gtk2 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (281) hide show
  1. data/ChangeLog +6664 -0
  2. data/README +33 -0
  3. data/Rakefile +71 -0
  4. data/extconf.rb +116 -0
  5. data/src/global.h +33 -0
  6. data/src/init.c +39 -0
  7. data/src/lib/gtk2.rb +13 -0
  8. data/src/lib/gtk2/base.rb +95 -0
  9. data/src/makeinits.rb +57 -0
  10. data/src/makekeysyms.rb +5 -0
  11. data/src/rbgdk.c +395 -0
  12. data/src/rbgdk.h +50 -0
  13. data/src/rbgdkatom.c +122 -0
  14. data/src/rbgdkcairo.c +100 -0
  15. data/src/rbgdkcolor.c +151 -0
  16. data/src/rbgdkcolormap.c +142 -0
  17. data/src/rbgdkconst.c +29 -0
  18. data/src/rbgdkconversions.h +18 -0
  19. data/src/rbgdkcursor.c +115 -0
  20. data/src/rbgdkdevice.c +235 -0
  21. data/src/rbgdkdisplay.c +634 -0
  22. data/src/rbgdkdisplaymanager.c +50 -0
  23. data/src/rbgdkdragcontext.c +280 -0
  24. data/src/rbgdkdraw.c +487 -0
  25. data/src/rbgdkevent.c +1020 -0
  26. data/src/rbgdkgc.c +456 -0
  27. data/src/rbgdkgeometry.c +272 -0
  28. data/src/rbgdkimage.c +155 -0
  29. data/src/rbgdkinput.c +70 -0
  30. data/src/rbgdkkeymap.c +153 -0
  31. data/src/rbgdkkeysyms.h +2174 -0
  32. data/src/rbgdkkeyval.c +105 -0
  33. data/src/rbgdkpango.c +171 -0
  34. data/src/rbgdkpangorenderer.c +132 -0
  35. data/src/rbgdkpixbuf.c +178 -0
  36. data/src/rbgdkpixmap.c +255 -0
  37. data/src/rbgdkproperty.c +342 -0
  38. data/src/rbgdkrectangle.c +146 -0
  39. data/src/rbgdkregion.c +242 -0
  40. data/src/rbgdkrgb.c +197 -0
  41. data/src/rbgdkscreen.c +535 -0
  42. data/src/rbgdkselection.c +161 -0
  43. data/src/rbgdkthreads.c +68 -0
  44. data/src/rbgdktimecoord.c +118 -0
  45. data/src/rbgdkvisual.c +273 -0
  46. data/src/rbgdkwindow.c +1302 -0
  47. data/src/rbgdkwindowattr.c +213 -0
  48. data/src/rbgdkx11.c +256 -0
  49. data/src/rbgtk.c +93 -0
  50. data/src/rbgtk.h +121 -0
  51. data/src/rbgtkaboutdialog.c +195 -0
  52. data/src/rbgtkaccelerator.c +78 -0
  53. data/src/rbgtkaccelgroup.c +216 -0
  54. data/src/rbgtkaccelgroupentry.c +85 -0
  55. data/src/rbgtkaccelkey.c +116 -0
  56. data/src/rbgtkaccellabel.c +46 -0
  57. data/src/rbgtkaccelmap.c +162 -0
  58. data/src/rbgtkaccessible.c +29 -0
  59. data/src/rbgtkaction.c +277 -0
  60. data/src/rbgtkactiongroup.c +377 -0
  61. data/src/rbgtkadjustment.c +153 -0
  62. data/src/rbgtkalignment.c +71 -0
  63. data/src/rbgtkallocation.c +171 -0
  64. data/src/rbgtkarrow.c +47 -0
  65. data/src/rbgtkaspectframe.c +46 -0
  66. data/src/rbgtkassistant.c +230 -0
  67. data/src/rbgtkbbox.c +47 -0
  68. data/src/rbgtkbin.c +31 -0
  69. data/src/rbgtkbindingset.c +192 -0
  70. data/src/rbgtkborder.c +80 -0
  71. data/src/rbgtkbox.c +142 -0
  72. data/src/rbgtkbuildable.c +115 -0
  73. data/src/rbgtkbuilder.c +154 -0
  74. data/src/rbgtkbutton.c +151 -0
  75. data/src/rbgtkcalendar.c +159 -0
  76. data/src/rbgtkcelleditable.c +49 -0
  77. data/src/rbgtkcelllayout.c +144 -0
  78. data/src/rbgtkcellrenderer.c +139 -0
  79. data/src/rbgtkcellrendereraccel.c +42 -0
  80. data/src/rbgtkcellrenderercombo.c +37 -0
  81. data/src/rbgtkcellrendererpixbuf.c +33 -0
  82. data/src/rbgtkcellrendererprogress.c +37 -0
  83. data/src/rbgtkcellrendererspin.c +38 -0
  84. data/src/rbgtkcellrenderertext.c +45 -0
  85. data/src/rbgtkcellrenderertoggle.c +32 -0
  86. data/src/rbgtkcellview.c +134 -0
  87. data/src/rbgtkcheckbutton.c +55 -0
  88. data/src/rbgtkcheckmenuitem.c +56 -0
  89. data/src/rbgtkclipboard.c +473 -0
  90. data/src/rbgtkcolorbutton.c +63 -0
  91. data/src/rbgtkcolorsel.c +175 -0
  92. data/src/rbgtkcolorselectiondialog.c +72 -0
  93. data/src/rbgtkcombo.c +117 -0
  94. data/src/rbgtkcombobox.c +240 -0
  95. data/src/rbgtkcomboboxentry.c +60 -0
  96. data/src/rbgtkconst.c +163 -0
  97. data/src/rbgtkcontainer.c +776 -0
  98. data/src/rbgtkconversions.h +26 -0
  99. data/src/rbgtkcurve.c +105 -0
  100. data/src/rbgtkdialog.c +244 -0
  101. data/src/rbgtkdrag.c +436 -0
  102. data/src/rbgtkdrawingarea.c +31 -0
  103. data/src/rbgtkeditable.c +152 -0
  104. data/src/rbgtkentry.c +161 -0
  105. data/src/rbgtkentrycompletion.c +167 -0
  106. data/src/rbgtkeventbox.c +31 -0
  107. data/src/rbgtkexpander.c +67 -0
  108. data/src/rbgtkfilechooser.c +403 -0
  109. data/src/rbgtkfilechooserbutton.c +72 -0
  110. data/src/rbgtkfilechooserdialog.c +58 -0
  111. data/src/rbgtkfilechooserwidget.c +50 -0
  112. data/src/rbgtkfilefilter.c +139 -0
  113. data/src/rbgtkfilesel.c +155 -0
  114. data/src/rbgtkfixed.c +72 -0
  115. data/src/rbgtkfontbutton.c +69 -0
  116. data/src/rbgtkfontselection.c +30 -0
  117. data/src/rbgtkfontselectiondialog.c +106 -0
  118. data/src/rbgtkframe.c +64 -0
  119. data/src/rbgtkgamma.c +47 -0
  120. data/src/rbgtkhandlebox.c +42 -0
  121. data/src/rbgtkhbbox.c +31 -0
  122. data/src/rbgtkhbox.c +38 -0
  123. data/src/rbgtkhpaned.c +31 -0
  124. data/src/rbgtkhruler.c +31 -0
  125. data/src/rbgtkhscale.c +45 -0
  126. data/src/rbgtkhscrollbar.c +38 -0
  127. data/src/rbgtkhseparator.c +30 -0
  128. data/src/rbgtkiconfactory.c +80 -0
  129. data/src/rbgtkiconinfo.c +118 -0
  130. data/src/rbgtkiconset.c +87 -0
  131. data/src/rbgtkiconsize.c +90 -0
  132. data/src/rbgtkiconsource.c +176 -0
  133. data/src/rbgtkicontheme.c +309 -0
  134. data/src/rbgtkiconview.c +351 -0
  135. data/src/rbgtkimage.c +152 -0
  136. data/src/rbgtkimagemenuitem.c +52 -0
  137. data/src/rbgtkimcontext.c +134 -0
  138. data/src/rbgtkimcontextsimple.c +48 -0
  139. data/src/rbgtkimmulticontext.c +38 -0
  140. data/src/rbgtkinits.c +473 -0
  141. data/src/rbgtkinputdialog.c +30 -0
  142. data/src/rbgtkinvisible.c +68 -0
  143. data/src/rbgtkitem.c +51 -0
  144. data/src/rbgtkitemfactory.c +312 -0
  145. data/src/rbgtklabel.c +168 -0
  146. data/src/rbgtklayout.c +91 -0
  147. data/src/rbgtklinkbutton.c +68 -0
  148. data/src/rbgtkliststore.c +412 -0
  149. data/src/rbgtkmacros.h +26 -0
  150. data/src/rbgtkmain.c +532 -0
  151. data/src/rbgtkmenu.c +272 -0
  152. data/src/rbgtkmenubar.c +48 -0
  153. data/src/rbgtkmenuitem.c +171 -0
  154. data/src/rbgtkmenushell.c +128 -0
  155. data/src/rbgtkmenutoolbutton.c +74 -0
  156. data/src/rbgtkmessagedialog.c +102 -0
  157. data/src/rbgtkmisc.c +63 -0
  158. data/src/rbgtknotebook.c +484 -0
  159. data/src/rbgtkobject.c +186 -0
  160. data/src/rbgtkoptionmenu.c +65 -0
  161. data/src/rbgtkpagesetup.c +196 -0
  162. data/src/rbgtkpagesetupunixdialog.c +80 -0
  163. data/src/rbgtkpaned.c +114 -0
  164. data/src/rbgtkpapersize.c +186 -0
  165. data/src/rbgtkplug.c +84 -0
  166. data/src/rbgtkprintcontext.c +124 -0
  167. data/src/rbgtkprinter.c +155 -0
  168. data/src/rbgtkprintjob.c +151 -0
  169. data/src/rbgtkprintoperation.c +152 -0
  170. data/src/rbgtkprintoperationpreview.c +54 -0
  171. data/src/rbgtkprintsettings.c +794 -0
  172. data/src/rbgtkprintunixdialog.c +98 -0
  173. data/src/rbgtkprogress.c +21 -0
  174. data/src/rbgtkprogressbar.c +72 -0
  175. data/src/rbgtkradioaction.c +102 -0
  176. data/src/rbgtkradiobutton.c +83 -0
  177. data/src/rbgtkradiomenuitem.c +115 -0
  178. data/src/rbgtkradiotoolbutton.c +99 -0
  179. data/src/rbgtkrange.c +98 -0
  180. data/src/rbgtkrc.c +228 -0
  181. data/src/rbgtkrcstyle.c +184 -0
  182. data/src/rbgtkrecentaction.c +52 -0
  183. data/src/rbgtkrecentchooser.c +276 -0
  184. data/src/rbgtkrecentchooserdialog.c +59 -0
  185. data/src/rbgtkrecentchoosermenu.c +55 -0
  186. data/src/rbgtkrecentchooserwidget.c +45 -0
  187. data/src/rbgtkrecentdata.c +152 -0
  188. data/src/rbgtkrecentfilter.c +180 -0
  189. data/src/rbgtkrecentfilterinfo.c +197 -0
  190. data/src/rbgtkrecentinfo.c +232 -0
  191. data/src/rbgtkrecentmanager.c +164 -0
  192. data/src/rbgtkruler.c +82 -0
  193. data/src/rbgtkscale.c +47 -0
  194. data/src/rbgtkscalebutton.c +115 -0
  195. data/src/rbgtkscrollbar.c +21 -0
  196. data/src/rbgtkscrolledwindow.c +160 -0
  197. data/src/rbgtkselection.c +171 -0
  198. data/src/rbgtkselectiondata.c +333 -0
  199. data/src/rbgtkseparator.c +21 -0
  200. data/src/rbgtkseparatormenuitem.c +28 -0
  201. data/src/rbgtkseparatortoolitem.c +40 -0
  202. data/src/rbgtksettings.c +225 -0
  203. data/src/rbgtksizegroup.c +74 -0
  204. data/src/rbgtksocket.c +72 -0
  205. data/src/rbgtkspinbutton.c +138 -0
  206. data/src/rbgtkstatusbar.c +90 -0
  207. data/src/rbgtkstatusicon.c +120 -0
  208. data/src/rbgtkstock.c +264 -0
  209. data/src/rbgtkstyle.c +722 -0
  210. data/src/rbgtktable.c +190 -0
  211. data/src/rbgtktargetlist.c +148 -0
  212. data/src/rbgtktearoffmenuitem.c +30 -0
  213. data/src/rbgtktextappearance.c +173 -0
  214. data/src/rbgtktextattributes.c +209 -0
  215. data/src/rbgtktextbuffer.c +993 -0
  216. data/src/rbgtktextchild.c +49 -0
  217. data/src/rbgtktextiter.c +553 -0
  218. data/src/rbgtktextmark.c +87 -0
  219. data/src/rbgtktexttag.c +66 -0
  220. data/src/rbgtktexttagtable.c +94 -0
  221. data/src/rbgtktextview.c +351 -0
  222. data/src/rbgtktoggleaction.c +76 -0
  223. data/src/rbgtktogglebutton.c +84 -0
  224. data/src/rbgtktoggletoolbutton.c +70 -0
  225. data/src/rbgtktoolbar.c +373 -0
  226. data/src/rbgtktoolbutton.c +75 -0
  227. data/src/rbgtktoolitem.c +184 -0
  228. data/src/rbgtktooltip.c +76 -0
  229. data/src/rbgtktooltips.c +107 -0
  230. data/src/rbgtktreedragdest.c +19 -0
  231. data/src/rbgtktreedragsource.c +19 -0
  232. data/src/rbgtktreeiter.c +259 -0
  233. data/src/rbgtktreemodel.c +256 -0
  234. data/src/rbgtktreemodelfilter.c +214 -0
  235. data/src/rbgtktreemodelsort.c +113 -0
  236. data/src/rbgtktreepath.c +195 -0
  237. data/src/rbgtktreerowreference.c +168 -0
  238. data/src/rbgtktreeselection.c +235 -0
  239. data/src/rbgtktreesortable.c +127 -0
  240. data/src/rbgtktreestore.c +379 -0
  241. data/src/rbgtktreeview.c +881 -0
  242. data/src/rbgtktreeviewcolumn.c +331 -0
  243. data/src/rbgtkuimanager.c +210 -0
  244. data/src/rbgtkvbbox.c +31 -0
  245. data/src/rbgtkvbox.c +38 -0
  246. data/src/rbgtkviewport.c +33 -0
  247. data/src/rbgtkvolumebutton.c +36 -0
  248. data/src/rbgtkvpaned.c +31 -0
  249. data/src/rbgtkvruler.c +30 -0
  250. data/src/rbgtkvscale.c +45 -0
  251. data/src/rbgtkvscrollbar.c +38 -0
  252. data/src/rbgtkvseparator.c +30 -0
  253. data/src/rbgtkwidget.c +1414 -0
  254. data/src/rbgtkwindow.c +822 -0
  255. data/src/rbgtkwindowgroup.c +48 -0
  256. data/test/gtk-test-utils.rb +15 -0
  257. data/test/run-test.rb +30 -0
  258. data/test/test_gc.rb +25 -0
  259. data/test/test_gdk.rb +18 -0
  260. data/test/test_gdk_color.rb +10 -0
  261. data/test/test_gdk_display.rb +37 -0
  262. data/test/test_gdk_event.rb +11 -0
  263. data/test/test_gdk_gc.rb +7 -0
  264. data/test/test_gdk_keymap.rb +8 -0
  265. data/test/test_gdk_pango.rb +9 -0
  266. data/test/test_gdk_selection_data.rb +17 -0
  267. data/test/test_gdk_window.rb +29 -0
  268. data/test/test_gdk_window_attribute.rb +9 -0
  269. data/test/test_gtk_about_dialog.rb +14 -0
  270. data/test/test_gtk_buildable.rb +66 -0
  271. data/test/test_gtk_builder.rb +188 -0
  272. data/test/test_gtk_entry.rb +18 -0
  273. data/test/test_gtk_icon_theme.rb +30 -0
  274. data/test/test_gtk_image.rb +8 -0
  275. data/test/test_gtk_list_store.rb +65 -0
  276. data/test/test_gtk_menu_item.rb +13 -0
  277. data/test/test_gtk_rc_style.rb +14 -0
  278. data/test/test_gtk_tree_path.rb +20 -0
  279. data/test/test_gtk_unix_print.rb +14 -0
  280. data/test/test_gtk_widget.rb +32 -0
  281. metadata +393 -0
