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,32 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbgtktextmark.c -
5
-
6
- $Author: ggc $
7
- $Date: 2007/07/13 16:30:53 $
8
-
9
- Copyright (C) 2002,2003 Masahiro Sakai
10
- ************************************************/
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2002,2003 Masahiro Sakai
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
 
24
+ #define RG_TARGET_NAMESPACE cTextMark
14
25
  #define _SELF(s) (GTK_TEXT_MARK(RVAL2GOBJ(s)))
15
26
 
16
27
  #if GTK_CHECK_VERSION(2,12,0)
17
28
  static VALUE
18
- initialize(VALUE self, VALUE name, VALUE left_gravity)
29
+ rg_initialize(VALUE self, VALUE name, VALUE left_gravity)
19
30
  {
20
31
  if (NIL_P(name))
21
32
  G_INITIALIZE(self, gtk_text_mark_new(NULL, RVAL2CBOOL(left_gravity)));
@@ -26,48 +37,40 @@ initialize(VALUE self, VALUE name, VALUE left_gravity)
26
37
  #endif
27
38
 
28
39
  static VALUE
29
- set_visible(VALUE self, VALUE setting)
40
+ rg_set_visible(VALUE self, VALUE setting)
30
41
  {
31
42
  gtk_text_mark_set_visible(_SELF(self), RVAL2CBOOL(setting));
32
43
  return setting;
33
44
  }
34
45
 
35
46
  static VALUE
36
- get_visible(VALUE self)
47
+ rg_visible_p(VALUE self)
37
48
  {
38
49
  return CBOOL2RVAL(gtk_text_mark_get_visible(_SELF(self)));
39
50
  }
40
51
 
41
- /* Defined as Properties:
42
- const gchar * gtk_text_mark_get_name (GtkTextMark *mark);
43
- */
44
-
45
52
  static VALUE
46
- get_deleted(VALUE self)
53
+ rg_deleted_p(VALUE self)
47
54
  {
48
55
  return CBOOL2RVAL(gtk_text_mark_get_deleted(_SELF(self)));
49
56
  }
50
57
 
51
58
  static VALUE
52
- get_buffer(VALUE self)
59
+ rg_buffer(VALUE self)
53
60
  {
54
61
  return GOBJ2RVAL(gtk_text_mark_get_buffer(_SELF(self)));
55
62
  }
56
63
 
57
- /* Defined as Properties:
58
- gboolean gtk_text_mark_get_left_gravity (GtkTextMark *mark);
59
- */
60
-
61
64
  void
62
- Init_gtk_textmark()
65
+ Init_gtk_textmark(VALUE mGtk)
63
66
  {
64
- VALUE gTextMark = G_DEF_CLASS(GTK_TYPE_TEXT_MARK, "TextMark", mGtk);
67
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_MARK, "TextMark", mGtk);
65
68
  #if GTK_CHECK_VERSION(2,12,0)
66
- rb_define_method(gTextMark, "initialize", initialize, 2);
69
+ RG_DEF_METHOD(initialize, 2);
67
70
  #endif
68
- rb_define_method(gTextMark, "set_visible", set_visible, 1);
69
- G_DEF_SETTER(gTextMark, "visible");
70
- rb_define_method(gTextMark, "visible?", get_visible, 0);
71
- rb_define_method(gTextMark, "deleted?", get_deleted, 0);
72
- rb_define_method(gTextMark, "buffer", get_buffer, 0);
71
+ RG_DEF_METHOD(set_visible, 1);
72
+ G_DEF_SETTER(RG_TARGET_NAMESPACE, "visible");
73
+ RG_DEF_METHOD_P(visible, 0);
74
+ RG_DEF_METHOD_P(deleted, 0);
75
+ RG_DEF_METHOD(buffer, 0);
73
76
  }
@@ -1,18 +1,30 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbgtktexttag.c -
5
-
6
- $Author: ggc $
7
- $Date: 2007/07/13 14:27:10 $
8
-
9
- Copyright (C) 2002,2003 Masahiro Sakai
10
- ************************************************/
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2002,2003 Masahiro Sakai
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
 
