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,53 @@
1
+ /*
2
+ ** $Id: lualib.h,v 1.1 2008/12/03 01:12:48 phasis68 Exp $
3
+ ** Lua standard libraries
4
+ ** See Copyright Notice in lua.h
5
+ */
6
+
7
+
8
+ #ifndef lualib_h
9
+ #define lualib_h
10
+
11
+ #include "lua.h"
12
+
13
+
14
+ /* Key to file-handle type */
15
+ #define LUA_FILEHANDLE "FILE*"
16
+
17
+
18
+ #define LUA_COLIBNAME "coroutine"
19
+ LUALIB_API int (luaopen_base) (lua_State *L);
20
+
21
+ #define LUA_TABLIBNAME "table"
22
+ LUALIB_API int (luaopen_table) (lua_State *L);
23
+
24
+ #define LUA_IOLIBNAME "io"
25
+ LUALIB_API int (luaopen_io) (lua_State *L);
26
+
27
+ #define LUA_OSLIBNAME "os"
28
+ LUALIB_API int (luaopen_os) (lua_State *L);
29
+
30
+ #define LUA_STRLIBNAME "string"
31
+ LUALIB_API int (luaopen_string) (lua_State *L);
32
+
33
+ #define LUA_MATHLIBNAME "math"
34
+ LUALIB_API int (luaopen_math) (lua_State *L);
35
+
36
+ #define LUA_DBLIBNAME "debug"
37
+ LUALIB_API int (luaopen_debug) (lua_State *L);
38
+
39
+ #define LUA_LOADLIBNAME "package"
40
+ LUALIB_API int (luaopen_package) (lua_State *L);
41
+
42
+
43
+ /* open all previous libraries */
44
+ LUALIB_API void (luaL_openlibs) (lua_State *L);
45
+
46
+
47
+
48
+ #ifndef lua_assert
49
+ #define lua_assert(x) ((void)0)
50
+ #endif
51
+
52
+
53
+ #endif
@@ -0,0 +1,59 @@
1
+ /** \file
2
+ * \brief Old API
3
+ *
4
+ * See Copyright Notice in im_lib.h
5
+ */
6
+
7
+ #ifndef __IM_OLD_H
8
+ #define __IM_OLD_H
9
+
10
+ #if defined(__cplusplus)
11
+ extern "C" {
12
+ #endif
13
+
14
+ enum {IM_BMP, IM_PCX, IM_GIF, IM_TIF, IM_RAS, IM_SGI, IM_JPG, IM_LED, IM_TGA};
15
+ enum {IM_NONE = 0x0000, IM_DEFAULT = 0x0100, IM_COMPRESSED = 0x0200};
16
+
17
+ #define IM_ERR_READ IM_ERR_ACCESS
18
+ #define IM_ERR_WRITE IM_ERR_ACCESS
19
+ #define IM_ERR_TYPE IM_ERR_DATA
20
+ #define IM_ERR_COMP IM_ERR_COMPRESS
21
+
22
+ long imEncodeColor(unsigned char red, unsigned char green, unsigned char blue);
23
+ void imDecodeColor(unsigned char* red, unsigned char* green, unsigned char* blue, long palette);
24
+ int imFileFormat(char *filename, int* format);
25
+ int imImageInfo(char *filename, int *width, int *height, int *type, int *palette_count);
26
+ int imLoadRGB(char *filename, unsigned char *red, unsigned char *green, unsigned char *blue);
27
+ int imSaveRGB(int width, int height, int format, unsigned char *red, unsigned char *green, unsigned char *blue, char *filename);
28
+ int imLoadMap(char *filename, unsigned char *map, long *palette);
29
+ int imSaveMap(int width, int height, int format, unsigned char *map, int palette_count, long *palette, char *filename);
30
+ void imRGB2Map(int width, int height, unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *map, int palette_count, long *palette);
31
+ void imMap2RGB(int width, int height, unsigned char *map, int palette_count, long *colors, unsigned char *red, unsigned char *green, unsigned char *blue);
32
+ void imRGB2Gray(int width, int height, unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *map, long *grays);
33
+ void imMap2Gray(int width, int height, unsigned char *map, int palette_count, long *colors, unsigned char *grey_map, long *grays);
34
+ void imResize(int src_width, int src_height, unsigned char *src_map, int dst_width, int dst_height, unsigned char *dst_map);
35
+ void imStretch(int src_width, int src_height, unsigned char *src_map, int dst_width, int dst_height, unsigned char *dst_map);
36
+ typedef int (*imCallback)(char *filename);
37
+ int imRegisterCallback(imCallback cb, int cb_id, int format);
38
+
39
+ #define IM_INTERRUPTED -1
40
+ #define IM_ALL -1
41
+ #define IM_COUNTER_CB 0
42
+ typedef int (*imFileCounterCallback)(char *filename, int percent, int io);
43
+
44
+ #define IM_RESOLUTION_CB 1
45
+ typedef int (*imResolutionCallback)(char *filename, double* xres, double* yres, int* res_unit);
46
+
47
+ enum {IM_RES_NONE, IM_RES_DPI, IM_RES_DPC};
48
+
49
+ #define IM_GIF_TRANSPARENT_COLOR_CB 0
50
+ typedef int (*imGifTranspIndex)(char *filename, unsigned char *transp_index);
51
+
52
+ #define IM_TIF_IMAGE_DESCRIPTION_CB 0
53
+ typedef int (*imTiffImageDesc)(char *filename, char* img_desc);
54
+
55
+ #if defined(__cplusplus)
56
+ }
57
+ #endif
58
+
59
+ #endif
@@ -0,0 +1,78 @@
1
+ /** \file
2
+ * \brief World Coordinate Functions
3
+ *
4
+ * See Copyright Notice in cd.h
5
+ */
6
+
7
+ #ifndef __WD_H
8
+ #define __WD_H
9
+
10
+ #ifdef __cplusplus
11
+ extern "C" {
12
+ #endif
13
+
14
+ /* coordinate transformation */
15
+ void wdCanvasWindow(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax);
16
+ void wdCanvasGetWindow(cdCanvas* canvas, double *xmin, double *xmax, double *ymin, double *ymax);
17
+ void wdCanvasViewport(cdCanvas* canvas, int xmin, int xmax, int ymin, int ymax);
18
+ void wdCanvasGetViewport(cdCanvas* canvas, int *xmin, int *xmax, int *ymin, int *ymax);
19
+ void wdCanvasWorld2Canvas(cdCanvas* canvas, double xw, double yw, int *xv, int *yv);
20
+ void wdCanvasWorld2CanvasSize(cdCanvas* canvas, double hw, double vw, int *hv, int *vv);
21
+ void wdCanvasCanvas2World(cdCanvas* canvas, int xv, int yv, double *xw, double *yw);
22
+
23
+ void wdCanvasClipArea(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax);
24
+ int wdCanvasGetClipArea(cdCanvas* canvas, double *xmin, double *xmax, double *ymin, double *ymax);
25
+ int wdCanvasIsPointInRegion(cdCanvas* canvas, double x, double y);
26
+ void wdCanvasOffsetRegion(cdCanvas* canvas, double x, double y);
27
+ void wdCanvasGetRegionBox(cdCanvas* canvas, double *xmin, double *xmax, double *ymin, double *ymax);
28
+
29
+ void wdCanvasHardcopy(cdCanvas* canvas, cdContext* ctx, void *data, void(*draw_func)(cdCanvas *canvas_copy));
30
+
31
+ /* primitives */
32
+ void wdCanvasPixel(cdCanvas* canvas, double x, double y, long color);
33
+ void wdCanvasMark(cdCanvas* canvas, double x, double y);
34
+ void wdCanvasLine(cdCanvas* canvas, double x1, double y1, double x2, double y2);
35
+ void wdCanvasVertex(cdCanvas* canvas, double x, double y);
36
+ void wdCanvasRect(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax);
37
+ void wdCanvasBox(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax);
38
+ void wdCanvasArc(cdCanvas* canvas, double xc, double yc, double w, double h, double angle1, double angle2);
39
+ void wdCanvasSector(cdCanvas* canvas, double xc, double yc, double w, double h, double angle1, double angle2);
40
+ void wdCanvasChord(cdCanvas* canvas, double xc, double yc, double w, double h, double angle1, double angle2);
41
+ void wdCanvasText(cdCanvas* canvas, double x, double y, const char* s);
42
+
43
+ void wdCanvasPutImageRect(cdCanvas* canvas, cdImage* image, double x, double y, int xmin, int xmax, int ymin, int ymax);
44
+ void wdCanvasPutImageRectRGB(cdCanvas* canvas, int iw, int ih, const unsigned char* r, const unsigned char* g, const unsigned char* b, double x, double y, double w, double h, int xmin, int xmax, int ymin, int ymax);
45
+ void wdCanvasPutImageRectRGBA(cdCanvas* canvas, int iw, int ih, const unsigned char* r, const unsigned char* g, const unsigned char* b, const unsigned char* a, double x, double y, double w, double h, int xmin, int xmax, int ymin, int ymax);
46
+ void wdCanvasPutImageRectMap(cdCanvas* canvas, int iw, int ih, const unsigned char* index, const long* colors, double x, double y, double w, double h, int xmin, int xmax, int ymin, int ymax);
47
+ void wdCanvasPutBitmap(cdCanvas* canvas, cdBitmap* bitmap, double x, double y, double w, double h);
48
+
49
+ /* attributes */
50
+ double wdCanvasLineWidth(cdCanvas* canvas, double width);
51
+ int wdCanvasFont(cdCanvas* canvas, const char* type_face, int style, double size);
52
+ void wdCanvasGetFont(cdCanvas* canvas, char *type_face, int *style, double *size);
53
+ double wdCanvasMarkSize(cdCanvas* canvas, double size);
54
+ void wdCanvasGetFontDim(cdCanvas* canvas, double *max_width, double *height, double *ascent, double *descent);
55
+ void wdCanvasGetTextSize(cdCanvas* canvas, const char* s, double *width, double *height);
56
+ void wdCanvasGetTextBox(cdCanvas* canvas, double x, double y, const char* s, double *xmin, double *xmax, double *ymin, double *ymax);
57
+ void wdCanvasGetTextBounds(cdCanvas* canvas, double x, double y, const char* s, double *rect);
58
+ void wdCanvasStipple(cdCanvas* canvas, int w, int h, const unsigned char*fgbg, double w_mm, double h_mm);
59
+ void wdCanvasPattern(cdCanvas* canvas, int w, int h, const long *color, double w_mm, double h_mm);
60
+
61
+ /* vector text */
62
+ void wdCanvasVectorTextDirection(cdCanvas* canvas, double x1, double y1, double x2, double y2);
63
+ void wdCanvasVectorTextSize(cdCanvas* canvas, double size_x, double size_y, const char* s);
64
+ void wdCanvasGetVectorTextSize(cdCanvas* canvas, const char* s, double *x, double *y);
65
+ double wdCanvasVectorCharSize(cdCanvas* canvas, double size);
66
+ void wdCanvasVectorText(cdCanvas* canvas, double x, double y, const char* s);
67
+ void wdCanvasMultiLineVectorText(cdCanvas* canvas, double x, double y, const char* s);
68
+ void wdCanvasGetVectorTextBounds(cdCanvas* canvas, const char* s, double x, double y, double *rect);
69
+
70
+ #ifdef __cplusplus
71
+ }
72
+ #endif
73
+
74
+ #ifndef CD_NO_OLD_INTERFACE
75
+ #include "wd_old.h"
76
+ #endif
77
+
78
+ #endif
@@ -0,0 +1,85 @@
1
+ /** \file
2
+ * \brief Old WC API
3
+ *
4
+ * See Copyright Notice in cd.h
5
+ */
6
+
7
+ #ifndef WD_OLD_H
8
+ #define WD_OLD_H
9
+
10
+ #ifdef __cplusplus
11
+ extern "C" {
12
+ #endif
13
+
14
+ /* coordinate transformation */
15
+ void wdWindow(double xmin, double xmax, double ymin, double ymax);
16
+ void wdGetWindow(double *xmin, double *xmax, double *ymin, double *ymax);
17
+ void wdViewport(int xmin, int xmax, int ymin, int ymax);
18
+ void wdGetViewport(int *xmin, int *xmax, int *ymin, int *ymax);
19
+ void wdWorld2Canvas(double xw, double yw, int *xv, int *yv);
20
+ void wdWorld2CanvasSize(double hw, double vw, int *hv, int *vv);
21
+ void wdCanvas2World(int xv, int yv, double *xw, double *yw);
22
+
23
+ void wdClipArea(double xmin, double xmax, double ymin, double ymax);
24
+ int wdGetClipArea(double *xmin, double *xmax, double *ymin, double *ymax);
25
+ double* wdGetClipPoly(int *n);
26
+ int wdPointInRegion(double x, double y);
27
+ void wdOffsetRegion(double x, double y);
28
+ void wdRegionBox(double *xmin, double *xmax, double *ymin, double *ymax);
29
+
30
+ void wdHardcopy(cdContext* ctx, void *data, cdCanvas *cnv, void(*draw_func)(void));
31
+
32
+ /* primitives */
33
+ void wdPixel(double x, double y, long color);
34
+ void wdMark(double x, double y);
35
+ void wdLine(double x1, double y1, double x2, double y2);
36
+ void wdVertex(double x, double y);
37
+ void wdRect(double xmin, double xmax, double ymin, double ymax);
38
+ void wdBox(double xmin, double xmax, double ymin, double ymax);
39
+ void wdArc(double xc, double yc, double w, double h, double angle1, double angle2);
40
+ void wdSector(double xc, double yc, double w, double h, double angle1, double angle2);
41
+ void wdChord(double xc, double yc, double w, double h, double angle1, double angle2);
42
+ void wdText(double x, double y, const char* s);
43
+
44
+ void wdPutImageRect(cdImage* image, double x, double y, int xmin, int xmax, int ymin, int ymax);
45
+ void wdPutImageRectRGB(int iw, int ih, const unsigned char* r, const unsigned char* g, const unsigned char* b, double x, double y, double w, double h, int xmin, int xmax, int ymin, int ymax);
46
+ void wdPutImageRectRGBA(int iw, int ih, const unsigned char* r, const unsigned char* g, const unsigned char* b, const unsigned char* a, double x, double y, double w, double h, int xmin, int xmax, int ymin, int ymax);
47
+ void wdPutImageRectMap(int iw, int ih, const unsigned char* index, const long* colors, double x, double y, double w, double h, int xmin, int xmax, int ymin, int ymax);
48
+ void wdPutBitmap(cdBitmap* bitmap, double x, double y, double w, double h);
49
+
50
+ /* attributes */
51
+ double wdLineWidth(double width);
52
+ void wdFont(int type_face, int style, double size);
53
+ void wdGetFont(int *type_face, int *style, double *size);
54
+ double wdMarkSize(double size);
55
+ void wdFontDim(double *max_width, double *height, double *ascent, double *descent);
56
+ void wdTextSize(const char* s, double *width, double *height);
57
+ void wdTextBox(double x, double y, const char* s, double *xmin, double *xmax, double *ymin, double *ymax);
58
+ void wdTextBounds(double x, double y, const char* s, double *rect);
59
+ void wdStipple(int w, int h, const unsigned char* stipple, double w_mm, double h_mm);
60
+ void wdPattern(int w, int h, const long* pattern, double w_mm, double h_mm);
61
+
62
+ /* vector text */
63
+ void wdVectorTextDirection(double x1, double y1, double x2, double y2);
64
+ void wdVectorTextSize(double size_x, double size_y, const char* s);
65
+ void wdGetVectorTextSize(const char* s, double *x, double *y);
66
+ double wdVectorCharSize(double size);
67
+ void wdVectorText(double x, double y, const char* s);
68
+ void wdMultiLineVectorText(double x, double y, const char* s);
69
+ void wdGetVectorTextBounds(const char* s, double x, double y, double *rect);
70
+
71
+ /* OLD definitions, defined for backward compatibility */
72
+ #define wdVectorFont cdVectorFont
73
+ #define wdVectorTextTransform cdVectorTextTransform
74
+ #define wdActivate cdActivate
75
+ #define wdClip(mode) cdClip(mode)
76
+ #define wdBegin(mode) cdBegin(mode)
77
+ #define wdEnd() cdEnd();
78
+ #define wdMM2Pixel(mm_dx, mm_dy, dx, dy) cdMM2Pixel(mm_dx, mm_dy, dx, dy)
79
+ #define wdPixel2MM(dx, dy, mm_dx, mm_dy) cdPixel2MM(dx, dy, mm_dx, mm_dy)
80
+
81
+ #ifdef __cplusplus
82
+ }
83
+ #endif
84
+
85
+ #endif
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,494 @@
1
+ /** \file
2
+ * \brief User API
3
+ * CD - Canvas Draw
4
+ * Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil
5
+ * http://www.tecgraf.puc-rio.br/cd
6
+ * mailto:cd@tecgraf.puc-rio.br
7
+ *
8
+ * See Copyright Notice at the end of this file
9
+ */
10
+
11
+ #ifndef __CD_H
12
+ #define __CD_H
13
+
14
+ #ifdef __cplusplus
15
+ extern "C" {
16
+ #endif
17
+
18
+
19
+ #define CD_NAME "CD - Canvas Draw"
20
+ #define CD_DESCRIPTION "A 2D Graphics Library"
21
+ #define CD_COPYRIGHT "Copyright (C) 1994-2008 Tecgraf, PUC-Rio."
22
+ #define CD_VERSION "5.1.0"
23
+ #define CD_VERSION_DATE "2008/10/14"
24
+ #define CD_VERSION_NUMBER 501000
25
+
26
+ typedef struct _cdContext cdContext;
27
+ typedef struct _cdCanvas cdCanvas;
28
+ typedef struct _cdCanvas cdState;
29
+ typedef struct _cdImage cdImage;
30
+
31
+ /* client images using bitmap structure */
32
+ typedef struct _cdBitmap {
33
+ int w;
34
+ int h;
35
+ int type;
36
+ void *data;
37
+ } cdBitmap;
38
+
39
+
40
+ /* library */
41
+ char* cdVersion(void);
42
+ char* cdVersionDate(void);
43
+ int cdVersionNumber(void);
44
+
45
+ /* canvas init */
46
+ cdCanvas* cdCreateCanvas(cdContext *context, void *data);
47
+ cdCanvas* cdCreateCanvasf(cdContext *context, const char* format, ...);
48
+ void cdKillCanvas(cdCanvas* canvas);
49
+
50
+ cdContext* cdCanvasGetContext(cdCanvas* canvas);
51
+ int cdCanvasActivate(cdCanvas* canvas);
52
+ void cdCanvasDeactivate(cdCanvas* canvas);
53
+ int cdUseContextPlus(int use);
54
+ void cdInitContextPlus(void); /* need an external library */
55
+
56
+ /* context */
57
+ typedef int (*cdCallback)(cdCanvas* canvas, ...);
58
+ int cdContextRegisterCallback(cdContext *context, int cb, cdCallback func);
59
+ unsigned long cdContextCaps(cdContext *context);
60
+
61
+ /* control */
62
+ int cdCanvasSimulate(cdCanvas* canvas, int mode);
63
+ void cdCanvasFlush(cdCanvas* canvas);
64
+ void cdCanvasClear(cdCanvas* canvas);
65
+ cdState* cdCanvasSaveState(cdCanvas* canvas);
66
+ void cdCanvasRestoreState(cdCanvas* canvas, cdState* state);
67
+ void cdReleaseState(cdState* state);
68
+ void cdCanvasSetAttribute(cdCanvas* canvas, const char* name, char* data);
69
+ void cdCanvasSetfAttribute(cdCanvas* canvas, const char* name, const char* format, ...);
70
+ char* cdCanvasGetAttribute(cdCanvas* canvas, const char* name);
71
+
72
+ /* interpretation */
73
+ int cdCanvasPlay(cdCanvas* canvas, cdContext *context, int xmin, int xmax, int ymin, int ymax, void *data);
74
+
75
+ /* coordinate transformation */
76
+ void cdCanvasGetSize(cdCanvas* canvas, int *width, int *height, double *width_mm, double *height_mm);
77
+ int cdCanvasUpdateYAxis(cdCanvas* canvas, int* y);
78
+ double cdfCanvasUpdateYAxis(cdCanvas* canvas, double* y);
79
+ int cdCanvasInvertYAxis(cdCanvas* canvas, int y);
80
+ double cdfCanvasInvertYAxis(cdCanvas* canvas, double y);
81
+ void cdCanvasMM2Pixel(cdCanvas* canvas, double mm_dx, double mm_dy, int *dx, int *dy);
82
+ void cdCanvasPixel2MM(cdCanvas* canvas, int dx, int dy, double *mm_dx, double *mm_dy);
83
+ void cdfCanvasMM2Pixel(cdCanvas* canvas, double mm_dx, double mm_dy, double *dx, double *dy);
84
+ void cdfCanvasPixel2MM(cdCanvas* canvas, double dx, double dy, double *mm_dx, double *mm_dy);
85
+ void cdCanvasOrigin(cdCanvas* canvas, int x, int y);
86
+ void cdfCanvasOrigin(cdCanvas* canvas, double x, double y);
87
+ void cdCanvasGetOrigin(cdCanvas* canvas, int *x, int *y);
88
+ void cdfCanvasGetOrigin(cdCanvas* canvas, double *x, double *y);
89
+ void cdCanvasTransform(cdCanvas* canvas, const double* matrix);
90
+ double* cdCanvasGetTransform(cdCanvas* canvas);
91
+ void cdCanvasTransformMultiply(cdCanvas* canvas, const double* matrix);
92
+ void cdCanvasTransformRotate(cdCanvas* canvas, double angle);
93
+ void cdCanvasTransformScale(cdCanvas* canvas, double sx, double sy);
94
+ void cdCanvasTransformTranslate(cdCanvas* canvas, double dx, double dy);
95
+ void cdCanvasTransformPoint(cdCanvas* canvas, int x, int y, int *tx, int *ty);
96
+ void cdfCanvasTransformPoint(cdCanvas* canvas, double x, double y, double *tx, double *ty);
97
+
98
+ /* clipping */
99
+ int cdCanvasClip(cdCanvas* canvas, int mode);
100
+ void cdCanvasClipArea(cdCanvas* canvas, int xmin, int xmax, int ymin, int ymax);
101
+ int cdCanvasGetClipArea(cdCanvas* canvas, int *xmin, int *xmax, int *ymin, int *ymax);
102
+ void cdfCanvasClipArea(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax);
103
+ int cdfCanvasGetClipArea(cdCanvas* canvas, double *xmin, double *xmax, double *ymin, double *ymax);
104
+
105
+ /* clipping region */
106
+ int cdCanvasIsPointInRegion(cdCanvas* canvas, int x, int y);
107
+ void cdCanvasOffsetRegion(cdCanvas* canvas, int x, int y);
108
+ void cdCanvasGetRegionBox(cdCanvas* canvas, int *xmin, int *xmax, int *ymin, int *ymax);
109
+ int cdCanvasRegionCombineMode(cdCanvas* canvas, int mode);
110
+
111
+ /* primitives */
112
+ void cdCanvasPixel(cdCanvas* canvas, int x, int y, long color);
113
+ void cdCanvasMark(cdCanvas* canvas, int x, int y);
114
+
115
+ void cdCanvasLine(cdCanvas* canvas, int x1, int y1, int x2, int y2);
116
+ void cdCanvasBegin(cdCanvas* canvas, int mode);
117
+ void cdCanvasVertex(cdCanvas* canvas, int x, int y);
118
+ void cdCanvasEnd(cdCanvas* canvas);
119
+ void cdCanvasRect(cdCanvas* canvas, int xmin, int xmax, int ymin, int ymax);
120
+ void cdCanvasBox(cdCanvas* canvas, int xmin, int xmax, int ymin, int ymax);
121
+ void cdCanvasArc(cdCanvas* canvas, int xc, int yc, int w, int h, double angle1, double angle2);
122
+ void cdCanvasSector(cdCanvas* canvas, int xc, int yc, int w, int h, double angle1, double angle2);
123
+ void cdCanvasChord(cdCanvas* canvas, int xc, int yc, int w, int h, double angle1, double angle2);
124
+ void cdCanvasText(cdCanvas* canvas, int x, int y, const char* s);
125
+
126
+ void cdfCanvasLine(cdCanvas* canvas, double x1, double y1, double x2, double y2);
127
+ void cdfCanvasVertex(cdCanvas* canvas, double x, double y);
128
+ void cdfCanvasRect(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax);
129
+ void cdfCanvasBox(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax);
130
+ void cdfCanvasArc(cdCanvas* canvas, double xc, double yc, double w, double h, double angle1, double angle2);
131
+ void cdfCanvasSector(cdCanvas* canvas, double xc, double yc, double w, double h, double angle1, double angle2);
132
+ void cdfCanvasChord(cdCanvas* canvas, double xc, double yc, double w, double h, double angle1, double angle2);
133
+ void cdfCanvasText(cdCanvas* canvas, double x, double y, const char* s);
134
+
135
+ /* attributes */
136
+ void cdCanvasSetBackground(cdCanvas* canvas, long color);
137
+ void cdCanvasSetForeground(cdCanvas* canvas, long color);
138
+ long cdCanvasBackground(cdCanvas* canvas, long color);
139
+ long cdCanvasForeground(cdCanvas* canvas, long color);
140
+ int cdCanvasBackOpacity(cdCanvas* canvas, int opacity);
141
+ int cdCanvasWriteMode(cdCanvas* canvas, int mode);
142
+ int cdCanvasLineStyle(cdCanvas* canvas, int style);
143
+ void cdCanvasLineStyleDashes(cdCanvas* canvas, const int* dashes, int count);
144
+ int cdCanvasLineWidth(cdCanvas* canvas, int width);
145
+ int cdCanvasLineJoin(cdCanvas* canvas, int join);
146
+ int cdCanvasLineCap(cdCanvas* canvas, int cap);
147
+ int cdCanvasInteriorStyle(cdCanvas* canvas, int style);
148
+ int cdCanvasHatch(cdCanvas* canvas, int style);
149
+ void cdCanvasStipple(cdCanvas* canvas, int w, int h, const unsigned char* stipple);
150
+ unsigned char* cdCanvasGetStipple(cdCanvas* canvas, int *n, int *m);
151
+ void cdCanvasPattern(cdCanvas* canvas, int w, int h, long const int *pattern);
152
+ long* cdCanvasGetPattern(cdCanvas* canvas, int* n, int* m);
153
+ int cdCanvasFillMode(cdCanvas* canvas, int mode);
154
+ int cdCanvasFont(cdCanvas* canvas, const char* type_face, int style, int size);
155
+ void cdCanvasGetFont(cdCanvas* canvas, char *type_face, int *style, int *size);
156
+ char* cdCanvasNativeFont(cdCanvas* canvas, const char* font);
157
+ int cdCanvasTextAlignment(cdCanvas* canvas, int alignment);
158
+ double cdCanvasTextOrientation(cdCanvas* canvas, double angle);
159
+ int cdCanvasMarkType(cdCanvas* canvas, int type);
160
+ int cdCanvasMarkSize(cdCanvas* canvas, int size);
161
+
162
+ /* vector text */
163
+ void cdCanvasVectorText(cdCanvas* canvas, int x, int y, const char* s);
164
+ void cdCanvasMultiLineVectorText(cdCanvas* canvas, int x, int y, const char* s);
165
+
166
+ /* vector text attributes */
167
+ char *cdCanvasVectorFont(cdCanvas* canvas, const char *filename);
168
+ void cdCanvasVectorTextDirection(cdCanvas* canvas, int x1, int y1, int x2, int y2);
169
+ double* cdCanvasVectorTextTransform(cdCanvas* canvas, const double* matrix);
170
+ void cdCanvasVectorTextSize(cdCanvas* canvas, int size_x, int size_y, const char* s);
171
+ int cdCanvasVectorCharSize(cdCanvas* canvas, int size);
172
+
173
+ /* vector text properties */
174
+ void cdCanvasGetVectorTextSize(cdCanvas* canvas, const char* s, int *x, int *y);
175
+ void cdCanvasGetVectorTextBounds(cdCanvas* canvas, const char* s, int x, int y, int *rect);
176
+
177
+ /* properties */
178
+ void cdCanvasGetFontDim(cdCanvas* canvas, int *max_width, int *height, int *ascent, int *descent);
179
+ void cdCanvasGetTextSize(cdCanvas* canvas, const char* s, int *width, int *height);
180
+ void cdCanvasGetTextBox(cdCanvas* canvas, int x, int y, const char* s, int *xmin, int *xmax, int *ymin, int *ymax);
181
+ void cdCanvasGetTextBounds(cdCanvas* canvas, int x, int y, const char* s, int *rect);
182
+ int cdCanvasGetColorPlanes(cdCanvas* canvas);
183
+
184
+ /* color */
185
+ void cdCanvasPalette(cdCanvas* canvas, int n, const long *palette, int mode);
186
+
187
+ /* client images */
188
+ void cdCanvasGetImageRGB(cdCanvas* canvas, unsigned char* r, unsigned char* g, unsigned char* b, int x, int y, int w, int h);
189
+ void cdCanvasPutImageRectRGB(cdCanvas* canvas, int iw, int ih, const unsigned char* r, const unsigned char* g, const unsigned char* b, int x, int y, int w, int h, int xmin, int xmax, int ymin, int ymax);
190
+ void cdCanvasPutImageRectRGBA(cdCanvas* canvas, int iw, int ih, const unsigned char* r, const unsigned char* g, const unsigned char* b, const unsigned char* a, int x, int y, int w, int h, int xmin, int xmax, int ymin, int ymax);
191
+ void cdCanvasPutImageRectMap(cdCanvas* canvas, int iw, int ih, const unsigned char* index, const long* colors, int x, int y, int w, int h, int xmin, int xmax, int ymin, int ymax);
192
+
193
+ /* server images */
194
+ cdImage* cdCanvasCreateImage(cdCanvas* canvas, int w, int h);
195
+ void cdKillImage(cdImage* image);
196
+ void cdCanvasGetImage(cdCanvas* canvas, cdImage* image, int x, int y);
197
+ void cdCanvasPutImageRect(cdCanvas* canvas, cdImage* image, int x, int y, int xmin, int xmax, int ymin, int ymax);
198
+ void cdCanvasScrollArea(cdCanvas* canvas, int xmin, int xmax, int ymin, int ymax, int dx, int dy);
199
+
200
+ /* bitmap */
201
+ cdBitmap* cdCreateBitmap(int w, int h, int type);
202
+ cdBitmap* cdInitBitmap(int w, int h, int type, ...);
203
+ void cdKillBitmap(cdBitmap* bitmap);
204
+ unsigned char* cdBitmapGetData(cdBitmap* bitmap, int dataptr);
205
+ void cdBitmapSetRect(cdBitmap* bitmap, int xmin, int xmax, int ymin, int ymax);
206
+ void cdCanvasPutBitmap(cdCanvas* canvas, cdBitmap* bitmap, int x, int y, int w, int h);
207
+ void cdCanvasGetBitmap(cdCanvas* canvas, cdBitmap* bitmap, int x, int y);
208
+ void cdBitmapRGB2Map(cdBitmap* bitmap_rgb, cdBitmap* bitmap_map);
209
+
210
+ /* color */
211
+ long cdEncodeColor(unsigned char red, unsigned char green, unsigned char blue);
212
+ void cdDecodeColor(long color, unsigned char* red, unsigned char* green, unsigned char* blue);
213
+ unsigned char cdDecodeAlpha(long color);
214
+ long cdEncodeAlpha(long color, unsigned char alpha);
215
+
216
+ #define cdAlpha(_) (unsigned char)(~(((_) >> 24) & 0xFF))
217
+ #define cdReserved(_) (unsigned char)(((_) >> 24) & 0xFF)
218
+ #define cdRed(_) (unsigned char)(((_) >> 16) & 0xFF)
219
+ #define cdGreen(_) (unsigned char)(((_) >> 8) & 0xFF)
220
+ #define cdBlue(_) (unsigned char)(((_) >> 0) & 0xFF)
221
+
222
+ /* client image color convertion */
223
+ void cdRGB2Map(int width, int height, const unsigned char* red, const unsigned char* green, const unsigned char* blue, unsigned char* index, int pal_size, long *color);
224
+
225
+
226
+ /* CD Values */
227
+
228
+ #define CD_QUERY -1 /* query value */
229
+
230
+ enum { /* bitmap type */
231
+ CD_RGB, /* these definitions are compatible with the IM library */
232
+ CD_MAP,
233
+ CD_RGBA = 0x100
234
+ };
235
+
236
+ enum { /* bitmap data */
237
+ CD_IRED,
238
+ CD_IGREEN,
239
+ CD_IBLUE,
240
+ CD_IALPHA,
241
+ CD_INDEX,
242
+ CD_COLORS
243
+ };
244
+
245
+ enum { /* status report */
246
+ CD_ERROR = -1,
247
+ CD_OK = 0
248
+ };
249
+
250
+ enum { /* clip mode */
251
+ CD_CLIPOFF,
252
+ CD_CLIPAREA,
253
+ CD_CLIPPOLYGON,
254
+ CD_CLIPREGION
255
+ };
256
+
257
+ enum { /* region combine mode */
258
+ CD_UNION,
259
+ CD_INTERSECT,
260
+ CD_DIFFERENCE,
261
+ CD_NOTINTERSECT
262
+ };
263
+
264
+ enum { /* polygon mode (begin...end) */
265
+ CD_FILL,
266
+ CD_OPEN_LINES,
267
+ CD_CLOSED_LINES,
268
+ CD_CLIP,
269
+ CD_BEZIER,
270
+ CD_REGION
271
+ };
272
+
273
+ #define CD_POLYCUSTOM 10
274
+
275
+ enum { /* fill mode */
276
+ CD_EVENODD,
277
+ CD_WINDING
278
+ };
279
+
280
+ enum { /* line join */
281
+ CD_MITER,
282
+ CD_BEVEL,
283
+ CD_ROUND
284
+ };
285
+
286
+ enum { /* line cap */
287
+ CD_CAPFLAT,
288
+ CD_CAPSQUARE,
289
+ CD_CAPROUND
290
+ };
291
+
292
+ enum { /* background opacity mode */
293
+ CD_OPAQUE,
294
+ CD_TRANSPARENT
295
+ };
296
+
297
+ enum { /* write mode */
298
+ CD_REPLACE,
299
+ CD_XOR,
300
+ CD_NOT_XOR
301
+ };
302
+
303
+ enum { /* color allocation mode (palette) */
304
+ CD_POLITE,
305
+ CD_FORCE
306
+ };
307
+
308
+ enum { /* line style */
309
+ CD_CONTINUOUS,
310
+ CD_DASHED,
311
+ CD_DOTTED,
312
+ CD_DASH_DOT,
313
+ CD_DASH_DOT_DOT,
314
+ CD_CUSTOM
315
+ };
316
+
317
+ enum { /* marker type */
318
+ CD_PLUS,
319
+ CD_STAR,
320
+ CD_CIRCLE,
321
+ CD_X,
322
+ CD_BOX,
323
+ CD_DIAMOND,
324
+ CD_HOLLOW_CIRCLE,
325
+ CD_HOLLOW_BOX,
326
+ CD_HOLLOW_DIAMOND
327
+ };
328
+
329
+ enum { /* hatch type */
330
+ CD_HORIZONTAL,
331
+ CD_VERTICAL,
332
+ CD_FDIAGONAL,
333
+ CD_BDIAGONAL,
334
+ CD_CROSS,
335
+ CD_DIAGCROSS
336
+ };
337
+
338
+ enum { /* interior style */
339
+ CD_SOLID,
340
+ CD_HATCH,
341
+ CD_STIPPLE,
342
+ CD_PATTERN,
343
+ CD_HOLLOW
344
+ };
345
+
346
+ enum { /* text alignment */
347
+ CD_NORTH,
348
+ CD_SOUTH,
349
+ CD_EAST,
350
+ CD_WEST,
351
+ CD_NORTH_EAST,
352
+ CD_NORTH_WEST,
353
+ CD_SOUTH_EAST,
354
+ CD_SOUTH_WEST,
355
+ CD_CENTER,
356
+ CD_BASE_LEFT,
357
+ CD_BASE_CENTER,
358
+ CD_BASE_RIGHT
359
+ };
360
+
361
+ enum { /* style */
362
+ CD_PLAIN = 0,
363
+ CD_BOLD = 1,
364
+ CD_ITALIC = 2,
365
+ CD_UNDERLINE = 4,
366
+ CD_STRIKEOUT = 8
367
+ };
368
+
369
+ #define CD_BOLD_ITALIC (CD_BOLD|CD_ITALIC) /* compatibility name */
370
+
371
+ enum { /* some font sizes */
372
+ CD_SMALL = 8,
373
+ CD_STANDARD = 12,
374
+ CD_LARGE = 18
375
+ };
376
+
377
+ /* Canvas Capabilities */
378
+ #define CD_CAP_NONE 0x00000000
379
+ #define CD_CAP_FLUSH 0x00000001
380
+ #define CD_CAP_CLEAR 0x00000002
381
+ #define CD_CAP_PLAY 0x00000004
382
+ #define CD_CAP_YAXIS 0x00000008
383
+ #define CD_CAP_CLIPAREA 0x00000010
384
+ #define CD_CAP_CLIPPOLY 0x00000020
385
+ #define CD_CAP_REGION 0x00000040
386
+ #define CD_CAP_RECT 0x00000080
387
+ #define CD_CAP_CHORD 0x00000100
388
+ #define CD_CAP_IMAGERGB 0x00000200
389
+ #define CD_CAP_IMAGERGBA 0x00000400
390
+ #define CD_CAP_IMAGEMAP 0x00000800
391
+ #define CD_CAP_GETIMAGERGB 0x00001000
392
+ #define CD_CAP_IMAGESRV 0x00002000
393
+ #define CD_CAP_BACKGROUND 0x00004000
394
+ #define CD_CAP_BACKOPACITY 0x00008000
395
+ #define CD_CAP_WRITEMODE 0x00010000
396
+ #define CD_CAP_LINESTYLE 0x00020000
397
+ #define CD_CAP_LINEWITH 0x00040000
398
+ #define CD_CAP_FPRIMTIVES 0x00080000
399
+ #define CD_CAP_HATCH 0x00100000
400
+ #define CD_CAP_STIPPLE 0x00200000
401
+ #define CD_CAP_PATTERN 0x00400000
402
+ #define CD_CAP_FONT 0x00800000
403
+ #define CD_CAP_FONTDIM 0x01000000
404
+ #define CD_CAP_TEXTSIZE 0x02000000
405
+ #define CD_CAP_TEXTORIENTATION 0x04000000
406
+ #define CD_CAP_PALETTE 0x08000000
407
+ #define CD_CAP_LINECAP 0x10000000
408
+ #define CD_CAP_LINEJOIN 0x20000000
409
+ #define CD_CAP_ALL 0xFFFFFFFF
410
+
411
+ /* cdPlay definitions */
412
+ #define CD_SIZECB 0 /* size callback */
413
+ typedef int(*cdSizeCB)(cdCanvas *canvas, int w, int h, double w_mm, double h_mm);
414
+ #define CD_ABORT 1
415
+ #define CD_CONTINUE 0
416
+
417
+ /* simulation flags */
418
+ #define CD_SIM_NONE 0x0000
419
+ #define CD_SIM_LINE 0x0001
420
+ #define CD_SIM_RECT 0x0002
421
+ #define CD_SIM_BOX 0x0004
422
+ #define CD_SIM_ARC 0x0008
423
+ #define CD_SIM_SECTOR 0x0010
424
+ #define CD_SIM_CHORD 0x0020
425
+ #define CD_SIM_POLYLINE 0x0040
426
+ #define CD_SIM_POLYGON 0x0080
427
+ #define CD_SIM_TEXT 0x0100
428
+ #define CD_SIM_ALL 0xFFFF
429
+
430
+ #define CD_SIM_LINES (CD_SIM_LINE | CD_SIM_RECT | CD_SIM_ARC | CD_SIM_POLYLINE)
431
+ #define CD_SIM_FILLS (CD_SIM_BOX | CD_SIM_SECTOR | CD_SIM_CHORD | CD_SIM_POLYGON)
432
+
433
+ /* some predefined colors for convenience */
434
+ #define CD_RED 0xFF0000L /* 255, 0, 0 */
435
+ #define CD_DARK_RED 0x800000L /* 128, 0, 0 */
436
+ #define CD_GREEN 0x00FF00L /* 0,255, 0 */
437
+ #define CD_DARK_GREEN 0x008000L /* 0,128, 0 */
438
+ #define CD_BLUE 0x0000FFL /* 0, 0,255 */
439
+ #define CD_DARK_BLUE 0x000080L /* 0, 0,128 */
440
+
441
+ #define CD_YELLOW 0xFFFF00L /* 255,255, 0 */
442
+ #define CD_DARK_YELLOW 0x808000L /* 128,128, 0 */
443
+ #define CD_MAGENTA 0xFF00FFL /* 255, 0,255 */
444
+ #define CD_DARK_MAGENTA 0x800080L /* 128, 0,128 */
445
+ #define CD_CYAN 0x00FFFFL /* 0,255,255 */
446
+ #define CD_DARK_CYAN 0x008080L /* 0,128,128 */
447
+
448
+ #define CD_WHITE 0xFFFFFFL /* 255,255,255 */
449
+ #define CD_BLACK 0x000000L /* 0, 0, 0 */
450
+
451
+ #define CD_DARK_GRAY 0x808080L /* 128,128,128 */
452
+ #define CD_GRAY 0xC0C0C0L /* 192,192,192 */
453
+
454
+ /* some usefull conversion factors */
455
+ #define CD_MM2PT 2.834645669 /* milimeters to points (pt = CD_MM2PT * mm) */
456
+ #define CD_RAD2DEG 57.295779513 /* radians to degrees (deg = CD_RAD2DEG * rad) */
457
+ #define CD_DEG2RAD 0.01745329252 /* degrees to radians (rad = CD_DEG2RAD * deg) */
458
+
459
+
460
+ #ifdef __cplusplus
461
+ }
462
+ #endif
463
+
464
+
465
+ #ifndef CD_NO_OLD_INTERFACE
466
+ #include "cd_old.h"
467
+ #endif
468
+
469
+
470
+ /******************************************************************************
471
+ Copyright (C) 1994-2008 Tecgraf, PUC-Rio.
472
+
473
+ Permission is hereby granted, free of charge, to any person obtaining
474
+ a copy of this software and associated documentation files (the
475
+ "Software"), to deal in the Software without restriction, including
476
+ without limitation the rights to use, copy, modify, merge, publish,
477
+ distribute, sublicense, and/or sell copies of the Software, and to
478
+ permit persons to whom the Software is furnished to do so, subject to
479
+ the following conditions:
480
+
481
+ The above copyright notice and this permission notice shall be
482
+ included in all copies or substantial portions of the Software.
483
+
484
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
485
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
486
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
487
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
488
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
489
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
490
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
491
+ ******************************************************************************/
492
+
493
+ #endif /* ifndef CD_H */
494
+