add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / gtk / src / widget.hg
1 /* $Id: widget.hg,v 1.48 2006/09/19 20:08:42 murrayc Exp $ */
2
3 /* Copyright (C) 2002, 2003 The gtkmm Development Team
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the Free
17  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */
19  
20 #include <pangomm/context.h>
21 #include <pangomm/layout.h>
22
23 #include <gtkmmconfig.h> //For GTKMM_ATKMM_ENABLED
24 #ifdef GTKMM_ATKMM_ENABLED
25 #include <atkmm/object.h>
26 #include <atkmm/implementor.h>
27 #endif //GTKMM_ATKMM_ENABLED
28
29 #include <gdkmm/event.h>
30 #include <gdkmm/types.h>
31 #include <gdkmm/window.h>
32 #include <gdkmm/dragcontext.h>
33 #include <gdkmm/pixbuf.h>
34 #include <gdkmm/screen.h>
35 #include <gtkmm/enums.h>
36 #include <gdkmm/display.h>
37 //#include <gtkmm/style.h>
38 #include <gtkmm/targetlist.h>
39 #include <gtkmm/rc.h>
40 #include <gtkmm/object.h>
41 #include <gtkmm/clipboard.h>
42 //#include <gtkmm/action.h>
43
44 _DEFS(gtkmm,gtk)
45 _PINCLUDE(gtkmm/private/object_p.h)
46
47
48 #ifndef DOXYGEN_SHOULD_SKIP_THIS
49 extern "C"
50 {
51 typedef struct _GtkTargetEntry GtkTargetEntry;
52 }
53
54 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
55
56 namespace Gtk
57 {
58
59 _CC_INCLUDE(gtk/gtktypebuiltins.h)
60 _WRAP_ENUM(DestDefaults, GtkDestDefaults)
61 _WRAP_ENUM(WidgetFlags, GtkWidgetFlags)
62 _WRAP_ENUM(WidgetHelpType, GtkWidgetHelpType)
63
64 class Action;
65 class Style;
66 class AccelGroup;
67 class Adjustment;
68 class Window;
69 class Container;
70 class Settings;
71 class Tooltip;
72
73 typedef GtkRequisition Requisition;
74
75 // Gtk::Allocation is a typedef of Gdk::Rectangle because GtkAllocation is
76 // a typedef of GdkRectangle.
77 typedef Gdk::Rectangle Allocation;
78
79
80
81 /** @defgroup Widgets Widgets
82  */
83
84 /** Abstract Widget (Base class for all widgets)
85  *
86  * As the base class of all widgets this contains all of the properties
87  * and methods common to all widgets.  It is an abstract class that
88  * can not be instantiated.
89  *
90  * Important part of widgets are the *_event signals and virtual methods
91  * that every widget have. Those are events coming directly from gdk and
92  * thus also from XLib. By overriding those virtual methods you can
93  * trap everything a widget can ever do.
94  * In order to capture events from a widget, the event mask must
95  * first be set with ().
96  *
97  * Only widgets with a Gdk::Window on the server side are allowed to
98  * capture events.  Widgets in the Gtk::Misc group for example lack
99  * a Gdk::Window.
100  */
101 class Widget
102 : public Object
103 #ifdef GTKMM_ATKMM_ENABLED
104   ,public Atk::Implementor
105 #endif //GTKMM_ATKMM_ENABLED
106 {
107   _CLASS_GTKOBJECT(Widget,GtkWidget,GTK_WIDGET,Gtk::Object,GtkObject)
108   _IMPLEMENTS_INTERFACE(Atk::Implementor, ifdef GTKMM_ATKMM_ENABLED)
109   _IGNORE(gtk_widget_set, gtk_widget_queue_clear, gtk_widget_queue_clear_area, gtk_widget_draw,
110           gtk_widget_set_uposition, gtk_widget_set_usize, gtk_widget_set_visual, gtk_widget_push_visual,
111           gtk_widget_pop_visual, gtk_widget_set_default_visual, gtk_widget_set_rc_style, gtk_widget_restore_default_style)
112   _IGNORE(gtk_widget_destroy, gtk_widget_ref, gtk_widget_unref, gtk_widget_destroyed, gtk_widget_hide_on_delete,
113           gtk_widget_style_get_valist, gtk_widget_list_accel_closures, gtk_widget_style_get)
114 public:
115   friend class Main;
116   _CUSTOM_DTOR
117
118   _WRAP_METHOD(bool set_scroll_adjustments(Adjustment& hadjustment, Adjustment& vadjustment), gtk_widget_set_scroll_adjustments)
119
120   _WRAP_METHOD(void show(), gtk_widget_show)
121   _WRAP_METHOD(void show_now(), gtk_widget_show_now)
122   _WRAP_METHOD(void hide(), gtk_widget_hide)
123
124   _WRAP_METHOD(void show_all(), gtk_widget_show_all)
125
126   _WRAP_METHOD(void hide_all(), gtk_widget_hide_all)
127
128
129 /* QUEUE DRAWS */
130
131   _WRAP_METHOD(void queue_draw(), gtk_widget_queue_draw)
132   _WRAP_METHOD(void queue_draw_area(int x, int y, int width, int height), gtk_widget_queue_draw_area)
133   _WRAP_METHOD(void queue_resize(), gtk_widget_queue_resize)
134
135   /** This function is typically used when implementing a Gtk::Container
136    * subclass.  Obtains the preferred size of a widget. The container
137    * uses this information to arrange its child widgets and decide what
138    * size allocations to give them with size_allocate().
139    * 
140    * You can also call this function from an application, with some
141    * caveats. Most notably, getting a size request requires the widget
142    * to be associated with a screen, because font information may be
143    * needed. Multihead-aware applications should keep this in mind.
144    * 
145    * Also remember that the size request is not necessarily the size
146    * a widget will actually be allocated.
147    * 
148    * See also get_child_requisition().
149    * @result A Gtk::Requisition.
150    */
151   Requisition size_request() const;
152   _IGNORE(gtk_widget_size_request)
153
154   _WRAP_METHOD(void size_request(const Requisition& requisition), gtk_widget_size_request, deprecated "Use size_request() const.")
155
156   _WRAP_METHOD(void size_allocate(const Allocation& allocation), gtk_widget_size_allocate)
157
158
159   _WRAP_METHOD(void add_accelerator(const Glib::ustring& accel_signal, const Glib::RefPtr<AccelGroup>& accel_group,
160                guint accel_key, Gdk::ModifierType accel_mods, AccelFlags accel_flags), gtk_widget_add_accelerator)
161
162   _WRAP_METHOD(bool remove_accelerator(const Glib::RefPtr<AccelGroup>& accel_group,
163                guint accel_key, Gdk::ModifierType accel_mods), gtk_widget_remove_accelerator)
164   _WRAP_METHOD(void set_accel_path(const Glib::ustring& accel_path,
165                                    const Glib::RefPtr<AccelGroup>& accel_group),
166                gtk_widget_set_accel_path)
167
168   //GList* gtk_widget_list_accel_closures();
169
170   //TODO: Or maybe it is useless: gboolean gtk_widget_can_activate_accel(GtkWidget *widget, guint signal_id)
171   
172   _WRAP_METHOD(bool mnemonic_activate(bool group_cycling), gtk_widget_mnemonic_activate)
173
174   //TODO: Use C++ type
175   _WRAP_METHOD(bool event(GdkEvent* event), gtk_widget_event)
176   _WRAP_METHOD(int send_expose(GdkEvent* event), gtk_widget_send_expose)
177   _WRAP_METHOD(bool activate(), gtk_widget_activate)
178
179   _WRAP_METHOD(void reparent(Widget & new_parent), gtk_widget_reparent)
180
181   bool intersect(const Gdk::Rectangle& area) const;
182   _WRAP_METHOD(bool intersect(const Gdk::Rectangle& area, Gdk::Rectangle& intersection) const, gtk_widget_intersect)
183
184   _WRAP_METHOD(Gdk::Region region_intersect(const Gdk::Region& region) const, gtk_widget_region_intersect)
185
186   _WRAP_METHOD(void freeze_child_notify(), gtk_widget_freeze_child_notify)
187   _WRAP_METHOD(void     child_notify(const Glib::ustring& child_property), gtk_widget_child_notify)
188   _WRAP_METHOD(void     thaw_child_notify(), gtk_widget_thaw_child_notify)
189
190   _WRAP_METHOD(bool is_focus() const, gtk_widget_is_focus)
191   _WRAP_METHOD(void     grab_focus(), gtk_widget_grab_focus)
192   _WRAP_METHOD(void     grab_default(), gtk_widget_grab_default)
193
194   /** Block events to everything else than this widget and its children. This
195    * way you can get modal behaviour (usually not recommended). One practical
196    * example could be when implementing a key-binding widget that needs
197    * exclusive access to the key combination that the user presses next.
198    *
199    * Calls to add_modal_grab should be paired with calls to remove_modal_grab.
200    */
201   void add_modal_grab();
202
203   /** Remove the modal grab of the widget in case it was previously grabbed.
204    */
205   void remove_modal_grab();
206
207   /** Retrieve the widget which is currently grabbing all events.
208    */
209   static Widget* get_current_modal_grab();
210
211   _WRAP_METHOD(void set_name(const Glib::ustring& name), gtk_widget_set_name)
212   void unset_name();
213   _WRAP_METHOD(Glib::ustring get_name() const, gtk_widget_get_name)
214
215   _WRAP_METHOD(void set_state(Gtk::StateType state), gtk_widget_set_state)
216   _WRAP_METHOD(void set_sensitive(bool sensitive = true), gtk_widget_set_sensitive)
217   _WRAP_METHOD(void set_app_paintable(bool app_paintable = true), gtk_widget_set_app_paintable)
218   _WRAP_METHOD(void set_double_buffered(bool double_buffered = true), gtk_widget_set_double_buffered)
219
220   _WRAP_METHOD(void set_redraw_on_allocate(bool redraw_on_allocate = true),
221                gtk_widget_set_redraw_on_allocate)
222
223   _WRAP_METHOD(void set_child_visible(bool is_visible = true), gtk_widget_set_child_visible)
224   _WRAP_METHOD(bool get_child_visible() const, gtk_widget_get_child_visible)
225
226   _WRAP_METHOD(Container* get_parent(), gtk_widget_get_parent)
227   _WRAP_METHOD(const Container* get_parent() const, gtk_widget_get_parent, constversion)
228
229   _WRAP_METHOD(Glib::RefPtr<Gdk::Window> get_parent_window(), gtk_widget_get_parent_window, refreturn)
230   _WRAP_METHOD(Glib::RefPtr<const Gdk::Window> get_parent_window() const, gtk_widget_get_parent_window, refreturn, constversion)
231   _WRAP_METHOD(void set_parent_window(const Glib::RefPtr<const Gdk::Window>& parent_window), gtk_widget_set_parent_window)
232
233   _WRAP_METHOD(bool child_focus(DirectionType direction), gtk_widget_child_focus)
234
235   _WRAP_METHOD(bool keynav_failed(DirectionType direction), gtk_widget_keynav_failed)
236   _WRAP_METHOD(void error_bell(), gtk_widget_error_bell)
237
238   _WRAP_METHOD(void set_size_request(int width = -1, int  height = -1), gtk_widget_set_size_request)
239   _WRAP_METHOD(void get_size_request(int& width, int& height) const, gtk_widget_get_size_request)
240
241   _WRAP_METHOD(void set_events(Gdk::EventMask events), gtk_widget_set_events)
242   _WRAP_METHOD(void add_events(Gdk::EventMask events), gtk_widget_add_events)
243   _WRAP_METHOD(void set_extension_events(Gdk::ExtensionMode mode), gtk_widget_set_extension_events)
244
245   _WRAP_METHOD(Gdk::ExtensionMode get_extension_events() const, gtk_widget_get_extension_events)
246
247   _WRAP_METHOD(Container* get_toplevel(), gtk_widget_get_toplevel)
248   _WRAP_METHOD(const Container* get_toplevel() const, gtk_widget_get_toplevel, constversion)
249
250   _WRAP_METHOD(Widget* get_ancestor(GType widget_type), gtk_widget_get_ancestor)
251   _WRAP_METHOD(const Widget* get_ancestor(GType widget_type) const, gtk_widget_get_ancestor, constversion)
252
253   _WRAP_METHOD(Glib::RefPtr<Gdk::Colormap> get_colormap(), gtk_widget_get_colormap, refreturn)
254
255   _WRAP_METHOD(Glib::RefPtr<Gdk::Visual> get_visual(), gtk_widget_get_visual, refreturn)
256
257   _WRAP_METHOD(Glib::RefPtr<Gdk::Screen> get_screen(), gtk_widget_get_screen, refreturn)
258   _WRAP_METHOD(Glib::RefPtr<const Gdk::Screen> get_screen() const, gtk_widget_get_screen, refreturn, constversion)
259
260   _WRAP_METHOD(bool has_screen() const, gtk_widget_has_screen)
261
262   _WRAP_METHOD(Glib::RefPtr<Gdk::Display> get_display(), gtk_widget_get_display, refreturn)
263   _WRAP_METHOD(Glib::RefPtr<const Gdk::Display> get_display() const, gtk_widget_get_display, refreturn, constversion)
264
265   _WRAP_METHOD(Glib::RefPtr<Gdk::Window> get_root_window(), gtk_widget_get_root_window, refreturn)
266   _WRAP_METHOD(Glib::RefPtr<const Gdk::Window> get_root_window() const, gtk_widget_get_root_window, refreturn, constversion)
267   
268   _WRAP_METHOD(Glib::RefPtr<Settings> get_settings(), gtk_widget_get_settings, refreturn)
269
270   _WRAP_METHOD(Glib::RefPtr<Clipboard> get_clipboard(const Glib::ustring& selection), gtk_widget_get_clipboard, refreturn)
271   _WRAP_METHOD(Glib::RefPtr<const Clipboard> get_clipboard(const Glib::ustring& selection) const, gtk_widget_get_clipboard, refreturn, constversion)
272
273   //TODO: This probably needs a special conversion to do an extra ref (take_copy=true) for the returned instance:
274   _WRAP_METHOD(Glib::RefPtr<Atk::Object> get_accessible(), gtk_widget_get_accessible, refreturn, ifdef GTKMM_ATKMM_ENABLED)
275
276   _WRAP_METHOD(void set_colormap(const Glib::RefPtr<const Gdk::Colormap> &colormap), gtk_widget_set_colormap)
277   _WRAP_METHOD(Gdk::EventMask get_events() const, gtk_widget_get_events)
278   _WRAP_METHOD(void get_pointer(int &x, int &y) const, gtk_widget_get_pointer)
279   _WRAP_METHOD(bool is_ancestor(Widget &ancestor) const, gtk_widget_is_ancestor)
280
281   _WRAP_METHOD(bool translate_coordinates(Widget& dest_widget,
282                                                int src_x, int src_y,
283                                                int& dest_x, int& dest_y), gtk_widget_translate_coordinates)
284
285 /* STYLE */
286   _WRAP_METHOD(void set_style(const Glib::RefPtr<Style>& style), gtk_widget_set_style)
287   void unset_style();
288
289   _WRAP_METHOD(void ensure_style(), gtk_widget_ensure_style)
290   _WRAP_METHOD(Glib::RefPtr<Style> get_style(), gtk_widget_get_style, refreturn)
291   _WRAP_METHOD(Glib::RefPtr<const Style> get_style() const, gtk_widget_get_style, refreturn, constversion)
292   _WRAP_METHOD(void modify_style(const Glib::RefPtr<RcStyle>& style), gtk_widget_modify_style)
293   _WRAP_METHOD(Glib::RefPtr<RcStyle> get_modifier_style(), gtk_widget_get_modifier_style, refreturn)
294   _WRAP_METHOD(Glib::RefPtr<const RcStyle> get_modifier_style() const, gtk_widget_get_modifier_style, refreturn, constversion)
295
296   // we need custom documentation because modify_* can take a NULL pointer
297   // (which we wrap with unset_*)
298   /** Sets the foreground color for a widget in a particular state.
299    * All other style values are left untouched. See also modify_style() and
300    * unset_fg().
301    *
302    * @param state The state for which to set the foreground color.
303    * @param color The color to assign (does not need to be allocated).
304    */
305   _WRAP_METHOD(void modify_fg(StateType state, const Gdk::Color& color), gtk_widget_modify_fg)
306
307
308   /** Sets the background color for a widget in a particular state.
309    * All other style values are left untouched. See also modify_style() and
310    * unset_bg().
311    *
312    * @param state The state for which to set the background color.
313    * @param color The color to assign (does not need to be allocated).
314    */
315   _WRAP_METHOD(void modify_bg(StateType state, const Gdk::Color& color), gtk_widget_modify_bg)
316
317   // TODO: Document this, and perhaps add unset_bg_pixmap
318   void modify_bg_pixmap(StateType state, const Glib::ustring& pixmap_name);
319
320   /** Sets the text color for a widget in a particular state.
321    * All other style values are left untouched. The text color is the
322    * foreground color used along with the base color (see modify_base() ) for
323    * widgets such as Gtk::Entry and Gtk::TextView. See also modify_style() and
324    * unset_text().
325    *
326    * @param state The state for which to set the text color.
327    * @param color The color to assign (does not need to be allocated).
328    */
329   _WRAP_METHOD(void modify_text(StateType state, const Gdk::Color& color), gtk_widget_modify_text)
330
331   /** Sets the base color for a widget in a particular state.
332    * All other style values are left untouched. The base color is the
333    * background color used along with the text color (see modify_text() ) for
334    * widgets such as Gtk::Entry and Gtk::TextView. See also modify_style() and
335    * unset_base().
336    *
337    * @param state The state for which to set the text color.
338    * @param color The color to assign (does not need to be allocated).
339    */
340   _WRAP_METHOD(void modify_base(StateType state, const Gdk::Color& color), gtk_widget_modify_base)
341
342   /** Sets the cursor color to use in a widget, overriding the
343    * cursor_color and secondary_cursor_color
344    * style properties. All other style values are left untouched. 
345    * See also modify_style().
346    * See also unset_cursor().
347    *
348    * @param primary the color to use for primary cursor (does not need to be allocated).
349    * @param secondary the color to use for secondary cursor (does not need to be allocated).
350    *
351    * @newin2p12
352    */
353   _WRAP_METHOD(void modify_cursor(const Gdk::Color& primary, const Gdk::Color& secondary), gtk_widget_modify_cursor)
354   
355   /// See modify_cursor().
356   void unset_cursor();
357
358   /** Sets the font to use for a widget.
359    * All other style values are left untouched. See also modify_style() and
360    * unset_font().
361    */
362   _WRAP_METHOD(void modify_font(const Pango::FontDescription& font_desc), gtk_widget_modify_font)
363
364   /** Undo the effect of previous calls to modify_fg() for a particular state.
365    * All other style values are left untouched. See also modify_style().
366    */
367   void unset_fg(StateType state);
368   
369   /** Undo the effect of previous calls to modify_bg() for a particular state.
370    * All other style values are left untouched. See also modify_style().
371    */
372   void unset_bg(StateType state);
373
374   /** Undo the effect of previous calls to modify_text() for a particular state.
375    * All other style values are left untouched. See also modify_style().
376    */
377   void unset_text(StateType state);
378
379   /** Undo the effect of previous calls to modify_base() for a particular state.
380    * All other style values are left untouched. See also modify_style().
381    */
382   void unset_base(StateType state);
383
384   /** Undo the effect of previous calls to modify_font() for a particular state.
385    * All other style values are left untouched. See also modify_style().
386    */
387   void unset_font();
388
389   //The parameter name is "the_property_name" to avoid a warning because there is a method with the "property_name" name.
390   template <class PropertyType>
391   void get_style_property(const Glib::ustring& the_property_name, PropertyType& value) const;
392
393   _WRAP_METHOD(Glib::RefPtr<Pango::Context> create_pango_context(), gtk_widget_create_pango_context)
394   _WRAP_METHOD(Glib::RefPtr<Pango::Context> get_pango_context(), gtk_widget_get_pango_context, refreturn)
395   _WRAP_METHOD(Glib::RefPtr<Pango::Layout> create_pango_layout(const Glib::ustring& text), gtk_widget_create_pango_layout)
396
397   _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> render_icon(const StockID& stock_id, IconSize size, const Glib::ustring& detail = Glib::ustring()), gtk_widget_render_icon)
398
399   _WRAP_METHOD(void set_composite_name(const Glib::ustring& name), gtk_widget_set_composite_name)
400   void unset_composite_name();
401   _WRAP_METHOD(Glib::ustring get_composite_name() const, gtk_widget_get_composite_name)
402
403   _WRAP_METHOD(void reset_rc_styles(),gtk_widget_reset_rc_styles)
404
405
406   // PUSH/POP - these are used to create widgets.  Hidden arguments to override the defaults.
407   _WRAP_METHOD(static void push_colormap(const Glib::RefPtr<const Gdk::Colormap>& cmap), gtk_widget_push_colormap)
408   _WRAP_METHOD(static void pop_colormap(), gtk_widget_pop_colormap)
409
410   _WRAP_METHOD(static void push_composite_child(), gtk_widget_push_composite_child)
411   _WRAP_METHOD(static void pop_composite_child(), gtk_widget_pop_composite_child)
412
413
414 /* DEFAULTS */
415
416   _WRAP_METHOD(static void set_default_colormap(const Glib::RefPtr<const Gdk::Colormap>& colormap), gtk_widget_set_default_colormap)
417   _WRAP_METHOD(static Glib::RefPtr<Style> get_default_style(), gtk_widget_get_default_style, refreturn)
418   _WRAP_METHOD(static Glib::RefPtr<Gdk::Colormap> get_default_colormap(), gtk_widget_get_default_colormap, refreturn)
419   _WRAP_METHOD(static Glib::RefPtr<Gdk::Visual> get_default_visual(), gtk_widget_get_default_visual, refreturn)
420
421
422 /* Directionality of Text */
423
424   _WRAP_METHOD(void set_direction(TextDirection dir), gtk_widget_set_direction)
425   _WRAP_METHOD(TextDirection get_direction(), gtk_widget_get_direction)
426   _WRAP_METHOD(static void set_default_direction(TextDirection dir), gtk_widget_set_default_direction)
427   _WRAP_METHOD(static TextDirection get_default_direction(), gtk_widget_get_default_direction)
428
429
430 /* Shape masking */
431   _WRAP_METHOD(void shape_combine_mask(const Glib::RefPtr<const Gdk::Bitmap>& shape_mask, int offset_x, int offset_y), gtk_widget_shape_combine_mask)
432   void unset_shape_combine_mask();
433   _WRAP_METHOD(void input_shape_combine_mask(const Glib::RefPtr<const Gdk::Bitmap>& shape_mask, int offset_x, int offset_y), gtk_widget_input_shape_combine_mask)
434   void unset_input_shape_combine_mask();
435
436
437   // must be realized 
438   _WRAP_METHOD(void reset_shapes(),gtk_widget_reset_shapes)
439
440 /* Paths */
441   /// Compute a widget's path of the form "GtkWindow.MyLabel"
442   void path(Glib::ustring& path, Glib::ustring& path_reversed);
443   void class_path(Glib::ustring& path, Glib::ustring& path_reversed);
444   _IGNORE(gtk_widget_path, gtk_widget_class_path)
445
446  _WRAP_METHOD(Glib::ListHandle<Widget*> list_mnemonic_labels(), gtk_widget_list_mnemonic_labels)
447  _WRAP_METHOD(Glib::ListHandle<const Widget*> list_mnemonic_labels() const, gtk_widget_list_mnemonic_labels)
448  _WRAP_METHOD(void add_mnemonic_label(Widget& label), gtk_widget_add_mnemonic_label)
449  _WRAP_METHOD(void remove_mnemonic_label(Widget& label), gtk_widget_remove_mnemonic_label)
450            
451
452   //TODO: Should drag_get_data() be const?
453   _WRAP_METHOD(void drag_get_data(const Glib::RefPtr<Gdk::DragContext>& context, Glib::ustring& target, guint32 time), gtk_drag_get_data)               
454   _WRAP_METHOD(void drag_highlight(), gtk_drag_highlight)
455   _WRAP_METHOD(void drag_unhighlight(), gtk_drag_unhighlight)
456
457   void drag_dest_set(DestDefaults flags = DestDefaults(0), Gdk::DragAction actions = Gdk::DragAction(0));
458   void drag_dest_set(const ArrayHandle_TargetEntry& targets, DestDefaults flags = DEST_DEFAULT_ALL, Gdk::DragAction actions = Gdk::ACTION_COPY);
459   _IGNORE(gtk_drag_dest_set)
460
461   _WRAP_METHOD(void drag_dest_set_proxy(const Glib::RefPtr<Gdk::Window>& proxy_window, Gdk::DragProtocol protocol, bool use_coordinates), gtk_drag_dest_set_proxy)
462   _WRAP_METHOD(void drag_dest_unset(), gtk_drag_dest_unset)
463   _WRAP_METHOD(Glib::ustring drag_dest_find_target(const Glib::RefPtr<Gdk::DragContext>& context, const Glib::RefPtr<TargetList>& target_list) const, gtk_drag_dest_find_target)
464   Glib::ustring drag_dest_find_target(const Glib::RefPtr<Gdk::DragContext>& context) const;
465
466   _WRAP_METHOD(Glib::RefPtr<TargetList> drag_dest_get_target_list(), gtk_drag_dest_get_target_list, refreturn)
467   _WRAP_METHOD(Glib::RefPtr<const TargetList> drag_dest_get_target_list() const, gtk_drag_dest_get_target_list, refreturn, constversion)
468   _WRAP_METHOD(void drag_dest_set_target_list(const Glib::RefPtr<TargetList>& target_list), gtk_drag_dest_set_target_list)
469
470   _WRAP_METHOD(void drag_dest_add_text_targets(), gtk_drag_dest_add_text_targets)  
471   _WRAP_METHOD(void drag_dest_add_image_targets(), gtk_drag_dest_add_image_targets)
472   _WRAP_METHOD(void drag_dest_add_uri_targets(), gtk_drag_dest_add_uri_targets)
473  
474   void drag_source_set(const ArrayHandle_TargetEntry& targets, Gdk::ModifierType start_button_mask = Gdk::MODIFIER_MASK, Gdk::DragAction actions = Gdk::ACTION_COPY);
475   _IGNORE(gtk_drag_source_set)
476
477   _WRAP_METHOD(void drag_source_unset(), gtk_drag_source_unset)
478
479   _WRAP_METHOD(void drag_source_set_icon(const Glib::RefPtr<Gdk::Colormap>& colormap, const Glib::RefPtr<Gdk::Pixmap>& pixmap, const Glib::RefPtr<Gdk::Bitmap>& mask), gtk_drag_source_set_icon)
480   _WRAP_METHOD(void drag_source_set_icon(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf), gtk_drag_source_set_icon_pixbuf)
481   _WRAP_METHOD(void drag_source_set_icon(const StockID& stock_id), gtk_drag_source_set_icon_stock)
482   _WRAP_METHOD(void drag_source_set_icon(const Glib::ustring& icon_name), gtk_drag_source_set_icon_name)
483
484   _WRAP_METHOD(void drag_source_add_text_targets(), gtk_drag_source_add_text_targets)
485   _WRAP_METHOD(void drag_source_add_uri_targets(), gtk_drag_source_add_uri_targets)
486   _WRAP_METHOD(void drag_source_add_image_targets(), gtk_drag_source_add_image_targets)
487   
488   _WRAP_METHOD(Glib::RefPtr<Gdk::DragContext> drag_begin(const Glib::RefPtr<TargetList>& targets, Gdk::DragAction actions, int button, GdkEvent* event), gtk_drag_begin, refreturn)
489   _WRAP_METHOD(bool drag_check_threshold(int start_x, int start_y, int current_x, int current_y), gtk_drag_check_threshold)
490   _IGNORE(_gtk_drag_source_handle_event, _gtk_drag_dest_handle_event)
491
492   //These should be a method of Gdk::DragContext, but gdkmm can't depend on gtkmm.
493   static Widget* drag_get_source_widget(const Glib::RefPtr<Gdk::DragContext>& context);
494   void drag_set_as_icon(const Glib::RefPtr<Gdk::DragContext>& context, int hot_x, int hot_y);
495   
496   
497
498   _WRAP_METHOD(void queue_resize_no_redraw(), gtk_widget_queue_resize_no_redraw)
499   _WRAP_METHOD(bool get_no_show_all() const, gtk_widget_get_no_show_all)
500   _WRAP_METHOD(void set_no_show_all(bool no_show_all = true), gtk_widget_set_no_show_all)
501
502   //Used when implementing containers:
503   _WRAP_METHOD(void set_parent(Widget& parent), gtk_widget_set_parent)
504   _WRAP_METHOD(void unparent(), gtk_widget_unparent)
505
506   //TODO: When exactly do we need to custom containers need to call map() on the child widgets?
507   //Most containers that derive from GtkContainer do not need to, but GtkNotebook does.
508   _WRAP_METHOD(void map(), gtk_widget_map)
509   _WRAP_METHOD(void unmap(), gtk_widget_unmap)
510
511   //TODO: The drawable should be passed by reference, when we can break API/ABI, but it's not the end of the world. murrayc.
512   void draw_insertion_cursor(Glib::RefPtr<Gdk::Drawable> drawable, const Gdk::Rectangle& area, const Gdk::Rectangle& location, bool is_primary, TextDirection direction, bool draw_arrow = true);
513   _IGNORE(gtk_draw_insertion_cursor)
514
515   // Gtk+ 2.12 tooltip API
516   _WRAP_METHOD(void set_tooltip_window(Window& widget), gtk_widget_set_tooltip_window)
517   _WRAP_METHOD(Window* get_tooltip_window(), gtk_widget_get_tooltip_window)
518   _WRAP_METHOD(void trigger_tooltip_query(), gtk_widget_trigger_tooltip_query)
519   _WRAP_METHOD(void set_tooltip_text(const Glib::ustring& text), gtk_widget_set_tooltip_text)
520   _WRAP_METHOD(Glib::ustring get_tooltip_text() const, gtk_widget_get_tooltip_text)
521   _WRAP_METHOD(void set_tooltip_markup(const Glib::ustring& markup), gtk_widget_set_tooltip_markup)
522   _WRAP_METHOD(Glib::ustring get_tooltip_markup() const, gtk_widget_get_tooltip_markup)
523   _WRAP_METHOD(void set_has_tooltip(bool has_tooltip = TRUE), gtk_widget_set_has_tooltip)
524   _WRAP_METHOD(bool get_has_tooltip() const, gtk_widget_get_has_tooltip)
525   
526   /* FLAGS */
527
528   //: Returns property {flags.toplevel}.
529   bool is_toplevel() const;
530
531   //: Returns property {flags.nowindow}.
532   bool has_no_window() const;
533
534   //: Returns property {flags.realized}.
535   bool is_realized() const;
536
537   //: Returns property {flags.mapped}.
538   bool is_mapped() const;
539
540   //: Returns property {flags.visible}.
541   bool is_visible() const; 
542
543   //: Returns if the widget is ready to be drawn to.
544   // Checks to see if the widget is both visible and mapped which
545   // makes it possible to perform drawing commands on.
546   bool is_drawable() const;
547   
548   //: Returns property {flags.sensitive}. You might want to check
549   // is_sensitive instead.
550   bool sensitive() const;
551
552   bool parent_sensitive() const;
553   bool is_sensitive() const;
554   bool can_focus() const;
555   bool has_focus() const;
556   bool can_default() const;
557   bool has_default() const;
558   bool has_grab() const;
559   bool rc_style() const;
560   bool is_composite_child() const;
561   bool app_paintable() const;
562   bool receives_default() const;
563   bool double_buffered() const;
564
565   WidgetFlags get_flags() const;
566   void set_flags(WidgetFlags flags);
567   void unset_flags(WidgetFlags flags);
568
569   int get_width() const;
570   int get_height() const;
571
572   _WRAP_METHOD(bool is_composited() const, gtk_widget_is_composited)
573
574   //From gtkaction.h:
575   _WRAP_METHOD(Glib::RefPtr<Action> get_action(), gtk_widget_get_action, refreturn)
576   _WRAP_METHOD(Glib::RefPtr<const Action> get_action() const, gtk_widget_get_action, refreturn, constversion)
577
578   _MEMBER_GET(state, state, Gtk::StateType, guint8)
579   _MEMBER_GET(saved_state, saved_state, Gtk::StateType, guint8)
580   _MEMBER_GET(requisition, requisition, Requisition, GtkRequisition)
581   _MEMBER_GET(allocation, allocation, Allocation, GtkAllocation)
582   _MEMBER_GET_GOBJECT(window, window, Gdk::Window, GdkWindow*)
583
584
585   _WRAP_SIGNAL(void show(),"show")
586   _WRAP_SIGNAL(void hide(),"hide")
587
588   //: Emitted on mapping of a widget to the screen.
589   //- See {flags.mapped}.
590   _WRAP_SIGNAL(void map(),"map")
591
592   //- See {flags.mapped}.
593   _WRAP_SIGNAL(void unmap(),"unmap")
594
595   //: Emitted on realization of a widget.
596   //- See {flags.realized}.  This is also responsible for
597   //- setting {flags.realized} when it is done.  Therefore, 
598   //- when overriding the impl method, you should call the 
599   //- default realize method.
600   _WRAP_SIGNAL(void realize(),"realize")
601
602   //- See {flags.realized}.  This should not be called by the user.
603   //_WRAP(meth|sig|impl,void unrealize_(),gtk_widget_unrealize,"unrealize")
604   _WRAP_SIGNAL(void unrealize(),"unrealize")
605
606   _WRAP_SIGNAL(void size_request(Requisition* requisition), "size_request")
607   _WRAP_SIGNAL(void size_allocate(Allocation& allocation), "size_allocate")
608
609 // Changed signals -- inform widget of internal changes.
610 // We rename parent_set => parent_changed 
611 //  and      style_set  => style_changed 
612 //  to avoid confusion with set_parent and set_style.
613
614   _WRAP_SIGNAL(void state_changed(Gtk::StateType previous_state), "state_changed")
615
616   //: Informs objects that their parent changed.
617   //- The widget passed is the former parent, which may be 0 if 
618   //- there was no parent. (was parent_set in GTK+)
619   _WRAP_SIGNAL(void parent_changed(Widget* previous_parent), "parent_set")
620
621   _WRAP_SIGNAL(void hierarchy_changed(Widget* previous_toplevel), "hierarchy_changed")
622
623 //Note: We use Gtk::Style instead of Style here, to fix a build problem on MacOS X 
624 //that we don't fully understand. See bug #493057.
625 #m4 _CONVERSION(`GtkStyle*',`const Glib::RefPtr<Gtk::Style>&',`Glib::wrap($3, true)')
626 #m4 _CONVERSION(`const Glib::RefPtr<Gtk::Style>&',`GtkStyle*',__CONVERT_REFPTR_TO_P)
627   /** The style-set signal is emitted when a new style has been set 
628    * on a widget. Note that style-modifying functions like 
629    * modify_base() also cause this signal to be emitted.
630    *
631    * @param previous_style  the previous style, or an empty RefPtr if the widget 
632    * just got its initial style. 
633    */
634   _WRAP_SIGNAL(void style_changed(const Glib::RefPtr<Gtk::Style>& previous_style), "style_set")
635
636   _WRAP_SIGNAL(void direction_changed(TextDirection direction), "direction_changed")
637
638   _WRAP_SIGNAL(void grab_notify(bool was_grabbed), "grab_notify")
639
640  /** The ::child-notify signal is emitted for each child property that has 
641   * changed on an object. The signal's detail holds the property name. 
642   *
643   * @param pspec The GParamSpec of the changed child property.
644   */
645   _WRAP_SIGNAL(void child_notify(GParamSpec* pspec), "child_notify")
646
647   //_WRAP_SIGNAL(void add_accelerator(guint, GtkAccelGroup*, guint accel_key, Gdk::ModifierType, AccelFlags), "add-accelerator")
648   //_WRAP_SIGNAL(void remove_accelerator(GtkAccelGroup* accel_group, guint, Gdk::ModifierType), "remove-accelerator")
649   _WRAP_SIGNAL(bool mnemonic_activate(bool group_cycling), "mnemonic_activate")
650   _WRAP_SIGNAL(void grab_focus(), "grab_focus")
651   _WRAP_SIGNAL(bool focus(DirectionType direction), "focus")
652   _WRAP_SIGNAL(bool event(GdkEvent* event), "event")
653   _WRAP_SIGNAL(void event_after(GdkEvent* event), "event_after", no_default_handler)
654
655   //: Event triggered by user pressing button.
656   _WRAP_SIGNAL(bool button_press_event(GdkEventButton* event),"button_press_event")
657
658   //: Event triggered by user releasing button.
659   _WRAP_SIGNAL(bool button_release_event(GdkEventButton* event), "button_release_event")
660
661   _WRAP_SIGNAL(bool scroll_event(GdkEventScroll* event), "scroll_event")
662
663   //: Event triggered by user moving pointer.
664   _WRAP_SIGNAL(bool motion_notify_event(GdkEventMotion* event), "motion_notify_event")
665
666  /** The delete_event signal is emitted if a user requests that
667   * a toplevel window is closed. The default handler for this signal
668   * hides the window.
669   *
670   * @param event the event which triggered this signal.
671   * @result true to stop other handlers from being invoked for the event, 
672   * or false to propagate the event. further.
673   */
674   _WRAP_SIGNAL(bool delete_event(GdkEventAny* event), "delete_event")
675
676 #m4begin
677 dnl// Hook in special code to catch explicit uses of gtk_object_destroy() by
678 dnl// GTK+ code, e.g. when receiving the GDK_DELETE event.  For details, look
679 dnl// at Gtk::Widget_Class::dispose_vfunc_callback() in widget.ccg.
680 dnl
681   _PUSH(SECTION_PCC_CLASS_INIT_VFUNCS)
682 #endif //GLIBMM_VFUNCS_ENABLED //We always need dispose_vfunc_callback
683     reinterpret_cast<GObjectClass*>(klass)->dispose = &dispose_vfunc_callback;
684 #ifdef GLIBMM_VFUNCS_ENABLED
685   _SECTION(SECTION_PH_VFUNCS)
686 #endif //GLIBMM_VFUNCS_ENABLED //We always need dispose_vfunc_callback
687     static void dispose_vfunc_callback(GObject* self);
688 #ifdef GLIBMM_VFUNCS_ENABLED
689   _POP()
690 #m4end
691
692   //: Event triggered by window requiring a refresh.
693   //- Expose events cover a rectangular area that was covered
694   //- or obscured by another window.  That area is now exposed
695   //- and thus is needs to be redrawn.  
696   //-
697   //- If the application is not capable of redrawing sections
698   //- it should watch the count field and only draw on the last
699   //- even indicated.  This is important for things such as 
700   //- Gtk::DrawingArea. 
701   _WRAP_SIGNAL(bool expose_event(GdkEventExpose* event), "expose_event")
702
703   //: Event triggered by a key press will widget has focus.
704   _WRAP_SIGNAL(bool key_press_event(GdkEventKey* event), "key_press_event")
705
706   //: Event triggered by a key release will widget has focus.
707   _WRAP_SIGNAL(bool key_release_event(GdkEventKey* event), "key_release_event")
708
709   //: Event triggered by pointer entering widget area.
710   _WRAP_SIGNAL(bool enter_notify_event(GdkEventCrossing* event), "enter_notify_event")
711
712   //: Event triggered by pointer leaving widget area.
713   _WRAP_SIGNAL(bool leave_notify_event(GdkEventCrossing* event), "leave_notify_event")
714  
715   //: Event triggered by a window resizing.
716   _WRAP_SIGNAL(bool configure_event(GdkEventConfigure* event), "configure_event")
717   _WRAP_SIGNAL(bool focus_in_event(GdkEventFocus* event), "focus_in_event")
718   _WRAP_SIGNAL(bool focus_out_event(GdkEventFocus* event), "focus_out_event")
719   _WRAP_SIGNAL(bool map_event(GdkEventAny* event), "map_event")
720   _WRAP_SIGNAL(bool unmap_event(GdkEventAny* event), "unmap_event")
721   _WRAP_SIGNAL(bool property_notify_event(GdkEventProperty* event), "property_notify_event")
722   _WRAP_SIGNAL(bool selection_clear_event(GdkEventSelection* event), "selection_clear_event")
723   _WRAP_SIGNAL(bool selection_request_event(GdkEventSelection* event), "selection_request_event")
724   _WRAP_SIGNAL(bool selection_notify_event(GdkEventSelection* event), "selection_notify_event")
725   _WRAP_SIGNAL(bool proximity_in_event(GdkEventProximity* event), "proximity_in_event")
726   _WRAP_SIGNAL(bool proximity_out_event(GdkEventProximity* event), "proximity_out_event")
727   _WRAP_SIGNAL(bool visibility_notify_event(GdkEventVisibility* event), "visibility_notify_event")
728   _WRAP_SIGNAL(bool client_event(GdkEventClient* event), "client_event")
729   _WRAP_SIGNAL(bool no_expose_event(GdkEventAny* event), "no_expose_event")
730   _WRAP_SIGNAL(bool window_state_event(GdkEventWindowState* event), "window_state_event")
731
732   //We use the optional custom_c_callback parameter with _WRAP_SIGNAL() for some of these,
733   //so that we can write special code to wrap the non-const SelectionData& output parameters:
734   _WRAP_SIGNAL(void selection_get(SelectionData& selection_data, guint info, guint time), "selection_get", custom_c_callback)
735   _WRAP_SIGNAL(void selection_received(const SelectionData& selection_data, guint time), "selection_received")
736   
737 #m4 _CONVERSION(`GdkDragContext*',`const Glib::RefPtr<Gdk::DragContext>&',Glib::wrap($3, true))
738
739   /** The drag_begin signal is emitted on the drag source when a drag is started. 
740    * A typical reason to connect to this signal is to set up a custom drag icon with
741    * drag_source_set_icon().
742    *
743    * @param context the drag context
744    */
745   _WRAP_SIGNAL(void drag_begin(const Glib::RefPtr<Gdk::DragContext>& context), "drag_begin")
746   
747   /** The drag_end signal is emitted on the drag source when a drag is finished. 
748    * A typical reason to connect to this signal is to undo things done in the drag-begin 
749    * signal handler.
750    *
751    * @param context the drag context.
752    */
753   _WRAP_SIGNAL(void drag_end(const Glib::RefPtr<Gdk::DragContext>& context), "drag_end")
754
755   /** The drag_data_get signal is emitted on the drag source when the drop site requests
756    * the data which is dragged. It is the responsibility of the signal handler to fill @a data
757    * with the data in the format which is indicated by @a info. See SelectionData::set() and 
758    * SelectionData::set_text().
759    *
760    * @param context: the drag context.
761    * @param selection_data the SelectionData to be filled with the dragged data.
762    * @param info the info that has been registered with the target in the TargetList.
763    * @param time the timestamp at which the data was requested.
764    */
765   _WRAP_SIGNAL(void drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, SelectionData& selection_data, guint info, guint time), "drag_data_get", custom_c_callback)
766   
767   /**  The drag_data_delete signal is emitted on the drag source when a drag with the action
768    * Gdk::ACTION_MOVE is successfully completed. The signal handler is responsible for deleting
769    * the data that has been dropped. What "delete" means, depends on the context of the drag
770    * operation. 
771    *
772    * @param context the drag context.
773    */
774   _WRAP_SIGNAL(void drag_data_delete(const Glib::RefPtr<Gdk::DragContext>& context), "drag_data_delete")
775
776   //TODO: Check the parameters: _WRAP_SIGNAL(bool drag_failed(const Glib::RefPtr<Gdk::DragContext>& context), "drag_failed")
777   
778   /**  The drag_leave signal is emitted on the drop site when the cursor leaves the widget.
779    * A typical reason to connect to this signal is to undo things done in the drag_motion signal handler, 
780    *  e.g. undo highlighting with drag_unhighlight().
781    *
782    * @param context the drag context.
783    * @param time the timestamp of the motion event.
784    */
785   _WRAP_SIGNAL(void drag_leave(const Glib::RefPtr<Gdk::DragContext>& context, guint time), "drag_leave")
786   
787   /** The drag_motion signal is emitted on the drop site when the user moves the cursor over
788    * the widget during a drag. The signal handler must determine whether the cursor position is in 
789    * a drop zone or not. If it is not in a drop zone, it returns false and no further processing is
790    * necessary. Otherwise, the handler returns true. In this case, the handler is responsible for
791    * providing the necessary information for displaying feedback to the user, by calling
792    * drag_status(). If the decision whether the drop will be accepted or rejected can't be made
793    * based solely on the cursor position and the type of the data, the handler may inspect the dragged 
794    * data by calling drag_get_data() and defer the drag_status() call to the drag_data_received 
795    * handler. 
796    *
797    * Note that there is no drag_enter signal. The drag receiver has to keep track of whether
798    * he has received any drag_motion signals since the last drag_leave and if not, treat the
799    * drag_motion signal as an "enter" signal. Upon an "enter", the handler will typically highlight 
800    * the drop site with drag_highlight().
801    * 
802    * @param context the drag context.
803    * @param x the x coordinate of the current cursor position.
804    * @param y the y coordinate of the current cursor position.
805    * @param time the timestamp of the motion event.
806    * @result whether the cursor position is in a drop zone.
807    */
808   _WRAP_SIGNAL(bool drag_motion(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time), "drag_motion")
809   
810   /** The drag_drop signal is emitted on the drop site when the user drops the data
811    * onto the widget. The signal handler must determine whether the cursor position is in 
812    * a drop zone or not. If it is not in a drop zone, it returns false and no further 
813    * processing is necessary. Otherwise, the handler returns true. In this case, the handler 
814    * must ensure that gtk_drag_finish() is called to let the source know that the drop is done.
815    * The call to gtk_drag_finish() can be done either directly or in a drag_data_received handler
816    * which gets triggered by calling drop_get_data() to receive the data for one or more of the 
817    * supported targets.
818    *
819    * @param context the drag context.
820    * @param x the x coordinate of the current cursor position.
821    * @param y the y coordinate of the current cursor position.
822    * @param time: the timestamp of the motion event.
823    * @result whether the cursor position is in a drop zone
824    */
825   _WRAP_SIGNAL(bool drag_drop(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time), "drag_drop")
826   
827   
828   /** The drag_data_received signal is emitted on the drop site when the dragged data has been 
829    * received. If the data was received in order to determine whether the drop will be accepted, 
830    * the handler is expected to call drag_status() and <emphasis>not</emphasis> finish the drag. 
831    * If the data was received in response to a drag_drop signal (and this is the last target to be 
832    * received), the handler for this signal is expected to process the received data and then call 
833    * drag_finish(), setting the @a success parameter depending on whether the data was processed 
834    * successfully.
835    *
836    * The handler may inspect and modify @drag_context->action before calling gtk_drag_finish(), 
837    * e.g. to implement %Gdk::ACTION_ASK.
838    *
839    * @param drag_context the drag context
840    * @param x where the drop happened
841    * @param y where the drop happened
842    * @param data the received data
843    * @param info the info that has been registered with the target in the TargetList.
844    * @param time the timestamp at which the data was received.
845    */
846   _WRAP_SIGNAL(void drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const SelectionData& selection_data, guint info, guint time), "drag_data_received")
847
848   //Note that the deprecated keyword has no effect on _WRAP_SIGNAL() yet.
849   //It doesn't seem like a good idea to put virtual functions in #ifdefs, because that would change the size of the class instances.
850   /** @deprecated This should never have been in the API. It was never meaningful.
851    */
852   _WRAP_SIGNAL(Glib::RefPtr<Atk::Object> get_accessible(), "get_accessible", ifdef GTKMM_ATKMM_ENABLED, refreturn, deprecated)
853   
854   _WRAP_SIGNAL(void screen_changed(const Glib::RefPtr<Gdk::Screen>& previous_screen), "screen_changed")
855
856   _WRAP_SIGNAL(void composited_changed(), "composited_changed", no_default_handler)
857
858 //TODO: The signal_id is very C-like here:                                                                          
859   //_WRAP_SIGNAL(bool can_activate_accel(guint signal_id), "can_activate_accel")
860   
861   //Keybinding signals:
862   _IGNORE_SIGNAL("popup_menu") //TODO: This might actually be useful. See the C docs.
863   _IGNORE_SIGNAL("show_help")
864   _IGNORE_SIGNAL("keynav_failed")
865
866   _IGNORE_SIGNAL("destroy-event")
867
868   // Tooltip signal
869   _WRAP_SIGNAL(bool query_tooltip(int x, int y, bool keyboard_tooltip, const Glib::RefPtr<Tooltip>& tooltip), "query_tooltip", no_default_handler)
870
871   //TODO: Wrap this (added in GTK+ 2.8 but forgotten): _WRAP_SIGNAL(bool grab_broken_event(GdkEventGrabBroken* event), "grab_broken_event", no_default_handler)
872
873   _WRAP_PROPERTY("name", Glib::ustring)
874   _WRAP_PROPERTY("parent", Container*)
875   _WRAP_PROPERTY("width_request", int)
876   _WRAP_PROPERTY("height_request", int)
877   _WRAP_PROPERTY("visible", bool)
878   _WRAP_PROPERTY("sensitive", bool)
879   _WRAP_PROPERTY("app_paintable", bool)
880   _WRAP_PROPERTY("can_focus", bool)
881   _WRAP_PROPERTY("has_focus", bool)
882   _WRAP_PROPERTY("can_default", bool)
883   _WRAP_PROPERTY("has_default", bool)
884   _WRAP_PROPERTY("receives_default", bool)
885   _WRAP_PROPERTY("composite_child", bool)
886   _WRAP_PROPERTY("style", Glib::RefPtr<Style>)
887   _WRAP_PROPERTY("events", Gdk::EventMask)
888   _WRAP_PROPERTY("extension_events", Gdk::ExtensionMode)
889   _WRAP_PROPERTY("has_tooltip", bool)
890   _WRAP_PROPERTY("tooltip_markup", Glib::ustring)
891   _WRAP_PROPERTY("tooltip_text", Glib::ustring)
892
893 protected:
894   //comment in GTK+ header: "seldomly overidden"
895   _WRAP_VFUNC(void dispatch_child_properties_changed(guint, GParamSpec**), "dispatch_child_properties_changed")
896
897   _WRAP_VFUNC(void show_all(), "show_all")
898   _WRAP_VFUNC(void hide_all(), "hide_all")
899
900   _WRAP_VFUNC(Glib::RefPtr<Atk::Object> get_accessible(), "get_accessible", refreturn, ifdef GTKMM_ATKMM_ENABLED)
901
902 protected:
903   _CTOR_DEFAULT()
904
905   _WRAP_METHOD(void realize(), gtk_widget_realize)
906   _WRAP_METHOD(void unrealize(), gtk_widget_unrealize)
907
908   _WRAP_METHOD(void get_child_requisition(Requisition& requisition) const, gtk_widget_get_child_requisition)
909
910   //The parameter name is "the_property_name" to avoid a warning because there is a method with the "property_name" name.
911   _WRAP_METHOD(void get_style_property_value(
912                    const Glib::ustring& the_property_name, Glib::ValueBase& value) const,
913                gtk_widget_style_get_property)
914
915   void realize_if_needed();
916
917   _MEMBER_SET(allocation, allocation, Allocation, GtkAllocation)
918   _MEMBER_SET_GOBJECT(window, window, Gdk::Window, GdkWindow*)
919
920 #m4begin
921 dnl// Hook in custom hierarchy_changed callback.
922 dnl// It will use the generated callback.
923 dnl
924   _PUSH(SECTION_PCC_CLASS_INIT_DEFAULT_SIGNAL_HANDLERS)
925     klass->hierarchy_changed = &hierarchy_changed_callback_custom;
926   _SECTION(SECTION_PH_DEFAULT_SIGNAL_HANDLERS)
927     static void hierarchy_changed_callback_custom(GtkWidget* self, GtkWidget* p0);
928   _POP()
929 #m4end
930
931 #m4begin
932 dnl// Hook in custom hierarchy_changed callback.
933 dnl// It will use the generated callback.
934 dnl
935   _PUSH(SECTION_PCC_CLASS_INIT_DEFAULT_SIGNAL_HANDLERS)
936     klass->parent_set = &parent_set_callback_custom;
937   _SECTION(SECTION_PH_DEFAULT_SIGNAL_HANDLERS)
938     static void parent_set_callback_custom(GtkWidget* self, GtkWidget* p0);
939   _POP()
940 #m4end
941
942 };
943
944
945 #ifndef DOXYGEN_SHOULD_SKIP_THIS
946
947 //The parameter name is "the_property_name" to avoid a warning because there is a method with the "property_name" name.
948 template <class PropertyType>
949 void Widget::get_style_property(const Glib::ustring& the_property_name, PropertyType& value) const
950 {
951   Glib::Value<PropertyType> property_value;
952   property_value.init(Glib::Value<PropertyType>::value_type());
953
954   this->get_style_property_value(the_property_name, property_value);
955
956   value = property_value.get();
957 }
958
959 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
960
961 } // namespace Gtk
962