24
+ #define RG_TARGET_NAMESPACE cTextTag
25
+
14
26
  static VALUE
15
- initialize(int argc, VALUE *argv, VALUE self)
27
+ rg_initialize(int argc, VALUE *argv, VALUE self)
16
28
  {
17
29
  VALUE name;
18
30
  rb_scan_args(argc, argv, "01", &name);
@@ -21,20 +33,20 @@ initialize(int argc, VALUE *argv, VALUE self)
21
33
  }
22
34
 
23
35
  static VALUE
24
- get_priority(VALUE self)
36
+ rg_priority(VALUE self)
25
37
  {
26
38
  return INT2NUM(gtk_text_tag_get_priority(GTK_TEXT_TAG(RVAL2GOBJ(self))));
27
39
  }
28
40
 
29
41
  static VALUE
30
- set_priority(VALUE self, VALUE priority)
42
+ rg_set_priority(VALUE self, VALUE priority)
31
43
  {
32
44
  gtk_text_tag_set_priority(GTK_TEXT_TAG(RVAL2GOBJ(self)), NUM2INT(priority));
33
45
  return priority;
34
46
  }
35
47
 
36
48
  static VALUE
37
- event(VALUE self, VALUE event_object, VALUE event, VALUE iter)
49
+ rg_event(VALUE self, VALUE event_object, VALUE event, VALUE iter)
38
50
  {
39
51
  gboolean ret = gtk_text_tag_event(GTK_TEXT_TAG(RVAL2GOBJ(self)),
40
52
  RVAL2GOBJ(event_object),
@@ -44,16 +56,16 @@ event(VALUE self, VALUE event_object, VALUE event, VALUE iter)
44
56
  }
45
57
 
46
58
  void
47
- Init_gtk_texttag()
59
+ Init_gtk_texttag(VALUE mGtk)
48
60
  {
49
- VALUE gTextTag = G_DEF_CLASS(GTK_TYPE_TEXT_TAG, "TextTag", mGtk);
50
- rb_define_method(gTextTag, "initialize", initialize, -1);
51
- rb_define_method(gTextTag, "priority", get_priority, 0);
52
- rb_define_method(gTextTag, "set_priority", set_priority, 1);
53
- G_DEF_SETTER(gTextTag, "priority");
54
- rb_define_method(gTextTag, "event", event, 3);
61
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_TAG, "TextTag", mGtk);
62
+ RG_DEF_METHOD(initialize, -1);
63
+ RG_DEF_METHOD(priority, 0);
64
+ RG_DEF_METHOD(set_priority, 1);
65
+ G_DEF_SETTER(RG_TARGET_NAMESPACE, "priority");
66
+ RG_DEF_METHOD(event, 3);
55
67
 
56
68
  /* GtkWrapMode */
57
- G_DEF_CLASS(GTK_TYPE_WRAP_MODE, "WrapMode", gTextTag);
58
- G_DEF_CONSTANTS(gTextTag, GTK_TYPE_WRAP_MODE, "GTK_");
69
+ G_DEF_CLASS(GTK_TYPE_WRAP_MODE, "WrapMode", RG_TARGET_NAMESPACE);
70
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_WRAP_MODE, "GTK_");
59
71
  }
@@ -1,27 +1,39 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2002,2003 OGASAWARA, Takeshi
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
- rbgtktexttagtable.c -
5
-
6
- $Author: ggc $
7
- $Date: 2007/07/13 16:07:32 $
8
-
9
- Copyright (C) 2002,2003 OGASAWARA, Takeshi
10
- ************************************************/
11
22
  #include "global.h"
12
23
 
24
+ #define RG_TARGET_NAMESPACE cTextTagTable
13
25
  #define _SELF(self) (GTK_TEXT_TAG_TABLE(RVAL2GOBJ(self)))
14
26
  #define RVAL2TAG(t) (GTK_TEXT_TAG(RVAL2GOBJ(t)))
15
27
 
16
28
  static VALUE
