gtk2 0.90.7 → 0.90.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (232) hide show
  1. data/ChangeLog +62 -0
  2. data/ext/gtk2/extconf.rb +2 -2
  3. data/ext/gtk2/rbgdk.c +30 -61
  4. data/ext/gtk2/rbgdkatom.c +6 -14
  5. data/ext/gtk2/rbgdkcairo.c +4 -8
  6. data/ext/gtk2/rbgdkcolor.c +11 -27
  7. data/ext/gtk2/rbgdkcolormap.c +8 -16
  8. data/ext/gtk2/rbgdkcursor.c +5 -12
  9. data/ext/gtk2/rbgdkdevice.c +16 -32
  10. data/ext/gtk2/rbgdkdisplay.c +49 -100
  11. data/ext/gtk2/rbgdkdisplaymanager.c +3 -6
  12. data/ext/gtk2/rbgdkdragcontext.c +21 -48
  13. data/ext/gtk2/rbgdkdraw.c +27 -60
  14. data/ext/gtk2/rbgdkevent.c +51 -113
  15. data/ext/gtk2/rbgdkgc.c +35 -70
  16. data/ext/gtk2/rbgdkgeometry.c +24 -50
  17. data/ext/gtk2/rbgdkimage.c +14 -28
  18. data/ext/gtk2/rbgdkinput.c +3 -8
  19. data/ext/gtk2/rbgdkkeymap.c +7 -14
  20. data/ext/gtk2/rbgdkkeyval.c +9 -18
  21. data/ext/gtk2/rbgdkpango.c +8 -18
  22. data/ext/gtk2/rbgdkpangorenderer.c +7 -18
  23. data/ext/gtk2/rbgdkpixbuf.c +5 -20
  24. data/ext/gtk2/rbgdkpixmap.c +9 -24
  25. data/ext/gtk2/rbgdkproperty.c +8 -28
  26. data/ext/gtk2/rbgdkrectangle.c +12 -24
  27. data/ext/gtk2/rbgdkregion.c +15 -33
  28. data/ext/gtk2/rbgdkrgb.c +11 -26
  29. data/ext/gtk2/rbgdkscreen.c +37 -78
  30. data/ext/gtk2/rbgdkselection.c +5 -16
  31. data/ext/gtk2/rbgdkthreads.c +4 -8
  32. data/ext/gtk2/rbgdktimecoord.c +5 -10
  33. data/ext/gtk2/rbgdkvisual.c +25 -50
  34. data/ext/gtk2/rbgdkwindow.c +102 -211
  35. data/ext/gtk2/rbgdkwindowattr.c +16 -32
  36. data/ext/gtk2/rbgdkx11.c +5 -12
  37. data/ext/gtk2/rbgtk.c +9 -10
  38. data/ext/gtk2/rbgtkaboutdialog.c +5 -12
  39. data/ext/gtk2/rbgtkaccelerator.c +6 -12
  40. data/ext/gtk2/rbgtkaccelgroup.c +14 -32
  41. data/ext/gtk2/rbgtkaccelgroupentry.c +4 -8
  42. data/ext/gtk2/rbgtkaccelkey.c +7 -14
  43. data/ext/gtk2/rbgtkaccellabel.c +3 -6
  44. data/ext/gtk2/rbgtkaccelmap.c +12 -28
  45. data/ext/gtk2/rbgtkaccessible.c +1 -2
  46. data/ext/gtk2/rbgtkaction.c +20 -42
  47. data/ext/gtk2/rbgtkactiongroup.c +15 -39
  48. data/ext/gtk2/rbgtkadjustment.c +14 -28
  49. data/ext/gtk2/rbgtkalignment.c +4 -8
  50. data/ext/gtk2/rbgtkallocation.c +13 -26
  51. data/ext/gtk2/rbgtkarrow.c +2 -4
  52. data/ext/gtk2/rbgtkaspectframe.c +2 -4
  53. data/ext/gtk2/rbgtkassistant.c +23 -47
  54. data/ext/gtk2/rbgtkbbox.c +2 -4
  55. data/ext/gtk2/rbgtkbin.c +1 -2
  56. data/ext/gtk2/rbgtkbindingset.c +8 -18
  57. data/ext/gtk2/rbgtkborder.c +4 -8
  58. data/ext/gtk2/rbgtkbox.c +8 -23
  59. data/ext/gtk2/rbgtkbutton.c +8 -18
  60. data/ext/gtk2/rbgtkcalendar.c +11 -24
  61. data/ext/gtk2/rbgtkcelleditable.c +3 -6
  62. data/ext/gtk2/rbgtkcelllayout.c +9 -22
  63. data/ext/gtk2/rbgtkcellrenderer.c +8 -19
  64. data/ext/gtk2/rbgtkcellrendereraccel.c +1 -2
  65. data/ext/gtk2/rbgtkcellrenderercombo.c +1 -2
  66. data/ext/gtk2/rbgtkcellrendererpixbuf.c +1 -2
  67. data/ext/gtk2/rbgtkcellrendererprogress.c +1 -2
  68. data/ext/gtk2/rbgtkcellrendererspin.c +1 -2
  69. data/ext/gtk2/rbgtkcellrendererspinner.c +35 -0
  70. data/ext/gtk2/rbgtkcellrenderertext.c +2 -4
  71. data/ext/gtk2/rbgtkcellrenderertoggle.c +1 -2
  72. data/ext/gtk2/rbgtkcellview.c +6 -14
  73. data/ext/gtk2/rbgtkcheckbutton.c +1 -4
  74. data/ext/gtk2/rbgtkcheckmenuitem.c +2 -6
  75. data/ext/gtk2/rbgtkclipboard.c +30 -75
  76. data/ext/gtk2/rbgtkcolorbutton.c +1 -4
  77. data/ext/gtk2/rbgtkcolorsel.c +10 -24
  78. data/ext/gtk2/rbgtkcolorselectiondialog.c +5 -12
  79. data/ext/gtk2/rbgtkcombo.c +7 -16
  80. data/ext/gtk2/rbgtkcombobox.c +14 -32
  81. data/ext/gtk2/rbgtkcomboboxentry.c +1 -4
  82. data/ext/gtk2/rbgtkcontainer.c +27 -70
  83. data/ext/gtk2/rbgtkcurve.c +6 -12
  84. data/ext/gtk2/rbgtkdialog.c +14 -32
  85. data/ext/gtk2/rbgtkdrag.c +31 -68
  86. data/ext/gtk2/rbgtkdrawingarea.c +1 -2
  87. data/ext/gtk2/rbgtkeditable.c +13 -26
  88. data/ext/gtk2/rbgtkentry.c +7 -14
  89. data/ext/gtk2/rbgtkentrycompletion.c +10 -23
  90. data/ext/gtk2/rbgtkeventbox.c +1 -2
  91. data/ext/gtk2/rbgtkexpander.c +1 -4
  92. data/ext/gtk2/rbgtkfilechooser.c +30 -60
  93. data/ext/gtk2/rbgtkfilechooserbutton.c +1 -4
  94. data/ext/gtk2/rbgtkfilechooserdialog.c +1 -4
  95. data/ext/gtk2/rbgtkfilechooserwidget.c +1 -4
  96. data/ext/gtk2/rbgtkfilefilter.c +10 -21
  97. data/ext/gtk2/rbgtkfilesel.c +14 -30
  98. data/ext/gtk2/rbgtkfixed.c +5 -10
  99. data/ext/gtk2/rbgtkfontbutton.c +1 -4
  100. data/ext/gtk2/rbgtkfontselection.c +1 -2
  101. data/ext/gtk2/rbgtkfontselectiondialog.c +9 -20
  102. data/ext/gtk2/rbgtkframe.c +3 -8
  103. data/ext/gtk2/rbgtkgamma.c +3 -6
  104. data/ext/gtk2/rbgtkhandlebox.c +2 -4
  105. data/ext/gtk2/rbgtkhbbox.c +1 -2
  106. data/ext/gtk2/rbgtkhbox.c +1 -4
  107. data/ext/gtk2/rbgtkhpaned.c +1 -2
  108. data/ext/gtk2/rbgtkhruler.c +1 -2
  109. data/ext/gtk2/rbgtkhscale.c +1 -4
  110. data/ext/gtk2/rbgtkhscrollbar.c +1 -4
  111. data/ext/gtk2/rbgtkhseparator.c +1 -2
  112. data/ext/gtk2/rbgtkiconfactory.c +6 -12
  113. data/ext/gtk2/rbgtkiconinfo.c +8 -16
  114. data/ext/gtk2/rbgtkiconset.c +4 -12
  115. data/ext/gtk2/rbgtkiconsize.c +6 -12
  116. data/ext/gtk2/rbgtkiconsource.c +17 -34
  117. data/ext/gtk2/rbgtkicontheme.c +16 -32
  118. data/ext/gtk2/rbgtkiconview.c +23 -50
  119. data/ext/gtk2/rbgtkimage.c +3 -10
  120. data/ext/gtk2/rbgtkimagemenuitem.c +1 -4
  121. data/ext/gtk2/rbgtkimcontext.c +11 -22
  122. data/ext/gtk2/rbgtkimcontextsimple.c +2 -4
  123. data/ext/gtk2/rbgtkimmulticontext.c +2 -4
  124. data/ext/gtk2/rbgtkinputdialog.c +1 -2
  125. data/ext/gtk2/rbgtkinvisible.c +3 -8
  126. data/ext/gtk2/rbgtkitem.c +3 -6
  127. data/ext/gtk2/rbgtkitemfactory.c +13 -34
  128. data/ext/gtk2/rbgtklabel.c +10 -26
  129. data/ext/gtk2/rbgtklayout.c +6 -14
  130. data/ext/gtk2/rbgtklinkbutton.c +3 -10
  131. data/ext/gtk2/rbgtkliststore.c +15 -36
  132. data/ext/gtk2/rbgtkmain.c +32 -68
  133. data/ext/gtk2/rbgtkmenu.c +21 -46
  134. data/ext/gtk2/rbgtkmenubar.c +1 -2
  135. data/ext/gtk2/rbgtkmenuitem.c +12 -26
  136. data/ext/gtk2/rbgtkmenushell.c +9 -18
  137. data/ext/gtk2/rbgtkmenutoolbutton.c +2 -8
  138. data/ext/gtk2/rbgtkmessagedialog.c +4 -10
  139. data/ext/gtk2/rbgtkmisc.c +4 -8
  140. data/ext/gtk2/rbgtknotebook.c +53 -79
  141. data/ext/gtk2/rbgtkobject.c +7 -14
  142. data/ext/gtk2/rbgtkoptionmenu.c +4 -8
  143. data/ext/gtk2/rbgtkpaned.c +10 -20
  144. data/ext/gtk2/rbgtkplug.c +3 -8
  145. data/ext/gtk2/rbgtkprintsettings.c +1 -4
  146. data/ext/gtk2/rbgtkprogressbar.c +2 -4
  147. data/ext/gtk2/rbgtkradioaction.c +4 -8
  148. data/ext/gtk2/rbgtkradiobutton.c +3 -8
  149. data/ext/gtk2/rbgtkradiomenuitem.c +4 -10
  150. data/ext/gtk2/rbgtkradiotoolbutton.c +3 -8
  151. data/ext/gtk2/rbgtkrange.c +4 -8
  152. data/ext/gtk2/rbgtkrc.c +16 -34
  153. data/ext/gtk2/rbgtkrcstyle.c +13 -26
  154. data/ext/gtk2/rbgtkrecentaction.c +1 -4
  155. data/ext/gtk2/rbgtkrecentchooser.c +18 -38
  156. data/ext/gtk2/rbgtkrecentchooserdialog.c +1 -4
  157. data/ext/gtk2/rbgtkrecentchoosermenu.c +1 -4
  158. data/ext/gtk2/rbgtkrecentchooserwidget.c +1 -4
  159. data/ext/gtk2/rbgtkrecentdata.c +7 -14
  160. data/ext/gtk2/rbgtkrecentfilter.c +14 -29
  161. data/ext/gtk2/rbgtkrecentfilterinfo.c +11 -22
  162. data/ext/gtk2/rbgtkrecentinfo.c +21 -42
  163. data/ext/gtk2/rbgtkrecentmanager.c +11 -24
  164. data/ext/gtk2/rbgtkruler.c +6 -12
  165. data/ext/gtk2/rbgtkscale.c +2 -4
  166. data/ext/gtk2/rbgtkscalebutton.c +6 -14
  167. data/ext/gtk2/rbgtkscrolledwindow.c +9 -20
  168. data/ext/gtk2/rbgtkselection.c +10 -22
  169. data/ext/gtk2/rbgtkselectiondata.c +19 -41
  170. data/ext/gtk2/rbgtkseparatormenuitem.c +1 -2
  171. data/ext/gtk2/rbgtkseparatortoolitem.c +1 -2
  172. data/ext/gtk2/rbgtksettings.c +10 -22
  173. data/ext/gtk2/rbgtksizegroup.c +4 -8
  174. data/ext/gtk2/rbgtksocket.c +4 -8
  175. data/ext/gtk2/rbgtkspinbutton.c +9 -20
  176. data/ext/gtk2/rbgtkspinner.c +51 -0
  177. data/ext/gtk2/rbgtkstatusbar.c +7 -14
  178. data/ext/gtk2/rbgtkstatusicon.c +5 -10
  179. data/ext/gtk2/rbgtkstock.c +5 -13
  180. data/ext/gtk2/rbgtkstyle.c +51 -139
  181. data/ext/gtk2/rbgtktable.c +14 -33
  182. data/ext/gtk2/rbgtktargetlist.c +9 -18
  183. data/ext/gtk2/rbgtktearoffmenuitem.c +1 -2
  184. data/ext/gtk2/rbgtktextappearance.c +11 -22
  185. data/ext/gtk2/rbgtktextattributes.c +16 -32
  186. data/ext/gtk2/rbgtktextbuffer.c +69 -162
  187. data/ext/gtk2/rbgtktextchild.c +3 -8
  188. data/ext/gtk2/rbgtktextiter.c +34 -81
  189. data/ext/gtk2/rbgtktextmark.c +7 -14
  190. data/ext/gtk2/rbgtktexttag.c +4 -10
  191. data/ext/gtk2/rbgtktexttagtable.c +7 -15
  192. data/ext/gtk2/rbgtktextview.c +30 -62
  193. data/ext/gtk2/rbgtktoggleaction.c +4 -8
  194. data/ext/gtk2/rbgtktogglebutton.c +4 -10
  195. data/ext/gtk2/rbgtktoggletoolbutton.c +3 -8
  196. data/ext/gtk2/rbgtktoolbar.c +20 -46
  197. data/ext/gtk2/rbgtktoolbutton.c +1 -4
  198. data/ext/gtk2/rbgtktoolitem.c +16 -34
  199. data/ext/gtk2/rbgtktooltip.c +5 -10
  200. data/ext/gtk2/rbgtktooltips.c +7 -14
  201. data/ext/gtk2/rbgtktreeiter.c +14 -29
  202. data/ext/gtk2/rbgtktreemodel.c +16 -37
  203. data/ext/gtk2/rbgtktreemodelfilter.c +13 -36
  204. data/ext/gtk2/rbgtktreemodelsort.c +8 -16
  205. data/ext/gtk2/rbgtktreepath.c +13 -28
  206. data/ext/gtk2/rbgtktreerowreference.c +9 -20
  207. data/ext/gtk2/rbgtktreeselection.c +20 -47
  208. data/ext/gtk2/rbgtktreesortable.c +7 -18
  209. data/ext/gtk2/rbgtktreestore.c +17 -40
  210. data/ext/gtk2/rbgtktreeview.c +58 -138
  211. data/ext/gtk2/rbgtktreeviewcolumn.c +20 -46
  212. data/ext/gtk2/rbgtkuimanager.c +12 -26
  213. data/ext/gtk2/rbgtkvbbox.c +1 -2
  214. data/ext/gtk2/rbgtkvbox.c +1 -4
  215. data/ext/gtk2/rbgtkviewport.c +1 -2
  216. data/ext/gtk2/rbgtkvolumebutton.c +1 -2
  217. data/ext/gtk2/rbgtkvpaned.c +1 -2
  218. data/ext/gtk2/rbgtkvruler.c +1 -2
  219. data/ext/gtk2/rbgtkvscale.c +1 -4
  220. data/ext/gtk2/rbgtkvscrollbar.c +1 -4
  221. data/ext/gtk2/rbgtkvseparator.c +1 -2
  222. data/ext/gtk2/rbgtkwidget.c +126 -264
  223. data/ext/gtk2/rbgtkwindow.c +69 -142
  224. data/ext/gtk2/rbgtkwindowgroup.c +3 -6
  225. data/lib/gtk2/base.rb +1 -2
  226. data/sample/gtk-demo/main.rb +2 -0
  227. data/sample/gtk-demo/textview.rb +1 -0
  228. metadata +15 -17
  229. data/ext/gtk2/Makefile +0 -169
  230. data/ext/gtk2/rbgdkkeysyms.h +0 -2174
  231. data/ext/gtk2/rbgtkinits.c +0 -473
  232. data/ext/gtk2/ruby-gtk2.pc +0 -3
