gtkcommon.bmx 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200
  1. ' Copyright (c) 2006-2020 Bruce A Henderson
  2. '
  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
  19. ' THE SOFTWARE.
  20. '
  21. SuperStrict
  22. ?bmxng
  23. Import BRL.SystemDefault
  24. ?Not bmxng
  25. Import BRL.System
  26. ?
  27. Import MaxGUI.MaxGUI
  28. Import BRL.LinkedList
  29. Import BRL.Map
  30. ?linux
  31. 'Import "-L/usr/lib/x86_64-linux-gnu/"
  32. Import "-lgtk-3"
  33. Import "-lgdk-3"
  34. Import "-latk-1.0"
  35. Import "-lgio-2.0"
  36. Import "-lpangocairo-1.0"
  37. Import "-lgdk_pixbuf-2.0"
  38. Import "-lcairo-gobject"
  39. Import "-lpango-1.0"
  40. Import "-lcairo"
  41. Import "-lgobject-2.0"
  42. Import "-lglib-2.0"
  43. ?
  44. Import "gtkkeymap.bmx"
  45. Import "elist.bmx"
  46. Extern
  47. ' main loop and events
  48. Function gtk_init(argc:Int Ptr, argv:Byte Ptr Ptr Ptr)
  49. Function gtk_main_iteration_do:Int(blocking:Int)
  50. Function gtk_events_pending:Int()
  51. Function gtk_get_current_event_time:Int()
  52. ' gdkscreen
  53. Function gdk_screen_get_default:Byte Ptr()
  54. Function gdk_screen_get_width:Int(handle:Byte Ptr)
  55. Function gdk_screen_get_height:Int(handle:Byte Ptr)
  56. Function gdk_screen_get_system_visual:Byte Ptr(handle:Byte Ptr)
  57. Function gdk_screen_get_display:Byte Ptr(screen:Byte Ptr)
  58. Function gdk_screen_get_n_monitors:Int(screen:Byte Ptr)
  59. Function gdk_screen_get_monitor_scale_factor:Int(screen:Byte Ptr, monitor:Int)
  60. ' visuals
  61. Function gdk_visual_get_depth:Int(handle:Byte Ptr)
  62. ' gdkdisplay
  63. Function gdk_display_get_default:Byte Ptr()
  64. ' gdkcursor
  65. Function gdk_cursor_new_for_display:Byte Ptr(display:Byte Ptr, cursorType:Int)
  66. ' gtkmessagedialog
  67. Function gtk_message_dialog_new:Byte Ptr(parent:Byte Ptr, flags:Int, _type:Int, buttons:Int, message:Byte Ptr)
  68. ' gtkdialog
  69. Function gtk_dialog_run:Int(handle:Byte Ptr)
  70. Function gtk_dialog_add_button:Byte Ptr(handle:Byte Ptr, buttonText$z, responseId:Int)
  71. ' gtkwidget
  72. Function gtk_widget_destroy(handle:Byte Ptr)
  73. Function gtk_widget_show(handle:Byte Ptr)
  74. Function gtk_widget_hide(handle:Byte Ptr)
  75. ?bmxng
  76. Function gtk_widget_get_preferred_size(handle:Byte Ptr, minSize:GtkRequisition Var, natSize:GtkRequisition Var)
  77. Function gtk_widget_get_allocation(handle:Byte Ptr, allocation:GtkAllocation Var)
  78. Function gtk_widget_override_color(handle:Byte Ptr, state:Int, color:GdkRGBA Var)
  79. Function gtk_widget_size_allocate(handle:Byte Ptr, allocation:GtkAllocation Var)
  80. Function gtk_widget_override_background_color(handle:Byte Ptr, state:Int, color:GdkRGBA Var)
  81. ?Not bmxng
  82. Function gtk_widget_get_preferred_size(handle:Byte Ptr, minSize:Byte Ptr, natSize:Byte Ptr)
  83. Function gtk_widget_get_allocation(handle:Byte Ptr, allocation:Byte Ptr)
  84. Function gtk_widget_override_color(handle:Byte Ptr, state:Int, color:Byte Ptr)
  85. Function gtk_widget_size_allocate(handle:Byte Ptr, allocation:Byte Ptr)
  86. Function gtk_widget_override_background_color(handle:Byte Ptr, state:Int, color:Byte Ptr)
  87. ?
  88. Function gtk_widget_grab_default(handle:Byte Ptr)
  89. Function gtk_widget_set_size_request(handle:Byte Ptr, width:Int, height:Int)
  90. Function gtk_widget_remove_accelerator:Int(handle:Byte Ptr, group:Byte Ptr, key:Int, mods:Int)
  91. Function gtk_widget_add_accelerator(handle:Byte Ptr, signal:Byte Ptr, group:Byte Ptr, key:Int, mods:Int, flags:Int)
  92. Function gtk_widget_add_events(handle:Byte Ptr, events:Int)
  93. Function gtk_widget_set_tooltip_text(handle:Byte Ptr, tooltip:Byte Ptr)
  94. Function gtk_widget_set_has_tooltip(handle:Byte Ptr, value:Int)
  95. Function gtk_widget_grab_focus(handle:Byte Ptr)
  96. Function gtk_widget_queue_draw(handle:Byte Ptr)
  97. Function gtk_widget_get_state_flags:Int(handle:Byte Ptr)
  98. Function gtk_widget_get_visible:Int(handle:Byte Ptr)
  99. Function gtk_widget_set_sensitive(handle:Byte Ptr, sensitive:Int)
  100. Function gtk_widget_is_sensitive:Int(handle:Byte Ptr)
  101. Function gtk_widget_get_parent_window:Byte Ptr(handle:Byte Ptr)
  102. Function gtk_widget_get_pango_context:Byte Ptr(handle:Byte Ptr)
  103. Function gtk_widget_get_style_context:Byte Ptr(handle:Byte Ptr)
  104. Function gtk_widget_get_window:Byte Ptr(handle:Byte Ptr)
  105. Function gtk_widget_has_focus:Int(handle:Byte Ptr)
  106. ' gtkfilechooserdialog
  107. Function gtk_file_chooser_dialog_new:Byte Ptr(title:Byte Ptr, parent:Byte Ptr, action:Int, but1$z, opt1:Int, but2$z, opt2:Int, opt3:Byte Ptr)
  108. ' gtkfilechooser
  109. Function gtk_file_chooser_set_current_folder:Int(handle:Byte Ptr, filename:Byte Ptr)
  110. Function gtk_file_chooser_set_filename:Int(handle:Byte Ptr, filename:Byte Ptr)
  111. Function gtk_file_chooser_get_filename:Byte Ptr(handle:Byte Ptr)
  112. Function gtk_file_chooser_add_filter(handle:Byte Ptr, filter:Byte Ptr)
  113. ' glib
  114. Function g_free(mem:Byte Ptr)
  115. ' gobject
  116. Function g_object_unref(handle:Byte Ptr)
  117. Function g_object_set_int(handle:Byte Ptr, property:Byte Ptr, value:Int, _null:Byte Ptr=Null) = "void g_object_set(BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*) !"
  118. Function g_object_set_double(handle:Byte Ptr, property:Byte Ptr, value:Double, _null:Byte Ptr=Null) = "void g_object_set(BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*) !"
  119. Function g_value_set_string(handle:Byte Ptr, str:Byte Ptr)
  120. Function g_value_unset(handle:Byte Ptr)
  121. Function g_value_init:Byte Ptr(handle:Byte Ptr, _type:Size_T)
  122. Function g_value_set_object(handle:Byte Ptr, obj:Byte Ptr)
  123. Function g_value_get_string:Byte Ptr(handle:Byte Ptr)
  124. Function g_object_ref:Byte Ptr(handle:Byte Ptr)
  125. Function g_object_connect:Byte Ptr(gtkWidget:Byte Ptr, signalSpec:Byte Ptr, callback(widget:Byte Ptr, pspec:Byte Ptr, gadget:Object), gadget:Object, flag:Int)="g_object_connect"
  126. Function g_object_set_data(handle:Byte Ptr, key:Byte Ptr, data:Object)
  127. ' gtkfilefilter
  128. Function gtk_file_filter_new:Byte Ptr()
  129. Function gtk_file_filter_set_name(handle:Byte Ptr, name:Byte Ptr)
  130. Function gtk_file_filter_add_pattern(handle:Byte Ptr, pattern:Byte Ptr)
  131. ' pango
  132. Function pango_font_description_free(handle:Byte Ptr)
  133. Function pango_font_description_new:Byte Ptr()
  134. Function pango_font_description_set_family(handle:Byte Ptr, family:Byte Ptr)
  135. Function pango_font_description_set_weight(handle:Byte Ptr, weight:Int)
  136. Function pango_font_description_set_style(handle:Byte Ptr, style:Int)
  137. Function pango_font_description_set_absolute_size(handle:Byte Ptr, size:Double)
  138. Function pango_font_description_get_family:Byte Ptr(handle:Byte Ptr)
  139. Function pango_font_description_get_style:Int(handle:Byte Ptr)
  140. Function pango_font_description_get_weight:Int(handle:Byte Ptr)
  141. Function pango_font_description_get_size:Int(handle:Byte Ptr)
  142. Function pango_context_set_font_description(handle:Byte Ptr, desc:Byte Ptr)
  143. Function pango_context_load_fontset:Byte Ptr(handle:Byte Ptr, desc:Byte Ptr, language:Byte Ptr)
  144. Function pango_fontset_foreach(fontset:Byte Ptr, func:Int(_set:Byte Ptr, _font:Byte Ptr ,data:Object), data:Object)
  145. Function pango_font_describe:Byte Ptr(font:Byte Ptr)
  146. ' pango layout
  147. Function pango_layout_new:Byte Ptr(context:Byte Ptr)
  148. Function pango_layout_set_text(handle:Byte Ptr, Text:Byte Ptr, length:Int)
  149. Function pango_layout_get_pixel_size(handle:Byte Ptr, width:Int Ptr, height:Int Ptr)
  150. ' gdk pango
  151. Function gdk_pango_context_get:Byte Ptr()
  152. ' gtkcanvas
  153. Function gdk_x11_window_get_xid:Byte Ptr(handle:Byte Ptr)
  154. ' gtkwindow
  155. Function gtk_window_new:Byte Ptr(_type:Int)
  156. Function gtk_window_move(handle:Byte Ptr, x:Int, y:Int)
  157. Function gtk_window_set_default_size(handle:Byte Ptr, width:Int, height:Int)
  158. Function gtk_window_set_decorated(handle:Byte Ptr, setting:Int)
  159. Function gtk_window_set_resizable(handle:Byte Ptr, resizable:Int)
  160. Function gtk_window_set_type_hint(handle:Byte Ptr, hint:Int)
  161. ?bmxng
  162. Function gtk_window_set_geometry_hints(handle:Byte Ptr, widget:Byte Ptr, geometry:GdkGeometry Var, mask:Int)
  163. ?Not bmxng
  164. Function gtk_window_set_geometry_hints(handle:Byte Ptr, widget:Byte Ptr, geometry:Byte Ptr, mask:Int)
  165. ?
  166. Function gtk_window_set_transient_for(handle:Byte Ptr, parent:Byte Ptr)
  167. Function gtk_window_add_accel_group(handle:Byte Ptr, accelGroup:Byte Ptr)
  168. Function gtk_window_get_position(handle:Byte Ptr, x:Int Ptr, y:Int Ptr)
  169. Function gtk_window_resize(handle:Byte Ptr, width:Int, height:Int)
  170. Function gtk_window_deiconify(handle:Byte Ptr)
  171. Function gtk_window_unmaximize(handle:Byte Ptr)
  172. Function gtk_window_present(handle:Byte Ptr)
  173. Function gtk_window_set_icon(handle:Byte Ptr, icon:Byte Ptr)
  174. Function gtk_window_set_title(handle:Byte Ptr, title:Byte Ptr)
  175. Function gtk_window_get_title:Byte Ptr(handle:Byte Ptr)
  176. Function gtk_window_maximize(handle:Byte Ptr)
  177. Function gtk_window_iconify(handle:Byte Ptr)
  178. Function gtk_window_get_focus:Byte Ptr(handle:Byte Ptr)
  179. ' GtkBox
  180. Function gtk_box_new:Byte Ptr(orientation:Int, spacing:Int)
  181. Function gtk_box_pack_start(handle:Byte Ptr, child:Byte Ptr, expand:Int, fill:Int, padding:Int)
  182. Function gtk_box_reorder_child(handle:Byte Ptr, child:Byte Ptr, position:Int)
  183. ' GtkMenuBar
  184. Function gtk_menu_bar_new:Byte Ptr()
  185. ' GtkLayout
  186. Function gtk_layout_new:Byte Ptr(hadjustment:Byte Ptr, vadjustment:Byte Ptr)
  187. Function gtk_layout_put(handle:Byte Ptr, child:Byte Ptr, x:Int, y:Int)
  188. Function gtk_layout_move(handle:Byte Ptr, child:Byte Ptr, x:Int, y:Int)
  189. Function gtk_layout_get_bin_window:Byte Ptr(handle:Byte Ptr)
  190. ' GtkLabel
  191. Function gtk_label_new:Byte Ptr(str:Byte Ptr)
  192. Function gtk_label_set_xalign(handle:Byte Ptr, xalign:Float)
  193. Function gtk_label_set_yalign(handle:Byte Ptr, yalign:Float)
  194. Function gtk_label_set_text(handle:Byte Ptr, str:Byte Ptr)
  195. Function gtk_label_get_text:Byte Ptr(handle:Byte Ptr)
  196. Function gtk_label_set_text_with_mnemonic(handle:Byte Ptr, txt:Byte Ptr)
  197. ' GtkContainer
  198. Function gtk_container_add(handle:Byte Ptr, widget:Byte Ptr)
  199. Function gtk_container_set_resize_mode(handle:Byte Ptr, _mode:Int)
  200. Function gtk_container_remove(handle:Byte Ptr, widget:Byte Ptr)
  201. ' signals
  202. Function g_signal_cb2:Int(gtkwidget:Byte Ptr, name:Byte Ptr, callback(widget:Byte Ptr, gadget:Object), gadget:Object, destroyhandler(data:Byte Ptr, user: Byte Ptr), flag:Int) = "int g_signal_connect_data(BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, int) !"
  203. Function g_signal_cb2_ret:Int(gtkwidget:Byte Ptr, name:Byte Ptr, callback:Int(widget:Byte Ptr, gadget:Object), gadget:Object, destroyhandler(data:Byte Ptr, user: Byte Ptr), flag:Int) = "int g_signal_connect_data(BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, int) !"
  204. Function g_signal_cb3:Int(gtkwidget:Byte Ptr, name:Byte Ptr, callback(widget:Byte Ptr, event:Byte Ptr, gadget:Object), gadget:Object, destroyhandler(data:Byte Ptr, user: Byte Ptr), flag:Int) = "int g_signal_connect_data(BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, int) !"
  205. Function g_signal_cb3_ret:Int(gtkwidget:Byte Ptr, name:Byte Ptr, callback:Int(widget:Byte Ptr, event:Byte Ptr, gadget:Object), gadget:Object, destroyhandler(data:Byte Ptr, user: Byte Ptr), flag:Int) = "int g_signal_connect_data(BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, int) !"
  206. Function g_signal_cb3a_ret:Int(gtkwidget:Byte Ptr, name:Byte Ptr, callback:Int(widget:Byte Ptr, value:Int, gadget:Object), gadget:Object, destroyhandler(data:Byte Ptr, user: Byte Ptr), flag:Int) = "int g_signal_connect_data(BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, int) !"
  207. Function g_signal_cb4:Int(gtkwidget:Byte Ptr, name:Byte Ptr, callback(widget:Byte Ptr,url:Byte Ptr,stream:Byte Ptr,gadget:Object),gadget:Object,destroyhandler(data:Byte Ptr,user: Byte Ptr),flag:Int) = "int g_signal_connect_data(BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, int) !"
  208. Function g_signal_cb4a:Int(gtkwidget:Byte Ptr, name:Byte Ptr, callback:Int(widget:Byte Ptr,val1:Int,val2:Double,gadget:Object),gadget:Object,destroyhandler(data:Byte Ptr,user: Byte Ptr),flag:Int) = "int g_signal_connect_data(BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, int) !"
  209. Function g_signal_cb5:Int(gtkwidget:Byte Ptr, name:Byte Ptr, callback(widget:Byte Ptr,val1:Int,val2:Int,val3:Int,gadget:Object),gadget:Object,destroyhandler(data:Byte Ptr,user: Byte Ptr),flag:Int) = "int g_signal_connect_data(BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, int) !"
  210. Function g_signal_cb8:Int(gtkwidget:Byte Ptr, name:Byte Ptr, callback(widget:Byte Ptr,context:Byte Ptr, val1:Int,val2:Int,data:Byte Ptr,val3:Int,val4:Int,gadget:Object),gadget:Object,destroyhandler(data:Byte Ptr,user: Byte Ptr),flag:Int) = "int g_signal_connect_data(BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, int) !"
  211. Function g_signal_handler_disconnect(gtkwidget:Byte Ptr, handlerid:Long)
  212. Function g_signal_tabchange:Int(gtkwidget:Byte Ptr, name:Byte Ptr, callback(widget:Byte Ptr,a:Byte Ptr, index:Int,gadget:Object),gadget:Object,destroyhandler(data:Byte Ptr,user: Byte Ptr),flag:Int) = "int g_signal_connect_data(BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, BBBYTE*, int) !"
  213. ' accelerator groups
  214. Function gtk_accel_group_new:Byte Ptr()
  215. Function gtk_accelerator_parse(accel:Byte Ptr, key:Int Ptr, mods:Int Ptr)
  216. ' GtkMenu
  217. Function gtk_menu_popup(handle:Byte Ptr, parentMenuShell:Byte Ptr, parentMenuItem:Byte Ptr, func:Byte Ptr, data:Byte Ptr, button:Int, activateTime:Int)
  218. ' GtkMisc
  219. Function gtk_misc_set_alignment(handle:Byte Ptr, xalign:Float, yalign:Float)
  220. ' image data
  221. Function gdk_pixbuf_new_from_data:Byte Ptr(data:Byte Ptr, colorspace:Int, has_alpha:Int, bits_per_sample:Int, width:Int, height:Int, ..
  222. rowstride:Int, destroy_fn:Byte Ptr, data_fn:Byte Ptr)
  223. Function gdk_pixbuf_new_from_bytes:Byte Ptr(data:Byte Ptr, colorspace:Int, has_alpha:Int, bits_per_sample:Int, width:Int, height:Int, rowstride:Int)
  224. Function gdk_pixbuf_get_type:Size_T()
  225. Function gdk_pixbuf_copy_area(handle:Byte Ptr, sx:Int, sy:Int, width:Int, height:Int, dest:Byte Ptr, dx:Int, dy:Int)
  226. Function gdk_pixbuf_scale_simple:Byte Ptr(src:Byte Ptr, dw:Int, dh:Int, inter:Int)
  227. Function gdk_pixbuf_new:Byte Ptr(colorspace:Int, alpha:Int, bps:Int, width:Int, height:Int)
  228. Function gdk_pixbuf_copy:Byte Ptr(handle:Byte Ptr)
  229. ' GtkButton
  230. Function gtk_button_set_label(handle:Byte Ptr, label:Byte Ptr)
  231. Function gtk_button_set_use_underline(handle:Byte Ptr, useUnderline:Int)
  232. Function gtk_button_get_label:Byte Ptr(handle:Byte Ptr)
  233. Function gtk_button_new_with_label:Byte Ptr(label:Byte Ptr)
  234. Function gtk_button_set_image(handle:Byte Ptr, image:Byte Ptr)
  235. Function gtk_button_set_image_position(handle:Byte Ptr, pos:Int)
  236. ' GtkBin
  237. Function gtk_bin_get_child:Byte Ptr(handle:Byte Ptr)
  238. ' GtkToggleButton
  239. Function gtk_toggle_button_get_active:Int(handle:Byte Ptr)
  240. Function gtk_toggle_button_set_active(handle:Byte Ptr, active:Int)
  241. Function gtk_toggle_button_set_mode(handle:Byte Ptr, indicator:Int)
  242. ' GtkRadioButton
  243. Function gtk_radio_button_new_with_label:Byte Ptr(handle:Byte Ptr, label:Byte Ptr)
  244. Function gtk_radio_button_get_group:Byte Ptr(handle:Byte Ptr)
  245. ' GtkCheckButton
  246. Function gtk_check_button_new_with_label:Byte Ptr(label:Byte Ptr)
  247. ' GtkEventBox
  248. Function gtk_event_box_new:Byte Ptr()
  249. Function gtk_event_box_set_visible_window(handle:Byte Ptr, visibleWindow:Int)
  250. ' GtkSeparator
  251. Function gtk_separator_new:Byte Ptr(orientation:Int)
  252. ' GtkFrame
  253. Function gtk_frame_new:Byte Ptr(label:Byte Ptr)
  254. Function gtk_frame_set_shadow_type(handle:Byte Ptr, shadowType:Int)
  255. Function gtk_frame_set_label(handle:Byte Ptr, label:Byte Ptr)
  256. ' key values
  257. Function gdk_keyval_to_unicode:Int(keyval:Int)
  258. ' GtkEntry
  259. Function gtk_entry_new:Byte Ptr()
  260. Function gtk_entry_set_visibility(handle:Byte Ptr, visible:Int)
  261. Function gtk_entry_get_text:Byte Ptr(handle:Byte Ptr)
  262. Function gtk_entry_set_text(handle:Byte Ptr, txt:Byte Ptr)
  263. ' GtkEditable
  264. Function gtk_editable_cut_clipboard(handle:Byte Ptr)
  265. Function gtk_editable_copy_clipboard(handle:Byte Ptr)
  266. Function gtk_editable_paste_clipboard(handle:Byte Ptr)
  267. ' GtkListStore
  268. Function gtk_list_store_set_value(handle:Byte Ptr, iter:Byte Ptr, column:Int, value:Byte Ptr)
  269. Function gtk_list_store_new:Byte Ptr(COLS:Int, type1:Size_T, type2:Size_T)
  270. Function gtk_list_store_insert(handle:Byte Ptr, iter:Byte Ptr, position:Int)
  271. Function gtk_list_store_clear(handle:Byte Ptr)
  272. Function gtk_list_store_remove:Int(handle:Byte Ptr, iter:Byte Ptr)
  273. ' GtkTreeStore
  274. Function gtk_tree_store_set_value(handle:Byte Ptr, iter:Byte Ptr, column:Int, value:Byte Ptr)
  275. Function gtk_tree_store_append(handle:Byte Ptr, iter:Byte Ptr, parent:Byte Ptr)
  276. Function gtk_tree_store_insert(handle:Byte Ptr, iter:Byte Ptr, parent:Byte Ptr, position:Int)
  277. Function gtk_tree_store_remove:Int(handle:Byte Ptr, iter:Byte Ptr)
  278. Function gtk_tree_store_new:Byte Ptr(columns:Int, _type1:Size_T, _type2:Size_T)
  279. ' GtkTreeView
  280. Function gtk_tree_view_append_column:Int(handle:Byte Ptr, column:Byte Ptr)
  281. Function gtk_tree_view_new:Byte Ptr()
  282. Function gtk_tree_view_set_headers_visible(handle:Byte Ptr, visible:Int)
  283. Function gtk_tree_view_get_selection:Byte Ptr(handle:Byte Ptr)
  284. Function gtk_tree_view_set_model(handle:Byte Ptr, model:Byte Ptr)
  285. Function gtk_tree_view_get_path_at_pos:Int(handle:Byte Ptr, x:Int, y:Int, path:Byte Ptr Ptr, column:Byte Ptr Ptr, cellX:Int Ptr, celly:Int Ptr)
  286. Function gtk_tree_view_expand_row:Int(handle:Byte Ptr, path:Byte Ptr, openAll:Int)
  287. Function gtk_tree_view_collapse_row:Int(handle:Byte Ptr, path:Byte Ptr)
  288. ' GtkTreeViewColumn
  289. Function gtk_tree_view_column_new:Byte Ptr()
  290. Function gtk_tree_view_column_pack_start(handle:Byte Ptr, cell:Byte Ptr, expand:Int)
  291. Function gtk_tree_view_column_pack_end(handle:Byte Ptr, cell:Byte Ptr, expand:Int)
  292. Function gtk_tree_view_column_add_attribute(handle:Byte Ptr, renderer:Byte Ptr, attr$z, column:Int)
  293. ' GtkCellRendererPixbuf
  294. Function gtk_cell_renderer_pixbuf_new:Byte Ptr()
  295. ' GtkCellRendererText
  296. Function gtk_cell_renderer_text_new:Byte Ptr()
  297. ' GtkCellLayout
  298. Function gtk_cell_layout_clear(handle:Byte Ptr)
  299. Function gtk_cell_layout_add_attribute(handle:Byte Ptr, cell:Byte Ptr, attr$z, column:Int)
  300. Function gtk_cell_layout_pack_start(handle:Byte Ptr, cell:Byte Ptr, expand:Int)
  301. Function gtk_cell_layout_pack_end(handle:Byte Ptr, cell:Byte Ptr, expand:Int)
  302. ' GtkComboBox
  303. Function gtk_combo_box_new_with_entry:Byte Ptr()
  304. Function gtk_combo_box_new:Byte Ptr()
  305. Function gtk_combo_box_set_model(handle:Byte Ptr, model:Byte Ptr)
  306. Function gtk_combo_box_set_entry_text_column(handle:Byte Ptr, column:Int)
  307. Function gtk_combo_box_get_active:Int(handle:Byte Ptr)
  308. Function gtk_combo_box_set_active(handle:Byte Ptr, index:Int)
  309. Function gtk_combo_box_get_active_iter:Int(handle:Byte Ptr, iter:Byte Ptr)
  310. ' GtkTreeModel
  311. Function gtk_tree_model_iter_nth_child:Int(handle:Byte Ptr, iter:Byte Ptr, parent:Byte Ptr, index:Int)
  312. Function gtk_tree_model_get_value(handle:Byte Ptr, iter:Byte Ptr, column:Int, value:Byte Ptr)
  313. Function gtk_tree_model_get_string_from_iter:Byte Ptr(handle:Byte Ptr, iter:Byte Ptr)
  314. Function gtk_tree_path_to_string:Byte Ptr(handle:Byte Ptr)
  315. Function gtk_tree_path_free(handle:Byte Ptr)
  316. Function gtk_tree_path_new_from_string:Byte Ptr(path$z)
  317. Function gtk_tree_model_get_iter_from_string:Int(handle:Byte Ptr, iter:Byte Ptr, path$z)
  318. Function gtk_tree_model_get_path:Byte Ptr(handle:Byte Ptr, iter:Byte Ptr)
  319. ' GtkScrolledWindow
  320. Function gtk_scrolled_window_new:Byte Ptr(hadjustment:Byte Ptr, vadjustment:Byte Ptr)
  321. Function gtk_scrolled_window_set_policy(handle:Byte Ptr, hpolicy:Int, vpolicy:Int)
  322. ' GtkTreeSelection
  323. Function gtk_tree_selection_set_mode(handle:Byte Ptr, _type:Int)
  324. Function gtk_tree_selection_select_iter(handle:Byte Ptr, iter:Byte Ptr)
  325. Function gtk_tree_selection_unselect_iter(handle:Byte Ptr, iter:Byte Ptr)
  326. Function gtk_tree_selection_iter_is_selected:Int(handle:Byte Ptr, iter:Byte Ptr)
  327. Function gtk_tree_selection_get_selected:Int(handle:Byte Ptr, model:Byte Ptr Ptr, iter:Byte Ptr)
  328. Function gtk_tree_selection_select_path(handle:Byte Ptr, path:Byte Ptr)
  329. ' GtkRange
  330. Function gtk_range_set_range(handle:Byte Ptr, _min:Double, _max:Double)
  331. Function gtk_range_set_value(handle:Byte Ptr, value:Double)
  332. Function gtk_range_get_value:Double(handle:Byte Ptr)
  333. Function gtk_range_set_round_digits(handle:Byte Ptr, roundDigits:Int)
  334. Function gtk_range_set_increments(handle:Byte Ptr, _step:Double, _page:Double)
  335. Function gtk_range_get_adjustment:Byte Ptr(handle:Byte Ptr)
  336. ' GtkScale
  337. Function gtk_scale_new_with_range:Byte Ptr(orientation:Int, _min:Double, _max:Double, _step:Double)
  338. Function gtk_scale_set_draw_value(handle:Byte Ptr, value:Int)
  339. ' GtkScrollbar
  340. Function gtk_scrollbar_new:Byte Ptr(orientation:Int, adjustment:Byte Ptr)
  341. ' GtkAdjustment
  342. Function gtk_adjustment_set_page_size(handle:Byte Ptr, pageSize:Double)
  343. ' GtkSpinButton
  344. Function gtk_spin_button_new_with_range:Byte Ptr(_min:Double, _max:Double, _step:Double)
  345. Function gtk_spin_button_set_range(handle:Byte Ptr, _min:Double, _max:Double)
  346. Function gtk_spin_button_set_increments(handle:Byte Ptr, _step:Double, _page:Double)
  347. Function gtk_spin_button_set_value(handle:Byte Ptr, value:Double)
  348. Function gtk_spin_button_get_value:Double(handle:Byte Ptr)
  349. ' GtkProgressBar
  350. Function gtk_progress_bar_new:Byte Ptr()
  351. Function gtk_progress_bar_set_fraction(handle:Byte Ptr, fraction:Double)
  352. Function gtk_progress_bar_get_fraction:Double(handle:Byte Ptr)
  353. ' GtkToolbar
  354. Function gtk_toolbar_new:Byte Ptr()
  355. Function gtk_toolbar_set_style(handle:Byte Ptr, style:Int)
  356. Function gtk_toolbar_insert(handle:Byte Ptr, item:Byte Ptr, pos:Int)
  357. Function gtk_toolbar_get_item_index:Int(handle:Byte Ptr, item:Byte Ptr)
  358. ' GtkToolButton
  359. Function gtk_tool_button_set_label(handle:Byte Ptr, label:Byte Ptr)
  360. Function gtk_tool_button_set_icon_widget(handle:Byte Ptr, icon:Byte Ptr)
  361. Function gtk_tool_button_new:Byte Ptr(icon:Byte Ptr, label:Byte Ptr)
  362. Function gtk_tool_button_set_icon_name(handle:Byte Ptr, name$z)
  363. ' GtkToggleToolButton
  364. Function gtk_toggle_tool_button_new:Byte Ptr()
  365. Function gtk_toggle_tool_button_get_active:Int(handle:Byte Ptr)
  366. Function gtk_toggle_tool_button_set_active(handle:Byte Ptr, active:Int)
  367. ' GtkImage
  368. Function gtk_image_new_from_pixbuf:Byte Ptr(pixbuf:Byte Ptr)
  369. Function gtk_image_new:Byte Ptr()
  370. Function gtk_image_set_from_pixbuf(handle:Byte Ptr, pixbuf:Byte Ptr)
  371. Function gtk_image_clear(handle:Byte Ptr)
  372. ' GtkSeparatorToolItem
  373. Function gtk_separator_tool_item_new:Byte Ptr()
  374. ' GtkToolItem
  375. Function gtk_tool_item_set_tooltip_text(handle:Byte Ptr, txt:Byte Ptr)
  376. ' GtkNotebook
  377. Function gtk_notebook_new:Byte Ptr()
  378. Function gtk_notebook_set_scrollable(handle:Byte Ptr, scrollable:Int)
  379. Function gtk_notebook_get_nth_page:Byte Ptr(handle:Byte Ptr, page:Int)
  380. Function gtk_notebook_insert_page:Int(handle:Byte Ptr, child:Byte Ptr, label:Byte Ptr, pos:Int)
  381. Function gtk_notebook_get_tab_label:Byte Ptr(handle:Byte Ptr, child:Byte Ptr)
  382. Function gtk_notebook_get_current_page:Int(handle:Byte Ptr)
  383. Function gtk_notebook_remove_page(handle:Byte Ptr, page:Int)
  384. Function gtk_notebook_set_current_page(handle:Byte Ptr, page:Int)
  385. ' GdkWindow
  386. Function gdk_window_get_device_position:Byte Ptr(handle:Byte Ptr, device:Byte Ptr, x:Int Var, y:Int Var, mask:Int Var)
  387. Function gdk_window_set_cursor(handle:Byte Ptr, cursor:Byte Ptr)
  388. ' GdkCairo
  389. Function gdk_cairo_create:Byte Ptr(handle:Byte Ptr)
  390. Function gdk_cairo_set_source_pixbuf(handle:Byte Ptr, pixbuf:Byte Ptr, x:Double, y:Double)
  391. ' Cairo
  392. Function cairo_paint(handle:Byte Ptr)
  393. Function cairo_fill(handle:Byte Ptr)
  394. Function cairo_destroy(handle:Byte Ptr)
  395. ' atoms
  396. Function gdk_atom_intern:Byte Ptr(name:Byte Ptr, onlyIfExists:Int)
  397. ' GtkClipboard
  398. Function gtk_clipboard_get:Byte Ptr(selection:Byte Ptr)
  399. Function gtk_clipboard_set_text(handle:Byte Ptr, txt:Byte Ptr, length:Int)
  400. Function gtk_clipboard_wait_for_text:Byte Ptr(handle:Byte Ptr)
  401. ' GtkTextBuffer
  402. Function gtk_text_buffer_new:Byte Ptr(table:Byte Ptr)
  403. Function gtk_text_buffer_get_tag_table:Byte Ptr(handle:Byte Ptr)
  404. Function gtk_text_buffer_get_end_iter(handle:Byte Ptr, iter:Byte Ptr)
  405. Function gtk_text_buffer_insert(handle:Byte Ptr, iter:Byte Ptr, txt:Byte Ptr, length:Int)
  406. Function gtk_text_buffer_get_iter_at_line(handle:Byte Ptr, iter:Byte Ptr, line:Int)
  407. Function gtk_text_buffer_get_iter_at_offset(handle:Byte Ptr, iter:Byte Ptr, offset:Int)
  408. Function gtk_text_buffer_get_text:Byte Ptr(handle:Byte Ptr, _start:Byte Ptr, _end:Byte Ptr, includeHidden:Int)
  409. Function gtk_text_buffer_get_line_count:Int(handle:Byte Ptr)
  410. Function gtk_text_buffer_get_char_count:Int(handle:Byte Ptr)
  411. Function gtk_text_buffer_get_selection_bounds:Int(handle:Byte Ptr, _start:Byte Ptr, _end:Byte Ptr)
  412. Function gtk_text_buffer_set_text(handle:Byte Ptr, txt:Byte Ptr, length:Int)
  413. Function gtk_text_buffer_place_cursor(handle:Byte Ptr, where_:Byte Ptr)
  414. Function gtk_text_buffer_select_range(handle:Byte Ptr, ins:Byte Ptr, bound:Byte Ptr)
  415. Function gtk_text_buffer_cut_clipboard(handle:Byte Ptr, clipboard:Byte Ptr, editable:Int)
  416. Function gtk_text_buffer_copy_clipboard(handle:Byte Ptr, clipboard:Byte Ptr)
  417. Function gtk_text_buffer_paste_clipboard(handle:Byte Ptr, clipboard:Byte Ptr, overide:Byte Ptr, editable:Int)
  418. Function gtk_text_buffer_delete(handle:Byte Ptr, _start:Byte Ptr, _end:Byte Ptr)
  419. Function gtk_text_buffer_get_insert:Byte Ptr(handle:Byte Ptr)
  420. Function gtk_text_buffer_remove_all_tags(handle:Byte Ptr, _start:Byte Ptr, _end:Byte Ptr)
  421. Function gtk_text_buffer_apply_tag(handle:Byte Ptr, tag:Byte Ptr, _start:Byte Ptr, _end:Byte Ptr)
  422. ' GtkTextView
  423. Function gtk_text_view_new_with_buffer:Byte Ptr(handle:Byte Ptr)
  424. Function gtk_text_view_set_wrap_mode(handle:Byte Ptr, wrapMode:Int)
  425. Function gtk_text_view_set_editable(handle:Byte Ptr, setting:Int)
  426. Function gtk_text_view_scroll_to_iter(handle:Byte Ptr, iter:Byte Ptr, withinMargin:Double, useAlign:Int, xAlign:Double, yAlign:Double)
  427. Function gtk_text_view_scroll_mark_onscreen(handle:Byte Ptr, mark:Byte Ptr)
  428. Function gtk_text_view_get_tabs:Byte Ptr(handle:Byte Ptr)
  429. Function gtk_text_view_set_tabs(handle:Byte Ptr, tabs:Byte Ptr)
  430. ' GtkTextIter
  431. Function gtk_text_iter_get_line:Int(handle:Byte Ptr)
  432. Function gtk_text_iter_get_offset:Int(handle:Byte Ptr)
  433. Function gtk_text_iter_backward_char:Int(handle:Byte Ptr)
  434. ' GtkTextTagTable
  435. Function gtk_text_tag_table_lookup:Byte Ptr(handle:Byte Ptr, txt$z)
  436. ' pango tab array
  437. Function pango_tab_array_free(handle:Byte Ptr)
  438. Function pango_tab_array_new_with_positions:Byte Ptr(size:Int, pixels:Int, align:Int, pos:Int)
  439. ' GtkSeparatorMenuItem
  440. Function gtk_separator_menu_item_new:Byte Ptr()
  441. ' GtkMenuItem
  442. Function gtk_menu_item_new_with_mnemonic:Byte Ptr(label:Byte Ptr)
  443. Function gtk_menu_item_new_with_label:Byte Ptr(label:Byte Ptr)
  444. Function gtk_menu_item_set_submenu(handle:Byte Ptr, submenu:Byte Ptr)
  445. ' GtkMenu
  446. Function gtk_menu_new:Byte Ptr()
  447. ' GtkMenuShell
  448. Function gtk_menu_shell_append(handle:Byte Ptr, child:Byte Ptr)
  449. Function gtk_menu_shell_insert(handle:Byte Ptr, child:Byte Ptr, pos:Int)
  450. ' settings
  451. Function gtk_settings_set_string_property(settings:Byte Ptr, name:Byte Ptr, v_string:Byte Ptr, origin:Byte Ptr)
  452. Function gtk_settings_get_default:Byte Ptr()
  453. ' GtkCheckMenuItem
  454. Function gtk_check_menu_item_get_active:Int(handle:Byte Ptr)
  455. Function gtk_check_menu_item_new_with_mnemonic:Byte Ptr(label:Byte Ptr)
  456. Function gtk_check_menu_item_new_with_label:Byte Ptr(label:Byte Ptr)
  457. Function gtk_check_menu_item_set_active(handle:Byte Ptr, active:Int)
  458. ' GtkDrawingArea
  459. Function gtk_drawing_area_new:Byte Ptr()
  460. ' GtkIconTheme
  461. Function gtk_icon_theme_add_builtin_icon(name$z, size:Int, pixbuf:Byte Ptr)
  462. ' GtkColorSelection
  463. Function gtk_color_selection_dialog_new:Byte Ptr(title:Byte Ptr)
  464. Function gtk_color_selection_dialog_get_color_selection:Byte Ptr(handle:Byte Ptr)
  465. ?bmxng
  466. Function gtk_color_selection_set_current_rgba(handle:Byte Ptr, rgba:GdkRGBA Var)
  467. Function gtk_color_selection_get_current_rgba(handle:Byte Ptr, rgba:GdkRGBA Var)
  468. ?Not bmxng
  469. Function gtk_color_selection_set_current_rgba(handle:Byte Ptr, rgba:Byte Ptr)
  470. Function gtk_color_selection_get_current_rgba(handle:Byte Ptr, rgba:Byte Ptr)
  471. ?
  472. ' GtkFontChooserDialog
  473. Function gtk_font_chooser_dialog_new:Byte Ptr(title:Byte Ptr, parent:Byte Ptr)
  474. Function gtk_font_chooser_set_font_desc(handle:Byte Ptr, desc:Byte Ptr)
  475. Function gtk_font_chooser_get_font_desc:Byte Ptr(handle:Byte Ptr)
  476. ' GdkMonitor
  477. 'Function gdk_display_get_primary_monitor:Byte Ptr(display:Byte Ptr)
  478. ' drag n drop
  479. Function gtk_drag_dest_set(handle:Byte Ptr, flags:Int, targets:Byte Ptr, numTargets:Int, actions:Int)
  480. Function gtk_drag_dest_add_uri_targets(handle:Byte Ptr)
  481. ' glue
  482. Function bmx_gtk3_gtkdesktop_gethertz:Int()
  483. Function bmx_gtk3_gvalue_new:Byte Ptr(_type:Int)
  484. Function bmx_gtk3_gvalue_free(_value:Byte Ptr)
  485. Function bmx_gtk3_gtktreeiter_new:Byte Ptr()
  486. Function bmx_gtk3_gtktreeiter_free(handle:Byte Ptr)
  487. Function bmx_gtk3_stylecontext_get_fontdesc:Byte Ptr(handle:Byte Ptr)
  488. Function bmx_gtk3_gtktextiter_new:Byte Ptr()
  489. Function bmx_gtk3_gtktextiter_free(iter:Byte Ptr)
  490. ?bmxng
  491. Function bmx_gtk3_set_text_tag_style:Byte Ptr(handle:Byte Ptr, tag$z, _fg:GdkRGBA Var, _style:Int, _weight:Int, _under:Int, _strike:Int)
  492. Function bmx_gtk3_set_text_bg_tag:Byte Ptr(handle:Byte Ptr, tag$z, _bg:GdkRGBA Var)
  493. ?Not bmxng
  494. Function bmx_gtk3_set_text_tag_style:Byte Ptr(handle:Byte Ptr, tag$z, _fg:Byte Ptr, _style:Int, _weight:Int, _under:Int, _strike:Int)
  495. Function bmx_gtk3_set_text_bg_tag:Byte Ptr(handle:Byte Ptr, tag$z, _bg:Byte Ptr)
  496. ?
  497. ' event types
  498. Function bmx_gtk3maxgui_gdkeventbutton(event:Byte Ptr, x:Double Ptr, y:Double Ptr, button:Int Ptr)
  499. Function bmx_gtk3maxgui_gdkeventmotion(event:Byte Ptr, x:Double Ptr, y:Double Ptr, state:Int Ptr)
  500. Function bmx_gtk3maxgui_gdkeventscroll(event:Byte Ptr, x:Double Ptr, y:Double Ptr, direction:Int Ptr)
  501. Function bmx_gtk3maxgui_gdkeventkey(event:Byte Ptr, keyval:Int Ptr, state:Int Ptr)
  502. Function bmx_gtk3maxgui_gdkeventconfigure(event:Byte Ptr, x:Int Ptr, y:Int Ptr, w:Int Ptr, h:Int Ptr)
  503. Function bmx_gtk3maxgui_gdkeventwindowstate(event:Byte Ptr, state:Int Ptr)
  504. Function bmx_gtk3maxgui_gdkeventmotiondevice:Byte Ptr(event:Byte Ptr)
  505. Function bmx_gtk3_selection_data_get_uris:String[](data:Byte Ptr)
  506. End Extern
  507. ' gadget identifiers
  508. Const GTK_WINDOW:Int = 0
  509. Const GTK_BUTTON:Int = 1
  510. Const GTK_RADIOBUTTON:Int = 2
  511. Const GTK_CHECKBUTTON:Int = 3
  512. Const GTK_TOGGLEBUTTON:Int = 4
  513. Const GTK_LABEL:Int = 5
  514. Const GTK_MENUITEM:Int = 6
  515. Const GTK_TEXTFIELD:Int = 7
  516. Const GTK_TEXTAREA:Int = 8
  517. Const GTK_PANEL:Int = 9
  518. Const GTK_COMBOBOX:Int = 10
  519. Const GTK_HTMLVIEW:Int = 11
  520. Const GTK_TABBER:Int = 12
  521. Const GTK_PROGRESSBAR:Int = 13
  522. Const GTK_SCROLLBAR:Int = 14
  523. Const GTK_TRACKBAR:Int = 15
  524. Const GTK_STEPPER:Int = 16
  525. Const GTK_DESKTOP:Int = 17
  526. Const GTK_TOOLBAR:Int = 18
  527. Const GTK_LISTBOX:Int = 19
  528. Const GTK_TREEVIEW:Int = 20
  529. Const GTK_CANVAS:Int = 21
  530. ' GtkDialogFlags
  531. Const GTK_DIALOG_MODAL:Int = 0
  532. Const GTK_DIALOG_DESTROY_WITH_PARENT:Int = 1
  533. ' GtkButtonsType
  534. Const GTK_BUTTONS_NONE:Int = 0
  535. Const GTK_BUTTONS_OK:Int = 1
  536. Const GTK_BUTTONS_CLOSE:Int = 2
  537. Const GTK_BUTTONS_CANCEL:Int = 3
  538. Const GTK_BUTTONS_YES_NO:Int = 4
  539. Const GTK_BUTTONS_OK_CANCEL:Int = 5
  540. ' GtkMessageType
  541. Const GTK_MESSAGE_INFO:Int = 0
  542. Const GTK_MESSAGE_WARNING:Int = 1
  543. Const GTK_MESSAGE_QUESTION:Int = 2
  544. Const GTK_MESSAGE_ERROR:Int = 3
  545. Const GTK_MESSAGE_OTHER:Int = 4
  546. ' GtkResponseType
  547. Const GTK_RESPONSE_NONE:Int = -1
  548. Const GTK_RESPONSE_REJECT:Int = -2
  549. Const GTK_RESPONSE_ACCEPT:Int = -3
  550. Const GTK_RESPONSE_DELETE_EVENT:Int = -4
  551. Const GTK_RESPONSE_OK:Int = -5
  552. Const GTK_RESPONSE_CANCEL:Int = -6
  553. Const GTK_RESPONSE_CLOSE:Int = -7
  554. Const GTK_RESPONSE_YES:Int = -8
  555. Const GTK_RESPONSE_NO:Int = -9
  556. Const GTK_RESPONSE_APPLY:Int = -10
  557. Const GTK_RESPONSE_HELP:Int = -11
  558. ' GtkFileChooserAction
  559. Const GTK_FILE_CHOOSER_ACTION_OPEN:Int = 0
  560. Const GTK_FILE_CHOOSER_ACTION_SAVE:Int = 1
  561. Const GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER:Int = 2
  562. Const GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER:Int = 3
  563. ' PangoStyle
  564. Const PANGO_STYLE_NORMAL:Int = 0
  565. Const PANGO_STYLE_OBLIQUE:Int = 1
  566. Const PANGO_STYLE_ITALIC:Int = 2
  567. ' PangoWeight
  568. Const PANGO_WEIGHT_ULTRALIGHT:Int = 200
  569. Const PANGO_WEIGHT_LIGHT:Int = 300
  570. Const PANGO_WEIGHT_NORMAL:Int = 400
  571. Const PANGO_WEIGHT_SEMIBOLD:Int = 600
  572. Const PANGO_WEIGHT_BOLD:Int = 700
  573. Const PANGO_WEIGHT_ULTRABOLD:Int = 800
  574. Const PANGO_WEIGHT_HEAVY:Int = 900
  575. ' PangoUnderline
  576. Const PANGO_UNDERLINE_NONE:Int = 0
  577. Const PANGO_UNDERLINE_SINGLE:Int = 1
  578. Const PANGO_UNDERLINE_DOUBLE:Int = 2
  579. Const PANGO_UNDERLINE_LOW:Int = 3
  580. Const PANGO_UNDERLINE_ERROR:Int = 4
  581. ' GtkOrientation
  582. Const GTK_ORIENTATION_HORIZONTAL:Int = 0
  583. Const GTK_ORIENTATION_VERTICAL:Int = 1
  584. ' gtkwindowtype
  585. Const GTK_WINDOW_TOPLEVEL:Int = 0
  586. Const GTK_WINDOW_POPUP:Int = 1
  587. ' gtkwindowposition
  588. Const GTK_WIN_POS_NONE:Int = 0
  589. Const GTK_WIN_POS_CENTER:Int = 1
  590. Const GTK_WIN_POS_MOUSE:Int = 2
  591. Const GTK_WIN_POS_CENTER_ALWAYS:Int = 3
  592. Const GTK_WIN_POS_CENTER_ON_PARENT:Int = 4
  593. ' GdkWindowTypeHint
  594. Const GDK_WINDOW_TYPE_HINT_NORMAL:Int = 0
  595. Const GDK_WINDOW_TYPE_HINT_DIALOG:Int = 1
  596. Const GDK_WINDOW_TYPE_HINT_MENU:Int = 2
  597. Const GDK_WINDOW_TYPE_HINT_TOOLBAR:Int = 3
  598. Const GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:Int = 4
  599. Const GDK_WINDOW_TYPE_HINT_UTILITY:Int = 5
  600. Const GDK_WINDOW_TYPE_HINT_DOCK:Int = 6
  601. Const GDK_WINDOW_TYPE_HINT_DESKTOP:Int = 7
  602. Const GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU:Int= 8 ' A drop down menu (from a menubar)
  603. Const GDK_WINDOW_TYPE_HINT_POPUP_MENU:Int = 9 ' A popup menu (from Right-click)
  604. Const GDK_WINDOW_TYPE_HINT_TOOLTIP:Int = 10
  605. Const GDK_WINDOW_TYPE_HINT_NOTIFICATION:Int = 11
  606. Const GDK_WINDOW_TYPE_HINT_COMBO:Int = 12
  607. Const GDK_WINDOW_TYPE_HINT_DND:Int = 13
  608. ' GdkWindowHints
  609. Const GDK_HINT_POS:Int = 1
  610. Const GDK_HINT_MIN_SIZE:Int = 2
  611. Const GDK_HINT_MAX_SIZE:Int = 4
  612. Const GDK_HINT_BASE_SIZE:Int = 8
  613. Const GDK_HINT_ASPECT:Int = 16
  614. Const GDK_HINT_RESIZE_INC:Int = 32
  615. Const GDK_HINT_WIN_GRAVITY:Int = 64
  616. Const GDK_HINT_USER_POS:Int = 128
  617. Const GDK_HINT_USER_SIZE:Int = 256
  618. ' GdkWindowState
  619. Const GDK_WINDOW_STATE_WITHDRAWN:Int = 1 Shl 0
  620. Const GDK_WINDOW_STATE_ICONIFIED:Int = 1 Shl 1
  621. Const GDK_WINDOW_STATE_MAXIMIZED:Int = 1 Shl 2
  622. Const GDK_WINDOW_STATE_STICKY:Int = 1 Shl 3
  623. Const GDK_WINDOW_STATE_FULLSCREEN:Int = 1 Shl 4
  624. Const GDK_WINDOW_STATE_ABOVE:Int = 1 Shl 5
  625. Const GDK_WINDOW_STATE_BELOW:Int = 1 Shl 6
  626. Const GDK_WINDOW_STATE_FOCUSED:Int = 1 Shl 7
  627. Const GDK_WINDOW_STATE_TILED:Int = 1 Shl 8
  628. ' GdkColorspace
  629. Const GDK_COLORSPACE_RGB:Int = 0
  630. ' GtkStateType
  631. Const GTK_STATE_FLAG_NORMAL:Int = 0
  632. Const GTK_STATE_FLAG_ACTIVE:Int = 1
  633. Const GTK_STATE_FLAG_PRELIGHT:Int = 2
  634. Const GTK_STATE_FLAG_SELECTED:Int = 3
  635. Const GTK_STATE_FLAG_INSENSITIVE:Int = 4
  636. Const GTK_STATE_FLAG_INCONSISTENT:Int = 5
  637. Const GTK_STATE_FLAG_FOCUSED:Int = 6
  638. Const GTK_STATE_FLAG_BACKDROP:Int = 7
  639. Const GTK_STATE_FLAG_DIR_LTR:Int = 8
  640. Const GTK_STATE_FLAG_DIR_RTL:Int = 9
  641. ' GtkAccelFlags
  642. Const GTK_ACCEL_VISIBLE:Int = 1 ' display in GtkAccelLabel?
  643. Const GTK_ACCEL_LOCKED:Int = 2 ' is it removable?
  644. Const GTK_ACCEL_MASK:Int = 7
  645. Const GDK_EXPOSURE_MASK:Int = 1 Shl 1
  646. Const GDK_POINTER_MOTION_MASK:Int = 1 Shl 2
  647. Const GDK_POINTER_MOTION_HINT_MASK:Int = 1 Shl 3
  648. Const GDK_BUTTON_MOTION_MASK:Int = 1 Shl 4
  649. Const GDK_BUTTON1_MOTION_MASK:Int = 1 Shl 5
  650. Const GDK_BUTTON2_MOTION_MASK:Int = 1 Shl 6
  651. Const GDK_BUTTON3_MOTION_MASK:Int = 1 Shl 7
  652. Const GDK_BUTTON_PRESS_MASK:Int = 1 Shl 8
  653. Const GDK_BUTTON_RELEASE_MASK:Int = 1 Shl 9
  654. Const GDK_KEY_PRESS_MASK:Int = 1 Shl 10
  655. Const GDK_KEY_RELEASE_MASK:Int = 1 Shl 11
  656. Const GDK_ENTER_NOTIFY_MASK:Int = 1 Shl 12
  657. Const GDK_LEAVE_NOTIFY_MASK:Int = 1 Shl 13
  658. Const GDK_FOCUS_CHANGE_MASK:Int = 1 Shl 14
  659. Const GDK_STRUCTURE_MASK:Int = 1 Shl 15
  660. Const GDK_PROPERTY_CHANGE_MASK:Int = 1 Shl 16
  661. Const GDK_VISIBILITY_NOTIFY_MASK:Int = 1 Shl 17
  662. Const GDK_PROXIMITY_IN_MASK:Int = 1 Shl 18
  663. Const GDK_PROXIMITY_OUT_MASK:Int = 1 Shl 19
  664. Const GDK_SUBSTRUCTURE_MASK:Int = 1 Shl 20
  665. Const GDK_SCROLL_MASK:Int = 1 Shl 21
  666. Const GDK_TOUCH_MASK:Int = 1 Shl 22
  667. Const GDK_SMOOTH_SCROLL_MASK:Int = 1 Shl 23
  668. ' GtkShadowType
  669. Const GTK_SHADOW_NONE:Int = 0
  670. Const GTK_SHADOW_IN:Int = 1
  671. Const GTK_SHADOW_OUT:Int = 2
  672. Const GTK_SHADOW_ETCHED_IN:Int = 3
  673. Const GTK_SHADOW_ETCHED_OUT:Int = 4
  674. ' GType
  675. Const G_TYPE_STRING:Int = 16 Shl 2
  676. Const G_TYPE_POINTER:Int = 17 Shl 2
  677. ' GtkPolicyType
  678. Const GTK_POLICY_ALWAYS:Int = 0
  679. Const GTK_POLICY_AUTOMATIC:Int = 1
  680. Const GTK_POLICY_NEVER:Int = 2
  681. ' GtkSelectionMode
  682. Const GTK_SELECTION_NONE:Int = 0 ' Nothing can be selected
  683. Const GTK_SELECTION_SINGLE:Int = 1
  684. Const GTK_SELECTION_BROWSE:Int = 2
  685. Const GTK_SELECTION_MULTIPLE:Int = 3
  686. ' GtkResizeMode
  687. Const GTK_RESIZE_PARENT:Int = 0
  688. Const GTK_RESIZE_QUEUE:Int = 1
  689. Const GTK_RESIZE_IMMEDIATE:Int = 2
  690. ' GtkToolbarStyle
  691. Const GTK_TOOLBAR_ICONS:Int = 0
  692. Const GTK_TOOLBAR_TEXT:Int = 1
  693. Const GTK_TOOLBAR_BOTH:Int = 2
  694. Const GTK_TOOLBAR_BOTH_HORIZ:Int = 3
  695. ' GdkScrollDirection
  696. Const GDK_SCROLL_UP:Int = 0
  697. Const GDK_SCROLL_DOWN:Int = 1
  698. Const GDK_SCROLL_LEFT:Int = 2
  699. Const GDK_SCROLL_RIGHT:Int = 3
  700. Const GDK_SCROLL_SMOOTH:Int = 4
  701. ' GdkInterpType
  702. Const GDK_INTERP_NEAREST:Int = 0
  703. Const GDK_INTERP_TILES:Int = 1
  704. Const GDK_INTERP_BILINEAR:Int = 2
  705. Const GDK_INTERP_HYPER:Int = 3
  706. ' GtkPositionType
  707. Const GTK_POS_LEFT:Int = 0
  708. Const GTK_POS_RIGHT:Int = 1
  709. Const GTK_POS_TOP:Int = 2
  710. Const GTK_POS_BOTTOM:Int = 3
  711. ' GtkWrapMode
  712. Const GTK_WRAP_NONE:Int = 0
  713. Const GTK_WRAP_CHAR:Int = 1
  714. Const GTK_WRAP_WORD:Int = 2
  715. Const GTK_WRAP_WORD_CHAR:Int = 3
  716. ' PangoTabAlign
  717. Const PANGO_TAB_LEFT:Int = 0
  718. Const PANGO_TAB_RIGHT:Int = 1
  719. Const PANGO_TAB_CENTER:Int = 2
  720. Const PANGO_TAB_NUMERIC:Int = 3
  721. ' GdkCursorType
  722. Const GDK_X_CURSOR:Int = 0
  723. Const GDK_ARROW:Int = 2
  724. Const GDK_BASED_ARROW_DOWN:Int = 4
  725. Const GDK_BASED_ARROW_UP:Int = 6
  726. Const GDK_BOAT:Int = 8
  727. Const GDK_BOGOSITY:Int = 10
  728. Const GDK_BOTTOM_LEFT_CORNER:Int = 12
  729. Const GDK_BOTTOM_RIGHT_CORNER:Int = 14
  730. Const GDK_BOTTOM_SIDE:Int = 16
  731. Const GDK_BOTTOM_TEE:Int = 18
  732. Const GDK_BOX_SPIRAL:Int = 20
  733. Const GDK_CENTER_PTR:Int = 22
  734. Const GDK_CIRCLE:Int = 24
  735. Const GDK_CLOCK:Int = 26
  736. Const GDK_COFFEE_MUG:Int = 28
  737. Const GDK_CROSS:Int = 30
  738. Const GDK_CROSS_REVERSE:Int = 32
  739. Const GDK_CROSSHAIR:Int = 34
  740. Const GDK_DIAMOND_CROSS:Int = 36
  741. Const GDK_DOT:Int = 38
  742. Const GDK_DOTBOX:Int = 40
  743. Const GDK_DOUBLE_ARROW:Int = 42
  744. Const GDK_DRAFT_LARGE:Int = 44
  745. Const GDK_DRAFT_SMALL:Int = 46
  746. Const GDK_DRAPED_BOX:Int = 48
  747. Const GDK_EXCHANGE:Int = 50
  748. Const GDK_FLEUR:Int = 52
  749. Const GDK_GOBBLER:Int = 54
  750. Const GDK_GUMBY:Int = 56
  751. Const GDK_HAND1:Int = 58
  752. Const GDK_HAND2:Int = 60
  753. Const GDK_HEART:Int = 62
  754. Const GDK_ICON:Int = 64
  755. Const GDK_IRON_CROSS:Int = 66
  756. Const GDK_LEFT_PTR:Int = 68
  757. Const GDK_LEFT_SIDE:Int = 70
  758. Const GDK_LEFT_TEE:Int = 72
  759. Const GDK_LEFTBUTTON:Int = 74
  760. Const GDK_LL_ANGLE:Int = 76
  761. Const GDK_LR_ANGLE:Int = 78
  762. Const GDK_MAN:Int = 80
  763. Const GDK_MIDDLEBUTTON:Int = 82
  764. Const GDK_MOUSE:Int = 84
  765. Const GDK_PENCIL:Int = 86
  766. Const GDK_PIRATE:Int = 88
  767. Const GDK_PLUS:Int = 90
  768. Const GDK_QUESTION_ARROW:Int = 92
  769. Const GDK_RIGHT_PTR:Int = 94
  770. Const GDK_RIGHT_SIDE:Int = 96
  771. Const GDK_RIGHT_TEE:Int = 98
  772. Const GDK_RIGHTBUTTON:Int = 100
  773. Const GDK_RTL_LOGO:Int = 102
  774. Const GDK_SAILBOAT:Int = 104
  775. Const GDK_SB_DOWN_ARROW:Int = 106
  776. Const GDK_SB_H_DOUBLE_ARROW:Int = 108
  777. Const GDK_SB_LEFT_ARROW:Int = 110
  778. Const GDK_SB_RIGHT_ARROW:Int = 112
  779. Const GDK_SB_UP_ARROW:Int = 114
  780. Const GDK_SB_V_DOUBLE_ARROW:Int = 116
  781. Const GDK_SHUTTLE:Int = 118
  782. Const GDK_SIZING:Int = 120
  783. Const GDK_SPIDER:Int = 122
  784. Const GDK_SPRAYCAN:Int = 124
  785. Const GDK_STAR:Int = 126
  786. Const GDK_TARGET:Int = 128
  787. Const GDK_TCROSS:Int = 130
  788. Const GDK_TOP_LEFT_ARROW:Int = 132
  789. Const GDK_TOP_LEFT_CORNER:Int = 134
  790. Const GDK_TOP_RIGHT_CORNER:Int = 136
  791. Const GDK_TOP_SIDE:Int = 138
  792. Const GDK_TOP_TEE:Int = 140
  793. Const GDK_TREK:Int = 142
  794. Const GDK_UL_ANGLE:Int = 144
  795. Const GDK_UMBRELLA:Int = 146
  796. Const GDK_UR_ANGLE:Int = 148
  797. Const GDK_WATCH:Int = 150
  798. Const GDK_XTERM:Int = 152
  799. Const GDK_BLANK_CURSOR:Int = -2
  800. Const GDK_CURSOR_IS_PIXMAP:Int = -1
  801. ' GtkDestDefaults
  802. Const GTK_DEST_DEFAULT_MOTION:Int = 1 Shl 0
  803. Const GTK_DEST_DEFAULT_HIGHLIGHT:Int = 1 Shl 1
  804. Const GTK_DEST_DEFAULT_DROP:Int = 1 Shl 2
  805. Const GTK_DEST_DEFAULT_ALL:Int = $07
  806. ' GdkDragAction
  807. Const GDK_ACTION_DEFAULT:Int = 1 Shl 0
  808. Const GDK_ACTION_COPY:Int = 1 Shl 1
  809. Const GDK_ACTION_MOVE:Int = 1 Shl 2
  810. Const GDK_ACTION_LINK:Int = 1 Shl 3
  811. Const GDK_ACTION_PRIVATE:Int = 1 Shl 4
  812. Const GDK_ACTION_ASK:Int = 1 Shl 5
  813. ' List of application windows
  814. ' We use it for SetPointer etc.
  815. Global gtkWindows:TList = New TList
  816. ' I know... cup of cocoa anyone?
  817. Global GadgetMap:TPtrMap=New TPtrMap
  818. ' creates an Object out of an "int"
  819. Type TGTKInteger
  820. Field value:Int
  821. Function Set:TGTKInteger(value:Int)
  822. Local this:TGTKInteger = New TGTKInteger
  823. this.value = value
  824. Return this
  825. End Function
  826. Method Compare:Int(o:Object)
  827. Return value-TGTKInteger(o).value
  828. End Method
  829. End Type
  830. Type TGTKGuiFont Extends TGuiFont
  831. Field fontDesc:Byte Ptr
  832. Field context:Byte Ptr
  833. Field layout:Byte Ptr
  834. Method Delete()
  835. If fontDesc Then
  836. pango_font_description_free(fontDesc)
  837. fontDesc = Null
  838. EndIf
  839. If layout Then
  840. g_object_unref(layout)
  841. layout = Null
  842. End If
  843. If context Then
  844. g_object_unref(context)
  845. context = Null
  846. End If
  847. EndMethod
  848. Method CharWidth:Int(char:Int)
  849. If Not fontDesc Then
  850. getPangoDescriptionFromGuiFont(Self)
  851. EndIf
  852. If fontDesc Then
  853. If Not context Then
  854. context = gdk_pango_context_get()
  855. pango_context_set_font_description(context, fontDesc)
  856. layout = pango_layout_new(context)
  857. End If
  858. Local s:Byte Ptr = Chr(char).ToUTF8String()
  859. pango_layout_set_text(layout, s, 1)
  860. MemFree(s)
  861. Local w:Int
  862. pango_layout_get_pixel_size(layout, Varptr w, Null)
  863. Return w
  864. End If
  865. Return 0
  866. EndMethod
  867. EndType
  868. Rem
  869. internal: Returns a Pango font description based on a TGuiFont specification. (INTERNAL)
  870. End Rem
  871. Function getPangoDescriptionFromGuiFont(font:TGtkGuiFont)
  872. If font = Null Then
  873. Return
  874. End If
  875. If Not font.fontDesc Then
  876. Local fontdesc:Byte Ptr = pango_font_description_new()
  877. Local s:Byte Ptr = font.name.toUTF8String()
  878. pango_font_description_set_family(fontdesc, s)
  879. If font.style & FONT_BOLD Then
  880. pango_font_description_set_weight(fontdesc, PANGO_WEIGHT_BOLD)
  881. Else
  882. pango_font_description_set_weight(fontdesc, PANGO_WEIGHT_NORMAL)
  883. End If
  884. If font.style & FONT_ITALIC Then
  885. pango_font_description_set_style(fontdesc, PANGO_STYLE_ITALIC)
  886. End If
  887. pango_font_description_set_absolute_size(fontdesc, font.size * 1024)
  888. MemFree(s)
  889. font.fontDesc = fontDesc
  890. End If
  891. End Function
  892. Rem
  893. internal: Clear a cached Pango font description for a TGuiFont. (INTERNAL)
  894. End Rem
  895. Function clearPangoDescriptionCacheForGuiFont(font:TGtkGuiFont)
  896. If font.fontDesc Then
  897. pango_font_description_free(font.fontDesc)
  898. font.fontDesc = Null
  899. EndIf
  900. End Function
  901. Rem
  902. internal: Returns a TGuiFont from a pango description object. (INTERNAL)
  903. End Rem
  904. Function getGuiFontFromPangoDescription:TGuiFont(fontdesc:Byte Ptr)
  905. Local font:TGtkGuiFont = New TGTKGuiFont
  906. font.name = String.FromUTF8String(pango_font_description_get_family(fontdesc))
  907. 'font.path = ...
  908. Local ital:Int = pango_font_description_get_style(fontdesc)
  909. Local bold:Int = pango_font_description_get_weight(fontdesc)
  910. If ital = PANGO_STYLE_OBLIQUE Or ital = PANGO_STYLE_ITALIC Then
  911. font.style:| FONT_ITALIC
  912. End If
  913. If bold > PANGO_WEIGHT_NORMAL Then
  914. font.style:| FONT_BOLD
  915. End If
  916. font.size = pango_font_description_get_size(fontdesc) / 1024
  917. font.fontDesc = fontdesc
  918. Return font
  919. End Function
  920. ?bmxng
  921. Struct GdkGeometry
  922. ?Not bmxng
  923. Type GdkGeometry
  924. ?
  925. Field minWidth:Int
  926. Field minHeight:Int
  927. Field maxWidth:Int
  928. Field maxHeight:Int
  929. Field baseWidth:Int
  930. Field baseHeight:Int
  931. Field widthInc:Int
  932. Field heightInc:Int
  933. Field minAspect:Double
  934. Field maxAspect:Double
  935. Field winGravity:Int
  936. ?bmxng
  937. End Struct
  938. ?Not bmxng
  939. End Type
  940. ?
  941. ?bmxng
  942. Struct GtkRequisition
  943. Field width:Int
  944. Field height:Int
  945. End Struct
  946. ?Not bmxng
  947. Type GtkRequisition
  948. Field width:Int
  949. Field height:Int
  950. End Type
  951. ?
  952. ?bmxng
  953. Struct GdkRectangle
  954. Field x:Int
  955. Field y:Int
  956. Field width:Int
  957. Field height:Int
  958. End Struct
  959. ?Not bmxng
  960. Type GdkRectangle
  961. Field x:Int
  962. Field y:Int
  963. Field width:Int
  964. Field height:Int
  965. End Type
  966. ?
  967. ?bmxng
  968. Struct GtkAllocation
  969. Field x:Int
  970. Field y:Int
  971. Field width:Int
  972. Field height:Int
  973. End Struct
  974. ?Not bmxng
  975. Type GtkAllocation
  976. Field x:Int
  977. Field y:Int
  978. Field width:Int
  979. Field height:Int
  980. End Type
  981. ?
  982. ?bmxng
  983. Struct GdkRGBA
  984. Field red:Double
  985. Field green:Double
  986. Field blue:Double
  987. Field alpha:Double
  988. Method New(red:Double, green:Double, blue:Double, alpha:Double = 1.0)
  989. Self.red = red
  990. Self.green = green
  991. Self.blue = blue
  992. Self.alpha = alpha
  993. End Method
  994. End Struct
  995. ?Not bmxng
  996. Type GdkRGBA
  997. Field red:Double
  998. Field green:Double
  999. Field blue:Double
  1000. Field alpha:Double
  1001. Method Create:GdkRGBA(red:Double, green:Double, blue:Double, alpha:Double = 1.0)
  1002. Self.red = red
  1003. Self.green = green
  1004. Self.blue = blue
  1005. Self.alpha = alpha
  1006. Return Self
  1007. End Method
  1008. End Type
  1009. ?
  1010. Global _gtkKeysDown:Int[] = New Int[255]
  1011. ' returns True if key is already believed to be DOWN/Pressed
  1012. Function gtk3SetKeyDown:Int(key:Int)
  1013. Assert key < 255, "gtkSetKeyDown key is out of range - " + key
  1014. If _gtkKeysDown[key] Then
  1015. Return True
  1016. End If
  1017. _gtkKeysDown[key] = 1
  1018. Return False
  1019. End Function
  1020. Function gtk3SetKeyUp(key:Int)
  1021. Assert key < 255, "gtkSetKeyUp key is out of range - " + key
  1022. _gtkKeysDown[key] = 0
  1023. End Function