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,14 +1,24 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbgdkdisplay.c -
5
-
6
- $Author: sakai $
7
- $Date: 2007/07/08 03:00:50 $
8
-
9
- Copyright (C) 2003-2006 Ruby-GNOME2 Project Team
10
- Copyright (C) 2003 Geoff Youngs
11
- ************************************************/
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2003-2006 Ruby-GNOME2 Project Team
5
+ * Copyright (C) 2003 Geoff Youngs
6
+ *
7
+ * This library is free software; you can redistribute it and/or
8
+ * modify it under the terms of the GNU Lesser General Public
9
+ * License as published by the Free Software Foundation; either
10
+ * version 2.1 of the License, or (at your option) any later version.
11
+ *
12
+ * This library is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ * Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public
18
+ * License along with this library; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20
+ * MA 02110-1301 USA
21
+ */
12
22
 
13
23
  #include "global.h"
14
24
  #ifdef HAVE_RB_CAIRO_H
@@ -16,24 +26,26 @@
16
26
  #endif
17
27
 
18
28
  #if GTK_CHECK_VERSION(2,2,0)
29
+
30
+ #define RG_TARGET_NAMESPACE cScreen
19
31
  #define _SELF(i) GDK_SCREEN(RVAL2GOBJ(i))
20
32
 
21
33
  static ID id_new;
22
34
 
23
35
  static VALUE
24
- gdkscreen_default(VALUE self)
36
+ rg_s_default(G_GNUC_UNUSED VALUE self)
25
37
  {
26
38
  return GOBJ2RVAL(gdk_screen_get_default());
27
39
  }
28
40
 
29
41
  static VALUE
30
- gdkscreen_get_default_colormap(VALUE self)
42
+ rg_default_colormap(VALUE self)
31
43
  {
32
44
  return GOBJ2RVAL(gdk_screen_get_default_colormap(_SELF(self)));
33
45
  }
34
46
 
35
47
  static VALUE
36
- gdkscreen_set_default_colormap(VALUE self, VALUE colormap)
48
+ rg_set_default_colormap(VALUE self, VALUE colormap)
37
49
  {
38
50
  gdk_screen_set_default_colormap(_SELF(self),
39
51
  GDK_COLORMAP(RVAL2GOBJ(colormap)));
@@ -41,38 +53,38 @@ gdkscreen_set_default_colormap(VALUE self, VALUE colormap)
41
53
  }
42
54
 
43
55
  static VALUE
44
- gdkscreen_get_system_colormap(VALUE self)
56
+ rg_system_colormap(VALUE self)
45
57
  {
46
58
  return GOBJ2RVAL(gdk_screen_get_system_colormap(_SELF(self)));
47
59
  }
48
60
 
49
61
  static VALUE
50
- gdkscreen_get_system_visual(VALUE self)
62
+ rg_system_visual(VALUE self)
51
63
  {
52
64
  return GOBJ2RVAL(gdk_screen_get_system_visual(_SELF(self)));
53
65
  }
54
66
 
55
67
  static VALUE
56
- gdkscreen_get_rgb_colormap(VALUE self)
68
+ rg_rgb_colormap(VALUE self)
57
69
  {
58
70
  return GOBJ2RVAL(gdk_screen_get_rgb_colormap(_SELF(self)));
59
71
  }
60
72
 
61
73
  static VALUE
62
- gdkscreen_get_rgb_visual(VALUE self)
74
+ rg_rgb_visual(VALUE self)
63
75
  {
64
76
  return GOBJ2RVAL(gdk_screen_get_rgb_visual(_SELF(self)));
65
77
  }
66
78
 
67
79
  #if GTK_CHECK_VERSION(2,8,0)
68
80
  static VALUE
69
- gdkscreen_get_rgba_colormap(VALUE self)
81
+ rg_rgba_colormap(VALUE self)
70
82
  {
71
83
  return GOBJ2RVAL(gdk_screen_get_rgba_colormap(_SELF(self)));
72
84
  }
73
85
 
