rock-qtbindings 4.8.6.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (768) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.txt +85 -0
  3. data/COPYING.LIB.txt +510 -0
  4. data/COPYING.txt +286 -0
  5. data/KNOWN_ISSUES.txt +17 -0
  6. data/Rakefile +121 -0
  7. data/TODO.txt +2 -0
  8. data/bin/rbqtapi +152 -0
  9. data/bin/rbrcc +14 -0
  10. data/bin/rbuic4 +14 -0
  11. data/bin/smokeapi +14 -0
  12. data/bin/smokedeptool +14 -0
  13. data/examples/designer/calculatorbuilder/calculatorbuilder.qrc +5 -0
  14. data/examples/designer/calculatorbuilder/calculatorform.rb +60 -0
  15. data/examples/designer/calculatorbuilder/calculatorform.ui +299 -0
  16. data/examples/designer/calculatorbuilder/main.rb +34 -0
  17. data/examples/designer/calculatorbuilder/makefile +2 -0
  18. data/examples/designer/calculatorform/calculatorform.rb +46 -0
  19. data/examples/designer/calculatorform/calculatorform.ui +277 -0
  20. data/examples/designer/calculatorform/main.rb +32 -0
  21. data/examples/designer/calculatorform/makefile +3 -0
  22. data/examples/desktop/screenshot/main.rb +32 -0
  23. data/examples/desktop/screenshot/screenshot.rb +157 -0
  24. data/examples/desktop/systray/images/bad.svg +64 -0
  25. data/examples/desktop/systray/images/heart.svg +55 -0
  26. data/examples/desktop/systray/images/trash.svg +58 -0
  27. data/examples/desktop/systray/main.rb +41 -0
  28. data/examples/desktop/systray/makefile +2 -0
  29. data/examples/desktop/systray/systray.qrc +7 -0
  30. data/examples/desktop/systray/window.rb +219 -0
  31. data/examples/dialogs/complexwizard/complexwizard.rb +140 -0
  32. data/examples/dialogs/complexwizard/licensewizard.rb +294 -0
  33. data/examples/dialogs/complexwizard/main.rb +31 -0
  34. data/examples/dialogs/configdialog/configdialog.rb +109 -0
  35. data/examples/dialogs/configdialog/images/config.png +0 -0
  36. data/examples/dialogs/configdialog/images/query.png +0 -0
  37. data/examples/dialogs/configdialog/images/update.png +0 -0
  38. data/examples/dialogs/configdialog/main.rb +31 -0
  39. data/examples/dialogs/configdialog/pages.rb +140 -0
  40. data/examples/dialogs/extension/finddialog.rb +89 -0
  41. data/examples/dialogs/extension/main.rb +31 -0
  42. data/examples/dialogs/findfiles/main.rb +32 -0
  43. data/examples/dialogs/findfiles/window.rb +177 -0
  44. data/examples/dialogs/simplewizard/classwizard.rb +374 -0
  45. data/examples/dialogs/simplewizard/main.rb +31 -0
  46. data/examples/dialogs/simplewizard/simplewizard.rb +110 -0
  47. data/examples/dialogs/standarddialogs/dialog.rb +340 -0
  48. data/examples/dialogs/standarddialogs/main.rb +31 -0
  49. data/examples/dialogs/tabdialog/main.rb +38 -0
  50. data/examples/dialogs/tabdialog/tabdialog.rb +178 -0
  51. data/examples/draganddrop/draggableicons/dragwidget.rb +125 -0
  52. data/examples/draganddrop/draggableicons/images/boat.png +0 -0
  53. data/examples/draganddrop/draggableicons/images/car.png +0 -0
  54. data/examples/draganddrop/draggableicons/images/house.png +0 -0
  55. data/examples/draganddrop/draggableicons/main.rb +41 -0
  56. data/examples/draganddrop/draggabletext/draglabel.rb +51 -0
  57. data/examples/draganddrop/draggabletext/dragwidget.rb +94 -0
  58. data/examples/draganddrop/draggabletext/main.rb +33 -0
  59. data/examples/draganddrop/draggabletext/words.txt +41 -0
  60. data/examples/draganddrop/dropsite/dropsitewidget.rb +99 -0
  61. data/examples/draganddrop/dropsite/dropsitewindow.rb +114 -0
  62. data/examples/draganddrop/dropsite/main.rb +33 -0
  63. data/examples/draganddrop/fridgemagnets/draglabel.rb +78 -0
  64. data/examples/draganddrop/fridgemagnets/dragwidget.rb +130 -0
  65. data/examples/draganddrop/fridgemagnets/main.rb +33 -0
  66. data/examples/draganddrop/fridgemagnets/words.txt +48 -0
  67. data/examples/draganddrop/puzzle/example.jpg +0 -0
  68. data/examples/draganddrop/puzzle/main.rb +33 -0
  69. data/examples/draganddrop/puzzle/mainwindow.rb +136 -0
  70. data/examples/draganddrop/puzzle/pieceslist.rb +95 -0
  71. data/examples/draganddrop/puzzle/puzzlewidget.rb +190 -0
  72. data/examples/graphicsview/collidingmice/images/cheese.jpg +0 -0
  73. data/examples/graphicsview/collidingmice/main.rb +53 -0
  74. data/examples/graphicsview/collidingmice/makefile +2 -0
  75. data/examples/graphicsview/collidingmice/mice.qrc +5 -0
  76. data/examples/graphicsview/collidingmice/mouse.rb +176 -0
  77. data/examples/graphicsview/dragdroprobot/coloritem.rb +86 -0
  78. data/examples/graphicsview/dragdroprobot/images/head.png +0 -0
  79. data/examples/graphicsview/dragdroprobot/main.rb +57 -0
  80. data/examples/graphicsview/dragdroprobot/makefile +2 -0
  81. data/examples/graphicsview/dragdroprobot/robot.qrc +5 -0
  82. data/examples/graphicsview/dragdroprobot/robot.rb +246 -0
  83. data/examples/itemviews/chart/chart.qrc +5 -0
  84. data/examples/itemviews/chart/main.rb +33 -0
  85. data/examples/itemviews/chart/mainwindow.rb +151 -0
  86. data/examples/itemviews/chart/makefile +2 -0
  87. data/examples/itemviews/chart/mydata.cht +8 -0
  88. data/examples/itemviews/chart/pieview.rb +516 -0
  89. data/examples/itemviews/chart/qtdata.cht +14 -0
  90. data/examples/itemviews/dirview/main.rb +39 -0
  91. data/examples/itemviews/pixelator/imagemodel.rb +51 -0
  92. data/examples/itemviews/pixelator/images/qt.png +0 -0
  93. data/examples/itemviews/pixelator/images.qrc +5 -0
  94. data/examples/itemviews/pixelator/main.rb +34 -0
  95. data/examples/itemviews/pixelator/mainwindow.rb +218 -0
  96. data/examples/itemviews/pixelator/makefile +3 -0
  97. data/examples/itemviews/pixelator/pixeldelegate.rb +67 -0
  98. data/examples/itemviews/puzzle/example.jpg +0 -0
  99. data/examples/itemviews/puzzle/main.rb +36 -0
  100. data/examples/itemviews/puzzle/mainwindow.rb +143 -0
  101. data/examples/itemviews/puzzle/piecesmodel.rb +174 -0
  102. data/examples/itemviews/puzzle/puzzlewidget.rb +192 -0
  103. data/examples/itemviews/simpledommodel/domitem.rb +62 -0
  104. data/examples/itemviews/simpledommodel/dommodel.rb +139 -0
  105. data/examples/itemviews/simpledommodel/main.rb +33 -0
  106. data/examples/itemviews/simpledommodel/mainwindow.rb +66 -0
  107. data/examples/itemviews/simpletreemodel/default.txt +40 -0
  108. data/examples/itemviews/simpletreemodel/main.rb +41 -0
  109. data/examples/itemviews/simpletreemodel/makefile +2 -0
  110. data/examples/itemviews/simpletreemodel/simpletreemodel.qrc +5 -0
  111. data/examples/itemviews/simpletreemodel/treeitem.rb +67 -0
  112. data/examples/itemviews/simpletreemodel/treemodel.rb +164 -0
  113. data/examples/itemviews/sortingmodel/default.txt +40 -0
  114. data/examples/itemviews/sortingmodel/main.rb +53 -0
  115. data/examples/itemviews/sortingmodel/treeitem.rb +73 -0
  116. data/examples/itemviews/sortingmodel/treemodel.rb +166 -0
  117. data/examples/itemviews/spinboxdelegate/main.rb +47 -0
  118. data/examples/itemviews/spinboxdelegate/spinboxdelegate.rb +62 -0
  119. data/examples/killerfilter/killerfilter.rb +55 -0
  120. data/examples/layouts/basiclayouts/dialog.rb +110 -0
  121. data/examples/layouts/basiclayouts/main.rb +31 -0
  122. data/examples/layouts/borderlayout/borderlayout.rb +190 -0
  123. data/examples/layouts/borderlayout/main.rb +32 -0
  124. data/examples/layouts/borderlayout/window.rb +52 -0
  125. data/examples/layouts/flowlayouts/flowlayout.rb +108 -0
  126. data/examples/layouts/flowlayouts/main.rb +32 -0
  127. data/examples/layouts/flowlayouts/window.rb +43 -0
  128. data/examples/mainwindows/application/images/copy.png +0 -0
  129. data/examples/mainwindows/application/images/cut.png +0 -0
  130. data/examples/mainwindows/application/images/new.png +0 -0
  131. data/examples/mainwindows/application/images/open.png +0 -0
  132. data/examples/mainwindows/application/images/paste.png +0 -0
  133. data/examples/mainwindows/application/images/save.png +0 -0
  134. data/examples/mainwindows/application/main.rb +32 -0
  135. data/examples/mainwindows/application/mainwindow.rb +285 -0
  136. data/examples/mainwindows/dockwidgets/images/new.png +0 -0
  137. data/examples/mainwindows/dockwidgets/images/print.png +0 -0
  138. data/examples/mainwindows/dockwidgets/images/save.png +0 -0
  139. data/examples/mainwindows/dockwidgets/images/undo.png +0 -0
  140. data/examples/mainwindows/dockwidgets/main.rb +32 -0
  141. data/examples/mainwindows/dockwidgets/mainwindow.rb +302 -0
  142. data/examples/mainwindows/mdi/images/copy.png +0 -0
  143. data/examples/mainwindows/mdi/images/cut.png +0 -0
  144. data/examples/mainwindows/mdi/images/new.png +0 -0
  145. data/examples/mainwindows/mdi/images/open.png +0 -0
  146. data/examples/mainwindows/mdi/images/paste.png +0 -0
  147. data/examples/mainwindows/mdi/images/save.png +0 -0
  148. data/examples/mainwindows/mdi/main.rb +32 -0
  149. data/examples/mainwindows/mdi/mainwindow.rb +363 -0
  150. data/examples/mainwindows/mdi/mdichild.rb +152 -0
  151. data/examples/mainwindows/menus/main.rb +32 -0
  152. data/examples/mainwindows/menus/mainwindow.rb +327 -0
  153. data/examples/mainwindows/recentfiles/main.rb +32 -0
  154. data/examples/mainwindows/recentfiles/mainwindow.rb +258 -0
  155. data/examples/mainwindows/sdi/images/copy.png +0 -0
  156. data/examples/mainwindows/sdi/images/cut.png +0 -0
  157. data/examples/mainwindows/sdi/images/new.png +0 -0
  158. data/examples/mainwindows/sdi/images/open.png +0 -0
  159. data/examples/mainwindows/sdi/images/paste.png +0 -0
  160. data/examples/mainwindows/sdi/images/save.png +0 -0
  161. data/examples/mainwindows/sdi/main.rb +32 -0
  162. data/examples/mainwindows/sdi/mainwindow.rb +335 -0
  163. data/examples/network/broadcastreceiver/main.rb +32 -0
  164. data/examples/network/broadcastreceiver/receiver.rb +64 -0
  165. data/examples/network/broadcastsender/main.rb +32 -0
  166. data/examples/network/broadcastsender/sender.rb +72 -0
  167. data/examples/network/fortuneclient/client.rb +149 -0
  168. data/examples/network/fortuneclient/main.rb +32 -0
  169. data/examples/network/fortuneserver/main.rb +32 -0
  170. data/examples/network/fortuneserver/server.rb +88 -0
  171. data/examples/network/ftp/ftpwindow.rb +259 -0
  172. data/examples/network/ftp/images/cdtoparent.png +0 -0
  173. data/examples/network/ftp/images/dir.png +0 -0
  174. data/examples/network/ftp/images/file.png +0 -0
  175. data/examples/network/ftp/main.rb +32 -0
  176. data/examples/network/http/httpwindow.rb +187 -0
  177. data/examples/network/http/main.rb +32 -0
  178. data/examples/network/loopback/dialog.rb +163 -0
  179. data/examples/network/loopback/main.rb +32 -0
  180. data/examples/opengl/grabber/glwidget.rb +265 -0
  181. data/examples/opengl/grabber/main.rb +32 -0
  182. data/examples/opengl/grabber/mainwindow.rb +189 -0
  183. data/examples/opengl/hellogl/glwidget.rb +226 -0
  184. data/examples/opengl/hellogl/main.rb +32 -0
  185. data/examples/opengl/hellogl/window.rb +66 -0
  186. data/examples/opengl/textures/glwidget.rb +151 -0
  187. data/examples/opengl/textures/images/side1.png +0 -0
  188. data/examples/opengl/textures/images/side2.png +0 -0
  189. data/examples/opengl/textures/images/side3.png +0 -0
  190. data/examples/opengl/textures/images/side4.png +0 -0
  191. data/examples/opengl/textures/images/side5.png +0 -0
  192. data/examples/opengl/textures/images/side6.png +0 -0
  193. data/examples/opengl/textures/main.rb +32 -0
  194. data/examples/opengl/textures/window.rb +77 -0
  195. data/examples/painting/basicdrawing/images/brick.png +0 -0
  196. data/examples/painting/basicdrawing/images/qt-logo.png +0 -0
  197. data/examples/painting/basicdrawing/main.rb +32 -0
  198. data/examples/painting/basicdrawing/renderarea.rb +166 -0
  199. data/examples/painting/basicdrawing/window.rb +215 -0
  200. data/examples/painting/concentriccircles/circlewidget.rb +88 -0
  201. data/examples/painting/concentriccircles/main.rb +32 -0
  202. data/examples/painting/concentriccircles/window.rb +72 -0
  203. data/examples/painting/fontsampler/main.rb +32 -0
  204. data/examples/painting/fontsampler/mainwindow.rb +369 -0
  205. data/examples/painting/fontsampler/mainwindowbase.ui +136 -0
  206. data/examples/painting/fontsampler/makefile +8 -0
  207. data/examples/painting/fontsampler/previewdialog.rb +257 -0
  208. data/examples/painting/fontsampler/previewdialogbase.ui +224 -0
  209. data/examples/painting/fontsampler/previewlabel.rb +43 -0
  210. data/examples/painting/imagecomposition/imagecomposer.rb +152 -0
  211. data/examples/painting/imagecomposition/imagecomposition.qrc +6 -0
  212. data/examples/painting/imagecomposition/images/background.png +0 -0
  213. data/examples/painting/imagecomposition/images/blackrectangle.png +0 -0
  214. data/examples/painting/imagecomposition/images/butterfly.png +0 -0
  215. data/examples/painting/imagecomposition/images/checker.png +0 -0
  216. data/examples/painting/imagecomposition/main.rb +33 -0
  217. data/examples/painting/imagecomposition/makefile +2 -0
  218. data/examples/painting/painterpaths/main.rb +32 -0
  219. data/examples/painting/painterpaths/renderarea.rb +97 -0
  220. data/examples/painting/painterpaths/window.rb +247 -0
  221. data/examples/painting/svgviewer/files/bubbles.svg +212 -0
  222. data/examples/painting/svgviewer/files/cubic.svg +77 -0
  223. data/examples/painting/svgviewer/files/spheres.svg +79 -0
  224. data/examples/painting/svgviewer/main.rb +38 -0
  225. data/examples/painting/svgviewer/mainwindow.rb +99 -0
  226. data/examples/painting/svgviewer/makefile +2 -0
  227. data/examples/painting/svgviewer/svgview.rb +156 -0
  228. data/examples/painting/svgviewer/svgviewer.qrc +6 -0
  229. data/examples/painting/svgviewer/svgwindow.rb +87 -0
  230. data/examples/painting/transformations/main.rb +32 -0
  231. data/examples/painting/transformations/renderarea.rb +127 -0
  232. data/examples/painting/transformations/window.rb +153 -0
  233. data/examples/passivepopup/passivepopup.rb +38 -0
  234. data/examples/qdbus/chat/chat.rb +146 -0
  235. data/examples/qdbus/chat/chat_adaptor.rb +12 -0
  236. data/examples/qdbus/chat/chat_interface.rb +13 -0
  237. data/examples/qdbus/chat/chatmainwindow.ui +184 -0
  238. data/examples/qdbus/chat/chatsetnickname.ui +145 -0
  239. data/examples/qdbus/chat/makefile +8 -0
  240. data/examples/qdbus/complexpingpong/complexping.rb +92 -0
  241. data/examples/qdbus/complexpingpong/complexpong.rb +83 -0
  242. data/examples/qdbus/complexpingpong/ping-common.rb +1 -0
  243. data/examples/qdbus/listnames/listnames.rb +69 -0
  244. data/examples/qdbus/pingpong/ping-common.rb +1 -0
  245. data/examples/qdbus/pingpong/ping.rb +52 -0
  246. data/examples/qdbus/pingpong/pong.rb +55 -0
  247. data/examples/qdbus/remotecontrolledcar/car/car.rb +151 -0
  248. data/examples/qdbus/remotecontrolledcar/car/main.rb +50 -0
  249. data/examples/qdbus/remotecontrolledcar/controller/controller.rb +66 -0
  250. data/examples/qdbus/remotecontrolledcar/controller/controller.ui +61 -0
  251. data/examples/qdbus/remotecontrolledcar/controller/main.rb +32 -0
  252. data/examples/qdbus/remotecontrolledcar/controller/makefile +2 -0
  253. data/examples/qtscribble/scribble.rb +270 -0
  254. data/examples/richtext/calendar/main.rb +33 -0
  255. data/examples/richtext/calendar/mainwindow.rb +173 -0
  256. data/examples/richtext/orderform/detailsdialog.rb +130 -0
  257. data/examples/richtext/orderform/main.rb +34 -0
  258. data/examples/richtext/orderform/mainwindow.rb +194 -0
  259. data/examples/richtext/syntaxhighlighter/examples/example +79 -0
  260. data/examples/richtext/syntaxhighlighter/highlighter.rb +90 -0
  261. data/examples/richtext/syntaxhighlighter/main.rb +34 -0
  262. data/examples/richtext/syntaxhighlighter/mainwindow.rb +105 -0
  263. data/examples/ruboids/LICENSE.txt +58 -0
  264. data/examples/ruboids/Manifest +26 -0
  265. data/examples/ruboids/README +53 -0
  266. data/examples/ruboids/TODO +29 -0
  267. data/examples/ruboids/boids.properties +33 -0
  268. data/examples/ruboids/generateManifest.rb +42 -0
  269. data/examples/ruboids/index.html +147 -0
  270. data/examples/ruboids/release.rb +152 -0
  271. data/examples/ruboids/ruboids/Boid.rb +141 -0
  272. data/examples/ruboids/ruboids/BoidView.rb +159 -0
  273. data/examples/ruboids/ruboids/Camera.rb +24 -0
  274. data/examples/ruboids/ruboids/CameraDialog.rb +218 -0
  275. data/examples/ruboids/ruboids/Canvas.rb +143 -0
  276. data/examples/ruboids/ruboids/Cloud.rb +61 -0
  277. data/examples/ruboids/ruboids/CloudView.rb +54 -0
  278. data/examples/ruboids/ruboids/Flock.rb +47 -0
  279. data/examples/ruboids/ruboids/Graphics.rb +278 -0
  280. data/examples/ruboids/ruboids/Params.rb +87 -0
  281. data/examples/ruboids/ruboids/Point.rb +153 -0
  282. data/examples/ruboids/ruboids/Thing.rb +34 -0
  283. data/examples/ruboids/ruboids/Triangle.rb +21 -0
  284. data/examples/ruboids/ruboids/View.rb +88 -0
  285. data/examples/ruboids/ruboids/World.rb +82 -0
  286. data/examples/ruboids/ruboids/WorldWindow.rb +52 -0
  287. data/examples/ruboids/ruboids/info.rb +12 -0
  288. data/examples/ruboids/ruboids/ruboids.rb +29 -0
  289. data/examples/run_all.rb +15 -0
  290. data/examples/threading/main_thread.rb +19 -0
  291. data/examples/tutorial/t1/t1.rb +10 -0
  292. data/examples/tutorial/t10/cannon.rb +72 -0
  293. data/examples/tutorial/t10/lcdrange.rb +45 -0
  294. data/examples/tutorial/t10/t10.rb +55 -0
  295. data/examples/tutorial/t11/cannon.rb +123 -0
  296. data/examples/tutorial/t11/lcdrange.rb +45 -0
  297. data/examples/tutorial/t11/t11.rb +65 -0
  298. data/examples/tutorial/t12/cannon.rb +157 -0
  299. data/examples/tutorial/t12/lcdrange.rb +58 -0
  300. data/examples/tutorial/t12/t12.rb +65 -0
  301. data/examples/tutorial/t13/cannon.rb +206 -0
  302. data/examples/tutorial/t13/gamebrd.rb +112 -0
  303. data/examples/tutorial/t13/lcdrange.rb +59 -0
  304. data/examples/tutorial/t13/t13.rb +11 -0
  305. data/examples/tutorial/t14/cannon.rb +262 -0
  306. data/examples/tutorial/t14/gamebrd.rb +122 -0
  307. data/examples/tutorial/t14/lcdrange.rb +61 -0
  308. data/examples/tutorial/t14/t14.rb +11 -0
  309. data/examples/tutorial/t2/t2.rb +16 -0
  310. data/examples/tutorial/t3/t3.rb +17 -0
  311. data/examples/tutorial/t4/t4.rb +23 -0
  312. data/examples/tutorial/t5/t5.rb +35 -0
  313. data/examples/tutorial/t6/t6.rb +48 -0
  314. data/examples/tutorial/t7/lcdrange.rb +32 -0
  315. data/examples/tutorial/t7/t7.rb +40 -0
  316. data/examples/tutorial/t8/cannon.rb +37 -0
  317. data/examples/tutorial/t8/lcdrange.rb +45 -0
  318. data/examples/tutorial/t8/t8.rb +43 -0
  319. data/examples/tutorial/t9/cannon.rb +44 -0
  320. data/examples/tutorial/t9/lcdrange.rb +46 -0
  321. data/examples/tutorial/t9/t9.rb +43 -0
  322. data/examples/widgets/analogclock/analogclock.rb +94 -0
  323. data/examples/widgets/analogclock/main.rb +9 -0
  324. data/examples/widgets/calculator/button.rb +45 -0
  325. data/examples/widgets/calculator/calculator.rb +382 -0
  326. data/examples/widgets/calculator/main.rb +32 -0
  327. data/examples/widgets/charactermap/characterwidget.rb +110 -0
  328. data/examples/widgets/charactermap/main.rb +32 -0
  329. data/examples/widgets/charactermap/mainwindow.rb +118 -0
  330. data/examples/widgets/digitalclock/digitalclock.rb +30 -0
  331. data/examples/widgets/digitalclock/main.rb +9 -0
  332. data/examples/widgets/groupbox/main.rb +32 -0
  333. data/examples/widgets/groupbox/window.rb +134 -0
  334. data/examples/widgets/icons/iconpreviewarea.rb +111 -0
  335. data/examples/widgets/icons/iconsizespinbox.rb +39 -0
  336. data/examples/widgets/icons/imagedelegate.rb +73 -0
  337. data/examples/widgets/icons/images/designer.png +0 -0
  338. data/examples/widgets/icons/images/find_disabled.png +0 -0
  339. data/examples/widgets/icons/images/find_normal.png +0 -0
  340. data/examples/widgets/icons/images/monkey_off_128x128.png +0 -0
  341. data/examples/widgets/icons/images/monkey_off_16x16.png +0 -0
  342. data/examples/widgets/icons/images/monkey_off_32x32.png +0 -0
  343. data/examples/widgets/icons/images/monkey_off_64x64.png +0 -0
  344. data/examples/widgets/icons/images/monkey_on_128x128.png +0 -0
  345. data/examples/widgets/icons/images/monkey_on_16x16.png +0 -0
  346. data/examples/widgets/icons/images/monkey_on_32x32.png +0 -0
  347. data/examples/widgets/icons/images/monkey_on_64x64.png +0 -0
  348. data/examples/widgets/icons/images/qtopia_16x16.png +0 -0
  349. data/examples/widgets/icons/images/qtopia_32x32.png +0 -0
  350. data/examples/widgets/icons/images/qtopia_48x48.png +0 -0
  351. data/examples/widgets/icons/main.rb +32 -0
  352. data/examples/widgets/icons/mainwindow.rb +351 -0
  353. data/examples/widgets/imageviewer/imageviewer.rb +219 -0
  354. data/examples/widgets/imageviewer/main.rb +32 -0
  355. data/examples/widgets/lineedits/main.rb +32 -0
  356. data/examples/widgets/lineedits/window.rb +199 -0
  357. data/examples/widgets/movie/images/open.png +0 -0
  358. data/examples/widgets/movie/images/pause.png +0 -0
  359. data/examples/widgets/movie/images/play.png +0 -0
  360. data/examples/widgets/movie/images/quit.png +0 -0
  361. data/examples/widgets/movie/images/stop.png +0 -0
  362. data/examples/widgets/movie/main.rb +32 -0
  363. data/examples/widgets/movie/movieplayer.rb +201 -0
  364. data/examples/widgets/movie/movies/fire.mng +0 -0
  365. data/examples/widgets/screenshot/main.rb +32 -0
  366. data/examples/widgets/screenshot/screenshot.rb +155 -0
  367. data/examples/widgets/scribble/main.rb +32 -0
  368. data/examples/widgets/scribble/mainwindow.rb +202 -0
  369. data/examples/widgets/scribble/scribblearea.rb +154 -0
  370. data/examples/widgets/sliders/main.rb +32 -0
  371. data/examples/widgets/sliders/slidersgroup.rb +97 -0
  372. data/examples/widgets/sliders/window.rb +124 -0
  373. data/examples/widgets/spinboxes/main.rb +32 -0
  374. data/examples/widgets/spinboxes/window.rb +213 -0
  375. data/examples/widgets/tetrix/main.rb +33 -0
  376. data/examples/widgets/tetrix/tetrixboard.rb +346 -0
  377. data/examples/widgets/tetrix/tetrixpiece.rb +135 -0
  378. data/examples/widgets/tetrix/tetrixwindow.rb +88 -0
  379. data/examples/widgets/tooltips/images/circle.png +0 -0
  380. data/examples/widgets/tooltips/images/square.png +0 -0
  381. data/examples/widgets/tooltips/images/triangle.png +0 -0
  382. data/examples/widgets/tooltips/main.rb +32 -0
  383. data/examples/widgets/tooltips/shapeitem.rb +31 -0
  384. data/examples/widgets/tooltips/sortingbox.rb +222 -0
  385. data/examples/widgets/wiggly/dialog.rb +48 -0
  386. data/examples/widgets/wiggly/main.rb +9 -0
  387. data/examples/widgets/wiggly/wigglywidget.rb +76 -0
  388. data/examples/widgets/windowflags/controllerwindow.rb +195 -0
  389. data/examples/widgets/windowflags/main.rb +32 -0
  390. data/examples/widgets/windowflags/previewwindow.rb +103 -0
  391. data/examples/xml/dombookmarks/frank.xbel +230 -0
  392. data/examples/xml/dombookmarks/jennifer.xbel +93 -0
  393. data/examples/xml/dombookmarks/main.rb +34 -0
  394. data/examples/xml/dombookmarks/mainwindow.rb +129 -0
  395. data/examples/xml/dombookmarks/xbeltree.rb +172 -0
  396. data/examples/xml/saxbookmarks/frank.xbel +230 -0
  397. data/examples/xml/saxbookmarks/jennifer.xbel +93 -0
  398. data/examples/xml/saxbookmarks/main.rb +34 -0
  399. data/examples/xml/saxbookmarks/mainwindow.rb +144 -0
  400. data/examples/xml/saxbookmarks/xbelgenerator.rb +95 -0
  401. data/examples/xml/saxbookmarks/xbelhandler.rb +122 -0
  402. data/ext/CMakeLists.txt +28 -0
  403. data/ext/cmake/modules/BasicFindPackageVersion.cmake.in +30 -0
  404. data/ext/cmake/modules/CMakeCSharpCompiler.cmake.in +7 -0
  405. data/ext/cmake/modules/CMakeCSharpInformation.cmake +366 -0
  406. data/ext/cmake/modules/CMakeDetermineCSharpCompiler.cmake +85 -0
  407. data/ext/cmake/modules/CMakeTestCSharpCompiler.cmake +1 -0
  408. data/ext/cmake/modules/CheckCXXSourceCompiles.cmake +68 -0
  409. data/ext/cmake/modules/FindLibraryWithDebug.cmake +113 -0
  410. data/ext/cmake/modules/FindMono.cmake +36 -0
  411. data/ext/cmake/modules/FindPHP5.cmake +179 -0
  412. data/ext/cmake/modules/FindPerlMore.cmake +78 -0
  413. data/ext/cmake/modules/FindPhonon.cmake +71 -0
  414. data/ext/cmake/modules/FindQImageBlitz.cmake +51 -0
  415. data/ext/cmake/modules/FindQScintilla.cmake +57 -0
  416. data/ext/cmake/modules/FindQt4.cmake +1275 -0
  417. data/ext/cmake/modules/FindQwt5.cmake +104 -0
  418. data/ext/cmake/modules/FindRuby.cmake +279 -0
  419. data/ext/cmake/modules/FindSmoke.cmake +78 -0
  420. data/ext/cmake/modules/HandleImportedTargetsInCMakeRequiredLibraries.cmake +85 -0
  421. data/ext/cmake/modules/MacroLogFeature.cmake +146 -0
  422. data/ext/cmake/modules/MacroOptionalAddBindings.cmake +47 -0
  423. data/ext/cmake/modules/MacroOptionalFindPackage.cmake +28 -0
  424. data/ext/cmake/modules/MacroPushRequiredVars.cmake +47 -0
  425. data/ext/cmake/modules/MacroWriteBasicCMakeVersionFile.cmake +22 -0
  426. data/ext/cmake/modules/Qt4ConfigDependentSettings.cmake +384 -0
  427. data/ext/cmake/modules/Qt4Macros.cmake +414 -0
  428. data/ext/cmake/modules/SmokeConfig.cmake.in +109 -0
  429. data/ext/generator/CMakeLists.txt +38 -0
  430. data/ext/generator/cmake/BasicFindPackageVersion.cmake.in +30 -0
  431. data/ext/generator/cmake/CMakeLists.txt +24 -0
  432. data/ext/generator/cmake/FindLibraryWithDebug.cmake +113 -0
  433. data/ext/generator/cmake/FindPhonon.cmake +71 -0
  434. data/ext/generator/cmake/FindQImageBlitz.cmake +51 -0
  435. data/ext/generator/cmake/FindQScintilla.cmake +57 -0
  436. data/ext/generator/cmake/FindQwt5.cmake +104 -0
  437. data/ext/generator/cmake/HandleImportedTargetsInCMakeRequiredLibraries.cmake +85 -0
  438. data/ext/generator/cmake/MacroLogFeature.cmake +146 -0
  439. data/ext/generator/cmake/MacroOptionalAddBindings.cmake +47 -0
  440. data/ext/generator/cmake/MacroOptionalFindPackage.cmake +28 -0
  441. data/ext/generator/cmake/MacroWriteBasicCMakeVersionFile.cmake +22 -0
  442. data/ext/generator/cmake/SmokeConfig.cmake.in +109 -0
  443. data/ext/generator/config.h +25 -0
  444. data/ext/generator/generator_export.h +31 -0
  445. data/ext/generator/generatorenvironment.cpp +52 -0
  446. data/ext/generator/generatorenvironment.h +35 -0
  447. data/ext/generator/generatorpreprocessor.cpp +303 -0
  448. data/ext/generator/generatorpreprocessor.h +83 -0
  449. data/ext/generator/generators/CMakeLists.txt +4 -0
  450. data/ext/generator/generators/dump/CMakeLists.txt +15 -0
  451. data/ext/generator/generators/dump/generator_dump.cpp +36 -0
  452. data/ext/generator/generators/smoke/CMakeLists.txt +18 -0
  453. data/ext/generator/generators/smoke/generator_smoke.cpp +240 -0
  454. data/ext/generator/generators/smoke/globals.h +140 -0
  455. data/ext/generator/generators/smoke/helpers.cpp +793 -0
  456. data/ext/generator/generators/smoke/writeClasses.cpp +502 -0
  457. data/ext/generator/generators/smoke/writeSmokeDataFile.cpp +754 -0
  458. data/ext/generator/generatorvisitor.cpp +922 -0
  459. data/ext/generator/generatorvisitor.h +119 -0
  460. data/ext/generator/main.cpp +243 -0
  461. data/ext/generator/name_compiler.cpp +205 -0
  462. data/ext/generator/name_compiler.h +76 -0
  463. data/ext/generator/options.cpp +33 -0
  464. data/ext/generator/options.h +46 -0
  465. data/ext/generator/parser/CMakeLists.txt +50 -0
  466. data/ext/generator/parser/ast.cpp +21 -0
  467. data/ext/generator/parser/ast.h +923 -0
  468. data/ext/generator/parser/astutilities.h +65 -0
  469. data/ext/generator/parser/codegenerator.cpp +867 -0
  470. data/ext/generator/parser/codegenerator.h +180 -0
  471. data/ext/generator/parser/codemodel_fwd.h +76 -0
  472. data/ext/generator/parser/commentformatter.cpp +54 -0
  473. data/ext/generator/parser/commentformatter.h +45 -0
  474. data/ext/generator/parser/commentparser.cpp +109 -0
  475. data/ext/generator/parser/commentparser.h +84 -0
  476. data/ext/generator/parser/control.cpp +40 -0
  477. data/ext/generator/parser/control.h +51 -0
  478. data/ext/generator/parser/cppparser_export.h +33 -0
  479. data/ext/generator/parser/default_visitor.cpp +470 -0
  480. data/ext/generator/parser/default_visitor.h +116 -0
  481. data/ext/generator/parser/dumptree.cpp +146 -0
  482. data/ext/generator/parser/dumptree.h +50 -0
  483. data/ext/generator/parser/indexedstring.cpp +213 -0
  484. data/ext/generator/parser/indexedstring.h +147 -0
  485. data/ext/generator/parser/kdevelop-parser-rev +1 -0
  486. data/ext/generator/parser/kdevvarlengtharray.h +346 -0
  487. data/ext/generator/parser/lexer.cpp +964 -0
  488. data/ext/generator/parser/lexer.h +308 -0
  489. data/ext/generator/parser/listnode.cpp +20 -0
  490. data/ext/generator/parser/listnode.h +97 -0
  491. data/ext/generator/parser/memorypool.cpp +20 -0
  492. data/ext/generator/parser/memorypool.h +41 -0
  493. data/ext/generator/parser/name_compiler.cpp +190 -0
  494. data/ext/generator/parser/name_compiler.h +77 -0
  495. data/ext/generator/parser/parser.cpp +4708 -0
  496. data/ext/generator/parser/parser.h +290 -0
  497. data/ext/generator/parser/parsesession.cpp +106 -0
  498. data/ext/generator/parser/parsesession.h +87 -0
  499. data/ext/generator/parser/problem.h +21 -0
  500. data/ext/generator/parser/rpp/CMakeLists.txt +45 -0
  501. data/ext/generator/parser/rpp/Makefile.am +13 -0
  502. data/ext/generator/parser/rpp/anchor.h +51 -0
  503. data/ext/generator/parser/rpp/appendedlist.h +363 -0
  504. data/ext/generator/parser/rpp/chartools.cpp +146 -0
  505. data/ext/generator/parser/rpp/chartools.h +99 -0
  506. data/ext/generator/parser/rpp/macrorepository.cpp +44 -0
  507. data/ext/generator/parser/rpp/macrorepository.h +59 -0
  508. data/ext/generator/parser/rpp/pp-configuration +86 -0
  509. data/ext/generator/parser/rpp/pp-engine.cpp +1216 -0
  510. data/ext/generator/parser/rpp/pp-engine.h +267 -0
  511. data/ext/generator/parser/rpp/pp-environment.cpp +271 -0
  512. data/ext/generator/parser/rpp/pp-environment.h +119 -0
  513. data/ext/generator/parser/rpp/pp-internal.cpp +38 -0
  514. data/ext/generator/parser/rpp/pp-internal.h +37 -0
  515. data/ext/generator/parser/rpp/pp-location.cpp +191 -0
  516. data/ext/generator/parser/rpp/pp-location.h +89 -0
  517. data/ext/generator/parser/rpp/pp-macro-expander.cpp +568 -0
  518. data/ext/generator/parser/rpp/pp-macro-expander.cpp.orig +558 -0
  519. data/ext/generator/parser/rpp/pp-macro-expander.h +130 -0
  520. data/ext/generator/parser/rpp/pp-macro.cpp +153 -0
  521. data/ext/generator/parser/rpp/pp-macro.h +176 -0
  522. data/ext/generator/parser/rpp/pp-scanner.cpp +311 -0
  523. data/ext/generator/parser/rpp/pp-scanner.h +97 -0
  524. data/ext/generator/parser/rpp/pp-stream.cpp +425 -0
  525. data/ext/generator/parser/rpp/pp-stream.h +183 -0
  526. data/ext/generator/parser/rpp/preprocessor.cpp +65 -0
  527. data/ext/generator/parser/rpp/preprocessor.h +80 -0
  528. data/ext/generator/parser/rpp/rpp.pri +2 -0
  529. data/ext/generator/parser/rpp/test/t001.cpp +23 -0
  530. data/ext/generator/parser/rpp/test/t002.cpp +15 -0
  531. data/ext/generator/parser/rpp/test/t003.cpp +10 -0
  532. data/ext/generator/parser/rpp/test/t004.cpp +9 -0
  533. data/ext/generator/parser/rpp/test/t005.cpp +10 -0
  534. data/ext/generator/parser/rpp/test/t006.cpp +10 -0
  535. data/ext/generator/parser/rpp/test/t007.cpp +6 -0
  536. data/ext/generator/parser/rpp/test/t008.cpp +6 -0
  537. data/ext/generator/parser/rpp/test/t009.cpp +5 -0
  538. data/ext/generator/parser/rpp/test/t010.cpp +15 -0
  539. data/ext/generator/parser/rpp/test/t011.cpp +9 -0
  540. data/ext/generator/parser/rpp/tests/CMakeLists.txt +17 -0
  541. data/ext/generator/parser/rpp/tests/main.cpp +69 -0
  542. data/ext/generator/parser/rxx.pri +50 -0
  543. data/ext/generator/parser/rxx_allocator.h +128 -0
  544. data/ext/generator/parser/safetycounter.h +57 -0
  545. data/ext/generator/parser/simplecursor.h +74 -0
  546. data/ext/generator/parser/stringhelpers.cpp +577 -0
  547. data/ext/generator/parser/stringhelpers.h +118 -0
  548. data/ext/generator/parser/symbol.h +140 -0
  549. data/ext/generator/parser/tests/CMakeLists.txt +46 -0
  550. data/ext/generator/parser/tests/test_generator.cpp +259 -0
  551. data/ext/generator/parser/tests/test_parser.cpp +474 -0
  552. data/ext/generator/parser/tests/test_pool.cpp +109 -0
  553. data/ext/generator/parser/tests/test_pool.h +35 -0
  554. data/ext/generator/parser/tests/testconfig.h.cmake +4 -0
  555. data/ext/generator/parser/tokens.cpp +367 -0
  556. data/ext/generator/parser/tokens.h +148 -0
  557. data/ext/generator/parser/type_compiler.cpp +135 -0
  558. data/ext/generator/parser/type_compiler.h +68 -0
  559. data/ext/generator/parser/visitor.cpp +115 -0
  560. data/ext/generator/parser/visitor.h +138 -0
  561. data/ext/generator/smoke.h +557 -0
  562. data/ext/generator/smokegen_string.h +43 -0
  563. data/ext/generator/type.cpp +204 -0
  564. data/ext/generator/type.h +497 -0
  565. data/ext/generator/type_compiler.cpp +277 -0
  566. data/ext/generator/type_compiler.h +80 -0
  567. data/ext/ruby/CMakeLists.txt +64 -0
  568. data/ext/ruby/qtdeclarative/CMakeLists.txt +17 -0
  569. data/ext/ruby/qtdeclarative/qtdeclarative.cpp +67 -0
  570. data/ext/ruby/qtdeclarative/qtdeclarative.rb +17 -0
  571. data/ext/ruby/qtdeclarative/qtdeclarativehandlers.cpp +36 -0
  572. data/ext/ruby/qtruby/AUTHORS +54 -0
  573. data/ext/ruby/qtruby/CMakeLists.txt +4 -0
  574. data/ext/ruby/qtruby/COPYING +355 -0
  575. data/ext/ruby/qtruby/COPYING.LIB +510 -0
  576. data/ext/ruby/qtruby/ChangeLog +3732 -0
  577. data/ext/ruby/qtruby/INSTALL +79 -0
  578. data/ext/ruby/qtruby/README +264 -0
  579. data/ext/ruby/qtruby/TODO +8 -0
  580. data/ext/ruby/qtruby/bin/CMakeLists.txt +1 -0
  581. data/ext/ruby/qtruby/bin/rbqtapi +152 -0
  582. data/ext/ruby/qtruby/rails_support/CMakeLists.txt +1 -0
  583. data/ext/ruby/qtruby/rails_support/active_item_model.rb +234 -0
  584. data/ext/ruby/qtruby/rails_support/active_table_model.rb +122 -0
  585. data/ext/ruby/qtruby/src/CMakeLists.txt +103 -0
  586. data/ext/ruby/qtruby/src/Qt.cpp +1327 -0
  587. data/ext/ruby/qtruby/src/handlers.cpp +2668 -0
  588. data/ext/ruby/qtruby/src/marshall.h +66 -0
  589. data/ext/ruby/qtruby/src/marshall_basetypes.h +208 -0
  590. data/ext/ruby/qtruby/src/marshall_complex.h +175 -0
  591. data/ext/ruby/qtruby/src/marshall_macros.h +647 -0
  592. data/ext/ruby/qtruby/src/marshall_primitives.h +306 -0
  593. data/ext/ruby/qtruby/src/marshall_types.cpp +815 -0
  594. data/ext/ruby/qtruby/src/marshall_types.h +240 -0
  595. data/ext/ruby/qtruby/src/qtruby.cpp +2627 -0
  596. data/ext/ruby/qtruby/src/qtruby.h +198 -0
  597. data/ext/ruby/qtruby/src/smokeruby.h +164 -0
  598. data/ext/ruby/qtruby/test/opoverloading.rb +46 -0
  599. data/ext/ruby/qtruby/test/unittests.rb +151 -0
  600. data/ext/ruby/qtruby/tools/CMakeLists.txt +2 -0
  601. data/ext/ruby/qtruby/tools/rbrcc/CMakeLists.txt +6 -0
  602. data/ext/ruby/qtruby/tools/rbrcc/Messages.sh +7 -0
  603. data/ext/ruby/qtruby/tools/rbrcc/main.cpp +173 -0
  604. data/ext/ruby/qtruby/tools/rbrcc/rbrcc.pro +14 -0
  605. data/ext/ruby/qtruby/tools/rbrcc/rcc.cpp +648 -0
  606. data/ext/ruby/qtruby/tools/rbrcc/rcc.h +165 -0
  607. data/ext/ruby/qtruby/tools/rbuic/CMakeLists.txt +35 -0
  608. data/ext/ruby/qtruby/tools/rbuic/LICENSE.GPL +280 -0
  609. data/ext/ruby/qtruby/tools/rbuic/Messages.sh +7 -0
  610. data/ext/ruby/qtruby/tools/rbuic/TODO +4 -0
  611. data/ext/ruby/qtruby/tools/rbuic/customwidgetsinfo.cpp +106 -0
  612. data/ext/ruby/qtruby/tools/rbuic/customwidgetsinfo.h +95 -0
  613. data/ext/ruby/qtruby/tools/rbuic/databaseinfo.cpp +102 -0
  614. data/ext/ruby/qtruby/tools/rbuic/databaseinfo.h +85 -0
  615. data/ext/ruby/qtruby/tools/rbuic/driver.cpp +384 -0
  616. data/ext/ruby/qtruby/tools/rbuic/driver.h +141 -0
  617. data/ext/ruby/qtruby/tools/rbuic/globaldefs.h +60 -0
  618. data/ext/ruby/qtruby/tools/rbuic/main.cpp +201 -0
  619. data/ext/ruby/qtruby/tools/rbuic/option.h +110 -0
  620. data/ext/ruby/qtruby/tools/rbuic/rbuic.pri +23 -0
  621. data/ext/ruby/qtruby/tools/rbuic/rbuic4.pro +43 -0
  622. data/ext/ruby/qtruby/tools/rbuic/ruby/rbextractimages.cpp +150 -0
  623. data/ext/ruby/qtruby/tools/rbuic/ruby/rbextractimages.h +83 -0
  624. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwritedeclaration.cpp +217 -0
  625. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwritedeclaration.h +85 -0
  626. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteicondata.cpp +185 -0
  627. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteicondata.h +86 -0
  628. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteicondeclaration.cpp +88 -0
  629. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteicondeclaration.h +83 -0
  630. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteiconinitialization.cpp +126 -0
  631. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteiconinitialization.h +87 -0
  632. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteinitialization.cpp +2478 -0
  633. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteinitialization.h +314 -0
  634. data/ext/ruby/qtruby/tools/rbuic/ruby/ruby.pri +18 -0
  635. data/ext/ruby/qtruby/tools/rbuic/treewalker.cpp +318 -0
  636. data/ext/ruby/qtruby/tools/rbuic/treewalker.h +139 -0
  637. data/ext/ruby/qtruby/tools/rbuic/ui4.cpp +7623 -0
  638. data/ext/ruby/qtruby/tools/rbuic/ui4.h +3180 -0
  639. data/ext/ruby/qtruby/tools/rbuic/uic.cpp +438 -0
  640. data/ext/ruby/qtruby/tools/rbuic/uic.h +154 -0
  641. data/ext/ruby/qtruby/tools/rbuic/utils.h +125 -0
  642. data/ext/ruby/qtruby/tools/rbuic/validator.cpp +100 -0
  643. data/ext/ruby/qtruby/tools/rbuic/validator.h +80 -0
  644. data/ext/ruby/qtscript/CMakeLists.txt +19 -0
  645. data/ext/ruby/qtscript/qtscript.cpp +83 -0
  646. data/ext/ruby/qtscript/qtscript.rb +40 -0
  647. data/ext/ruby/qtscript/qtscripthandlers.cpp +37 -0
  648. data/ext/ruby/qtscript/smokedata.cpp +1403 -0
  649. data/ext/ruby/qttest/CMakeLists.txt +18 -0
  650. data/ext/ruby/qttest/ChangeLog +9 -0
  651. data/ext/ruby/qttest/examples/myfirsttest.rb +30 -0
  652. data/ext/ruby/qttest/qttest.cpp +83 -0
  653. data/ext/ruby/qttest/qttest.rb +166 -0
  654. data/ext/ruby/qttest/qttesthandlers.cpp +37 -0
  655. data/ext/ruby/qtuitools/CMakeLists.txt +16 -0
  656. data/ext/ruby/qtuitools/qtuitools.cpp +83 -0
  657. data/ext/ruby/qtuitools/qtuitools.rb +17 -0
  658. data/ext/ruby/qtuitools/qtuitoolshandlers.cpp +32 -0
  659. data/ext/ruby/qtwebkit/CMakeLists.txt +17 -0
  660. data/ext/ruby/qtwebkit/qtwebkit.cpp +67 -0
  661. data/ext/ruby/qtwebkit/qtwebkit.rb +17 -0
  662. data/ext/ruby/qtwebkit/qtwebkithandlers.cpp +40 -0
  663. data/ext/smoke/CMakeLists.txt +39 -0
  664. data/ext/smoke/deptool/CMakeLists.txt +7 -0
  665. data/ext/smoke/deptool/main.cpp +128 -0
  666. data/ext/smoke/qt_smoke.h +16 -0
  667. data/ext/smoke/qtcore/CMakeLists.txt +88 -0
  668. data/ext/smoke/qtcore/QtGuess.txt +180 -0
  669. data/ext/smoke/qtcore/config.xml.cmake +10 -0
  670. data/ext/smoke/qtcore/qt-config.xml.cmake +21 -0
  671. data/ext/smoke/qtcore/qtcore_includes.h +1 -0
  672. data/ext/smoke/qtcore/smokeconfig.xml +193 -0
  673. data/ext/smoke/qtcore/tests/CMakeLists.txt +13 -0
  674. data/ext/smoke/qtcore/tests/test.cpp +846 -0
  675. data/ext/smoke/qtcore_smoke.h +16 -0
  676. data/ext/smoke/qtdbus/CMakeLists.txt +38 -0
  677. data/ext/smoke/qtdbus/config.xml.cmake +11 -0
  678. data/ext/smoke/qtdbus/qtdbus_includes.h +2 -0
  679. data/ext/smoke/qtdbus/smokeconfig.xml +65 -0
  680. data/ext/smoke/qtdbus_smoke.h +16 -0
  681. data/ext/smoke/qtdeclarative/CMakeLists.txt +45 -0
  682. data/ext/smoke/qtdeclarative/config.xml.cmake +12 -0
  683. data/ext/smoke/qtdeclarative/qtdeclarative_includes.h +3 -0
  684. data/ext/smoke/qtdeclarative/smokeconfig.xml +59 -0
  685. data/ext/smoke/qtdeclarative_smoke.h +16 -0
  686. data/ext/smoke/qtgui/CMakeLists.txt +76 -0
  687. data/ext/smoke/qtgui/config.xml.cmake +11 -0
  688. data/ext/smoke/qtgui/qtgui_includes.h +7 -0
  689. data/ext/smoke/qtgui/smokeconfig.xml +500 -0
  690. data/ext/smoke/qtgui_smoke.h +16 -0
  691. data/ext/smoke/qthelp/CMakeLists.txt +45 -0
  692. data/ext/smoke/qthelp/config.xml.cmake +13 -0
  693. data/ext/smoke/qthelp/qthelp_includes.h +3 -0
  694. data/ext/smoke/qthelp/smokeconfig.xml +54 -0
  695. data/ext/smoke/qthelp_smoke.h +16 -0
  696. data/ext/smoke/qtmultimedia/CMakeLists.txt +42 -0
  697. data/ext/smoke/qtmultimedia/config.xml.cmake +12 -0
  698. data/ext/smoke/qtmultimedia/qtmultimedia_includes.h +3 -0
  699. data/ext/smoke/qtmultimedia/smokeconfig.xml +51 -0
  700. data/ext/smoke/qtmultimedia_smoke.h +16 -0
  701. data/ext/smoke/qtnetwork/CMakeLists.txt +38 -0
  702. data/ext/smoke/qtnetwork/config.xml.cmake +11 -0
  703. data/ext/smoke/qtnetwork/qtnetwork_includes.h +2 -0
  704. data/ext/smoke/qtnetwork/smokeconfig.xml +81 -0
  705. data/ext/smoke/qtnetwork_smoke.h +16 -0
  706. data/ext/smoke/qtopengl/CMakeLists.txt +43 -0
  707. data/ext/smoke/qtopengl/config.xml.cmake +13 -0
  708. data/ext/smoke/qtopengl/qtopengl_includes.h +3 -0
  709. data/ext/smoke/qtopengl/smokeconfig.xml +58 -0
  710. data/ext/smoke/qtopengl_smoke.h +16 -0
  711. data/ext/smoke/qtscript/CMakeLists.txt +31 -0
  712. data/ext/smoke/qtscript/config.xml.cmake +11 -0
  713. data/ext/smoke/qtscript/qtscript_includes.h +14 -0
  714. data/ext/smoke/qtscript/smokeconfig.xml +39 -0
  715. data/ext/smoke/qtscript_smoke.h +16 -0
  716. data/ext/smoke/qtsql/CMakeLists.txt +45 -0
  717. data/ext/smoke/qtsql/config.xml.cmake +11 -0
  718. data/ext/smoke/qtsql/qtsql_includes.h +3 -0
  719. data/ext/smoke/qtsql/smokeconfig.xml +60 -0
  720. data/ext/smoke/qtsql_smoke.h +16 -0
  721. data/ext/smoke/qtsvg/CMakeLists.txt +43 -0
  722. data/ext/smoke/qtsvg/config.xml.cmake +12 -0
  723. data/ext/smoke/qtsvg/qtsvg_includes.h +3 -0
  724. data/ext/smoke/qtsvg/smokeconfig.xml +46 -0
  725. data/ext/smoke/qtsvg_smoke.h +16 -0
  726. data/ext/smoke/qttest/CMakeLists.txt +35 -0
  727. data/ext/smoke/qttest/config.xml.cmake +12 -0
  728. data/ext/smoke/qttest/qttest_includes.h +14 -0
  729. data/ext/smoke/qttest/smokeconfig.xml +36 -0
  730. data/ext/smoke/qttest_smoke.h +16 -0
  731. data/ext/smoke/qtuitools/CMakeLists.txt +30 -0
  732. data/ext/smoke/qtuitools/config.xml.cmake +12 -0
  733. data/ext/smoke/qtuitools/qtuitools_includes.h +1 -0
  734. data/ext/smoke/qtuitools/smokeconfig.xml +20 -0
  735. data/ext/smoke/qtuitools_smoke.h +16 -0
  736. data/ext/smoke/qtwebkit/CMakeLists.txt +36 -0
  737. data/ext/smoke/qtwebkit/config.xml.cmake +11 -0
  738. data/ext/smoke/qtwebkit/qtwebkit_includes.h +1 -0
  739. data/ext/smoke/qtwebkit/smokeconfig.xml +48 -0
  740. data/ext/smoke/qtwebkit_smoke.h +16 -0
  741. data/ext/smoke/qtxml/CMakeLists.txt +41 -0
  742. data/ext/smoke/qtxml/config.xml.cmake +11 -0
  743. data/ext/smoke/qtxml/qtxml_includes.h +2 -0
  744. data/ext/smoke/qtxml/smokeconfig.xml +70 -0
  745. data/ext/smoke/qtxml_smoke.h +16 -0
  746. data/ext/smoke/qtxmlpatterns/CMakeLists.txt +42 -0
  747. data/ext/smoke/qtxmlpatterns/config.xml.cmake +12 -0
  748. data/ext/smoke/qtxmlpatterns/qtxmlpatterns_includes.h +3 -0
  749. data/ext/smoke/qtxmlpatterns/smokeconfig.xml +80 -0
  750. data/ext/smoke/qtxmlpatterns_smoke.h +16 -0
  751. data/ext/smoke/smoke.h +559 -0
  752. data/ext/smoke/smokeapi/CMakeLists.txt +9 -0
  753. data/ext/smoke/smokeapi/main.cpp +309 -0
  754. data/ext/smoke/smokebase/CMakeLists.txt +11 -0
  755. data/ext/smoke/smokebase/smokebase.cpp +6 -0
  756. data/ext/smoke/solid_smoke.h +16 -0
  757. data/extconf.rb +256 -0
  758. data/lib/Qt/qtruby4.rb +3268 -0
  759. data/lib/Qt.rb +1 -0
  760. data/lib/Qt4.rb +119 -0
  761. data/lib/qtbindings_version.rb +2 -0
  762. data/lib/qtdeclarative/qtdeclarative.rb +17 -0
  763. data/lib/qtscript/qtscript.rb +40 -0
  764. data/lib/qttest/qttest.rb +166 -0
  765. data/lib/qtuitools/qtuitools.rb +17 -0
  766. data/lib/qtwebkit/qtwebkit.rb +17 -0
  767. data/rock-qtbindings.gemspec +18 -0
  768. metadata +819 -0