17
- txt_tt_initialize(VALUE self)
29
+ rg_initialize(VALUE self)
18
30
  {
19
31
  G_INITIALIZE(self, gtk_text_tag_table_new());
20
32
  return Qnil;
21
33
  }
22
34
 
23
35
  static VALUE
24
- txt_tt_add(VALUE self, VALUE tag)
36
+ rg_add(VALUE self, VALUE tag)
25
37
  {
26
38
  G_CHILD_ADD(self, tag);
27
39
  gtk_text_tag_table_add(_SELF(self), RVAL2TAG(tag));
@@ -29,7 +41,7 @@ txt_tt_add(VALUE self, VALUE tag)
29
41
  }
30
42
 
31
43
  static VALUE
32
- txt_tt_remove(VALUE self, VALUE tag)
44
+ rg_remove(VALUE self, VALUE tag)
33
45
  {
34
46
  G_CHILD_REMOVE(self, tag);
35
47
  gtk_text_tag_table_remove(_SELF(self), RVAL2TAG(tag));
@@ -37,7 +49,7 @@ txt_tt_remove(VALUE self, VALUE tag)
37
49
  }
38
50
 
39
51
  static VALUE
40
- txt_tt_lookup(VALUE self, VALUE name)
52
+ rg_lookup(VALUE self, VALUE name)
41
53
  {
42
54
  VALUE ret = Qnil;
43
55
  GtkTextTag* tag = gtk_text_tag_table_lookup(_SELF(self), RVAL2CSTR(name));
@@ -55,7 +67,7 @@ txt_tt_foreach_func(GtkTextTag *tag, gpointer func)
55
67
  }
56
68
 
57
69
  static VALUE
58
- txt_tt_foreach(VALUE self)
70
+ rg_each(VALUE self)
59
71
  {
60
72
  volatile VALUE func = rb_block_proc();
61
73
  gtk_text_tag_table_foreach(_SELF(self),
@@ -65,22 +77,21 @@ txt_tt_foreach(VALUE self)
65
77
  }
66
78
 
67
79
  static VALUE
68
- txt_tt_get_size(VALUE self)
80
+ rg_size(VALUE self)
69
81
  {
70
82
  return INT2NUM(gtk_text_tag_table_get_size(_SELF(self)));
71
83
  }
72
84
 
73
- void
74
- Init_txt_tt()
85
+ void
86
+ Init_gtk_text_tag_table(VALUE mGtk)
75
87
  {
76
- VALUE gTextTagTable = G_DEF_CLASS(GTK_TYPE_TEXT_TAG_TABLE, "TextTagTable", mGtk);
88
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_TAG_TABLE, "TextTagTable", mGtk);
77
89
 
78
- rb_define_method(gTextTagTable, "initialize", txt_tt_initialize, 0);
79
- rb_define_method(gTextTagTable, "add", txt_tt_add, 1);
80
- rb_define_method(gTextTagTable, "remove", txt_tt_remove, 1);
81
- rb_define_method(gTextTagTable, "lookup", txt_tt_lookup, 1);
82
- rb_define_alias(gTextTagTable, "[]", "lookup");
83
- rb_define_method(gTextTagTable, "each", txt_tt_foreach, 0);
84
- rb_define_method(gTextTagTable, "size", txt_tt_get_size, 0);
90
+ RG_DEF_METHOD(initialize, 0);
91
+ RG_DEF_METHOD(add, 1);
92
+ RG_DEF_METHOD(remove, 1);
93
+ RG_DEF_METHOD(lookup, 1);
94
+ RG_DEF_ALIAS("[]", "lookup");
95
+ RG_DEF_METHOD(each, 0);
96
+ RG_DEF_METHOD(size, 0);
85
97
  }
86
-
@@ -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) 2002-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
+ */
3
21
 
4
- rbgtktextview.c -
5
-
6
- $Author $
7
- $Date: 2007/07/13 16:07:32 $
8
-
9
- Copyright (C) 2002-2005 Masao Mutoh
10
- ************************************************/
11
22
  #include "global.h"