@@ -29,8 +29,7 @@ typedef struct _callback_info_t
29
29
 
30
30
 
31
31
  static VALUE
32
- gtk_m_function_body(data)
33
- VALUE data;
32
+ gtk_m_function_body(VALUE data)
34
33
  {
35
34
  callback_info_t *info = (callback_info_t *)data;
36
35
  VALUE ret = rb_funcall(info->callback, id_call, 0);
@@ -41,8 +40,7 @@ gtk_m_function_body(data)
41
40
  }
42
41
 
43
42
  static gboolean
44
- gtk_m_function(data)
45
- gpointer data;
43
+ gtk_m_function(gpointer data)
46
44
  {
47
45
  return RVAL2CBOOL(G_PROTECT_CALLBACK(gtk_m_function_body, data));
48
46
  }
@@ -62,23 +60,20 @@ gtk_m_function2(gpointer proc)
62
60
 
63
61
 
64
62
  static VALUE
65
- gtk_m_set_locale(self)
66
- VALUE self;
63
+ gtk_m_set_locale(VALUE self)
67
64
  {
68
65
  return CSTR2RVAL(gtk_set_locale());
69
66
  }
70
67
 
71
68
  static VALUE
72
- gtk_m_disable_setlocale(self)
73
- VALUE self;
69
+ gtk_m_disable_setlocale(VALUE self)
74
70
  {
75
71
  gtk_disable_setlocale();
76
72
  return Qnil;
77
73
  }
