]> Pileus Git - ~andy/gtk/blob - gtk/gtkwidget.h
removed all occourances of #pragma } and #pragma { which were in place to
[~andy/gtk] / gtk / gtkwidget.h
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 Library 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  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19 #ifndef __GTK_WIDGET_H__
20 #define __GTK_WIDGET_H__
21
22
23 #include <gdk/gdk.h>
24 #include <gtk/gtkaccelgroup.h>
25 #include <gtk/gtkobject.h>
26 #include <gtk/gtkstyle.h>
27
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif /* __cplusplus */
32
33
34 /* The flags that are used by GtkWidget on top of the
35  * flags field of GtkObject.
36  */
37 typedef enum
38 {
39   GTK_TOPLEVEL         = 1 << 4,
40   GTK_NO_WINDOW        = 1 << 5,
41   GTK_REALIZED         = 1 << 6,
42   GTK_MAPPED           = 1 << 7,
43   GTK_VISIBLE          = 1 << 8,
44   GTK_SENSITIVE        = 1 << 9,
45   GTK_PARENT_SENSITIVE = 1 << 10,
46   GTK_CAN_FOCUS        = 1 << 11,
47   GTK_HAS_FOCUS        = 1 << 12,
48   GTK_CAN_DEFAULT      = 1 << 13,
49   GTK_HAS_DEFAULT      = 1 << 14,
50   GTK_HAS_GRAB         = 1 << 15,
51   GTK_RC_STYLE         = 1 << 16,
52   GTK_COMPOSITE_CHILD  = 1 << 17,
53   GTK_BASIC            = 1 << 18
54 } GtkWidgetFlags;
55
56 /* Macro for casting a pointer to a GtkWidget or GtkWidgetClass pointer.
57  * Macros for testing whether `widget' or `klass' are of type GTK_TYPE_WIDGET.
58  */
59 #define GTK_TYPE_WIDGET                   (gtk_widget_get_type ())
60 #define GTK_WIDGET(widget)                (GTK_CHECK_CAST ((widget), GTK_TYPE_WIDGET, GtkWidget))
61 #define GTK_WIDGET_CLASS(klass)           (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_WIDGET, GtkWidgetClass))
62 #define GTK_IS_WIDGET(widget)             (GTK_CHECK_TYPE ((widget), GTK_TYPE_WIDGET))
63 #define GTK_IS_WIDGET_CLASS(klass)        (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WIDGET))
64
65 /* Macros for extracting various fields from GtkWidget and GtkWidgetClass.
66  */
67 #define GTK_WIDGET_TYPE(wid)              (GTK_OBJECT_TYPE (wid))
68 #define GTK_WIDGET_STATE(wid)             (GTK_WIDGET (wid)->state)
69 #define GTK_WIDGET_SAVED_STATE(wid)       (GTK_WIDGET (wid)->saved_state)
70
71 /* Macros for extracting the widget flags from GtkWidget.
72  */
73 #define GTK_WIDGET_FLAGS(wid)             (GTK_OBJECT_FLAGS (wid))
74 #define GTK_WIDGET_TOPLEVEL(wid)          ((GTK_WIDGET_FLAGS (wid) & GTK_TOPLEVEL) != 0)
75 #define GTK_WIDGET_NO_WINDOW(wid)         ((GTK_WIDGET_FLAGS (wid) & GTK_NO_WINDOW) != 0)
76 #define GTK_WIDGET_REALIZED(wid)          ((GTK_WIDGET_FLAGS (wid) & GTK_REALIZED) != 0)
77 #define GTK_WIDGET_MAPPED(wid)            ((GTK_WIDGET_FLAGS (wid) & GTK_MAPPED) != 0)
78 #define GTK_WIDGET_VISIBLE(wid)           ((GTK_WIDGET_FLAGS (wid) & GTK_VISIBLE) != 0)
79 #define GTK_WIDGET_DRAWABLE(wid)          ((GTK_WIDGET_VISIBLE (wid) && GTK_WIDGET_MAPPED (wid)) != 0)
80 #define GTK_WIDGET_SENSITIVE(wid)         ((GTK_WIDGET_FLAGS (wid) & GTK_SENSITIVE) != 0)
81 #define GTK_WIDGET_PARENT_SENSITIVE(wid)  ((GTK_WIDGET_FLAGS (wid) & GTK_PARENT_SENSITIVE) != 0)
82 #define GTK_WIDGET_IS_SENSITIVE(wid)      (((GTK_WIDGET_SENSITIVE (wid) && \
83                                             GTK_WIDGET_PARENT_SENSITIVE (wid)) != 0) != 0)
84 #define GTK_WIDGET_CAN_FOCUS(wid)         ((GTK_WIDGET_FLAGS (wid) & GTK_CAN_FOCUS) != 0)
85 #define GTK_WIDGET_HAS_FOCUS(wid)         ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_FOCUS) != 0)
86 #define GTK_WIDGET_CAN_DEFAULT(wid)       ((GTK_WIDGET_FLAGS (wid) & GTK_CAN_DEFAULT) != 0)
87 #define GTK_WIDGET_HAS_DEFAULT(wid)       ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_DEFAULT) != 0)
88 #define GTK_WIDGET_HAS_GRAB(wid)          ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_GRAB) != 0)
89 #define GTK_WIDGET_RC_STYLE(wid)          ((GTK_WIDGET_FLAGS (wid) & GTK_RC_STYLE) != 0)
90 #define GTK_WIDGET_COMPOSITE_CHILD(wid)   ((GTK_WIDGET_FLAGS (wid) & GTK_COMPOSITE_CHILD) != 0)
91 #define GTK_WIDGET_BASIC(wid)             ((GTK_WIDGET_FLAGS (wid) & GTK_BASIC) != 0)
92   
93 /* Macros for setting and clearing widget flags.
94  */
95 #define GTK_WIDGET_SET_FLAGS(wid,flag)    G_STMT_START{ (GTK_WIDGET_FLAGS (wid) |= (flag)); }G_STMT_END
96 #define GTK_WIDGET_UNSET_FLAGS(wid,flag)  G_STMT_START{ (GTK_WIDGET_FLAGS (wid) &= ~(flag)); }G_STMT_END
97   
98   
99   
100 typedef struct _GtkRequisition    GtkRequisition;
101 typedef struct _GtkAllocation     GtkAllocation;
102 typedef struct _GtkSelectionData GtkSelectionData;
103 typedef struct _GtkWidget         GtkWidget;
104 typedef struct _GtkWidgetClass    GtkWidgetClass;
105 typedef struct _GtkWidgetAuxInfo  GtkWidgetAuxInfo;
106 typedef struct _GtkWidgetShapeInfo GtkWidgetShapeInfo;
107
108 typedef void (*GtkCallback) (GtkWidget *widget,
109                              gpointer   data);
110
111 /* A requisition is a desired amount of space which a
112  *  widget may request.
113  */
114 struct _GtkRequisition
115 {
116   guint16 width;
117   guint16 height;
118 };
119
120 /* An allocation is a size and position. Where a widget
121  *  can ask for a desired size, it is actually given
122  *  this amount of space at the specified position.
123  */
124 struct _GtkAllocation
125 {
126   gint16 x;
127   gint16 y;
128   guint16 width;
129   guint16 height;
130 };
131
132 /* The contents of a selection are returned in a GtkSelectionData
133    structure. selection/target identify the request. 
134    type specifies the type of the return; if length < 0, and
135    the data should be ignored. This structure has object semantics -
136    no fields should be modified directly, they should not be created
137    directly, and pointers to them should not be stored beyond the duration of
138    a callback. (If the last is changed, we'll need to add reference
139    counting) */
140
141 struct _GtkSelectionData
142 {
143   GdkAtom selection;
144   GdkAtom target;
145   GdkAtom type;
146   gint    format;
147   guchar *data;
148   gint    length;
149 };
150
151 /* The widget is the base of the tree for displayable objects.
152  *  (A displayable object is one which takes up some amount
153  *  of screen real estate). It provides a common base and interface
154  *  which actual widgets must adhere to.
155  */
156 struct _GtkWidget
157 {
158   /* The object structure needs to be the first
159    *  element in the widget structure in order for
160    *  the object mechanism to work correctly. This
161    *  allows a GtkWidget pointer to be cast to a
162    *  GtkObject pointer.
163    */
164   GtkObject object;
165   
166   /* 16 bits of internally used private flags.
167    * this will be packed into the same 4 byte alignment frame that
168    * state and saved_state go. we therefore don't waste any new
169    * space on this.
170    */
171   guint16 private_flags;
172   
173   /* The state of the widget. There are actually only
174    *  5 widget states (defined in "gtkenums.h").
175    */
176   guint8 state;
177   
178   /* The saved state of the widget. When a widgets state
179    *  is changed to GTK_STATE_INSENSITIVE via
180    *  "gtk_widget_set_state" or "gtk_widget_set_sensitive"
181    *  the old state is kept around in this field. The state
182    *  will be restored once the widget gets sensitive again.
183    */
184   guint8 saved_state;
185   
186   /* The widgets name. If the widget does not have a name
187    *  (the name is NULL), then its name (as returned by
188    *  "gtk_widget_get_name") is its classes name.
189    * Among other things, the widget name is used to determine
190    *  the style to use for a widget.
191    */
192   gchar *name;
193   
194   /* The style for the widget. The style contains the
195    *  colors the widget should be drawn in for each state
196    *  along with graphics contexts used to draw with and
197    *  the font to use for text.
198    */
199   GtkStyle *style;
200   
201   /* The widgets desired size.
202    */
203   GtkRequisition requisition;
204   
205   /* The widgets allocated size.
206    */
207   GtkAllocation allocation;
208   
209   /* The widgets window or its parent window if it does
210    *  not have a window. (Which will be indicated by the
211    *  GTK_NO_WINDOW flag being set).
212    */
213   GdkWindow *window;
214   
215   /* The widgets parent.
216    */
217   GtkWidget *parent;
218 };
219
220 struct _GtkWidgetClass
221 {
222   /* The object class structure needs to be the first
223    *  element in the widget class structure in order for
224    *  the class mechanism to work correctly. This allows a
225    *  GtkWidgetClass pointer to be cast to a GtkObjectClass
226    *  pointer.
227    */
228   GtkObjectClass parent_class;
229   
230   /* The signal to emit when an object of this class is activated.
231    *  This is used when activating the current focus widget and
232    *  the default widget.
233    */
234   guint activate_signal;
235   
236   /* basics */
237   void (* show)                (GtkWidget      *widget);
238   void (* show_all)            (GtkWidget      *widget);
239   void (* hide)                (GtkWidget      *widget);
240   void (* hide_all)            (GtkWidget      *widget);
241   void (* map)                 (GtkWidget      *widget);
242   void (* unmap)               (GtkWidget      *widget);
243   void (* realize)             (GtkWidget      *widget);
244   void (* unrealize)           (GtkWidget      *widget);
245   void (* draw)                (GtkWidget      *widget,
246                                 GdkRectangle   *area);
247   void (* draw_focus)          (GtkWidget      *widget);
248   void (* draw_default)        (GtkWidget      *widget);
249   void (* size_request)        (GtkWidget      *widget,
250                                 GtkRequisition *requisition);
251   void (* size_allocate)       (GtkWidget      *widget,
252                                 GtkAllocation  *allocation);
253   void (* state_changed)       (GtkWidget      *widget,
254                                 GtkStateType    previous_state);
255   void (* parent_set)          (GtkWidget      *widget,
256                                 GtkWidget      *previous_parent);
257   void (* style_set)           (GtkWidget      *widget,
258                                 GtkStyle       *previous_style);
259   
260   /* accelerators */
261   gint (* add_accelerator)     (GtkWidget      *widget,
262                                 guint           accel_signal_id,
263                                 GtkAccelGroup  *accel_group,
264                                 guint           accel_key,
265                                 GdkModifierType accel_mods,
266                                 GtkAccelFlags   accel_flags);
267   void (* remove_accelerator)  (GtkWidget      *widget,
268                                 GtkAccelGroup  *accel_group,
269                                 guint           accel_key,
270                                 GdkModifierType accel_mods);
271   
272   /* events */
273   gint (* event)                   (GtkWidget          *widget,
274                                     GdkEvent           *event);
275   gint (* button_press_event)      (GtkWidget          *widget,
276                                     GdkEventButton     *event);
277   gint (* button_release_event)    (GtkWidget          *widget,
278                                     GdkEventButton     *event);
279   gint (* motion_notify_event)     (GtkWidget          *widget,
280                                     GdkEventMotion     *event);
281   gint (* delete_event)            (GtkWidget          *widget,
282                                     GdkEventAny        *event);
283   gint (* destroy_event)           (GtkWidget          *widget,
284                                     GdkEventAny        *event);
285   gint (* expose_event)            (GtkWidget          *widget,
286                                     GdkEventExpose     *event);
287   gint (* key_press_event)         (GtkWidget          *widget,
288                                     GdkEventKey        *event);
289   gint (* key_release_event)       (GtkWidget          *widget,
290                                     GdkEventKey        *event);
291   gint (* enter_notify_event)      (GtkWidget          *widget,
292                                     GdkEventCrossing   *event);
293   gint (* leave_notify_event)      (GtkWidget          *widget,
294                                     GdkEventCrossing   *event);
295   gint (* configure_event)         (GtkWidget          *widget,
296                                     GdkEventConfigure  *event);
297   gint (* focus_in_event)          (GtkWidget          *widget,
298                                     GdkEventFocus      *event);
299   gint (* focus_out_event)         (GtkWidget          *widget,
300                                     GdkEventFocus      *event);
301   gint (* map_event)               (GtkWidget          *widget,
302                                     GdkEventAny        *event);
303   gint (* unmap_event)             (GtkWidget          *widget,
304                                     GdkEventAny        *event);
305   gint (* property_notify_event)   (GtkWidget          *widget,
306                                     GdkEventProperty   *event);
307   gint (* selection_clear_event)   (GtkWidget          *widget,
308                                     GdkEventSelection  *event);
309   gint (* selection_request_event) (GtkWidget          *widget,
310                                     GdkEventSelection  *event);
311   gint (* selection_notify_event)  (GtkWidget          *widget,
312                                     GdkEventSelection  *event);
313   gint (* proximity_in_event)      (GtkWidget          *widget,
314                                     GdkEventProximity  *event);
315   gint (* proximity_out_event)     (GtkWidget          *widget,
316                                     GdkEventProximity  *event);
317   gint (* drag_begin_event)        (GtkWidget          *widget,
318                                     GdkEventDragBegin  *event);
319   gint (* drag_request_event)      (GtkWidget          *widget,
320                                     GdkEventDragRequest *event);
321   gint (* drag_end_event)          (GtkWidget          *widget,
322                                     GdkEvent           *event);
323   gint (* drop_enter_event)        (GtkWidget          *widget,
324                                     GdkEventDropEnter  *event);
325   gint (* drop_leave_event)        (GtkWidget          *widget,
326                                     GdkEventDropLeave  *event);
327   gint (* drop_data_available_event)(GtkWidget         *widget,
328                                      GdkEventDropDataAvailable *event);
329   gint (* visibility_notify_event)  (GtkWidget         *widget,
330                                      GdkEventVisibility *event);
331   gint (* client_event)            (GtkWidget          *widget,
332                                     GdkEventClient     *event);
333   gint (* no_expose_event)         (GtkWidget          *widget,
334                                     GdkEventAny        *event);
335   gint (* other_event)             (GtkWidget          *widget,
336                                     GdkEventOther      *event);
337   
338   /* selection */
339   void (* selection_received)      (GtkWidget          *widget,
340                                     GtkSelectionData   *selection_data);
341
342   /* action signals */
343   void (* debug_msg)               (GtkWidget          *widget,
344                                     const gchar        *string);
345 };
346
347 struct _GtkWidgetAuxInfo
348 {
349   gint16  x;
350   gint16  y;
351   gint16 width;
352   gint16 height;
353 };
354
355 struct _GtkWidgetShapeInfo
356 {
357   gint16     offset_x;
358   gint16     offset_y;
359   GdkBitmap *shape_mask;
360 };
361
362
363 GtkType    gtk_widget_get_type            (void);
364 GtkWidget* gtk_widget_new                 (GtkType              type,
365                                            const gchar         *first_arg_name,
366                                            ...);
367 GtkWidget* gtk_widget_newv                (GtkType              type,
368                                            guint                nargs,
369                                            GtkArg              *args);
370 void       gtk_widget_ref                 (GtkWidget           *widget);
371 void       gtk_widget_unref               (GtkWidget           *widget);
372 void       gtk_widget_destroy             (GtkWidget           *widget);
373 void       gtk_widget_destroyed           (GtkWidget           *widget,
374                                            GtkWidget          **widget_pointer);
375 void       gtk_widget_get                 (GtkWidget           *widget,
376                                            GtkArg              *arg);
377 void       gtk_widget_getv                (GtkWidget           *widget,
378                                            guint                nargs,
379                                            GtkArg              *args);
380 void       gtk_widget_set                 (GtkWidget           *widget,
381                                            const gchar         *first_arg_name,
382                                            ...);
383 void       gtk_widget_setv                (GtkWidget           *widget,
384                                            guint                nargs,
385                                            GtkArg              *args);
386 void       gtk_widget_unparent            (GtkWidget           *widget);
387 void       gtk_widget_show                (GtkWidget           *widget);
388 void       gtk_widget_show_now            (GtkWidget           *widget);
389 void       gtk_widget_hide                (GtkWidget           *widget);
390 void       gtk_widget_show_all            (GtkWidget           *widget);
391 void       gtk_widget_hide_all            (GtkWidget           *widget);
392 void       gtk_widget_map                 (GtkWidget           *widget);
393 void       gtk_widget_unmap               (GtkWidget           *widget);
394 void       gtk_widget_realize             (GtkWidget           *widget);
395 void       gtk_widget_unrealize           (GtkWidget           *widget);
396 void       gtk_widget_queue_draw          (GtkWidget           *widget);
397 void       gtk_widget_queue_resize        (GtkWidget           *widget);
398 void       gtk_widget_draw                (GtkWidget           *widget,
399                                            GdkRectangle        *area);
400 void       gtk_widget_draw_focus          (GtkWidget           *widget);
401 void       gtk_widget_draw_default        (GtkWidget           *widget);
402 void       gtk_widget_draw_children       (GtkWidget           *widget);
403 void       gtk_widget_size_request        (GtkWidget           *widget,
404                                            GtkRequisition      *requisition);
405 void       gtk_widget_size_allocate       (GtkWidget           *widget,
406                                            GtkAllocation       *allocation);
407 void       gtk_widget_add_accelerator     (GtkWidget           *widget,
408                                            const gchar         *accel_signal,
409                                            GtkAccelGroup       *accel_group,
410                                            guint                accel_key,
411                                            guint                accel_mods,
412                                            GtkAccelFlags        accel_flags);
413 void       gtk_widget_remove_accelerator  (GtkWidget           *widget,
414                                            GtkAccelGroup       *accel_group,
415                                            guint                accel_key,
416                                            guint                accel_mods);
417 void       gtk_widget_remove_accelerators (GtkWidget           *widget,
418                                            const gchar         *accel_signal,
419                                            gboolean             visible_only);
420 guint      gtk_widget_accelerator_signal  (GtkWidget           *widget,
421                                            GtkAccelGroup       *accel_group,
422                                            guint                accel_key,
423                                            guint                accel_mods);
424 void       gtk_widget_freeze_accelerators (GtkWidget           *widget);
425 void       gtk_widget_thaw_accelerators   (GtkWidget           *widget);
426 gint       gtk_widget_event               (GtkWidget           *widget,
427                                            GdkEvent            *event);
428
429 void       gtk_widget_activate            (GtkWidget           *widget);
430 void       gtk_widget_reparent            (GtkWidget           *widget,
431                                            GtkWidget           *new_parent);
432 void       gtk_widget_popup               (GtkWidget           *widget,
433                                            gint                 x,
434                                            gint                 y);
435 gint       gtk_widget_intersect           (GtkWidget           *widget,
436                                            GdkRectangle        *area,
437                                            GdkRectangle        *intersection);
438 gint       gtk_widget_basic               (GtkWidget           *widget);
439
440 void       gtk_widget_grab_focus          (GtkWidget           *widget);
441 void       gtk_widget_grab_default        (GtkWidget           *widget);
442
443 void       gtk_widget_set_name            (GtkWidget           *widget,
444                                            const gchar         *name);
445 gchar*     gtk_widget_get_name            (GtkWidget           *widget);
446 void       gtk_widget_set_state           (GtkWidget           *widget,
447                                            GtkStateType         state);
448 void       gtk_widget_set_sensitive       (GtkWidget           *widget,
449                                            gint                 sensitive);
450 void       gtk_widget_set_parent          (GtkWidget           *widget,
451                                            GtkWidget           *parent);
452 void       gtk_widget_set_parent_window   (GtkWidget           *widget,
453                                            GdkWindow           *parent_window);
454 GdkWindow *gtk_widget_get_parent_window   (GtkWidget           *widget);
455 void       gtk_widget_set_uposition       (GtkWidget           *widget,
456                                            gint                 x,
457                                            gint                 y);
458 void       gtk_widget_set_usize           (GtkWidget           *widget,
459                                            gint                 width,
460                                            gint                 height);
461 void       gtk_widget_set_events          (GtkWidget           *widget,
462                                            gint                 events);
463 void       gtk_widget_set_extension_events (GtkWidget           *widget,
464                                             GdkExtensionMode    mode);
465
466 GdkExtensionMode gtk_widget_get_extension_events (GtkWidget     *widget);
467 GtkWidget*   gtk_widget_get_toplevel    (GtkWidget      *widget);
468 GtkWidget*   gtk_widget_get_ancestor    (GtkWidget      *widget,
469                                          GtkType        widget_type);
470 GdkColormap* gtk_widget_get_colormap    (GtkWidget      *widget);
471 GdkVisual*   gtk_widget_get_visual      (GtkWidget      *widget);
472 gint         gtk_widget_get_events      (GtkWidget      *widget);
473 void         gtk_widget_get_pointer     (GtkWidget      *widget,
474                                          gint           *x,
475                                          gint           *y);
476
477 gint         gtk_widget_is_ancestor     (GtkWidget      *widget,
478                                          GtkWidget      *ancestor);
479 gint         gtk_widget_is_child        (GtkWidget      *widget,
480                                          GtkWidget      *child);
481
482 /* Hide widget and return TRUE.
483  */
484 gint       gtk_widget_hide_on_delete    (GtkWidget      *widget);
485
486 /* Widget styles.
487  */
488 void       gtk_widget_set_style         (GtkWidget      *widget,
489                                          GtkStyle       *style);
490 void       gtk_widget_set_rc_style      (GtkWidget      *widget);
491 void       gtk_widget_ensure_style      (GtkWidget      *widget);
492 GtkStyle*  gtk_widget_get_style         (GtkWidget      *widget);
493 void       gtk_widget_restore_default_style (GtkWidget  *widget);
494
495 /* Descend recursively and set rc-style on all widgets without user styles */
496 void       gtk_widget_reset_rc_styles   (GtkWidget      *widget);
497
498 /* Push/pop pairs, to change default values upon a widget's creation.
499  * This will override the values that got set by the
500  * gtk_widget_set_default_* () functions.
501  */
502 void         gtk_widget_push_style          (GtkStyle    *style);
503 void         gtk_widget_push_colormap       (GdkColormap *cmap);
504 void         gtk_widget_push_visual         (GdkVisual   *visual);
505 void         gtk_widget_push_composite_flag (void);
506 void         gtk_widget_pop_composite_flag  (void);
507 void         gtk_widget_pop_style           (void);
508 void         gtk_widget_pop_colormap        (void);
509 void         gtk_widget_pop_visual          (void);
510
511 /* Set certain default values to be used at widget creation time.
512  */
513 void         gtk_widget_set_default_style    (GtkStyle    *style);
514 void         gtk_widget_set_default_colormap (GdkColormap *colormap);
515 void         gtk_widget_set_default_visual   (GdkVisual   *visual);
516 GtkStyle*    gtk_widget_get_default_style    (void);
517 GdkColormap* gtk_widget_get_default_colormap (void);
518 GdkVisual*   gtk_widget_get_default_visual   (void);
519
520 /* Counterpart to gdk_window_shape_combine_mask.
521  */
522 void         gtk_widget_shape_combine_mask (GtkWidget *widget,
523                                             GdkBitmap *shape_mask,
524                                             gint       offset_x,
525                                             gint       offset_y);
526
527 /* Compute a widget's path in the form "GtkWindow.MyLabel", and
528  * return newly alocated strings.
529  */
530 void         gtk_widget_path               (GtkWidget *widget,
531                                             guint     *path_length,
532                                             gchar    **path,
533                                             gchar    **path_reversed);
534 void         gtk_widget_class_path         (GtkWidget *widget,
535                                             guint     *path_length,
536                                             gchar    **path,
537                                             gchar    **path_reversed);
538
539 /* When you get a drag_enter event, you can use this to tell Gtk of other
540  *  items that are to be dragged as well...
541  */
542 void         gtk_widget_dnd_drag_add (GtkWidget *widget);
543
544 /* These two functions enable drag and/or drop on a widget,
545  *  and also let Gtk know what data types will be accepted (use MIME
546  *  type naming, plus tacking "URL:" on the front for link dragging)
547  */
548 void         gtk_widget_dnd_drag_set (GtkWidget     *widget,
549                                       guint8         drag_enable,
550                                       gchar        **type_accept_list,
551                                       guint          numtypes);
552 void         gtk_widget_dnd_drop_set (GtkWidget     *widget,
553                                       guint8         drop_enable,
554                                       gchar        **type_accept_list,
555                                       guint          numtypes,
556                                       guint8         is_destructive_operation);
557
558 /* Used to reply to a DRAG_REQUEST event - if you don't want to 
559  * give the data then pass in NULL for it 
560  */
561 void         gtk_widget_dnd_data_set (GtkWidget     *widget,
562                                       GdkEvent      *event,
563                                       gpointer       data,
564                                       gulong         data_numbytes);
565
566 #if     defined (GTK_TRACE_OBJECTS) && defined (__GNUC__)
567 #  define gtk_widget_ref gtk_object_ref
568 #  define gtk_widget_unref gtk_object_unref
569 #endif  /* GTK_TRACE_OBJECTS && __GNUC__ */
570
571
572 #ifdef __cplusplus
573 }
574 #endif /* __cplusplus */
575
576
577 #endif /* __GTK_WIDGET_H__ */