@@ -0,0 +1,822 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /************************************************
3
+
4
+ rbgtkwindow.c -
5
+
6
+ $Author: ktou $
7
+ $Date: 2007/09/08 12:49:10 $
8
+
9
+ Copyright (C) 2002-2006 Ruby-GNOME2 Project Team
10
+ Copyright (C) 1998-2000 Yukihiro Matsumoto,
11
+ Daisuke Kanda,
12
+ Hiroshi Igarashi
13
+ ************************************************/
14
+
15
+ #include "global.h"
16
+
17
+ #define _SELF(s) (GTK_WINDOW(RVAL2GOBJ(s)))
18
+
19
+ static VALUE
20
+ gwin_initialize(argc, argv, self)
21
+ int argc;
22
+ VALUE *argv;
23
+ VALUE self;
24
+ {
25
+ VALUE arg;
26
+ GtkWindowType tp = GTK_WINDOW_TOPLEVEL;
27
+ gchar* title = NULL;
28
+ GtkWidget* window = NULL;
29
+
30
+ if (rb_scan_args(argc, argv, "01", &arg) == 1) {
31
+ if (TYPE(arg) == T_STRING) {
32
+ StringValue(arg);
33
+ title = RVAL2CSTR(arg);
34
+ } else {
35
+ tp = RVAL2GENUM(arg, GTK_TYPE_WINDOW_TYPE);
36
+ }
37
+ }
38
+ window = gtk_window_new(tp);
39
+
40
+ if (title)
41
+ gtk_window_set_title(GTK_WINDOW(window), title);
42
+
43
+ RBGTK_INITIALIZE(self, window);
44
+ return Qnil;
45
+ }
46
+
47
+ static VALUE
48
+ gwin_set_wmclass(self, wmclass_name, wmclass_class)
49
+ VALUE self, wmclass_name, wmclass_class;
50
+ {
51
+ gtk_window_set_wmclass(_SELF(self),
52
+ NIL_P(wmclass_name)?NULL:RVAL2CSTR(wmclass_name),
53
+ NIL_P(wmclass_class)?NULL:RVAL2CSTR(wmclass_class));
54
+ return self;
55
+ }
56
+
57
+ static VALUE
58
+ gwin_add_accel_group(self, accel)
59
+ VALUE self, accel;
60
+ {
61
+ gtk_window_add_accel_group(_SELF(self),
62
+ GTK_ACCEL_GROUP(RVAL2GOBJ(accel)));
63
+ return self;
64
+ }
65
+
66
+ static VALUE
67
+ gwin_remove_accel_group(self, accel)
68
+ VALUE self, accel;
69
+ {
70
+ gtk_window_remove_accel_group(_SELF(self),
71
+ GTK_ACCEL_GROUP(RVAL2GOBJ(accel)));
72
+ return self;
73
+ }
74
+
75
+ static VALUE
76
+ gwin_activate_focus(self)
77
+ VALUE self;
78
+ {
79
+ return CBOOL2RVAL(gtk_window_activate_focus(_SELF(self)));
80
+ }
81
+
82
+ static VALUE
83
+ gwin_activate_default(self)
84
+ VALUE self;
85
+ {
86
+ return CBOOL2RVAL(gtk_window_activate_default(_SELF(self)));
87
+ }
88
+
89
+ static VALUE
90
+ gwin_active_focus(self)
91
+ VALUE self;
92
+ {
93
+ rb_warning("Gtk::Window#active_focus is deprecated. Use Gtk::Window#activate_focus");
94
+ gtk_window_activate_focus(_SELF(self));
95
+ return self;
96
+ }
97
+
98
+ static VALUE
99
+ gwin_active_default(self)
100
+ VALUE self;
101
+ {
102
+ rb_warning("Gtk::Window#active_default is deprecated. Use Gtk::Window#activate_default");
103
+ gtk_window_activate_default(_SELF(self));
104
+ return self;
105
+ }
106
+
107
+ static VALUE
108
+ gwin_set_default_size(self, w, h)
109
+ VALUE self, w, h;
110
+ {
111
+ gtk_window_set_default_size(_SELF(self),
112
+ NUM2INT(w), NUM2INT(h));
113
+ return self;
114
+ }
115
+
116
+ static VALUE
117
+ gwin_set_geometry_hints(self, geometry_widget, geometry, geom_mask)
118
+ VALUE self, geometry_widget, geometry, geom_mask;
119
+ {
120
+ gtk_window_set_geometry_hints(_SELF(self),
121
+ GTK_WIDGET(RVAL2GOBJ(geometry_widget)),
122
+ (GdkGeometry*)RVAL2BOXED(geometry, GDK_TYPE_GEOMETRY),
123
+ RVAL2GFLAGS(geom_mask, GDK_TYPE_WINDOW_HINTS));
124
+ return self;
125
+ }
126
+
127
+ static VALUE
128
+ gwin_set_gravity(self, gravity)
129
+ VALUE self, gravity;
130
+ {
131
+ gtk_window_set_gravity(_SELF(self), RVAL2GENUM(gravity, GDK_TYPE_GRAVITY));
132
+ return self;
133
+ }
134
+
135
+ static VALUE
136
+ gwin_get_gravity(self)
137
+ VALUE self;
138
+ {
139
+ return GENUM2RVAL(gtk_window_get_gravity(_SELF(self)), GDK_TYPE_GRAVITY);
140
+ }
141
+
142
+ static VALUE
143
+ gwin_set_transient_for(self, parent)
144
+ VALUE self, parent;
145
+ {
146
+ gtk_window_set_transient_for(_SELF(self), _SELF(parent));
147
+ return self;
148
+ }
149
+
150
+ static VALUE
151
+ gwin_set_destroy_with_parent(self, setting)
152
+ VALUE self, setting;
153
+ {
154
+ gtk_window_set_destroy_with_parent(_SELF(self), RVAL2CBOOL(setting));
155
+ return self;
156
+ }
157
+
158
+ /* Define as Properties.
159
+ void gtk_window_set_screen (GtkWindow *window,
160
+ GdkScreen *screen);
161
+ GdkScreen* gtk_window_get_screen (GtkWindow *window);
162
+ gboolean gtk_window_is_active (GtkWindow *window);
163
+ gboolean gtk_window_has_toplevel_focus (GtkWindow *window);
164
+ */
165
+
166
+ static VALUE
167
+ gwin_s_list_toplevels(self)
168
+ VALUE self;
169
+ {
170
+ GList* list = gtk_window_list_toplevels();
171
+ VALUE ret = GLIST2ARY(list);
172
+ g_list_foreach(list, (GFunc)g_object_ref, NULL);
173
+ g_list_free(list);
174
+ return ret;
175
+ }
176
+
177
+ static VALUE
178
+ gwin_add_mnemonic(self, keyval, target)
179
+ VALUE self, keyval, target;
180
+ {
181
+ gtk_window_add_mnemonic(_SELF(self), NUM2INT(keyval), GTK_WIDGET(RVAL2GOBJ(target)));
182
+ return self;
183
+ }
184
+
185
+ static VALUE
186
+ gwin_remove_mnemonic(self, keyval, target)
187
+ VALUE self, keyval, target;
188
+ {
189
+ gtk_window_remove_mnemonic(_SELF(self), NUM2INT(keyval), GTK_WIDGET(RVAL2GOBJ(target)));
190
+ return self;
191
+ }
192
+
193
+ static VALUE
194
+ gwin_mnemonic_activate(self, keyval, modifier)
195
+ VALUE self, keyval, modifier;
196
+ {
197
+ return CBOOL2RVAL(gtk_window_mnemonic_activate(_SELF(self),
198
+ NUM2INT(keyval),
199
+ RVAL2GFLAGS(modifier, GDK_TYPE_MODIFIER_TYPE)));
200
+ }
201
+
202
+ static VALUE
203
+ gwin_get_focus(self)
204
+ VALUE self;
205
+ {
206
+ return GOBJ2RVAL(gtk_window_get_focus(_SELF(self)));
207
+ }
208
+
209
+ static VALUE
210
+ gwin_set_focus(self, win)
211
+ VALUE self, win;
212
+ {
213
+ gtk_window_set_focus(_SELF(self),
214
+ NIL_P(win) ? NULL : GTK_WIDGET(RVAL2GOBJ(win)));
215
+ return self;
216
+ }
217
+
218
+ static VALUE
219
+ gwin_set_default(self, win)
220
+ VALUE self, win;
221
+ {
222
+ gtk_window_set_default(_SELF(self),
223
+ NIL_P(win) ? NULL : GTK_WIDGET(RVAL2GOBJ(win)));
224
+ return self;
225
+ }
226
+
227
+ #if GTK_CHECK_VERSION(2,8,0)
228
+ static VALUE
229
+ gwin_present(argc, argv, self)
230
+ int argc;
231
+ VALUE *argv;
232
+ VALUE self;
233
+ {
234
+ VALUE timestamp;
235
+ if (rb_scan_args(argc, argv, "01", &timestamp) == 1) {
236
+ gtk_window_present_with_time(_SELF(self), NUM2UINT(timestamp));
237
+ } else {
238
+ gtk_window_present(_SELF(self));
239
+ }
240
+ return self;
241
+ }
242
+ #else
243
+ static VALUE
244
+ gwin_present(self)
245
+ VALUE self;
246
+ {
247
+ gtk_window_present(_SELF(self));
248
+ return self;
249
+ }
250
+ #endif
251
+
252
+ static VALUE
253
+ gwin_iconify(self)
254
+ VALUE self;
255
+ {
256
+ gtk_window_iconify(_SELF(self));
257
+ return self;
258
+ }
259
+
260
+ static VALUE
261
+ gwin_deiconify(self)
262
+ VALUE self;
263
+ {
264
+ gtk_window_deiconify(_SELF(self));
265
+ return self;
266
+ }
267
+
268
+ static VALUE
269
+ gwin_stick(self)
270
+ VALUE self;
271
+ {
272
+ gtk_window_stick(_SELF(self));
273
+ return self;
274
+ }
275
+
276
+ static VALUE
277
+ gwin_unstick(self)
278
+ VALUE self;
279
+ {
280
+ gtk_window_unstick(_SELF(self));
281
+ return self;
282
+ }
283
+
284
+ static VALUE
285
+ gwin_maximize(self)
286
+ VALUE self;
287
+ {
288
+ gtk_window_maximize(_SELF(self));
289
+ return self;
290
+ }
291
+
292
+ static VALUE
293
+ gwin_unmaximize(self)
294
+ VALUE self;
295
+ {
296
+ gtk_window_unmaximize(_SELF(self));
297
+ return self;
298
+ }
299
+
300
+ #if GTK_CHECK_VERSION(2,2,0)
301
+ static VALUE
302
+ gwin_fullscreen(self)
303
+ VALUE self;
304
+ {
305
+ gtk_window_fullscreen(_SELF(self));
306
+ return self;
307
+ }
308
+ static VALUE
309
+ gwin_unfullscreen(self)
310
+ VALUE self;
311
+ {
312
+ gtk_window_unfullscreen(_SELF(self));
313
+ return self;
314
+ }
315
+ #endif
316
+ #if GTK_CHECK_VERSION(2,4,0)
317
+ static VALUE
318
+ gwin_set_keep_above(self, setting)
319
+ VALUE self, setting;
320
+ {
321
+ gtk_window_set_keep_above(_SELF(self), RVAL2CBOOL(setting));
322
+ return self;
323
+ }
324
+ static VALUE
325
+ gwin_set_keep_below(self, setting)
326
+ VALUE self, setting;
327
+ {
328
+ gtk_window_set_keep_below(_SELF(self), RVAL2CBOOL(setting));
329
+ return self;
330
+ }
331
+ #endif
332
+
333
+ static VALUE
334
+ gwin_begin_resize_drag(self, edge, button, root_x, root_y, timestamp)
335
+ VALUE self, edge, button, root_x, root_y, timestamp;
336
+ {
337
+ gtk_window_begin_resize_drag(_SELF(self), RVAL2GENUM(edge, GDK_TYPE_WINDOW_EDGE),
338
+ NUM2INT(button), NUM2INT(root_x),
339
+ NUM2INT(root_y), NUM2UINT(timestamp));
340
+ return self;
341
+ }
342
+
343
+ static VALUE
344
+ gwin_begin_move_drag(self, button, root_x, root_y, timestamp)
345
+ VALUE self, button, root_x, root_y, timestamp;
346
+ {
347
+ gtk_window_begin_move_drag(_SELF(self),
348
+ NUM2INT(button), NUM2INT(root_x),
349
+ NUM2INT(root_y), NUM2UINT(timestamp));
350
+ return self;
351
+ }
352
+
353
+ static VALUE
354
+ gwin_set_decorated(self, setting)
355
+ VALUE self, setting;
356
+ {
357
+ gtk_window_set_decorated(_SELF(self), RVAL2CBOOL(setting));
358
+ return self;
359
+ }
360
+
361
+ static VALUE
362
+ gwin_set_frame_dimensions(self, left, top, right, bottom)
363
+ VALUE self, left, top, right, bottom;
364
+ {
365
+ gtk_window_set_frame_dimensions(_SELF(self), NUM2INT(left),
366
+ NUM2INT(top), NUM2INT(right),
367
+ NUM2INT(bottom));
368
+ return self;
369
+ }
370
+
371
+ static VALUE
372
+ gwin_set_has_frame(self, setting)
373
+ VALUE self, setting;
374
+ {
375
+ gtk_window_set_has_frame(_SELF(self), RVAL2CBOOL(setting));
376
+ return self;
377
+ }
378
+
379
+ static VALUE
380
+ gwin_set_mnemonic_modifier(self, modifier)
381
+ VALUE self, modifier;
382
+ {
383
+ gtk_window_set_mnemonic_modifier(_SELF(self),
384
+ RVAL2GFLAGS(modifier, GDK_TYPE_MODIFIER_TYPE));
385
+ return self;
386
+ }
387
+
388
+ static VALUE
389
+ gwin_set_role(self, role)
390
+ VALUE self, role;
391
+ {
392
+ gtk_window_set_role(_SELF(self), RVAL2CSTR(role));
393
+ return self;
394
+ }
395
+
396
+ static VALUE
397
+ gwin_set_type_hint(self, hint)
398
+ VALUE self, hint;
399
+ {
400
+ gtk_window_set_type_hint(_SELF(self), RVAL2GENUM(hint, GDK_TYPE_WINDOW_TYPE_HINT));
401
+ return self;
402
+ }
403
+ /* Defined as Properties
404
+ void gtk_window_set_skip_taskbar_hint
405
+ (GtkWindow *window,
406
+ gboolean setting);
407
+ void gtk_window_set_skip_pager_hint (GtkWindow *window,
408
+ gboolean setting);
409
+ void gtk_window_set_accept_focus (GtkWindow *window,
410
+ gboolean setting);
411
+
412
+ gchar* gtk_window_get_icon_name (GtkWindow *window);
413
+ void gtk_window_set_icon_name (GtkWindow *window,
414
+ const gchar *name);
415
+
416
+ void gtk_window_set_focus_on_map (GtkWindow *window,
417
+ gboolean setting);
418
+ gboolean gtk_window_get_focus_on_map (GtkWindow *window);
419
+
420
+ void gtk_window_set_urgency_hint (GtkWindow *window,
421
+ gboolean setting);
422
+
423
+ gboolean gtk_window_get_deletable (GtkWindow *window);
424
+
425
+ void gtk_window_set_deletable (GtkWindow *window,
426
+ gboolean setting);
427
+ */
428
+
429
+
430
+ static VALUE
431
+ gwin_get_decorated(self)
432
+ VALUE self;
433
+ {
434
+ return CBOOL2RVAL(gtk_window_get_decorated(_SELF(self)));
435
+ }
436
+
437
+ static VALUE
438
+ gwin_s_get_default_icon_list(self)
439
+ VALUE self;
440
+ {
441
+ return GLIST2ARYF(gtk_window_get_default_icon_list());
442
+ }
443
+
444
+ static VALUE
445
+ gwin_get_default_size(self)
446
+ VALUE self;
447
+ {
448
+ int width, height;
449
+ gtk_window_get_default_size(_SELF(self), &width, &height);
450
+ return rb_ary_new3(2, INT2NUM(width), INT2NUM(height));
451
+ }
452
+
453
+ static VALUE
454
+ gwin_get_destroy_with_parent(self)
455
+ VALUE self;
456
+ {
457
+ return gtk_window_get_destroy_with_parent(_SELF(self)) ? Qtrue : Qfalse;
458
+ }
459
+
460
+ static VALUE
461
+ gwin_get_frame_dimensions(self)
462
+ VALUE self;
463
+ {
464
+ int left, top, right, bottom;
465
+ gtk_window_get_frame_dimensions(_SELF(self), &left, &top, &right, &bottom);
466
+ return rb_ary_new3(4,
467
+ INT2NUM(left),
468
+ INT2NUM(top),
469
+ INT2NUM(right),
470
+ INT2NUM(bottom));
471
+ }
472
+
473
+ static VALUE
474
+ gwin_get_has_frame(self)
475
+ VALUE self;
476
+ {
477
+ return CBOOL2RVAL(gtk_window_get_has_frame(_SELF(self)));
478
+ }
479
+
480
+ static VALUE
481
+ gwin_get_icon_list(self)
482
+ VALUE self;
483
+ {
484
+ return GLIST2ARYF(gtk_window_get_icon_list(_SELF(self)));
485
+ }
486
+
487
+ static VALUE
488
+ gwin_get_mnemonic_modifier(self)
489
+ VALUE self;
490
+ {
491
+ return GFLAGS2RVAL(gtk_window_get_mnemonic_modifier(_SELF(self)), GDK_TYPE_MODIFIER_TYPE);
492
+ }
493
+
494
+ static VALUE
495
+ gwin_get_position(self)
496
+ VALUE self;
497
+ {
498
+ int root_x, root_y;
499
+ gtk_window_get_position(_SELF(self), &root_x, &root_y);
500
+ return rb_ary_new3(2, INT2NUM(root_x), INT2NUM(root_y));
501
+ }
502
+
503
+ static VALUE
504
+ gwin_get_role(self)
505
+ VALUE self;
506
+ {
507
+ const gchar* role = gtk_window_get_role(_SELF(self));
508
+ return role ? CSTR2RVAL(role) : Qnil;
509
+ }
510
+
511
+ static VALUE
512
+ gwin_get_size(self)
513
+ VALUE self;
514
+ {
515
+ int width, height;
516
+ gtk_window_get_size(_SELF(self), &width, &height);
517
+ return rb_ary_new3(2, INT2NUM(width), INT2NUM(height));
518
+ }
519
+
520
+ static VALUE
521
+ gwin_get_transient_for(self)
522
+ VALUE self;
523
+ {
524
+ GtkWindow* window = gtk_window_get_transient_for(_SELF(self));
525
+ return window ? GOBJ2RVAL(window) : Qnil;
526
+ }
527
+
528
+ static VALUE
529
+ gwin_get_type_hint(self)
530
+ VALUE self;
531
+ {
532
+ return GENUM2RVAL(gtk_window_get_type_hint(_SELF(self)), GDK_TYPE_WINDOW_TYPE_HINT);
533
+ }
534
+
535
+ #if GTK_CHECK_VERSION(2,10,0)
536
+ static VALUE
537
+ gwin_get_group(self)
538
+ VALUE self;
539
+ {
540
+ return GOBJ2RVAL(gtk_window_get_group(_SELF(self)));
541
+ }
542
+ #endif
543
+
544
+ static VALUE
545
+ gwin_move(self, x, y)
546
+ VALUE self, x, y;
547
+ {
548
+ gtk_window_move(_SELF(self), NUM2INT(x), NUM2INT(y));
549
+ return self;
550
+ }
551
+
552
+ static VALUE
553
+ gwin_parse_geometry(self, geometry)
554
+ VALUE self, geometry;
555
+ {
556
+ return CBOOL2RVAL(gtk_window_parse_geometry(_SELF(self), RVAL2CSTR(geometry)));
557
+ }
558
+
559
+ static VALUE
560
+ gwin_reshow_with_initial_size(self)
561
+ VALUE self;
562
+ {
563
+ gtk_window_reshow_with_initial_size(_SELF(self));
564
+ return self;
565
+ }
566
+
567
+ static VALUE
568
+ gwin_resize(self, width, height)
569
+ VALUE self, width, height;
570
+ {
571
+ gtk_window_resize(_SELF(self), NUM2INT(width), NUM2INT(height));
572
+ return self;
573
+ }
574
+
575
+ static VALUE
576
+ gwin_s_set_default_icon_list(self, list)
577
+ VALUE self, list;
578
+ {
579
+ int i;
580
+ GList *glist = NULL;
581
+ Check_Type(list, T_ARRAY);
582
+ for (i = 0; i < RARRAY_LEN(list); i++){
583
+ glist = g_list_append(glist, RVAL2GOBJ(RARRAY_PTR(list)[i]));
584
+ }
585
+ gtk_window_set_default_icon_list(glist);
586
+ g_list_free(glist);
587
+ return list;
588
+ }
589
+
590
+ #if GTK_CHECK_VERSION(2,2,0)
591
+ static VALUE
592
+ gwin_s_set_default_icon(self, icon_or_filename)
593
+ VALUE self, icon_or_filename;
594
+ {
595
+ if (TYPE(icon_or_filename) == T_STRING){
596
+ GError* err;
597
+ gboolean ret = gtk_window_set_default_icon_from_file(RVAL2CSTR(icon_or_filename), &err);
598
+ if (! ret)
599
+ RAISE_GERROR(err);
600
+ } else {
601
+ #if GTK_CHECK_VERSION(2,4,0)
602
+ gtk_window_set_default_icon(GDK_PIXBUF(RVAL2GOBJ(icon_or_filename)));
603
+ #else
604
+ rb_raise(rb_eArgError, "Invalid argument: %s, or you may need to use GTK+-2.4.x",
605
+ rb_class2name(CLASS_OF(icon_or_filename)));
606
+ #endif
607
+ }
608
+ return self;
609
+ }
610
+ #endif
611
+
612
+ #if GTK_CHECK_VERSION(2,6,0)
613
+ static VALUE
614
+ gwin_s_set_default_icon_name(self, name)
615
+ VALUE self, name;
616
+ {
617
+ gtk_window_set_default_icon_name(RVAL2CSTR(name));
618
+ return self;
619
+ }
620
+ #endif
621
+
622
+ static VALUE
623
+ gwin_set_icon(self, icon_or_filename)
624
+ VALUE self, icon_or_filename;
625
+ {
626
+ if (TYPE(icon_or_filename) == T_STRING){
627
+ #if GTK_CHECK_VERSION(2,2,0)
628
+ GError* err;
629
+ gboolean ret = gtk_window_set_icon_from_file(_SELF(self),
630
+ RVAL2CSTR(icon_or_filename), &err);
631
+ if (! ret)
632
+ RAISE_GERROR(err);
633
+ #else
634
+ rb_raise(rb_eArgError, "Invalid argument: %s, or you may need to use GTK+-2.4.x",
635
+ rb_class2name(CLASS_OF(icon_or_filename)));
636
+ #endif
637
+ } else {
638
+ gtk_window_set_icon(_SELF(self), GDK_PIXBUF(RVAL2GOBJ(icon_or_filename)));
639
+ }
640
+ return self;
641
+ }
642
+
643
+ static VALUE
644
+ gwin_set_icon_list(self, list)
645
+ VALUE self, list;
646
+ {
647
+ int i;
648
+ GList *glist = NULL;
649
+ Check_Type(list, T_ARRAY);
650
+ for (i = 0; i < RARRAY_LEN(list); i++){
651
+ glist = g_list_append(glist, RVAL2GOBJ(RARRAY_PTR(list)[i]));
652
+ }
653
+ gtk_window_set_icon_list(_SELF(self), glist);
654
+ g_list_free(glist);
655
+ return list;
656
+ }
657
+ #if GTK_CHECK_VERSION(2,2,0)
658
+ static VALUE
659
+ gwin_s_set_auto_startup_notification(self, setting)
660
+ VALUE self, setting;
661
+ {
662
+ gtk_window_set_auto_startup_notification(RVAL2CBOOL(setting));
663
+ return self;
664
+ }
665
+ #endif
666
+
667
+ /* They are not public methods.
668
+ static VALUE
669
+ gwin_decorated_window_init(self)
670
+ VALUE self;
671
+ {
672
+ gtk_decorated_window_init(_SELF(self));
673
+ return self;
674
+ }
675
+
676
+ static VALUE
677
+ gwin_decorated_window_calculate_frame_size(self)
678
+ VALUE self;
679
+ {
680
+ gtk_decorated_window_calculate_frame_size(_SELF(self));
681
+ return self;
682
+ }
683
+
684
+ static VALUE
685
+ gwin_decorated_window_set_title(self, title)
686
+ VALUE self, title;
687
+ {
688
+ gtk_decorated_window_set_title(_SELF(self), RVAL2CSTR(title));
689
+ return self;
690
+ }
691
+
692
+ static VALUE
693
+ gwin_decorated_window_move_resize_window(self)
694
+ VALUE self;
695
+ {
696
+ int x, y, width, height;
697
+ gtk_decorated_window_move_resize_window(_SELF(self), &x, &y, &width, &height);
698
+ return rb_ary_new3(4, INT2NUM(x), INT2NUM(y), INT2NUM(width), INT2NUM(height));
699
+ }
700
+ */
701
+
702
+ static void
703
+ mark_toplevels(void* _)
704
+ {
705
+ GList* list = gtk_window_list_toplevels();
706
+ GList* p;
707
+ for (p = list; p; p = g_list_next(p))
708
+ rbgobj_gc_mark_instance(p->data);
709
+ g_list_free(list);
710
+ }
711
+
712
+ void
713
+ Init_gtk_window()
714
+ {
715
+ VALUE gWindow = G_DEF_CLASS(GTK_TYPE_WINDOW, "Window", mGtk);
716
+
717
+ rb_define_method(gWindow, "initialize", gwin_initialize, -1);
718
+ rb_define_method(gWindow, "set_wmclass", gwin_set_wmclass, 2);
719
+ rb_define_method(gWindow, "add_accel_group", gwin_add_accel_group, 1);
720
+ rb_define_method(gWindow, "remove_accel_group", gwin_remove_accel_group, 1);
721
+ /* active_(focus|default) are deprecated. Use activate_* instead. */
722
+ rb_define_method(gWindow, "active_focus", gwin_active_focus, 0);
723
+ rb_define_method(gWindow, "active_default", gwin_active_default, 0);
724
+ rb_define_method(gWindow, "activate_focus", gwin_activate_focus, 0);
725
+ rb_define_method(gWindow, "activate_default", gwin_activate_default, 0);
726
+ rb_define_method(gWindow, "set_default_size", gwin_set_default_size, 2);
727
+ rb_define_method(gWindow, "set_geometry_hints", gwin_set_geometry_hints, 3);
728
+ rb_define_method(gWindow, "set_gravity", gwin_set_gravity, 1);
729
+ rb_define_method(gWindow, "gravity", gwin_get_gravity, 0);
730
+ rb_define_method(gWindow, "set_transient_for", gwin_set_transient_for, 1);
731
+ rb_define_method(gWindow, "set_destroy_with_parent", gwin_set_destroy_with_parent, 1);
732
+ rb_define_singleton_method(gWindow, "toplevels", gwin_s_list_toplevels, 0);
733
+ rb_define_method(gWindow, "add_mnemonic", gwin_add_mnemonic, 2);
734
+ rb_define_method(gWindow, "remove_mnemonic", gwin_remove_mnemonic, 2);
735
+ rb_define_method(gWindow, "mnemonic_activate", gwin_mnemonic_activate, 2);
736
+ rb_define_method(gWindow, "focus", gwin_get_focus, 0);
737
+ rb_define_method(gWindow, "set_focus", gwin_set_focus, 1);
738
+ rb_define_method(gWindow, "set_default", gwin_set_default, 1);
739
+ #if GTK_CHECK_VERSION(2,8,0)
740
+ rb_define_method(gWindow, "present", gwin_present, -1);
741
+ #else
742
+ rb_define_method(gWindow, "present", gwin_present, 0);
743
+ #endif
744
+ rb_define_method(gWindow, "iconify", gwin_iconify, 0);
745
+ rb_define_method(gWindow, "deiconify", gwin_deiconify, 0);
746
+ rb_define_method(gWindow, "stick", gwin_stick, 0);
747
+ rb_define_method(gWindow, "unstick", gwin_unstick, 0);
748
+ rb_define_method(gWindow, "maximize", gwin_maximize, 0);
749
+ rb_define_method(gWindow, "unmaximize", gwin_unmaximize, 0);
750
+ #if GTK_CHECK_VERSION(2,2,0)
751
+ rb_define_method(gWindow, "fullscreen", gwin_fullscreen, 0);
752
+ rb_define_method(gWindow, "unfullscreen", gwin_unfullscreen, 0);
753
+ #endif
754
+ #if GTK_CHECK_VERSION(2,4,0)
755
+ rb_define_method(gWindow, "set_keep_above", gwin_set_keep_above, 1);
756
+ rb_define_method(gWindow, "set_keep_below", gwin_set_keep_below, 1);
757
+ #endif
758
+ rb_define_method(gWindow, "begin_resize_drag", gwin_begin_resize_drag, 5);
759
+ rb_define_method(gWindow, "begin_move_drag", gwin_begin_move_drag, 4);
760
+ rb_define_method(gWindow, "set_decorated", gwin_set_decorated, 1);
761
+ rb_define_method(gWindow, "set_frame_dimensions", gwin_set_frame_dimensions, 4);
762
+ rb_define_method(gWindow, "set_mnemonic_modifier", gwin_set_mnemonic_modifier, 1);
763
+ rb_define_method(gWindow, "set_role", gwin_set_role, 1);
764
+ rb_define_method(gWindow, "set_type_hint", gwin_set_type_hint, 1);
765
+ rb_define_method(gWindow, "decorated?", gwin_get_decorated, 0);
766
+ rb_define_method(gWindow, "default_size", gwin_get_default_size, 0);
767
+ rb_define_singleton_method(gWindow, "default_icon_list", gwin_s_get_default_icon_list, 0);
768
+ rb_define_method(gWindow, "destroy_with_parent?", gwin_get_destroy_with_parent, 0);
769
+ rb_define_method(gWindow, "frame_dimensions", gwin_get_frame_dimensions, 0);
770
+ rb_define_method(gWindow, "set_has_frame", gwin_set_has_frame, 1);
771
+ rb_define_method(gWindow, "has_frame?", gwin_get_has_frame, 0);
772
+ rb_define_method(gWindow, "icon_list", gwin_get_icon_list, 0);
773
+ rb_define_method(gWindow, "mnemonic_modifier", gwin_get_mnemonic_modifier, 0);
774
+ rb_define_method(gWindow, "position", gwin_get_position, 0);
775
+ rb_define_method(gWindow, "role", gwin_get_role, 0);
776
+ rb_define_method(gWindow, "size", gwin_get_size, 0);
777
+ rb_define_method(gWindow, "transient_for", gwin_get_transient_for, 0);
778
+ rb_define_method(gWindow, "type_hint", gwin_get_type_hint, 0);
779
+ #if GTK_CHECK_VERSION(2,10,0)
780
+ rb_define_method(gWindow, "group", gwin_get_group, 0);
781
+ #endif
782
+ rb_define_method(gWindow, "move", gwin_move, 2);
783
+ rb_define_method(gWindow, "parse_geometry", gwin_parse_geometry, 1);
784
+ rb_define_method(gWindow, "reshow_with_initial_size", gwin_reshow_with_initial_size, 0);
785
+ rb_define_method(gWindow, "resize", gwin_resize, 2);
786
+ rb_define_singleton_method(gWindow, "set_default_icon_list", gwin_s_set_default_icon_list, 1);
787
+ #if GTK_CHECK_VERSION(2,2,0)
788
+ rb_define_singleton_method(gWindow, "set_default_icon", gwin_s_set_default_icon, 1);
789
+ #endif
790
+ #if GTK_CHECK_VERSION(2,6,0)
791
+ rb_define_singleton_method(gWindow, "set_default_icon_name", gwin_s_set_default_icon_name, 1);
792
+ #endif
793
+ rb_define_method(gWindow, "set_icon", gwin_set_icon, 1);
794
+ rb_define_method(gWindow, "set_icon_list", gwin_set_icon_list, 1);
795
+ #if GTK_CHECK_VERSION(2,2,0)
796
+ rb_define_singleton_method(gWindow, "set_auto_startup_notification",
797
+ gwin_s_set_auto_startup_notification, 1);
798
+ #endif
799
+
800
+ /*
801
+ rb_define_method(gWindow, "decorated_window_init", gwin_decorated_window_init, 0);
802
+ rb_define_method(gWindow, "decorated_window_calculate_frame_size", gwin_decorated_window_calculate_frame_size, 0);
803
+ rb_define_method(gWindow, "decorated_window_set_title", gwin_decorated_window_set_title, 1);
804
+ rb_define_method(gWindow, "decorated_window_move_resize_window", gwin_decorated_window_move_resize_window, 0);
805
+ */
806
+ G_DEF_SETTERS(gWindow);
807
+
808
+ /* GtkWindowPosition (from General constants) */
809
+ G_DEF_CLASS(GTK_TYPE_WINDOW_POSITION, "Position", gWindow);
810
+ G_DEF_CONSTANTS(gWindow, GTK_TYPE_WINDOW_POSITION, "GTK_WIN_");
811
+
812
+ /* GtkWindowType (from General constants) */
813
+ G_DEF_CLASS(GTK_TYPE_WINDOW_TYPE, "Type", gWindow);
814
+ G_DEF_CONSTANTS(gWindow, GTK_TYPE_WINDOW_TYPE, "GTK_WINDOW_");
815
+
816
+ {
817
+ static VALUE toplevels_marker;
818
+ toplevels_marker =
819
+ rb_data_object_alloc(rb_cData, NULL, mark_toplevels, NULL);
820
+ rb_global_variable(&toplevels_marker);
821
+ }
822
+ }