78
74
 
79
75
  static VALUE
80
- gtk_m_get_default_language(self)
81
- VALUE self;
76
+ gtk_m_get_default_language(VALUE self)
82
77
  {
83
78
  return BOXED2RVAL(gtk_get_default_language(), PANGO_TYPE_LANGUAGE);
84
79
  }
@@ -181,45 +176,39 @@ gtk_exit()
181
176
  */
182
177
 
183
178
  static VALUE
184
- gtk_m_main(self)
185
- VALUE self;
179
+ gtk_m_main(VALUE self)
186
180
  {
187
181
  gtk_main();
188
182
  return Qnil;
189
183
  }
190
184
 
191
185
  static VALUE
192
- gtk_m_main_level(self)
193
- VALUE self;
186
+ gtk_m_main_level(VALUE self)
194
187
  {
195
188
  return INT2FIX(gtk_main_level());
196
189
  }
197
190
 
198
191
  static VALUE
199
- gtk_m_main_quit(self)
200
- VALUE self;
192
+ gtk_m_main_quit(VALUE self)
201
193
  {
202
194
  gtk_main_quit();
203
195
  return Qnil;
204
196
  }
205
197
 
206
198
  static VALUE
207
- gtk_m_main_iteration(self)
208
- VALUE self;
199
+ gtk_m_main_iteration(VALUE self)
209
200
  {
210
201
  return CBOOL2RVAL(gtk_main_iteration());
211
202
  }
