Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gtkeditable.h
Go to the documentation of this file.
1/* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/*
19 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
20 * file for a list of people on the GTK+ Team. See the ChangeLog
21 * files for a list of changes. These files are distributed with
22 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23 */
24
25#pragma once
26
27
28#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
29#error "Only <gtk/gtk.h> can be included directly."
30#endif
31
32#include <gtk/gtkaccessible.h>
33#include <gtk/gtkwidget.h>
34
36
37#define GTK_TYPE_EDITABLE (gtk_editable_get_type ())
38#define GTK_EDITABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_EDITABLE, GtkEditable))
39#define GTK_IS_EDITABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_EDITABLE))
40#define GTK_EDITABLE_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GTK_TYPE_EDITABLE, GtkEditableInterface))
41
42typedef struct _GtkEditable GtkEditable; /* Dummy typedef */
44
46{
48
49 /* signals */
50 void (* insert_text) (GtkEditable *editable,
51 const char *text,
52 int length,
53 int *position);
54 void (* delete_text) (GtkEditable *editable,
55 int start_pos,
56 int end_pos);
57 void (* changed) (GtkEditable *editable);
58
59 /* vtable */
60 const char * (* get_text) (GtkEditable *editable);
61 void (* do_insert_text) (GtkEditable *editable,
62 const char *text,
63 int length,
64 int *position);
65 void (* do_delete_text) (GtkEditable *editable,
66 int start_pos,
67 int end_pos);
68
70 int *start_pos,
71 int *end_pos);
72 void (* set_selection_bounds) (GtkEditable *editable,
73 int start_pos,
74 int end_pos);
75 GtkEditable * (* get_delegate) (GtkEditable *editable);
76};
77
80
82const char * gtk_editable_get_text (GtkEditable *editable);
85 const char *text);
88 int start_pos,
89 int end_pos) G_GNUC_MALLOC;
92 const char *text,
93 int length,
94 int *position);
97 int start_pos,
98 int end_pos);
99
102 int *start_pos,
103 int *end_pos);
108 int start_pos,
109 int end_pos);
110
113 int position);
116
121 gboolean is_editable);
122
127 float xalign);
128
133 int n_chars);
134
139 int n_chars);
144 gboolean enable_undo);
145
146/* api for implementations */
147
148/**
149 * GtkEditableProperties:
150 * @GTK_EDITABLE_PROP_TEXT: the property id for [property@Gtk.Editable:text]
151 * @GTK_EDITABLE_PROP_CURSOR_POSITION: the property id for [property@Gtk.Editable:cursor-position]
152 * @GTK_EDITABLE_PROP_SELECTION_BOUND: the property id for [property@Gtk.Editable:selection-bound]
153 * @GTK_EDITABLE_PROP_EDITABLE: the property id for [property@Gtk.Editable:editable]
154 * @GTK_EDITABLE_PROP_WIDTH_CHARS: the property id for [property@Gtk.Editable:width-chars]
155 * @GTK_EDITABLE_PROP_MAX_WIDTH_CHARS: the property id for [property@Gtk.Editable:max-width-chars]
156 * @GTK_EDITABLE_PROP_XALIGN: the property id for [property@Gtk.Editable:xalign]
157 * @GTK_EDITABLE_PROP_ENABLE_UNDO: the property id for [property@Gtk.Editable:enable-undo]
158 * @GTK_EDITABLE_NUM_PROPERTIES: the number of properties
159 *
160 * The identifiers for [iface@Gtk.Editable] properties.
161 *
162 * See [func@Gtk.Editable.install_properties] for details on how to
163 * implement the `GtkEditable` interface.
164 */
176
179 guint first_prop);
188 guint prop_id,
189 const GValue *value,
190 GParamSpec *pspec);
193 guint prop_id,
194 GValue *value,
195 GParamSpec *pspec);
199
201
203
#define GDK_AVAILABLE_IN_4_10
#define GDK_AVAILABLE_IN_ALL
#define G_GNUC_MALLOC
Definition gmacros.h:293
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
#define G_GNUC_CONST
Definition gmacros.h:637
#define G_DEFINE_AUTOPTR_CLEANUP_FUNC(TypeName, func)
Definition gmacros.h:1400
GOBJECT_AVAILABLE_IN_ALL void g_object_unref(gpointer object)
GtkAccessiblePlatformState
GDK_AVAILABLE_IN_ALL void gtk_editable_set_max_width_chars(GtkEditable *editable, int n_chars)
GDK_AVAILABLE_IN_ALL float gtk_editable_get_alignment(GtkEditable *editable)
GDK_AVAILABLE_IN_ALL void gtk_editable_set_enable_undo(GtkEditable *editable, gboolean enable_undo)
GDK_AVAILABLE_IN_ALL gboolean gtk_editable_delegate_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
GDK_AVAILABLE_IN_ALL void gtk_editable_init_delegate(GtkEditable *editable)
GDK_AVAILABLE_IN_ALL void gtk_editable_delete_text(GtkEditable *editable, int start_pos, int end_pos)
GDK_AVAILABLE_IN_ALL void gtk_editable_insert_text(GtkEditable *editable, const char *text, int length, int *position)
GDK_AVAILABLE_IN_ALL gboolean gtk_editable_get_enable_undo(GtkEditable *editable)
GDK_AVAILABLE_IN_ALL void gtk_editable_delete_selection(GtkEditable *editable)
GDK_AVAILABLE_IN_ALL void gtk_editable_set_text(GtkEditable *editable, const char *text)
GDK_AVAILABLE_IN_ALL gboolean gtk_editable_get_selection_bounds(GtkEditable *editable, int *start_pos, int *end_pos)
GDK_AVAILABLE_IN_ALL void gtk_editable_select_region(GtkEditable *editable, int start_pos, int end_pos)
GDK_AVAILABLE_IN_ALL void gtk_editable_set_editable(GtkEditable *editable, gboolean is_editable)
GDK_AVAILABLE_IN_ALL void gtk_editable_set_position(GtkEditable *editable, int position)
GDK_AVAILABLE_IN_ALL char * gtk_editable_get_chars(GtkEditable *editable, int start_pos, int end_pos) G_GNUC_MALLOC
GDK_AVAILABLE_IN_ALL const char * gtk_editable_get_text(GtkEditable *editable)
GDK_AVAILABLE_IN_ALL GtkEditable * gtk_editable_get_delegate(GtkEditable *editable)
GDK_AVAILABLE_IN_ALL GType gtk_editable_get_type(void) G_GNUC_CONST
GDK_AVAILABLE_IN_ALL int gtk_editable_get_max_width_chars(GtkEditable *editable)
GDK_AVAILABLE_IN_ALL void gtk_editable_set_alignment(GtkEditable *editable, float xalign)
GDK_AVAILABLE_IN_ALL void gtk_editable_finish_delegate(GtkEditable *editable)
GDK_AVAILABLE_IN_ALL gboolean gtk_editable_get_editable(GtkEditable *editable)
GDK_AVAILABLE_IN_ALL void gtk_editable_set_width_chars(GtkEditable *editable, int n_chars)
struct _GtkEditable GtkEditable
Definition gtkeditable.h:42
GDK_AVAILABLE_IN_ALL int gtk_editable_get_position(GtkEditable *editable)
GtkEditableProperties
@ GTK_EDITABLE_NUM_PROPERTIES
@ GTK_EDITABLE_PROP_EDITABLE
@ GTK_EDITABLE_PROP_MAX_WIDTH_CHARS
@ GTK_EDITABLE_PROP_ENABLE_UNDO
@ GTK_EDITABLE_PROP_CURSOR_POSITION
@ GTK_EDITABLE_PROP_WIDTH_CHARS
@ GTK_EDITABLE_PROP_XALIGN
@ GTK_EDITABLE_PROP_SELECTION_BOUND
@ GTK_EDITABLE_PROP_TEXT
GDK_AVAILABLE_IN_4_10 gboolean gtk_editable_delegate_get_accessible_platform_state(GtkEditable *editable, GtkAccessiblePlatformState state)
GDK_AVAILABLE_IN_ALL gboolean gtk_editable_delegate_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
GDK_AVAILABLE_IN_ALL int gtk_editable_get_width_chars(GtkEditable *editable)
GDK_AVAILABLE_IN_ALL guint gtk_editable_install_properties(GObjectClass *object_class, guint first_prop)
gsize GType
Definition gtype.h:427
gint gboolean
Definition gtypes.h:56
unsigned int guint
Definition gtypes.h:61
int value
Definition lsqlite3.c:2155
void(* do_delete_text)(GtkEditable *editable, int start_pos, int end_pos)
Definition gtkeditable.h:65
GTypeInterface base_iface
Definition gtkeditable.h:47
void(* do_insert_text)(GtkEditable *editable, const char *text, int length, int *position)
Definition gtkeditable.h:61
void(* changed)(GtkEditable *editable)
Definition gtkeditable.h:57
void(* set_selection_bounds)(GtkEditable *editable, int start_pos, int end_pos)
Definition gtkeditable.h:72
void(* delete_text)(GtkEditable *editable, int start_pos, int end_pos)
Definition gtkeditable.h:54
void(* insert_text)(GtkEditable *editable, const char *text, int length, int *position)
Definition gtkeditable.h:50
gboolean(* get_selection_bounds)(GtkEditable *editable, int *start_pos, int *end_pos)
Definition gtkeditable.h:69