Ardour  9.0-pre0-582-g084a23a80d
gtkentry.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  * Copyright (C) 2004-2006 Christian Hammond
5  * Copyright (C) 2008 Cody Russell
6  * Copyright (C) 2008 Red Hat, Inc.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
24 /*
25  * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
26  * file for a list of people on the GTK+ Team. See the ChangeLog
27  * files for a list of changes. These files are distributed with
28  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
29  */
30 
31 #ifndef __GTK_ENTRY_H__
32 #define __GTK_ENTRY_H__
33 
34 
35 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
36 #error "Only <gtk/gtk.h> can be included directly."
37 #endif
38 
39 #include <gtk/gtkeditable.h>
40 #include <gtk/gtkimcontext.h>
41 #include <gtk/gtkmenu.h>
42 #include <gtk/gtkentrybuffer.h>
43 #include <gtk/gtkentrycompletion.h>
44 #include <gtk/gtkimage.h>
45 #include <gtk/gtkselection.h>
46 
47 
48 G_BEGIN_DECLS
49 
50 #define GTK_TYPE_ENTRY (gtk_entry_get_type ())
51 #define GTK_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ENTRY, GtkEntry))
52 #define GTK_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ENTRY, GtkEntryClass))
53 #define GTK_IS_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ENTRY))
54 #define GTK_IS_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ENTRY))
55 #define GTK_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ENTRY, GtkEntryClass))
56 
57 typedef enum
58 {
62 
63 typedef struct _GtkEntry GtkEntry;
64 typedef struct _GtkEntryClass GtkEntryClass;
65 
66 struct _GtkEntry
67 {
69 
70  gchar *GSEAL (text); /* COMPAT: Deprecated, not used. Remove in GTK+ 3.x */
71 
72  guint GSEAL (editable) : 1;
73  guint GSEAL (visible) : 1;
74  guint GSEAL (overwrite_mode) : 1;
75  guint GSEAL (in_drag) : 1; /* FIXME: Should be private?
76  Dragging within the selection */
77 
78  guint16 GSEAL (text_length); /* COMPAT: Deprecated, not used. Remove in GTK+ 3.x */
79  guint16 GSEAL (text_max_length); /* COMPAT: Deprecated, not used. Remove in GTK+ 3.x */
80 
81  /*< private >*/
82  GdkWindow *GSEAL (text_area);
83  GtkIMContext *GSEAL (im_context);
84  GtkWidget *GSEAL (popup_menu);
85 
86  gint GSEAL (current_pos);
87  gint GSEAL (selection_bound);
88 
89  PangoLayout *GSEAL (cached_layout);
90 
91  guint GSEAL (cache_includes_preedit) : 1;
92  guint GSEAL (need_im_reset) : 1;
93  guint GSEAL (has_frame) : 1;
94  guint GSEAL (activates_default) : 1;
95  guint GSEAL (cursor_visible) : 1;
96  guint GSEAL (in_click) : 1; /* Flag so we don't select all when clicking in entry to focus in */
97  guint GSEAL (is_cell_renderer) : 1;
98  guint GSEAL (editing_canceled) : 1; /* Only used by GtkCellRendererText */
99  guint GSEAL (mouse_cursor_obscured) : 1;
100  guint GSEAL (select_words) : 1;
101  guint GSEAL (select_lines) : 1;
102  guint GSEAL (resolved_dir) : 4; /* PangoDirection */
103  guint GSEAL (truncate_multiline) : 1;
104 
105  guint GSEAL (button);
106  guint GSEAL (blink_timeout);
107  guint GSEAL (recompute_idle);
108  gint GSEAL (scroll_offset);
109  gint GSEAL (ascent); /* font ascent in pango units */
110  gint GSEAL (descent); /* font descent in pango units */
111 
112  guint16 GSEAL (x_text_size); /* allocated size, in bytes */
113  guint16 GSEAL (x_n_bytes); /* length in use, in bytes */
114 
115  guint16 GSEAL (preedit_length); /* length of preedit string, in bytes */
116  guint16 GSEAL (preedit_cursor); /* offset of cursor within preedit string, in chars */
117 
118  gint GSEAL (dnd_position); /* In chars, -1 == no DND cursor */
119 
120  gint GSEAL (drag_start_x);
121  gint GSEAL (drag_start_y);
122 
123  gunichar GSEAL (invisible_char);
124 
125  gint GSEAL (width_chars);
126 };
127 
129 {
131 
132  /* Hook to customize right-click popup */
133  void (* populate_popup) (GtkEntry *entry,
134  GtkMenu *menu);
135 
136  /* Action signals
137  */
138  void (* activate) (GtkEntry *entry);
139  void (* move_cursor) (GtkEntry *entry,
140  GtkMovementStep step,
141  gint count,
142  gboolean extend_selection);
143  void (* insert_at_cursor) (GtkEntry *entry,
144  const gchar *str);
145  void (* delete_from_cursor) (GtkEntry *entry,
146  GtkDeleteType type,
147  gint count);
148  void (* backspace) (GtkEntry *entry);
149  void (* cut_clipboard) (GtkEntry *entry);
150  void (* copy_clipboard) (GtkEntry *entry);
151  void (* paste_clipboard) (GtkEntry *entry);
152  void (* toggle_overwrite) (GtkEntry *entry);
153 
154  /* hook to add other objects beside the entry (like in GtkSpinButton) */
155  void (* get_text_area_size) (GtkEntry *entry,
156  gint *x,
157  gint *y,
158  gint *width,
159  gint *height);
160 
161  /* Padding for future expansion */
162  void (*_gtk_reserved1) (void);
163  void (*_gtk_reserved2) (void);
164 };
165 
166 GType gtk_entry_get_type (void) G_GNUC_CONST;
169 
172  GtkEntryBuffer *buffer);
173 
175 
177  gboolean visible);
179 
181  gunichar ch);
184 
186  gboolean setting);
188 
190  const GtkBorder *border);
192 
194  gboolean overwrite);
196 
197 /* text is truncated if needed */
199  gint max);
202 
204  gboolean setting);
206 
208  gint n_chars);
210 
211 /* Somewhat more convenient than the GtkEditable generic functions
212  */
214  const gchar *text);
215 /* returns a reference to the text */
216 const gchar* gtk_entry_get_text (GtkEntry *entry);
217 
218 PangoLayout* gtk_entry_get_layout (GtkEntry *entry);
220  gint *x,
221  gint *y);
223  gfloat xalign);
225 
227  GtkEntryCompletion *completion);
229 
231  gint layout_index);
233  gint text_index);
234 
235 /* For scrolling cursor appropriately
236  */
238  GtkAdjustment *adjustment);
240 
241 /* Progress API
242  */
244  gdouble fraction);
246 
248  gdouble fraction);
250 
252 
253 /* Setting and managing icons
254  */
256  GtkEntryIconPosition icon_pos,
257  GdkPixbuf *pixbuf);
259  GtkEntryIconPosition icon_pos,
260  const gchar *stock_id);
262  GtkEntryIconPosition icon_pos,
263  const gchar *icon_name);
265  GtkEntryIconPosition icon_pos,
266  GIcon *icon);
268  GtkEntryIconPosition icon_pos);
270  GtkEntryIconPosition icon_pos);
271 const gchar* gtk_entry_get_icon_stock (GtkEntry *entry,
272  GtkEntryIconPosition icon_pos);
273 const gchar* gtk_entry_get_icon_name (GtkEntry *entry,
274  GtkEntryIconPosition icon_pos);
276  GtkEntryIconPosition icon_pos);
278  GtkEntryIconPosition icon_pos,
279  gboolean activatable);
281  GtkEntryIconPosition icon_pos);
283  GtkEntryIconPosition icon_pos,
284  gboolean sensitive);
286  GtkEntryIconPosition icon_pos);
288  gint x,
289  gint y);
291  GtkEntryIconPosition icon_pos,
292  const gchar *tooltip);
294  GtkEntryIconPosition icon_pos);
296  GtkEntryIconPosition icon_pos,
297  const gchar *tooltip);
299  GtkEntryIconPosition icon_pos);
301  GtkEntryIconPosition icon_pos,
302  GtkTargetList *target_list,
303  GdkDragAction actions);
305 
307  GtkEntryIconPosition icon_pos);
308 
310  GdkEventKey *event);
312 
313 
314 /* Deprecated compatibility functions
315  */
316 
317 #ifndef GTK_DISABLE_DEPRECATED
320  const gchar *text);
322  const gchar *text);
324  gint position);
326  gint start,
327  gint end);
329  gboolean editable);
330 #endif /* GTK_DISABLE_DEPRECATED */
331 
332 G_END_DECLS
333 
334 #endif /* __GTK_ENTRY_H__ */
GdkDragAction
Definition: gdkdnd.h:41
GtkWidget * gtk_entry_new(void)
GtkEntryIconPosition
Definition: gtkentry.h:58
@ GTK_ENTRY_ICON_PRIMARY
Definition: gtkentry.h:59
@ GTK_ENTRY_ICON_SECONDARY
Definition: gtkentry.h:60
void gtk_entry_set_progress_pulse_step(GtkEntry *entry, gdouble fraction)
gboolean gtk_entry_get_has_frame(GtkEntry *entry)
GtkEntryCompletion * gtk_entry_get_completion(GtkEntry *entry)
void gtk_entry_set_completion(GtkEntry *entry, GtkEntryCompletion *completion)
guint16 gtk_entry_get_text_length(GtkEntry *entry)
GdkPixbuf * gtk_entry_get_icon_pixbuf(GtkEntry *entry, GtkEntryIconPosition icon_pos)
void gtk_entry_unset_invisible_char(GtkEntry *entry)
GtkImageType gtk_entry_get_icon_storage_type(GtkEntry *entry, GtkEntryIconPosition icon_pos)
void gtk_entry_set_icon_from_pixbuf(GtkEntry *entry, GtkEntryIconPosition icon_pos, GdkPixbuf *pixbuf)
GtkWidget * gtk_entry_new_with_buffer(GtkEntryBuffer *buffer)
GdkWindow * gtk_entry_get_text_window(GtkEntry *entry)
void gtk_entry_set_overwrite_mode(GtkEntry *entry, gboolean overwrite)
void gtk_entry_set_icon_tooltip_text(GtkEntry *entry, GtkEntryIconPosition icon_pos, const gchar *tooltip)
gint gtk_entry_text_index_to_layout_index(GtkEntry *entry, gint text_index)
void gtk_entry_set_editable(GtkEntry *entry, gboolean editable)
void gtk_entry_set_width_chars(GtkEntry *entry, gint n_chars)
GdkWindow * gtk_entry_get_icon_window(GtkEntry *entry, GtkEntryIconPosition icon_pos)
void gtk_entry_set_has_frame(GtkEntry *entry, gboolean setting)
gboolean gtk_entry_get_overwrite_mode(GtkEntry *entry)
gchar * gtk_entry_get_icon_tooltip_text(GtkEntry *entry, GtkEntryIconPosition icon_pos)
void gtk_entry_set_icon_from_gicon(GtkEntry *entry, GtkEntryIconPosition icon_pos, GIcon *icon)
void gtk_entry_prepend_text(GtkEntry *entry, const gchar *text)
const GtkBorder * gtk_entry_get_inner_border(GtkEntry *entry)
gboolean gtk_entry_im_context_filter_keypress(GtkEntry *entry, GdkEventKey *event)
GtkWidget * gtk_entry_new_with_max_length(gint max)
const gchar * gtk_entry_get_text(GtkEntry *entry)
gchar * gtk_entry_get_icon_tooltip_markup(GtkEntry *entry, GtkEntryIconPosition icon_pos)
void gtk_entry_append_text(GtkEntry *entry, const gchar *text)
GtkEntryBuffer * gtk_entry_get_buffer(GtkEntry *entry)
void gtk_entry_select_region(GtkEntry *entry, gint start, gint end)
void gtk_entry_set_inner_border(GtkEntry *entry, const GtkBorder *border)
gdouble gtk_entry_get_progress_fraction(GtkEntry *entry)
void gtk_entry_reset_im_context(GtkEntry *entry)
void gtk_entry_set_icon_drag_source(GtkEntry *entry, GtkEntryIconPosition icon_pos, GtkTargetList *target_list, GdkDragAction actions)
void gtk_entry_set_progress_fraction(GtkEntry *entry, gdouble fraction)
GType gtk_entry_get_type(void) G_GNUC_CONST
void gtk_entry_set_icon_sensitive(GtkEntry *entry, GtkEntryIconPosition icon_pos, gboolean sensitive)
gboolean gtk_entry_get_icon_activatable(GtkEntry *entry, GtkEntryIconPosition icon_pos)
void gtk_entry_set_cursor_hadjustment(GtkEntry *entry, GtkAdjustment *adjustment)
gboolean gtk_entry_get_visibility(GtkEntry *entry)
void gtk_entry_set_icon_from_icon_name(GtkEntry *entry, GtkEntryIconPosition icon_pos, const gchar *icon_name)
gint gtk_entry_get_icon_at_pos(GtkEntry *entry, gint x, gint y)
GtkAdjustment * gtk_entry_get_cursor_hadjustment(GtkEntry *entry)
gboolean gtk_entry_get_icon_sensitive(GtkEntry *entry, GtkEntryIconPosition icon_pos)
void gtk_entry_set_position(GtkEntry *entry, gint position)
void gtk_entry_set_alignment(GtkEntry *entry, gfloat xalign)
void gtk_entry_get_layout_offsets(GtkEntry *entry, gint *x, gint *y)
void gtk_entry_set_icon_from_stock(GtkEntry *entry, GtkEntryIconPosition icon_pos, const gchar *stock_id)
void gtk_entry_set_visibility(GtkEntry *entry, gboolean visible)
PangoLayout * gtk_entry_get_layout(GtkEntry *entry)
gint gtk_entry_get_width_chars(GtkEntry *entry)
gint gtk_entry_get_current_icon_drag_source(GtkEntry *entry)
gunichar gtk_entry_get_invisible_char(GtkEntry *entry)
void gtk_entry_progress_pulse(GtkEntry *entry)
gdouble gtk_entry_get_progress_pulse_step(GtkEntry *entry)
void gtk_entry_set_activates_default(GtkEntry *entry, gboolean setting)
gfloat gtk_entry_get_alignment(GtkEntry *entry)
GIcon * gtk_entry_get_icon_gicon(GtkEntry *entry, GtkEntryIconPosition icon_pos)
void gtk_entry_set_icon_tooltip_markup(GtkEntry *entry, GtkEntryIconPosition icon_pos, const gchar *tooltip)
void gtk_entry_set_max_length(GtkEntry *entry, gint max)
void gtk_entry_set_buffer(GtkEntry *entry, GtkEntryBuffer *buffer)
void gtk_entry_set_invisible_char(GtkEntry *entry, gunichar ch)
void gtk_entry_set_icon_activatable(GtkEntry *entry, GtkEntryIconPosition icon_pos, gboolean activatable)
gboolean gtk_entry_get_activates_default(GtkEntry *entry)
gint gtk_entry_get_max_length(GtkEntry *entry)
gint gtk_entry_layout_index_to_text_index(GtkEntry *entry, gint layout_index)
const gchar * gtk_entry_get_icon_stock(GtkEntry *entry, GtkEntryIconPosition icon_pos)
void gtk_entry_set_text(GtkEntry *entry, const gchar *text)
const gchar * gtk_entry_get_icon_name(GtkEntry *entry, GtkEntryIconPosition icon_pos)
GtkDeleteType
Definition: gtkenums.h:108
GtkMovementStep
Definition: gtkenums.h:238
GtkImageType
Definition: gtkimage.h:130
GtkImagePixbufData pixbuf
Definition: gtkimage.h:2
typedefG_BEGIN_DECLS struct _GtkTargetList GtkTargetList
Definition: gtkselection.h:41
PBD::PropertyDescriptor< timepos_t > start
void(* move_cursor)(GtkEntry *entry, GtkMovementStep step, gint count, gboolean extend_selection)
Definition: gtkentry.h:139
GtkWidgetClass parent_class
Definition: gtkentry.h:130
void(* copy_clipboard)(GtkEntry *entry)
Definition: gtkentry.h:150
void(* _gtk_reserved2)(void)
Definition: gtkentry.h:163
void(* paste_clipboard)(GtkEntry *entry)
Definition: gtkentry.h:151
void(* backspace)(GtkEntry *entry)
Definition: gtkentry.h:148
void(* populate_popup)(GtkEntry *entry, GtkMenu *menu)
Definition: gtkentry.h:133
void(* delete_from_cursor)(GtkEntry *entry, GtkDeleteType type, gint count)
Definition: gtkentry.h:145
void(* insert_at_cursor)(GtkEntry *entry, const gchar *str)
Definition: gtkentry.h:143
void(* _gtk_reserved1)(void)
Definition: gtkentry.h:162
void(* toggle_overwrite)(GtkEntry *entry)
Definition: gtkentry.h:152
void(* cut_clipboard)(GtkEntry *entry)
Definition: gtkentry.h:149
void(* get_text_area_size)(GtkEntry *entry, gint *x, gint *y, gint *width, gint *height)
Definition: gtkentry.h:155
void(* activate)(GtkEntry *entry)
Definition: gtkentry.h:138
GdkWindow * GSEAL(text_area)
gint GSEAL(selection_bound)
gint GSEAL(drag_start_y)
PangoLayout * GSEAL(cached_layout)
guint16 GSEAL(x_n_bytes)
guint16 GSEAL(text_max_length)
gint GSEAL(current_pos)
gint GSEAL(scroll_offset)
GtkWidget * GSEAL(popup_menu)
gchar * GSEAL(text)
gint GSEAL(ascent)
gint GSEAL(descent)
gunichar GSEAL(invisible_char)
guint GSEAL(blink_timeout)
GtkWidget widget
Definition: gtkentry.h:68
gint GSEAL(dnd_position)
guint16 GSEAL(preedit_length)
gint GSEAL(width_chars)
guint16 GSEAL(preedit_cursor)
GtkIMContext * GSEAL(im_context)
gint GSEAL(drag_start_x)
guint16 GSEAL(x_text_size)
guint GSEAL(recompute_idle)
guint GSEAL(editable) guint GSEAL(visible) guint GSEAL(overwrite_mode) guint GSEAL(in_drag) guint16 GSEAL(text_length)
guint GSEAL(cache_includes_preedit) guint GSEAL(need_im_reset) guint GSEAL(has_frame) guint GSEAL(activates_default) guint GSEAL(cursor_visible) guint GSEAL(in_click) guint GSEAL(is_cell_renderer) guint GSEAL(editing_canceled) guint GSEAL(mouse_cursor_obscured) guint GSEAL(select_words) guint GSEAL(select_lines) guint GSEAL(resolved_dir) guint GSEAL(truncate_multiline) guint GSEAL(button)
gint height
Definition: xcursors.h:1
gint width
Definition: xcursors.h:1