ruby-iup 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (323) hide show
  1. data/Rakefile +97 -0
  2. data/doc/README +10 -0
  3. data/doc/build_install.txt +77 -0
  4. data/examples/README +16 -0
  5. data/examples/ctrl/cbox.rb +221 -0
  6. data/examples/ctrl/checkboard.rb +33 -0
  7. data/examples/ctrl/degrade.rb +73 -0
  8. data/examples/ctrl/example1.rb +53 -0
  9. data/examples/ctrl/example2.rb +39 -0
  10. data/examples/ctrl/iupcolorbar.rb +95 -0
  11. data/examples/ctrl/iupcolorbrowser.rb +45 -0
  12. data/examples/ctrl/iupdial.rb +117 -0
  13. data/examples/ctrl/iupgauge.rb +242 -0
  14. data/examples/ctrl/iupgetcolor.rb +8 -0
  15. data/examples/ctrl/iupgetparam.rb +62 -0
  16. data/examples/ctrl/iupglcanvas.rb +172 -0
  17. data/examples/ctrl/iupmask.rb +15 -0
  18. data/examples/ctrl/iupmatrix.rb +39 -0
  19. data/examples/ctrl/iupplot2.rb +603 -0
  20. data/examples/ctrl/iuptabs.rb +22 -0
  21. data/examples/ctrl/iuptree.rb +190 -0
  22. data/examples/ctrl/iupval.rb +71 -0
  23. data/examples/ctrl/numbering.rb +46 -0
  24. data/examples/ctrl/sample.rb +166 -0
  25. data/examples/dlg/iupalarm.rb +14 -0
  26. data/examples/dlg/iupfiledlg.rb +19 -0
  27. data/examples/dlg/iupgetfile.rb +19 -0
  28. data/examples/dlg/iuplistdialog.rb +26 -0
  29. data/examples/dlg/iupmessage.rb +5 -0
  30. data/examples/dlg/iupscanf.rb +17 -0
  31. data/examples/elem/iupbutton.rb +197 -0
  32. data/examples/elem/iupcanvas.rb +27 -0
  33. data/examples/elem/iupcanvas2.rb +113 -0
  34. data/examples/elem/iupcanvas3.rb +62 -0
  35. data/examples/elem/iupdialog.rb +71 -0
  36. data/examples/elem/iupdialog2.rb +25 -0
  37. data/examples/elem/iupfill.rb +51 -0
  38. data/examples/elem/iupframe.rb +25 -0
  39. data/examples/elem/iuphbox.rb +68 -0
  40. data/examples/elem/iupimage.rb +113 -0
  41. data/examples/elem/iupitem.rb +60 -0
  42. data/examples/elem/iuplabel.rb +57 -0
  43. data/examples/elem/iuplist.rb +41 -0
  44. data/examples/elem/iuplist2.rb +125 -0
  45. data/examples/elem/iupmenu.rb +32 -0
  46. data/examples/elem/iupmultiline.rb +24 -0
  47. data/examples/elem/iupmultiline2.rb +156 -0
  48. data/examples/elem/iupradio.rb +32 -0
  49. data/examples/elem/iupseparator.rb +81 -0
  50. data/examples/elem/iupsubmenu.rb +85 -0
  51. data/examples/elem/iuptext.rb +61 -0
  52. data/examples/elem/iuptimer.rb +36 -0
  53. data/examples/elem/iuptoggle.rb +110 -0
  54. data/examples/elem/iupvbox.rb +87 -0
  55. data/examples/elem/iupzbox.rb +60 -0
  56. data/examples/elem/mdisample.rb +376 -0
  57. data/examples/elem/progressbar.rb +294 -0
  58. data/examples/elem/scrollbar.rb +66 -0
  59. data/examples/elem/tray.rb +90 -0
  60. data/examples/func/iupgetattribute.rb +32 -0
  61. data/examples/func/iupidle.rb +48 -0
  62. data/ext/extconf.rb +27 -0
  63. data/ext/iup-linux/include/cd.h +494 -0
  64. data/ext/iup-linux/include/cd_canvas.hpp +358 -0
  65. data/ext/iup-linux/include/cd_old.h +158 -0
  66. data/ext/iup-linux/include/cd_private.h +362 -0
  67. data/ext/iup-linux/include/cdcgm.h +34 -0
  68. data/ext/iup-linux/include/cdclipbd.h +22 -0
  69. data/ext/iup-linux/include/cddbuf.h +23 -0
  70. data/ext/iup-linux/include/cddebug.h +24 -0
  71. data/ext/iup-linux/include/cddgn.h +23 -0
  72. data/ext/iup-linux/include/cddxf.h +22 -0
  73. data/ext/iup-linux/include/cdemf.h +22 -0
  74. data/ext/iup-linux/include/cdgdiplus.h +29 -0
  75. data/ext/iup-linux/include/cdimage.h +23 -0
  76. data/ext/iup-linux/include/cdirgb.h +30 -0
  77. data/ext/iup-linux/include/cdiup.h +22 -0
  78. data/ext/iup-linux/include/cdlua.h +39 -0
  79. data/ext/iup-linux/include/cdlua3_private.h +120 -0
  80. data/ext/iup-linux/include/cdlua5_private.h +141 -0
  81. data/ext/iup-linux/include/cdluaim.h +24 -0
  82. data/ext/iup-linux/include/cdluaiup.h +27 -0
  83. data/ext/iup-linux/include/cdluapdf.h +27 -0
  84. data/ext/iup-linux/include/cdmf.h +24 -0
  85. data/ext/iup-linux/include/cdmf_private.h +32 -0
  86. data/ext/iup-linux/include/cdnative.h +26 -0
  87. data/ext/iup-linux/include/cdpdf.h +38 -0
  88. data/ext/iup-linux/include/cdpicture.h +22 -0
  89. data/ext/iup-linux/include/cdprint.h +23 -0
  90. data/ext/iup-linux/include/cdps.h +37 -0
  91. data/ext/iup-linux/include/cdwmf.h +22 -0
  92. data/ext/iup-linux/include/im.h +282 -0
  93. data/ext/iup-linux/include/im_attrib.h +116 -0
  94. data/ext/iup-linux/include/im_attrib_flat.h +39 -0
  95. data/ext/iup-linux/include/im_binfile.h +214 -0
  96. data/ext/iup-linux/include/im_capture.h +365 -0
  97. data/ext/iup-linux/include/im_color.h +465 -0
  98. data/ext/iup-linux/include/im_colorhsi.h +61 -0
  99. data/ext/iup-linux/include/im_complex.h +160 -0
  100. data/ext/iup-linux/include/im_convert.h +127 -0
  101. data/ext/iup-linux/include/im_counter.h +69 -0
  102. data/ext/iup-linux/include/im_dib.h +195 -0
  103. data/ext/iup-linux/include/im_file.h +111 -0
  104. data/ext/iup-linux/include/im_format.h +79 -0
  105. data/ext/iup-linux/include/im_format_all.h +576 -0
  106. data/ext/iup-linux/include/im_format_avi.h +87 -0
  107. data/ext/iup-linux/include/im_format_ecw.h +93 -0
  108. data/ext/iup-linux/include/im_format_jp2.h +78 -0
  109. data/ext/iup-linux/include/im_format_raw.h +64 -0
  110. data/ext/iup-linux/include/im_format_wmv.h +100 -0
  111. data/ext/iup-linux/include/im_image.h +403 -0
  112. data/ext/iup-linux/include/im_kernel.h +315 -0
  113. data/ext/iup-linux/include/im_lib.h +191 -0
  114. data/ext/iup-linux/include/im_math.h +368 -0
  115. data/ext/iup-linux/include/im_math_op.h +219 -0
  116. data/ext/iup-linux/include/im_palette.h +172 -0
  117. data/ext/iup-linux/include/im_plus.h +73 -0
  118. data/ext/iup-linux/include/im_process.h +35 -0
  119. data/ext/iup-linux/include/im_process_ana.h +221 -0
  120. data/ext/iup-linux/include/im_process_glo.h +170 -0
  121. data/ext/iup-linux/include/im_process_loc.h +577 -0
  122. data/ext/iup-linux/include/im_process_pon.h +712 -0
  123. data/ext/iup-linux/include/im_raw.h +34 -0
  124. data/ext/iup-linux/include/im_util.h +277 -0
  125. data/ext/iup-linux/include/imlua.h +83 -0
  126. data/ext/iup-linux/include/iup.h +255 -0
  127. data/ext/iup-linux/include/iup_pplot.h +40 -0
  128. data/ext/iup-linux/include/iupcb.h +25 -0
  129. data/ext/iup-linux/include/iupcbox.h +23 -0
  130. data/ext/iup-linux/include/iupcbs.h +42 -0
  131. data/ext/iup-linux/include/iupcells.h +130 -0
  132. data/ext/iup-linux/include/iupcolorbar.h +126 -0
  133. data/ext/iup-linux/include/iupcompat.h +62 -0
  134. data/ext/iup-linux/include/iupcontrols.h +40 -0
  135. data/ext/iup-linux/include/iupcpi.h +76 -0
  136. data/ext/iup-linux/include/iupdef.h +520 -0
  137. data/ext/iup-linux/include/iupdial.h +64 -0
  138. data/ext/iup-linux/include/iupgauge.h +57 -0
  139. data/ext/iup-linux/include/iupgc.h +20 -0
  140. data/ext/iup-linux/include/iupgetparam.h +27 -0
  141. data/ext/iup-linux/include/iupgl.h +101 -0
  142. data/ext/iup-linux/include/iupim.h +21 -0
  143. data/ext/iup-linux/include/iupkey.h +290 -0
  144. data/ext/iup-linux/include/iuplua.h +41 -0
  145. data/ext/iup-linux/include/iuplua_pplot.h +26 -0
  146. data/ext/iup-linux/include/iupluacontrols.h +27 -0
  147. data/ext/iup-linux/include/iupluagl.h +26 -0
  148. data/ext/iup-linux/include/iupluaim.h +26 -0
  149. data/ext/iup-linux/include/iupluaole.h +26 -0
  150. data/ext/iup-linux/include/iupmask.h +52 -0
  151. data/ext/iup-linux/include/iupmatrix.h +69 -0
  152. data/ext/iup-linux/include/iupole.h +24 -0
  153. data/ext/iup-linux/include/iupsbox.h +20 -0
  154. data/ext/iup-linux/include/iupspeech.h +23 -0
  155. data/ext/iup-linux/include/iupspin.h +21 -0
  156. data/ext/iup-linux/include/iuptabs.h +79 -0
  157. data/ext/iup-linux/include/iuptree.h +93 -0
  158. data/ext/iup-linux/include/iupval.h +46 -0
  159. data/ext/iup-linux/include/lauxlib.h +174 -0
  160. data/ext/iup-linux/include/lua.h +388 -0
  161. data/ext/iup-linux/include/lua.hpp +9 -0
  162. data/ext/iup-linux/include/luaconf.h +763 -0
  163. data/ext/iup-linux/include/lualib.h +53 -0
  164. data/ext/iup-linux/include/old_im.h +59 -0
  165. data/ext/iup-linux/include/wd.h +78 -0
  166. data/ext/iup-linux/include/wd_old.h +85 -0
  167. data/ext/iup-linux/libcd.so +0 -0
  168. data/ext/iup-linux/libcdcontextplus.so +0 -0
  169. data/ext/iup-linux/libcdluacontextplus51.so +0 -0
  170. data/ext/iup-linux/libcdpdf.so +0 -0
  171. data/ext/iup-linux/libfreetype.so +0 -0
  172. data/ext/iup-linux/libim.so +0 -0
  173. data/ext/iup-linux/libim_fftw.so +0 -0
  174. data/ext/iup-linux/libim_jp2.so +0 -0
  175. data/ext/iup-linux/libim_process.so +0 -0
  176. data/ext/iup-linux/libiup.so +0 -0
  177. data/ext/iup-linux/libiup_pplot.so +0 -0
  178. data/ext/iup-linux/libiupcd.so +0 -0
  179. data/ext/iup-linux/libiupcontrols.so +0 -0
  180. data/ext/iup-linux/libiupgl.so +0 -0
  181. data/ext/iup-linux/libiupim.so +0 -0
  182. data/ext/iup-linux/libiupimglib.so +0 -0
  183. data/ext/iup-linux/libpdflib.so +0 -0
  184. data/ext/iup-win32/cd.dll +0 -0
  185. data/ext/iup-win32/cd.lib +0 -0
  186. data/ext/iup-win32/cdcontextplus.dll +0 -0
  187. data/ext/iup-win32/cdcontextplus.lib +0 -0
  188. data/ext/iup-win32/cdlua51.lib +0 -0
  189. data/ext/iup-win32/cdluacontextplus51.lib +0 -0
  190. data/ext/iup-win32/cdluaim51.lib +0 -0
  191. data/ext/iup-win32/cdluapdf51.lib +0 -0
  192. data/ext/iup-win32/cdpdf.dll +0 -0
  193. data/ext/iup-win32/cdpdf.lib +0 -0
  194. data/ext/iup-win32/freetype6.dll +0 -0
  195. data/ext/iup-win32/freetype6.lib +0 -0
  196. data/ext/iup-win32/im.dll +0 -0
  197. data/ext/iup-win32/im_avi.dll +0 -0
  198. data/ext/iup-win32/im_capture.dll +0 -0
  199. data/ext/iup-win32/im_ecw.dll +0 -0
  200. data/ext/iup-win32/im_fftw.dll +0 -0
  201. data/ext/iup-win32/im_jp2.dll +0 -0
  202. data/ext/iup-win32/im_process.dll +0 -0
  203. data/ext/iup-win32/im_wmv.dll +0 -0
  204. data/ext/iup-win32/include/cd.h +494 -0
  205. data/ext/iup-win32/include/cd_canvas.hpp +358 -0
  206. data/ext/iup-win32/include/cd_old.h +158 -0
  207. data/ext/iup-win32/include/cd_private.h +362 -0
  208. data/ext/iup-win32/include/cdcgm.h +34 -0
  209. data/ext/iup-win32/include/cdclipbd.h +22 -0
  210. data/ext/iup-win32/include/cddbuf.h +23 -0
  211. data/ext/iup-win32/include/cddebug.h +24 -0
  212. data/ext/iup-win32/include/cddgn.h +23 -0
  213. data/ext/iup-win32/include/cddxf.h +22 -0
  214. data/ext/iup-win32/include/cdemf.h +22 -0
  215. data/ext/iup-win32/include/cdgdiplus.h +29 -0
  216. data/ext/iup-win32/include/cdimage.h +23 -0
  217. data/ext/iup-win32/include/cdirgb.h +30 -0
  218. data/ext/iup-win32/include/cdiup.h +22 -0
  219. data/ext/iup-win32/include/cdlua.h +39 -0
  220. data/ext/iup-win32/include/cdlua3_private.h +120 -0
  221. data/ext/iup-win32/include/cdlua5_private.h +141 -0
  222. data/ext/iup-win32/include/cdluaim.h +24 -0
  223. data/ext/iup-win32/include/cdluaiup.h +27 -0
  224. data/ext/iup-win32/include/cdluapdf.h +27 -0
  225. data/ext/iup-win32/include/cdmf.h +24 -0
  226. data/ext/iup-win32/include/cdmf_private.h +32 -0
  227. data/ext/iup-win32/include/cdnative.h +26 -0
  228. data/ext/iup-win32/include/cdpdf.h +38 -0
  229. data/ext/iup-win32/include/cdpicture.h +22 -0
  230. data/ext/iup-win32/include/cdprint.h +23 -0
  231. data/ext/iup-win32/include/cdps.h +37 -0
  232. data/ext/iup-win32/include/cdwmf.h +22 -0
  233. data/ext/iup-win32/include/iup.h +255 -0
  234. data/ext/iup-win32/include/iup_pplot.h +40 -0
  235. data/ext/iup-win32/include/iupcb.h +25 -0
  236. data/ext/iup-win32/include/iupcbox.h +23 -0
  237. data/ext/iup-win32/include/iupcbs.h +42 -0
  238. data/ext/iup-win32/include/iupcells.h +130 -0
  239. data/ext/iup-win32/include/iupcolorbar.h +126 -0
  240. data/ext/iup-win32/include/iupcompat.h +62 -0
  241. data/ext/iup-win32/include/iupcontrols.h +40 -0
  242. data/ext/iup-win32/include/iupcpi.h +76 -0
  243. data/ext/iup-win32/include/iupdef.h +520 -0
  244. data/ext/iup-win32/include/iupdial.h +64 -0
  245. data/ext/iup-win32/include/iupgauge.h +57 -0
  246. data/ext/iup-win32/include/iupgc.h +20 -0
  247. data/ext/iup-win32/include/iupgetparam.h +27 -0
  248. data/ext/iup-win32/include/iupgl.h +101 -0
  249. data/ext/iup-win32/include/iupim.h +21 -0
  250. data/ext/iup-win32/include/iupkey.h +290 -0
  251. data/ext/iup-win32/include/iuplua.h +41 -0
  252. data/ext/iup-win32/include/iuplua_pplot.h +26 -0
  253. data/ext/iup-win32/include/iupluacontrols.h +27 -0
  254. data/ext/iup-win32/include/iupluagl.h +26 -0
  255. data/ext/iup-win32/include/iupluaim.h +26 -0
  256. data/ext/iup-win32/include/iupluaole.h +26 -0
  257. data/ext/iup-win32/include/iupmask.h +52 -0
  258. data/ext/iup-win32/include/iupmatrix.h +69 -0
  259. data/ext/iup-win32/include/iupole.h +24 -0
  260. data/ext/iup-win32/include/iupsbox.h +20 -0
  261. data/ext/iup-win32/include/iupspeech.h +23 -0
  262. data/ext/iup-win32/include/iupspin.h +21 -0
  263. data/ext/iup-win32/include/iuptabs.h +79 -0
  264. data/ext/iup-win32/include/iuptree.h +93 -0
  265. data/ext/iup-win32/include/iupval.h +46 -0
  266. data/ext/iup-win32/include/wd.h +78 -0
  267. data/ext/iup-win32/include/wd_old.h +85 -0
  268. data/ext/iup-win32/iup.dll +0 -0
  269. data/ext/iup-win32/iup.lib +0 -0
  270. data/ext/iup-win32/iup_pplot.dll +0 -0
  271. data/ext/iup-win32/iup_pplot.lib +0 -0
  272. data/ext/iup-win32/iupcd.dll +0 -0
  273. data/ext/iup-win32/iupcd.lib +0 -0
  274. data/ext/iup-win32/iupcontrols.dll +0 -0
  275. data/ext/iup-win32/iupcontrols.lib +0 -0
  276. data/ext/iup-win32/iupgl.dll +0 -0
  277. data/ext/iup-win32/iupgl.lib +0 -0
  278. data/ext/iup-win32/iupim.dll +0 -0
  279. data/ext/iup-win32/iupim.lib +0 -0
  280. data/ext/iup-win32/iupimglib.dll +0 -0
  281. data/ext/iup-win32/iupimglib.lib +0 -0
  282. data/ext/iup-win32/iuplua51.lib +0 -0
  283. data/ext/iup-win32/iuplua_pplot51.lib +0 -0
  284. data/ext/iup-win32/iupluacd51.lib +0 -0
  285. data/ext/iup-win32/iupluacontrols51.lib +0 -0
  286. data/ext/iup-win32/iupluagl51.lib +0 -0
  287. data/ext/iup-win32/iupluaim51.lib +0 -0
  288. data/ext/iup-win32/iupluaimglib51.lib +0 -0
  289. data/ext/iup-win32/iupluaole51.lib +0 -0
  290. data/ext/iup-win32/iupole.dll +0 -0
  291. data/ext/iup-win32/iupole.lib +0 -0
  292. data/ext/iup-win32/iupstub.lib +0 -0
  293. data/ext/iup-win32/pdflib.dll +0 -0
  294. data/ext/iup-win32/pdflib.lib +0 -0
  295. data/ext/iup.c +1261 -0
  296. data/ext/mkrf_conf.rb +72 -0
  297. data/ext/rb_cd.h +1525 -0
  298. data/ext/rb_iup.h +2446 -0
  299. data/ext/rb_iup_pplot.h +129 -0
  300. data/ext/rb_iupcb.h +13 -0
  301. data/ext/rb_iupcbox.h +40 -0
  302. data/ext/rb_iupcells.h +15 -0
  303. data/ext/rb_iupcolorbar.h +17 -0
  304. data/ext/rb_iupcompat.h +237 -0
  305. data/ext/rb_iupcontrols.h +28 -0
  306. data/ext/rb_iupdef.h +3 -0
  307. data/ext/rb_iupdial.h +24 -0
  308. data/ext/rb_iupgauge.h +15 -0
  309. data/ext/rb_iupgc.h +18 -0
  310. data/ext/rb_iupgetparam.h +72 -0
  311. data/ext/rb_iupgl.h +58 -0
  312. data/ext/rb_iupim.h +25 -0
  313. data/ext/rb_iupmask.h +189 -0
  314. data/ext/rb_iupmatrix.h +80 -0
  315. data/ext/rb_iupole.h +24 -0
  316. data/ext/rb_iupsbox.h +23 -0
  317. data/ext/rb_iupspeech.h +25 -0
  318. data/ext/rb_iupspin.h +29 -0
  319. data/ext/rb_iuptabs.h +29 -0
  320. data/ext/rb_iuptree.h +94 -0
  321. data/ext/rb_iupval.h +24 -0
  322. data/lib/README +1 -0
  323. metadata +391 -0
