2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD 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
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkWidget.html
71 * - pango.PgFontDescription
75 * - AtkObject* -> ObjectAtk
78 * - GdkBitmap* -> Bitmap
79 * - GdkColor* -> Color
80 * - GdkColormap* -> Colormap
81 * - GdkDisplay* -> Display
82 * - GdkEvent* -> Event
83 * - GdkPixbuf* -> Pixbuf
84 * - GdkRectangle* -> Rectangle
85 * - GdkRegion* -> Region
86 * - GdkScreen* -> Screen
87 * - GdkVisual* -> Visual
88 * - GdkWindow* -> Window
89 * - GtkAccelGroup* -> AccelGroup
90 * - GtkAdjustment* -> Adjustment
91 * - GtkClipboard* -> Clipboard
92 * - GtkRcStyle* -> RcStyle
93 * - GtkSettings* -> Settings
94 * - GtkStyle* -> Style
95 * - PangoContext* -> PgContext
96 * - PangoFontDescription* -> PgFontDescription
97 * - PangoLayout* -> PgLayout
108 import tango
.io
.Stdout
; // use the tango loging?
112 private import gtkc
.gtktypes
;
114 private import gtkc
.gtk
;
117 private import glib
.Str
;
118 private import atk
.ObjectAtk
;
119 private import gdk
.Rectangle
;
120 private import gtk
.AccelGroup
;
121 private import glib
.ListG
;
122 private import gdk
.Event
;
123 private import gdk
.Window
;
124 private import gdk
.Colormap
;
125 private import gdk
.Visual
;
126 private import gtk
.Style
;
127 private import gdk
.Bitmap
;
128 private import gtk
.RcStyle
;
129 private import gdk
.Color
;
130 private import gdk
.Pixbuf
;
131 private import gtk
.Adjustment
;
132 private import gdk
.Region
;
133 private import gobject
.Value
;
134 private import gtk
.Settings
;
135 private import gtk
.Clipboard
;
136 private import gdk
.Display
;
137 private import gdk
.Screen
;
138 private import gtkc
.gdk
;
139 private import gdk
.Cursor
;
140 private import pango
.PgLayout
;
141 private import pango
.PgContext
;
142 private import pango
.PgFontDescription
;
143 private import gdk
.Drawable
;
144 private import gtk
.Tooltips
;
151 * GtkWidget introduces style
152 * properties - these are basically object properties that are stored
153 * not on the object, but in the style object associated to the widget. Style
154 * properties are set in resource files.
155 * This mechanism is used for configuring such things as the location of the
156 * scrollbar arrows through the theme, giving theme authors more control over the
157 * look of applications without the need to write a theme engine in C.
158 * Use gtk_widget_class_install_style_property() to install style properties for
159 * a widget class, gtk_widget_class_find_style_property() or
160 * gtk_widget_class_list_style_properties() to get information about existing
161 * style properties and gtk_widget_style_get_property(), gtk_widget_style_get() or
162 * gtk_widget_style_get_valist() to obtain the value of a style property.
164 private import gtk
.ObjectGtk
;
165 public class Widget
: ObjectGtk
168 /** the main Gtk struct */
169 protected GtkWidget
* gtkWidget
;
172 public GtkWidget
* getWidgetStruct()
178 /** the main Gtk struct as a void* */
179 protected void* getStruct()
181 return cast(void*)gtkWidget
;
185 * Sets our main struct and passes it to the parent class
187 public this (GtkWidget
* gtkWidget
)
191 if ( gtkWidget
is null )
196 Stdout("struct gtkWidget is null on constructor").newline
;
200 printf("struct gtkWidget is null on constructor");
207 assert(gtkWidget
!is null, "struct gtkWidget is null on constructor");
209 super(cast(GtkObject
*)gtkWidget
);
210 this.gtkWidget
= gtkWidget
;
213 public int getWidth()
216 gtk_widget_get_size_request(gtkWidget
, &width
, null);
219 public int getHeight()
222 gtk_widget_get_size_request(gtkWidget
, null, &height
);
227 * Gets the drawable for this widget
229 * The drawable for this widget
231 Drawable
getDrawable()
234 // ubyte *p = cast(ubyte*)getStruct();
236 // for ( int i=0 ; i<120 ; i+=4 )
238 // printf("(%d) %X %x %x %x %x\n", i,p,*(p+0), *(p+1), *(p+2), *(p+3));
242 // int* pt =cast(int*)getStruct();
244 // printf("pt=%X strcut=%X\n", pt, getStruct());
245 // printf("*pt=%X\n", *pt);
247 // printf("pt+52=%X strcut.window=%X\n", pt, getWidgetStruct().window);
248 // printf("*pt+52=%X\n", *pt);
250 // //return new Drawable(cast(GdkDrawable*)(getWidgetStruct().window));
251 int* pt
=cast(int*)getStruct();
253 return new Drawable(cast(GdkDrawable
*)(*pt
));
256 * Gets the Window for this widget
258 * The window for this widget
263 // ubyte *p = cast(ubyte*)getStruct();
265 // for ( int i=0 ; i<120 ; i+=4 )
267 // printf("(%d) %X %x %x %x %x\n", i,p,*(p+0), *(p+1), *(p+2), *(p+3));
271 // int* pt =cast(int*)getStruct();
273 // printf("pt=%X strcut=%X\n", pt, getStruct());
274 // printf("*pt=%X\n", *pt);
276 // printf("pt+52=%X strcut.window=%X\n", pt, getWidgetStruct().window);
277 // printf("*pt+52=%X\n", *pt);
279 // //return new Drawable(cast(GdkDrawable*)(getWidgetStruct().window));
280 int* pt
=cast(int*)getStruct();
282 return new Window(cast(GdkWindow
*)(*pt
));
286 * @param cursor the new cursor
287 * \bug the cursor changes to the parent widget also
289 void setCursor(Cursor cursor
)
291 int* pt
=cast(int*)getStruct();
293 gdk_window_set_cursor(cast(GdkWindow
*)(*pt
), cursor
.getCursorStruct());
298 * don't know if this is implemented by GTK+. Seems that it's not
301 public void resetCursor()
303 int* pt
=cast(int*)getStruct();
305 gdk_window_set_cursor(cast(GdkWindow
*)(*pt
), null);
308 version(Tango
)import tango
.text
.convert
.Integer
;
311 * Modifies the font for this widget.
312 * This just calls modifyFont(new PgFontDescription(PgFontDescription.fromString(family ~ " " ~ size)));
314 public void modifyFont(char[] family
, int size
)
316 if ( size
< 0 ) size
= -size
; // hack to workaround leds bug - TO BE REMOVED
322 new PgFontDescription(
323 PgFontDescription
.fromString(
324 family
~ " " ~ itoa(s
,size
)
332 new PgFontDescription(
333 PgFontDescription
.fromString(
334 family
~ " " ~ std
.string
.toString(size
)
343 * Sets this widget tooltip
344 * @param tipText the tooltip
345 * @param tipPrivate a private text
347 void setTooltip(char[] tipText
, char[] tipPrivate
)
349 Tooltips tt
= new Tooltips();
350 tt
.setTip(this, tipText
, tipPrivate
);
358 // imports for the signal processing
359 private import gobject
.Signals
;
360 private import gtkc
.gdktypes
;
361 int[char[]] connectedSignals
;
363 void delegate(Widget
)[] onAccelClosuresChangedListeners
;
364 void addOnAccelClosuresChanged(void delegate(Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
366 if ( !("accel-closures-changed" in connectedSignals
) )
370 "accel-closures-changed",
371 cast(GCallback
)&callBackAccelClosuresChanged
,
375 connectedSignals
["accel-closures-changed"] = 1;
377 onAccelClosuresChangedListeners
~= dlg
;
379 extern(C
) static void callBackAccelClosuresChanged(GtkWidget
* widgetStruct
, Widget widget
)
381 bool consumed
= false;
383 foreach ( void delegate(Widget
) dlg
; widget
.onAccelClosuresChangedListeners
)
391 gboolean
delegate(GdkEventButton
*, Widget
)[] onButtonPressListeners
;
392 void addOnButtonPress(gboolean
delegate(GdkEventButton
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
394 if ( !("button-press-event" in connectedSignals
) )
396 addEvents(EventMask
.BUTTON_PRESS_MASK
);
399 "button-press-event",
400 cast(GCallback
)&callBackButtonPress
,
404 connectedSignals
["button-press-event"] = 1;
406 onButtonPressListeners
~= dlg
;
408 extern(C
) static void callBackButtonPress(GtkWidget
* widgetStruct
, GdkEventButton
* event
, Widget widget
)
410 bool consumed
= false;
412 foreach ( gboolean
delegate(GdkEventButton
*, Widget
) dlg
; widget
.onButtonPressListeners
)
420 gboolean
delegate(GdkEventButton
*, Widget
)[] onButtonReleaseListeners
;
421 void addOnButtonRelease(gboolean
delegate(GdkEventButton
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
423 if ( !("button-release-event" in connectedSignals
) )
425 addEvents(EventMask
.BUTTON_RELEASE_MASK
);
428 "button-release-event",
429 cast(GCallback
)&callBackButtonRelease
,
433 connectedSignals
["button-release-event"] = 1;
435 onButtonReleaseListeners
~= dlg
;
437 extern(C
) static void callBackButtonRelease(GtkWidget
* widgetStruct
, GdkEventButton
* event
, Widget widget
)
439 bool consumed
= false;
441 foreach ( gboolean
delegate(GdkEventButton
*, Widget
) dlg
; widget
.onButtonReleaseListeners
)
449 gboolean
delegate(guint
, Widget
)[] onCanActivateAccelListeners
;
450 void addOnCanActivateAccel(gboolean
delegate(guint
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
452 if ( !("can-activate-accel" in connectedSignals
) )
456 "can-activate-accel",
457 cast(GCallback
)&callBackCanActivateAccel
,
461 connectedSignals
["can-activate-accel"] = 1;
463 onCanActivateAccelListeners
~= dlg
;
465 extern(C
) static void callBackCanActivateAccel(GtkWidget
* widgetStruct
, guint signalId
, Widget widget
)
467 bool consumed
= false;
469 foreach ( gboolean
delegate(guint
, Widget
) dlg
; widget
.onCanActivateAccelListeners
)
471 dlg(signalId
, widget
);
477 void delegate(GParamSpec
*, Widget
)[] onChildNotifyListeners
;
478 void addOnChildNotify(void delegate(GParamSpec
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
480 if ( !("child-notify" in connectedSignals
) )
485 cast(GCallback
)&callBackChildNotify
,
489 connectedSignals
["child-notify"] = 1;
491 onChildNotifyListeners
~= dlg
;
493 extern(C
) static void callBackChildNotify(GtkWidget
* widgetStruct
, GParamSpec
* pspec
, Widget widget
)
495 bool consumed
= false;
497 foreach ( void delegate(GParamSpec
*, Widget
) dlg
; widget
.onChildNotifyListeners
)
505 gboolean
delegate(GdkEventClient
*, Widget
)[] onClientListeners
;
506 void addOnClient(gboolean
delegate(GdkEventClient
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
508 if ( !("client-event" in connectedSignals
) )
513 cast(GCallback
)&callBackClient
,
517 connectedSignals
["client-event"] = 1;
519 onClientListeners
~= dlg
;
521 extern(C
) static void callBackClient(GtkWidget
* widgetStruct
, GdkEventClient
* event
, Widget widget
)
523 bool consumed
= false;
525 foreach ( gboolean
delegate(GdkEventClient
*, Widget
) dlg
; widget
.onClientListeners
)
533 void delegate(Widget
)[] onCompositedChangedListeners
;
534 void addOnCompositedChanged(void delegate(Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
536 if ( !("composited-changed" in connectedSignals
) )
540 "composited-changed",
541 cast(GCallback
)&callBackCompositedChanged
,
545 connectedSignals
["composited-changed"] = 1;
547 onCompositedChangedListeners
~= dlg
;
549 extern(C
) static void callBackCompositedChanged(GtkWidget
* widgetStruct
, Widget widget
)
551 bool consumed
= false;
553 foreach ( void delegate(Widget
) dlg
; widget
.onCompositedChangedListeners
)
561 gboolean
delegate(GdkEventConfigure
*, Widget
)[] onConfigureListeners
;
562 void addOnConfigure(gboolean
delegate(GdkEventConfigure
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
564 if ( !("configure-event" in connectedSignals
) )
569 cast(GCallback
)&callBackConfigure
,
573 connectedSignals
["configure-event"] = 1;
575 onConfigureListeners
~= dlg
;
577 extern(C
) static void callBackConfigure(GtkWidget
* widgetStruct
, GdkEventConfigure
* event
, Widget widget
)
579 bool consumed
= false;
581 foreach ( gboolean
delegate(GdkEventConfigure
*, Widget
) dlg
; widget
.onConfigureListeners
)
589 gboolean
delegate(Event
, Widget
)[] onDeleteListeners
;
590 void addOnDelete(gboolean
delegate(Event
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
592 if ( !("delete-event" in connectedSignals
) )
597 cast(GCallback
)&callBackDelete
,
601 connectedSignals
["delete-event"] = 1;
603 onDeleteListeners
~= dlg
;
605 extern(C
) static void callBackDelete(GtkWidget
* widgetStruct
, GdkEvent
* event
, Widget widget
)
607 bool consumed
= false;
609 foreach ( gboolean
delegate(Event
, Widget
) dlg
; widget
.onDeleteListeners
)
611 dlg(new Event(event
), widget
);
617 gboolean
delegate(Event
, Widget
)[] onDestroyListeners
;
618 void addOnDestroy(gboolean
delegate(Event
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
620 if ( !("destroy-event" in connectedSignals
) )
625 cast(GCallback
)&callBackDestroy
,
629 connectedSignals
["destroy-event"] = 1;
631 onDestroyListeners
~= dlg
;
633 extern(C
) static void callBackDestroy(GtkWidget
* widgetStruct
, GdkEvent
* event
, Widget widget
)
635 bool consumed
= false;
637 foreach ( gboolean
delegate(Event
, Widget
) dlg
; widget
.onDestroyListeners
)
639 dlg(new Event(event
), widget
);
645 void delegate(GtkTextDirection
, Widget
)[] onDirectionChangedListeners
;
646 void addOnDirectionChanged(void delegate(GtkTextDirection
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
648 if ( !("direction-changed" in connectedSignals
) )
653 cast(GCallback
)&callBackDirectionChanged
,
657 connectedSignals
["direction-changed"] = 1;
659 onDirectionChangedListeners
~= dlg
;
661 extern(C
) static void callBackDirectionChanged(GtkWidget
* widgetStruct
, GtkTextDirection arg1
, Widget widget
)
663 bool consumed
= false;
665 foreach ( void delegate(GtkTextDirection
, Widget
) dlg
; widget
.onDirectionChangedListeners
)
673 void delegate(GdkDragContext
*, Widget
)[] onDragBeginListeners
;
674 void addOnDragBegin(void delegate(GdkDragContext
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
676 if ( !("drag-begin" in connectedSignals
) )
681 cast(GCallback
)&callBackDragBegin
,
685 connectedSignals
["drag-begin"] = 1;
687 onDragBeginListeners
~= dlg
;
689 extern(C
) static void callBackDragBegin(GtkWidget
* widgetStruct
, GdkDragContext
* dragContext
, Widget widget
)
691 bool consumed
= false;
693 foreach ( void delegate(GdkDragContext
*, Widget
) dlg
; widget
.onDragBeginListeners
)
695 dlg(dragContext
, widget
);
701 void delegate(GdkDragContext
*, Widget
)[] onDragDataDeleteListeners
;
702 void addOnDragDataDelete(void delegate(GdkDragContext
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
704 if ( !("drag-data-delete" in connectedSignals
) )
709 cast(GCallback
)&callBackDragDataDelete
,
713 connectedSignals
["drag-data-delete"] = 1;
715 onDragDataDeleteListeners
~= dlg
;
717 extern(C
) static void callBackDragDataDelete(GtkWidget
* widgetStruct
, GdkDragContext
* dragContext
, Widget widget
)
719 bool consumed
= false;
721 foreach ( void delegate(GdkDragContext
*, Widget
) dlg
; widget
.onDragDataDeleteListeners
)
723 dlg(dragContext
, widget
);
729 void delegate(GdkDragContext
*, GtkSelectionData
*, guint
, guint
, Widget
)[] onDragDataGetListeners
;
730 void addOnDragDataGet(void delegate(GdkDragContext
*, GtkSelectionData
*, guint
, guint
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
732 if ( !("drag-data-get" in connectedSignals
) )
737 cast(GCallback
)&callBackDragDataGet
,
741 connectedSignals
["drag-data-get"] = 1;
743 onDragDataGetListeners
~= dlg
;
745 extern(C
) static void callBackDragDataGet(GtkWidget
* widgetStruct
, GdkDragContext
* dragContext
, GtkSelectionData
* data
, guint info
, guint time
, Widget widget
)
747 bool consumed
= false;
749 foreach ( void delegate(GdkDragContext
*, GtkSelectionData
*, guint
, guint
, Widget
) dlg
; widget
.onDragDataGetListeners
)
751 dlg(dragContext
, data
, info
, time
, widget
);
757 void delegate(GdkDragContext
*, gint
, gint
, GtkSelectionData
*, guint
, guint
, Widget
)[] onDragDataReceivedListeners
;
758 void addOnDragDataReceived(void delegate(GdkDragContext
*, gint
, gint
, GtkSelectionData
*, guint
, guint
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
760 if ( !("drag-data-received" in connectedSignals
) )
764 "drag-data-received",
765 cast(GCallback
)&callBackDragDataReceived
,
769 connectedSignals
["drag-data-received"] = 1;
771 onDragDataReceivedListeners
~= dlg
;
773 extern(C
) static void callBackDragDataReceived(GtkWidget
* widgetStruct
, GdkDragContext
* dragContext
, gint x
, gint y
, GtkSelectionData
* data
, guint info
, guint time
, Widget widget
)
775 bool consumed
= false;
777 foreach ( void delegate(GdkDragContext
*, gint
, gint
, GtkSelectionData
*, guint
, guint
, Widget
) dlg
; widget
.onDragDataReceivedListeners
)
779 dlg(dragContext
, x
, y
, data
, info
, time
, widget
);
785 gboolean
delegate(GdkDragContext
*, gint
, gint
, guint
, Widget
)[] onDragDropListeners
;
786 void addOnDragDrop(gboolean
delegate(GdkDragContext
*, gint
, gint
, guint
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
788 if ( !("drag-drop" in connectedSignals
) )
793 cast(GCallback
)&callBackDragDrop
,
797 connectedSignals
["drag-drop"] = 1;
799 onDragDropListeners
~= dlg
;
801 extern(C
) static void callBackDragDrop(GtkWidget
* widgetStruct
, GdkDragContext
* dragContext
, gint x
, gint y
, guint time
, Widget widget
)
803 bool consumed
= false;
805 foreach ( gboolean
delegate(GdkDragContext
*, gint
, gint
, guint
, Widget
) dlg
; widget
.onDragDropListeners
)
807 dlg(dragContext
, x
, y
, time
, widget
);
813 void delegate(GdkDragContext
*, Widget
)[] onDragEndListeners
;
814 void addOnDragEnd(void delegate(GdkDragContext
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
816 if ( !("drag-end" in connectedSignals
) )
821 cast(GCallback
)&callBackDragEnd
,
825 connectedSignals
["drag-end"] = 1;
827 onDragEndListeners
~= dlg
;
829 extern(C
) static void callBackDragEnd(GtkWidget
* widgetStruct
, GdkDragContext
* dragContext
, Widget widget
)
831 bool consumed
= false;
833 foreach ( void delegate(GdkDragContext
*, Widget
) dlg
; widget
.onDragEndListeners
)
835 dlg(dragContext
, widget
);
841 gboolean
delegate(GdkDragContext
*, GtkDragResult
, Widget
)[] onDragFailedListeners
;
842 void addOnDragFailed(gboolean
delegate(GdkDragContext
*, GtkDragResult
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
844 if ( !("drag-failed" in connectedSignals
) )
849 cast(GCallback
)&callBackDragFailed
,
853 connectedSignals
["drag-failed"] = 1;
855 onDragFailedListeners
~= dlg
;
857 extern(C
) static void callBackDragFailed(GtkWidget
* widgetStruct
, GdkDragContext
* dragContext
, GtkDragResult result
, Widget widget
)
859 bool consumed
= false;
861 foreach ( gboolean
delegate(GdkDragContext
*, GtkDragResult
, Widget
) dlg
; widget
.onDragFailedListeners
)
863 dlg(dragContext
, result
, widget
);
869 void delegate(GdkDragContext
*, guint
, Widget
)[] onDragLeaveListeners
;
870 void addOnDragLeave(void delegate(GdkDragContext
*, guint
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
872 if ( !("drag-leave" in connectedSignals
) )
877 cast(GCallback
)&callBackDragLeave
,
881 connectedSignals
["drag-leave"] = 1;
883 onDragLeaveListeners
~= dlg
;
885 extern(C
) static void callBackDragLeave(GtkWidget
* widgetStruct
, GdkDragContext
* dragContext
, guint time
, Widget widget
)
887 bool consumed
= false;
889 foreach ( void delegate(GdkDragContext
*, guint
, Widget
) dlg
; widget
.onDragLeaveListeners
)
891 dlg(dragContext
, time
, widget
);
897 gboolean
delegate(GdkDragContext
*, gint
, gint
, guint
, Widget
)[] onDragMotionListeners
;
898 void addOnDragMotion(gboolean
delegate(GdkDragContext
*, gint
, gint
, guint
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
900 if ( !("drag-motion" in connectedSignals
) )
905 cast(GCallback
)&callBackDragMotion
,
909 connectedSignals
["drag-motion"] = 1;
911 onDragMotionListeners
~= dlg
;
913 extern(C
) static void callBackDragMotion(GtkWidget
* widgetStruct
, GdkDragContext
* dragContext
, gint x
, gint y
, guint time
, Widget widget
)
915 bool consumed
= false;
917 foreach ( gboolean
delegate(GdkDragContext
*, gint
, gint
, guint
, Widget
) dlg
; widget
.onDragMotionListeners
)
919 dlg(dragContext
, x
, y
, time
, widget
);
925 gboolean
delegate(GdkEventCrossing
*, Widget
)[] onEnterNotifyListeners
;
926 void addOnEnterNotify(gboolean
delegate(GdkEventCrossing
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
928 if ( !("enter-notify-event" in connectedSignals
) )
932 "enter-notify-event",
933 cast(GCallback
)&callBackEnterNotify
,
937 connectedSignals
["enter-notify-event"] = 1;
939 onEnterNotifyListeners
~= dlg
;
941 extern(C
) static void callBackEnterNotify(GtkWidget
* widgetStruct
, GdkEventCrossing
* event
, Widget widget
)
943 bool consumed
= false;
945 foreach ( gboolean
delegate(GdkEventCrossing
*, Widget
) dlg
; widget
.onEnterNotifyListeners
)
953 gboolean
delegate(Event
, Widget
)[] onListeners
;
954 void addOn(gboolean
delegate(Event
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
956 if ( !("event" in connectedSignals
) )
961 cast(GCallback
)&callBack
,
965 connectedSignals
["event"] = 1;
969 extern(C
) static void callBack(GtkWidget
* widgetStruct
, GdkEvent
* event
, Widget widget
)
971 bool consumed
= false;
973 foreach ( gboolean
delegate(Event
, Widget
) dlg
; widget
.onListeners
)
975 dlg(new Event(event
), widget
);
981 void delegate(Event
, Widget
)[] onEventAfterListeners
;
982 void addOnEventAfter(void delegate(Event
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
984 if ( !("event-after" in connectedSignals
) )
989 cast(GCallback
)&callBackEventAfter
,
993 connectedSignals
["event-after"] = 1;
995 onEventAfterListeners
~= dlg
;
997 extern(C
) static void callBackEventAfter(GtkWidget
* widgetStruct
, GdkEvent
* event
, Widget widget
)
999 bool consumed
= false;
1001 foreach ( void delegate(Event
, Widget
) dlg
; widget
.onEventAfterListeners
)
1003 dlg(new Event(event
), widget
);
1009 gboolean
delegate(GdkEventExpose
*, Widget
)[] onExposeListeners
;
1010 void addOnExpose(gboolean
delegate(GdkEventExpose
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1012 if ( !("expose-event" in connectedSignals
) )
1014 Signals
.connectData(
1017 cast(GCallback
)&callBackExpose
,
1021 connectedSignals
["expose-event"] = 1;
1023 onExposeListeners
~= dlg
;
1025 extern(C
) static void callBackExpose(GtkWidget
* widgetStruct
, GdkEventExpose
* event
, Widget widget
)
1027 bool consumed
= false;
1029 foreach ( gboolean
delegate(GdkEventExpose
*, Widget
) dlg
; widget
.onExposeListeners
)
1037 gboolean
delegate(GtkDirectionType
, Widget
)[] onFocusListeners
;
1038 void addOnFocus(gboolean
delegate(GtkDirectionType
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1040 if ( !("focus" in connectedSignals
) )
1042 Signals
.connectData(
1045 cast(GCallback
)&callBackFocus
,
1049 connectedSignals
["focus"] = 1;
1051 onFocusListeners
~= dlg
;
1053 extern(C
) static void callBackFocus(GtkWidget
* widgetStruct
, GtkDirectionType arg1
, Widget widget
)
1055 bool consumed
= false;
1057 foreach ( gboolean
delegate(GtkDirectionType
, Widget
) dlg
; widget
.onFocusListeners
)
1065 gboolean
delegate(GdkEventFocus
*, Widget
)[] onFocusInListeners
;
1066 void addOnFocusIn(gboolean
delegate(GdkEventFocus
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1068 if ( !("focus-in-event" in connectedSignals
) )
1070 Signals
.connectData(
1073 cast(GCallback
)&callBackFocusIn
,
1077 connectedSignals
["focus-in-event"] = 1;
1079 onFocusInListeners
~= dlg
;
1081 extern(C
) static void callBackFocusIn(GtkWidget
* widgetStruct
, GdkEventFocus
* event
, Widget widget
)
1083 bool consumed
= false;
1085 foreach ( gboolean
delegate(GdkEventFocus
*, Widget
) dlg
; widget
.onFocusInListeners
)
1093 gboolean
delegate(GdkEventFocus
*, Widget
)[] onFocusOutListeners
;
1094 void addOnFocusOut(gboolean
delegate(GdkEventFocus
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1096 if ( !("focus-out-event" in connectedSignals
) )
1098 Signals
.connectData(
1101 cast(GCallback
)&callBackFocusOut
,
1105 connectedSignals
["focus-out-event"] = 1;
1107 onFocusOutListeners
~= dlg
;
1109 extern(C
) static void callBackFocusOut(GtkWidget
* widgetStruct
, GdkEventFocus
* event
, Widget widget
)
1111 bool consumed
= false;
1113 foreach ( gboolean
delegate(GdkEventFocus
*, Widget
) dlg
; widget
.onFocusOutListeners
)
1121 gboolean
delegate(Event
, Widget
)[] onGrabBrokenListeners
;
1122 void addOnGrabBroken(gboolean
delegate(Event
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1124 if ( !("grab-broken-event" in connectedSignals
) )
1126 Signals
.connectData(
1128 "grab-broken-event",
1129 cast(GCallback
)&callBackGrabBroken
,
1133 connectedSignals
["grab-broken-event"] = 1;
1135 onGrabBrokenListeners
~= dlg
;
1137 extern(C
) static void callBackGrabBroken(GtkWidget
* widgetStruct
, GdkEvent
* event
, Widget widget
)
1139 bool consumed
= false;
1141 foreach ( gboolean
delegate(Event
, Widget
) dlg
; widget
.onGrabBrokenListeners
)
1143 dlg(new Event(event
), widget
);
1149 void delegate(Widget
)[] onGrabFocusListeners
;
1150 void addOnGrabFocus(void delegate(Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1152 if ( !("grab-focus" in connectedSignals
) )
1154 Signals
.connectData(
1157 cast(GCallback
)&callBackGrabFocus
,
1161 connectedSignals
["grab-focus"] = 1;
1163 onGrabFocusListeners
~= dlg
;
1165 extern(C
) static void callBackGrabFocus(GtkWidget
* widgetStruct
, Widget widget
)
1167 bool consumed
= false;
1169 foreach ( void delegate(Widget
) dlg
; widget
.onGrabFocusListeners
)
1177 void delegate(gboolean
, Widget
)[] onGrabNotifyListeners
;
1178 void addOnGrabNotify(void delegate(gboolean
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1180 if ( !("grab-notify" in connectedSignals
) )
1182 Signals
.connectData(
1185 cast(GCallback
)&callBackGrabNotify
,
1189 connectedSignals
["grab-notify"] = 1;
1191 onGrabNotifyListeners
~= dlg
;
1193 extern(C
) static void callBackGrabNotify(GtkWidget
* widgetStruct
, gboolean wasGrabbed
, Widget widget
)
1195 bool consumed
= false;
1197 foreach ( void delegate(gboolean
, Widget
) dlg
; widget
.onGrabNotifyListeners
)
1199 dlg(wasGrabbed
, widget
);
1205 void delegate(Widget
)[] onHideListeners
;
1206 void addOnHide(void delegate(Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1208 if ( !("hide" in connectedSignals
) )
1210 Signals
.connectData(
1213 cast(GCallback
)&callBackHide
,
1217 connectedSignals
["hide"] = 1;
1219 onHideListeners
~= dlg
;
1221 extern(C
) static void callBackHide(GtkWidget
* widgetStruct
, Widget widget
)
1223 bool consumed
= false;
1225 foreach ( void delegate(Widget
) dlg
; widget
.onHideListeners
)
1233 void delegate(GtkWidget
*, Widget
)[] onHierarchyChangedListeners
;
1234 void addOnHierarchyChanged(void delegate(GtkWidget
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1236 if ( !("hierarchy-changed" in connectedSignals
) )
1238 Signals
.connectData(
1240 "hierarchy-changed",
1241 cast(GCallback
)&callBackHierarchyChanged
,
1245 connectedSignals
["hierarchy-changed"] = 1;
1247 onHierarchyChangedListeners
~= dlg
;
1249 extern(C
) static void callBackHierarchyChanged(GtkWidget
* widgetStruct
, GtkWidget
* widget2
, Widget widget
)
1251 bool consumed
= false;
1253 foreach ( void delegate(GtkWidget
*, Widget
) dlg
; widget
.onHierarchyChangedListeners
)
1255 dlg(widget2
, widget
);
1261 gboolean
delegate(GdkEventKey
*, Widget
)[] onKeyPressListeners
;
1262 void addOnKeyPress(gboolean
delegate(GdkEventKey
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1264 if ( !("key-press-event" in connectedSignals
) )
1266 Signals
.connectData(
1269 cast(GCallback
)&callBackKeyPress
,
1273 connectedSignals
["key-press-event"] = 1;
1275 onKeyPressListeners
~= dlg
;
1277 extern(C
) static void callBackKeyPress(GtkWidget
* widgetStruct
, GdkEventKey
* event
, Widget widget
)
1279 bool consumed
= false;
1281 foreach ( gboolean
delegate(GdkEventKey
*, Widget
) dlg
; widget
.onKeyPressListeners
)
1289 gboolean
delegate(GdkEventKey
*, Widget
)[] onKeyReleaseListeners
;
1290 void addOnKeyRelease(gboolean
delegate(GdkEventKey
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1292 if ( !("key-release-event" in connectedSignals
) )
1294 Signals
.connectData(
1296 "key-release-event",
1297 cast(GCallback
)&callBackKeyRelease
,
1301 connectedSignals
["key-release-event"] = 1;
1303 onKeyReleaseListeners
~= dlg
;
1305 extern(C
) static void callBackKeyRelease(GtkWidget
* widgetStruct
, GdkEventKey
* event
, Widget widget
)
1307 bool consumed
= false;
1309 foreach ( gboolean
delegate(GdkEventKey
*, Widget
) dlg
; widget
.onKeyReleaseListeners
)
1317 gboolean
delegate(GtkDirectionType
, Widget
)[] onKeynavFailedListeners
;
1318 void addOnKeynavFailed(gboolean
delegate(GtkDirectionType
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1320 if ( !("keynav-failed" in connectedSignals
) )
1322 Signals
.connectData(
1325 cast(GCallback
)&callBackKeynavFailed
,
1329 connectedSignals
["keynav-failed"] = 1;
1331 onKeynavFailedListeners
~= dlg
;
1333 extern(C
) static void callBackKeynavFailed(GtkWidget
* widgetStruct
, GtkDirectionType direction
, Widget widget
)
1335 bool consumed
= false;
1337 foreach ( gboolean
delegate(GtkDirectionType
, Widget
) dlg
; widget
.onKeynavFailedListeners
)
1339 dlg(direction
, widget
);
1345 gboolean
delegate(GdkEventCrossing
*, Widget
)[] onLeaveNotifyListeners
;
1346 void addOnLeaveNotify(gboolean
delegate(GdkEventCrossing
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1348 if ( !("leave-notify-event" in connectedSignals
) )
1350 Signals
.connectData(
1352 "leave-notify-event",
1353 cast(GCallback
)&callBackLeaveNotify
,
1357 connectedSignals
["leave-notify-event"] = 1;
1359 onLeaveNotifyListeners
~= dlg
;
1361 extern(C
) static void callBackLeaveNotify(GtkWidget
* widgetStruct
, GdkEventCrossing
* event
, Widget widget
)
1363 bool consumed
= false;
1365 foreach ( gboolean
delegate(GdkEventCrossing
*, Widget
) dlg
; widget
.onLeaveNotifyListeners
)
1373 void delegate(Widget
)[] onMapListeners
;
1374 void addOnMap(void delegate(Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1376 if ( !("map" in connectedSignals
) )
1378 Signals
.connectData(
1381 cast(GCallback
)&callBackMap
,
1385 connectedSignals
["map"] = 1;
1387 onMapListeners
~= dlg
;
1389 extern(C
) static void callBackMap(GtkWidget
* widgetStruct
, Widget widget
)
1391 bool consumed
= false;
1393 foreach ( void delegate(Widget
) dlg
; widget
.onMapListeners
)
1401 gboolean
delegate(Event
, Widget
)[] onMapEventListeners
;
1402 void addOnMapEvent(gboolean
delegate(Event
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1404 if ( !("map-event" in connectedSignals
) )
1406 Signals
.connectData(
1409 cast(GCallback
)&callBackMapEvent
,
1413 connectedSignals
["map-event"] = 1;
1415 onMapEventListeners
~= dlg
;
1417 extern(C
) static void callBackMapEvent(GtkWidget
* widgetStruct
, GdkEvent
* event
, Widget widget
)
1419 bool consumed
= false;
1421 foreach ( gboolean
delegate(Event
, Widget
) dlg
; widget
.onMapEventListeners
)
1423 dlg(new Event(event
), widget
);
1429 gboolean
delegate(gboolean
, Widget
)[] onMnemonicActivateListeners
;
1430 void addOnMnemonicActivate(gboolean
delegate(gboolean
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1432 if ( !("mnemonic-activate" in connectedSignals
) )
1434 Signals
.connectData(
1436 "mnemonic-activate",
1437 cast(GCallback
)&callBackMnemonicActivate
,
1441 connectedSignals
["mnemonic-activate"] = 1;
1443 onMnemonicActivateListeners
~= dlg
;
1445 extern(C
) static void callBackMnemonicActivate(GtkWidget
* widgetStruct
, gboolean arg1
, Widget widget
)
1447 bool consumed
= false;
1449 foreach ( gboolean
delegate(gboolean
, Widget
) dlg
; widget
.onMnemonicActivateListeners
)
1457 gboolean
delegate(GdkEventMotion
*, Widget
)[] onMotionNotifyListeners
;
1458 void addOnMotionNotify(gboolean
delegate(GdkEventMotion
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1460 if ( !("motion-notify-event" in connectedSignals
) )
1462 addEvents(EventMask
.POINTER_MOTION_MASK
);
1463 Signals
.connectData(
1465 "motion-notify-event",
1466 cast(GCallback
)&callBackMotionNotify
,
1470 connectedSignals
["motion-notify-event"] = 1;
1472 onMotionNotifyListeners
~= dlg
;
1474 extern(C
) static void callBackMotionNotify(GtkWidget
* widgetStruct
, GdkEventMotion
* event
, Widget widget
)
1476 bool consumed
= false;
1478 foreach ( gboolean
delegate(GdkEventMotion
*, Widget
) dlg
; widget
.onMotionNotifyListeners
)
1486 gboolean
delegate(GdkEventNoExpose
*, Widget
)[] onNoExposeListeners
;
1487 void addOnNoExpose(gboolean
delegate(GdkEventNoExpose
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1489 if ( !("no-expose-event" in connectedSignals
) )
1491 Signals
.connectData(
1494 cast(GCallback
)&callBackNoExpose
,
1498 connectedSignals
["no-expose-event"] = 1;
1500 onNoExposeListeners
~= dlg
;
1502 extern(C
) static void callBackNoExpose(GtkWidget
* widgetStruct
, GdkEventNoExpose
* event
, Widget widget
)
1504 bool consumed
= false;
1506 foreach ( gboolean
delegate(GdkEventNoExpose
*, Widget
) dlg
; widget
.onNoExposeListeners
)
1514 void delegate(GtkObject
*, Widget
)[] onParentSetListeners
;
1515 void addOnParentSet(void delegate(GtkObject
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1517 if ( !("parent-set" in connectedSignals
) )
1519 Signals
.connectData(
1522 cast(GCallback
)&callBackParentSet
,
1526 connectedSignals
["parent-set"] = 1;
1528 onParentSetListeners
~= dlg
;
1530 extern(C
) static void callBackParentSet(GtkWidget
* widgetStruct
, GtkObject
* oldParent
, Widget widget
)
1532 bool consumed
= false;
1534 foreach ( void delegate(GtkObject
*, Widget
) dlg
; widget
.onParentSetListeners
)
1536 dlg(oldParent
, widget
);
1542 gboolean
delegate(Widget
)[] onPopupMenuListeners
;
1543 void addOnPopupMenu(gboolean
delegate(Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1545 if ( !("popup-menu" in connectedSignals
) )
1547 Signals
.connectData(
1550 cast(GCallback
)&callBackPopupMenu
,
1554 connectedSignals
["popup-menu"] = 1;
1556 onPopupMenuListeners
~= dlg
;
1558 extern(C
) static void callBackPopupMenu(GtkWidget
* widgetStruct
, Widget widget
)
1560 bool consumed
= false;
1562 foreach ( gboolean
delegate(Widget
) dlg
; widget
.onPopupMenuListeners
)
1570 gboolean
delegate(GdkEventProperty
*, Widget
)[] onPropertyNotifyListeners
;
1571 void addOnPropertyNotify(gboolean
delegate(GdkEventProperty
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1573 if ( !("property-notify-event" in connectedSignals
) )
1575 Signals
.connectData(
1577 "property-notify-event",
1578 cast(GCallback
)&callBackPropertyNotify
,
1582 connectedSignals
["property-notify-event"] = 1;
1584 onPropertyNotifyListeners
~= dlg
;
1586 extern(C
) static void callBackPropertyNotify(GtkWidget
* widgetStruct
, GdkEventProperty
* event
, Widget widget
)
1588 bool consumed
= false;
1590 foreach ( gboolean
delegate(GdkEventProperty
*, Widget
) dlg
; widget
.onPropertyNotifyListeners
)
1598 gboolean
delegate(GdkEventProximity
*, Widget
)[] onProximityInListeners
;
1599 void addOnProximityIn(gboolean
delegate(GdkEventProximity
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1601 if ( !("proximity-in-event" in connectedSignals
) )
1603 Signals
.connectData(
1605 "proximity-in-event",
1606 cast(GCallback
)&callBackProximityIn
,
1610 connectedSignals
["proximity-in-event"] = 1;
1612 onProximityInListeners
~= dlg
;
1614 extern(C
) static void callBackProximityIn(GtkWidget
* widgetStruct
, GdkEventProximity
* event
, Widget widget
)
1616 bool consumed
= false;
1618 foreach ( gboolean
delegate(GdkEventProximity
*, Widget
) dlg
; widget
.onProximityInListeners
)
1626 gboolean
delegate(GdkEventProximity
*, Widget
)[] onProximityOutListeners
;
1627 void addOnProximityOut(gboolean
delegate(GdkEventProximity
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1629 if ( !("proximity-out-event" in connectedSignals
) )
1631 Signals
.connectData(
1633 "proximity-out-event",
1634 cast(GCallback
)&callBackProximityOut
,
1638 connectedSignals
["proximity-out-event"] = 1;
1640 onProximityOutListeners
~= dlg
;
1642 extern(C
) static void callBackProximityOut(GtkWidget
* widgetStruct
, GdkEventProximity
* event
, Widget widget
)
1644 bool consumed
= false;
1646 foreach ( gboolean
delegate(GdkEventProximity
*, Widget
) dlg
; widget
.onProximityOutListeners
)
1654 gboolean
delegate(gint
, gint
, gboolean
, GtkTooltip
*, Widget
)[] onQueryTooltipListeners
;
1655 void addOnQueryTooltip(gboolean
delegate(gint
, gint
, gboolean
, GtkTooltip
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1657 if ( !("query-tooltip" in connectedSignals
) )
1659 Signals
.connectData(
1662 cast(GCallback
)&callBackQueryTooltip
,
1666 connectedSignals
["query-tooltip"] = 1;
1668 onQueryTooltipListeners
~= dlg
;
1670 extern(C
) static void callBackQueryTooltip(GtkWidget
* widgetStruct
, gint x
, gint y
, gboolean keyboardMode
, GtkTooltip
* tooltip
, Widget widget
)
1672 bool consumed
= false;
1674 foreach ( gboolean
delegate(gint
, gint
, gboolean
, GtkTooltip
*, Widget
) dlg
; widget
.onQueryTooltipListeners
)
1676 dlg(x
, y
, keyboardMode
, tooltip
, widget
);
1682 void delegate(Widget
)[] onRealizeListeners
;
1683 void addOnRealize(void delegate(Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1685 if ( !("realize" in connectedSignals
) )
1687 Signals
.connectData(
1690 cast(GCallback
)&callBackRealize
,
1694 connectedSignals
["realize"] = 1;
1696 onRealizeListeners
~= dlg
;
1698 extern(C
) static void callBackRealize(GtkWidget
* widgetStruct
, Widget widget
)
1700 bool consumed
= false;
1702 foreach ( void delegate(Widget
) dlg
; widget
.onRealizeListeners
)
1710 void delegate(Screen
, Widget
)[] onScreenChangedListeners
;
1711 void addOnScreenChanged(void delegate(Screen
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1713 if ( !("screen-changed" in connectedSignals
) )
1715 Signals
.connectData(
1718 cast(GCallback
)&callBackScreenChanged
,
1722 connectedSignals
["screen-changed"] = 1;
1724 onScreenChangedListeners
~= dlg
;
1726 extern(C
) static void callBackScreenChanged(GtkWidget
* widgetStruct
, GdkScreen
* arg1
, Widget widget
)
1728 bool consumed
= false;
1730 foreach ( void delegate(Screen
, Widget
) dlg
; widget
.onScreenChangedListeners
)
1732 dlg(new Screen(arg1
), widget
);
1738 gboolean
delegate(GdkEventScroll
*, Widget
)[] onScrollListeners
;
1739 void addOnScroll(gboolean
delegate(GdkEventScroll
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1741 if ( !("scroll-event" in connectedSignals
) )
1743 Signals
.connectData(
1746 cast(GCallback
)&callBackScroll
,
1750 connectedSignals
["scroll-event"] = 1;
1752 onScrollListeners
~= dlg
;
1754 extern(C
) static void callBackScroll(GtkWidget
* widgetStruct
, GdkEventScroll
* event
, Widget widget
)
1756 bool consumed
= false;
1758 foreach ( gboolean
delegate(GdkEventScroll
*, Widget
) dlg
; widget
.onScrollListeners
)
1766 gboolean
delegate(GdkEventSelection
*, Widget
)[] onSelectionClearListeners
;
1767 void addOnSelectionClear(gboolean
delegate(GdkEventSelection
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1769 if ( !("selection-clear-event" in connectedSignals
) )
1771 Signals
.connectData(
1773 "selection-clear-event",
1774 cast(GCallback
)&callBackSelectionClear
,
1778 connectedSignals
["selection-clear-event"] = 1;
1780 onSelectionClearListeners
~= dlg
;
1782 extern(C
) static void callBackSelectionClear(GtkWidget
* widgetStruct
, GdkEventSelection
* event
, Widget widget
)
1784 bool consumed
= false;
1786 foreach ( gboolean
delegate(GdkEventSelection
*, Widget
) dlg
; widget
.onSelectionClearListeners
)
1794 void delegate(GtkSelectionData
*, guint
, guint
, Widget
)[] onSelectionGetListeners
;
1795 void addOnSelectionGet(void delegate(GtkSelectionData
*, guint
, guint
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1797 if ( !("selection-get" in connectedSignals
) )
1799 Signals
.connectData(
1802 cast(GCallback
)&callBackSelectionGet
,
1806 connectedSignals
["selection-get"] = 1;
1808 onSelectionGetListeners
~= dlg
;
1810 extern(C
) static void callBackSelectionGet(GtkWidget
* widgetStruct
, GtkSelectionData
* data
, guint info
, guint time
, Widget widget
)
1812 bool consumed
= false;
1814 foreach ( void delegate(GtkSelectionData
*, guint
, guint
, Widget
) dlg
; widget
.onSelectionGetListeners
)
1816 dlg(data
, info
, time
, widget
);
1822 gboolean
delegate(GdkEventSelection
*, Widget
)[] onSelectionNotifyListeners
;
1823 void addOnSelectionNotify(gboolean
delegate(GdkEventSelection
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1825 if ( !("selection-notify-event" in connectedSignals
) )
1827 Signals
.connectData(
1829 "selection-notify-event",
1830 cast(GCallback
)&callBackSelectionNotify
,
1834 connectedSignals
["selection-notify-event"] = 1;
1836 onSelectionNotifyListeners
~= dlg
;
1838 extern(C
) static void callBackSelectionNotify(GtkWidget
* widgetStruct
, GdkEventSelection
* event
, Widget widget
)
1840 bool consumed
= false;
1842 foreach ( gboolean
delegate(GdkEventSelection
*, Widget
) dlg
; widget
.onSelectionNotifyListeners
)
1850 void delegate(GtkSelectionData
*, guint
, Widget
)[] onSelectionReceivedListeners
;
1851 void addOnSelectionReceived(void delegate(GtkSelectionData
*, guint
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1853 if ( !("selection-received" in connectedSignals
) )
1855 Signals
.connectData(
1857 "selection-received",
1858 cast(GCallback
)&callBackSelectionReceived
,
1862 connectedSignals
["selection-received"] = 1;
1864 onSelectionReceivedListeners
~= dlg
;
1866 extern(C
) static void callBackSelectionReceived(GtkWidget
* widgetStruct
, GtkSelectionData
* data
, guint time
, Widget widget
)
1868 bool consumed
= false;
1870 foreach ( void delegate(GtkSelectionData
*, guint
, Widget
) dlg
; widget
.onSelectionReceivedListeners
)
1872 dlg(data
, time
, widget
);
1878 gboolean
delegate(GdkEventSelection
*, Widget
)[] onSelectionRequestListeners
;
1879 void addOnSelectionRequest(gboolean
delegate(GdkEventSelection
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1881 if ( !("selection-request-event" in connectedSignals
) )
1883 Signals
.connectData(
1885 "selection-request-event",
1886 cast(GCallback
)&callBackSelectionRequest
,
1890 connectedSignals
["selection-request-event"] = 1;
1892 onSelectionRequestListeners
~= dlg
;
1894 extern(C
) static void callBackSelectionRequest(GtkWidget
* widgetStruct
, GdkEventSelection
* event
, Widget widget
)
1896 bool consumed
= false;
1898 foreach ( gboolean
delegate(GdkEventSelection
*, Widget
) dlg
; widget
.onSelectionRequestListeners
)
1906 void delegate(Widget
)[] onShowListeners
;
1907 void addOnShow(void delegate(Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1909 if ( !("show" in connectedSignals
) )
1911 Signals
.connectData(
1914 cast(GCallback
)&callBackShow
,
1918 connectedSignals
["show"] = 1;
1920 onShowListeners
~= dlg
;
1922 extern(C
) static void callBackShow(GtkWidget
* widgetStruct
, Widget widget
)
1924 bool consumed
= false;
1926 foreach ( void delegate(Widget
) dlg
; widget
.onShowListeners
)
1934 gboolean
delegate(GtkWidgetHelpType
, Widget
)[] onShowHelpListeners
;
1935 void addOnShowHelp(gboolean
delegate(GtkWidgetHelpType
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1937 if ( !("show-help" in connectedSignals
) )
1939 Signals
.connectData(
1942 cast(GCallback
)&callBackShowHelp
,
1946 connectedSignals
["show-help"] = 1;
1948 onShowHelpListeners
~= dlg
;
1950 extern(C
) static void callBackShowHelp(GtkWidget
* widgetStruct
, GtkWidgetHelpType arg1
, Widget widget
)
1952 bool consumed
= false;
1954 foreach ( gboolean
delegate(GtkWidgetHelpType
, Widget
) dlg
; widget
.onShowHelpListeners
)
1962 void delegate(GtkAllocation
*, Widget
)[] onSizeAllocateListeners
;
1963 void addOnSizeAllocate(void delegate(GtkAllocation
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1965 if ( !("size-allocate" in connectedSignals
) )
1967 Signals
.connectData(
1970 cast(GCallback
)&callBackSizeAllocate
,
1974 connectedSignals
["size-allocate"] = 1;
1976 onSizeAllocateListeners
~= dlg
;
1978 extern(C
) static void callBackSizeAllocate(GtkWidget
* widgetStruct
, GtkAllocation
* allocation
, Widget widget
)
1980 bool consumed
= false;
1982 foreach ( void delegate(GtkAllocation
*, Widget
) dlg
; widget
.onSizeAllocateListeners
)
1984 dlg(allocation
, widget
);
1990 void delegate(GtkRequisition
*, Widget
)[] onSizeRequestListeners
;
1991 void addOnSizeRequest(void delegate(GtkRequisition
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
1993 if ( !("size-request" in connectedSignals
) )
1995 Signals
.connectData(
1998 cast(GCallback
)&callBackSizeRequest
,
2002 connectedSignals
["size-request"] = 1;
2004 onSizeRequestListeners
~= dlg
;
2006 extern(C
) static void callBackSizeRequest(GtkWidget
* widgetStruct
, GtkRequisition
* requisition
, Widget widget
)
2008 bool consumed
= false;
2010 foreach ( void delegate(GtkRequisition
*, Widget
) dlg
; widget
.onSizeRequestListeners
)
2012 dlg(requisition
, widget
);
2018 void delegate(GtkStateType
, Widget
)[] onStateChangedListeners
;
2019 void addOnStateChanged(void delegate(GtkStateType
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
2021 if ( !("state-changed" in connectedSignals
) )
2023 Signals
.connectData(
2026 cast(GCallback
)&callBackStateChanged
,
2030 connectedSignals
["state-changed"] = 1;
2032 onStateChangedListeners
~= dlg
;
2034 extern(C
) static void callBackStateChanged(GtkWidget
* widgetStruct
, GtkStateType state
, Widget widget
)
2036 bool consumed
= false;
2038 foreach ( void delegate(GtkStateType
, Widget
) dlg
; widget
.onStateChangedListeners
)
2046 version(Tango
){}else
2047 void delegate(Style
, Widget
)[] onStyleSetListeners
;
2048 version(Tango
){}else
2049 void addOnStyleSet(void delegate(Style
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
2051 if ( !("style-set" in connectedSignals
) )
2053 Signals
.connectData(
2056 cast(GCallback
)&callBackStyleSet
,
2060 connectedSignals
["style-set"] = 1;
2062 onStyleSetListeners
~= dlg
;
2064 version(Tango
){}else
2065 extern(C
) static void callBackStyleSet(GtkWidget
* widgetStruct
, GtkStyle
* previousStyle
, Widget widget
)
2067 bool consumed
= false;
2069 foreach ( void delegate(Style
, Widget
) dlg
; widget
.onStyleSetListeners
)
2071 dlg(new Style(previousStyle
), widget
);
2077 void delegate(Widget
)[] onUnmapListeners
;
2078 void addOnUnmap(void delegate(Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
2080 if ( !("unmap" in connectedSignals
) )
2082 Signals
.connectData(
2085 cast(GCallback
)&callBackUnmap
,
2089 connectedSignals
["unmap"] = 1;
2091 onUnmapListeners
~= dlg
;
2093 extern(C
) static void callBackUnmap(GtkWidget
* widgetStruct
, Widget widget
)
2095 bool consumed
= false;
2097 foreach ( void delegate(Widget
) dlg
; widget
.onUnmapListeners
)
2105 gboolean
delegate(Event
, Widget
)[] onUnmapEventListeners
;
2106 void addOnUnmapEvent(gboolean
delegate(Event
, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
2108 if ( !("unmap-event" in connectedSignals
) )
2110 Signals
.connectData(
2113 cast(GCallback
)&callBackUnmapEvent
,
2117 connectedSignals
["unmap-event"] = 1;
2119 onUnmapEventListeners
~= dlg
;
2121 extern(C
) static void callBackUnmapEvent(GtkWidget
* widgetStruct
, GdkEvent
* event
, Widget widget
)
2123 bool consumed
= false;
2125 foreach ( gboolean
delegate(Event
, Widget
) dlg
; widget
.onUnmapEventListeners
)
2127 dlg(new Event(event
), widget
);
2133 void delegate(Widget
)[] onUnrealizeListeners
;
2134 void addOnUnrealize(void delegate(Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
2136 if ( !("unrealize" in connectedSignals
) )
2138 Signals
.connectData(
2141 cast(GCallback
)&callBackUnrealize
,
2145 connectedSignals
["unrealize"] = 1;
2147 onUnrealizeListeners
~= dlg
;
2149 extern(C
) static void callBackUnrealize(GtkWidget
* widgetStruct
, Widget widget
)
2151 bool consumed
= false;
2153 foreach ( void delegate(Widget
) dlg
; widget
.onUnrealizeListeners
)
2161 gboolean
delegate(GdkEventVisibility
*, Widget
)[] onVisibilityNotifyListeners
;
2162 void addOnVisibilityNotify(gboolean
delegate(GdkEventVisibility
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
2164 if ( !("visibility-notify-event" in connectedSignals
) )
2166 Signals
.connectData(
2168 "visibility-notify-event",
2169 cast(GCallback
)&callBackVisibilityNotify
,
2173 connectedSignals
["visibility-notify-event"] = 1;
2175 onVisibilityNotifyListeners
~= dlg
;
2177 extern(C
) static void callBackVisibilityNotify(GtkWidget
* widgetStruct
, GdkEventVisibility
* event
, Widget widget
)
2179 bool consumed
= false;
2181 foreach ( gboolean
delegate(GdkEventVisibility
*, Widget
) dlg
; widget
.onVisibilityNotifyListeners
)
2189 gboolean
delegate(GdkEventWindowState
*, Widget
)[] onWindowStateListeners
;
2190 void addOnWindowState(gboolean
delegate(GdkEventWindowState
*, Widget
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
2192 if ( !("window-state-event" in connectedSignals
) )
2194 Signals
.connectData(
2196 "window-state-event",
2197 cast(GCallback
)&callBackWindowState
,
2201 connectedSignals
["window-state-event"] = 1;
2203 onWindowStateListeners
~= dlg
;
2205 extern(C
) static void callBackWindowState(GtkWidget
* widgetStruct
, GdkEventWindowState
* event
, Widget widget
)
2207 bool consumed
= false;
2209 foreach ( gboolean
delegate(GdkEventWindowState
*, Widget
) dlg
; widget
.onWindowStateListeners
)
2254 * This is a convenience function for creating a widget and setting
2255 * its properties in one go. For example you might write:
2256 * gtk_widget_new (GTK_TYPE_LABEL, "label", "Hello World", "xalign",
2257 * 0.0, NULL) to create a left-aligned label. Equivalent to
2258 * g_object_new(), but returns a widget so you don't have to
2259 * cast the object yourself.
2261 * type ID of the widget to create
2262 * first_property_name:
2263 * name of first property to set
2265 * value of first property, followed by more properties, NULL-terminated
2267 * a new GtkWidget of type widget_type
2269 public this (GType type
, char[] firstPropertyName
, ... )
2271 // GtkWidget* gtk_widget_new (GType type, const gchar *first_property_name, ...);
2272 this(cast(GtkWidget
*)gtk_widget_new(type
, Str
.toStringz(firstPropertyName
)) );
2277 * Inverse of gtk_widget_ref(). Equivalent to g_object_unref().
2283 // void gtk_widget_unref (GtkWidget *widget);
2284 gtk_widget_unref(gtkWidget
);
2288 * Destroys a widget. Equivalent to gtk_object_destroy(), except that
2289 * you don't have to cast the widget to GtkObject. When a widget is
2290 * destroyed, it will break any references it holds to other objects.
2291 * If the widget is inside a container, the widget will be removed
2292 * from the container. If the widget is a toplevel (derived from
2293 * GtkWindow), it will be removed from the list of toplevels, and the
2294 * reference GTK+ holds to it will be removed. Removing a
2295 * widget from its container or the list of toplevels results in the
2296 * widget being finalized, unless you've added additional references
2297 * to the widget with g_object_ref().
2298 * In most cases, only toplevel widgets (windows) require explicit
2299 * destruction, because when you destroy a toplevel its children will
2300 * be destroyed as well.
2304 public void destroy()
2306 // void gtk_widget_destroy (GtkWidget *widget);
2307 gtk_widget_destroy(gtkWidget
);
2311 * This function sets *widget_pointer to NULL if widget_pointer !=
2312 * NULL. It's intended to be used as a callback connected to the
2313 * "destroy" signal of a widget. You connect gtk_widget_destroyed()
2314 * as a signal handler, and pass the address of your widget variable
2315 * as user data. Then when the widget is destroyed, the variable will
2316 * be set to NULL. Useful for example to avoid multiple copies
2317 * of the same dialog.
2321 * address of a variable that contains widget
2323 public void destroyed(GtkWidget
** widgetPointer
)
2325 // void gtk_widget_destroyed (GtkWidget *widget, GtkWidget **widget_pointer);
2326 gtk_widget_destroyed(gtkWidget
, widgetPointer
);
2331 * gtk_widget_set is deprecated and should not be used in newly-written code.
2332 * Like g_object_set() - there's no reason to use this instead of
2336 * first_property_name:
2337 * name of first property to set
2339 * value of first property, followed by more properties, NULL-terminated
2341 public void set(char[] firstPropertyName
, ... )
2343 // void gtk_widget_set (GtkWidget *widget, const gchar *first_property_name, ...);
2344 gtk_widget_set(gtkWidget
, Str
.toStringz(firstPropertyName
));
2348 * This function is only for use in widget implementations.
2349 * Should be called by implementations of the remove method
2350 * on GtkContainer, to dissociate a child from the container.
2354 public void unparent()
2356 // void gtk_widget_unparent (GtkWidget *widget);
2357 gtk_widget_unparent(gtkWidget
);
2361 * Flags a widget to be displayed. Any widget that isn't shown will
2362 * not appear on the screen. If you want to show all the widgets in a
2363 * container, it's easier to call gtk_widget_show_all() on the
2364 * container, instead of individually showing the widgets.
2365 * Remember that you have to show the containers containing a widget,
2366 * in addition to the widget itself, before it will appear onscreen.
2367 * When a toplevel container is shown, it is immediately realized and
2368 * mapped; other shown widgets are realized and mapped when their
2369 * toplevel container is realized and mapped.
2375 // void gtk_widget_show (GtkWidget *widget);
2376 gtk_widget_show(gtkWidget
);
2380 * Shows a widget. If the widget is an unmapped toplevel widget
2381 * (i.e. a GtkWindow that has not yet been shown), enter the main
2382 * loop and wait for the window to actually be mapped. Be careful;
2383 * because the main loop is running, anything can happen during
2388 public void showNow()
2390 // void gtk_widget_show_now (GtkWidget *widget);
2391 gtk_widget_show_now(gtkWidget
);
2395 * Reverses the effects of gtk_widget_show(), causing the widget to be
2396 * hidden (invisible to the user).
2402 // void gtk_widget_hide (GtkWidget *widget);
2403 gtk_widget_hide(gtkWidget
);
2407 * Recursively shows a widget, and any child widgets (if the widget is
2412 public void showAll()
2414 // void gtk_widget_show_all (GtkWidget *widget);
2415 gtk_widget_show_all(gtkWidget
);
2419 * Recursively hides a widget and any child widgets.
2423 public void hideAll()
2425 // void gtk_widget_hide_all (GtkWidget *widget);
2426 gtk_widget_hide_all(gtkWidget
);
2430 * This function is only for use in widget implementations. Causes
2431 * a widget to be mapped if it isn't already.
2437 // void gtk_widget_map (GtkWidget *widget);
2438 gtk_widget_map(gtkWidget
);
2442 * This function is only for use in widget implementations. Causes
2443 * a widget to be unmapped if it's currently mapped.
2449 // void gtk_widget_unmap (GtkWidget *widget);
2450 gtk_widget_unmap(gtkWidget
);
2454 * Creates the GDK (windowing system) resources associated with a
2455 * widget. For example, widget->window will be created when a widget
2456 * is realized. Normally realization happens implicitly; if you show
2457 * a widget and all its parent containers, then the widget will be
2458 * realized and mapped automatically.
2459 * Realizing a widget requires all
2460 * the widget's parent widgets to be realized; calling
2461 * gtk_widget_realize() realizes the widget's parents in addition to
2462 * widget itself. If a widget is not yet inside a toplevel window
2463 * when you realize it, bad things will happen.
2464 * This function is primarily used in widget implementations, and
2465 * isn't very useful otherwise. Many times when you think you might
2466 * need it, a better approach is to connect to a signal that will be
2467 * called after the widget is realized automatically, such as
2468 * "expose_event". Or simply g_signal_connect_after() to the
2473 public void realize()
2475 // void gtk_widget_realize (GtkWidget *widget);
2476 gtk_widget_realize(gtkWidget
);
2480 * This function is only useful in widget implementations.
2481 * Causes a widget to be unrealized (frees all GDK resources
2482 * associated with the widget, such as widget->window).
2486 public void unrealize()
2488 // void gtk_widget_unrealize (GtkWidget *widget);
2489 gtk_widget_unrealize(gtkWidget
);
2493 * Equivalent to calling gtk_widget_queue_draw_area() for the
2494 * entire area of a widget.
2498 public void queueDraw()
2500 // void gtk_widget_queue_draw (GtkWidget *widget);
2501 gtk_widget_queue_draw(gtkWidget
);
2505 * This function is only for use in widget implementations.
2506 * Flags a widget to have its size renegotiated; should
2507 * be called when a widget for some reason has a new size request.
2508 * For example, when you change the text in a GtkLabel, GtkLabel
2509 * queues a resize to ensure there's enough space for the new text.
2513 public void queueResize()
2515 // void gtk_widget_queue_resize (GtkWidget *widget);
2516 gtk_widget_queue_resize(gtkWidget
);
2520 * This function works like gtk_widget_queue_resize(), except that the
2521 * widget is not invalidated.
2526 public void queueResizeNoRedraw()
2528 // void gtk_widget_queue_resize_no_redraw (GtkWidget *widget);
2529 gtk_widget_queue_resize_no_redraw(gtkWidget
);
2534 * gtk_widget_draw is deprecated and should not be used in newly-written code.
2535 * In GTK+ 1.2, this function would immediately render the
2536 * region area of a widget, by invoking the virtual draw method of a
2537 * widget. In GTK+ 2.0, the draw method is gone, and instead
2538 * gtk_widget_draw() simply invalidates the specified region of the
2539 * widget, then updates the invalid region of the widget immediately.
2540 * Usually you don't want to update the region immediately for
2541 * performance reasons, so in general gtk_widget_queue_draw_area() is
2542 * a better choice if you want to draw a region of a widget.
2548 public void draw(Rectangle area
)
2550 // void gtk_widget_draw (GtkWidget *widget, GdkRectangle *area);
2551 gtk_widget_draw(gtkWidget
, (area
is null) ?
null : area
.getRectangleStruct());
2555 * This function is typically used when implementing a GtkContainer
2556 * subclass. Obtains the preferred size of a widget. The container
2557 * uses this information to arrange its child widgets and decide what
2558 * size allocations to give them with gtk_widget_size_allocate().
2559 * You can also call this function from an application, with some
2560 * caveats. Most notably, getting a size request requires the widget
2561 * to be associated with a screen, because font information may be
2562 * needed. Multihead-aware applications should keep this in mind.
2563 * Also remember that the size request is not necessarily the size
2564 * a widget will actually be allocated.
2565 * See also gtk_widget_get_child_requisition().
2569 * a GtkRequisition to be filled in
2571 public void sizeRequest(GtkRequisition
* requisition
)
2573 // void gtk_widget_size_request (GtkWidget *widget, GtkRequisition *requisition);
2574 gtk_widget_size_request(gtkWidget
, requisition
);
2578 * This function is only for use in widget implementations. Obtains
2579 * widget->requisition, unless someone has forced a particular
2580 * geometry on the widget (e.g. with gtk_widget_set_usize()), in which
2581 * case it returns that geometry instead of the widget's requisition.
2582 * This function differs from gtk_widget_size_request() in that
2583 * it retrieves the last size request value from widget->requisition,
2584 * while gtk_widget_size_request() actually calls the "size_request" method
2585 * on widget to compute the size request and fill in widget->requisition,
2586 * and only then returns widget->requisition.
2587 * Because this function does not call the "size_request" method, it
2588 * can only be used when you know that widget->requisition is
2589 * up-to-date, that is, gtk_widget_size_request() has been called
2590 * since the last time a resize was queued. In general, only container
2591 * implementations have this information; applications should use
2592 * gtk_widget_size_request().
2596 * a GtkRequisition to be filled in
2598 public void getChildRequisition(GtkRequisition
* requisition
)
2600 // void gtk_widget_get_child_requisition (GtkWidget *widget, GtkRequisition *requisition);
2601 gtk_widget_get_child_requisition(gtkWidget
, requisition
);
2605 * This function is only used by GtkContainer subclasses, to assign a size
2606 * and position to their child widgets.
2610 * position and size to be allocated to widget
2612 public void sizeAllocate(GtkAllocation
* allocation
)
2614 // void gtk_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation);
2615 gtk_widget_size_allocate(gtkWidget
, allocation
);
2619 * Installs an accelerator for this widget in accel_group that causes
2620 * accel_signal to be emitted if the accelerator is activated.
2621 * The accel_group needs to be added to the widget's toplevel via
2622 * gtk_window_add_accel_group(), and the signal must be of type G_RUN_ACTION.
2623 * Accelerators added through this function are not user changeable during
2624 * runtime. If you want to support accelerators that can be changed by the
2625 * user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
2626 * gtk_menu_item_set_accel_path() instead.
2628 * widget to install an accelerator on
2630 * widget signal to emit on accelerator activation
2632 * accel group for this widget, added to its toplevel
2634 * GDK keyval of the accelerator
2636 * modifier key combination of the accelerator
2638 * flag accelerators, e.g. GTK_ACCEL_VISIBLE
2640 public void addAccelerator(char[] accelSignal
, AccelGroup accelGroup
, uint accelKey
, GdkModifierType accelMods
, GtkAccelFlags accelFlags
)
2642 // void gtk_widget_add_accelerator (GtkWidget *widget, const gchar *accel_signal, GtkAccelGroup *accel_group, guint accel_key, GdkModifierType accel_mods, GtkAccelFlags accel_flags);
2643 gtk_widget_add_accelerator(gtkWidget
, Str
.toStringz(accelSignal
), (accelGroup
is null) ?
null : accelGroup
.getAccelGroupStruct(), accelKey
, accelMods
, accelFlags
);
2647 * Removes an accelerator from widget, previously installed with
2648 * gtk_widget_add_accelerator().
2650 * widget to install an accelerator on
2652 * accel group for this widget
2654 * GDK keyval of the accelerator
2656 * modifier key combination of the accelerator
2658 * whether an accelerator was installed and could be removed
2660 public int removeAccelerator(AccelGroup accelGroup
, uint accelKey
, GdkModifierType accelMods
)
2662 // gboolean gtk_widget_remove_accelerator (GtkWidget *widget, GtkAccelGroup *accel_group, guint accel_key, GdkModifierType accel_mods);
2663 return gtk_widget_remove_accelerator(gtkWidget
, (accelGroup
is null) ?
null : accelGroup
.getAccelGroupStruct(), accelKey
, accelMods
);
2667 * Given an accelerator group, accel_group, and an accelerator path,
2668 * accel_path, sets up an accelerator in accel_group so whenever the
2669 * key binding that is defined for accel_path is pressed, widget
2670 * will be activated. This removes any accelerators (for any
2671 * accelerator group) installed by previous calls to
2672 * gtk_widget_set_accel_path(). Associating accelerators with
2673 * paths allows them to be modified by the user and the modifications
2674 * to be saved for future use. (See gtk_accel_map_save().)
2675 * This function is a low level function that would most likely
2676 * be used by a menu creation system like GtkItemFactory. If you
2677 * use GtkItemFactory, setting up accelerator paths will be done
2679 * Even when you you aren't using GtkItemFactory, if you only want to
2680 * set up accelerators on menu items gtk_menu_item_set_accel_path()
2681 * provides a somewhat more convenient interface.
2685 * path used to look up the accelerator
2689 public void setAccelPath(char[] accelPath
, AccelGroup accelGroup
)
2691 // void gtk_widget_set_accel_path (GtkWidget *widget, const gchar *accel_path, GtkAccelGroup *accel_group);
2692 gtk_widget_set_accel_path(gtkWidget
, Str
.toStringz(accelPath
), (accelGroup
is null) ?
null : accelGroup
.getAccelGroupStruct());
2696 * Lists the closures used by widget for accelerator group connections
2697 * with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
2698 * The closures can be used to monitor accelerator changes on widget,
2699 * by connecting to the ::accel_changed signal of the GtkAccelGroup of a
2700 * closure which can be found out with gtk_accel_group_from_accel_closure().
2702 * widget to list accelerator closures for
2704 * a newly allocated GList of closures
2706 public ListG
listAccelClosures()
2708 // GList* gtk_widget_list_accel_closures (GtkWidget *widget);
2709 return new ListG( gtk_widget_list_accel_closures(gtkWidget
) );
2713 * Determines whether an accelerator that activates the signal
2714 * identified by signal_id can currently be activated.
2715 * This is done by emitting the GtkWidget::can-activate-accel
2716 * signal on widget; if the signal isn't overridden by a
2717 * handler or in a derived widget, then the default check is
2718 * that the widget must be sensitive, and the widget and all
2719 * its ancestors mapped.
2723 * the ID of a signal installed on widget
2725 * TRUE if the accelerator can be activated.
2728 public int canActivateAccel(uint signalId
)
2730 // gboolean gtk_widget_can_activate_accel (GtkWidget *widget, guint signal_id);
2731 return gtk_widget_can_activate_accel(gtkWidget
, signalId
);
2735 * Rarely-used function. This function is used to emit
2736 * the event signals on a widget (those signals should never
2737 * be emitted without using this function to do so).
2738 * If you want to synthesize an event though, don't use this function;
2739 * instead, use gtk_main_do_event() so the event will behave as if
2740 * it were in the event queue. Don't synthesize expose events; instead,
2741 * use gdk_window_invalidate_rect() to invalidate a region of the
2748 * return from the event signal emission (TRUE if the event was handled)
2750 public int event(Event event
)
2752 // gboolean gtk_widget_event (GtkWidget *widget, GdkEvent *event);
2753 return gtk_widget_event(gtkWidget
, (event
is null) ?
null : event
.getEventStruct());
2757 * For widgets that can be "activated" (buttons, menu items, etc.)
2758 * this function activates them. Activation is what happens when you
2759 * press Enter on a widget during key navigation. If widget isn't
2760 * activatable, the function returns FALSE.
2762 * a GtkWidget that's activatable
2764 * TRUE if the widget was activatable
2766 public int activate()
2768 // gboolean gtk_widget_activate (GtkWidget *widget);
2769 return gtk_widget_activate(gtkWidget
);
2773 * Moves a widget from one GtkContainer to another, handling reference
2774 * count issues to avoid destroying the widget.
2778 * a GtkContainer to move the widget into
2780 public void reparent(GtkWidget
* newParent
)
2782 // void gtk_widget_reparent (GtkWidget *widget, GtkWidget *new_parent);
2783 gtk_widget_reparent(gtkWidget
, newParent
);
2787 * Computes the intersection of a widget's area and area, storing
2788 * the intersection in intersection, and returns TRUE if there was
2789 * an intersection. intersection may be NULL if you're only
2790 * interested in whether there was an intersection.
2796 * rectangle to store intersection of widget and area
2798 * TRUE if there was an intersection
2800 public int intersect(Rectangle area
, Rectangle intersection
)
2802 // gboolean gtk_widget_intersect (GtkWidget *widget, GdkRectangle *area, GdkRectangle *intersection);
2803 return gtk_widget_intersect(gtkWidget
, (area
is null) ?
null : area
.getRectangleStruct(), (intersection
is null) ?
null : intersection
.getRectangleStruct());
2807 * Determines if the widget is the focus widget within its
2808 * toplevel. (This does not mean that the HAS_FOCUS flag is
2809 * necessarily set; HAS_FOCUS will only be set if the
2810 * toplevel widget additionally has the global input focus.)
2814 * TRUE if the widget is the focus widget.
2816 public int isFocus()
2818 // gboolean gtk_widget_is_focus (GtkWidget *widget);
2819 return gtk_widget_is_focus(gtkWidget
);
2823 * Causes widget to have the keyboard focus for the GtkWindow it's
2824 * inside. widget must be a focusable widget, such as a GtkEntry;
2825 * something like GtkFrame won't work. (More precisely, it must have the
2826 * GTK_CAN_FOCUS flag set.)
2830 public void grabFocus()
2832 // void gtk_widget_grab_focus (GtkWidget *widget);
2833 gtk_widget_grab_focus(gtkWidget
);
2837 * Causes widget to become the default widget. widget must have the
2838 * GTK_CAN_DEFAULT flag set; typically you have to set this flag
2839 * yourself by calling GTK_WIDGET_SET_FLAGS (widget,
2840 * GTK_CAN_DEFAULT). The default widget is activated when the user
2841 * presses Enter in a window. Default widgets must be activatable,
2842 * that is, gtk_widget_activate() should affect them.
2846 public void grabDefault()
2848 // void gtk_widget_grab_default (GtkWidget *widget);
2849 gtk_widget_grab_default(gtkWidget
);
2853 * Widgets can be named, which allows you to refer to them from a
2854 * gtkrc file. You can apply a style to widgets with a particular name
2855 * in the gtkrc file. See the documentation for gtkrc files (on the
2856 * same page as the docs for GtkRcStyle).
2857 * Note that widget names are separated by periods in paths (see
2858 * gtk_widget_path()), so names with embedded periods may cause confusion.
2862 * name for the widget
2864 public void setName(char[] name
)
2866 // void gtk_widget_set_name (GtkWidget *widget, const gchar *name);
2867 gtk_widget_set_name(gtkWidget
, Str
.toStringz(name
));
2871 * Retrieves the name of a widget. See gtk_widget_set_name() for the
2872 * significance of widget names.
2876 * name of the widget. This string is owned by GTK+ and
2877 * should not be modified or freed
2879 public char[] getName()
2881 // const gchar* gtk_widget_get_name (GtkWidget *widget);
2882 return Str
.toString(gtk_widget_get_name(gtkWidget
) );
2886 * This function is for use in widget implementations. Sets the state
2887 * of a widget (insensitive, prelighted, etc.) Usually you should set
2888 * the state using wrapper functions such as gtk_widget_set_sensitive().
2892 * new state for widget
2894 public void setState(GtkStateType state
)
2896 // void gtk_widget_set_state (GtkWidget *widget, GtkStateType state);
2897 gtk_widget_set_state(gtkWidget
, state
);
2901 * Sets the sensitivity of a widget. A widget is sensitive if the user
2902 * can interact with it. Insensitive widgets are "grayed out" and the
2903 * user can't interact with them. Insensitive widgets are known as
2904 * "inactive", "disabled", or "ghosted" in some other toolkits.
2908 * TRUE to make the widget sensitive
2910 public void setSensitive(int sensitive
)
2912 // void gtk_widget_set_sensitive (GtkWidget *widget, gboolean sensitive);
2913 gtk_widget_set_sensitive(gtkWidget
, sensitive
);
2917 * This function is useful only when implementing subclasses of GtkContainer.
2918 * Sets the container as the parent of widget, and takes care of
2919 * some details such as updating the state and style of the child
2920 * to reflect its new location. The opposite function is
2921 * gtk_widget_unparent().
2927 public void setParent(GtkWidget
* parent
)
2929 // void gtk_widget_set_parent (GtkWidget *widget, GtkWidget *parent);
2930 gtk_widget_set_parent(gtkWidget
, parent
);
2934 * Sets a non default parent window for widget.
2938 * the new parent window.
2940 public void setParentWindow(Window parentWindow
)
2942 // void gtk_widget_set_parent_window (GtkWidget *widget, GdkWindow *parent_window);
2943 gtk_widget_set_parent_window(gtkWidget
, (parentWindow
is null) ?
null : parentWindow
.getWindowStruct());
2947 * Gets widget's parent window.
2951 * the parent window of widget.
2953 public Window
getParentWindow()
2955 // GdkWindow* gtk_widget_get_parent_window (GtkWidget *widget);
2956 return new Window( gtk_widget_get_parent_window(gtkWidget
) );
2961 * gtk_widget_set_uposition is deprecated and should not be used in newly-written code.
2962 * Sets the position of a widget. The funny "u" in the name comes from
2963 * the "user position" hint specified by the X Window System, and
2964 * exists for legacy reasons. This function doesn't work if a widget
2965 * is inside a container; it's only really useful on GtkWindow.
2966 * Don't use this function to center dialogs over the main application
2967 * window; most window managers will do the centering on your behalf
2968 * if you call gtk_window_set_transient_for(), and it's really not
2969 * possible to get the centering to work correctly in all cases from
2970 * application code. But if you insist, use gtk_window_set_position()
2971 * to set GTK_WIN_POS_CENTER_ON_PARENT, don't do the centering
2973 * Note that although x and y can be individually unset, the position
2974 * is not honoured unless both x and y are set.
2978 * x position; -1 to unset x; -2 to leave x unchanged
2980 * y position; -1 to unset y; -2 to leave y unchanged
2982 public void setUposition(int x
, int y
)
2984 // void gtk_widget_set_uposition (GtkWidget *widget, gint x, gint y);
2985 gtk_widget_set_uposition(gtkWidget
, x
, y
);
2990 * gtk_widget_set_usize is deprecated and should not be used in newly-written code.
2991 * Sets the minimum size of a widget; that is, the widget's size
2992 * request will be width by height. You can use this function to
2993 * force a widget to be either larger or smaller than it is. The
2994 * strange "usize" name dates from the early days of GTK+, and derives
2995 * from X Window System terminology. In many cases,
2996 * gtk_window_set_default_size() is a better choice for toplevel
2997 * windows than this function; setting the default size will still
2998 * allow users to shrink the window. Setting the usize will force them
2999 * to leave the window at least as large as the usize. When dealing
3000 * with window sizes, gtk_window_set_geometry_hints() can be a useful
3002 * Note the inherent danger of setting any fixed size - themes,
3003 * translations into other languages, different fonts, and user action
3004 * can all change the appropriate size for a given widget. So, it's
3005 * basically impossible to hardcode a size that will always be
3007 * Deprecated: Use gtk_widget_set_size_request() instead.
3011 * minimum width, or -1 to unset
3013 * minimum height, or -1 to unset
3015 public void setUsize(int width
, int height
)
3017 // void gtk_widget_set_usize (GtkWidget *widget, gint width, gint height);
3018 gtk_widget_set_usize(gtkWidget
, width
, height
);
3022 * Sets the event mask (see GdkEventMask) for a widget. The event
3023 * mask determines which events a widget will receive. Keep in mind
3024 * that different widgets have different default event masks, and by
3025 * changing the event mask you may disrupt a widget's functionality,
3026 * so be careful. This function must be called while a widget is
3027 * unrealized. Consider gtk_widget_add_events() for widgets that are
3028 * already realized, or if you want to preserve the existing event
3029 * mask. This function can't be used with GTK_NO_WINDOW widgets;
3030 * to get events on those widgets, place them inside a GtkEventBox
3031 * and receive events on the event box.
3037 public void setEvents(int events
)
3039 // void gtk_widget_set_events (GtkWidget *widget, gint events);
3040 gtk_widget_set_events(gtkWidget
, events
);
3044 * Adds the events in the bitfield events to the event mask for
3045 * widget. See gtk_widget_set_events() for details.
3049 * an event mask, see GdkEventMask
3051 public void addEvents(int events
)
3053 // void gtk_widget_add_events (GtkWidget *widget, gint events);
3054 gtk_widget_add_events(gtkWidget
, events
);
3058 * Sets the extension events mask to mode. See GdkExtensionMode
3059 * and gdk_input_set_extension_events().
3063 * bitfield of extension events to receive
3065 public void setExtensionEvents(GdkExtensionMode mode
)
3067 // void gtk_widget_set_extension_events (GtkWidget *widget, GdkExtensionMode mode);
3068 gtk_widget_set_extension_events(gtkWidget
, mode
);
3072 * Retrieves the extension events the widget will receive; see
3073 * gdk_input_set_extension_events().
3077 * extension events for widget
3079 public GdkExtensionMode
getExtensionEvents()
3081 // GdkExtensionMode gtk_widget_get_extension_events (GtkWidget *widget);
3082 return gtk_widget_get_extension_events(gtkWidget
);
3086 * This function returns the topmost widget in the container hierarchy
3087 * widget is a part of. If widget has no parent widgets, it will be
3088 * returned as the topmost widget. No reference will be added to the
3089 * returned widget; it should not be unreferenced.
3090 * Note the difference in behavior vs. gtk_widget_get_ancestor();
3091 * gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)
3093 * NULL if widget wasn't inside a toplevel window, and if the
3094 * window was inside a GtkWindow-derived widget which was in turn
3095 * inside the toplevel GtkWindow. While the second case may
3096 * seem unlikely, it actually happens when a GtkPlug is embedded
3097 * inside a GtkSocket within the same application.
3098 * To reliably find the toplevel GtkWindow, use
3099 * gtk_widget_get_toplevel() and check if the TOPLEVEL flags
3100 * is set on the result.
3101 * GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
3102 * if (GTK_WIDGET_TOPLEVEL (toplevel))
3104 * [ Perform action on toplevel. ]
3109 * the topmost ancestor of widget, or widget itself if there's no ancestor.
3111 public GtkWidget
* getToplevel()
3113 // GtkWidget* gtk_widget_get_toplevel (GtkWidget *widget);
3114 return gtk_widget_get_toplevel(gtkWidget
);
3118 * Gets the first ancestor of widget with type widget_type. For example,
3119 * gtk_widget_get_ancestor (widget, GTK_TYPE_BOX) gets the
3120 * first GtkBox that's
3121 * an ancestor of widget. No reference will be added to the returned widget;
3122 * it should not be unreferenced. See note about checking for a toplevel
3123 * GtkWindow in the docs for gtk_widget_get_toplevel().
3124 * Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
3125 * considers widget to be an ancestor of itself.
3131 * the ancestor widget, or NULL if not found
3133 public GtkWidget
* getAncestor(GType widgetType
)
3135 // GtkWidget* gtk_widget_get_ancestor (GtkWidget *widget, GType widget_type);
3136 return gtk_widget_get_ancestor(gtkWidget
, widgetType
);
3140 * Gets the colormap that will be used to render widget. No reference will
3141 * be added to the returned colormap; it should not be unreferenced.
3145 * the colormap used by widget
3147 public Colormap
getColormap()
3149 // GdkColormap* gtk_widget_get_colormap (GtkWidget *widget);
3150 return new Colormap( gtk_widget_get_colormap(gtkWidget
) );
3154 * Sets the colormap for the widget to the given value. Widget must not
3155 * have been previously realized. This probably should only be used
3156 * from an init() function (i.e. from the constructor
3163 public void setColormap(Colormap colormap
)
3165 // void gtk_widget_set_colormap (GtkWidget *widget, GdkColormap *colormap);
3166 gtk_widget_set_colormap(gtkWidget
, (colormap
is null) ?
null : colormap
.getColormapStruct());
3170 * Gets the visual that will be used to render widget.
3174 * the visual for widget
3176 public Visual
getVisual()
3178 // GdkVisual* gtk_widget_get_visual (GtkWidget *widget);
3179 return new Visual( gtk_widget_get_visual(gtkWidget
) );
3183 * Returns the event mask for the widget (a bitfield containing flags
3184 * from the GdkEventMask enumeration). These are the events that the widget
3189 * event mask for widget
3191 public int getEvents()
3193 // gint gtk_widget_get_events (GtkWidget *widget);
3194 return gtk_widget_get_events(gtkWidget
);
3198 * Obtains the location of the mouse pointer in widget coordinates.
3199 * Widget coordinates are a bit odd; for historical reasons, they are
3200 * defined as widget->window coordinates for widgets that are not
3201 * GTK_NO_WINDOW widgets, and are relative to widget->allocation.x,
3202 * widget->allocation.y for widgets that are GTK_NO_WINDOW widgets.
3206 * return location for the X coordinate, or NULL
3208 * return location for the Y coordinate, or NULL
3210 public void getPointer(int* x
, int* y
)
3212 // void gtk_widget_get_pointer (GtkWidget *widget, gint *x, gint *y);
3213 gtk_widget_get_pointer(gtkWidget
, x
, y
);
3217 * Determines whether widget is somewhere inside ancestor, possibly with
3218 * intermediate containers.
3224 * TRUE if ancestor contains widget as a child, grandchild, great grandchild, etc.
3226 public int isAncestor(GtkWidget
* ancestor
)
3228 // gboolean gtk_widget_is_ancestor (GtkWidget *widget, GtkWidget *ancestor);
3229 return gtk_widget_is_ancestor(gtkWidget
, ancestor
);
3233 * Translate coordinates relative to src_widget's allocation to coordinates
3234 * relative to dest_widget's allocations. In order to perform this
3235 * operation, both widgets must be realized, and must share a common
3242 * X position relative to src_widget
3244 * Y position relative to src_widget
3246 * location to store X position relative to dest_widget
3248 * location to store Y position relative to dest_widget
3250 * FALSE if either widget was not realized, or there
3251 * was no common ancestor. In this case, nothing is stored in
3252 * *dest_x and *dest_y. Otherwise TRUE.
3254 public int translateCoordinates(GtkWidget
* destWidget
, int srcX
, int srcY
, int* destX
, int* destY
)
3256 // gboolean gtk_widget_translate_coordinates (GtkWidget *src_widget, GtkWidget *dest_widget, gint src_x, gint src_y, gint *dest_x, gint *dest_y);
3257 return gtk_widget_translate_coordinates(gtkWidget
, destWidget
, srcX
, srcY
, destX
, destY
);
3261 * Utility function; intended to be connected to the "delete_event"
3262 * signal on a GtkWindow. The function calls gtk_widget_hide() on its
3263 * argument, then returns TRUE. If connected to "delete_event", the
3264 * result is that clicking the close button for a window (on the
3265 * window frame, top right corner usually) will hide but not destroy
3266 * the window. By default, GTK+ destroys windows when "delete_event"
3273 public int hideOnDelete()
3275 // gboolean gtk_widget_hide_on_delete (GtkWidget *widget);
3276 return gtk_widget_hide_on_delete(gtkWidget
);
3280 * Sets the GtkStyle for a widget (widget->style). You probably don't
3281 * want to use this function; it interacts badly with themes, because
3282 * themes work by replacing the GtkStyle. Instead, use
3283 * gtk_widget_modify_style().
3287 * a GtkStyle, or NULL to remove the effect of a previous
3288 * gtk_widget_set_style() and go back to the default style
3290 version(Tango
){}else
3291 public void setStyle(Style style
)
3293 // void gtk_widget_set_style (GtkWidget *widget, GtkStyle *style);
3294 gtk_widget_set_style(gtkWidget
, (style
is null) ?
null : style
.getStyleStruct());
3299 * Ensures that widget has a style (widget->style). Not a very useful
3300 * function; most of the time, if you want the style, the widget is
3301 * realized, and realized widgets are guaranteed to have a style
3306 public void ensureStyle()
3308 // void gtk_widget_ensure_style (GtkWidget *widget);
3309 gtk_widget_ensure_style(gtkWidget
);
3313 * Simply an accessor function that returns widget->style.
3317 * the widget's GtkStyle
3319 version(Tango
){}else
3320 public Style
getStyle()
3322 // GtkStyle* gtk_widget_get_style (GtkWidget *widget);
3323 return new Style( gtk_widget_get_style(gtkWidget
) );
3328 * Reset the styles of widget and all descendents, so when
3329 * they are looked up again, they get the correct values
3330 * for the currently loaded RC file settings.
3331 * This function is not useful for applications.
3335 public void resetRcStyles()
3337 // void gtk_widget_reset_rc_styles (GtkWidget *widget);
3338 gtk_widget_reset_rc_styles(gtkWidget
);
3342 * Pushes cmap onto a global stack of colormaps; the topmost
3343 * colormap on the stack will be used to create all widgets.
3344 * Remove cmap with gtk_widget_pop_colormap(). There's little
3345 * reason to use this function.
3349 public static void pushColormap(Colormap cmap
)
3351 // void gtk_widget_push_colormap (GdkColormap *cmap);
3352 gtk_widget_push_colormap((cmap
is null) ?
null : cmap
.getColormapStruct());
3356 * Removes a colormap pushed with gtk_widget_push_colormap().
3358 public static void popColormap()
3360 // void gtk_widget_pop_colormap (void);
3361 gtk_widget_pop_colormap();
3365 * Sets the default colormap to use when creating widgets.
3366 * gtk_widget_push_colormap() is a better function to use if
3367 * you only want to affect a few widgets, rather than all widgets.
3371 public static void setDefaultColormap(Colormap colormap
)
3373 // void gtk_widget_set_default_colormap (GdkColormap *colormap);
3374 gtk_widget_set_default_colormap((colormap
is null) ?
null : colormap
.getColormapStruct());
3378 * Returns the default style used by all widgets initially.
3380 * the default style. This GtkStyle object is owned by GTK+ and
3381 * should not be modified or freed.
3383 version(Tango
){}else
3384 public static Style
getDefaultStyle()
3386 // GtkStyle* gtk_widget_get_default_style (void);
3387 return new Style( gtk_widget_get_default_style() );
3391 * Obtains the default colormap used to create widgets.
3393 * default widget colormap
3395 public static Colormap
getDefaultColormap()
3397 // GdkColormap* gtk_widget_get_default_colormap (void);
3398 return new Colormap( gtk_widget_get_default_colormap() );
3402 * Obtains the visual of the default colormap. Not really useful;
3403 * used to be useful before gdk_colormap_get_visual() existed.
3405 * visual of the default colormap
3407 public static Visual
getDefaultVisual()
3409 // GdkVisual* gtk_widget_get_default_visual (void);
3410 return new Visual( gtk_widget_get_default_visual() );
3414 * Sets the reading direction on a particular widget. This direction
3415 * controls the primary direction for widgets containing text,
3416 * and also the direction in which the children of a container are
3417 * packed. The ability to set the direction is present in order
3418 * so that correct localization into languages with right-to-left
3419 * reading directions can be done. Generally, applications will
3420 * let the default reading direction present, except for containers
3421 * where the containers are arranged in an order that is explicitely
3422 * visual rather than logical (such as buttons for text justification).
3423 * If the direction is set to GTK_TEXT_DIR_NONE, then the value
3424 * set by gtk_widget_set_default_direction() will be used.
3430 public void setDirection(GtkTextDirection dir
)
3432 // void gtk_widget_set_direction (GtkWidget *widget, GtkTextDirection dir);
3433 gtk_widget_set_direction(gtkWidget
, dir
);
3438 * Gets the reading direction for a particular widget. See
3439 * gtk_widget_set_direction().
3443 * the reading direction for the widget.
3445 public GtkTextDirection
getDirection()
3447 // GtkTextDirection gtk_widget_get_direction (GtkWidget *widget);
3448 return gtk_widget_get_direction(gtkWidget
);
3452 * Sets the default reading direction for widgets where the
3453 * direction has not been explicitly set by gtk_widget_set_direction().
3455 * the new default direction. This cannot be
3456 * GTK_TEXT_DIR_NONE.
3458 public static void setDefaultDirection(GtkTextDirection dir
)
3460 // void gtk_widget_set_default_direction (GtkTextDirection dir);
3461 gtk_widget_set_default_direction(dir
);
3465 * Obtains the current default reading direction. See
3466 * gtk_widget_set_default_direction().
3468 * the current default direction.
3470 public static GtkTextDirection
getDefaultDirection()
3472 // GtkTextDirection gtk_widget_get_default_direction (void);
3473 return gtk_widget_get_default_direction();
3477 * Sets a shape for this widget's GDK window. This allows for
3478 * transparent windows etc., see gdk_window_shape_combine_mask()
3479 * for more information.
3483 * shape to be added, or NULL to remove an existing shape.
3485 * X position of shape mask with respect to window.
3487 * Y position of shape mask with respect to window.
3489 public void shapeCombineMask(Bitmap shapeMask
, int offsetX
, int offsetY
)
3491 // void gtk_widget_shape_combine_mask (GtkWidget *widget, GdkBitmap *shape_mask, gint offset_x, gint offset_y);
3492 gtk_widget_shape_combine_mask(gtkWidget
, (shapeMask
is null) ?
null : shapeMask
.getBitmapStruct(), offsetX
, offsetY
);
3496 * Sets an input shape for this widget's GDK window. This allows for
3497 * windows which react to mouse click in a nonrectangular region, see
3498 * gdk_window_input_shape_combine_mask() for more information.
3502 * shape to be added, or NULL to remove an existing shape.
3504 * X position of shape mask with respect to window.
3506 * Y position of shape mask with respect to window.
3509 public void inputShapeCombineMask(Bitmap shapeMask
, int offsetX
, int offsetY
)
3511 // void gtk_widget_input_shape_combine_mask (GtkWidget *widget, GdkBitmap *shape_mask, gint offset_x, gint offset_y);
3512 gtk_widget_input_shape_combine_mask(gtkWidget
, (shapeMask
is null) ?
null : shapeMask
.getBitmapStruct(), offsetX
, offsetY
);
3516 * Obtains the full path to widget. The path is simply the name of a
3517 * widget and all its parents in the container hierarchy, separated by
3518 * periods. The name of a widget comes from
3519 * gtk_widget_get_name(). Paths are used to apply styles to a widget
3520 * in gtkrc configuration files. Widget names are the type of the
3521 * widget by default (e.g. "GtkButton") or can be set to an
3522 * application-specific value with gtk_widget_set_name(). By setting
3523 * the name of a widget, you allow users or theme authors to apply
3524 * styles to that specific widget in their gtkrc
3525 * file. path_reversed_p fills in the path in reverse order,
3526 * i.e. starting with widget's name instead of starting with the name
3527 * of widget's outermost ancestor.
3531 * location to store length of the path, or NULL
3533 * location to store allocated path string, or NULL
3535 * location to store allocated reverse path string, or NULL
3537 public void path(uint* pathLength
, char** path
, char** pathReversed
)
3539 // void gtk_widget_path (GtkWidget *widget, guint *path_length, gchar **path, gchar **path_reversed);
3540 gtk_widget_path(gtkWidget
, pathLength
, path
, pathReversed
);
3544 * Same as gtk_widget_path(), but always uses the name of a widget's type,
3545 * never uses a custom name set with gtk_widget_set_name().
3549 * location to store the length of the class path, or NULL
3551 * location to store the class path as an allocated string, or NULL
3553 * location to store the reverse class path as an allocated string, or NULL
3555 public void classPath(uint* pathLength
, char** path
, char** pathReversed
)
3557 // void gtk_widget_class_path (GtkWidget *widget, guint *path_length, gchar **path, gchar **path_reversed);
3558 gtk_widget_class_path(gtkWidget
, pathLength
, path
, pathReversed
);
3562 * Obtains the composite name of a widget.
3566 * the composite name of widget, or NULL if widget is not
3567 * a composite child. The string should not be freed when it is no
3570 public char[] getCompositeName()
3572 // gchar* gtk_widget_get_composite_name (GtkWidget *widget);
3573 return Str
.toString(gtk_widget_get_composite_name(gtkWidget
) );
3577 * Modifies style values on the widget. Modifications made using this
3578 * technique take precedence over style values set via an RC file,
3579 * however, they will be overriden if a style is explicitely set on
3580 * the widget using gtk_widget_set_style(). The GtkRcStyle structure
3581 * is designed so each field can either be set or unset, so it is
3582 * possible, using this function, to modify some style values and
3583 * leave the others unchanged.
3584 * Note that modifications made with this function are not cumulative
3585 * with previous calls to gtk_widget_modify_style() or with such
3586 * functions as gtk_widget_modify_fg(). If you wish to retain
3587 * previous values, you must first call gtk_widget_get_modifier_style(),
3588 * make your modifications to the returned style, then call
3589 * gtk_widget_modify_style() with that style. On the other hand,
3590 * if you first call gtk_widget_modify_style(), subsequent calls
3591 * to such functions gtk_widget_modify_fg() will have a cumulative
3592 * effect with the initial modifications.
3596 * the GtkRcStyle holding the style modifications
3598 public void modifyStyle(RcStyle style
)
3600 // void gtk_widget_modify_style (GtkWidget *widget, GtkRcStyle *style);
3601 gtk_widget_modify_style(gtkWidget
, (style
is null) ?
null : style
.getRcStyleStruct());
3605 * Returns the current modifier style for the widget. (As set by
3606 * gtk_widget_modify_style().) If no style has previously set, a new
3607 * GtkRcStyle will be created with all values unset, and set as the
3608 * modifier style for the widget. If you make changes to this rc
3609 * style, you must call gtk_widget_modify_style(), passing in the
3610 * returned rc style, to make sure that your changes take effect.
3611 * Caution: passing the style back to gtk_widget_modify_style() will
3612 * normally end up destroying it, because gtk_widget_modify_style() copies
3613 * the passed-in style and sets the copy as the new modifier style,
3614 * thus dropping any reference to the old modifier style. Add a reference
3615 * to the modifier style if you want to keep it alive.
3619 * the modifier style for the widget. This rc style is
3620 * owned by the widget. If you want to keep a pointer to value this
3621 * around, you must add a refcount using g_object_ref().
3623 public RcStyle
getModifierStyle()
3625 // GtkRcStyle* gtk_widget_get_modifier_style (GtkWidget *widget);
3626 return new RcStyle( gtk_widget_get_modifier_style(gtkWidget
) );
3630 * Sets the foreground color for a widget in a particular state. All
3631 * other style values are left untouched. See also
3632 * gtk_widget_modify_style().
3636 * the state for which to set the foreground color.
3638 * the color to assign (does not need to be allocated),
3639 * or NULL to undo the effect of previous calls to
3640 * of gtk_widget_modify_fg().
3642 public void modifyFg(GtkStateType state
, Color color
)
3644 // void gtk_widget_modify_fg (GtkWidget *widget, GtkStateType state, const GdkColor *color);
3645 gtk_widget_modify_fg(gtkWidget
, state
, (color
is null) ?
null : color
.getColorStruct());
3649 * Sets the background color for a widget in a particular state. All
3650 * other style values are left untouched. See also
3651 * gtk_widget_modify_style().
3652 * Note that "no window" widgets (which have the GTK_NO_WINDOW flag set)
3653 * draw on their parent container's window and thus may not draw any background
3654 * themselves. This is the case for e.g. GtkLabel. To modify the background
3655 * of such widgets, you have to set the background color on their parent; if you want
3656 * to set the background of a rectangular area around a label, try placing the
3657 * label in a GtkEventBox widget and setting the background color on that.
3661 * the state for which to set the background color.
3663 * the color to assign (does not need to be allocated),
3664 * or NULL to undo the effect of previous calls to
3665 * of gtk_widget_modify_bg().
3667 public void modifyBg(GtkStateType state
, Color color
)
3669 // void gtk_widget_modify_bg (GtkWidget *widget, GtkStateType state, const GdkColor *color);
3670 gtk_widget_modify_bg(gtkWidget
, state
, (color
is null) ?
null : color
.getColorStruct());
3674 * Sets the text color for a widget in a particular state. All other
3675 * style values are left untouched. The text color is the foreground
3676 * color used along with the base color (see gtk_widget_modify_base())
3677 * for widgets such as GtkEntry and GtkTextView. See also
3678 * gtk_widget_modify_style().
3682 * the state for which to set the text color.
3684 * the color to assign (does not need to be allocated),
3685 * or NULL to undo the effect of previous calls to
3686 * of gtk_widget_modify_text().
3688 public void modifyText(GtkStateType state
, Color color
)
3690 // void gtk_widget_modify_text (GtkWidget *widget, GtkStateType state, const GdkColor *color);
3691 gtk_widget_modify_text(gtkWidget
, state
, (color
is null) ?
null : color
.getColorStruct());
3695 * Sets the base color for a widget in a particular state.
3696 * All other style values are left untouched. The base color
3697 * is the background color used along with the text color
3698 * (see gtk_widget_modify_text()) for widgets such as GtkEntry
3699 * and GtkTextView. See also gtk_widget_modify_style().
3700 * Note that "no window" widgets (which have the GTK_NO_WINDOW flag set)
3701 * draw on their parent container's window and thus may not draw any background
3702 * themselves. This is the case for e.g. GtkLabel. To modify the background
3703 * of such widgets, you have to set the base color on their parent; if you want
3704 * to set the background of a rectangular area around a label, try placing the
3705 * label in a GtkEventBox widget and setting the base color on that.
3709 * the state for which to set the base color.
3711 * the color to assign (does not need to be allocated),
3712 * or NULL to undo the effect of previous calls to
3713 * of gtk_widget_modify_base().
3715 public void modifyBase(GtkStateType state
, Color color
)
3717 // void gtk_widget_modify_base (GtkWidget *widget, GtkStateType state, const GdkColor *color);
3718 gtk_widget_modify_base(gtkWidget
, state
, (color
is null) ?
null : color
.getColorStruct());
3722 * Sets the font to use for a widget. All other style values are left
3723 * untouched. See also gtk_widget_modify_style().
3727 * the font description to use, or NULL to undo
3728 * the effect of previous calls to gtk_widget_modify_font().
3730 public void modifyFont(PgFontDescription fontDesc
)
3732 // void gtk_widget_modify_font (GtkWidget *widget, PangoFontDescription *font_desc);
3733 gtk_widget_modify_font(gtkWidget
, (fontDesc
is null) ?
null : fontDesc
.getPgFontDescriptionStruct());
3737 * Creates a new PangoContext with the appropriate font map,
3738 * font description, and base direction for drawing text for
3739 * this widget. See also gtk_widget_get_pango_context().
3743 * the new PangoContext
3745 public PgContext
createPangoContext()
3747 // PangoContext* gtk_widget_create_pango_context (GtkWidget *widget);
3748 return new PgContext( gtk_widget_create_pango_context(gtkWidget
) );
3752 * Gets a PangoContext with the appropriate font map, font description,
3753 * and base direction for this widget. Unlike the context returned
3754 * by gtk_widget_create_pango_context(), this context is owned by
3755 * the widget (it can be used until the screen for the widget changes
3756 * or the widget is removed from its toplevel), and will be updated to
3757 * match any changes to the widget's attributes.
3758 * If you create and keep a PangoLayout using this context, you must
3759 * deal with changes to the context by calling pango_layout_context_changed()
3760 * on the layout in response to the ::style-set and ::direction-changed signals
3765 * the PangoContext for the widget.
3767 public PgContext
getPangoContext()
3769 // PangoContext* gtk_widget_get_pango_context (GtkWidget *widget);
3770 return new PgContext( gtk_widget_get_pango_context(gtkWidget
) );
3774 * Creates a new PangoLayout with the appropriate font map,
3775 * font description, and base direction for drawing text for
3777 * If you keep a PangoLayout created in this way around, in order to
3778 * notify the layout of changes to the base direction or font of this
3779 * widget, you must call pango_layout_context_changed() in response to
3780 * the ::style-set and ::direction-changed signals for the widget.
3784 * text to set on the layout (can be NULL)
3786 * the new PangoLayout
3788 public PgLayout
createPangoLayout(char[] text
)
3790 // PangoLayout* gtk_widget_create_pango_layout (GtkWidget *widget, const gchar *text);
3791 return new PgLayout( gtk_widget_create_pango_layout(gtkWidget
, Str
.toStringz(text
)) );
3795 * A convenience function that uses the theme engine and RC file
3796 * settings for widget to look up stock_id and render it to
3797 * a pixbuf. stock_id should be a stock icon ID such as
3798 * GTK_STOCK_OPEN or GTK_STOCK_OK. size should be a size
3799 * such as GTK_ICON_SIZE_MENU. detail should be a string that
3800 * identifies the widget or code doing the rendering, so that
3801 * theme engines can special-case rendering for that widget or code.
3802 * The pixels in the returned GdkPixbuf are shared with the rest of
3803 * the application and should not be modified. The pixbuf should be freed
3804 * after use with g_object_unref().
3810 * a stock size. A size of (GtkIconSize)-1 means render at
3811 * the size of the source and don't scale (if there are multiple
3812 * source sizes, GTK+ picks one of the available sizes).
3814 * render detail to pass to theme engine
3816 * a new pixbuf, or NULL if the stock ID wasn't known
3818 public Pixbuf
renderIcon(char[] stockId
, GtkIconSize size
, char[] detail
)
3820 // GdkPixbuf* gtk_widget_render_icon (GtkWidget *widget, const gchar *stock_id, GtkIconSize size, const gchar *detail);
3821 return new Pixbuf( gtk_widget_render_icon(gtkWidget
, Str
.toStringz(stockId
), size
, Str
.toStringz(detail
)) );
3825 * Cancels the effect of a previous call to gtk_widget_push_composite_child().
3827 public static void popCompositeChild()
3829 // void gtk_widget_pop_composite_child (void);
3830 gtk_widget_pop_composite_child();
3834 * Makes all newly-created widgets as composite children until
3835 * the corresponding gtk_widget_pop_composite_child() call.
3836 * A composite child is a child that's an implementation detail of the
3837 * container it's inside and should not be visible to people using the
3838 * container. Composite children aren't treated differently by GTK (but
3839 * see gtk_container_foreach() vs. gtk_container_forall()), but e.g. GUI
3840 * builders might want to treat them in a different way.
3841 * Here is a simple example:
3842 * gtk_widget_push_composite_child ();
3843 * scrolled_window->hscrollbar = gtk_hscrollbar_new (hadjustment);
3844 * gtk_widget_set_composite_name (scrolled_window->hscrollbar, "hscrollbar");
3845 * gtk_widget_pop_composite_child ();
3846 * gtk_widget_set_parent (scrolled_window->hscrollbar,
3847 * GTK_WIDGET (scrolled_window));
3848 * g_object_ref (scrolled_window->hscrollbar);
3850 public static void pushCompositeChild()
3852 // void gtk_widget_push_composite_child (void);
3853 gtk_widget_push_composite_child();
3858 * gtk_widget_queue_clear is deprecated and should not be used in newly-written code.
3859 * This function does the same as gtk_widget_queue_draw().
3860 * Deprecated: Use gtk_widget_queue_draw() instead.
3864 public void queueClear()
3866 // void gtk_widget_queue_clear (GtkWidget *widget);
3867 gtk_widget_queue_clear(gtkWidget
);
3872 * gtk_widget_queue_clear_area is deprecated and should not be used in newly-written code.
3873 * This function is no longer different from
3874 * gtk_widget_queue_draw_area(), though it once was. Now it just calls
3875 * gtk_widget_queue_draw_area(). Originally
3876 * gtk_widget_queue_clear_area() would force a redraw of the
3877 * background for GTK_NO_WINDOW widgets, and
3878 * gtk_widget_queue_draw_area() would not. Now both functions ensure
3879 * the background will be redrawn.
3880 * Deprecated: Use gtk_widget_queue_draw_area() instead.
3884 * x coordinate of upper-left corner of rectangle to redraw
3886 * y coordinate of upper-left corner of rectangle to redraw
3888 * width of region to draw
3890 * height of region to draw
3892 public void queueClearArea(int x
, int y
, int width
, int height
)
3894 // void gtk_widget_queue_clear_area (GtkWidget *widget, gint x, gint y, gint width, gint height);
3895 gtk_widget_queue_clear_area(gtkWidget
, x
, y
, width
, height
);
3899 * Invalidates the rectangular area of widget defined by x, y,
3900 * width and height by calling gdk_window_invalidate_rect() on the
3901 * widget's window and all its child windows. Once the main loop
3902 * becomes idle (after the current batch of events has been processed,
3903 * roughly), the window will receive expose events for the union of
3904 * all regions that have been invalidated.
3905 * Normally you would only use this function in widget
3906 * implementations. You might also use it, or
3907 * gdk_window_invalidate_rect() directly, to schedule a redraw of a
3908 * GtkDrawingArea or some portion thereof.
3909 * Frequently you can just call gdk_window_invalidate_rect() or
3910 * gdk_window_invalidate_region() instead of this function. Those
3911 * functions will invalidate only a single window, instead of the
3912 * widget and all its children.
3913 * The advantage of adding to the invalidated region compared to
3914 * simply drawing immediately is efficiency; using an invalid region
3915 * ensures that you only have to redraw one time.
3919 * x coordinate of upper-left corner of rectangle to redraw
3921 * y coordinate of upper-left corner of rectangle to redraw
3923 * width of region to draw
3925 * height of region to draw
3927 public void queueDrawArea(int x
, int y
, int width
, int height
)
3929 // void gtk_widget_queue_draw_area (GtkWidget *widget, gint x, gint y, gint width, gint height);
3930 gtk_widget_queue_draw_area(gtkWidget
, x
, y
, width
, height
);
3934 * Recursively resets the shape on this widget and its descendants.
3938 public void resetShapes()
3940 // void gtk_widget_reset_shapes (GtkWidget *widget);
3941 gtk_widget_reset_shapes(gtkWidget
);
3945 * Sets whether the application intends to draw on the widget in
3946 * an ::expose-event handler.
3947 * This is a hint to the widget and does not affect the behavior of
3948 * the GTK+ core; many widgets ignore this flag entirely. For widgets
3949 * that do pay attention to the flag, such as GtkEventBox and GtkWindow,
3950 * the effect is to suppress default themed drawing of the widget's
3951 * background. (Children of the widget will still be drawn.) The application
3952 * is then entirely responsible for drawing the widget background.
3953 * Note that the background is still drawn when the widget is mapped.
3954 * If this is not suitable (e.g. because you want to make a transparent
3955 * window using an RGBA visual), you can work around this by doing:
3956 * gtk_widget_realize (window);
3957 * gdk_window_set_back_pixmap (window->window, NULL, FALSE);
3958 * gtk_widget_show (window);
3962 * TRUE if the application will paint on the widget
3964 public void setAppPaintable(int appPaintable
)
3966 // void gtk_widget_set_app_paintable (GtkWidget *widget, gboolean app_paintable);
3967 gtk_widget_set_app_paintable(gtkWidget
, appPaintable
);
3971 * Widgets are double buffered by default; you can use this function
3972 * to turn off the buffering. "Double buffered" simply means that
3973 * gdk_window_begin_paint_region() and gdk_window_end_paint() are called
3974 * automatically around expose events sent to the
3975 * widget. gdk_window_begin_paint() diverts all drawing to a widget's
3976 * window to an offscreen buffer, and gdk_window_end_paint() draws the
3977 * buffer to the screen. The result is that users see the window
3978 * update in one smooth step, and don't see individual graphics
3979 * primitives being rendered.
3980 * In very simple terms, double buffered widgets don't flicker,
3981 * so you would only use this function to turn off double buffering
3982 * if you had special needs and really knew what you were doing.
3983 * Note: if you turn off double-buffering, you have to handle
3984 * expose events, since even the clearing to the background color or
3985 * pixmap will not happen automatically (as it is done in
3986 * gdk_window_begin_paint()).
3990 * TRUE to double-buffer a widget
3992 public void setDoubleBuffered(int doubleBuffered
)
3994 // void gtk_widget_set_double_buffered (GtkWidget *widget, gboolean double_buffered);
3995 gtk_widget_set_double_buffered(gtkWidget
, doubleBuffered
);
3999 * Sets whether the entire widget is queued for drawing when its size
4000 * allocation changes. By default, this setting is TRUE and
4001 * the entire widget is redrawn on every size change. If your widget
4002 * leaves the upper left unchanged when made bigger, turning this
4003 * setting on will improve performance.
4004 * Note that for NO_WINDOW widgets setting this flag to FALSE turns
4005 * off all allocation on resizing: the widget will not even redraw if
4006 * its position changes; this is to allow containers that don't draw
4007 * anything to avoid excess invalidations. If you set this flag on a
4008 * NO_WINDOW widget that does draw on widget->window,
4009 * you are responsible for invalidating both the old and new allocation
4010 * of the widget when the widget is moved and responsible for invalidating
4011 * regions newly when the widget increases size.
4014 * redraw_on_allocate:
4015 * if TRUE, the entire widget will be redrawn
4016 * when it is allocated to a new size. Otherwise, only the
4017 * new portion of the widget will be redrawn.
4019 public void setRedrawOnAllocate(int redrawOnAllocate
)
4021 // void gtk_widget_set_redraw_on_allocate (GtkWidget *widget, gboolean redraw_on_allocate);
4022 gtk_widget_set_redraw_on_allocate(gtkWidget
, redrawOnAllocate
);
4026 * Sets a widgets composite name. The widget must be
4027 * a composite child of its parent; see gtk_widget_push_composite_child().
4033 public void setCompositeName(char[] name
)
4035 // void gtk_widget_set_composite_name (GtkWidget *widget, const gchar *name);
4036 gtk_widget_set_composite_name(gtkWidget
, Str
.toStringz(name
));
4040 * For widgets that support scrolling, sets the scroll adjustments and
4041 * returns TRUE. For widgets that don't support scrolling, does
4042 * nothing and returns FALSE. Widgets that don't support scrolling
4043 * can be scrolled by placing them in a GtkViewport, which does
4044 * support scrolling.
4048 * an adjustment for horizontal scrolling, or NULL
4050 * an adjustment for vertical scrolling, or NULL
4052 * TRUE if the widget supports scrolling
4054 public int setScrollAdjustments(Adjustment hadjustment
, Adjustment vadjustment
)
4056 // gboolean gtk_widget_set_scroll_adjustments (GtkWidget *widget, GtkAdjustment *hadjustment, GtkAdjustment *vadjustment);
4057 return gtk_widget_set_scroll_adjustments(gtkWidget
, (hadjustment
is null) ?
null : hadjustment
.getAdjustmentStruct(), (vadjustment
is null) ?
null : vadjustment
.getAdjustmentStruct());
4065 public int mnemonicActivate(int groupCycling
)
4067 // gboolean gtk_widget_mnemonic_activate (GtkWidget *widget, gboolean group_cycling);
4068 return gtk_widget_mnemonic_activate(gtkWidget
, groupCycling
);
4072 * Installs a style property on a widget class. The parser for the
4073 * style property is determined by the value type of pspec.
4077 * the GParamSpec for the property
4079 public static void classInstallStyleProperty(GtkWidgetClass
* klass
, GParamSpec
* pspec
)
4081 // void gtk_widget_class_install_style_property (GtkWidgetClass *klass, GParamSpec *pspec);
4082 gtk_widget_class_install_style_property(klass
, pspec
);
4086 * Installs a style property on a widget class.
4090 * the GParamSpec for the style property
4092 * the parser for the style property
4094 public static void classInstallStylePropertyParser(GtkWidgetClass
* klass
, GParamSpec
* pspec
, GtkRcPropertyParser parser
)
4096 // void gtk_widget_class_install_style_property_parser (GtkWidgetClass *klass, GParamSpec *pspec, GtkRcPropertyParser parser);
4097 gtk_widget_class_install_style_property_parser(klass
, pspec
, parser
);
4101 * Finds a style property of a widget class by name.
4105 * the name of the style property to find
4107 * the GParamSpec of the style property or NULL if class has no
4108 * style property with that name.
4111 public static GParamSpec
* classFindStyleProperty(GtkWidgetClass
* klass
, char[] propertyName
)
4113 // GParamSpec* gtk_widget_class_find_style_property (GtkWidgetClass *klass, const gchar *property_name);
4114 return gtk_widget_class_find_style_property(klass
, Str
.toStringz(propertyName
));
4118 * Returns all style properties of a widget class.
4122 * location to return the number of style properties found
4124 * an newly allocated array of GParamSpec*. The array must be freed with g_free().
4127 public static GParamSpec
** classListStyleProperties(GtkWidgetClass
* klass
, uint* nProperties
)
4129 // GParamSpec** gtk_widget_class_list_style_properties (GtkWidgetClass *klass, guint *n_properties);
4130 return gtk_widget_class_list_style_properties(klass
, nProperties
);
4134 * Computes the intersection of a widget's area and region, returning
4135 * the intersection. The result may be empty, use gdk_region_empty() to
4140 * a GdkRegion, in the same coordinate system as
4141 * widget->allocation. That is, relative to widget->window
4142 * for NO_WINDOW widgets; relative to the parent window
4143 * of widget->window for widgets with their own window.
4145 * A newly allocated region holding the intersection of widget
4146 * and region. The coordinates of the return value are
4147 * relative to widget->window for NO_WINDOW widgets, and
4148 * relative to the parent window of widget->window for
4149 * widgets with their own window.
4151 public Region
regionIntersect(Region region
)
4153 // GdkRegion* gtk_widget_region_intersect (GtkWidget *widget, GdkRegion *region);
4154 return new Region( gtk_widget_region_intersect(gtkWidget
, (region
is null) ?
null : region
.getRegionStruct()) );
4158 * Very rarely-used function. This function is used to emit
4159 * an expose event signals on a widget. This function is not
4160 * normally used directly. The only time it is used is when
4161 * propagating an expose event to a child NO_WINDOW widget, and
4162 * that is normally done using gtk_container_propagate_expose().
4163 * If you want to force an area of a window to be redrawn,
4164 * use gdk_window_invalidate_rect() or gdk_window_invalidate_region().
4165 * To cause the redraw to be done immediately, follow that call
4166 * with a call to gdk_window_process_updates().
4172 * return from the event signal emission (TRUE if the event was handled)
4174 public int sendExpose(Event event
)
4176 // gint gtk_widget_send_expose (GtkWidget *widget, GdkEvent *event);
4177 return gtk_widget_send_expose(gtkWidget
, (event
is null) ?
null : event
.getEventStruct());
4181 * Gets the values of a multiple style properties of widget.
4184 * first_property_name:
4185 * the name of the first property to get
4187 * pairs of property names and locations to
4188 * return the property values, starting with the location for
4189 * first_property_name, terminated by NULL.
4191 public void styleGet(char[] firstPropertyName
, ... )
4193 // void gtk_widget_style_get (GtkWidget *widget, const gchar *first_property_name, ...);
4194 gtk_widget_style_get(gtkWidget
, Str
.toStringz(firstPropertyName
));
4198 * Gets the value of a style property of widget.
4202 * the name of a style property
4204 * location to return the property value
4206 public void styleGetProperty(char[] propertyName
, Value value
)
4208 // void gtk_widget_style_get_property (GtkWidget *widget, const gchar *property_name, GValue *value);
4209 gtk_widget_style_get_property(gtkWidget
, Str
.toStringz(propertyName
), (value
is null) ?
null : value
.getValueStruct());
4213 * Non-vararg variant of gtk_widget_style_get(). Used primarily by language
4217 * first_property_name:
4218 * the name of the first property to get
4220 * a va_list of pairs of property names and
4221 * locations to return the property values, starting with the location
4222 * for first_property_name.
4224 public void styleGetValist(char[] firstPropertyName
, void* varArgs
)
4226 // void gtk_widget_style_get_valist (GtkWidget *widget, const gchar *first_property_name, va_list var_args);
4227 gtk_widget_style_get_valist(gtkWidget
, Str
.toStringz(firstPropertyName
), varArgs
);
4231 * Returns the accessible object that describes the widget to an
4232 * assistive technology.
4233 * If no accessibility library is loaded (i.e. no ATK implementation library is
4234 * loaded via GTK_MODULES or via another application library,
4235 * such as libgnome), then this AtkObject instance may be a no-op. Likewise,
4236 * if no class-specific AtkObject implementation is available for the widget
4237 * instance in question, it will inherit an AtkObject implementation from the
4238 * first ancestor class for which such an implementation is defined.
4239 * The documentation of the ATK
4240 * library contains more information about accessible objects and their uses.
4244 * the AtkObject associated with widget
4246 public ObjectAtk
getAccessible()
4248 // AtkObject* gtk_widget_get_accessible (GtkWidget *widget);
4249 return new ObjectAtk( gtk_widget_get_accessible(gtkWidget
) );
4253 * This function is used by custom widget implementations; if you're
4254 * writing an app, you'd use gtk_widget_grab_focus() to move the focus
4255 * to a particular widget, and gtk_container_set_focus_chain() to
4256 * change the focus tab order. So you may want to investigate those
4257 * functions instead.
4258 * gtk_widget_child_focus() is called by containers as the user moves
4259 * around the window using keyboard shortcuts. direction indicates
4260 * what kind of motion is taking place (up, down, left, right, tab
4261 * forward, tab backward). gtk_widget_child_focus() invokes the
4262 * "focus" signal on GtkWidget; widgets override the default handler
4263 * for this signal in order to implement appropriate focus behavior.
4264 * The "focus" default handler for a widget should return TRUE if
4265 * moving in direction left the focus on a focusable location inside
4266 * that widget, and FALSE if moving in direction moved the focus
4267 * outside the widget. If returning TRUE, widgets normally
4268 * call gtk_widget_grab_focus() to place the focus accordingly;
4269 * if returning FALSE, they don't modify the current focus location.
4270 * This function replaces gtk_container_focus() from GTK+ 1.2. It was
4271 * necessary to check that the child was visible, sensitive, and
4272 * focusable before calling
4273 * gtk_container_focus(). gtk_widget_child_focus() returns FALSE if
4274 * the widget is not currently in a focusable state, so there's no
4275 * need for those checks.
4279 * direction of focus movement
4281 * TRUE if focus ended up inside widget
4283 public int childFocus(GtkDirectionType direction
)
4285 // gboolean gtk_widget_child_focus (GtkWidget *widget, GtkDirectionType direction);
4286 return gtk_widget_child_focus(gtkWidget
, direction
);
4290 * Emits a "child-notify" signal for the
4291 * child property child_property
4293 * This is the analogue of g_object_notify() for child properties.
4297 * the name of a child property installed on the
4298 * class of widget's parent.
4300 public void childNotify(char[] childProperty
)
4302 // void gtk_widget_child_notify (GtkWidget *widget, const gchar *child_property);
4303 gtk_widget_child_notify(gtkWidget
, Str
.toStringz(childProperty
));
4307 * Stops emission of "child-notify" signals on widget. The signals are
4308 * queued until gtk_widget_thaw_child_notify() is called on widget.
4309 * This is the analogue of g_object_freeze_notify() for child properties.
4313 public void freezeChildNotify()
4315 // void gtk_widget_freeze_child_notify (GtkWidget *widget);
4316 gtk_widget_freeze_child_notify(gtkWidget
);
4320 * Gets the value set with gtk_widget_set_child_visible().
4321 * If you feel a need to use this function, your code probably
4322 * needs reorganization.
4323 * This function is only useful for container implementations and
4324 * never should be called by an application.
4328 * TRUE if the widget is mapped with the parent.
4330 public int getChildVisible()
4332 // gboolean gtk_widget_get_child_visible (GtkWidget *widget);
4333 return gtk_widget_get_child_visible(gtkWidget
);
4337 * Returns the parent container of widget.
4341 * the parent container of widget, or NULL
4343 public GtkWidget
* getParent()
4345 // GtkWidget* gtk_widget_get_parent (GtkWidget *widget);
4346 return gtk_widget_get_parent(gtkWidget
);
4350 * Gets the settings object holding the settings (global property
4351 * settings, RC file information, etc) used for this widget.
4352 * Note that this function can only be called when the GtkWidget
4353 * is attached to a toplevel, since the settings object is specific
4354 * to a particular GdkScreen.
4358 * the relevant GtkSettings object
4360 public Settings
getSettings()
4362 // GtkSettings* gtk_widget_get_settings (GtkWidget *widget);
4363 return new Settings( gtk_widget_get_settings(gtkWidget
) );
4367 * Returns the clipboard object for the given selection to
4368 * be used with widget. widget must have a GdkDisplay
4369 * associated with it, so must be attached to a toplevel
4374 * a GdkAtom which identifies the clipboard
4375 * to use. GDK_SELECTION_CLIPBOARD gives the
4376 * default clipboard. Another common value
4377 * is GDK_SELECTION_PRIMARY, which gives
4378 * the primary X selection.
4380 * the appropriate clipboard object. If no
4381 * clipboard already exists, a new one will
4382 * be created. Once a clipboard object has
4383 * been created, it is persistent for all time.
4386 public Clipboard
getClipboard(GdkAtom selection
)
4388 // GtkClipboard* gtk_widget_get_clipboard (GtkWidget *widget, GdkAtom selection);
4389 return new Clipboard( gtk_widget_get_clipboard(gtkWidget
, selection
) );
4393 * Get the GdkDisplay for the toplevel window associated with
4394 * this widget. This function can only be called after the widget
4395 * has been added to a widget hierarchy with a GtkWindow at the top.
4396 * In general, you should only create display specific
4397 * resources when a widget has been realized, and you should
4398 * free those resources when the widget is unrealized.
4402 * the GdkDisplay for the toplevel for this widget.
4405 public Display
getDisplay()
4407 // GdkDisplay* gtk_widget_get_display (GtkWidget *widget);
4408 return new Display( gtk_widget_get_display(gtkWidget
) );
4412 * Get the root window where this widget is located. This function can
4413 * only be called after the widget has been added to a widget
4414 * heirarchy with GtkWindow at the top.
4415 * The root window is useful for such purposes as creating a popup
4416 * GdkWindow associated with the window. In general, you should only
4417 * create display specific resources when a widget has been realized,
4418 * and you should free those resources when the widget is unrealized.
4422 * the GdkWindow root window for the toplevel for this widget.
4425 public Window
getRootWindow()
4427 // GdkWindow* gtk_widget_get_root_window (GtkWidget *widget);
4428 return new Window( gtk_widget_get_root_window(gtkWidget
) );
4432 * Get the GdkScreen from the toplevel window associated with
4433 * this widget. This function can only be called after the widget
4434 * has been added to a widget hierarchy with a GtkWindow
4436 * In general, you should only create screen specific
4437 * resources when a widget has been realized, and you should
4438 * free those resources when the widget is unrealized.
4442 * the GdkScreen for the toplevel for this widget.
4445 public Screen
getScreen()
4447 // GdkScreen* gtk_widget_get_screen (GtkWidget *widget);
4448 return new Screen( gtk_widget_get_screen(gtkWidget
) );
4452 * Checks whether there is a GdkScreen is associated with
4453 * this widget. All toplevel widgets have an associated
4454 * screen, and all widgets added into a heirarchy with a toplevel
4455 * window at the top.
4459 * TRUE if there is a GdkScreen associcated
4463 public int hasScreen()
4465 // gboolean gtk_widget_has_screen (GtkWidget *widget);
4466 return gtk_widget_has_screen(gtkWidget
);
4470 * Gets the size request that was explicitly set for the widget using
4471 * gtk_widget_set_size_request(). A value of -1 stored in width or
4472 * height indicates that that dimension has not been set explicitly
4473 * and the natural requisition of the widget will be used intead. See
4474 * gtk_widget_set_size_request(). To get the size a widget will
4475 * actually use, call gtk_widget_size_request() instead of
4480 * return location for width, or NULL
4482 * return location for height, or NULL
4484 public void getSizeRequest(int* width
, int* height
)
4486 // void gtk_widget_get_size_request (GtkWidget *widget, gint *width, gint *height);
4487 gtk_widget_get_size_request(gtkWidget
, width
, height
);
4493 * Sets whether widget should be mapped along with its when its parent
4494 * is mapped and widget has been shown with gtk_widget_show().
4495 * The child visibility can be set for widget before it is added to
4496 * a container with gtk_widget_set_parent(), to avoid mapping
4497 * children unnecessary before immediately unmapping them. However
4498 * it will be reset to its default state of TRUE when the widget
4499 * is removed from a container.
4500 * Note that changing the child visibility of a widget does not
4501 * queue a resize on the widget. Most of the time, the size of
4502 * a widget is computed from all visible children, whether or
4503 * not they are mapped. If this is not the case, the container
4504 * can queue a resize itself.
4505 * This function is only useful for container implementations and
4506 * never should be called by an application.
4510 * if TRUE, widget should be mapped along with its parent.
4512 public void setChildVisible(int isVisible
)
4514 // void gtk_widget_set_child_visible (GtkWidget *widget, gboolean is_visible);
4515 gtk_widget_set_child_visible(gtkWidget
, isVisible
);
4520 * Sets the minimum size of a widget; that is, the widget's size
4521 * request will be width by height. You can use this function to
4522 * force a widget to be either larger or smaller than it normally
4524 * In most cases, gtk_window_set_default_size() is a better choice for
4525 * toplevel windows than this function; setting the default size will
4526 * still allow users to shrink the window. Setting the size request
4527 * will force them to leave the window at least as large as the size
4528 * request. When dealing with window sizes,
4529 * gtk_window_set_geometry_hints() can be a useful function as well.
4530 * Note the inherent danger of setting any fixed size - themes,
4531 * translations into other languages, different fonts, and user action
4532 * can all change the appropriate size for a given widget. So, it's
4533 * basically impossible to hardcode a size that will always be
4535 * The size request of a widget is the smallest size a widget can
4536 * accept while still functioning well and drawing itself correctly.
4537 * However in some strange cases a widget may be allocated less than
4538 * its requested size, and in many cases a widget may be allocated more
4539 * space than it requested.
4540 * If the size request in a given direction is -1 (unset), then
4541 * the "natural" size request of the widget will be used instead.
4542 * Widgets can't actually be allocated a size less than 1 by 1, but
4543 * you can pass 0,0 to this function to mean "as small as possible."
4547 * width widget should request, or -1 to unset
4549 * height widget should request, or -1 to unset
4551 public void setSizeRequest(int width
, int height
)
4553 // void gtk_widget_set_size_request (GtkWidget *widget, gint width, gint height);
4554 gtk_widget_set_size_request(gtkWidget
, width
, height
);
4559 * Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
4560 * This causes all queued "child-notify" signals on widget to be emitted.
4564 public void thawChildNotify()
4566 // void gtk_widget_thaw_child_notify (GtkWidget *widget);
4567 gtk_widget_thaw_child_notify(gtkWidget
);
4571 * Sets the "no_show_all" property, which determines whether calls to
4572 * gtk_widget_show_all() and gtk_widget_hide_all() will affect this widget.
4573 * This is mostly for use in constructing widget hierarchies with externally
4574 * controlled visibility, see GtkUIManager.
4578 * the new value for the "no_show_all" property
4581 public void setNoShowAll(int noShowAll
)
4583 // void gtk_widget_set_no_show_all (GtkWidget *widget, gboolean no_show_all);
4584 gtk_widget_set_no_show_all(gtkWidget
, noShowAll
);
4588 * Returns the current value of the "no_show_all" property, which determines
4589 * whether calls to gtk_widget_show_all() and gtk_widget_hide_all()
4590 * will affect this widget.
4594 * the current value of the "no_show_all" property.
4597 public int getNoShowAll()
4599 // gboolean gtk_widget_get_no_show_all (GtkWidget *widget);
4600 return gtk_widget_get_no_show_all(gtkWidget
);
4604 * Returns a newly allocated list of the widgets, normally labels, for
4605 * which this widget is a the target of a mnemonic (see for example,
4606 * gtk_label_set_mnemonic_widget()).
4607 * The widgets in the list are not individually referenced. If you
4608 * want to iterate through the list and perform actions involving
4609 * callbacks that might destroy the widgets, you
4610 * must call g_list_foreach (result,
4611 * (GFunc)g_object_ref, NULL) first, and then unref all the
4612 * widgets afterwards.
4616 * the list of mnemonic labels; free this list
4617 * with g_list_free() when you are done with it.
4620 public ListG
listMnemonicLabels()
4622 // GList* gtk_widget_list_mnemonic_labels (GtkWidget *widget);
4623 return new ListG( gtk_widget_list_mnemonic_labels(gtkWidget
) );
4627 * Adds a widget to the list of mnemonic labels for
4628 * this widget. (See gtk_widget_list_mnemonic_labels()). Note the
4629 * list of mnemonic labels for the widget is cleared when the
4630 * widget is destroyed, so the caller must make sure to update
4631 * its internal state at this point as well, by using a connection
4632 * to the ::destroy signal or a weak notifier.
4636 * a GtkWidget that acts as a mnemonic label for widget.
4639 public void addMnemonicLabel(GtkWidget
* label
)
4641 // void gtk_widget_add_mnemonic_label (GtkWidget *widget, GtkWidget *label);
4642 gtk_widget_add_mnemonic_label(gtkWidget
, label
);
4646 * Removes a widget from the list of mnemonic labels for
4647 * this widget. (See gtk_widget_list_mnemonic_labels()). The widget
4648 * must have previously been added to the list with
4649 * gtk_widget_add_mnemonic_label().
4653 * a GtkWidget that was previously set as a mnemnic label for
4654 * widget with gtk_widget_add_mnemonic_label().
4657 public void removeMnemonicLabel(GtkWidget
* label
)
4659 // void gtk_widget_remove_mnemonic_label (GtkWidget *widget, GtkWidget *label);
4660 gtk_widget_remove_mnemonic_label(gtkWidget
, label
);
4664 * Returns the GtkAction that widget is a proxy for.
4665 * See also gtk_action_get_proxies().
4669 * the action that a widget is a proxy for, or
4670 * NULL, if it is not attached to an action.
4673 public GtkAction
* getAction()
4675 // GtkAction* gtk_widget_get_action (GtkWidget *widget);
4676 return gtk_widget_get_action(gtkWidget
);
4680 * Whether widget can rely on having its alpha channel
4681 * drawn correctly. On X11 this function returns whether a
4682 * compositing manager is running for widget's screen
4686 * TRUE if the widget can rely on its alpha
4687 * channel being drawn correctly.
4690 public int isComposited()
4692 // gboolean gtk_widget_is_composited (GtkWidget *widget);
4693 return gtk_widget_is_composited(gtkWidget
);
4697 * Notifies the user about an input-related error on this widget. If
4698 * the gtk-error-bell settings property is TRUE, it calls
4699 * gdk_window_beep(), otherwise it does nothing.
4700 * Note that the effect of gdk_window_beep() can be configured in many
4701 * ways, depending on the windowing backend and the desktop environment
4702 * or window manager that is used.
4707 public void errorBell()
4709 // void gtk_widget_error_bell (GtkWidget *widget);
4710 gtk_widget_error_bell(gtkWidget
);
4714 * This function should be called whenever keyboard navigation within
4715 * a single widget hits a boundary. The function emits the
4716 * "keynav-changed" signal on the widget and its return value should
4717 * be interpreted in a way similar to the return value of
4718 * gtk_widget_child_focus():
4719 * When TRUE is returned, stay in the widget, the failed keyboard
4720 * navigation is Ok and/or there is nowhere we can/should move the
4722 * When FALSE is returned, the caller should continue with keyboard
4723 * navigation outside the widget, e.g. by calling
4724 * gtk_widget_child_focus() on the widget's toplevel.
4725 * The default implementation for the "keynav-failed" signal is to
4726 * return TRUE for GTK_DIR_TAB_FORWARD and
4727 * GTK_DIR_TAB_BACKWARD. For the other values of GtkDirectionType,
4728 * it looks at the "gtk-keynav-cursor-only" settings property and
4729 * returns FALSE if the setting is TRUE. This way the entire GUI
4730 * becomes cursor-navigatable on input devices such as mobile phones
4731 * which only have cursor keys but no tab key.
4732 * Whenever the default implementation returns TRUE, it also calls
4733 * gtk_widget_error_bell() to notify the user of the failed keyboard
4735 * A use case for providing an own implementation of keynav-failed (by
4736 * either connecting to it or by overriding it) would be a row of
4737 * GtkEntry widgets where the user should be able to navigate the
4738 * entire row with the cursor keys, as e.g. known from GUIs that
4739 * require entering license keys.
4743 * direction of focus movement
4745 * TRUE if stopping keyboard navigation is fine, FALSE
4746 * if the emitting widget should try to handle the keyboard
4747 * navigation attempt in its parent container(s).
4750 public int keynavFailed(GtkDirectionType direction
)
4752 // gboolean gtk_widget_keynav_failed (GtkWidget *widget, GtkDirectionType direction);
4753 return gtk_widget_keynav_failed(gtkWidget
, direction
);
4757 * Copies a GtkRequisition.
4761 * a copy of requisition.
4763 public static GtkRequisition
* requisitionCopy(GtkRequisition
* requisition
)
4765 // GtkRequisition* gtk_requisition_copy (const GtkRequisition *requisition);
4766 return gtk_requisition_copy(requisition
);
4770 * Frees a GtkRequisition.
4774 * The "app-paintable" property
4775 * "app-paintable" gboolean : Read / Write
4776 * Whether the application will paint directly on the widget.
4777 * Default value: FALSE
4779 public static void requisitionFree(GtkRequisition
* requisition
)
4781 // void gtk_requisition_free (GtkRequisition *requisition);
4782 gtk_requisition_free(requisition
);