212
203
 
213
204
  static VALUE
214
- gtk_m_main_iteration_do(self, blocking)
215
- VALUE self, blocking;
205
+ gtk_m_main_iteration_do(VALUE self, VALUE blocking)
216
206
  {
217
207
  return CBOOL2RVAL(gtk_main_iteration_do(RVAL2CBOOL(blocking)));
218
208
  }
219
209
 
220
210
  static VALUE
221
- gtk_m_main_do_event(self, event)
222
- VALUE self, event;
211
+ gtk_m_main_do_event(VALUE self, VALUE event)
223
212
  {
224
213
  gtk_main_do_event(RVAL2GEV(event));
225
214
  return event;
@@ -231,31 +220,27 @@ gtk_false()
231
220
  */
232
221
 
233
222
  static VALUE
234
- gtk_m_grab_add(self, widget)
235
- VALUE self, widget;
223
+ gtk_m_grab_add(VALUE self, VALUE widget)
236
224
  {
237
225
  gtk_grab_add(GTK_WIDGET(RVAL2GOBJ(widget)));
238
226
  return Qnil;
239
227
  }
240
228
 
241
229
  static VALUE
242
- gtk_m_get_current(self)
243
- VALUE self;
230
+ gtk_m_get_current(VALUE self)
244
231
  {
245
232
  return GOBJ2RVAL(gtk_grab_get_current());
246
233
  }
247
234
 
248
235
  static VALUE
249
- gtk_m_grab_remove(self, widget)
250
- VALUE self, widget;
236
+ gtk_m_grab_remove(VALUE self, VALUE widget)
251
237
  {
252
238
  gtk_grab_remove(GTK_WIDGET(RVAL2GOBJ(widget)));
253
239
  return Qnil;
254
240
  }
255
241
 
256
242
  static VALUE
257
- gtk_m_init_add(self)
258
- VALUE self;
243
+ gtk_m_init_add(VALUE self)
259
244
  {
260
245
  volatile VALUE func = rb_block_proc();
261
246
 
@@ -265,8 +250,7 @@ gtk_m_init_add(self)
265
250
  }
266
251
 
267
252
  static VALUE
268
- gtk_m_quit_add(self, main_level)
269
- VALUE self, main_level;
253
+ gtk_m_quit_add(VALUE self, VALUE main_level)
270
254
  {
271
255
  volatile VALUE func = rb_block_proc();
272
256
  VALUE rb_id;
@@ -285,8 +269,7 @@ gtk_m_quit_add(self, main_level)
285
269
  }
286
270
 
287
271
  static VALUE
288
- gtk_m_quit_remove(self, quit_handler_id)
289
- VALUE self, quit_handler_id;
272
+ gtk_m_quit_remove(VALUE self, VALUE quit_handler_id)
290
273
  {
291
274
  gtk_quit_remove(NUM2UINT(quit_handler_id));
292
275
  G_REMOVE_RELATIVE(self, id__quit_callbacks__, quit_handler_id);
@@ -301,8 +284,7 @@ gtk_timeout_add_full()
301
284
  */
302
285
 
303
286
  static VALUE
304
- timeout_add(self, interval)
305
- VALUE self, interval;
287
+ timeout_add(VALUE self, VALUE interval)
306
288
  {
307
289
  VALUE func, rb_id;
308
290
  callback_info_t *info;
@@ -321,8 +303,7 @@ timeout_add(self, interval)
321
303
  }
322
304
 
323
305
  static VALUE
324
- timeout_remove(self, id)
325
- VALUE self, id;
306
+ timeout_remove(VALUE self, VALUE id)
326
307
  {
327
308
  gtk_timeout_remove(NUM2UINT(id));
328
309
  G_REMOVE_RELATIVE(self, id__timeout_callbacks__, id);
@@ -330,8 +311,7 @@ timeout_remove(self, id)
330
311
  }
331
312
 
332
313
  static VALUE
333
- idle_add(self)
334
- VALUE self;
314
+ idle_add(VALUE self)
335
315
  {
336
316
  VALUE func, rb_id;
337
317
  callback_info_t *info;
@@ -351,8 +331,7 @@ idle_add(self)
351
331
  }
352
332
 
353
333
  static VALUE
354
- idle_add_priority(self, priority)
355
- VALUE self;
334
+ idle_add_priority(VALUE self, VALUE priority)
356
335
  {
357
336
  VALUE func, rb_id;
358
337
  callback_info_t *info;
@@ -371,8 +350,7 @@ idle_add_priority(self, priority)
371
350
  }
372
351
 
373
352
  static VALUE
374
- idle_remove(self, id)
375
- VALUE self, id;
353
+ idle_remove(VALUE self, VALUE id)
376
354
  {
377
355
  gtk_idle_remove(NUM2UINT(id));
378
356
  G_REMOVE_RELATIVE(self, id__idle_callbacks__, id);
@@ -389,10 +367,7 @@ gtk_input_remove()
389
367
  */
390
368
 
391
369
  static gint
392
- gtk_m_key_snoop_func(grab_widget, event, func)
393
- GtkWidget* grab_widget;
394
- GdkEventKey* event;
395
- gpointer func;
370
+ gtk_m_key_snoop_func(GtkWidget *grab_widget, GdkEventKey *event, gpointer func)
396
371
  {
397
372
  VALUE ret = rb_funcall((VALUE)func, id_call, 2,
398
373
  GOBJ2RVAL(grab_widget),
@@ -401,8 +376,7 @@ gtk_m_key_snoop_func(grab_widget, event, func)
401
376
  }
402
377
 
403
378
  static VALUE
404
- gtk_m_key_snooper_install(self)
405
- VALUE self;
379
+ gtk_m_key_snooper_install(VALUE self)
406
380
  {
407
381
  VALUE func = rb_block_proc();
408
382
  VALUE id = INT2FIX(gtk_key_snooper_install(
@@ -413,8 +387,7 @@ gtk_m_key_snooper_install(self)
413
387
  }
414
388
 
415
389
  static VALUE
416
- gtk_m_key_snooper_remove(self, id)
417
- VALUE self, id;
390
+ gtk_m_key_snooper_remove(VALUE self, VALUE id)
418
391
  {
419
392
  gtk_key_snooper_remove(NUM2UINT(id));
420
393
  G_REMOVE_RELATIVE(self, id__snooper_callbacks__, id);
@@ -422,22 +395,19 @@ gtk_m_key_snooper_remove(self, id)
422
395
  }
423
396
 
424
397
  static VALUE
425
- gtk_m_get_current_event(self)
426
- VALUE self;
398
+ gtk_m_get_current_event(VALUE self)
427
399
  {
428
400
  return GEV2RVAL(gtk_get_current_event());
429
401
  }
430
402
 
431
403
  static VALUE
432
- gtk_m_get_current_event_time(self)
433
- VALUE self;
404
+ gtk_m_get_current_event_time(VALUE self)
434
405
  {
435
406
  return INT2NUM(gtk_get_current_event_time());
436
407
  }
437
408
 
438
409
  static VALUE
439
- gtk_m_get_current_event_state(self)
440
- VALUE self;
410
+ gtk_m_get_current_event_state(VALUE self)
441
411
  {
442
412
  GdkModifierType state;
443
413
  gboolean ret = gtk_get_current_event_state(&state);
@@ -445,10 +415,7 @@ gtk_m_get_current_event_state(self)
445
415
  }
446
416
 
447
417
  static VALUE
448
- gtk_m_get_event_widget(argc, argv, self)
449
- int argc;
450
- VALUE* argv;
451
- VALUE self;
418
+ gtk_m_get_event_widget(int argc, VALUE *argv, VALUE self)
452
419
  {
453
420
  VALUE event;
454
421
  rb_scan_args(argc, argv, "01", &event);
@@ -457,8 +424,7 @@ gtk_m_get_event_widget(argc, argv, self)
457
424
  }
458
425
 
459
426
  static VALUE
460
- gtk_m_propagate_event(self, widget, event)
461
- VALUE self, widget, event;
427
+ gtk_m_propagate_event(VALUE self, VALUE widget, VALUE event)
462
428
  {
463
429
  gtk_propagate_event(GTK_WIDGET(RVAL2GOBJ(widget)), RVAL2GEV(event));
464
430
  return Qnil;
@@ -466,8 +432,7 @@ gtk_m_propagate_event(self, widget, event)
466
432
 
467
433
  /* From Version Information */
468
434
  static VALUE
469
- gtk_m_check_version(self, major, minor, micro)
470
- VALUE self, major, minor, micro;
435
+ gtk_m_check_version(VALUE self, VALUE major, VALUE minor, VALUE micro)
471
436
  {
472
437
  const gchar *ret;
473
438
  ret = gtk_check_version(FIX2INT(major), FIX2INT(minor), FIX2INT(micro));
@@ -475,8 +440,7 @@ gtk_m_check_version(self, major, minor, micro)
475
440
  }
476
441
 
477
442
  static VALUE
478
- gtk_m_check_version_q(self, major, minor, micro)
479
- VALUE self, major, minor, micro;
443
+ gtk_m_check_version_q(VALUE self, VALUE major, VALUE minor, VALUE micro)
480
444
  {
481
445
  const gchar *ret;
482
446
  ret = gtk_check_version(FIX2INT(major), FIX2INT(minor), FIX2INT(micro));
@@ -18,8 +18,7 @@
18
18
  #define RVAL2WIDGET(w) (GTK_WIDGET(RVAL2GOBJ(w)))
19
19
 
20
20
  static VALUE
21
- menu_initialize(self)
22
- VALUE self;
21
+ menu_initialize(VALUE self)
23
22
  {
24
23
  RBGTK_INITIALIZE(self, gtk_menu_new());
25
24
  return Qnil;
@@ -27,8 +26,7 @@ menu_initialize(self)
27
26
 
28
27
  #if GTK_CHECK_VERSION(2,2,0)
29
28
  static VALUE
30
- menu_set_screen(self, screen)
31
- VALUE self, screen;
29
+ menu_set_screen(VALUE self, VALUE screen)
32
30
  {
33
31
  gtk_menu_set_screen(_SELF(self), GDK_SCREEN(RVAL2GOBJ(screen)));
34
32
  return self;
@@ -36,8 +34,7 @@ menu_set_screen(self, screen)
36
34
  #endif
37
35
 
38
36
  static VALUE
39
- menu_reorder_child(self, child, position)
40
- VALUE self, child, position;
37
+ menu_reorder_child(VALUE self, VALUE child, VALUE position)
41
38
  {
42
39
  gtk_menu_reorder_child(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child)),
43
40
  NUM2INT(position));
@@ -46,8 +43,7 @@ menu_reorder_child(self, child, position)
46
43
 
47
44
  #if GTK_CHECK_VERSION(2,4,0)
48
45
  static VALUE
49
- menu_attach(self, child, left_attach, right_attach, top_attach, bottom_attach)
50
- VALUE self, child, left_attach, right_attach, top_attach, bottom_attach;
46
+ menu_attach(VALUE self, VALUE child, VALUE left_attach, VALUE right_attach, VALUE top_attach, VALUE bottom_attach)
51
47
  {
52
48
  gtk_menu_attach(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child)),
53
49
  NUM2UINT(left_attach), NUM2UINT(right_attach),
@@ -57,11 +53,7 @@ menu_attach(self, child, left_attach, right_attach, top_attach, bottom_attach)
57
53
  #endif
58
54
 
59
55
  static void
60
- menu_pos_func(menu, px, py, push_in, data)
61
- GtkMenu *menu;
62
- gint *px, *py;
63
- gboolean *push_in;
64
- gpointer data;
56
+ menu_pos_func(GtkMenu *menu, gint *px, gint *py, gboolean *push_in, gpointer data)
65
57
  {
66
58
  VALUE arr = rb_funcall((VALUE)data, id_call, 4, GOBJ2RVAL(menu),
67
59
  INT2FIX(*px), INT2FIX(*py),
@@ -79,8 +71,7 @@ menu_pos_func(menu, px, py, push_in, data)
79
71
 
80
72
  /* the proc should return [x, y, push_in] */
81
73
  static VALUE
82
- menu_popup(self, pshell, pitem, button, activate_time)
83
- VALUE self, pshell, pitem, button, activate_time;
74
+ menu_popup(VALUE self, VALUE pshell, VALUE pitem, VALUE button, VALUE activate_time)
84
75
  {
85
76
  GtkWidget *gpshell = NULL;
86
77
  GtkWidget *gpitem = NULL;
@@ -108,8 +99,7 @@ menu_popup(self, pshell, pitem, button, activate_time)
108
99
  }
109
100
 
110
101
  static VALUE
111
- menu_set_accel_group(self, accel_group)
112
- VALUE self, accel_group;
102
+ menu_set_accel_group(VALUE self, VALUE accel_group)
113
103
  {
114
104
  gtk_menu_set_accel_group(_SELF(self),
115
105
  GTK_ACCEL_GROUP(RVAL2GOBJ(accel_group)));
@@ -117,46 +107,40 @@ menu_set_accel_group(self, accel_group)
117
107
  }
118
108
 
119
109
  static VALUE
120
- menu_get_accel_group(self)
121
- VALUE self;
110
+ menu_get_accel_group(VALUE self)
122
111
  {
123
112
  return GOBJ2RVAL(gtk_menu_get_accel_group(_SELF(self)));
124
113
  }
125
114
 
126
115
  static VALUE
127
- menu_set_accel_path(self, accel_path)
128
- VALUE self, accel_path;
116
+ menu_set_accel_path(VALUE self, VALUE accel_path)
129
117
  {
130
118
  gtk_menu_set_accel_path(_SELF(self), RVAL2CSTR(accel_path));
131
119
  return self;
132
120
  }
133
121
 
134
122
  static VALUE
135
- menu_get_tearoff_state(self)
136
- VALUE self;
123
+ menu_get_tearoff_state(VALUE self)
137
124
  {
138
125
  return CBOOL2RVAL(gtk_menu_get_tearoff_state(_SELF(self)));
139
126
  }
140
127
 
141
128
  static VALUE
142
- menu_popdown(self)
143
- VALUE self;
129
+ menu_popdown(VALUE self)
144
130
  {
145
131
  gtk_menu_popdown(_SELF(self));
146
132
  return self;
147
133
  }
148
134
 
149
135
  static VALUE
150
- menu_reposition(self)
151
- VALUE self;
136
+ menu_reposition(VALUE self)
152
137
  {
153
138
  gtk_menu_reposition(_SELF(self));
154
139
  return self;
155
140
  }
156
141
 
157
142
  static VALUE
158
- menu_get_active(self)
159
- VALUE self;
143
+ menu_get_active(VALUE self)
160
144
  {
161
145
  GtkWidget *mitem = gtk_menu_get_active(_SELF(self));
162
146
 
@@ -164,16 +148,14 @@ menu_get_active(self)
164
148
  }
165
149
 
166
150
  static VALUE
167
- menu_set_active(self, active)
168
- VALUE self, active;
151
+ menu_set_active(VALUE self, VALUE active)
169
152
  {
170
153
  gtk_menu_set_active(_SELF(self), NUM2INT(active));
171
154
  return self;
172
155
  }
173
156
 
174
157
  static VALUE
175
- menu_set_tearoff_state(self, torn_off)
176
- VALUE self, torn_off;
158
+ menu_set_tearoff_state(VALUE self, VALUE torn_off)
177
159
  {
178
160
  gtk_menu_set_tearoff_state(_SELF(self), RVAL2CBOOL(torn_off));
179
161
  return self;
@@ -181,17 +163,14 @@ menu_set_tearoff_state(self, torn_off)
181
163
 
182
164
  static VALUE menu_detacher;
183
165
  static void
184
- detach_func(attach_widget, menu)
185
- GtkWidget* attach_widget;
186
- GtkMenu* menu;
166
+ detach_func(GtkWidget *attach_widget, GtkMenu *menu)
187
167
  {
188
168
  rb_funcall((VALUE)menu_detacher, id_call, 2,
189
169
  GOBJ2RVAL(attach_widget), GOBJ2RVAL(menu));
190
170
  }
191
171
 
192
172
  static VALUE
193
- menu_attach_to_widget(self, attach_widget)
194
- VALUE self, attach_widget;
173
+ menu_attach_to_widget(VALUE self, VALUE attach_widget)
195
174
  {
196
175
  menu_detacher = rb_block_proc();
197
176
  G_RELATIVE(self, menu_detacher);
@@ -202,24 +181,21 @@ menu_attach_to_widget(self, attach_widget)
202
181
  }
203
182
 
204
183
  static VALUE
205
- menu_detach(self)
206
- VALUE self;
184
+ menu_detach(VALUE self)
207
185
  {
208
186
  gtk_menu_detach(_SELF(self));
209
187
  return self;
210
188
  }
211
189
 
212
190
  static VALUE
213
- menu_get_attach_widget(self)
214
- VALUE self;
191
+ menu_get_attach_widget(VALUE self)
215
192
  {
216
193
  return GOBJ2RVAL(gtk_menu_get_attach_widget(_SELF(self)));
217
194
  }
218
195
 
219
196
  #if GTK_CHECK_VERSION(2,6,0)
220
197
  static VALUE
221
- menu_s_get_for_attach_widget(self, widget)
222
- VALUE self, widget;
198
+ menu_s_get_for_attach_widget(VALUE self, VALUE widget)
223
199
  {
224
200
  /* Owned by GTK+ */
225
201
  return GLIST2ARY(gtk_menu_get_for_attach_widget(GTK_WIDGET(RVAL2GOBJ(widget))));
@@ -228,8 +204,7 @@ menu_s_get_for_attach_widget(self, widget)
228
204
 
229
205
  #if GTK_CHECK_VERSION(2,4,0)
230
206
  static VALUE
231
- menu_set_monitor(self, monitor_num)
232
- VALUE self, monitor_num;
207
+ menu_set_monitor(VALUE self, VALUE monitor_num)
233
208
  {
234
209
  gtk_menu_set_monitor(_SELF(self), NUM2INT(monitor_num));
235
210
  return self;