eiffel-iup.c 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540
  1. // The MIT License (MIT)
  2. // Copyright (c) 2020 by German A. Arias
  3. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4. // of this software and associated documentation files (the "Software"), to deal
  5. // in the Software without restriction, including without limitation the rights
  6. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. // copies of the Software, and to permit persons to whom the Software is
  8. // furnished to do so, subject to the following conditions:
  9. //
  10. // The above copyright notice and this permission notice shall be included in
  11. // all copies or substantial portions of the Software.
  12. //
  13. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  19. // SOFTWARE.
  20. //#include <eiffel-iup.h>
  21. #include "eif_setup.h"
  22. #include "eif_eiffel.h"
  23. // IUP
  24. #include <stdlib.h>
  25. #include <iup/iup.h>
  26. #include <iup/iupkey.h>
  27. #include <iup/iup_config.h>
  28. #include <iup/iupcontrols.h>
  29. // For IM
  30. #include <im/im.h>
  31. #include <im/im_image.h>
  32. #include <iup/iupim.h>
  33. // For CD
  34. #include <cd/cd.h>
  35. #include <cd/wd.h>
  36. #include <cd/cdiup.h>
  37. #include <cd/cdim.h>
  38. EIF_OBJECT obj = NULL;
  39. EIF_PROC help_cb_Fn,
  40. // Common callback
  41. idle_action_Fidle,
  42. // Common callbacks
  43. map_cb_Fn,
  44. unmap_cb_Fn,
  45. destroy_cb_Fn,
  46. ldestroy_cb_Fn,
  47. getfocus_cb_Fn,
  48. killfocus_cb_Fn,
  49. enterwindow_cb_Fn,
  50. leavewindow_cb_Fn,
  51. action_Fn,
  52. // Common callback
  53. k_any_Fni,
  54. // Dialog and progress d
  55. close_cb_Fn,
  56. copydata_cb_Fnsi,
  57. dropfiles_cb_Fnsiii,
  58. mdiactivate_cb_Fn,
  59. move_cb_Fnii,
  60. resize_cb_Fnii,
  61. show_cb_Fni,
  62. trayclick_cb_Fniii,
  63. // File dialog callback
  64. file_cb_Fnss,
  65. // Color dialog callback
  66. colorupdate_cb_Fn,
  67. // Progress dialog callb
  68. cancel_cb_Fn,
  69. // Tabs callback
  70. tabchange_cb_Fnnn,
  71. tabchangepos_cb_Fnii,
  72. tabclose_cb_Fni,
  73. rightclick_cb_Fni,
  74. // DetachedBox callback
  75. detached_cb_Fnnii,
  76. restored_cb_Fnnii,
  77. // Expander callback
  78. openclose_cb_Fni,
  79. extrabutton_cb_Fnii,
  80. // Split callback
  81. valuechanged_cb_Fn,
  82. // Button callback
  83. button_cb_Fniiiis,
  84. // Canvas callback
  85. action_Fnff,
  86. focus_cb_Fni,
  87. motion_cb_Fniis,
  88. keypress_cb_Fnii,
  89. scroll_cb_Fniff,
  90. wheel_cb_Fndiis,
  91. // Link callback
  92. click_cb_Fns,
  93. // List callbacks
  94. action_Fnsii,
  95. caret_cb_Fniii,
  96. dblclick_cb_Fnis,
  97. dragdrop_cb_Fniiii,
  98. dropdown_cb_Fni,
  99. edit_cb_Fnis,
  100. multiselect_cb_Fns,
  101. // Spin callback
  102. spin_cb_Fni,
  103. // Callback for text
  104. action_Fnis,
  105. // Callback for toggle
  106. action_Fni,
  107. // Callbacks for tree
  108. selection_cb_Fnii,
  109. multiselection_cb_Fnpi,
  110. multiunselection_cb_Fnpi,
  111. branchopen_cb_Fni,
  112. branchclose_cb_Fni,
  113. executeleaf_cb_Fni,
  114. showrename_cb_Fni,
  115. rename_cb_Fnis,
  116. noderemoved_cb_Fns,
  117. togglevalue_cb_Fnii,
  118. // Callbacks for menu
  119. highlight_cb_Fn,
  120. open_cb_Fn,
  121. menuclose_cb_Fn,
  122. // Drag & Drop callbacks
  123. dragbegin_cb_Fnii,
  124. dragdatasize_cb_Fns,
  125. dragdata_cb_FnsVi,
  126. dragend_cb_Fni,
  127. dropdata_cb_FnsViii,
  128. dropmotion_cb_Fniis,
  129. // Menu recent files
  130. recent_cb_Fn,
  131. // Get Param
  132. param_cb_FniV,
  133. // Flat button
  134. flat_action_Fn,
  135. flat_button_cb_Fniiiis,
  136. flat_focus_cb_Fni,
  137. flat_enterwindow_cb_Fn,
  138. flat_leavewindow_cb_Fn,
  139. // Cells
  140. draw_cb_Fniiiiiic,
  141. height_cb_Fni,
  142. hspan_cb_Fnii,
  143. mouseclick_cb_Fniiiiiis,
  144. mousemotion_cb_Fniiiis,
  145. ncols_cb_Fn,
  146. nlines_cb_Fn,
  147. scrolling_cb_Fnii,
  148. vspan_cb_Fnii,
  149. width_cb_Fni,
  150. // Color bar
  151. cell_cb_Fni,
  152. extended_cb_Fni,
  153. select_cb_Fnii,
  154. switch_cb_Fnii,
  155. // Matrix
  156. action_Fniiiis,
  157. click_cb_Fniis,
  158. colresize_cb_Fni,
  159. release_cb_Fniis,
  160. resizematrix_cb_Fnii,
  161. mousemove_cb_Fnii,
  162. enteritem_cb_Fnii,
  163. leaveitem_cb_Fnii,
  164. scrolltop_cb_Fnii,
  165. bgcolor_cb_FniiVVV,
  166. fgcolor_cb_FniiVVV,
  167. // font_cb_Fnii,
  168. // type_cb_Fnii,
  169. dropcheck_cb_Fnii,
  170. // translatevalue_cb_Fniis,
  171. togglevalue_cb_Fniii,
  172. drop_cb_Fnnii,
  173. menudrop_cb_Fnnii,
  174. dropselect_cb_Fniinsii,
  175. edition_cb_Fniiii,
  176. // value_cb_Fnii,
  177. value_edit_cb_Fniis,
  178. mark_cb_Fnii,
  179. markedit_cb_Fniii,
  180. // Flat tabs
  181. flat_motion_cb_Fniis,
  182. // Drop button
  183. flat_dropshow_cb_Fni,
  184. // Dial
  185. button_press_cb_Fnd,
  186. button_release_cb_Fnd,
  187. mousemove_cb_Fnd,
  188. // Color browser
  189. change_cb_FnVVV,
  190. drag_cb_FnVVV,
  191. font_cb_Fnii,
  192. type_cb_Fnii,
  193. translatevalue_cb_Fniis,
  194. value_cb_Fnii;
  195. // Convert const char* to char*
  196. char* unconst_char (const char* s) {
  197. int i;
  198. char* res;
  199. if (s != NULL) {
  200. for (i = 0; s[i] != '\0'; i++) {
  201. res[i] = s[i];
  202. }
  203. res[i] = '\0';
  204. }
  205. return res;
  206. }
  207. void set_callbacks (EIF_REFERENCE iup_obj,
  208. EIF_PROC launch_help_cb_fn, EIF_PROC launch_idle_action_fidle, EIF_PROC launch_map_cb_fn,
  209. EIF_PROC launch_unmap_cb_fn, EIF_PROC launch_destroy_cb_fn, EIF_PROC launch_ldestroy_cb_fn,
  210. EIF_PROC launch_getfocus_cb_fn, EIF_PROC launch_killfocus_cb_fn, EIF_PROC launch_enterwindow_cb_fn,
  211. EIF_PROC launch_leavewindow_cb_fn, EIF_PROC launch_action_fn, EIF_PROC launch_k_any_fni,
  212. EIF_PROC launch_close_cb_fn, EIF_PROC launch_copydata_cb_fnsi, EIF_PROC launch_dropfiles_cb_fnsiii,
  213. EIF_PROC launch_mdiactivate_cb_fn, EIF_PROC launch_move_cb_fnii, EIF_PROC launch_resize_cb_fnii,
  214. EIF_PROC launch_show_cb_fni, EIF_PROC launch_trayclick_cb_fniii, EIF_PROC launch_file_cb_fnss,
  215. EIF_PROC launch_colorupdate_cb_fn, EIF_PROC launch_cancel_cb_fn, EIF_PROC launch_tabchange_cb_fnnn,
  216. EIF_PROC launch_tabchangepos_cb_fnii, EIF_PROC launch_tabclose_cb_fni, EIF_PROC launch_rightclick_cb_fni,
  217. EIF_PROC launch_detached_cb_fnnii, EIF_PROC launch_restored_cb_fnnii, EIF_PROC launch_openclose_cb_fni,
  218. EIF_PROC launch_extrabutton_cb_fnii, EIF_PROC launch_valuechanged_cb_fn, EIF_PROC launch_button_cb_fniiiis,
  219. EIF_PROC launch_action_fnff, EIF_PROC launch_focus_cb_fni, EIF_PROC launch_motion_cb_fniis, EIF_PROC launch_keypress_cb_fnii,
  220. EIF_PROC launch_scroll_cb_fniff, EIF_PROC launch_wheel_cb_fndiis, EIF_PROC launch_click_cb_fns,
  221. EIF_PROC launch_action_fnsii, EIF_PROC launch_caret_cb_fniii, EIF_PROC launch_dblclick_cb_fnis,
  222. EIF_PROC launch_dragdrop_cb_fniiii, EIF_PROC launch_dropdown_cb_fni, EIF_PROC launch_edit_cb_fnis,
  223. EIF_PROC launch_multiselect_cb_fns, EIF_PROC launch_spin_cb_fni, EIF_PROC launch_action_fnis,
  224. EIF_PROC launch_action_fni, EIF_PROC launch_selection_cb_fnii, EIF_PROC launch_multiselection_cb_fnpi,
  225. EIF_PROC launch_multiunselection_cb_fnpi, EIF_PROC launch_branchopen_cb_fni, EIF_PROC launch_branchclose_cb_fni,
  226. EIF_PROC launch_executeleaf_cb_fni, EIF_PROC launch_showrename_cb_fni, EIF_PROC launch_rename_cb_fnis,
  227. EIF_PROC launch_noderemoved_cb_fns, EIF_PROC launch_togglevalue_cb_fnii, EIF_PROC launch_highlight_cb_fn,
  228. EIF_PROC launch_open_cb_fn, EIF_PROC launch_menuclose_cb_fn, EIF_PROC launch_dragbegin_cb_fnii,
  229. EIF_PROC launch_dragdatasize_cb_fns, EIF_PROC launch_dragdata_cb_fnsvi, EIF_PROC launch_dragend_cb_fni,
  230. EIF_PROC launch_dropdata_cb_fnsviii, EIF_PROC launch_dropmotion_cb_fniis, EIF_PROC launch_recent_cb_fn,
  231. EIF_PROC launch_param_cb_fniv, EIF_PROC launch_flat_action_fn, EIF_PROC launch_flat_button_cb_fniiiis,
  232. EIF_PROC launch_flat_focus_cb_fni, EIF_PROC launch_flat_enterwindow_cb_fn, EIF_PROC launch_flat_leavewindow_cb_fn,
  233. EIF_PROC launch_draw_cb_fniiiiiic, EIF_PROC launch_height_cb_fni, EIF_PROC launch_hspan_cb_fnii,
  234. EIF_PROC launch_mouseclick_cb_fniiiiiis, EIF_PROC launch_mousemotion_cb_fniiiis, EIF_PROC launch_ncols_cb_fn,
  235. EIF_PROC launch_nlines_cb_fn, EIF_PROC launch_scrolling_cb_fnii, EIF_PROC launch_vspan_cb_fnii,
  236. EIF_PROC launch_width_cb_fni, EIF_PROC launch_cell_fni, EIF_PROC launch_extended_fni,
  237. EIF_PROC launch_select_fnii, EIF_PROC launch_switch_fnii, EIF_PROC launch_action_fniiiis,
  238. EIF_PROC launch_click_fniis, EIF_PROC launch_colresize_fni, EIF_PROC launch_release_fniis,
  239. EIF_PROC launch_resizematrix_fnii, EIF_PROC launch_mousemove_fnii, EIF_PROC launch_enteritem_fnii,
  240. EIF_PROC launch_leaveitem_fnii, EIF_PROC launch_scrolltop_fnii, EIF_PROC launch_bgcolor_fniivvv,
  241. EIF_PROC launch_fgcolor_fniivvv, EIF_PROC launch_font_fnii, EIF_PROC launch_type_fnii,
  242. EIF_PROC launch_dropcheck_fnii, EIF_PROC launch_translatevalue_fniis, EIF_PROC launch_togglevalue_fniii,
  243. EIF_PROC launch_drop_fnnii, EIF_PROC launch_menudrop_fnnii, EIF_PROC launch_dropselect_fniinsii,
  244. EIF_PROC launch_edition_fniiii, EIF_PROC launch_value_fnii, EIF_PROC launch_value_edit_fniis,
  245. EIF_PROC launch_mark_fnii, EIF_PROC launch_markedit_fniii, EIF_PROC launch_flat_motion_cb_fniis,
  246. EIF_PROC launch_dropshow_cb_fni, EIF_PROC launch_button_press_cb_fnd, EIF_PROC launch_button_release_cb_fnd,
  247. EIF_PROC launch_mousemove_cb_fnd, EIF_PROC launch_change_cb_fnvvv, EIF_PROC launch_drag_cb_fnvvv)
  248. {
  249. if (obj != NULL)
  250. { eif_wean (obj); }
  251. obj = eif_protect (iup_obj);
  252. //Commoncallback
  253. help_cb_Fn = launch_help_cb_fn;
  254. //Commoncallback
  255. idle_action_Fidle = launch_idle_action_fidle;
  256. //Commoncallbacks
  257. map_cb_Fn = launch_map_cb_fn;
  258. unmap_cb_Fn = launch_unmap_cb_fn;
  259. destroy_cb_Fn = launch_destroy_cb_fn;
  260. ldestroy_cb_Fn = launch_ldestroy_cb_fn;
  261. getfocus_cb_Fn = launch_getfocus_cb_fn;
  262. killfocus_cb_Fn = launch_killfocus_cb_fn;
  263. enterwindow_cb_Fn = launch_enterwindow_cb_fn;
  264. leavewindow_cb_Fn = launch_leavewindow_cb_fn;
  265. action_Fn = launch_action_fn;
  266. //Commoncallback
  267. k_any_Fni = launch_k_any_fni;
  268. //Dialogandprogressdialogcallback
  269. close_cb_Fn = launch_close_cb_fn;
  270. copydata_cb_Fnsi = launch_copydata_cb_fnsi;
  271. dropfiles_cb_Fnsiii = launch_dropfiles_cb_fnsiii;
  272. mdiactivate_cb_Fn = launch_mdiactivate_cb_fn;
  273. move_cb_Fnii = launch_move_cb_fnii;
  274. resize_cb_Fnii = launch_resize_cb_fnii;
  275. show_cb_Fni = launch_show_cb_fni;
  276. trayclick_cb_Fniii = launch_trayclick_cb_fniii;
  277. //Filedialogcallback
  278. file_cb_Fnss = launch_file_cb_fnss;
  279. //Colordialogcallback
  280. colorupdate_cb_Fn = launch_colorupdate_cb_fn;
  281. //Progressdialogcallback
  282. cancel_cb_Fn = launch_cancel_cb_fn;
  283. //Tabscallback
  284. tabchange_cb_Fnnn = launch_tabchange_cb_fnnn;
  285. tabchangepos_cb_Fnii = launch_tabchangepos_cb_fnii;
  286. tabclose_cb_Fni = launch_tabclose_cb_fni;
  287. rightclick_cb_Fni = launch_rightclick_cb_fni;
  288. //DetachedBoxcallback
  289. detached_cb_Fnnii = launch_detached_cb_fnnii;
  290. restored_cb_Fnnii = launch_restored_cb_fnnii;
  291. //Expandercallback
  292. openclose_cb_Fni = launch_openclose_cb_fni;
  293. extrabutton_cb_Fnii = launch_extrabutton_cb_fnii;
  294. //Splitcallback
  295. valuechanged_cb_Fn = launch_valuechanged_cb_fn;
  296. //Buttoncallback
  297. button_cb_Fniiiis = launch_button_cb_fniiiis;
  298. //Canvascallback
  299. action_Fnff = launch_action_fnff;
  300. focus_cb_Fni = launch_focus_cb_fni;
  301. motion_cb_Fniis = launch_motion_cb_fniis;
  302. keypress_cb_Fnii = launch_keypress_cb_fnii;
  303. scroll_cb_Fniff = launch_scroll_cb_fniff;
  304. wheel_cb_Fndiis = launch_wheel_cb_fndiis;
  305. //Linkcallback
  306. click_cb_Fns = launch_click_cb_fns;
  307. //Listcallbacks
  308. action_Fnsii = launch_action_fnsii;
  309. caret_cb_Fniii = launch_caret_cb_fniii;
  310. dblclick_cb_Fnis = launch_dblclick_cb_fnis;
  311. dragdrop_cb_Fniiii = launch_dragdrop_cb_fniiii;
  312. dropdown_cb_Fni = launch_dropdown_cb_fni;
  313. edit_cb_Fnis = launch_edit_cb_fnis;
  314. multiselect_cb_Fns = launch_multiselect_cb_fns;
  315. //Spincallback
  316. spin_cb_Fni = launch_spin_cb_fni;
  317. //Callbackfortext
  318. action_Fnis = launch_action_fnis;
  319. //Callbackfortoggle
  320. action_Fni = launch_action_fni;
  321. //Callbacksfortree
  322. selection_cb_Fnii = launch_selection_cb_fnii;
  323. multiselection_cb_Fnpi = launch_multiselection_cb_fnpi;
  324. multiunselection_cb_Fnpi = launch_multiunselection_cb_fnpi;
  325. branchopen_cb_Fni = launch_branchopen_cb_fni;
  326. branchclose_cb_Fni = launch_branchclose_cb_fni;
  327. executeleaf_cb_Fni = launch_executeleaf_cb_fni;
  328. showrename_cb_Fni = launch_showrename_cb_fni;
  329. rename_cb_Fnis = launch_rename_cb_fnis;
  330. noderemoved_cb_Fns = launch_noderemoved_cb_fns;
  331. togglevalue_cb_Fnii = launch_togglevalue_cb_fnii;
  332. //Callbacksformenuitem
  333. highlight_cb_Fn = launch_highlight_cb_fn;
  334. open_cb_Fn = launch_open_cb_fn;
  335. menuclose_cb_Fn = launch_menuclose_cb_fn;
  336. //Drag&Dropcallbacks
  337. dragbegin_cb_Fnii = launch_dragbegin_cb_fnii;
  338. dragdatasize_cb_Fns = launch_dragdatasize_cb_fns;
  339. dragdata_cb_FnsVi = launch_dragdata_cb_fnsvi;
  340. dragend_cb_Fni = launch_dragend_cb_fni;
  341. dropdata_cb_FnsViii = launch_dropdata_cb_fnsviii;
  342. dropmotion_cb_Fniis = launch_dropmotion_cb_fniis;
  343. //Menurecentfiles
  344. recent_cb_Fn = launch_recent_cb_fn;
  345. //GetParam
  346. param_cb_FniV = launch_param_cb_fniv;
  347. //Flatbutton
  348. flat_action_Fn = launch_flat_action_fn;
  349. flat_button_cb_Fniiiis = launch_flat_button_cb_fniiiis;
  350. flat_focus_cb_Fni = launch_flat_focus_cb_fni;
  351. flat_enterwindow_cb_Fn = launch_flat_enterwindow_cb_fn;
  352. flat_leavewindow_cb_Fn = launch_flat_leavewindow_cb_fn;
  353. //Cells
  354. draw_cb_Fniiiiiic = launch_draw_cb_fniiiiiic;
  355. height_cb_Fni = launch_height_cb_fni;
  356. hspan_cb_Fnii = launch_hspan_cb_fnii;
  357. mouseclick_cb_Fniiiiiis = launch_mouseclick_cb_fniiiiiis;
  358. mousemotion_cb_Fniiiis = launch_mousemotion_cb_fniiiis;
  359. ncols_cb_Fn = launch_ncols_cb_fn;
  360. nlines_cb_Fn = launch_nlines_cb_fn;
  361. scrolling_cb_Fnii = launch_scrolling_cb_fnii;
  362. vspan_cb_Fnii = launch_vspan_cb_fnii;
  363. width_cb_Fni = launch_width_cb_fni;
  364. //Colorbar
  365. cell_cb_Fni = launch_cell_fni;
  366. extended_cb_Fni = launch_extended_fni;
  367. select_cb_Fnii = launch_select_fnii;
  368. switch_cb_Fnii = launch_switch_fnii;
  369. //Matrix
  370. action_Fniiiis = launch_action_fniiiis;
  371. click_cb_Fniis = launch_click_fniis;
  372. colresize_cb_Fni = launch_colresize_fni;
  373. release_cb_Fniis = launch_release_fniis;
  374. resizematrix_cb_Fnii = launch_resizematrix_fnii;
  375. mousemove_cb_Fnii = launch_mousemove_fnii;
  376. enteritem_cb_Fnii = launch_enteritem_fnii;
  377. leaveitem_cb_Fnii = launch_leaveitem_fnii;
  378. scrolltop_cb_Fnii = launch_scrolltop_fnii;
  379. bgcolor_cb_FniiVVV = launch_bgcolor_fniivvv;
  380. fgcolor_cb_FniiVVV = launch_fgcolor_fniivvv;
  381. font_cb_Fnii = launch_font_fnii;
  382. type_cb_Fnii = launch_type_fnii;
  383. dropcheck_cb_Fnii = launch_dropcheck_fnii;
  384. translatevalue_cb_Fniis = launch_translatevalue_fniis;
  385. togglevalue_cb_Fniii = launch_togglevalue_fniii;
  386. drop_cb_Fnnii = launch_drop_fnnii;
  387. menudrop_cb_Fnnii = launch_menudrop_fnnii;
  388. dropselect_cb_Fniinsii = launch_dropselect_fniinsii;
  389. edition_cb_Fniiii = launch_edition_fniiii;
  390. value_cb_Fnii = launch_value_fnii;
  391. value_edit_cb_Fniis = launch_value_edit_fniis;
  392. mark_cb_Fnii = launch_mark_fnii;
  393. markedit_cb_Fniii = launch_markedit_fniii;
  394. //Flattabs
  395. flat_motion_cb_Fniis = launch_flat_motion_cb_fniis;
  396. //Dropbutton
  397. flat_dropshow_cb_Fni = launch_dropshow_cb_fni;
  398. //Dial
  399. button_press_cb_Fnd = launch_button_press_cb_fnd;
  400. button_release_cb_Fnd = launch_button_release_cb_fnd;
  401. mousemove_cb_Fnd = launch_mousemove_cb_fnd;
  402. //Colorbrowser
  403. change_cb_FnVVV = launch_change_cb_fnvvv;
  404. drag_cb_FnVVV = launch_drag_cb_fnvvv;
  405. }
  406. int param_action(Ihandle* dialog, int param_index, void* user_data) {
  407. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_POINTER)) param_cb_FniV) (eif_access (obj), dialog, param_index, user_data);
  408. }
  409. int get_param_dialog (const char* title, void* user_data, const char* format, int param_count, int param_extra, void** param_data) {
  410. return IupGetParamv(title, param_action, user_data, format, param_count, param_extra, param_data);
  411. }
  412. // One function for each type of event
  413. // Common callbacks
  414. int callback_idle_action(void) {
  415. return ((int (*) (EIF_REFERENCE)) idle_action_Fidle) (eif_access (obj));
  416. }
  417. void callback_help_cb(Ihandle *ih) {
  418. ((void(*) (EIF_REFERENCE, EIF_POINTER)) help_cb_Fn) (eif_access (obj), ih);
  419. }
  420. int callback_map_cb(Ihandle *ih) {
  421. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) map_cb_Fn) (eif_access (obj), ih);
  422. }
  423. int callback_unmap_cb(Ihandle *ih) {
  424. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) unmap_cb_Fn) (eif_access (obj), ih);
  425. }
  426. int callback_destroy_cb(Ihandle *ih) {
  427. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) destroy_cb_Fn) (eif_access (obj), ih);
  428. }
  429. int callback_ldestroy_cb(Ihandle *ih) {
  430. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) ldestroy_cb_Fn) (eif_access (obj), ih);
  431. }
  432. int callback_getfocus_cb(Ihandle *ih) {
  433. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) getfocus_cb_Fn) (eif_access (obj), ih);
  434. }
  435. int callback_killfocus_cb(Ihandle *ih) {
  436. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) killfocus_cb_Fn) (eif_access (obj), ih);
  437. }
  438. int callback_enterwindow_cb(Ihandle *ih) {
  439. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) enterwindow_cb_Fn) (eif_access (obj), ih);
  440. }
  441. int callback_leavewindow_cb(Ihandle *ih) {
  442. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) leavewindow_cb_Fn) (eif_access (obj), ih);
  443. }
  444. int callback_k_any(Ihandle *ih, int c) {
  445. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) k_any_Fni) (eif_access (obj), ih, c);
  446. }
  447. // Action callbacks
  448. int callback_action_Fn(Ihandle *ih) {
  449. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) action_Fn) (eif_access (obj), ih);
  450. }
  451. // Dialog and progress dialog callback
  452. int callback_close_cb(Ihandle *ih) {
  453. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) close_cb_Fn) (eif_access (obj), ih);
  454. }
  455. int callback_copydata_cb(Ihandle *ih, char* cmdLine, int size) {
  456. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_POINTER, EIF_INTEGER_32)) copydata_cb_Fnsi) (eif_access (obj), ih, cmdLine, size);
  457. }
  458. int callback_dropfiles_cb(Ihandle *ih, char* filename, int num, int x, int y) {
  459. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32)) dropfiles_cb_Fnsiii) (eif_access (obj), ih, filename, num, x, y);
  460. }
  461. int callback_mdiactivate_cb(Ihandle *ih) {
  462. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) mdiactivate_cb_Fn) (eif_access (obj), ih);
  463. }
  464. int callback_move_cb(Ihandle *ih, int x, int y) {
  465. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) move_cb_Fnii) (eif_access (obj), ih, x, y);
  466. }
  467. int callback_resize_cb(Ihandle *ih, int width, int height) {
  468. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) resize_cb_Fnii) (eif_access (obj), ih, width, height);
  469. }
  470. int callback_show_cb(Ihandle *ih, int state) {
  471. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) show_cb_Fni) (eif_access (obj), ih, state);
  472. }
  473. int callback_trayclick_cb(Ihandle *ih, int but, int pressed, int dclick) {
  474. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32)) trayclick_cb_Fniii) (eif_access (obj), ih, but, pressed, dclick);
  475. }
  476. // File dialog callback
  477. int callback_file_cb(Ihandle *ih, char* file_name, char* status) {
  478. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_POINTER, EIF_POINTER)) file_cb_Fnss) (eif_access (obj), ih, file_name, status);
  479. }
  480. // Color dialog callback
  481. int callback_colorupdate_cb (Ihandle* ih) {
  482. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) colorupdate_cb_Fn) (eif_access (obj), ih);
  483. }
  484. // Progress dialog callback
  485. int callback_cancel_cb (Ihandle* ih) {
  486. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) cancel_cb_Fn) (eif_access (obj), ih);
  487. }
  488. /*
  489. // Get param dialog callback
  490. int callback_getparam(Ihandle* dialog, int param_index, void* user_data) {
  491. return getparam_FniV(iup_object(0), dialog, param_index, user_data);
  492. }
  493. */
  494. // Tabs callbacks
  495. int callback_tabchange_cb(Ihandle *ih, Ihandle* new_tab, Ihandle* old_tab) {
  496. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_POINTER, EIF_POINTER)) tabchange_cb_Fnnn) (eif_access (obj), ih, new_tab, old_tab);
  497. }
  498. int callback_tabchangepos_cb(Ihandle *ih, int new_pos, int old_pos) {
  499. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) tabchangepos_cb_Fnii) (eif_access (obj), ih, new_pos, old_pos);
  500. }
  501. int callback_tabclose_cb(Ihandle *ih, int pos) {
  502. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) tabclose_cb_Fni) (eif_access (obj), ih, pos);
  503. }
  504. int callback_rightclick_cb(Ihandle *ih, int pos) {
  505. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) rightclick_cb_Fni) (eif_access (obj), ih, pos);
  506. }
  507. // Detach box callback
  508. int callback_detached_cb(Ihandle *ih, Ihandle *new_parent, int x, int y) {
  509. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) detached_cb_Fnnii) (eif_access (obj), ih, new_parent, x, y);
  510. }
  511. int callback_restored_cb(Ihandle *ih, Ihandle *old_parent, int x, int y) {
  512. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) restored_cb_Fnnii) (eif_access (obj), ih, old_parent, x, y);
  513. }
  514. // Expander callbacks
  515. int callback_openclose_cb(Ihandle *ih, int state) {
  516. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) openclose_cb_Fni) (eif_access (obj), ih, state);
  517. }
  518. int callback_extrabutton_cb(Ihandle *ih, Ihandle *new_parent, int button, int pressed) {
  519. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) extrabutton_cb_Fnii) (eif_access (obj), ih, new_parent, button, pressed);
  520. }
  521. // Val callback
  522. int callback_valuechanged_cb(Ihandle *ih) {
  523. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) valuechanged_cb_Fn) (eif_access (obj), ih); // Also matrix
  524. }
  525. // Button callback
  526. int callback_button_cb(Ihandle *ih, int button, int pressed, int x, int y, char* status) {
  527. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_POINTER)) button_cb_Fniiiis) (eif_access (obj), ih, button, pressed, x, y, status);
  528. }
  529. // Canvas callbacks
  530. int callback_action_Fnff(Ihandle *ih, float posx, float posy) {
  531. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_REAL_32, EIF_REAL_32)) action_Fnff) (eif_access (obj), ih, posx, posy);
  532. }
  533. // Also Dialog
  534. int callback_focus_cb(Ihandle *ih, int focus) {
  535. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) focus_cb_Fni) (eif_access (obj), ih, focus);
  536. }
  537. int callback_motion_cb(Ihandle *ih, int x, int y, char *status) {
  538. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_POINTER)) motion_cb_Fniis) (eif_access (obj), ih, x, y, status);
  539. }
  540. int callback_keypress_cb(Ihandle *ih, int c, int press) {
  541. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) keypress_cb_Fnii) (eif_access (obj), ih, c, press);
  542. }
  543. int callback_scroll_cb(Ihandle *ih, int op, float posx, float posy) {
  544. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_REAL_32, EIF_REAL_32)) scroll_cb_Fniff) (eif_access (obj), ih, op, posx, posy);
  545. }
  546. int callback_wheel_cb(Ihandle *ih, float delta, int x, int y, char *status) {
  547. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_REAL_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_POINTER)) wheel_cb_Fndiis) (eif_access (obj), ih, delta, x, y, status);
  548. }
  549. int callback_click_cb(Ihandle *ih, char *url) {
  550. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_POINTER)) click_cb_Fns) (eif_access (obj), ih, url);
  551. }
  552. // List callbacks
  553. int callback_action_Fnsii(Ihandle *ih, char *text, int item, int state) {
  554. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) action_Fnsii) (eif_access (obj), ih, text, item, state);
  555. }
  556. int callback_caret_cb(Ihandle *ih, int lin, int col, int pos) {
  557. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32)) caret_cb_Fniii) (eif_access (obj), ih, lin, col, pos);
  558. }
  559. int callback_dblclick_cb(Ihandle *ih, int item, char *text) {
  560. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_POINTER)) dblclick_cb_Fnis) (eif_access (obj), ih, item, text);
  561. }
  562. int callback_dragdrop_cb(Ihandle *ih, int drag_id, int drop_id, int isshift, int iscontrol) {
  563. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32)) dragdrop_cb_Fniiii) (eif_access (obj), ih, drag_id, drop_id, isshift, iscontrol);
  564. }
  565. int callback_dropdown_cb(Ihandle *ih, int state) {
  566. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) dropdown_cb_Fni) (eif_access (obj), ih, state);
  567. }
  568. int callback_edit_cb(Ihandle *ih, int c, char *new_value) {
  569. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_POINTER)) edit_cb_Fnis) (eif_access (obj), ih, c, new_value);
  570. }
  571. int callback_multiselect_cb(Ihandle *ih, char *value) {
  572. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_POINTER)) multiselect_cb_Fns) (eif_access (obj), ih, value);
  573. }
  574. // Spin callback
  575. int callback_spin_cb(Ihandle *ih, int inc) {
  576. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) spin_cb_Fni) (eif_access (obj), ih, inc);
  577. }
  578. // Text callback
  579. int callback_action_Fnis(Ihandle *ih, int c, char *new_value) {
  580. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_POINTER)) action_Fnis) (eif_access (obj), ih, c, new_value);
  581. }
  582. // Toggle callback
  583. int callback_action_Fni(Ihandle* ih, int state) {
  584. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) action_Fni) (eif_access (obj), ih, state);
  585. }
  586. // Tree callbacks
  587. int callback_selection_cb (Ihandle *ih, int id, int status) {
  588. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) selection_cb_Fnii) (eif_access (obj), ih, id, status);
  589. }
  590. int callback_multiselection_cb (Ihandle *ih, int* ids, int n) {
  591. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_POINTER, EIF_INTEGER_32)) multiselection_cb_Fnpi) (eif_access (obj), ih, ids, n);
  592. }
  593. int callback_multiunselection_cb (Ihandle *ih, int* ids, int n) {
  594. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_POINTER, EIF_INTEGER_32)) multiunselection_cb_Fnpi) (eif_access (obj), ih, ids, n);
  595. }
  596. int callback_branchopen_cb (Ihandle *ih, int id) {
  597. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) branchopen_cb_Fni) (eif_access (obj), ih, id);
  598. }
  599. int callback_branchclose_cb (Ihandle *ih, int id) {
  600. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) branchclose_cb_Fni) (eif_access (obj), ih, id);
  601. }
  602. int callback_executeleaf_cb (Ihandle *ih, int id) {
  603. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) executeleaf_cb_Fni) (eif_access (obj), ih, id);
  604. }
  605. int callback_showrename_cb (Ihandle *ih, int id) {
  606. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) showrename_cb_Fni) (eif_access (obj), ih, id);
  607. }
  608. int callback_rename_cb (Ihandle *ih, int id, char *title) {
  609. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_POINTER)) rename_cb_Fnis) (eif_access (obj), ih, id, title);
  610. }
  611. int callback_noderemoved_cb (Ihandle *ih, void* userdata) {
  612. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_POINTER)) noderemoved_cb_Fns) (eif_access (obj), ih, userdata);
  613. }
  614. int callback_togglevalue_cb_Fnii (Ihandle *ih, int id, int state) {
  615. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) togglevalue_cb_Fnii) (eif_access (obj), ih, id, state);
  616. }
  617. // Menu callbacks
  618. int callback_highlight_cb (Ihandle *ih) {
  619. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) highlight_cb_Fn) (eif_access (obj), ih);
  620. }
  621. int callback_open_cb (Ihandle *ih) {
  622. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) open_cb_Fn) (eif_access (obj), ih);
  623. }
  624. int callback_menuclose_cb (Ihandle *ih) {
  625. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) menuclose_cb_Fn) (eif_access (obj), ih);
  626. }
  627. // Drag&Drop callbacks
  628. int callback_dragbegin_cb (Ihandle* ih, int x, int y) {
  629. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) dragbegin_cb_Fnii) (eif_access (obj), ih, x, y);
  630. }
  631. int callback_dragdatasize_cb (Ihandle* ih, char* type) {
  632. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_POINTER)) dragdatasize_cb_Fns) (eif_access (obj), ih, type);
  633. }
  634. int callback_dragdata_cb (Ihandle* ih, char* type, void* data, int size) {
  635. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_POINTER, EIF_POINTER, EIF_INTEGER_32)) dragdata_cb_FnsVi) (eif_access (obj), ih, type, data, size);
  636. }
  637. int callback_dragend_cb (Ihandle* ih, int action) {
  638. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) dragend_cb_Fni) (eif_access (obj), ih, action);
  639. }
  640. int callback_dropdata_cb (Ihandle* ih, char* type, void* data, int size, int x, int y) {
  641. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_POINTER, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32)) dropdata_cb_FnsViii) (eif_access (obj), ih, type, data, size, x, y);
  642. }
  643. int callback_dropmotion_cb (Ihandle *ih, int x, int y, char *status) {
  644. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_POINTER)) dropmotion_cb_Fniis) (eif_access (obj), ih, x, y, status);
  645. }
  646. // Menu recent files
  647. int callback_recent_cb (Ihandle *ih) {
  648. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) recent_cb_Fn) (eif_access (obj), ih);
  649. }
  650. void config_recent_init (Ihandle* ih, Ihandle* menu, int max_recent) {
  651. IupConfigRecentInit(ih, menu, (Icallback) callback_recent_cb, max_recent);
  652. }
  653. // Flat button
  654. int callback_flat_action_Fn(Ihandle *ih) {
  655. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) flat_action_Fn) (eif_access (obj), ih);
  656. }
  657. int callback_flat_button_cb(Ihandle *ih, int button, int pressed, int x, int y, char* status) {
  658. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_POINTER)) flat_button_cb_Fniiiis) (eif_access (obj), ih, button, pressed, x, y, status);
  659. }
  660. int callback_flat_focus_cb(Ihandle *ih, int focus) {
  661. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) flat_focus_cb_Fni) (eif_access (obj), ih, focus);
  662. }
  663. int callback_flat_enterwindow_cb(Ihandle *ih) {
  664. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) flat_enterwindow_cb_Fn) (eif_access (obj), ih);
  665. }
  666. int callback_flat_leavewindow_cb(Ihandle *ih) {
  667. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) flat_leavewindow_cb_Fn) (eif_access (obj), ih);
  668. }
  669. // Cells
  670. int callback_draw_cb(Ihandle* ih, int line, int column, int xmin, int xmax, int ymin, int ymax, cdCanvas* canvas) {
  671. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_POINTER)) draw_cb_Fniiiiiic) (eif_access (obj), ih, line, column, xmin, xmax, ymin, ymax, canvas);
  672. }
  673. int callback_height_cb(Ihandle* ih, int line) {
  674. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) height_cb_Fni) (eif_access (obj), ih, line);
  675. }
  676. int callback_hspan_cb(Ihandle* ih, int line, int column) {
  677. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) hspan_cb_Fnii) (eif_access (obj), ih, line, column);
  678. }
  679. int callback_mouseclick_cb(Ihandle* ih, int button, int pressed, int line, int column, int x, int y, char* status) {
  680. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_POINTER)) mouseclick_cb_Fniiiiiis) (eif_access (obj), ih, button, pressed, line, column, x, y, status);
  681. }
  682. int callback_mousemotion_cb(Ihandle *ih, int line, int column, int x, int y, char *r) {
  683. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_POINTER)) mousemotion_cb_Fniiiis) (eif_access (obj), ih, line, column, x, y, r);
  684. }
  685. int callback_ncols_cb(Ihandle* ih) {
  686. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) ncols_cb_Fn) (eif_access (obj), ih);
  687. }
  688. int callback_nlines_cb(Ihandle* ih) {
  689. return ((int (*) (EIF_REFERENCE, EIF_POINTER)) nlines_cb_Fn) (eif_access (obj), ih);
  690. }
  691. int callback_scrolling_cb(Ihandle* ih, int line, int column) {
  692. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) scrolling_cb_Fnii) (eif_access (obj), ih, line, column);
  693. }
  694. int callback_vspan_cb(Ihandle* ih, int line, int column) {
  695. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) vspan_cb_Fnii) (eif_access (obj), ih, line, column);
  696. }
  697. int callback_width_cb(Ihandle* ih, int column) {
  698. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) width_cb_Fni) (eif_access (obj), ih, column);
  699. }
  700. // Color bar
  701. char* callback_cell_cb(Ihandle* ih, int cell) {
  702. unsigned char r, g, b;
  703. long int cl;
  704. static char str[30];
  705. cl = ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) cell_cb_Fni) (eif_access (obj), ih, cell);
  706. if (cl == -1)
  707. {
  708. return NULL;
  709. }
  710. else
  711. {
  712. cdDecodeColor(cl, &r, &g, &b);
  713. sprintf(str, "%d %d %d", (int)r, (int)g, (int)b);
  714. return str;
  715. }
  716. }
  717. int callback_extended_cb(Ihandle* ih, int cell) {
  718. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) extended_cb_Fni) (eif_access (obj), ih, cell);
  719. }
  720. int callback_select_cb(Ihandle* ih, int cell, int type) {
  721. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) select_cb_Fnii) (eif_access (obj), ih, cell, type);
  722. }
  723. int callback_switch_cb(Ihandle* ih, int prim_cell, int sec_cell) {
  724. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) switch_cb_Fnii) (eif_access (obj), ih, prim_cell, sec_cell);
  725. }
  726. // Matrix
  727. int callback_action_Fniiiis(Ihandle *ih, int key, int lin, int col, int edition, char* value) {
  728. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_POINTER)) action_Fniiiis) (eif_access (obj), ih, key, lin, col, edition, value);
  729. }
  730. int callback_click_cb_Fniis (Ihandle *ih, int lin, int col, char *status) {
  731. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_POINTER)) click_cb_Fniis) (eif_access (obj), ih, lin, col, status);
  732. }
  733. int callback_colresize_cb (Ihandle *ih, int col) {
  734. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) colresize_cb_Fni) (eif_access (obj), ih, col);
  735. }
  736. int callback_release_cb (Ihandle *ih, int lin, int col, char *status) {
  737. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_POINTER)) release_cb_Fniis) (eif_access (obj), ih, lin, col, status);
  738. }
  739. int callback_resizematrix_cb (Ihandle *ih, int width, int height) {
  740. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) resizematrix_cb_Fnii) (eif_access (obj), ih, width, height);
  741. }
  742. int callback_mousemove_cb (Ihandle *ih, int lin, int col) {
  743. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) mousemove_cb_Fnii) (eif_access (obj), ih, lin, col);
  744. }
  745. int callback_enteritem_cb (Ihandle *ih, int lin, int col) {
  746. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) enteritem_cb_Fnii) (eif_access (obj), ih, lin, col);
  747. }
  748. int callback_leaveitem_cb (Ihandle *ih, int lin, int col) {
  749. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) leaveitem_cb_Fnii) (eif_access (obj), ih, lin, col);
  750. }
  751. int callback_scrolltop_cb (Ihandle *ih, int lin, int col) {
  752. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) scrolltop_cb_Fnii) (eif_access (obj), ih, lin, col);
  753. }
  754. int callback_bgcolor_cb (Ihandle *ih, int lin, int col, int *red, int *green, int *blue) {
  755. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_POINTER, EIF_POINTER, EIF_POINTER)) bgcolor_cb_FniiVVV) (eif_access (obj), ih, lin, col, red, green, blue);
  756. }
  757. int callback_fgcolor_cb (Ihandle *ih, int lin, int col, int *red, int *green, int *blue) {
  758. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_POINTER, EIF_POINTER, EIF_POINTER)) fgcolor_cb_FniiVVV) (eif_access (obj), ih, lin, col, red, green, blue);
  759. }
  760. char* callback_font_cb (Ihandle* ih, int lin, int col) {
  761. return ((char* (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) font_cb_Fnii) (eif_access (obj), ih, lin, col);
  762. }
  763. char* callback_type_cb (Ihandle* ih, int lin, int col) {
  764. return ((char* (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) type_cb_Fnii) (eif_access (obj), ih, lin, col);
  765. }
  766. int callback_dropcheck_cb (Ihandle *ih, int lin, int col) {
  767. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) dropcheck_cb_Fnii) (eif_access (obj), ih, lin, col);
  768. }
  769. char* callback_translatevalue_cb (Ihandle* ih, int lin, int col, char* value) {
  770. return ((char* (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_POINTER)) translatevalue_cb_Fniis) (eif_access (obj), ih, lin, col, value);
  771. }
  772. int callback_togglevalue_cb_Fniii (Ihandle *ih, int lin, int col, int status) {
  773. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32)) togglevalue_cb_Fniii) (eif_access (obj), ih, lin, col, status);
  774. }
  775. int callback_drop_cb (Ihandle *ih, Ihandle *drop, int lin, int col) {
  776. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) drop_cb_Fnnii) (eif_access (obj), ih, drop, lin, col);
  777. }
  778. int callback_menudrop_cb (Ihandle *ih, Ihandle *drop, int lin, int col) {
  779. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) menudrop_cb_Fnnii) (eif_access (obj), ih, drop, lin, col);
  780. }
  781. int callback_dropselect_cb (Ihandle *ih, int lin, int col, Ihandle *drop, char *t, int i, int v) {
  782. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_POINTER, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) dropselect_cb_Fniinsii) (eif_access (obj), ih, lin, col, drop, t, i, v);
  783. }
  784. int callback_edition_cb (Ihandle *ih, int lin, int col, int mode, int update) {
  785. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32)) edition_cb_Fniiii) (eif_access (obj), ih, lin, col, mode, update);
  786. }
  787. char* callback_value_cb (Ihandle* ih, int lin, int col) {
  788. return ((char* (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) value_cb_Fnii) (eif_access (obj), ih, lin, col);
  789. }
  790. int callback_value_edit_cb (Ihandle *ih, int lin, int col, char* newval) {
  791. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_POINTER)) value_edit_cb_Fniis) (eif_access (obj), ih, lin, col, newval);
  792. }
  793. int callback_mark_cb (Ihandle* ih, int lin, int col) {
  794. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32)) mark_cb_Fnii) (eif_access (obj), ih, lin, col);
  795. }
  796. int callback_markedit_cb (Ihandle *ih, int lin, int col, int marked) {
  797. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32)) markedit_cb_Fniii) (eif_access (obj), ih, lin, col, marked);
  798. }
  799. // Flat tabs
  800. int callback_flat_motion_cb(Ihandle *ih, int x, int y, char *status) {
  801. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_POINTER)) flat_motion_cb_Fniis) (eif_access (obj), ih, x, y, status);
  802. }
  803. // Drop button
  804. int callback_flat_dropshow_cb (Ihandle *ih, int state) {
  805. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32)) flat_dropshow_cb_Fni) (eif_access (obj), ih, state);
  806. }
  807. // Dial
  808. int callback_button_press_cb (Ihandle *ih, double angle) {
  809. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_REAL_32)) button_press_cb_Fnd) (eif_access (obj), ih, angle);
  810. }
  811. int callback_button_release_cb (Ihandle *ih, double angle) {
  812. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_REAL_32)) button_release_cb_Fnd) (eif_access (obj), ih, angle);
  813. }
  814. int callback_mousemove_cb_Fnd (Ihandle *ih, double angle) {
  815. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_REAL_32)) mousemove_cb_Fnd) (eif_access (obj), ih, angle);
  816. }
  817. // Color browse
  818. int callback_change_cb (Ihandle *ih, unsigned char r, unsigned char g, unsigned char b) {
  819. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32)) change_cb_FnVVV) (eif_access (obj), ih, r, g, b);
  820. }
  821. int callback_drag_cb (Ihandle *ih, unsigned char r, unsigned char g, unsigned char b) {
  822. return ((int (*) (EIF_REFERENCE, EIF_POINTER, EIF_INTEGER_32, EIF_INTEGER_32, EIF_INTEGER_32)) drag_cb_FnVVV) (eif_access (obj), ih, r, g, b);
  823. }
  824. // Set callbacks
  825. void connect_function (const char *name, int operation) {
  826. if (strcmp("IDLE_ACTION",name) == 0)
  827. {
  828. if (operation == 1)
  829. {
  830. IupSetFunction(name, (Icallback) callback_idle_action);
  831. }
  832. else
  833. {
  834. IupSetFunction(name, NULL);
  835. }
  836. }
  837. else
  838. {
  839. printf("Unknown function.");
  840. }
  841. }
  842. void connect_callback (Ihandle* ih, const char *name, const char *type, int operation) {
  843. if (operation == 0)
  844. {
  845. IupSetCallback(ih, name, NULL);
  846. return;
  847. }
  848. if (strcmp("HELP_CB",name) == 0)
  849. {
  850. IupSetCallback(ih, name, (Icallback) callback_help_cb);
  851. }
  852. else if (strcmp("MAP_CB",name) == 0)
  853. {
  854. IupSetCallback(ih, name, (Icallback) callback_map_cb);
  855. }
  856. else if (strcmp("UNMAP_CB",name) == 0)
  857. {
  858. IupSetCallback(ih, name, (Icallback) callback_unmap_cb);
  859. }
  860. else if (strcmp("DESTROY_CB",name) == 0)
  861. {
  862. IupSetCallback(ih, name, (Icallback) callback_destroy_cb);
  863. }
  864. else if (strcmp("LDESTROY_CB",name) == 0)
  865. {
  866. IupSetCallback(ih, name, (Icallback) callback_ldestroy_cb);
  867. }
  868. else if (strcmp("GETFOCUS_CB",name) == 0)
  869. {
  870. IupSetCallback(ih, name, (Icallback) callback_getfocus_cb);
  871. }
  872. else if (strcmp("KILLFOCUS_CB",name) == 0)
  873. {
  874. IupSetCallback(ih, name, (Icallback) callback_killfocus_cb);
  875. }
  876. else if (strcmp("ENTERWINDOW_CB",name) == 0)
  877. {
  878. IupSetCallback(ih, name, (Icallback) callback_enterwindow_cb);
  879. }
  880. else if (strcmp("LEAVEWINDOW_CB",name) == 0)
  881. {
  882. IupSetCallback(ih, name, (Icallback) callback_leavewindow_cb);
  883. }
  884. else if (strcmp("K_ANY",name) == 0)
  885. {
  886. IupSetCallback(ih, name, (Icallback) callback_k_any);
  887. }
  888. else if (strcmp("ACTION",name) == 0)
  889. {
  890. if (strcmp("Fn", type) == 0)
  891. {
  892. IupSetCallback(ih, name, (Icallback) callback_action_Fn);
  893. }
  894. else if (strcmp("Fnff", type) == 0)
  895. {
  896. IupSetCallback(ih, name, (Icallback) callback_action_Fnff);
  897. }
  898. else if (strcmp("Fns", type) == 0)
  899. {
  900. IupSetCallback(ih, name, (Icallback) callback_click_cb);
  901. }
  902. else if (strcmp("Fnsii", type) == 0)
  903. {
  904. IupSetCallback(ih, name, (Icallback) callback_action_Fnsii);
  905. }
  906. else if (strcmp("Fnis", type) == 0)
  907. {
  908. IupSetCallback(ih, name, (Icallback) callback_action_Fnis);
  909. }
  910. else if (strcmp("Fni", type) == 0)
  911. {
  912. IupSetCallback(ih, name, (Icallback) callback_action_Fni);
  913. }
  914. }
  915. else if (strcmp("CLOSE_CB",name) == 0)
  916. {
  917. IupSetCallback(ih, name, (Icallback) callback_close_cb);
  918. }
  919. else if (strcmp("COPYDATA_CB",name) == 0)
  920. {
  921. IupSetCallback(ih, name, (Icallback) callback_copydata_cb);
  922. }
  923. else if (strcmp("DROPFILES_CB",name) == 0)
  924. {
  925. IupSetCallback(ih, name, (Icallback) callback_dropfiles_cb);
  926. }
  927. // Skeep CUSTOMFRAME_CB
  928. else if (strcmp("MDIACTIVATE_CB",name) == 0)
  929. {
  930. IupSetCallback(ih, name, (Icallback) callback_mdiactivate_cb);
  931. }
  932. else if (strcmp("MOVE_CB",name) == 0)
  933. {
  934. IupSetCallback(ih, name, (Icallback) callback_move_cb);
  935. }
  936. else if (strcmp("RESIZE_CB",name) == 0)
  937. {
  938. IupSetCallback(ih, name, (Icallback) callback_resize_cb);
  939. }
  940. else if (strcmp("SHOW_CB",name) == 0)
  941. {
  942. IupSetCallback(ih, name, (Icallback) callback_show_cb);
  943. }
  944. else if (strcmp("TRAYCLICK_CB",name) == 0)
  945. {
  946. IupSetCallback(ih, name, (Icallback) callback_trayclick_cb);
  947. }
  948. else if (strcmp("FILE_CB",name) == 0)
  949. {
  950. IupSetCallback(ih, name, (Icallback) callback_file_cb);
  951. }
  952. else if (strcmp("COLORUPDATE_CB",name) == 0)
  953. {
  954. IupSetCallback(ih, name, (Icallback) callback_colorupdate_cb);
  955. }
  956. else if (strcmp("CANCEL_CB",name) == 0)
  957. {
  958. IupSetCallback(ih, name, (Icallback) callback_cancel_cb);
  959. }
  960. else if (strcmp("GETPARAM",name) == 0)
  961. {
  962. }
  963. else if (strcmp("TABCHANGE_CB",name) == 0)
  964. {
  965. IupSetCallback(ih, name, (Icallback) callback_tabchange_cb);
  966. }
  967. else if (strcmp("TABCHANGEPOS_CB",name) == 0)
  968. {
  969. IupSetCallback(ih, name, (Icallback) callback_tabchangepos_cb);
  970. }
  971. else if (strcmp("TABCLOSE_CB",name) == 0)
  972. {
  973. IupSetCallback(ih, name, (Icallback) callback_tabclose_cb);
  974. }
  975. else if (strcmp("RIGHTCLICK_CB",name) == 0)
  976. {
  977. IupSetCallback(ih, name, (Icallback) callback_rightclick_cb);
  978. }
  979. else if (strcmp("DETACHED_CB",name) == 0)
  980. {
  981. IupSetCallback(ih, name, (Icallback) callback_detached_cb);
  982. }
  983. else if (strcmp("RESTORED_CB",name) == 0)
  984. {
  985. IupSetCallback(ih, name, (Icallback) callback_restored_cb);
  986. }
  987. else if (strcmp("OPENCLOSE_CB",name) == 0)
  988. {
  989. IupSetCallback(ih, name, (Icallback) callback_openclose_cb);
  990. }
  991. else if (strcmp("EXTRABUTTON_CB",name) == 0)
  992. {
  993. IupSetCallback(ih, name, (Icallback) callback_extrabutton_cb);
  994. }
  995. else if (strcmp("VALUECHANGED_CB",name) == 0)
  996. {
  997. IupSetCallback(ih, name, (Icallback) callback_valuechanged_cb);
  998. }
  999. else if (strcmp("BUTTON_CB",name) == 0)
  1000. {
  1001. IupSetCallback(ih, name, (Icallback) callback_button_cb);
  1002. }
  1003. else if (strcmp("FOCUS_CB",name) == 0)
  1004. {
  1005. IupSetCallback(ih, name, (Icallback) callback_focus_cb);
  1006. }
  1007. else if (strcmp("MOTION_CB",name) == 0)
  1008. {
  1009. IupSetCallback(ih, name, (Icallback) callback_motion_cb);
  1010. }
  1011. else if (strcmp("KEYPRESS_CB",name) == 0)
  1012. {
  1013. IupSetCallback(ih, name, (Icallback) callback_keypress_cb);
  1014. }
  1015. else if (strcmp("SCROLL_CB",name) == 0)
  1016. {
  1017. IupSetCallback(ih, name, (Icallback) callback_scroll_cb);
  1018. }
  1019. // TOUCH_CB and MULTITOUCH_CB
  1020. else if (strcmp("WHEEL_CB",name) == 0)
  1021. {
  1022. IupSetCallback(ih, name, (Icallback) callback_wheel_cb);
  1023. }
  1024. // WOM_CB
  1025. else if (strcmp("CARET_CB",name) == 0)
  1026. {
  1027. IupSetCallback(ih, name, (Icallback) callback_caret_cb);
  1028. }
  1029. else if (strcmp("DBLCLICK_CB",name) == 0)
  1030. {
  1031. IupSetCallback(ih, name, (Icallback) callback_dblclick_cb);
  1032. }
  1033. else if (strcmp("DRAGDROP_CB",name) == 0)
  1034. {
  1035. IupSetCallback(ih, name, (Icallback) callback_dragdrop_cb);
  1036. }
  1037. else if (strcmp("DROPDOWN_CB",name) == 0)
  1038. {
  1039. IupSetCallback(ih, name, (Icallback) callback_dropdown_cb);
  1040. }
  1041. else if (strcmp("EDIT_CB",name) == 0)
  1042. {
  1043. IupSetCallback(ih, name, (Icallback) callback_edit_cb);
  1044. }
  1045. else if (strcmp("MULTISELECT_CB",name) == 0)
  1046. {
  1047. IupSetCallback(ih, name, (Icallback) callback_multiselect_cb);
  1048. }
  1049. else if (strcmp("SPIN_CB",name) == 0)
  1050. {
  1051. IupSetCallback(ih, name, (Icallback) callback_spin_cb);
  1052. }
  1053. else if (strcmp("SELECTION_CB",name) == 0)
  1054. {
  1055. IupSetCallback(ih, name, (Icallback) callback_selection_cb);
  1056. }
  1057. else if (strcmp("MULTISELECTION_CB",name) == 0)
  1058. {
  1059. IupSetCallback(ih, name, (Icallback) callback_multiselection_cb);
  1060. }
  1061. else if (strcmp("MULTIUNSELECTION_CB",name) == 0)
  1062. {
  1063. IupSetCallback(ih, name, (Icallback) callback_multiunselection_cb);
  1064. }
  1065. else if (strcmp("BRANCHOPEN_CB",name) == 0)
  1066. {
  1067. IupSetCallback(ih, name, (Icallback) callback_branchopen_cb);
  1068. }
  1069. else if (strcmp("BRANCHCLOSE_CB",name) == 0)
  1070. {
  1071. IupSetCallback(ih, name, (Icallback) callback_branchclose_cb);
  1072. }
  1073. else if (strcmp("EXECUTELEAF_CB",name) == 0)
  1074. {
  1075. IupSetCallback(ih, name, (Icallback) callback_executeleaf_cb);
  1076. }
  1077. else if (strcmp("SHOWRENAME_CB",name) == 0)
  1078. {
  1079. IupSetCallback(ih, name, (Icallback) callback_showrename_cb);
  1080. }
  1081. else if (strcmp("RENAME_CB",name) == 0)
  1082. {
  1083. IupSetCallback(ih, name, (Icallback) callback_rename_cb);
  1084. }
  1085. else if (strcmp("NODEREMOVED_CB",name) == 0)
  1086. {
  1087. IupSetCallback(ih, name, (Icallback) callback_noderemoved_cb);
  1088. }
  1089. else if (strcmp("TOGGLEVALUE_CB",name) == 0)
  1090. {
  1091. if (strcmp("Fnii", type) == 0)
  1092. {
  1093. IupSetCallback(ih, name, (Icallback) callback_togglevalue_cb_Fnii);
  1094. }
  1095. // Matrix
  1096. else if (strcmp("Fniii", type) == 0)
  1097. {
  1098. IupSetCallback(ih, name, (Icallback) callback_togglevalue_cb_Fniii);
  1099. }
  1100. }
  1101. else if (strcmp("HIGHLIGHT_CB",name) == 0)
  1102. {
  1103. IupSetCallback(ih, name, (Icallback) callback_highlight_cb);
  1104. }
  1105. else if (strcmp("OPEN_CB",name) == 0)
  1106. {
  1107. IupSetCallback(ih, name, (Icallback) callback_open_cb);
  1108. }
  1109. else if (strcmp("MENUCLOSE_CB",name) == 0)
  1110. {
  1111. IupSetCallback(ih, name, (Icallback) callback_menuclose_cb);
  1112. }
  1113. else if (strcmp("DRAGBEGIN_CB",name) == 0)
  1114. {
  1115. IupSetCallback(ih, name, (Icallback) callback_dragbegin_cb);
  1116. }
  1117. else if (strcmp("DRAGDATASIZE_CB",name) == 0)
  1118. {
  1119. IupSetCallback(ih, name, (Icallback) callback_dragdatasize_cb);
  1120. }
  1121. else if (strcmp("DRAGDATA_CB",name) == 0)
  1122. {
  1123. IupSetCallback(ih, name, (Icallback) callback_dragdata_cb);
  1124. }
  1125. else if (strcmp("DRAGEND_CB",name) == 0)
  1126. {
  1127. IupSetCallback(ih, name, (Icallback) callback_dragend_cb);
  1128. }
  1129. else if (strcmp("DROPDATA_CB",name) == 0)
  1130. {
  1131. IupSetCallback(ih, name, (Icallback) callback_dropdata_cb);
  1132. }
  1133. else if (strcmp("DROPMOTION_CB",name) == 0)
  1134. {
  1135. IupSetCallback(ih, name, (Icallback) callback_dropmotion_cb);
  1136. }
  1137. else if (strcmp("FLAT_ACTION",name) == 0)
  1138. {
  1139. IupSetCallback(ih, name, (Icallback) callback_flat_action_Fn);
  1140. }
  1141. else if (strcmp("FLAT_BUTTON_CB",name) == 0)
  1142. {
  1143. IupSetCallback(ih, name, (Icallback) callback_flat_button_cb);
  1144. }
  1145. else if (strcmp("FLAT_FOCUS_CB",name) == 0)
  1146. {
  1147. IupSetCallback(ih, name, (Icallback) callback_flat_focus_cb);
  1148. }
  1149. else if (strcmp("FLAT_ENTERWINDOW_CB",name) == 0)
  1150. {
  1151. IupSetCallback(ih, name, (Icallback) callback_flat_enterwindow_cb);
  1152. }
  1153. else if (strcmp("FLAT_LEAVEWINDOW_CB",name) == 0)
  1154. {
  1155. IupSetCallback(ih, name, (Icallback) callback_flat_leavewindow_cb);
  1156. }
  1157. // Cells
  1158. else if (strcmp("DRAW_CB",name) == 0) // Also Matrix
  1159. {
  1160. IupSetCallback(ih, name, (Icallback) callback_draw_cb);
  1161. }
  1162. else if (strcmp("HEIGHT_CB",name) == 0)
  1163. {
  1164. IupSetCallback(ih, name, (Icallback) callback_height_cb);
  1165. }
  1166. else if (strcmp("HSPAN_CB",name) == 0)
  1167. {
  1168. IupSetCallback(ih, name, (Icallback) callback_hspan_cb);
  1169. }
  1170. else if (strcmp("MOUSECLICK_CB",name) == 0)
  1171. {
  1172. IupSetCallback(ih, name, (Icallback) callback_mouseclick_cb);
  1173. }
  1174. else if (strcmp("MOUSEMOTION_CB",name) == 0)
  1175. {
  1176. IupSetCallback(ih, name, (Icallback) callback_mousemotion_cb);
  1177. }
  1178. else if (strcmp("NCOLS_CB",name) == 0)
  1179. {
  1180. IupSetCallback(ih, name, (Icallback) callback_ncols_cb);
  1181. }
  1182. else if (strcmp("NLINES_CB",name) == 0)
  1183. {
  1184. IupSetCallback(ih, name, (Icallback) callback_nlines_cb);
  1185. }
  1186. else if (strcmp("SCROLLING_CB",name) == 0)
  1187. {
  1188. IupSetCallback(ih, name, (Icallback) callback_scrolling_cb);
  1189. }
  1190. else if (strcmp("VSPAN_CB",name) == 0)
  1191. {
  1192. IupSetCallback(ih, name, (Icallback) callback_vspan_cb);
  1193. }
  1194. else if (strcmp("WIDTH_CB",name) == 0)
  1195. {
  1196. IupSetCallback(ih, name, (Icallback) callback_width_cb);
  1197. }
  1198. else if (strcmp("CELL_CB",name) == 0)
  1199. {
  1200. IupSetCallback(ih, name, (Icallback) callback_cell_cb);
  1201. }
  1202. else if (strcmp("EXTENDED_CB",name) == 0)
  1203. {
  1204. IupSetCallback(ih, name, (Icallback) callback_extended_cb);
  1205. }
  1206. else if (strcmp("SELECT_CB",name) == 0)
  1207. {
  1208. IupSetCallback(ih, name, (Icallback) callback_select_cb);
  1209. }
  1210. else if (strcmp("SWITCH_CB",name) == 0)
  1211. {
  1212. IupSetCallback(ih, name, (Icallback) callback_switch_cb);
  1213. }
  1214. // Matrix (Interaction)
  1215. else if (strcmp("ACTION_CB", name) == 0)
  1216. {
  1217. if (strcmp("Fniiiis", type) == 0)
  1218. {
  1219. IupSetCallback(ih, name, (Icallback) callback_action_Fniiiis);
  1220. }
  1221. else if (strcmp("Fn", type) == 0)
  1222. {
  1223. IupSetCallback(ih, name, (Icallback) callback_action_Fn);
  1224. }
  1225. }
  1226. else if (strcmp("CLICK_CB",name) == 0)
  1227. {
  1228. IupSetCallback(ih, name, (Icallback) callback_click_cb_Fniis);
  1229. }
  1230. else if (strcmp("COLRESIZE_CB",name) == 0)
  1231. {
  1232. IupSetCallback(ih, name, (Icallback) callback_colresize_cb);
  1233. }
  1234. else if (strcmp("RELEASE_CB",name) == 0)
  1235. {
  1236. IupSetCallback(ih, name, (Icallback) callback_release_cb);
  1237. }
  1238. else if (strcmp("RESIZEMATRIX_CB",name) == 0)
  1239. {
  1240. IupSetCallback(ih, name, (Icallback) callback_resizematrix_cb);
  1241. }
  1242. else if (strcmp("MOUSEMOVE_CB",name) == 0)
  1243. {
  1244. if (strcmp("Fnd", type) == 0)
  1245. {
  1246. IupSetCallback(ih, name, (Icallback) callback_mousemove_cb_Fnd);
  1247. }
  1248. else
  1249. {
  1250. IupSetCallback(ih, name, (Icallback) callback_mousemove_cb);
  1251. }
  1252. }
  1253. else if (strcmp("ENTERITEM_CB",name) == 0)
  1254. {
  1255. IupSetCallback(ih, name, (Icallback) callback_enteritem_cb);
  1256. }
  1257. else if (strcmp("LEAVEITEM_CB",name) == 0)
  1258. {
  1259. IupSetCallback(ih, name, (Icallback) callback_leaveitem_cb);
  1260. }
  1261. else if (strcmp("SCROLLTOP_CB",name) == 0)
  1262. {
  1263. IupSetCallback(ih, name, (Icallback) callback_scrolltop_cb);
  1264. }
  1265. else if (strcmp("BGCOLOR_CB",name) == 0)
  1266. {
  1267. IupSetCallback(ih, name, (Icallback) callback_bgcolor_cb);
  1268. }
  1269. else if (strcmp("FGCOLOR_CB",name) == 0)
  1270. {
  1271. IupSetCallback(ih, name, (Icallback) callback_fgcolor_cb);
  1272. }
  1273. else if (strcmp("FONT_CB",name) == 0)
  1274. {
  1275. IupSetCallback(ih, name, (Icallback) callback_font_cb);
  1276. }
  1277. else if (strcmp("TYPE_CB",name) == 0)
  1278. {
  1279. IupSetCallback(ih, name, (Icallback) callback_type_cb);
  1280. }
  1281. else if (strcmp("DROPCHECK_CB",name) == 0)
  1282. {
  1283. IupSetCallback(ih, name, (Icallback) callback_dropcheck_cb);
  1284. }
  1285. else if (strcmp("TRANSLATEVALUE_CB",name) == 0)
  1286. {
  1287. IupSetCallback(ih, name, (Icallback) callback_translatevalue_cb);
  1288. }
  1289. else if (strcmp("DROP_CB",name) == 0)
  1290. {
  1291. IupSetCallback(ih, name, (Icallback) callback_drop_cb);
  1292. }
  1293. else if (strcmp("MENUDROP_CB",name) == 0)
  1294. {
  1295. IupSetCallback(ih, name, (Icallback) callback_menudrop_cb);
  1296. }
  1297. else if (strcmp("DROPSELECT_CB",name) == 0)
  1298. {
  1299. IupSetCallback(ih, name, (Icallback) callback_dropselect_cb);
  1300. }
  1301. else if (strcmp("EDITION_CB",name) == 0)
  1302. {
  1303. IupSetCallback(ih, name, (Icallback) callback_edition_cb);
  1304. }
  1305. else if (strcmp("VALUE_CB",name) == 0)
  1306. {
  1307. IupSetCallback(ih, name, (Icallback) callback_value_cb);
  1308. }
  1309. else if (strcmp("VALUE_EDIT_CB",name) == 0)
  1310. {
  1311. IupSetCallback(ih, name, (Icallback) callback_value_edit_cb);
  1312. }
  1313. else if (strcmp("MARK_CB",name) == 0)
  1314. {
  1315. IupSetCallback(ih, name, (Icallback) callback_mark_cb);
  1316. }
  1317. else if (strcmp("MARKEDIT_CB",name) == 0)
  1318. {
  1319. IupSetCallback(ih, name, (Icallback) callback_markedit_cb);
  1320. }
  1321. // Flat tabs
  1322. else if (strcmp("FLAT_MOTION_CB",name) == 0)
  1323. {
  1324. IupSetCallback(ih, name, (Icallback) callback_flat_motion_cb);
  1325. }
  1326. // Drop button
  1327. else if (strcmp("DROPSHOW_CB",name) == 0)
  1328. {
  1329. IupSetCallback(ih, name, (Icallback) callback_flat_dropshow_cb);
  1330. }
  1331. // Dial
  1332. else if (strcmp("BUTTON_PRESS_CB",name) == 0)
  1333. {
  1334. IupSetCallback(ih, name, (Icallback) callback_button_press_cb);
  1335. }
  1336. else if (strcmp("BUTTON_RELEASE_CB",name) == 0)
  1337. {
  1338. IupSetCallback(ih, name, (Icallback) callback_button_release_cb);
  1339. }
  1340. // Color browse
  1341. else if (strcmp("CHANGE_CB",name) == 0)
  1342. {
  1343. IupSetCallback(ih, name, (Icallback) callback_change_cb);
  1344. }
  1345. else if (strcmp("DRAG_CB",name) == 0)
  1346. {
  1347. IupSetCallback(ih, name, (Icallback) callback_drag_cb);
  1348. }
  1349. else
  1350. {
  1351. printf("Unknown function.");
  1352. }
  1353. }