data/lib/Qt/qtruby4.rb ADDED
@@ -0,0 +1,3268 @@
1
+ =begin
2
+ /***************************************************************************
3
+ qtruby.rb - description
4
+ -------------------
5
+ begin : Fri Jul 4 2003
6
+ copyright : (C) 2003-2008 by Richard Dale
7
+ email : richard.j.dale@gmail.com
8
+ ***************************************************************************/
9
+
10
+ /***************************************************************************
11
+ * *
12
+ * This program is free software; you can redistribute it and/or modify *
13
+ * it under the terms of the GNU Lesser General Public License as *
14
+ * published by the Free Software Foundation; either version 2 of the *
15
+ * License, or (at your option) any later version. *
16
+ * *
17
+ ***************************************************************************/
18
+ =end
19
+
20
+ module Qt
21
+
22
+ module DebugLevel
23
+ Off, Minimal, High, Extensive = 0, 1, 2, 3
24
+ end
25
+
26
+ module QtDebugChannel
27
+ QTDB_NONE = 0x00
28
+ QTDB_AMBIGUOUS = 0x01
29
+ QTDB_METHOD_MISSING = 0x02
30
+ QTDB_CALLS = 0x04
31
+ QTDB_GC = 0x08
32
+ QTDB_VIRTUAL = 0x10
33
+ QTDB_VERBOSE = 0x20
34
+ QTDB_ALL = QTDB_VERBOSE | QTDB_VIRTUAL | QTDB_GC | QTDB_CALLS | QTDB_METHOD_MISSING | QTDB_AMBIGUOUS
35
+ end
36
+
37
+ @@debug_level = DebugLevel::Off
38
+ def Qt.debug_level=(level)
39
+ @@debug_level = level
40
+ Internal::setDebug Qt::QtDebugChannel::QTDB_ALL if level >= DebugLevel::Extensive
41
+ end
42
+
43
+ def Qt.debug_level
44
+ @@debug_level
45
+ end
46
+
47
+ module Internal
48
+ #
49
+ # From the enum MethodFlags in qt-copy/src/tools/moc/generator.cpp
50
+ #
51
+ AccessPrivate = 0x00
52
+ AccessProtected = 0x01
53
+ AccessPublic = 0x02
54
+ MethodMethod = 0x00
55
+ MethodSignal = 0x04
56
+ MethodSlot = 0x08
57
+ MethodCompatibility = 0x10
58
+ MethodCloned = 0x20
59
+ MethodScriptable = 0x40
60
+ end
61
+
62
+ class Base
63
+ def self.signals(*signal_list)
64
+ meta = Qt::Meta[self.name] || Qt::MetaInfo.new(self)
65
+ meta.add_signals(signal_list, Internal::MethodSignal | Internal::AccessProtected)
66
+ meta.changed = true
67
+ end
68
+
69
+ def self.slots(*slot_list)
70
+ meta = Qt::Meta[self.name] || Qt::MetaInfo.new(self)
71
+ meta.add_slots(slot_list, Internal::MethodSlot | Internal::AccessPublic)
72
+ meta.changed = true
73
+ end
74
+
75
+ def self.private_slots(*slot_list)
76
+ meta = Qt::Meta[self.name] || Qt::MetaInfo.new(self)
77
+ meta.add_slots(slot_list, Internal::MethodSlot | Internal::AccessPrivate)
78
+ meta.changed = true
79
+ end
80
+
81
+ def self.q_signal(signal)
82
+ meta = Qt::Meta[self.name] || Qt::MetaInfo.new(self)
83
+ meta.add_signals([signal], Internal::MethodSignal | Internal::AccessProtected)
84
+ meta.changed = true
85
+ end
86
+
87
+ def self.q_slot(slot)
88
+ meta = Qt::Meta[self.name] || Qt::MetaInfo.new(self)
89
+ meta.add_slots([slot], Internal::MethodSlot | Internal::AccessPublic)
90
+ meta.changed = true
91
+ end
92
+
93
+ def self.q_classinfo(key, value)
94
+ meta = Qt::Meta[self.name] || Qt::MetaInfo.new(self)
95
+ meta.add_classinfo(key, value)
96
+ meta.changed = true
97
+ end
98
+
99
+ def **(a)
100
+ return Qt::**(self, a)
101
+ end
102
+ def +(a)
103
+ return Qt::+(self, a)
104
+ end
105
+ def ~(a)
106
+ return Qt::~(self, a)
107
+ end
108
+ def -@()
109
+ return Qt::-(self)
110
+ end
111
+ def -(a)
112
+ return Qt::-(self, a)
113
+ end
114
+ def *(a)
115
+ return Qt::*(self, a)
116
+ end
117
+ def /(a)
118
+ return Qt::/(self, a) #/
119
+ end
120
+ def %(a)
121
+ return Qt::%(self, a)
122
+ end
123
+ def >>(a)
124
+ return Qt::>>(self, a)
125
+ end
126
+ def <<(a)
127
+ return Qt::<<(self, a)
128
+ end
129
+ def &(a)
130
+ return Qt::&(self, a)
131
+ end
132
+ def ^(a)
133
+ return Qt::^(self, a)
134
+ end
135
+ def |(a)
136
+ return Qt::|(self, a)
137
+ end
138
+
139
+ # Module has '<', '<=', '>' and '>=' operator instance methods, so pretend they
140
+ # don't exist by calling method_missing() explicitly
141
+ def <(a)
142
+ begin
143
+ Qt::method_missing(:<, self, a)
144
+ rescue
145
+ super(a)
146
+ end
147
+ end
148
+
149
+ def <=(a)
150
+ begin
151
+ Qt::method_missing(:<=, self, a)
152
+ rescue
153
+ super(a)
154
+ end
155
+ end
156
+
157
+ def >(a)
158
+ begin
159
+ Qt::method_missing(:>, self, a)
160
+ rescue
161
+ super(a)
162
+ end
163
+ end
164
+
165
+ def >=(a)
166
+ begin
167
+ Qt::method_missing(:>=, self, a)
168
+ rescue
169
+ super(a)
170
+ end
171
+ end
172
+
173
+ # Object has a '==' operator instance method, so pretend it
174
+ # don't exist by calling method_missing() explicitly
175
+ def ==(a)
176
+ return false if a.nil?
177
+ begin
178
+ Qt::method_missing(:==, self, a)
179
+ rescue
180
+ super(a)
181
+ end
182
+ end
183
+
184
+ def self.ancestors
185
+ klass = self
186
+ classid = nil
187
+ loop do
188
+ classid = Qt::Internal::find_pclassid(klass.name)
189
+ break if classid.index
190
+
191
+ klass = klass.superclass
192
+ if klass.nil?
193
+ return super
194
+ end
195
+ end
196
+
197
+ klasses = super
198
+ klasses.delete(Qt::Base)
199
+ klasses.delete(self)
200
+ ids = []
201
+ Qt::Internal::getAllParents(classid, ids)
202
+ return [self] + ids.map {|id| Qt::Internal.find_class(Qt::Internal.classid2name(id))} + klasses
203
+ end
204
+
205
+ # Change the behaviors of is_a? and kind_of? (alias of is_a?) to use above self.ancestors method
206
+ # Note: this definition also affects Object#===
207
+ def is_a?(mod)
208
+ super || self.class.ancestors.include?(mod)
209
+ end
210
+ alias :kind_of? :is_a?
211
+
212
+ def methods(regular=true)
213
+ if !regular
214
+ return singleton_methods
215
+ end
216
+
217
+ qt_methods(super, 0x0)
218
+ end
219
+
220
+ def protected_methods(all=true)
221
+ # From smoke.h, Smoke::mf_protected 0x80
222
+ qt_methods(super, 0x80)
223
+ end
224
+
225
+ def public_methods(all=true)
226
+ methods
227
+ end
228
+
229
+ def singleton_methods(all=true)
230
+ # From smoke.h, Smoke::mf_static 0x01
231
+ qt_methods(super, 0x01)
232
+ end
233
+
234
+ private
235
+ def qt_methods(meths, flags)
236
+ ids = []
237
+ # These methods are all defined in Qt::Base, even if they aren't supported by a particular
238
+ # subclass, so remove them to avoid confusion
239
+ meths -= ["%", "&", "*", "**", "+", "-", "-@", "/", "<", "<<", "<=", ">", ">=", ">>", "|", "~", "^"]
240
+ classid = Qt::Internal::idInstance(self)
241
+ Qt::Internal::getAllParents(classid, ids)
242
+ ids << classid
243
+ ids.each { |c| Qt::Internal::findAllMethodNames(meths, c, flags) }
244
+ return meths.uniq.map! {|a| a.intern}
245
+ end
246
+ end # Qt::Base
247
+
248
+ # Provides a mutable numeric class for passing to methods with
249
+ # C++ 'int*' or 'int&' arg types
250
+ class Integer
251
+ attr_accessor :value
252
+ def initialize(n=0) @value = n end
253
+
254
+ def +(n)
255
+ return Integer.new(@value + n.to_i)
256
+ end
257
+ def -(n)
258
+ return Integer.new(@value - n.to_i)
259
+ end
260
+ def *(n)
261
+ return Integer.new(@value * n.to_i)
262
+ end
263
+ def /(n)
264
+ return Integer.new(@value / n.to_i)
265
+ end
266
+ def %(n)
267
+ return Integer.new(@value % n.to_i)
268
+ end
269
+ def **(n)
270
+ return Integer.new(@value ** n.to_i)
271
+ end
272
+
273
+ def |(n)
274
+ return Integer.new(@value | n.to_i)
275
+ end
276
+ def &(n)
277
+ return Integer.new(@value & n.to_i)
278
+ end
279
+ def ^(n)
280
+ return Integer.new(@value ^ n.to_i)
281
+ end
282
+ def <<(n)
283
+ return Integer.new(@value << n.to_i)
284
+ end
285
+ def >>(n)
286
+ return Integer.new(@value >> n.to_i)
287
+ end
288
+ def >(n)
289
+ return @value > n.to_i
290
+ end
291
+ def >=(n)
292
+ return @value >= n.to_i
293
+ end
294
+ def <(n)
295
+ return @value < n.to_i
296
+ end
297
+ def <=(n)
298
+ return @value <= n.to_i
299
+ end
300
+
301
+ def <=>(n)
302
+ if @value < n.to_i
303
+ return -1
304
+ elsif @value > n.to_i
305
+ return 1
306
+ else
307
+ return 0
308
+ end
309
+ end
310
+
311
+ def to_f() return @value.to_f end
312
+ def to_i() return @value.to_i end
313
+ def to_s() return @value.to_s end
314
+
315
+ def coerce(n)
316
+ [n, @value]
317
+ end
318
+ end
319
+
320
+ # If a C++ enum was converted to an ordinary ruby Integer, the
321
+ # name of the type is lost. The enum type name is needed for overloaded
322
+ # method resolution when two methods differ only by an enum type.
323
+ class Enum
324
+ attr_accessor :type, :value
325
+ def initialize(n, enum_type)
326
+ @value = n
327
+ @type = enum_type
328
+ end
329
+
330
+ def +(n)
331
+ return @value + n.to_i
332
+ end
333
+ def -(n)
334
+ return @value - n.to_i
335
+ end
336
+ def *(n)
337
+ return @value * n.to_i
338
+ end
339
+ def /(n)
340
+ return @value / n.to_i
341
+ end
342
+ def %(n)
343
+ return @value % n.to_i
344
+ end
345
+ def **(n)
346
+ return @value ** n.to_i
347
+ end
348
+
349
+ def |(n)
350
+ return Enum.new(@value | n.to_i, @type)
351
+ end
352
+ def &(n)
353
+ return Enum.new(@value & n.to_i, @type)
354
+ end
355
+ def ^(n)
356
+ return Enum.new(@value ^ n.to_i, @type)
357
+ end
358
+ def ~()
359
+ return ~ @value
360
+ end
361
+ def <(n)
362
+ return @value < n.to_i
363
+ end
364
+ def <=(n)
365
+ return @value <= n.to_i
366
+ end
367
+ def >(n)
368
+ return @value > n.to_i
369
+ end
370
+ def >=(n)
371
+ return @value >= n.to_i
372
+ end
373
+ def <<(n)
374
+ return Enum.new(@value << n.to_i, @type)
375
+ end
376
+ def >>(n)
377
+ return Enum.new(@value >> n.to_i, @type)
378
+ end
379
+
380
+ def ==(n) return @value == n.to_i end
381
+ def to_i() return @value end
382
+
383
+ def to_f() return @value.to_f end
384
+ def to_s() return @value.to_s end
385
+
386
+ def coerce(n)
387
+ [n, @value]
388
+ end
389
+
390
+ def inspect
391
+ to_s
392
+ end
393
+
394
+ def pretty_print(pp)
395
+ pp.text "#<%s:0x%8.8x @type=%s, @value=%d>" % [self.class.name, object_id, type, value]
396
+ end
397
+ end
398
+
399
+ # Provides a mutable boolean class for passing to methods with
400
+ # C++ 'bool*' or 'bool&' arg types
401
+ class Boolean
402
+ attr_accessor :value
403
+ def initialize(b=false) @value = b end
404
+ def nil?
405
+ return !@value
406
+ end
407
+ end
408
+
409
+ class AbstractSlider < Qt::Base
410
+ def range=(arg)
411
+ if arg.kind_of? Range
412
+ return super(arg.begin, arg.exclude_end? ? arg.end - 1 : arg.end)
413
+ else
414
+ return super(arg)
415
+ end
416
+ end
417
+ end
418
+
419
+ class AbstractSocket < Qt::Base
420
+ def abort(*args)
421
+ method_missing(:abort, *args)
422
+ end
423
+ end
424
+
425
+ class AbstractTextDocumentLayout < Qt::Base
426
+ def format(*args)
427
+ method_missing(:format, *args)
428
+ end
429
+ end
430
+
431
+ class AccessibleEvent < Qt::Base
432
+ def type(*args)
433
+ method_missing(:type, *args)
434
+ end
435
+ end
436
+
437
+ class ActionEvent < Qt::Base
438
+ def type(*args)
439
+ method_missing(:type, *args)
440
+ end
441
+ end
442
+
443
+ class Action < Qt::Base
444
+ def setShortcut(arg)
445
+ if arg.kind_of?(String)
446
+ return super(Qt::KeySequence.new(arg))
447
+ else
448
+ return super(arg)
449
+ end
450
+ end
451
+
452
+ def shortcut=(arg)
453
+ setShortcut(arg)
454
+ end
455
+ end
456
+
457
+ class Application < Qt::Base
458
+ attr_reader :thread_fix
459
+
460
+ def initialize(*args)
461
+ if args.length == 1 && args[0].kind_of?(Array)
462
+ super(args.length + 1, [$0] + args[0])
463
+ else
464
+ super(*args)
465
+ end
466
+ $qApp = self
467
+ @thread_fix = RubyThreadFix.new
468
+ end
469
+
470
+ def disable_threading
471
+ @thread_fix.stop if @thread_fix
472
+ @thread_fix = nil
473
+ end
474
+
475
+ # Delete the underlying C++ instance after exec returns
476
+ # Otherwise, rb_gc_call_finalizer_at_exit() can delete
477
+ # stuff that Qt::Application still needs for its cleanup.
478
+ def exec
479
+ result = method_missing(:exec)
480
+ disable_threading()
481
+ self.dispose
482
+ Qt::Internal.application_terminated = true
483
+ result
484
+ end
485
+
486
+ def type(*args)
487
+ method_missing(:type, *args)
488
+ end
489
+
490
+ def self.translate(*args)
491
+ if args[3] and args[3].value == Qt::Application::UnicodeUTF8.value
492
+ return method_missing(:translate,*args).force_encoding('utf-8')
493
+ else
494
+ return method_missing(:translate,*args)
495
+ end
496
+ end
497
+ end
498
+
499
+ class Buffer < Qt::Base
500
+ def open(*args)
501
+ method_missing(:open, *args)
502
+ end
503
+ end
504
+
505
+ class ButtonGroup < Qt::Base
506
+ def id(*args)
507
+ method_missing(:id, *args)
508
+ end
509
+ end
510
+
511
+ class ByteArray < Qt::Base
512
+ def initialize(*args)
513
+ if args.size == 1 && args[0].kind_of?(String)
514
+ super(args[0], args[0].size)
515
+ else
516
+ super
517
+ end
518
+ end
519
+
520
+ def to_s
521
+ return constData()
522
+ end
523
+
524
+ def to_i
525
+ return toInt()
526
+ end
527
+
528
+ def to_f
529
+ return toDouble()
530
+ end
531
+
532
+ def chop(*args)
533
+ method_missing(:chop, *args)
534
+ end
535
+
536
+ def split(*args)
537
+ method_missing(:split, *args)
538
+ end
539
+ end
540
+
541
+ class CheckBox < Qt::Base
542
+ def setShortcut(arg)
543
+ if arg.kind_of?(String)
544
+ return super(Qt::KeySequence.new(arg))
545
+ else
546
+ return super(arg)
547
+ end
548
+ end
549
+
550
+ def shortcut=(arg)
551
+ setShortcut(arg)
552
+ end
553
+ end
554
+
555
+ class ChildEvent < Qt::Base
556
+ def type(*args)
557
+ method_missing(:type, *args)
558
+ end
559
+ end
560
+
561
+ class CloseEvent < Qt::Base
562
+ def type(*args)
563
+ method_missing(:type, *args)
564
+ end
565
+ end
566
+
567
+ class Color < Qt::Base
568
+ def inspect
569
+ str = super
570
+ str.sub(/>$/, " %s>" % name)
571
+ end
572
+
573
+ def pretty_print(pp)
574
+ str = to_s
575
+ pp.text str.sub(/>$/, " %s>" % name)
576
+ end
577
+
578
+ def name(*args)
579
+ method_missing(:name, *args)
580
+ end
581
+ end
582
+
583
+ class Connection < Qt::Base
584
+ def inspect
585
+ str = super
586
+ str.sub(/>$/, " memberName=%s, memberType=%s, object=%s>" %
587
+ [memberName.inspect, memberType == 1 ? "SLOT" : "SIGNAL", object.inspect] )
588
+ end
589
+
590
+ def pretty_print(pp)
591
+ str = to_s
592
+ pp.text str.sub(/>$/, "\n memberName=%s,\n memberType=%s,\n object=%s>" %
593
+ [memberName.inspect, memberType == 1 ? "SLOT" : "SIGNAL", object.inspect] )
594
+ end
595
+ end
596
+
597
+ class ContextMenuEvent < Qt::Base
598
+ def type(*args)
599
+ method_missing(:type, *args)
600
+ end
601
+ end
602
+
603
+ class CoreApplication < Qt::Base
604
+ attr_reader :thread_fix
605
+
606
+ def initialize(*args)
607
+ if args.length == 1 && args[0].kind_of?(Array)
608
+ super(args.length + 1, [$0] + args[0])
609
+ else
610
+ super(*args)
611
+ end
612
+ $qApp = self
613
+ @thread_fix = RubyThreadFix.new
614
+ end
615
+
616
+ def disable_threading
617
+ @thread_fix.stop if @thread_fix
618
+ @thread_fix = nil
619
+ end
620
+
621
+ # Delete the underlying C++ instance after exec returns
622
+ # Otherwise, rb_gc_call_finalizer_at_exit() can delete
623
+ # stuff that Qt::Application still needs for its cleanup.
624
+ def exec
625
+ method_missing(:exec)
626
+ disable_threading()
627
+ self.dispose
628
+ Qt::Internal.application_terminated = true
629
+ end
630
+
631
+ def type(*args)
632
+ method_missing(:type, *args)
633
+ end
634
+
635
+ def exit(*args)
636
+ method_missing(:exit, *args)
637
+ end
638
+
639
+ def self.translate(*args)
640
+ if args[3] and args[3].value == Qt::Application::UnicodeUTF8.value
641
+ return method_missing(:translate,*args).force_encoding('utf-8')
642
+ else
643
+ return method_missing(:translate,*args)
644
+ end
645
+ end
646
+ end
647
+
648
+ class Cursor < Qt::Base
649
+ def inspect
650
+ str = super
651
+ str.sub(/>$/, " shape=%d>" % shape)
652
+ end
653
+
654
+ def pretty_print(pp)
655
+ str = to_s
656
+ pp.text str.sub(/>$/, " shape=%d>" % shape)
657
+ end
658
+ end
659
+
660
+ class CustomEvent < Qt::Base
661
+ def type(*args)
662
+ method_missing(:type, *args)
663
+ end
664
+ end
665
+
666
+ class Date < Qt::Base
667
+ def initialize(*args)
668
+ if args.size == 1 && args[0].class.name == "Date"
669
+ return super(args[0].year, args[0].month, args[0].day)
670
+ else
671
+ return super(*args)
672
+ end
673
+ end
674
+
675
+ def inspect
676
+ str = super
677
+ str.sub(/>$/, " %s>" % toString)
678
+ end
679
+
680
+ def pretty_print(pp)
681
+ str = to_s
682
+ pp.text str.sub(/>$/, " %s>" % toString)
683
+ end
684
+
685
+ def to_date
686
+ ::Date.new! to_julian_day
687
+ end
688
+ end
689
+
690
+ class DateTime < Qt::Base
691
+ def initialize(*args)
692
+ if args.size == 1 && args[0].class.name == "DateTime"
693
+ return super( Qt::Date.new(args[0].year, args[0].month, args[0].day),
694
+ Qt::Time.new(args[0].hour, args[0].min, args[0].sec) )
695
+ elsif args.size == 1 && args[0].class.name == "Time"
696
+ result = super( Qt::Date.new(args[0].year, args[0].month, args[0].day),
697
+ Qt::Time.new(args[0].hour, args[0].min, args[0].sec, args[0].usec / 1000) )
698
+ result.timeSpec = (args[0].utc? ? Qt::UTC : Qt::LocalTime)
699
+ return result
700
+ else
701
+ return super(*args)
702
+ end
703
+ end
704
+
705
+ def to_time
706
+ if timeSpec == Qt::UTC
707
+ return ::Time.utc( date.year, date.month, date.day,
708
+ time.hour, time.minute, time.second, time.msec * 1000 )
709
+ else
710
+ return ::Time.local( date.year, date.month, date.day,
711
+ time.hour, time.minute, time.second, time.msec * 1000 )
712
+ end
713
+ end
714
+
715
+ def inspect
716
+ str = super
717
+ str.sub(/>$/, " %s>" % toString)
718
+ end
719
+
720
+ def pretty_print(pp)
721
+ str = to_s
722
+ pp.text str.sub(/>$/, " %s>" % toString)
723
+ end
724
+ end
725
+
726
+ class DBusArgument < Qt::Base
727
+ def inspect
728
+ str = super
729
+ str.sub(/>$/, " currentSignature='%s', atEnd=%s>" % [currentSignature, atEnd])
730
+ end
731
+
732
+ def pretty_print(pp)
733
+ str = to_s
734
+ pp.text str.sub(/>$/, " currentSignature='%s, atEnd=%s'>" % [currentSignature, atEnd])
735
+ end
736
+ end
737
+
738
+ class DBusConnection < Qt::Base
739
+ def send(*args)
740
+ method_missing(:send, *args)
741
+ end
742
+ end
743
+
744
+ class DBusConnectionInterface < Qt::Base
745
+ def serviceOwner(name)
746
+ return Qt::DBusReply.new(internalConstCall(Qt::DBus::AutoDetect, "GetNameOwner", [Qt::Variant.new(name)]))
747
+ end
748
+
749
+ def service_owner(name)
750
+ return serviceOwner(name)
751
+ end
752
+
753
+ def registeredServiceNames
754
+ return Qt::DBusReply.new(internalConstCall(Qt::DBus::AutoDetect, "ListNames"))
755
+ end
756
+
757
+ def registered_service_names
758
+ return registeredServiceNames
759
+ end
760
+
761
+ def isServiceRegistered(serviceName)
762
+ return Qt::DBusReply.new(internalConstCall(Qt::DBus::AutoDetect, "NameHasOwner", [Qt::Variant.new(serviceName)]))
763
+ end
764
+
765
+ def is_service_registered(serviceName)
766
+ return isServiceRegistered(serviceName)
767
+ end
768
+
769
+ def serviceRegistered?(serviceName)
770
+ return isServiceRegistered(serviceName)
771
+ end
772
+
773
+ def service_registered?(serviceName)
774
+ return isServiceRegistered(serviceName)
775
+ end
776
+
777
+ def servicePid(serviceName)
778
+ return Qt::DBusReply.new(internalConstCall(Qt::DBus::AutoDetect, "GetConnectionUnixProcessID", [Qt::Variant.new(serviceName)]))
779
+ end
780
+
781
+ def service_pid(serviceName)
782
+ return servicePid(serviceName)
783
+ end
784
+
785
+ def serviceUid(serviceName)
786
+ return Qt::DBusReply.new(internalConstCall(Qt::DBus::AutoDetect, "GetConnectionUnixUser", [Qt::Variant.new(serviceName)]))
787
+ end
788
+
789
+ def service_uid(serviceName)
790
+ return serviceUid(serviceName)
791
+ end
792
+
793
+ def startService(name)
794
+ return call("StartServiceByName", Qt::Variant.new(name), Qt::Variant.new(0)).value
795
+ end
796
+
797
+ def start_service(name)
798
+ startService(name)
799
+ end
800
+ end
801
+
802
+ class DBusError < Qt::Base
803
+ def type(*args)
804
+ method_missing(:type, *args)
805
+ end
806
+ end
807
+
808
+ class DBusInterface < Qt::Base
809
+ def call(method_name, *args)
810
+ if args.length == 0
811
+ return super(method_name)
812
+ elsif method_name.is_a? Qt::Enum
813
+ opt = args.shift
814
+ qdbusArgs = args.collect {|arg| qVariantFromValue(arg)}
815
+ return super(method_name, opt, *qdbusArgs)
816
+ else
817
+ # If the method is Qt::DBusInterface.call(), create an Array
818
+ # 'dbusArgs' of Qt::Variants from '*args'
819
+ qdbusArgs = args.collect {|arg| qVariantFromValue(arg)}
820
+ return super(method_name, *qdbusArgs)
821
+ end
822
+ end
823
+
824
+ def method_missing(id, *args)
825
+ begin
826
+ # First look for a method in the Smoke runtime
827
+ # If not found, then throw an exception and try dbus.
828
+ super(id, *args)
829
+ rescue
830
+ if args.length == 0
831
+ return call(id.to_s).value
832
+ else
833
+ return call(id.to_s, *args).value
834
+ end
835
+ end
836
+ end
837
+ end
838
+
839
+ class DBusMessage < Qt::Base
840
+ def type(*args)
841
+ method_missing(:type, *args)
842
+ end
843
+
844
+ def value
845
+ if type() == Qt::DBusMessage::ReplyMessage
846
+ reply = arguments()
847
+ if reply.length == 0
848
+ return nil
849
+ elsif reply.length == 1
850
+ return reply[0].value
851
+ else
852
+ return reply.collect {|v| v.value}
853
+ end
854
+ else
855
+ return nil
856
+ end
857
+ end
858
+
859
+ def <<(a)
860
+ if a.kind_of?(Qt::Variant)
861
+ return super(a)
862
+ else
863
+ return super(qVariantFromValue(a))
864
+ end
865
+ end
866
+ end
867
+
868
+ class DBusReply
869
+ def initialize(reply)
870
+ @error = Qt::DBusError.new(reply)
871
+
872
+ if @error.valid?
873
+ @data = Qt::Variant.new
874
+ return
875
+ end
876
+
877
+ if reply.arguments.length >= 1
878
+ @data = reply.arguments[0]
879
+ return
880
+ end
881
+
882
+ # error
883
+ @error = Qt::DBusError.new( Qt::DBusError::InvalidSignature,
884
+ "Unexpected reply signature" )
885
+ @data = Qt::Variant.new # clear it
886
+ end
887
+
888
+ def isValid
889
+ return !@error.isValid
890
+ end
891
+
892
+ def valid?
893
+ return !@error.isValid
894
+ end
895
+
896
+ def value
897
+ return @data.value
898
+ end
899
+
900
+ def error
901
+ return @error
902
+ end
903
+ end
904
+
905
+ class Dial < Qt::Base
906
+ def range=(arg)
907
+ if arg.kind_of? Range
908
+ return super(arg.begin, arg.exclude_end? ? arg.end - 1 : arg.end)
909
+ else
910
+ return super(arg)
911
+ end
912
+ end
913
+ end
914
+
915
+ class Dialog < Qt::Base
916
+ def exec(*args)
917
+ method_missing(:exec, *args)
918
+ end
919
+ end
920
+
921
+ class Dir < Qt::Base
922
+ Time = Qt::Enum.new(1, "QDir::SortFlag")
923
+ end
924
+
925
+ class DomAttr < Qt::Base
926
+ def name(*args)
927
+ method_missing(:name, *args)
928
+ end
929
+ end
930
+
931
+ class DoubleSpinBox < Qt::Base
932
+ def range=(arg)
933
+ if arg.kind_of? Range
934
+ return super(arg.begin, arg.exclude_end? ? arg.end - 1 : arg.end)
935
+ else
936
+ return super(arg)
937
+ end
938
+ end
939
+ end
940
+
941
+ class DoubleValidator < Qt::Base
942
+ def range=(arg)
943
+ if arg.kind_of? Range
944
+ return super(arg.begin, arg.exclude_end? ? arg.end - 1 : arg.end)
945
+ else
946
+ return super(arg)
947
+ end
948
+ end
949
+ end
950
+
951
+ class DomDocumentType < Qt::Base
952
+ def name(*args)
953
+ method_missing(:name, *args)
954
+ end
955
+
956
+ def type(*args)
957
+ method_missing(:type, *args)
958
+ end
959
+ end
960
+
961
+ class DragEnterEvent < Qt::Base
962
+ def type(*args)
963
+ method_missing(:type, *args)
964
+ end
965
+ end
966
+
967
+ class DragLeaveEvent < Qt::Base
968
+ def type(*args)
969
+ method_missing(:type, *args)
970
+ end
971
+ end
972
+
973
+ class DropEvent < Qt::Base
974
+ def format(*args)
975
+ method_missing(:format, *args)
976
+ end
977
+ def type(*args)
978
+ method_missing(:type, *args)
979
+ end
980
+ end
981
+
982
+ class Event < Qt::Base
983
+ def type(*args)
984
+ method_missing(:type, *args)
985
+ end
986
+ end
987
+
988
+ class EventLoop < Qt::Base
989
+ def exec(*args)
990
+ method_missing(:exec, *args)
991
+ end
992
+
993
+ def exit(*args)
994
+ method_missing(:exit, *args)
995
+ end
996
+ end
997
+
998
+ class File < Qt::Base
999
+ def open(*args)
1000
+ method_missing(:open, *args)
1001
+ end
1002
+ end
1003
+
1004
+ class FileOpenEvent < Qt::Base
1005
+ def type(*args)
1006
+ method_missing(:type, *args)
1007
+ end
1008
+ end
1009
+
1010
+ class FileIconProvider < Qt::Base
1011
+ File = Qt::Enum.new(6, "QFileIconProvider::IconType")
1012
+
1013
+ def type(*args)
1014
+ method_missing(:type, *args)
1015
+ end
1016
+ end
1017
+
1018
+ class FocusEvent < Qt::Base
1019
+ def type(*args)
1020
+ method_missing(:type, *args)
1021
+ end
1022
+ end
1023
+
1024
+ class Font < Qt::Base
1025
+ def inspect
1026
+ str = super
1027
+ str.sub(/>$/, " family=%s, pointSize=%d, weight=%d, italic=%s, bold=%s, underline=%s, strikeOut=%s>" %
1028
+ [family.inspect, pointSize, weight, italic, bold, underline, strikeOut])
1029
+ end
1030
+
1031
+ def pretty_print(pp)
1032
+ str = to_s
1033
+ pp.text str.sub(/>$/, "\n family=%s,\n pointSize=%d,\n weight=%d,\n italic=%s,\n bold=%s,\n underline=%s,\n strikeOut=%s>" %
1034
+ [family.inspect, pointSize, weight, italic, bold, underline, strikeOut])
1035
+ end
1036
+ end
1037
+
1038
+ class FontDatabase < Qt::Base
1039
+ Symbol = Qt::Enum.new(30, "QFontDatabase::WritingSystem")
1040
+ end
1041
+
1042
+ class Ftp < Qt::Base
1043
+ def abort(*args)
1044
+ method_missing(:abort, *args)
1045
+ end
1046
+ end
1047
+
1048
+ class GLContext < Qt::Base
1049
+ def format(*args)
1050
+ method_missing(:format, *args)
1051
+ end
1052
+ end
1053
+
1054
+ class GLPixelBuffer < Qt::Base
1055
+ def format(*args)
1056
+ method_missing(:format, *args)
1057
+ end
1058
+ end
1059
+
1060
+ class GLWidget < Qt::Base
1061
+ def format(*args)
1062
+ method_missing(:format, *args)
1063
+ end
1064
+ end
1065
+
1066
+ class GenericArgument < Qt::Base
1067
+ def name(*args)
1068
+ method_missing(:name, *args)
1069
+ end
1070
+ end
1071
+
1072
+ class Gradient < Qt::Base
1073
+ def type(*args)
1074
+ method_missing(:type, *args)
1075
+ end
1076
+ end
1077
+
1078
+ class GraphicsEllipseItem < Qt::Base
1079
+ def type(*args)
1080
+ method_missing(:type, *args)
1081
+ end
1082
+ end
1083
+
1084
+ class GraphicsItem < Qt::Base
1085
+ def type(*args)
1086
+ method_missing(:type, *args)
1087
+ end
1088
+ end
1089
+
1090
+ class GraphicsItemGroup < Qt::Base
1091
+ Type = 10
1092
+
1093
+ def type(*args)
1094
+ method_missing(:type, *args)
1095
+ end
1096
+ end
1097
+
1098
+ class GraphicsLineItem < Qt::Base
1099
+ Type = 6
1100
+ def type(*args)
1101
+ method_missing(:type, *args)
1102
+ end
1103
+ end
1104
+
1105
+ class GraphicsPathItem < Qt::Base
1106
+ Type = 2
1107
+ def type(*args)
1108
+ method_missing(:type, *args)
1109
+ end
1110
+ end
1111
+
1112
+ class GraphicsPixmapItem < Qt::Base
1113
+ def type(*args)
1114
+ method_missing(:type, *args)
1115
+ end
1116
+ end
1117
+
1118
+ class GraphicsPolygonItem < Qt::Base
1119
+ Type = 5
1120
+ def type(*args)
1121
+ method_missing(:type, *args)
1122
+ end
1123
+ end
1124
+
1125
+ class GraphicsProxyWidget < Qt::Base
1126
+ Type = 12
1127
+ def type(*args)
1128
+ method_missing(:type, *args)
1129
+ end
1130
+ end
1131
+
1132
+ class GraphicsRectItem < Qt::Base
1133
+ Type = 3
1134
+ def type(*args)
1135
+ method_missing(:type, *args)
1136
+ end
1137
+ end
1138
+
1139
+ class GraphicsSceneDragDropEvent < Qt::Base
1140
+ def type(*args)
1141
+ method_missing(:type, *args)
1142
+ end
1143
+ end
1144
+
1145
+ class GraphicsSceneMouseEvent < Qt::Base
1146
+ def type(*args)
1147
+ method_missing(:type, *args)
1148
+ end
1149
+ end
1150
+
1151
+ class GraphicsSceneContextMenuEvent < Qt::Base
1152
+ def type(*args)
1153
+ method_missing(:type, *args)
1154
+ end
1155
+ end
1156
+
1157
+ class GraphicsSceneHoverEvent < Qt::Base
1158
+ def type(*args)
1159
+ method_missing(:type, *args)
1160
+ end
1161
+ end
1162
+
1163
+ class GraphicsSceneHelpEvent < Qt::Base
1164
+ def type(*args)
1165
+ method_missing(:type, *args)
1166
+ end
1167
+ end
1168
+
1169
+ class GraphicsSceneWheelEvent < Qt::Base
1170
+ def type(*args)
1171
+ method_missing(:type, *args)
1172
+ end
1173
+ end
1174
+
1175
+ class GraphicsSimpleTextItem < Qt::Base
1176
+ Type = 9
1177
+ def type(*args)
1178
+ method_missing(:type, *args)
1179
+ end
1180
+ end
1181
+
1182
+ class GraphicsSvgItem < Qt::Base
1183
+ Type = 13
1184
+ def type(*args)
1185
+ method_missing(:type, *args)
1186
+ end
1187
+ end
1188
+
1189
+ class GraphicsTextItem < Qt::Base
1190
+ Type = 8
1191
+ def type(*args)
1192
+ method_missing(:type, *args)
1193
+ end
1194
+ end
1195
+
1196
+ class GraphicsWidget < Qt::Base
1197
+ Type = 11
1198
+ def type(*args)
1199
+ method_missing(:type, *args)
1200
+ end
1201
+ end
1202
+
1203
+ class HelpEvent < Qt::Base
1204
+ def type(*args)
1205
+ method_missing(:type, *args)
1206
+ end
1207
+ end
1208
+
1209
+ class HideEvent < Qt::Base
1210
+ def type(*args)
1211
+ method_missing(:type, *args)
1212
+ end
1213
+ end
1214
+
1215
+ class HoverEvent < Qt::Base
1216
+ def type(*args)
1217
+ method_missing(:type, *args)
1218
+ end
1219
+ end
1220
+
1221
+ class Http < Qt::Base
1222
+ def abort(*args)
1223
+ method_missing(:abort, *args)
1224
+ end
1225
+ end
1226
+
1227
+ class HttpRequestHeader < Qt::Base
1228
+ def method(*args)
1229
+ if args.length == 1
1230
+ super(*args)
1231
+ else
1232
+ method_missing(:method, *args)
1233
+ end
1234
+ end
1235
+ end
1236
+
1237
+ class IconDragEvent < Qt::Base
1238
+ def type(*args)
1239
+ method_missing(:type, *args)
1240
+ end
1241
+ end
1242
+
1243
+ class InputEvent < Qt::Base
1244
+ def type(*args)
1245
+ method_missing(:type, *args)
1246
+ end
1247
+ end
1248
+
1249
+ class InputMethodEvent < Qt::Base
1250
+ def type(*args)
1251
+ method_missing(:type, *args)
1252
+ end
1253
+ end
1254
+
1255
+ class IODevice < Qt::Base
1256
+ def open(*args)
1257
+ method_missing(:open, *args)
1258
+ end
1259
+ end
1260
+
1261
+ class Image < Qt::Base
1262
+ def fromImage(image)
1263
+ send("operator=".to_sym, image)
1264
+ end
1265
+
1266
+ def format(*args)
1267
+ method_missing(:format, *args)
1268
+ end
1269
+
1270
+ def load(*args)
1271
+ method_missing(:load, *args)
1272
+ end
1273
+ end
1274
+
1275
+ class ImageIOHandler < Qt::Base
1276
+ def format(*args)
1277
+ method_missing(:format, *args)
1278
+ end
1279
+
1280
+ def name(*args)
1281
+ method_missing(:name, *args)
1282
+ end
1283
+ end
1284
+
1285
+ class ImageReader < Qt::Base
1286
+ def format(*args)
1287
+ method_missing(:format, *args)
1288
+ end
1289
+ end
1290
+
1291
+ class ImageWriter < Qt::Base
1292
+ def format(*args)
1293
+ method_missing(:format, *args)
1294
+ end
1295
+ end
1296
+
1297
+ class IntValidator < Qt::Base
1298
+ def range=(arg)
1299
+ if arg.kind_of? Range
1300
+ return super(arg.begin, arg.exclude_end? ? arg.end - 1 : arg.end)
1301
+ else
1302
+ return super(arg)
1303
+ end
1304
+ end
1305
+ end
1306
+
1307
+ class ItemSelection < Qt::Base
1308
+ include Enumerable
1309
+
1310
+ def each
1311
+ for i in 0...count
1312
+ yield at(i)
1313
+ end
1314
+ return self
1315
+ end
1316
+
1317
+ def select(*args)
1318
+ method_missing(:select, *args)
1319
+ end
1320
+
1321
+ def split(*args)
1322
+ method_missing(:split, *args)
1323
+ end
1324
+ end
1325
+
1326
+ class ItemSelectionModel < Qt::Base
1327
+ def select(*args)
1328
+ method_missing(:select, *args)
1329
+ end
1330
+ end
1331
+
1332
+ class KeyEvent < Qt::Base
1333
+ def type(*args)
1334
+ method_missing(:type, *args)
1335
+ end
1336
+ end
1337
+
1338
+ class KeySequence < Qt::Base
1339
+ def initialize(*args)
1340
+ if args.length == 1 && args[0].kind_of?(Qt::Enum) && args[0].type == "Qt::Key"
1341
+ return super(args[0].to_i)
1342
+ end
1343
+ return super(*args)
1344
+ end
1345
+
1346
+ def inspect
1347
+ str = super
1348
+ str.sub(/>$/, " %s>" % toString)
1349
+ end
1350
+
1351
+ def pretty_print(pp)
1352
+ str = to_s
1353
+ pp.text str.sub(/>$/, " %s>" % toString)
1354
+ end
1355
+ end
1356
+
1357
+ class LCDNumber < Qt::Base
1358
+ def display(item)
1359
+ method_missing(:display, item)
1360
+ end
1361
+ end
1362
+
1363
+ class Library < Qt::Base
1364
+ def load(*args)
1365
+ method_missing(:load, *args)
1366
+ end
1367
+ end
1368
+
1369
+ class ListWidgetItem < Qt::Base
1370
+ def clone(*args)
1371
+ Qt::ListWidgetItem.new(self)
1372
+ end
1373
+
1374
+ def type(*args)
1375
+ method_missing(:type, *args)
1376
+ end
1377
+
1378
+ def inspect
1379
+ str = super
1380
+ str.sub(/>$/, " text='%s'>" % text)
1381
+ end
1382
+
1383
+ def pretty_print(pp)
1384
+ str = to_s
1385
+ pp.text str.sub(/>$/, " text='%s'>" % text)
1386
+ end
1387
+ end
1388
+
1389
+ class Locale < Qt::Base
1390
+ def name(*args)
1391
+ method_missing(:name, *args)
1392
+ end
1393
+
1394
+ def system(*args)
1395
+ method_missing(:system, *args)
1396
+ end
1397
+ end
1398
+
1399
+ class Menu < Qt::Base
1400
+ def exec(*args)
1401
+ method_missing(:exec, *args)
1402
+ end
1403
+ end
1404
+
1405
+ class MetaClassInfo < Qt::Base
1406
+ def name(*args)
1407
+ method_missing(:name, *args)
1408
+ end
1409
+ end
1410
+
1411
+ class MetaEnum < Qt::Base
1412
+ def name(*args)
1413
+ method_missing(:name, *args)
1414
+ end
1415
+
1416
+ def keyValues()
1417
+ res = []
1418
+ for i in 0...keyCount()
1419
+ if flag?
1420
+ res.push "%s=0x%x" % [key(i), value(i)]
1421
+ else
1422
+ res.push "%s=%d" % [key(i), value(i)]
1423
+ end
1424
+ end
1425
+ return res
1426
+ end
1427
+
1428
+ def inspect
1429
+ str = super
1430
+ str.sub(/>$/, " scope=%s, name=%s, keyValues=Array (%d element(s))>" % [scope, name, keyValues.length])
1431
+ end
1432
+
1433
+ def pretty_print(pp)
1434
+ str = to_s
1435
+ pp.text str.sub(/>$/, " scope=%s, name=%s, keyValues=Array (%d element(s))>" % [scope, name, keyValues.length])
1436
+ end
1437
+ end
1438
+
1439
+ class MetaMethod < Qt::Base
1440
+ # Oops, name clash with the Signal module so hard code
1441
+ # this value rather than get it from the Smoke runtime
1442
+ Method = Qt::Enum.new(0, "QMetaMethod::MethodType")
1443
+ Signal = Qt::Enum.new(1, "QMetaMethod::MethodType")
1444
+ end
1445
+
1446
+ class MetaObject < Qt::Base
1447
+ def method(*args)
1448
+ if args.length == 1 && args[0].kind_of?(Symbol)
1449
+ super(*args)
1450
+ else
1451
+ method_missing(:method, *args)
1452
+ end
1453
+ end
1454
+
1455
+ # Add three methods, 'propertyNames()', 'slotNames()' and 'signalNames()'
1456
+ # from Qt3, as they are very useful when debugging
1457
+
1458
+ def propertyNames(inherits = false)
1459
+ res = []
1460
+ if inherits
1461
+ for p in 0...propertyCount()
1462
+ res.push property(p).name
1463
+ end
1464
+ else
1465
+ for p in propertyOffset()...propertyCount()
1466
+ res.push property(p).name
1467
+ end
1468
+ end
1469
+ return res
1470
+ end
1471
+
1472
+ def slotNames(inherits = false)
1473
+ res = []
1474
+ if inherits
1475
+ for m in 0...methodCount()
1476
+ if method(m).methodType == Qt::MetaMethod::Slot
1477
+ res.push "%s %s" % [method(m).typeName == "" ? "void" : method(m).typeName,
1478
+ method(m).signature]
1479
+ end
1480
+ end
1481
+ else
1482
+ for m in methodOffset()...methodCount()
1483
+ if method(m).methodType == Qt::MetaMethod::Slot
1484
+ res.push "%s %s" % [method(m).typeName == "" ? "void" : method(m).typeName,
1485
+ method(m).signature]
1486
+ end
1487
+ end
1488
+ end
1489
+ return res
1490
+ end
1491
+
1492
+ def signalNames(inherits = false)
1493
+ res = []
1494
+ if inherits
1495
+ for m in 0...methodCount()
1496
+ if method(m).methodType == Qt::MetaMethod::Signal
1497
+ res.push "%s %s" % [method(m).typeName == "" ? "void" : method(m).typeName,
1498
+ method(m).signature]
1499
+ end
1500
+ end
1501
+ else
1502
+ for m in methodOffset()...methodCount()
1503
+ if method(m).methodType == Qt::MetaMethod::Signal
1504
+ res.push "%s %s" % [method(m).typeName == "" ? "void" : method(m).typeName,
1505
+ method(m).signature]
1506
+ end
1507
+ end
1508
+ end
1509
+ return res
1510
+ end
1511
+
1512
+ def enumerators(inherits = false)
1513
+ res = []
1514
+ if inherits
1515
+ for e in 0...enumeratorCount()
1516
+ res.push enumerator(e)
1517
+ end
1518
+ else
1519
+ for e in enumeratorOffset()...enumeratorCount()
1520
+ res.push enumerator(e)
1521
+ end
1522
+ end
1523
+ return res
1524
+ end
1525
+
1526
+ def inspect
1527
+ str = super
1528
+ str.sub!(/>$/, "")
1529
+ str << " className=%s," % className
1530
+ str << " propertyNames=Array (%d element(s))," % propertyNames.length unless propertyNames.length == 0
1531
+ str << " signalNames=Array (%d element(s))," % signalNames.length unless signalNames.length == 0
1532
+ str << " slotNames=Array (%d element(s))," % slotNames.length unless slotNames.length == 0
1533
+ str << " enumerators=Array (%d element(s))," % enumerators.length unless enumerators.length == 0
1534
+ str << " superClass=%s," % superClass.inspect unless superClass == nil
1535
+ str.chop!
1536
+ str << ">"
1537
+ end
1538
+
1539
+ def pretty_print(pp)
1540
+ str = to_s
1541
+ str.sub!(/>$/, "")
1542
+ str << "\n className=%s," % className
1543
+ str << "\n propertyNames=Array (%d element(s))," % propertyNames.length unless propertyNames.length == 0
1544
+ str << "\n signalNames=Array (%d element(s))," % signalNames.length unless signalNames.length == 0
1545
+ str << "\n slotNames=Array (%d element(s))," % slotNames.length unless slotNames.length == 0
1546
+ str << "\n enumerators=Array (%d element(s))," % enumerators.length unless enumerators.length == 0
1547
+ str << "\n superClass=%s," % superClass.inspect unless superClass == nil
1548
+ str << "\n methodCount=%d," % methodCount
1549
+ str << "\n methodOffset=%d," % methodOffset
1550
+ str << "\n propertyCount=%d," % propertyCount
1551
+ str << "\n propertyOffset=%d," % propertyOffset
1552
+ str << "\n enumeratorCount=%d," % enumeratorCount
1553
+ str << "\n enumeratorOffset=%d," % enumeratorOffset
1554
+ str.chop!
1555
+ str << ">"
1556
+ pp.text str
1557
+ end
1558
+ end
1559
+
1560
+ class MetaProperty < Qt::Base
1561
+ def name(*args)
1562
+ method_missing(:name, *args)
1563
+ end
1564
+
1565
+ def type(*args)
1566
+ method_missing(:type, *args)
1567
+ end
1568
+ end
1569
+
1570
+ class MetaType < Qt::Base
1571
+ Float = Qt::Enum.new(135, "QMetaType::Type")
1572
+
1573
+ def load(*args)
1574
+ method_missing(:load, *args)
1575
+ end
1576
+
1577
+ def type(*args)
1578
+ method_missing(:type, *args)
1579
+ end
1580
+ end
1581
+
1582
+ class MouseEvent < Qt::Base
1583
+ def type(*args)
1584
+ method_missing(:type, *args)
1585
+ end
1586
+ end
1587
+
1588
+ class MoveEvent < Qt::Base
1589
+ def type(*args)
1590
+ method_missing(:type, *args)
1591
+ end
1592
+ end
1593
+
1594
+ class Movie < Qt::Base
1595
+ def format(*args)
1596
+ method_missing(:format, *args)
1597
+ end
1598
+ end
1599
+
1600
+ class NetworkProxy < Qt::Base
1601
+ def type(*args)
1602
+ method_missing(:type, *args)
1603
+ end
1604
+ end
1605
+
1606
+ class Object < Qt::Base
1607
+ end
1608
+
1609
+ class PageSetupDialog < Qt::Base
1610
+ def exec(*args)
1611
+ method_missing(:exec, *args)
1612
+ end
1613
+ end
1614
+
1615
+ class PaintEvent < Qt::Base
1616
+ def type(*args)
1617
+ method_missing(:type, *args)
1618
+ end
1619
+ end
1620
+
1621
+ class Picture < Qt::Base
1622
+ def load(*args)
1623
+ method_missing(:load, *args)
1624
+ end
1625
+ end
1626
+
1627
+ class PictureIO < Qt::Base
1628
+ def format(*args)
1629
+ method_missing(:format, *args)
1630
+ end
1631
+ end
1632
+
1633
+ class Pixmap < Qt::Base
1634
+ def load(*args)
1635
+ method_missing(:load, *args)
1636
+ end
1637
+ end
1638
+
1639
+ class PluginLoader < Qt::Base
1640
+ def load(*args)
1641
+ method_missing(:load, *args)
1642
+ end
1643
+ end
1644
+
1645
+ class Point < Qt::Base
1646
+ def inspect
1647
+ str = super
1648
+ str.sub(/>$/, " x=%d, y=%d>" % [self.x, self.y])
1649
+ end
1650
+
1651
+ def pretty_print(pp)
1652
+ str = to_s
1653
+ pp.text str.sub(/>$/, "\n x=%d,\n y=%d>" % [self.x, self.y])
1654
+ end
1655
+ end
1656
+
1657
+ class PointF < Qt::Base
1658
+ def inspect
1659
+ str = super
1660
+ str.sub(/>$/, " x=%f, y=%f>" % [self.x, self.y])
1661
+ end
1662
+
1663
+ def pretty_print(pp)
1664
+ str = to_s
1665
+ pp.text str.sub(/>$/, "\n x=%f,\n y=%f>" % [self.x, self.y])
1666
+ end
1667
+ end
1668
+
1669
+ class Polygon < Qt::Base
1670
+ include Enumerable
1671
+
1672
+ def each
1673
+ for i in 0...count
1674
+ yield point(i)
1675
+ end
1676
+ return self
1677
+ end
1678
+ end
1679
+
1680
+ class PolygonF < Qt::Base
1681
+ include Enumerable
1682
+
1683
+ def each
1684
+ for i in 0...count
1685
+ yield point(i)
1686
+ end
1687
+ return self
1688
+ end
1689
+ end
1690
+
1691
+ class PrintDialog < Qt::Base
1692
+ def exec(*args)
1693
+ method_missing(:exec, *args)
1694
+ end
1695
+ end
1696
+
1697
+ class Process < Qt::Base
1698
+ StandardError = Qt::Enum.new(1, "QProcess::ProcessChannel")
1699
+ end
1700
+
1701
+ class ProgressBar < Qt::Base
1702
+ def range=(arg)
1703
+ if arg.kind_of? Range
1704
+ return super(arg.begin, arg.exclude_end? ? arg.end - 1 : arg.end)
1705
+ else
1706
+ return super(arg)
1707
+ end
1708
+ end
1709
+ end
1710
+
1711
+ class ProgressDialog < Qt::Base
1712
+ def range=(arg)
1713
+ if arg.kind_of? Range
1714
+ return super(arg.begin, arg.exclude_end? ? arg.end - 1 : arg.end)
1715
+ else
1716
+ return super(arg)
1717
+ end
1718
+ end
1719
+ end
1720
+
1721
+ class Printer < Qt::Base
1722
+ def abort(*args)
1723
+ method_missing(:abort, *args)
1724
+ end
1725
+ end
1726
+
1727
+ class PushButton < Qt::Base
1728
+ def setShortcut(arg)
1729
+ if arg.kind_of?(String)
1730
+ return super(Qt::KeySequence.new(arg))
1731
+ else
1732
+ return super(arg)
1733
+ end
1734
+ end
1735
+
1736
+ def shortcut=(arg)
1737
+ setShortcut(arg)
1738
+ end
1739
+ end
1740
+
1741
+ class Line < Qt::Base
1742
+ def inspect
1743
+ str = super
1744
+ str.sub(/>$/, " x1=%d, y1=%d, x2=%d, y2=%d>" % [x1, y1, x2, y2])
1745
+ end
1746
+
1747
+ def pretty_print(pp)
1748
+ str = to_s
1749
+ pp.text str.sub(/>$/, "\n x1=%d,\n y1=%d,\n x2=%d,\n y2=%d>" % [x1, y1, x2, y2])
1750
+ end
1751
+ end
1752
+
1753
+ class LineF < Qt::Base
1754
+ def inspect
1755
+ str = super
1756
+ str.sub(/>$/, " x1=%f, y1=%f, x2=%f, y2=%f>" % [x1, y1, x2, y2])
1757
+ end
1758
+
1759
+ def pretty_print(pp)
1760
+ str = to_s
1761
+ pp.text str.sub(/>$/, "\n x1=%f,\n y1=%f,\n x2=%f,\n y2=%f>" % [x1, y1, x2, y2])
1762
+ end
1763
+ end
1764
+
1765
+ class MetaType < Qt::Base
1766
+ def self.type(*args)
1767
+ method_missing(:type, *args)
1768
+ end
1769
+ end
1770
+
1771
+ class ModelIndex < Qt::Base
1772
+ def inspect
1773
+ str = super
1774
+ str.sub(/>$/, " valid?=%s, row=%s, column=%s>" % [valid?, row, column])
1775
+ end
1776
+
1777
+ def pretty_print(pp)
1778
+ str = to_s
1779
+ pp.text str.sub(/>$/, "\n valid?=%s,\n row=%s,\n column=%s>" % [valid?, row, column])
1780
+ end
1781
+ end
1782
+
1783
+ class RadioButton < Qt::Base
1784
+ def setShortcut(arg)
1785
+ if arg.kind_of?(String)
1786
+ return super(Qt::KeySequence.new(arg))
1787
+ else
1788
+ return super(arg)
1789
+ end
1790
+ end
1791
+
1792
+ def shortcut=(arg)
1793
+ setShortcut(arg)
1794
+ end
1795
+ end
1796
+
1797
+ class Rect < Qt::Base
1798
+ def inspect
1799
+ str = super
1800
+ str.sub(/>$/, " x=%d, y=%d, width=%d, height=%d>" % [self.x, self.y, width, height])
1801
+ end
1802
+
1803
+ def pretty_print(pp)
1804
+ str = to_s
1805
+ pp.text str.sub(/>$/, "\n x=%d,\n y=%d,\n width=%d,\n height=%d>" % [self.x, self.y, width, height])
1806
+ end
1807
+ end
1808
+
1809
+ class RectF < Qt::Base
1810
+ def inspect
1811
+ str = super
1812
+ str.sub(/>$/, " x=%f, y=%f, width=%f, height=%f>" % [self.x, self.y, width, height])
1813
+ end
1814
+
1815
+ def pretty_print(pp)
1816
+ str = to_s
1817
+ pp.text str.sub(/>$/, "\n x=%f,\n y=%f,\n width=%f,\n height=%f>" % [self.x, self.y, width, height])
1818
+ end
1819
+ end
1820
+
1821
+ class ResizeEvent < Qt::Base
1822
+ def type(*args)
1823
+ method_missing(:type, *args)
1824
+ end
1825
+ end
1826
+
1827
+ class ScrollBar < Qt::Base
1828
+ def range=(arg)
1829
+ if arg.kind_of? Range
1830
+ return super(arg.begin, arg.exclude_end? ? arg.end - 1 : arg.end)
1831
+ else
1832
+ return super(arg)
1833
+ end
1834
+ end
1835
+ end
1836
+
1837
+ class Shortcut < Qt::Base
1838
+ def id(*args)
1839
+ method_missing(:id, *args)
1840
+ end
1841
+ end
1842
+
1843
+ class ShortcutEvent < Qt::Base
1844
+ def type(*args)
1845
+ method_missing(:type, *args)
1846
+ end
1847
+ end
1848
+
1849
+ class ShowEvent < Qt::Base
1850
+ def type(*args)
1851
+ method_missing(:type, *args)
1852
+ end
1853
+ end
1854
+
1855
+ class Size < Qt::Base
1856
+ def inspect
1857
+ str = super
1858
+ str.sub(/>$/, " width=%d, height=%d>" % [width, height])
1859
+ end
1860
+
1861
+ def pretty_print(pp)
1862
+ str = to_s
1863
+ pp.text str.sub(/>$/, "\n width=%d,\n height=%d>" % [width, height])
1864
+ end
1865
+ end
1866
+
1867
+ class SizeF < Qt::Base
1868
+ def inspect
1869
+ str = super
1870
+ str.sub(/>$/, " width=%f, height=%f>" % [width, height])
1871
+ end
1872
+
1873
+ def pretty_print(pp)
1874
+ str = to_s
1875
+ pp.text str.sub(/>$/, "\n width=%f,\n height=%f>" % [width, height])
1876
+ end
1877
+ end
1878
+
1879
+ class SizePolicy < Qt::Base
1880
+ def inspect
1881
+ str = super
1882
+ str.sub(/>$/, " horizontalPolicy=%d, verticalPolicy=%d>" % [horizontalPolicy, verticalPolicy])
1883
+ end
1884
+
1885
+ def pretty_print(pp)
1886
+ str = to_s
1887
+ pp.text str.sub(/>$/, "\n horizontalPolicy=%d,\n verticalPolicy=%d>" % [horizontalPolicy, verticalPolicy])
1888
+ end
1889
+ end
1890
+
1891
+ class Slider < Qt::Base
1892
+ def range=(arg)
1893
+ if arg.kind_of? Range
1894
+ return super(arg.begin, arg.exclude_end? ? arg.end - 1 : arg.end)
1895
+ else
1896
+ return super(arg)
1897
+ end
1898
+ end
1899
+ end
1900
+
1901
+ class SocketNotifier < Qt::Base
1902
+ Exception = Qt::Enum.new(2, "QSocketNotifier::Type")
1903
+
1904
+ def type(*args)
1905
+ method_missing(:type, *args)
1906
+ end
1907
+ end
1908
+
1909
+ class SpinBox < Qt::Base
1910
+ def range=(arg)
1911
+ if arg.kind_of? Range
1912
+ return super(arg.begin, arg.exclude_end? ? arg.end - 1 : arg.end)
1913
+ else
1914
+ return super(arg)
1915
+ end
1916
+ end
1917
+ end
1918
+
1919
+ class SqlDatabase < Qt::Base
1920
+ def exec(*args)
1921
+ method_missing(:exec, *args)
1922
+ end
1923
+
1924
+ def open(*args)
1925
+ method_missing(:open, *args)
1926
+ end
1927
+ end
1928
+
1929
+ class SqlError < Qt::Base
1930
+ def type(*args)
1931
+ method_missing(:type, *args)
1932
+ end
1933
+ end
1934
+
1935
+ class SqlField < Qt::Base
1936
+ def name(*args)
1937
+ method_missing(:name, *args)
1938
+ end
1939
+
1940
+ def type(*args)
1941
+ method_missing(:type, *args)
1942
+ end
1943
+ end
1944
+
1945
+ class SqlIndex < Qt::Base
1946
+ def name(*args)
1947
+ method_missing(:name, *args)
1948
+ end
1949
+ end
1950
+
1951
+ class SqlQuery < Qt::Base
1952
+ def exec(*args)
1953
+ method_missing(:exec, *args)
1954
+ end
1955
+ end
1956
+
1957
+ class SqlResult < Qt::Base
1958
+ def exec(*args)
1959
+ method_missing(:exec, *args)
1960
+ end
1961
+ end
1962
+
1963
+ class SqlTableModel < Qt::Base
1964
+ def select(*k)
1965
+ method_missing(:select, *k)
1966
+ end
1967
+ end
1968
+
1969
+ class StandardItem < Qt::Base
1970
+ def inspect
1971
+ str = super
1972
+ str.sub(/>$/, " text='%s'>" % [text])
1973
+ end
1974
+
1975
+ def pretty_print(pp)
1976
+ str = to_s
1977
+ pp.text str.sub(/>$/, "\n text='%s'>" % [text])
1978
+ end
1979
+
1980
+ def type(*args)
1981
+ method_missing(:type, *args)
1982
+ end
1983
+
1984
+ def clone
1985
+ Qt::StandardItem.new(self)
1986
+ end
1987
+ end
1988
+
1989
+ class StandardItemModel < Qt::Base
1990
+ def type(*args)
1991
+ method_missing(:type, *args)
1992
+ end
1993
+ end
1994
+
1995
+ class StatusTipEvent < Qt::Base
1996
+ def type(*args)
1997
+ method_missing(:type, *args)
1998
+ end
1999
+ end
2000
+
2001
+ class StyleHintReturn < Qt::Base
2002
+ def type(*args)
2003
+ method_missing(:type, *args)
2004
+ end
2005
+ end
2006
+
2007
+ class StyleOption < Qt::Base
2008
+ def type(*args)
2009
+ method_missing(:type, *args)
2010
+ end
2011
+ end
2012
+
2013
+ class SyntaxHighlighter < Qt::Base
2014
+ def format(*args)
2015
+ method_missing(:format, *args)
2016
+ end
2017
+ end
2018
+
2019
+ class TableWidgetItem < Qt::Base
2020
+ def clone(*args)
2021
+ Qt::TableWidgetItem.new(self)
2022
+ end
2023
+
2024
+ def type(*args)
2025
+ method_missing(:type, *args)
2026
+ end
2027
+
2028
+ def inspect
2029
+ str = super
2030
+ str.sub(/>$/, " text='%s'>" % text)
2031
+ end
2032
+
2033
+ def pretty_print(pp)
2034
+ str = to_s
2035
+ pp.text str.sub(/>$/, " text='%s'>" % text)
2036
+ end
2037
+ end
2038
+
2039
+ class TemporaryFile < Qt::Base
2040
+ def open(*args)
2041
+ method_missing(:open, *args)
2042
+ end
2043
+ end
2044
+
2045
+ class TextCursor < Qt::Base
2046
+ def select(*k)
2047
+ method_missing(:select, *k)
2048
+ end
2049
+ end
2050
+
2051
+ class TextDocument < Qt::Base
2052
+ def clone(*args)
2053
+ method_missing(:clone, *args)
2054
+ end
2055
+
2056
+ def print(*args)
2057
+ method_missing(:print, *args)
2058
+ end
2059
+ end
2060
+
2061
+ class TextFormat < Qt::Base
2062
+ def type(*args)
2063
+ method_missing(:type, *args)
2064
+ end
2065
+ end
2066
+
2067
+ class TextImageFormat < Qt::Base
2068
+ def name(*args)
2069
+ method_missing(:name, *args)
2070
+ end
2071
+ end
2072
+
2073
+ class TextInlineObject < Qt::Base
2074
+ def format(*args)
2075
+ method_missing(:format, *args)
2076
+ end
2077
+ end
2078
+
2079
+ class TextLength < Qt::Base
2080
+ def type(*args)
2081
+ method_missing(:type, *args)
2082
+ end
2083
+ end
2084
+
2085
+ class TextList < Qt::Base
2086
+ def format(*args)
2087
+ method_missing(:format, *args)
2088
+ end
2089
+ end
2090
+
2091
+ class TextObject < Qt::Base
2092
+ def format(*args)
2093
+ method_missing(:format, *args)
2094
+ end
2095
+ end
2096
+
2097
+ class TextTable < Qt::Base
2098
+ def format(*args)
2099
+ method_missing(:format, *args)
2100
+ end
2101
+ end
2102
+
2103
+ class TextTableCell < Qt::Base
2104
+ def format(*args)
2105
+ method_missing(:format, *args)
2106
+ end
2107
+ end
2108
+
2109
+ class Time < Qt::Base
2110
+ def initialize(*args)
2111
+ if args.size == 1 && args[0].class.name == "Time"
2112
+ return super(args[0].hour, args[0].min, args[0].sec)
2113
+ else
2114
+ return super(*args)
2115
+ end
2116
+ end
2117
+
2118
+ def inspect
2119
+ str = super
2120
+ str.sub(/>$/, " %s>" % toString)
2121
+ end
2122
+
2123
+ def pretty_print(pp)
2124
+ str = to_s
2125
+ pp.text str.sub(/>$/, " %s>" % toString)
2126
+ end
2127
+ end
2128
+
2129
+ class Timer < Qt::Base
2130
+ def start(*args)
2131
+ method_missing(:start, *args)
2132
+ end
2133
+ end
2134
+
2135
+ class TimerEvent < Qt::Base
2136
+ def type(*args)
2137
+ method_missing(:type, *args)
2138
+ end
2139
+ end
2140
+
2141
+ class TimeLine < Qt::Base
2142
+ def frameRange=(arg)
2143
+ if arg.kind_of? Range
2144
+ return super(arg.begin, arg.exclude_end? ? arg.end - 1 : arg.end)
2145
+ else
2146
+ return super(arg)
2147
+ end
2148
+ end
2149
+ end
2150
+
2151
+ class ToolButton < Qt::Base
2152
+ def setShortcut(arg)
2153
+ if arg.kind_of?(String)
2154
+ return super(Qt::KeySequence.new(arg))
2155
+ else
2156
+ return super(arg)
2157
+ end
2158
+ end
2159
+
2160
+ def shortcut=(arg)
2161
+ setShortcut(arg)
2162
+ end
2163
+ end
2164
+
2165
+ class Translator < Qt::Base
2166
+ def load(*args)
2167
+ method_missing(:load, *args)
2168
+ end
2169
+ end
2170
+
2171
+ class TreeWidget < Qt::Base
2172
+ include Enumerable
2173
+
2174
+ def each
2175
+ it = Qt::TreeWidgetItemIterator.new(self)
2176
+ while it.current
2177
+ yield it.current
2178
+ it += 1
2179
+ end
2180
+ end
2181
+ end
2182
+
2183
+ class TreeWidgetItem < Qt::Base
2184
+ include Enumerable
2185
+
2186
+ def initialize(*args)
2187
+ # There is not way to distinguish between the copy constructor
2188
+ # QTreeWidgetItem (const QTreeWidgetItem & other)
2189
+ # and
2190
+ # QTreeWidgetItem (QTreeWidgetItem * parent, const QStringList & strings, int type = Type)
2191
+ # when the latter has a single argument. So force the second variant to be called
2192
+ if args.length == 1 && args[0].kind_of?(Qt::TreeWidgetItem)
2193
+ super(args[0], Qt::TreeWidgetItem::Type)
2194
+ else
2195
+ super(*args)
2196
+ end
2197
+ end
2198
+
2199
+ def inspect
2200
+ str = super
2201
+ str.sub!(/>$/, "")
2202
+ str << " parent=%s," % parent unless parent.nil?
2203
+ for i in 0..(columnCount - 1)
2204
+ str << " text%d='%s'," % [i, self.text(i)]
2205
+ end
2206
+ str.sub!(/,?$/, ">")
2207
+ end
2208
+
2209
+ def pretty_print(pp)
2210
+ str = to_s
2211
+ str.sub!(/>$/, "")
2212
+ str << " parent=%s," % parent unless parent.nil?
2213
+ for i in 0..(columnCount - 1)
2214
+ str << " text%d='%s'," % [i, self.text(i)]
2215
+ end
2216
+ str.sub!(/,?$/, ">")
2217
+ pp.text str
2218
+ end
2219
+
2220
+ def clone(*args)
2221
+ Qt::TreeWidgetItem.new(self)
2222
+ end
2223
+
2224
+ def type(*args)
2225
+ method_missing(:type, *args)
2226
+ end
2227
+
2228
+ def each
2229
+ it = Qt::TreeWidgetItemIterator.new(self)
2230
+ while it.current
2231
+ yield it.current
2232
+ it += 1
2233
+ end
2234
+ end
2235
+ end
2236
+
2237
+ class TreeWidgetItemIterator < Qt::Base
2238
+ def current
2239
+ return send("operator*".to_sym)
2240
+ end
2241
+ end
2242
+
2243
+ class Url < Qt::Base
2244
+ def inspect
2245
+ str = super
2246
+ str.sub(/>$/, " url=%s>" % toString)
2247
+ end
2248
+
2249
+ def pretty_print(pp)
2250
+ str = to_s
2251
+ pp.text str.sub(/>$/, " url=%s>" % toString)
2252
+ end
2253
+ end
2254
+
2255
+ class UrlInfo < Qt::Base
2256
+ def name(*args)
2257
+ method_missing(:name, *args)
2258
+ end
2259
+ end
2260
+
2261
+ class Uuid < Qt::Base
2262
+ Time = Qt::Enum.new(1, "QUuid::Version")
2263
+ end
2264
+
2265
+ class Variant < Qt::Base
2266
+ String = Qt::Enum.new(10, "QVariant::Type")
2267
+ Date = Qt::Enum.new(14, "QVariant::Type")
2268
+ Time = Qt::Enum.new(15, "QVariant::Type")
2269
+ DateTime = Qt::Enum.new(16, "QVariant::Type")
2270
+
2271
+ def initialize(*args)
2272
+ if args.size == 1 && args[0].nil?
2273
+ return super()
2274
+ elsif args.size == 1 && args[0].class.name == "Date"
2275
+ return super(Qt::Date.new(args[0]))
2276
+ elsif args.size == 1 && args[0].class.name == "DateTime"
2277
+ return super(Qt::DateTime.new( Qt::Date.new(args[0].year, args[0].month, args[0].day),
2278
+ Qt::Time.new(args[0].hour, args[0].min, args[0].sec) ) )
2279
+ elsif args.size == 1 && args[0].class.name == "Time"
2280
+ return super(Qt::Time.new(args[0]))
2281
+ elsif args.size == 1 && args[0].class.name == "BigDecimal"
2282
+ return super(args[0].to_f) # we have to make do with a float
2283
+ else
2284
+ return super(*args)
2285
+ end
2286
+ end
2287
+
2288
+ def to_a
2289
+ return toStringList()
2290
+ end
2291
+
2292
+ def to_f
2293
+ return toDouble()
2294
+ end
2295
+
2296
+ def to_i
2297
+ return toInt()
2298
+ end
2299
+
2300
+ def to_int
2301
+ return toInt()
2302
+ end
2303
+
2304
+ def value
2305
+ case type()
2306
+ when Qt::Variant::Invalid
2307
+ return nil
2308
+ when Qt::Variant::Bitmap
2309
+ when Qt::Variant::Bool
2310
+ return toBool
2311
+ when Qt::Variant::Brush
2312
+ return qVariantValue(Qt::Brush, self)
2313
+ when Qt::Variant::ByteArray
2314
+ return toByteArray
2315
+ when Qt::Variant::Char
2316
+ return qVariantValue(Qt::Char, self)
2317
+ when Qt::Variant::Color
2318
+ return qVariantValue(Qt::Color, self)
2319
+ when Qt::Variant::Cursor
2320
+ return qVariantValue(Qt::Cursor, self)
2321
+ when Qt::Variant::Date
2322
+ return toDate
2323
+ when Qt::Variant::DateTime
2324
+ return toDateTime
2325
+ when Qt::Variant::Double
2326
+ return toDouble
2327
+ when Qt::Variant::Font
2328
+ return qVariantValue(Qt::Font, self)
2329
+ when Qt::Variant::Icon
2330
+ return qVariantValue(Qt::Icon, self)
2331
+ when Qt::Variant::Image
2332
+ return qVariantValue(Qt::Image, self)
2333
+ when Qt::Variant::Int
2334
+ return toInt
2335
+ when Qt::Variant::KeySequence
2336
+ return qVariantValue(Qt::KeySequence, self)
2337
+ when Qt::Variant::Line
2338
+ return toLine
2339
+ when Qt::Variant::LineF
2340
+ return toLineF
2341
+ when Qt::Variant::List
2342
+ return toList
2343
+ when Qt::Variant::Locale
2344
+ return qVariantValue(Qt::Locale, self)
2345
+ when Qt::Variant::LongLong
2346
+ return toLongLong
2347
+ when Qt::Variant::Map
2348
+ return toMap
2349
+ when Qt::Variant::Palette
2350
+ return qVariantValue(Qt::Palette, self)
2351
+ when Qt::Variant::Pen
2352
+ return qVariantValue(Qt::Pen, self)
2353
+ when Qt::Variant::Pixmap
2354
+ return qVariantValue(Qt::Pixmap, self)
2355
+ when Qt::Variant::Point
2356
+ return toPoint
2357
+ when Qt::Variant::PointF
2358
+ return toPointF
2359
+ when Qt::Variant::Polygon
2360
+ return qVariantValue(Qt::Polygon, self)
2361
+ when Qt::Variant::Rect
2362
+ return toRect
2363
+ when Qt::Variant::RectF
2364
+ return toRectF
2365
+ when Qt::Variant::RegExp
2366
+ return toRegExp
2367
+ when Qt::Variant::Region
2368
+ return qVariantValue(Qt::Region, self)
2369
+ when Qt::Variant::Size
2370
+ return toSize
2371
+ when Qt::Variant::SizeF
2372
+ return toSizeF
2373
+ when Qt::Variant::SizePolicy
2374
+ return toSizePolicy
2375
+ when Qt::Variant::String
2376
+ return toString
2377
+ when Qt::Variant::StringList
2378
+ return toStringList
2379
+ when Qt::Variant::TextFormat
2380
+ return qVariantValue(Qt::TextFormat, self)
2381
+ when Qt::Variant::TextLength
2382
+ return qVariantValue(Qt::TextLength, self)
2383
+ when Qt::Variant::Time
2384
+ return toTime
2385
+ when Qt::Variant::UInt
2386
+ return toUInt
2387
+ when Qt::Variant::ULongLong
2388
+ return toULongLong
2389
+ when Qt::Variant::Url
2390
+ return toUrl
2391
+ end
2392
+
2393
+ return qVariantValue(nil, self)
2394
+ end
2395
+
2396
+ def inspect
2397
+ str = super
2398
+ str.sub(/>$/, " typeName=%s>" % typeName)
2399
+ end
2400
+
2401
+ def pretty_print(pp)
2402
+ str = to_s
2403
+ pp.text str.sub(/>$/, " typeName=%s>" % typeName)
2404
+ end
2405
+
2406
+ def load(*args)
2407
+ method_missing(:load, *args)
2408
+ end
2409
+
2410
+ def type(*args)
2411
+ method_missing(:type, *args)
2412
+ end
2413
+ end
2414
+
2415
+ class DBusVariant < Variant
2416
+ def initialize(value)
2417
+ if value.kind_of? Qt::Variant
2418
+ super(value)
2419
+ else
2420
+ super(Qt::Variant.new(value))
2421
+ end
2422
+ end
2423
+
2424
+ def setVariant(variant)
2425
+ end
2426
+
2427
+ def variant=(variant)
2428
+ setVariant(variant)
2429
+ end
2430
+
2431
+ def variant()
2432
+ return self
2433
+ end
2434
+ end
2435
+
2436
+ class WhatsThisClickedEvent < Qt::Base
2437
+ def type(*args)
2438
+ method_missing(:type, *args)
2439
+ end
2440
+ end
2441
+
2442
+ class Widget < Qt::Base
2443
+ def raise(*args)
2444
+ method_missing(:raise, *args)
2445
+ end
2446
+ end
2447
+
2448
+ class WindowStateChangeEvent < Qt::Base
2449
+ def type(*args)
2450
+ method_missing(:type, *args)
2451
+ end
2452
+ end
2453
+
2454
+ class XmlAttributes < Qt::Base
2455
+ def type(*args)
2456
+ method_missing(:type, *args)
2457
+ end
2458
+ end
2459
+
2460
+ class SignalBlockInvocation < Qt::Object
2461
+ def initialize(parent, block, signature)
2462
+ super(parent)
2463
+ if metaObject.indexOfSlot(signature) == -1
2464
+ self.class.slots signature
2465
+ end
2466
+ @block = block
2467
+ end
2468
+
2469
+ def invoke(*args)
2470
+ @block.call(*args)
2471
+ end
2472
+ end
2473
+
2474
+ class BlockInvocation < Qt::Object
2475
+ def initialize(target, block, signature)
2476
+ super(target)
2477
+ if metaObject.indexOfSlot(signature) == -1
2478
+ self.class.slots signature
2479
+ end
2480
+ @block = block
2481
+ end
2482
+
2483
+ def invoke(*args)
2484
+ @block.call(*args)
2485
+ end
2486
+ end
2487
+
2488
+ class MethodInvocation < Qt::Object
2489
+ def initialize(target, method, signature)
2490
+ super(target)
2491
+ if metaObject.indexOfSlot(signature) == -1
2492
+ self.class.slots signature
2493
+ end
2494
+ @target = target
2495
+ method = method.intern unless method.is_a?Symbol
2496
+ @method = method
2497
+ end
2498
+
2499
+ def invoke(*args)
2500
+ @target.send @method, *args
2501
+ end
2502
+ end
2503
+
2504
+ module Internal
2505
+ @@classes = {}
2506
+ @@cpp_names = {}
2507
+ @@idclass = []
2508
+ # Initialize all instances to false since nil can be a valid entry
2509
+ @@method_lookup_cache = Hash.new(false)
2510
+
2511
+ @@normalize_procs = []
2512
+
2513
+ class ModuleIndex
2514
+ attr_accessor :index
2515
+
2516
+ def smoke
2517
+ if ! @smoke
2518
+ return 0
2519
+ end
2520
+ return @smoke
2521
+ end
2522
+
2523
+ def initialize(smoke, index)
2524
+ @smoke = smoke
2525
+ @index = index
2526
+ end
2527
+ end
2528
+
2529
+ def self.classes
2530
+ return @@classes
2531
+ end
2532
+
2533
+ def self.cpp_names
2534
+ return @@cpp_names
2535
+ end
2536
+
2537
+ def self.idclass
2538
+ return @@idclass
2539
+ end
2540
+
2541
+ def self.add_normalize_proc(func)
2542
+ @@normalize_procs << func
2543
+ end
2544
+
2545
+ def Internal.normalize_classname(classname)
2546
+ @@normalize_procs.each do |func|
2547
+ ret = func.call(classname)
2548
+ if !ret.nil?
2549
+ return ret
2550
+ end
2551
+ end
2552
+ if classname =~ /^Q3/
2553
+ ruby_classname = classname.sub(/^Q3(?=[A-Z])/,'Qt3::')
2554
+ elsif classname =~ /^Q/
2555
+ ruby_classname = classname.sub(/^Q(?=[A-Z])/,'Qt::')
2556
+ else
2557
+ ruby_classname = classname
2558
+ end
2559
+ ruby_classname
2560
+ end
2561
+
2562
+ def Internal.init_class(c)
2563
+ if c == "WebCore" || c == "std" || c == "QGlobalSpace"
2564
+ return
2565
+ end
2566
+ classname = Qt::Internal::normalize_classname(c)
2567
+ classId = Qt::Internal.findClass(c)
2568
+ insert_pclassid(classname, classId)
2569
+ @@idclass[classId.index] = classname
2570
+ @@cpp_names[classname] = c
2571
+ klass = isQObject(c) ? create_qobject_class(classname, Qt) \
2572
+ : create_qt_class(classname, Qt)
2573
+ @@classes[classname] = klass unless klass.nil?
2574
+ end
2575
+
2576
+ def Internal.debug_level
2577
+ Qt.debug_level
2578
+ end
2579
+
2580
+ def Internal.checkarg(argtype, typename)
2581
+ const_point = typename =~ /^const\s+/ ? -1 : 0
2582
+ if argtype == 'i'.freeze
2583
+ if typename =~ /^int&?$|^signed int&?$|^signed$|^qint32&?$/
2584
+ return 6 + const_point
2585
+ elsif typename =~ /^quint32&?$/
2586
+ return 4 + const_point
2587
+ elsif typename =~ /^(?:short|ushort|unsigned short int|unsigned short|uchar|char|unsigned char|uint|long|ulong|unsigned long int|unsigned|float|double|WId|HBITMAP__\*|HDC__\*|HFONT__\*|HICON__\*|HINSTANCE__\*|HPALETTE__\*|HRGN__\*|HWND__\*|Q_PID|^quint16&?$|^qint16&?$)$/
2588
+ return 4 + const_point
2589
+ elsif typename =~ /^(quint|qint|qulong|qlong|qreal)/
2590
+ return 4 + const_point
2591
+ else
2592
+ t = typename.sub(/^const\s+/, '')
2593
+ t.sub!(/[&*]$/, '')
2594
+ if isEnum(t)
2595
+ return 2
2596
+ end
2597
+ end
2598
+ elsif argtype == 'n'.freeze
2599
+ if typename =~ /^double$|^qreal$/
2600
+ return 6 + const_point
2601
+ elsif typename =~ /^float$/
2602
+ return 4 + const_point
2603
+ elsif typename =~ /^int&?$/
2604
+ return 2 + const_point
2605
+ elsif typename =~ /^(?:short|ushort|uint|long|ulong|signed|unsigned|float|double)$/
2606
+ return 2 + const_point
2607
+ else
2608
+ t = typename.sub(/^const\s+/, '')
2609
+ t.sub!(/[&*]$/, '')
2610
+ if isEnum(t)
2611
+ return 2 + const_point
2612
+ end
2613
+ end
2614
+ elsif argtype == 'B'.freeze
2615
+ if typename =~ /^(?:bool)[*&]?$/
2616
+ return 2 + const_point
2617
+ end
2618
+ elsif argtype == 's'.freeze
2619
+ if typename =~ /^(const )?((QChar)[*&]?)$/
2620
+ return 6 + const_point
2621
+ elsif typename =~ /^(?:(u(nsigned )?)?char\*)$/
2622
+ return 4 + const_point
2623
+ elsif typename =~ /^(?:const (u(nsigned )?)?char\*)$/
2624
+ return 2 + const_point
2625
+ elsif typename =~ /^(?:(?:const )?(QString)[*&]?)$/
2626
+ return 8 + const_point
2627
+ end
2628
+ elsif argtype == 'a'.freeze
2629
+ # FIXME: shouldn't be hardcoded. Installed handlers should tell what ruby type they expect.
2630
+ if typename =~ /^(?:
2631
+ const\ QCOORD\*|
2632
+ (?:const\ )?
2633
+ (?:
2634
+ QStringList[\*&]?|
2635
+ QValueList<int>[\*&]?|
2636
+ QRgb\*|
2637
+ char\*\*
2638
+ )
2639
+ )$/x
2640
+ return 2 + const_point
2641
+ end
2642
+ elsif argtype == 'u'.freeze
2643
+ # Give nil matched against string types a higher score than anything else
2644
+ if typename =~ /^(?:u?char\*|const u?char\*|(?:const )?((Q(C?)String))[*&]?)$/
2645
+ return 4 + const_point
2646
+ # Numerics will give a runtime conversion error, so they fail the match
2647
+ elsif typename =~ /^(?:short|ushort|uint|long|ulong|signed|unsigned|int)$/
2648
+ return -99
2649
+ else
2650
+ return 2 + const_point
2651
+ end
2652
+ elsif argtype == 'U'.freeze
2653
+ if typename =~ /QStringList/
2654
+ return 4 + const_point
2655
+ else
2656
+ return 2 + const_point
2657
+ end
2658
+ else
2659
+ t = typename.sub(/^const\s+/, '')
2660
+ t.sub!(/(::)?Ptr$/, '')
2661
+ t.sub!(/[&*]$/, '')
2662
+ if argtype == t
2663
+ return 4 + const_point
2664
+ elsif classIsa(argtype, t)
2665
+ return 2 + const_point
2666
+ elsif isEnum(argtype) and
2667
+ (t =~ /int|qint32|uint|quint32|long|ulong/ or isEnum(t))
2668
+ return 2 + const_point
2669
+ end
2670
+ end
2671
+ return -99
2672
+ end
2673
+
2674
+ def Internal.find_class(classname)
2675
+ @@classes[classname]
2676
+ end
2677
+
2678
+ # Runs the initializer as far as allocating the Qt C++ instance.
2679
+ # Then use a throw to jump back to here with the C++ instance
2680
+ # wrapped in a new ruby variable of type T_DATA
2681
+ def Internal.try_initialize(instance, *args)
2682
+ initializer = instance.method(:initialize)
2683
+ catch :newqt do
2684
+ initializer.call(*args)
2685
+ end
2686
+ end
2687
+
2688
+ # If a block was passed to the constructor, then
2689
+ # run that now. Either run the context of the new instance
2690
+ # if no args were passed to the block. Or otherwise,
2691
+ # run the block in the context of the arg.
2692
+ def Internal.run_initializer_block(instance, block)
2693
+ if block.arity == -1 || block.arity == 0
2694
+ instance.instance_eval(&block)
2695
+ elsif block.arity == 1
2696
+ block.call(instance)
2697
+ else
2698
+ raise ArgumentError, "Wrong number of arguments to block(#{block.arity} for 1)"
2699
+ end
2700
+ end
2701
+
2702
+ # Looks up and executes a Qt method
2703
+ #
2704
+ # package - Always the string 'Qt'
2705
+ # method - Methodname as a string
2706
+ # klass - Ruby class object
2707
+ # this - instance of class
2708
+ # args - arguments to method call
2709
+ #
2710
+ def Internal.do_method_missing(package, method, klass, this, *args)
2711
+ # Determine class name
2712
+ if klass.class == Module
2713
+ # If a module use the module's name - typically Qt
2714
+ classname = klass.name
2715
+ else
2716
+ # Lookup Qt class name from Ruby class name
2717
+ classname = @@cpp_names[klass.name]
2718
+ if classname.nil?
2719
+ # Make sure we haven't backed all the way up to Object
2720
+ if klass != Object and klass != Qt
2721
+ # Don't recognize this class so try the superclass
2722
+ return do_method_missing(package, method, klass.superclass, this, *args)
2723
+ else
2724
+ # Give up if we back all the way up to Object
2725
+ return nil
2726
+ end
2727
+ end
2728
+ end
2729
+ lookup_str = "#{classname}::#{method}::#{args.collect {|arg| arg.class.to_s} }"
2730
+ lookup = @@method_lookup_cache[lookup_str]
2731
+ # @@method_lookup_cache is initialized to return false values on a cache miss
2732
+ if lookup != false
2733
+ setCurrentMethod(lookup) if lookup
2734
+ return nil
2735
+ end
2736
+
2737
+ # Modify constructor method name from new to the name of the Qt class
2738
+ # and remove any namespacing
2739
+ if method == "new".freeze
2740
+ method = classname.dup
2741
+ method.gsub!(/^.*::/,"")
2742
+ end
2743
+
2744
+ # If the method contains no letters it must be an operator, append "operator" to the
2745
+ # method name
2746
+ method = "operator" + method.sub("@","") if method !~ /[a-zA-Z]+/
2747
+
2748
+ # Change foobar= to setFoobar()
2749
+ method = 'set' + method[0,1].upcase + method[1,method.length].sub("=", "") if method =~ /.*[^-+%\/|=]=$/ && method != 'operator='.freeze
2750
+
2751
+ # Build list of munged method names which is the methodname followed
2752
+ # by symbols that indicate the basic type of the method's arguments
2753
+ #
2754
+ # Plain scalar = $
2755
+ # Object = #
2756
+ # Non-scalar (reference to array or hash, undef) = ?
2757
+ #
2758
+ methods = []
2759
+ methods << method.dup
2760
+ args.each do |arg|
2761
+ if arg.nil?
2762
+ # For each nil arg encountered, triple the number of munged method
2763
+ # templates, in order to cover all possible types that can match nil
2764
+ temp = []
2765
+ methods.collect! do |meth|
2766
+ temp << meth + '?'
2767
+ temp << meth + '#'
2768
+ meth << '$'
2769
+ end
2770
+ methods.concat(temp)
2771
+ elsif isObject(arg)
2772
+ methods.collect! { |meth| meth << '#' }
2773
+ elsif arg.kind_of? Array or arg.kind_of? Hash
2774
+ methods.collect! { |meth| meth << '?' }
2775
+ else
2776
+ methods.collect! { |meth| meth << '$' }
2777
+ end
2778
+ end
2779
+
2780
+ # Create list of methodIds that match classname and munged method name
2781
+ methodIds = []
2782
+ methods.collect { |meth| methodIds.concat( findMethod(classname, meth) ) }
2783
+
2784
+ # If we didn't find any methods and the method name contains an underscore
2785
+ # then convert to camelcase and try again
2786
+ if method =~ /._./ && methodIds.length == 0
2787
+ # If the method name contains underscores, convert to camel case
2788
+ # form and try again
2789
+ method.gsub!(/(.)_(.)/) {$1 + $2.upcase}
2790
+ return do_method_missing(package, method, klass, this, *args)
2791
+ end
2792
+
2793
+ # Debugging output for method lookup
2794
+ if debug_level >= DebugLevel::High
2795
+ puts "Searching for #{classname}##{method}"
2796
+ puts "Munged method names:"
2797
+ methods.each {|meth| puts " #{meth}"}
2798
+ puts "candidate list:"
2799
+ prototypes = dumpCandidates(methodIds).split("\n")
2800
+ line_len = (prototypes.collect { |p| p.length }).max
2801
+ prototypes.zip(methodIds) {
2802
+ |prototype,id| puts "#{prototype.ljust line_len} (smoke: #{id.smoke} index: #{id.index})"
2803
+ }
2804
+ end
2805
+
2806
+ # Find the best match
2807
+ chosen = nil
2808
+ if methodIds.length > 0
2809
+ best_match = -1
2810
+ methodIds.each do
2811
+ |id|
2812
+ puts "matching => smoke: #{id.smoke} index: #{id.index}" if debug_level >= DebugLevel::High
2813
+ current_match = (isConstMethod(id) ? 1 : 0)
2814
+ (0...args.length).each do
2815
+ |i|
2816
+ typename = get_arg_type_name(id, i)
2817
+ argtype = get_value_type(args[i])
2818
+ score = checkarg(argtype, typename)
2819
+ current_match += score
2820
+ puts " #{typename} (#{argtype}) score: #{score}" if debug_level >= DebugLevel::High
2821
+ end
2822
+
2823
+ # Note that if current_match > best_match, then chosen must be nil
2824
+ if current_match > best_match
2825
+ best_match = current_match
2826
+ chosen = id
2827
+ # Ties are bad - but it is better to chose something than to fail
2828
+ elsif current_match == best_match && id.smoke == chosen.smoke
2829
+ puts " ****** warning: multiple methods with the same score of #{current_match}: #{chosen.index} and #{id.index}" if debug_level >= DebugLevel::Minimal
2830
+ chosen = id
2831
+ end
2832
+ puts " match => smoke: #{id.smoke} index: #{id.index} score: #{current_match} chosen: #{chosen ? chosen.index : nil}" if debug_level >= DebugLevel::High
2833
+ end
2834
+ end
2835
+
2836
+ # Additional debugging output
2837
+ if debug_level >= DebugLevel::Minimal && chosen.nil? && method !~ /^operator/
2838
+ id = find_pclassid(normalize_classname(klass.name))
2839
+ hash = findAllMethods(id)
2840
+ constructor_names = nil
2841
+ if method == classname
2842
+ puts "No matching constructor found, possibles:\n"
2843
+ constructor_names = hash.keys.grep(/^#{classname}/)
2844
+ else
2845
+ puts "Possible prototypes:"
2846
+ constructor_names = hash.keys
2847
+ end
2848
+ method_ids = hash.values_at(*constructor_names).flatten
2849
+ puts dumpCandidates(method_ids)
2850
+ else
2851
+ puts "setCurrentMethod(smokeList index: #{chosen.smoke}, meth index: #{chosen.index})" if debug_level >= DebugLevel::High && chosen
2852
+ end
2853
+
2854
+ # Select the chosen method
2855
+ @@method_lookup_cache[lookup_str] = chosen
2856
+ setCurrentMethod(chosen) if chosen
2857
+ return nil
2858
+ end
2859
+
2860
+ def Internal.init_all_classes()
2861
+ Qt::Internal::getClassList().each do |c|
2862
+ if c == "Qt"
2863
+ # Don't change Qt to Qt::t, just leave as is
2864
+ @@cpp_names["Qt"] = c
2865
+ elsif c != "QInternal" && !c.empty?
2866
+ Qt::Internal::init_class(c)
2867
+ end
2868
+ end
2869
+
2870
+ @@classes['Qt::Integer'] = Qt::Integer
2871
+ @@classes['Qt::Boolean'] = Qt::Boolean
2872
+ @@classes['Qt::Enum'] = Qt::Enum
2873
+ end
2874
+
2875
+ def Internal.get_qinteger(num)
2876
+ return num.value
2877
+ end
2878
+
2879
+ def Internal.set_qinteger(num, val)
2880
+ return num.value = val
2881
+ end
2882
+
2883
+ def Internal.create_qenum(num, enum_type)
2884
+ return Qt::Enum.new(num, enum_type)
2885
+ end
2886
+
2887
+ def Internal.get_qenum_type(e)
2888
+ return e.type
2889
+ end
2890
+
2891
+ def Internal.get_qboolean(b)
2892
+ return b.value
2893
+ end
2894
+
2895
+ def Internal.set_qboolean(b, val)
2896
+ return b.value = val
2897
+ end
2898
+
2899
+ def Internal.getAllParents(class_id, res)
2900
+ getIsa(class_id).each do |s|
2901
+ c = findClass(s)
2902
+ res << c
2903
+ getAllParents(c, res)
2904
+ end
2905
+ end
2906
+
2907
+ # Keeps a hash of strings against their corresponding offsets
2908
+ # within the qt_meta_stringdata sequence of null terminated
2909
+ # strings. Returns a proc to get an offset given a string.
2910
+ # That proc also adds new strings to the 'data' array, and updates
2911
+ # the corresponding 'pack_str' Array#pack template.
2912
+ def Internal.string_table_handler(data, pack_str)
2913
+ hsh = {}
2914
+ offset = 0
2915
+ return lambda do |str|
2916
+ if !hsh.has_key? str
2917
+ hsh[str] = offset
2918
+ data << str
2919
+ pack_str << "a*x"
2920
+ offset += str.length + 1
2921
+ end
2922
+
2923
+ return hsh[str]
2924
+ end
2925
+ end
2926
+
2927
+ def Internal.makeMetaData(classname, classinfos, dbus, signals, slots)
2928
+ # Each entry in 'stringdata' corresponds to a string in the
2929
+ # qt_meta_stringdata_<classname> structure.
2930
+ # 'pack_string' is used to convert 'stringdata' into the
2931
+ # binary sequence of null terminated strings for the metaObject
2932
+ stringdata = []
2933
+ pack_string = ""
2934
+ string_table = string_table_handler(stringdata, pack_string)
2935
+
2936
+ # This is used to create the array of uints that make up the
2937
+ # qt_meta_data_<classname> structure in the metaObject
2938
+ data = [1, # revision
2939
+ string_table.call(classname), # classname
2940
+ classinfos.length, classinfos.length > 0 ? 10 : 0, # classinfo
2941
+ signals.length + slots.length,
2942
+ 10 + (2*classinfos.length), # methods
2943
+ 0, 0, # properties
2944
+ 0, 0] # enums/sets
2945
+
2946
+ classinfos.each do |entry|
2947
+ data.push string_table.call(entry[0]) # key
2948
+ data.push string_table.call(entry[1]) # value
2949
+ end
2950
+
2951
+ signals.each do |entry|
2952
+ data.push string_table.call(entry.full_name) # signature
2953
+ data.push string_table.call(entry.full_name.delete("^,")) # parameters
2954
+ data.push string_table.call(entry.reply_type) # type, "" means void
2955
+ data.push string_table.call("") # tag
2956
+ if dbus
2957
+ data.push MethodScriptable | MethodSignal | AccessPublic
2958
+ else
2959
+ data.push entry.access # flags, always protected for now
2960
+ end
2961
+ end
2962
+
2963
+ slots.each do |entry|
2964
+ data.push string_table.call(entry.full_name) # signature
2965
+ data.push string_table.call(entry.full_name.delete("^,")) # parameters
2966
+ data.push string_table.call(entry.reply_type) # type, "" means void
2967
+ data.push string_table.call("") # tag
2968
+ if dbus
2969
+ data.push MethodScriptable | MethodSlot | AccessPublic # flags, always public for now
2970
+ else
2971
+ data.push entry.access # flags, always public for now
2972
+ end
2973
+ end
2974
+
2975
+ data.push 0 # eod
2976
+
2977
+ return [stringdata.pack(pack_string), data]
2978
+ end
2979
+
2980
+ def Internal.getMetaObject(klass, qobject)
2981
+ if klass.nil?
2982
+ klass = qobject.class
2983
+ end
2984
+
2985
+ parentMeta = nil
2986
+ if @@cpp_names[klass.superclass.name].nil?
2987
+ parentMeta = getMetaObject(klass.superclass, qobject)
2988
+ end
2989
+
2990
+ meta = Meta[klass.name]
2991
+ if meta.nil?
2992
+ meta = Qt::MetaInfo.new(klass)
2993
+ end
2994
+
2995
+ if meta.metaobject.nil? or meta.changed
2996
+ stringdata, data = makeMetaData( qobject.class.name,
2997
+ meta.classinfos,
2998
+ meta.dbus,
2999
+ meta.signals,
3000
+ meta.slots )
3001
+ meta.metaobject = make_metaObject(qobject, parentMeta, stringdata, data)
3002
+ meta.changed = false
3003
+ end
3004
+
3005
+ meta.metaobject
3006
+ end
3007
+
3008
+ # Handles calls of the form:
3009
+ # connect(myobj, SIGNAL('mysig(int)'), mytarget) {|arg(s)| ...}
3010
+ # connect(myobj, SIGNAL('mysig(int)')) {|arg(s)| ...}
3011
+ # connect(myobj, SIGNAL(:mysig), mytarget) { ...}
3012
+ # connect(myobj, SIGNAL(:mysig)) { ...}
3013
+ def Internal.connect(src, signal, target, block)
3014
+ args = (signal =~ /\((.*)\)/) ? $1 : ""
3015
+ signature = Qt::MetaObject.normalizedSignature("invoke(%s)" % args).to_s
3016
+ return Qt::Object.connect( src,
3017
+ signal,
3018
+ Qt::BlockInvocation.new(target, block.to_proc, signature),
3019
+ SLOT(signature) )
3020
+ end
3021
+
3022
+ # Handles calls of the form:
3023
+ # connect(SIGNAL(:mysig)) { ...}
3024
+ # connect(SIGNAL('mysig(int)')) {|arg(s)| ...}
3025
+ def Internal.signal_connect(src, signal, block)
3026
+ args = (signal =~ /\((.*)\)/) ? $1 : ""
3027
+ signature = Qt::MetaObject.normalizedSignature("invoke(%s)" % args).to_s
3028
+ return Qt::Object.connect( src,
3029
+ signal,
3030
+ Qt::SignalBlockInvocation.new(src, block.to_proc, signature),
3031
+ SLOT(signature) )
3032
+ end
3033
+
3034
+ # Handles calls of the form:
3035
+ # connect(:mysig, mytarget, :mymethod))
3036
+ # connect(SIGNAL('mysignal(int)'), mytarget, :mymethod))
3037
+ def Internal.method_connect(src, signal, target, method)
3038
+ signal = SIGNAL(signal) if signal.is_a?Symbol
3039
+ args = (signal =~ /\((.*)\)/) ? $1 : ""
3040
+ signature = Qt::MetaObject.normalizedSignature("invoke(%s)" % args).to_s
3041
+ return Qt::Object.connect( src,
3042
+ signal,
3043
+ Qt::MethodInvocation.new(target, method, signature),
3044
+ SLOT(signature) )
3045
+ end
3046
+
3047
+ # Handles calls of the form:
3048
+ # Qt::Timer.singleShot(500, myobj) { ...}
3049
+ def Internal.single_shot_timer_connect(interval, target, block)
3050
+ return Qt::Timer.singleShot( interval,
3051
+ Qt::BlockInvocation.new(target, block, "invoke()"),
3052
+ SLOT("invoke()") )
3053
+ end
3054
+ end # Qt::Internal
3055
+
3056
+ Meta = {}
3057
+
3058
+ # An entry for each signal or slot
3059
+ # Example
3060
+ # int foobar(QString,bool)
3061
+ # :name is 'foobar'
3062
+ # :full_name is 'foobar(QString,bool)'
3063
+ # :arg_types is 'QString,bool'
3064
+ # :reply_type is 'int'
3065
+ QObjectMember = Struct.new :name, :full_name, :arg_types, :reply_type, :access
3066
+
3067
+ class MetaInfo
3068
+ attr_accessor :classinfos, :dbus, :signals, :slots, :metaobject, :mocargs, :changed
3069
+
3070
+ def initialize(klass)
3071
+ Meta[klass.name] = self
3072
+ @klass = klass
3073
+ @metaobject = nil
3074
+ @signals = []
3075
+ @slots = []
3076
+ @classinfos = []
3077
+ @dbus = false
3078
+ @changed = false
3079
+ Internal.addMetaObjectMethods(klass)
3080
+ end
3081
+
3082
+ def add_signals(signal_list, access)
3083
+ signal_names = []
3084
+ signal_list.each do |signal|
3085
+ if signal.kind_of? Symbol
3086
+ signal = signal.to_s + "()"
3087
+ end
3088
+ signal = Qt::MetaObject.normalizedSignature(signal).to_s
3089
+ if signal =~ /^(([\w,<>:]*)\s+)?([^\s]*)\((.*)\)/
3090
+ @signals.push QObjectMember.new( $3,
3091
+ $3 + "(" + $4 + ")",
3092
+ $4,
3093
+ ($2 == 'void' || $2.nil?) ? "" : $2,
3094
+ access )
3095
+ signal_names << $3
3096
+ else
3097
+ qWarning( "#{@klass.name}: Invalid signal format: '#{signal}'" )
3098
+ end
3099
+ end
3100
+ Internal.addSignalMethods(@klass, signal_names)
3101
+ end
3102
+
3103
+ # Return a list of signals, including inherited ones
3104
+ def get_signals
3105
+ all_signals = []
3106
+ current = @klass
3107
+ while current != Qt::Base
3108
+ meta = Meta[current.name]
3109
+ if !meta.nil?
3110
+ all_signals.concat meta.signals
3111
+ end
3112
+ current = current.superclass
3113
+ end
3114
+ return all_signals
3115
+ end
3116
+
3117
+ def add_slots(slot_list, access)
3118
+ slot_list.each do |slot|
3119
+ if slot.kind_of? Symbol
3120
+ slot = slot.to_s + "()"
3121
+ end
3122
+ slot = Qt::MetaObject.normalizedSignature(slot).to_s
3123
+ if slot =~ /^(([\w,<>:]*)\s+)?([^\s]*)\((.*)\)/
3124
+ @slots.push QObjectMember.new( $3,
3125
+ $3 + "(" + $4 + ")",
3126
+ $4,
3127
+ ($2 == 'void' || $2.nil?) ? "" : $2,
3128
+ access )
3129
+ else
3130
+ qWarning( "#{@klass.name}: Invalid slot format: '#{slot}'" )
3131
+ end
3132
+ end
3133
+ end
3134
+
3135
+ def add_classinfo(key, value)
3136
+ @classinfos.push [key, value]
3137
+ if key == 'D-Bus Interface'
3138
+ @dbus = true
3139
+ end
3140
+ end
3141
+ end # Qt::MetaInfo
3142
+
3143
+ # These values are from the enum WindowType in qnamespace.h.
3144
+ # Some of the names such as 'Qt::Dialog', clash with QtRuby
3145
+ # class names. So add some constants here to use instead,
3146
+ # renamed with an ending of 'Type'.
3147
+ WidgetType = 0x00000000
3148
+ WindowType = 0x00000001
3149
+ DialogType = 0x00000002 | WindowType
3150
+ SheetType = 0x00000004 | WindowType
3151
+ DrawerType = 0x00000006 | WindowType
3152
+ PopupType = 0x00000008 | WindowType
3153
+ ToolType = 0x0000000a | WindowType
3154
+ ToolTipType = 0x0000000c | WindowType
3155
+ SplashScreenType = 0x0000000e | WindowType
3156
+ DesktopType = 0x00000010 | WindowType
3157
+ SubWindowType = 0x00000012
3158
+
3159
+ end # Qt
3160
+
3161
+ class Object
3162
+ def SIGNAL(signal)
3163
+ if signal.kind_of? Symbol
3164
+ return "2" + signal.to_s + "()"
3165
+ else
3166
+ return "2" + signal
3167
+ end
3168
+ end
3169
+
3170
+ def SLOT(slot)
3171
+ if slot.kind_of? Symbol
3172
+ return "1" + slot.to_s + "()"
3173
+ else
3174
+ return "1" + slot
3175
+ end
3176
+ end
3177
+
3178
+ def emit(signal)
3179
+ return signal
3180
+ end
3181
+
3182
+ def QT_TR_NOOP(x) x end
3183
+ def QT_TRANSLATE_NOOP(scope, x) x end
3184
+
3185
+ # See the discussion here: http://eigenclass.org/hiki.rb?instance_exec
3186
+ # about implementations of the ruby 1.9 method instance_exec(). This
3187
+ # version is the one from Rails. It isn't thread safe, but that doesn't
3188
+ # matter for the intended use in invoking blocks as Qt slots.
3189
+ def instance_exec(*arguments, &block)
3190
+ block.bind(self)[*arguments]
3191
+ end unless defined? instance_exec
3192
+ end
3193
+
3194
+ class Proc
3195
+ # Part of the Rails Object#instance_exec implementation
3196
+ def bind(object)
3197
+ block, time = self, Time.now
3198
+ (class << object; self end).class_eval do
3199
+ method_name = "__bind_#{time.to_i}_#{time.usec}"
3200
+ define_method(method_name, &block)
3201
+ method = instance_method(method_name)
3202
+ remove_method(method_name)
3203
+ method
3204
+ end.bind(object)
3205
+ end
3206
+ end
3207
+
3208
+ class Module
3209
+ alias_method :_constants, :constants
3210
+ alias_method :_instance_methods, :instance_methods
3211
+ alias_method :_protected_instance_methods, :protected_instance_methods
3212
+ alias_method :_public_instance_methods, :public_instance_methods
3213
+
3214
+ private :_constants, :_instance_methods
3215
+ private :_protected_instance_methods, :_public_instance_methods
3216
+
3217
+ if RUBY_VERSION < '1.9'
3218
+ def constants
3219
+ qt_methods(_constants, 0x10, true)
3220
+ end
3221
+ else
3222
+ def constants(_arg = true)
3223
+ qt_methods(_constants, 0x10, true)
3224
+ end
3225
+ end
3226
+
3227
+ def instance_methods(inc_super=true)
3228
+ qt_methods(_instance_methods(inc_super), 0x0, inc_super)
3229
+ end
3230
+
3231
+ def protected_instance_methods(inc_super=true)
3232
+ qt_methods(_protected_instance_methods(inc_super), 0x80, inc_super)
3233
+ end
3234
+
3235
+ def public_instance_methods(inc_super=true)
3236
+ qt_methods(_public_instance_methods(inc_super), 0x0, inc_super)
3237
+ end
3238
+
3239
+ private
3240
+ def qt_methods(meths, flags, inc_super=true)
3241
+ if !self.kind_of? Class
3242
+ return meths
3243
+ end
3244
+
3245
+ klass = self
3246
+ classid = Qt::Internal::ModuleIndex.new(0, 0)
3247
+ loop do
3248
+ classid = Qt::Internal::find_pclassid(klass.name)
3249
+ break if classid.index
3250
+
3251
+ klass = klass.superclass
3252
+ if klass.nil?
3253
+ return meths
3254
+ end
3255
+ end
3256
+
3257
+ # These methods are all defined in Qt::Base, even if they aren't supported by a particular
3258
+ # subclass, so remove them to avoid confusion
3259
+ meths -= ["%", "&", "*", "**", "+", "-", "-@", "/", "<", "<<", "<=", ">", ">=", ">>", "|", "~", "^"]
3260
+ ids = []
3261
+ if inc_super
3262
+ Qt::Internal::getAllParents(classid, ids)
3263
+ end
3264
+ ids << classid
3265
+ ids.each { |c| Qt::Internal::findAllMethodNames(meths, c, flags) }
3266
+ return meths.uniq.map! {|a| a.intern}
3267
+ end
3268
+ end