gtk2 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (255) hide show
  1. data/Rakefile +66 -1
  2. data/ext/gtk2/extconf.rb +0 -96
  3. data/ext/gtk2/global.h +274 -13
  4. data/ext/gtk2/gtk2.def +5 -3
  5. data/ext/gtk2/init.c +263 -19
  6. data/ext/gtk2/rbgdk.c +245 -89
  7. data/ext/gtk2/rbgdk.h +32 -6
  8. data/ext/gtk2/rbgdkatom.c +38 -28
  9. data/ext/gtk2/rbgdkcairo.c +32 -42
  10. data/ext/gtk2/rbgdkcolor.c +52 -42
  11. data/ext/gtk2/rbgdkcolormap.c +42 -37
  12. data/ext/gtk2/rbgdkconst.c +23 -13
  13. data/ext/gtk2/rbgdkconversions.h +19 -6
  14. data/ext/gtk2/rbgdkcursor.c +37 -25
  15. data/ext/gtk2/rbgdkdevice.c +77 -67
  16. data/ext/gtk2/rbgdkdisplay.c +158 -150
  17. data/ext/gtk2/rbgdkdisplaymanager.c +27 -15
  18. data/ext/gtk2/rbgdkdragcontext.c +121 -70
  19. data/ext/gtk2/rbgdkdraw.c +252 -160
  20. data/ext/gtk2/rbgdkevent.c +30 -20
  21. data/ext/gtk2/rbgdkgc.c +123 -116
  22. data/ext/gtk2/rbgdkgeometry.c +77 -68
  23. data/ext/gtk2/rbgdkimage.c +58 -47
  24. data/ext/gtk2/rbgdkinput.c +33 -26
  25. data/ext/gtk2/rbgdkkeymap.c +38 -27
  26. data/ext/gtk2/rbgdkkeyval.c +44 -32
  27. data/ext/gtk2/rbgdkpango.c +66 -39
  28. data/ext/gtk2/rbgdkpangorenderer.c +63 -35
  29. data/ext/gtk2/rbgdkpixbuf.c +36 -25
  30. data/ext/gtk2/rbgdkpixmap.c +65 -49
  31. data/ext/gtk2/rbgdkproperty.c +66 -60
  32. data/ext/gtk2/rbgdkrectangle.c +54 -46
  33. data/ext/gtk2/rbgdkregion.c +144 -79
  34. data/ext/gtk2/rbgdkrgb.c +74 -58
  35. data/ext/gtk2/rbgdkscreen.c +103 -97
  36. data/ext/gtk2/rbgdkselection.c +49 -39
  37. data/ext/gtk2/rbgdkthreads.c +32 -19
  38. data/ext/gtk2/rbgdktimecoord.c +60 -38
  39. data/ext/gtk2/rbgdkvisual.c +79 -71
  40. data/ext/gtk2/rbgdkwindow.c +284 -305
  41. data/ext/gtk2/rbgdkwindowattr.c +69 -58
  42. data/ext/gtk2/rbgdkx11.c +41 -28
  43. data/ext/gtk2/rbgtk.c +498 -19
  44. data/ext/gtk2/rbgtk.h +35 -20
  45. data/ext/gtk2/rbgtkaboutdialog.c +33 -80
  46. data/ext/gtk2/rbgtkaccelerator.c +36 -23
  47. data/ext/gtk2/rbgtkaccelgroup.c +50 -40
  48. data/ext/gtk2/rbgtkaccelgroupentry.c +32 -20
  49. data/ext/gtk2/rbgtkaccelkey.c +40 -28
  50. data/ext/gtk2/rbgtkaccellabel.c +30 -18
  51. data/ext/gtk2/rbgtkaccelmap.c +55 -42
  52. data/ext/gtk2/rbgtkaccessible.c +25 -14
  53. data/ext/gtk2/rbgtkaction.c +68 -68
  54. data/ext/gtk2/rbgtkactiongroup.c +317 -195
  55. data/ext/gtk2/rbgtkadjustment.c +33 -46
  56. data/ext/gtk2/rbgtkalignment.c +36 -24
  57. data/ext/gtk2/rbgtkallocation.c +53 -42
  58. data/ext/gtk2/rbgtkarrow.c +34 -22
  59. data/ext/gtk2/rbgtkaspectframe.c +32 -20
  60. data/ext/gtk2/rbgtkassistant.c +81 -61
  61. data/ext/gtk2/rbgtkbbox.c +32 -20
  62. data/ext/gtk2/rbgtkbin.c +28 -16
  63. data/ext/gtk2/rbgtkbindingset.c +42 -35
  64. data/ext/gtk2/rbgtkborder.c +34 -23
  65. data/ext/gtk2/rbgtkbox.c +40 -29
  66. data/ext/gtk2/rbgtkbuildable.c +57 -45
  67. data/ext/gtk2/rbgtkbuilder.c +53 -38
  68. data/ext/gtk2/rbgtkbutton.c +41 -55
  69. data/ext/gtk2/rbgtkcalendar.c +51 -40
  70. data/ext/gtk2/rbgtkcelleditable.c +28 -17
  71. data/ext/gtk2/rbgtkcelllayout.c +41 -30
  72. data/ext/gtk2/rbgtkcellrenderer.c +43 -32
  73. data/ext/gtk2/rbgtkcellrendereraccel.c +26 -18
  74. data/ext/gtk2/rbgtkcellrenderercombo.c +25 -17
  75. data/ext/gtk2/rbgtkcellrendererpixbuf.c +24 -17
  76. data/ext/gtk2/rbgtkcellrendererprogress.c +25 -17
  77. data/ext/gtk2/rbgtkcellrendererspin.c +24 -16
  78. data/ext/gtk2/rbgtkcellrendererspinner.c +23 -11
  79. data/ext/gtk2/rbgtkcellrenderertext.c +28 -21
  80. data/ext/gtk2/rbgtkcellrenderertoggle.c +24 -16
  81. data/ext/gtk2/rbgtkcellview.c +34 -33
  82. data/ext/gtk2/rbgtkcheckbutton.c +28 -16
  83. data/ext/gtk2/rbgtkcheckmenuitem.c +31 -19
  84. data/ext/gtk2/rbgtkclipboard.c +123 -77
  85. data/ext/gtk2/rbgtkcolorbutton.c +26 -31
  86. data/ext/gtk2/rbgtkcolorsel.c +109 -55
  87. data/ext/gtk2/rbgtkcolorselectiondialog.c +28 -19
  88. data/ext/gtk2/rbgtkcombo.c +43 -32
  89. data/ext/gtk2/rbgtkcombobox.c +44 -83
  90. data/ext/gtk2/rbgtkcomboboxentry.c +26 -21
  91. data/ext/gtk2/rbgtkconst.c +23 -13
  92. data/ext/gtk2/rbgtkcontainer.c +153 -100
  93. data/ext/gtk2/rbgtkconversions.h +19 -6
  94. data/ext/gtk2/rbgtkcurve.c +46 -36
  95. data/ext/gtk2/rbgtkdialog.c +104 -70
  96. data/ext/gtk2/rbgtkdrag.c +173 -121
  97. data/ext/gtk2/rbgtkdrawingarea.c +28 -16
  98. data/ext/gtk2/rbgtkeditable.c +63 -51
  99. data/ext/gtk2/rbgtkentry.c +48 -85
  100. data/ext/gtk2/rbgtkentrycompletion.c +42 -55
  101. data/ext/gtk2/rbgtkeventbox.c +28 -16
  102. data/ext/gtk2/rbgtkexpander.c +26 -35
  103. data/ext/gtk2/rbgtkfilechooser.c +87 -143
  104. data/ext/gtk2/rbgtkfilechooserbutton.c +26 -32
  105. data/ext/gtk2/rbgtkfilechooserdialog.c +25 -15
  106. data/ext/gtk2/rbgtkfilechooserwidget.c +26 -15
  107. data/ext/gtk2/rbgtkfilefilter.c +45 -35
  108. data/ext/gtk2/rbgtkfilesel.c +54 -43
  109. data/ext/gtk2/rbgtkfilesystemerror.c +51 -0
  110. data/ext/gtk2/rbgtkfixed.c +36 -25
  111. data/ext/gtk2/rbgtkfontbutton.c +26 -37
  112. data/ext/gtk2/rbgtkfontselection.c +27 -15
  113. data/ext/gtk2/rbgtkfontselectiondialog.c +43 -32
  114. data/ext/gtk2/rbgtkframe.c +39 -28
  115. data/ext/gtk2/rbgtkgamma.c +32 -20
  116. data/ext/gtk2/rbgtkhandlebox.c +31 -19
  117. data/ext/gtk2/rbgtkhbbox.c +28 -16
  118. data/ext/gtk2/rbgtkhbox.c +29 -17
  119. data/ext/gtk2/rbgtkhpaned.c +28 -16
  120. data/ext/gtk2/rbgtkhruler.c +28 -16
  121. data/ext/gtk2/rbgtkhscale.c +28 -16
  122. data/ext/gtk2/rbgtkhscrollbar.c +28 -16
  123. data/ext/gtk2/rbgtkhseparator.c +28 -16
  124. data/ext/gtk2/rbgtkiconfactory.c +35 -23
  125. data/ext/gtk2/rbgtkiconinfo.c +42 -30
  126. data/ext/gtk2/rbgtkiconset.c +31 -19
  127. data/ext/gtk2/rbgtkiconsize.c +38 -25
  128. data/ext/gtk2/rbgtkiconsource.c +62 -50
  129. data/ext/gtk2/rbgtkicontheme.c +95 -95
  130. data/ext/gtk2/rbgtkiconview.c +87 -121
  131. data/ext/gtk2/rbgtkimage.c +31 -40
  132. data/ext/gtk2/rbgtkimagemenuitem.c +26 -14
  133. data/ext/gtk2/rbgtkimcontext.c +46 -34
  134. data/ext/gtk2/rbgtkimcontextsimple.c +47 -24
  135. data/ext/gtk2/rbgtkimmulticontext.c +26 -14
  136. data/ext/gtk2/rbgtkinputdialog.c +28 -16
  137. data/ext/gtk2/rbgtkinvisible.c +24 -18
  138. data/ext/gtk2/rbgtkitem.c +32 -20
  139. data/ext/gtk2/rbgtkitemfactory.c +65 -57
  140. data/ext/gtk2/rbgtklabel.c +46 -57
  141. data/ext/gtk2/rbgtklayout.c +40 -29
  142. data/ext/gtk2/rbgtklinkbutton.c +26 -15
  143. data/ext/gtk2/rbgtkliststore.c +145 -102
  144. data/ext/gtk2/rbgtkmacros.h +19 -6
  145. data/ext/gtk2/rbgtkmenu.c +47 -59
  146. data/ext/gtk2/rbgtkmenubar.c +30 -30
  147. data/ext/gtk2/rbgtkmenuitem.c +34 -41
  148. data/ext/gtk2/rbgtkmenushell.c +43 -42
  149. data/ext/gtk2/rbgtkmenutoolbutton.c +27 -16
  150. data/ext/gtk2/rbgtkmessagedialog.c +31 -25
  151. data/ext/gtk2/rbgtkmisc.c +33 -22
  152. data/ext/gtk2/rbgtknotebook.c +98 -134
  153. data/ext/gtk2/rbgtkobject.c +46 -81
  154. data/ext/gtk2/rbgtkoptionmenu.c +35 -23
  155. data/ext/gtk2/rbgtkpagesetup.c +64 -54
  156. data/ext/gtk2/rbgtkpagesetupunixdialog.c +34 -27
  157. data/ext/gtk2/rbgtkpaned.c +46 -36
  158. data/ext/gtk2/rbgtkpapersize.c +60 -54
  159. data/ext/gtk2/rbgtkplug.c +32 -20
  160. data/ext/gtk2/rbgtkprintcontext.c +43 -35
  161. data/ext/gtk2/rbgtkprinter.c +36 -37
  162. data/ext/gtk2/rbgtkprintjob.c +36 -37
  163. data/ext/gtk2/rbgtkprintoperation.c +44 -33
  164. data/ext/gtk2/rbgtkprintoperationpreview.c +30 -18
  165. data/ext/gtk2/rbgtkprintsettings.c +248 -192
  166. data/ext/gtk2/rbgtkprintunixdialog.c +33 -45
  167. data/ext/gtk2/rbgtkprogress.c +23 -13
  168. data/ext/gtk2/rbgtkprogressbar.c +47 -46
  169. data/ext/gtk2/rbgtkradioaction.c +84 -39
  170. data/ext/gtk2/rbgtkradiobutton.c +33 -21
  171. data/ext/gtk2/rbgtkradiomenuitem.c +86 -45
  172. data/ext/gtk2/rbgtkradiotoolbutton.c +99 -53
  173. data/ext/gtk2/rbgtkrange.c +36 -56
  174. data/ext/gtk2/rbgtkrc.c +61 -49
  175. data/ext/gtk2/rbgtkrcstyle.c +59 -48
  176. data/ext/gtk2/rbgtkrecentaction.c +28 -16
  177. data/ext/gtk2/rbgtkrecentchooser.c +58 -92
  178. data/ext/gtk2/rbgtkrecentchooserdialog.c +29 -18
  179. data/ext/gtk2/rbgtkrecentchoosermenu.c +25 -21
  180. data/ext/gtk2/rbgtkrecentchooserwidget.c +24 -13
  181. data/ext/gtk2/rbgtkrecentdata.c +47 -36
  182. data/ext/gtk2/rbgtkrecentfilter.c +55 -46
  183. data/ext/gtk2/rbgtkrecentfilterinfo.c +51 -40
  184. data/ext/gtk2/rbgtkrecentinfo.c +66 -56
  185. data/ext/gtk2/rbgtkrecentmanager.c +47 -43
  186. data/ext/gtk2/rbgtkruler.c +35 -30
  187. data/ext/gtk2/rbgtkscale.c +29 -18
  188. data/ext/gtk2/rbgtkscalebutton.c +27 -27
  189. data/ext/gtk2/rbgtkscrollbar.c +23 -13
  190. data/ext/gtk2/rbgtkscrolledwindow.c +44 -60
  191. data/ext/gtk2/rbgtkselection.c +87 -67
  192. data/ext/gtk2/rbgtkselectiondata.c +74 -65
  193. data/ext/gtk2/rbgtkseparator.c +23 -13
  194. data/ext/gtk2/rbgtkseparatormenuitem.c +25 -13
  195. data/ext/gtk2/rbgtkseparatortoolitem.c +26 -21
  196. data/ext/gtk2/rbgtksettings.c +123 -103
  197. data/ext/gtk2/rbgtksizegroup.c +33 -30
  198. data/ext/gtk2/rbgtksocket.c +32 -20
  199. data/ext/gtk2/rbgtkspinbutton.c +48 -38
  200. data/ext/gtk2/rbgtkspinner.c +27 -14
  201. data/ext/gtk2/rbgtkstatusbar.c +36 -31
  202. data/ext/gtk2/rbgtkstatusicon.c +31 -44
  203. data/ext/gtk2/rbgtkstock.c +137 -125
  204. data/ext/gtk2/rbgtkstyle.c +177 -161
  205. data/ext/gtk2/rbgtktable.c +58 -47
  206. data/ext/gtk2/rbgtktargetlist.c +56 -36
  207. data/ext/gtk2/rbgtktearoffmenuitem.c +28 -16
  208. data/ext/gtk2/rbgtktextappearance.c +44 -34
  209. data/ext/gtk2/rbgtktextattributes.c +54 -42
  210. data/ext/gtk2/rbgtktextbuffer.c +188 -191
  211. data/ext/gtk2/rbgtktextchild.c +29 -18
  212. data/ext/gtk2/rbgtktextiter.c +153 -145
  213. data/ext/gtk2/rbgtktextmark.c +33 -30
  214. data/ext/gtk2/rbgtktexttag.c +34 -22
  215. data/ext/gtk2/rbgtktexttagtable.c +36 -25
  216. data/ext/gtk2/rbgtktextview.c +85 -73
  217. data/ext/gtk2/rbgtktoggleaction.c +27 -22
  218. data/ext/gtk2/rbgtktogglebutton.c +37 -26
  219. data/ext/gtk2/rbgtktoggletoolbutton.c +26 -20
  220. data/ext/gtk2/rbgtktoolbar.c +66 -69
  221. data/ext/gtk2/rbgtktoolbutton.c +27 -40
  222. data/ext/gtk2/rbgtktoolitem.c +60 -62
  223. data/ext/gtk2/rbgtktooltip.c +36 -25
  224. data/ext/gtk2/rbgtktooltips.c +42 -34
  225. data/ext/gtk2/rbgtktreedragdest.c +20 -11
  226. data/ext/gtk2/rbgtktreedragsource.c +20 -11
  227. data/ext/gtk2/rbgtktreeiter.c +58 -47
  228. data/ext/gtk2/rbgtktreemodel.c +83 -65
  229. data/ext/gtk2/rbgtktreemodelfilter.c +47 -35
  230. data/ext/gtk2/rbgtktreemodelsort.c +38 -27
  231. data/ext/gtk2/rbgtktreepath.c +55 -44
  232. data/ext/gtk2/rbgtktreerowreference.c +60 -42
  233. data/ext/gtk2/rbgtktreeselection.c +61 -52
  234. data/ext/gtk2/rbgtktreesortable.c +52 -42
  235. data/ext/gtk2/rbgtktreestore.c +88 -67
  236. data/ext/gtk2/rbgtktreeview.c +157 -185
  237. data/ext/gtk2/rbgtktreeviewcolumn.c +57 -62
  238. data/ext/gtk2/rbgtkuimanager.c +61 -61
  239. data/ext/gtk2/rbgtkvbbox.c +28 -16
  240. data/ext/gtk2/rbgtkvbox.c +29 -17
  241. data/ext/gtk2/rbgtkviewport.c +28 -16
  242. data/ext/gtk2/rbgtkvolumebutton.c +28 -16
  243. data/ext/gtk2/rbgtkvpaned.c +28 -16
  244. data/ext/gtk2/rbgtkvruler.c +28 -16
  245. data/ext/gtk2/rbgtkvscale.c +28 -16
  246. data/ext/gtk2/rbgtkvscrollbar.c +28 -16
  247. data/ext/gtk2/rbgtkvseparator.c +28 -16
  248. data/ext/gtk2/rbgtkwidget.c +284 -296
  249. data/ext/gtk2/rbgtkwindow.c +156 -214
  250. data/ext/gtk2/rbgtkwindowgroup.c +35 -24
  251. data/sample/testgtk/labels.rb +1 -0
  252. data/sample/testgtk/testgtk.rb +2 -0
  253. metadata +16 -17
  254. data/ChangeLog +0 -6902
  255. data/ext/gtk2/rbgtkmain.c +0 -493
