gtk3 0.0.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (425) hide show
  1. data/Rakefile +32 -0
  2. data/ext/gtk3/conversions.c +34 -0
  3. data/ext/gtk3/depend +11 -0
  4. data/ext/gtk3/extconf.rb +108 -0
  5. data/ext/gtk3/gtk3.def +10 -0
  6. data/ext/gtk3/init.c +38 -0
  7. data/ext/gtk3/rbgdkdisplay.c +39 -0
  8. data/ext/gtk3/rbgdkdragcontext.c +108 -0
  9. data/ext/gtk3/rbgdkevent.c +38 -0
  10. data/ext/gtk3/rbgdkscreen.c +61 -0
  11. data/ext/gtk3/rbgtk.c +625 -0
  12. data/ext/gtk3/rbgtk3.h +57 -0
  13. data/ext/gtk3/rbgtk3conversions.h +347 -0
  14. data/ext/gtk3/rbgtk3private.h +282 -0
  15. data/ext/gtk3/rbgtk3util.c +67 -0
  16. data/ext/gtk3/rbgtk3util.h +32 -0
  17. data/ext/gtk3/rbgtkaboutdialog.c +117 -0
  18. data/ext/gtk3/rbgtkaccelerator.c +78 -0
  19. data/ext/gtk3/rbgtkaccelgroup.c +199 -0
  20. data/ext/gtk3/rbgtkaccelgroupentry.c +93 -0
  21. data/ext/gtk3/rbgtkaccelkey.c +119 -0
  22. data/ext/gtk3/rbgtkaccellabel.c +55 -0
  23. data/ext/gtk3/rbgtkaccelmap.c +135 -0
  24. data/ext/gtk3/rbgtkaccessible.c +56 -0
  25. data/ext/gtk3/rbgtkaction.c +205 -0
  26. data/ext/gtk3/rbgtkactiongroup.c +466 -0
  27. data/ext/gtk3/rbgtkactivatable.c +30 -0
  28. data/ext/gtk3/rbgtkadjustment.c +98 -0
  29. data/ext/gtk3/rbgtkalignment.c +75 -0
  30. data/ext/gtk3/rbgtkallocation.c +166 -0
  31. data/ext/gtk3/rbgtkappchooser.c +47 -0
  32. data/ext/gtk3/rbgtkappchooserbutton.c +70 -0
  33. data/ext/gtk3/rbgtkappchooserdialog.c +68 -0
  34. data/ext/gtk3/rbgtkappchooserwidget.c +40 -0
  35. data/ext/gtk3/rbgtkapplication.c +69 -0
  36. data/ext/gtk3/rbgtkarrow.c +56 -0
  37. data/ext/gtk3/rbgtkaspectframe.c +56 -0
  38. data/ext/gtk3/rbgtkassistant.c +218 -0
  39. data/ext/gtk3/rbgtkbin.c +42 -0
  40. data/ext/gtk3/rbgtkbindingset.c +164 -0
  41. data/ext/gtk3/rbgtkborder.c +119 -0
  42. data/ext/gtk3/rbgtkbox.c +146 -0
  43. data/ext/gtk3/rbgtkbuildable.c +96 -0
  44. data/ext/gtk3/rbgtkbuilder.c +166 -0
  45. data/ext/gtk3/rbgtkbutton.c +93 -0
  46. data/ext/gtk3/rbgtkbuttonbox.c +87 -0
  47. data/ext/gtk3/rbgtkcalendar.c +118 -0
  48. data/ext/gtk3/rbgtkcelleditable.c +57 -0
  49. data/ext/gtk3/rbgtkcelllayout.c +144 -0
  50. data/ext/gtk3/rbgtkcellrenderer.c +116 -0
  51. data/ext/gtk3/rbgtkcellrendereraccel.c +41 -0
  52. data/ext/gtk3/rbgtkcellrenderercombo.c +38 -0
  53. data/ext/gtk3/rbgtkcellrendererpixbuf.c +41 -0
  54. data/ext/gtk3/rbgtkcellrendererprogress.c +38 -0
  55. data/ext/gtk3/rbgtkcellrendererspin.c +39 -0
  56. data/ext/gtk3/rbgtkcellrendererspinner.c +38 -0
  57. data/ext/gtk3/rbgtkcellrenderertext.c +48 -0
  58. data/ext/gtk3/rbgtkcellrenderertoggle.c +39 -0
  59. data/ext/gtk3/rbgtkcellview.c +109 -0
  60. data/ext/gtk3/rbgtkcheckbutton.c +64 -0
  61. data/ext/gtk3/rbgtkcheckmenuitem.c +64 -0
  62. data/ext/gtk3/rbgtkclipboard.c +389 -0
  63. data/ext/gtk3/rbgtkcolorbutton.c +49 -0
  64. data/ext/gtk3/rbgtkcolorselection.c +219 -0
  65. data/ext/gtk3/rbgtkcolorselectiondialog.c +56 -0
  66. data/ext/gtk3/rbgtkcombobox.c +147 -0
  67. data/ext/gtk3/rbgtkcomboboxtext.c +138 -0
  68. data/ext/gtk3/rbgtkconst.c +79 -0
  69. data/ext/gtk3/rbgtkcontainer.c +784 -0
  70. data/ext/gtk3/rbgtkcssprovider.c +110 -0
  71. data/ext/gtk3/rbgtkdialog.c +186 -0
  72. data/ext/gtk3/rbgtkdrag.c +93 -0
  73. data/ext/gtk3/rbgtkdrawingarea.c +42 -0
  74. data/ext/gtk3/rbgtkeditable.c +149 -0
  75. data/ext/gtk3/rbgtkentry.c +198 -0
  76. data/ext/gtk3/rbgtkentrybuffer.c +87 -0
  77. data/ext/gtk3/rbgtkentrycompletion.c +122 -0
  78. data/ext/gtk3/rbgtkeventbox.c +42 -0
  79. data/ext/gtk3/rbgtkexpander.c +49 -0
  80. data/ext/gtk3/rbgtkfilechooser.c +384 -0
  81. data/ext/gtk3/rbgtkfilechooserbutton.c +50 -0
  82. data/ext/gtk3/rbgtkfilechooserdialog.c +62 -0
  83. data/ext/gtk3/rbgtkfilechooserwidget.c +40 -0
  84. data/ext/gtk3/rbgtkfilefilter.c +128 -0
  85. data/ext/gtk3/rbgtkfilesystemerror.c +48 -0
  86. data/ext/gtk3/rbgtkfixed.c +61 -0
  87. data/ext/gtk3/rbgtkfontbutton.c +49 -0
  88. data/ext/gtk3/rbgtkfontchooser.c +78 -0
  89. data/ext/gtk3/rbgtkfontchooserdialog.c +56 -0
  90. data/ext/gtk3/rbgtkfontchooserwidget.c +45 -0
  91. data/ext/gtk3/rbgtkframe.c +69 -0
  92. data/ext/gtk3/rbgtkgrid.c +105 -0
  93. data/ext/gtk3/rbgtkhandlebox.c +45 -0
  94. data/ext/gtk3/rbgtkhsv.c +102 -0
  95. data/ext/gtk3/rbgtkiconfactory.c +85 -0
  96. data/ext/gtk3/rbgtkiconinfo.c +115 -0
  97. data/ext/gtk3/rbgtkiconset.c +84 -0
  98. data/ext/gtk3/rbgtkiconsize.c +91 -0
  99. data/ext/gtk3/rbgtkiconsource.c +184 -0
  100. data/ext/gtk3/rbgtkicontheme.c +268 -0
  101. data/ext/gtk3/rbgtkiconview.c +270 -0
  102. data/ext/gtk3/rbgtkimage.c +96 -0
  103. data/ext/gtk3/rbgtkimagemenuitem.c +67 -0
  104. data/ext/gtk3/rbgtkimcontext.c +133 -0
  105. data/ext/gtk3/rbgtkimcontextsimple.c +69 -0
  106. data/ext/gtk3/rbgtkimmulticontext.c +48 -0
  107. data/ext/gtk3/rbgtkinfobar.c +121 -0
  108. data/ext/gtk3/rbgtkinvisible.c +49 -0
  109. data/ext/gtk3/rbgtklabel.c +139 -0
  110. data/ext/gtk3/rbgtklayout.c +93 -0
  111. data/ext/gtk3/rbgtklinkbutton.c +55 -0
  112. data/ext/gtk3/rbgtkliststore.c +408 -0
  113. data/ext/gtk3/rbgtklockbutton.c +50 -0
  114. data/ext/gtk3/rbgtkmenu.c +168 -0
  115. data/ext/gtk3/rbgtkmenubar.c +43 -0
  116. data/ext/gtk3/rbgtkmenuitem.c +95 -0
  117. data/ext/gtk3/rbgtkmenushell.c +106 -0
  118. data/ext/gtk3/rbgtkmenutoolbutton.c +81 -0
  119. data/ext/gtk3/rbgtkmessagedialog.c +74 -0
  120. data/ext/gtk3/rbgtkmisc.c +70 -0
  121. data/ext/gtk3/rbgtknotebook.c +383 -0
  122. data/ext/gtk3/rbgtknumerableicon.c +50 -0
  123. data/ext/gtk3/rbgtkorientable.c +27 -0
  124. data/ext/gtk3/rbgtkoverlay.c +53 -0
  125. data/ext/gtk3/rbgtkpagesetup.c +195 -0
  126. data/ext/gtk3/rbgtkpagesetupunixdialog.c +94 -0
  127. data/ext/gtk3/rbgtkpaned.c +114 -0
  128. data/ext/gtk3/rbgtkpapersize.c +179 -0
  129. data/ext/gtk3/rbgtkplug.c +85 -0
  130. data/ext/gtk3/rbgtkprintcontext.c +125 -0
  131. data/ext/gtk3/rbgtkprinter.c +155 -0
  132. data/ext/gtk3/rbgtkprintjob.c +148 -0
  133. data/ext/gtk3/rbgtkprintoperation.c +149 -0
  134. data/ext/gtk3/rbgtkprintoperationpreview.c +59 -0
  135. data/ext/gtk3/rbgtkprintsettings.c +807 -0
  136. data/ext/gtk3/rbgtkprintunixdialog.c +90 -0
  137. data/ext/gtk3/rbgtkprogressbar.c +72 -0
  138. data/ext/gtk3/rbgtkradioaction.c +122 -0
  139. data/ext/gtk3/rbgtkradiobutton.c +89 -0
  140. data/ext/gtk3/rbgtkradiomenuitem.c +147 -0
  141. data/ext/gtk3/rbgtkradiotoolbutton.c +131 -0
  142. data/ext/gtk3/rbgtkrange.c +68 -0
  143. data/ext/gtk3/rbgtkrecentaction.c +64 -0
  144. data/ext/gtk3/rbgtkrecentchooser.c +198 -0
  145. data/ext/gtk3/rbgtkrecentchooserdialog.c +66 -0
  146. data/ext/gtk3/rbgtkrecentchoosermenu.c +50 -0
  147. data/ext/gtk3/rbgtkrecentchooserwidget.c +48 -0
  148. data/ext/gtk3/rbgtkrecentdata.c +187 -0
  149. data/ext/gtk3/rbgtkrecentfilter.c +169 -0
  150. data/ext/gtk3/rbgtkrecentfilterinfo.c +200 -0
  151. data/ext/gtk3/rbgtkrecentinfo.c +213 -0
  152. data/ext/gtk3/rbgtkrecentmanager.c +134 -0
  153. data/ext/gtk3/rbgtkscale.c +97 -0
  154. data/ext/gtk3/rbgtkscalebutton.c +84 -0
  155. data/ext/gtk3/rbgtkscrollable.c +31 -0
  156. data/ext/gtk3/rbgtkscrollbar.c +52 -0
  157. data/ext/gtk3/rbgtkscrolledwindow.c +122 -0
  158. data/ext/gtk3/rbgtkselection.c +168 -0
  159. data/ext/gtk3/rbgtkselectiondata.c +282 -0
  160. data/ext/gtk3/rbgtkseparator.c +44 -0
  161. data/ext/gtk3/rbgtkseparatormenuitem.c +39 -0
  162. data/ext/gtk3/rbgtkseparatortoolitem.c +38 -0
  163. data/ext/gtk3/rbgtksettings.c +229 -0
  164. data/ext/gtk3/rbgtksizegroup.c +66 -0
  165. data/ext/gtk3/rbgtksocket.c +82 -0
  166. data/ext/gtk3/rbgtkspinbutton.c +132 -0
  167. data/ext/gtk3/rbgtkspinner.c +55 -0
  168. data/ext/gtk3/rbgtkstatusbar.c +77 -0
  169. data/ext/gtk3/rbgtkstatusicon.c +122 -0
  170. data/ext/gtk3/rbgtkstock.c +213 -0
  171. data/ext/gtk3/rbgtkstylecontext.c +411 -0
  172. data/ext/gtk3/rbgtkstyleproperties.c +119 -0
  173. data/ext/gtk3/rbgtkstyleprovider.c +68 -0
  174. data/ext/gtk3/rbgtkswitch.c +40 -0
  175. data/ext/gtk3/rbgtktable.c +190 -0
  176. data/ext/gtk3/rbgtktargetlist.c +125 -0
  177. data/ext/gtk3/rbgtktearoffmenuitem.c +41 -0
  178. data/ext/gtk3/rbgtktextappearance.c +236 -0
  179. data/ext/gtk3/rbgtktextattributes.c +326 -0
  180. data/ext/gtk3/rbgtktextbuffer.c +899 -0
  181. data/ext/gtk3/rbgtktextchildanchor.c +56 -0
  182. data/ext/gtk3/rbgtktextiter.c +732 -0
  183. data/ext/gtk3/rbgtktextmark.c +71 -0
  184. data/ext/gtk3/rbgtktexttag.c +68 -0
  185. data/ext/gtk3/rbgtktexttagtable.c +96 -0
  186. data/ext/gtk3/rbgtktextview.c +336 -0
  187. data/ext/gtk3/rbgtkthemingengine.c +257 -0
  188. data/ext/gtk3/rbgtktoggleaction.c +61 -0
  189. data/ext/gtk3/rbgtktogglebutton.c +87 -0
  190. data/ext/gtk3/rbgtktoggletoolbutton.c +61 -0
  191. data/ext/gtk3/rbgtktoolbar.c +118 -0
  192. data/ext/gtk3/rbgtktoolbutton.c +66 -0
  193. data/ext/gtk3/rbgtktoolitem.c +200 -0
  194. data/ext/gtk3/rbgtktoolitemgroup.c +70 -0
  195. data/ext/gtk3/rbgtktoolshell.c +96 -0
  196. data/ext/gtk3/rbgtktooltip.c +100 -0
  197. data/ext/gtk3/rbgtktreedragdest.c +28 -0
  198. data/ext/gtk3/rbgtktreedragsource.c +28 -0
  199. data/ext/gtk3/rbgtktreeiter.c +258 -0
  200. data/ext/gtk3/rbgtktreemodel.c +236 -0
  201. data/ext/gtk3/rbgtktreemodelfilter.c +197 -0
  202. data/ext/gtk3/rbgtktreemodelsort.c +111 -0
  203. data/ext/gtk3/rbgtktreepath.c +191 -0
  204. data/ext/gtk3/rbgtktreerowreference.c +140 -0
  205. data/ext/gtk3/rbgtktreeselection.c +205 -0
  206. data/ext/gtk3/rbgtktreesortable.c +122 -0
  207. data/ext/gtk3/rbgtktreestore.c +330 -0
  208. data/ext/gtk3/rbgtktreeview.c +715 -0
  209. data/ext/gtk3/rbgtktreeviewcolumn.c +256 -0
  210. data/ext/gtk3/rbgtkuimanager.c +189 -0
  211. data/ext/gtk3/rbgtkviewport.c +44 -0
  212. data/ext/gtk3/rbgtkvolumebutton.c +41 -0
  213. data/ext/gtk3/rbgtkwidget.c +1564 -0
  214. data/ext/gtk3/rbgtkwidgetpath.c +229 -0
  215. data/ext/gtk3/rbgtkwindow.c +557 -0
  216. data/ext/gtk3/rbgtkwindowgroup.c +80 -0
  217. data/extconf.rb +49 -0
  218. data/lib/gtk3.rb +10 -0
  219. data/lib/gtk3/base.rb +67 -0
  220. data/lib/gtk3/deprecated.rb +1001 -0
  221. data/sample/gtk-demo/README +7 -0
  222. data/sample/gtk-demo/alphatest.png +0 -0
  223. data/sample/gtk-demo/apple-red.png +0 -0
  224. data/sample/gtk-demo/appwindow.rb +233 -0
  225. data/sample/gtk-demo/background.jpg +0 -0
  226. data/sample/gtk-demo/builder.rb +51 -0
  227. data/sample/gtk-demo/button_box.rb +84 -0
  228. data/sample/gtk-demo/cairo-arc-negative.rb +41 -0
  229. data/sample/gtk-demo/cairo-arc.rb +41 -0
  230. data/sample/gtk-demo/cairo-clip-image.rb +51 -0
  231. data/sample/gtk-demo/cairo-clip-rectangle.rb +35 -0
  232. data/sample/gtk-demo/cairo-clip.rb +35 -0
  233. data/sample/gtk-demo/cairo-curve-rectangle.rb +76 -0
  234. data/sample/gtk-demo/cairo-curve-to.rb +43 -0
  235. data/sample/gtk-demo/cairo-dash.rb +39 -0
  236. data/sample/gtk-demo/cairo-fill-and-stroke.rb +32 -0
  237. data/sample/gtk-demo/cairo-fill-and-stroke2.rb +38 -0
  238. data/sample/gtk-demo/cairo-gradient.rb +35 -0
  239. data/sample/gtk-demo/cairo-image-pattern.rb +39 -0
  240. data/sample/gtk-demo/cairo-image.rb +49 -0
  241. data/sample/gtk-demo/cairo-line-cap.rb +53 -0
  242. data/sample/gtk-demo/cairo-line-join.rb +41 -0
  243. data/sample/gtk-demo/cairo-long-lines.rb +41 -0
  244. data/sample/gtk-demo/cairo-operator.rb +83 -0
  245. data/sample/gtk-demo/cairo-path.rb +28 -0
  246. data/sample/gtk-demo/cairo-pattern-fill.rb +88 -0
  247. data/sample/gtk-demo/cairo-self-intersect.rb +32 -0
  248. data/sample/gtk-demo/cairo-text-align-center.rb +45 -0
  249. data/sample/gtk-demo/cairo-text-extents.rb +46 -0
  250. data/sample/gtk-demo/cairo-text.rb +43 -0
  251. data/sample/gtk-demo/changedisplay.rb +408 -0
  252. data/sample/gtk-demo/clipboard.rb +72 -0
  253. data/sample/gtk-demo/colorsel.rb +84 -0
  254. data/sample/gtk-demo/common.rb +88 -0
  255. data/sample/gtk-demo/demo.ui +258 -0
  256. data/sample/gtk-demo/dialog.rb +137 -0
  257. data/sample/gtk-demo/drawingarea.rb +226 -0
  258. data/sample/gtk-demo/editable_cells.rb +172 -0
  259. data/sample/gtk-demo/entry_completion.rb +63 -0
  260. data/sample/gtk-demo/expander.rb +40 -0
  261. data/sample/gtk-demo/floppybuddy.gif +0 -0
  262. data/sample/gtk-demo/gnome-applets.png +0 -0
  263. data/sample/gtk-demo/gnome-calendar.png +0 -0
  264. data/sample/gtk-demo/gnome-foot.png +0 -0
  265. data/sample/gtk-demo/gnome-fs-directory.png +0 -0
  266. data/sample/gtk-demo/gnome-fs-regular.png +0 -0
  267. data/sample/gtk-demo/gnome-gimp.png +0 -0
  268. data/sample/gtk-demo/gnome-gmush.png +0 -0
  269. data/sample/gtk-demo/gnome-gsame.png +0 -0
  270. data/sample/gtk-demo/gnu-keys.png +0 -0
  271. data/sample/gtk-demo/gtk-logo-rgb.gif +0 -0
  272. data/sample/gtk-demo/hypertext.rb +211 -0
  273. data/sample/gtk-demo/iconview.rb +109 -0
  274. data/sample/gtk-demo/images.rb +197 -0
  275. data/sample/gtk-demo/item_factory.rb +94 -0
  276. data/sample/gtk-demo/list_store.rb +138 -0
  277. data/sample/gtk-demo/main.rb +382 -0
  278. data/sample/gtk-demo/menus.rb +172 -0
  279. data/sample/gtk-demo/panes.rb +156 -0
  280. data/sample/gtk-demo/pixbufs.rb +176 -0
  281. data/sample/gtk-demo/printing.rb +128 -0
  282. data/sample/gtk-demo/rotated_text.rb +84 -0
  283. data/sample/gtk-demo/ruby-gnome2-logo.png +0 -0
  284. data/sample/gtk-demo/sizegroup.rb +118 -0
  285. data/sample/gtk-demo/stock_browser.rb +235 -0
  286. data/sample/gtk-demo/textview.rb +436 -0
  287. data/sample/gtk-demo/tree_store.rb +270 -0
  288. data/sample/misc/aboutdialog.rb +42 -0
  289. data/sample/misc/aboutdialog2.rb +42 -0
  290. data/sample/misc/alpha-demo.rb +70 -0
  291. data/sample/misc/assistant.rb +347 -0
  292. data/sample/misc/bindings.rb +107 -0
  293. data/sample/misc/button.rb +69 -0
  294. data/sample/misc/button2.rb +28 -0
  295. data/sample/misc/buttonbox.rb +93 -0
  296. data/sample/misc/cairo-pong.rb +215 -0
  297. data/sample/misc/calendar.rb +66 -0
  298. data/sample/misc/checkbutton.rb +46 -0
  299. data/sample/misc/colorselection.rb +25 -0
  300. data/sample/misc/combo_check.rb +71 -0
  301. data/sample/misc/combobox.rb +86 -0
  302. data/sample/misc/composited-windows.rb +113 -0
  303. data/sample/misc/cursor.rb +32 -0
  304. data/sample/misc/dialog.rb +44 -0
  305. data/sample/misc/dialog2.rb +39 -0
  306. data/sample/misc/dnd.rb +64 -0
  307. data/sample/misc/dndtreeview.rb +56 -0
  308. data/sample/misc/drag-move.rb +131 -0
  309. data/sample/misc/drawing.rb +90 -0
  310. data/sample/misc/entry.rb +34 -0
  311. data/sample/misc/entrycompletion.rb +33 -0
  312. data/sample/misc/expander.rb +27 -0
  313. data/sample/misc/filechooser.rb +41 -0
  314. data/sample/misc/frame.rb +69 -0
  315. data/sample/misc/gdkscreen.rb +32 -0
  316. data/sample/misc/gnome-logo-icon.png +0 -0
  317. data/sample/misc/helloworld.rb +35 -0
  318. data/sample/misc/iconview.rb +38 -0
  319. data/sample/misc/image.rb +42 -0
  320. data/sample/misc/itemfactory.rb +73 -0
  321. data/sample/misc/itemfactory2.rb +74 -0
  322. data/sample/misc/keyboard_grab.rb +29 -0
  323. data/sample/misc/label.rb +33 -0
  324. data/sample/misc/linkbutton.rb +42 -0
  325. data/sample/misc/listview.rb +92 -0
  326. data/sample/misc/menu.rb +81 -0
  327. data/sample/misc/misc_button.rb +49 -0
  328. data/sample/misc/mouse-gesture.rb +465 -0
  329. data/sample/misc/pangorenderer.rb +66 -0
  330. data/sample/misc/pointer_grab.rb +34 -0
  331. data/sample/misc/print.rb +247 -0
  332. data/sample/misc/properties.rb +85 -0
  333. data/sample/misc/radiobutton.rb +47 -0
  334. data/sample/misc/recentchooserdialog.rb +52 -0
  335. data/sample/misc/rgtk+cairo.rb +42 -0
  336. data/sample/misc/scalebutton.rb +19 -0
  337. data/sample/misc/settings.rb +41 -0
  338. data/sample/misc/statusicon.rb +123 -0
  339. data/sample/misc/stock.rb +36 -0
  340. data/sample/misc/style_property.rb +67 -0
  341. data/sample/misc/style_property.rc +19 -0
  342. data/sample/misc/t-gtkplug.rb +58 -0
  343. data/sample/misc/t-gtksocket.rb +65 -0
  344. data/sample/misc/test.xpm +92 -0
  345. data/sample/misc/textbuffer_serialize.rb +130 -0
  346. data/sample/misc/threads.rb +72 -0
  347. data/sample/misc/to_drawable.rb +42 -0
  348. data/sample/misc/togglebutton.rb +34 -0
  349. data/sample/misc/toolbar.rb +55 -0
  350. data/sample/misc/tooltips.rb +204 -0
  351. data/sample/misc/tree_combo.rb +79 -0
  352. data/sample/misc/tree_progress.rb +63 -0
  353. data/sample/misc/treemodelfilter.rb +49 -0
  354. data/sample/misc/treeview.rb +71 -0
  355. data/sample/misc/uimanager.rb +148 -0
  356. data/sample/misc/uimanager2.rb +91 -0
  357. data/sample/misc/uimanager2.xml +36 -0
  358. data/sample/misc/window.rb +24 -0
  359. data/sample/misc/xbm_cursor.rb +43 -0
  360. data/sample/testgtk/3DRings.xpm +116 -0
  361. data/sample/testgtk/FilesQueue.xpm +98 -0
  362. data/sample/testgtk/Modeller.xpm +117 -0
  363. data/sample/testgtk/README +14 -0
  364. data/sample/testgtk/button.rb +124 -0
  365. data/sample/testgtk/buttonbox.rb +100 -0
  366. data/sample/testgtk/check-n.xpm +21 -0
  367. data/sample/testgtk/check-y.xpm +21 -0
  368. data/sample/testgtk/checkbutton.rb +67 -0
  369. data/sample/testgtk/circles.xbm +46 -0
  370. data/sample/testgtk/colorselect.rb +33 -0
  371. data/sample/testgtk/dialog.rb +48 -0
  372. data/sample/testgtk/entry.rb +73 -0
  373. data/sample/testgtk/filesel.rb +65 -0
  374. data/sample/testgtk/fontselection.rb +56 -0
  375. data/sample/testgtk/labels.rb +74 -0
  376. data/sample/testgtk/layout.rb +108 -0
  377. data/sample/testgtk/marble.xpm +408 -0
  378. data/sample/testgtk/menu.rb +79 -0
  379. data/sample/testgtk/notebook.rb +280 -0
  380. data/sample/testgtk/pixmap.rb +58 -0
  381. data/sample/testgtk/progressbar.rb +173 -0
  382. data/sample/testgtk/radiobutton.rb +61 -0
  383. data/sample/testgtk/range.rb +65 -0
  384. data/sample/testgtk/reparent.rb +91 -0
  385. data/sample/testgtk/sample.rb +80 -0
  386. data/sample/testgtk/savedposition.rb +87 -0
  387. data/sample/testgtk/scrolledwindow.rb +67 -0
  388. data/sample/testgtk/shapedwindow.rb +99 -0
  389. data/sample/testgtk/spinbutton.rb +181 -0
  390. data/sample/testgtk/statusbar.rb +89 -0
  391. data/sample/testgtk/test.xpm +92 -0
  392. data/sample/testgtk/testgtk.rb +176 -0
  393. data/sample/testgtk/testgtkrc +146 -0
  394. data/sample/testgtk/testgtkrc2 +21 -0
  395. data/sample/testgtk/togglebutton.rb +53 -0
  396. data/sample/testgtk/toolbar.rb +82 -0
  397. data/sample/testgtk/tooltips.rb +41 -0
  398. data/sample/testgtk/wmhints.rb +40 -0
  399. data/test/gtk-test-utils.rb +15 -0
  400. data/test/run-test.rb +32 -0
  401. data/test/test_gc.rb +25 -0
  402. data/test/test_gdk.rb +18 -0
  403. data/test/test_gdk_color.rb +10 -0
  404. data/test/test_gdk_display.rb +37 -0
  405. data/test/test_gdk_event.rb +11 -0
  406. data/test/test_gdk_gc.rb +7 -0
  407. data/test/test_gdk_keymap.rb +8 -0
  408. data/test/test_gdk_pango.rb +9 -0
  409. data/test/test_gdk_selection_data.rb +17 -0
  410. data/test/test_gdk_window.rb +29 -0
  411. data/test/test_gdk_window_attribute.rb +9 -0
  412. data/test/test_gtk_about_dialog.rb +14 -0
  413. data/test/test_gtk_buildable.rb +66 -0
  414. data/test/test_gtk_builder.rb +188 -0
  415. data/test/test_gtk_entry.rb +18 -0
  416. data/test/test_gtk_icon_theme.rb +30 -0
  417. data/test/test_gtk_image.rb +8 -0
  418. data/test/test_gtk_list_store.rb +65 -0
  419. data/test/test_gtk_menu_item.rb +13 -0
  420. data/test/test_gtk_rc_style.rb +14 -0
  421. data/test/test_gtk_tree_path.rb +20 -0
  422. data/test/test_gtk_unix_print.rb +14 -0
  423. data/test/test_gtk_widget.rb +32 -0
  424. metadata +553 -94
  425. data/LICENSE +0 -19