74
86
  static VALUE
75
- gdkscreen_get_rgba_visual(VALUE self)
87
+ rg_rgba_visual(VALUE self)
76
88
  {
77
89
  return GOBJ2RVAL(gdk_screen_get_rgba_visual(_SELF(self)));
78
90
  }
@@ -80,64 +92,64 @@ gdkscreen_get_rgba_visual(VALUE self)
80
92
 
81
93
  #if GTK_CHECK_VERSION(2,10,0)
82
94
  static VALUE
83
- gdkscreen_is_composited(VALUE self)
95
+ rg_composited_p(VALUE self)
84
96
  {
85
97
  return CBOOL2RVAL(gdk_screen_is_composited(_SELF(self)));
86
98
  }
87
99
  #endif
88
100
 
89
101
  static VALUE
90
- gdkscreen_get_root_window(VALUE self)
102
+ rg_root_window(VALUE self)
91
103
  {
92
104
  return GOBJ2RVAL(gdk_screen_get_root_window(_SELF(self)));
93
105
  }
94
106
 
95
107
  static VALUE
96
- gdkscreen_get_display(VALUE self)
108
+ rg_display(VALUE self)
97
109
  {
98
110
  return GOBJ2RVAL(gdk_screen_get_display(_SELF(self)));
99
111
  }
100
112
 
101
113
  static VALUE
102
- gdkscreen_number(VALUE self)
114
+ rg_number(VALUE self)
103
115
  {
104
116
  return INT2NUM(gdk_screen_get_number(_SELF(self)));
105
117
  }
106
118
  static VALUE
107
- gdkscreen_width(VALUE self)
119
+ rg_width(VALUE self)
108
120
  {
109
121
  return INT2NUM(gdk_screen_get_width(_SELF(self)));
110
122
  }
111
123
  static VALUE
112
- gdkscreen_height(VALUE self)
124
+ rg_height(VALUE self)
113
125
  {
114
126
  return INT2NUM(gdk_screen_get_height(_SELF(self)));
115
127
  }
116
128
  static VALUE
117
- gdkscreen_width_mm(VALUE self)
129
+ rg_width_mm(VALUE self)
118
130
  {
119
131
  return INT2NUM(gdk_screen_get_width_mm(_SELF(self)));
120
132
  }
121
133
  static VALUE
122
- gdkscreen_height_mm(VALUE self)
134
+ rg_height_mm(VALUE self)
123
135
  {
124
136
  return INT2NUM(gdk_screen_get_height_mm(_SELF(self)));
125
137
  }
126
138
 
127
139
  static VALUE
128
- gdkscreen_list_visuals(VALUE self)
140
+ rg_visuals(VALUE self)
129
141
  {
130
142
  return GLIST2ARYF(gdk_screen_list_visuals(_SELF(self)));
131
143
  }
132
144
 
133
145
  static VALUE
134
- gdkscreen_get_toplevel_windows(VALUE self)
146
+ rg_toplevel_windows(VALUE self)
135
147
  {
136
148
  return GLIST2ARYF(gdk_screen_get_toplevel_windows(_SELF(self)));
137
149
  }
138
150
 
139
151
  static VALUE
140
- gdkscreen_make_display_name(VALUE self)
152
+ rg_display_name(VALUE self)
141
153
  {
142
154
  gchar* name = gdk_screen_make_display_name(_SELF(self));
143
155
  VALUE ret = CSTR2RVAL(name);
@@ -146,13 +158,13 @@ gdkscreen_make_display_name(VALUE self)
146
158
  }
147
159
 
148
160
  static VALUE
149
- gdkscreen_n_monitors(VALUE self)
161
+ rg_n_monitors(VALUE self)
150
162
  {
151
163
  return INT2NUM(gdk_screen_get_n_monitors(_SELF(self)));
152
164
  }
153
165
 
154
166
  static VALUE