@@ -1,21 +1,31 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbgdkselection.c -
5
-
6
- $Author: ggc $
7
- $Date: 2007/07/13 16:07:31 $
8
-
9
- Copyright (C) 2002-2004 Masao Mutoh
10
- ************************************************/
11
-
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2002-2004 Masao Mutoh
5
+ *
6
+ * This library is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation; either
9
+ * version 2.1 of the License, or (at your option) any later version.
10
+ *
11
+ * This library is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ * Lesser General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General Public
17
+ * License along with this library; if not, write to the Free Software
18
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
+ * MA 02110-1301 USA
20
+ */
12
21
 
13
22
  #include "global.h"
14
23
 
24
+ #define RG_TARGET_NAMESPACE mSelection
15
25
  #define GATOM2RVAL(g) (BOXED2RVAL(g, GDK_TYPE_ATOM))
16
26
 
17
27
  static VALUE
18
- gdkselection_owner_set(int argc, VALUE *argv, VALUE self)
28
+ rg_m_owner_set(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
19
29
  {
20
30
  VALUE owner, selection, time, send_event;
21
31
  int ret;
@@ -42,7 +52,7 @@ gdkselection_owner_set(int argc, VALUE *argv, VALUE self)
42
52
  }
43
53
 
44
54
  static VALUE
45
- gdkselection_owner_get(int argc, VALUE *argv, VALUE self)
55
+ rg_m_owner_get(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
46
56
  {
47
57
  VALUE selection;
48
58
 
@@ -62,7 +72,7 @@ gdkselection_owner_get(int argc, VALUE *argv, VALUE self)
62
72
  }
63
73
 
64
74
  static VALUE
65
- gdkselection_convert(VALUE self, VALUE requestor, VALUE selection, VALUE target, VALUE time)
75
+ rg_m_convert(VALUE self, VALUE requestor, VALUE selection, VALUE target, VALUE time)
66
76
  {
67
77
  gdk_selection_convert(GDK_WINDOW(RVAL2GOBJ(requestor)),
68
78
  RVAL2ATOM(selection),
@@ -71,7 +81,7 @@ gdkselection_convert(VALUE self, VALUE requestor, VALUE selection, VALUE target,
71
81
  }
72
82
 
73
83
  static VALUE
74
- gdkselection_property_get(VALUE self, VALUE requestor)
84
+ rg_m_property_get(G_GNUC_UNUSED VALUE self, VALUE requestor)
75
85
  {
76
86
  guchar *data;
77
87
  GdkAtom prop_type;
@@ -88,7 +98,7 @@ gdkselection_property_get(VALUE self, VALUE requestor)
88
98
  }
89
99
 
90
100
  static VALUE
91
- gdkselection_send_notify(int argc, VALUE *argv, VALUE self)
101
+ rg_m_send_notify(int argc, VALUE *argv, VALUE self)
92
102
  {
93
103
  VALUE requestor, selection, target, property, time;
94
104
 
@@ -115,36 +125,36 @@ gdkselection_send_notify(int argc, VALUE *argv, VALUE self)
115
125
  }
116
126
 
117
127
  void
118
- Init_gtk_gdk_selection()
128
+ Init_gtk_gdk_selection(VALUE mGdk)
119
129
  {
120
- VALUE mGdkSelection = rb_define_module_under(mGdk, "Selection");
130
+ VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGdk, "Selection");
121
131
 
122
- rb_define_module_function(mGdkSelection, "owner_set", gdkselection_owner_set, -1);
123
- rb_define_module_function(mGdkSelection, "owner_get", gdkselection_owner_get, -1);
124
- rb_define_module_function(mGdkSelection, "convert", gdkselection_convert, 4);
125
- rb_define_module_function(mGdkSelection, "property_get", gdkselection_property_get, 1);
126
- rb_define_module_function(mGdkSelection, "send_notify", gdkselection_send_notify, -1);
132
+ RG_DEF_MODFUNC(owner_set, -1);
133
+ RG_DEF_MODFUNC(owner_get, -1);
134
+ RG_DEF_MODFUNC(convert, 4);
135
+ RG_DEF_MODFUNC(property_get, 1);
136
+ RG_DEF_MODFUNC(send_notify, -1);
127
137
 
128
138
  /* Constants */
129
- rb_define_const(mGdkSelection, "PRIMARY", GATOM2RVAL(GDK_SELECTION_PRIMARY));
130
- rb_define_const(mGdkSelection, "SECONDARY", GATOM2RVAL(GDK_SELECTION_SECONDARY));
131
- rb_define_const(mGdkSelection, "CLIPBOARD", GATOM2RVAL(GDK_SELECTION_CLIPBOARD));
132
-
139
+ rb_define_const(RG_TARGET_NAMESPACE, "PRIMARY", GATOM2RVAL(GDK_SELECTION_PRIMARY));
140
+ rb_define_const(RG_TARGET_NAMESPACE, "SECONDARY", GATOM2RVAL(GDK_SELECTION_SECONDARY));
141
+ rb_define_const(RG_TARGET_NAMESPACE, "CLIPBOARD", GATOM2RVAL(GDK_SELECTION_CLIPBOARD));
142
+
133
143
  /* GdkSelectionType */
134
- rb_define_const(mGdkSelection, "TYPE_ATOM", GATOM2RVAL(GDK_SELECTION_TYPE_ATOM));
135
- rb_define_const(mGdkSelection, "TYPE_BITMAP", GATOM2RVAL(GDK_SELECTION_TYPE_BITMAP));
136
- rb_define_const(mGdkSelection, "TYPE_COLORMAP", GATOM2RVAL(GDK_SELECTION_TYPE_COLORMAP));
137
- rb_define_const(mGdkSelection, "TYPE_DRAWABLE", GATOM2RVAL(GDK_SELECTION_TYPE_DRAWABLE));
138
- rb_define_const(mGdkSelection, "TYPE_INTEGER", GATOM2RVAL(GDK_SELECTION_TYPE_INTEGER));
139
- rb_define_const(mGdkSelection, "TYPE_PIXMAP", GATOM2RVAL(GDK_SELECTION_TYPE_PIXMAP));
140
- rb_define_const(mGdkSelection, "TYPE_WINDOW", GATOM2RVAL(GDK_SELECTION_TYPE_WINDOW));
141
- rb_define_const(mGdkSelection, "TYPE_STRING", GATOM2RVAL(GDK_SELECTION_TYPE_STRING));
144
+ rb_define_const(RG_TARGET_NAMESPACE, "TYPE_ATOM", GATOM2RVAL(GDK_SELECTION_TYPE_ATOM));
145
+ rb_define_const(RG_TARGET_NAMESPACE, "TYPE_BITMAP", GATOM2RVAL(GDK_SELECTION_TYPE_BITMAP));
146
+ rb_define_const(RG_TARGET_NAMESPACE, "TYPE_COLORMAP", GATOM2RVAL(GDK_SELECTION_TYPE_COLORMAP));
147
+ rb_define_const(RG_TARGET_NAMESPACE, "TYPE_DRAWABLE", GATOM2RVAL(GDK_SELECTION_TYPE_DRAWABLE));
148
+ rb_define_const(RG_TARGET_NAMESPACE, "TYPE_INTEGER", GATOM2RVAL(GDK_SELECTION_TYPE_INTEGER));
149
+ rb_define_const(RG_TARGET_NAMESPACE, "TYPE_PIXMAP", GATOM2RVAL(GDK_SELECTION_TYPE_PIXMAP));
150
+ rb_define_const(RG_TARGET_NAMESPACE, "TYPE_WINDOW", GATOM2RVAL(GDK_SELECTION_TYPE_WINDOW));
151
+ rb_define_const(RG_TARGET_NAMESPACE, "TYPE_STRING", GATOM2RVAL(GDK_SELECTION_TYPE_STRING));
142
152
 
143
153
  /* GdkTarget */
144
- rb_define_const(mGdkSelection, "TARGET_BITMAP", GATOM2RVAL(GDK_TARGET_BITMAP));
145
- rb_define_const(mGdkSelection, "TARGET_COLORMAP", GATOM2RVAL(GDK_TARGET_COLORMAP));
146
- rb_define_const(mGdkSelection, "TARGET_DRAWABLE", GATOM2RVAL(GDK_TARGET_DRAWABLE));
147
- rb_define_const(mGdkSelection, "TARGET_PIXMAP", GATOM2RVAL(GDK_TARGET_PIXMAP));
148
- rb_define_const(mGdkSelection, "TARGET_STRING", GATOM2RVAL(GDK_TARGET_STRING));
154
+ rb_define_const(RG_TARGET_NAMESPACE, "TARGET_BITMAP", GATOM2RVAL(GDK_TARGET_BITMAP));
155
+ rb_define_const(RG_TARGET_NAMESPACE, "TARGET_COLORMAP", GATOM2RVAL(GDK_TARGET_COLORMAP));
156
+ rb_define_const(RG_TARGET_NAMESPACE, "TARGET_DRAWABLE", GATOM2RVAL(GDK_TARGET_DRAWABLE));
157
+ rb_define_const(RG_TARGET_NAMESPACE, "TARGET_PIXMAP", GATOM2RVAL(GDK_TARGET_PIXMAP));
158
+ rb_define_const(RG_TARGET_NAMESPACE, "TARGET_STRING", GATOM2RVAL(GDK_TARGET_STRING));
149
159
 
150
160
  }
@@ -1,19 +1,32 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbgtkthreads.c -
5
-
6
- $Author: sakai $
7
- $Date: 2007/07/08 03:00:50 $
8
-
9
- Copyright (C) 2003-2005 Masao Mutoh
10
- ************************************************/
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2003-2005 Masao Mutoh
5
+ *
6
+ * This library is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation; either
9
+ * version 2.1 of the License, or (at your option) any later version.
10
+ *
11
+ * This library is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ * Lesser General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General Public
17
+ * License along with this library; if not, write to the Free Software
18
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
+ * MA 02110-1301 USA
20
+ */
11
21
 
12
22
  #include "global.h"
13
23
 
14
24
  #ifdef G_THREADS_ENABLED
25
+
26
+ #define RG_TARGET_NAMESPACE mThreads
27
+
15
28
  static VALUE
16
- rbgdk_threads_init(VALUE self)
29
+ rg_m_init(VALUE self)
17
30
  {
18
31
  #ifndef GDK_WINDOWING_WIN32
19
32
  if (!g_thread_supported()){
@@ -25,21 +38,21 @@ rbgdk_threads_init(VALUE self)
25
38
  }
26
39
 
27
40
  static VALUE
28
- rbgdk_threads_enter(VALUE self)
41
+ rg_m_enter(VALUE self)
29
42
  {
30
43
  gdk_threads_enter();
31
44
  return self;
32
45
  }
33
46
 
34
47
  static VALUE
35
- rbgdk_threads_leave(VALUE self)
48
+ rg_m_leave(VALUE self)
36
49
  {
37
50
  gdk_threads_leave();
38
51
  return self;
39
52
  }
40
53
 
41
54
  static VALUE
42
- rbgdk_threads_synchronize(VALUE self)
55
+ rg_m_synchronize(G_GNUC_UNUSED VALUE self)
43
56
  {
44
57
  VALUE func = rb_block_proc();
45
58
  gdk_threads_enter();
@@ -51,14 +64,14 @@ rbgdk_threads_synchronize(VALUE self)
51
64
  #endif
52
65
 
53
66
  void
54
- Init_gtk_gdk_threads()
67
+ Init_gtk_gdk_threads(VALUE mGdk)
55
68
  {
56
69
  #ifdef G_THREADS_ENABLED
57
- VALUE mGdkThreads = rb_define_module_under(mGdk, "Threads");
70
+ VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGdk, "Threads");
58
71
 
59
- rb_define_module_function(mGdkThreads, "init", rbgdk_threads_init, 0);
60
- rb_define_module_function(mGdkThreads, "enter", rbgdk_threads_enter, 0);
61
- rb_define_module_function(mGdkThreads, "leave", rbgdk_threads_leave, 0);
62
- rb_define_module_function(mGdkThreads, "synchronize", rbgdk_threads_synchronize, 0);
72
+ RG_DEF_MODFUNC(init, 0);
73
+ RG_DEF_MODFUNC(enter, 0);
74
+ RG_DEF_MODFUNC(leave, 0);
75
+ RG_DEF_MODFUNC(synchronize, 0);
63
76
  #endif
64
77
  }
@@ -1,15 +1,27 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2003 Masao Mutoh
5
+ *
6
+ * This library is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation; either
9
+ * version 2.1 of the License, or (at your option) any later version.
10
+ *
11
+ * This library is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ * Lesser General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General Public
17
+ * License along with this library; if not, write to the Free Software
18
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
+ * MA 02110-1301 USA
20
+ */
3
21
 
4
- rbgdktimecoord.c -
5
-
6
- $Author: sakai $
7
- $Date: 2006/05/26 14:18:22 $
8
-
9
- Copyright (C) 2003 Masao Mutoh
10
- ************************************************/
11
22
  #include "global.h"
12
23
 
24
+ #define RG_TARGET_NAMESPACE cTimeCoord
13
25
  #define _SELF(s) ((GdkTimeCoord*)RVAL2BOXED(s, GDK_TYPE_TIME_COORD))
14
26
 
15
27
  /**********************************/
@@ -37,40 +49,47 @@ gdk_timecoord_get_type(void)
37
49
  /**********************************/
38
50
 
39
51
  static VALUE
40
- timecoord_initialize(VALUE self, VALUE time, VALUE axes)
52
+ rg_initialize(VALUE self, VALUE rbtime, VALUE rbaxes)
41
53
  {
42
- GdkTimeCoord coord;
43
- int i;
44
- coord.time = NUM2UINT(time);
54
+ guint32 time = NUM2UINT(rbtime);
55
+ long n;
56
+ gdouble *axes = RVAL2GDOUBLES(rbaxes, n);
57
+ GdkTimeCoord *coord;
45
58
 
46
- if (RARRAY_LEN(axes) > GDK_MAX_TIMECOORD_AXES){
47
- rb_raise(rb_eArgError, "axes: Out of range: %ld", RARRAY_LEN(axes));
48
- }
59
+ if (n > GDK_MAX_TIMECOORD_AXES) {
60
+ g_free(axes);
49
61
 
50
- for (i = 0; i < RARRAY_LEN(axes); i++){
51
- coord.axes[i] = NUM2DBL(RARRAY_PTR(axes)[i]);
62
+ rb_raise(rb_eArgError,
63
+ "axes out of range: %ld (0..%d)",
64
+ n, GDK_MAX_TIMECOORD_AXES);
52
65
  }
53
66
 
54
- G_INITIALIZE(self, &coord);
67
+ coord = g_new(GdkTimeCoord, 1);
68
+ coord->time = time;
69
+ MEMCPY(coord->axes, axes, gdouble, n);
70
+
71
+ g_free(axes);
72
+
73
+ G_INITIALIZE(self, coord);
55
74
 
56
75
  return Qnil;
57
76
  }
58
77
 
59
78
  static VALUE
60
- timecoord_time(VALUE self)
79
+ rg_time(VALUE self)
61
80
  {
62
81
  return UINT2NUM(_SELF(self)->time);
63
82
  }
64
83
 
65
84
  static VALUE
66
- timecoord_set_time(VALUE self, VALUE time)
85
+ rg_set_time(VALUE self, VALUE time)
67
86
  {
68
87
  _SELF(self)->time = NUM2UINT(time);
69
88
  return self;
70
89
  }
71
90
 
72
91
  static VALUE
73
- timecoord_axes(VALUE self)
92
+ rg_axes(VALUE self)
74
93
  {
75
94
  VALUE ary = rb_ary_new();
76
95
  int i;
@@ -81,33 +100,36 @@ timecoord_axes(VALUE self)
81
100
  }
82
101
 
83
102
  static VALUE
84
- timecoord_set_axes(VALUE self, VALUE axes)
103
+ rg_set_axes(VALUE self, VALUE rbaxes)
85
104
  {
86
- int i;
87
- GdkTimeCoord* coord = _SELF(self);
105
+ GdkTimeCoord *coord = _SELF(self);
106
+ VALUE axes = rb_ary_to_ary(rbaxes);
107
+ long i;
108
+ long n = RARRAY_LEN(axes);
88
109
 
89
- if (RARRAY_LEN(axes) > GDK_MAX_TIMECOORD_AXES){
90
- rb_raise(rb_eArgError, "axes: Out of range: %ld", RARRAY_LEN(axes));
91
- }
110
+ if (n < 0 || n > GDK_MAX_TIMECOORD_AXES)
111
+ rb_raise(rb_eArgError,
112
+ "axes out of range: %ld (0..%d)",
113
+ n, GDK_MAX_TIMECOORD_AXES);
92
114
 
93
- for (i = 0; i < RARRAY_LEN(axes); i++){
115
+ for (i = 0; i < n; i++)
94
116
  coord->axes[i] = NUM2DBL(RARRAY_PTR(axes)[i]);
95
- }
117
+
96
118
  return self;
97
119
  }
98
120
 
99
121
  void
100
- Init_gtk_gdk_timecoord()
122
+ Init_gtk_gdk_timecoord(VALUE mGdk)
101
123
  {
102
- VALUE tc = G_DEF_CLASS(GDK_TYPE_TIME_COORD, "TimeCoord", mGdk);
124
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_TIME_COORD, "TimeCoord", mGdk);
103
125
 
104
- rb_define_method(tc, "initialize", timecoord_initialize, 2);
105
- rb_define_method(tc, "time", timecoord_time, 0);
106
- rb_define_method(tc, "set_time", timecoord_set_time, 1);
107
- rb_define_method(tc, "axes", timecoord_axes, 0);
108
- rb_define_method(tc, "set_axes", timecoord_set_axes, 1);
126
+ RG_DEF_METHOD(initialize, 2);
127
+ RG_DEF_METHOD(time, 0);
128
+ RG_DEF_METHOD(set_time, 1);
129
+ RG_DEF_METHOD(axes, 0);
130
+ RG_DEF_METHOD(set_axes, 1);
109
131
 
110
- G_DEF_SETTERS(tc);
132
+ G_DEF_SETTERS(RG_TARGET_NAMESPACE);
111
133
 
112
- rb_define_const(tc, "MAX_AXES", INT2NUM(GDK_MAX_TIMECOORD_AXES));
134
+ rb_define_const(RG_TARGET_NAMESPACE, "MAX_AXES", INT2NUM(GDK_MAX_TIMECOORD_AXES));
113
135
  }
@@ -1,26 +1,34 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbgdkvisual.c -
5
-
6
- $Author: mutoh $
7
- $Date: 2004/08/01 07:10:03 $
8
-
9
- Copyright (C) 2002-2004 Masao Mutoh
10
-
11
- This file is devided from rbgdkcolor.c.
12
- rbgdkcolor.c -
13
- Copyright (C) 1998-2000 Yukihiro Matsumoto,
14
- Daisuke Kanda,
15
- Hiroshi Igarashi
16
- ************************************************/
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2002-2004 Masao Mutoh
5
+ * Copyright (C) 1998-2000 Yukihiro Matsumoto,
6
+ * Daisuke Kanda,
7
+ * Hiroshi Igarashi
8
+ *
9
+ * This library is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU Lesser General Public
11
+ * License as published by the Free Software Foundation; either
12
+ * version 2.1 of the License, or (at your option) any later version.
13
+ *
14
+ * This library is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
+ * Lesser General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU Lesser General Public
20
+ * License along with this library; if not, write to the Free Software
21
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22
+ * MA 02110-1301 USA
23
+ */
17
24
 
18
25
  #include "global.h"
19
26
 
27
+ #define RG_TARGET_NAMESPACE cVisual
20
28
  #define _SELF(self) (GDK_VISUAL(RVAL2GOBJ(self)))
21
29
 
22
30
  static VALUE
23
- gdkvisual_s_query_depths(VALUE self)
31
+ rg_s_query_depths(G_GNUC_UNUSED VALUE self)
24
32
  {
25
33
  gint *depth;
26
34
  gint count;
@@ -36,7 +44,7 @@ gdkvisual_s_query_depths(VALUE self)
36
44
  }
37
45
 
38
46
  static VALUE
39
- gdkvisual_s_query_visual_types(VALUE self)
47
+ rg_s_query_visual_types(G_GNUC_UNUSED VALUE self)
40
48
  {
41
49
  GdkVisualType *visual_types;
42
50
  gint count;
@@ -52,7 +60,7 @@ gdkvisual_s_query_visual_types(VALUE self)
52
60
  }
53
61
 
54
62
  static VALUE
55
- gdkvisual_s_list_visuals(VALUE self)
63
+ rg_s_visuals(G_GNUC_UNUSED VALUE self)
56
64
  {
57
65
  GList *list = gdk_list_visuals(), *cur;
58
66
  VALUE ary = rb_ary_new();
@@ -65,44 +73,44 @@ gdkvisual_s_list_visuals(VALUE self)
65
73
  }
66
74
 
67
75
  static VALUE
68
- gdkvisual_s_get_best_depth(VALUE self)
76
+ rg_s_best_depth(G_GNUC_UNUSED VALUE self)
69
77
  {
70
78
  return INT2NUM(gdk_visual_get_best_depth());
71
79
  }
72
80
 
73
81
  static VALUE
74
- gdkvisual_s_get_best_type(VALUE self)
82
+ rg_s_best_type(G_GNUC_UNUSED VALUE self)
75
83
  {
76
84
  return INT2NUM(gdk_visual_get_best_type());
77
85
  }
78
86
 
79
87
  static VALUE
80
- gdkvisual_s_get_system(VALUE self)
88
+ rg_s_system(G_GNUC_UNUSED VALUE self)
81
89
  {
82
90
  return GOBJ2RVAL(gdk_visual_get_system());
83
91
  }
84
92
 
85
93
  static VALUE
86
- gdkvisual_s_get_best(VALUE self)
94
+ rg_s_best(G_GNUC_UNUSED VALUE self)
87
95
  {
88
96
  return GOBJ2RVAL(gdk_visual_get_best());
89
97
  }
90
98
 
91
99
  static VALUE
92
- gdkvisual_s_get_best_with_depth(VALUE self, VALUE depth)
100
+ rg_s_best_with_depth(G_GNUC_UNUSED VALUE self, VALUE depth)
93
101
  {
94
102
  return GOBJ2RVAL(gdk_visual_get_best_with_depth(NUM2INT(depth)));
95
103
  }
96
104
 
97
105
  static VALUE
98
- gdkvisual_s_get_best_with_type(VALUE self, VALUE type)
106
+ rg_s_best_with_type(G_GNUC_UNUSED VALUE self, VALUE type)
99
107
  {
100
108
  return GOBJ2RVAL(gdk_visual_get_best_with_depth(
101
109
  (GdkVisualType)GENUM2RVAL(type, GDK_TYPE_VISUAL_TYPE)));
102
110
  }
103
111
 
104
112
  static VALUE
105
- gdkvisual_s_get_best_with_both(VALUE self, VALUE depth, VALUE type)
113
+ rg_s_best_with_both(G_GNUC_UNUSED VALUE self, VALUE depth, VALUE type)
106
114
  {
107
115
  return GOBJ2RVAL(gdk_visual_get_best_with_both(
108
116
  NUM2INT(depth),
@@ -111,7 +119,7 @@ gdkvisual_s_get_best_with_both(VALUE self, VALUE depth, VALUE type)
111
119
 
112
120
  #if GTK_CHECK_VERSION(2,2,0)
113
121
  static VALUE
114
- gdkvisual_get_screen(VALUE self)
122
+ rg_screen(VALUE self)
115
123
  {
116
124
  return GOBJ2RVAL(gdk_visual_get_screen(_SELF(self)));
117
125
  }
@@ -119,130 +127,130 @@ gdkvisual_get_screen(VALUE self)
119
127
 
120
128
  /* Structure accessors */
121
129
  static VALUE
122
- gdkvisual_type(VALUE self)
130
+ rg_visual_type(VALUE self)
123
131
  {
124
132
  return GENUM2RVAL(_SELF(self)->type, GDK_TYPE_VISUAL_TYPE);
125
133
  }
126
134
 
127
135
  static VALUE
128
- gdkvisual_depth(VALUE self)
136
+ rg_depth(VALUE self)
129
137
  {
130
138
  return INT2FIX(_SELF(self)->depth);
131
139
  }
132
140
 
133
141
  static VALUE
134
- gdkvisual_byte_order(VALUE self)
142
+ rg_byte_order(VALUE self)
135
143
  {
136
144
  return GENUM2RVAL(_SELF(self)->byte_order, GDK_TYPE_BYTE_ORDER);
137
145
  }
138
146
 
139
147
  static VALUE
140
- gdkvisual_colormap_size(VALUE self)
148
+ rg_colormap_size(VALUE self)
141
149
  {
142
150
  return INT2FIX(_SELF(self)->colormap_size);
143
151
  }
144
152
 
145
153
  static VALUE
146
- gdkvisual_bits_per_rgb(VALUE self)
154
+ rg_bits_per_rgb(VALUE self)
147
155
  {
148
156
  return INT2FIX(_SELF(self)->bits_per_rgb);
149
157
  }
150
158
 
151
159
  static VALUE
152
- gdkvisual_red_mask(VALUE self)
160
+ rg_red_mask(VALUE self)
153
161
  {
154
162
  return INT2FIX(_SELF(self)->red_mask);
155
163
  }
156
164
 
157
165
  static VALUE
158
- gdkvisual_red_shift(VALUE self)
166
+ rg_red_shift(VALUE self)
159
167
  {
160
168
  return INT2FIX(_SELF(self)->red_shift);
161
169
  }
162
170
 
163
171
  static VALUE
164
- gdkvisual_red_prec(VALUE self)
172
+ rg_red_prec(VALUE self)
165
173
  {
166
174
  return INT2FIX(_SELF(self)->red_prec);
167
175
  }
168
176
 
169
177
  static VALUE
170
- gdkvisual_green_mask(VALUE self)
178
+ rg_green_mask(VALUE self)
171
179
  {
172
180
  return INT2FIX(_SELF(self)->green_mask);
173
181
  }
174
182
 
175
183
  static VALUE
176
- gdkvisual_green_shift(VALUE self)
184
+ rg_green_shift(VALUE self)
177
185
  {
178
186
  return INT2FIX(_SELF(self)->green_shift);
179
187
  }
180
188
 
181
189
  static VALUE
182
- gdkvisual_green_prec(VALUE self)
190
+ rg_green_prec(VALUE self)
183
191
  {
184
192
  return INT2FIX(_SELF(self)->green_prec);
185
193
  }
186
194
 
187
195
  static VALUE
188
- gdkvisual_blue_mask(VALUE self)
196
+ rg_blue_mask(VALUE self)
189
197
  {
190
198
  return INT2FIX(_SELF(self)->blue_mask);
191
199
  }
192
200
 
193
201
  static VALUE
194
- gdkvisual_blue_shift(VALUE self)
202
+ rg_blue_shift(VALUE self)
195
203
  {
196
204
  return INT2FIX(_SELF(self)->blue_shift);
197
205
  }
198
206
 
199
207
  static VALUE
200
- gdkvisual_blue_prec(VALUE self)
208
+ rg_blue_prec(VALUE self)
201
209
  {
202
210
  return INT2FIX(_SELF(self)->blue_prec);
203
211
  }
204
212
 
205
213
  void
206
- Init_gtk_gdk_visual()
214
+ Init_gtk_gdk_visual(VALUE mGdk)
207
215
  {
208
- VALUE gdkVisual = G_DEF_CLASS(GDK_TYPE_VISUAL, "Visual", mGdk);
216
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_VISUAL, "Visual", mGdk);
209
217
 
210
218
  /* class methods */
211
- rb_define_singleton_method(gdkVisual, "query_depths", gdkvisual_s_query_depths, 0);
212
- rb_define_singleton_method(gdkVisual, "query_visual_types", gdkvisual_s_query_visual_types, 0);
213
- rb_define_singleton_method(gdkVisual, "visuals", gdkvisual_s_list_visuals, 0);
214
- rb_define_singleton_method(gdkVisual, "best_depth", gdkvisual_s_get_best_depth, 0);
215
- rb_define_singleton_method(gdkVisual, "best_type", gdkvisual_s_get_best_type, 0);
216
- rb_define_singleton_method(gdkVisual, "system", gdkvisual_s_get_system, 0);
217
- rb_define_singleton_method(gdkVisual, "best", gdkvisual_s_get_best, 0);
218
- rb_define_singleton_method(gdkVisual, "best_with_depth", gdkvisual_s_get_best_with_depth, 1);
219
- rb_define_singleton_method(gdkVisual, "best_with_type", gdkvisual_s_get_best_with_type, 1);
220
- rb_define_singleton_method(gdkVisual, "best_with_both", gdkvisual_s_get_best_with_both, 2);
219
+ RG_DEF_SMETHOD(query_depths, 0);
220
+ RG_DEF_SMETHOD(query_visual_types, 0);
221
+ RG_DEF_SMETHOD(visuals, 0);
222
+ RG_DEF_SMETHOD(best_depth, 0);
223
+ RG_DEF_SMETHOD(best_type, 0);
224
+ RG_DEF_SMETHOD(system, 0);
225
+ RG_DEF_SMETHOD(best, 0);
226
+ RG_DEF_SMETHOD(best_with_depth, 1);
227
+ RG_DEF_SMETHOD(best_with_type, 1);
228
+ RG_DEF_SMETHOD(best_with_both, 2);
221
229
 
222
230
  /* instance methods */
223
231
  #if GTK_CHECK_VERSION(2,2,0)
224
- rb_define_method(gdkVisual, "screen", gdkvisual_get_screen, 0);
232
+ RG_DEF_METHOD(screen, 0);
225
233
  #endif
226
- rb_define_method(gdkVisual, "visual_type", gdkvisual_type, 0);
227
- rb_define_method(gdkVisual, "depth", gdkvisual_depth, 0);
228
- rb_define_method(gdkVisual, "byte_order", gdkvisual_byte_order, 0);
229
- rb_define_method(gdkVisual, "colormap_size", gdkvisual_colormap_size, 0);
230
- rb_define_method(gdkVisual, "bits_per_rgb", gdkvisual_bits_per_rgb, 0);
231
- rb_define_method(gdkVisual, "red_mask", gdkvisual_red_mask, 0);
232
- rb_define_method(gdkVisual, "red_shift", gdkvisual_red_shift, 0);
233
- rb_define_method(gdkVisual, "red_prec", gdkvisual_red_prec, 0);
234
- rb_define_method(gdkVisual, "green_mask", gdkvisual_green_mask, 0);
235
- rb_define_method(gdkVisual, "green_shift", gdkvisual_green_shift, 0);
236
- rb_define_method(gdkVisual, "green_prec", gdkvisual_green_prec, 0);
237
- rb_define_method(gdkVisual, "blue_mask", gdkvisual_blue_mask, 0);
238
- rb_define_method(gdkVisual, "blue_shift", gdkvisual_blue_shift, 0);
239
- rb_define_method(gdkVisual, "blue_prec", gdkvisual_blue_prec, 0);
234
+ RG_DEF_METHOD(visual_type, 0);
235
+ RG_DEF_METHOD(depth, 0);
236
+ RG_DEF_METHOD(byte_order, 0);
237
+ RG_DEF_METHOD(colormap_size, 0);
238
+ RG_DEF_METHOD(bits_per_rgb, 0);
239
+ RG_DEF_METHOD(red_mask, 0);
240
+ RG_DEF_METHOD(red_shift, 0);
241
+ RG_DEF_METHOD(red_prec, 0);
242
+ RG_DEF_METHOD(green_mask, 0);
243
+ RG_DEF_METHOD(green_shift, 0);
244
+ RG_DEF_METHOD(green_prec, 0);
245
+ RG_DEF_METHOD(blue_mask, 0);
246
+ RG_DEF_METHOD(blue_shift, 0);
247
+ RG_DEF_METHOD(blue_prec, 0);
240
248
 
241
249
  /* GdkVisualType */
242
- G_DEF_CLASS(GDK_TYPE_VISUAL_TYPE, "Type", gdkVisual);
243
- G_DEF_CONSTANTS(gdkVisual, GDK_TYPE_VISUAL_TYPE, "GDK_VISUAL_");
250
+ G_DEF_CLASS(GDK_TYPE_VISUAL_TYPE, "Type", RG_TARGET_NAMESPACE);
251
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_VISUAL_TYPE, "GDK_VISUAL_");
244
252
 
245
253
  /* GdkByteOrder */
246
- G_DEF_CLASS(GDK_TYPE_BYTE_ORDER, "ByteOrder", gdkVisual);
247
- G_DEF_CONSTANTS(gdkVisual, GDK_TYPE_BYTE_ORDER, "GDK_");
254
+ G_DEF_CLASS(GDK_TYPE_BYTE_ORDER, "ByteOrder", RG_TARGET_NAMESPACE);
255
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_BYTE_ORDER, "GDK_");
248
256
  }