@@ -0,0 +1,80 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2002,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
+ */
21
+
22
+ #include "rbgtk3private.h"
23
+
24
+ #define RG_TARGET_NAMESPACE cWindowGroup
25
+ #define _SELF(self) (RVAL2GTKWINDOWGROUP(self))
26
+
27
+ static VALUE
28
+ rg_initialize(VALUE self)
29
+ {
30
+ G_INITIALIZE(self, gtk_window_group_new());
31
+ return Qnil;
32
+ }
33
+
34
+ static VALUE
35
+ rg_add(VALUE self, VALUE window)
36
+ {
37
+ gtk_window_group_add_window(_SELF(self),
38
+ RVAL2GTKWINDOW(window));
39
+ return self;
40
+ }
41
+
42
+ static VALUE
43
+ rg_remove(VALUE self, VALUE window)
44
+ {
45
+ gtk_window_group_remove_window(_SELF(self),
46
+ RVAL2GTKWINDOW(window));
47
+ return self;
48
+ }
49
+
50
+ static VALUE
51
+ rg_get_current_device_grab(VALUE self, VALUE device)
52
+ {
53
+ return GOBJ2RVAL(gtk_window_group_get_current_device_grab(_SELF(self),
54
+ NIL_P(device) ? NULL : RVAL2GDKDEVICE(device)));
55
+ }
56
+
57
+ static VALUE
58
+ rg_current_grab(VALUE self)
59
+ {
60
+ return GOBJ2RVAL(gtk_window_group_get_current_grab(_SELF(self)));
61
+ }
62
+
63
+ static VALUE
64
+ rg_windows(VALUE self)
65
+ {
66
+ /* TODO: need free? */
67
+ return GOBJGLIST2RVAL(gtk_window_group_list_windows(_SELF(self)));
68
+ }
69
+
70
+ void
71
+ Init_gtk_windowgroup(VALUE mGtk)
72
+ {
73
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_WINDOW_GROUP, "WindowGroup", mGtk);
74
+ RG_DEF_METHOD(initialize, 0);
75
+ RG_DEF_METHOD(add, 1);
76
+ RG_DEF_METHOD(remove, 1);
77
+ RG_DEF_METHOD(get_current_device_grab, 1);
78
+ RG_DEF_METHOD(current_grab, 0);
79
+ RG_DEF_METHOD(windows, 0);
80
+ }
data/extconf.rb ADDED
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'pathname'
4
+ require 'mkmf'
5
+ require 'rbconfig'
6
+ require 'fileutils'
7
+
8
+ package = "gtk3"
9
+
10
+ base_dir = Pathname(__FILE__).dirname.expand_path
11
+ ext_dir = base_dir + "ext" + package
12
+ mkmf_gnome2_dir = base_dir + 'lib'
13
+
14
+ ruby = File.join(RbConfig::CONFIG['bindir'],
15
+ RbConfig::CONFIG['ruby_install_name'] +
16
+ RbConfig::CONFIG["EXEEXT"])
17
+
18
+ build_dir = Pathname("ext") + package
19
+ FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist?
20
+ extconf_rb_path = ext_dir + "extconf.rb"
21
+ system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false)
22
+
23
+ create_makefile(package)
24
+ FileUtils.mv("Makefile", "Makefile.lib")
25
+
26
+ File.open("Makefile", "w") do |makefile|
27
+ makefile.puts(<<-EOM)
28
+ all:
29
+ (cd ext/#{package} && $(MAKE))
30
+ $(MAKE) -f Makefile.lib
31
+
32
+ install:
33
+ (cd ext/#{package} && $(MAKE) install)
34
+ $(MAKE) -f Makefile.lib install
35
+
36
+ site-install:
37
+ (cd ext/#{package} && $(MAKE) site-install)
38
+ $(MAKE) -f Makefile.lib site-install
39
+
40
+ clean:
41
+ (cd ext/#{package} && $(MAKE) clean)
42
+ $(MAKE) -f Makefile.lib clean
43
+
44
+ distclean:
45
+ (cd ext/#{package} && $(MAKE) distclean)
46
+ $(MAKE) -f Makefile.lib distclean
47
+ @rm -f Makefile.lib
48
+ EOM
49
+ end
data/lib/gtk3.rb ADDED
@@ -0,0 +1,10 @@
1
+ #! /usr/bin/env ruby
2
+ =begin
3
+ Copyright (c) 2006-2011 Ruby-GNOME2 Project Team
4
+ This program is licenced under the same licence as Ruby-GNOME2.
5
+ =end
6
+
7
+ require 'gtk3/base'
8
+ require 'gtk3/deprecated'
9
+
10
+ Gtk.init
data/lib/gtk3/base.rb ADDED
@@ -0,0 +1,67 @@
1
+ =begin
2
+ Copyright (c) 2006-2011 Ruby-GNOME2 Project Team
3
+ This program is licenced under the same licence as Ruby-GNOME2.
4
+ =end
5
+
6
+
7
+ require 'atk'
8
+ require 'gdk3'
9
+
10
+ base_dir = Pathname.new(__FILE__).dirname.dirname.dirname.expand_path
11
+ vendor_dir = base_dir + "vendor" + "local"
12
+ vendor_bin_dir = vendor_dir + "bin"
13
+ GLib.prepend_environment_path(vendor_bin_dir)
14
+ begin
15
+ major, minor, _ = RUBY_VERSION.split(/\./)
16
+ require "#{major}.#{minor}/gtk3.so"
17
+ rescue LoadError
18
+ require "gtk3.so"
19
+ end
20
+
21
+
22
+ module Gtk
23
+ LOG_DOMAIN = "Gtk"
24
+
25
+ class Printer
26
+ def self.printers(wait = false)
27
+ printers = []
28
+ self.each(wait) {|v| printers << v}
29
+ printers
30
+ end
31
+ end
32
+
33
+ class Builder
34
+ private
35
+ def canonical_handler_name(name)
36
+ name.gsub(/[-\s]+/, "_")
37
+ end
38
+
39
+ def __connect_signals__(connector, object, signal_name,
40
+ handler_name, connect_object, flags)
41
+ handler_name = canonical_handler_name(handler_name)
42
+ if connect_object
43
+ handler = connect_object.method(handler_name)
44
+ else
45
+ handler = connector.call(handler_name)
46
+ end
47
+ unless handler
48
+ $stderr.puts("Undefined handler: #{handler_name}") if $DEBUG
49
+ return
50
+ end
51
+
52
+ if flags.after?
53
+ signal_connect_method = :signal_connect_after
54
+ else
55
+ signal_connect_method = :signal_connect
56
+ end
57
+
58
+ if handler.arity.zero?
59
+ object.send(signal_connect_method, signal_name) {handler.call}
60
+ else
61
+ object.send(signal_connect_method, signal_name, &handler)
62
+ end
63
+ end
64
+ end
65
+ end
66
+
67
+ GLib::Log.set_log_domain(Gtk::LOG_DOMAIN)
@@ -0,0 +1,1001 @@
1
+ module Gtk
2
+ extend GLib::Deprecatable
3
+ define_deprecated_const :Combo, :raise => "Use 'Gtk::ComboBoxText' instead."
4
+ define_deprecated_const :ComboBoxEntry, :raise => "Use 'Gtk::ComboBox' instead."
5
+ define_deprecated_const :Curve, :raise => "Don't use this widget anymore."
6
+ define_deprecated_const :FileSelection, :raise => "Use 'Gtk::FileChooserDialog' instead."
7
+ define_deprecated_const :FontSelection, :raise => "Use 'Gtk::FontChooserWidget' instead."
8
+ define_deprecated_const :FontSelectionDialog, :raise => "Use 'Gtk::FontChooserDialog' instead."
9
+ define_deprecated_const :GammaCurve, :raise => "Don't use this widget anymore."
10
+ define_deprecated_const :HRuler, :raise => "Don't use this widget anymore."
11
+ define_deprecated_const :InputDialog, :raise => "Don't use this widget anymore."
12
+ define_deprecated_const :ItemFactory, :raise => "Use 'Gtk::UIManager' instead."
13
+ define_deprecated_const :OptionMenu, :raise => "Use 'Gtk::ComboBox' instead."
14
+ define_deprecated_const :RC, :raise => "Use 'Gtk::StyleContext' instead."
15
+ define_deprecated_const :RcStyle, :raise => "Use 'Gtk::CssProvider' instead."
16
+ define_deprecated_const :Ruler, :raise => "Don't use this widget anymore."
17
+ define_deprecated_const :Style, :raise => "Use 'Gtk::StyleContext' instead."
18
+ define_deprecated_const :Tooltips, :raise => "Use 'Gtk::Tooltip' API."
19
+ define_deprecated_const :VRuler, :raise => "Don't use this widget anymore."
20
+ define_deprecated_flags :AccelFlags, 'ACCEL'
21
+ define_deprecated_flags :AttachOptions
22
+ define_deprecated_enums :CornerType, 'CORNER'
23
+ define_deprecated_enums :DeleteType, 'DELETE'
24
+ define_deprecated_enums :DirectionType, 'DIR'
25
+ define_deprecated_enums :ExpanderStyle, 'EXPANDER'
26
+ define_deprecated_enums :Justification, 'JUSTIFY'
27
+ define_deprecated_enums :MovementStep, 'MOVEMENT'
28
+ define_deprecated_enums :Orientation, 'ORIENTATION'
29
+ define_deprecated_enums :PackType, 'PACK'
30
+ define_deprecated_enums :PathPriorityType, 'PATH_PRIO'
31
+ define_deprecated_enums :PathType, 'PATH'
32
+ define_deprecated_enums :PolicyType, 'POLICY'
33
+ define_deprecated_enums :PositionType, 'POS'
34
+ define_deprecated_enums :ReliefStyle, 'RELIEF'
35
+ define_deprecated_enums :ResizeMode, 'RESIZE'
36
+ define_deprecated_enums :ScrollStep, 'SCROLL'
37
+ define_deprecated_enums :ScrollType, 'SCROLL'
38
+ define_deprecated_enums :SelectionMode, 'SELECTION'
39
+ define_deprecated_enums :ShadowType, 'SHADOW'
40
+ define_deprecated_enums :StateType, 'STATE'
41
+ define_deprecated_enums :SortType, 'SORT'
42
+ define_deprecated_const :AnchorType
43
+ define_deprecated_const :ANCHOR_CENTER
44
+ define_deprecated_const :ANCHOR_NORTH
45
+ define_deprecated_const :ANCHOR_NORTH_WEST
46
+ define_deprecated_const :ANCHOR_NORTH_EAST
47
+ define_deprecated_const :ANCHOR_SOUTH
48
+ define_deprecated_const :ANCHOR_SOUTH_WEST
49
+ define_deprecated_const :ANCHOR_SOUTH_EAST
50
+ define_deprecated_const :ANCHOR_WEST
51
+ define_deprecated_const :ANCHOR_EAST
52
+ define_deprecated_const :ANCHOR_N
53
+ define_deprecated_const :ANCHOR_NW
54
+ define_deprecated_const :ANCHOR_NE
55
+ define_deprecated_const :ANCHOR_S
56
+ define_deprecated_const :ANCHOR_SW
57
+ define_deprecated_const :ANCHOR_SE
58
+ define_deprecated_const :ANCHOR_W
59
+ define_deprecated_const :ANCHOR_E
60
+ define_deprecated_const :UpdateType
61
+ define_deprecated_const :UPDATE_CONTINUOUS
62
+ define_deprecated_const :UPDATE_DISCONTINUOUS
63
+ define_deprecated_const :UPDATE_DELAYED
64
+ define_deprecated_singleton_method :init_add, :warn => "Don't use this method."
65
+ define_deprecated_singleton_method :quit_add, :warn => "Don't use this method."
66
+ define_deprecated_singleton_method :quit_remove, :warn => "Don't use this method."
67
+ define_deprecated_singleton_method :get_event_widget, :warn => "Use 'Gdk::Event#event_widget'." do |_self, event|
68
+ event && event.event_widget
69
+ end
70
+ define_deprecated_singleton_method :timeout_add, :warn => "Use 'GLib::Timeout.add'." do |_self, interval, &block|
71
+ GLib::Timeout.add(interval, &block)
72
+ end
73
+ define_deprecated_singleton_method :timeout_remove, :warn => "Use 'GLib::Source.remove'." do |_self, id|
74
+ GLib::Source.remove(id)
75
+ end
76
+ define_deprecated_singleton_method :idle_add, :warn => "Use 'GLib::Idle.add'." do |_self, &block|
77
+ GLib::Idle.add(&block)
78
+ end
79
+ define_deprecated_singleton_method :idle_add_priority, :warn => "Use 'GLib::Idle.add'." do |_self, priority, &block|
80
+ GLib::Idle.add(priority, &block)
81
+ end
82
+ define_deprecated_singleton_method :idle_remove, :warn => "Use 'GLib::Source.remove'." do |_self, id|
83
+ GLib::Source.remove(id)
84
+ end
85
+
86
+ class AboutDialog
87
+ extend GLib::Deprecatable
88
+ define_deprecated_singleton_method :set_email_hook, :warn => "Use 'activate-link' signal."
89
+ define_deprecated_singleton_method :set_url_hook, :warn => "Use 'activate-link' signal."
90
+ end
91
+
92
+ class Action
93
+ extend GLib::Deprecatable
94
+ define_deprecated_method :connect_proxy, :warn => "Use 'Gtk::Activatable#set_related_action'."
95
+ define_deprecated_method :disconnect_proxy, :warn => "Use 'Gtk::Activatable#set_related_action'."
96
+ define_deprecated_method :block_activate_from, :warn => "Don't use this method."
97
+ define_deprecated_method :unblock_activate_from, :warn => "Don't use this method."
98
+ define_deprecated_method_by_hash_args :initialize,
99
+ 'name, label, tooltip = nil, stock_id = nil',
100
+ 'name, :label => nil, :tooltip => nil, :stock_id => nil', 1 do
101
+ |_self, name, label, tooltip, stock_id|
102
+ [name, {:label => label, :tooltip => tooltip, :stock_id => stock_id}]
103
+ end
104
+ end
105
+
106
+ class Arrow
107
+ extend GLib::Deprecatable
108
+ define_deprecated_enums :Type
109
+ end
110
+
111
+ class Assistant
112
+ extend GLib::Deprecatable
113
+ define_deprecated_enums :PageType, 'PAGE'
114
+ define_deprecated_method :set_page_header_image, :warn => "Don't use this method."
115
+ define_deprecated_method :get_page_header_image, :warn => "Don't use this method."
116
+ define_deprecated_method :set_page_side_image, :warn => "Don't use this method."
117
+ define_deprecated_method :get_page_side_image, :warn => "Don't use this method."
118
+ end
119
+
120
+ class BindingSet
121
+ extend GLib::Deprecatable
122
+ define_deprecated_method :entry_clear, :entry_remove
123
+ end
124
+
125
+ class Box
126
+ extend GLib::Deprecatable
127
+ define_deprecated_method :pack_start_defaults, :pack_start
128
+ define_deprecated_method :pack_end_defaults, :pack_end
129
+ define_deprecated_method_by_hash_args :pack_start,
130
+ 'child, expand = true, fill = true, padding = 0',
131
+ 'child, :expand => true, :fill => true, :padding => 0', 1 do
132
+ |_self, child, expand, fill, padding|
133
+ [child, {:expand => expand, :fill => fill, :padding => padding}]
134
+ end
135
+ define_deprecated_method_by_hash_args :pack_end,
136
+ 'child, expand = true, fill = true, padding = 0',
137
+ 'child, :expand => true, :fill => true, :padding => 0', 1 do
138
+ |_self, child, expand, fill, padding|
139
+ [child, {:expand => expand, :fill => fill, :padding => padding}]
140
+ end
141
+ define_deprecated_method_by_hash_args :set_child_packing,
142
+ 'child, expand, fill, padding, pack_type',
143
+ 'child, :expand => nil, :fill => nil, :padding => nil, :pack_type => nil', 1 do
144
+ |_self, child, expand, fill, padding, pack_type|
145
+ [child, {:expand => expand, :fill => fill, :padding => padding, :pack_type => pack_type}]
146
+ end
147
+ end
148
+
149
+ class Button
150
+ extend GLib::Deprecatable
151
+ define_deprecated_method :enter, :warn => "Don't use this method."
152
+ define_deprecated_method :leave, :warn => "Don't use this method."
153
+ define_deprecated_method :pressed, :warn => "Don't use this method."
154
+ define_deprecated_method :released, :warn => "Don't use this method."
155
+ define_deprecated_signal :enter, :warn => "Use 'Gtk::Widget::enter-notify-event' signal."
156
+ define_deprecated_signal :leave, :warn => "Use 'Gtk::Widget::leave-notify-event' signal."
157
+ define_deprecated_signal :pressed, :warn => "Use 'Gtk::Widget::button-press-event' signal."
158
+ define_deprecated_signal :released, :warn => "Use 'Gtk::Widget::button-release-event' signal."
159
+ define_deprecated_method_by_hash_args :initialize,
160
+ 'label_or_stock_id, use_underline = nil',
161
+ ':label => nil, :mnemonic => nil, :stock_id => nil' do
162
+ |_self, label_or_stock_id, use_underline|
163
+ case label_or_stock_id
164
+ when String
165
+ if use_underline
166
+ [{:mnemonic => label_or_stock_id}]
167
+ else
168
+ [{:label => label_or_stock_id}]
169
+ end
170
+ when Symbol
171
+ [{:stock_id => label_or_stock_id}]
172
+ else
173
+ [label_or_stock_id]
174
+ end
175
+ end
176
+ end
177
+
178
+ class ButtonBox
179
+ extend GLib::Deprecatable
180
+ define_deprecated_enums :Style
181
+ end
182
+
183
+ class Calendar
184
+ extend GLib::Deprecatable
185
+ define_deprecated_flags :DisplayOptions
186
+ define_deprecated_method :freeze, :warn => "Don't use this method."
187
+ define_deprecated_method :thaw, :warn => "Don't use this method."
188
+ end
189
+
190
+ class CellRenderer
191
+ extend GLib::Deprecatable
192
+ define_deprecated_enums :Mode, 'MODE'
193
+ define_deprecated_flags :State
194
+ define_deprecated_method :editing_canceled, :warn => "Use '#{self}#stop_editing'." do |_self|
195
+ _self.stop_editing(true)
196
+ end
197
+ end
198
+
199
+ class CellRendererAccel
200
+ extend GLib::Deprecatable
201
+ define_deprecated_enums :Mode, 'MODE'
202
+ end
203
+
204
+ class CellView
205
+ extend GLib::Deprecatable
206
+ define_deprecated_method :cell_renderers, :warn => "Use 'Gtk::CellLayout#cells'." do |_self|
207
+ _self.cells
208
+ end
209
+ end
210
+
211
+ class ColorSelectionDialog
212
+ extend GLib::Deprecatable
213
+ define_deprecated_method :colorsel, :color_selection
214
+ define_deprecated_method_by_hash_args :initialize,
215
+ 'title', ':title => nil' do |_self, title|
216
+ [{:title => title}]
217
+ end
218
+ end
219
+
220
+ class ComboBox
221
+ extend GLib::Deprecatable
222
+ define_deprecated_method :append_text, :raise => "Use 'Gtk::ComboBoxText#append_text'."
223
+ define_deprecated_method :insert_text, :raise => "Use 'Gtk::ComboBoxText#insert_text'."
224
+ define_deprecated_method :prepend_text, :raise => "Use 'Gtk::ComboBoxText#prepend_text'."
225
+ define_deprecated_method :remove_text, :raise => "Use 'Gtk::ComboBoxText#remove'."
226
+ define_deprecated_method :active_text, :raise => "Use 'Gtk::ComboBoxText#active_text'."
227
+ define_deprecated_method_by_hash_args :initialize,
228
+ 'model', ':entry => false, :model => nil, :area => nil' do |_self, model|
229
+ case model
230
+ when TreeModel
231
+ [{:model => model}]
232
+ when true, false
233
+ raise GLib::DeprecatedError.new("#{caller[0]}: '#{self}#initialize(is_text_only)' style has been deprecated. Use 'Gtk::ComboBoxText'.")
234
+ end
235
+ end
236
+ end
237
+
238
+ class Dialog
239
+ extend GLib::Deprecatable
240
+ define_deprecated_flags :Flags
241
+ define_deprecated_const :ResponseType, 'Gtk::ResponseType'
242
+ define_deprecated_enums 'Gtk::ResponseType', 'RESPONSE'
243
+ define_deprecated_method :vbox, :child
244
+ define_deprecated_method_by_hash_args :initialize,
245
+ 'title, parent, flags, *buttons',
246
+ ':title => nil, :parent => nil, :flags => 0, :buttons => nil' do
247
+ |_self, title, parent, flags, *buttons|
248
+ [{:title => title, :parent => parent, :flags => flags, :buttons => buttons}]
249
+ end
250
+ end
251
+
252
+ module Drag
253
+ extend GLib::Deprecatable
254
+ define_deprecated_flags :DestDefaults, 'DEST_DEFAULT'
255
+ define_deprecated_flags :TargetFlags, 'TARGET'
256
+ define_deprecated_singleton_method :finish, :warn => "Use 'Gdk::DragContext#finish'." do |_self, context, success, del, time|
257
+ context.finish(success, del, time)
258
+ end
259
+ define_deprecated_singleton_method :set_icon_default, :warn => "Use 'Gdk::DragContext#set_icon_default'." do |_self, context|
260
+ context.set_icon_default
261
+ end
262
+ define_deprecated_singleton_method :set_icon_name, :warn => "Use 'Gdk::DragContext#set_icon'." do |_self, context, name, hot_x, hot_y|
263
+ context.set_icon(:name => name, :hot_x => hot_x, :hot_y => hot_y)
264
+ end
265
+ define_deprecated_singleton_method :set_icon, :warn => "Use 'Gdk::DragContext#set_icon'." do |_self, context, icon, hot_x, hot_y|
266
+ case icon
267
+ when Symbol
268
+ context.set_icon(:stock_id => icon, :hot_x => hot_x, :hot_y => hot_y)
269
+ when Gdk::Pixbuf
270
+ context.set_icon(:pixbuf => icon, :hot_x => hot_x, :hot_y => hot_y)
271
+ when Gtk::Widget
272
+ context.set_icon(:widget => icon, :hot_x => hot_x, :hot_y => hot_y)
273
+ end
274
+ end
275
+ define_deprecated_singleton_method :dest_set,
276
+ :warn => "Use 'Gtk::Widget#drag_dest_set'." do |_self, widget, flags, targets, actions|
277
+ widget.drag_dest_set(flags, targets, actions)
278
+ end
279
+ define_deprecated_singleton_method :dest_set_proxy,
280
+ :warn => "Use 'Gtk::Widget#drag_dest_set_proxy'." do |_self, widget, proxy_window, protocol, use_coordinates|
281
+ widget.drag_dest_set_proxy(proxy_window, protocol, use_coordinates)
282
+ end
283
+ define_deprecated_singleton_method :dest_unset,
284
+ :warn => "Use 'Gtk::Widget#drag_dest_unset'." do |_self, widget|
285
+ widget.drag_dest_unset
286
+ end
287
+ define_deprecated_singleton_method :dest_find_target,
288
+ :warn => "Use 'Gtk::Widget#drag_dest_find_target'." do |_self, widget, context, target_list|
289
+ widget.drag_dest_find_target(context, target_list)
290
+ end
291
+ define_deprecated_singleton_method :dest_get_target_list,
292
+ :warn => "Use 'Gtk::Widget#drag_dest_get_target_list'." do |_self, widget|
293
+ widget.drag_dest_get_target_list
294
+ end
295
+ define_deprecated_singleton_method :dest_set_target_list,
296
+ :warn => "Use 'Gtk::Widget#drag_dest_set_target_list'." do |_self, widget, target_list|
297
+ widget.drag_dest_set_target_list(target_list)
298
+ end
299
+ define_deprecated_singleton_method :dest_add_text_targets,
300
+ :warn => "Use 'Gtk::Widget#drag_dest_add_text_targets'." do |_self, widget|
301
+ widget.drag_dest_add_text_targets
302
+ end
303
+ define_deprecated_singleton_method :dest_add_image_targets,
304
+ :warn => "Use 'Gtk::Widget#drag_dest_add_image_targets'." do |_self, widget|
305
+ widget.drag_dest_add_image_targets
306
+ end
307
+ define_deprecated_singleton_method :dest_add_uri_targets,
308
+ :warn => "Use 'Gtk::Widget#drag_dest_add_uri_targets'." do |_self, widget|
309
+ widget.drag_dest_add_uri_targets
310
+ end
311
+ define_deprecated_singleton_method :dest_set_track_motion,
312
+ :warn => "Use 'Gtk::Widget#drag_dest_set_track_motion'." do |_self, widget, track_motion|
313
+ widget.drag_dest_set_track_motion(track_motion)
314
+ end
315
+ define_deprecated_singleton_method :dest_get_track_motion,
316
+ :warn => "Use 'Gtk::Widget#drag_dest_get_track_motion'." do |_self, widget|
317
+ widget.drag_dest_get_track_motion
318
+ end
319
+ define_deprecated_singleton_method :get_data,
320
+ :warn => "Use 'Gtk::Widget#drag_get_data'." do |_self, widget, context, target, time|
321
+ widget.drag_get_data(context, target, time)
322
+ end
323
+ define_deprecated_singleton_method :highlight,
324
+ :warn => "Use 'Gtk::Widget#drag_highlight'." do |_self, widget|
325
+ widget.drag_highlight
326
+ end
327
+ define_deprecated_singleton_method :unhighlight,
328
+ :warn => "Use 'Gtk::Widget#drag_unhighlight'." do |_self, widget|
329
+ widget.drag_unhighlight
330
+ end
331
+ define_deprecated_singleton_method :begin,
332
+ :warn => "Use 'Gtk::Widget#drag_begin'." do |_self, widget, target_list, actions, button, event|
333
+ widget.drag_begin(target_list, actions, button, event)
334
+ end
335
+ define_deprecated_singleton_method :threshold?,
336
+ :warn => "Use 'Gtk::Widget#drag_threshold?'." do |_self, widget, start_x, start_y, current_x, current_y|
337
+ widget.drag_threshold?(start_x, start_y, current_x, current_y)
338
+ end
339
+ define_deprecated_singleton_method :source_set,
340
+ :warn => "Use 'Gtk::Widget#drag_source_set'." do |_self, widget, start_button_mask, targets, actions|
341
+ widget.drag_source_set(start_button_mask, targets, actions)
342
+ end
343
+ define_deprecated_singleton_method :source_set_icon,
344
+ :warn => "Use 'Gtk::Widget#drag_source_set_icon(:stock_id => nil, :pixbuf => nil)'." do |_self, widget, icon|
345
+ case icon
346
+ when Symbol
347
+ widget.drag_source_set_icon(:stock_id => icon)
348
+ else
349
+ widget.drag_source_set_icon(:pixbuf => icon)
350
+ end
351
+ end
352
+ define_deprecated_singleton_method :source_set_icon_name,
353
+ :warn => "Use 'Gtk::Widget#drag_source_set_icon(:icon_name => nil)'." do |_self, widget, icon|
354
+ widget.drag_source_set_icon(:icon_name => icon)
355
+ end
356
+ define_deprecated_singleton_method :source_unset,
357
+ :warn => "Use 'Gtk::Widget#drag_source_unset'." do |_self, widget|
358
+ widget.drag_source_unset
359
+ end
360
+ define_deprecated_singleton_method :source_set_target_list,
361
+ :warn => "Use 'Gtk::Widget#drag_source_set_target_list'." do |_self, widget, target_list|
362
+ widget.drag_source_set_target_list(target_list)
363
+ end
364
+ define_deprecated_singleton_method :source_get_target_list,
365
+ :warn => "Use 'Gtk::Widget#drag_source_get_target_list'." do |_self, widget|
366
+ widget.drag_source_get_target_list
367
+ end
368
+ define_deprecated_singleton_method :source_add_text_targets,
369
+ :warn => "Use 'Gtk::Widget#drag_source_add_text_targets'." do |_self, widget|
370
+ widget.drag_source_add_text_targets
371
+ end
372
+ define_deprecated_singleton_method :source_add_image_targets,
373
+ :warn => "Use 'Gtk::Widget#drag_source_add_image_targets'." do |_self, widget|
374
+ widget.drag_source_add_image_targets
375
+ end
376
+ define_deprecated_singleton_method :source_add_uri_targets,
377
+ :warn => "Use 'Gtk::Widget#drag_source_add_uri_targets'." do |_self, widget|
378
+ widget.drag_source_add_uri_targets
379
+ end
380
+ end
381
+
382
+ module FileChooser
383
+ extend GLib::Deprecatable
384
+ define_deprecated_enums :Action, 'ACTION'
385
+ define_deprecated_enums :Confirmation, 'CONFIRMATION'
386
+ end
387
+
388
+ class FileChooserDialog
389
+ extend GLib::Deprecatable
390
+ define_deprecated_method_by_hash_args :initialize,
391
+ 'title, parent, action, back, *buttons',
392
+ ':title => nil, :parent => nil, :action => :open, :buttons => nil' do
393
+ |_self, title, parent, action, back, *buttons|
394
+ [{:title => title, :parent => parent, :action => action, :buttons => buttons}]
395
+ end
396
+ end
397
+
398
+ class FileFilter
399
+ extend GLib::Deprecatable
400
+ define_deprecated_flags :Flags
401
+ end
402
+
403
+ class HBox
404
+ extend GLib::Deprecatable
405
+ define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Box.new(:horizontal, spacing)'." do |_self, homogeneous, spacing|
406
+ Gtk::Box.new(:horizontal, spacing).set_homogeneous(homogeneous)
407
+ end
408
+ end
409
+
410
+ class HButtonBox
411
+ extend GLib::Deprecatable
412
+ define_deprecated_singleton_method :new, :warn => "Use 'Gtk::ButtonBox.new(:horizontal)'." do |_self|
413
+ Gtk::ButtonBox.new(:horizontal)
414
+ end
415
+ end
416
+
417
+ class HPaned
418
+ extend GLib::Deprecatable
419
+ define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Paned.new(:horizontal)'." do |_self|
420
+ Gtk::Paned.new(:horizontal)
421
+ end
422
+ end
423
+
424
+ class HScale
425
+ extend GLib::Deprecatable
426
+ define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Scale.new(:horizontal, *args)'." do |_self, *args|
427
+ Gtk::Scale.new(:horizontal, *args)
428
+ end
429
+ end
430
+
431
+ class HScrollbar
432
+ extend GLib::Deprecatable
433
+ define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Scrollbar.new(:horizontal, adjustment)'." do |_self, adjustment|
434
+ Gtk::Scrollbar.new(:horizontal, adjustment)
435
+ end
436
+ end
437
+
438
+ class HSeparator
439
+ extend GLib::Deprecatable
440
+ define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Separator.new(:horizontal)'." do |_self|
441
+ Gtk::Separator.new(:horizontal)
442
+ end
443
+ end
444
+
445
+ class IconSet
446
+ extend GLib::Deprecatable
447
+ define_deprecated_method :render_icon, :raise => "Use '#{self}#render_icon_pixbuf'."
448
+ end
449
+
450
+ module IconSize
451
+ extend GLib::Deprecatable
452
+ define_deprecated_enums :IconSize
453
+ end
454
+
455
+ class IconTheme
456
+ extend GLib::Deprecatable
457
+ define_deprecated_flags :LookupFlags, 'LOOKUP'
458
+ end
459
+
460
+ class IconView
461
+ extend GLib::Deprecatable
462
+ define_deprecated_enums :Type
463
+ end
464
+
465
+ class Image
466
+ extend GLib::Deprecatable
467
+ define_deprecated_enums :Type
468
+ define_deprecated_method :set, :warn => "Use '#{self}#set_stock', '#{self}#set_icon_name', '#{self}#set_icon_set', '#{self}#set_file', '#{self}#set_pixbuf' or '#{self}#set_pixbuf_animation'."
469
+ define_deprecated_method_by_hash_args :initialize,
470
+ 'image, size = nil',
471
+ ':label => nil, :mnemonic => nil, :stock => nil, :size => nil' do
472
+ |_self, image, size|
473
+ case image
474
+ when String
475
+ if size
476
+ [{:icon_name => image, :size => size}]
477
+ else
478
+ [{:file => image}]
479
+ end
480
+ when Symbol
481
+ [{:stock => image, :size => size}]
482
+ when Gtk::IconSet
483
+ [{:icon_set => image, :size => size}]
484
+ else
485
+ [image]
486
+ end
487
+ end
488
+ end
489
+
490
+ class ImageMenuItem
491
+ extend GLib::Deprecatable
492
+ define_deprecated_method_by_hash_args :initialize,
493
+ 'label_or_stock_id = nil, use_underline_or_accel_group = nil',
494
+ ':label => nil, :mnemonic => nil, :stock_id => nil, :accel_group => nil' do
495
+ |_self, label_or_stock_id, use_underline_or_accel_group|
496
+ case label_or_stock_id
497
+ when String
498
+ if use_underline_or_accel_group
499
+ [{:mnemonic => label_or_stock_id}]
500
+ else
501
+ [{:label => label_or_stock_id}]
502
+ end
503
+ when Symbol
504
+ [{:stock_id => label_or_stock_id, :accel_group => use_underline_or_accel_group}]
505
+ end
506
+ end
507
+ end
508
+
509
+ class LinkButton
510
+ extend GLib::Deprecatable
511
+ define_deprecated_singleton_method :set_uri_hook, :warn => "Use 'clicked' signal."
512
+ end
513
+
514
+ class MenuBar
515
+ extend GLib::Deprecatable
516
+ define_deprecated_enums :PackDirection, 'PACK_DIRECTION'
517
+ end
518
+
519
+ class MenuItem
520
+ extend GLib::Deprecatable
521
+ define_deprecated_method :remove_submenu, :warn => "Use '#{self}#set_submenu'." do |_self|
522
+ _self.set_submenu(nil)
523
+ end
524
+ end
525
+
526
+ class MenuShell
527
+ extend GLib::Deprecatable
528
+ define_deprecated_enums :DirectionType, 'DIR'
529
+ end
530
+
531
+ class MenuToolButton
532
+ extend GLib::Deprecatable
533
+ define_deprecated_method_by_hash_args :initialize,
534
+ 'icon_widget_or_stock_id = nil, label = nil',
535
+ ':icon_widget => nil, :label => nil, :stock_id => nil' do
536
+ |_self, icon_widget_or_stock_id, label|
537
+ case icon_widget_or_stock_id
538
+ when String, Symbol
539
+ [{:stock_id => icon_widget_or_stock_id}]
540
+ when Gtk::Widget
541
+ [{:icon_widget => icon_widget_or_stock_id, :label => label}]
542
+ end
543
+ end
544
+ end
545
+
546
+ class MessageDialog
547
+ extend GLib::Deprecatable
548
+ define_deprecated_enums :ButtonsType, 'BUTTONS'
549
+ define_deprecated_const :Type, 'Gtk::MessageType'
550
+ define_deprecated_enums 'Gtk::MessageType'
551
+ define_deprecated_method_by_hash_args :initialize,
552
+ 'parent, flags, type, buttons_type, message',
553
+ ':parent => nil, :flags => 0, :type => :info, :buttons_type => :ok, :message => ""' do
554
+ |_self, parent, flags, type, buttons_type, message|
555
+ [{:parent => parent, :flags => flags, :type => type, :buttons_type => buttons_type, :message => message}]
556
+ end
557
+ end
558
+
559
+ class Notebook
560
+ extend GLib::Deprecatable
561
+ define_deprecated_singleton_method :set_window_creation_hook, :warn => "Use 'create-window' signal."
562
+ define_deprecated_method :query_tab_label_packing, :warn => "Use 'tab-expand' and 'tab-fill' child property." do |_self, child|
563
+ [_self.child_get_property(child, 'tab-expand'), _self.child_get_property(child, 'tab-fill')]
564
+ end
565
+ define_deprecated_method :set_tab_label_packing, :warn => "Use 'tab-expand' and 'tab-fill' child property." do |_self, child, expand, fill, pack_type|
566
+ _self.child_set_property(child, 'tab-expand', expand)
567
+ _self.child_set_property(child, 'tab-fill', fill)
568
+ end
569
+ end
570
+
571
+ class PageSetupUnixDialog
572
+ extend GLib::Deprecatable
573
+ define_deprecated_method_by_hash_args :initialize,
574
+ 'title, parent', ':title => nil, :parent => nil' do |_self, title, parent|
575
+ [{:title => title, :parent => parent}]
576
+ end
577
+ end
578
+
579
+ class PaperSize
580
+ extend GLib::Deprecatable
581
+ define_deprecated_enums :Unit, 'UNIT'
582
+ end
583
+
584
+ class PrintOperation
585
+ extend GLib::Deprecatable
586
+ define_deprecated_enums :Action, 'ACTION'
587
+ define_deprecated_enums :Result, 'RESULT'
588
+ define_deprecated_enums :Status, 'STATUS'
589
+ end
590
+
591
+ class PrintSettings
592
+ extend GLib::Deprecatable
593
+ define_deprecated_enums :PageOrientation, 'ORIENTATION'
594
+ define_deprecated_enums :PageSet, 'PAGE_SET'
595
+ define_deprecated_enums :PrintDuplex, 'DUPLEX'
596
+ define_deprecated_enums :PrintPages, 'PAGES'
597
+ define_deprecated_enums :PrintQuality, 'QUALITY'
598
+ end
599
+
600
+ class PrintUnixDialog
601
+ extend GLib::Deprecatable
602
+ define_deprecated_flags :Capabilities, 'CAPABILITY'
603
+ define_deprecated_method_by_hash_args :initialize,
604
+ 'title, parent', ':title => nil, :parent => nil' do |_self, title, parent|
605
+ [{:title => title, :parent => parent}]
606
+ end
607
+ end
608
+
609
+ class Paned
610
+ extend GLib::Deprecatable
611
+ %w(child1 child2).product(%w(resize shrink)).each do |child, prop|
612
+ define_deprecated_method "#{child}_#{prop}?", :warn => "Use '#{prop}' child property." do |_self|
613
+ _self.child_get_property(_self.send(child), prop)
614
+ end
615
+ end
616
+ define_deprecated_method_by_hash_args :pack1,
617
+ 'child, resize, shrink',
618
+ 'child, :resize => false, :shrink => true', 1 do
619
+ |_self, child, resize, shrink|
620
+ [child, {:resize => resize, :shrink => shrink}]
621
+ end
622
+ define_deprecated_method_by_hash_args :pack2,
623
+ 'child, resize, shrink',
624
+ 'child, :resize => true, :shrink => true', 1 do
625
+ |_self, child, resize, shrink|
626
+ [child, {:resize => resize, :shrink => shrink}]
627
+ end
628
+ end
629
+
630
+ class RadioAction
631
+ extend GLib::Deprecatable
632
+ define_deprecated_method_by_hash_args :initialize,
633
+ 'name, label, tooltip, stock_id, value',
634
+ 'name, value, :label => nil, :tooltip => nil, :stock_id => nil', 2 do
635
+ |_self, name, label, tooltip, stock_id, value|
636
+ [name, value, {:label => label, :tooltip => tooltip, :stock_id => stock_id}]
637
+ end
638
+ end
639
+
640
+ class Range
641
+ extend GLib::Deprecatable
642
+ define_deprecated_enums :SensitivityType, 'SENSITIVITY'
643
+ define_deprecated_method :update_policy, :raise => "Don't use this method."
644
+ define_deprecated_method :set_update_policy, :warn => "Don't use this method."
645
+ alias :update_policy= :set_update_policy
646
+ end
647
+
648
+ module RC
649
+ extend GLib::Deprecatable
650
+ define_deprecated_flags :Flags
651
+ define_deprecated_enums :TokenType, 'TOKEN'
652
+ end
653
+
654
+ class RecentAction
655
+ extend GLib::Deprecatable
656
+ define_deprecated_method_by_hash_args :initialize,
657
+ 'name, label, tooltip = nil, stock_id = nil, manager = nil',
658
+ 'name, :label => nil, :tooltip => nil, :stock_id => nil, :manager => nil', 1 do
659
+ |_self, name, label, tooltip, stock_id, manager|
660
+ [name, {:label => label, :tooltip => tooltip, :stock_id => stock_id, :manager => manager}]
661
+ end
662
+ end
663
+
664
+ module RecentChooser
665
+ extend GLib::Deprecatable
666
+ define_deprecated_enums :SortType, 'SORT'
667
+ define_deprecated_method :show_numbers, :warn => "Use 'Gtk::RecentChooserMenu#show_numbers?'." do |_self|
668
+ false
669
+ end
670
+ define_deprecated_method :set_show_numbers, :warn => "Use 'Gtk::RecentChooserMenu#set_show_numbers'."
671
+ alias :show_numbers= :set_show_numbers
672
+ end
673
+
674
+ class RecentChooserDialog
675
+ extend GLib::Deprecatable
676
+ define_deprecated_method_by_hash_args :initialize,
677
+ 'title, parent, manager, *buttons',
678
+ ':title => nil, :parent => nil, :manager => nil, :buttons => nil' do
679
+ |_self, title, parent, *buttons|
680
+ manager = buttons.first.is_a?(RecentManager) ? buttons.shift : nil
681
+ [{:title => title, :parent => parent, :manager => manager, :buttons => buttons}]
682
+ end
683
+ end
684
+
685
+ class RecentFilter
686
+ extend GLib::Deprecatable
687
+ define_deprecated_flags :Flags
688
+ end
689
+
690
+ class RecentManager
691
+ extend GLib::Deprecatable
692
+ define_deprecated_singleton_method :get_for_screen, :warn => "Use '#{self}.default'." do |_self, screen|
693
+ _self.default
694
+ end
695
+ define_deprecated_method :set_screen, :warn => "Don't use this method."
696
+ alias :screen= :set_screen
697
+ end
698
+
699
+ class ProgressBar
700
+ extend GLib::Deprecatable
701
+ define_deprecated_method :set_activity_mode, :warn => "Don't use this method."
702
+ alias :activity_mode= :set_activity_mode
703
+ define_deprecated_method :activity_mode?, :warn => "Don't use this method." do |_self|
704
+ false
705
+ end
706
+ define_deprecated_method :set_text_xalign, :warn => "Don't use this method."
707
+ alias :text_xalign= :set_text_xalign
708
+ define_deprecated_method :text_xalign, :warn => "Don't use this method." do |_self|
709
+ 0.0
710
+ end
711
+ define_deprecated_method :set_text_yalign, :warn => "Don't use this method."
712
+ alias :text_yalign= :set_text_yalign
713
+ define_deprecated_method :text_yalign, :warn => "Don't use this method." do |_self|
714
+ 0.0
715
+ end
716
+ end
717
+
718
+ class SelectionData
719
+ extend GLib::Deprecatable
720
+ define_deprecated_method :type, :data_type
721
+ end
722
+
723
+ class SizeGroup
724
+ extend GLib::Deprecatable
725
+ define_deprecated_enums :Mode
726
+ end
727
+
728
+ class SpinButton
729
+ extend GLib::Deprecatable
730
+ define_deprecated_enums :Type
731
+ define_deprecated_enums :UpdatePolicy, 'UPDATE'
732
+ end
733
+
734
+ class TextAttributes
735
+ extend GLib::Deprecatable
736
+ define_deprecated_method :realized?, :warn => "Don't use this method." do |_self|
737
+ false
738
+ end
739
+ define_deprecated_method :set_realized, :warn => "Don't use this method."
740
+ alias :realized= :set_realized
741
+ end
742
+
743
+ class TextBuffer
744
+ extend GLib::Deprecatable
745
+ define_deprecated_method :get_iter_at_line,
746
+ :warn => "Use '#{self}#get_iter_at(:line => nil)'." do |_self, line|
747
+ _self.get_iter_at(:line => line)
748
+ end
749
+ define_deprecated_method :get_iter_at_line_offset,
750
+ :warn => "Use '#{self}#get_iter_at(:line => nil, :offset => nil)'." do |_self, line, offset|
751
+ _self.get_iter_at(:line => line, :offset => offset)
752
+ end
753
+ define_deprecated_method :get_iter_at_line_index,
754
+ :warn => "Use '#{self}#get_iter_at(:line => nil, :index => nil)'." do |_self, line, index|
755
+ _self.get_iter_at(:line => line, :index => index)
756
+ end
757
+ define_deprecated_method :get_iter_at_offset,
758
+ :warn => "Use '#{self}#get_iter_at(:offset => nil)'." do |_self, offset|
759
+ _self.get_iter_at(:offset => offset)
760
+ end
761
+ define_deprecated_method :get_iter_at_mark,
762
+ :warn => "Use '#{self}#get_iter_at(:mark => nil)'." do |_self, mark|
763
+ _self.get_iter_at(:mark => mark)
764
+ end
765
+ define_deprecated_method :get_iter_at_child_anchor,
766
+ :warn => "Use '#{self}#get_iter_at(:anchor => nil)'." do |_self, anchor|
767
+ _self.get_iter_at(:anchor => anchor)
768
+ end
769
+ define_deprecated_method :insert_pixbuf, :insert
770
+ define_deprecated_method :insert_child_anchor, :insert
771
+ define_deprecated_method :insert_with_tags, :insert
772
+ end
773
+
774
+ class TextIter
775
+ extend GLib::Deprecatable
776
+ define_deprecated_flags :SearchFlags, 'SEARCH'
777
+ define_deprecated_method :backword_visible_word_start, :backward_visible_word_start
778
+ end
779
+
780
+ class TextTag
781
+ extend GLib::Deprecatable
782
+ define_deprecated_enums :WrapMode, 'WRAP'
783
+ end
784
+
785
+ class TextView
786
+ extend GLib::Deprecatable
787
+ define_deprecated_enums :WindowType, 'WINDOW'
788
+ end
789
+
790
+ class ToggleAction
791
+ extend GLib::Deprecatable
792
+ define_deprecated_method_by_hash_args :initialize,
793
+ 'name, label, tooltip = nil, stock_id = nil',
794
+ 'name, :label => nil, :tooltip => nil, :stock_id => nil', 1 do
795
+ |_self, name, label, tooltip, stock_id|
796
+ [name, {:label => label, :tooltip => tooltip, :stock_id => stock_id}]
797
+ end
798
+ end
799
+
800
+ class Toolbar
801
+ extend GLib::Deprecatable
802
+ define_deprecated_method :append, :warn => "Don't use this method."
803
+ define_deprecated_method :prepend, :warn => "Don't use this method."
804
+ define_deprecated_method :item_index, :get_item_index
805
+ define_deprecated_method :nth_item, :get_nth_item
806
+ define_deprecated_method :drop_index, :get_drop_index
807
+ define_deprecated_method :append_space, :warn => "Don't use this method."
808
+ define_deprecated_method :prepend_space, :warn => "Don't use this method."
809
+ define_deprecated_method :insert_space, :warn => "Don't use this method."
810
+ define_deprecated_method :remove_space, :warn => "Don't use this method."
811
+ end
812
+
813
+ class ToolButton
814
+ extend GLib::Deprecatable
815
+ define_deprecated_method_by_hash_args :initialize,
816
+ 'icon_widget_or_stock_id = nil, label = nil',
817
+ ':icon_widget => nil, :label => nil, :stock_id => nil' do
818
+ |_self, icon_widget_or_stock_id, label|
819
+ case icon_widget_or_stock_id
820
+ when String, Symbol
821
+ [{:stock_id => icon_widget_or_stock_id}]
822
+ when Gtk::Widget
823
+ [{:icon_widget => icon_widget_or_stock_id, :label => label}]
824
+ end
825
+ end
826
+ end
827
+
828
+ class Tooltip
829
+ extend GLib::Deprecatable
830
+ define_deprecated_method :set_icon_from_stock, :warn => "Use '#{self}#set_icon'." do |_self, stock_id, size|
831
+ _self.set_icon(:stock_id => stock_id, :size => size)
832
+ end
833
+ end
834
+
835
+ module TreeModel
836
+ extend GLib::Deprecatable
837
+ define_deprecated_flags :Flags
838
+ end
839
+
840
+ class TreeView
841
+ extend GLib::Deprecatable
842
+ define_deprecated_enums :DropPosition, 'DROP'
843
+ define_deprecated_enums :GridLines, 'GRID_LINES'
844
+ define_deprecated_method :widget_to_tree_coords, :convert_widget_to_bin_window_coords
845
+ define_deprecated_method :tree_to_widget_coords, :convert_bin_window_to_widget_coords
846
+ end
847
+
848
+ class TreeViewColumn
849
+ extend GLib::Deprecatable
850
+ define_deprecated_enums :Sizing
851
+ define_deprecated_method :cell_renderers, :warn => "Use 'Gtk::CellLayout#cells'." do |_self|
852
+ _self.cells
853
+ end
854
+ end
855
+
856
+ class UIManager
857
+ extend GLib::Deprecatable
858
+ define_deprecated_flags :ItemType
859
+ end
860
+
861
+ class VBox
862
+ extend GLib::Deprecatable
863
+ define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Box.new(:vertical, spacing)'." do |_self, homogeneous, spacing|
864
+ Gtk::Box.new(:vertical, spacing).set_homogeneous(homogeneous)
865
+ end
866
+ end
867
+
868
+ class VButtonBox
869
+ extend GLib::Deprecatable
870
+ define_deprecated_singleton_method :new, :warn => "Use 'Gtk::ButtonBox.new(:vertical)'." do |_self|
871
+ Gtk::ButtonBox.new(:vertical)
872
+ end
873
+ end
874
+
875
+ class VPaned
876
+ extend GLib::Deprecatable
877
+ define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Paned.new(:vertical)'." do |_self|
878
+ Gtk::Paned.new(:vertical)
879
+ end
880
+ end
881
+
882
+ class VScale
883
+ extend GLib::Deprecatable
884
+ define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Scale.new(:vertical, *args)'." do |_self, *args|
885
+ Gtk::Scale.new(:vertical, *args)
886
+ end
887
+ end
888
+
889
+ class VScrollbar
890
+ extend GLib::Deprecatable
891
+ define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Scrollbar.new(:vertical, adjustment)'." do |_self, adjustment|
892
+ Gtk::Scrollbar.new(:vertical, adjustment)
893
+ end
894
+ end
895
+
896
+ class VSeparator
897
+ extend GLib::Deprecatable
898
+ define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Separator.new(:vertical)'." do |_self|
899
+ Gtk::Separator.new(:vertical)
900
+ end
901
+ end
902
+
903
+ class Widget
904
+ extend GLib::Deprecatable
905
+ define_deprecated_enums :HelpType, 'HELP'
906
+ define_deprecated_enums :TextDirection, 'TEXT_DIR'
907
+ define_deprecated_singleton_method :push_colormap, :warn => "Don't use this method."
908
+ define_deprecated_singleton_method :pop_colormap, :warn => "Don't use this method."
909
+ define_deprecated_singleton_method :set_default_colormap, :warn => "Don't use this method."
910
+ class << self
911
+ alias :default_colormap= :set_default_colormap
912
+ end
913
+ define_deprecated_singleton_method :default_colormap, :raise => "Don't use this method."
914
+ define_deprecated_singleton_method :default_visual, :raise => "Don't use this method."
915
+ define_deprecated_singleton_method :default_style, :raise => "Use 'Gtk::StyleContext' and 'Gtk::CssProvider'."
916
+ define_deprecated_const :Flags, :raise => "Don't use this flags anymore."
917
+ define_deprecated_method :flags, :raise => "Use the proper method."
918
+ define_deprecated_method :set_flags, :warn => "Use the proper method."
919
+ alias :flags= :set_flags
920
+ define_deprecated_method :unset_flags, :warn => "Use the proper method."
921
+ define_deprecated_method :no_window?, :warn => "Use '#{self}#has_window?'." do |_self|
922
+ !_self.has_window?
923
+ end
924
+ define_deprecated_method :rc_style?, :has_rc_style?
925
+ define_deprecated_method :parent_sensitive?, :warn => "Use '#{self}#sensitive?' on the parent widget." do |_self|
926
+ _self.parent.sensitive?
927
+ end
928
+ define_deprecated_method :hide_all, :hide
929
+ define_deprecated_method :colormap, :raise => "Use '#{self}#visual'."
930
+ define_deprecated_method :set_colormap, :warn => "Use '#{self}#set_visual'."
931
+ alias :colormap= :set_colormap
932
+ define_deprecated_method :shape_combine_mask, :warn => "Don't use this method."
933
+ define_deprecated_method :input_shape_combine_mask, :warn => "Don't use this method."
934
+ define_deprecated_method :reset_shapes, :warn => "Don't use this method."
935
+ define_deprecated_method :set_scroll_adjustments, :warn => "Use 'Gtk::Scrollable#set_hadjustment' and 'Gtk::Scrollable#set_vadjustment'." do |_self, hadj, vadj|
936
+ _self.set_hadjustment(hadj)
937
+ _self.set_vadjustment(vadj)
938
+ true
939
+ end
940
+ alias :set_scroll_adjustment :set_scroll_adjustments
941
+ define_deprecated_method :action, :warn => "Use 'Gtk::Activatable#related_action'." do |_self|
942
+ _self.related_action
943
+ end
944
+ define_deprecated_method :size_request, :warn => "Use '#{self}#preferred_size'." do |_self|
945
+ _self.preferred_size.last
946
+ end
947
+ define_deprecated_method :child_requisition, :warn => "Use '#{self}#preferred_size'." do |_self|
948
+ _self.preferred_size.last
949
+ end
950
+ define_deprecated_method :set_state, :warn => "Use '#{self}#set_state_flags'."
951
+ alias :state= :set_state
952
+ define_deprecated_method :ensure_style, :warn => "Use 'Gtk::StyleContext'."
953
+ define_deprecated_method :reset_rc_styles, :warn => "Use '#{self}#reset_style'."
954
+ define_deprecated_method :class_path, :raise => "Use '#{self}#widget_path'."
955
+ define_deprecated_method :modify_style, :warn => "Use 'Gtk::StyleContext'."
956
+ define_deprecated_method :modifier_style, :raise => "Use 'Gtk::StyleContext'."
957
+ define_deprecated_method :modify_fg, :warn => "Use '#{self}#override_color'."
958
+ define_deprecated_method :modify_bg, :warn => "Use '#{self}#override_background_color'."
959
+ define_deprecated_method :modify_text, :warn => "Use '#{self}#override_color'."
960
+ define_deprecated_method :modify_base, :warn => "Use '#{self}#override_background_color'."
961
+ define_deprecated_method :modify_font, :warn => "Use '#{self}#override_font'."
962
+ define_deprecated_method :modify_cursor, :warn => "Use '#{self}#override_cursor'."
963
+ define_deprecated_method :render_icon, :warn => "Use '#{self}#render_icon_pixbuf'." do |_self, stock_id, size, detail|
964
+ _self.render_icon_pixbuf(stock_id, size)
965
+ end
966
+ define_deprecated_method :state, :raise => "Use '#{self}#state_flags'."
967
+ define_deprecated_method :has_rc_style?, :warn => "Use 'Gtk::StyleContext'." do |_self|
968
+ false
969
+ end
970
+ define_deprecated_method :requisition, :raise => "Don't use this method."
971
+ define_deprecated_method :set_requisition, :warn => "Don't use this method."
972
+ define_deprecated_method :saved_state, :raise => "Don't use this method."
973
+
974
+ alias :__set_allocation__ :set_allocation
975
+ private :__set_allocation__
976
+ def set_allocation(*args)
977
+ case args.size
978
+ when 1
979
+ __set_allocation__(args.first)
980
+ when 4
981
+ warn "#{caller[0]}: '#{self.class}#set_allocation(x, y, width, height)' style has been deprecated. Use '#{self.class}#set_allocation(alloc)' style."
982
+ __set_allocation__(Gtk::Allocation.new(*args))
983
+ else
984
+ raise ArgumentError.new("need 1 or 4 arguments.")
985
+ end
986
+ end
987
+
988
+ define_deprecated_signal :expose_event, :warn => "Use '#{self}::draw' signal."
989
+ define_deprecated_signal :state_changed, :warn => "Use '#{self}::state-flags-changed' signal."
990
+ define_deprecated_signal :style_set, :warn => "Use '#{self}::style-updated' signal."
991
+ end
992
+
993
+ class Window
994
+ extend GLib::Deprecatable
995
+ define_deprecated_enums :Position, 'POS'
996
+ define_deprecated_enums :Type
997
+ define_deprecated_method :active_focus, :activate_focus
998
+ define_deprecated_method :active_default, :activate_default
999
+ end
1000
+ end
1001
+