155
- gdkscreen_monitor_geometry(VALUE self, VALUE num)
167
+ rg_monitor_geometry(VALUE self, VALUE num)
156
168
  {
157
169
  GdkRectangle rect;
158
170
  gdk_screen_get_monitor_geometry(_SELF(self), NUM2INT(num), &rect);
@@ -160,7 +172,7 @@ gdkscreen_monitor_geometry(VALUE self, VALUE num)
160
172
  }
161
173
 
162
174
  static VALUE
163
- gdkscreen_get_monitor(int argc, VALUE *argv, VALUE self)
175
+ rg_get_monitor(int argc, VALUE *argv, VALUE self)
164
176
  {
165
177
  VALUE arg1, arg2;
166
178
  VALUE ret;
@@ -179,7 +191,7 @@ gdkscreen_get_monitor(int argc, VALUE *argv, VALUE self)
179
191
  }
180
192
 
181
193
  static VALUE
182
- gdkscreen_broadcast_client_message(VALUE self, VALUE event)
194
+ rg_broadcast_client_message(VALUE self, VALUE event)
183
195
  {
184
196
  gdk_screen_broadcast_client_message(_SELF(self), RVAL2GEV(event));
185
197
  return self;
@@ -189,11 +201,11 @@ gdkscreen_broadcast_client_message(VALUE self, VALUE event)
189
201
  type: String, Integer, Gdk::Color.
190
202
  */
191
203
  static VALUE
192
- gdkscreen_get_setting(int argc, VALUE *argv, VALUE self)
204
+ rg_get_setting(int argc, VALUE *argv, VALUE self)
193
205
  {
194
206
  VALUE name, type;
195
207
  GType gtype;
196
- GValue val = {0,};
208
+ GValue val = G_VALUE_INIT;
197
209
  gboolean ret;
198
210
  VALUE value;
199
211
 
@@ -227,20 +239,14 @@ gdkscreen_set_font_options(VALUE self, VALUE options)
227
239
  }
228
240
  #endif
229
241
 
230
- /* Defined as properties
231
- void gdk_screen_set_font_options (GdkScreen *screen,
232
- const cairo_font_options_t *options);
233
- gdouble gdk_screen_get_resolution (GdkScreen *screen);
234
- */
235
-
236
242
  static VALUE
237
- gdkscreen_get_active_window(VALUE self)
243
+ rg_active_window(VALUE self)
238
244
  {
239
245
  return GOBJ2RVAL(gdk_screen_get_active_window(_SELF(self)));
240
246
  }
241
247
 
242
248
  static VALUE
243
- gdkscreen_get_window_stack(VALUE self)
249
+ rg_window_stack(VALUE self)
244
250
  {
245
251
  GList* list = gdk_screen_get_window_stack(_SELF(self));
246
252
  VALUE ary = rb_ary_new();
@@ -264,7 +270,7 @@ child_setup(gpointer func)
264
270
  }
265
271
 
266
272
  static VALUE
267
- gdkscreen_spawn_on_screen(VALUE self, VALUE working_directory, VALUE argv, VALUE envp, VALUE flags)
273
+ rg_spawn_on_screen(VALUE self, VALUE working_directory, VALUE argv, VALUE envp, VALUE flags)
268
274
  {
269
275
  GError *err = NULL;
270
276
  gboolean ret;
@@ -279,7 +285,7 @@ gdkscreen_spawn_on_screen(VALUE self, VALUE working_directory, VALUE argv, VALUE
279
285
  }
280
286
 
281
287
  gargv = (gchar **)RVAL2STRV(argv);
282
- genvp = (gchar **)RVAL2STRV(envp);
288
+ genvp = (gchar **)RVAL2STRV_ACCEPT_NIL(envp);
283
289
  ret = gdk_spawn_on_screen(_SELF(self),
284
290
  NIL_P(working_directory) ? NULL : RVAL2CSTR(working_directory),
285
291
  gargv, genvp, NUM2INT(flags),
@@ -289,12 +295,12 @@ gdkscreen_spawn_on_screen(VALUE self, VALUE working_directory, VALUE argv, VALUE
289
295
  g_free(genvp);
290
296
  if (!ret)
291
297
  RAISE_GERROR(err);
292
-
298
+
293
299
  return INT2NUM(child_pid);
294
300
  }
295
301
 
296
302
  static VALUE
297
- gdkscreen_spawn_on_screen_with_pipes(VALUE self, VALUE working_directory, VALUE argv, VALUE envp, VALUE flags)
303
+ rg_spawn_on_screen_with_pipes(VALUE self, VALUE working_directory, VALUE argv, VALUE envp, VALUE flags)
298
304
  {
299
305
  GError *err = NULL;
300
306
  gboolean ret;
@@ -310,7 +316,7 @@ gdkscreen_spawn_on_screen_with_pipes(VALUE self, VALUE working_directory, VALUE
310
316
  }
311
317
 
312
318
  gargv = (gchar **)RVAL2STRV(argv);
313
- genvp = (gchar **)RVAL2STRV(envp);
319
+ genvp = (gchar **)RVAL2STRV_ACCEPT_NIL(envp);
314
320
  ret = gdk_spawn_on_screen_with_pipes(_SELF(self),
315
321
  NIL_P(working_directory) ? NULL : RVAL2CSTR(working_directory),
316
322
  gargv, genvp, NUM2INT(flags),
@@ -322,7 +328,7 @@ gdkscreen_spawn_on_screen_with_pipes(VALUE self, VALUE working_directory, VALUE
322
328
  g_free(genvp);
323
329
  if (!ret)
324
330
  RAISE_GERROR(err);
325
-
331
+
326
332
  return rb_ary_new3(4, INT2NUM(child_pid),
327
333
  rb_funcall(rb_cIO, id_new, 1, INT2NUM(standard_input)),
328
334
  rb_funcall(rb_cIO, id_new, 1, INT2NUM(standard_output)),
@@ -330,14 +336,14 @@ gdkscreen_spawn_on_screen_with_pipes(VALUE self, VALUE working_directory, VALUE
330
336
  }
331
337
 
332
338
  static VALUE
333
- gdkscreen_spawn_command_line_on_screen(VALUE self, VALUE command_line)
339
+ rg_spawn_command_line_on_screen(G_GNUC_UNUSED VALUE self, VALUE command_line)
334
340
  {
335
341
  GError *err = NULL;
336
342
  VALUE ret;
337
343
 
338
344
  ret = CBOOL2RVAL(g_spawn_command_line_async(RVAL2CSTR(command_line), &err));
339
345
  if (!ret) RAISE_GERROR(err);
340
-
346
+
341
347
  return ret;
342
348
  }
343
349
  #endif
@@ -346,24 +352,24 @@ gdkscreen_spawn_command_line_on_screen(VALUE self, VALUE command_line)
346
352
  #ifdef GDK_WINDOWING_X11
347
353
  #include <gdk/gdkx.h>
348
354
  static VALUE
349
- gdkscreen_xnumber(VALUE self)
355
+ rg_xnumber(VALUE self)
350
356
  {
351
357
  return INT2NUM(GDK_SCREEN_XNUMBER(_SELF(self)));
352
358
  }
353
359
  static VALUE
354
- gdkscreen_supports_net_wm_hint(VALUE self, VALUE property)
360
+ rg_supports_net_wm_hint_p(VALUE self, VALUE property)
355
361
  {
356
362
  return CBOOL2RVAL(gdk_x11_screen_supports_net_wm_hint(_SELF(self),
357
363
  RVAL2ATOM(property)));
358
364
  }
359
365
 
360
366
  static VALUE
361
- gdkscreen_get_window_manager_name(VALUE self)
367
+ rg_window_manager_name(VALUE self)
362
368
  {
363
369
  return CSTR2RVAL(gdk_x11_screen_get_window_manager_name(_SELF(self)));
364
370
  }
365
371
  static VALUE
366
- gdkscreen_get_screen_number(VALUE self)
372
+ rg_screen_number(VALUE self)
367
373
  {
368
374
  return INT2NUM(gdk_x11_screen_get_screen_number(_SELF(self)));
369
375
  }
@@ -372,67 +378,67 @@ gdkscreen_get_screen_number(VALUE self)
372
378
  #endif
373
379
 
374
380
  void
375
- Init_gtk_gdk_screen()
381
+ Init_gtk_gdk_screen(VALUE mGdk)
376
382
  {
377
383
  #if GTK_CHECK_VERSION(2,2,0)
378
- VALUE gdkScreen = G_DEF_CLASS(GDK_TYPE_SCREEN, "Screen", mGdk);
384
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_SCREEN, "Screen", mGdk);
379
385
 
380
386
  id_new = rb_intern("new");
381
387
 
382
- rb_define_singleton_method(gdkScreen, "default", gdkscreen_default, 0);
383
- rb_define_method(gdkScreen, "default_colormap", gdkscreen_get_default_colormap, 0);
384
- rb_define_method(gdkScreen, "set_default_colormap", gdkscreen_set_default_colormap, 1);
385
- G_DEF_SETTER(gdkScreen, "default_colormap");
386
- rb_define_method(gdkScreen, "system_colormap", gdkscreen_get_system_colormap, 0);
387
- rb_define_method(gdkScreen, "system_visual", gdkscreen_get_system_visual, 0);
388
- rb_define_method(gdkScreen, "rgb_colormap", gdkscreen_get_rgb_colormap, 0);
389
- rb_define_method(gdkScreen, "rgb_visual", gdkscreen_get_rgb_visual, 0);
388
+ RG_DEF_SMETHOD(default, 0);
389
+ RG_DEF_METHOD(default_colormap, 0);
390
+ RG_DEF_METHOD(set_default_colormap, 1);
391
+ G_DEF_SETTER(RG_TARGET_NAMESPACE, "default_colormap");
392
+ RG_DEF_METHOD(system_colormap, 0);
393
+ RG_DEF_METHOD(system_visual, 0);
394
+ RG_DEF_METHOD(rgb_colormap, 0);
395
+ RG_DEF_METHOD(rgb_visual, 0);
390
396
  #if GTK_CHECK_VERSION(2,8,0)
391
- rb_define_method(gdkScreen, "rgba_colormap", gdkscreen_get_rgba_colormap, 0);
392
- rb_define_method(gdkScreen, "rgba_visual", gdkscreen_get_rgba_visual, 0);
397
+ RG_DEF_METHOD(rgba_colormap, 0);
398
+ RG_DEF_METHOD(rgba_visual, 0);
393
399
  #endif
394
400
  #if GTK_CHECK_VERSION(2,10,0)
395
- rb_define_method(gdkScreen, "composited?", gdkscreen_is_composited, 0);
401
+ RG_DEF_METHOD_P(composited, 0);
396
402
  #endif
397
- rb_define_method(gdkScreen, "root_window", gdkscreen_get_root_window, 0);
398
- rb_define_method(gdkScreen, "display", gdkscreen_get_display, 0);
399
- rb_define_method(gdkScreen, "number", gdkscreen_number, 0);
400
- rb_define_method(gdkScreen, "width", gdkscreen_width, 0);
401
- rb_define_method(gdkScreen, "height", gdkscreen_height, 0);
402
- rb_define_method(gdkScreen, "width_mm", gdkscreen_width_mm, 0);
403
- rb_define_method(gdkScreen, "height_mm", gdkscreen_height_mm, 0);
404
- rb_define_method(gdkScreen, "visuals", gdkscreen_list_visuals, 0);
405
- rb_define_method(gdkScreen, "toplevel_windows", gdkscreen_get_toplevel_windows, 0);
406
- rb_define_method(gdkScreen, "display_name", gdkscreen_make_display_name, 0);
407
- rb_define_method(gdkScreen, "n_monitors", gdkscreen_n_monitors, 0);
408
- rb_define_method(gdkScreen, "monitor_geometry", gdkscreen_monitor_geometry, 1);
409
- rb_define_method(gdkScreen, "get_monitor", gdkscreen_get_monitor, -1);
410
- rb_define_method(gdkScreen, "broadcast_client_message", gdkscreen_broadcast_client_message, 1);
411
- rb_define_method(gdkScreen, "get_setting", gdkscreen_get_setting, -1);
403
+ RG_DEF_METHOD(root_window, 0);
404
+ RG_DEF_METHOD(display, 0);
405
+ RG_DEF_METHOD(number, 0);
406
+ RG_DEF_METHOD(width, 0);
407
+ RG_DEF_METHOD(height, 0);
408
+ RG_DEF_METHOD(width_mm, 0);
409
+ RG_DEF_METHOD(height_mm, 0);
410
+ RG_DEF_METHOD(visuals, 0);
411
+ RG_DEF_METHOD(toplevel_windows, 0);
412
+ RG_DEF_METHOD(display_name, 0);
413
+ RG_DEF_METHOD(n_monitors, 0);
414
+ RG_DEF_METHOD(monitor_geometry, 1);
415
+ RG_DEF_METHOD(get_monitor, -1);
416
+ RG_DEF_METHOD(broadcast_client_message, 1);
417
+ RG_DEF_METHOD(get_setting, -1);
412
418
  #if GTK_CHECK_VERSION(2,10,0)
413
419
  #ifdef HAVE_RB_CAIRO_H
414
- G_REPLACE_GET_PROPERTY(gdkScreen, "font_options", gdkscreen_get_font_options, 0);
415
- G_REPLACE_SET_PROPERTY(gdkScreen, "font_options", gdkscreen_set_font_options, 1);
420
+ G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "font_options", gdkscreen_get_font_options, 0);
421
+ G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "font_options", gdkscreen_set_font_options, 1);
416
422
  #endif
417
- rb_define_method(gdkScreen, "active_window", gdkscreen_get_active_window, 0);
418
- rb_define_method(gdkScreen, "window_stack", gdkscreen_get_window_stack, 0);
423
+ RG_DEF_METHOD(active_window, 0);
424
+ RG_DEF_METHOD(window_stack, 0);
419
425
  #endif
420
426
 
421
427
  #if GTK_CHECK_VERSION(2,4,0)
422
- rb_define_method(gdkScreen, "spawn_on_screen", gdkscreen_spawn_on_screen, 4);
423
- rb_define_method(gdkScreen, "spawn_on_screen_with_pipes", gdkscreen_spawn_on_screen_with_pipes, 4);
424
- rb_define_method(gdkScreen, "spawn_command_line_on_screen", gdkscreen_spawn_command_line_on_screen, 1);
428
+ RG_DEF_METHOD(spawn_on_screen, 4);
429
+ RG_DEF_METHOD(spawn_on_screen_with_pipes, 4);
430
+ RG_DEF_METHOD(spawn_command_line_on_screen, 1);
425
431
  #endif
426
432
 
427
433
  #ifdef GDK_WINDOWING_X11
428
- rb_define_method(gdkScreen, "xnumber", gdkscreen_xnumber, 0);
429
- rb_define_method(gdkScreen, "supports_net_wm_hint?", gdkscreen_supports_net_wm_hint, 0);
430
- rb_define_method(gdkScreen, "window_manager_name", gdkscreen_get_window_manager_name, 0);
431
- rb_define_method(gdkScreen, "screen_number", gdkscreen_get_screen_number, 0);
434
+ RG_DEF_METHOD(xnumber, 0);
435
+ RG_DEF_METHOD_P(supports_net_wm_hint, 0);
436
+ RG_DEF_METHOD(window_manager_name, 0);
437
+ RG_DEF_METHOD(screen_number, 0);
432
438
  #endif
433
439
 
434
- #ifdef GDK_WINDOWING_X11
440
+ #ifdef GDK_WINDOWING_X11
435
441
  G_DEF_CLASS3("GdkScreenX11", "ScreenX11", mGdk);
436
- #endif
442
+ #endif
437
443
  #endif
438
444
  }