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,1302 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /************************************************
3
+
4
+ rbgdkwindow.c -
5
+
6
+ $Author: ggc $
7
+ $Date: 2007/07/13 16:07:31 $
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) GDK_WINDOW(RVAL2GOBJ(s))
18
+
19
+ static VALUE
20
+ gdkwin_initialize(self, parent, attributes, attributes_mask)
21
+ VALUE self, parent, attributes, attributes_mask;
22
+ {
23
+ GdkWindow* win;
24
+ win = gdk_window_new(NIL_P(parent) ? NULL : _SELF(parent),
25
+ (GdkWindowAttr*)RVAL2BOXED(attributes,
26
+ GDK_TYPE_WINDOW_ATTR),
27
+ RVAL2GFLAGS(attributes_mask,
28
+ GDK_TYPE_WINDOW_ATTRIBUTES_TYPE));
29
+ G_INITIALIZE(self, win);
30
+
31
+ return Qnil;
32
+ }
33
+
34
+ static VALUE
35
+ gdkwin_destroy(self)
36
+ VALUE self;
37
+ {
38
+ gdk_window_destroy(_SELF(self));
39
+ return Qnil;
40
+ }
41
+
42
+ static VALUE
43
+ gdkwin_get_window_type(self)
44
+ VALUE self;
45
+ {
46
+ return GENUM2RVAL(gdk_window_get_window_type(_SELF(self)), GDK_TYPE_WINDOW_TYPE);
47
+ }
48
+
49
+ static VALUE
50
+ gdkwin_s_at_pointer(self)
51
+ VALUE self;
52
+ {
53
+ gint x, y;
54
+ GdkWindow* win = gdk_window_at_pointer(&x, &y);
55
+ return rb_ary_new3(3, GOBJ2RVAL(win), INT2FIX(x), INT2FIX(y));
56
+ }
57
+
58
+ static VALUE
59
+ gdkwin_show(self)
60
+ VALUE self;
61
+ {
62
+ gdk_window_show(_SELF(self));
63
+ return self;
64
+ }
65
+
66
+ static VALUE
67
+ gdkwin_show_unraised(self)
68
+ VALUE self;
69
+ {
70
+ gdk_window_show_unraised(_SELF(self));
71
+ return self;
72
+ }
73
+
74
+ static VALUE
75
+ gdkwin_hide(self)
76
+ VALUE self;
77
+ {
78
+ gdk_window_hide(_SELF(self));
79
+ return Qnil;
80
+ }
81
+
82
+ static VALUE
83
+ gdkwin_is_visible(self)
84
+ VALUE self;
85
+ {
86
+ return CBOOL2RVAL(gdk_window_is_visible(_SELF(self)));
87
+ }
88
+
89
+ static VALUE
90
+ gdkwin_is_viewable(self)
91
+ VALUE self;
92
+ {
93
+ return CBOOL2RVAL(gdk_window_is_viewable(_SELF(self)));
94
+ }
95
+
96
+ static VALUE
97
+ gdkwin_get_state(self)
98
+ VALUE self;
99
+ {
100
+ return GENUM2RVAL(gdk_window_get_state(_SELF(self)), GDK_TYPE_WINDOW_STATE);
101
+ }
102
+
103
+ static VALUE
104
+ gdkwin_withdraw(self)
105
+ VALUE self;
106
+ {
107
+ gdk_window_withdraw(_SELF(self));
108
+ return Qnil;
109
+ }
110
+
111
+ static VALUE
112
+ gdkwin_iconify(self)
113
+ VALUE self;
114
+ {
115
+ gdk_window_iconify(_SELF(self));
116
+ return self;
117
+ }
118
+
119
+ static VALUE
120
+ gdkwin_deiconify(self)
121
+ VALUE self;
122
+ {
123
+ gdk_window_deiconify(_SELF(self));
124
+ return self;
125
+ }
126
+
127
+ static VALUE
128
+ gdkwin_stick(self)
129
+ VALUE self;
130
+ {
131
+ gdk_window_stick(_SELF(self));
132
+ return self;
133
+ }
134
+
135
+ static VALUE
136
+ gdkwin_unstick(self)
137
+ VALUE self;
138
+ {
139
+ gdk_window_unstick(_SELF(self));
140
+ return self;
141
+ }
142
+
143
+ static VALUE
144
+ gdkwin_maximize(self)
145
+ VALUE self;
146
+ {
147
+ gdk_window_maximize(_SELF(self));
148
+ return self;
149
+ }
150
+
151
+ static VALUE
152
+ gdkwin_unmaximize(self)
153
+ VALUE self;
154
+ {
155
+ gdk_window_unmaximize(_SELF(self));
156
+ return self;
157
+ }
158
+ #if GTK_CHECK_VERSION(2,2,0)
159
+ static VALUE
160
+ gdkwin_fullscreen(self)
161
+ VALUE self;
162
+ {
163
+ gdk_window_fullscreen(_SELF(self));
164
+ return self;
165
+ }
166
+
167
+ static VALUE
168
+ gdkwin_unfullscreen(self)
169
+ VALUE self;
170
+ {
171
+ gdk_window_unfullscreen(_SELF(self));
172
+ return self;
173
+ }
174
+ #endif
175
+ #if GTK_CHECK_VERSION(2,4,0)
176
+ static VALUE
177
+ gdkwin_set_keep_above(self, setting)
178
+ VALUE self, setting;
179
+ {
180
+ gdk_window_set_keep_above(_SELF(self), RVAL2CBOOL(setting));
181
+ return self;
182
+ }
183
+
184
+ static VALUE
185
+ gdkwin_set_keep_below(self, setting)
186
+ VALUE self, setting;
187
+ {
188
+ gdk_window_set_keep_below(_SELF(self), RVAL2CBOOL(setting));
189
+ return self;
190
+ }
191
+ #endif
192
+
193
+ static VALUE
194
+ gdkwin_move(self, x, y)
195
+ VALUE self, x, y;
196
+ {
197
+ gdk_window_move(_SELF(self), NUM2INT(x), NUM2INT(y));
198
+ return self;
199
+ }
200
+
201
+ static VALUE
202
+ gdkwin_resize(self, w, h)
203
+ VALUE self, w, h;
204
+ {
205
+ gdk_window_resize(_SELF(self), NUM2INT(w), NUM2INT(h));
206
+ return self;
207
+ }
208
+
209
+ static VALUE
210
+ gdkwin_move_resize(self, x, y, w, h)
211
+ VALUE self, x, y, w, h;
212
+ {
213
+ gdk_window_move_resize(_SELF(self), NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h));
214
+ return self;
215
+ }
216
+
217
+ static VALUE
218
+ gdkwin_scroll(self, dx, dy)
219
+ VALUE self, dx, dy;
220
+ {
221
+ gdk_window_scroll(_SELF(self), NUM2INT(dx), NUM2INT(dy));
222
+ return self;
223
+ }
224
+
225
+ #if GTK_CHECK_VERSION(2,8,0)
226
+ static VALUE
227
+ gdkwin_move_region(self, region, dx, dy)
228
+ VALUE self, region, dx, dy;
229
+ {
230
+ gdk_window_move_region(_SELF(self),
231
+ (GdkRegion*)RVAL2BOXED(region, GDK_TYPE_REGION),
232
+ NUM2INT(dx),
233
+ NUM2INT(dy));
234
+ return self;
235
+ }
236
+ #endif
237
+
238
+ static VALUE
239
+ gdkwin_reparent(self, new_parent, x, y)
240
+ VALUE self, new_parent, x, y;
241
+ {
242
+ gdk_window_reparent(_SELF(self), _SELF(new_parent), NUM2INT(x), NUM2INT(y));
243
+ return self;
244
+ }
245
+
246
+ static VALUE
247
+ gdkwin_clear(self)
248
+ VALUE self;
249
+ {
250
+ gdk_window_clear(_SELF(self));
251
+ return self;
252
+ }
253
+
254
+ static VALUE
255
+ gdkwin_clear_area(argc, argv, self)
256
+ int argc;
257
+ VALUE *argv;
258
+ VALUE self;
259
+ {
260
+ VALUE gen_expose, x, y, w, h;
261
+ rb_scan_args(argc, argv, "41", &x, &y, &w, &h, &gen_expose);
262
+
263
+ if (! NIL_P(gen_expose) && RVAL2CBOOL(gen_expose)){
264
+ gdk_window_clear_area_e(_SELF(self),
265
+ NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h));
266
+ } else {
267
+ gdk_window_clear_area(_SELF(self),
268
+ NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h));
269
+ }
270
+ return self;
271
+ }
272
+
273
+ /* Obsolete
274
+ #define gdk_window_copy_area()
275
+ */
276
+
277
+ static VALUE
278
+ gdkwin_raise(self)
279
+ VALUE self;
280
+ {
281
+ gdk_window_raise(_SELF(self));
282
+ return self;
283
+ }
284
+
285
+ static VALUE
286
+ gdkwin_lower(self)
287
+ VALUE self;
288
+ {
289
+ gdk_window_lower(_SELF(self));
290
+ return self;
291
+ }
292
+
293
+ static VALUE
294
+ gdkwin_focus(self, timestamp)
295
+ VALUE self, timestamp;
296
+ {
297
+ gdk_window_focus(_SELF(self), NUM2UINT(timestamp));
298
+ return self;
299
+ }
300
+
301
+ static VALUE
302
+ gdkwin_register_dnd(self)
303
+ VALUE self;
304
+ {
305
+ gdk_window_register_dnd(_SELF(self));
306
+ return self;
307
+ }
308
+
309
+ static VALUE
310
+ gdkwin_begin_resize_drag(self, edge, button, root_x, root_y, timestamp)
311
+ VALUE self, edge, button, root_x, root_y, timestamp;
312
+ {
313
+ gdk_window_begin_resize_drag(_SELF(self),
314
+ RVAL2GENUM(edge, GDK_TYPE_WINDOW_EDGE),
315
+ NUM2INT(button),
316
+ NUM2INT(root_x), NUM2INT(root_y),
317
+ NUM2UINT(timestamp));
318
+ return self;
319
+ }
320
+
321
+ static VALUE
322
+ gdkwin_begin_move_drag(self, button, root_x, root_y, timestamp)
323
+ VALUE self, button, root_x, root_y, timestamp;
324
+ {
325
+ gdk_window_begin_move_drag(_SELF(self), NUM2INT(button),
326
+ NUM2INT(root_x), NUM2INT(root_y),
327
+ NUM2UINT(timestamp));
328
+ return self;
329
+ }
330
+
331
+ static VALUE
332
+ gdkwin_s_constrain_size(self, geometry, flags, w, h)
333
+ VALUE self, geometry, flags, w, h;
334
+ {
335
+ gint new_width, new_height;
336
+ gdk_window_constrain_size((GdkGeometry*)RVAL2BOXED(geometry, GDK_TYPE_GEOMETRY),
337
+ RVAL2GFLAGS(flags, GDK_TYPE_WINDOW_HINTS),
338
+ NUM2INT(w), NUM2INT(h), &new_width, &new_height);
339
+ return rb_assoc_new(INT2NUM(new_width), INT2NUM(new_height));
340
+ }
341
+
342
+ #if GTK_CHECK_VERSION(2, 12, 0)
343
+ static VALUE
344
+ gdkwin_beep(VALUE self)
345
+ {
346
+ gdk_window_beep(_SELF(self));
347
+ return self;
348
+ }
349
+ #endif
350
+
351
+ static VALUE
352
+ gdkwin_begin_paint(self, area)
353
+ VALUE self, area;
354
+ {
355
+ if (rb_obj_is_kind_of(area, GTYPE2CLASS(GDK_TYPE_RECTANGLE))){
356
+ gdk_window_begin_paint_rect(_SELF(self),
357
+ (GdkRectangle*)RVAL2BOXED(area, GDK_TYPE_RECTANGLE));
358
+ } else {
359
+ gdk_window_begin_paint_region(_SELF(self),
360
+ (GdkRegion*)RVAL2BOXED(area, GDK_TYPE_REGION));
361
+ }
362
+ return self;
363
+ }
364
+
365
+ static VALUE
366
+ gdkwin_end_paint(self)
367
+ VALUE self;
368
+ {
369
+ gdk_window_end_paint(_SELF(self));
370
+ return self;
371
+ }
372
+
373
+ static VALUE
374
+ gdkwin_invalidate(self, area, invalidate_children)
375
+ VALUE self, area, invalidate_children;
376
+ {
377
+ if (rb_obj_is_kind_of(area, GTYPE2CLASS(GDK_TYPE_REGION))){
378
+ gdk_window_invalidate_region(_SELF(self),
379
+ RVAL2BOXED(area, GDK_TYPE_REGION),
380
+ RVAL2CBOOL(invalidate_children));
381
+ } else {
382
+ gdk_window_invalidate_rect(_SELF(self),
383
+ RVAL2BOXED(area, GDK_TYPE_RECTANGLE),
384
+ RVAL2CBOOL(invalidate_children));
385
+ }
386
+ return self;
387
+ }
388
+
389
+ static gboolean
390
+ invalidate_child_func_wrap(window, func)
391
+ GdkWindow* window;
392
+ VALUE func;
393
+ {
394
+ VALUE result = rb_funcall(func, id_call, 1, GOBJ2RVAL(window));
395
+ return RVAL2CBOOL(result);
396
+ }
397
+
398
+ typedef gboolean (*ChildFunc) (GdkWindow*, gpointer);
399
+
400
+ static VALUE
401
+ gdkwin_invalidate_maybe_recurse(self, region)
402
+ VALUE self, region;
403
+ {
404
+ VALUE func = (VALUE)NULL;
405
+ if (rb_block_given_p()){
406
+ func = rb_block_proc();
407
+ G_RELATIVE(self, func);
408
+ }
409
+ gdk_window_invalidate_maybe_recurse(_SELF(self),
410
+ RVAL2BOXED(region, GDK_TYPE_REGION),
411
+ (ChildFunc)invalidate_child_func_wrap,
412
+ (gpointer)func);
413
+ return self;
414
+ }
415
+
416
+ static VALUE
417
+ gdkwin_get_update_area(self)
418
+ VALUE self;
419
+ {
420
+ GdkRegion* ret = gdk_window_get_update_area(_SELF(self));
421
+ return BOXED2RVAL(ret, GDK_TYPE_REGION);
422
+ }
423
+
424
+ static VALUE
425
+ gdkwin_freeze_updates(self)
426
+ VALUE self;
427
+ {
428
+ gdk_window_freeze_updates(_SELF(self));
429
+ return self;
430
+ }
431
+
432
+ static VALUE
433
+ gdkwin_thaw_updates(self)
434
+ VALUE self;
435
+ {
436
+ gdk_window_thaw_updates(_SELF(self));
437
+ return self;
438
+ }
439
+
440
+ static VALUE
441
+ gdkwin_s_process_all_updates(self)
442
+ VALUE self;
443
+ {
444
+ gdk_window_process_all_updates();
445
+ return self;
446
+ }
447
+
448
+ static VALUE
449
+ gdkwin_process_updates(self, update_children)
450
+ VALUE self, update_children;
451
+ {
452
+ gdk_window_process_updates(_SELF(self), RVAL2CBOOL(update_children));
453
+ return self;
454
+ }
455
+
456
+ static VALUE
457
+ gdkwin_s_set_debug_updates(self, setting)
458
+ VALUE self, setting;
459
+ {
460
+ gdk_window_set_debug_updates(RVAL2CBOOL(setting));
461
+ return self;
462
+ }
463
+
464
+ static VALUE
465
+ gdkwin_get_internal_paint_info(self)
466
+ VALUE self;
467
+ {
468
+ GdkDrawable* real_drawable;
469
+ gint x_offset, y_offset;
470
+
471
+ gdk_window_get_internal_paint_info(_SELF(self), &real_drawable,
472
+ &x_offset, &y_offset);
473
+ return rb_ary_new3(3, GOBJ2RVAL(real_drawable),
474
+ INT2NUM(x_offset), INT2NUM(y_offset));
475
+ }
476
+
477
+ #if GTK_CHECK_VERSION(2,6,0)
478
+ static VALUE
479
+ gdkwin_configure_finished(self)
480
+ VALUE self;
481
+ {
482
+ gdk_window_configure_finished(_SELF(self));
483
+ return self;
484
+ }
485
+
486
+ static VALUE
487
+ gdkwin_enable_synchronized_configure(self)
488
+ VALUE self;
489
+ {
490
+ gdk_window_enable_synchronized_configure(_SELF(self));
491
+
492
+ if (rb_block_given_p()) {
493
+ rb_ensure(rb_yield, self, gdkwin_configure_finished, self);
494
+ }
495
+ return self;
496
+ }
497
+ #endif
498
+
499
+ static VALUE
500
+ gdkwin_set_user_data(self, user_data)
501
+ VALUE self, user_data;
502
+ {
503
+ gdk_window_set_user_data(_SELF(self), (gpointer)RVAL2GOBJ(user_data));
504
+ return self;
505
+ }
506
+
507
+ static VALUE
508
+ gdkwin_set_override_redirect(self, override_redirect)
509
+ VALUE self, override_redirect;
510
+ {
511
+ gdk_window_set_override_redirect(_SELF(self),
512
+ RVAL2CBOOL(override_redirect));
513
+ return self;
514
+ }
515
+
516
+ #if GTK_CHECK_VERSION(2,4,0)
517
+ static VALUE
518
+ gdkwin_set_accept_focus(self, accept_focus)
519
+ VALUE self, accept_focus;
520
+ {
521
+ gdk_window_set_accept_focus(_SELF(self), RVAL2CBOOL(accept_focus));
522
+ return self;
523
+ }
524
+ #endif
525
+
526
+ #if GTK_CHECK_VERSION(2,6,0)
527
+ static VALUE
528
+ gdkwin_set_focus_on_map(self, focus_on_map)
529
+ VALUE self, focus_on_map;
530
+ {
531
+ gdk_window_set_focus_on_map(_SELF(self), RVAL2CBOOL(focus_on_map));
532
+ return self;
533
+ }
534
+ #endif
535
+
536
+ /* GdkXEvent is not implemented.
537
+ void gdk_window_add_filter (GdkWindow *window,
538
+ GdkFilterFunc function,
539
+ gpointer data);
540
+ void gdk_window_remove_filter (GdkWindow *window,
541
+ GdkFilterFunc function,
542
+ gpointer data);
543
+ GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
544
+ GdkEvent *event,
545
+ gpointer data);
546
+ */
547
+
548
+ static VALUE
549
+ gdkwin_shape_combine_mask(self, shape_mask, offset_x, offset_y)
550
+ VALUE self, shape_mask, offset_x, offset_y;
551
+ {
552
+ gdk_window_shape_combine_mask(_SELF(self),
553
+ GDK_BITMAP(RVAL2GOBJ(shape_mask)),
554
+ NUM2INT(offset_x), NUM2INT(offset_y));
555
+ return self;
556
+ }
557
+
558
+ static VALUE
559
+ gdkwin_shape_combine_region(self, shape_region, offset_x, offset_y)
560
+ VALUE self, shape_region, offset_x, offset_y;
561
+ {
562
+ gdk_window_shape_combine_region(_SELF(self),
563
+ NIL_P(shape_region) ? NULL : (GdkRegion*)RVAL2BOXED(shape_region, GDK_TYPE_REGION),
564
+ INT2NUM(offset_x), INT2NUM(offset_y));
565
+ return self;
566
+ }
567
+
568
+ static VALUE
569
+ gdkwin_set_child_shapes(self)
570
+ VALUE self;
571
+ {
572
+ gdk_window_set_child_shapes(_SELF(self));
573
+ return self;
574
+ }
575
+
576
+ static VALUE
577
+ gdkwin_merge_child_shapes(self)
578
+ VALUE self;
579
+ {
580
+ gdk_window_merge_child_shapes(_SELF(self));
581
+ return self;
582
+ }
583
+
584
+ #if GTK_CHECK_VERSION(2,10,0)
585
+ static VALUE
586
+ gdkwin_input_shape_combine_mask(self, mask, x, y)
587
+ VALUE self, mask, x, y;
588
+ {
589
+ gdk_window_input_shape_combine_mask(_SELF(self),
590
+ GDK_BITMAP(RVAL2GOBJ(mask)),
591
+ NUM2INT(x), NUM2INT(y));
592
+ return self;
593
+ }
594
+
595
+ static VALUE
596
+ gdkwin_input_shape_combine_region(self, shape_region, offset_x, offset_y)
597
+ VALUE self, shape_region, offset_x, offset_y;
598
+ {
599
+ gdk_window_input_shape_combine_region(_SELF(self),
600
+ (GdkRegion*)RVAL2BOXED(shape_region, GDK_TYPE_REGION),
601
+ NUM2INT(offset_x),
602
+ NUM2INT(offset_y));
603
+ return self;
604
+ }
605
+
606
+ static VALUE
607
+ gdkwin_set_child_input_shapes(self)
608
+ VALUE self;
609
+ {
610
+ gdk_window_set_child_input_shapes(_SELF(self));
611
+ return self;
612
+ }
613
+
614
+ static VALUE
615
+ gdkwin_merge_child_input_shapes(self)
616
+ VALUE self;
617
+ {
618
+ gdk_window_merge_child_input_shapes(_SELF(self));
619
+ return self;
620
+ }
621
+
622
+ #endif
623
+
624
+ static VALUE
625
+ gdkwin_set_static_gravities(self, use_static)
626
+ VALUE self, use_static;
627
+ {
628
+ gboolean ret = gdk_window_set_static_gravities(_SELF(self),
629
+ RVAL2CBOOL(use_static));
630
+ if (! ret)
631
+ rb_raise(rb_eRuntimeError, "couldn't turn on static gravity");
632
+
633
+ return self;
634
+ }
635
+
636
+ /* Obsoleted.
637
+ void gdk_window_set_hints (GdkWindow *window,
638
+ */
639
+
640
+ static VALUE
641
+ gdkwin_set_title(self, title)
642
+ VALUE self, title;
643
+ {
644
+ gdk_window_set_title(_SELF(self),RVAL2CSTR(title));
645
+ return self;
646
+ }
647
+
648
+ static VALUE
649
+ gdkwin_set_background(self, color)
650
+ VALUE self, color;
651
+ {
652
+ gdk_window_set_background(_SELF(self), RVAL2GDKCOLOR(color));
653
+ return self;
654
+ }
655
+
656
+ static VALUE
657
+ gdkwin_set_back_pixmap(self, pixmap, parent_relative)
658
+ VALUE self, pixmap, parent_relative;
659
+ {
660
+ gdk_window_set_back_pixmap(_SELF(self),
661
+ GDK_PIXMAP(RVAL2GOBJ(pixmap)),
662
+ RVAL2CBOOL(parent_relative));
663
+ return self;
664
+ }
665
+
666
+ #if !GTK_CHECK_VERSION(2, 18, 0)
667
+ static VALUE
668
+ gdkwin_set_cursor(self, cursor)
669
+ VALUE self, cursor;
670
+ {
671
+ gdk_window_set_cursor(_SELF(self),
672
+ (GdkCursor*)(NIL_P(cursor) ? NULL : RVAL2BOXED(cursor, GDK_TYPE_CURSOR)));
673
+
674
+ return self;
675
+ }
676
+ #endif
677
+
678
+ /* Obsolete
679
+ #define gdk_window_set_colormap
680
+ */
681
+
682
+ static VALUE
683
+ gdkwin_get_user_data(self)
684
+ VALUE self;
685
+ {
686
+ GObject *data = NULL;
687
+ gdk_window_get_user_data(_SELF(self), (gpointer)&data);
688
+ return GOBJ2RVAL(data);
689
+ }
690
+
691
+ static VALUE
692
+ gdkwin_get_geometry(self)
693
+ VALUE self;
694
+ {
695
+ gint x, y, w, h, d;
696
+ gdk_window_get_geometry(_SELF(self), &x, &y, &w, &h, &d);
697
+ return rb_ary_new3(5, INT2NUM(x), INT2NUM(y),
698
+ INT2NUM(w), INT2NUM(h), INT2NUM(d));
699
+ }
700
+
701
+ static VALUE
702
+ gdkwin_set_geometry_hints(self, geometry, geom_mask)
703
+ VALUE self, geometry, geom_mask;
704
+ {
705
+ gdk_window_set_geometry_hints(_SELF(self),
706
+ NIL_P(geometry) ? (GdkGeometry*)NULL : (GdkGeometry*)RVAL2BOXED(geometry, GDK_TYPE_GEOMETRY),
707
+ RVAL2GFLAGS(geom_mask, GDK_TYPE_WINDOW_HINTS));
708
+ return self;
709
+ }
710
+
711
+ static VALUE
712
+ gdkwin_set_icon_list(self, pixbufs)
713
+ VALUE self, pixbufs;
714
+ {
715
+ int i;
716
+ GList *glist = NULL;
717
+
718
+ Check_Type(pixbufs, T_ARRAY);
719
+ for (i = 0; i < RARRAY_LEN(pixbufs); i++) {
720
+ glist = g_list_append(glist, GDK_PIXBUF(RVAL2GOBJ(RARRAY_PTR(pixbufs)[i])));
721
+ }
722
+
723
+ gdk_window_set_icon_list(_SELF(self), glist);
724
+ return self;
725
+ }
726
+
727
+ static VALUE
728
+ gdkwin_set_modal_hint(self, modal)
729
+ VALUE self, modal;
730
+ {
731
+ gdk_window_set_modal_hint(_SELF(self), RVAL2CBOOL(modal));
732
+ return self;
733
+ }
734
+
735
+ static VALUE
736
+ gdkwin_set_type_hint(self, hint)
737
+ VALUE self, hint;
738
+ {
739
+ gdk_window_set_type_hint(_SELF(self), RVAL2GENUM(hint, GDK_TYPE_WINDOW_TYPE_HINT));
740
+ return self;
741
+ }
742
+
743
+ #if GTK_CHECK_VERSION(2,10,0)
744
+ static VALUE
745
+ gdkwin_get_type_hint(self)
746
+ VALUE self;
747
+ {
748
+ return GENUM2RVAL(gdk_window_get_type_hint(_SELF(self)), GDK_TYPE_WINDOW_TYPE_HINT);
749
+ }
750
+ #endif
751
+
752
+ #if GTK_CHECK_VERSION(2,2,0)
753
+ static VALUE
754
+ gdkwin_set_skip_taskbar_hint(self, hint)
755
+ VALUE self, hint;
756
+ {
757
+ gdk_window_set_skip_taskbar_hint(_SELF(self), RVAL2CBOOL(hint));
758
+ return self;
759
+ }
760
+
761
+ static VALUE
762
+ gdkwin_set_skip_pager_hint(self, hint)
763
+ VALUE self, hint;
764
+ {
765
+ gdk_window_set_skip_pager_hint(_SELF(self), RVAL2CBOOL(hint));
766
+ return self;
767
+ }
768
+ #endif
769
+
770
+ #if GTK_CHECK_VERSION(2,8,0)
771
+ static VALUE
772
+ gdkwin_set_urgency_hint(self, hint)
773
+ VALUE self, hint;
774
+ {
775
+ gdk_window_set_urgency_hint(_SELF(self), RVAL2CBOOL(hint));
776
+ return self;
777
+ }
778
+ #endif
779
+
780
+ static VALUE
781
+ gdkwin_get_position(self)
782
+ VALUE self;
783
+ {
784
+ gint x, y;
785
+ gdk_window_get_position(_SELF(self), &x, &y);
786
+ return rb_assoc_new(INT2NUM(x), INT2NUM(y));
787
+ }
788
+
789
+ static VALUE
790
+ gdkwin_get_root_origin(self)
791
+ VALUE self;
792
+ {
793
+ int x, y;
794
+ gdk_window_get_root_origin(_SELF(self), &x, &y);
795
+ return rb_assoc_new(INT2FIX(x), INT2FIX(y));
796
+ }
797
+
798
+ static VALUE
799
+ gdkwin_get_frame_extents(self)
800
+ VALUE self;
801
+ {
802
+ GdkRectangle rect;
803
+ gdk_window_get_frame_extents(_SELF(self), &rect);
804
+ return BOXED2RVAL(&rect, GDK_TYPE_RECTANGLE);
805
+ }
806
+
807
+ /* Obsolete
808
+ #define gdk_window_get_size
809
+ #define gdk_window_get_visual
810
+ #define gdk_window_get_colormap
811
+ #define gdk_window_get_type
812
+ */
813
+
814
+ static VALUE
815
+ gdkwin_get_origin(self)
816
+ VALUE self;
817
+ {
818
+ gint x, y;
819
+ gdk_window_get_origin(_SELF(self), &x, &y);
820
+ return rb_assoc_new(INT2NUM(x), INT2NUM(y));
821
+ }
822
+
823
+ /* Obsolete
824
+ gboolean gdk_window_get_deskrelative_origin
825
+ (GdkWindow *window,
826
+ gint *x,
827
+ gint *y);
828
+ */
829
+
830
+ static VALUE
831
+ gdkwin_get_pointer(self)
832
+ VALUE self;
833
+ {
834
+ gint x, y;
835
+ GdkModifierType state;
836
+ GdkWindow* ret = gdk_window_get_pointer(_SELF(self), &x, &y, &state);
837
+ return rb_ary_new3(4, GOBJ2RVAL(ret), INT2NUM(x), INT2NUM(y), GFLAGS2RVAL(state, GDK_TYPE_MODIFIER_TYPE));
838
+ }
839
+
840
+ static VALUE
841
+ gdkwin_get_parent(self)
842
+ VALUE self;
843
+ {
844
+ return GOBJ2RVAL(gdk_window_get_parent(_SELF(self)));
845
+ }
846
+
847
+ static VALUE
848
+ gdkwin_get_toplevel(self)
849
+ VALUE self;
850
+ {
851
+ return GOBJ2RVAL(gdk_window_get_toplevel(_SELF(self)));
852
+ }
853
+
854
+ static VALUE
855
+ gdkwin_get_children(self)
856
+ VALUE self;
857
+ {
858
+ /* Don't use gdk_window_get_children() here */
859
+ GList* list = gdk_window_peek_children(_SELF(self));
860
+ VALUE ary = rb_ary_new();
861
+ while (list) {
862
+ rb_ary_push(ary, GOBJ2RVAL(list->data));
863
+ list = list->next;
864
+ }
865
+ return ary;
866
+ }
867
+
868
+ static VALUE
869
+ gdkwin_get_events(self)
870
+ VALUE self;
871
+ {
872
+ return GFLAGS2RVAL(gdk_window_get_events(_SELF(self)), GDK_TYPE_EVENT_MASK);
873
+ }
874
+
875
+ static VALUE
876
+ gdkwin_set_events(self, mask)
877
+ VALUE self, mask;
878
+ {
879
+ gdk_window_set_events(_SELF(self), RVAL2GFLAGS(mask, GDK_TYPE_EVENT_MASK));
880
+ return self;
881
+ }
882
+
883
+ static VALUE
884
+ gdkwin_set_icon(self, icon, pixmap, mask)
885
+ VALUE self, icon, pixmap, mask;
886
+ {
887
+ gdk_window_set_icon(_SELF(self), NIL_P(icon) ? NULL :_SELF(icon),
888
+ NIL_P(pixmap) ? NULL : GDK_PIXMAP(RVAL2GOBJ(pixmap)),
889
+ NIL_P(mask) ? NULL : GDK_BITMAP(RVAL2GOBJ(mask)));
890
+ return self;
891
+ }
892
+
893
+ static VALUE
894
+ gdkwin_set_icon_name(self, name)
895
+ VALUE self, name;
896
+ {
897
+ gdk_window_set_icon_name(_SELF(self), RVAL2CSTR(name));
898
+ return self;
899
+ }
900
+
901
+ static VALUE
902
+ gdkwin_set_transient_for(self, parent)
903
+ VALUE self, parent;
904
+ {
905
+ gdk_window_set_transient_for(_SELF(self), _SELF(parent));
906
+ return self;
907
+ }
908
+
909
+ static VALUE
910
+ gdkwin_set_role(self, role)
911
+ VALUE self, role;
912
+ {
913
+ gdk_window_set_role(_SELF(self), RVAL2CSTR(role));
914
+ return self;
915
+ }
916
+
917
+ static VALUE
918
+ gdkwin_set_group(self, leader)
919
+ VALUE self, leader;
920
+ {
921
+ gdk_window_set_group(_SELF(self), _SELF(leader));
922
+ return self;
923
+ }
924
+
925
+ #if GTK_CHECK_VERSION(2,4,0)
926
+ static VALUE
927
+ gdkwin_get_group(self)
928
+ VALUE self;
929
+ {
930
+ return GOBJ2RVAL(gdk_window_get_group(_SELF(self)));
931
+ }
932
+ #endif
933
+
934
+ static VALUE
935
+ gdkwin_set_decorations(self, decor)
936
+ VALUE self, decor;
937
+ {
938
+ gdk_window_set_decorations(_SELF(self), RVAL2GFLAGS(decor, GDK_TYPE_WM_DECORATION));
939
+ return self;
940
+ }
941
+
942
+ static VALUE
943
+ gdkwin_get_decorations(self)
944
+ VALUE self;
945
+ {
946
+ GdkWMDecoration decorations;
947
+ gboolean ret = gdk_window_get_decorations(_SELF(self), &decorations);
948
+ return ret ? GFLAGS2RVAL(decorations, GDK_TYPE_WM_DECORATION) : Qnil;
949
+ }
950
+
951
+ static VALUE
952
+ gdkwin_set_functions(self, func)
953
+ VALUE self, func;
954
+ {
955
+ gdk_window_set_functions(_SELF(self), RVAL2GFLAGS(func, GDK_TYPE_WM_FUNCTION));
956
+ return self;
957
+ }
958
+
959
+ #if GTK_CHECK_VERSION(2, 12, 0)
960
+ static VALUE
961
+ gdkwin_set_composited(VALUE self, VALUE composited)
962
+ {
963
+ gdk_window_set_composited(_SELF(self), RVAL2CBOOL(composited));
964
+ return self;
965
+ }
966
+
967
+ static VALUE
968
+ gdkwin_set_opacity(VALUE self, VALUE opacity)
969
+ {
970
+ gdk_window_set_opacity(_SELF(self), NUM2DBL(opacity));
971
+ return self;
972
+ }
973
+
974
+ static VALUE
975
+ gdkwin_set_startup_id(VALUE self, VALUE startup_id)
976
+ {
977
+ gdk_window_set_startup_id(_SELF(self), RVAL2CSTR_ACCEPT_NIL(startup_id));
978
+ return self;
979
+ }
980
+ #endif
981
+
982
+ static VALUE
983
+ gdkwin_s_get_toplevels(self)
984
+ VALUE self;
985
+ {
986
+ return GLIST2ARYF(gdk_window_get_toplevels());
987
+ }
988
+
989
+ static VALUE
990
+ gdkwin_s_get_default_root_window(self)
991
+ VALUE self;
992
+ {
993
+ return GOBJ2RVAL(gdk_get_default_root_window());
994
+ }
995
+
996
+ /* Would you need this?
997
+ GdkPointerHooks* gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks);
998
+ */
999
+
1000
+
1001
+ /* From X Window System Interaction */
1002
+ static VALUE
1003
+ gdkwin_foreign_new(argc, argv, self)
1004
+ int argc;
1005
+ VALUE *argv;
1006
+ VALUE self;
1007
+ {
1008
+ VALUE arg[2];
1009
+ GdkWindow * win = NULL;
1010
+
1011
+ rb_scan_args(argc, argv, "11", &arg[0], &arg[1]);
1012
+
1013
+ switch(argc)
1014
+ {
1015
+ case 1:
1016
+ win = gdk_window_foreign_new(NUM2UINT(arg[0]));
1017
+ break;
1018
+ case 2:
1019
+ #if GTK_CHECK_VERSION(2,2,0)
1020
+ win = gdk_window_foreign_new_for_display(RVAL2GOBJ(arg[0]), NUM2UINT(arg[1]));
1021
+ #else
1022
+ win = gdk_window_foreign_new(NUM2UINT(arg[1]));
1023
+ rb_warn("Not supported in GTK+-2.0.x.");
1024
+ #endif
1025
+ break;
1026
+ }
1027
+ if (win == NULL)
1028
+ return Qnil;
1029
+ else {
1030
+ return GOBJ2RVAL(win);
1031
+ }
1032
+ }
1033
+
1034
+ static VALUE
1035
+ gdkwin_lookup(argc, argv, self)
1036
+ int argc;
1037
+ VALUE *argv;
1038
+ VALUE self;
1039
+ {
1040
+ VALUE arg[2];
1041
+ GdkWindow * win = NULL;
1042
+
1043
+ rb_scan_args(argc, argv, "11", &arg[0], &arg[1]);
1044
+
1045
+ switch(argc)
1046
+ {
1047
+ case 1:
1048
+ win = gdk_window_lookup(NUM2UINT(arg[0]));
1049
+ break;
1050
+ case 2:
1051
+ #if GTK_CHECK_VERSION(2,2,0)
1052
+ win = gdk_window_lookup_for_display(RVAL2GOBJ(arg[0]), NUM2UINT(arg[1]));
1053
+ #else
1054
+ win = gdk_window_lookup(NUM2UINT(arg[1]));
1055
+ rb_warn("Not supported in GTK+-2.0.x.");
1056
+ #endif
1057
+ break;
1058
+ }
1059
+ if (win == NULL)
1060
+ return Qnil;
1061
+ else {
1062
+ return GOBJ2RVAL(win);
1063
+ }
1064
+ }
1065
+
1066
+ #ifdef GDK_WINDOWING_X11
1067
+ static VALUE
1068
+ gdkwin_get_server_time(self)
1069
+ VALUE self;
1070
+ {
1071
+ return UINT2NUM(gdk_x11_get_server_time(_SELF(self)));
1072
+ }
1073
+
1074
+ #if GTK_CHECK_VERSION(2,6,0)
1075
+ static VALUE
1076
+ gdkwin_set_user_time(VALUE self, VALUE time)
1077
+ {
1078
+ gdk_x11_window_set_user_time(_SELF(self), NUM2UINT(time));
1079
+ return Qnil;
1080
+ }
1081
+ #endif
1082
+
1083
+ #if GTK_CHECK_VERSION(2,8,0)
1084
+ static VALUE
1085
+ gdkwin_move_to_current_desktop(self)
1086
+ VALUE self;
1087
+ {
1088
+ gdk_x11_window_move_to_current_desktop(_SELF(self));
1089
+ return self;
1090
+ }
1091
+ #endif
1092
+
1093
+ #endif
1094
+
1095
+ void
1096
+ Init_gtk_gdk_window()
1097
+ {
1098
+ GObjectClass *g_class;
1099
+ VALUE gdkWindow = G_DEF_CLASS(GDK_TYPE_WINDOW, "Window", mGdk);
1100
+
1101
+ g_class = g_type_class_peek(GDK_TYPE_WINDOW);
1102
+
1103
+ rb_define_method(gdkWindow, "initialize", gdkwin_initialize, 3);
1104
+ rb_define_method(gdkWindow, "destroy", gdkwin_destroy, 0);
1105
+ rb_define_method(gdkWindow, "window_type", gdkwin_get_window_type, 0);
1106
+ rb_define_singleton_method(gdkWindow, "at_pointer", gdkwin_s_at_pointer, 0);
1107
+ rb_define_singleton_method(gdkWindow, "constrain_size", gdkwin_s_constrain_size, 4);
1108
+ rb_define_singleton_method(gdkWindow, "process_all_updates", gdkwin_s_process_all_updates, 0);
1109
+ rb_define_singleton_method(gdkWindow, "set_debug_updates", gdkwin_s_set_debug_updates, 1);
1110
+ rb_define_method(gdkWindow, "show", gdkwin_show, 0);
1111
+ rb_define_method(gdkWindow, "show_unraised", gdkwin_show_unraised, 0);
1112
+ rb_define_method(gdkWindow, "hide", gdkwin_hide, 0);
1113
+ rb_define_method(gdkWindow, "visible?", gdkwin_is_visible, 0);
1114
+ rb_define_method(gdkWindow, "viewable?", gdkwin_is_viewable, 0);
1115
+ rb_define_method(gdkWindow, "withdraw", gdkwin_withdraw, 0);
1116
+ rb_define_method(gdkWindow, "state", gdkwin_get_state, 0);
1117
+ rb_define_method(gdkWindow, "iconify", gdkwin_iconify, 0);
1118
+ rb_define_method(gdkWindow, "deiconify", gdkwin_deiconify, 0);
1119
+ rb_define_method(gdkWindow, "stick", gdkwin_stick, 0);
1120
+ rb_define_method(gdkWindow, "unstick", gdkwin_unstick, 0);
1121
+ rb_define_method(gdkWindow, "maximize", gdkwin_maximize, 0);
1122
+ rb_define_method(gdkWindow, "unmaximize", gdkwin_unmaximize, 0);
1123
+ #if GTK_CHECK_VERSION(2,2,0)
1124
+ rb_define_method(gdkWindow, "fullscreen", gdkwin_fullscreen, 0);
1125
+ rb_define_method(gdkWindow, "unfullscreen", gdkwin_unfullscreen, 0);
1126
+ #endif
1127
+ #if GTK_CHECK_VERSION(2,4,0)
1128
+ rb_define_method(gdkWindow, "set_keep_above", gdkwin_set_keep_above, 1);
1129
+ rb_define_method(gdkWindow, "set_keep_below", gdkwin_set_keep_below, 1);
1130
+ #endif
1131
+ rb_define_method(gdkWindow, "move", gdkwin_move, 2);
1132
+ rb_define_method(gdkWindow, "resize", gdkwin_resize, 2);
1133
+ rb_define_method(gdkWindow, "move_resize", gdkwin_move_resize, 4);
1134
+ rb_define_method(gdkWindow, "scroll", gdkwin_scroll, 2);
1135
+ #if GTK_CHECK_VERSION(2,8,0)
1136
+ rb_define_method(gdkWindow, "move_region", gdkwin_move_region, 3);
1137
+ #endif
1138
+ rb_define_method(gdkWindow, "reparent", gdkwin_reparent, 3);
1139
+ rb_define_method(gdkWindow, "clear", gdkwin_clear, 0);
1140
+ rb_define_method(gdkWindow, "clear_area", gdkwin_clear_area, -1);
1141
+ rb_define_method(gdkWindow, "raise", gdkwin_raise, 0);
1142
+ rb_define_method(gdkWindow, "lower", gdkwin_lower, 0);
1143
+ rb_define_method(gdkWindow, "focus", gdkwin_focus, 1);
1144
+ rb_define_method(gdkWindow, "register_dnd", gdkwin_register_dnd, 0);
1145
+ #if GTK_CHECK_VERSION(2, 12, 0)
1146
+ rb_define_method(gdkWindow, "beep", gdkwin_beep, 0);
1147
+ #endif
1148
+ rb_define_method(gdkWindow, "begin_resize_drag", gdkwin_begin_resize_drag, 5);
1149
+ rb_define_method(gdkWindow, "begin_move_drag", gdkwin_begin_move_drag, 4);
1150
+ rb_define_method(gdkWindow, "begin_paint", gdkwin_begin_paint, 1);
1151
+ rb_define_method(gdkWindow, "end_paint", gdkwin_end_paint, 0);
1152
+ rb_define_method(gdkWindow, "invalidate", gdkwin_invalidate, 2);
1153
+ rb_define_method(gdkWindow, "invalidate_maybe_recurse", gdkwin_invalidate_maybe_recurse, 1);
1154
+ rb_define_method(gdkWindow, "update_area", gdkwin_get_update_area, 0);
1155
+ rb_define_method(gdkWindow, "freeze_updates", gdkwin_freeze_updates, 0);
1156
+ rb_define_method(gdkWindow, "thaw_updates", gdkwin_thaw_updates, 0);
1157
+ rb_define_method(gdkWindow, "process_updates", gdkwin_process_updates, 1);
1158
+ rb_define_method(gdkWindow, "internal_paint_info", gdkwin_get_internal_paint_info, 0);
1159
+ #if GTK_CHECK_VERSION(2,6,0)
1160
+ rb_define_method(gdkWindow, "configure_finished", gdkwin_configure_finished, 0);
1161
+ rb_define_method(gdkWindow, "enable_synchronized_configure", gdkwin_enable_synchronized_configure, 0);
1162
+ #endif
1163
+ rb_define_method(gdkWindow, "set_user_data", gdkwin_set_user_data, 1);
1164
+ rb_define_method(gdkWindow, "set_override_redirect", gdkwin_set_override_redirect, 1);
1165
+ #if GTK_CHECK_VERSION(2,4,0)
1166
+ rb_define_method(gdkWindow, "set_accept_focus", gdkwin_set_accept_focus, 1);
1167
+ #endif
1168
+ #if GTK_CHECK_VERSION(2,6,0)
1169
+ rb_define_method(gdkWindow, "set_focus_on_map", gdkwin_set_focus_on_map, 1);
1170
+ #endif
1171
+ rb_define_method(gdkWindow, "shape_combine_mask", gdkwin_shape_combine_mask, 3);
1172
+ rb_define_method(gdkWindow, "shape_combine_region", gdkwin_shape_combine_region, 3);
1173
+ rb_define_method(gdkWindow, "set_child_shapes", gdkwin_set_child_shapes, 0);
1174
+ rb_define_method(gdkWindow, "merge_child_shapes", gdkwin_merge_child_shapes, 0);
1175
+ #if GTK_CHECK_VERSION(2,10,0)
1176
+ rb_define_method(gdkWindow, "input_shape_combine_mask", gdkwin_input_shape_combine_mask, 3);
1177
+ rb_define_method(gdkWindow, "input_shape_combine_region", gdkwin_input_shape_combine_region, 3);
1178
+ rb_define_method(gdkWindow, "set_child_input_shapes", gdkwin_set_child_input_shapes, 0);
1179
+ rb_define_method(gdkWindow, "merge_child_input_shapes", gdkwin_merge_child_input_shapes, 0);
1180
+ #endif
1181
+ rb_define_method(gdkWindow, "set_static_gravities", gdkwin_set_static_gravities, 1);
1182
+ rb_define_method(gdkWindow, "set_title", gdkwin_set_title, 1);
1183
+ rb_define_method(gdkWindow, "set_background", gdkwin_set_background, 1);
1184
+ rb_define_method(gdkWindow, "set_back_pixmap", gdkwin_set_back_pixmap, 2);
1185
+ #if !GTK_CHECK_VERSION(2, 18, 0)
1186
+ rb_define_method(gdkWindow, "set_cursor", gdkwin_set_cursor, 1);
1187
+ #endif
1188
+ rb_define_method(gdkWindow, "user_data", gdkwin_get_user_data, 0);
1189
+ rb_define_method(gdkWindow, "geometry", gdkwin_get_geometry, 0);
1190
+ rb_define_method(gdkWindow, "set_geometry_hints", gdkwin_set_geometry_hints, 2);
1191
+ rb_define_method(gdkWindow, "set_icon_list", gdkwin_set_icon_list, 1);
1192
+ rb_define_method(gdkWindow, "set_modal_hint", gdkwin_set_modal_hint, 1);
1193
+ rb_define_method(gdkWindow, "set_type_hint", gdkwin_set_type_hint, 1);
1194
+ #if GTK_CHECK_VERSION(2,10,0)
1195
+ rb_define_method(gdkWindow, "type_hint", gdkwin_get_type_hint, 0);
1196
+ #endif
1197
+
1198
+ #if GTK_CHECK_VERSION(2,2,0)
1199
+ rb_define_method(gdkWindow, "set_skip_taskbar_hint", gdkwin_set_skip_taskbar_hint, 1);
1200
+ rb_define_method(gdkWindow, "set_skip_pager_hint", gdkwin_set_skip_pager_hint, 1);
1201
+ #endif
1202
+ #if GTK_CHECK_VERSION(2,8,0)
1203
+ rb_define_method(gdkWindow, "set_urgency_hint", gdkwin_set_urgency_hint, 1);
1204
+ #endif
1205
+ rb_define_method(gdkWindow, "position", gdkwin_get_position, 0);
1206
+ rb_define_method(gdkWindow, "root_origin", gdkwin_get_root_origin, 0);
1207
+ rb_define_method(gdkWindow, "frame_extents", gdkwin_get_frame_extents, 0);
1208
+ rb_define_method(gdkWindow, "origin", gdkwin_get_origin, 0);
1209
+ rb_define_method(gdkWindow, "pointer", gdkwin_get_pointer, 0);
1210
+ rb_define_method(gdkWindow, "parent", gdkwin_get_parent, 0);
1211
+ rb_define_method(gdkWindow, "toplevel", gdkwin_get_toplevel, 0);
1212
+ rb_define_singleton_method(gdkWindow, "default_root_window", gdkwin_s_get_default_root_window, 0);
1213
+ rb_define_method(gdkWindow, "children", gdkwin_get_children, 0);
1214
+ rb_define_method(gdkWindow, "events", gdkwin_get_events, 0);
1215
+ rb_define_method(gdkWindow, "set_events", gdkwin_set_events, 1);
1216
+ rb_define_method(gdkWindow, "set_icon", gdkwin_set_icon, 3);
1217
+ rb_define_method(gdkWindow, "set_icon_name", gdkwin_set_icon_name, 1);
1218
+ rb_define_method(gdkWindow, "set_transient_for", gdkwin_set_transient_for, 1);
1219
+ rb_define_method(gdkWindow, "set_role", gdkwin_set_role, 1);
1220
+ rb_define_method(gdkWindow, "set_group", gdkwin_set_group, 1);
1221
+ #if GTK_CHECK_VERSION(2,4,0)
1222
+ rb_define_method(gdkWindow, "group", gdkwin_get_group, 0);
1223
+ #endif
1224
+ rb_define_method(gdkWindow, "set_decorations", gdkwin_set_decorations, 1);
1225
+ rb_define_method(gdkWindow, "decorations", gdkwin_get_decorations, 0);
1226
+ rb_define_method(gdkWindow, "set_functions", gdkwin_set_functions, 1);
1227
+ #if GTK_CHECK_VERSION(2, 12, 0)
1228
+ rb_define_method(gdkWindow, "set_composited", gdkwin_set_composited, 1);
1229
+ rb_define_method(gdkWindow, "set_opacity", gdkwin_set_opacity, 1);
1230
+ rb_define_method(gdkWindow, "set_startup_id", gdkwin_set_startup_id, 1);
1231
+ #endif
1232
+ rb_define_singleton_method(gdkWindow, "toplevels", gdkwin_s_get_toplevels, 0);
1233
+
1234
+ rb_define_singleton_method(gdkWindow, "foreign_new", gdkwin_foreign_new, -1);
1235
+ rb_define_singleton_method(gdkWindow, "lookup", gdkwin_lookup, -1);
1236
+
1237
+ G_DEF_SETTERS(gdkWindow);
1238
+
1239
+ /* GdkWindowType */
1240
+ G_DEF_CLASS(GDK_TYPE_WINDOW_TYPE, "Type", gdkWindow);
1241
+ G_DEF_CONSTANTS(gdkWindow, GDK_TYPE_WINDOW_TYPE, "GDK_WINDOW_");
1242
+
1243
+ /* GdkWindowClass */
1244
+ G_DEF_CLASS(GDK_TYPE_WINDOW_CLASS, "Class", gdkWindow);
1245
+ G_DEF_CONSTANTS(gdkWindow, GDK_TYPE_WINDOW_CLASS, "GDK_");
1246
+
1247
+ /* GdkWindowHints */
1248
+ G_DEF_CLASS(GDK_TYPE_WINDOW_HINTS, "Hints", gdkWindow);
1249
+ G_DEF_CONSTANTS(gdkWindow, GDK_TYPE_WINDOW_HINTS, "GDK_");
1250
+
1251
+ /* GdkGravity */
1252
+ G_DEF_CLASS(GDK_TYPE_GRAVITY, "Gravity", gdkWindow);
1253
+ G_DEF_CONSTANTS(gdkWindow, GDK_TYPE_GRAVITY, "GDK_");
1254
+
1255
+ /* GdkWindowEdge */
1256
+ G_DEF_CLASS(GDK_TYPE_WINDOW_EDGE, "Edge", gdkWindow);
1257
+ G_DEF_CONSTANTS(gdkWindow, GDK_TYPE_WINDOW_EDGE, "GDK_WINDOW_");
1258
+
1259
+ /* GdkWindowTypeHint */
1260
+ G_DEF_CLASS(GDK_TYPE_WINDOW_TYPE_HINT, "TypeHint", gdkWindow);
1261
+ G_DEF_CONSTANTS(gdkWindow, GDK_TYPE_WINDOW_TYPE_HINT, "GDK_WINDOW_");
1262
+
1263
+ /* GdkWindowAttibutesType */
1264
+ G_DEF_CLASS(GDK_TYPE_WINDOW_ATTRIBUTES_TYPE, "AttributesType", gdkWindow);
1265
+ G_DEF_CONSTANTS(gdkWindow, GDK_TYPE_WINDOW_ATTRIBUTES_TYPE, "GDK_");
1266
+
1267
+ /* GdkFilterReturn */
1268
+ G_DEF_CLASS(GDK_TYPE_FILTER_RETURN, "FilterReturn", gdkWindow);
1269
+ G_DEF_CONSTANTS(gdkWindow, GDK_TYPE_FILTER_RETURN, "GDK_");
1270
+
1271
+ /* GdkModifierType */
1272
+ G_DEF_CLASS(GDK_TYPE_MODIFIER_TYPE, "ModifierType", gdkWindow);
1273
+ G_DEF_CONSTANTS(gdkWindow, GDK_TYPE_MODIFIER_TYPE, "GDK_");
1274
+
1275
+ /* GdkWMDecoration */
1276
+ G_DEF_CLASS(GDK_TYPE_WM_DECORATION, "WMDecoration", gdkWindow);
1277
+ G_DEF_CONSTANTS(gdkWindow, GDK_TYPE_WM_DECORATION, "GDK_");
1278
+
1279
+ /* GdkWMFunction */
1280
+ G_DEF_CLASS(GDK_TYPE_WM_FUNCTION, "WMFunction", gdkWindow);
1281
+ G_DEF_CONSTANTS(gdkWindow, GDK_TYPE_WM_FUNCTION, "GDK_");
1282
+
1283
+ rb_define_const(gdkWindow, "PARENT_RELATIVE", INT2FIX(GDK_PARENT_RELATIVE));
1284
+
1285
+ #ifdef GDK_WINDOWING_X11
1286
+ rb_define_method(gdkWindow, "server_time", gdkwin_get_server_time, 0);
1287
+
1288
+ #if GTK_CHECK_VERSION(2,6,0)
1289
+ rb_define_method(gdkWindow, "set_user_time", gdkwin_set_user_time, 1);
1290
+ #endif
1291
+ #if GTK_CHECK_VERSION(2,8,0)
1292
+ rb_define_method(gdkWindow, "move_to_current_desktop", gdkwin_move_to_current_desktop, 0);
1293
+ #endif
1294
+
1295
+ G_DEF_CLASS3("GdkWindowImplX11", "WindowImplX11", mGdk);
1296
+ #elif defined(GDK_WINDOWING_WIN32)
1297
+ G_DEF_CLASS3("GdkWindowImplWin32", "WindowImplWin32", mGdk);
1298
+ #elif defined(GDK_WINDOWING_FB)
1299
+ G_DEF_CLASS3("GdkWindowFB", "WindowFB", mGdk);
1300
+ #endif
1301
+ }
1302
+