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
@@ -15,8 +15,7 @@
15
15
  #include "global.h"
16
16
 
17
17
  static VALUE
18
- darea_initialize(self)
19
- VALUE self;
18
+ darea_initialize(VALUE self)
20
19
  {
21
20
  RBGTK_INITIALIZE(self, gtk_drawing_area_new());
22
21
  return Qnil;
@@ -15,8 +15,7 @@
15
15
  #include "global.h"
16
16
 
17
17
  static VALUE
18
- edit_sel_region(self, start, end)
19
- VALUE self, start, end;
18
+ edit_sel_region(VALUE self, VALUE start, VALUE end)
20
19
  {
21
20
  gtk_editable_select_region(GTK_EDITABLE(RVAL2GOBJ(self)),
22
21
  NUM2INT(start), NUM2INT(end));
@@ -24,8 +23,7 @@ edit_sel_region(self, start, end)
24
23
  }
25
24
 
26
25
  static VALUE
27
- edit_get_sel_bounds(self)
28
- VALUE self;
26
+ edit_get_sel_bounds(VALUE self)
29
27
  {
30
28
  gint start, end;
31
29
  gboolean ret;
@@ -35,8 +33,7 @@ edit_get_sel_bounds(self)
35
33
  }
36
34
 
37
35
  static VALUE
38
- edit_insert_text(self, new_text, pos)
39
- VALUE self, new_text, pos;
36
+ edit_insert_text(VALUE self, VALUE new_text, VALUE pos)
40
37
  {
41
38
  gint p = NUM2INT(pos);
42
39
 
@@ -49,8 +46,7 @@ edit_insert_text(self, new_text, pos)
49
46
  }
50
47
 
51
48
  static VALUE
52
- edit_delete_text(self, start, end)
53
- VALUE self, start, end;
49
+ edit_delete_text(VALUE self, VALUE start, VALUE end)
54
50
  {
55
51
  gtk_editable_delete_text(GTK_EDITABLE(RVAL2GOBJ(self)),
56
52
  NUM2INT(start), NUM2INT(end));
@@ -58,8 +54,7 @@ edit_delete_text(self, start, end)
58
54
  }
59
55
 
60
56
  static VALUE
61
- edit_get_chars(self, start, end)
62
- VALUE self, start, end;
57
+ edit_get_chars(VALUE self, VALUE start, VALUE end)
63
58
  {
64
59
  return CSTR2RVAL_FREE(
65
60
  gtk_editable_get_chars(GTK_EDITABLE(RVAL2GOBJ(self)), /* check s */
@@ -67,23 +62,20 @@ edit_get_chars(self, start, end)
67
62
  }
68
63
 
69
64
  static VALUE
70
- edit_delete_selection(self)
71
- VALUE self;
65
+ edit_delete_selection(VALUE self)
72
66
  {
73
67
  gtk_editable_delete_selection(GTK_EDITABLE(RVAL2GOBJ(self)));
74
68
  return self;
75
69
  }
76
70
 
77
71
  static VALUE
78
- edit_get_position(self)
79
- VALUE self;
72
+ edit_get_position(VALUE self)
80
73
  {
81
74
  return INT2NUM(gtk_editable_get_position(GTK_EDITABLE(RVAL2GOBJ(self))));
82
75
  }
83
76
 
84
77
  static VALUE
85
- edit_set_position(self, position)
86
- VALUE self, position;
78
+ edit_set_position(VALUE self, VALUE position)
87
79
  {
88
80
  gtk_editable_set_position(GTK_EDITABLE(RVAL2GOBJ(self)),
89
81
  NUM2INT(position));
@@ -91,39 +83,34 @@ edit_set_position(self, position)
91
83
  }
92
84
 
93
85
  static VALUE
94
- edit_set_editable(self, editable)
95
- VALUE self, editable;
86
+ edit_set_editable(VALUE self, VALUE editable)
96
87
  {
97
88
  gtk_editable_set_editable(GTK_EDITABLE(RVAL2GOBJ(self)), RVAL2CBOOL(editable));
98
89
  return self;
99
90
  }
100
91
 
101
92
  static VALUE
102
- edit_get_editable(self)
103
- VALUE self;
93
+ edit_get_editable(VALUE self)
104
94
  {
105
95
  return CBOOL2RVAL(gtk_editable_get_editable(GTK_EDITABLE(RVAL2GOBJ(self))));
106
96
  }
107
97
 
108
98
  static VALUE
109
- edit_cut_clipboard(self)
110
- VALUE self;
99
+ edit_cut_clipboard(VALUE self)
111
100
  {
112
101
  gtk_editable_cut_clipboard(GTK_EDITABLE(RVAL2GOBJ(self)));
113
102
  return self;
114
103
  }
115
104
 
116
105
  static VALUE
117
- edit_copy_clipboard(self)
118
- VALUE self;
106
+ edit_copy_clipboard(VALUE self)
119
107
  {
120
108
  gtk_editable_copy_clipboard(GTK_EDITABLE(RVAL2GOBJ(self)));
121
109
  return self;
122
110
  }
123
111
 
124
112
  static VALUE
125
- edit_paste_clipboard(self)
126
- VALUE self;
113
+ edit_paste_clipboard(VALUE self)
127
114
  {
128
115
  gtk_editable_paste_clipboard(GTK_EDITABLE(RVAL2GOBJ(self)));
129
116
  return self;
@@ -17,23 +17,20 @@
17
17
  #define _SELF(self) (GTK_ENTRY(RVAL2GOBJ(self)))
18
18
 
19
19
  static VALUE
20
- entry_initialize(self)
21
- VALUE self;
20
+ entry_initialize(VALUE self)
22
21
  {
23
22
  RBGTK_INITIALIZE(self, gtk_entry_new());
24
23
  return Qnil;
25
24
  }
26
25
 
27
26
  static VALUE
28
- entry_get_layout(self)
29
- VALUE self;
27
+ entry_get_layout(VALUE self)
30
28
  {
31
29
  return GOBJ2RVAL(gtk_entry_get_layout(_SELF(self)));
32
30
  }
33
31
 
34
32
  static VALUE
35
- entry_get_layout_offsets(self)
36
- VALUE self;
33
+ entry_get_layout_offsets(VALUE self)
37
34
  {
38
35
  int x, y;
39
36
  gtk_entry_get_layout_offsets(_SELF(self), &x, &y);
@@ -42,31 +39,27 @@ entry_get_layout_offsets(self)
42
39
 
43
40
  #if GTK_CHECK_VERSION(2,4,0)
44
41
  static VALUE
45
- entry_set_completion(self, completion)
46
- VALUE self, completion;
42
+ entry_set_completion(VALUE self, VALUE completion)
47
43
  {
48
44
  gtk_entry_set_completion(_SELF(self), GTK_ENTRY_COMPLETION(RVAL2GOBJ(completion)));
49
45
  return self;
50
46
  }
51
47
 
52
48
  static VALUE
53
- entry_get_completion(self)
54
- VALUE self;
49
+ entry_get_completion(VALUE self)
55
50
  {
56
51
  return GOBJ2RVAL(gtk_entry_get_completion(_SELF(self)));
57
52
  }
58
53
  #endif
59
54
 
60
55
  static VALUE
61
- entry_layout_index_to_text_index(self, layout_index)
62
- VALUE self, layout_index;
56
+ entry_layout_index_to_text_index(VALUE self, VALUE layout_index)
63
57
  {
64
58
  return INT2NUM(gtk_entry_layout_index_to_text_index(_SELF(self), NUM2INT(layout_index)));
65
59
  }
66
60
 
67
61
  static VALUE
68
- entry_text_index_to_layout_index(self, text_index)
69
- VALUE self, text_index;
62
+ entry_text_index_to_layout_index(VALUE self, VALUE text_index)
70
63
  {
71
64
  return INT2NUM(gtk_entry_text_index_to_layout_index(_SELF(self), NUM2INT(text_index)));
72
65
  }
@@ -15,26 +15,20 @@
15
15
  #define _SELF(self) (GTK_ENTRY_COMPLETION(RVAL2GOBJ(self)))
16
16
 
17
17
  static VALUE
18
- entryc_initialize(self)
19
- VALUE self;
18
+ entryc_initialize(VALUE self)
20
19
  {
21
20
  G_INITIALIZE(self, gtk_entry_completion_new());
22
21
  return Qnil;
23
22
  }
24
23
 
25
24
  static VALUE
26
- entryc_get_entry(self)
27
- VALUE self;
25
+ entryc_get_entry(VALUE self)
28
26
  {
29
27
  return GOBJ2RVAL(gtk_entry_completion_get_entry(_SELF(self)));
30
28
  }
31
29
 
32
30
  static gboolean
33
- entryc_match_func(completion, key, iter, func)
34
- GtkEntryCompletion* completion;
35
- const gchar* key;
36
- GtkTreeIter* iter;
37
- gpointer func;
31
+ entryc_match_func(GtkEntryCompletion *completion, const gchar *key, GtkTreeIter *iter, gpointer func)
38
32
  {
39
33
  iter->user_data3 = gtk_entry_completion_get_model(completion);
40
34
  return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 3, GOBJ2RVAL(completion),
@@ -42,8 +36,7 @@ entryc_match_func(completion, key, iter, func)
42
36
  }
43
37
 
44
38
  static VALUE
45
- entryc_set_match_func(self)
46
- VALUE self;
39
+ entryc_set_match_func(VALUE self)
47
40
  {
48
41
  VALUE func = rb_block_proc();
49
42
  G_RELATIVE(self, func);
@@ -54,8 +47,7 @@ entryc_set_match_func(self)
54
47
  }
55
48
 
56
49
  static VALUE
57
- entryc_complete(self)
58
- VALUE self;
50
+ entryc_complete(VALUE self)
59
51
  {
60
52
  gtk_entry_completion_complete(_SELF(self));
61
53
  return self;
@@ -63,8 +55,7 @@ entryc_complete(self)
63
55
 
64
56
  #if GTK_CHECK_VERSION(2,6,0)
65
57
  static VALUE
66
- entryc_insert_prefix(self)
67
- VALUE self;
58
+ entryc_insert_prefix(VALUE self)
68
59
  {
69
60
  gtk_entry_completion_insert_prefix(_SELF(self));
70
61
  return self;
@@ -72,32 +63,28 @@ entryc_insert_prefix(self)
72
63
  #endif
73
64
 
74
65
  static VALUE
75
- entryc_insert_action_text(self, index, text)
76
- VALUE self, index, text;
66
+ entryc_insert_action_text(VALUE self, VALUE index, VALUE text)
77
67
  {
78
68
  gtk_entry_completion_insert_action_text(_SELF(self), NUM2INT(index), RVAL2CSTR(text));
79
69
  return self;
80
70
  }
81
71
 
82
72
  static VALUE
83
- entryc_insert_action_markup(self, index, markup)
84
- VALUE self, index, markup;
73
+ entryc_insert_action_markup(VALUE self, VALUE index, VALUE markup)
85
74
  {
86
75
  gtk_entry_completion_insert_action_markup(_SELF(self), NUM2INT(index), RVAL2CSTR(markup));
87
76
  return self;
88
77
  }
89
78
 
90
79
  static VALUE
91
- entryc_delete_action(self, index)
92
- VALUE self, index;
80
+ entryc_delete_action(VALUE self, VALUE index)
93
81
  {
94
82
  gtk_entry_completion_delete_action(_SELF(self), NUM2INT(index));
95
83
  return self;
96
84
  }
97
85
 
98
86
  static VALUE
99
- entryc_set_text_column(self, column)
100
- VALUE self, column;
87
+ entryc_set_text_column(VALUE self, VALUE column)
101
88
  {
102
89
  gtk_entry_completion_set_text_column(_SELF(self), NUM2INT(column));
103
90
  return self;
@@ -15,8 +15,7 @@
15
15
  #include "global.h"
16
16
 
17
17
  static VALUE
18
- eventbox_initialize(self)
19
- VALUE self;
18
+ eventbox_initialize(VALUE self)
20
19
  {
21
20
  RBGTK_INITIALIZE(self, gtk_event_box_new());
22
21
  return Qnil;
@@ -16,10 +16,7 @@
16
16
  #define _SELF(self) (GTK_EXPANDER(RVAL2GOBJ(self)))
17
17
 
18
18
  static VALUE
19
- expander_initialize(argc, argv, self)
20
- int argc;
21
- VALUE* argv;
22
- VALUE self;
19
+ expander_initialize(int argc, VALUE *argv, VALUE self)
23
20
  {
24
21
  VALUE label, with_mnemonic;
25
22
  GtkWidget* widget = NULL;
@@ -35,8 +35,7 @@ gslist2ary_free(GSList* list)
35
35
  }
36
36
 
37
37
  static VALUE
38
- fcho_set_action(self, action)
39
- VALUE self, action;
38
+ fcho_set_action(VALUE self, VALUE action)
40
39
  {
41
40
  gtk_file_chooser_set_action(
42
41
  _SELF(self),
@@ -45,8 +44,7 @@ fcho_set_action(self, action)
45
44
  }
46
45
 
47
46
  static VALUE
48
- fcho_get_action(self)
49
- VALUE self;
47
+ fcho_get_action(VALUE self)
50
48
  {
51
49
  return GENUM2RVAL(gtk_file_chooser_get_action(_SELF(self)), GTK_TYPE_FILE_CHOOSER_ACTION);
52
50
  }
@@ -67,8 +65,7 @@ gboolean gtk_file_chooser_get_show_hidden
67
65
  */
68
66
 
69
67
  static VALUE
70
- fcho_set_current_name(self, name)
71
- VALUE self, name;
68
+ fcho_set_current_name(VALUE self, VALUE name)
72
69
  {
73
70
  /* doc says the awaited string is UTF-8, so use RVAL2CSTR */
74
71
  gtk_file_chooser_set_current_name(_SELF(self), RVAL2CSTR(name));
@@ -76,15 +73,13 @@ fcho_set_current_name(self, name)
76
73
  }
77
74
 
78
75
  static VALUE
79
- fcho_get_filename(self)
80
- VALUE self;
76
+ fcho_get_filename(VALUE self)
81
77
  {
82
78
  return CSTRFILENAME2RVAL_FREE(gtk_file_chooser_get_filename(_SELF(self)));
83
79
  }
84
80
 
85
81
  static VALUE
86
- fcho_set_filename(self, name)
87
- VALUE self, name;
82
+ fcho_set_filename(VALUE self, VALUE name)
88
83
  {
89
84
  gboolean ret = gtk_file_chooser_set_filename(_SELF(self), RVAL2CSTRFILENAME(name));
90
85
  if (! ret) rb_raise(rb_eRuntimeError, "Can't set filename");
@@ -92,46 +87,40 @@ fcho_set_filename(self, name)
92
87
  }
93
88
 
94
89
  static VALUE
95
- fcho_select_filename(self, filename)
96
- VALUE self, filename;
90
+ fcho_select_filename(VALUE self, VALUE filename)
97
91
  {
98
92
  return CBOOL2RVAL(gtk_file_chooser_select_filename(_SELF(self), RVAL2CSTRFILENAME(filename)));
99
93
  }
100
94
 
101
95
  static VALUE
102
- fcho_unselect_filename(self, filename)
103
- VALUE self, filename;
96
+ fcho_unselect_filename(VALUE self, VALUE filename)
104
97
  {
105
98
  gtk_file_chooser_unselect_filename(_SELF(self), RVAL2CSTRFILENAME(filename));
106
99
  return self;
107
100
  }
108
101
 
109
102
  static VALUE
110
- fcho_select_all(self)
111
- VALUE self;
103
+ fcho_select_all(VALUE self)
112
104
  {
113
105
  gtk_file_chooser_select_all(_SELF(self));
114
106
  return self;
115
107
  }
116
108
 
117
109
  static VALUE
118
- fcho_unselect_all(self)
119
- VALUE self;
110
+ fcho_unselect_all(VALUE self)
120
111
  {
121
112
  gtk_file_chooser_unselect_all(_SELF(self));
122
113
  return self;
123
114
  }
124
115
 
125
116
  static VALUE
126
- fcho_get_filenames(self)
127
- VALUE self;
117
+ fcho_get_filenames(VALUE self)
128
118
  {
129
119
  return CSTRFILENAMEARRAY2RVAL_FREE(gtk_file_chooser_get_filenames(_SELF(self)));
130
120
  }
131
121
 
132
122
  static VALUE
133
- fcho_set_current_folder(self, filename)
134
- VALUE self, filename;
123
+ fcho_set_current_folder(VALUE self, VALUE filename)
135
124
  {
136
125
  gboolean ret = gtk_file_chooser_set_current_folder(_SELF(self), RVAL2CSTR(filename));
137
126
  if (! ret) rb_raise(rb_eRuntimeError, "Can't set current folder");
@@ -139,22 +128,19 @@ fcho_set_current_folder(self, filename)
139
128
  }
140
129
 
141
130
  static VALUE
142
- fcho_get_current_folder(self)
143
- VALUE self;
131
+ fcho_get_current_folder(VALUE self)
144
132
  {
145
133
  return CSTR2RVAL_FREE(gtk_file_chooser_get_current_folder(_SELF(self)));
146
134
  }
147
135
 
148
136
  static VALUE
149
- fcho_get_uri(self)
150
- VALUE self;
137
+ fcho_get_uri(VALUE self)
151
138
  {
152
139
  return CSTR2RVAL_FREE(gtk_file_chooser_get_uri(_SELF(self)));
153
140
  }
154
141
 
155
142
  static VALUE
156
- fcho_set_uri(self, uri)
157
- VALUE self, uri;
143
+ fcho_set_uri(VALUE self, VALUE uri)
158
144
  {
159
145
  gboolean ret = gtk_file_chooser_set_uri(_SELF(self), RVAL2CSTR(uri));
160
146
  if (! ret) rb_raise(rb_eRuntimeError, "Can't set uri");
@@ -162,30 +148,26 @@ fcho_set_uri(self, uri)
162
148
  }
163
149
 
164
150
  static VALUE
165
- fcho_select_uri(self, uri)
166
- VALUE self, uri;
151
+ fcho_select_uri(VALUE self, VALUE uri)
167
152
  {
168
153
  return CBOOL2RVAL(gtk_file_chooser_select_uri(_SELF(self), RVAL2CSTR(uri)));
169
154
  }
170
155
 
171
156
  static VALUE
172
- fcho_unselect_uri(self, uri)
173
- VALUE self, uri;
157
+ fcho_unselect_uri(VALUE self, VALUE uri)
174
158
  {
175
159
  gtk_file_chooser_unselect_uri(_SELF(self), RVAL2CSTR(uri));
176
160
  return self;
177
161
  }
178
162
 
179
163
  static VALUE
180
- fcho_get_uris(self)
181
- VALUE self;
164
+ fcho_get_uris(VALUE self)
182
165
  {
183
166
  return gslist2ary_free(gtk_file_chooser_get_uris(_SELF(self)));
184
167
  }
185
168
 
186
169
  static VALUE
187
- fcho_set_current_folder_uri(self, uri)
188
- VALUE self, uri;
170
+ fcho_set_current_folder_uri(VALUE self, VALUE uri)
189
171
  {
190
172
  gboolean ret = gtk_file_chooser_set_current_folder_uri(_SELF(self), RVAL2CSTR(uri));
191
173
  if (! ret) rb_raise(rb_eRuntimeError, "Can't set current folder uri");
@@ -193,8 +175,7 @@ fcho_set_current_folder_uri(self, uri)
193
175
  }
194
176
 
195
177
  static VALUE
196
- fcho_get_current_folder_uri(self)
197
- VALUE self;
178
+ fcho_get_current_folder_uri(VALUE self)
198
179
  {
199
180
  return CSTR2RVAL_FREE(gtk_file_chooser_get_current_folder_uri(_SELF(self)));
200
181
  }
@@ -209,15 +190,13 @@ fcho_get_current_folder_uri(self)
209
190
  */
210
191
 
211
192
  static VALUE
212
- fcho_get_preview_filename(self)
213
- VALUE self;
193
+ fcho_get_preview_filename(VALUE self)
214
194
  {
215
195
  return CSTR2RVAL_FREE(gtk_file_chooser_get_preview_filename(_SELF(self)));
216
196
  }
217
197
 
218
198
  static VALUE
219
- fcho_get_preview_uri(self)
220
- VALUE self;
199
+ fcho_get_preview_uri(VALUE self)
221
200
  {
222
201
  return CSTR2RVAL_FREE(gtk_file_chooser_get_preview_uri(_SELF(self)));
223
202
  }
@@ -228,24 +207,21 @@ fcho_get_preview_uri(self)
228
207
  */
229
208
 
230
209
  static VALUE
231
- fcho_add_filter(self, filter)
232
- VALUE self, filter;
210
+ fcho_add_filter(VALUE self, VALUE filter)
233
211
  {
234
212
  gtk_file_chooser_add_filter(_SELF(self), GTK_FILE_FILTER(RVAL2GOBJ(filter)));
235
213
  return self;
236
214
  }
237
215
 
238
216
  static VALUE
239
- fcho_remove_filter(self, filter)
240
- VALUE self, filter;
217
+ fcho_remove_filter(VALUE self, VALUE filter)
241
218
  {
242
219
  gtk_file_chooser_remove_filter(_SELF(self), GTK_FILE_FILTER(RVAL2GOBJ(filter)));
243
220
  return self;
244
221
  }
245
222
 
246
223
  static VALUE
247
- fcho_list_filters(self)
248
- VALUE self;
224
+ fcho_list_filters(VALUE self)
249
225
  {
250
226
  return GSLIST2ARYF(gtk_file_chooser_list_filters(_SELF(self)));
251
227
  }
@@ -257,8 +233,7 @@ fcho_list_filters(self)
257
233
  */
258
234
 
259
235
  static VALUE
260
- fcho_add_shortcut_folder(self, folder)
261
- VALUE self, folder;
236
+ fcho_add_shortcut_folder(VALUE self, VALUE folder)
262
237
  {
263
238
  GError *error = NULL;
264
239
  if (! gtk_file_chooser_add_shortcut_folder(_SELF(self), RVAL2CSTRFILENAME(folder), &error))
@@ -267,8 +242,7 @@ fcho_add_shortcut_folder(self, folder)
267
242
  }
268
243
 
269
244
  static VALUE
270
- fcho_remove_shortcut_folder(self, folder)
271
- VALUE self, folder;
245
+ fcho_remove_shortcut_folder(VALUE self, VALUE folder)
272
246
  {
273
247
  GError *error = NULL;
274
248
  if (! gtk_file_chooser_remove_shortcut_folder(_SELF(self), RVAL2CSTRFILENAME(folder), &error))
@@ -277,16 +251,14 @@ fcho_remove_shortcut_folder(self, folder)
277
251
  }
278
252
 
279
253
  static VALUE
280
- fcho_list_shortcut_folders(self)
281
- VALUE self;
254
+ fcho_list_shortcut_folders(VALUE self)
282
255
  {
283
256
  return CSTRFILENAMEARRAY2RVAL_FREE(gtk_file_chooser_list_shortcut_folders(_SELF(self)));
284
257
  }
285
258
 
286
259
 
287
260
  static VALUE
288
- fcho_add_shortcut_folder_uri(self, uri)
289
- VALUE self, uri;
261
+ fcho_add_shortcut_folder_uri(VALUE self, VALUE uri)
290
262
  {
291
263
  GError *error = NULL;
292
264
  if (! gtk_file_chooser_add_shortcut_folder_uri(_SELF(self), RVAL2CSTR(uri), &error))
@@ -295,8 +267,7 @@ fcho_add_shortcut_folder_uri(self, uri)
295
267
  }
296
268
 
297
269
  static VALUE
298
- fcho_remove_shortcut_folder_uri(self, uri)
299
- VALUE self, uri;
270
+ fcho_remove_shortcut_folder_uri(VALUE self, VALUE uri)
300
271
  {
301
272
  GError *error = NULL;
302
273
  if (! gtk_file_chooser_remove_shortcut_folder_uri(_SELF(self), RVAL2CSTR(uri), &error))
@@ -305,8 +276,7 @@ fcho_remove_shortcut_folder_uri(self, uri)
305
276
  }
306
277
 
307
278
  static VALUE
308
- fcho_list_shortcut_folder_uris(self)
309
- VALUE self;
279
+ fcho_list_shortcut_folder_uris(VALUE self)
310
280
  {
311
281
  return gslist2ary_free(gtk_file_chooser_list_shortcut_folder_uris(_SELF(self)));
312
282
  }