@@ -0,0 +1,28 @@
1
+ #include <ruby.h>
2
+ #include "iup.h"
3
+ #include "iupcontrols.h"
4
+
5
+ VALUE rb_IupControlsOpen(VALUE self)
6
+ {
7
+ int v;
8
+ v = IupControlsOpen();
9
+ return INT2FIX((int)v);
10
+ }
11
+
12
+ VALUE rb_IupControlsClose(VALUE self)
13
+ {
14
+ IupControlsClose();
15
+ return Qnil;
16
+ }
17
+
18
+ VALUE rb_IupImageLibOpen(VALUE self)
19
+ {
20
+ IupImageLibOpen();
21
+ return Qnil;
22
+ }
23
+
24
+ VALUE rb_IupImageLibClose(VALUE self)
25
+ {
26
+ IupImageLibClose();
27
+ return Qnil;
28
+ }
@@ -0,0 +1,3 @@
1
+ #include <ruby.h>
2
+ #include "iup.h"
3
+ #include "iupdef.h"
@@ -0,0 +1,24 @@
1
+ #include <ruby.h>
2
+ #include "iup.h"
3
+ #include "iupdial.h"
4
+
5
+ VALUE rb_IupDial(int argc,VALUE *argv,VALUE self)
6
+ {
7
+ extern VALUE rb_cIupDial;
8
+ const char *type = NULL;
9
+ Ihandle* v;
10
+ VALUE v_type;
11
+ if(argc==1 && TYPE(argv[0])==T_HASH) {
12
+ v_type = rb_hash_delete(argv[0],ID2SYM(rb_intern("type")));
13
+ } else {
14
+ rb_scan_args(argc,argv,"10",&v_type);
15
+ }
16
+ if(v_type!=Qnil)
17
+ type = RSTRING(v_type)->ptr;
18
+ v = IupDial(type);
19
+ if(argc==1 && TYPE(argv[0])==T_HASH)
20
+ rb_set_attribute(v,argv[0]);
21
+ if(v)
22
+ return rb_funcall(rb_cIupDial,rb_intern("new"),1,UINT2NUM((unsigned)v));
23
+ return Qnil;
24
+ }
@@ -0,0 +1,15 @@
1
+ #include <ruby.h>
2
+ #include "iup.h"
3
+ #include "iupgauge.h"
4
+
5
+ VALUE rb_IupGauge(int argc,VALUE *argv,VALUE self)
6
+ {
7
+ extern VALUE rb_cIupGauge;
8
+ Ihandle* v;
9
+ v = IupGauge();
10
+ if(argc==1 && TYPE(argv[0])==T_HASH)
11
+ rb_set_attribute(v,argv[0]);
12
+ if(v)
13
+ return rb_funcall(rb_cIupGauge,rb_intern("new"),1,UINT2NUM((unsigned)v));
14
+ return Qnil;
15
+ }
@@ -0,0 +1,18 @@
1
+ #include <ruby.h>
2
+ #include "iup.h"
3
+ #include "iupgc.h"
4
+
5
+ VALUE rb_IupGetColor(VALUE self,VALUE v_x,VALUE v_y)
6
+ {
7
+ int x = NUM2INT(v_x);
8
+ int y = NUM2INT(v_y);
9
+ unsigned char r;
10
+ unsigned char g;
11
+ unsigned char b;
12
+ int v;
13
+ VALUE v_r;
14
+ v = IupGetColor(x,y,&r,&g,&b);
15
+ if(v==0) return Qnil;
16
+ v_r = rb_ary_new3(3,INT2FIX(r),INT2FIX(g),INT2FIX(b));
17
+ return v_r;
18
+ }
@@ -0,0 +1,72 @@
1
+ #include <ruby.h>
2
+ #include "iup.h"
3
+ #include "iupgetparam.h"
4
+
5
+ static char ParamAction[100];
6
+
7
+ static int _param_action(Ihandle* dialog, int param_index, void* user_data)
8
+ {
9
+ VALUE v;
10
+ VALUE node;
11
+ node = rb_funcall(rb_cIupNode,rb_intern("new"),1,UINT2NUM((unsigned)dialog));
12
+ v = rb_funcall(rb_cObject,rb_intern(ParamAction),3,node,INT2FIX(param_index),UINT2NUM((unsigned)user_data));
13
+ return NUM2INT(v);
14
+ }
15
+
16
+ VALUE rb_IupGetParam(int argc,VALUE *argv,VALUE self)
17
+ {
18
+ const char* title = RSTRING(argv[0])->ptr;
19
+ Iparamcb action = NULL;
20
+ void* user_data = (void*)NUM2INT(argv[2]);
21
+ const char* format = RSTRING(argv[3])->ptr;
22
+ int param_count;
23
+ int param_extra;
24
+ void *param_data[50];
25
+ int i,v;
26
+ int n[50];
27
+ float d[50];
28
+ static char s[50][500];
29
+ VALUE v_r;
30
+ if(argv[1]!=Qnil) {
31
+ strcpy(ParamAction,RSTRING(argv[1])->ptr);
32
+ action = (Iparamcb)_param_action;
33
+ }
34
+ param_count = IupGetParamCount(format, &param_extra);
35
+ for(i=0;i<param_count && i+4<argc;i++) {
36
+ switch(TYPE(argv[i+4])) {
37
+ case T_FIXNUM:
38
+ case T_BIGNUM:
39
+ n[i] = NUM2INT(argv[i+4]);
40
+ param_data[i] = (void*)&n[i];
41
+ break;
42
+ case T_FLOAT:
43
+ d[i] = RFLOAT(argv[i+4])->value;
44
+ param_data[i] = (void*)&d[i];
45
+ break;
46
+ case T_STRING:
47
+ strcpy(s[i],RSTRING(argv[i+4])->ptr);
48
+ param_data[i] = s[i];
49
+ break;
50
+ }
51
+ }
52
+ param_data[i] = NULL;
53
+ v = IupGetParamv(title,action,user_data,format,param_count,param_extra,param_data);
54
+ v_r = rb_ary_new();
55
+ for(i=0;i<param_count;i++) {
56
+ switch(TYPE(argv[i+4])) {
57
+ case T_FIXNUM:
58
+ case T_BIGNUM:
59
+ rb_ary_push(v_r,INT2NUM(n[i]));
60
+ break;
61
+ case T_FLOAT:
62
+ sprintf(s[i],"%g",d[i]);
63
+ rb_ary_push(v_r,rb_float_new(atof(s[i])));
64
+ break;
65
+ case T_STRING:
66
+ rb_ary_push(v_r,rb_str_new2(s[i]));
67
+ break;
68
+ }
69
+ }
70
+ return v_r;
71
+ }
72
+
@@ -0,0 +1,58 @@
1
+ #include <ruby.h>
2
+ #include "iup.h"
3
+ #include "iupgl.h"
4
+
5
+ VALUE rb_IupGLCanvasOpen(VALUE self)
6
+ {
7
+ IupGLCanvasOpen();
8
+ return Qnil;
9
+ }
10
+
11
+ VALUE rb_IupGLCanvas(int argc,VALUE *argv,VALUE self)
12
+ {
13
+ extern VALUE rb_cIupGLCanvas;
14
+ const char *action = NULL;
15
+ Ihandle* v;
16
+ VALUE v_action;
17
+ IupGLCanvasOpen();
18
+ rb_scan_args(argc,argv,"01",&v_action);
19
+ if(v_action!=Qnil) action = RSTRING(v_action)->ptr;
20
+ v = IupGLCanvas(action);
21
+ if(v)
22
+ return rb_funcall(rb_cIupGLCanvas,rb_intern("new"),1,UINT2NUM((unsigned)v));
23
+ return Qnil;
24
+ }
25
+
26
+ VALUE rb_IupGLMakeCurrent(VALUE self,VALUE node)
27
+ {
28
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
29
+ IupGLMakeCurrent((Ihandle*)NUM2UINT(v_ih));
30
+ return Qnil;
31
+ }
32
+
33
+ VALUE rb_IupGLIsCurrent(VALUE self,VALUE node)
34
+ {
35
+ int v;
36
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
37
+ v = IupGLIsCurrent((Ihandle*)NUM2UINT(v_ih));
38
+ return INT2FIX((int)v);
39
+ }
40
+
41
+ VALUE rb_IupGLSwapBuffers(VALUE self,VALUE node)
42
+ {
43
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
44
+ IupGLSwapBuffers((Ihandle*)NUM2UINT(v_ih));
45
+ return Qnil;
46
+ }
47
+
48
+ VALUE rb_IupGLPalette(VALUE self,VALUE node,VALUE v_index,VALUE v_r,VALUE v_g,VALUE v_b)
49
+ {
50
+ float r,g,b;
51
+ int index = NUM2INT(v_index);
52
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
53
+ r = RFLOAT(v_r)->value;
54
+ g = RFLOAT(v_g)->value;
55
+ b = RFLOAT(v_b)->value;
56
+ IupGLPalette((Ihandle*)NUM2UINT(v_ih),index,r,g,b);
57
+ return Qnil;
58
+ }
@@ -0,0 +1,25 @@
1
+ #include <ruby.h>
2
+ #include "iup.h"
3
+ #include "iupim.h"
4
+
5
+ VALUE rb_IupLoadImage(VALUE self,VALUE v_file_name)
6
+ {
7
+ extern VALUE rb_cIupImage;
8
+ const char* file_name = RSTRING(v_file_name)->ptr;
9
+ Ihandle* v;
10
+ v = IupLoadImage(file_name);
11
+ if(v)
12
+ return rb_funcall(rb_cIupImage,rb_intern("new"),1,UINT2NUM((unsigned)v));
13
+ return Qnil;
14
+ }
15
+
16
+ VALUE rb_IupSaveImage(VALUE self,VALUE node,VALUE v_file_name,VALUE v_format)
17
+ {
18
+ const char* file_name = RSTRING(v_file_name)->ptr;
19
+ const char* format = RSTRING(v_format)->ptr;
20
+ int v;
21
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
22
+ v = IupSaveImage((Ihandle*)NUM2UINT(v_ih),file_name,format);
23
+ return INT2FIX((int)v);
24
+ }
25
+
@@ -0,0 +1,189 @@
1
+ #include <ruby.h>
2
+ #include "iup.h"
3
+ #include "iupmask.h"
4
+
5
+ VALUE rb_iupmaskSet(VALUE node,VALUE v_mask,VALUE v_autofill,VALUE v_casei)
6
+ {
7
+ const char *mask = RSTRING(v_mask)->ptr;
8
+ int autofill = NUM2INT(v_autofill);
9
+ int casei = NUM2INT(v_casei);
10
+ int v;
11
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
12
+ v = iupmaskSet((Ihandle*)NUM2UINT(v_ih),mask,autofill,casei);
13
+ return INT2FIX(v);
14
+ }
15
+
16
+ VALUE rb_iupmaskSetInt(VALUE node,VALUE v_autofill,VALUE v_min,VALUE v_max)
17
+ {
18
+ int autofill = NUM2INT(v_autofill);
19
+ int min = NUM2INT(v_min);
20
+ int max = NUM2INT(v_max);
21
+ int v;
22
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
23
+ v = iupmaskSetInt((Ihandle*)NUM2UINT(v_ih),autofill,min,max);
24
+ return INT2FIX(v);
25
+ }
26
+
27
+ VALUE rb_iupmaskSetFloat(VALUE node,VALUE v_autofill,VALUE v_min,VALUE v_max)
28
+ {
29
+ float min = RFLOAT(v_min)->value;
30
+ float max = RFLOAT(v_max)->value;
31
+ int autofill = NUM2INT(v_autofill);
32
+ int v;
33
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
34
+ v = iupmaskSetFloat((Ihandle*)NUM2UINT(v_ih),autofill,min,max);
35
+ return INT2FIX(v);
36
+ }
37
+
38
+ VALUE rb_iupmaskRemove(VALUE node)
39
+ {
40
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
41
+ iupmaskRemove((Ihandle*)NUM2UINT(v_ih));
42
+ return Qnil;
43
+ }
44
+
45
+ VALUE rb_iupmaskCheck(VALUE node)
46
+ {
47
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
48
+ int v;
49
+ v = iupmaskCheck((Ihandle*)NUM2UINT(v_ih));
50
+ return INT2FIX(v);
51
+ }
52
+
53
+ VALUE rb_iupmaskGet(VALUE node,VALUE v_val)
54
+ {
55
+ char *val = RSTRING(v_val)->ptr;
56
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
57
+ int v;
58
+ v = iupmaskGet((Ihandle*)NUM2UINT(v_ih),&val);
59
+ return INT2FIX(v);
60
+ }
61
+
62
+ VALUE rb_iupmaskGetFloat(VALUE node,VALUE v_fval)
63
+ {
64
+ int v;
65
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
66
+ float fval = RFLOAT(v_fval)->value;
67
+ v = iupmaskGetFloat((Ihandle*)NUM2UINT(v_ih),&fval);
68
+ return INT2FIX(v);
69
+ }
70
+
71
+ VALUE rb_iupmaskGetDouble(VALUE node,VALUE v_dval)
72
+ {
73
+ int v;
74
+ double dval = RFLOAT(v_dval)->value;
75
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
76
+ v = iupmaskGetDouble((Ihandle*)NUM2UINT(v_ih),&dval);
77
+ return INT2FIX(v);
78
+ }
79
+
80
+ VALUE rb_iupmaskGetInt(VALUE node,VALUE v_ival)
81
+ {
82
+ int ival = NUM2INT(v_ival);
83
+ int v;
84
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
85
+ v = iupmaskGetInt((Ihandle*)NUM2UINT(v_ih),&ival);
86
+ return INT2FIX(v);
87
+ }
88
+
89
+ VALUE rb_iupmaskMatSet(VALUE node,VALUE v_mask,VALUE v_autofill,VALUE v_casei,VALUE v_lin,VALUE v_col)
90
+ {
91
+ const char *mask = RSTRING(v_mask)->ptr;
92
+ int autofill = NUM2INT(v_autofill);
93
+ int casei = NUM2INT(v_casei);
94
+ int lin = NUM2INT(v_lin);
95
+ int col = NUM2INT(v_col);
96
+ int v;
97
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
98
+ v = iupmaskMatSet((Ihandle*)NUM2UINT(v_ih),mask,autofill,casei,lin,col);
99
+ return INT2FIX(v);
100
+ }
101
+
102
+ VALUE rb_iupmaskMatSetInt(VALUE node,VALUE v_autofill,VALUE v_min,VALUE v_max,VALUE v_lin,VALUE v_col)
103
+ {
104
+ int autofill = NUM2INT(v_autofill);
105
+ int min = NUM2INT(v_min);
106
+ int max = NUM2INT(v_max);
107
+ int lin = NUM2INT(v_lin);
108
+ int col = NUM2INT(v_col);
109
+ int v;
110
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
111
+ v = iupmaskMatSetInt((Ihandle*)NUM2UINT(v_ih),autofill,min,max,lin,col);
112
+ return INT2FIX(v);
113
+ }
114
+
115
+ VALUE rb_iupmaskMatSetFloat(VALUE node,VALUE v_autofill,VALUE v_min,VALUE v_max,VALUE v_lin,VALUE v_col)
116
+ {
117
+ int autofill = NUM2INT(v_autofill);
118
+ int lin = NUM2INT(v_lin);
119
+ int col = NUM2INT(v_col);
120
+ float min = RFLOAT(v_min)->value;
121
+ float max = RFLOAT(v_max)->value;
122
+ int v;
123
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
124
+ v = iupmaskMatSetFloat((Ihandle*)NUM2UINT(v_ih),autofill,min,max,lin,col);
125
+ return INT2FIX(v);
126
+ }
127
+
128
+ VALUE rb_iupmaskMatRemove(VALUE node,VALUE v_lin,VALUE v_col)
129
+ {
130
+ int lin = NUM2INT(v_lin);
131
+ int col = NUM2INT(v_col);
132
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
133
+ iupmaskMatRemove((Ihandle*)NUM2UINT(v_ih),lin,col);
134
+ return Qnil;
135
+ }
136
+
137
+ VALUE rb_iupmaskMatCheck(VALUE node,VALUE v_lin,VALUE v_col)
138
+ {
139
+ int lin = NUM2INT(v_lin);
140
+ int col = NUM2INT(v_col);
141
+ int v;
142
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
143
+ v = iupmaskMatCheck((Ihandle*)NUM2UINT(v_ih),lin,col);
144
+ return INT2FIX(v);
145
+ }
146
+
147
+ VALUE rb_iupmaskMatGet(VALUE node,VALUE v_val,VALUE v_lin,VALUE v_col)
148
+ {
149
+ char *val = RSTRING(v_val)->ptr;
150
+ int lin = NUM2INT(v_lin);
151
+ int col = NUM2INT(v_col);
152
+ int v;
153
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
154
+ v = iupmaskMatGet((Ihandle*)NUM2UINT(v_ih),&val,lin,col);
155
+ return INT2FIX(v);
156
+ }
157
+
158
+ VALUE rb_iupmaskMatGetFloat(VALUE node,VALUE v_fval,VALUE v_lin,VALUE v_col)
159
+ {
160
+ int lin = NUM2INT(v_lin);
161
+ int col = NUM2INT(v_col);
162
+ int v;
163
+ float fval = RFLOAT(v_fval)->value;
164
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
165
+ v = iupmaskMatGetFloat((Ihandle*)NUM2UINT(v_ih),&fval,lin,col);
166
+ return INT2FIX(v);
167
+ }
168
+
169
+ VALUE rb_iupmaskMatGetDouble(VALUE node,VALUE v_dval,VALUE v_lin,VALUE v_col)
170
+ {
171
+ int lin = NUM2INT(v_lin);
172
+ int col = NUM2INT(v_col);
173
+ int v;
174
+ double dval = RFLOAT(v_dval)->value;
175
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
176
+ v = iupmaskMatGetDouble((Ihandle*)NUM2UINT(v_ih),&dval,lin,col);
177
+ return INT2FIX(v);
178
+ }
179
+
180
+ VALUE rb_iupmaskMatGetInt(VALUE node,VALUE v_ival,VALUE v_lin,VALUE v_col)
181
+ {
182
+ int ival = NUM2INT(v_ival);
183
+ int lin = NUM2INT(v_lin);
184
+ int col = NUM2INT(v_col);
185
+ int v;
186
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
187
+ v = iupmaskMatGetInt((Ihandle*)NUM2UINT(v_ih),&ival,lin,col);
188
+ return INT2FIX(v);
189
+ }
@@ -0,0 +1,80 @@
1
+ #include <ruby.h>
2
+ #include "iup.h"
3
+ #include "iupmatrix.h"
4
+
5
+ VALUE rb_IupMatrix(int argc,VALUE *argv,VALUE self)
6
+ {
7
+ extern VALUE rb_cIupMatrix;
8
+ char *action = NULL;
9
+ Ihandle* v;
10
+ VALUE v_action;
11
+ if(argc==1 && TYPE(argv[0])==T_HASH) {
12
+ v_action = rb_hash_delete(argv[0],ID2SYM(rb_intern("action")));
13
+ } else {
14
+ rb_scan_args(argc,argv,"01",&v_action);
15
+ }
16
+ if(v_action!=Qnil)
17
+ action = RSTRING(v_action)->ptr;
18
+ v = IupMatrix(action);
19
+ if(argc==1 && TYPE(argv[0])==T_HASH)
20
+ rb_set_attribute(v,argv[0]);
21
+ if(v)
22
+ return rb_funcall(rb_cIupMatrix,rb_intern("new"),1,UINT2NUM((unsigned)v));
23
+ return Qnil;
24
+ }
25
+
26
+ VALUE rb_IupMatSetAttribute(VALUE node,VALUE v_a,VALUE v_l,VALUE v_c,VALUE v_v)
27
+ {
28
+ const char* a = RSTRING(v_a)->ptr;
29
+ int l = NUM2INT(v_l);
30
+ int c = NUM2INT(v_c);
31
+ char* v = RSTRING(v_v)->ptr;
32
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
33
+ IupMatSetAttribute((Ihandle*)NUM2UINT(v_ih),a,l,c,v);
34
+ return Qnil;
35
+ }
36
+
37
+ VALUE rb_IupMatStoreAttribute(VALUE node,VALUE v_a,VALUE v_l,VALUE v_c,VALUE v_v)
38
+ {
39
+ const char* a = RSTRING(v_a)->ptr;
40
+ int l = NUM2INT(v_l);
41
+ int c = NUM2INT(v_c);
42
+ char* v = RSTRING(v_v)->ptr;
43
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
44
+ IupMatStoreAttribute((Ihandle*)NUM2UINT(v_ih),a,l,c,v);
45
+ return Qnil;
46
+ }
47
+
48
+ VALUE rb_IupMatGetAttribute(VALUE node,VALUE v_a,VALUE v_l,VALUE v_c)
49
+ {
50
+ const char* a = RSTRING(v_a)->ptr;
51
+ int l = NUM2INT(v_l);
52
+ int c = NUM2INT(v_c);
53
+ char* v;
54
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
55
+ v = IupMatGetAttribute((Ihandle*)NUM2UINT(v_ih),a,l,c);
56
+ return rb_str_new2(v);
57
+ }
58
+
59
+ VALUE rb_IupMatGetInt(VALUE node,VALUE v_a,VALUE v_l,VALUE v_c)
60
+ {
61
+ const char* a = RSTRING(v_a)->ptr;
62
+ int l = NUM2INT(v_l);
63
+ int c = NUM2INT(v_c);
64
+ int v;
65
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
66
+ v = IupMatGetInt((Ihandle*)NUM2UINT(v_ih),a,l,c);
67
+ return INT2FIX(v);
68
+ }
69
+
70
+ VALUE rb_IupMatGetFloat(VALUE node,VALUE v_a,VALUE v_l,VALUE v_c)
71
+ {
72
+ const char* a = RSTRING(v_a)->ptr;
73
+ int l = NUM2INT(v_l);
74
+ int c = NUM2INT(v_c);
75
+ float v;
76
+ VALUE v_ih = rb_iv_get(node,"@ihandle");
77
+ v = IupMatGetFloat((Ihandle*)NUM2UINT(v_ih),a,l,c);
78
+ return INT2FIX(v);
79
+ }
80
+