12
23
 
24
+ #define RG_TARGET_NAMESPACE cTextView
13
25
  #define _SELF(self) (GTK_TEXT_VIEW(RVAL2GOBJ(self)))
14
26
  #define RVAL2BUFFER(b) (GTK_TEXT_BUFFER(RVAL2GOBJ(b)))
15
27
  #define RVAL2MARK(m) (GTK_TEXT_MARK(RVAL2GOBJ(m)))
@@ -19,7 +31,7 @@
19
31
  static ID id_buffer;
20
32
 
21
33
  static VALUE
22
- textview_initialize(int argc, VALUE *argv, VALUE self)
34
+ rg_initialize(int argc, VALUE *argv, VALUE self)
23
35
  {
24
36
  VALUE buffer;
25
37
  GtkWidget* widget;
@@ -55,7 +67,7 @@ textview_get_buffer(VALUE self)
55
67
  }
56
68
 
57
69
  static VALUE
58
- textview_scroll_to_mark(VALUE self, VALUE mark, VALUE within_margin, VALUE use_align, VALUE xalign, VALUE yalign)
70
+ rg_scroll_to_mark(VALUE self, VALUE mark, VALUE within_margin, VALUE use_align, VALUE xalign, VALUE yalign)
59
71
  {
60
72
  gtk_text_view_scroll_to_mark(_SELF(self), RVAL2MARK(mark),
61
73
  NUM2DBL(within_margin), RVAL2CBOOL(use_align),
@@ -64,7 +76,7 @@ textview_scroll_to_mark(VALUE self, VALUE mark, VALUE within_margin, VALUE use_a
64
76
  }
65
77
 
66
78
  static VALUE
67
- textview_scroll_to_iter(VALUE self, VALUE iter, VALUE within_margin, VALUE use_align, VALUE xalign, VALUE yalign)
79
+ rg_scroll_to_iter(VALUE self, VALUE iter, VALUE within_margin, VALUE use_align, VALUE xalign, VALUE yalign)
68
80
  {
69
81
  return CBOOL2RVAL(gtk_text_view_scroll_to_iter(_SELF(self), RVAL2ITR(iter),
70
82
  NUM2DBL(within_margin), RVAL2CBOOL(use_align),
@@ -72,26 +84,26 @@ textview_scroll_to_iter(VALUE self, VALUE iter, VALUE within_margin, VALUE use_a
72
84
  }
73
85
 
74
86
  static VALUE
75
- textview_scroll_mark_onscreen(VALUE self, VALUE mark)
87
+ rg_scroll_mark_onscreen(VALUE self, VALUE mark)
76
88
  {
77
89
  gtk_text_view_scroll_mark_onscreen(_SELF(self), RVAL2MARK(mark));
78
90
  return self;
79
91
  }
80
92
 
81
93
  static VALUE
82
- textview_move_mark_onscreen(VALUE self, VALUE mark)
94
+ rg_move_mark_onscreen(VALUE self, VALUE mark)
83
95
  {
84
96
  return CBOOL2RVAL(gtk_text_view_move_mark_onscreen(_SELF(self), RVAL2MARK(mark)));
85
97
  }
86
98
 
87
99
  static VALUE
88
- textview_place_cursor_onscreen(VALUE self)
100
+ rg_place_cursor_onscreen(VALUE self)
89
101
  {
90
102
  return CBOOL2RVAL(gtk_text_view_place_cursor_onscreen(_SELF(self)));
91
103
  }
92
104
 
93
105
  static VALUE
94
- textview_get_visible_rect(VALUE self)
106
+ rg_visible_rect(VALUE self)
95
107
  {
96
108
  GdkRectangle rect;
97
109
  gtk_text_view_get_visible_rect(_SELF(self), &rect);
@@ -99,7 +111,7 @@ textview_get_visible_rect(VALUE self)
99
111
  }
100
112
 
101
113
  static VALUE
102
- textview_get_iter_location(VALUE self, VALUE iter)
114
+ rg_get_iter_location(VALUE self, VALUE iter)
103
115
  {
104
116
  GdkRectangle rect;
105
117
  gtk_text_view_get_iter_location(_SELF(self), RVAL2ITR(iter), &rect);
@@ -107,7 +119,7 @@ textview_get_iter_location(VALUE self, VALUE iter)
107
119
  }
108
120
 
109
121
  static VALUE
110
- textview_get_line_at_y(VALUE self, VALUE y)
122
+ rg_get_line_at_y(VALUE self, VALUE y)
111
123
  {
112
124
  GtkTextIter target_iter;
113
125
  gint line_top;
@@ -116,7 +128,7 @@ textview_get_line_at_y(VALUE self, VALUE y)
116
128
  }
117
129
 
118
130
  static VALUE
119
- textview_get_line_yrange(VALUE self, VALUE iter)
131
+ rg_get_line_yrange(VALUE self, VALUE iter)
120
132
  {
121
133
  int y, height;
122
134
  gtk_text_view_get_line_yrange(_SELF(self), RVAL2ITR(iter), &y, &height);
@@ -125,7 +137,7 @@ textview_get_line_yrange(VALUE self, VALUE iter)
125
137
  }
126
138
 
127
139
  static VALUE
128
- textview_get_iter_at_location(VALUE self, VALUE x, VALUE y)
140
+ rg_get_iter_at_location(VALUE self, VALUE x, VALUE y)
129
141
  {
130
142
  GtkTextIter iter;
131
143
  gtk_text_view_get_iter_at_location(_SELF(self), &iter, NUM2INT(x), NUM2INT(y));
@@ -134,7 +146,7 @@ textview_get_iter_at_location(VALUE self, VALUE x, VALUE y)
134
146
 
135
147
  #if GTK_CHECK_VERSION(2,6,0)
136
148
  static VALUE
137
- textview_get_iter_at_position(VALUE self, VALUE x, VALUE y)
149
+ rg_get_iter_at_position(VALUE self, VALUE x, VALUE y)
138
150
  {
139
151
  GtkTextIter iter;
140
152
  gint trailing;
@@ -144,7 +156,7 @@ textview_get_iter_at_position(VALUE self, VALUE x, VALUE y)
144
156
  #endif
145
157
 
146
158
  static VALUE
147
- textview_buffer_to_window_coords(VALUE self, VALUE wintype, VALUE buffer_x, VALUE buffer_y)
159
+ rg_buffer_to_window_coords(VALUE self, VALUE wintype, VALUE buffer_x, VALUE buffer_y)
148
160
  {
149
161
  int window_x, window_y;
150
162
  gtk_text_view_buffer_to_window_coords(_SELF(self),
@@ -155,7 +167,7 @@ textview_buffer_to_window_coords(VALUE self, VALUE wintype, VALUE buffer_x, VALU
155
167
  }
156
168
 
157
169
  static VALUE
158
- textview_window_to_buffer_coords(VALUE self, VALUE wintype, VALUE window_x, VALUE window_y)
170
+ rg_window_to_buffer_coords(VALUE self, VALUE wintype, VALUE window_x, VALUE window_y)
159
171
  {
160
172
  int buffer_x, buffer_y;
161
173
  gtk_text_view_window_to_buffer_coords(_SELF(self),
@@ -166,7 +178,7 @@ textview_window_to_buffer_coords(VALUE self, VALUE wintype, VALUE window_x, VALU
166
178
  }
167
179
 
168
180
  static VALUE
169
- textview_get_window(VALUE self, VALUE wintype)
181
+ rg_get_window(VALUE self, VALUE wintype)
170
182
  {
171
183
  GdkWindow* win = NULL;
172
184
  win = gtk_text_view_get_window(_SELF(self),
@@ -175,14 +187,14 @@ textview_get_window(VALUE self, VALUE wintype)
175
187
  }
176
188
 
177
189
  static VALUE
178
- textview_get_window_type(VALUE self, VALUE gdkwin)
190
+ rg_get_window_type(VALUE self, VALUE gdkwin)
179
191
  {
180
192
  return GENUM2RVAL(gtk_text_view_get_window_type(_SELF(self), RVAL2GOBJ(gdkwin)),
181
193
  GTK_TYPE_TEXT_WINDOW_TYPE);
182
194
  }
183
195
 
184
196
  static VALUE
185
- textview_set_border_window_size(VALUE self, VALUE wintype, VALUE size)
197
+ rg_set_border_window_size(VALUE self, VALUE wintype, VALUE size)
186
198
  {
187
199
  gtk_text_view_set_border_window_size(_SELF(self),
188
200
  RVAL2GENUM(wintype, GTK_TYPE_TEXT_WINDOW_TYPE),
@@ -191,7 +203,7 @@ textview_set_border_window_size(VALUE self, VALUE wintype, VALUE size)
191
203
  }
192
204
 
193
205
  static VALUE
194
- textview_get_border_window_size(VALUE self, VALUE wintype)
206
+ rg_get_border_window_size(VALUE self, VALUE wintype)
195
207
  {
196
208
  return INT2NUM(gtk_text_view_get_border_window_size(
197
209
  _SELF(self),
@@ -199,43 +211,43 @@ textview_get_border_window_size(VALUE self, VALUE wintype)
199
211
  }
200
212
 
201
213
  static VALUE
202
- textview_forward_display_line(VALUE self, VALUE iter)
214
+ rg_forward_display_line(VALUE self, VALUE iter)
203
215
  {
204
216
  return CBOOL2RVAL(gtk_text_view_forward_display_line(_SELF(self), RVAL2ITR(iter)));
205
217
  }
206
218
 
207
219
  static VALUE
208
- textview_backward_display_line(VALUE self, VALUE iter)
220
+ rg_backward_display_line(VALUE self, VALUE iter)
209
221
  {
210
222
  return CBOOL2RVAL(gtk_text_view_backward_display_line(_SELF(self), RVAL2ITR(iter)));
211
223
  }
212
224
 
213
225
  static VALUE
214
- textview_forward_display_line_end(VALUE self, VALUE iter)
226
+ rg_forward_display_line_end(VALUE self, VALUE iter)
215
227
  {
216
228
  return CBOOL2RVAL(gtk_text_view_forward_display_line_end(_SELF(self), RVAL2ITR(iter)));
217
229
  }
218
230
 
219
231
  static VALUE
220
- textview_backward_display_line_start(VALUE self, VALUE iter)
232
+ rg_backward_display_line_start(VALUE self, VALUE iter)
221
233
  {
222
234
  return CBOOL2RVAL(gtk_text_view_backward_display_line_start(_SELF(self), RVAL2ITR(iter)));
223
235
  }
224
236
 
225
237
  static VALUE
226
- textview_starts_display_line(VALUE self, VALUE iter)
238
+ rg_starts_display_line(VALUE self, VALUE iter)
227
239
  {
228
240
  return CBOOL2RVAL(gtk_text_view_starts_display_line(_SELF(self), RVAL2ITR(iter)));
229
241
  }
230
242
 
231
243
  static VALUE
232
- textview_move_visually(VALUE self, VALUE iter, VALUE count)
244
+ rg_move_visually(VALUE self, VALUE iter, VALUE count)
233
245
  {
234
246
  return CBOOL2RVAL(gtk_text_view_move_visually(_SELF(self), RVAL2ITR(iter), NUM2INT(count)));
235
247
  }
236
248
 
237
249
  static VALUE
238
- textview_add_child_at_anchor(VALUE self, VALUE child, VALUE anchor)
250
+ rg_add_child_at_anchor(VALUE self, VALUE child, VALUE anchor)
239
251
  {
240
252
  G_CHILD_ADD(self, child);
241
253
  gtk_text_view_add_child_at_anchor(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child)),
@@ -244,7 +256,7 @@ textview_add_child_at_anchor(VALUE self, VALUE child, VALUE anchor)
244
256
  }
245
257
 
246
258
  static VALUE
247
- textview_add_child_in_window(VALUE self, VALUE child, VALUE which_window, VALUE xpos, VALUE ypos)
259
+ rg_add_child_in_window(VALUE self, VALUE child, VALUE which_window, VALUE xpos, VALUE ypos)
248
260
  {
249
261
  G_CHILD_ADD(self, child);
250
262
  gtk_text_view_add_child_in_window(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child)),
@@ -254,7 +266,7 @@ textview_add_child_in_window(VALUE self, VALUE child, VALUE which_window, VALUE
254
266
  }
255
267
 
256
268
  static VALUE
257
- textview_move_child(VALUE self, VALUE child, VALUE xpos, VALUE ypos)
269
+ rg_move_child(VALUE self, VALUE child, VALUE xpos, VALUE ypos)
258
270
  {
259
271
  G_CHILD_ADD(self, child);
260
272
  gtk_text_view_move_child(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child)),
@@ -263,56 +275,56 @@ textview_move_child(VALUE self, VALUE child, VALUE xpos, VALUE ypos)
263
275
  }
264
276
 
265
277
  static VALUE
266
- textview_get_default_attributes(VALUE self)
278
+ rg_default_attributes(VALUE self)
267
279
  {
268
280
  return BOXED2RVAL(gtk_text_view_get_default_attributes(_SELF(self)),
269
281
  GTK_TYPE_TEXT_ATTRIBUTES);
270
282
  }
271
283
 
272
284
  void
273
- Init_gtk_textview()
285
+ Init_gtk_textview(VALUE mGtk)
274
286
  {
275
- VALUE cTextView = G_DEF_CLASS(GTK_TYPE_TEXT_VIEW, "TextView", mGtk);
287
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_VIEW, "TextView", mGtk);
276
288
 
277
289
  id_buffer = rb_intern("buffer");
278
290
 
279
- rb_define_method(cTextView, "initialize", textview_initialize, -1);
280
- G_REPLACE_SET_PROPERTY(cTextView, "buffer", textview_set_buffer, 1);
281
- G_REPLACE_GET_PROPERTY(cTextView, "buffer", textview_get_buffer, 0);
282
- rb_define_method(cTextView, "scroll_to_mark", textview_scroll_to_mark, 5);
283
- rb_define_method(cTextView, "scroll_to_iter", textview_scroll_to_iter, 5);
284
- rb_define_method(cTextView, "scroll_mark_onscreen", textview_scroll_mark_onscreen, 1);
285
- rb_define_method(cTextView, "move_mark_onscreen", textview_move_mark_onscreen, 1);
286
- rb_define_method(cTextView, "place_cursor_onscreen", textview_place_cursor_onscreen, 0);
287
- rb_define_method(cTextView, "visible_rect", textview_get_visible_rect, 0);
288
- rb_define_method(cTextView, "get_iter_location", textview_get_iter_location, 1);
289
- rb_define_method(cTextView, "get_line_at_y", textview_get_line_at_y, 1);
290
- rb_define_method(cTextView, "get_line_yrange", textview_get_line_yrange, 1);
291
- rb_define_method(cTextView, "get_iter_at_location", textview_get_iter_at_location, 2);
291
+ RG_DEF_METHOD(initialize, -1);
292
+ G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "buffer", textview_set_buffer, 1);
293
+ G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "buffer", textview_get_buffer, 0);
294
+ RG_DEF_METHOD(scroll_to_mark, 5);
295
+ RG_DEF_METHOD(scroll_to_iter, 5);
296
+ RG_DEF_METHOD(scroll_mark_onscreen, 1);
297
+ RG_DEF_METHOD(move_mark_onscreen, 1);
298
+ RG_DEF_METHOD(place_cursor_onscreen, 0);
299
+ RG_DEF_METHOD(visible_rect, 0);
300
+ RG_DEF_METHOD(get_iter_location, 1);
301
+ RG_DEF_METHOD(get_line_at_y, 1);
302
+ RG_DEF_METHOD(get_line_yrange, 1);
303
+ RG_DEF_METHOD(get_iter_at_location, 2);
292
304
  #if GTK_CHECK_VERSION(2,6,0)
293
- rb_define_method(cTextView, "get_iter_at_position", textview_get_iter_at_position, 2);
305
+ RG_DEF_METHOD(get_iter_at_position, 2);
294
306
  #endif
295
- rb_define_method(cTextView, "buffer_to_window_coords", textview_buffer_to_window_coords, 3);
296
- rb_define_method(cTextView, "window_to_buffer_coords", textview_window_to_buffer_coords, 3);
297
- rb_define_method(cTextView, "get_window", textview_get_window, 1);
298
- rb_define_method(cTextView, "get_window_type", textview_get_window_type, 1);
299
- rb_define_method(cTextView, "set_border_window_size", textview_set_border_window_size, 2);
300
- G_DEF_SETTER(cTextView, "border_window_size");
301
- rb_define_method(cTextView, "get_border_window_size", textview_get_border_window_size, 1);
302
- rb_define_method(cTextView, "forward_display_line", textview_forward_display_line, 1);
303
- rb_define_method(cTextView, "backward_display_line", textview_backward_display_line, 1);
304
- rb_define_method(cTextView, "forward_display_line_end", textview_forward_display_line_end, 1);
305
- rb_define_method(cTextView, "backward_display_line_start", textview_backward_display_line_start, 1);
306
- rb_define_method(cTextView, "starts_display_line", textview_starts_display_line, 1);
307
- rb_define_method(cTextView, "move_visually", textview_move_visually, 2);
308
- rb_define_method(cTextView, "add_child_at_anchor", textview_add_child_at_anchor, 2);
309
- rb_define_method(cTextView, "add_child_in_window", textview_add_child_in_window, 4);
310
- rb_define_method(cTextView, "move_child", textview_move_child, 3);
311
- rb_define_method(cTextView, "default_attributes", textview_get_default_attributes, 0);
307
+ RG_DEF_METHOD(buffer_to_window_coords, 3);
308
+ RG_DEF_METHOD(window_to_buffer_coords, 3);
309
+ RG_DEF_METHOD(get_window, 1);
310
+ RG_DEF_METHOD(get_window_type, 1);
311
+ RG_DEF_METHOD(set_border_window_size, 2);
312
+ G_DEF_SETTER(RG_TARGET_NAMESPACE, "border_window_size");
313
+ RG_DEF_METHOD(get_border_window_size, 1);
314
+ RG_DEF_METHOD(forward_display_line, 1);
315
+ RG_DEF_METHOD(backward_display_line, 1);
316
+ RG_DEF_METHOD(forward_display_line_end, 1);
317
+ RG_DEF_METHOD(backward_display_line_start, 1);
318
+ RG_DEF_METHOD(starts_display_line, 1);
319
+ RG_DEF_METHOD(move_visually, 2);
320
+ RG_DEF_METHOD(add_child_at_anchor, 2);
321
+ RG_DEF_METHOD(add_child_in_window, 4);
322
+ RG_DEF_METHOD(move_child, 3);
323
+ RG_DEF_METHOD(default_attributes, 0);
312
324
 
313
325
  /* GtkTextWindowType */
314
- G_DEF_CLASS(GTK_TYPE_TEXT_WINDOW_TYPE, "WindowType", cTextView);
315
- G_DEF_CONSTANTS(cTextView, GTK_TYPE_TEXT_WINDOW_TYPE, "GTK_TEXT_");
316
-
317
- rb_define_const(cTextView, "PRIORITY_VALIDATE", INT2FIX(GTK_TEXT_VIEW_PRIORITY_VALIDATE));
326
+ G_DEF_CLASS(GTK_TYPE_TEXT_WINDOW_TYPE, "WindowType", RG_TARGET_NAMESPACE);
327
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_TEXT_WINDOW_TYPE, "GTK_TEXT_");
328
+
329
+ rb_define_const(RG_TARGET_NAMESPACE, "PRIORITY_VALIDATE", INT2FIX(GTK_TEXT_VIEW_PRIORITY_VALIDATE));
318
330
  }