From c0b98b619e4648e4142f976bf9c85acd5dc1495a Mon Sep 17 00:00:00 2001
From: mollusk
Date: Fri, 25 Nov 2016 00:33:18 -0700
Subject: [PATCH] added eugtk examples
---
eugtk/examples/.httpd.css | 11 +
eugtk/examples/BEAR.ex | 845 +
eugtk/examples/GtkAboutDialog.e | 39 +
eugtk/examples/GtkCairo.e | 643 +
eugtk/examples/GtkEngine.e | 9648 +++++++
eugtk/examples/GtkEnums.e | 1514 ++
eugtk/examples/GtkEvents.e | 277 +
eugtk/examples/GtkFileSelector.e | 454 +
eugtk/examples/GtkFontSelector.e | 154 +
eugtk/examples/GtkPrinter.e | 567 +
eugtk/examples/GtkSettings.e | 305 +
eugtk/examples/GtkSourceView.plugin | 741 +
eugtk/examples/GtkWebKit.plugin | 498 +
eugtk/examples/browser.ex | 118 +
eugtk/examples/documentation/.httpd.css | 11 +
eugtk/examples/documentation/Broadway | 41 +
eugtk/examples/documentation/Glade.html | 418 +
eugtk/examples/documentation/HowItWorks.html | 1195 +
eugtk/examples/documentation/README.html | 1169 +
eugtk/examples/documentation/ServerHelp.html | 184 +
.../examples/documentation/StartingGlade.html | 271 +
.../documentation/StartingGlade2.html | 208 +
eugtk/examples/documentation/bear.html | 153 +
eugtk/examples/documentation/dialogs.html | 277 +
eugtk/examples/documentation/favicon.ico | Bin 0 -> 21230 bytes
eugtk/examples/documentation/functions.html | 253 +
eugtk/examples/documentation/guide_a.html | 1558 ++
eugtk/examples/documentation/images/bear0.png | Bin 0 -> 707879 bytes
eugtk/examples/documentation/images/bear1.png | Bin 0 -> 13264 bytes
eugtk/examples/documentation/images/bear2.png | Bin 0 -> 17660 bytes
eugtk/examples/documentation/images/bear3.png | Bin 0 -> 21145 bytes
eugtk/examples/documentation/images/bear4.png | Bin 0 -> 235528 bytes
.../examples/documentation/pango_markup.html | 267 +
eugtk/examples/documentation/platforms.html | 141 +
eugtk/examples/documentation/printing.html | 327 +
eugtk/examples/documentation/style.css | 107 +
eugtk/examples/documentation/treeviews.html | 496 +
eugtk/examples/eu.cfg | 1 +
eugtk/examples/examples/.httpd.css | 11 +
eugtk/examples/examples/README.html | 118 +
eugtk/examples/examples/audio_converter.ex | 193 +
eugtk/examples/examples/base_converter.ex | 159 +
eugtk/examples/examples/browser.ex | 118 +
eugtk/examples/examples/clown.e | 1053 +
eugtk/examples/examples/color_codes.ex | 185 +
eugtk/examples/examples/colornames.ex | 68 +
eugtk/examples/examples/eu.cfg | 1 +
eugtk/examples/examples/hangman.ex | 154 +
eugtk/examples/examples/httpd.ex | 403 +
eugtk/examples/examples/icon_E.e | 641 +
eugtk/examples/examples/icon_I.e | 544 +
eugtk/examples/examples/icon_P.e | 1041 +
eugtk/examples/examples/icons.ex | 224 +
eugtk/examples/examples/leak.ex | 56 +
eugtk/examples/examples/passwords.ex | 68 +
eugtk/examples/examples/talk.ex | 143 +
eugtk/examples/examples/task.ex | 100 +
eugtk/examples/examples/test_all.ex | 104 +
eugtk/examples/examples/test_missing.ex | 39 +
eugtk/examples/examples/webkit.ex | 153 +
eugtk/examples/examples/webserver.ex | 165 +
eugtk/examples/examples/worldflags.ex | 239 +
eugtk/examples/examples/xpm_include_test.ex | 23 +
eugtk/examples/examples/xpm_to_eu_include.ex | 141 +
eugtk/examples/glade/.httpd.css | 10 +
eugtk/examples/glade/Jessica-Alba.jpg | Bin 0 -> 36129 bytes
eugtk/examples/glade/README.html | 85 +
eugtk/examples/glade/about.e | 15 +
eugtk/examples/glade/about.glade | 36 +
.../examples/glade/accessories-calculator.png | Bin 0 -> 5347 bytes
eugtk/examples/glade/au.e | 14 +
eugtk/examples/glade/browser.ex | 118 +
eugtk/examples/glade/ca.e | 14 +
eugtk/examples/glade/calculator.ex | 122 +
eugtk/examples/glade/calculator.glade | 1027 +
eugtk/examples/glade/calendar.ex | 58 +
eugtk/examples/glade/calendar.glade | 205 +
eugtk/examples/glade/clock.ex | 32 +
eugtk/examples/glade/clock.glade | 90 +
eugtk/examples/glade/colors.ex | 18 +
eugtk/examples/glade/colors.glade | 111 +
eugtk/examples/glade/coweat2.png | Bin 0 -> 14066 bytes
eugtk/examples/glade/en.e | 14 +
eugtk/examples/glade/es.e | 14 +
eugtk/examples/glade/eu.cfg | 4 +
eugtk/examples/glade/eugtk.png | Bin 0 -> 12921 bytes
eugtk/examples/glade/euphoria.gif | Bin 0 -> 11566 bytes
eugtk/examples/glade/file.e | 88 +
eugtk/examples/glade/file.glade | 68 +
eugtk/examples/glade/fr.e | 13 +
eugtk/examples/glade/glade.svg | 1272 +
eugtk/examples/glade/gladetest1.ex | 27 +
eugtk/examples/glade/gladetest1.glade | 240 +
eugtk/examples/glade/green-terminal.png | Bin 0 -> 881 bytes
eugtk/examples/glade/gtk-logo-rgb.gif | Bin 0 -> 6271 bytes
eugtk/examples/glade/hello.ex | 48 +
eugtk/examples/glade/hello.glade | 257 +
eugtk/examples/glade/help.e | 29 +
eugtk/examples/glade/help.glade | 92 +
eugtk/examples/glade/list.ex | 46 +
eugtk/examples/glade/list.glade | 281 +
eugtk/examples/glade/main.ex | 39 +
eugtk/examples/glade/main.glade | 294 +
eugtk/examples/glade/math_eval.e | 1258 +
eugtk/examples/glade/mongoose.png | Bin 0 -> 5167 bytes
eugtk/examples/glade/paned.ex | 24 +
eugtk/examples/glade/paned.glade | 132 +
eugtk/examples/glade/pref.e | 52 +
eugtk/examples/glade/pref.glade | 188 +
eugtk/examples/glade/prefs.glade | 255 +
eugtk/examples/glade/test11.ex | 20 +
eugtk/examples/glade/test11.glade | 135 +
eugtk/examples/glade/test116.ex | 27 +
eugtk/examples/glade/test116.glade | 73 +
eugtk/examples/glade/test12.ex | 30 +
eugtk/examples/glade/test12.glade | 90 +
eugtk/examples/glade/test13.ex | 35 +
eugtk/examples/glade/test13.glade | 174 +
eugtk/examples/glade/test142.ex | 13 +
eugtk/examples/glade/test142.glade | 58 +
eugtk/examples/glade/test157.ex | 23 +
eugtk/examples/glade/test157.glade | 94 +
eugtk/examples/glade/test25.ex | 188 +
eugtk/examples/glade/test25.glade | 439 +
eugtk/examples/glade/toolbar.ex | 37 +
eugtk/examples/glade/toolbar.glade | 292 +
eugtk/examples/glade/webserver.ex | 78 +
eugtk/examples/glade/webserver.glade | 329 +
eugtk/examples/glade/widgets.ex | 102 +
eugtk/examples/glade/widgets.glade | 487 +
eugtk/examples/glade/widgets.png | Bin 0 -> 17038 bytes
eugtk/examples/glade/widgets.xml | 498 +
eugtk/examples/glade/x2.png | Bin 0 -> 215386 bytes
eugtk/examples/plug.ex | 61 +
eugtk/examples/resources/Jerry.map | Bin 0 -> 275 bytes
eugtk/examples/resources/Justin.map | 7 +
eugtk/examples/resources/README.html | 178 +
eugtk/examples/resources/a.e | 17 +
eugtk/examples/resources/apple-red.png | Bin 0 -> 3545 bytes
eugtk/examples/resources/b.e | 17 +
eugtk/examples/resources/background.jpg | Bin 0 -> 22219 bytes
eugtk/examples/resources/clown.e | 1050 +
.../examples/resources/colorcode/README.html | 20 +
eugtk/examples/resources/colorcode/bar.jpg | Bin 0 -> 613 bytes
eugtk/examples/resources/colorcode/bar0.jpg | Bin 0 -> 644 bytes
eugtk/examples/resources/colorcode/bar1.jpg | Bin 0 -> 583 bytes
eugtk/examples/resources/colorcode/bar10.jpg | Bin 0 -> 650 bytes
eugtk/examples/resources/colorcode/bar11.jpg | Bin 0 -> 658 bytes
eugtk/examples/resources/colorcode/bar2.jpg | Bin 0 -> 612 bytes
eugtk/examples/resources/colorcode/bar3.jpg | Bin 0 -> 621 bytes
eugtk/examples/resources/colorcode/bar4.jpg | Bin 0 -> 646 bytes
eugtk/examples/resources/colorcode/bar5.jpg | Bin 0 -> 658 bytes
eugtk/examples/resources/colorcode/bar6.jpg | Bin 0 -> 646 bytes
eugtk/examples/resources/colorcode/bar7.jpg | Bin 0 -> 618 bytes
eugtk/examples/resources/colorcode/bar8.jpg | Bin 0 -> 648 bytes
eugtk/examples/resources/colorcode/bar9.jpg | Bin 0 -> 654 bytes
eugtk/examples/resources/colorcode/end1.jpg | Bin 0 -> 1416 bytes
eugtk/examples/resources/colorcode/end2.jpg | Bin 0 -> 1432 bytes
eugtk/examples/resources/colorcode/end3.jpg | Bin 0 -> 1266 bytes
.../examples/resources/colorcode/leftend.jpg | Bin 0 -> 943 bytes
eugtk/examples/resources/colorcode/rcc.jpg | Bin 0 -> 11525 bytes
eugtk/examples/resources/css_multiplebgs.css | 142 +
eugtk/examples/resources/css_pixbufs.css | 76 +
eugtk/examples/resources/cssview.css | 41 +
eugtk/examples/resources/eu.cfg | 1 +
eugtk/examples/resources/flags/README.html | 19 +
.../resources/flags/flags-afghanistan.png | Bin 0 -> 1420 bytes
.../examples/resources/flags/flags-aland.png | Bin 0 -> 450 bytes
.../resources/flags/flags-albania.png | Bin 0 -> 1731 bytes
.../resources/flags/flags-alderney.png | Bin 0 -> 1351 bytes
.../resources/flags/flags-algeria.png | Bin 0 -> 983 bytes
.../resources/flags/flags-american_samoa.png | Bin 0 -> 2331 bytes
.../resources/flags/flags-andorra.png | Bin 0 -> 1394 bytes
.../examples/resources/flags/flags-angola.png | Bin 0 -> 1192 bytes
.../resources/flags/flags-anguilla.png | Bin 0 -> 2095 bytes
.../resources/flags/flags-antarctica.png | Bin 0 -> 1243 bytes
.../flags/flags-antigua_and_barbuda.png | Bin 0 -> 1745 bytes
.../resources/flags/flags-argentina.png | Bin 0 -> 727 bytes
.../resources/flags/flags-armenia.png | Bin 0 -> 251 bytes
.../examples/resources/flags/flags-aruba.png | Bin 0 -> 666 bytes
.../resources/flags/flags-australia.png | Bin 0 -> 1974 bytes
.../resources/flags/flags-austria.png | Bin 0 -> 251 bytes
.../resources/flags/flags-azerbaijan.png | Bin 0 -> 638 bytes
.../examples/resources/flags/flags-azores.png | Bin 0 -> 1584 bytes
.../resources/flags/flags-bahamas.png | Bin 0 -> 681 bytes
.../resources/flags/flags-bahrain.png | Bin 0 -> 730 bytes
.../resources/flags/flags-bangladesh.png | Bin 0 -> 771 bytes
.../resources/flags/flags-barbados.png | Bin 0 -> 815 bytes
.../resources/flags/flags-belgium.png | Bin 0 -> 276 bytes
.../examples/resources/flags/flags-belize.png | Bin 0 -> 3329 bytes
.../examples/resources/flags/flags-benin.png | Bin 0 -> 290 bytes
.../resources/flags/flags-bermuda.png | Bin 0 -> 2382 bytes
.../examples/resources/flags/flags-bhutan.png | Bin 0 -> 2661 bytes
.../resources/flags/flags-bolivia.png | Bin 0 -> 716 bytes
.../resources/flags/flags-bonaire.png | Bin 0 -> 1410 bytes
.../flags/flags-bosnia_and_herzegovina.png | Bin 0 -> 1277 bytes
.../resources/flags/flags-botswana.png | Bin 0 -> 290 bytes
.../examples/resources/flags/flags-brazil.png | Bin 0 -> 1951 bytes
.../flags-british_antarctic_territory.png | Bin 0 -> 3098 bytes
.../flags-british_indian_ocean_territory.png | Bin 0 -> 5748 bytes
.../flags/flags-british_virgin_islands.png | Bin 0 -> 2664 bytes
.../examples/resources/flags/flags-brunei.png | Bin 0 -> 2322 bytes
.../resources/flags/flags-bulgaria.png | Bin 0 -> 254 bytes
.../resources/flags/flags-burkina_faso.png | Bin 0 -> 566 bytes
.../resources/flags/flags-burundi.png | Bin 0 -> 1970 bytes
.../resources/flags/flags-cambodia.png | Bin 0 -> 1447 bytes
.../resources/flags/flags-cameroon.png | Bin 0 -> 536 bytes
.../examples/resources/flags/flags-canada.png | Bin 0 -> 838 bytes
.../resources/flags/flags-cape_verde.png | Bin 0 -> 836 bytes
.../resources/flags/flags-cayman_islands.png | Bin 0 -> 2505 bytes
.../flags/flags-central_african_republic.png | Bin 0 -> 647 bytes
eugtk/examples/resources/flags/flags-chad.png | Bin 0 -> 285 bytes
.../examples/resources/flags/flags-chile.png | Bin 0 -> 584 bytes
.../flags/flags-christmas_island.png | Bin 0 -> 2155 bytes
.../flags/flags-cocos_(keeling)_islands.png | Bin 0 -> 1717 bytes
.../resources/flags/flags-colombia.png | Bin 0 -> 273 bytes
.../resources/flags/flags-comoros.png | Bin 0 -> 1459 bytes
.../resources/flags/flags-cook_islands.png | Bin 0 -> 2798 bytes
.../resources/flags/flags-costa_rica.png | Bin 0 -> 259 bytes
.../resources/flags/flags-cote_d'ivoire.png | Bin 0 -> 278 bytes
.../resources/flags/flags-croatia.png | Bin 0 -> 1280 bytes
eugtk/examples/resources/flags/flags-cuba.png | Bin 0 -> 1090 bytes
.../examples/resources/flags/flags-cyprus.png | Bin 0 -> 1147 bytes
.../resources/flags/flags-czech_republic.png | Bin 0 -> 982 bytes
...flags-democratic_republic_of_the_congo.png | Bin 0 -> 2075 bytes
.../resources/flags/flags-denmark.png | Bin 0 -> 395 bytes
.../resources/flags/flags-djibouti.png | Bin 0 -> 1065 bytes
.../resources/flags/flags-dominica.png | Bin 0 -> 1259 bytes
.../flags/flags-dominican_republic.png | Bin 0 -> 844 bytes
.../resources/flags/flags-east_timor.png | Bin 0 -> 1393 bytes
.../resources/flags/flags-ecuador.png | Bin 0 -> 1338 bytes
.../examples/resources/flags/flags-egypt.png | Bin 0 -> 713 bytes
.../resources/flags/flags-el_salvador.png | Bin 0 -> 768 bytes
.../flags/flags-equatorial_guinea.png | Bin 0 -> 1156 bytes
.../resources/flags/flags-eritrea.png | Bin 0 -> 2181 bytes
.../resources/flags/flags-estonia.png | Bin 0 -> 254 bytes
.../resources/flags/flags-ethiopia.png | Bin 0 -> 1155 bytes
.../flags/flags-falkland_islands.png | Bin 0 -> 2563 bytes
.../resources/flags/flags-faroe_islands.png | Bin 0 -> 463 bytes
.../flags-federated_states_of_micronesia.png | Bin 0 -> 797 bytes
eugtk/examples/resources/flags/flags-fiji.png | Bin 0 -> 2237 bytes
.../resources/flags/flags-finland.png | Bin 0 -> 335 bytes
.../examples/resources/flags/flags-france.png | Bin 0 -> 280 bytes
.../flags/flags-french_polynesia.png | Bin 0 -> 1252 bytes
...gs-french_southern_and_antarctic_lands.png | Bin 0 -> 1283 bytes
.../examples/resources/flags/flags-gabon.png | Bin 0 -> 259 bytes
.../examples/resources/flags/flags-gambia.png | Bin 0 -> 283 bytes
.../resources/flags/flags-georgia.png | Bin 0 -> 912 bytes
.../resources/flags/flags-germany.png | Bin 0 -> 253 bytes
.../examples/resources/flags/flags-ghana.png | Bin 0 -> 576 bytes
.../resources/flags/flags-gibraltar.png | Bin 0 -> 1356 bytes
.../examples/resources/flags/flags-greece.png | Bin 0 -> 430 bytes
.../resources/flags/flags-greenland.png | Bin 0 -> 835 bytes
.../resources/flags/flags-grenada.png | Bin 0 -> 2013 bytes
eugtk/examples/resources/flags/flags-guam.png | Bin 0 -> 1068 bytes
.../resources/flags/flags-guatemala.png | Bin 0 -> 932 bytes
.../resources/flags/flags-guernsey.png | Bin 0 -> 628 bytes
.../resources/flags/flags-guinea-bissau.png | Bin 0 -> 582 bytes
.../examples/resources/flags/flags-guinea.png | Bin 0 -> 285 bytes
.../examples/resources/flags/flags-guyana.png | Bin 0 -> 1485 bytes
.../examples/resources/flags/flags-haiti.png | Bin 0 -> 772 bytes
eugtk/examples/resources/flags/flags-herm.png | Bin 0 -> 1306 bytes
.../resources/flags/flags-honduras.png | Bin 0 -> 416 bytes
.../resources/flags/flags-hong_kong.png | Bin 0 -> 1475 bytes
.../resources/flags/flags-hungary.png | Bin 0 -> 254 bytes
.../resources/flags/flags-iceland.png | Bin 0 -> 463 bytes
.../examples/resources/flags/flags-india.png | Bin 0 -> 757 bytes
.../resources/flags/flags-indonesia.png | Bin 0 -> 251 bytes
eugtk/examples/resources/flags/flags-iran.png | Bin 0 -> 1618 bytes
eugtk/examples/resources/flags/flags-iraq.png | Bin 0 -> 878 bytes
.../resources/flags/flags-ireland.png | Bin 0 -> 280 bytes
.../resources/flags/flags-isle_of_man.png | Bin 0 -> 1101 bytes
.../examples/resources/flags/flags-israel.png | Bin 0 -> 738 bytes
.../examples/resources/flags/flags-italy.png | Bin 0 -> 285 bytes
.../resources/flags/flags-jamaica.png | Bin 0 -> 2020 bytes
.../examples/resources/flags/flags-japan.png | Bin 0 -> 702 bytes
.../examples/resources/flags/flags-jersey.png | Bin 0 -> 2154 bytes
.../examples/resources/flags/flags-jordan.png | Bin 0 -> 1021 bytes
.../resources/flags/flags-kazakhstan.png | Bin 0 -> 1860 bytes
.../examples/resources/flags/flags-kenya.png | Bin 0 -> 1130 bytes
.../resources/flags/flags-kiribati.png | Bin 0 -> 1654 bytes
.../examples/resources/flags/flags-kosovo.png | Bin 0 -> 1488 bytes
.../examples/resources/flags/flags-kuwait.png | Bin 0 -> 497 bytes
.../resources/flags/flags-kyrgyzstan.png | Bin 0 -> 1779 bytes
eugtk/examples/resources/flags/flags-laos.png | Bin 0 -> 609 bytes
.../examples/resources/flags/flags-latvia.png | Bin 0 -> 278 bytes
.../resources/flags/flags-lebanon.png | Bin 0 -> 1242 bytes
.../resources/flags/flags-lesotho.png | Bin 0 -> 712 bytes
.../resources/flags/flags-liberia.png | Bin 0 -> 695 bytes
.../examples/resources/flags/flags-libya.png | Bin 0 -> 240 bytes
.../resources/flags/flags-liechtenstein.png | Bin 0 -> 718 bytes
.../resources/flags/flags-lithuania.png | Bin 0 -> 262 bytes
.../resources/flags/flags-luxembourg.png | Bin 0 -> 258 bytes
.../examples/resources/flags/flags-macau.png | Bin 0 -> 1381 bytes
.../resources/flags/flags-macedonia.png | Bin 0 -> 1836 bytes
.../resources/flags/flags-madagascar.png | Bin 0 -> 281 bytes
.../resources/flags/flags-madeira.png | Bin 0 -> 841 bytes
.../examples/resources/flags/flags-malawi.png | Bin 0 -> 932 bytes
.../resources/flags/flags-malaysia.png | Bin 0 -> 1125 bytes
.../resources/flags/flags-maldives.png | Bin 0 -> 656 bytes
eugtk/examples/resources/flags/flags-mali.png | Bin 0 -> 283 bytes
.../examples/resources/flags/flags-malta.png | Bin 0 -> 600 bytes
.../flags/flags-marshall_islands.png | Bin 0 -> 2427 bytes
.../resources/flags/flags-martinique.png | Bin 0 -> 2391 bytes
.../resources/flags/flags-mauritania.png | Bin 0 -> 1055 bytes
.../resources/flags/flags-mauritius.png | Bin 0 -> 291 bytes
.../examples/resources/flags/flags-mexico.png | Bin 0 -> 1124 bytes
.../resources/flags/flags-moldova.png | Bin 0 -> 1097 bytes
.../examples/resources/flags/flags-monaco.png | Bin 0 -> 251 bytes
.../resources/flags/flags-mongolia.png | Bin 0 -> 964 bytes
.../resources/flags/flags-montenegro.png | Bin 0 -> 1405 bytes
.../resources/flags/flags-montserrat.png | Bin 0 -> 2161 bytes
.../resources/flags/flags-morocco.png | Bin 0 -> 1011 bytes
.../resources/flags/flags-mozambique.png | Bin 0 -> 1289 bytes
.../resources/flags/flags-myanmar.png | Bin 0 -> 1218 bytes
.../resources/flags/flags-namibia.png | Bin 0 -> 2178 bytes
.../examples/resources/flags/flags-nauru.png | Bin 0 -> 734 bytes
.../examples/resources/flags/flags-nepal.png | Bin 0 -> 1843 bytes
.../resources/flags/flags-netherlands.png | Bin 0 -> 256 bytes
.../flags/flags-netherlands_antilles.png | Bin 0 -> 588 bytes
.../resources/flags/flags-new_zealand.png | Bin 0 -> 1795 bytes
.../resources/flags/flags-nicaragua.png | Bin 0 -> 861 bytes
.../examples/resources/flags/flags-niger.png | Bin 0 -> 509 bytes
.../resources/flags/flags-nigeria.png | Bin 0 -> 279 bytes
eugtk/examples/resources/flags/flags-niue.png | Bin 0 -> 1735 bytes
.../resources/flags/flags-norfolk_island.png | Bin 0 -> 1604 bytes
.../resources/flags/flags-north_korea.png | Bin 0 -> 934 bytes
.../flags/flags-northern_mariana_islands.png | Bin 0 -> 2843 bytes
.../examples/resources/flags/flags-norway.png | Bin 0 -> 448 bytes
eugtk/examples/resources/flags/flags-oman.png | Bin 0 -> 655 bytes
.../resources/flags/flags-pakistan.png | Bin 0 -> 1062 bytes
.../examples/resources/flags/flags-palau.png | Bin 0 -> 776 bytes
.../resources/flags/flags-palestine.png | Bin 0 -> 749 bytes
.../examples/resources/flags/flags-panama.png | Bin 0 -> 766 bytes
.../flags/flags-papua_new_guinea.png | Bin 0 -> 1879 bytes
.../resources/flags/flags-paraguay.png | Bin 0 -> 705 bytes
.../flags-people's_republic_of_china.png | Bin 0 -> 807 bytes
eugtk/examples/resources/flags/flags-peru.png | Bin 0 -> 280 bytes
.../resources/flags/flags-philippines.png | Bin 0 -> 1491 bytes
.../flags/flags-pitcairn_islands.png | Bin 0 -> 3164 bytes
.../examples/resources/flags/flags-poland.png | Bin 0 -> 251 bytes
.../resources/flags/flags-portugal.png | Bin 0 -> 1649 bytes
.../resources/flags/flags-puerto_rico.png | Bin 0 -> 1101 bytes
.../examples/resources/flags/flags-qatar.png | Bin 0 -> 417 bytes
.../flags/flags-republic_of_china.png | Bin 0 -> 864 bytes
.../flags/flags-republic_of_the_congo.png | Bin 0 -> 1075 bytes
.../resources/flags/flags-romania.png | Bin 0 -> 285 bytes
.../examples/resources/flags/flags-russia.png | Bin 0 -> 246 bytes
.../examples/resources/flags/flags-rwanda.png | Bin 0 -> 1066 bytes
eugtk/examples/resources/flags/flags-saba.png | Bin 0 -> 1830 bytes
.../flags/flags-saint-pierre_and_miquelon.png | Bin 0 -> 5451 bytes
.../flags/flags-saint_barthelemy.png | Bin 0 -> 6017 bytes
.../resources/flags/flags-saint_helena.png | Bin 0 -> 2114 bytes
.../flags/flags-saint_kitts_and_nevis.png | Bin 0 -> 2119 bytes
.../resources/flags/flags-saint_lucia.png | Bin 0 -> 1004 bytes
...flags-saint_vincent_and_the_grenadines.png | Bin 0 -> 800 bytes
.../examples/resources/flags/flags-samoa.png | Bin 0 -> 726 bytes
.../resources/flags/flags-san_marino.png | Bin 0 -> 1489 bytes
.../flags/flags-sao_tome_and_principe.png | Bin 0 -> 898 bytes
eugtk/examples/resources/flags/flags-sark.png | Bin 0 -> 1640 bytes
.../resources/flags/flags-saudi_arabia.png | Bin 0 -> 1810 bytes
.../resources/flags/flags-senegal.png | Bin 0 -> 584 bytes
.../examples/resources/flags/flags-serbia.png | Bin 0 -> 1632 bytes
.../resources/flags/flags-seychelles.png | Bin 0 -> 1490 bytes
.../resources/flags/flags-sierra_leone.png | Bin 0 -> 254 bytes
.../resources/flags/flags-singapore.png | Bin 0 -> 937 bytes
.../resources/flags/flags-sint_eustatius.png | Bin 0 -> 2061 bytes
.../resources/flags/flags-sint_maarten.png | Bin 0 -> 1299 bytes
.../resources/flags/flags-slovakia.png | Bin 0 -> 1042 bytes
.../resources/flags/flags-slovenia.png | Bin 0 -> 723 bytes
.../resources/flags/flags-solomon_islands.png | Bin 0 -> 2062 bytes
.../resources/flags/flags-somalia.png | Bin 0 -> 592 bytes
.../resources/flags/flags-south_africa.png | Bin 0 -> 1822 bytes
...georgia_and_the_south_sandwich_islands.png | Bin 0 -> 2975 bytes
.../resources/flags/flags-south_korea.png | Bin 0 -> 2170 bytes
.../examples/resources/flags/flags-spain.png | Bin 0 -> 1091 bytes
.../resources/flags/flags-sri_lanka.png | Bin 0 -> 1991 bytes
.../examples/resources/flags/flags-sudan.png | Bin 0 -> 743 bytes
.../resources/flags/flags-suriname.png | Bin 0 -> 626 bytes
.../resources/flags/flags-swaziland.png | Bin 0 -> 1855 bytes
.../examples/resources/flags/flags-sweden.png | Bin 0 -> 320 bytes
.../resources/flags/flags-switzerland.png | Bin 0 -> 443 bytes
.../examples/resources/flags/flags-syria.png | Bin 0 -> 644 bytes
.../resources/flags/flags-tajikistan.png | Bin 0 -> 688 bytes
.../resources/flags/flags-tanzania.png | Bin 0 -> 1473 bytes
.../resources/flags/flags-thailand.png | Bin 0 -> 259 bytes
eugtk/examples/resources/flags/flags-togo.png | Bin 0 -> 774 bytes
.../resources/flags/flags-tokelau.png | Bin 0 -> 1440 bytes
.../examples/resources/flags/flags-tonga.png | Bin 0 -> 450 bytes
.../flags/flags-trinidad_and_tobago.png | Bin 0 -> 2298 bytes
.../flags/flags-tristan_da_cunha.png | Bin 0 -> 3390 bytes
.../resources/flags/flags-tunisia.png | Bin 0 -> 960 bytes
.../examples/resources/flags/flags-turkey.png | Bin 0 -> 966 bytes
.../resources/flags/flags-turkmenistan.png | Bin 0 -> 2303 bytes
.../flags/flags-turks_and_caicos_islands.png | Bin 0 -> 2029 bytes
.../examples/resources/flags/flags-tuvalu.png | Bin 0 -> 2562 bytes
.../examples/resources/flags/flags-uganda.png | Bin 0 -> 847 bytes
.../resources/flags/flags-ukraine.png | Bin 0 -> 255 bytes
.../flags/flags-united_arab_emirates.png | Bin 0 -> 278 bytes
.../resources/flags/flags-united_kingdom.png | Bin 0 -> 2870 bytes
.../resources/flags/flags-united_states.png | Bin 0 -> 1921 bytes
.../flags-united_states_virgin_islands.png | Bin 0 -> 3415 bytes
.../resources/flags/flags-uruguay.png | Bin 0 -> 1287 bytes
.../resources/flags/flags-uzbekistan.png | Bin 0 -> 716 bytes
.../resources/flags/flags-vanuatu.png | Bin 0 -> 1790 bytes
.../resources/flags/flags-vatican_city.png | Bin 0 -> 1045 bytes
.../resources/flags/flags-venezuela.png | Bin 0 -> 1265 bytes
.../resources/flags/flags-vietnam.png | Bin 0 -> 812 bytes
.../flags/flags-wallis_and_futuna.png | Bin 0 -> 813 bytes
.../resources/flags/flags-western_sahara.png | Bin 0 -> 986 bytes
.../examples/resources/flags/flags-yemen.png | Bin 0 -> 253 bytes
.../examples/resources/flags/flags-zambia.png | Bin 0 -> 650 bytes
.../resources/flags/flags-zimbabwe.png | Bin 0 -> 1448 bytes
eugtk/examples/resources/floppybuddy.gif | Bin 0 -> 5216 bytes
.../resources/geany_syntax/README.html | 41 +
.../resources/geany_syntax/compileflag.jpg | Bin 0 -> 33210 bytes
.../geany_syntax/filetype_extensions.conf | 69 +
.../resources/geany_syntax/filetypes.lua | 97 +
.../examples/resources/geany_syntax/gneui.ex | 116 +
.../resources/gedit_syntax/README.html | 60 +
.../examples/resources/gedit_syntax/build.xml | 106 +
eugtk/examples/resources/gedit_syntax/cc.png | Bin 0 -> 57340 bytes
.../resources/gedit_syntax/classic.xml | 112 +
.../resources/gedit_syntax/cobalt.xml | 135 +
.../resources/gedit_syntax/euphoria.lang | 254 +
.../resources/gedit_syntax/gedit_syntax.xml | 8 +
.../resources/gedit_syntax/oblivion.xml | 113 +
eugtk/examples/resources/gnome-applets.png | Bin 0 -> 3090 bytes
eugtk/examples/resources/gnome-calendar.png | Bin 0 -> 2755 bytes
eugtk/examples/resources/gnome-foot.png | Bin 0 -> 2916 bytes
eugtk/examples/resources/gnome-gimp.png | Bin 0 -> 3410 bytes
eugtk/examples/resources/gnome-gmush.png | Bin 0 -> 3244 bytes
eugtk/examples/resources/gnome-gsame.png | Bin 0 -> 4263 bytes
eugtk/examples/resources/gnu-keys.png | Bin 0 -> 3852 bytes
eugtk/examples/resources/hello.css | 9 +
eugtk/examples/resources/jerry.map | Bin 0 -> 249 bytes
eugtk/examples/resources/justin.map | 2 +
eugtk/examples/resources/license.txt | 16 +
eugtk/examples/resources/mongoose.e | 258 +
eugtk/examples/resources/mystyle.css | 27 +
eugtk/examples/resources/mystyle2.css | 27 +
eugtk/examples/resources/mystyle3.css | 33 +
eugtk/examples/resources/mystyle4.css | 55 +
eugtk/examples/resources/mystyle5.css | 9 +
eugtk/examples/resources/mystyle6.css | 16 +
eugtk/examples/resources/notebook_pages.txt | 59 +
eugtk/examples/resources/papersizes.txt | 170 +
eugtk/examples/resources/places_sidebar.txt | 29 +
eugtk/examples/resources/reset.css | 68 +
eugtk/examples/resources/secret_message | 1 +
eugtk/examples/resources/test153.ini | 35 +
eugtk/examples/resources/test173.ini | 27 +
eugtk/examples/resources/test201.ini | 7 +
eugtk/examples/resources/test5.e | 34 +
eugtk/examples/resources/text-editor.e | 3689 +++
eugtk/examples/resources/themeicons.txt | 811 +
eugtk/examples/resources/words.txt | 21084 ++++++++++++++++
eugtk/examples/resources/xcolors.txt | 659 +
eugtk/examples/screenshots/.test1.png | Bin 0 -> 26572 bytes
eugtk/examples/screenshots/README.html | 22 +
.../screenshots/Resistor Color Codes.png | Bin 0 -> 27351 bytes
eugtk/examples/screenshots/Screenshot-1.png | Bin 0 -> 274471 bytes
eugtk/examples/screenshots/Screenshot-11.png | Bin 0 -> 382267 bytes
eugtk/examples/screenshots/Screenshot-12.png | Bin 0 -> 269664 bytes
eugtk/examples/screenshots/Screenshot-14.png | Bin 0 -> 402480 bytes
eugtk/examples/screenshots/Screenshot-8.png | Bin 0 -> 256861 bytes
eugtk/examples/screenshots/Vancouver.png | Bin 0 -> 1784418 bytes
eugtk/examples/screenshots/Windows.png | Bin 0 -> 175937 bytes
eugtk/examples/screenshots/broadway.png | Bin 0 -> 136799 bytes
eugtk/examples/screenshots/browser.png | Bin 0 -> 106827 bytes
eugtk/examples/screenshots/buttons.png | Bin 0 -> 7148 bytes
eugtk/examples/screenshots/compileflag.jpg | Bin 0 -> 33210 bytes
eugtk/examples/screenshots/contexthelp.png | Bin 0 -> 167371 bytes
eugtk/examples/screenshots/error.png | Bin 0 -> 13310 bytes
eugtk/examples/screenshots/flo.jpg | Bin 0 -> 37370 bytes
eugtk/examples/screenshots/glade.png | Bin 0 -> 136564 bytes
eugtk/examples/screenshots/glade_test_1.png | Bin 0 -> 126190 bytes
eugtk/examples/screenshots/hangman.jpg | Bin 0 -> 27409 bytes
eugtk/examples/screenshots/header1.png | Bin 0 -> 11836 bytes
eugtk/examples/screenshots/hello.png | Bin 0 -> 107910 bytes
eugtk/examples/screenshots/icons.jpg | Bin 0 -> 108978 bytes
eugtk/examples/screenshots/icons.png | Bin 0 -> 63179 bytes
eugtk/examples/screenshots/imagemenu.png | Bin 0 -> 77518 bytes
eugtk/examples/screenshots/info.png | Bin 0 -> 11605 bytes
eugtk/examples/screenshots/leaktest.png | Bin 0 -> 149911 bytes
eugtk/examples/screenshots/menus.png | Bin 0 -> 70476 bytes
eugtk/examples/screenshots/namespace.png | Bin 0 -> 9458 bytes
eugtk/examples/screenshots/passwords.png | Bin 0 -> 39382 bytes
eugtk/examples/screenshots/question.png | Bin 0 -> 14423 bytes
eugtk/examples/screenshots/t.png | Bin 0 -> 116599 bytes
eugtk/examples/screenshots/template.png | Bin 0 -> 19341 bytes
eugtk/examples/screenshots/test0.png | Bin 0 -> 87347 bytes
eugtk/examples/screenshots/test1.png | Bin 0 -> 86531 bytes
eugtk/examples/screenshots/test109.png | Bin 0 -> 158624 bytes
eugtk/examples/screenshots/test116.jpg | Bin 0 -> 14216 bytes
eugtk/examples/screenshots/test136.jpg | Bin 0 -> 41202 bytes
eugtk/examples/screenshots/test138.png | Bin 0 -> 94496 bytes
eugtk/examples/screenshots/test150.jpg | Bin 0 -> 86427 bytes
eugtk/examples/screenshots/test157.jpg | Bin 0 -> 175266 bytes
eugtk/examples/screenshots/test17.jpg | Bin 0 -> 8195 bytes
eugtk/examples/screenshots/test188.png | Bin 0 -> 152347 bytes
eugtk/examples/screenshots/test194.jpg | Bin 0 -> 56507 bytes
eugtk/examples/screenshots/test2.png | Bin 0 -> 14049 bytes
eugtk/examples/screenshots/test201.png | Bin 0 -> 206195 bytes
eugtk/examples/screenshots/test211.png | Bin 0 -> 117990 bytes
eugtk/examples/screenshots/test212.png | Bin 0 -> 31692 bytes
eugtk/examples/screenshots/test23.png | Bin 0 -> 427113 bytes
eugtk/examples/screenshots/test28.png | Bin 0 -> 75586 bytes
eugtk/examples/screenshots/test3.jpg | Bin 0 -> 26564 bytes
eugtk/examples/screenshots/test3.png | Bin 0 -> 35420 bytes
eugtk/examples/screenshots/test31.jpg | Bin 0 -> 27476 bytes
eugtk/examples/screenshots/test33.jpg | Bin 0 -> 43980 bytes
eugtk/examples/screenshots/test34.jpg | Bin 0 -> 171645 bytes
eugtk/examples/screenshots/test5.jpg | Bin 0 -> 36783 bytes
eugtk/examples/screenshots/test5.png | Bin 0 -> 70869 bytes
eugtk/examples/screenshots/test59.png | Bin 0 -> 101465 bytes
eugtk/examples/screenshots/test6.png | Bin 0 -> 280890 bytes
eugtk/examples/screenshots/test7.jpg | Bin 0 -> 13393 bytes
eugtk/examples/screenshots/test77.jpg | Bin 0 -> 11928 bytes
eugtk/examples/screenshots/test84.jpg | Bin 0 -> 21860 bytes
eugtk/examples/screenshots/test9.jpg | Bin 0 -> 13673 bytes
eugtk/examples/screenshots/test92.png | Bin 0 -> 91602 bytes
eugtk/examples/screenshots/titlebar.png | Bin 0 -> 13833 bytes
eugtk/examples/screenshots/utf.png | Bin 0 -> 27166 bytes
eugtk/examples/screenshots/warn.png | Bin 0 -> 13607 bytes
eugtk/examples/screenshots/webkit.png | Bin 0 -> 306215 bytes
eugtk/examples/screenshots/webkit_test.png | Bin 0 -> 208458 bytes
eugtk/examples/screenshots/webserver.png | Bin 0 -> 24487 bytes
eugtk/examples/screenshots/worldflags.jpg | Bin 0 -> 33070 bytes
eugtk/examples/screenshots/x2.png | Bin 0 -> 52295 bytes
eugtk/examples/screenshots/x3.png | Bin 0 -> 63583 bytes
eugtk/examples/sock.ex | 49 +
eugtk/examples/test0.ex | 111 +
eugtk/examples/test1.ex | 29 +
eugtk/examples/test10.ex | 19 +
eugtk/examples/test100.ex | 56 +
eugtk/examples/test101.ex | 68 +
eugtk/examples/test102.ex | 42 +
eugtk/examples/test103.ex | 64 +
eugtk/examples/test104.ex | 61 +
eugtk/examples/test105.ex | 41 +
eugtk/examples/test106.ex | 53 +
eugtk/examples/test107.ex | 45 +
eugtk/examples/test108.ex | 59 +
eugtk/examples/test109.ex | 45 +
eugtk/examples/test11.ex | 55 +
eugtk/examples/test110.ex | 42 +
eugtk/examples/test111.ex | 41 +
eugtk/examples/test112.ex | 56 +
eugtk/examples/test113.ex | 47 +
eugtk/examples/test114.ex | 48 +
eugtk/examples/test115.ex | 86 +
eugtk/examples/test116.ex | 69 +
eugtk/examples/test117.ex | 37 +
eugtk/examples/test118.ex | 51 +
eugtk/examples/test119.ex | 51 +
eugtk/examples/test12.ex | 50 +
eugtk/examples/test120.ex | 57 +
eugtk/examples/test121.ex | 105 +
eugtk/examples/test122.ex | 43 +
eugtk/examples/test123.ex | 65 +
eugtk/examples/test124.ex | 56 +
eugtk/examples/test125.ex | 88 +
eugtk/examples/test126.ex | 65 +
eugtk/examples/test127.ex | 72 +
eugtk/examples/test128.ex | 37 +
eugtk/examples/test129.ex | 82 +
eugtk/examples/test13.ex | 60 +
eugtk/examples/test130.ex | 69 +
eugtk/examples/test131.ex | 86 +
eugtk/examples/test132.ex | 123 +
eugtk/examples/test133.ex | 24 +
eugtk/examples/test134.ex | 109 +
eugtk/examples/test135.ex | 37 +
eugtk/examples/test136.ex | 55 +
eugtk/examples/test137.ex | 59 +
eugtk/examples/test138.ex | 138 +
eugtk/examples/test139.ex | 24 +
eugtk/examples/test14.ex | 66 +
eugtk/examples/test140.ex | 41 +
eugtk/examples/test141.ex | 39 +
eugtk/examples/test142.ex | 36 +
eugtk/examples/test143.ex | 55 +
eugtk/examples/test144.ex | 62 +
eugtk/examples/test145.ex | 47 +
eugtk/examples/test146.ex | 60 +
eugtk/examples/test147.ex | 42 +
eugtk/examples/test148.ex | 109 +
eugtk/examples/test149.ex | 39 +
eugtk/examples/test15.ex | 73 +
eugtk/examples/test150.ex | 73 +
eugtk/examples/test151.ex | 88 +
eugtk/examples/test152.ex | 37 +
eugtk/examples/test153.ex | 116 +
eugtk/examples/test154.ex | 44 +
eugtk/examples/test155.ex | 84 +
eugtk/examples/test156.ex | 179 +
eugtk/examples/test157.ex | 50 +
eugtk/examples/test158.ex | 42 +
eugtk/examples/test159.ex | 72 +
eugtk/examples/test16.ex | 94 +
eugtk/examples/test160.ex | 42 +
eugtk/examples/test161.ex | 43 +
eugtk/examples/test162.ex | 77 +
eugtk/examples/test163.ex | 121 +
eugtk/examples/test164.ex | 70 +
eugtk/examples/test165.ex | 74 +
eugtk/examples/test166.ex | 71 +
eugtk/examples/test167.ex | 91 +
eugtk/examples/test168.ex | 70 +
eugtk/examples/test169.ex | 50 +
eugtk/examples/test17.ex | 122 +
eugtk/examples/test170.ex | 49 +
eugtk/examples/test171.ex | 54 +
eugtk/examples/test172.ex | 97 +
eugtk/examples/test173.ex | 128 +
eugtk/examples/test174.ex | 59 +
eugtk/examples/test175.ex | 57 +
eugtk/examples/test176.ex | 58 +
eugtk/examples/test177.ex | 44 +
eugtk/examples/test178.ex | 93 +
eugtk/examples/test179.ex | 57 +
eugtk/examples/test18.ex | 64 +
eugtk/examples/test180.ex | 74 +
eugtk/examples/test181.ex | 51 +
eugtk/examples/test182.ex | 116 +
eugtk/examples/test183.ex | 38 +
eugtk/examples/test184.ex | 61 +
eugtk/examples/test185.ex | 54 +
eugtk/examples/test186.ex | 49 +
eugtk/examples/test187.ex | 72 +
eugtk/examples/test188.ex | 190 +
eugtk/examples/test189.ex | 50 +
eugtk/examples/test19.ex | 99 +
eugtk/examples/test190.ex | 76 +
eugtk/examples/test191.ex | 109 +
eugtk/examples/test192.ex | 77 +
eugtk/examples/test193.ex | 87 +
eugtk/examples/test194.ex | 142 +
eugtk/examples/test195.ex | 93 +
eugtk/examples/test196.ex | 76 +
eugtk/examples/test197.ex | 83 +
eugtk/examples/test198.ex | 72 +
eugtk/examples/test199.ex | 58 +
eugtk/examples/test2.ex | 38 +
eugtk/examples/test20.ex | 50 +
eugtk/examples/test200.ex | 96 +
eugtk/examples/test201.ex | 216 +
eugtk/examples/test202.ex | 54 +
eugtk/examples/test203.ex | 74 +
eugtk/examples/test204.ex | 93 +
eugtk/examples/test205.ex | 53 +
eugtk/examples/test206.ex | 89 +
eugtk/examples/test207.ex | 33 +
eugtk/examples/test208.ex | 95 +
eugtk/examples/test209.ex | 64 +
eugtk/examples/test21.ex | 47 +
eugtk/examples/test210.ex | 47 +
eugtk/examples/test211.ex | 14 +
eugtk/examples/test212.ex | 29 +
eugtk/examples/test22.ex | 129 +
eugtk/examples/test23.ex | 267 +
eugtk/examples/test24.ex | 56 +
eugtk/examples/test25.ex | 367 +
eugtk/examples/test26.ex | 96 +
eugtk/examples/test27.ex | 37 +
eugtk/examples/test28.ex | 54 +
eugtk/examples/test29.ex | 39 +
eugtk/examples/test3.ex | 56 +
eugtk/examples/test30.ex | 41 +
eugtk/examples/test31.ex | 46 +
eugtk/examples/test32.ex | 45 +
eugtk/examples/test33.ex | 323 +
eugtk/examples/test34.ex | 62 +
eugtk/examples/test35.ex | 113 +
eugtk/examples/test36.ex | 55 +
eugtk/examples/test37.ex | 33 +
eugtk/examples/test38.ex | 59 +
eugtk/examples/test39.ex | 46 +
eugtk/examples/test4.ex | 57 +
eugtk/examples/test40.ex | 125 +
eugtk/examples/test41.ex | 53 +
eugtk/examples/test42.ex | 90 +
eugtk/examples/test43.ex | 55 +
eugtk/examples/test44.ex | 43 +
eugtk/examples/test45.ex | 58 +
eugtk/examples/test46.ex | 62 +
eugtk/examples/test47.ex | 54 +
eugtk/examples/test48.ex | 63 +
eugtk/examples/test49.ex | 54 +
eugtk/examples/test5.ex | 38 +
eugtk/examples/test50.ex | 68 +
eugtk/examples/test51.ex | 54 +
eugtk/examples/test52.ex | 98 +
eugtk/examples/test53.ex | 82 +
eugtk/examples/test54.ex | 96 +
eugtk/examples/test55.ex | 74 +
eugtk/examples/test56.ex | 44 +
eugtk/examples/test57.ex | 66 +
eugtk/examples/test58.ex | 89 +
eugtk/examples/test59.ex | 347 +
eugtk/examples/test6.ex | 63 +
eugtk/examples/test60.ex | 598 +
eugtk/examples/test61.ex | 93 +
eugtk/examples/test62.ex | 146 +
eugtk/examples/test63.ex | 83 +
eugtk/examples/test64.ex | 68 +
eugtk/examples/test65.ex | 95 +
eugtk/examples/test66.ex | 55 +
eugtk/examples/test67.ex | 53 +
eugtk/examples/test68.ex | 37 +
eugtk/examples/test69.ex | 55 +
eugtk/examples/test7.ex | 67 +
eugtk/examples/test70.ex | 63 +
eugtk/examples/test71.ex | 54 +
eugtk/examples/test72.ex | 53 +
eugtk/examples/test73.ex | 60 +
eugtk/examples/test74.ex | 29 +
eugtk/examples/test75.ex | 62 +
eugtk/examples/test76.ex | 61 +
eugtk/examples/test77.ex | 50 +
eugtk/examples/test78.ex | 48 +
eugtk/examples/test79.ex | 41 +
eugtk/examples/test8.ex | 47 +
eugtk/examples/test80.ex | 114 +
eugtk/examples/test81.ex | 34 +
eugtk/examples/test82.ex | 70 +
eugtk/examples/test83.ex | 90 +
eugtk/examples/test84.ex | 56 +
eugtk/examples/test85.ex | 49 +
eugtk/examples/test86.ex | 45 +
eugtk/examples/test87.ex | 68 +
eugtk/examples/test88.ex | 14 +
eugtk/examples/test89.ex | 12 +
eugtk/examples/test9.ex | 65 +
eugtk/examples/test90.ex | 77 +
eugtk/examples/test91.ex | 57 +
eugtk/examples/test92.ex | 56 +
eugtk/examples/test93.ex | 46 +
eugtk/examples/test94.ex | 48 +
eugtk/examples/test95.ex | 37 +
eugtk/examples/test96.ex | 151 +
eugtk/examples/test97.ex | 89 +
eugtk/examples/test98.ex | 39 +
eugtk/examples/test99.ex | 117 +
eugtk/examples/thumbnails/.httpd.css | 0
eugtk/examples/thumbnails/4_rhombuses.gif | Bin 0 -> 349 bytes
eugtk/examples/thumbnails/7300.jpg | Bin 0 -> 46306 bytes
eugtk/examples/thumbnails/BabyTux.bmp | Bin 0 -> 8854 bytes
eugtk/examples/thumbnails/BabyTux.gif | Bin 0 -> 2008 bytes
eugtk/examples/thumbnails/BabyTux.png | Bin 0 -> 3570 bytes
eugtk/examples/thumbnails/DISKS04.ICO | Bin 0 -> 1078 bytes
eugtk/examples/thumbnails/Jacob.jpg | Bin 0 -> 3554 bytes
eugtk/examples/thumbnails/Jerry.jpg | Bin 0 -> 3507 bytes
eugtk/examples/thumbnails/Justin.jpg | Bin 0 -> 2801 bytes
eugtk/examples/thumbnails/MorningRain.png | Bin 0 -> 171451 bytes
eugtk/examples/thumbnails/README.html | 22 +
.../thumbnails/accessories-calculator.png | Bin 0 -> 5347 bytes
.../thumbnails/applications-development.svg | 420 +
.../thumbnails/applications-graphics.png | Bin 0 -> 15688 bytes
eugtk/examples/thumbnails/arc.png | Bin 0 -> 3643 bytes
eugtk/examples/thumbnails/arcneg.png | Bin 0 -> 4290 bytes
eugtk/examples/thumbnails/bar.gif | Bin 0 -> 5378 bytes
eugtk/examples/thumbnails/bug-buddy.png | Bin 0 -> 4675 bytes
eugtk/examples/thumbnails/bug-buddy.svg | 249 +
eugtk/examples/thumbnails/cake.png | Bin 0 -> 16589 bytes
eugtk/examples/thumbnails/cal.png | Bin 0 -> 2544 bytes
eugtk/examples/thumbnails/clip.png | Bin 0 -> 3331 bytes
eugtk/examples/thumbnails/clipper.png | Bin 0 -> 2470 bytes
eugtk/examples/thumbnails/clown.png | Bin 0 -> 8219 bytes
eugtk/examples/thumbnails/clown.svg | 358 +
eugtk/examples/thumbnails/clown.xpm | 1045 +
eugtk/examples/thumbnails/clown_trans.png | Bin 0 -> 9706 bytes
eugtk/examples/thumbnails/cow2.jpg | Bin 0 -> 10898 bytes
eugtk/examples/thumbnails/cowbell.png | Bin 0 -> 18488 bytes
eugtk/examples/thumbnails/cowbell2.png | Bin 0 -> 14081 bytes
eugtk/examples/thumbnails/cowbell2a.gif | Bin 0 -> 42734 bytes
eugtk/examples/thumbnails/cowbell2a.png | Bin 0 -> 13598 bytes
eugtk/examples/thumbnails/cowbell3.png | Bin 0 -> 16854 bytes
eugtk/examples/thumbnails/coweat.png | Bin 0 -> 13951 bytes
eugtk/examples/thumbnails/coweat2.png | Bin 0 -> 14066 bytes
eugtk/examples/thumbnails/coweat3.png | Bin 0 -> 14403 bytes
eugtk/examples/thumbnails/coweat4.png | Bin 0 -> 15007 bytes
eugtk/examples/thumbnails/coweat5.png | Bin 0 -> 14434 bytes
eugtk/examples/thumbnails/coweat6.png | Bin 0 -> 16485 bytes
eugtk/examples/thumbnails/coweat7.png | Bin 0 -> 18841 bytes
eugtk/examples/thumbnails/curveto.png | Bin 0 -> 5277 bytes
eugtk/examples/thumbnails/dialog-password.png | Bin 0 -> 2358 bytes
eugtk/examples/thumbnails/dino.gif | Bin 0 -> 7002 bytes
eugtk/examples/thumbnails/dino_mite.gif | Bin 0 -> 2860 bytes
eugtk/examples/thumbnails/dino_slo.gif | Bin 0 -> 6611 bytes
eugtk/examples/thumbnails/document-print.png | Bin 0 -> 18542 bytes
eugtk/examples/thumbnails/dragon.png | Bin 0 -> 6672 bytes
eugtk/examples/thumbnails/e.xpm | 632 +
eugtk/examples/thumbnails/emblem-cool.svg | 182 +
eugtk/examples/thumbnails/emblem-ok.svg | 222 +
eugtk/examples/thumbnails/emblem-sound.png | Bin 0 -> 25514 bytes
eugtk/examples/thumbnails/emblem-web-off.png | Bin 0 -> 3208 bytes
eugtk/examples/thumbnails/emblem-web-on.png | Bin 0 -> 3981 bytes
eugtk/examples/thumbnails/eugtk.png | Bin 0 -> 12921 bytes
eugtk/examples/thumbnails/euphoria-linux.gif | Bin 0 -> 43110 bytes
eugtk/examples/thumbnails/euphoria-linux.svg | 233 +
eugtk/examples/thumbnails/euphoria.gif | Bin 0 -> 11566 bytes
eugtk/examples/thumbnails/face-cry.png | Bin 0 -> 1347 bytes
eugtk/examples/thumbnails/fands.png | Bin 0 -> 4263 bytes
eugtk/examples/thumbnails/favicon.ico | Bin 0 -> 5226 bytes
eugtk/examples/thumbnails/fillstyle.png | Bin 0 -> 6960 bytes
eugtk/examples/thumbnails/fire.png | Bin 0 -> 84589 bytes
eugtk/examples/thumbnails/fish.png | Bin 0 -> 5911 bytes
eugtk/examples/thumbnails/fish.svg | 282 +
eugtk/examples/thumbnails/font.png | Bin 0 -> 897 bytes
eugtk/examples/thumbnails/fox.png | Bin 0 -> 7210 bytes
eugtk/examples/thumbnails/fox.svg | 306 +
eugtk/examples/thumbnails/gconf-editor.png | Bin 0 -> 4119 bytes
eugtk/examples/thumbnails/giraffe.jpg | Bin 0 -> 161076 bytes
eugtk/examples/thumbnails/giraffe.xpm | 3365 +++
eugtk/examples/thumbnails/glade.svg | 1272 +
eugtk/examples/thumbnails/gnome-run.png | Bin 0 -> 65323 bytes
eugtk/examples/thumbnails/gradient.png | Bin 0 -> 6588 bytes
eugtk/examples/thumbnails/green_star.png | Bin 0 -> 229 bytes
eugtk/examples/thumbnails/gtk-logo-rgb.gif | Bin 0 -> 6271 bytes
eugtk/examples/thumbnails/hint.png | Bin 0 -> 6039 bytes
eugtk/examples/thumbnails/i.xpm | 535 +
eugtk/examples/thumbnails/icon-reset.png | Bin 0 -> 1849 bytes
eugtk/examples/thumbnails/icon-start.png | Bin 0 -> 1211 bytes
eugtk/examples/thumbnails/icon-stop.png | Bin 0 -> 1185 bytes
eugtk/examples/thumbnails/image.png | Bin 0 -> 22279 bytes
eugtk/examples/thumbnails/info.png | Bin 0 -> 1047 bytes
eugtk/examples/thumbnails/input-mouse.png | Bin 0 -> 6413 bytes
eugtk/examples/thumbnails/internet.png | Bin 0 -> 48456 bytes
eugtk/examples/thumbnails/internet_trans.png | Bin 0 -> 47151 bytes
eugtk/examples/thumbnails/jeff.jpg | Bin 0 -> 32061 bytes
eugtk/examples/thumbnails/jls.jpg | Bin 0 -> 31624 bytes
eugtk/examples/thumbnails/keybindings.png | Bin 0 -> 2567 bytes
eugtk/examples/thumbnails/linecap.png | Bin 0 -> 1112 bytes
eugtk/examples/thumbnails/linejoin.png | Bin 0 -> 1862 bytes
eugtk/examples/thumbnails/little_house.png | Bin 0 -> 345 bytes
eugtk/examples/thumbnails/missing-image.png | Bin 0 -> 2159 bytes
eugtk/examples/thumbnails/mongoose.png | Bin 0 -> 4497 bytes
eugtk/examples/thumbnails/mongoose.xpm | 248 +
eugtk/examples/thumbnails/mouse.png | Bin 0 -> 6974 bytes
eugtk/examples/thumbnails/mouse.svg | 95 +
eugtk/examples/thumbnails/n.png | Bin 0 -> 302 bytes
eugtk/examples/thumbnails/nature.jpg | Bin 0 -> 1665335 bytes
eugtk/examples/thumbnails/nature_small.jpg | Bin 0 -> 79491 bytes
eugtk/examples/thumbnails/net0.png | Bin 0 -> 3376 bytes
.../thumbnails/network-wired-disconnected.png | Bin 0 -> 3146 bytes
eugtk/examples/thumbnails/network-wired.png | Bin 0 -> 2934 bytes
eugtk/examples/thumbnails/notebook.png | Bin 0 -> 3074 bytes
eugtk/examples/thumbnails/p.xpm | 1032 +
eugtk/examples/thumbnails/paint.png | Bin 0 -> 2839 bytes
eugtk/examples/thumbnails/passgrn.png | Bin 0 -> 2669 bytes
eugtk/examples/thumbnails/passred.png | Bin 0 -> 2651 bytes
eugtk/examples/thumbnails/pattern.png | Bin 0 -> 29486 bytes
eugtk/examples/thumbnails/pie.png | Bin 0 -> 7428 bytes
.../examples/thumbnails/preferences-color.svg | 592 +
.../thumbnails/preferences-desktop-locale.svg | 732 +
eugtk/examples/thumbnails/r.png | Bin 0 -> 327 bytes
eugtk/examples/thumbnails/red.png | Bin 0 -> 163 bytes
eugtk/examples/thumbnails/red_star.png | Bin 0 -> 228 bytes
eugtk/examples/thumbnails/rightleft.png | Bin 0 -> 651 bytes
eugtk/examples/thumbnails/roundrect.png | Bin 0 -> 4437 bytes
eugtk/examples/thumbnails/t.bmp | Bin 0 -> 1738 bytes
eugtk/examples/thumbnails/t.jpg | Bin 0 -> 933 bytes
eugtk/examples/thumbnails/t.png | Bin 0 -> 643 bytes
eugtk/examples/thumbnails/t.xpm | 77 +
eugtk/examples/thumbnails/text-editor.png | Bin 0 -> 39787 bytes
eugtk/examples/thumbnails/thunderbird.png | Bin 0 -> 6538 bytes
eugtk/examples/thumbnails/thunderbird.svg | 326 +
eugtk/examples/thumbnails/tiphat1.gif | Bin 0 -> 235 bytes
eugtk/examples/thumbnails/ufo1.png | Bin 0 -> 789 bytes
eugtk/examples/thumbnails/ufo2.png | Bin 0 -> 916 bytes
eugtk/examples/thumbnails/updown.png | Bin 0 -> 642 bytes
eugtk/examples/thumbnails/user_icon.gif | Bin 0 -> 3533 bytes
eugtk/examples/thumbnails/warn.png | Bin 0 -> 1026 bytes
eugtk/examples/thumbnails/web-browser.png | Bin 0 -> 4992 bytes
eugtk/examples/windows.bugs | 17 +
877 files changed, 96872 insertions(+)
create mode 100644 eugtk/examples/.httpd.css
create mode 100644 eugtk/examples/BEAR.ex
create mode 100644 eugtk/examples/GtkAboutDialog.e
create mode 100644 eugtk/examples/GtkCairo.e
create mode 100644 eugtk/examples/GtkEngine.e
create mode 100644 eugtk/examples/GtkEnums.e
create mode 100644 eugtk/examples/GtkEvents.e
create mode 100644 eugtk/examples/GtkFileSelector.e
create mode 100644 eugtk/examples/GtkFontSelector.e
create mode 100644 eugtk/examples/GtkPrinter.e
create mode 100644 eugtk/examples/GtkSettings.e
create mode 100644 eugtk/examples/GtkSourceView.plugin
create mode 100644 eugtk/examples/GtkWebKit.plugin
create mode 100644 eugtk/examples/browser.ex
create mode 100644 eugtk/examples/documentation/.httpd.css
create mode 100644 eugtk/examples/documentation/Broadway
create mode 100644 eugtk/examples/documentation/Glade.html
create mode 100644 eugtk/examples/documentation/HowItWorks.html
create mode 100644 eugtk/examples/documentation/README.html
create mode 100644 eugtk/examples/documentation/ServerHelp.html
create mode 100644 eugtk/examples/documentation/StartingGlade.html
create mode 100644 eugtk/examples/documentation/StartingGlade2.html
create mode 100644 eugtk/examples/documentation/bear.html
create mode 100644 eugtk/examples/documentation/dialogs.html
create mode 100644 eugtk/examples/documentation/favicon.ico
create mode 100644 eugtk/examples/documentation/functions.html
create mode 100644 eugtk/examples/documentation/guide_a.html
create mode 100644 eugtk/examples/documentation/images/bear0.png
create mode 100644 eugtk/examples/documentation/images/bear1.png
create mode 100644 eugtk/examples/documentation/images/bear2.png
create mode 100644 eugtk/examples/documentation/images/bear3.png
create mode 100644 eugtk/examples/documentation/images/bear4.png
create mode 100644 eugtk/examples/documentation/pango_markup.html
create mode 100644 eugtk/examples/documentation/platforms.html
create mode 100644 eugtk/examples/documentation/printing.html
create mode 100644 eugtk/examples/documentation/style.css
create mode 100644 eugtk/examples/documentation/treeviews.html
create mode 100644 eugtk/examples/eu.cfg
create mode 100644 eugtk/examples/examples/.httpd.css
create mode 100644 eugtk/examples/examples/README.html
create mode 100644 eugtk/examples/examples/audio_converter.ex
create mode 100644 eugtk/examples/examples/base_converter.ex
create mode 100644 eugtk/examples/examples/browser.ex
create mode 100644 eugtk/examples/examples/clown.e
create mode 100644 eugtk/examples/examples/color_codes.ex
create mode 100644 eugtk/examples/examples/colornames.ex
create mode 100644 eugtk/examples/examples/eu.cfg
create mode 100644 eugtk/examples/examples/hangman.ex
create mode 100755 eugtk/examples/examples/httpd.ex
create mode 100644 eugtk/examples/examples/icon_E.e
create mode 100644 eugtk/examples/examples/icon_I.e
create mode 100644 eugtk/examples/examples/icon_P.e
create mode 100644 eugtk/examples/examples/icons.ex
create mode 100644 eugtk/examples/examples/leak.ex
create mode 100644 eugtk/examples/examples/passwords.ex
create mode 100644 eugtk/examples/examples/talk.ex
create mode 100644 eugtk/examples/examples/task.ex
create mode 100644 eugtk/examples/examples/test_all.ex
create mode 100644 eugtk/examples/examples/test_missing.ex
create mode 100644 eugtk/examples/examples/webkit.ex
create mode 100644 eugtk/examples/examples/webserver.ex
create mode 100644 eugtk/examples/examples/worldflags.ex
create mode 100644 eugtk/examples/examples/xpm_include_test.ex
create mode 100644 eugtk/examples/examples/xpm_to_eu_include.ex
create mode 100644 eugtk/examples/glade/.httpd.css
create mode 100644 eugtk/examples/glade/Jessica-Alba.jpg
create mode 100644 eugtk/examples/glade/README.html
create mode 100644 eugtk/examples/glade/about.e
create mode 100644 eugtk/examples/glade/about.glade
create mode 100644 eugtk/examples/glade/accessories-calculator.png
create mode 100644 eugtk/examples/glade/au.e
create mode 100644 eugtk/examples/glade/browser.ex
create mode 100644 eugtk/examples/glade/ca.e
create mode 100644 eugtk/examples/glade/calculator.ex
create mode 100644 eugtk/examples/glade/calculator.glade
create mode 100644 eugtk/examples/glade/calendar.ex
create mode 100644 eugtk/examples/glade/calendar.glade
create mode 100644 eugtk/examples/glade/clock.ex
create mode 100644 eugtk/examples/glade/clock.glade
create mode 100644 eugtk/examples/glade/colors.ex
create mode 100644 eugtk/examples/glade/colors.glade
create mode 100644 eugtk/examples/glade/coweat2.png
create mode 100644 eugtk/examples/glade/en.e
create mode 100644 eugtk/examples/glade/es.e
create mode 100644 eugtk/examples/glade/eu.cfg
create mode 100644 eugtk/examples/glade/eugtk.png
create mode 100644 eugtk/examples/glade/euphoria.gif
create mode 100644 eugtk/examples/glade/file.e
create mode 100644 eugtk/examples/glade/file.glade
create mode 100644 eugtk/examples/glade/fr.e
create mode 100644 eugtk/examples/glade/glade.svg
create mode 100644 eugtk/examples/glade/gladetest1.ex
create mode 100644 eugtk/examples/glade/gladetest1.glade
create mode 100644 eugtk/examples/glade/green-terminal.png
create mode 100644 eugtk/examples/glade/gtk-logo-rgb.gif
create mode 100644 eugtk/examples/glade/hello.ex
create mode 100644 eugtk/examples/glade/hello.glade
create mode 100644 eugtk/examples/glade/help.e
create mode 100644 eugtk/examples/glade/help.glade
create mode 100644 eugtk/examples/glade/list.ex
create mode 100644 eugtk/examples/glade/list.glade
create mode 100644 eugtk/examples/glade/main.ex
create mode 100644 eugtk/examples/glade/main.glade
create mode 100644 eugtk/examples/glade/math_eval.e
create mode 100644 eugtk/examples/glade/mongoose.png
create mode 100644 eugtk/examples/glade/paned.ex
create mode 100644 eugtk/examples/glade/paned.glade
create mode 100644 eugtk/examples/glade/pref.e
create mode 100644 eugtk/examples/glade/pref.glade
create mode 100644 eugtk/examples/glade/prefs.glade
create mode 100644 eugtk/examples/glade/test11.ex
create mode 100644 eugtk/examples/glade/test11.glade
create mode 100644 eugtk/examples/glade/test116.ex
create mode 100644 eugtk/examples/glade/test116.glade
create mode 100644 eugtk/examples/glade/test12.ex
create mode 100644 eugtk/examples/glade/test12.glade
create mode 100644 eugtk/examples/glade/test13.ex
create mode 100644 eugtk/examples/glade/test13.glade
create mode 100644 eugtk/examples/glade/test142.ex
create mode 100644 eugtk/examples/glade/test142.glade
create mode 100644 eugtk/examples/glade/test157.ex
create mode 100644 eugtk/examples/glade/test157.glade
create mode 100644 eugtk/examples/glade/test25.ex
create mode 100644 eugtk/examples/glade/test25.glade
create mode 100644 eugtk/examples/glade/toolbar.ex
create mode 100644 eugtk/examples/glade/toolbar.glade
create mode 100644 eugtk/examples/glade/webserver.ex
create mode 100644 eugtk/examples/glade/webserver.glade
create mode 100644 eugtk/examples/glade/widgets.ex
create mode 100644 eugtk/examples/glade/widgets.glade
create mode 100644 eugtk/examples/glade/widgets.png
create mode 100644 eugtk/examples/glade/widgets.xml
create mode 100644 eugtk/examples/glade/x2.png
create mode 100644 eugtk/examples/plug.ex
create mode 100644 eugtk/examples/resources/Jerry.map
create mode 100644 eugtk/examples/resources/Justin.map
create mode 100644 eugtk/examples/resources/README.html
create mode 100644 eugtk/examples/resources/a.e
create mode 100644 eugtk/examples/resources/apple-red.png
create mode 100644 eugtk/examples/resources/b.e
create mode 100644 eugtk/examples/resources/background.jpg
create mode 100644 eugtk/examples/resources/clown.e
create mode 100644 eugtk/examples/resources/colorcode/README.html
create mode 100644 eugtk/examples/resources/colorcode/bar.jpg
create mode 100644 eugtk/examples/resources/colorcode/bar0.jpg
create mode 100644 eugtk/examples/resources/colorcode/bar1.jpg
create mode 100644 eugtk/examples/resources/colorcode/bar10.jpg
create mode 100644 eugtk/examples/resources/colorcode/bar11.jpg
create mode 100644 eugtk/examples/resources/colorcode/bar2.jpg
create mode 100644 eugtk/examples/resources/colorcode/bar3.jpg
create mode 100644 eugtk/examples/resources/colorcode/bar4.jpg
create mode 100644 eugtk/examples/resources/colorcode/bar5.jpg
create mode 100644 eugtk/examples/resources/colorcode/bar6.jpg
create mode 100644 eugtk/examples/resources/colorcode/bar7.jpg
create mode 100644 eugtk/examples/resources/colorcode/bar8.jpg
create mode 100644 eugtk/examples/resources/colorcode/bar9.jpg
create mode 100644 eugtk/examples/resources/colorcode/end1.jpg
create mode 100644 eugtk/examples/resources/colorcode/end2.jpg
create mode 100644 eugtk/examples/resources/colorcode/end3.jpg
create mode 100644 eugtk/examples/resources/colorcode/leftend.jpg
create mode 100644 eugtk/examples/resources/colorcode/rcc.jpg
create mode 100644 eugtk/examples/resources/css_multiplebgs.css
create mode 100644 eugtk/examples/resources/css_pixbufs.css
create mode 100644 eugtk/examples/resources/cssview.css
create mode 100644 eugtk/examples/resources/eu.cfg
create mode 100644 eugtk/examples/resources/flags/README.html
create mode 100644 eugtk/examples/resources/flags/flags-afghanistan.png
create mode 100644 eugtk/examples/resources/flags/flags-aland.png
create mode 100644 eugtk/examples/resources/flags/flags-albania.png
create mode 100644 eugtk/examples/resources/flags/flags-alderney.png
create mode 100644 eugtk/examples/resources/flags/flags-algeria.png
create mode 100644 eugtk/examples/resources/flags/flags-american_samoa.png
create mode 100644 eugtk/examples/resources/flags/flags-andorra.png
create mode 100644 eugtk/examples/resources/flags/flags-angola.png
create mode 100644 eugtk/examples/resources/flags/flags-anguilla.png
create mode 100644 eugtk/examples/resources/flags/flags-antarctica.png
create mode 100644 eugtk/examples/resources/flags/flags-antigua_and_barbuda.png
create mode 100644 eugtk/examples/resources/flags/flags-argentina.png
create mode 100644 eugtk/examples/resources/flags/flags-armenia.png
create mode 100644 eugtk/examples/resources/flags/flags-aruba.png
create mode 100644 eugtk/examples/resources/flags/flags-australia.png
create mode 100644 eugtk/examples/resources/flags/flags-austria.png
create mode 100644 eugtk/examples/resources/flags/flags-azerbaijan.png
create mode 100644 eugtk/examples/resources/flags/flags-azores.png
create mode 100644 eugtk/examples/resources/flags/flags-bahamas.png
create mode 100644 eugtk/examples/resources/flags/flags-bahrain.png
create mode 100644 eugtk/examples/resources/flags/flags-bangladesh.png
create mode 100644 eugtk/examples/resources/flags/flags-barbados.png
create mode 100644 eugtk/examples/resources/flags/flags-belgium.png
create mode 100644 eugtk/examples/resources/flags/flags-belize.png
create mode 100644 eugtk/examples/resources/flags/flags-benin.png
create mode 100644 eugtk/examples/resources/flags/flags-bermuda.png
create mode 100644 eugtk/examples/resources/flags/flags-bhutan.png
create mode 100644 eugtk/examples/resources/flags/flags-bolivia.png
create mode 100644 eugtk/examples/resources/flags/flags-bonaire.png
create mode 100644 eugtk/examples/resources/flags/flags-bosnia_and_herzegovina.png
create mode 100644 eugtk/examples/resources/flags/flags-botswana.png
create mode 100644 eugtk/examples/resources/flags/flags-brazil.png
create mode 100644 eugtk/examples/resources/flags/flags-british_antarctic_territory.png
create mode 100644 eugtk/examples/resources/flags/flags-british_indian_ocean_territory.png
create mode 100644 eugtk/examples/resources/flags/flags-british_virgin_islands.png
create mode 100644 eugtk/examples/resources/flags/flags-brunei.png
create mode 100644 eugtk/examples/resources/flags/flags-bulgaria.png
create mode 100644 eugtk/examples/resources/flags/flags-burkina_faso.png
create mode 100644 eugtk/examples/resources/flags/flags-burundi.png
create mode 100644 eugtk/examples/resources/flags/flags-cambodia.png
create mode 100644 eugtk/examples/resources/flags/flags-cameroon.png
create mode 100644 eugtk/examples/resources/flags/flags-canada.png
create mode 100644 eugtk/examples/resources/flags/flags-cape_verde.png
create mode 100644 eugtk/examples/resources/flags/flags-cayman_islands.png
create mode 100644 eugtk/examples/resources/flags/flags-central_african_republic.png
create mode 100644 eugtk/examples/resources/flags/flags-chad.png
create mode 100644 eugtk/examples/resources/flags/flags-chile.png
create mode 100644 eugtk/examples/resources/flags/flags-christmas_island.png
create mode 100644 eugtk/examples/resources/flags/flags-cocos_(keeling)_islands.png
create mode 100644 eugtk/examples/resources/flags/flags-colombia.png
create mode 100644 eugtk/examples/resources/flags/flags-comoros.png
create mode 100644 eugtk/examples/resources/flags/flags-cook_islands.png
create mode 100644 eugtk/examples/resources/flags/flags-costa_rica.png
create mode 100644 eugtk/examples/resources/flags/flags-cote_d'ivoire.png
create mode 100644 eugtk/examples/resources/flags/flags-croatia.png
create mode 100644 eugtk/examples/resources/flags/flags-cuba.png
create mode 100644 eugtk/examples/resources/flags/flags-cyprus.png
create mode 100644 eugtk/examples/resources/flags/flags-czech_republic.png
create mode 100644 eugtk/examples/resources/flags/flags-democratic_republic_of_the_congo.png
create mode 100644 eugtk/examples/resources/flags/flags-denmark.png
create mode 100644 eugtk/examples/resources/flags/flags-djibouti.png
create mode 100644 eugtk/examples/resources/flags/flags-dominica.png
create mode 100644 eugtk/examples/resources/flags/flags-dominican_republic.png
create mode 100644 eugtk/examples/resources/flags/flags-east_timor.png
create mode 100644 eugtk/examples/resources/flags/flags-ecuador.png
create mode 100644 eugtk/examples/resources/flags/flags-egypt.png
create mode 100644 eugtk/examples/resources/flags/flags-el_salvador.png
create mode 100644 eugtk/examples/resources/flags/flags-equatorial_guinea.png
create mode 100644 eugtk/examples/resources/flags/flags-eritrea.png
create mode 100644 eugtk/examples/resources/flags/flags-estonia.png
create mode 100644 eugtk/examples/resources/flags/flags-ethiopia.png
create mode 100644 eugtk/examples/resources/flags/flags-falkland_islands.png
create mode 100644 eugtk/examples/resources/flags/flags-faroe_islands.png
create mode 100644 eugtk/examples/resources/flags/flags-federated_states_of_micronesia.png
create mode 100644 eugtk/examples/resources/flags/flags-fiji.png
create mode 100644 eugtk/examples/resources/flags/flags-finland.png
create mode 100644 eugtk/examples/resources/flags/flags-france.png
create mode 100644 eugtk/examples/resources/flags/flags-french_polynesia.png
create mode 100644 eugtk/examples/resources/flags/flags-french_southern_and_antarctic_lands.png
create mode 100644 eugtk/examples/resources/flags/flags-gabon.png
create mode 100644 eugtk/examples/resources/flags/flags-gambia.png
create mode 100644 eugtk/examples/resources/flags/flags-georgia.png
create mode 100644 eugtk/examples/resources/flags/flags-germany.png
create mode 100644 eugtk/examples/resources/flags/flags-ghana.png
create mode 100644 eugtk/examples/resources/flags/flags-gibraltar.png
create mode 100644 eugtk/examples/resources/flags/flags-greece.png
create mode 100644 eugtk/examples/resources/flags/flags-greenland.png
create mode 100644 eugtk/examples/resources/flags/flags-grenada.png
create mode 100644 eugtk/examples/resources/flags/flags-guam.png
create mode 100644 eugtk/examples/resources/flags/flags-guatemala.png
create mode 100644 eugtk/examples/resources/flags/flags-guernsey.png
create mode 100644 eugtk/examples/resources/flags/flags-guinea-bissau.png
create mode 100644 eugtk/examples/resources/flags/flags-guinea.png
create mode 100644 eugtk/examples/resources/flags/flags-guyana.png
create mode 100644 eugtk/examples/resources/flags/flags-haiti.png
create mode 100644 eugtk/examples/resources/flags/flags-herm.png
create mode 100644 eugtk/examples/resources/flags/flags-honduras.png
create mode 100644 eugtk/examples/resources/flags/flags-hong_kong.png
create mode 100644 eugtk/examples/resources/flags/flags-hungary.png
create mode 100644 eugtk/examples/resources/flags/flags-iceland.png
create mode 100644 eugtk/examples/resources/flags/flags-india.png
create mode 100644 eugtk/examples/resources/flags/flags-indonesia.png
create mode 100644 eugtk/examples/resources/flags/flags-iran.png
create mode 100644 eugtk/examples/resources/flags/flags-iraq.png
create mode 100644 eugtk/examples/resources/flags/flags-ireland.png
create mode 100644 eugtk/examples/resources/flags/flags-isle_of_man.png
create mode 100644 eugtk/examples/resources/flags/flags-israel.png
create mode 100644 eugtk/examples/resources/flags/flags-italy.png
create mode 100644 eugtk/examples/resources/flags/flags-jamaica.png
create mode 100644 eugtk/examples/resources/flags/flags-japan.png
create mode 100644 eugtk/examples/resources/flags/flags-jersey.png
create mode 100644 eugtk/examples/resources/flags/flags-jordan.png
create mode 100644 eugtk/examples/resources/flags/flags-kazakhstan.png
create mode 100644 eugtk/examples/resources/flags/flags-kenya.png
create mode 100644 eugtk/examples/resources/flags/flags-kiribati.png
create mode 100644 eugtk/examples/resources/flags/flags-kosovo.png
create mode 100644 eugtk/examples/resources/flags/flags-kuwait.png
create mode 100644 eugtk/examples/resources/flags/flags-kyrgyzstan.png
create mode 100644 eugtk/examples/resources/flags/flags-laos.png
create mode 100644 eugtk/examples/resources/flags/flags-latvia.png
create mode 100644 eugtk/examples/resources/flags/flags-lebanon.png
create mode 100644 eugtk/examples/resources/flags/flags-lesotho.png
create mode 100644 eugtk/examples/resources/flags/flags-liberia.png
create mode 100644 eugtk/examples/resources/flags/flags-libya.png
create mode 100644 eugtk/examples/resources/flags/flags-liechtenstein.png
create mode 100644 eugtk/examples/resources/flags/flags-lithuania.png
create mode 100644 eugtk/examples/resources/flags/flags-luxembourg.png
create mode 100644 eugtk/examples/resources/flags/flags-macau.png
create mode 100644 eugtk/examples/resources/flags/flags-macedonia.png
create mode 100644 eugtk/examples/resources/flags/flags-madagascar.png
create mode 100644 eugtk/examples/resources/flags/flags-madeira.png
create mode 100644 eugtk/examples/resources/flags/flags-malawi.png
create mode 100644 eugtk/examples/resources/flags/flags-malaysia.png
create mode 100644 eugtk/examples/resources/flags/flags-maldives.png
create mode 100644 eugtk/examples/resources/flags/flags-mali.png
create mode 100644 eugtk/examples/resources/flags/flags-malta.png
create mode 100644 eugtk/examples/resources/flags/flags-marshall_islands.png
create mode 100644 eugtk/examples/resources/flags/flags-martinique.png
create mode 100644 eugtk/examples/resources/flags/flags-mauritania.png
create mode 100644 eugtk/examples/resources/flags/flags-mauritius.png
create mode 100644 eugtk/examples/resources/flags/flags-mexico.png
create mode 100644 eugtk/examples/resources/flags/flags-moldova.png
create mode 100644 eugtk/examples/resources/flags/flags-monaco.png
create mode 100644 eugtk/examples/resources/flags/flags-mongolia.png
create mode 100644 eugtk/examples/resources/flags/flags-montenegro.png
create mode 100644 eugtk/examples/resources/flags/flags-montserrat.png
create mode 100644 eugtk/examples/resources/flags/flags-morocco.png
create mode 100644 eugtk/examples/resources/flags/flags-mozambique.png
create mode 100644 eugtk/examples/resources/flags/flags-myanmar.png
create mode 100644 eugtk/examples/resources/flags/flags-namibia.png
create mode 100644 eugtk/examples/resources/flags/flags-nauru.png
create mode 100644 eugtk/examples/resources/flags/flags-nepal.png
create mode 100644 eugtk/examples/resources/flags/flags-netherlands.png
create mode 100644 eugtk/examples/resources/flags/flags-netherlands_antilles.png
create mode 100644 eugtk/examples/resources/flags/flags-new_zealand.png
create mode 100644 eugtk/examples/resources/flags/flags-nicaragua.png
create mode 100644 eugtk/examples/resources/flags/flags-niger.png
create mode 100644 eugtk/examples/resources/flags/flags-nigeria.png
create mode 100644 eugtk/examples/resources/flags/flags-niue.png
create mode 100644 eugtk/examples/resources/flags/flags-norfolk_island.png
create mode 100644 eugtk/examples/resources/flags/flags-north_korea.png
create mode 100644 eugtk/examples/resources/flags/flags-northern_mariana_islands.png
create mode 100644 eugtk/examples/resources/flags/flags-norway.png
create mode 100644 eugtk/examples/resources/flags/flags-oman.png
create mode 100644 eugtk/examples/resources/flags/flags-pakistan.png
create mode 100644 eugtk/examples/resources/flags/flags-palau.png
create mode 100644 eugtk/examples/resources/flags/flags-palestine.png
create mode 100644 eugtk/examples/resources/flags/flags-panama.png
create mode 100644 eugtk/examples/resources/flags/flags-papua_new_guinea.png
create mode 100644 eugtk/examples/resources/flags/flags-paraguay.png
create mode 100644 eugtk/examples/resources/flags/flags-people's_republic_of_china.png
create mode 100644 eugtk/examples/resources/flags/flags-peru.png
create mode 100644 eugtk/examples/resources/flags/flags-philippines.png
create mode 100644 eugtk/examples/resources/flags/flags-pitcairn_islands.png
create mode 100644 eugtk/examples/resources/flags/flags-poland.png
create mode 100644 eugtk/examples/resources/flags/flags-portugal.png
create mode 100644 eugtk/examples/resources/flags/flags-puerto_rico.png
create mode 100644 eugtk/examples/resources/flags/flags-qatar.png
create mode 100644 eugtk/examples/resources/flags/flags-republic_of_china.png
create mode 100644 eugtk/examples/resources/flags/flags-republic_of_the_congo.png
create mode 100644 eugtk/examples/resources/flags/flags-romania.png
create mode 100644 eugtk/examples/resources/flags/flags-russia.png
create mode 100644 eugtk/examples/resources/flags/flags-rwanda.png
create mode 100644 eugtk/examples/resources/flags/flags-saba.png
create mode 100644 eugtk/examples/resources/flags/flags-saint-pierre_and_miquelon.png
create mode 100644 eugtk/examples/resources/flags/flags-saint_barthelemy.png
create mode 100644 eugtk/examples/resources/flags/flags-saint_helena.png
create mode 100644 eugtk/examples/resources/flags/flags-saint_kitts_and_nevis.png
create mode 100644 eugtk/examples/resources/flags/flags-saint_lucia.png
create mode 100644 eugtk/examples/resources/flags/flags-saint_vincent_and_the_grenadines.png
create mode 100644 eugtk/examples/resources/flags/flags-samoa.png
create mode 100644 eugtk/examples/resources/flags/flags-san_marino.png
create mode 100644 eugtk/examples/resources/flags/flags-sao_tome_and_principe.png
create mode 100644 eugtk/examples/resources/flags/flags-sark.png
create mode 100644 eugtk/examples/resources/flags/flags-saudi_arabia.png
create mode 100644 eugtk/examples/resources/flags/flags-senegal.png
create mode 100644 eugtk/examples/resources/flags/flags-serbia.png
create mode 100644 eugtk/examples/resources/flags/flags-seychelles.png
create mode 100644 eugtk/examples/resources/flags/flags-sierra_leone.png
create mode 100644 eugtk/examples/resources/flags/flags-singapore.png
create mode 100644 eugtk/examples/resources/flags/flags-sint_eustatius.png
create mode 100644 eugtk/examples/resources/flags/flags-sint_maarten.png
create mode 100644 eugtk/examples/resources/flags/flags-slovakia.png
create mode 100644 eugtk/examples/resources/flags/flags-slovenia.png
create mode 100644 eugtk/examples/resources/flags/flags-solomon_islands.png
create mode 100644 eugtk/examples/resources/flags/flags-somalia.png
create mode 100644 eugtk/examples/resources/flags/flags-south_africa.png
create mode 100644 eugtk/examples/resources/flags/flags-south_georgia_and_the_south_sandwich_islands.png
create mode 100644 eugtk/examples/resources/flags/flags-south_korea.png
create mode 100644 eugtk/examples/resources/flags/flags-spain.png
create mode 100644 eugtk/examples/resources/flags/flags-sri_lanka.png
create mode 100644 eugtk/examples/resources/flags/flags-sudan.png
create mode 100644 eugtk/examples/resources/flags/flags-suriname.png
create mode 100644 eugtk/examples/resources/flags/flags-swaziland.png
create mode 100644 eugtk/examples/resources/flags/flags-sweden.png
create mode 100644 eugtk/examples/resources/flags/flags-switzerland.png
create mode 100644 eugtk/examples/resources/flags/flags-syria.png
create mode 100644 eugtk/examples/resources/flags/flags-tajikistan.png
create mode 100644 eugtk/examples/resources/flags/flags-tanzania.png
create mode 100644 eugtk/examples/resources/flags/flags-thailand.png
create mode 100644 eugtk/examples/resources/flags/flags-togo.png
create mode 100644 eugtk/examples/resources/flags/flags-tokelau.png
create mode 100644 eugtk/examples/resources/flags/flags-tonga.png
create mode 100644 eugtk/examples/resources/flags/flags-trinidad_and_tobago.png
create mode 100644 eugtk/examples/resources/flags/flags-tristan_da_cunha.png
create mode 100644 eugtk/examples/resources/flags/flags-tunisia.png
create mode 100644 eugtk/examples/resources/flags/flags-turkey.png
create mode 100644 eugtk/examples/resources/flags/flags-turkmenistan.png
create mode 100644 eugtk/examples/resources/flags/flags-turks_and_caicos_islands.png
create mode 100644 eugtk/examples/resources/flags/flags-tuvalu.png
create mode 100644 eugtk/examples/resources/flags/flags-uganda.png
create mode 100644 eugtk/examples/resources/flags/flags-ukraine.png
create mode 100644 eugtk/examples/resources/flags/flags-united_arab_emirates.png
create mode 100644 eugtk/examples/resources/flags/flags-united_kingdom.png
create mode 100644 eugtk/examples/resources/flags/flags-united_states.png
create mode 100644 eugtk/examples/resources/flags/flags-united_states_virgin_islands.png
create mode 100644 eugtk/examples/resources/flags/flags-uruguay.png
create mode 100644 eugtk/examples/resources/flags/flags-uzbekistan.png
create mode 100644 eugtk/examples/resources/flags/flags-vanuatu.png
create mode 100644 eugtk/examples/resources/flags/flags-vatican_city.png
create mode 100644 eugtk/examples/resources/flags/flags-venezuela.png
create mode 100644 eugtk/examples/resources/flags/flags-vietnam.png
create mode 100644 eugtk/examples/resources/flags/flags-wallis_and_futuna.png
create mode 100644 eugtk/examples/resources/flags/flags-western_sahara.png
create mode 100644 eugtk/examples/resources/flags/flags-yemen.png
create mode 100644 eugtk/examples/resources/flags/flags-zambia.png
create mode 100644 eugtk/examples/resources/flags/flags-zimbabwe.png
create mode 100644 eugtk/examples/resources/floppybuddy.gif
create mode 100644 eugtk/examples/resources/geany_syntax/README.html
create mode 100644 eugtk/examples/resources/geany_syntax/compileflag.jpg
create mode 100644 eugtk/examples/resources/geany_syntax/filetype_extensions.conf
create mode 100644 eugtk/examples/resources/geany_syntax/filetypes.lua
create mode 100644 eugtk/examples/resources/geany_syntax/gneui.ex
create mode 100644 eugtk/examples/resources/gedit_syntax/README.html
create mode 100644 eugtk/examples/resources/gedit_syntax/build.xml
create mode 100644 eugtk/examples/resources/gedit_syntax/cc.png
create mode 100644 eugtk/examples/resources/gedit_syntax/classic.xml
create mode 100644 eugtk/examples/resources/gedit_syntax/cobalt.xml
create mode 100644 eugtk/examples/resources/gedit_syntax/euphoria.lang
create mode 100644 eugtk/examples/resources/gedit_syntax/gedit_syntax.xml
create mode 100644 eugtk/examples/resources/gedit_syntax/oblivion.xml
create mode 100644 eugtk/examples/resources/gnome-applets.png
create mode 100644 eugtk/examples/resources/gnome-calendar.png
create mode 100644 eugtk/examples/resources/gnome-foot.png
create mode 100644 eugtk/examples/resources/gnome-gimp.png
create mode 100644 eugtk/examples/resources/gnome-gmush.png
create mode 100644 eugtk/examples/resources/gnome-gsame.png
create mode 100644 eugtk/examples/resources/gnu-keys.png
create mode 100644 eugtk/examples/resources/hello.css
create mode 100644 eugtk/examples/resources/jerry.map
create mode 100644 eugtk/examples/resources/justin.map
create mode 100644 eugtk/examples/resources/license.txt
create mode 100644 eugtk/examples/resources/mongoose.e
create mode 100644 eugtk/examples/resources/mystyle.css
create mode 100644 eugtk/examples/resources/mystyle2.css
create mode 100644 eugtk/examples/resources/mystyle3.css
create mode 100644 eugtk/examples/resources/mystyle4.css
create mode 100644 eugtk/examples/resources/mystyle5.css
create mode 100644 eugtk/examples/resources/mystyle6.css
create mode 100644 eugtk/examples/resources/notebook_pages.txt
create mode 100644 eugtk/examples/resources/papersizes.txt
create mode 100644 eugtk/examples/resources/places_sidebar.txt
create mode 100644 eugtk/examples/resources/reset.css
create mode 100644 eugtk/examples/resources/secret_message
create mode 100644 eugtk/examples/resources/test153.ini
create mode 100644 eugtk/examples/resources/test173.ini
create mode 100644 eugtk/examples/resources/test201.ini
create mode 100644 eugtk/examples/resources/test5.e
create mode 100644 eugtk/examples/resources/text-editor.e
create mode 100644 eugtk/examples/resources/themeicons.txt
create mode 100644 eugtk/examples/resources/words.txt
create mode 100644 eugtk/examples/resources/xcolors.txt
create mode 100644 eugtk/examples/screenshots/.test1.png
create mode 100644 eugtk/examples/screenshots/README.html
create mode 100644 eugtk/examples/screenshots/Resistor Color Codes.png
create mode 100644 eugtk/examples/screenshots/Screenshot-1.png
create mode 100644 eugtk/examples/screenshots/Screenshot-11.png
create mode 100644 eugtk/examples/screenshots/Screenshot-12.png
create mode 100644 eugtk/examples/screenshots/Screenshot-14.png
create mode 100644 eugtk/examples/screenshots/Screenshot-8.png
create mode 100644 eugtk/examples/screenshots/Vancouver.png
create mode 100644 eugtk/examples/screenshots/Windows.png
create mode 100644 eugtk/examples/screenshots/broadway.png
create mode 100644 eugtk/examples/screenshots/browser.png
create mode 100644 eugtk/examples/screenshots/buttons.png
create mode 100644 eugtk/examples/screenshots/compileflag.jpg
create mode 100644 eugtk/examples/screenshots/contexthelp.png
create mode 100644 eugtk/examples/screenshots/error.png
create mode 100644 eugtk/examples/screenshots/flo.jpg
create mode 100644 eugtk/examples/screenshots/glade.png
create mode 100644 eugtk/examples/screenshots/glade_test_1.png
create mode 100644 eugtk/examples/screenshots/hangman.jpg
create mode 100644 eugtk/examples/screenshots/header1.png
create mode 100644 eugtk/examples/screenshots/hello.png
create mode 100644 eugtk/examples/screenshots/icons.jpg
create mode 100644 eugtk/examples/screenshots/icons.png
create mode 100644 eugtk/examples/screenshots/imagemenu.png
create mode 100644 eugtk/examples/screenshots/info.png
create mode 100644 eugtk/examples/screenshots/leaktest.png
create mode 100644 eugtk/examples/screenshots/menus.png
create mode 100644 eugtk/examples/screenshots/namespace.png
create mode 100644 eugtk/examples/screenshots/passwords.png
create mode 100644 eugtk/examples/screenshots/question.png
create mode 100644 eugtk/examples/screenshots/t.png
create mode 100644 eugtk/examples/screenshots/template.png
create mode 100644 eugtk/examples/screenshots/test0.png
create mode 100644 eugtk/examples/screenshots/test1.png
create mode 100644 eugtk/examples/screenshots/test109.png
create mode 100644 eugtk/examples/screenshots/test116.jpg
create mode 100644 eugtk/examples/screenshots/test136.jpg
create mode 100644 eugtk/examples/screenshots/test138.png
create mode 100644 eugtk/examples/screenshots/test150.jpg
create mode 100644 eugtk/examples/screenshots/test157.jpg
create mode 100644 eugtk/examples/screenshots/test17.jpg
create mode 100644 eugtk/examples/screenshots/test188.png
create mode 100644 eugtk/examples/screenshots/test194.jpg
create mode 100644 eugtk/examples/screenshots/test2.png
create mode 100644 eugtk/examples/screenshots/test201.png
create mode 100644 eugtk/examples/screenshots/test211.png
create mode 100644 eugtk/examples/screenshots/test212.png
create mode 100644 eugtk/examples/screenshots/test23.png
create mode 100644 eugtk/examples/screenshots/test28.png
create mode 100644 eugtk/examples/screenshots/test3.jpg
create mode 100644 eugtk/examples/screenshots/test3.png
create mode 100644 eugtk/examples/screenshots/test31.jpg
create mode 100644 eugtk/examples/screenshots/test33.jpg
create mode 100644 eugtk/examples/screenshots/test34.jpg
create mode 100644 eugtk/examples/screenshots/test5.jpg
create mode 100644 eugtk/examples/screenshots/test5.png
create mode 100644 eugtk/examples/screenshots/test59.png
create mode 100644 eugtk/examples/screenshots/test6.png
create mode 100644 eugtk/examples/screenshots/test7.jpg
create mode 100644 eugtk/examples/screenshots/test77.jpg
create mode 100644 eugtk/examples/screenshots/test84.jpg
create mode 100644 eugtk/examples/screenshots/test9.jpg
create mode 100644 eugtk/examples/screenshots/test92.png
create mode 100644 eugtk/examples/screenshots/titlebar.png
create mode 100644 eugtk/examples/screenshots/utf.png
create mode 100644 eugtk/examples/screenshots/warn.png
create mode 100644 eugtk/examples/screenshots/webkit.png
create mode 100644 eugtk/examples/screenshots/webkit_test.png
create mode 100644 eugtk/examples/screenshots/webserver.png
create mode 100644 eugtk/examples/screenshots/worldflags.jpg
create mode 100644 eugtk/examples/screenshots/x2.png
create mode 100644 eugtk/examples/screenshots/x3.png
create mode 100644 eugtk/examples/sock.ex
create mode 100644 eugtk/examples/test0.ex
create mode 100644 eugtk/examples/test1.ex
create mode 100644 eugtk/examples/test10.ex
create mode 100644 eugtk/examples/test100.ex
create mode 100644 eugtk/examples/test101.ex
create mode 100644 eugtk/examples/test102.ex
create mode 100644 eugtk/examples/test103.ex
create mode 100644 eugtk/examples/test104.ex
create mode 100644 eugtk/examples/test105.ex
create mode 100644 eugtk/examples/test106.ex
create mode 100644 eugtk/examples/test107.ex
create mode 100644 eugtk/examples/test108.ex
create mode 100644 eugtk/examples/test109.ex
create mode 100644 eugtk/examples/test11.ex
create mode 100644 eugtk/examples/test110.ex
create mode 100644 eugtk/examples/test111.ex
create mode 100644 eugtk/examples/test112.ex
create mode 100644 eugtk/examples/test113.ex
create mode 100644 eugtk/examples/test114.ex
create mode 100644 eugtk/examples/test115.ex
create mode 100644 eugtk/examples/test116.ex
create mode 100644 eugtk/examples/test117.ex
create mode 100644 eugtk/examples/test118.ex
create mode 100644 eugtk/examples/test119.ex
create mode 100644 eugtk/examples/test12.ex
create mode 100644 eugtk/examples/test120.ex
create mode 100644 eugtk/examples/test121.ex
create mode 100644 eugtk/examples/test122.ex
create mode 100644 eugtk/examples/test123.ex
create mode 100644 eugtk/examples/test124.ex
create mode 100644 eugtk/examples/test125.ex
create mode 100644 eugtk/examples/test126.ex
create mode 100644 eugtk/examples/test127.ex
create mode 100644 eugtk/examples/test128.ex
create mode 100644 eugtk/examples/test129.ex
create mode 100644 eugtk/examples/test13.ex
create mode 100644 eugtk/examples/test130.ex
create mode 100644 eugtk/examples/test131.ex
create mode 100644 eugtk/examples/test132.ex
create mode 100644 eugtk/examples/test133.ex
create mode 100644 eugtk/examples/test134.ex
create mode 100644 eugtk/examples/test135.ex
create mode 100644 eugtk/examples/test136.ex
create mode 100644 eugtk/examples/test137.ex
create mode 100644 eugtk/examples/test138.ex
create mode 100644 eugtk/examples/test139.ex
create mode 100644 eugtk/examples/test14.ex
create mode 100644 eugtk/examples/test140.ex
create mode 100644 eugtk/examples/test141.ex
create mode 100644 eugtk/examples/test142.ex
create mode 100644 eugtk/examples/test143.ex
create mode 100644 eugtk/examples/test144.ex
create mode 100644 eugtk/examples/test145.ex
create mode 100644 eugtk/examples/test146.ex
create mode 100644 eugtk/examples/test147.ex
create mode 100644 eugtk/examples/test148.ex
create mode 100644 eugtk/examples/test149.ex
create mode 100644 eugtk/examples/test15.ex
create mode 100644 eugtk/examples/test150.ex
create mode 100644 eugtk/examples/test151.ex
create mode 100644 eugtk/examples/test152.ex
create mode 100644 eugtk/examples/test153.ex
create mode 100644 eugtk/examples/test154.ex
create mode 100644 eugtk/examples/test155.ex
create mode 100644 eugtk/examples/test156.ex
create mode 100644 eugtk/examples/test157.ex
create mode 100644 eugtk/examples/test158.ex
create mode 100644 eugtk/examples/test159.ex
create mode 100644 eugtk/examples/test16.ex
create mode 100644 eugtk/examples/test160.ex
create mode 100644 eugtk/examples/test161.ex
create mode 100644 eugtk/examples/test162.ex
create mode 100644 eugtk/examples/test163.ex
create mode 100644 eugtk/examples/test164.ex
create mode 100644 eugtk/examples/test165.ex
create mode 100644 eugtk/examples/test166.ex
create mode 100644 eugtk/examples/test167.ex
create mode 100644 eugtk/examples/test168.ex
create mode 100644 eugtk/examples/test169.ex
create mode 100644 eugtk/examples/test17.ex
create mode 100644 eugtk/examples/test170.ex
create mode 100644 eugtk/examples/test171.ex
create mode 100644 eugtk/examples/test172.ex
create mode 100644 eugtk/examples/test173.ex
create mode 100644 eugtk/examples/test174.ex
create mode 100644 eugtk/examples/test175.ex
create mode 100644 eugtk/examples/test176.ex
create mode 100644 eugtk/examples/test177.ex
create mode 100644 eugtk/examples/test178.ex
create mode 100644 eugtk/examples/test179.ex
create mode 100644 eugtk/examples/test18.ex
create mode 100644 eugtk/examples/test180.ex
create mode 100644 eugtk/examples/test181.ex
create mode 100644 eugtk/examples/test182.ex
create mode 100644 eugtk/examples/test183.ex
create mode 100644 eugtk/examples/test184.ex
create mode 100644 eugtk/examples/test185.ex
create mode 100644 eugtk/examples/test186.ex
create mode 100644 eugtk/examples/test187.ex
create mode 100644 eugtk/examples/test188.ex
create mode 100644 eugtk/examples/test189.ex
create mode 100644 eugtk/examples/test19.ex
create mode 100644 eugtk/examples/test190.ex
create mode 100644 eugtk/examples/test191.ex
create mode 100644 eugtk/examples/test192.ex
create mode 100644 eugtk/examples/test193.ex
create mode 100644 eugtk/examples/test194.ex
create mode 100644 eugtk/examples/test195.ex
create mode 100644 eugtk/examples/test196.ex
create mode 100644 eugtk/examples/test197.ex
create mode 100644 eugtk/examples/test198.ex
create mode 100644 eugtk/examples/test199.ex
create mode 100644 eugtk/examples/test2.ex
create mode 100644 eugtk/examples/test20.ex
create mode 100644 eugtk/examples/test200.ex
create mode 100644 eugtk/examples/test201.ex
create mode 100644 eugtk/examples/test202.ex
create mode 100644 eugtk/examples/test203.ex
create mode 100644 eugtk/examples/test204.ex
create mode 100644 eugtk/examples/test205.ex
create mode 100644 eugtk/examples/test206.ex
create mode 100644 eugtk/examples/test207.ex
create mode 100644 eugtk/examples/test208.ex
create mode 100644 eugtk/examples/test209.ex
create mode 100644 eugtk/examples/test21.ex
create mode 100644 eugtk/examples/test210.ex
create mode 100644 eugtk/examples/test211.ex
create mode 100644 eugtk/examples/test212.ex
create mode 100644 eugtk/examples/test22.ex
create mode 100644 eugtk/examples/test23.ex
create mode 100644 eugtk/examples/test24.ex
create mode 100644 eugtk/examples/test25.ex
create mode 100644 eugtk/examples/test26.ex
create mode 100644 eugtk/examples/test27.ex
create mode 100644 eugtk/examples/test28.ex
create mode 100644 eugtk/examples/test29.ex
create mode 100644 eugtk/examples/test3.ex
create mode 100644 eugtk/examples/test30.ex
create mode 100644 eugtk/examples/test31.ex
create mode 100644 eugtk/examples/test32.ex
create mode 100644 eugtk/examples/test33.ex
create mode 100644 eugtk/examples/test34.ex
create mode 100644 eugtk/examples/test35.ex
create mode 100644 eugtk/examples/test36.ex
create mode 100644 eugtk/examples/test37.ex
create mode 100644 eugtk/examples/test38.ex
create mode 100644 eugtk/examples/test39.ex
create mode 100644 eugtk/examples/test4.ex
create mode 100644 eugtk/examples/test40.ex
create mode 100644 eugtk/examples/test41.ex
create mode 100644 eugtk/examples/test42.ex
create mode 100644 eugtk/examples/test43.ex
create mode 100644 eugtk/examples/test44.ex
create mode 100644 eugtk/examples/test45.ex
create mode 100644 eugtk/examples/test46.ex
create mode 100644 eugtk/examples/test47.ex
create mode 100644 eugtk/examples/test48.ex
create mode 100644 eugtk/examples/test49.ex
create mode 100644 eugtk/examples/test5.ex
create mode 100644 eugtk/examples/test50.ex
create mode 100644 eugtk/examples/test51.ex
create mode 100644 eugtk/examples/test52.ex
create mode 100644 eugtk/examples/test53.ex
create mode 100644 eugtk/examples/test54.ex
create mode 100644 eugtk/examples/test55.ex
create mode 100644 eugtk/examples/test56.ex
create mode 100644 eugtk/examples/test57.ex
create mode 100644 eugtk/examples/test58.ex
create mode 100644 eugtk/examples/test59.ex
create mode 100644 eugtk/examples/test6.ex
create mode 100644 eugtk/examples/test60.ex
create mode 100644 eugtk/examples/test61.ex
create mode 100644 eugtk/examples/test62.ex
create mode 100644 eugtk/examples/test63.ex
create mode 100644 eugtk/examples/test64.ex
create mode 100644 eugtk/examples/test65.ex
create mode 100644 eugtk/examples/test66.ex
create mode 100644 eugtk/examples/test67.ex
create mode 100644 eugtk/examples/test68.ex
create mode 100644 eugtk/examples/test69.ex
create mode 100644 eugtk/examples/test7.ex
create mode 100644 eugtk/examples/test70.ex
create mode 100644 eugtk/examples/test71.ex
create mode 100644 eugtk/examples/test72.ex
create mode 100644 eugtk/examples/test73.ex
create mode 100644 eugtk/examples/test74.ex
create mode 100644 eugtk/examples/test75.ex
create mode 100644 eugtk/examples/test76.ex
create mode 100644 eugtk/examples/test77.ex
create mode 100644 eugtk/examples/test78.ex
create mode 100644 eugtk/examples/test79.ex
create mode 100644 eugtk/examples/test8.ex
create mode 100644 eugtk/examples/test80.ex
create mode 100644 eugtk/examples/test81.ex
create mode 100644 eugtk/examples/test82.ex
create mode 100644 eugtk/examples/test83.ex
create mode 100644 eugtk/examples/test84.ex
create mode 100644 eugtk/examples/test85.ex
create mode 100644 eugtk/examples/test86.ex
create mode 100644 eugtk/examples/test87.ex
create mode 100644 eugtk/examples/test88.ex
create mode 100644 eugtk/examples/test89.ex
create mode 100644 eugtk/examples/test9.ex
create mode 100644 eugtk/examples/test90.ex
create mode 100644 eugtk/examples/test91.ex
create mode 100644 eugtk/examples/test92.ex
create mode 100644 eugtk/examples/test93.ex
create mode 100644 eugtk/examples/test94.ex
create mode 100644 eugtk/examples/test95.ex
create mode 100644 eugtk/examples/test96.ex
create mode 100644 eugtk/examples/test97.ex
create mode 100644 eugtk/examples/test98.ex
create mode 100644 eugtk/examples/test99.ex
create mode 100644 eugtk/examples/thumbnails/.httpd.css
create mode 100644 eugtk/examples/thumbnails/4_rhombuses.gif
create mode 100644 eugtk/examples/thumbnails/7300.jpg
create mode 100644 eugtk/examples/thumbnails/BabyTux.bmp
create mode 100644 eugtk/examples/thumbnails/BabyTux.gif
create mode 100644 eugtk/examples/thumbnails/BabyTux.png
create mode 100644 eugtk/examples/thumbnails/DISKS04.ICO
create mode 100644 eugtk/examples/thumbnails/Jacob.jpg
create mode 100644 eugtk/examples/thumbnails/Jerry.jpg
create mode 100644 eugtk/examples/thumbnails/Justin.jpg
create mode 100644 eugtk/examples/thumbnails/MorningRain.png
create mode 100644 eugtk/examples/thumbnails/README.html
create mode 100644 eugtk/examples/thumbnails/accessories-calculator.png
create mode 100644 eugtk/examples/thumbnails/applications-development.svg
create mode 100644 eugtk/examples/thumbnails/applications-graphics.png
create mode 100644 eugtk/examples/thumbnails/arc.png
create mode 100644 eugtk/examples/thumbnails/arcneg.png
create mode 100644 eugtk/examples/thumbnails/bar.gif
create mode 100644 eugtk/examples/thumbnails/bug-buddy.png
create mode 100644 eugtk/examples/thumbnails/bug-buddy.svg
create mode 100644 eugtk/examples/thumbnails/cake.png
create mode 100644 eugtk/examples/thumbnails/cal.png
create mode 100644 eugtk/examples/thumbnails/clip.png
create mode 100644 eugtk/examples/thumbnails/clipper.png
create mode 100644 eugtk/examples/thumbnails/clown.png
create mode 100644 eugtk/examples/thumbnails/clown.svg
create mode 100644 eugtk/examples/thumbnails/clown.xpm
create mode 100644 eugtk/examples/thumbnails/clown_trans.png
create mode 100644 eugtk/examples/thumbnails/cow2.jpg
create mode 100644 eugtk/examples/thumbnails/cowbell.png
create mode 100644 eugtk/examples/thumbnails/cowbell2.png
create mode 100644 eugtk/examples/thumbnails/cowbell2a.gif
create mode 100644 eugtk/examples/thumbnails/cowbell2a.png
create mode 100644 eugtk/examples/thumbnails/cowbell3.png
create mode 100644 eugtk/examples/thumbnails/coweat.png
create mode 100644 eugtk/examples/thumbnails/coweat2.png
create mode 100644 eugtk/examples/thumbnails/coweat3.png
create mode 100644 eugtk/examples/thumbnails/coweat4.png
create mode 100644 eugtk/examples/thumbnails/coweat5.png
create mode 100644 eugtk/examples/thumbnails/coweat6.png
create mode 100644 eugtk/examples/thumbnails/coweat7.png
create mode 100644 eugtk/examples/thumbnails/curveto.png
create mode 100644 eugtk/examples/thumbnails/dialog-password.png
create mode 100644 eugtk/examples/thumbnails/dino.gif
create mode 100644 eugtk/examples/thumbnails/dino_mite.gif
create mode 100644 eugtk/examples/thumbnails/dino_slo.gif
create mode 100644 eugtk/examples/thumbnails/document-print.png
create mode 100644 eugtk/examples/thumbnails/dragon.png
create mode 100644 eugtk/examples/thumbnails/e.xpm
create mode 100644 eugtk/examples/thumbnails/emblem-cool.svg
create mode 100644 eugtk/examples/thumbnails/emblem-ok.svg
create mode 100644 eugtk/examples/thumbnails/emblem-sound.png
create mode 100644 eugtk/examples/thumbnails/emblem-web-off.png
create mode 100644 eugtk/examples/thumbnails/emblem-web-on.png
create mode 100644 eugtk/examples/thumbnails/eugtk.png
create mode 100644 eugtk/examples/thumbnails/euphoria-linux.gif
create mode 100644 eugtk/examples/thumbnails/euphoria-linux.svg
create mode 100644 eugtk/examples/thumbnails/euphoria.gif
create mode 100644 eugtk/examples/thumbnails/face-cry.png
create mode 100644 eugtk/examples/thumbnails/fands.png
create mode 100644 eugtk/examples/thumbnails/favicon.ico
create mode 100644 eugtk/examples/thumbnails/fillstyle.png
create mode 100644 eugtk/examples/thumbnails/fire.png
create mode 100644 eugtk/examples/thumbnails/fish.png
create mode 100644 eugtk/examples/thumbnails/fish.svg
create mode 100644 eugtk/examples/thumbnails/font.png
create mode 100644 eugtk/examples/thumbnails/fox.png
create mode 100644 eugtk/examples/thumbnails/fox.svg
create mode 100644 eugtk/examples/thumbnails/gconf-editor.png
create mode 100644 eugtk/examples/thumbnails/giraffe.jpg
create mode 100644 eugtk/examples/thumbnails/giraffe.xpm
create mode 100644 eugtk/examples/thumbnails/glade.svg
create mode 100644 eugtk/examples/thumbnails/gnome-run.png
create mode 100644 eugtk/examples/thumbnails/gradient.png
create mode 100644 eugtk/examples/thumbnails/green_star.png
create mode 100644 eugtk/examples/thumbnails/gtk-logo-rgb.gif
create mode 100644 eugtk/examples/thumbnails/hint.png
create mode 100644 eugtk/examples/thumbnails/i.xpm
create mode 100644 eugtk/examples/thumbnails/icon-reset.png
create mode 100644 eugtk/examples/thumbnails/icon-start.png
create mode 100644 eugtk/examples/thumbnails/icon-stop.png
create mode 100644 eugtk/examples/thumbnails/image.png
create mode 100644 eugtk/examples/thumbnails/info.png
create mode 100644 eugtk/examples/thumbnails/input-mouse.png
create mode 100644 eugtk/examples/thumbnails/internet.png
create mode 100644 eugtk/examples/thumbnails/internet_trans.png
create mode 100644 eugtk/examples/thumbnails/jeff.jpg
create mode 100644 eugtk/examples/thumbnails/jls.jpg
create mode 100644 eugtk/examples/thumbnails/keybindings.png
create mode 100644 eugtk/examples/thumbnails/linecap.png
create mode 100644 eugtk/examples/thumbnails/linejoin.png
create mode 100644 eugtk/examples/thumbnails/little_house.png
create mode 100644 eugtk/examples/thumbnails/missing-image.png
create mode 100644 eugtk/examples/thumbnails/mongoose.png
create mode 100644 eugtk/examples/thumbnails/mongoose.xpm
create mode 100644 eugtk/examples/thumbnails/mouse.png
create mode 100644 eugtk/examples/thumbnails/mouse.svg
create mode 100644 eugtk/examples/thumbnails/n.png
create mode 100644 eugtk/examples/thumbnails/nature.jpg
create mode 100644 eugtk/examples/thumbnails/nature_small.jpg
create mode 100644 eugtk/examples/thumbnails/net0.png
create mode 100644 eugtk/examples/thumbnails/network-wired-disconnected.png
create mode 100644 eugtk/examples/thumbnails/network-wired.png
create mode 100644 eugtk/examples/thumbnails/notebook.png
create mode 100644 eugtk/examples/thumbnails/p.xpm
create mode 100644 eugtk/examples/thumbnails/paint.png
create mode 100644 eugtk/examples/thumbnails/passgrn.png
create mode 100644 eugtk/examples/thumbnails/passred.png
create mode 100644 eugtk/examples/thumbnails/pattern.png
create mode 100644 eugtk/examples/thumbnails/pie.png
create mode 100644 eugtk/examples/thumbnails/preferences-color.svg
create mode 100644 eugtk/examples/thumbnails/preferences-desktop-locale.svg
create mode 100644 eugtk/examples/thumbnails/r.png
create mode 100644 eugtk/examples/thumbnails/red.png
create mode 100644 eugtk/examples/thumbnails/red_star.png
create mode 100644 eugtk/examples/thumbnails/rightleft.png
create mode 100644 eugtk/examples/thumbnails/roundrect.png
create mode 100644 eugtk/examples/thumbnails/t.bmp
create mode 100644 eugtk/examples/thumbnails/t.jpg
create mode 100644 eugtk/examples/thumbnails/t.png
create mode 100644 eugtk/examples/thumbnails/t.xpm
create mode 100644 eugtk/examples/thumbnails/text-editor.png
create mode 100644 eugtk/examples/thumbnails/thunderbird.png
create mode 100644 eugtk/examples/thumbnails/thunderbird.svg
create mode 100644 eugtk/examples/thumbnails/tiphat1.gif
create mode 100644 eugtk/examples/thumbnails/ufo1.png
create mode 100644 eugtk/examples/thumbnails/ufo2.png
create mode 100644 eugtk/examples/thumbnails/updown.png
create mode 100644 eugtk/examples/thumbnails/user_icon.gif
create mode 100644 eugtk/examples/thumbnails/warn.png
create mode 100644 eugtk/examples/thumbnails/web-browser.png
create mode 100644 eugtk/examples/windows.bugs
diff --git a/eugtk/examples/.httpd.css b/eugtk/examples/.httpd.css
new file mode 100644
index 0000000..33137b6
--- /dev/null
+++ b/eugtk/examples/.httpd.css
@@ -0,0 +1,11 @@
+/*
+-- ====================================================================
+-- Styling for the remote display is set here;
+-- ====================================================================
+*/
+
+button {width: 100%;}
+button.dir {background-color: skyblue;}
+button.html {background-color: orange;}
+
+body {background-image: linear-gradient(180deg, yellow, blue); background-repeat: no-repeat;)
diff --git a/eugtk/examples/BEAR.ex b/eugtk/examples/BEAR.ex
new file mode 100644
index 0000000..b1321d2
--- /dev/null
+++ b/eugtk/examples/BEAR.ex
@@ -0,0 +1,845 @@
+
+-------------------------------------------------------------------------------
+--# BEAR (Browse, Edit And Run)
+-------------------------------------------------------------------------------
+-- Requires EuGTK version 4.11.10, GtkSourceView and WebKit2Gtk libraries.
+-- You may have to manually change the names of the libraries in GtkSourcView.plugin
+-- and/or GtkWebKit.plugin!
+
+include GtkEngine.e
+include GtkFileSelector.e
+include GtkFontSelector.e
+
+include GtkSettings.e
+
+include GtkWebKit.plugin
+include GtkSourceView.plugin
+include GtkAboutDialog.e
+
+include std/net/url.e
+include std/net/http.e
+
+------------------------------
+-- Globals
+------------------------------
+
+object current_web_page = "documentation/README.html"
+object current_net_page = ""
+object current_edit_file = ""
+object current_font = "Ubuntu mono 12"
+object current_web_folder = "~/demos"
+object current_edit_folder = "~/demos"
+object current_style = "classic"
+object uri, link, lang, tags = {}
+object svbuffer, request, lm, edit_html = 0
+constant cb = create(GtkClipboard)
+constant ini = canonical_path("~/.bear.ini")
+atom sv, menu, m1, m2, m3, m4, m5, sep, context
+atom wvsettings, svsettings, controller,sig
+integer toggle = 1, show_map = 0 -- map not used
+
+-----------------------------
+-- Styling
+-----------------------------
+constant css = create(GtkCssProvider,`
+ @define-color yellow #F5EEB5;
+ @define-color blue #B5F5F4;
+ GtkFrame,GtkToolbar {border-radius: 10px;
+ background-image:
+ -gtk-gradient (linear,
+ left top, right bottom,
+ from(@yellow), to(@blue));
+ }
+`)
+
+constant mgr = create(GtkSourceStyleSchemeManager)
+constant ids = get(mgr,"scheme ids")
+sequence sty = repeat(0,length(ids))
+ sty[1] = create(GtkRadioMenuItem,0,ids[1],_("SelectStyle"),ids[1])
+ for i = 2 to length(ids) do
+ sty[i] = create(GtkRadioMenuItem,sty[i-1],
+ ids[i],_("SelectStyle"),ids[i])
+ end for
+
+----------------------------
+-- Interface
+----------------------------
+
+constant win = create(GtkWindow,"name=MainWindow,title=The Bear,size=1200x800,border=10,$delete-event=Bail")
+
+add("MainWindow",create(GtkBox,"name=top,orientation=VERTICAL"))
+
+pack("top",create(GtkButtonBox,"name=bar,layout=2,margin-bottom=5"))
+
+add("bar",{ -- these display current file names, captions, and language type;
+ create(GtkFrame,"name=frame1"),
+ create(GtkFrame,"name=frame2"),
+ create(GtkFrame,"name=frame3"),
+ create(GtkFrame,"name=frame4")})
+
+ add("frame1",create(GtkLabel,"name=label1,text=URL,font=8"))
+ add("frame2",create(GtkLabel,"name=label2,text=TITLE,font=8"))
+ add("frame3",create(GtkLabel,"name=label3,text=LANG,font=8"))
+ add("frame4",create(GtkLabel,"name=label4,text=FILE,font=8"))
+
+
+pack("top",create(GtkPaned,"name=paned,orientation=HORIZONTAL,position=600"),TRUE,TRUE)
+ set("paned","pack1",create_webview(),1,1) -- left side contains web view;
+
+ set("paned","pack2",create(GtkBox,"name=pane2,orientation=VERTICAL"),TRUE,TRUE)
+ pack("pane2",create_sourceview(),1,1) -- right side contains source view;
+
+ pack_end("top",create(GtkBox,"name=control_box,orientation=HORIZONTAL,spacing=5"))
+ pack("control_box",{ -- container for controls at bottom of screen;
+ create(GtkFrame,"name=frame5,label=Web Page"),
+ create(GtkFrame,"name=frame6,label=Source")},TRUE,TRUE)
+
+ add("frame5",create(GtkToolbar,"name=bar1,style=2,icon size=1,font=8"))
+ add("bar1",{ -- buttons for web page navigation;
+ create(GtkToolButton,"name=netOpen,icon_name=www,label=Network",,_("OpenNetPage")),
+ create(GtkToolButton,"name=htmlOpen,stock-id=gtk-open,label=Local",,_("OpenWebPage")),
+ create(GtkToolButton,"name=htmlEdit,stock-id=gtk-edit",,_("EditHtml")),
+ create(GtkToolButton,"name=htmlBack,stock-id=gtk-go-back",,_("Back")),
+ create(GtkToolButton,"name=htmlFwd,stock-id=gtk-go-forward",,_("Fwd")),
+ create(GtkToolButton,"name=htmlFind,stock-id=gtk-find",,_("Find")),
+ create(GtkToolButton,"name=zoomOut,stock-id=gtk-zoom-out",,_("ZoomOut")),
+ create(GtkToolButton,"name=zoomIn,stock-id=gtk-zoom-in",,_("ZoomIn")),
+ create(GtkToolButton,"name=htmlHelp,stock-id=gtk-help",,_("Help"))})
+
+ add("frame6",create(GtkToolbar,"name=bar2,style=2,icon size=1,font=8"))
+ add("bar2",{ -- buttons for source view navigation;
+ create(GtkToolButton,"name=srcNew,stock-id=gtk-new",,_("fileNew")),
+ create(GtkToolButton,"name=srcOpen,stock-id=gtk-open",,_("fileOpen")),
+ create(GtkToolButton,"name=srcSave,stock-id=gtk-save",,_("fileSave")),
+ create(GtkToolButton,"name=srcSaveAs,stock-id=gtk-save-as",,_("fileSaveAs")),
+ create(GtkToolButton,"name=srcRun,stock-id=gtk-execute",,_("fileRun")),
+ create(GtkSeparatorToolItem,"draw=TRUE,expand=TRUE"),
+ create(GtkMenuToolButton,"name=srcMenu,stock-id=gtk-preferences"),
+ create(GtkToolButton,"name=srcAbout,stock-id=gtk-about",,_("About"))})
+ connect("srcMenu","clicked",_("Preferences"))
+
+ set("srcMenu","menu",build_prefs_menu())
+ connect("srcMenu","clicked",_("PopupSrcMenu"))
+ connect("MainWindow","realize",_("on_startup"))
+
+show_all("MainWindow")
+--set("MainWindow","interactive debugging",1)
+main()
+
+------------------
+function fileNew()
+------------------
+fileselector:do_overwrite_confirmation = TRUE
+fileselector:filters = {"euphoria","html","text"}
+object f = fileselector:New()
+ if not atom(f) then
+ create_file(f)
+ end if
+return 1
+end function
+
+--------------------
+function fileOpen()
+--------------------
+fileselector:filters = {"euphoria","html","css","text"}
+object f = fileselector:Open(current_edit_folder & "/*")
+if not atom(f) then
+ load_file(f)
+ current_edit_folder = pathname(f)
+end if
+return 1
+end function
+
+--------------------
+function fileSave()
+--------------------
+object f
+atom fn
+
+fileselector:do_overwrite_confirmation = FALSE
+
+if match("http://",current_edit_file) = 1 then
+ f = fileselector:Save(canonical_path(filename(fix(decode(current_edit_file)))))
+
+else
+ f = canonical_path(get("label4","text"))
+ fileselector:filters = {fileext(f)} & {"text"}
+ chdir(pathname(f))
+ f = fileselector:Save(f)
+end if
+
+if string(f) then
+
+ fn = open(f,"w")
+ write_file(fn,get(svbuffer,"text"),TEXT_MODE)
+ flush(fn)
+ close(fn)
+
+ if match("htm",fileext(f)) = 1 then
+ set("WebView","reload bypass cache")
+ current_web_folder = pathname(f)
+ else
+ current_edit_folder = pathname(f)
+ end if
+end if
+return 1
+end function
+
+-----------------------
+function fileSaveAs()
+-----------------------
+fileselector:do_overwrite_confirmation = TRUE
+
+object f = filename(current_edit_file)
+fileselector:filters = {fileext(f)} & {"text"}
+
+f = fileselector:SaveAs(f & ".backup")
+if string(f) then
+ write_file(f,get(svbuffer,"text"),TEXT_MODE)
+ if match("htm",fileext(f)) = 1 then
+ current_web_folder = pathname(f)
+ else
+ current_edit_folder = pathname(f)
+ end if
+end if
+return 1
+end function
+
+------------------
+function fileRun()
+------------------
+object f = current_edit_file
+object cmd = command_line()
+atom fn
+ cmd = pathname(get("label4","text"))
+ f = filebase(f)
+ object tmp = temp_file(canonical_path("~/"),sprintf("tmp/%s_",{f}),"ex",1)
+ if not file_exists(canonical_path("~/tmp")) then
+ create_directory(canonical_path("~/tmp"),448,1)
+ end if
+ fn = open(tmp,"w")
+ write_file(fn,get(svbuffer,"text"),TEXT_MODE)
+ flush(fn)
+ close(fn)
+ setenv("EUINC",canonical_path("~/demos"))
+ system(text:format("eui [] & ",{tmp}),0)
+return 1
+end function
+
+-------------------------------
+function create_file(object f)
+-------------------------------
+object hdr
+ lang = get(lm,"guess language",f)
+ set(svbuffer,"language",lang)
+ name = get(lang,"name")
+ switch name do
+ case "Euphoria" then hdr = euhdr
+ case "Python" then hdr = pyhdr
+ case ".ini" then hdr = inihdr
+ case "C","CSS","C++","C/C++/ObjC Header" then hdr = chdr
+ case else hdr = "-- []\n\n"
+ end switch
+ set(svbuffer,"text",format(hdr,{f}))
+ set("label3","text",get(lang,"name"))
+ set("label4","text",f)
+ write_file(f,get(svbuffer,"text"))
+ current_edit_file = f
+ current_edit_folder = pathname(f)
+return update_buttons()
+end function
+
+-------------------------------------------
+function load_file(object f, integer web=0)
+-------------------------------------------
+object txt
+ if match("file://",lower(f)) then
+ f = f[8..$]
+ end if
+
+ if file_exists(canonical_path(f)) then
+ txt = read_file(canonical_path(f))
+
+ else
+
+ if not networked() then return Warn(,,"Network down") end if
+
+ if not match("http://",f) = 1 then f = "http://" & f end if
+
+ txt = http_get(f)
+ if atom(txt) then
+ Error(,,"Error %d loading %s ",{txt,f})
+ return -1
+ else
+ txt = txt[2]
+ end if
+
+ end if
+
+ lang = get(lm,"guess language",f)
+ set(svbuffer,"language",lang)
+ set(svbuffer,"text",txt)
+ set("label3","text",get(lang,"name"))
+ set("label4","text",f)
+ current_edit_file = f
+ current_edit_folder = pathname(f)
+
+return update_buttons()
+end function
+
+----------------------
+function fix(object x)
+----------------------
+ if match("#",x) then
+ x = split(x,'#')
+ x = x[1]
+ end if
+ if match("file:",x) = 1 then
+ return x[8..$]
+ end if
+ if match("http:",x) = 1 then
+ return x[8..$]
+ end if
+ if match("https:",x) = 1 then
+ return x[9..$]
+ end if
+return x
+end function
+
+-----------------------
+function Back(atom ctl)
+-----------------------
+ set("WebView","go back")
+return update_buttons()
+end function
+
+----------------------
+function Fwd(atom ctl)
+----------------------
+ set("WebView","go forward")
+return update_buttons()
+end function
+
+---------------
+function Undo()
+---------------
+ set(svbuffer,"undo")
+return update_buttons()
+end function
+
+---------------
+function Redo()
+---------------
+ set(svbuffer,"redo")
+return update_buttons()
+end function
+
+------------------
+function ZoomIn()
+------------------
+ set("WebView","zoom level",get("WebView","zoom level") + .1)
+return 1
+end function
+
+------------------
+function ZoomOut()
+------------------
+ set("WebView","zoom level",get("WebView","zoom level") - .1)
+return 1
+end function
+
+-------------------------
+function update_buttons()
+-------------------------
+integer x = get(svbuffer,"char count")
+ set("netOpen","sensitive",networked())
+ set("srcSave","sensitive",x)
+ set("srcSaveAs","sensitive",x)
+ set("srcRun","sensitive",x)
+ if string(current_edit_file)
+ and equal("ex",fileext(current_edit_file)) then
+ set("srcRun","sensitive",equal("ex",fileext(current_edit_file)))
+ else
+ set("srcRun","sensitive",FALSE)
+ end if
+object uri = get("WebView","uri")
+ if sequence(uri) and match("htm",uri) then
+ set("htmlEdit","tooltip text",uri)
+ set("label1","text",uri)
+ set("label2","text",get("WebView","title"))
+ end if
+return 1
+end function
+
+-----------------------
+function OpenNetPage()
+-----------------------
+atom dlg = create(GtkDialog)
+set(dlg,"add button","gtk-cancel",MB_CANCEL)
+set(dlg,"add button","gtk-ok",MB_OK)
+atom ca = get(dlg,"content area")
+atom lbl = create(GtkLabel," Enter a web address beginning with http:// ")
+atom input = create(GtkEntry)
+add(ca,{lbl,input})
+show_all(dlg)
+
+if match("file://",current_net_page) = 1 then
+ set(input,"text","")
+elsif match("http://",current_net_page) = 1 then
+ set(input,"text",current_net_page)
+else
+ set(input,"text","http://" & current_net_page)
+end if
+
+object uri, request
+if run(dlg) = MB_OK then
+ uri = get(input,"text")
+ if length(uri) > 0 then
+ request = create(WebkitUriRequest,decode(uri))
+ set("WebView","load request",request)
+ end if
+end if
+
+destroy(dlg)
+return 0
+end function
+
+-----------------------
+function OpenWebPage()
+-----------------------
+fileselector:filters = {"html","css"}
+object f = fileselector:Open(current_web_folder & "/*")
+ if not atom(f) then
+ load_html(f)
+ current_web_folder = pathname(f)
+ end if
+return 1
+end function
+
+----------------------------
+function load_html(object x)
+----------------------------
+x = canonical_path(x)
+if file_type(x) = 1 then
+ set(svsettings,"search text",0)
+ request = create(WebkitUriRequest,"file://" & x)
+ set("WebView","load request",request)
+ set("label1","text",x)
+end if
+return 1
+end function
+
+--------------------------------------------------
+function on_load_changed(atom view, integer event)
+--------------------------------------------------
+object uri, ext = "?", x = 0
+object editables = {"e","ex","txt","text","ini","css","xml","glade","c","cpp","h"}
+
+ set(svsettings,"search text","")
+
+ switch event do
+ case WEBKIT_LOAD_STARTED then
+ uri = decode(get("WebView","uri"))
+ ext = fileext(filename(uri))
+ if find(ext,editables) then
+ set("WebView","stop loading")
+ load_file(uri,0)
+ end if
+
+ case WEBKIT_LOAD_REDIRECTED then
+
+ case WEBKIT_LOAD_COMMITTED then
+
+ case WEBKIT_LOAD_FINISHED then
+ uri = decode(get("WebView","uri"))
+ if find(ext,editables) = 0 then
+ current_web_page = uri
+ end if
+ current_net_page = uri
+
+ end switch
+ edit_html = 0
+
+return update_buttons()
+end function
+
+--------------------------
+function EditHtml()
+--------------------------
+object f = canonical_path(fix(get("label1","text")))
+edit_html = 1
+if file_exists(f) then
+ object txt = read_file(f)
+ if not atom(txt) then
+ load_file(f,1)
+ end if
+else
+ f = get("WebView","uri")
+ if match("#",f) then
+ f = split(f,'#')
+ f = f[1]
+ end if
+ object content = http_get(f)
+ if atom(content) then
+ Error(,,"Cannot load web page",f)
+ else
+ lang = get(lm,"guess language",f)
+ set(svbuffer,"language",lang)
+ set("label3","text",get(lang,"name"))
+ set("label4","text",f)
+ set(svbuffer,"text",content[2])
+ current_edit_file = f
+ update_buttons()
+ end if
+end if
+return 1
+end function
+
+--------------------------
+function create_webview()
+--------------------------
+atom webview = create(WebkitWebView,"name=WebView")
+atom vset = get(webview,"settings")
+ set(vset,{
+ {"enable tabs to links",TRUE},
+ {"zoom text only",FALSE},
+ {"enable developer extras",TRUE},
+ {"enable smooth scrolling",TRUE},
+ {"enable_caret_browsing",TRUE},
+ {"draw_compositing_indicators",TRUE},
+ $})
+
+ connect(webview,"load-changed",_("on_load_changed"))
+
+ wvsettings = get(webview,"settings")
+ set(wvsettings,"enable plugins",1)
+ set(wvsettings,"zoom text only",1)
+ set(wvsettings,"enable smooth scrolling",1)
+ --set(wvsettings,"auto load images",0)
+ --set(wvsettings,"enable write console messages to stdout",1)
+ --set(wvsettings,"enable spatial navigation",1)
+ --set(wvsettings,"enable tabs to links",1)
+ --set(wvsettings,"enable xss auditor",1)
+ --set(wvsettings,"minimum font size",12)
+ --set(wvsettings,"draw compositing indicators",1)
+ set(wvsettings,"enable html5 database",1)
+ set(wvsettings,"enable html5 local storage",1)
+ set(wvsettings,"enable hyperlink auditing",1)
+
+ controller = get(webview,"find controller")
+
+-- following are not implemented by webview yet;
+ --context = get(webview,"context")
+ --set(context,"preferred languages",{"en_US"})
+ --set(context,"spell checking languages",{"en_US"})
+ --set(context,"spell checking enabled",TRUE)
+
+return webview
+end function
+
+---------------
+function Find()
+---------------
+atom buffer = get(context,"buffer")
+object a = allocate(100)
+object b = allocate(100)
+object c = allocate(100)
+object x, count
+integer try = 1
+atom fn = define_c_func(LIBSV,"gtk_source_search_context_forward",{P,P,P,P},I)
+object txt = get(cb,"wait for text")
+label "retry"
+c_proc(fnBufStart,{buffer,a})
+c_proc(fnBufEnd,{buffer,b})
+ if string(txt) then
+ txt = transmute(txt,
+ {{},"<",">","&"},
+ {{},"<",">","&"})
+ txt = join(split(txt),"\\s+")
+ set(svsettings,"regex enabled",1)
+ set(svsettings,"search text",txt)
+
+ count = get(context,"occurrences count")
+ if count = -1 then
+ try += 1
+ if try > 20 then
+ return 0
+ end if
+ goto "retry"
+ else
+
+-- if count > 1 then
+-- if show_map then
+-- set("map","deiconify")
+-- set("map","present")
+-- end if
+-- else
+-- if show_map then
+-- set("map","iconify")
+-- end if
+-- end if
+
+ x = c_func(fn,{context,a,b,c})
+ set(sv,"scroll to iter",b,.25,1,0,0)
+
+ end if
+end if
+return 1
+end function
+
+-----------------------------
+function create_sourceview()
+-----------------------------
+ atom scroller = create(GtkScrolledWindow)
+ sv = create(GtkSourceView,{
+ {"name","SrcView"},
+ {"show line numbers",TRUE},
+ {"tab width",4},
+ {"indent width",4},
+ {"indent on tab",TRUE},
+ {"auto indent",TRUE},
+ {"font","Ubuntu mono bold 12"},
+ {"show right margin",TRUE},
+ {"show line marks",TRUE},
+ {"draw spaces",FALSE},
+ {"insert spaces instead of tabs",FALSE},
+ {"right margin position",90},
+ {"highlight current line",TRUE},
+ {"wrap mode",GTK_WRAP_NONE}})
+ add(scroller,sv)
+
+ set(sv,"font",current_font)
+
+-- map is commented out since only the latest WebView supports maps;
+
+-- atom win2 = create(GtkWindow,"name=map,border=10,size=80x800")
+-- atom smap = create(GtkSourceMap,"font=Ubuntu mono 4")
+--
+-- set(smap,"view",sv)
+-- add(win2,smap)
+-- set(win2,"deletable",0)
+-- set(win2,"move",0,0)
+-- set(win2,"decorated",0)
+-- show_all(win2)
+-- set(win2,"visible",show_map)
+--
+ svbuffer = get(sv,"buffer")
+
+ lm = create(GtkSourceLanguageManager)
+ svsettings = create(GtkSourceSearchSettings)
+ context = create(GtkSourceSearchContext,svbuffer,svsettings)
+
+ set(svsettings,"at word boundaries",0)
+ set(svsettings,"case sensitive",1)
+
+ atom tt = get(svbuffer,"tag table")
+ set(tt,"foreach",_("get_tags"))
+ set(tags[1],"background","red")
+ set(tags[1],"foreground","white")
+ set(tags[1],"font","bold")
+return scroller
+end function
+
+function get_tags(atom tt)
+ register(tt,GtkTextTag)
+ tags = append(tags,tt)
+return 1
+end function
+
+------------------------------------
+function ToggleMap()
+------------------------------------
+-- show_map = not(show_map)
+-- if show_map then set("map","deiconify")
+-- else set("map","iconify")
+-- end if
+return 1
+end function
+
+------------------------------------
+function ToggleLineNumbers(atom ctl)
+------------------------------------
+ set("SrcView","show line numbers",get(ctl,"active"))
+return 1
+end function
+
+------------------------------------
+function ToggleSpaces(atom ctl)
+------------------------------------
+ if get(ctl,"active") then
+ set("SrcView","draw spaces",GTK_SOURCE_DRAW_SPACES_ALL)
+ else
+ set("SrcView","draw spaces",FALSE)
+ end if
+return 1
+end function
+
+------------------------------------
+function ChooseFont(atom ctl)
+------------------------------------
+fontselector:mono_filter = TRUE
+object x = fontselector:Select(current_font)
+ if not atom(x) then
+ set("SrcView","font",x)
+ current_font = x
+ end if
+return 1
+end function
+
+-----------------------------
+function build_prefs_menu()
+-----------------------------
+ menu = create(GtkMenu)
+ m1 = create(GtkMenuItem,"Editor font",_("ChooseFont"))
+ m2 = create(GtkCheckMenuItem,"Line numbers",_("ToggleLineNumbers"))
+ m3 = create(GtkCheckMenuItem,"Draw spaces+tabs",_("ToggleSpaces"))
+ m4 = create(GtkCheckMenuItem,"Show Map",_("ToggleMap"))
+
+ atom sep1 = create(GtkSeparatorMenuItem)
+ atom sep2 = create(GtkSeparatorMenuItem)
+
+ set(menu,"append",{m1,sep1,m2,m3,sep2,sty})
+ set(m2,"name","ShowLineNumbers")
+ set(m2,"active",get("SrcView","show line numbers"))
+ set(m3,"name","DrawSpaces")
+ set(m3,"active",get("SrcView","draw spaces"))
+ set(m4,"name","ShowMap")
+ set(m4,"active",show_map)
+ set(menu,"name","popup_menu")
+ show_all(menu)
+return menu
+end function
+
+--------------------------------------------
+function SelectStyle(atom ctl, object name)
+--------------------------------------------
+if atom(name) then name = unpack(name) end if
+atom scheme = get(mgr,"scheme",name)
+set(svbuffer,"style scheme",scheme)
+set(mgr,"force rescan")
+current_style = name
+return 1
+end function
+
+-----------------------------
+function Help()
+-----------------------------
+object uri = "file://" & canonical_path("~/demos/documentation/bear.html")
+ set("WebView","load uri",uri)
+return 1
+end function
+
+-----------------------------
+function About()
+-----------------------------
+atom dlg = about:Dialog
+ set(dlg,"program name","The Bear")
+ set(dlg,"version","Version 1.3")
+ set(dlg,"logo","thumbnails/mongoose.png")
+ set(dlg,"add credit section","Using:",
+ {"Euphoria " & version_string_short(),filename(svdll),filename(wkdll)})
+ run(dlg)
+ hide(dlg)
+return 1
+end function
+
+-----------------------------
+function PopupSrcMenu()
+-------------------------------
+ set("popup_menu","popup")
+return 1
+end function
+
+-------------------------------
+function on_startup()
+-------------------------------
+settings:Load(ini)
+
+object x = get("MainWindow","data","edit_file")
+if sequence(x) and length(x) > 0 and file_exists(canonical_path(x)) then
+ load_file(canonical_path(x),1)
+end if
+
+x = get("MainWindow","data","current_web_folder")
+if sequence(x) and length(x) > 0 then
+ current_web_folder = x
+end if
+
+x = get("MainWindow","data","current_net_page")
+if sequence(x) and length(x) > 0 then
+ current_net_page = fix(x)
+ load_html(current_net_page)
+end if
+
+x = get("MainWindow","data","current_edit-folder")
+if sequence(x) and length(x) > 0 then
+ current_edit_folder = x
+end if
+
+x = get("MainWindow","data","current_style")
+if sequence(x) and length(x) > 0 then
+ current_style = x
+ x = find(current_style,ids)
+ if x > 0 and x <= length(sty) then
+ set(sty[x],"active",1)
+ end if
+end if
+
+
+set("netOpen","tooltip text","Open a web page on the WWW")
+set("htmlOpen","tooltip text","Open a local html file")
+set("srcOpen","tooltip text","Open a local text file")
+
+return 1
+end function
+
+-------------------------------
+global function Bail()
+-------------------------------
+ settings:Save(ini,{"MainWindow","paned","ShowLineNumbers","DrawSpaces","FontSelector"})
+ settings:Add(ini,"MainWindow","data.edit_file",fix(current_edit_file))
+ settings:Add(ini,"MainWindow","data.current_web_folder",current_web_folder)
+ settings:Add(ini,"MainWindow","data.current_net_page",fix(get("label1","text")))
+ settings:Add(ini,"MainWindow","data.current_edit_folder",current_edit_folder)
+ settings:Add(ini,"MainWindow","data.current_style",current_style)
+ settings:Add(ini,"SrcView","font",get("FontSelector","font"))
+
+ -- line above sets the sv font on loading, but there's no direct way to
+ -- save the sv font on exit, so we save the FontSelector current font instead,
+ -- and use that value to restore the sv font.
+
+return Quit()
+end function
+
+
+-- Boilerplate for new files;
+
+constant euhdr = `
+----------------------------
+-- []
+----------------------------
+
+
+`
+constant inihdr = `
+;---------------------------
+; []
+;---------------------------
+
+
+`
+constant pyhdr = `
+#-----------------------------
+# []
+#-----------------------------
+
+
+`
+constant chdr = `
+/*
+ []
+*/
+
+`
+--========================================================================--
+
diff --git a/eugtk/examples/GtkAboutDialog.e b/eugtk/examples/GtkAboutDialog.e
new file mode 100644
index 0000000..3176199
--- /dev/null
+++ b/eugtk/examples/GtkAboutDialog.e
@@ -0,0 +1,39 @@
+
+-------------------
+namespace about -- Generic About dialog
+-------------------
+
+export constant version = "4.12.0"
+
+--# EXPORTS: about:Dialog -- use run(about:Dialog), not show()
+
+include GtkEngine.e
+public include euphoria/info.e
+
+if not equal(version,gtk:version) then
+ Error(,,"GtkAboutDialog version mismatch","should be version " & gtk:version)
+end if
+
+export atom Dialog = create(GtkAboutDialog,{
+ {"name","about:dialog"},
+ {"logo","thumbnails/eugtk.png"},
+ {"program name",prg_name},
+ {"version","EuGTK version: " & gtk:version},
+ {"copyright",copyright},
+ {"comments","For information on the Euphoria\nprogramming language, click below"},
+
+ -- must specify custom as the license type if supplying license text;
+ {"license type",GTK_LICENSE_CUSTOM},
+ {"license",LGPL}, -- LGPL text is built into EuGTK
+ {"wrap license",0},
+
+ {"website","http://OpenEuphoria.org"},
+ {"website label","OpenEuphoria"},
+ {"authors",{"Irv Mullins"}},
+
+ --{"artists",0},
+ --{"documenters",0},
+ --{"translator credits",0},
+ --{"add credit section","Special Thanks to",{"\nBob's Burgers\nDuff's Beer"}},
+ $})
+
diff --git a/eugtk/examples/GtkCairo.e b/eugtk/examples/GtkCairo.e
new file mode 100644
index 0000000..24126d1
--- /dev/null
+++ b/eugtk/examples/GtkCairo.e
@@ -0,0 +1,643 @@
+
+----------------------------
+namespace cairo
+----------------------------
+
+export constant version = "4.12.0"
+
+include GtkEngine.e
+
+if not equal(version,gtk:version) then
+ Error(,,"GtkCairo version mismatch","should be version " & gtk:version)
+end if
+
+export constant pango_version = gtk_str_func("pango_version_string")
+
+widget[GdkCairo_t] = {"gdk_cairo",
+{Cairo_t},
+ {"new",{P},-routine_id("newGdkCairo")},
+ {"draw_from_gl",{P,P,I,I,I,I,I,I,I}}, -- 3.16
+ {"get_clip_rectangle",{P},-routine_id("getClipRect")},
+ {"set_source_pixbuf",{P,P,D,D}},
+ {"set_source_window",{P,P,D,D}},
+ {"region",{P,P}},
+ {"region_create_from_surface",{P},P},
+ {"surface_create_from_pixbuf",{P,I,P},P,0,CairoSurface_t},
+ {"set_source_rgba",{P,I,I,I,D},-routine_id("setCairoRGBA")},
+ {"set_color",{P,P},-routine_id("setCairoColor")},
+"GdkCairo_t"}
+
+ function getClipRect(atom cr)
+ atom fn = define_func("gdk_cairo_get_clip_rectangle",{P,P},B)
+ atom rect = allocate(8,1)
+ if c_func(fn,{cr,rect}) then
+ return rect
+ else return -1
+ end if
+ end function
+
+ function newGdkCairo(atom win)
+ return gtk_func("gdk_cairo_create",{P},{win})
+ end function
+
+ ----------------------------------------------------------------
+ -- to use the Cairo color specs, where colors are 0.0 => 1.0
+ ----------------------------------------------------------------------
+ function setCairoRGBA(atom cr, atom r, atom g, atom b, atom a=1)
+ gtk_proc("cairo_set_source_rgba",{P,D,D,D,D},{cr,r,g,b,a})
+ return 1
+ end function
+
+ --------------------------------------------
+ -- it's easier to use named colors
+ --------------------------------------------
+ function setCairoColor(atom cr, object color)
+ if atom(color) then color = sprintf("#%06x",color) end if
+ color = to_rgba(color)
+ color = from_rgba(color,7)
+ setCairoRGBA(cr,color[1],color[2],color[3],color[4])
+ return 1
+ end function
+
+widget[Cairo_t] = {"cairo",
+{GObject},
+ {"create",{P},P},
+ {"reference",{P},P},
+ {"destroy",{P}},
+ {"status",{P},I},
+ {"save",{P}},
+ {"restore",{P}},
+ {"get_target",{P},P,0,CairoSurface_t},
+ {"push_group",{P}},
+ {"push_group_with_content",{P,P}},
+ {"pop_group",{P},P},
+ {"pop_group_to_source",{P}},
+ {"get_group_target",{P},P},
+ {"set_source_rgb",{P,D,D,D}},
+ {"set_source",{P,P}},
+ {"get_source",{P},P},
+ {"set_source_surface",{P,P,D,D}},
+ {"set_antialias",{P,I}},
+ {"get_antialias",{P},I},
+ {"set_dash",{P,P,I,D}},
+ {"get_dash_count",{P},I},
+ {"get_dash",{P,D,D}},
+ {"set_fill_rule",{P,I}},
+ {"get_fill_rule",{P},I},
+ {"set_line_cap",{P,I}},
+ {"get_line_cap",{P},I},
+ {"set_line_join",{P,I}},
+ {"get_line_join",{P},I},
+ {"set_line_width",{P,D}},
+ {"get_line_width",{P},D},
+ {"set_miter_limit",{P,I}},
+ {"get_miter_limit",{P},I},
+ {"set_operator",{P,I}},
+ {"get_operator",{P},I},
+ {"set_tolerance",{P,D}},
+ {"get_tolerance",{P},D},
+ {"clip",{P}},
+ {"clip_preserve",{P}},
+ {"clip_extents",{P,D,D,D,D}},
+ {"in_clip",{P,D,D},B},
+ {"reset_clip",{P}},
+ {"rectangle_list_destroy",{P}},
+ {"fill",{P}},
+ {"fill_preserve",{P}},
+ {"fill_extents",{P,D,D,D,D}},
+ {"in_fill",{P,D,D},B},
+ {"mask",{P,P}},
+ {"mask_surface",{P,P,D,D}},
+ {"paint",{P}},
+ {"paint_with_alpha",{P,D}},
+ {"stroke",{P}},
+ {"stroke_preserve",{P}},
+ {"stroke_extents",{P,D,D,D,D}},
+ {"in_stroke",{P,D,D},B},
+ {"copy_page",{P}},
+ {"show_page",{P}},
+ {"copy_path",{P},P},
+ {"copy_path_flat",{P},P},
+ {"path_destroy",{P}},
+ {"append_path",{P,P}},
+ {"has_current_point",{P},B},
+ {"get_current_point",{P,D,D}},
+ {"new_path",{P}},
+ {"new_sub_path",{P}},
+ {"close_path",{P}},
+ {"set_user_data",{P,S,P,P},I},
+ {"get_user_data",{P,S}},
+ {"arc",{P,D,D,D,D,D}},
+ {"arc_negative",{P,D,D,D,D,D}},
+ {"move_to",{P,D,D}},
+ {"rel_move_to",{P,D,D}},
+ {"line_to",{P,D,D}},
+ {"rel_line_to",{P,D,D}},
+ {"rectangle",{P,D,D,D,D}},
+ {"glyph_path",{P,I,I}},
+ {"text_path",{P,S}},
+ {"curve_to",{P,D,D,D,D,D,D}},
+ {"rel_curve_to",{P,D,D,D,D,D,D}},
+ {"path_extents",{P,D,D,D,D}},
+ {"set_font_face",{P,S}},
+ {"device_get_type",{P},I},
+ {"device_status",{P},I},
+ {"status_to_string",{I},S},
+ {"translate",{P,D,D}},
+ {"scale",{P,D,D}},
+ {"rotate",{P,D}},
+ {"transform",{P,P}},
+ {"translate",{P,D,D}},
+ {"scale",{P,D,D}},
+ {"rotate",{P,D}},
+ {"transform",{P,P}},
+ {"set_matrix",{P,P}},
+ {"get_matrix",{P,P}},
+ {"identity_matrix",{P}},
+ {"user_to_device",{P,D,D}},
+ {"user_to_device_distance",{P,D,D}},
+ {"device_to_user",{P,D,D}},
+ {"device_to_user_distance",{P,D,D}},
+ {"version",{},I},
+ {"version_string",{},S},
+ {"set_font_size",{P,D}},
+ {"set_font_matrix",{P,P}},
+ {"get_font_matrix",{P,P}},
+ {"set_font_options",{P,P}},
+ {"get_font_options",{P,P}},
+ {"select_font_face",{P,S,I,I}},
+ {"get_font_face",{P},P},
+ {"set_scaled_font",{P,P}},
+ {"get_scaled_font",{P},P},
+ {"show_glyphs",{P,P}},
+ {"show_text_glyphs",{P,S,I,P,I,P,I,I}},
+ {"font_extents",{P,P}},
+ {"text_extents",{P,S,P}},
+ {"glyph_extents",{P,P,I,P}},
+ {"toy_font_face_create",{S,I,I},P},
+ {"toy_font_face_get_slant",{P},I},
+ {"toy_font_face_get_weight",{P},I},
+ {"glyph_allocate",{I},P},
+ {"glyph_free",{P}},
+ {"text_cluster_allocate",{I},P},
+ {"text_cluster_free",{P}},
+ {"show_text",{P,S}},
+ {"set_source_rgba",{P,D,D,D,D},-routine_id("setCairoRGBA")},
+ {"set_color",{P,S},-routine_id("setCairoColor")},
+ {"should_draw_window",{P,P},-routine_id("CairoShouldDrawWin")},
+ {"transform_to_window",{P,P,P},-routine_id("CairoTransformToWin")},
+"Cairo_t"}
+
+ function CairoShouldDrawWin(atom cr, atom win)
+ return gtk_func("gtk_cairo_should_draw_window",{P,P},{cr,win})
+ end function
+
+ function CairoTransformToWin(atom cr, atom win1, atom win2)
+ gtk_proc("gtk_cairo_transform_to_window",{P,P,P},{cr,win1,win2})
+ return 1
+ end function
+
+widget[CairoPattern_t] = {0,
+{Cairo_t},
+"CairoPattern_t"}
+
+widget[CairoFontOptions] = {"cairo_font_options",
+{0},
+"CairoFontOptions"}
+
+widget[CairoContent_t] = {0,
+{Cairo_t},
+"CairoContent_t"}
+
+widget[CairoStatus_t] = {0,
+{0},
+"CairoStatus_t"}
+
+widget[CairoPattern] = {"cairo_pattern",
+{CairoPattern_t},
+ {"new",{P},-routine_id("newCairoPattern")},
+ {"add_color_stop_rgb",{P,D,D,D,D}},
+ {"add_color_stop_rgba",{P,D,D,D,D,D}},
+ {"get_color_stop_count",{P,I},P,0,CairoStatus_t},
+ {"get_color_stop_rgba",{P,I,D,D,D,D,D},P,0,CairoStatus_t},
+ {"create_rgb",{D,D,D},P,0,CairoPattern_t},
+ {"create_rgba",{D,D,D,D},P,0,CairoPattern_t},
+ {"get_rgba",{P,D,D,D,D},P,0,CairoPattern_t},
+ {"create_for_surface",{P},P,0,CairoPattern_t},
+ {"reference",{P},P,0,CairoPattern_t},
+ {"destroy",{P}},
+ {"status",{P},P,0,CairoStatus_t},
+ {"set_extend",{P,I}},
+ {"get_extend",{P},I},
+ {"set_filter",{P,I}},
+ {"get_filter",{P},I},
+ {"set_matrix",{P,P}},
+ {"get_matrix",{P,P}},
+ {"get_type",{P},I},
+ {"get_reference_count",{P},I},
+"CairoPattern"}
+
+ function newCairoPattern(atom surf)
+ return gtk_func("cairo_pattern_create_for_surface",{P},{surf})
+ end function
+
+widget[CairoLinearGradient] = {"cairo_pattern",
+{CairoPattern},
+ {"new",{D,D,D,D},-routine_id("newLinearGradient"),0,CairoPattern_t},
+ {"get_linear_points",{P,D,D,D,D},P,0,CairoStatus_t},
+"CairoLinearGradient"}
+
+ function newLinearGradient(atom a, atom b, atom c, atom d)
+ return gtk_func("cairo_pattern_create_linear",{D,D,D,D},{a,b,c,d})
+ end function
+
+widget[CairoRadialGradient] = {"cairo_pattern",
+{CairoPattern},
+ {"new",{D,D,D,D,D,D},-routine_id("newRadialGradient"),0,CairoPattern_t},
+ {"get_radial_circles",{P,D,D,D,D,D,D},P,0,CairoStatus_t},
+"CairoRadialGradient"}
+
+ function newRadialGradient(atom a, atom b, atom c, atom d, atom e, atom f)
+ return gtk_func("cairo_pattern_create_radial",{D,D,D,D,D,D},{a,b,c,d,e,f})
+ end function
+
+widget[CairoRegion_t] = {"cairo_region_t", -- FIXME!
+{Cairo_t},
+"CairoRegion_t"}
+
+widget[CairoSurface_t] = {"cairo_surface_t",
+{Cairo_t},
+ {"get_write_to_png",{P,S},-routine_id("writetoPNG")},
+ {"create_similar",{P,P,I,I},P,0,CairoSurface_t},
+ {"create_for_rectangle",{P,D,D,D,D},P,0,CairoSurface_t},
+ {"reference",{P},P,0,CairoSurface_t},
+ {"destroy",{P}},
+ {"finish",{P}},
+ {"flush",{P}},
+ {"get_font_options",{P,P}},
+ {"mark_dirty",{P}},
+ {"mark_dirty_rectangle",{P,I,I,I,I}},
+ {"show_page",{P}},
+"CairoSurface_t"}
+
+ function writetoPNG(atom surf, object name) -- note difference in call name;
+ return gtk_func("cairo_surface_write_to_png",{P,S},{surf,name})
+ end function
+
+widget[CairoImageSurface] = {"cairo_image_surface",
+{CairoSurface_t},
+ {"new",{P},-routine_id("newCairoImageSurface")},
+ {"get_format",{P},I},
+ {"get_width",{P},P},
+ {"get_height",{P},P},
+ {"get_stride",{P},I},
+"CairoImageSurface"}
+
+ function newCairoImageSurface(object png)
+ if string(png) then
+ png = locate_file(png) if file_type(png) = 1 then
+ png = allocate_string(png)
+ end if
+ end if
+ return gtk_func("cairo_image_surface_create_from_png",{S},{png})
+ end function
+
+widget[PangoCairoLayout] = {"pango_cairo",
+{PangoLayout},
+ {"new",{P},-routine_id("newPangoCairoLayout")},
+ {"update_layout",{P,P},-routine_id("updateLayout")},
+ {"show_glyph_string",{P,P,P}},
+ {"show_glyph_item",{P,S,P}},
+ {"show_layout_line",{P,P}},
+ {"layout_line_path",{P,P}},
+ {"layout_path",{P,P}},
+"PangoCairoLayout"}
+
+ function newPangoCairoLayout(atom cr)
+ atom pcl = gtk_func("pango_cairo_create_layout",{P},{cr})
+ register(pcl,PangoLayout)
+ return pcl
+ end function
+
+ function updateLayout(atom pl, atom cr) -- params swapped;
+ gtk_proc("pango_cairo_update_layout",{P,P},{cr,pl})
+ return 1
+ end function
+
+widget[PangoFont] = {"pango_font",
+{0},
+ {"describe",{P},P,0,PangoFontDescription},
+ {"describe_with_absolute_size",{P},P,0,PangoFontDescription},
+ {"get_coverage",{P,P},P},
+ {"get_metrics",{P,P},P},
+ {"get_font_map",{P},P,0,PangoFontMap},
+"PangoFont"}
+
+widget[PangoAttrList] = {"pango_attr_list",
+{0},
+"PangoAttrList"}
+
+widget[PangoFontDescription] = {"pango_font_description",
+{PangoFont},
+ {"new",{P},-routine_id("newPangoFontDescription")},
+ {"copy",{P},P,0,PangoFontDescription},
+ {"copy_static",{P},P,0,PangoFontDescription},
+ {"hash",{P},I},
+ {"equal",{P,P},B},
+ {"free",{P}},
+ {"set_family",{P,S}},
+ {"set_family_static",{P,S}},
+ {"get_family",{P},S},
+ {"set_style",{P,I}},
+ {"get_style",{P},I},
+ {"set_variant",{P,I}},
+ {"get_variant",{P},P},
+ {"set_weight",{P,I}},
+ {"get_weight",{P},I},
+ {"set_stretch",{P,I}},
+ {"get_stretch",{P},I},
+ {"set_size",{P,I}},
+ {"get_size",{P},I},
+ {"set_absolute_size",{P,D}},
+ {"get_size_is_absolute",{P},B},
+ {"set_gravity",{P,I}},
+ {"get_gravity",{P},I},
+ {"get_set_fields",{P},I},
+ {"unset_fields",{P,I}},
+ {"merge",{P,P,B}},
+ {"merge_static",{P,P,B}},
+ {"better_match",{P,P,P},B},
+ -- from_string, see new
+ {"to_string",{P},S},
+ {"to_filename",{P},S},
+"PangoFontDescription"}
+
+ function newPangoFontDescription(object name=0)
+ if atom(name) then
+ return gtk_func("pango_font_description_new")
+ else
+ return gtk_func("pango_font_description_from_string",{P},{allocate_string(name,1)})
+ end if
+ end function
+
+widget[PangoContext] = {"pango_context",
+{GObject},
+ {"new",{},P},
+ {"load_font",{P,P},P},
+ {"load_fontset",{P,P,P},P},
+ {"get_metrics",{P,P,P},P},
+ {"list_families",{P,A,I}},
+ {"set_font_description",{P,P}},
+ {"get_font_description",{P},P,0,PangoFontDescription},
+ {"set_font_map",{P,P}},
+ {"get_font_map",{P},P},
+ {"set_base_gravity",{P,I}},
+ {"get_language",{P},P},
+ {"set_language",{P,P}},
+ {"get_layout",{P},P},
+ {"get_base_dir",{P},I},
+ {"set_base_dir",{P,I}},
+ {"get_base_gravity",{P},I},
+ {"set_base_gravity",{P,I}},
+ {"get_gravity",{P},I},
+ {"get_gravity_hint",{P},I},
+ {"set_gravity_hint",{P,I}},
+ {"get_matrix",{P},P},
+ {"set_matrix",{P,P}},
+"PangoContext"}
+
+widget[PangoFontsetSimple] = {"pango_fontset_simple",
+{GObject},
+ {"new",{P},P},
+ {"append",{P,P}},
+ {"size",{P},I},
+"PangoFontsetSimple"}
+
+widget[PangoFontSet] = {"pango_fontset",
+{PangoFontsetSimple},
+ {"get_font",{P,I},P,0,PangoFont},
+ {"get_metrics",{P},P},
+ {"foreach",{P,P,P}},
+"PangoFontSet"}
+
+widget[PangoFontMap] = {"pango_font_map",
+{PangoFontSet},
+ {"create_context",{P},P},
+ {"load_font",{P,P,S},P},
+ {"load_fontset",{P,P,S,P},P},
+ {"list_families",{P,A,I}},
+ {"get_shape_engine_type",{P},S},
+ {"get_serial",{P},I},
+ {"changed",{P}},
+"PangoFontMap"}
+
+widget[PangoFontFace] = {"pango_font_face",
+{PangoFontMap},
+ {"get_face_name",{P},S},
+ {"list_sizes",{P,P,I}},
+ {"describe",{P},P,0,PangoFontDescription},
+ {"is_synthesized",{P},B},
+"PangoFontFace"}
+
+widget[PangoFontFamily] = {"pango_font_family",
+{PangoFontFace},
+ {"get_name",{P},S},
+ {"is_monospace",{P},B},
+ {"list_faces",{P,P,I}},
+"PangoFontFamily"}
+
+widget[PangoLayout] = {"pango_layout",
+{GObject},
+ {"new",{P},-routine_id("newPangoLayout")},
+ {"set_text",{P,P},-routine_id("pl_set_text")},
+ {"get_text",{P},S},
+ {"get_character_count",{P},I},
+ {"set_markup",{P,S},-routine_id("pl_set_markup")},
+ {"set_markup_with_accel",{P,S,I,I},-routine_id("pl_set_markup_with_accel")},
+ {"set_font_description",{P,P}},
+ {"get_font_description",{P},P},
+ {"set_attributes",{P,P}},
+ {"get_attributes",{P},P,0,PangoAttrList},
+ {"set_width",{P,I}},
+ {"get_width",{P},I},
+ {"set_height",{P,I}},
+ {"get_height",{P},I},
+ {"get_size",{P,I,I}},
+ {"get_pixel_size",{P,I,I}},
+ {"set_wrap",{P,I}},
+ {"get_wrap",{P},I},
+ {"is_wrapped",{P},B},
+ {"set_ellipsize",{P,I}},
+ {"get_ellipsize",{P},I},
+ {"is_ellipsized",{P},B},
+ {"set_indent",{P,I}},
+ {"get_extents",{P,P,P}},
+ {"get_indent",{P},I},
+ {"get_pixel_size",{P,I,I}},
+ {"get_size",{P,I,I}},
+ {"set_spacing",{P,I}},
+ {"get_spacing",{P},I},
+ {"set_justify",{P,B}},
+ {"get_justify",{P},B},
+ {"set_auto_dir",{P,B}},
+ {"get_auto_dir",{P},B},
+ {"set_alignment",{P,P}},
+ {"get_alignment",{P},P},
+ {"set_tabs",{P,A}},
+ {"get_tabs",{P},A},
+ {"set_single_paragraph_mode",{P,B}},
+ {"get_single_paragraph_mode",{P},B},
+ {"get_unknown_glyphs_count",{P},I},
+ {"get_log_attrs",{P,P,I}},
+ {"get_log_attrs_readonly",{P,I},P},
+ {"index_to_pos",{P,I,P}},
+ {"index_to_line_x",{P,I,B,I,I}},
+ {"xy_to_line",{P,I,I,I,I},B},
+ {"get_cursor_pos",{P,I,P,P}},
+ {"move_cursor_visually",{P,B,I,I,I,I,I}},
+ {"get_pixel_extents",{P,P,P}},
+ {"get_baseline",{P},I},
+ {"get_line_count",{P},I},
+ {"get_line",{P,I},P,0,PangoLayoutLine},
+ {"get_line_readonly",{P,I},P,0,PangoLayoutLine},
+ {"get_lines",{P},A,0,GSList},
+ {"get_lines_readonly",{P},A,0,GSList},
+ {"get_iter",{P},P,0,PangoLayoutIter},
+ {"show_layout",{P,P},-routine_id("pl_show_layout")},
+ {"get_context",{P},P,0,PangoContext},
+ {"context_changed",{P}},
+ {"get_serial",{P},I},
+ {"get_extents",{P,P,P}},
+"PangoLayout"}
+
+ function newPangoLayout(atom cr=0)
+ if cr=0 then
+ Error(,,"requires cairo_t as param!")
+ end if
+ return gtk_func("pango_cairo_create_layout",{P},{cr})
+ end function
+
+ function pl_set_text(atom layout, object txt)
+ if string(txt) then
+ txt = allocate_string(txt,1)
+ end if
+ gtk_proc("pango_layout_set_text",{P,P,I},{layout,txt,-1})
+ return 1
+ end function
+
+ function pl_set_markup(atom layout, object txt)
+ if string(txt) then
+ txt = allocate_string(txt,1)
+ end if
+ gtk_proc("pango_layout_set_markup",{P,P,I},{layout,txt,-1})
+ return 1
+ end function
+
+ function pl_set_markup_with_accel(atom layout, object txt,
+ integer marker, integer char)
+ if string(txt) then
+ txt = allocate_string(txt,1)
+ end if
+ gtk_proc("pango_layout_set_markup_with_accel",{P,P,I,I,I},
+ {layout,txt,-1,marker,char})
+ return 1
+ end function
+
+ function pl_show_layout(atom pcl, atom cr)
+ gtk_proc("pango_cairo_show_layout",{P,P},{cr,pcl})
+ return 1
+ end function
+
+widget[PangoLayoutLine] = {"pango_layout_line",
+{0},
+ {"ref",{P},P},
+ {"unref",{P}},
+ {"get_extents",{P,P,P}},
+ {"get_pixel_extents",{P,P,P}},
+ {"index_to_x",{P,I,B,I}},
+ {"x_to_index",{P,I,I,I},B},
+ {"get_x_ranges",{P,I,I,P,P}},
+"PangoLayoutLine"}
+
+widget[PangoLayoutIter] = {"pango_layout_iter",
+{0},
+ {"copy",{P},P,0,PangoLayoutIter},
+ {"free",{P}},
+ {"next_run",{P},B},
+ {"next_char",{P},B},
+ {"next_cluster",{P},B},
+ {"next_line",{P},B},
+ {"at_last_line",{P},B},
+ {"get_index",{P},I},
+ {"get_baseline",{P},I},
+ {"get_run",{P},P,0,PangoLayoutRun},
+ {"get_run_readonly",{P},P,0,PangoLayoutRun},
+ {"get_line",{P},P,0,PangoLayoutLine},
+ {"get_line_readonly",{P},P,0,PangoLayoutLine},
+ {"get_layout",{P},P,0,PangoLayout},
+ {"get_char_extents",{P,P}},
+ {"get_cluster_extents",{P,P,P}},
+ {"get_run_extents",{P,P,P}},
+ {"get_line_yrange",{P,I,I}},
+ {"get_line_extents",{P,P,P}},
+ {"get_layout_extents",{P,P,P}},
+"PangoLayoutIter"}
+
+widget[PangoLayoutRun] = {"pango_layout_run",
+{0},
+"PangoLayoutRun"}
+
+widget[PangoTabArray] = {"pango_tab_array",
+{0},
+ {"new",{I,B},P},
+ {"get_size",{P},I},
+ {"resize",{P,I}},
+ {"set_tab",{P,I,I,I}},
+ {"get_tab",{P,I,P,P}},
+ {"get_tabs",{P,P,P}},
+ {"get_position_in_pixels",{P},B},
+"PangoTabArray"}
+
+widget[PangoLanguage] = {"pango_language",
+{GObject},
+ {"new",{S},-routine_id("newPangoLanguage")},
+ {"get_default",{P},-routine_id("getDefaultLanguage")},
+ {"get_sample_string",{P},-routine_id("getSampleStr")},
+ {"to_string",{P},S},
+ {"matches",{P,S},B},
+ {"includes_script",{P,P},B},
+"PangoLanguage"}
+
+ function newPangoLanguage(object s)
+ return gtk_func("pango_language_from_string",{S},{s})
+ end function
+
+ function getDefaultLanguage(object junk)
+ return gtk_str_func("pango_language_get_default")
+ end function
+
+ function getSampleStr(object x)
+ return gtk_str_func("pango_language_get_sample_string",{P},{x})
+ end function
+
+export enum by * 2
+ PANGO_STRETCH_ULTRA_CONDENSED,
+ PANGO_STRETCH_EXTRA_CONDENSED,
+ PANGO_STRETCH_CONDENSED,
+ PANGO_STRETCH_SEMI_CONDENSED,
+ PANGO_STRETCH_NORMAL,
+ PANGO_STRETCH_SEMI_EXPANDED,
+ PANGO_STRETCH_EXPANDED = 64,
+ PANGO_STRETCH_EXTRA_EXPANDED,
+ PANGO_STRETCH_ULTRA_EXPANDED
+
+export enum by * 2
+ PANGO_FONT_MASK_FAMILY,
+ PANGO_FONT_MASK_STYLE,
+ PANGO_FONT_MASK_VARIANT,
+ PANGO_FONT_MASK_WEIGHT,
+ PANGO_FONT_MASK_STRETCH,
+ PANGO_FONT_MASK_SIZE,
+ PANGO_FONT_MASK_GRAVITY
+
+
diff --git a/eugtk/examples/GtkEngine.e b/eugtk/examples/GtkEngine.e
new file mode 100644
index 0000000..d3e9129
--- /dev/null
+++ b/eugtk/examples/GtkEngine.e
@@ -0,0 +1,9648 @@
+
+-------------
+namespace gtk
+-------------
+
+------------------------------------------------------------------------
+-- This library is free software; you can redistribute it
+-- and/or modify it under the terms of the GNU Lesser General
+-- Public License as published by the Free Software Foundation;
+-- either version 2 of the License, or (at your option) any later
+-- version.
+
+-- This library is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+-- See the GNU Lesser General Public License for more details.
+
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Pl, Suite 330, Boston, MA 02111-1307 USA
+------------------------------------------------------------------------
+
+export constant
+ version = "4.12.0",
+ release = "Sept 1, 2016",
+ copyright = " © 2016 by Irv Mullins"
+
+public object ACCEL_FONT = "italic 10" -- affects accels in menus;
+public integer BTN_ICON_SIZE = 20 -- pixels;
+public integer BTN_TEXT_SIZE = 12
+public integer BTN_SHOW_IMG = 1
+
+public include GtkEnums.e
+
+-- GtkEnums includes most of Eu std libraries as public,
+-- making them available to your eu programs without
+-- having to specifically include them.
+
+if not equal(gtk:version,enums:version) then -- these 2 must be in sync!
+ crash("Version mismatch: GtkEnums should be version %s",{version})
+end if
+
+-- std/math, std/locale, std/datetime, etc. aren't made
+-- public, because that would cause too many conflicts,
+-- requiring you to use namespaces everywhere,
+-- but we do need them here;
+
+include std/datetime.e
+include std/locale.e
+include std/math.e
+include std/net/dns.e
+include std/utils.e
+include std/net/http.e
+include std/pipeio.e as pipe
+
+public constant -- 'shorthand' identifiers to save space in method prototypes;
+ P = C_POINTER, -- any valid pointer
+ B = C_BYTE, -- 8 bits (boolean)
+ I = C_INT, -- 32 (integer)
+ S = E_ATOM, -- 64 (string)
+ D = C_DOUBLE, -- 64 (double)
+ F = C_FLOAT, -- 32 (float)
+ A = E_INTEGER, -- 32/64 (glist ptr)
+ X = E_OBJECT, -- 32/64 (array of pointers)
+ V = E_SEQUENCE -- 32/64 (pointer to array of strings)
+
+-- hopefully, the above are compatible with both 32 and 64-bit architectures
+
+export object LIBS -- a single lib in UNIX, a sequence of dll's for Windows;
+
+ifdef OSX then -- thanks to Pete Eberlein for testing with OSX!
+ LIBS = {open_dll("/opt/local/lib/libgtk-3.dylib" )}
+
+elsifdef UNIX then -- Linux, BSD, etc.
+ LIBS = {open_dll("libgtk-3.so.0" )}
+
+elsifdef WINDOWS then
+
+object path = "C:/Program Files/GTK3-Runtime Win64/bin/" -- 3.18.6 is the vers. tested.
+
+ LIBS = dir(path & "*.dll") -- get a list of all .dll's in that folder;
+ LIBS = vslice(LIBS,1) -- retain only the filenames;
+
+ if atom(LIBS) then -- none found;
+ crash("\nFATAL ERROR:\n************ Cannot find GTK runtime libraries (.dlls)\n")
+ end if
+
+ atom x
+
+ for i = 1 to length(LIBS) do -- load each;
+ x = open_dll(LIBS[i])
+ if x = 0 then
+ display("Error loading []",{LIBS[i]})
+ else
+ LIBS[i] = x -- append this lib to list of libs;
+ end if
+ end for
+
+end ifdef -- PLATFORMS;
+
+if not object(LIBS) then -- no point in continuing;
+ crash("Required libraries not found!")
+end if
+
+constant cmd = pad_tail(command_line(),4,"")
+
+if not gtk_func("gtk_init_check",{P,P},{0,0}) then -- initialize the GTK library;
+ crash("GTK Library error - cannot init GTK!")
+
+else -- success!
+ gtk_proc("g_set_prgname",{S}," " & filename(cmd[2])) -- set default pgm name;
+ gtk_proc("g_type_init",{}) -- initialize normal GTK types;
+
+end if
+
+public constant -- two special types must be initialized at run-time;
+ gPIX = gtk_func("gdk_pixbuf_get_type"),
+ gCOMBO = gtk_func("gtk_combo_box_get_type")
+
+-------------------------------------------------------------
+-- Obtain a lot of sometimes useful system info;
+-------------------------------------------------------------
+include euphoria/info.e
+
+constant os_info = os:uname()
+
+export object
+
+ major_version = gtk_func("gtk_get_major_version"),
+ minor_version = gtk_func("gtk_get_minor_version"),
+ micro_version = gtk_func("gtk_get_micro_version"),
+
+ user_name = gtk_str_func("g_get_user_name"),
+ real_name = gtk_str_func("g_get_real_name"),
+
+ curr_dir = current_dir(),
+ home_dir = gtk_str_func("g_get_home_dir"),
+ temp_dir = gtk_str_func("g_get_tmp_dir"),
+ data_dir = gtk_str_func("g_get_user_data_dir"),
+ conf_dir = gtk_str_func("g_get_user_config_dir"),
+ runt_dir = gtk_str_func("g_get_user_runtime_dir"),
+
+ app_name = gtk_str_func("g_get_application_name"),
+ prg_name = gtk_str_func("g_get_prgname"),
+ lang_ = gtk_func("gtk_get_default_language"),
+ def_lang = gtk_str_func("pango_language_to_string",{P},{lang_}),
+ login = pathname(cmd[2]),
+
+ os_pid = os:get_pid(), -- process id: e.g:1234
+ os_name = os_info[1], -- e.g: Linux
+ os_distro = os_info[2], -- e.g: Mint17
+ os_version = os_info[3], -- e.g: 3.13.0-24-generic
+ os_compiled = os_info[4],
+ os_arch = os_info[5], -- e.g: AMD64
+ os_inc = getenv("EUINC"),
+ os_dir = getenv("EUDIR"),
+ os_path = getenv("PATH"),
+ os_shell = getenv("SHELL"),
+ os_term = getenv("TERM"),
+
+ eu_platform = platform_name(),
+ host_name = gtk_str_func("g_get_host_name"),
+ host_addr = "127.0.0.1"
+
+ifdef BITS64 then
+ constant eu_arch_bits = "64"
+elsedef
+ constant eu_arch_bits = "32"
+end ifdef
+
+if atom(os_term) then os_term = "none" end if
+
+ifdef WINDOWS then
+ user_name = getenv("USERNAME")
+ real_name = getenv("USERNAME")
+ home_dir = getenv("HOMEPATH")
+ temp_dir = getenv("TEMP")
+ os_name = getenv("OS")
+ os_term = getenv("SESSIONNAME")
+ os_compiled = getenv("PROCESSOR_IDENTIFIER")
+end ifdef
+
+-- following added because Windows misbehaves in the ifdef above :(
+
+if atom(os_term) then os_term = getenv("SESSIONNAME") end if
+if atom(os_shell) then os_shell = getenv("ComSpec") end if
+if atom(os_arch) then os_arch = getenv("PROCESSOR_ARCHITECTURE") end if
+
+export object info = { -- above system info in key/value form, sometimes this is useful;
+ "version=" & version,
+ "release=" & release,
+ "copyright=" & copyright,
+ "major=" & to_string(major_version),
+ "minor=" & to_string(minor_version),
+ "micro=" & to_string(micro_version),
+ "user_name=" & user_name,
+ "real_name=" & real_name,
+ "host_name=" & host_name,
+ "host_addr=" & host_addr,
+ "home_dir=" & home_dir,
+ "temp_dir=" & temp_dir,
+ "curr_dir=" & curr_dir,
+ "data_dir=" & data_dir,
+ "conf_dir=" & conf_dir,
+ "runt_dir=" & runt_dir,
+ "app_name=" & app_name,
+ "prg_name=" & prg_name,
+ "os_pid=" & to_string(os:get_pid()),
+ "os_name=" & os_info[1],
+ "os_distro=" & os_info[2],
+ "os_vers=" & os_info[3],
+ "os_comp=" & os_compiled,
+ "os_arch=" & os_arch,
+ "os_term=" & os_term,
+ "os_shell=" & os_shell,
+ "os_inc=" & os_inc,
+ "os_dir=" & os_dir,
+ "os_path=" & os_path,
+ "def_lang=" & def_lang,
+ "eu_version=" & version_string_short(),
+ "eu_revision=" & to_string(version_revision()),
+ "eu_platform=" & eu_platform,
+ "eu_arch_bits=" & eu_arch_bits,
+ "eu_date=" & version_date(),
+ "today=" & datetime:format(datetime:now(),"%A %B %d, %Y"),
+ "start_time=" & datetime:format(datetime:now(),"%H:%M:%S"),
+ "CMD1=" & cmd[1],
+ "CMD2=" & canonical_path(cmd[2]),
+ "CMD3=" & pathname(canonical_path(cmd[2])),
+ $}
+
+---------------------------
+export function networked()
+---------------------------
+atom m = gtk_func("g_network_monitor_get_default")
+return gtk_func("g_network_monitor_get_network_available",{P},{m})
+end function
+
+-----------------------------------
+export function inet_connected() -- ping msftncsi
+-----------------------------------
+atom err = allocate(8) err = 0
+atom x = gtk_func("g_network_address_parse_uri",{P,I,P},
+ {allocate_string("www.msftncsi.com"),80,err})
+if x > 0 then return gtk_str_func("g_socket_connectable_to_string",{P},{x})
+else return x
+end if
+end function
+
+--------------------------------
+export function get_net_address()
+--------------------------------
+ object results
+ object addr
+
+ ifdef UNIX then
+ sequence tmp = temp_file(,"MYIP-")
+ system_exec(sprintf(`ifconfig | grep "inet addr:" > %s`,{tmp}),2)
+ results = trim(read_file(tmp))
+ results = split(results," ")
+ delete_file(tmp)
+ for i = 1 to length(results) do
+ if match("inet addr:",results[i]) = 1 then
+ addr = split(results[i],':')
+ host_addr = addr[2]
+ info[11] = "host_addr=" & host_addr
+ return host_addr
+ end if
+ end for
+ end ifdef
+
+ return "127.0.0.1"
+end function
+
+---------------------------------------------------------
+public procedure requires(sequence a, object msg="Error")
+---------------------------------------------------------
+-- an easy way to ensure that your program is using the
+-- appropriate GTK version;
+object s = split(a,'.')
+ if length(s) < 3 then s = append(s,"0") end if
+ s[1] = to_number(s[1])
+ s[2] = to_number(s[2])
+ s[3] = to_number(s[3])
+
+object msg2 = gtk_str_func("gtk_check_version",{I,I,I},{s[1],s[2],s[3]})
+ if string(msg2) then
+ Warn(,msg,msg2,
+ text:format("Requires Gtk version []\nInstalled is Gtk [].[].[]",
+ {a,major_version,minor_version,micro_version}))
+ abort(1)
+ end if
+end procedure
+
+enum NAME,PARAMS,RETVAL,VECTOR,CLASS
+
+---------------------------------------------------------
+public function create(integer class,
+ object p1=0, object p2=0, object p3=0, object p4=0,
+ object p5=0, object p6=0, object p7=0, object p8=0)
+---------------------------------------------------------
+-- This function does the following:
+-- 1. initializes the class if not already initialized,
+-- 2. creates a new instance of the class (returning a handle to that instance)
+-- 3. optionally sets one or more properties and/or connects the default signal.
+---------------------------------------------------------------------------------------
+ if class = GtkStockList then -- GtkStock is not a real widget, but we fake it
+ return newStockList()-- also, stock items are deprecated as of 3.10+
+ end if -- so don't get in the habit of using them too much :)
+
+ if class = GtkColumn then return newColumn(p1) end if
+
+ if not initialized[class] then -- create a routine_id for each 'method' in class
+ init(class) -- but only do it if this is the first call to that class
+ end if
+
+ object method = lookup("new",vslice(widget[class],1),widget[class],0)
+ if method[VECTOR] = -1 then -- a 'new' method name was not found;
+ Error(,,widget[class][$],"not implemented in this GTK version!")
+ abort(class)
+ end if
+
+ object props = 0, dataitem = 0
+ if sequence(p1) and sequence(p1[1]) then -- a list of properties was provided.
+ props = p1 -- save until widget is created,
+ p1 = 0 -- then set them in one 'swell foop'
+ elsif string(p1) and match("=",p1) then -- properties were provided in string form,
+ props = keyvalues(p1,,,,"\t\n\r")-- break them up into key/value pairs,
+ p1 = 0 -- save for later;
+ dataitem = vlookup("data",props,1,2)
+ end if
+
+ atom handle = 0
+ object params = method[PARAMS]
+ object args = {p1,p2,p3,p4,p5,p6,p7,p8}
+
+ args = args[1..length(params)] -- discard un-needed args;
+
+ ifdef PARAMS then display(params) end ifdef -- debug;
+
+ for i = 1 to length(params) do -- ensure values match formal params;
+
+ switch params[i] do
+
+ case S then -- convert string to pointer to cstring;
+ if string(args[i]) then
+ args[i] = allocate_string(args[i])
+ end if
+ case B then -- convert "1", "TRUE", or "YES" to 1,
+ if string(args[i]) then
+ if args[i] = "1"
+ or upper(args[i]) = "TRUE"
+ or upper(args[i]) = "YES" then
+ args[i] = 1
+ else
+ args[i] = 0 -- anything else is 0;
+ end if
+ end if
+ end switch
+ end for
+
+ ifdef CREATE then -- debug;
+ display(decode_method("CREATE",class,method))
+ puts(1,"\tArgs: ") display(args,{2,5,10,78,"%d","%.2g",32,127,1,0})
+ ifdef METHOD then display(method) end ifdef
+ end ifdef
+
+ if method[RETVAL] > 0 then -- it's a GTK function (routine_id is positive);
+ handle = c_func(method[VECTOR],args)
+ end if
+
+ if method[RETVAL] < -1 then -- it's a Eu func (a negated routine_id)
+ handle = call_func(-method[VECTOR],args) -- convert to positive rid and call;
+ end if
+
+ if handle = 0 then -- failure :(
+ ifdef CREATE then
+ display("Create failed for class []",{widget[class][$]})
+ end ifdef
+ return handle
+ end if
+
+ object sig = 0, arg1 = 0 ,arg2 = 0
+
+ switch class do -- connect a default signal for some common controls;
+ case GtkButton then sig ="clicked" arg1 = p2 arg2 = p3
+ case GtkToolButton then sig ="clicked" arg1 = p3 arg2 = p4
+ case GtkRadioButton then sig ="toggled" arg1 = p3 arg2 = p4
+ case GtkRadioToolButton then sig = "toggled" arg1 = p3 arg2 = p4
+ case GtkRadioMenuItem then sig ="toggled" arg1 = p3 arg2 = p4
+ case GtkMenuItem then sig ="activate" arg1 = p2 arg2 = p3
+ case GtkCheckMenuItem then sig = "toggled" arg1 = p2 arg2 = p3
+ case GtkCellRendererToggle then sig = "toggled" arg1 = p1 arg2 = p2
+ case GtkFontButton then sig = "font-set" arg1 = p2 arg2 = p3
+ case GtkStatusIcon then sig = "activate" arg1 = p1 arg2 = p2
+ case GtkSwitch then sig = "notify::active" arg1 = p1 arg2 = p2
+ case GtkColorButton then sig = "color-set" arg1 = p2 arg2 = p3
+ case GtkCalendar then sig = "day-selected-double-click" arg1 = p2 arg2 = p3
+ case GtkComboBoxText, GtkComboBoxEntry then sig ="changed" arg1 = p1 arg2 = p2
+ case GtkCheckButton then sig ="toggled" arg1 = p2 arg2 = p3
+ case GtkToggleButton then sig ="toggled" arg1 = p2 arg2 = p3
+ case GtkToggleToolButton then sig ="toggled" arg1 = p2 arg2 = p3
+ end switch
+
+ if atom(arg2) and arg2 = 0 then arg2 = dataitem end if
+ connect(handle,sig,arg1,arg2) -- connect per above switch;
+
+ ifdef CREATE then -- debug;
+ display("\t[] => []\n",{widget[class][$],handle})
+ end ifdef
+
+ register(handle,class)
+
+ if class = GtkWindow then -- if not otherwise specified, use OpenEu logo;
+ atom err= allocate(8,1)
+ gtk_func("gtk_window_set_default_icon_from_file",{P,P},
+ {allocate_string(locate_file("./thumbnails/mongoose.png"),1),err})
+ end if
+ ----------------------------------------------------------------------
+ -- set properties using the new key/val style;
+ ----------------------------------------------------------------------
+ object p = 0, signal, name, v1, v2, v3, v4
+
+ if not atom(props) then
+
+ if handle > 0 then
+
+ for i = 1 to length(props) do
+ while length(props[i]) < 5 do
+ props[i] &= 0
+ end while
+ for n = 1 to 5 do
+ props[i][n] = numeric_test(props[i][n])
+ end for
+ end for
+
+ for i = 1 to length(props) do
+ name = props[i][1]
+ v1 = props[i][2]
+ v2 = props[i][3]
+ v3 = props[i][4]
+ v4 = props[i][5]
+
+ ifdef SET then
+ display("\nset []->[]",{widget[class][$],props[i]})
+ end ifdef
+
+ if match("sig.",name) = 1 then
+ signal = name[5..$]
+ connect(handle,signal,v1,dataitem)
+ elsif match("$",name) = 1 then
+ signal = name[2..$]
+ connect(handle,signal,v1,dataitem)
+ elsif match("data.",name) = 1 then
+ set(handle,"data",name[6..$],v1)
+ else
+ set(handle,name,v1,v2,v3,v4)
+ end if
+ end for
+ end if
+ end if
+
+ return handle -- a pointer to the newly created instance
+
+end function
+
+------------------------------------------------------------------------
+public function set(object handle, sequence property,
+ object p1=0, object p2=0, object p3=0, object p4=0,
+ object p5=0, object p6=0, object p7=0, object p8=0)
+------------------------------------------------------------------------
+-- This routine sets a property or sequence of properties
+-- for the given widget.
+-- In order to work with Glade, widget names in string form
+-- may be used, otherwise set() expects a handle.
+-- Property is always a string, p1...p8 are optional parameters.
+-- Any parameter expected but not supplied is set to null, excess
+-- parameters are discarded.
+------------------------------------------------------------------------
+integer class=-1
+object name = "unknown"
+object result = 0
+object allocated = {}
+
+ name = handle
+
+ ifdef SETX then display({name,property,p1,p2,p3,p4}) end ifdef
+
+ if string(handle) then handle = pointer(handle) end if
+
+ if handle = 0 then
+ printf(1,"Critical error\n" &
+ "Objects must have a unique name!\n%s [%d]",{name,handle})
+ return 0
+ end if
+
+ object prop = 0
+
+ if string(property) and match("=",property) > 0 then -- convert string props
+ property = keyvalues(property,,,,"\t\t\n") -- to key/val form;
+ end if
+
+ if sequence(property) -- new create format (key=value pairs);
+ and not string(property) then
+ for i = 1 to length(property) do
+ while length(property[i]) < 5 do
+ property[i] &= 0
+ end while
+ for n = 1 to 5 do
+ property[i][n] = numeric_test(property[i][n])
+ end for
+ end for
+
+ for i = 1 to length(property) do
+ prop = property[i] if prop[1][1]='$' then continue end if
+ while length(prop) < 8 do prop &= 0 end while
+ set(handle,prop[1],prop[2],prop[3],prop[4],prop[5],prop[6],prop[7],prop[8])
+ end for
+ return 0
+ end if
+
+ class = vlookup(handle,registry,1,2,-1) -- get widget's class;
+
+ if class = -1 then -- fail;
+ display("Set invalid handle [] []",{handle,prop})
+ end if
+
+ property = "set_" & lower(join(split(property,' '),'_')) -- conform;
+
+ object method = lookup_method(class,property)
+ ifdef METHOD then display(method) end ifdef
+
+ if atom(method) then
+ if not set_property(handle,property[5..$],numeric_test(p1)) then
+ Error(,,"Cannot set property",class_name(handle) & property)
+ end if
+ return 0
+ end if
+
+ if method[VECTOR] = -1 then
+ Warn(,,"Method not found",
+ sprintf("%s->%s",{class_name(handle),property}))
+ return 0
+ end if
+
+ -- method was found;
+
+ object params = method[PARAMS]
+
+ switch method[1] do -- make life easier for a common operation;
+ case "set_from_file" then p1 = canonical_path(p1)
+ end switch
+
+ object args = {handle,p1,p2,p3,p4,p5,p6,p7,p8}
+
+ ifdef PARAMS then
+ puts(1,"Params: ") display(params)
+ puts(1,"Args: ") display(args)
+ end ifdef
+
+ args = args[1..length(params)] -- match args to formal parameters;
+ for i = 2 to length(args) do
+ switch params[i] do
+
+ case A then -- array of strings;
+ if not atom(args[i]) then
+ args[i] = allocate_string_pointer_array(args[i])
+ allocated &= args[i]
+ end if
+
+ case S then -- string;
+ if atom(args[i]) then
+ args[i] = sprintf("%g",args[i])
+ end if
+ if string(args[i]) then
+ args[i] = allocate_string(args[i])
+ allocated &= args[i]
+ end if
+
+ case B then
+ if string(args[i]) then
+ if equal("TRUE",upper(args[i]))
+ or equal("YES",upper(args[i]))
+ or equal("1",args[i]) then
+ args[i] = 1
+ end if
+ if equal("FALSE",upper(args[i]))
+ or equal("NO",upper(args[i]))
+ or equal("0",args[i]) then
+ args[i] = 0
+ end if
+ end if
+
+ case I,D then
+ if string(args[i]) then
+ args[i] = to_number(args[i])
+ end if
+
+ -- apply patches for zero-based indexes;
+ switch method[1] do
+ case "add_attribute",
+ "set_active",
+ "set_text_column",
+ "set_pixbuf_column",
+ "set_tooltip_column",
+ "set_search_column",
+ "attribute_connect",
+ "reorder_child",
+ "page",
+ "remove_page",
+ "set_current_page",
+ "set_sort_column_id" then args[i]-=1
+ end switch
+ end switch
+ end for
+
+ ifdef SET then -- debug;
+ display(decode_method("SET",class,method))
+ puts(1,"\tArgs: ")
+ display(decode_args(method,args),
+ {2,2,11,78,"%d","%2.22f",32,127,1,0})
+ puts(1,"\n")
+ end ifdef
+
+ if equal("set_name",property) then
+ p8 = find(handle,vslice(registry,1))
+ registry[p8][4] = p1
+ end if
+
+ if method[RETVAL] = 0 then -- it's a GTK proc;
+ c_proc(method[VECTOR],args)
+ end if
+
+ if method[RETVAL] > 0 then -- it's a GTK func;
+ result = c_func(method[VECTOR],args)
+ end if
+
+ if method[RETVAL] <-1 then -- it's a Eu func;
+ result = call_func(-method[VECTOR],args)
+ end if
+
+ if method[VECTOR] = -1 then -- GTK doesn't know about this method!
+ printf(1,
+ "Warning: %s->%s call is invalid," &
+ "******** perhaps you need a later GTK version",
+ {widget[class][$],property})
+ end if
+
+ if not equal("set_data",property) then
+ for i = 1 to length(allocated) do
+ free(allocated[i])
+ end for
+ end if
+
+ return result
+
+end function
+
+-----------------------------------------------------------------------------------
+export function get(object handle, sequence property,
+ object p1=MINF, object p2=MINF, object p3=MINF, object p4=MINF, object p5=MINF)
+-----------------------------------------------------------------------------------
+-- This routine gets one or more values for a given property name.
+-- Property name is always a string, handle is usually an atom,
+-- but may sometimes be a string in order to work with Glade.
+-----------------------------------------------------------------------------------
+integer class
+object name = "unknown"
+
+ if string(handle) then
+ name = handle
+ handle = pointer(handle)
+ end if
+
+ class = vlookup(handle,registry,1,2,-1) -- get widget's class;
+
+ if class = -1 then
+ return 0
+ end if
+
+ property = "get_" & lower(join(split(property,' '),'_'))
+
+ object method = lookup_method(class,property)
+
+ if atom(method) then -- not found, try fallback to Object;
+ return get_property(handle,property[5..$])
+ end if
+
+ -- else, method found;
+
+ object params = method[PARAMS]
+
+ if method[VECTOR] = -1 then
+ crash("\nERROR:\n****** Invalid call: %s->%s",{widget[class][$],method[1]})
+ end if
+
+ object result = {}
+
+ if string(p1) then p1 = allocate_string(p1,1) end if
+ if string(p2) then p2 = allocate_string(p2,1) end if
+ if string(p3) then p3 = allocate_string(p3,1) end if
+ if string(p4) then p4 = allocate_string(p4,1) end if
+
+ object args = {handle,allocate(8,1),allocate(8,1),allocate(8,1),allocate(8,1)}
+ if p1 > MINF then args[2]=p1 end if
+ if p2 > MINF then args[3]=p2 end if
+ if p3 > MINF then args[4]=p3 end if
+ if p4 > MINF then args[5]=p4 end if
+
+ args = args[1..length(params)]
+
+ ifdef GET then -- debug
+ display(decode_method("GET",class,method),0)
+ puts(1,"\tArgs: ")
+ display(decode_args(method,args),
+ {2,2,11,78,"%d","%2.22f",32,127,4,-1})
+ end ifdef
+
+-----------------------------------------------------------------------------------
+ if method[RETVAL] = 0 then -- it's a GTK proc, may have multiple return values;
+ c_proc(method[VECTOR],args)
+ result = repeat(0,length(args))
+ for i = 1 to length(args) do
+ switch params[i] do -- convert arg pointer to value;
+ case D then result[i] = float64_to_atom(peek({args[i],8}))
+ case F then result[i] = float32_to_atom(peek({args[i],4}))
+ case I then result[i] = peek4s(args[i])
+ case B then result[i] = peek(args[i])
+ case A then result[i] = unpack_gs_str_list(args[i])
+ case X then result[i] = unpack_gs_atom_list(args[i])
+ case V then result[i] = deallocate_string_pointer_array(args[i])
+ case S then if args[i] > 0 then result[i] = peek_string(args[i]) end if
+ case else result[i] = args[i]
+ end switch
+ end for
+ result = result[2..$] -- don't return handle, just results;
+ goto "fini"
+ end if
+
+--------------------------------------------------
+ if method[RETVAL] > 0 then -- it's a GTK func;
+ result = c_func(method[VECTOR],args)
+ switch method[RETVAL] do -- convert function result to value;
+ case A then result = unpack_gs_str_list(result)
+ case X then result = unpack_gs_atom_list(result)
+ case V then result = deallocate_string_pointer_array(result)
+ case S then if result > 0 then result = peek_string(result) else result = 0 end if
+ case I then
+ switch method[1] do -- patch for zero-based indexing;
+ case
+ "get_active",
+ "get_text_column",
+ "get_pixbuf_column",
+ "get_column",
+ "get_tooltip_column",
+ "get_search_column",
+ "get_current_page",
+ "get_index",
+ "get_item_index",
+ "page_num",
+ "get_sort_column_id" then result += 1
+ end switch
+ end switch
+ goto "fini"
+ end if
+
+----------------------------------------------------------------------
+ if method[RETVAL] <-1 then -- it's a Eu func (negated routine_id);
+ result = call_func(-method[VECTOR],args)
+ end if
+
+label "fini"
+
+ if method[CLASS] != GSList then -- for widgets created 'internally' by GTK
+ if method[CLASS] != 0 then -- as a result of creating a parent widget;
+ if not initialized[method[CLASS]] then init(method[CLASS]) end if
+ if atom(result) then register(result,method[CLASS])
+ else for z = 1 to length(result) do
+ register(result[z],method[CLASS]) -- must be registered;
+ end for
+ end if
+ end if
+ end if
+
+ ifdef GET then display("\tReturns: []\n",{result}) end ifdef
+
+return result
+end function
+
+---------------------------------------------------
+public function add(object parent, object child) -- add widgets to container;
+---------------------------------------------------
+
+ ifdef ADD then
+ display("Add [] []",{parent,child})
+ end ifdef
+
+ if atom(child) and child = 0 then
+ display("Null pointer passed to add()\n")
+ return 0
+ end if
+
+ if class_id(child) = GdkPixbuf then -- issue a warning;
+ return Warn(,,"Cannot add a pixbuf to a container",
+ "Create an image from it first,\nthen add the image.",,child)
+ end if
+
+ if class_id(parent) = GtkBuilder then
+ load_builder(parent,child)
+ return 1
+ end if
+
+ if string(parent) then -- convert to handle;
+ parent = pointer(parent)
+ end if
+
+ if string(child) then -- convert to handle;
+ child = pointer(child)
+ end if
+
+ -- Switch below implements an easier-to-remember 'add' syntax
+ -- as an alias for the various 'set' calls shown.
+ -- The GTK original is still available, if you wish to use it.
+
+ switch class_id(parent) do
+
+ case GtkComboBoxText, GtkComboBoxEntry then
+ for i = 1 to length(child) do
+ set(parent,"append text",child[i])
+ end for
+
+ case GtkToolbar then
+ if atom(child) then
+ set(parent,"insert",child,-1)
+ else for i = 1 to length(child) do
+ add(parent,child[i])
+ end for
+ end if
+ return child
+
+ case GtkFileChooserDialog then
+ if atom(child) then
+ if class_id(child) = GtkFileFilter then
+ set(parent,"add filter",child)
+ end if
+ else for i = 1 to length(child) do
+ add(parent,child[i])
+ end for
+ end if
+
+ case GtkSizeGroup then
+ set(parent,"add widgets",child)
+ return child
+
+ case GtkTextTagTable then
+ set(parent,"add",child)
+ return child
+
+ case GtkTreeView then
+ set(parent,"append columns",child)
+ return child
+
+ case else
+ if atom(child) then
+ gtk_proc("gtk_container_add",{P,P},{parent,child})
+ else
+ for i = 1 to length(child) do
+ gtk_proc("gtk_container_add",{P,P},{parent,child[i]})
+ end for
+ end if
+ return child
+
+ end switch
+return -1
+end function
+
+------------------------------------------------------------------------
+public function pack(object parent, object child,
+ integer expand=0, integer fill=0, integer padding=0)
+------------------------------------------------------------------------
+-- pack a child widget or {list} of child widgets into parent container;
+-- prepending a negative sign to the child pointer means
+--'pack end'. this is an alias which is sometimes useful.
+------------------------------------------------------------------------
+
+ if string(parent) then parent = pointer(parent) end if
+ if string(child) then child = pointer(child) end if
+
+ if atom(child) then
+ if child > 0 then
+ pack_start(parent,child,expand,fill,padding)
+ else
+ child = -child
+ pack_end(parent,child,expand,fill,padding)
+ end if
+ else
+ for i = 1 to length(child) do
+ pack(parent,child[i],expand,fill,padding)
+ end for
+ end if
+
+ return abs(child)
+end function
+
+function valid(object x)
+object msg = "Invalid object []"
+atom p
+if string(x) then
+ p = pointer(x)
+ if p = 0 then
+ display(msg,{x})
+ return 0
+ else return p
+ end if
+end if
+if x = 0 then
+ display(msg)
+end if
+return x
+end function
+
+-- following 2 functions provided for compatibility with GTK calls;
+
+public function pack_start(object parent, object child,
+ boolean expand=0, boolean fill=0, integer padding=0)
+ parent = valid(parent)
+ child = valid(child)
+ set(parent,"pack start",child,expand,fill,padding)
+return child
+
+end function
+
+public function pack_end(object parent, object child,
+ boolean expand=0, boolean fill=0, integer padding=0)
+ parent = valid(parent)
+ child = valid(child)
+ set(parent,"pack end",child,expand,fill,padding)
+return child
+end function
+
+----------------------------------
+public procedure show(object x) -- show widget x or a {list} of widgets;
+----------------------------------
+ if string(x) then x = pointer(x) end if
+ if atom(x) then
+ set(x,"show")
+ else
+ for i = 1 to length(x) do
+ show(x[i])
+ end for
+ end if
+end procedure
+
+-------------------------------------
+public function show_all(object x) -- show container x and all children;
+-------------------------------------
+ if string(x) then x = pointer(x) end if
+ if atom(x) then
+ set(x,"show all")
+ else
+ for i = 1 to length(x) do
+ set(x[i],"show all")
+ end for
+ end if
+return 1
+end function
+
+---------------------------------
+public function hide(object x) -- hide a widget or a {list} of widgets;
+---------------------------------
+ if string(x) then x = pointer(x) end if
+ if atom(x) then
+ set(x,"hide")
+ else
+ for i = 1 to length(x) do
+ hide(x[i])
+ end for
+ end if
+return 1
+end function
+
+--------------------------------------
+public procedure hide_all(object x) -- hide container x and any children it contains;
+--------------------------------------
+ set(x,"hide all")
+end procedure
+
+--------------------------------------
+export function destroy(object ctl) -- destroy a widget or {list} of widgets;
+--------------------------------------
+ if sequence(ctl) then
+ for i = 1 to length(ctl) do
+ destroy(ctl[i])
+ end for
+ else
+ if ctl > 0 then
+ set(ctl,"destroy")
+ deregister(ctl)
+ end if
+ end if
+return 1
+end function
+
+--------------------------
+export procedure main() -- start the GTK engine;
+--------------------------
+ gtk_proc("gtk_main")
+end procedure
+
+without warning {not_reached}
+
+ --------------------------------------------------------------------------
+ export function Quit(atom ctl=0, object errcode=0) -- kill the GTK engine;
+ --------------------------------------------------------------------------
+ abort(errcode)
+ return 1
+ end function
+ export constant main_quit = call_back(routine_id("Quit"))
+
+with warning {not_reached}
+
+----------------------------------
+function numeric_test(object x) -- convert numbers passed in key=value format;
+----------------------------------
+ atom z
+ if atom(x) then
+ return x
+ end if
+ if string(x) then
+ if equal("TRUE",x) then return 1 end if
+ if equal("FALSE",x) then return 0 end if
+ if equal("YES",x) then return 1 end if
+ if equal("NO",x) then return 0 end if
+ if equal("VERTICAL",x) then return 1 end if
+ if equal("CENTER",x) then return 1 end if
+ if equal("HORIZONTAL",x) then return 0 end if
+
+ z = to_number(x)
+ if z != 0 then
+ ifdef NUM then display("string [] converted to number []",{x,z}) end ifdef
+ return z
+ else
+ ifdef NUM then display("returning string '[]'",{x}) end ifdef
+ return x
+ end if
+ end if
+ ifdef NUM then display("error []",x) end ifdef
+ return x
+end function
+
+------------------------------------------------------------------------
+-- Following functions register and initialize class methods
+------------------------------------------------------------------------
+-- A class is initialized the first time a widget of that class is created.
+-- This means the widget's method vectors are filled in with Eu routine_ids,
+-- either direct or generated by define_c_func or define_c_proc as appropriate.
+
+-- When a subsequent call is made to a widget method, that vector is
+-- used by calling c_func, c_proc, or call_func.
+
+-- If the call is to a method not implemented by the widget, but is
+-- instead a method inherited from one of the widget's ancestors,
+-- then that ancestor is also initialized if necessary.
+
+-- This scheme means that program startup isn't delayed as it would be
+-- if all 300+ widgets and nearly 4000 methods were to be initialized
+-- first, most of which would likely never be used in any given program.
+
+------------------------------------------------------------------------
+global procedure init(integer class)
+------------------------------------------------------------------------
+object name, params, retval
+
+ ifdef INITX then
+ display("\nInit class:[] []",{class,widget[class][$]})
+ display(widget[class])
+ end ifdef
+
+ if initialized[class] then return end if
+
+ for method = 3 to length(widget[class])-1 do
+
+ name = sprintf("+%s_%s",{widget[class][NAME],widget[class][method][NAME]})
+
+ widget[class][method] = pad_tail(widget[class][method],5,0)
+ params = widget[class][method][PARAMS]
+ retval = widget[class][method][RETVAL]
+
+ if class = GtkSpinButton then
+ switch widget[class][method][NAME] do
+ case "get_increments","get_range" then params[2] = P params[3] = P
+ case else -- do nothing;
+ end switch
+ end if
+
+ if widget[class][method][RETVAL] = 0 then -- it's a GTK proc
+ widget[class][method][VECTOR] = define_proc(name,params)
+ goto "init"
+ end if
+
+ if widget[class][method][RETVAL] > 0 then -- it's a GTK func
+ widget[class][method][VECTOR] = define_func(name,params,retval)
+ goto "init"
+ end if
+
+ if widget[class][method][RETVAL] < -1 then -- it's a Eu func
+ widget[class][method][VECTOR] = widget[class][method][RETVAL]
+ end if
+
+ label "init"
+
+ initialized[class] = TRUE
+
+ ifdef INIT then
+ display("INIT: [].[] RID:[]",
+ {widget[class][$],widget[class][method][NAME],widget[class][method][VECTOR]})
+ end ifdef
+
+ ifdef INIT_ERR then
+ if widget[class][method][VECTOR] = -1 then -- function is invalid!
+ display("\tINIT ERROR: [].[] ERR:[]",
+ {widget[class][$],widget[class][method][NAME],widget[class][method][VECTOR]})
+ end if
+ end ifdef
+
+ end for
+
+end procedure
+
+------------------------------------------------------------------------
+-- The registry associates a control's handle with its class,
+-- so that future calls to set or get that control's properties
+-- can go directly to the correct set of functions stored in the
+-- large widget{} structure.
+------------------------------------------------------------------------
+export object registry = {}
+
+----------------------------------------------------------------------------------------
+global function register(atom handle, integer class, object name="-nil-", object v=math:MINF)
+----------------------------------------------------------------------------------------
+integer x = find(handle,vslice(registry,1))
+
+ if x > 0 then -- handle already exists in the registry,
+ ifdef REG_DUP then -- debug
+ display("Note: [] handle [] already registered to [] []",
+ {widget[class][$],handle,registry[x][3],name})
+ end ifdef
+ -- update it in case handle has been recycled.
+ registry[x] = {handle,class,widget[class][$],name,v}
+ return 1
+ end if
+
+ -- else, add the widget to the registry;
+ registry = append(registry,{handle,class,widget[class][$],name,v})
+
+ -- initialize class if this is the first use of that class;
+ if not initialized[class] then init(class) end if
+
+ ifdef REG then -- debug
+ printf(1,text:format("Registry + [3:20]\thandle: [1:10>]\tname: [4]\tvalue: [5]\n",registry[$]))
+ end ifdef
+
+return 1
+end function
+
+------------------------------------
+procedure deregister(atom handle) -- when object no longer used;
+------------------------------------
+integer x = find(handle,vslice(registry,1))
+if x > 0 then
+ ifdef REG then
+ printf(1,text:format("Registry - [3:16]\thandle: [1:12>]\t",registry[x]))
+ if string(registry[x][4]) then printf(1,"name: %s",{registry[x][4]}) end if
+ puts(1,"\n")
+ end ifdef
+ registry = remove(registry,x)
+end if
+end procedure
+
+
+-----------------------------------------
+public function class_id(object handle) -- returns an integer widget class;
+-----------------------------------------
+ if string(handle) then handle = pointer(handle) end if
+ return vlookup(handle,registry,1,2,-1)
+end function
+
+-------------------------------------------
+public function class_name(object handle) -- returns class_name for a given handle;
+-------------------------------------------
+ if string(handle) then handle = pointer(handle) end if
+ return vlookup(handle,registry,1,3,"!")
+end function
+
+------------------------------------------
+public function object_name(atom handle) -- returns name of object, or -nil-;
+------------------------------------------
+ return vlookup(handle,registry,1,4,"!")
+end function
+
+---------------------------------------
+public function pointer(object name) -- returns handle to object or null,
+---------------------------------------
+ return vlookup(name,registry,4,1,0)
+end function
+
+------------------------------------------------------------------------
+function lookup_method(integer class, sequence prop)
+------------------------------------------------------------------------
+-- Finds the method to set or get a property for a given class,
+-- if not found, ancestors of that class are checked until the method
+-- is located.
+
+ if class = -1 then return 0 end if
+
+ ifdef LOOK then display("Look []->[]",{widget[class][$],prop}) end ifdef
+
+ object method = lookup(prop,vslice(widget[class],NAME),widget[class],0)
+
+ ifdef LOOKUP then display(widget[class][$]) end ifdef
+
+ if atom(method) then -- try sans the set_ or get_ prefix;
+ method = lookup(prop[5..$],vslice(widget[class],NAME),widget[class],0)
+ end if
+
+ if sequence(method) then -- method was found in this class, we're done!
+ return method
+ end if
+
+ object ancestor -- if not found, need to look for method in ancestors;
+ for i = 1 to length(widget[class][PARAMS]) do
+ ancestor = widget[class][PARAMS][i]
+ if ancestor = 0 then return 0 end if
+
+ if not initialized[ancestor] then
+ init(ancestor)
+ end if
+
+ ifdef LOOKUP then -- debug;
+ display("trying ancestor: []",{widget[ancestor][$]})
+ end ifdef
+
+ method = lookup(prop,vslice(widget[ancestor],NAME),widget[ancestor],0)
+ if atom(method) then
+ method = lookup(prop[5..$],vslice(widget[ancestor],NAME),widget[ancestor],0)
+ end if
+
+ if sequence(method) then -- found it!
+ ifdef LOOKUP then display("\t []",{method[1]}) end ifdef
+ return method
+ end if
+
+ end for
+
+ return -1 -- method not found (not implemented)
+
+end function
+
+-----------------------------------------------------------------------------
+public function connect(object ctl, object sig, object fn=0, object data=0,
+ atom closure=0, integer flags=0)
+-----------------------------------------------------------------------------
+-- tells control to call your Eu function, sending data along for the ride,
+-- whenever that control gets the specified signal.
+
+ integer result = -1
+ atom rid = 0
+
+ if atom(fn) and fn = 0 then -- no point in registering null functions!
+ return 0
+ end if
+
+ if string(ctl) then
+ ctl = pointer(ctl) -- convert name to pointer;
+ end if
+
+ if sequence(ctl) then
+ for i = 1 to length(ctl) do
+ connect(ctl[i],sig,fn,data,closure,flags)
+ end for
+ return 1
+ end if
+
+ if string(fn) then -- if interpreted, we can call functions by name if in scope;
+ ifdef COMPILE then -- do compile test if requested;
+ display("Connecting [] [] Signal '[]' Function [] Data []",
+ {class_name(ctl),ctl,sig,fn,data})
+ if not equal("Quit",fn) then
+ printf(1,"\n\tCaution: function %s will not link when compiled!\n\t********\n",{fn})
+ end if
+ end ifdef
+
+ rid = routine_id(fn)
+ if rid > 0 then -- named function is in scope;
+ fn = call_back(rid) -- so obtain a callback;
+ else
+ printf(1,"\n\tError: function %s is not in scope\n\t****** (make it global or link via routine_id)\n",{fn})
+ Warn(,,sprintf("function %s is not in scope",{fn}),"make it global or link via routine_id")
+ end if
+ end if
+
+ sig = join(split(sig,' '),'-') -- normalize signal names;
+ sig = allocate_string(sig) -- convert to string pointer;
+
+ if integer(data) then -- can be attached directly;
+ result = gtk_func("g_signal_connect_data",{P,S,P,P,I,I},{ctl,sig,fn,data,closure,flags})
+ free(sig)
+ return result
+ end if
+
+ if atom(data) then
+ data = prepend({data},"ATOM") -- must be serialized and unpacked later;
+ data = allocate_wstring(serialize(data)+1)
+ result = gtk_func("g_signal_connect_data",{P,S,P,P,I,I},{ctl,sig,fn,data,closure,flags})
+ free(sig)
+ return result
+ end if
+
+ if string(data) then
+ data = prepend({data},"STR") -- must be serialized and unpacked later;
+ data = allocate_wstring(serialize(data)+1)
+ result = gtk_func("g_signal_connect_data",{P,S,P,P,I,I},{ctl,sig,fn,data,closure,flags})
+ free(sig)
+ return result
+ end if
+
+ if sequence(data) then
+ data = prepend(data,"SEQ")-- must be serialized and unpacked later;
+ data = allocate_wstring(serialize(data)+1)
+ result = gtk_func("g_signal_connect_data",{P,S,P,P,I,I},{ctl,sig,fn,data,closure,flags})
+ free(sig)
+ return result
+ end if
+
+end function
+
+-------------------------------------------------------
+export procedure disconnect(atom ctl, integer sigid) -- disconnect a signal from ctl;
+-------------------------------------------------------
+ gtk_proc("g_signal_handler_disconnect",{P,I},{ctl,sigid})
+end procedure
+
+--------------------------------------
+export function unpack(object data) -- retrieves data passed in a control's data space;
+--------------------------------------
+if atom(data) and data = 0 then return 0 end if
+object result = deserialize(peek_wstring(data)-1)
+ switch result[1][1] do
+ case "ATOM","STR","INT" then return result[1][2]
+ case "SEQ" then return result[1][2..$]
+ case else return result
+ end switch
+end function
+
+-------------------------------------------------------
+export function deallocate_string_pointer_array(atom x)
+-------------------------------------------------------
+integer i = 0
+object result = {}
+ while peek4u(x+i) > 0 do
+ result = append(result,peek_string(peek4u(x+i)))
+ i += 8
+ end while
+ return result
+end function
+
+------------------------------------------------------------------------
+-- following 3 'decode_x' functions are for debugging purposes,
+-- they make displays more readable;
+------------------------------------------------------------------------
+function decode_args(object method, object args)
+------------------------------------------------------------------------
+ for i = 1 to length(method[PARAMS]) do
+ switch method[PARAMS][i] do
+ case S then
+ if atom(args[i]) and args[i] > 0 then
+ args[i] = peek_string(args[i])
+ if length(args[i]) > 40 then
+ args[i] = args[i][1..40] & "..."
+ end if
+ args[i] = args[i]
+ end if
+ case else -- do not convert
+ end switch
+ end for
+ return args
+end function
+
+constant ptype = {0,P,I,D,F,S,B,A}
+constant pname = {{},"None","Ptr ","Int ","Dbl ","Flt ","Str ","Bool ","Array "}
+
+------------------------------------------------------------------------
+function decode_params(object params)
+------------------------------------------------------------------------
+ return transmute(params,ptype,pname)
+end function
+
+------------------------------------------------------------------------
+function decode_method(sequence title, integer class, object method)
+------------------------------------------------------------------------
+object z = {}
+integer n
+ z = prepend(method,widget[class][$])
+ z = prepend(z,title)
+ z[4] = decode_params(method[PARAMS])
+ while length(z) < 5 do
+ z = append(z,0)
+ end while
+ if length(method) >= RETVAL then
+ n = find(method[RETVAL],ptype)
+ z[5] = pname[n+1]
+ end if
+ return text:format("[]\n\tCall: []->[]\n\tParams: []\n\tReturn type: []\n\tVector: []",z)
+end function
+
+---------------------------------------------------------
+public function to_sequence(atom glist, integer fmt=0) -- mostly internal use;
+---------------------------------------------------------
+-- convert glist pointer back to a Euphoria sequence;
+-- results are returned in a choice of formats;
+ integer len = gtk_func("g_list_length",{P},{glist})
+ object s = {}
+ atom data
+ for i = 0 to len-1 do
+ data = gtk_func("g_slist_nth_data",{P,I},{glist,i})
+ switch fmt do
+ case 0 then s = append(s,peek_string(data))
+ case 1 then s = append(s,data)
+ case 2 then s = append(s,gtk_str_func("gtk_tree_path_to_string",{P},{data}))
+ case 3 then s = append(s,to_number(gtk_str_func("gtk_tree_path_to_string",{P},{data})))
+ case else Warn(,,"Converting glist to_sequence",
+ "invalid format supplied,\nvalues are 0 to 3")
+ end switch
+ end for
+ return s
+end function
+
+-----------------------------------------------------------------------------------------
+-- METHOD DECLARATIONS:
+-----------------------------------------------------------------------------------------
+
+sequence initialized = repeat(0,500)
+-- This is a set of flags which are set to 1 when a given widget has
+-- been initialized. This prevents having to initialize a widget's
+-- methods repeatedly. Size is larger than GtkFinal to allow 'plugin'
+-- widgets to be added at runtime.
+
+export sequence widget = repeat(0,GtkFinal)
+-- This structure holds prototypes for each GTK method call,
+-- organized by widget. When each widget is initialized,
+-- vectors are added pointing to the routine_ids needed
+-- to call the GTK functions that implement each method.
+
+-- The widgets below need not be in any specific order.
+-- Widget names must also be added to the list in GtkEnums
+
+sequence stock_list = create(GtkStockList) -- a fake object;
+
+widget[GObject] = {"g_object",
+{0},
+ {"new",{I,S,S,I},P},
+ {"set",{P,S,P,P}},
+ {"set_property",{P,S,P},-routine_id("set_property")},
+ {"get_property",{P,S},-routine_id("get_property")},
+ {"get_data",{P,P},S},
+ {"set_data",{P,S,S}},
+ {"set_data_full",{P,S,S,P}},
+ {"steal_data",{P,S},P},
+ {"signal",{P,P,P,P,P,P},-routine_id("connect")},
+ {"connect",{P,P,P,P,P,P},-routine_id("connect")},
+"GObject"}
+
+ constant
+ fn1 = define_proc("g_object_get",{P,P,P,P}),
+ doubles = {"angle","climb-rate","fraction","max-value","min-value",
+ "scale","value","pulse-step","scale","size-points","text-xalign",
+ "text-yalign","xalign","yalign"}
+
+ constant prop = allocate_string("property")
+
+ function set_property(object handle, object a, object b)
+ --------------------------------------------------------------
+ object params = {P,P,P,P}
+ if find(a,doubles) then params = {P,P,D,P} end if
+ if string(a) then a = allocate_string(a,1) end if
+ if string(b) then b = allocate_string(b,1) end if
+ gtk_proc("g_object_set",params,{handle,a,b,0})
+ return 1
+ end function
+
+ function get_property(atom handle, object p)
+ --------------------------------------------------
+ atom x = allocate(8,1)
+ if string(p) then p = allocate_string(p,1) end if
+ c_proc(fn1,{handle,p,x,0})
+ object result = peek4u(x)
+ return result
+ end function
+
+widget[GtkAdjustment] = {"gtk_adjustment",
+{GObject},
+ {"new",{D,D,D,D,D,D},P},
+ {"set_value",{P,D}},
+ {"get_value",{P},D},
+ {"clamp_page",{P,D,D}},
+ {"value_changed",{P}},
+ {"configure",{P,D,D,D,D,D,D}},
+ {"get_lower",{P},D},
+ {"get_page_increment",{P},D},
+ {"get_step_increment",{P},D},
+ {"get_minimum_increment",{P},D},
+ {"set_upper",{P,D}},
+ {"get_upper",{P},D},
+ {"set_page_increment",{P,D}},
+ {"set_page_size",{P,D}},
+ {"set_step_increment",{P,D}},
+ {"set_upper",{P,D}},
+"GtkAdjustment"}
+
+widget[GtkWidgetPath] = {"gtk_widget_path",
+{GObject},
+ {"new",{},P},
+ {"append_type",{P,I},I},
+ {"append_with_siblings",{P,P,I},I},
+ {"append_for_widget",{P,P},I},
+ {"copy",{P},P,0,GtkWidgetPath},
+ {"get_object_type",{P},I},
+ {"has_parent",{P,I},B},
+ {"is_type",{P,I},B},
+ {"iter_add_class",{P,I,S}},
+ {"iter_add_region",{P,I,S,I}},
+ {"iter_clear_classes",{P,I}},
+ {"iter_clear_regions",{P,I}},
+ {"iter_get_name",{P,I},S},
+ {"iter_get_object_type",{P,I},I},
+ {"iter_get_siblings",{P,I},P,0,GtkWidgetPath},
+ {"iter_get_sibling_index",{P,I},I},
+ {"iter_has_class",{P,I,S},B},
+ {"iter_has_name",{P,I,S},B},
+ {"iter_has_qclass",{P,I,P},B},
+ {"iter_has_qname",{P,I,P},B},
+ {"iter_has_qregion",{P,I,P,I},B},
+ {"iter_has_region",{P,I,S,I},B},
+ {"iter_list_classes",{P,I},A,0,GSList},
+ {"iter_list_regions",{P,I},A,0,GSList},
+ {"iter_remove_class",{P,I,S}},
+ {"iter_remove_region",{P,I,S}},
+ {"iter_set_name",{P,I,S}},
+ {"iter_set_object_type",{P,I,I}},
+ {"iter_set_object_name",{P,I,S}}, -- 3.20
+ {"iter_get_object_name",{P,I},S}, -- 3.20
+ {"iter_get_state",{P,I},I}, -- 3.14
+ {"iter_set_state",{P,I,I}}, -- 3.14
+ {"length",{P},I},
+ {"prepend_type",{P,I}},
+ {"to_string",{P},S},
+ {"get_object_name",{P,I},S}, -- 3.20
+ {"set_object_name",{P,I,S}}, -- 3.20
+"GtkWidgetPath"}
+
+widget[GtkStyle] = {"gtk_style",
+{GObject},
+"GtkStyle"}
+
+widget[GAction] = {"g_action",
+{GObject},
+ {"name_is_valid",{S},B},
+ {"get_name",{P},S},
+ {"get_parameter_type",{P},I},
+ {"get_state_type",{P},I},
+ {"get_state_hint",{P},I},
+ {"get_enabled",{P},B},
+ {"get_state",{P},I},
+ {"change_state",{P,I}},
+ {"activate",{P,I}},
+ {"parse_detailed_name",{P,S,P,P},B},
+ {"print_detailed_name",{P,I},S},
+"GAction"}
+
+widget[GSimpleAction] = {"g_simple_action",
+{GObject},
+ {"new",{S,I},P},
+ {"new_stateful",{S,I,I}},
+ {"set_enabled",{P,B}},
+ {"set_state",{P,I}},
+ {"set_state_hint",{P,I}},
+"GSimpleAction"}
+
+widget[GPropertyAction] = {"g_property_action",
+{GObject},
+ {"new",{S,P,S},P},
+"GPropertyAction"}
+
+widget[GActionGroup] = {"g_action_group",
+{GSimpleAction,GObject},
+"GActionGroup"}
+
+widget[GSimpleActionGroup] = {"g_simple_action_group",
+{GApplication,GActionGroup,GObject},
+ {"new",{}},
+"GSimpleActionGroup"}
+
+widget[GActionMap] = {"g_action_map",
+{0},
+ {"lookup_action",{P,S},P},
+ {"add_action_entries",{P,P,I,P}},
+ {"add_action",{P,P}},
+ {"remove_action",{P,S}},
+"GActionMap"}
+
+widget[GtkWidgetClass] = {"gtk_widget_class",
+{GtkWidget,GtkBuildable,GObject},
+ {"set_template",{P,P}}, -- 3.10
+ {"set_template_from_resource",{P,S}}, -- 3.10
+ {"get_template_child",{P,I,S},P,0,GObject},
+ {"bind_template_child_full",{P,S,B,I}},
+ {"bind_template_callback_full",{P,S,P}},
+ {"set_connect_func",{P,P,P,P}},
+ {"set_css_name",{P,S}}, -- 3.20
+ {"get_css_name",{P},S}, -- 3.20
+"GtkWidgetClass"}
+
+widget[GtkWidget] = {"gtk_widget",
+{GtkBuildable,GObject},
+
+-- Aliases to fix awkward overrides; ordinarily you will use one of these 4,
+ {"set_font",{P,S},-routine_id("widget_set_font")},
+ {"set_color",{P,P},-routine_id("widget_set_foreground")},
+ {"set_foreground",{P,P},-routine_id("widget_set_foreground")},
+ {"set_background",{P,P},-routine_id("widget_set_background")},
+
+-- Only use following versions when you need to change the color
+-- of a control in a state other than normal. Rarely used since themes
+-- often disallow the use of stateful colors;
+ {"override_background_color",{P,I,P},-routine_id("widget_override_background_color")},
+ {"override_color",{P,I,P},-routine_id("widget_override_color")},
+----
+ {"new",{I},P},
+ {"destroy",{P}},
+ {"in_destruction",{P},B},
+ {"destroyed",{P},B},
+ {"unparent",{P}},
+ {"show",{P}},
+ {"show_now",{P}},
+ {"hide",{P}},
+ {"show_all",{P}},
+ {"map",{P}},
+ {"unmap",{P}},
+ {"realize",{P}},
+ {"unrealize",{P}},
+ {"draw",{P}},
+ {"queue_draw",{P}},
+ {"queue_resize",{P}},
+ {"queue_resize_no_redraw",{P}},
+ {"get_frame_clock",{P},P,0,GdkFrameClock},
+ {"add_tick_callback",{P,P,P,P},I},
+ {"remove_tick_callback",{P,I}}, -- GTK 3.8+
+ {"set_size_request",{P,P,P},-routine_id("widget_set_size_request")},
+ {"size_allocate",{P,P}},
+ {"size_allocate_with_baseline",{P,P,I}},
+ {"add_accelerator",{P,S,P,I,I}},
+ {"remove_accelerator",{P,P,I,I},B},
+ {"set_accel_path",{P,S,P}},
+ {"can_activate_accel",{P,I},B},
+ {"event",{P,P},B},
+ {"activate",{P},B},
+ {"reparent",{P,P}}, -- deprecated 3.14
+ {"intersect",{P,P,P},B},
+ {"is_focus",{P},B},
+ {"grab_focus",{P},B},
+ {"grab_default",{P}},
+ {"set_name",{P,S},-routine_id("widget_set_name")},
+ {"get_name",{P},S},
+ {"set_sensitive",{P,B}},
+ {"get_sensitive",{P},B},
+ {"set_parent",{P,P}},
+ {"get_parent",{P},P},
+ {"set_parent_window",{P,P}},
+ {"get_parent_window",{P},P},
+ {"set_events",{P,I}},
+ {"get_events",{P},I},
+ {"add_events",{P,I}},
+ {"set_device_events",{P,P,I}},
+ {"get_device_events",{P,P},I},
+ {"add_device_events",{P,P,I}},
+ {"set_device_enabled",{P,P,B}},
+ {"get_device_enabled",{P,P},B},
+ {"get_toplevel",{P},P},
+ {"get_ancestor",{P,I},P},
+ {"is_ancestor",{P,P},B},
+ {"set_visual",{P,P}},
+ {"get_visual",{P},P,0,GdkVisual},
+ {"get_pointer",{P,I,I}}, -- deprecated 3.4
+ {"translate_coordinates",{P,P,I,I,I,I},B},
+ {"hide_on_delete",{P},B},
+ {"set_direction",{P,I}},
+ {"get_direction",{P},I},
+ {"set_default_direction",{I}},
+ {"get_default_direction",{},I},
+ {"shape_combine_region",{P,P}},
+ {"create_pango_context",{P},P},
+ {"get_pango_context",{P},P,0,PangoContext},
+ {"create_pango_layout",{P,S},P},
+ {"queue_draw_area",{P,I,I,I,I}},
+ {"queue_draw_region",{P,P}},
+ {"set_app_paintable",{P,B}},
+ {"set_double_buffered",{P,B}}, -- deprecated 3.14
+ {"set_redraw_on_allocate",{P,B}},
+ {"mnemonic_activate",{P,B},B},
+ {"send_expose",{P,P},I},
+ {"send_focus_change",{P,P},B},
+ {"get_accessible",{P},P},
+ {"child_focus",{P,I},B},
+ {"child_notify",{P,S}},
+ {"freeze_child_notify",{P}},
+ {"get_child_visible",{P},B},
+ {"get_parent",{P},P},
+ {"get_path",{P},P,0,GtkWidgetPath},
+ {"get_settings",{P},P,0,GtkSettings},
+ {"get_clipboard",{P,I},P,0,GtkClipboard},
+ {"get_display",{P},P,0,GdkDisplay},
+ {"get_root_window",{P},P,0,GdkWindow}, -- deprecated 3.12
+ {"get_screen",{P},P,0,GdkScreen},
+ {"has_screen",{P},B},
+ {"get_size_request",{P,I,I}},
+ {"set_child_visible",{P,B}},
+ {"thaw_child_notify",{P}},
+ {"set_no_show_all",{P,B}},
+ {"get_no_show_all",{P},B},
+ {"add_mnemonic_label",{P,P}},
+ {"remove_mnemonic_label",{P,P}},
+ {"is_composited",{P},B},
+ {"set_tooltip_markup",{P,S}},
+ {"get_tooltip_markup",{P},S},
+ {"set_tooltip_text",{P,S}},
+ {"get_tooltip_text",{P},S},
+ {"set_tooltip_window",{P,P}},
+ {"get_tooltip_window",{P},P,0,GtkWindow},
+ {"set_has_tooltip",{P,B}},
+ {"get_has_tooltip",{P},B},
+ {"trigger_tooltip_query",{P}},
+ {"get_window",{P},P,0,GdkWindow},
+ {"register_window",{P,P}}, -- GTK 3.8+
+ {"unregister_window",{P,P}}, -- GTK 3.8+
+ {"get_allocated_width",{P},I},
+ {"get_allocated_height",{P},I},
+ {"get_allocation",{P},-routine_id("widget_get_allocation")},
+ {"set_allocation",{P,P}},
+ {"get_allocated_baseline",{P},I},
+ {"get_app_paintable",{P},B},
+ {"set_can_default",{P,B}},
+ {"get_can_default",{P},B},
+ {"get_can_focus",{P},B},
+ {"get_double_buffered",{P},B}, -- deprecated 3.14
+ {"get_has_window",{P},B},
+ {"get_sensitive",{P},B},
+ {"get_visible",{P},B},
+ {"is_visible",{P},B}, -- GTK 3.8+
+ {"set_visible",{P,B}},
+ {"set_state_flags",{P,I,B}},
+ {"unset_state_flags",{P,I}},
+ {"get_state_flags",{P},I},
+ {"has_default",{P},B},
+ {"has_focus",{P},B},
+ {"has_visible_focus",{P},B},
+ {"has_grab",{P},B},
+ {"is_drawable",{P},B},
+ {"is_toplevel",{P},B},
+ {"set_window",{P,P}},
+ {"set_receives_default",{P,B}},
+ {"get_receives_default",{P},B},
+ {"set_support_multidevice",{P,B}},
+ {"get_support_multidevice",{P},B},
+ {"set_realized",{P,B}},
+ {"get_realized",{P},B},
+ {"set_mapped",{P,B}},
+ {"get_mapped",{P},B},
+ {"device_is_shadowed",{P,P},B},
+ {"get_modifier_mask",{P,I},I},
+ {"insert_action_group",{P,S,P}},
+ {"get_opacity",{P},D}, -- GTK 3.8+
+ {"set_opacity",{P,D}}, -- GTK 3.8+
+ {"get_path",{P},P,0,GtkWidgetPath},
+ {"get_style",{P},P,0,GtkStyle},
+ {"get_style_context",{P},P,0,GtkStyleContext},
+ {"reset_style",{P}},
+ {"get_preferred_height",{P,I,I}},
+ {"get_preferred_width",{P,I,I}},
+ {"get_preferred_height_for_width",{P,I,I,I}},
+ {"get_preferred_width_for_height",{P,I,I,I}},
+ {"get_preferred_height_and_baseline_for_width",{P,I,I,I,I,I}},
+ {"get_request_mode",{P},I},
+ {"get_preferred_size",{P,P,P}},
+ {"get_preferred_size_and_baseline",{P,P,I,I}},
+ {"get_halign",{P},I},
+ {"set_halign",{P,I}},
+ {"get_valign",{P},I},
+ {"set_valign",{P,I}},
+ {"set_margin_left",{P,I}}, -- deprecated 3.12
+ {"get_margin_left",{P},I}, -- deprecated 3.12
+ {"set_margin_right",{P,I}}, -- deprecated 3.12
+ {"get_margin_right",{P},I}, -- deprecated 3.12
+ {"get_margin_end",{P},I}, -- new 3.12
+ {"set_margin_end",{P,I}}, -- new 3.12
+ {"get_margin_start",{P},I}, -- new 3.12
+ {"set_margin_start",{P,I}}, -- new 3.12
+ {"set_margin_top",{P,I}},
+ {"get_margin_top",{P},I},
+ {"set_margin_bottom",{P,I}},
+ {"get_margin_bottom",{P},I},
+ {"get_hexpand",{P},B},
+ {"set_hexpand",{P,B}},
+ {"get_hexpand_set",{P},B},
+ {"set_hexpand_set",{P,B}},
+ {"get_vexpand",{P},B},
+ {"set_vexpand",{P,B}},
+ {"get_vexpand_set",{P},B},
+ {"set_vexpand_set",{P,B}},
+ {"queue_compute_expand",{P}},
+ {"compute_expand",{P,I},B},
+ {"init_template",{P}},
+ {"get_automated_child",{P,I,S},P,0,GObject},
+ {"get_clip",{P,P}}, -- 3.14
+ {"set_clip",{P},P}, -- 3.14
+ {"get_action_group",{P,S},P,0,GActionGroup}, -- 3.16
+ {"list_action_prefixes",{P},A}, -- 3.16
+ {"get_font_map",{P},P,0,PangoFontMap}, -- 3.18
+ {"set_font_map",{P,P}}, -- 3.18
+ {"get_font_options",{P},P}, -- 3.18
+ {"set_font_options",{P,P}}, -- 3.18
+ {"signal",{P,P,P,P,P,P},-routine_id("connect")},
+ {"list_accel_closures",{P},X,0,GList},
+ {"get_font",{P},-routine_id("widget_get_font")},
+ {"get_allocated_size",{P,P,I}}, -- 3.20
+ {"get_focus_on_click",{P},B}, -- 3.20
+ {"set_focus_on_click",{P,B}}, -- 3.20
+"GtkWidget"}
+
+ function widget_set_size_request(atom ctl, object x=0, object y=0)
+ if string(x) then
+ x = split(x,'x')
+ y = to_number(x[2])
+ x = to_number(x[1])
+ end if
+ gtk_func("gtk_widget_set_size_request",{P,I,I},{ctl,x,y})
+ return 1
+ end function
+
+ function widget_get_font(atom x)
+ object layout = get(x,"layout")
+ object context = gtk_func("pango_layout_get_context",{P},{layout})
+ object descr = gtk_func("pango_context_get_font_description",{P},{context})
+ return gtk_str_func("pango_font_description_to_string",{P},{descr})
+ end function
+
+ function widget_get_allocation(atom obj)
+ atom al = allocate(32,1)
+ gtk_func("gtk_widget_get_allocation",{P,P},{obj,al})
+ return peek4u({al,4})
+ end function
+
+ function widget_set_name(atom ctl, object name)
+ gtk_proc("gtk_widget_set_name",{P,P},{ctl,name})
+ integer x = find(ctl,vslice(registry,1))
+ if x > 0 then
+ registry[x][4] = peek_string(name)
+ end if
+ return 1
+ end function
+
+ -- This allows specifying a font name, e.g. "Courier bold 12" as a string,
+ -- instead of a pango font description object;
+ function widget_set_font(atom x, object fnt)
+ fnt = gtk_func("pango_font_description_from_string",{P},{fnt})
+ gtk_proc("gtk_widget_override_font",{P,P},{x,fnt})
+ return 1
+ end function
+
+ -- The functions below handle color conversion to/from rgba,
+ -- as well as supplying easier-to-use method names for setting background
+ -- and foreground. These methods are only used to set the colors of a widget
+ -- in the NORMAL state, whereas if you want to set the colors in
+ -- some other state, such as mouse-over, etc, you use the original
+ -- set(widget,"override background",STATE,"color") syntax.
+
+ function widget_set_foreground(atom x, object c) -- alias 'color'
+ return widget_override_color(x,0,c)
+ end function
+
+ function widget_set_background(atom x, object c) -- alias 'background'
+ return widget_override_background_color(x,0,c)
+ end function
+
+ function widget_override_color(atom x, integer state=0, object c)
+ if atom(c) then
+ c = text:format("#[:06X]",c)
+ end if
+ gtk_proc("gtk_widget_override_color",{P,I,P},{x,state,to_rgba(c)})
+ return 1
+ end function
+
+ function widget_override_background_color(atom x, integer state=0, object c)
+ if atom(c) then
+ c = text:format("#[:06X]",c)
+ end if
+ gtk_proc("gtk_widget_override_background_color",{P,I,P},{x,state,to_rgba(c)})
+ return 1
+ end function
+
+widget[GtkContainer] = {"gtk_container",
+{GtkWidget,GtkBuildable,GObject},
+ {"add",{P,P}},
+ {"remove",{P,P}},
+ {"check_resize",{P}},
+ {"foreach",{P,P,P}},
+ {"get_children",{P},X},
+ {"get_path_for_child",{P,P},S},
+ {"set_focus_child",{P,P}},
+ {"get_focus_child",{P},P},
+ {"set_focus_vadjustment",{P,P}},
+ {"get_focus_vadjustment",{P},P,0,GtkAdjustment},
+ {"set_focus_hadjustment",{P,P}},
+ {"get_focus_hadjustment",{P},P,0,GtkAdjustment},
+ {"child_type",{P},I},
+ {"forall",{P,P,P}},
+ {"set_border",{P,I},-routine_id("set_border")},
+ {"set_border_width",{P,I}},
+ {"get_border_width",{P},I},
+ {"propagate_draw",{P,P,P}},
+ {"child_notify",{P,P,S}},
+ {"child_notify_by_pspec",{P,P,P}}, -- 3.18
+ {"class_install_child_properties",{P,I,P}}, -- 3.18
+"GtkContainer"}
+
+ function set_border(atom cont, integer w) -- alias for 'border_width';
+ gtk_proc("gtk_container_set_border_width",{P,I},{cont,w})
+ return 1
+ end function
+
+widget[GdkKeymap] = {"gdk_keymap",
+{GObject},
+ {"new",{},-routine_id("new_keymap")},
+ {"get_default",{},-routine_id("new_keymap")},
+ {"get_for_display",{P},P,0,GdkKeymap},
+ {"get_capslock_state",{P},B},
+ {"get_numlock_state",{P},B},
+ {"get_modifier_state",{P},I},
+ {"get_direction",{P},I},
+ {"have_bidi_layouts",{P},B},
+ {"lookup_key",{P,P},I},
+ {"get_scroll_lock_state",{P,B}},
+"GdkKeymap"}
+
+ function new_keymap(atom disp=0)
+ if disp=0 then
+ return gtk_func("gdk_keymap_get_default")
+ else
+ return gtk_func("gdk_keymap_get_for_display",{P},P)
+ end if
+ end function
+
+widget[GtkBin] = {"gtk_bin",
+{GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"get_child",{P},P},
+"GtkBin"}
+
+widget[GtkBox] = {"gtk_box",
+{GtkContainer,GtkWidget,GtkOrientable,GtkBuildable,GObject},
+ {"new",{I,I},P},
+ {"pack_start",{P,P,B,B,I}},
+ {"pack_end",{P,P,B,B,I}},
+ {"set_homogeneous",{P,B}},
+ {"get_homogeneous",{P},B},
+ {"set_spacing",{P,I}},
+ {"get_spacing",{P},I},
+ {"reorder_child",{P,P,I}},
+ {"query_child_packing",{P,P,B,B,I,I}},
+ {"set_child_packing",{P,P,B,B,I,I}},
+ {"set_baseline_position",{P,I}},
+ {"get_baseline_position",{P},I},
+ {"get_center_widget",{P},P,0,GtkWidget}, -- 3.12
+ {"set_center_widget",{P,P}}, -- 3.12
+"GtkBox"}
+
+widget[GtkButtonBox] = {"gtk_button_box",
+{GtkBox,GtkContainer,GtkWidget,GtkBuilder,GtkOrientable,GObject},
+ {"new",{I},P},
+ {"set_layout",{P,I}},
+ {"get_layout",{P},I},
+ {"set_child_secondary",{P,P,B}},
+ {"get_child_secondary",{P,P},B},
+ {"set_child_non_homogeneous",{P,P,B}},
+ {"get_child_non_homogeneous",{P,P},P},
+"GtkButtonBox"}
+
+widget[GtkWindowGroup] = {"gtk_window_group",
+{GObject},
+ {"new",{},P},
+ {"add_window",{P,P}},
+ {"remove_window",{P,P}},
+ {"list_windows",{P},X,0,GList},
+ {"get_current_grab",{P},P,0,GtkWidget},
+ {"get_current_grab_device",{P,P},P,0,GtkWidget},
+"GtkWindowGroup"}
+
+-- shortcuts are new in 3.20, inadequate documentation means there's no way to test yet;
+widget[GtkShortcutsWindow] = {"gtk_shortcuts_window",
+{GtkWindow,GtkBin,GtkContainer,GtkWidget,GObject},
+-- properties:
+-- section-name
+-- view-name
+"GtkShortcutsWindow"}
+
+widget[GtkShortcutsSection] = {"gtk_shortcuts_section",
+{GtkBox,GtkContainer,GtkWidget,GObject},
+-- properties;
+-- max-height
+-- section-name
+-- title
+-- view-name
+"GtkShortcutsSection"}
+
+widget[GtkShortcutsGroup] = {"gtk_shortcuts_group",
+{GtkBox,GtkContainer,GtkWidget,GObject},
+-- properties;
+-- accel-size-group
+-- height
+-- title
+-- title-size-group
+-- view
+"GtkShortcutsGroup"}
+
+widget[GtkShortcutsShortcut] = {"gtk_shortcuts_shortcut",
+{GtkBox,GtkContainer,GtkWidget,GObject},
+-- properties;
+-- accel-size-group
+-- accelerator
+-- title
+-- title-size-group
+"GtkShortcutsShortcut"}
+
+widget[GtkShortcutsGesture] = {"gtk_shortcuts_gesture",
+{GtkBox,GtkContainer,GtkWidget,GObject},
+-- properties;
+-- icon
+-- icon-size-group
+-- subtitle
+-- title
+-- title-size-group
+"GtkShortcutsGesture"}
+
+widget[GtkWindow] = {"gtk_window",
+{GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{I},P},
+ {"set_title",{P,S}},
+ {"get_title",{P},S},
+ {"set_resizable",{P,B}},
+ {"get_resizable",{P},B},
+ {"get_size",{P,I,I}},
+ {"set_size",{P,P},-routine_id("win_set_size")}, -- alias;
+ {"set_position",{P,P},-routine_id("win_set_pos")}, -- alias
+ --{"set_position",{P,I}}, -- alias above allows 2 forms of 'position';
+ {"set_default",{P,P}},
+ {"set_default_size",{P,I,I}},
+ {"get_default_size",{P,I,I}},
+ {"get_position",{P,I,I}},
+ {"add_accel_group",{P,P}},
+ {"remove_accel_group",{P,P}},
+ {"activate_focus",{P},B},
+ {"activate_default",{P},B},
+ {"set_modal",{P,B}},
+ {"get_modal",{P},B},
+ {"set_default_geometry",{P,I,I}},
+ {"set_geometry_hints",{P,P,P,I}},
+ {"set_gravity",{P,I}},
+ {"get_gravity",{P},I},
+ {"set_transient_for",{P,P}},
+ {"get_transient_for",{P},P,0,GtkWindow},
+ {"set_attached_to",{P,P}},
+ {"get_attached_to",{P},P,0,GtkWidget},
+ {"set_destroy_with_parent",{P,B}},
+ {"get_destroy_with_parent",{P},B},
+ {"set_hide_titlebar_when_maximized",{P,B}},
+ {"get_hide_titlebar_when_maximized",{P},B},
+ {"set_screen",{P,P}},
+ {"get_screen",{P},P,0,GdkScreen},
+ {"is_active",{P},B},
+ {"list_toplevels",{P},X,0,GSList},
+ {"has_toplevel_focus",{P},B},
+ {"add_mnemonic",{P,I,P}},
+ {"remove_mnemonic",{P,I,P}},
+ {"set_mnemonics_visible",{P,B}},
+ {"get_mnemonics_visible",{P},B},
+ {"mnemonic_activate",{P,I,I},B},
+ {"activate_key",{P,P},B},
+ {"propagate_key_event",{P,P},B},
+ {"get_focus",{P},P,0,GtkWidget},
+ {"set_focus",{P,P}},
+ {"set_focus_visible",{P,B}},
+ {"get_focus_visible",{P},B},
+ {"get_default_widget",{P},P,0,GtkWidget},
+ {"set_default",{P,P}},
+ {"present",{P}},
+ {"present_with_time",{P,P}},
+ {"iconify",{P}},
+ {"deiconify",{P}},
+ {"stick",{P}},
+ {"unstick",{P}},
+ {"maximize",{P}},
+ {"unmaximize",{P}},
+ {"fullscreen",{P}},
+ {"unfullscreen",{P}},
+ {"set_keep_above",{P,B}},
+ {"set_keep_below",{P,B}},
+ {"begin_resize_drag",{P,I,I,I,I,I}},
+ {"begin_move_drag",{P,I,I,I,I}},
+ {"set_decorated",{P,B}},
+ {"get_decorated",{P},B},
+ {"set_deletable",{P,B}},
+ {"get_deletable",{P},B},
+ {"set_mnemonic_modifier",{P,I}},
+ {"get_mnemonic_modifier",{P},I},
+ {"set_type_hint",{P,I}},
+ {"get_type_hint",{P},I},
+ {"set_skip_taskbar_hint",{P,B}},
+ {"get_skip_taskbar_hint",{P},B},
+ {"set_skip_pager_hint",{P,B}},
+ {"get_skip_pager_hint",{P},B},
+ {"set_urgency_hint",{P,B}},
+ {"get_urgency_hint",{P},B},
+ {"set_accept_focus",{P,B}},
+ {"get_accept_focus",{P},B},
+ {"set_focus_on_map",{P,B}},
+ {"get_focus_on_map",{P},B},
+ {"set_startup_id",{P,S}},
+ {"set_role",{P,S}},
+ {"get_role",{P},S},
+ {"get_icon",{P},P,0,GdkPixbuf},
+ {"get_icon_name",{P},S},
+ {"get_icon_list",{P},P,0,GList},
+ {"get_default_icon_list",{P},X,0,GList},
+ {"get_group",{P},P,0,GtkWindowGroup},
+ {"has_group",{P},B},
+ {"get_window_type",{P},I},
+ {"move",{P,I,I}},
+ {"parse_geometry",{P,S},B},
+ {"resize",{P,I,I}},
+ {"resize_to_geometry",{P,I,I}},
+ {"set_has_resize_grip",{P,B}},
+ {"get_has_resize_grip",{P},B},
+ {"resize_grip_is_visible",{P},B}, -- deprecated 3.14
+ {"get_resize_grip_area",{P,P},B}, -- deprecated 3.14
+ {"set_titlebar",{P,P}}, -- 3.10
+ {"get_titlebar",{P},P,0,GtkWidget}, -- 3.16
+ {"set_icon",{P,P},-routine_id("win_set_icon")},
+ {"restore",{P},-routine_id("win_restore")}, -- see below;
+ {"close",{P}}, -- 3.10
+ {"set_opacity",{P,D}},
+ {"is_maximized",{P},B}, -- 3.12
+ {"set_interactive_debugging",{B}}, -- 3.14
+ {"fullscreen_on_monitor",{P,P,I}}, -- 3.18
+ {"set_application",{P,P}},
+ {"get_application",{P},P,0,GtkApplication},
+ {"set_cursor",{P,P},-routine_id("win_set_cursor")},
+"GtkWindow"}
+
+ function win_set_size(atom win, object size)
+ -- allow for WxH format to be passed;
+ if match("x",size) then size = split(size,'x') end if
+ if match("{",size) = 1 and match("}",size) = length(size) then
+ size = size[2..$-1]
+ size = split(size,',')
+ end if
+ set(win,"default_size",size[1],size[2])
+ return 1
+ end function
+
+ function win_set_pos(atom win, object pos)
+ if integer(pos) then -- only one integer passed;
+ gtk_proc("gtk_window_set_position",{P,I},{win,pos}) -- use original call;
+ return 1
+ end if
+ -- else position is WxH format, so call move instead;
+ if match("x",pos) then pos = split(pos,'x') end if
+ if match("{",pos) = 1 and match("}",pos) = length(pos) then
+ pos = pos[2..$-1]
+ pos = split(pos,',')
+ end if
+ set(win,"move",pos[1],pos[2])
+ return 1
+ end function
+
+ function win_set_cursor(atom win, object cursor)
+ atom gdkwin = get(win,"window")
+ cursor = create(GdkCursor,cursor)
+ set(gdkwin,"cursor",cursor)
+ return cursor
+ end function
+
+ -- this replaces a handy but deprecated GTK function which
+ -- restores a window to its original size after being resized
+ -- to fit larger contents;
+ function win_restore(atom win)
+ set(win,"hide")
+ set(win,"unrealize")
+ gtk_proc("gtk_window_set_position",{P,I},{win,1})
+ set(win,"show")
+ return 1
+ end function
+
+ -- manages the creation of window icon from a variety of source formats.
+ -- this makes life much easier for the programmer.
+ function win_set_icon(object win, object icon)
+ object path
+
+ if string(icon) then
+ path = locate_file(icon)--display(path)
+ if file_type(path) = 1 then
+ gtk_proc("gtk_window_set_icon_from_file",{P,P},
+ {win,allocate_string(path,1)})
+ return 1
+ else
+ gtk_proc("gtk_window_set_icon_name",{P,P},
+ {win,allocate_string(icon,1)})
+ return 1
+ end if
+ end if
+
+ if sequence(icon) then
+ gtk_proc("gtk_window_set_icon",{P,P},{win,xpm_to_pixbuf(icon)})
+ end if
+
+ if atom(icon) then
+ if class_id(icon) = GtkImage then
+ icon = get(icon,"pixbuf")
+ end if
+ if class_id(icon) = GdkPixbuf then
+ gtk_proc("gtk_window_set_icon",{P,P},{win,icon})
+ end if
+ return 1
+ end if
+
+ return 0
+ end function
+
+widget[GtkMisc] = {"gtk_misc", -- deprecated 3.14
+{GtkWidget,GtkBuildable,GObject},
+ {"set_alignment",{P,F,F}},
+ {"get_alignment",{P,F,F}},
+ {"set_padding",{P,I,I}},
+ {"get_padding",{P,I,I}},
+"GtkMisc"}
+
+widget[GtkLabel] = {"gtk_label",
+{GtkMisc,GtkWidget,GtkBuildable,GObject},
+ {"new",{S},P},
+ {"new_with_mnemonic",{S},P,0,GtkLabel},
+ {"set_text",{P,S}},
+ {"set_value",{P,D},-routine_id("lbl_set_value")}, -- convenience, converts # to readable form;
+ {"get_text",{P},S},
+ {"set_markup",{P,S}},
+ {"set_text_with_mnemonic",{P,S}},
+ {"set_markup_with_mnemonic",{P,S}},
+ {"set_pattern",{P,S}},
+ {"set_justify",{P,I}},
+ {"get_justify",{P},I},
+ {"get_attributes",{P},P,0,PangoAttrList},
+ {"set_ellipsize",{P,I}},
+ {"get_ellipsize",{P},I},
+ {"set_width_chars",{P,I}},
+ {"get_width_chars",{P},I},
+ {"set_max_width_chars",{P,I}},
+ {"get_max_width_chars",{P},I},
+ {"set_line_wrap",{P,B}},
+ {"get_line_wrap",{P},B},
+ {"set_line_wrap_mode",{P,I}},
+ {"get_layout_offsets",{P,I,I}},
+ {"get_mnemonic_keyval",{P},I},
+ {"set_selectable",{P,B}},
+ {"get_selectable",{P},B},
+ {"select_region",{P,I,I}},
+ {"get_selection_bounds",{P,I,I},B},
+ {"set_mnemonic_widget",{P,P}},
+ {"get_mnemonic_widget",{P},P,0,GtkWidget},
+ {"get_label",{P},S},
+ {"get_layout",{P},P,0,PangoLayout},
+ {"get_line_wrap_mode",{P},I},
+ {"set_use_markup",{P,B}},
+ {"get_use_markup",{P},B},
+ {"set_use_underline",{P,B}},
+ {"get_use_underline",{P},B},
+ {"set_single_line_mode",{P,B}},
+ {"get_single_line_mode",{P},B},
+ {"set_angle",{P,D}},
+ {"get_current_uri",{P},S},
+ {"set_track_visited_links",{P,B}},
+ {"get_track_visited_links",{P},B},
+ {"set_lines",{P,I}}, -- 3.10
+ {"get_lines",{P},I}, -- 3.10
+ {"get_xalign",{P},F}, -- 3.16
+ {"get_yalign",{P},F}, -- 3.16
+ {"set_xalign",{P,F}}, -- 3.16
+ {"set_yalign",{P,F}}, -- 3.16
+"GtkLabel"}
+
+ function lbl_set_value(atom lbl, atom val) -- provided for convenience;
+ set(lbl,"text",sprintf("%2.2f",val)) -- convert atom to string for label;
+ return 1
+ end function
+
+widget[GtkImage] = {"gtk_image",
+{GtkMisc,GtkWidget,GtkBuildable,GObject},
+ {"new",{P,I,I,I},-routine_id("newImage")},
+ {"set_image",{P,P,P},-routine_id("setImage")}, -- not a gtk func
+ {"set_from_file",{P,S}},
+ {"set_from_pixbuf",{P,P}},
+ {"set_from_icon_name",{P,S,I}},
+ {"set_from_animation",{P,P}},
+ {"set_from_gicon",{P,P,I}},
+ {"set_from_resource",{P,S}},
+ {"set_from_surface",{P,P}}, -- 3.10
+ {"clear",{P}},
+ {"set_pixel_size",{P,I}},
+ {"get_pixel_size",{P},I},
+ {"get_pixbuf",{P},P,0,GdkPixbuf}, -- doesn't work!
+ {"get_animation",{P},P,0,GdkPixbufAnimation},
+ {"get_storage_type",{P},I},
+ {"get_icon_name",{P},-routine_id("img_get_icon_name")},
+"GtkImage"}
+
+-----------------------------------------------------
+ -- create an image from a variety of source formats
+ ----------------------------------------------------
+ function newImage(object icon=0, integer size=6, integer w=0, integer h=0)
+
+ if atom(icon) then
+ if icon = 0 then
+ return gtk_func("gtk_image_new") -- just a blank image requested;
+ else
+ switch class_id(icon) do
+ case GdkPixbuf then
+ icon = gtk_func("gtk_image_new_from_pixbuf",{P},{icon})
+ case GIcon then
+ icon = gtk_func("gtk_image_new_from_gicon",{P,I},{icon,size})
+ case CairoSurface_t then
+ icon = gtk_func("gtk_image_new_from_surface",{P},{icon})
+ case else -- do nothing
+ end switch
+ end if
+ return icon
+ end if
+
+ object theme, icon_info
+
+ if string(icon) then
+
+ if begins("gtk-",icon) then -- from stock (deprecated)
+ if size = 0 then size = 6 end if
+ return gtk_func("gtk_image_new_from_icon_name",{P,I},
+ {allocate_string(icon,1),size}) -- size is a GTK_ICON_SIZE_ enum;
+ end if
+
+ if file_exists(canonical_path(icon)) then -- from file
+ icon = canonical_path(icon)
+ if h = 0 and w = 0 then -- return at natural size;
+ return gtk_func("gtk_image_new_from_file",{P},
+ {allocate_string(icon,1)})
+ else
+ icon = newPixbuf(icon,w,h,size) -- resize it;
+ return gtk_func("gtk_image_new_from_pixbuf",{P},{icon})
+ end if
+ end if
+
+ if file_exists(locate_file(icon)) then -- from file
+ icon = locate_file(icon)
+ if h = 0 and w = 0 then -- return at natural size;
+ return gtk_func("gtk_image_new_from_file",{P},
+ {allocate_string(icon,1)})
+ else
+ icon = newPixbuf(icon,w,h,size) -- resize it;
+ return gtk_func("gtk_image_new_from_pixbuf",{P},{icon})
+ end if
+ end if
+
+ if size < 7 then
+ icon = gtk_func("gtk_image_new_from_icon_name",{P,I},{icon,size})
+ else
+ theme = create(GtkIconTheme) -- get current theme;
+ icon_info = get(theme,"lookup icon",icon,size) -- get icon details;
+ icon = get(icon_info,"load icon") -- load selected icon;
+ return create(GtkImage,icon)
+ end if
+
+ end if
+
+ return icon
+ end function
+
+ -----------------------------------------------------------------------------------
+ function setImage(atom img, object icon, integer size=0)
+ -----------------------------------------------------------------------------------
+
+ if size = 0 then
+ size = get(img,"pixel size")
+ end if
+
+ if string(icon) then
+
+ if file_exists(canonical_path(icon)) then -- from file
+ set(img,"from file",icon)
+ set(img,"pixel size",size)
+ return img
+ end if
+
+ if begins("gtk-",icon) then -- from stock (deprecated)
+ set(img,"from stock",icon)
+ return img
+ end if
+
+ set(img,"from icon name",icon)
+ return img
+
+ end if
+ return img
+ end function
+
+ function img_get_icon_name(atom img)
+ atom name = allocate(8), size = allocate(8)
+ atom fn = define_proc("gtk_image_get_icon_name",{P,P,P})
+ c_proc(fn,{img,name,size})
+ if name > 0 then
+ return {peek_string(peek4u(name)),peek4u(size)}
+ else return -1
+ end if
+ end function
+
+widget[GdkCursor] = {"gdk_cursor",
+{GObject},
+ {"new",{P,P,P},-routine_id("newCursor")},
+ {"get_display",{P},P,0,GdkDisplay},
+ {"get_image",{P},P,0,GdkPixbuf},
+ {"get_surface",{P,D,D},P,0,CairoSurface_t},
+ {"get_cursor_type",{P},I},
+"GdkCursor"}
+
+ -- manages cursor creation from a variety of sources
+ function newCursor(object a, object b=0, integer c=0)
+ atom disp = gtk_func("gdk_display_get_default")
+
+ if string(a) then
+ return gtk_func("gdk_cursor_new_from_name",{P,P},{disp,allocate_string(a,1)})
+ end if
+
+ if class_id(a) = GdkPixbuf then
+ return gtk_func("gdk_cursor_new_from_pixbuf",{P,P,I,I},{disp,a,b,c})
+ end if
+
+ if class_id(a) = CairoSurface_t then
+ return gtk_func("gdk_cursor_new_from_surface",{P,P,D,D},{disp,a,b,c})
+ end if
+
+ if integer(a) then
+ return gtk_func("gdk_cursor_new_for_display",{P,I},{disp,a})
+ end if
+
+ end function
+
+widget[GdkWindow] = {"gdk_window",
+{GObject},
+ {"new",{P,P,I},P},
+ {"set_title",{P,S}},
+ {"destroy",{P}},
+ {"get_width",{P},I},
+ {"get_height",{P},I},
+ {"get_position",{P,I,I}},
+ {"get_device_position",{P,P,P,P,P},P,0,GdkWindow},
+ {"get_device_position_double",{P,P,P,P,P},P,0,GdkWindow},
+ {"get_origin",{P,I,I}},
+ {"get_parent",{P},P,0,GdkWindow},
+ {"get_toplevel",{P},P,0,GdkWindow},
+ {"get_children",{P},A,0,GList},
+ {"get_children_with_user_data",{P,P},A,0,GList},
+ {"peek_children",{P},P,0,GList},
+ {"get_events",{P},I},
+ {"set_events",{P,I}},
+ {"set_icon_name",{P,S}},
+ {"set_transient_for",{P,P}},
+ {"get_root_origin",{P,I,I}},
+ {"get_root_coords",{P,I,I,P,P}},
+ {"get_frame_extents",{P,P}},
+ {"set_modal_hint",{P,B}},
+ {"get_modal_hint",{P},B},
+ {"set_type_hint",{P,I}},
+ {"get_type_hint",{P},I},
+ {"get_window_type",{P},I},
+ {"get_display",{P},P,0,GdkDisplay},
+ {"get_screen",{P},P,0,GdkScreen},
+ {"get_visual",{P},P,0,GdkVisual},
+ {"show",{P}},
+ {"show_unraised",{P}},
+ {"hide",{P}},
+ {"is_destroyed",{P},B},
+ {"is_visible",{P},B},
+ {"is_viewable",{P},B},
+ {"is_input_only",{P},B},
+ {"is_shaped",{P},B},
+ {"set_composited",{P,B}}, -- deprecated 3.16
+ {"get_composited",{P},B}, -- deprecated 3.16
+ {"set_opacity",{P,D}},
+ {"set_cursor",{P,P}},
+ {"get_cursor",{P},P},
+ {"get_state",{P},I},
+ {"withdraw",{P}},
+ {"iconify",{P}},
+ {"deiconify",{P}},
+ {"stick",{P}},
+ {"unstick",{P}},
+ {"maximize",{P}},
+ {"unmaximize",{P}},
+ {"fullscreen",{P}},
+ {"unfullscreen",{P}},
+ {"set_fullscreen_mode",{P,I}},
+ {"get_fullscreen_mode",{P},I},
+ {"set_opacity",{P,D}},
+ {"scroll",{P,I,I}},
+ {"move_region",{P,P,I,I}},
+ {"shape_combine_region",{P,P,I,I}},
+ {"set_child_shapes",{P}},
+ {"merge_child_shapes",{P}},
+ {"input_shape_combine_region",{P,P,I,I}},
+ {"set_child_input_shapes",{P}},
+ {"merge_child_input_shapes",{P}},
+ {"get_geometry",{P,I,I,I,I}},
+ {"set_background_rgba",{P,P}},
+ {"set_fullscreen_mode",{P,I}},
+ {"get_fullscreen_mode",{P},I},
+ {"get_scale_factor",{P},I},
+ {"set_opaque_region",{P,P}},
+ {"get_effective_parent",{P},P,0,GdkWindow},
+ {"get_effective_toplevel",{P},P,0,GdkWindow},
+ {"beep",{}},
+ {"focus",{P,I}},
+ {"restack",{P,P,B}},
+ {"raise",{P}},
+ {"lower",{P}},
+ {"set_keep_above",{P,B}},
+ {"set_keep_below",{P,B}},
+ {"reparent",{P,P,I,I}},
+ {"ensure_native",{P},B},
+ {"has_native",{P},B},
+ {"register_dnd",{P}},
+ {"move",{P,I,I}},
+ {"scroll",{P,I,I}},
+ {"resize",{P,I,I}},
+ {"move_resize",{P,I,I,I,I}},
+ {"move_region",{P,P,I,I}},
+ {"begin_resize_drag",{P,I,I,I,I,I}},
+ {"begin_resize_drag_for_device",{P,I,P,I,I,I,I}},
+ {"begin_move_drag",{P,I,I,I,I}},
+ {"begin_move_drag_for_device",{P,P,I,I,I,I}},
+ {"show_window_menu",{P,P},B},
+ {"create_gl_context",{P,P},P,0,GdkGLContext}, -- 3.16
+ {"mark_paint_from_clip",{P,P}}, -- 3.16
+ {"get_clip_region",{P},P,0,CairoRegion_t},
+ {"begin_paint_rect",{P,P}},
+ {"begin_paint_region",{P,P}},
+ {"end_paint",{P}},
+ {"set_opaque_region",{P,P}},
+ {"get_visible_region",{P},P,0,CairoRegion_t},
+ {"set_invalidate_handler",{P,P}},
+ {"invalidate_rect",{P,P,B}},
+ {"invalidate_region",{P,P,B}},
+ {"invalidate_maybe_recurse",{P,P,P,P}},
+ {"get_update_area",{P},P,0,CairoRegion_t},
+ {"freeze_updates",{P}},
+ {"thaw_updates",{P}},
+ {"process_all_updates",{P}},
+ {"process_updates",{P,B}},
+ {"get_frame_clock",{P},P,0,GdkFrameClock},
+ {"set_user_data",{P,P}},
+ {"get_user_data",{P,P}},
+ {"set_override_redirect",{P,B}},
+ {"set_accept_focus",{P,B}},
+ {"get_accept_focus",{P},B},
+ {"set_focus_on_map",{P,B}},
+ {"get_focus_on_map",{P},B},
+ {"add_filter",{P,P,P}},
+ {"remove_filter",{P,P,P}},
+ {"set_background_pattern",{P,P}},
+ {"get_background_pattern",{P},P,0,CairoPattern_t},
+ {"set_geometry_hints",{P,P,I}},
+ {"set_functions",{P,I}},
+ {"get_pass_through",{P},B},
+ {"set_pass_through",{P,B}},
+ {"create_gl_context",{P,P},P,0,GdkGLContext},
+ {"mark_paint_from_clip",{P,P}},
+"GdkWindow"}
+
+widget[GdkPixbuf] = {"gdk_pixbuf",
+{GObject},
+ {"new",{P,I,I,I},-routine_id("newPixbuf")},
+ {"get_from_window",{P,I,I,I,I},P,0,GdkPixbuf},
+ {"get_from_surface",{P,I,I,I,I},P,0,GdkPixbuf},
+ {"flip",{P,I},P,0,GdkPixbuf},
+ {"rotate_simple",{P,I},P,0,GdkPixbuf},
+ {"scale_simple",{P,I,I,I},P,0,GdkPixbuf},
+ {"add_alpha",{P,B,I,I,I},P,0,GdkPixbuf},
+ {"copy_area",{P,I,I,I,I,P,I,I}},
+ {"apply_embedded_orientation",{P},P,0,GdkPixbuf},
+ {"fill",{P,P}},
+ {"get_n_channels",{P},I},
+ {"get_has_alpha",{P},B},
+ {"get_colorspace",{P},I},
+ {"get_bits_per_sample",{P},I},
+ {"get_pixels_with_length",{P,I},P},
+ {"get_width",{P},I},
+ {"get_height",{P},I},
+ {"get_size",{P},-routine_id("getPixbufSize")},
+ {"get_rowstride",{P},I},
+ {"get_byte_length",{P},I},
+ {"get_option",{P,S},S},
+ {"saturate_and_pixelate",{P,P,F,B},0,GdkPixbuf},
+ {"composite_color_simple",{}},-- Cannot implement, use gtk_func if required.
+ {"save",{P,P,P,P},-routine_id("pb_save")},
+ {"get_file_info",{P,S},-routine_id("pb_get_file_info")},
+ {"get_format",{P,S},-routine_id("pb_get_format")},
+"GdkPixbuf"}
+
+ -- creates a pixbuf from a variety of sources
+
+ function newPixbuf(object name, integer w=0, integer h=0, atom ratio=0)
+ -----------------------------------------------------------------------
+ atom err = allocate(32,1) err = 0
+ object path=allocate_string("gtk-missing-image",1)
+ object pix = 0
+
+ if string(name) then
+
+ path = canonical_path(locate_file(name))
+
+ if file_exists(path) then
+ ifdef PIXBUF then
+ display("PIXBUF from file: []",{abbreviate_path(path)},0)
+ end ifdef
+ path = allocate_string(path,1)
+ goto "build"
+ end if
+
+ if has_icon(name) then
+ path = icon_info(name)
+ ifdef PIXBUF then
+ display("PIXBUF from icon: []",{filename(path[3])},0)
+ end ifdef
+ if string(path[3]) then
+ path = allocate_string(path[3],1)
+ else
+ path = "!"
+ end if
+ goto "build"
+ else return 0
+ end if
+
+ else
+ ifdef PIXBUF then
+ display("PIXBUF from atom: [] []",{name,peek_string(name)},0)
+ end ifdef
+ end if -- string name;
+
+ label "build"
+
+ if h = 0 and w = 0 then -- return at original size;
+ ifdef PIXBUF then display("Orig size") end ifdef
+ pix = gtk_func("gdk_pixbuf_new_from_file",{P,P},{path,err})
+
+ else -- if one or other dimension given, scale it, otherwise size it;
+ if w > 0 and h = 0 then h = -1 end if
+ if w = 0 and h > 0 then w = -1 end if
+ ifdef PIXBUF then display("\t SCALE []x[] []",{w,h,ratio}) end ifdef
+ pix = gtk_func("gdk_pixbuf_new_from_file_at_scale",{P,I,I,B,P},{path,w,h,ratio,err})
+ end if
+
+ ifdef PIXBUF_ERR then
+ if pix = 0 then
+ display("CAUTION: cannot create pixbuf from []",{peek_string(path)})
+ end if
+ end ifdef
+
+ return pix
+ end function
+
+ -- save a pixbuf in various formats based on file extension(.png, .jpg, etc)
+ function pb_save(atom handle, object fn, object ft, object params = 0)
+ if string(fn) then fn = allocate_string(fn,1) end if
+ if string(ft) then ft = allocate_string(ft,1) end if
+ if string(params) then
+ params = split(params,'=')
+ for i = 1 to length(params) do
+ params[i] = allocate_string(params[i],1)
+ end for
+ end if
+
+ atom err = allocate(8,1) err = 0
+ if atom(params) then
+ return gtk_func("gdk_pixbuf_save",{P,P,P,P,P},{handle,fn,ft,err,0})
+ else
+ return gtk_func("gdk_pixbuf_save",{P,P,P,P,P,P,P},{handle,fn,ft,err,params[1],params[2],0})
+ end if
+ end function
+
+ function getPixbufSize(object pb)
+ return {get(pb,"width"),get(pb,"height")}
+ end function
+
+ function pb_get_file_info(atom pb, object name)
+ atom w = allocate(8,1), h = allocate(8,1)
+ object fmt = gtk_func("gdk_pixbuf_get_file_info",{P,P,P},
+ {name,w,h})
+ return {fmt,peek4u(w),peek4u(h)}
+ end function
+
+ function pb_get_format(atom pb, object name)
+ object fmt = pb_get_file_info(pb,name)
+ return fmt
+ end function
+
+ export function pixbuf_formats()
+ object fmts = gtk_func("gdk_pixbuf_get_formats")
+ register(fmts,GSList)
+ return unpack_gs_str_list(fmts)
+ end function
+
+widget[GdkPixbufFormat] = {"gdk_pixbuf_format",
+{GObject},
+ {"get_name",{P},S},
+ {"get_description",{P},S},
+ {"get_mime_types",{P},A},
+ -- {"extensions",{P},P}, -- error
+ {"is_writable",{P},B},
+ {"is_scalable",{P},B},
+ {"is_disabled",{P},B},
+ {"set_disabled",{P,B}},
+ {"get_license",{P},S},
+"GdkPixbufFormat"}
+
+widget[GtkDialog] = {"gtk_dialog",
+{GtkWindow,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"run",{P},I},
+ {"get_action_area",{P},P,0,GtkBox}, -- deprecated 3.12
+ {"get_content_area",{P},P,0,GtkBox},
+ {"response",{P,I}},
+ {"add_button",{P,S,I},P,0,GtkButton},
+ {"add_action_widget",{P,P,I}},
+ {"set_default_response",{P,I}},
+ {"set_response_sensitive",{P,I,B}},
+ {"get_response_for_widget",{P,P},I},
+ {"get_widget_for_response",{P,I},P,0,GtkWidget},
+ {"get_header_bar",{P},P,0,GtkContainer},-- GTK 3.12
+"GtkDialog"}
+
+widget[GtkMessageDialog] = {"gtk_message_dialog",
+{GtkDialog,GtkWindow,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{P,I,I,I,S,S},P},
+ {"new_with_markup",{P,I,I,I,S,S},P},
+ {"set_markup",{P,S}},
+ {"set_image",{P,P}}, -- deprecated 3.12
+ {"get_image",{P},P,0,GtkImage}, -- deprecated 3.12
+ {"format_secondary_text",{P,S,S}},
+ {"format_secondary_markup",{P,S,S}},
+ {"get_message_area",{P},P,0,GtkContainer},
+"GtkMessageDialog"}
+
+widget[GtkSeparator] = {"gtk_separator",
+{GtkWidget,GObject,GtkBuildable,GtkOrientable},
+ {"new",{I},P},
+"GtkSeparator"}
+
+widget[GtkEditable] = {"gtk_editable",
+{0},
+ {"select_region",{P,I,I}},
+ {"get_selection_bounds",{P,I,I}},
+ {"insert_text",{P,S,I,I}},
+ {"delete_text",{P,I,I}},
+ {"get_chars",{P,I,I},S},
+ {"cut_clipboard",{P}},
+ {"copy_clipboard",{P}},
+ {"paste_clipboard",{P}},
+ {"delete_selection",{P}},
+ {"set_position",{P,I}},
+ {"get_position",{P},I},
+ {"set_editable",{P,B}},
+ {"get_editable",{P},B},
+"GtkEditable"}
+
+widget[GtkTextIter] = {"gtk_text_iter",
+{GObject},
+ {"get_buffer",{P},P,0,GtkTextBuffer},
+ {"copy",{P},P,0,GtkTextIter},
+ {"free",{P}},
+ {"get_offset",{P},I},
+ {"get_line",{P},I},
+ {"get_line_offset",{P},I},
+ {"get_line_index",{P},I},
+ {"get_visible_line_index",{P},I},
+ {"get_visible_line_offset",{P},I},
+ {"get_char",{P},I},
+ {"get_slice",{P,P},S},
+ {"get_text",{P,P},S},
+ {"get_visible_slice",{P,P},S},
+ {"get_visible_text",{P,P},S},
+ {"get_pixbuf",{P},P,0,GdkPixbuf},
+ {"get_marks",{P},X,0,GSList},
+ {"get_toggled_tags",{P,B},X,0,GSList},
+ {"get_child_anchor",{P},P,0,GtkTextChildAnchor},
+ {"begins_tag",{P,P},B},
+ {"ends_tag",{P,P},B},
+ {"toggles_tag",{P,P},B},
+ {"has_tag",{P,P},B},
+ {"get_tags",{P},X,0,GSList},
+ {"editable",{P,B},B},
+ {"can_insert",{P,B},B},
+ {"starts_word",{P},B},
+ {"ends_word",{P},B},
+ {"inside_word",{P},B},
+ {"starts_line",{P},B},
+ {"ends_line",{P},B},
+ {"starts_sentence",{P},B},
+ {"ends_sentence",{P},B},
+ {"inside_sentence",{P},B},
+ {"is_cursor_position",{P},B},
+ {"get_chars_in_line",{P},I},
+ {"get_bytes_in_line",{P},I},
+ {"get_attributes",{P,P},B},
+ {"get_language",{P},P,0,PangoLanguage},
+ {"is_end",{P},B},
+ {"is_start",{P},B},
+ {"forward_char",{P},B},
+ {"backward_char",{P},B},
+ {"forward_chars",{P,I},B},
+ {"backward_chars",{P,I},B},
+ {"forward_line",{P},B},
+ {"backward_line",{P},B},
+ {"forward_lines",{P,I},B},
+ {"backward_lines",{P,I},B},
+ {"forward_word_ends",{P,I},B},
+ {"backward_word_starts",{P,I},B},
+ {"forward_word_ends",{P},B},
+ {"backward_word_start",{P},B},
+ {"forward_cursor_position",{P},B},
+ {"backward_cursor_position",{P},B},
+ {"forward_cursor_positions",{P,I},B},
+ {"backward_cursor_positions",{P,I},B},
+ {"backward_sentence_start",{P},B},
+ {"backward_sentence_starts",{P,I},B},
+ {"forward_sentence_end",{P},B},
+ {"forward_sentence_ends",{P,I},B},
+ {"forward_visible_word_ends",{P,I},B},
+ {"backward_visible_word_starts",{P,I},B},
+ {"forward_visible_word_end",{P},B},
+ {"backward_visible_word_start",{P},B},
+ {"forward_visible_cursor_position",{P},B},
+ {"backward_visible_cursor_position",{P},B},
+ {"forward_visible_cursor_positions",{P,I},B},
+ {"backward_visible_cursor_positions",{P,I},B},
+ {"forward_visible_line",{P},B},
+ {"backward_visible_line",{P},B},
+ {"forward_visible_lines",{P,I},B},
+ {"backward_visible_lines",{P,I},B},
+ {"set_offset",{P,I}},
+ {"set_line",{P,I}},
+ {"set_line_offset",{P,I}},
+ {"set_line_index",{P,I}},
+ {"set_visible_line_index",{P,I}},
+ {"set_visible_line_offset",{P,I}},
+ {"forward_to_end",{P}},
+ {"forward_to_line_end",{P},B},
+ {"forward_to_tag_toggle",{P,P},B},
+ {"backward_to_tag_toggle",{P,P},B},
+ {"forward_find_char",{P,P,P,P},B},
+ {"backward_find_char",{P,P,P,P},B},
+ {"forward_search",{P,S,I,P,P,P},B},
+ {"backward_search",{P,S,I,P,P,P},B},
+ {"equal",{P,P},B},
+ {"compare",{P,P},I},
+ {"in_range",{P,P,P},B},
+ {"order",{P,P}},
+ {"starts_tag",{P,P},B}, -- 3.20
+"GtkTextIter"}
+
+widget[GtkEntry] = {"gtk_entry",
+{GtkWidget,GtkEditable,GtkCellEditable,GtkBuildable,GObject},
+ {"new",{},P},
+ {"get_buffer",{P},P,0,GtkEntryBuffer},
+ {"set_buffer",{P,P}},
+ {"set_text",{P,S}},
+ {"set_value",{P,D},-routine_id("entry_set_value")}, -- not GTK, a convenience func;
+ {"get_text",{P},S},
+ {"get_value",{P},-routine_id("entry_get_value")}, -- not GTK, a convenience func;
+ {"get_text_length",{P},I},
+ {"get_text_area",{P,P}},
+ {"set_visibility",{P,B}},
+ {"get_visibility",{P},B},
+ {"set_invisible_char",{P,I}},
+ {"get_invisible_char",{P},I},
+ {"unset_invisible_char",{P}},
+ {"set_max_length",{P,I}},
+ {"get_max_length",{P},I},
+ {"set_activates_default",{P,B}},
+ {"get_activates_default",{P},B},
+ {"set_has_frame",{P,B}},
+ {"get_has_frame",{P},B},
+ {"set_width_chars",{P,I}},
+ {"get_width_chars",{P},I},
+ {"set_alignment",{P,F}},
+ {"get_alignment",{P},F},
+ {"set_placeholder_text",{P,S}}, -- GTK 3.2+
+ {"get_placeholder_text",{P},S}, -- GTK 3.2+
+ {"set_overwrite_mode",{P,B}},
+ {"get_overwrite_mode",{P},B},
+ {"get_layout",{P},P,0,PangoLayout},
+ {"get_layout_offsets",{P,I,I}},
+ {"set_completion",{P,P}},
+ {"get_completion",{P},P,0,GtkEntryCompletion},
+ {"set_progress_fraction",{P,D}},
+ {"set_progress_pulse_step",{P,D}},
+ {"progress_pulse",{P}},
+ {"set_icon_from_stock",{P,I,S}}, -- deprecated 3.10
+ {"set_icon_from_pixbuf",{P,I,P}},
+ {"set_icon_from_icon_name",{P,I,S}},
+ {"set_icon_from_gicon",{P,I,P}},
+ {"get_icon_storage_type",{P,I},I},
+ {"get_icon_pixbuf",{P,I},P,0,GdkPixbuf},
+ {"get_icon_name",{P,I},S},
+ {"get_icon_area",{P,I,I}},
+ {"get_icon_gicon",{P,I},P,0,GIcon},
+ {"set_icon_activatable",{P,I,B}},
+ {"set_icon_sensitive",{P,I,B}},
+ {"get_icon_at_pos",{P,I,I},I},
+ {"set_icon_tooltip_text",{P,I,S}},
+ {"get_icon_tooltip_text",{P,I},S},
+ {"set_icon_tooltip_markup",{P,I,S}},
+ {"get_icon_tooltip_markup",{P,I},S},
+ {"set_tabs",{P,P}}, -- 3.10
+ {"get_tabs",{P},P,0,PangoTabArray}, -- 3.10
+ {"get_max_width_chars",{P},I}, -- 3.12
+ {"set_max_width_chars",{P,I}}, -- 3.12
+ {"im_context_filter_keypress",{P,I},B},
+ {"grab_focus_without_selecting",{P}}, --3.16
+"GtkEntry"}
+
+ function entry_get_value(atom x) -- retrieve input text as a number;
+ object txt = get(x,"text")
+ return to_number(txt)
+ end function
+
+ function entry_set_value(atom x, atom v) -- convert number to text equivalent;
+ if integer(v) then
+ set(x,"text",sprintf("%d",v))
+ else
+ set(x,"text",sprintf("%2.2f",v))
+ end if
+ return 1
+ end function
+
+widget[GtkSpinButton] = {"gtk_spin_button",
+{GtkEntry,GtkWidget,GtkEditable,GtkCellEditable,GtkOrientable,GtkBuildable,GObject},
+ {"set_adjustment",{P,P}},
+ {"get_adjustment",{P},P,0,GtkAdjustment},
+ {"set_digits",{P,I}},
+ {"get_digits",{P},I},
+ {"set_range",{P,D,D}},
+ {"get_range",{P,D,D}},
+ {"set_value",{P,D}},
+ {"get_value",{P},-routine_id("getSpinVal")},
+ {"get_value_as_int",{P},I},
+ {"set_update_policy",{P,I}},
+ {"set_numeric",{P,B}},
+ {"get_numeric",{P},B},
+ {"set_wrap",{P,B}},
+ {"get_wrap",{P},B},
+ {"spin",{P,I,D}},
+ {"update",{P}},
+ {"get_increments",{P,D,D}},
+ {"set_snap_to_ticks",{P,B}},
+ {"get_snap_to_ticks",{P},B},
+ {"configure",{P,P,D,I}},
+ {"new",{D,D,D},-routine_id("newSpinButton")},
+"GtkSpinButton"}
+
+ -- create a spin button from an ajustment object or from a range of values
+
+ function newSpinButton(atom a=0, atom b=0, atom c=0)
+ ----------------------------------------------------
+ atom sb = 0
+ if a+b+c = 0 then a = create(GtkAdjustment,0,0,100,1) end if
+ if class_id(a) = GtkAdjustment then
+ sb = gtk_func("gtk_spin_button_new",{P,D,I},{a,b,c})
+ else
+ sb = gtk_func("gtk_spin_button_new_with_range",{D,D,D},{a,b,c})
+ end if
+ return sb
+ end function
+
+ function getSpinVal(atom spin)
+ ------------------------------
+ object range = get(spin,"range")
+ atom fn = define_func("gtk_spin_button_get_value",{P},D)
+ atom val = c_func(fn,{spin})
+ val = math:ensure_in_range(val,range)
+ return val
+ end function
+
+widget[GtkOrientable] = {"gtk_orientable",
+{GObject},
+ {"set_orientation",{P,I}},
+ {"get_orientation",{P},I},
+"GtkOrientable"}
+
+widget[GtkRange] = {"gtk_range",
+{GtkWidget,GtkOrientable,GtkBuildable,GObject},
+ {"set_fill_level",{P,D}},
+ {"get_fill_level",{P},D},
+ {"set_restrict_to_fill_level",{P,B}},
+ {"get_restrict_to_fill_level",{P},B},
+ {"set_show_fill_level",{P,B}},
+ {"get_show_fill_level",{P},B},
+ {"set_adjustment",{P,P}},
+ {"get_adjustment",{P},P},
+ {"set_inverted",{P,B}},
+ {"get_inverted",{P},B},
+ {"set_value",{P,D}},
+ {"get_value",{P},D},
+ {"set_increments",{P,D,D}},
+ {"set_range",{P,D,D}},
+ {"set_round_digits",{P,I}},
+ {"get_round_digits",{P},I},
+ {"set_lower_stepper_sensitivity",{P,I}},
+ {"get_lower_stepper_sensitivity",{P},I},
+ {"set_upper_stepper_sensitivity",{P,I}},
+ {"get_upper_stepper_sensitivity",{P},I},
+ {"set_flippable",{P,B}},
+ {"get_flippable",{P},B},
+ {"set_min_slider_size",{P,I}},
+ {"get_min_slider_size",{P},I},
+ {"get_slider_range",{P,I,I}},
+ {"set_slider_size_fixed",{P,B}},
+ {"get_slider_size_fixed",{P},B},
+"GtkRange"}
+
+widget[GtkScale] = {"gtk_scale",
+{GtkRange,GtkWidget,GtkOrientable,GtkBuildable,GObject},
+ {"set_digits",{P,I}},
+ {"get_digits",{P},I},
+ {"set_draw_value",{P,B}},
+ {"get_draw_value",{P},B},
+ {"set_has_origin",{P,B}},
+ {"get_has_origin",{P},B},
+ {"set_value_pos",{P,I}},
+ {"get_value_pos",{P},I},
+ {"get_layout",{P},P,0,PangoLayout},
+ {"get_layout_offsets",{P,I,I}},
+ {"add_mark",{P,D,I,S}},
+ {"clear_marks",{P}},
+ {"new",{P,P,P,P},-routine_id("newScale")},
+"GtkScale"}
+
+ -- create scale from range or adjustment;
+ function newScale(integer orient, atom min=0, atom max=0, atom step=0)
+ if min+max+step = 0 then
+ return gtk_func("gtk_scale_new",{I,P},{orient,0})
+ end if
+ if class_id(min) = GtkAdjustment then
+ return gtk_func("gtk_scale_new",{I,P},{orient,min})
+ else
+ return gtk_func("gtk_scale_new_with_range",{I,D,D,D},{orient,min,max,step})
+ end if
+ end function
+
+widget[GTimeout] = {"g_timeout",
+{0},
+ {"new",{I,P,P},-routine_id("newTimeout")},
+ {"add",{I,P,P},-routine_id("newTimeout")},
+"GTimeout"}
+
+ function newTimeout(integer ms, atom fn, atom data)
+ return gtk_func("g_timeout_add",{I,P,P},{ms,fn,data})
+ end function
+
+widget[GIdle] = {"g_idle",
+{0},
+ {"new",{P,P},-routine_id("newIdle")},
+ {"add",{P,P},-routine_id("newIdle")},
+"GIdle"}
+
+ function newIdle(atom fn, atom data)
+ return gtk_func("g_idle_add",{P,P},{fn,data})
+ end function
+
+widget[GNotification] = {"g_notification",
+{0},
+ {"new",{S},P},
+ {"set_title",{P,S}},
+ {"set_body",{P,S}},
+ {"set_icon",{P,P}},
+ --{"set_priority",{P,I}}, error
+ {"set_default_action",{P,S}},
+ {"add_button",{P,S,S}},
+ {"add_button_with_target_value",{P,S,S,I}},
+ {"set_default_action_and_target_value",{P,S,I}},
+"GNotification"}
+
+widget[GApplication] = {"g_application",
+{0},
+ {"new",{S,I},P},
+ {"get_id",{P},S},
+ {"set_id",{P,S}},
+ {"id_is_valid",{P,S},B},
+ {"get_inactivity_timeout",{P},I},
+ {"set_inactivity_timeout",{P,I}},
+ {"get_flags",{P},I},
+ {"set_flags",{P,I}},
+ {"get_resource_base_path",{P},S},
+ {"set_resource_base_path",{P,S}},
+ {"get_dbus_connection",{P},P},
+ {"get_dbus_object_path",{P},S},
+ {"get_is_registered",{P},B},
+ {"get_is_remote",{P},B},
+ {"register",{P,P,P},B},
+ {"hold",{P}},
+ {"release",{P}},
+ {"quit",{P}},
+ {"activate",{P}},
+ {"open",{P,P,I,I}},
+ {"send_notification",{P,S,P}},
+ {"withdraw_notification",{P,S}},
+ {"run",{P,I,P},I},
+ {"add_main_option_entries",{P,P}},
+ {"add_option_group",{P,P}},
+ {"add_main_option",{P,S,S,I,I,S,S}},
+ {"set_default",{P}},
+ {"mark_busy",{P}},
+ {"unmark_busy",{P}},
+ {"get_is_busy",{P},B},
+ {"bind_busy_property",{P,P,S}},
+ {"unbind_busy_property",{P,P,S}},
+"GApplication"}
+
+widget[GAppInfo] = {"g_app_info",
+{0},
+ {"get_name",{P},S},
+ {"get_display_name",{P},S},
+ {"get_description",{P},S},
+ {"get_executable",{P},S},
+ {"get_commandline",{P},S},
+ {"get_icon",{P},P,0,GIcon},
+ {"launch",{P,P,P,P},B},
+ {"supports_files",{P},B},
+ {"supports_uris",{P},B},
+ {"launch_uris",{P,P,P,P},B},
+ {"should_show",{P},B},
+ {"can_delete",{P},B},
+ {"delete",{P},B},
+ {"set_as_default_for_type",{P,S,P},B},
+ {"set_as_default_for_extension",{P,S,P},B},
+ {"add_supports_type",{P,S,P},B},
+ {"can_remove_supports_type",{P},B},
+ {"remove_supports_type",{P,S,P},B},
+ {"get_all",{},P,0,GList},
+"GAppInfo"}
+
+widget[GFile] = {"g_file",
+{GObject},
+ {"new",{P},-routine_id("newGFile")},
+ {"get_parse_name",{P},S},
+ {"parse_name",{S},P},
+ {"equal",{P,P},B},
+ {"get_basename",{P},S},
+ {"get_path",{P},S},
+ {"get_uri",{P},S},
+ {"get_parse_name",{P},S},
+ {"get_parent",{P},P,0,GFile},
+ {"has_parent",{P,P},B},
+ {"get_child",{P,S},P,0,GFile},
+ {"get_child_for_display_name",{P,S,P},P,0,GFile},
+ {"has_prefix",{P,P},B},
+ {"get_relative_path",{P,P},S},
+ {"resolve_relative_path",{P,S},P,0,GFile},
+ {"is_native",{P},B},
+ {"has_uri_scheme",{P,S},B},
+ {"get_uri_scheme",{P},S},
+ {"read",{P,P,P},P,0,GFileInputStream},
+"GFile"}
+
+ -- create a GFile from a path or uri
+ function newGFile(object s)
+ if file_exists(canonical_path(locate_file(s))) then
+ return gtk_func("g_file_new_for_path",{P},
+ {allocate_string(canonical_path(locate_file(s)),1)})
+ else
+ return gtk_func("g_file_new_for_uri",{P},
+ {allocate_string(s,1)})
+ end if
+ return 0
+ end function
+
+widget[GIcon] = {"g_icon",
+{GObject},
+ {"hash",{P},I},
+ {"equal",{P,P},B},
+ {"to_string",{P},S},
+ {"new_for_string",{S,P},P},
+ {"new",{S},-routine_id("newGIcon")},
+ {"serialize",{P},P},
+ {"deserialize",{P},P,0,GIcon},
+"GIcon"}
+
+ function newGIcon(object s)
+ if string(s) then s = allocate_string(s,1) end if
+ return gtk_func("g_icon_new_for_string",{P,P},{s,0})
+ end function
+
+widget[GFileIcon] = {"g_file_icon",
+{GIcon,GObject},
+ {"new",{P},P},
+ {"get_file",{P},P},
+"GFileIcon"}
+
+widget[GFileInfo] = {"g_file_info",
+{GObject},
+ {"new",{},P},
+ {"get_name",{P},S},
+ {"get_display_name",{P},S},
+ {"get_edit_name",{P},S},
+ {"get_icon",{P},P,0,GIcon},
+ {"get_symbolic_icon",{P},P,0,GIcon},
+ {"get_content_type",{P},S},
+ {"get_size",{P},I},
+ {"get_modification_time",{P,P}},
+ {"get_symlink_target",{P},S},
+ {"get_etag",{P},S},
+ {"get_sort_order",{P},I},
+ {"get_deletion_date",{P},P,0,GDateTime},
+ {"set_is_hidden",{P,B}},
+ {"set_is_symlink",{P,B}},
+ {"set_name",{P,S}},
+ {"set_display_name",{P,S}},
+ {"set_edit_name",{P,S}},
+ {"set_icon",{P,P}},
+ {"set_symbolic_icon",{P,P}},
+ {"set_content_type",{P,S}},
+ {"set_size",{P,I}},
+"GFileInfo"}
+
+widget[GList] = {"g_list",
+{GObject},
+ {"new",{},-routine_id("newGList")},
+ {"append",{P,P},P},
+ {"length",{P},I},
+ {"nth_data",{P,I},P},
+"GList"}
+
+ function newGList()
+ atom x = allocate(64) x = 0 -- keep;
+ return x
+ end function
+
+widget[GSList] = {"g_slist",
+{GObject},
+ {"length",{P},I},
+"GSList"}
+
+ object temp_list
+
+ export function unpack_gs_str_list(atom gs)
+ if gs = 0 then return 1 end if
+ atom fn = call_back(routine_id("gs_str_each"))
+ temp_list = {}
+ gtk_proc("g_slist_foreach",{P,P,P},{gs,fn,0})
+ return temp_list
+ end function
+
+ function gs_str_each(object x)
+ if x > 0 then
+ temp_list = append(temp_list,peek_string(x))
+ end if
+ return 1
+ end function
+
+ export function unpack_gs_atom_list(object gs)
+ temp_list = {}
+ atom fn = call_back(routine_id("gs_atom_each"))
+ gtk_proc("g_slist_foreach",{P,P,P},{gs,fn,0})
+ return temp_list
+ end function
+
+ function gs_atom_each(object x)
+ temp_list = append(temp_list,x)
+ return 1
+ end function
+
+widget[GdkDisplay] = {"gdk_display",
+{GObject},
+ {"new",{},-routine_id("newGdkDisplay")}, -- alias get_default;
+ {"open",{S},P,0,GdkDisplay},
+ {"get_name",{P},S},
+ {"get_n_screens",{P},I},
+ {"get_screen",{P,I},P,0,GdkScreen},
+ {"get_default_screen",{P},P,0,GdkScreen},
+ {"get_device_manager",{P},P,0,GdkDeviceManager},
+ {"device_is_grabbed",{P,P},B},
+ {"beep",{P}},
+ {"sync",{P}},
+ {"flush",{P}},
+ {"close",{P}},
+ {"is_closed",{P},B},
+ {"get_event",{P},P,0,GdkEvent},
+ {"peek_event",{P},P,0,GdkEvent},
+ {"put_event",{P,P}},
+ {"has_pending",{P},B},
+ {"set_double_click_time",{P,I}},
+ {"set_double_click_distance",{P,I}},
+ {"supports_cursor_color",{P},B},
+ {"supports_cursor_alpha",{P},B},
+ {"get_default_cursor_size",{P},I},
+ {"get_maximal_cursor_size",{P,I,I}},
+ {"get_default_group",{P},P,0,GdkWindow},
+ {"supports_selection_notification",{P},B},
+ {"request_selection_notification",{P,P},B},
+ {"supports_clipboard_persistence",{P},B},
+ {"store_clipboard",{P,P,I,P,I}},
+ {"supports_shapes",{P},B},
+ {"supports_input_shapes",{P},B},
+ {"supports_composite",{P},B}, -- deprecated 3.16
+ {"get_app_launch_context",{P},P,0,GtkAppLaunchContext},
+ {"notify_startup_complete",{P,S}},
+"GdkDisplay"}
+
+ function newGdkDisplay() -- alias;
+ return gtk_func("gdk_display_get_default",{})
+ end function
+
+widget[GdkDevice] = {"gdk_device",
+{GObject},
+ {"get_name",{P},S},
+ {"get_device_type",{P},I},
+ {"get_display",{P},P,0,GdkDisplay},
+ {"get_has_cursor",{P},B},
+ {"get_n_axes",{P},I},
+ {"get_n_keys",{P},I},
+ {"warp",{P,P,I,I}},
+ {"grab",{P,P,I,B,I,P,P},I},
+ {"ungrab",{P,P}},
+ {"get_state",{P,P,D,P}},
+ {"get_position",{P,P,I,I}},
+ {"get_position_double",{P,P,D,D}},
+ {"get_window_at_position",{P,I,I},P,0,GdkWindow},
+ {"get_window_at_position_double",{P,D,D},P,0,GdkWindow},
+ {"get_history",{P,P,P,P,P,I},B},
+ {"free_history",{P,I}},
+ {"get_vendor_id",{P},S},
+ {"get_product_id",{P},S},
+ {"get_source",{P},P,0,GdkInputSource},
+ {"set_mode",{P,I},B},
+ {"get_mode",{P},I},
+ {"set_key",{P,I,I,I}},
+ {"get_key",{P,I,I,I},B},
+ {"get_axis",{P,D,I,D},B},
+ {"list_axes",{P},A,0,GList},
+ {"get_axis_value",{P,D,P,D},B},
+ {"get_last_event_window",{P},P,0,GdkWindow},
+ {"set_axis_use",{P,I,I}},
+ {"get_axis_use",{P,I},I},
+ {"get_associated_device",{P},P,0,GdkDevice},
+ {"list_slave_devices",{P},A,0,GList},
+ {"get_position",{P,P,I,I}},
+"GdkDevice"}
+
+widget[GdkScreen] = {"gdk_screen",
+{GdkDevice,GObject},
+ {"new",{},-routine_id("newGdkScreen")}, -- alias get_default;
+ {"get_system_visual",{P},P,0,GdkVisual},
+ {"get_rgba_visual",{P},P,0,GdkVisual},
+ {"is_composited",{P},B},
+ {"get_root_window",{P},P,0,GdkWindow},
+ {"get_display",{P},P,0,GdkDisplay},
+ {"get_number",{P},I},
+ {"get_width",{P},I},
+ {"get_height",{P},I},
+ {"get_width_mm",{P},I},
+ {"get_height_mm",{P},I},
+ {"list_visuals",{P},P,0,GList},
+ {"get_toplevel_windows",{P},P,0,GList},
+ {"make_display_name",{P},S},
+ {"get_n_monitors",{P},I},
+ {"get_primary_monitor",{P},I},
+ {"get_monitor_geometry",{P,I,P}},
+ {"get_monitor_workarea",{P,I,P}},
+ {"get_monitor_at_point",{P,I,I},I},
+ {"get_monitor_at_window",{P,P},I},
+ {"get_monitor_height_mm",{P,I},I},
+ {"get_monitor_width_mm",{P,I},I},
+ {"get_monitor_plug_name",{P,I},S},
+ {"get_setting",{P,S,P},B},
+ {"get_font_options",{P},P,0,CairoFontOptions},
+ {"get_resolution",{P},D},
+ {"set_resolution",{P,D}},
+ {"get_active_window",{P},P,0,GdkWindow},
+ {"get_window_stack",{P},P,0,GList},
+"GdkScreen"}
+
+ function newGdkScreen() -- alias;
+ return gtk_func("gdk_screen_get_default",{})
+ end function
+
+widget[GdkVisual] = {"gdk_visual",
+{GObject},
+"GdkVisual"}
+
+widget[GThemedIcon] = {"g_themed_icon",
+{GIcon,GObject},
+ {"new",{S},P},
+ {"new_with_default_fallbacks",{S},P},
+ {"get_names",{P},P},
+"GThemedIcon"}
+
+widget[GtkThemedIcon] = {"gtk_themed_icon",
+{GObject},
+"GtkThemedIcon"}
+
+widget[GEmblem] = {"g_emblem",
+{GObject},
+ {"new",{P},P},
+ {"get_icon",{P},P,0,GIcon},
+"GEmblem"}
+
+widget[GEmblemedIcon] = {"g_emblemed_icon",
+{GIcon,GObject},
+ {"new",{P,P},P},
+"GEmblemedIcon"}
+
+widget[GdkDeviceManager] = {"gdk_device_manager",
+{GObject},
+ {"new",{P},-routine_id("newDeviceManager")},
+ {"get_display",{P},P,0,GdkDisplay},
+ {"list_devices",{P,I},X,0,GList},
+ {"get_client_pointer",{P},P,0,GdkDevice},
+"GdkDeviceManager"}
+
+ function newDeviceManager(atom disp=0)
+ if disp = 0 then
+ disp = gtk_func("gdk_display_get_default")
+ end if
+ return gtk_func("gdk_display_get_device_manager",{P},{disp})
+ end function
+
+widget[GtkAppChooser] = {"gtk_app_chooser",
+{GtkWidget},
+ {"get_app_info",{P},P,0,GAppInfo},
+ {"get_content_type",{P},S},
+ {"refresh",{P}},
+"GtkAppChooser"}
+
+widget[GtkAppChooserButton] = {"gtk_app_chooser_button",
+{GtkComboBox,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkCellLayout,GtkCellEditable,GObject},
+ {"new",{S},P},
+ {"append_custom_item",{P,S,S,P}},
+ {"append_separator",{P}},
+ {"set_active_custom_item",{P,S}},
+ {"set_show_default_item",{P,B}},
+ {"get_show_default_item",{P},B},
+ {"set_show_dialog_item",{P,B}},
+ {"get_show_dialog_item",{P},B},
+ {"set_heading",{P,S}},
+ {"get_heading",{P},S},
+"GtkAppChooserButton"}
+
+widget[GMenu] = {"g_menu",
+{GObject},
+ {"new",{},P},
+ {"append",{P,S,S}},
+"GMenu"}
+
+widget[GSettings] = {"g_settings",
+{GObject},
+ {"new",{S},P},
+ {"set_value",{P,S,P},B},
+ {"get_value",{P},P},
+ {"get_user_value",{P,S},P},
+"GSettings"}
+
+widget[GtkApplication] = {"gtk_application",
+{GApplication,GObject},
+ {"new",{S,I},-routine_id("newApplication")},
+ {"add_window",{P,P}},
+ {"remove_window",{P,P}},
+ {"get_windows",{P},A,0,GList},
+ {"get_window_by_id",{P,I},P,0,GtkWindow},
+ {"get_active_window",{P},P,0,GtkWindow},
+ {"inhibit",{P,P,I,S},I},
+ {"uninhibit",{P,I}},
+ {"is_inhibited",{P,I},B},
+ {"get_app_menu",{P},P,0,GMenuModel},
+ {"set_app_menu",{P,P}},
+ {"get_menubar",{P},P,0,GMenuModel},
+ {"set_menubar",{P,P}},
+ {"add_accelerator",{P,S,S,P}},
+ {"remove_accelerator",{P,S,P}},
+ {"run",{P},-routine_id("app_run")},
+ {"activate",{P},-routine_id("app_activate")},
+ {"get_accels_for_action",{P,S},V}, -- 3.12
+ {"set_accels_for_action",{P,S,S}}, -- 3.12
+ {"list_action_descriptions",{P},V},
+ {"get_actions_for_accel",{P,S},V}, -- 3.14
+ {"get_menu_by_id",{P,S},P,0,GMenu}, -- 3.14
+ {"prefers_app_menu",{},B}, -- 3.14
+"GtkApplication"}
+
+ function app_activate(object x)
+ gtk_proc("g_application_activate",{P},{x})
+ return 1
+ end function
+
+ function app_run(object x)
+ gtk_proc("g_application_run",{P,I,P},{x,0,0})
+ return 1
+ end function
+
+ function newApplication(object id, object flags)
+ if string(id) then id = allocate_string(id,1) end if
+ if gtk_func("g_application_id_is_valid",{P},{id}) then
+ return gtk_func("gtk_application_new",{P,I},{id,flags})
+ else
+ crash("Error: invalid application id!")
+ end if
+ return 0
+ end function
+
+widget[GtkApplicationWindow] = {"gtk_application_window",
+{GtkWindow,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{P},P},
+ {"set_show_menubar",{P,B}},
+ {"get_show_menubar",{P},B},
+ {"set_help_overlay",{P,P}}, -- 3.20
+ {"get_help_overlay",{P},P,0,GtkShortcutsWindow}, -- 3.20
+ {"get_id",{P},I},
+"GtkApplicationWindow"}
+
+widget[GtkActionable] = {"gtk_actionable",
+{GtkWidget},
+ {"get_action_name",{P},S},
+ {"set_action_name",{P,S}},
+ {"get_action_target_value",{P},P},
+ {"set_action_target_value",{P,P}},
+ {"set_action_target",{P,S,P}},
+ {"set_detailed_action_name",{P,S}},
+"GtkActionable"}
+
+-- Soon to be deprecated, but still used internally by Glade;
+widget[GtkAlignment] = {"gtk_alignment",
+{GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{F,F,F,F},P},
+ {"set",{P,F,F,F,F}},
+ {"get_padding",{P,I,I,I,I}},
+ {"set_padding",{P,I,I,I,I}},
+"GtkAlignment"}
+
+widget[GtkAppLaunchContext] = {"gdk_app_launch_context",
+{GdkAppLaunchContext,GObject},
+ {"set_screen",{P,P}},
+ {"set_desktop",{P,I}},
+ {"set_timestamp",{P,I}},
+ {"set_icon",{P,P}},
+ {"set_icon_name",{P,S}},
+"GtkAppLaunchContext"}
+
+widget[GtkAspectFrame] = {"gtk_aspect_frame",
+{GtkFrame,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{S,F,F,F,B},P},
+ {"set",{P,F,F,F,B}},
+"GtkAspectFrame"}
+
+widget[GtkAssistant] = {"gtk_assistant",
+{GtkWindow,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"set_current_page",{P,I}},
+ {"get_current_page",{P},I},
+ {"get_n_pages",{P},I},
+ {"get_nth_page",{P,I},P,0,GtkWidget},
+ {"prepend_page",{P,P},I},
+ {"append_page",{P,P},I},
+ {"insert_page",{P,P,I},I},
+ {"remove_page",{P,I}},
+ {"set_forward_page_func",{P,P,P,P}},
+ {"set_page_type",{P,P,P}},
+ {"get_page_type",{P,P},I},
+ {"set_page_title",{P,P,S}},
+ {"get_page_title",{P,P},S},
+ {"set_page_complete",{P,P,B}},
+ {"get_page_complete",{P,P},B},
+ {"add_action_widget",{P,P}},
+ {"remove_action_widget",{P,P}},
+ {"update_buttons_state",{P}},
+ {"commit",{P}},
+ {"next_page",{P}},
+ {"previous_page",{P}},
+ {"get_page_has_padding",{P,P},B}, -- 3.18
+ {"set_page_has_padding",{P,P,B}}, -- 3.18
+"GtkAssistant"}
+
+widget[GtkDrag] = {"gtk_drag",
+{0},
+ {"get_data",{P,P,P,P}},
+ {"get_source_widget",{P},P,0,GtkWidget},
+ {"highlight",{P}},
+ {"unhighlight",{P}},
+ {"begin_with_coordinates",{P,P,P,I,P,I,I},P},
+ {"finish",{P,B,B,P}},
+ {"set_icon_widget",{P,P,I,I}},
+ {"set_icon_pixbuf",{P,P,I,I}},
+ {"set_icon_surface",{P,P}},
+ {"set_icon_name",{P,P,I,I}},
+ {"set_icon_gicon",{P,P,I,I}},
+ {"set_icon_default",{P}},
+ {"check_threshold",{P,I,I,I,I},B},
+ {"cancel",{P}}, -- 3.16
+"GtkDrag"}
+
+widget[GtkDragSource] = {"gtk_drag_source",
+{GtkDrag},
+ {"set",{P,I,P,I,I}},
+ {"set_icon_pixbuf",{P,P}},
+ {"set_icon_name",{P,S}},
+ {"set_icon_gicon",{P,P}},
+ {"unset",{P}},
+ {"set_target_list",{P,P}},
+ {"get_target_list",{P},P,0,GtkTargetList},
+ {"add_text_targets",{P}},
+ {"add_image_targets",{P}},
+ {"add_uri_targets",{P}},
+"GtkDragSource"}
+
+widget[GtkDragDest] = {"gtk_drag_dest",
+{GtkDrag},
+ {"set",{P,I,P,I,I}},
+ {"set_proxy",{P,P,I,B}},
+ {"unset",{P}},
+ {"find_target",{P,P,P},P},
+ {"get_target_list",{P},P,0,GtkTargetList},
+ {"set_target_list",{P,P}},
+ {"add_text_targets",{P}},
+ {"add_image_targets",{P}},
+ {"add_uri_targets",{P}},
+ {"set_track_motion",{P,B}},
+ {"get_track_motion",{P},B},
+"GtkDragDest"}
+
+widget[GtkCssProvider] = {"gtk_css_provider",
+{GObject},
+ {"new",{P},-routine_id("new_css_provider")},
+ {"get_default",{},P,0,GtkCssProvider},
+ {"get_named",{S,S},P,0,GtkCssProvider},
+ {"load_from_data",{P,S,I,P},B},
+ {"load_from_file",{P,S,P},B},
+ {"load_from_path",{P,S,P},B},
+ {"load_from_resource",{P,S}}, -- 3.16
+ {"to_string",{P},S},
+"GtkCssProvider"}
+
+ function new_css_provider(object name=0)
+ atom provider = gtk_func("gtk_css_provider_get_default")
+ atom style = create(GtkStyleContext)
+ atom screen = get(style,"screen")
+
+ atom err = allocate(64,1) err = 0
+ register(provider,GtkCssProvider)
+
+ if atom(name) then
+ set(style,"add provider for screen",screen,provider,800)
+ return provider
+ end if
+
+ if file_exists(canonical_path(locate_file(name))) then
+ if gtk_func("gtk_css_provider_load_from_path",{P,P,P},
+ {provider,allocate_string(canonical_path(locate_file(name)),1),err}) then
+ set(style,"add provider for screen",screen,provider,800)
+ return provider
+ else
+ printf(1,"Error finding or parsing css from path: %s \n",
+ {canonical_path(locate_file(name))})
+ end if
+ end if
+
+ if string(name) then
+ integer len = length(name)
+ name = allocate_string(name,1)
+ if gtk_func("gtk_css_provider_load_from_data",{P,P,I,P},{provider,name,len,err}) then
+ set(style,"add provider for screen",screen,provider,800)
+ end if
+ end if
+
+ return provider
+ end function
+
+widget[GtkCssSection] = {"gtk_css_section",
+{GObject},
+ {"get_end_line",{P},I},
+ {"get_end_position",{P},I},
+ {"get_file",{P},P,0,GFile},
+ {"get_parent",{P},P,0,GtkCssSection},
+ {"get_section_type",{P},I},
+ {"get_start_line",{P},I},
+ {"get_start_position",{P},I},
+"GtkCssSection"}
+
+widget[GtkStatusIcon] = {"gtk_status_icon", -- deprecated 3.14
+{GObject},
+ {"new",{},P,0,GObject},
+ {"new_from_pixbuf",{P},P},
+ {"new_from_file",{S},P},
+ {"new_from_icon_name",{S},P},
+ {"new_from_gicon",{P},P},
+ {"set_from_pixbuf",{P,P}},
+ {"set_from_file",{P,S}},
+ {"set_from_icon_name",{P,S}},
+ {"set_from_gicon",{P,P}},
+ {"get_storage_type",{P},I},
+ {"get_pixbuf",{P},P,0,GdkPixbuf},
+ {"get_icon_name",{P},S},
+ {"get_gicon",{P},P},
+ {"get_size",{P},I},
+ {"set_screen",{P,P}},
+ {"get_screen",{P},P,0,GdkScreen},
+ {"set_tooltip_text",{P,S}},
+ {"get_tooltip_text",{P},S},
+ {"set_tooltip_markup",{P,S}},
+ {"get_tooltip_markup",{P},S},
+ {"set_has_tooltip",{P,B}},
+ {"get_has_tooltip",{P},P},
+ {"set_title",{P,S}},
+ {"get_title",{P},S},
+ {"set_name",{P,S}},
+ {"set_visible",{P,B}},
+ {"get_visible",{P},B},
+ {"is_embedded",{P},B},
+ {"get_geometry",{P,P,P,I},B},
+ {"get_x11_window_id",{P},I},
+ {"position_menu",{P,P,I,I,B},-routine_id("si_position_menu")},
+"GtkStatusIcon"}
+
+ function si_position_menu(atom stat, atom menu, integer x, integer y, integer p)
+ atom fn = define_proc("gtk_status_icon_position_menu",{P,I,I,I,P})
+ c_proc(fn,{menu,x,y,p,stat}) -- menu and status_icon params swapped;
+ return 1
+ end function
+
+widget[GtkOffscreenWindow] = {"gtk_offscreen_window",
+{GtkWindow,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"get_surface",{P},P,0,CairoSurface_t},
+ {"get_pixbuf",{P},P,0,GdkPixbuf},
+"GtkOffscreenWindow"}
+
+widget[GtkComboBox] = {"gtk_combo_box",
+{GtkBin,GtkContainer,GtkWidget,GtkCellLayout,GtkCellEditable,GtkBuildable,GObject},
+ {"new",{P},-routine_id("newComboBox")},
+ {"set_wrap_width",{P,I}},
+ {"get_wrap_width",{P},I},
+ {"set_row_span_column",{P,I}},
+ {"get_row_span_column",{P},I},
+ {"set_column_span_column",{P,I}},
+ {"get_column_span_column",{P},I},
+ {"set_active",{P,I}},
+ {"get_active",{P},I},
+ {"set_id_column",{P,I}},
+ {"get_id_column",{P},I},
+ {"set_active_id",{P,S},B},
+ {"get_active_id",{P},S},
+ {"set_model",{P,P}},
+ {"get_model",{P},P,0,GtkTreeModel},
+ {"popup_for_device",{P,P}},
+ {"popup",{P}},
+ {"popdown",{P}},
+ {"set_row_separator_func",{P,P,P,P}},
+ {"get_row_separator_func",{P},P},
+ {"set_add_tearoffs",{P,B}}, -- deprecated 3.10
+ {"get_add_tearoffs",{P},B}, -- deprecated 3.10
+ {"set_title",{P,S}}, -- deprecated 3.10
+ {"get_title",{P},S}, -- deprecated 3.10
+ {"set_focus_on_click",{P,B}},
+ {"get_focus_on_click",{P},B},
+ {"set_button_sensitivity",{P,I}},
+ {"get_button_sensitivity",{P},I},
+ {"get_has_entry",{P},B},
+ {"set_entry_text_column",{P,I}},
+ {"get_entry_text_column",{P},I},
+ {"set_popup_fixed_width",{P,B}},
+ {"get_popup_fixed_width",{P},B},
+ {"set_activates_default",{P,B},-routine_id("combo_set_activates_default")},
+ {"get_entry",{P},-routine_id("combo_get_entry")},
+"GtkComboBox"}
+
+ -- create a combo box either empty or from a model
+ function newComboBox(object x=0)
+ if x = 0 then
+ return gtk_func("gtk_combo_box_new",{},{})
+ end if
+ if class_id(x) = GtkListStore then
+ return gtk_func("gtk_combo_box_new_with_model",{P},{x})
+ end if
+ end function
+
+ function combo_get_entry(atom box)
+ atom x = get(box,"child")
+ register(x,GtkEntry)
+ return x
+ end function
+
+ function combo_set_activates_default(atom box, boolean z)
+ atom x = get(box,"child")
+ register(x,GtkEntry)
+ set(x,"property","activates-default",z)
+ return 1
+ end function
+
+widget[GtkComboBoxText] = {"gtk_combo_box_text",
+{GtkCellLayout,GtkCellEditable,GtkComboBox,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"new_with_entry",{},P},
+ {"append",{P,S,S}},
+ {"prepend",{P,S,S}},
+ {"insert",{P,I,S,S}},
+ {"append_text",{P,S}},
+ {"prepend_text",{P,S}},
+ {"insert_text",{P,I,S}},
+ {"remove",{P,I}},
+ {"remove_all",{P}},
+ {"get_active_text",{P},S},
+"GtkComboBoxText"}
+
+widget[GtkComboBoxEntry] = {"gtk_combo_box_text",
+{GtkComboBoxText,GtkComboBox,GtkBin,GtkContainer,GtkWidget,GObject},
+ {"new",{},-routine_id("new_combo_box_entry")},
+"GtkComboBoxEntry"}
+
+ function new_combo_box_entry() -- alias;
+ return gtk_func("gtk_combo_box_text_new_with_entry",{},{})
+ end function
+
+widget[GtkFrame] = {"gtk_frame",
+{GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{S},P},
+ {"set_label",{P,S}},
+ {"get_label",{P},S},
+ {"set_label_align",{P,F,F}},
+ {"get_label_align",{P,F,F}},
+ {"set_label_widget",{P,P}},
+ {"get_label_widget",{P},P,0,GtkWidget},
+ {"set_shadow_type",{P,I}},
+ {"get_shadow_type",{P},I},
+"GtkFrame"}
+
+widget[GtkModelButton] = {"gtk_model_button", -- new in 3.16
+{GtkButton,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkActionable,GObject},
+ {"new",{},P},
+"GtkModelButton"}
+
+widget[GtkButton] = {"gtk_button",
+{GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkActionable,GObject},
+ {"new",{P},-routine_id("newButton")},
+ {"new_from_icon_name",{S,I},P,0,GtkWidget}, -- 3.10
+ {"set_relief",{P,I}},
+ {"get_relief",{P},I},
+ {"set_label",{P,S}},
+ {"get_label",{P},S},
+ {"set_use_underline",{P,B}},
+ {"get_use_underline",{P},B},
+ {"set_focus_on_click",{P,B}},
+ {"get_focus_on_click",{P},B},
+ {"set_alignment",{P,F,F}}, -- deprecated 3.14
+ {"get_alignment",{P,F,F}}, -- deprecated 3.15
+ {"set_image",{P,P},-routine_id("setBtnImage")},
+ {"get_image",{P},P,0,GtkImage},
+ {"set_image_position",{P,I}},
+ {"get_image_position",{P},I},
+ {"set_always_show_image",{P,B}}, -- GTK 3.6+
+ {"get_always_show_image",{P},B}, -- GTK 3.6+
+ {"get_event_window",{P},P,0,GdkWindow},
+"GtkButton"}
+
+ function setBtnImage(atom btn, object img)
+ ------------------------------------------
+ if class_id(img) = GdkPixbuf then
+ img = create(GtkImage,img)
+ end if
+ if string(img) then
+ if file_exists(canonical_path(img)) then
+ img = canonical_path(img)
+ elsif file_exists(canonical_path("~" & img)) then
+ img = canonical_path("~" & img)
+ end if
+ img = create(GdkPixbuf,img,20,20,1)
+ img = create(GtkImage,img)
+ end if
+ if atom(img) then
+ gtk_proc("gtk_button_set_image",{P,P},{btn,img})
+ end if
+ return 1
+ end function
+
+ -- handles creation of buttons with icons from various sources;
+ -- this function modified greatly from earlier versions, in order
+ -- to circumvent the misguided idea that buttons, menus, etc. should not have
+ -- icons (even though window managers have settings to show or hide these
+ -- icons as the USER prefers)
+
+ function newButton(object cap = 0)
+ ----------------------------------
+ atom btn = 0
+ object tmp, t1, box, lbl = 0, icon = 0
+
+ if atom(cap) then
+ if cap = 0 then -- blank button;
+ btn = gtk_func("gtk_button_new",{})
+ register(btn,GtkButton)
+ return btn
+ else
+ btn = gtk_func("gtk_button_new",{})
+ register(btn,GtkButton)
+ set(btn,"use underline",TRUE)
+
+ if class_id(cap) = GdkPixbuf then -- convert to image;
+ cap = create(GtkImage,cap)
+ end if
+ if class_id(cap) = GtkImage then
+ set(btn,"image",cap) -- add image to btn
+ set(btn,"always show image",BTN_SHOW_IMG)
+ end if
+ return btn
+ end if
+ end if
+
+ if string(cap) then
+ if match("#",cap) = 0 then
+ btn = gtk_func("gtk_button_new_from_stock",{P},{allocate_string(cap)})
+ register(btn,GtkButton)
+ set(btn,"always show image",BTN_SHOW_IMG)
+ set(btn,"use underline",TRUE)
+ return btn
+ end if
+ tmp = split(cap,'#')
+ btn = gtk_func("gtk_button_new_with_mnemonic",{P},{allocate_string(tmp[2],1)})
+ register(btn,GtkButton)
+ set(btn,"use underline",TRUE)
+
+ t1 = canonical_path(locate_file(tmp[1]))
+
+ if match("gtk-",cap) = 1 then
+ btn = gtk_func("gtk_button_new")
+ register(btn,GtkButton)
+ box = create(GtkBox,0,5)
+ add(btn,box)
+ icon = create(GtkImage,tmp[1],ceil(BTN_ICON_SIZE/10))
+ if icon > 0 then add(box,icon) end if
+ if length(tmp[2]) > 0 then
+ lbl = gtk_func("gtk_label_new_with_mnemonic",{P},{allocate_string(tmp[2])})
+ register(lbl,GtkLabel)
+ set(lbl,"font",sprintf("%d",BTN_TEXT_SIZE))
+ add(box,lbl)
+ end if
+ set(btn,"always show image",BTN_SHOW_IMG)
+ set(btn,"use underline",TRUE)
+ return btn
+
+ elsif file_exists(t1) then
+ icon = create(GdkPixbuf,t1,BTN_ICON_SIZE,0,1)
+
+ else
+ icon = create(GtkImage,tmp[1],BTN_ICON_SIZE,0,1)
+ end if
+ set(btn,"image",icon)
+ set(btn,"always show image",BTN_SHOW_IMG)
+ set(btn,"use underline",TRUE)
+ return btn
+ end if
+
+ btn = gtk_func("gtk_button_new",{})
+ register(btn,GtkButton)
+
+ return btn
+ end function
+
+widget[GtkToggleButton] = {"gtk_toggle_button",
+{GtkButton,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkActionable,GObject},
+ {"new",{P},-routine_id("newToggleButton")},
+ {"new_with_label",{S},P},
+ {"new_with_mnemonic",{S},P},
+ {"set_mode",{P,B}},
+ {"get_mode",{P},B},
+ {"toggled",{P}},
+ {"set_active",{P,B}},
+ {"get_active",{P},B},
+ {"set_inconsistent",{P,B}},
+ {"get_inconsistent",{P},B},
+"GtkToggleButton"}
+
+ function newToggleButton(object cap = 0)
+ atom btn = 0
+ object tmp, t1, icon = 0
+
+ if atom(cap) then
+ if cap = 0 then -- blank button;
+ btn = gtk_func("gtk_toggle_button_new",{})
+ register(btn,GtkToggleButton)
+ return btn
+ else
+ btn = gtk_func("gtk_toggle_button_new",{})
+ register(btn,GtkToggleButton)
+ if class_id(cap) = GdkPixbuf then -- convert to image;
+ cap = create(GtkImage,cap)
+ end if
+ if class_id(cap) = GtkImage then
+ set(btn,"image",cap) -- add image to btn
+ set(btn,"always show image",BTN_SHOW_IMG)
+ end if
+ return btn
+ end if
+ end if
+
+ if string(cap) then
+ if match("#",cap) = 0 then
+ btn = gtk_func("gtk_toggle_button_new_with_mnemonic",{P},{allocate_string(cap)})
+ register(btn,GtkToggleButton)
+ return btn
+ end if
+ tmp = split(cap,'#')
+ btn = gtk_func("gtk_toggle_button_new_with_mnemonic",{P},{allocate_string(tmp[2],1)})
+ register(btn,GtkToggleButton)
+
+ t1 = canonical_path(locate_file(tmp[1]))
+
+ if match("gtk-",cap) = 1 then
+ icon = create(GtkImage,tmp[1],ceil(BTN_ICON_SIZE/5))
+
+ elsif file_exists(t1) then
+ icon = create(GdkPixbuf,t1,BTN_ICON_SIZE,0,1)
+
+ else
+ icon = create(GtkImage,tmp[1],BTN_ICON_SIZE,0,1)
+ end if
+ set(btn,"image",icon)
+ set(btn,"always show image",BTN_SHOW_IMG)
+ return btn
+ end if
+
+ btn = gtk_func("gtk_toggle_button_new",{})
+ register(btn,GtkToggleButton)
+
+ return btn
+
+ end function
+
+widget[GtkCheckButton] = {"gtk_check_button",
+{GtkToggleButton,GtkButton,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkActionable,GObject},
+ {"new",{P},-routine_id("newCheckButton")},
+ {"new_with_label",{S},P,0,GtkCheckButton},
+ {"new_with_mnemonic",{S},P,0,GtkCheckButton},
+"GtkCheckButton"}
+
+ function newCheckButton(object cap = 0)
+ atom btn = 0
+ object tmp, t1, icon = 0
+
+ if atom(cap) then
+ if cap = 0 then -- blank button;
+ btn = gtk_func("gtk_check_button_new",{})
+ register(btn,GtkCheckButton)
+ return btn
+ else
+ btn = gtk_func("gtk_check_button_new",{})
+ register(btn,GtkCheckButton)
+ if class_id(cap) = GdkPixbuf then -- convert to image;
+ cap = create(GtkImage,cap)
+ end if
+ if class_id(cap) = GtkImage then
+ set(btn,"image",cap) -- add image to btn
+ set(btn,"always show image",BTN_SHOW_IMG)
+ end if
+ return btn
+ end if
+ end if
+
+ if string(cap) then
+ if match("#",cap) = 0 then
+ btn = gtk_func("gtk_check_button_new_with_mnemonic",{P},{allocate_string(cap)})
+ register(btn,GtkCheckButton)
+ return btn
+ end if
+ tmp = split(cap,'#')
+ btn = gtk_func("gtk_check_button_new_with_mnemonic",{P},{allocate_string(tmp[2],1)})
+ register(btn,GtkCheckButton)
+
+ t1 = canonical_path(locate_file(tmp[1]))
+
+ if match("gtk-",cap) = 1 then
+ icon = create(GtkImage,tmp[1],ceil(BTN_ICON_SIZE/5))
+
+ elsif file_exists(t1) then
+ icon = create(GdkPixbuf,t1,BTN_ICON_SIZE,0,1)
+
+ else
+ icon = create(GtkImage,tmp[1],BTN_ICON_SIZE,0,1)
+ end if
+ set(btn,"image",icon)
+ set(btn,"always show image",BTN_SHOW_IMG)
+ return btn
+ end if
+
+ btn = gtk_func("gtk_check_button_new",{})
+ register(btn,GtkCheckButton)
+
+ return btn
+ end function
+
+widget[GtkRadioButton] = {"gtk_radio_button",
+{GtkCheckButton,GtkToggleButton,GtkButton,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkActionable,GObject},
+ {"new",{P,P},-routine_id("newRadioButton")},
+ {"set_group",{P,P}},
+ {"get_group",{P},P},
+ {"join_group",{P,P}},
+"GtkRadioButton"}
+
+ function newRadioButton(atom group=0, object cap = 0)
+ atom btn = 0
+ object tmp, t1, icon = 0
+
+ if atom(cap) then
+ if cap = 0 then -- blank button;
+ btn = gtk_func("gtk_radio_button_new",{P},{group})
+ register(btn,GtkRadioButton)
+ return btn
+ else
+ btn = gtk_func("gtk_radio_button_new",{P},{group})
+ register(btn,GtkRadioButton)
+ if class_id(cap) = GdkPixbuf then -- convert to image;
+ cap = create(GtkImage,cap)
+ end if
+ if class_id(cap) = GtkImage then
+ set(btn,"image",cap) -- add image to btn
+ set(btn,"always show image",BTN_SHOW_IMG)
+ end if
+ return btn
+ end if
+ end if
+
+ if string(cap) then
+ if match("#",cap) = 0 then
+ btn = gtk_func("gtk_radio_button_new_with_mnemonic_from_widget",{P,P},{group,cap})
+ register(btn,GtkRadioButton)
+ return btn
+ end if
+ tmp = split(cap,'#')
+ btn = gtk_func("gtk_radio_button_new_with_mnemonic_from_widget",{P,P},{group,allocate_string(tmp[2],1)})
+ register(btn,GtkRadioButton)
+
+ t1 = canonical_path(locate_file(tmp[1]))
+
+ if match("gtk-",cap) = 1 then
+ icon = create(GtkImage,tmp[1],ceil(BTN_ICON_SIZE/5))
+
+ elsif file_exists(t1) then
+ icon = create(GdkPixbuf,t1,BTN_ICON_SIZE,0,1)
+
+ else
+ icon = create(GtkImage,tmp[1],BTN_ICON_SIZE,0,1)
+ end if
+ set(btn,"image",icon)
+ set(btn,"always show image",BTN_SHOW_IMG)
+ return btn
+ end if
+
+
+ btn = gtk_func("gtk_radio_button_new",{P},{group})
+ register(btn,GtkRadioButton)
+
+ return btn
+ end function
+
+widget[GtkColorButton] = {"gtk_color_button",
+{GtkColorChooser,GtkButton,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkActionable,GObject},
+ {"new",{P},-routine_id("newColorButton")},
+ {"set_title",{P,S}},
+ {"get_title",{P},S},
+ {"show_editor",{P,B}}, -- 3.20
+"GtkColorButton"}
+
+ function newColorButton(object c=0)
+ if string(c) then c = to_rgba(c) end if
+ if c=0 then return gtk_func("gtk_color_button_new")
+ else return gtk_func("gtk_color_button_new_with_rgba",{P},{c})
+ end if
+ end function
+
+widget[GtkFontButton] = {"gtk_font_button",
+{GtkFontChooser,GtkButton,GtkBin,GtkContainer,GtkWidget,GtkActionable,GtkBuildable,GObject},
+ {"new",{P,P,P},-routine_id("newFontButton")},
+ {"set_font_name",{P,S}},
+ {"get_font_name",{P},S},
+ {"set_show_style",{P,B}},
+ {"get_show_style",{P},B},
+ {"set_show_size",{P,B}},
+ {"get_show_size",{P},B},
+ {"set_use_font",{P,B}},
+ {"get_use_font",{P},B},
+ {"set_use_size",{P,B}},
+ {"get_use_size",{P},B},
+ {"set_title",{P,S}},
+ {"get_title",{P},S},
+"GtkFontButton"}
+
+ function newFontButton(object f=0, object fn=0, object data=0)
+ if string(f) then f = allocate_string(f,1) end if
+ atom fnt
+ if f = 0 then
+ fnt = gtk_func("gtk_font_button_new")
+ else fnt = gtk_func("gtk_font_button_new_with_font",{P},{f})
+ end if
+ if string(fn) or fn > 0 then
+ connect(fnt,"font-set",fn,data)
+ end if
+ return fnt
+ end function
+
+widget[GtkLinkButton] = {"gtk_link_button",
+{GtkButton,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkActionable,GObject},
+ {"new",{S,S},-routine_id("newLinkButton")},
+ {"set_uri",{P,S}},
+ {"get_uri",{P},S},
+ {"set_visited",{P,B}},
+ {"get_visited",{P},B},
+"GtkLinkButton"}
+
+ function newLinkButton(object link, object lbl=0)
+ if lbl = 0 then return gtk_func("gtk_link_button_new",{S},{link})
+ else return gtk_func("gtk_link_button_new_with_label",{S,S},{link,lbl})
+ end if
+ end function
+
+widget[GtkLockButton] = {"gtk_lock_button", -- unable to make this work!
+{GtkButton,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkActionable,GObject},
+ {"new",{P},P},
+ {"set_permission",{P,P}},
+ {"get_permission",{P},P,0,GPermission},
+"GtkLockButton"}
+
+widget[GPermission] = {"g_permission",
+{GObject},
+ {"get_allowed",{P},B},
+ {"get_can_acquire",{P},B},
+ {"get_can_release",{P},B},
+ {"acquire",{P,P,P},B},
+ {"acquire_async",{P,P,P,P}},
+ {"acquire_finish",{P,P,P},B},
+ {"release",{P,P,P},B},
+ {"release_async",{P,P,P,P}},
+ {"finish",{P,P,P},B},
+ {"impl_update",{P,B,B,B}},
+"GPermission"}
+
+widget[GSimplePermission] = {"g_simple_permission",
+{GPermission},
+ {"new",{B},P},
+"GSimplePermission"}
+
+widget[GtkScaleButton] = {"gtk_scale_button",
+{GtkButton,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkOrientable,GtkActionable,GObject},
+ {"new",{I,D,D,D,P},P},
+ {"set_adjustment",{P,P}},
+ {"get_adjustment",{P},P,0,GtkAdjustment},
+ {"set_value",{P,D}},
+ {"get_value",{P},D},
+ {"get_popup",{P},P,0,GtkWidget},
+ {"get_plus_button",{P},P,0,GtkButton},
+ {"get_minus_button",{P},P,0,GtkButton},
+ {"set_icons",{P,A}},
+"GtkScaleButton"}
+
+widget[GtkMenu] = {"gtk_menu",
+{GtkMenuShell,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{P},-routine_id("newMenu")},
+ {"attach",{P,P,I,I,I,I}},
+ {"attach_to_widget",{P,P,P}},
+ {"get_attach_widget",{P},P,0,GtkWidget},
+ {"get_for_attach_widget",{P},P,0,GList},
+ {"detach",{P}},
+ {"popup",{P,P,P,P,P,I,I}},
+ {"popdown",{P}},
+ {"reposition",{P}},
+ {"set_active",{P,I}},
+ {"get_active",{P},P,0,GtkMenuItem},
+ {"popup_for_device",{P,P,P,P,P,P,P,I,I}},
+ {"set_accel_group",{P,P}},
+ {"get_accel_group",{P},P,0,GtkAccelGroup},
+ {"set_accel_path",{P,S}},
+ {"get_accel_path",{P},S},
+ {"set_title",{P,S}}, -- deprecated 3.10
+ {"get_title",{P},S}, -- deprecated 3.10
+ {"set_monitor",{P,I}},
+ {"get_monitor",{P},I},
+ {"set_tearoff_state",{P,B}}, -- deprecated 3.10
+ {"get_tearoff_state",{P},B}, -- deprecated 3.10
+ {"set_reserve_toggle_size",{P,B}},
+ {"get_reserve_toggle_size",{P},B},
+ {"set_screen",{P,P}},
+ {"popup_at_pointer",{P,P}}, -- 3.22
+ {"popup_at_rect",{P,P,P,I,I,P}}, -- 3.22
+ {"popup_at_widget",{P,P,I,I,P}}, -- 3.22
+"GtkMenu"}
+
+ function newMenu(object x=0)
+ if class_id(x) = GMenuModel then
+ return gtk_func("gtk_menu_new_from_model",{P},{x})
+ else
+ return gtk_func("gtk_menu_new")
+ end if
+ end function
+
+widget[GtkMenuBar] = {"gtk_menu_bar",
+{GtkMenuShell,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{P},-routine_id("newMenuBar")},
+ {"set_pack_direction",{P,I}},
+ {"get_pack_direction",{P},I},
+ {"set_child_pack_direction",{P,I}},
+ {"get_child_pack_direction",{P},I},
+"GtkMenuBar"}
+
+ function newMenuBar(atom x=0)
+ if class_id(x) = GMenuModel then
+ return gtk_func("gtk_menu_bar_new_from_model",{P},{x})
+ else
+ return gtk_func("gtk_menu_bar_new")
+ end if
+ end function
+
+widget[GMenu] = {"g_menu",
+{GMenuModel,GObject},
+ {"new",{},P},
+ {"freeze",{P}},
+ {"insert",{P,I,S,S}},
+ {"prepend",{P,S,S}},
+ {"append",{P,S,S}},
+ {"insert_item",{P,I,P}},
+ {"append_item",{P,P}},
+ {"prepend_item",{P,P}},
+ {"insert_section",{P,I,S,P}},
+ {"prepend_section",{P,S,P}},
+ {"append_section",{P,S,P}},
+ {"append_submenu",{P,S,P}},
+ {"insert_submenu",{P,I,S,P}},
+ {"prepend_submenu",{P,S,P}},
+ {"remove",{P,I}},
+"GMenu"}
+
+widget[GMenuModel] = {"g_menu_model",
+{GObject},
+ {"is_mutable",{P},B},
+ {"get_n_items",{P},I},
+ {"get_item_attribute",{P,I,S,S,P},B},
+ {"get_item_link",{P,I,S},P,0,GMenuModel},
+ {"items_changed",{P,I,I,I}},
+"GMenuModel"}
+
+widget[GMenuItem] = {"g_menu_item",
+{GObject},
+ {"new",{S,S},P},
+ {"new_section",{S,P},P,0,GMenuItem},
+ {"new_submenu",{S,P},P,0,GMenuItem},
+ {"set_label",{P,S}},
+ {"set_action_and_target_value",{P,S,P}},
+ {"set_detailed_action",{P,S}},
+ {"set_section",{P,P}},
+ {"set_submenu",{P,P}},
+ {"set_attribute_value",{P,P,P}},
+ {"set_link",{P,S,P}},
+"GMenuItem"}
+
+widget[GtkMenuButton] = {"gtk_menu_button", --3.6
+{GtkToggleButton,GtkButton,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkActionable,GObject},
+ {"new",{},P},
+ {"set_popup",{P,P}},
+ {"get_popup",{P},P,0,GtkMenu},
+ {"set_menu_model",{P,P}},
+ {"get_menu_model",{P},P,0,GMenuModel},
+ {"set_direction",{P,I}},
+ {"get_direction",{P},I},
+ {"set_align_widget",{P,P}},
+ {"get_align_widget",{P},P,0,GtkWidget},
+ {"set_popover",{P,P}}, -- 3.12
+ {"get_popover",{P},P,0,GtkPopover}, -- 3.12
+ {"set_use_popover",{P,B}}, -- 3.12
+ {"get_use_popover",{P},B}, -- 3.12
+"GtkMenuButton"}
+
+widget[GtkMenuItem] = {"gtk_menu_item",
+{GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkActionable,GObject},
+ {"new",{P,P,P,P},-routine_id("newMenuItem")},
+ {"set_label",{P,S},-routine_id("mi_set_label")},
+ {"get_label",{P},-routine_id("mi_get_label")},
+ {"set_image",{P,P},-routine_id("mi_set_image")},
+ {"get_image",{P},-routine_id("mi_get_image")},
+ {"set_use_underline",{P,B}},
+ {"get_use_underline",{P},B},
+ {"set_submenu",{P,P}},
+ {"get_submenu",{P},P,0,GtkWidget},
+ {"select",{P}},
+ {"deselect",{P}},
+ {"activate",{P}},
+ {"toggle_size_allocate",{P,I}},
+ {"set_reserve_indicator",{P,B}},
+ {"get_reserve_indicator",{P},B},
+ {"add_accelerator",{P,P,P},-routine_id("mi_add_accelerator")},
+"GtkMenuItem"}
+
+-- all this just to allow images and accels on menu items!
+
+constant activate = allocate_string("activate")
+
+ function newMenuItem(object stk=0, object fn=0, object data=0, object accels=0)
+ object item, img = 0
+
+ if match("#",stk) then
+ stk = split(stk,'#')
+ img = stk[1]
+ stk = stk[2]
+ goto "next"
+ end if
+
+ if not match("#",stk) then
+ if match("gtk-",stk) then
+ img = stk
+ stk = "_" & proper(stk[5..$])
+ end if
+ end if
+
+ label "next"
+
+ item = gtk_func("gtk_menu_item_new_with_mnemonic",{P},{allocate_string(stk,1)})
+ register(item,GtkMenuItem)
+
+ label "accels "
+
+ if atom(img) and img = 0 then
+ item = mi_add_accelerator(item,accels)
+ else
+ item = mi_add_accelerator(item,accels,img)
+ end if
+
+ return item
+ end function
+
+ function mi_add_accelerator(atom item, object accels, object img = 0)
+ atom x = allocate(8,1)
+ integer key, mods
+
+ object child = get(item,"child")
+
+ if atom(img) and img = 0 then -- do nothing
+ else
+ img = get_icon_image(img,3)
+ end if
+
+ if sequence(accels) then
+ gtk_proc("gtk_accelerator_parse", {P,P,P},
+ {allocate_string(accels[2],1),x,x+4})
+
+ key = peek4u(x) mods = peek4u(x+4)
+
+ gtk_proc("gtk_widget_add_accelerator",{P,P,P,I,I,I},
+ {item,activate,accels[1],key,mods,GTK_ACCEL_VISIBLE})
+
+ if class_id(child) = -1 then
+ gtk_proc("gtk_accel_label_set_accel_widget",{P,P},{child,item})
+ gtk_proc("gtk_accel_label_set_accel",{P,I,I},{child,key,mods})
+ end if
+ end if
+
+ gtk_proc("g_object_ref",{P},{child})
+ gtk_proc("gtk_container_remove",{P,P},{item,child})
+
+ atom box = create(GtkButtonBox)
+ set(box,"margin left",0)
+ set(box,"layout",GTK_BUTTONBOX_START)
+
+ if atom(img) and img > 0 then
+ add(box,img)
+ register(img,GtkImage)
+ set(box,"halign",0)
+ set(img,"margin left",0)
+ set(img,"margin right",0)
+ set(box,"child non_homogeneous",img,TRUE)
+ end if
+
+ register(child,GtkAccelLabel)
+ pack_start(box,child,1,1) -- put the label back
+
+ set(box,"child non_homogeneous",child,TRUE)
+ set(child,"halign",0)
+ set(child,"margin left",0)
+
+ if sequence(accels) then
+ object txt = gtk_str_func("gtk_accelerator_get_label",{I,I},{key,mods})
+ if string(txt) then
+ atom acc = create(GtkLabel)
+ set(acc,"padding",0,0)
+ set(acc,"markup",txt)
+ if sequence(ACCEL_FONT) then
+ set(acc,"font",ACCEL_FONT)
+ end if
+ add(box,acc)
+ set(box,"child secondary",acc,TRUE)
+ set(box,"child non_homogeneous",acc,TRUE)
+ end if
+ end if
+
+ add(item,box)
+
+ return item
+ end function
+
+ function mi_set_label(atom item, object lbl)
+ if string(lbl) then lbl = allocate_string(lbl,1) end if
+ atom b = get(item,"child")
+ object list = get(b,"children")
+ if atom(list) then
+ list &= 0
+ end if
+
+ for i = 1 to length(list) do
+ if class_id(list[i]) = GtkAccelLabel then
+ gtk_proc("gtk_label_set_text",{P,P},{list[i],lbl})
+ return 1
+ end if
+ end for
+
+ return 1
+ end function
+
+ export function mi_get_label(atom item)
+ atom b = get(item,"child")
+ object list = get(b,"children")
+ for i = 1 to length(list) do
+ if class_id(list[i]) = GtkAccelLabel then
+ return gtk_str_func("gtk_label_get_text",{P},{list[i]})
+ end if
+ end for
+ return 0
+ end function
+
+ function mi_set_image(atom item, object img)
+ if string(img) then img = get_icon_image(img,GTK_ICON_SIZE_MENU) end if
+ img = get(img,"pixbuf")
+ atom b = get(item,"child")
+ object l = get(b,"children")
+ for i = 1 to length(l) do
+ if class_id(l[i]) = GtkImage then
+ gtk_proc("gtk_image_set_from_pixbuf",{P,P},{l[i],img})
+ return 1
+ end if
+ end for
+ return 1
+ end function
+
+ function gmi_get_image(atom item)
+ atom b = get(item,"child")
+ object l = get(b,"children")
+ for i = 1 to length(l) do
+ if class_id(l[i]) = GtkImage then
+ return l[i]
+ end if
+ end for
+ return 1
+ end function
+
+ function mi_set_use_underline(atom item, boolean use)
+ atom b = get(item,"child")
+ object l = get(b,"children")
+ for i = 1 to length(l) do
+ if class_id(l[i]) = GtkAccelLabel then
+ gtk_proc("gtk_label_set_use_underline",{P,B},{l[i],use})
+ return 1
+ end if
+ end for
+ return 1
+ end function
+
+ function mi_get_use_underline(atom item)
+ atom b = get(item,"child")
+ object l = get(b,"children")
+ l = to_sequence(l,1)
+ for i = 1 to length(l) do
+ if class_id(l[i]) = GtkAccelLabel then
+ return gtk_func("gtk_label_get_use_underline",{P},{l[i]})
+ end if
+ end for
+ return 1
+ end function
+
+widget[GtkImageMenuItem] = {"gtk_image_menu_item",
+{GtkMenuItem,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{P,P,P,P},-routine_id("newMenuItem")},
+"GtkImageMenuItem"}
+
+widget[GtkRadioMenuItem] = {"gtk_radio_menu_item",
+{GtkCheckMenuItem,GtkMenuItem,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkActionable,GObject},
+ {"new",{P,P,P,P,P},-routine_id("newRadioMenuItem")},
+ {"set_group",{P,P}},
+ {"get_group",{P},P},
+ {"join_group",{P,P}}, -- 3.18
+"GtkRadioMenuItem"}
+
+ function newRadioMenuItem(atom group, object stk, object fn, object data, object accels=0)
+ object item, img = 0
+
+ if match("#",stk) then
+ stk = split(stk,'#')
+ img = stk[1]
+ stk = stk[2]
+ goto "next"
+ end if
+
+ if not match("#",stk) then
+ if match("gtk-",stk) then
+ img = stk
+ end if
+ end if
+
+ label "next"
+
+ if group = 0 then
+ item = gtk_func("gtk_radio_menu_item_new_with_mnemonic",{P,P},
+ {group,allocate_string(stk,1)})
+ else
+ item = gtk_func("gtk_radio_menu_item_new_with_mnemonic_from_widget",
+ {P,P},{group,allocate_string(stk,1)})
+ end if
+ register(item,GtkMenuItem)
+
+ if atom(img) and img = 0 then
+ item = mi_add_accelerator(item,accels)
+ else
+ item = mi_add_accelerator(item,accels,img)
+ end if
+
+ return item
+ end function
+
+widget[GtkCheckMenuItem] = {"gtk_check_menu_item",
+{GtkMenuItem,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkActionable,GObject},
+ {"new",{P,P,P,P},-routine_id("newCheckMenuItem")},
+ {"set_active",{P,B}},
+ {"get_active",{P},B},
+ {"toggled",{P}},
+ {"set_inconsistent",{P,B}},
+ {"get_inconsistent",{P},B},
+ {"set_draw_as_radio",{P,B}},
+ {"get_draw_as_radio",{P},B},
+"GtkCheckMenuItem"}
+
+ function newCheckMenuItem(object stk,object fn, object data, object accels=0)
+ object item, img = 0
+
+ if match("#",stk) then
+ stk = split(stk,'#')
+ img = stk[1]
+ stk = stk[2]
+ goto "next"
+ end if
+
+ if not match("#",stk) then
+ if match("gtk-",stk) then
+ img = stk
+ end if
+ end if
+
+ label "next"
+
+ item = gtk_func("gtk_check_menu_item_new_with_mnemonic",{P},{allocate_string(stk,1)})
+ register(item,GtkCheckMenuItem)
+
+ if atom(img) and img = 0 then
+ item = mi_add_accelerator(item,accels)
+ else
+ item = mi_add_accelerator(item,accels,img)
+ end if
+
+ return item
+ end function
+
+widget[GtkNumerableIcon] = {"gtk_numerable_icon", -- deprecated 3.14
+{GEmblemedIcon,GObject},
+ {"new",{P},P,0,GIcon},
+ {"new_with_style_context",{P,P},P,0,GIcon},
+ {"get_background_gicon",{P},P,0,GIcon},
+ {"set_background_gicon",{P,P}},
+ {"get_background_icon_name",{P},S},
+ {"set_background_icon_name",{P,S}},
+ {"get_count",{P},I},
+ {"set_count",{P,I}},
+ {"get_label",{P},S},
+ {"set_label",{P,S}},
+ {"get_style_context",{P},P,0,GtkStyleContext},
+ {"set_style_context",{P,P}},
+"GtkNumerableIcon"}
+
+widget[GtkEventBox] = {"gtk_event_box",
+{GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"set_above_child",{P,B}},
+ {"get_above_child",{P},B},
+ {"set_visible_window",{P,B}},
+ {"get_visible_window",{P},B},
+"GtkEventBox"}
+
+widget[GtkExpander] = {"gtk_expander",
+{GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{P},-routine_id("newExpander")},
+ {"set_spacing",{P,I}},
+ {"get_spacing",{P},I},
+ {"set_expanded",{P,B}},
+ {"get_expanded",{P},B},
+ {"set_label",{P,S}},
+ {"get_label",{P},S},
+ {"set_label_widget",{P,P}},
+ {"get_label_widget",{P},P},
+ {"set_label_fill",{P,B}},
+ {"get_label_fill",{P},B},
+ {"set_use_underline",{P,B}},
+ {"get_use_underline",{P},B},
+ {"set_use_markup",{P,B}},
+ {"get_use_markup",{P},B},
+ {"set_resize_toplevel",{P,B}},
+ {"get_resize_toplevel",{P},B},
+"GtkExpander"}
+
+ function newExpander(object caption="")
+ if string(caption) and match("_",caption) then
+ return gtk_func("gtk_expander_new_with_mnemonic",{P},{caption})
+ else
+ return gtk_func("gtk_expander_new",{P},{caption})
+ end if
+ end function
+
+widget[GtkToolItem] = {"gtk_tool_item",
+{GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"set_homogeneous",{P,B}},
+ {"get_homogeneous",{P},B},
+ {"set_expand",{P,B}},
+ {"get_expand",{P},B},
+ {"set_tooltip_text",{P,S}},
+ {"set_tooltip_markup",{P,S}},
+ {"set_use_drag_window",{P,B}},
+ {"get_use_drag_window",{P},B},
+ {"set_visible_horizontal",{P,B}},
+ {"get_visible_horizontal",{P},B},
+ {"set_visible_vertical",{P,B}},
+ {"get_visible_vertical",{P},B},
+ {"set_is_important",{P,B}},
+ {"get_is_important",{P},B},
+ {"get_ellipsize_mode",{P},I},
+ {"get_icon_size",{P},I},
+ {"get_orientation",{P},I},
+ {"get_toolbar_style",{P},I},
+ {"get_relief_style",{P},I},
+ {"get_text_alignment",{P},F},
+ {"get_text_orientation",{P},I},
+ {"retrieve_proxy_menu_item",{P},P,0,GtkMenuItem},
+ {"set_proxy_menu_item",{P,S,P}},
+ {"get_proxy_menu_item",{P,S},P,0,GtkMenuItem},
+ {"rebuild_menu",{P}},
+ {"toolbar_reconfigured",{P}},
+ {"get_text_size_group",{P},P,0,GtkSizeGroup},
+"GtkToolItem"}
+
+widget[GtkToolButton] = {"gtk_tool_button",
+{GtkToolItem,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkActionable,GObject},
+ {"new",{P,P},-routine_id("newToolButton")},
+ {"set_label",{P,S}},
+ {"get_label",{P},S},
+ {"set_use_underline",{P,B}},
+ {"get_use_underline",{P},B},
+ {"set_stock_id",{P,S}}, -- deprecated 3.10
+ {"get_stock_id",{P},S}, -- deprecated 3.10
+ {"set_icon_name",{P,S}},
+ {"get_icon_name",{P},S},
+ {"set_icon_widget",{P,P}},
+ {"get_icon_widget",{P},P,0,GtkWidget},
+ {"set_label_widget",{P,P}},
+ {"get_label_widget",{P},P,0,GtkWidget},
+"GtkToolButton"}
+
+ function newToolButton(object icn=0, object lbl=0)
+ --------------------------------------------------
+ atom btn = 0
+ if string(icn) then
+ if match("gtk-",icn) = 1 then
+ btn = gtk_func("gtk_tool_button_new_from_stock",{P},{allocate_string(icn,1)})
+ set(btn,"always show icon",TRUE)
+ return btn
+ else
+ icn = create(GtkImage,icn)
+ end if
+ end if
+
+ if string(lbl) then
+ lbl = allocate_string(lbl,1)
+ end if
+
+ btn = gtk_func("gtk_tool_button_new",{P,P},{icn,lbl})
+
+ return btn
+ end function
+
+widget[GtkMenuToolButton] = {"gtk_menu_tool_button",
+{GtkToolButton,GtkToolItem,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkActionable,GObject},
+ {"new",{P,P},-routine_id("newMenuToolButton")},
+ {"set_menu",{P,P}},
+ {"get_menu",{P},P,0,GtkMenu},
+ {"set_arrow_tooltip_text",{P,S}},
+ {"set_arrow_tooltip_markup",{P,S}},
+"GtkMenuToolButton"}
+
+ function newMenuToolButton(object icn=0, object lbl=0)
+ if string(icn) then
+ icn = create(GtkImage,icn,1)
+ end if
+ if string(lbl) then
+ lbl = allocate_string(lbl,1)
+ end if
+ atom btn = gtk_func("gtk_menu_tool_button_new",{P,P},{icn,lbl})
+ return btn
+ end function
+
+widget[GtkToggleToolButton] = {"gtk_toggle_tool_button",
+{GtkToolButton,GtkToolItem,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkActionable,GObject},
+ {"new",{S},-routine_id("newToggleToolButton")},
+ {"set_active",{P,B}},
+ {"get_active",{P},B},
+"GtkToggleToolButton"}
+
+ function newToggleToolButton(object x)
+ atom btn
+ if string(x) then
+ btn = gtk_func("gtk_toggle_tool_button_new_from_stock",{S},{x})
+ elsif atom(x) then
+ btn = gtk_func("gtk_toggle_tool_button_new")
+ if class_id(btn) = GdkPixbuf then
+ set(btn,"image",create(GtkImage,btn))
+ end if
+ end if
+ return btn
+ end function
+
+widget[GtkRadioToolButton] = {"gtk_radio_tool_button",
+{GtkToggleToolButton,GtkToolButton,GtkToolItem,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkActionable,GObject},
+ {"new",{P},-routine_id("newRadioToolButton")},
+ {"set_group",{P,P}},
+ {"get_group",{P},P},
+"GtkRadioToolButton"}
+
+ function newRadioToolButton(atom id)
+ if class_id(id) = GtkRadioToolButton then
+ return gtk_func("gtk_radio_tool_button_new_from_widget",{P},{id})
+ else
+ return gtk_func("gtk_radio_tool_button_new",{P},{id})
+ end if
+ end function
+
+widget[GtkSeparatorToolItem] = {"gtk_separator_tool_item",
+{GtkToolItem,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"set_draw",{P,B}},
+ {"get_draw",{P},B},
+"GtkSeparatorToolItem"}
+
+widget[GtkOverlay] = {"gtk_overlay",
+{GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"add_overlay",{P,P}},
+ {"get_overlay_pass_through",{P,P},B}, -- 3.18
+ {"set_overlay_pass_through",{P,P,B}}, -- 3.18
+"GtkOverlay"}
+
+widget[GtkScrollable] = {"gtk_scrollable",
+{GObject},
+ {"set_hadjustment",{P,P}},
+ {"get_hadjustment",{P},P,0,GtkAdjustment},
+ {"set_vadjustment",{P,P}},
+ {"get_vadjustment",{P},P,0,GtkAdjustment},
+ {"set_hscroll_policy",{P,I}},
+ {"get_hscroll_policy",{P},I},
+ {"set_vscroll_policy",{P,I}},
+ {"get_vscroll_policy",{P},I},
+ {"get_border",{P,P},B}, -- 3.16
+"GtkScrollable"}
+
+widget[GtkScrolledWindow] = {"gtk_scrolled_window",
+{GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{P,P},P},
+ {"set_hadjustment",{P,P}},
+ {"get_hadjustment",{P},P,0,GtkAdjustment},
+ {"set_vadjustment",{P,P}},
+ {"get_vadjustment",{P},P,0,GtkAdjustment},
+ {"get_hscrollbar",{P},P,0,GtkWidget},
+ {"get_vscrollbar",{P},P,0,GtkWidget},
+ {"set_policy",{P,I,I}},
+ {"get_policy",{P,I,I}},
+ {"set_placement",{P,I}},
+ {"unset_placement",{P}},
+ {"set_shadow_type",{P,I}},
+ {"get_shadow_type",{P},I},
+ {"set_min_content_width",{P,I}},
+ {"get_min_content_width",{P},I},
+ {"set_min_content_height",{P,I}},
+ {"get_min_content_height",{P},I},
+ {"set_kinetic_scrolling",{P,B}},
+ {"get_kinetic_scrolling",{P},B},
+ {"set_capture_button_press",{P,B}},
+ {"get_capture_button_press",{P},B},
+ {"set_headers",{P,P}},
+ {"add_with_viewport",{P,P}}, -- deprecated 3.8
+ {"get_overlay_scrolling",{P},B}, -- 3.16
+ {"set_overlay_scrolling",{P,B}}, -- 3.16
+"GtkScrolledWindow"}
+
+widget[GtkSidebar] = {"gtk_sidebar", -- 3.16
+{GtkBin,GtkContainer,GtkWidget,GObject},
+ {"new",{},P},
+ {"set_stack",{P,P}},
+ {"get_stack",{P},P,0,GtkStack},
+"GtkSidebar"}
+
+widget[GtkTextBuffer] = {"gtk_text_buffer",
+{GObject},
+ {"new",{P},P},
+ {"get_line_count",{P},I},
+ {"get_char_count",{P},I},
+ {"get_tag_table",{P},P,0,GtkTextTagTable},
+ {"insert",{P,P,S,I}},
+ {"insert_at_cursor",{P,S,I}},
+ {"insert_interactive",{P,P,S,I,B},B},
+ {"insert_interactive_at_cursor",{P,S,I,B},B},
+ {"insert_range",{P,P,P,P}},
+ {"insert_range_interactive",{P,P,P,P,B},B},
+ {"insert_with_tags",{P,P,S,I,P,P}},
+ {"insert_with_tags_by_name",{P,P,S,I,S}},
+ {"insert_markup",{P,P,S,I}}, -- 3.16
+ {"delete",{P,P,P}},
+ {"delete_interactive",{P,P,P,B},B},
+ {"backspace",{P,P,B,B},B},
+ {"set_text",{P,P},-routine_id("setBufferText")},
+ {"get_text",{P},-routine_id("getBufferText")},
+ {"get_slice",{P,P,P,B},S},
+ {"insert_pixbuf",{P,P,P}},
+ {"insert_child_anchor",{P,P,P}},
+ {"create_child_anchor",{P,P},P,0,GtkTextChildAnchor},
+ {"create_mark",{P,S,P,B},P,0,GtkTextMark},
+ {"move_mark",{P,P,P}},
+ {"move_mark_by_name",{P,S,P}},
+ {"add_mark",{P,P,P}},
+ {"delete_mark",{P,P}},
+ {"delete_mark_by_name",{P,S}},
+ {"get_mark",{P,S},P,0,GtkTextMark},
+ {"get_insert",{P},P,0,GtkTextMark},
+ {"get_selection_bound",{P},P,0,GtkTextMark},
+ {"get_selection_bounds",{P},-routine_id("getSelectionBounds")},
+ {"get_has_selection",{P},B},
+ {"place_cursor",{P,P}},
+ {"select_range",{P,P,P}},
+ {"apply_tag",{P,P,P,P}},
+ {"remove_tag",{P,P,P,P}},
+ {"apply_tag_by_name",{P,S,P,P}},
+ {"remove_tag_by_name",{P,S,P,P}},
+ {"remove_all_tags",{P,P,P}},
+ {"create_tag",{P,S,S,S},P,0,GtkTextTag},
+ {"get_iter_at_line_offset",{P,P,I,I}},
+ {"get_iter_at_offset",{P,P,I}},
+ {"get_iter_at_line",{P,P,I}},
+ {"get_iter_at_line_index",{P,P,I,I}},
+ {"get_iter_at_mark",{P,P,P}},
+ {"get_iter_at_child_anchor",{P,P,P}},
+ {"get_start_iter",{P,P}},
+ {"get_end_iter",{P,P}},
+ {"get_bounds",{P,P,P}},
+ {"set_modified",{P,B}},
+ {"get_modified",{P},B},
+ {"delete_selection",{P,B,B},B},
+ {"paste_clipboard",{P,P,P,B}},
+ {"copy_clipboard",{P,P}},
+ {"cut_clipboard",{P,P,B}},
+ {"get_selection_bounds",{P,P,P},B},
+ {"begin_user_action",{P}},
+ {"end_user_action",{P}},
+ {"add_selection_clipboard",{P,P}},
+ {"remove_selection_clipboard",{P,P}},
+ {"deserialize",{P,P,I,P,I,I,P},B},
+ {"deserialize_set_can_create_tags",{P,I,B}},
+ {"deserialize_get_can_create_tags",{P,I},B},
+ {"get_copy_target_list",{P},P,0,GtkTargetList},
+ {"get_deserialize_formats",{P,I},P},
+ {"get_paste_target_list",{P},P,0,GtkTargetList},
+ {"get_serialize_formats",{P,I},P},
+ {"register_deserialize_format",{P,S,P,P,P},P},
+ {"register_deserialize_tagset",{P,S},P},
+ {"register_serialize_format",{P,S,P,P,P},P},
+ {"register_serialize_tagset",{P,S},P},
+ {"serialize",{P,P,P,P,P,I},I},
+ {"unregister_deserialize_format",{P,P}},
+ {"unregister_serialize_format",{P,P}},
+ {"insert_markup",{P,P,S,I}}, -- 3.16
+"GtkTextBuffer"}
+
+ export constant
+ fnBufStart = define_proc("gtk_text_buffer_get_start_iter",{P,P}),
+ fnBufEnd = define_proc("gtk_text_buffer_get_end_iter",{P,P}),
+ fnBufGet = define_func("gtk_text_buffer_get_text",{P,P,P,B},S),
+ fnBufSet = define_proc("gtk_text_buffer_set_text",{P,S,I}),
+ fnBufIns = define_func("gtk_text_buffer_get_insert",{P},P),
+ fnBufIter = define_proc("gtk_text_buffer_get_iter_at_mark",{P,P,P}),
+ fnBufBounds = define_func("gtk_text_buffer_get_selection_bounds",{P,P,P},B)
+
+ function getBufferText(object buf)
+ atom start = allocate(64) c_proc(fnBufStart,{buf,start})
+ atom fini = allocate(64) c_proc(fnBufEnd,{buf,fini})
+ object result = c_func(fnBufGet,{buf,start,fini,1})
+ return peek_string(result)
+ end function
+
+ function getSelectionBounds(object buf)
+ atom start = allocate(100)
+ atom fini = allocate(100)
+ atom iter = allocate(100)
+ if c_func(fnBufBounds,{buf,start,fini}) then
+ return {start,fini}
+ else
+ start = c_func(fnBufIns,{buf})
+ c_proc(fnBufIter,{buf,iter,start})
+ return {iter,iter}
+ end if
+ end function
+
+ function setBufferText(object buf, object txt)
+ object len
+ if atom(txt) then
+ len = peek_string(txt)
+ len = length(len)
+ else
+ len = length(txt)
+ txt = allocate_string(txt)
+ end if
+ c_proc(fnBufSet,{buf,txt,len})
+ return 1
+ end function
+
+widget[GtkClipboard] = {"gtk_clipboard",
+{GObject},
+ {"new",{I},-routine_id("newClipboard")},
+ {"get_default",{P},P,0,GtkClipboard},-- 3.16
+ {"get_for_display",{P,I},P,0,GtkClipboard},
+ {"get_display",{P},P,0,GdkDisplay},
+ {"set_with_data",{P,P,I,P,P,P},B},
+ {"set_with_owner",{P,P,I,P,P,P},B},
+ {"get_owner",{P},P,0,GObject},
+ {"clear",{P}},
+ {"set_text",{P,S,I}},
+ {"set_image",{P,P}},
+ {"request_contents",{P,I,P,P}},
+ {"request_text",{P,P,P}},
+ {"request_image",{P,P,P}},
+ {"request_targets",{P,P,P}},
+ {"request_rich_text",{P,P,P,P}},
+ {"request_uris",{P,P,P}},
+ {"wait_for_contents",{P,I},P,0,GtkSelectionData},
+ {"wait_for_text",{P},S},
+ {"wait_for_image",{P},P,0,GdkPixbuf},
+ {"wait_for_rich_text",{P,P,I,I},I},
+ {"wait_for_uris",{P},A},
+ {"wait_is_text_available",{P},B},
+ {"wait_is_image_available",{P},B},
+ {"wait_is_rich_text_available",{P,P},B},
+ {"wait_is_uris_available",{P},B},
+ {"wait_for_targets",{P,P,I},B},
+ {"wait_is_target_available",{P,I},B},
+ {"set_can_store",{P,P,I}},
+ {"store",{P}},
+ {"get_selection",{P},P}, -- 3.22
+"GtkClipboard"}
+
+ function newClipboard(integer i=0) -- just use default clipboard;
+ return gtk_func("gtk_clipboard_get",{I},{i})
+ end function
+
+widget[GtkSelectionData] = {"gtk_selection_data",
+{0},
+ {"set",{P,I,I,S,I}},
+ {"set_text",{P,S,I},B},
+ {"get_text",{P},S},
+ {"set_pixbuf",{P,P},B},
+ {"get_pixbuf",{P},P,0,GdkPixbuf},
+ {"set_uris",{P,S},B},
+ {"get_uris",{P},A},
+ {"get_targets",{P,P,I},B},
+ {"targets_include_image",{P,B},B},
+ {"targets_include_text",{P},B},
+ {"targets_include_uri",{P},B},
+ {"targets_include_rich_text",{P,P},B},
+ {"get_selection",{P},P},
+ {"get_data",{P},S},
+ {"get_length",{P},I},
+ {"get_data_with_length",{P,I},S},
+ {"get_data_type",{P},I},
+ {"get_display",{P},P,0,GdkDisplay},
+ {"get_format",{P},I},
+ {"get_target",{P},I},
+"GtkSelectionData"}
+
+widget[GtkCellArea] = {"gtk_cell_area",
+{GtkCellLayout,GtkBuildable,GObject},
+ {"add",{P,P}},
+ {"remove",{P,P}},
+ {"set_property",{P,P,S,P}},
+ {"get_property",{P,P,S,P}},
+ {"has_renderer",{P,P},B},
+ {"foreach",{P,P}},
+ {"foreach_alloc",{P,P,P,P,P,P,P}},
+ {"event",{P,P,P,P,P,I},I},
+ {"render",{P,P,P,P,P,P,I,B}},
+ {"get_cell_allocation",{P,P,P,P,P,P}},
+ {"get_cell_at_position",{P,P,P,P,I,I,P},P,0,GtkCellRenderer},
+ {"create_context",{P},P,0,GtkCellAreaContext},
+ {"copy_context",{P,P},P,0,GtkCellAreaContext},
+ {"get_request_mode",{P},I},
+ {"get_preferred_width",{P,P,P,I,I}},
+ {"get_preferred_height_for_width",{P,P,P,I,I,I}},
+ {"get_preferred_height",{P,P,P,I,I}},
+ {"get_preferred_width_for_height",{P,P,P,I,I,I}},
+ {"get_current_path",{P},S},
+ {"apply_attributes",{P,P,P,B,B}},
+ {"attribute_connect",{P,P,S,I}},
+ {"attribute_disconnect",{P,P,S}},
+ {"attribute_get_column",{P,P,S},I}, -- 3.14
+ {"is_activatable",{P},B},
+ {"activate",{P,P,P,P,I,B},B},
+ {"activate_cell",{P,P,P,P,P,I},B},
+ {"focus",{P,I},B},
+ {"set_focus_cell",{P,P}},
+ {"get_focus_cell",{P},P,0,GtkCellRenderer},
+ {"add_focus_sibling",{P,P,P}},
+ {"remove_focus_sibling",{P,P,P}},
+ {"is_focus_sibling",{P,P,P},B},
+ {"get_focus_siblings",{P,P},X,0,GList},
+ {"get_focus_from_sibling",{P,P},P,0,GtkCellRenderer},
+ {"get_edited_cell",{P},P,0,GtkCellRenderer},
+ {"get_edit_widget",{P},P,0,GtkCellEditable},
+ {"stop_editing",{P,B}},
+ {"inner_cell_area",{P,P,P,P}},
+ {"request_renderer",{P,P,P,P,I,I,I}},
+ {"class_install_property",{P,I,P}},
+ {"class_find_cell_property",{P,S},P},
+ {"class_list_cell_properties",{P,I},P},
+"GtkCellArea"}
+
+widget[GtkCellAreaCell] = {"gtk_cell_area_cell",
+{GtkCellArea},
+ {"set_property",{P,P,S,P}},
+ {"get_property",{P,P,S,P}},
+"GtkCellAreaCell"}
+
+widget[GtkCellAreaBox] = {"gtk_cell_area_box",
+{GtkCellLayout,GtkCellArea,GtkBuildable,GtkOrientable,GObject},
+ {"new",{},P},
+ {"pack_start",{P,P,B,B,B}},
+ {"pack_end",{P,P,B,B,B}},
+ {"set_spacing",{P,I}},
+ {"get_spacing",{P},I},
+"GtkCellAreaBox"}
+
+widget[GtkCellAreaContext] = {"gtk_cell_area_context",
+{GObject},
+ {"get_area",{P},P,0,GtkCellArea},
+ {"allocate",{P,I,I}},
+ {"reset",{P}},
+ {"get_preferred_width",{P,I,I}},
+ {"get_preferred_height",{P,I,I}},
+ {"get_preferred_height_for_width",{P,I,I,I}},
+ {"get_preferred_width_for_height",{P,I,I,I}},
+ {"get_allocation",{P,I,I}},
+ {"push_preferred_width",{P,I,I}},
+ {"push_preferred_height",{P,I,I}},
+"GtkCellAreaContext"}
+
+widget[GtkCellEditable] = {"gtk_cell_editable",
+{GtkWidget},
+ {"start_editing",{P,P}},
+ {"editing_done",{P}},
+ {"remove_widget",{P}},
+"GtkCellEditable"}
+
+widget[GtkCellLayout] = {"gtk_cell_layout",
+{GObject},
+ {"pack_start",{P,P,B}},
+ {"pack_end",{P,P,B}},
+ {"get_area",{P},P,0,GtkCellArea},
+ {"get_cells",{P},X,0,GList},
+ {"reorder",{P,P,I}},
+ {"clear",{P}},
+ {"add_attribute",{P,P,S,I}},
+ {"set_cell_data_func",{P,P,P,P,P}},
+ {"clear_attributes",{P,P}},
+"GtkCellLayout"}
+
+widget[GtkCellRenderer] = {"gtk_cell_renderer",
+{GObject},
+ {"set_fixed_size",{P,I,I}},
+ {"get_fixed_size",{P,I,I}},
+ {"set_visible",{P,B}},
+ {"get_visible",{P},B},
+ {"set_sensitive",{P,B}},
+ {"get_sensitive",{P},B},
+ {"set_alignment",{P,F,F}},
+ {"get_alignment",{P,F,F}},
+ {"set_padding",{P,I,I}},
+ {"get_padding",{P,I,I}},
+ {"get_state",{P,P,I},I},
+ {"is_activatable",{P},B},
+ {"get_aligned_area",{P,P,I,P,P}},
+ {"render",{P,P,P,P,P,I}},
+ {"activate",{P,P,P,P,P,P,I},B},
+ {"start_editing",{P,P,P,P,P,P,I},P,0,GtkCellEditable},
+ {"stop_editing",{P,B}},
+ {"get_preferred_height",{P,P,I,I}},
+ {"get_preferred_width",{P,P,I,I}},
+ {"get_preferred_height_for_width",{P,P,I,I,I}},
+ {"get_preferred_width_for_height",{P,P,I,I,I}},
+ {"get_preferred_size",{P,P,P,P}},
+ {"get_request_mode",{P},I},
+"GtkCellRenderer"}
+
+-- Many properties exist for cell renderers, see GTK docs!
+
+widget[GtkCellRendererAccel] = {"gtk_cell_renderer_accel",
+{GtkCellRendererText,GtkCellRenderer,GObject},
+ {"new",{},P},
+"GtkCellRendererAccel"}
+
+widget[GtkCellRendererCombo] = {"gtk_cell_renderer_combo",
+{GtkCellRendererText,GtkCellRenderer,GObject},
+ {"new",{},P},
+"GtkCellRendererCombo"}
+
+widget[GtkCellRendererText] = {"gtk_cell_renderer_text",
+{GtkCellRenderer,GObject},
+ {"new",{},P},
+ {"set_fixed_height_from_font",{P,I}},
+"GtkCellRendererText"}
+
+widget[GtkCellRendererPixbuf] = {"gtk_cell_renderer_pixbuf",
+{GtkCellRenderer,GObject},
+ {"new",{},P},
+"GtkCellRendererPixbuf"}
+
+widget[GtkCellRendererProgress] = {"gtk_cell_renderer_progress",
+{GtkOrientable,GtkCellRenderer,GObject},
+ {"new",{},P},
+"GtkCellRendererProgress"}
+
+widget[GtkCellRendererSpin] = {"gtk_cell_renderer_spin",
+{GtkCellRendererText,GtkCellRenderer,GObject},
+ {"new",{},P},
+"GtkCellRendererSpin"}
+
+widget[GtkCellRendererSpinner] = {"gtk_cell_renderer_spinner",
+{GtkCellRenderer,GObject},
+ {"new",{},P},
+"GtkCellRendererSpinner"}
+
+widget[GtkCellRendererToggle] = {"gtk_cell_renderer_toggle",
+{GtkCellRenderer,GObject},
+ {"new",{},P},
+ {"set_radio",{P,B}},
+ {"get_radio",{P},B},
+ {"set_active",{P,B}},
+ {"get_active",{P},B},
+ {"set_activatable",{P,B}},
+ {"get_activatable",{P},B},
+"GtkCellRendererToggle"}
+
+widget[GtkTreeModelFilter] = {"gtk_tree_model_filter",
+{GtkTreeModel,GtkTreeDragSource,GObject},
+ {"new",{P,P},P},
+ {"set_visible_func",{P,P,P,P}},
+ {"set_modify_func",{P,I,P,P,P,P}},
+ {"set_visible_column",{P,I}},
+ {"get_model",{P},P,0,GtkTreeModel},
+ {"convert_child_iter_to_iter",{P,P,P},B},
+ {"convert_iter_to_child_iter",{P,P,P},B},
+ {"convert_child_path_to_path",{P,P},P,0,GtkTreePath},
+ {"convert_path_to_child_path",{P,P},P,0,GtkTreePath},
+ {"refilter",{P}},
+ {"clear_cache",{P}},
+"GtkTreeModelFilter"}
+
+widget[GtkTreeModelSort] = {"gtk_tree_model_sort",
+{GtkTreeSortable,GtkTreeModel,GtkTreeDragSource,GObject},
+ {"new_with_model",{P},P},
+ {"get_model",{P},P,0,GtkTreeModel},
+ {"convert_child_path_to_path",{P,P},P,0,GtkTreePath},
+ {"convert_child_iter_to_iter",{P,P,P},B},
+ {"convert_path_to_child_path",{P,P},P,0,GtkTreePath},
+ {"convert_iter_to_child_iter",{P,P,P}},
+ {"reset_default_sort_func",{P}},
+ {"clear_cache",{P}},
+"GtkTreeModelSort"}
+
+widget[GtkListStore] = {"gtk_list_store",
+{GtkTreeModel,GtkTreeSortable,GtkTreeDragSource,GtkTreeDragDest,GtkBuildable,GObject},
+ {"new",{P},-routine_id("newListStore")},
+ {"clear",{P}},
+ {"set_data",{P,P},-routine_id("ls_set_data")},
+ {"get_data",{P},-routine_id("ls_get_data")},
+ {"get_n_rows",{P},-routine_id("ls_get_n_rows")},
+ {"get_n_cols",{P},-routine_id("ls_get_n_cols")},
+ {"set_row_data",{P,I,P},-routine_id("ls_set_row_data")},
+ {"get_row_data",{P,I},-routine_id("ls_get_row_data")},
+ {"set_col_data",{P,I,I,P},-routine_id("ls_set_col_data")},
+ {"get_col_data",{P,I,I},-routine_id("ls_get_col_data")},
+ {"get_col_data_from_iter",{P,I,I},-routine_id("ls_get_col_data_from_iter")},
+ {"remove_row",{P,I},-routine_id("ls_remove_row")},
+ {"replace_row",{P,I,P},-routine_id("ls_replace_row")},
+ {"insert_row",{P,I,P},-routine_id("ls_insert_row")},
+ {"prepend_row",{P,P},-routine_id("ls_prepend_row")},
+ {"append_row",{P,P},-routine_id("ls_append_row")},
+ {"set_swap_rows",{P,I,I},-routine_id("ls_set_swap_rows")},
+ {"set_move_before",{P,I,I},-routine_id("ls_set_move_before")},
+ {"set_move_after",{P,I,I},-routine_id("ls_set_move_after")},
+"GtkListStore"}
+
+-- almost all calls to GtkListStore are overridden with Euphoria calls,
+-- because the GTK versions are just too complex and tedious to set up,
+-- making them impractical to use.
+
+constant
+ TM1 = define_func("gtk_tree_model_get_iter_first",{P,P},I),
+ TM2 = define_func("gtk_tree_model_iter_next",{P,P},I),
+ TM3 = define_func("gtk_tree_model_get_iter_from_string",{P,P,P},P),
+ TM4 = define_proc("gtk_tree_model_get",{P,P,I,P,I}),
+ TM5 = define_func("gtk_tree_model_get_column_type",{P,I},I),
+ LS0 = define_proc("gtk_list_store_clear",{P}),
+ LS1 = define_proc("gtk_list_store_insert",{P,P,I}),
+ LS2 = define_proc("gtk_list_store_append",{P,P}),
+ LS3 = define_proc("gtk_list_store_swap",{P,P,P}),
+ LS4 = define_proc("gtk_list_store_move_before",{P,P,P}),
+ LS5 = define_proc("gtk_list_store_move_after",{P,P,P}),
+ LS6 = define_func("gtk_list_store_iter_is_valid",{P,P},B)
+
+ function newListStore(object params)
+ object proto = I & repeat(P,length(params))
+ params = length(params) & params -- must build func params 'on the fly'
+ atom fn = define_func("gtk_list_store_new",proto,P)
+ return c_func(fn,params)
+ end function
+
+ function ls_get_n_rows(object store)
+ return gtk_func("gtk_tree_model_iter_n_children",{P,P},{store,0})
+ end function
+
+ function ls_get_n_cols(object store)
+ return gtk_func("gtk_tree_model_get_n_columns",{P},{store})
+ end function
+
+ function ls_set_data(object store, object data)
+ atom iter = allocate(32,1)
+ for row = 1 to length(data) do
+ c_proc(LS1,{store,iter,length(data)}) -- new row
+ if string(data[row]) then
+ ls_set_row_data(store,row,{data[row]})
+ else
+ ls_set_row_data(store,row,data[row])
+ end if
+ end for
+ return 1
+ end function
+
+ function ls_set_row_data(atom store, integer row, object data)
+ integer max_col = ls_get_n_cols(store)
+ for col = 1 to math:min({length(data),max_col}) do
+ ls_set_col_data(store,row,col,data[col])
+ end for
+ return 1
+ end function
+
+ function ls_set_col_data(object store, object row, integer col, object data)
+ integer max_col = ls_get_n_cols(store)
+
+ if col < 1 or col > max_col then
+ crash("Invalid column #%d",col)
+ end if
+
+ atom s = allocate_string(sprintf("%d",row-1),1)
+ atom iter = allocate(32,1)
+ if not c_func(TM3,{store,iter,s}) then
+ return -1
+ end if
+
+ object prototype = {P,P,I,P,I}
+
+ integer col_type = c_func(TM5,{store,col-1})
+
+ switch col_type do
+ case gSTR then prototype = {P,P,I,S,I}
+ if atom(data) then data = sprintf("%2.2f",data) end if
+ case gDBL,gFLT then prototype = {P,P,I,D,I}
+ case gPIX then prototype = {P,P,I,P,I}
+ case gINT,gBOOL then prototype = {P,P,I,I,I}
+ case else
+ display("Error in []->ls_set_col_data: col [] type [] expects [], got []",
+ {get(store,"name"),col,col_type,vlookup(col_type,storage_types,1,2,"!"),data})
+ ?1/0
+ end switch
+
+ if string(data) then
+ data = allocate_string(data) -- don't free these strings!
+ end if
+
+ atom fn = define_proc("gtk_list_store_set",prototype)
+ object params = {store,iter,col-1,data,-1}
+ c_proc(fn,params)
+
+ return 1
+ end function
+
+ function ls_get_data(object store)
+ object data = {}
+ for row = 1 to ls_get_n_rows(store) do
+ data = append(data,ls_get_row_data(store,row))
+ end for
+ return data
+ end function
+
+ function ls_get_row_data(object store, integer row)
+ object data = {}
+
+ integer max_row = ls_get_n_rows(store)
+ if row > max_row then return -1 end if
+
+ integer max_col = ls_get_n_cols(store)
+ for i = 1 to max_col do
+ data = append(data,ls_get_col_data(store,row,i))
+ end for
+ if max_col = 1 then
+ return data[1] else return data
+ end if
+ end function
+
+ function ls_get_col_data(atom store, integer row, integer col)
+ atom x = allocate(32,1)
+ object result
+
+ ifdef LISTSTORE then
+ display("Get Col Data ~ row [] col []",{row,col})
+ end ifdef
+
+ integer col_type = c_func(TM5,{store,col-1})
+ ifdef BITS64 then
+ poke8(x,col_type)
+ elsedef
+ poke4(x,col_type)
+ end ifdef
+
+ atom iter = allocate(32,1)
+
+ c_func(TM3,{store,iter,allocate_string(sprintf("%d",row-1),1)})
+ if gtk_func("gtk_list_store_iter_is_valid",{P,P},{store,iter}) = 0 then
+ display("Error in ls_get_col_data 2 ") abort(0) end if
+
+ c_proc(TM4,{store,iter,col-1,x,-1})
+ if gtk_func("gtk_list_store_iter_is_valid",{P,P},{store,iter}) = 0 then
+ display("Error in ls_get_col_data 3") abort(0) end if
+
+ switch col_type do
+ case gSTR then
+ ifdef BITS64 then -- thanks pete eberlein
+ result = peek8u(x)
+ elsedef
+ result = peek4u(x)
+ end ifdef
+ if result > 0 then
+ result = peek_string(result)
+ end if
+ case gINT then result = peek4u(x)
+ case gBOOL then result = peek(x)
+ case gDBL then result = float64_to_atom(peek({x,8}))
+ case gFLT then result = float32_to_atom(peek({x,4}))
+ case gPIX then result = peek4u(x)
+ case else display("Error in ls_get_col_data 4") abort(0)
+ end switch
+ ifdef LISTSTORE then
+ display("Result []",{result})
+ end ifdef
+ return result
+ end function
+
+ function ls_get_col_data_from_iter(atom store, atom iter, integer col)
+ atom x = allocate(64,1)
+ object result
+
+ ifdef LISTSTORE then
+ display("Get Col Data from Iter ~ store [] iter [] col []\n",{store,iter,col})
+ end ifdef
+
+ integer col_type = c_func(TM5,{store,col-1})
+ ifdef BITS64 then
+ poke8(x,col_type)
+ elsedef
+ poke4(x,col_type)
+ end ifdef
+
+ if gtk_func("gtk_list_store_iter_is_valid",{P,P},{store,iter}) = 0 then
+ display("Error in ls_get_col_datafromiter 1 ") abort(0) end if
+
+ c_proc(TM4,{store,iter,col-1,x,-1})
+
+ if gtk_func("gtk_list_store_iter_is_valid",{P,P},{store,iter}) = 0 then
+ display("Error in ls_get_col_datafromiter 2 ") abort(0) end if
+
+ switch col_type do
+ case gSTR then
+ ifdef BITS64 then -- thanks pete eberlein
+ result = peek8u(x)
+ elsedef
+ result = peek4u(x)
+ end ifdef
+ if result > 0 then
+ result = peek_string(result)
+ end if
+ case gINT then result = peek4u(x)
+ case gBOOL then result = peek(x)
+ case gDBL then result = float64_to_atom(peek({x,8}))
+ case gFLT then result = float32_to_atom(peek({x,4}))
+ case gPIX then result = peek4u(x)
+ case else display("Error in ls_get_col_datafromiter 3") abort(0)
+ end switch
+ ifdef LISTSTORE then
+ display("Result []",{result})
+ end ifdef
+ return result
+ end function
+
+ function ls_insert_row(object store, object data, integer pos)
+ object tmp = ls_get_data(store)
+ tmp = insert(tmp,data,pos)
+ set(store,"clear")
+ ls_set_data(store,tmp)
+ return tmp
+ end function
+
+ function ls_append_row(atom store, object data)
+ object tmp = ls_get_data(store)
+ tmp = append(tmp,data)
+ set(store,"clear")
+ set(store,"data",tmp)
+ return tmp
+ end function
+
+ function ls_prepend_row(atom store, object data)
+ object tmp = ls_get_data(store)
+ tmp = prepend(tmp,data)
+ set(store,"clear")
+ set(store,"data",tmp)
+ return tmp
+ end function
+
+ function ls_remove_row(atom store, integer row)
+ object tmp = ls_get_data(store)
+ tmp = remove(tmp,row)
+ set(store,"clear")
+ ls_set_data(store,tmp)
+ return tmp
+ end function
+
+ function ls_replace_row(atom store, object data, integer row)
+ object tmp = ls_get_data(store)
+ set(store,"clear")
+ tmp = replace(tmp,{data},row)
+ ls_set_data(store,tmp)
+ return tmp
+ end function
+
+ function ls_set_swap_rows(atom store, integer row_a, integer row_b)
+ if get(store,"is sorted") then
+ Warn(0,,"Can't move items in a sorted list!")
+ return -1
+ end if
+ atom iter_a = allocate(32,1), iter_b = allocate(32,1)
+ c_func(TM3,{store,iter_a,allocate_string(sprintf("%d",row_a-1),1)})
+ c_func(TM3,{store,iter_b,allocate_string(sprintf("%d",row_b-1),1)})
+ c_proc(LS3,{store,iter_a,iter_b})
+ return get(store,"data")
+ end function
+
+ function ls_set_move_before(atom store, integer row_a, integer row_b)
+ if get(store,"is sorted") then
+ Error(0,,"Can't move items in a sorted list!")
+ return -1
+ end if
+ atom iter_a = allocate(32,1), iter_b = allocate(32,1)
+ c_func(TM3,{store,iter_a,allocate_string(sprintf("%d",row_a-1),1)})
+ c_func(TM3,{store,iter_b,allocate_string(sprintf("%d",row_b-1),1)})
+ c_proc(LS4,{store,iter_b,iter_a})
+ return get(store,"data")
+ end function
+
+ function ls_set_move_after(atom store, integer row_a, integer row_b)
+ if get(store,"is sorted") then
+ Error(0,,"Can't move items in a sorted list!")
+ return -1
+ end if
+ atom iter_a = allocate(32,1), iter_b = allocate(32,1)
+ c_func(TM3,{store,iter_a,allocate_string(sprintf("%d",row_a-1),1)})
+ c_func(TM3,{store,iter_b,allocate_string(sprintf("%d",row_b-1),1)})
+ c_proc(LS5,{store,iter_b,iter_a})
+ return get(store,"data")
+ end function
+
+widget[GtkTreeStore] = {"gtk_tree_store",
+{GtkTreeModel,GtkTreeDragSource,GtkTreeDragDest,GtkTreeSortable,GtkBuildable,GObject},
+ {"new",{P},-routine_id("newTreeStore")},
+ {"get_n_rows",{P},-routine_id("ts_get_n_rows")},
+ {"get_n_cols",{P},-routine_id("ts_get_n_cols")},
+ {"get_data",{P},-routine_id("ts_get_data")},
+ {"set_data",{P,P},-routine_id("ts_set_data")},
+ {"set_row_data",{P,P,P},-routine_id("ts_set_row_data")},
+ {"remove_row",{P,I},-routine_id("ts_remove_row")},
+ {"insert_row",{P,P,P,I}},
+ {"insert_before",{P,P,P,P}},
+ {"insert_after",{P,P,P,P}},
+ {"prepend",{P,P,P}},
+ {"append",{P,P,P}},
+ {"is_ancestor",{P,P,P},B},
+ {"iter_depth",{P,P},I},
+ {"clear",{P}},
+ {"swap",{P,P,P}},
+ {"move_before",{P,P,P}},
+ {"move_after",{P,P,P}},
+"GtkTreeStore"}
+
+ function newTreeStore(object params)
+ object proto = I & repeat(P,length(params))
+ params = length(params) & params -- must build func params 'on the fly'
+ atom fn = define_func("gtk_tree_store_new",proto,P)
+ return c_func(fn,params)
+ end function
+
+ function ts_get_n_rows(object store)
+ return gtk_func("gtk_tree_model_iter_n_children",{P,P},{store,0})
+ end function
+
+ function ts_get_n_cols(object store)
+ return gtk_func("gtk_tree_model_get_n_columns",{P},{store})
+ end function
+
+ function ts_set_data(object store, object data)
+ atom iter = allocate(32,1)
+ for row = 1 to length(data) do
+ gtk_proc("gtk_tree_store_append",{P,P,P},{store,iter,0})
+ ts_set_row_data(store,data[row],iter)
+ end for
+ return 1
+ end function
+
+ constant TSA = define_proc("gtk_tree_store_append",{P,P,P})
+
+ -- the following should really be recursive, but that's too complicated
+ -- for me to figure out! Anyway, four deep should be enough.
+
+ function ts_set_row_data(atom store, object data, object parent = 0)
+ atom iter1 = allocate(32,1)
+ atom iter2 = allocate(32,1)
+ atom iter3 = allocate(32,1)
+ atom iter4 = allocate(32,1)
+ for i = 1 to length(data) do
+ if string(data[i]) then
+ ts_set_row_col_data(store,parent,i,data[i])
+ else
+ for j = 1 to length(data[i]) do
+ if string(data[i][j]) then
+ c_proc(TSA,{store,iter1,parent})
+ ts_set_row_col_data(store,iter1,1,data[i][j])
+ else
+ for k = 1 to length(data[i][j]) do
+ if string(data[i][j][k]) then
+ c_proc(TSA,{store,iter2,iter1})
+ ts_set_row_col_data(store,iter2,1,data[i][j][k])
+ else
+ for l = 1 to length(data[i][j][k]) do
+ if string(data[i][j][k][l]) then
+ c_proc(TSA,{store,iter3,iter2})
+ ts_set_row_col_data(store,iter3,1,data[i][j][k][l])
+ else
+ for m = 1 to length(data[i][j][k][l]) do
+ c_proc(TSA,{store,iter4,iter3})
+ ts_set_row_col_data(store,iter4,1,data[i][j][k][l][m])
+ end for
+ end if
+ end for
+ end if
+ end for
+ end if
+ end for
+ end if
+ end for
+ return 1
+ end function
+
+ function ts_set_row_col_data(object store, object iter, integer col, object item)
+ integer max_col = ts_get_n_cols(store)
+ if col < 1 or col > max_col then
+ crash("Invalid column #%d",col)
+ end if
+
+ object prototype = {P,P,I,P,I}
+
+ integer col_type
+
+ col_type = c_func(TM5,{store,col-1})
+ switch col_type do
+ case gDBL,gFLT then prototype = {P,P,I,D,I}
+ case gSTR, gPIX then prototype = {P,P,I,P,I}
+ case gBOOL,gINT then prototype = {P,P,I,I,I}
+ if atom(item) then item = sprintf("%g",item) end if
+ case else Warn(,,"Unknown column type",
+ "Expecting gSTR, gBOOL, gINT, gDBL, gFLT, or gPIX")
+ end switch
+
+ if string(item[1]) then item = item[1] end if
+ if string(item) then item = allocate_string(item,1) end if
+
+ atom fn = define_proc("gtk_tree_store_set",prototype)
+ object params = {store,iter,col-1,item,-1}
+ c_proc(fn,params)
+
+ return iter
+ end function
+
+ function ts_get_data(atom store)
+ object rowdata = {}
+ object column = {}
+ for row = 1 to ts_get_n_rows(store) do
+ for col = 1 to ts_get_n_cols(store) do
+ column = append(column,get(store,"col data",col))
+ end for
+ rowdata = append(rowdata,column)
+ column = {}
+ end for
+ return rowdata
+ end function
+
+ function ts_remove_row(atom store, integer row)
+ object tmp = get(store,"data")
+ tmp = remove(tmp,row)
+ set(store,"data",tmp)
+ return tmp
+ end function
+
+widget[GtkTreeDragSource] = {"gtk_tree_drag_source",
+{0},
+"GtkTreeDragSource"}
+
+widget[GtkTreeDragDest] = {"gtk_tree_drag_dest",
+{0},
+"GtkTreeDragDest"}
+
+widget[GtkTreePath] = {"gtk_tree_path",
+{GObject},
+ {"new",{P},-routine_id("newTreePath")},
+ {"to_string",{P},S},
+ {"to_integer",{P},-routine_id("tp_to_integer")},
+ {"new_first",{},P,0,GtkTreePath},
+ {"append_index",{P,I}},
+ {"prepend_index",{P,I}},
+ {"get_depth",{P},I},
+ {"get_indices",{P},A},
+ {"get_indices_with_depth",{P,I},A},
+ {"free",{P}},
+ {"copy",{P},P,0,GtkTreePath},
+ {"compare",{P,P},I},
+ {"next",{P}},
+ {"prev",{P},B},
+ {"up",{P},B},
+ {"down",{P}},
+ {"is_ancestor",{P,P},B},
+ {"is_descendant",{P,P},B},
+"GtkTreePath"}
+
+ function newTreePath(object x=0)
+ if atom(x) and x > 0 then
+ x = sprintf("%d",x-1)
+ end if
+ if string(x) then
+ x = allocate_string(x,1)
+ end if
+ if x > 0 then
+ return gtk_func("gtk_tree_path_new_from_string",{P},{x})
+ else
+ return gtk_func("gtk_tree_path_new",{},{})
+ end if
+ end function
+
+ function tp_to_integer(object x)
+ integer n = to_number(gtk_str_func("gtk_tree_path_to_string",{P},{x}))
+ return n+1
+ end function
+
+widget[GtkTreeRowReference] = {"gtk_tree_row_reference",
+{GObject},
+ {"new",{P,P},P,0,GtkTreeRowReference},
+ {"get_model",{P},P,0,GtkTreeModel},
+ {"get_path",{P},P,0,GtkTreePath},
+ {"valid",{P},B},
+ {"free",{P}},
+ {"copy",{P},P,0,GtkTreeRowReference},
+ {"inserted",{P,P}},
+ {"deleted",{P,P}},
+ {"reordered",{P,P,P,A}},
+"GtkTreeRowReference"}
+
+widget[GtkTreeIter] = {"gtk_tree_iter",
+{GObject},
+ {"new",{},-routine_id("newTreeIter")},
+ {"copy",{P},P,0,GtkTreeIter},
+ {"free",{P}},
+"GtkTreeIter"}
+
+ function newTreeIter()
+ return allocate(64) -- keep;
+ end function
+
+widget[GtkTreeModel] = {"gtk_tree_model",
+{GObject},
+ {"get_flags",{P},I},
+ {"get_n_columns",{P},I},
+ {"get_column_type",{P,I},I},
+ {"get_iter",{P,P,P},B},
+ {"get_iter_first",{P,P},B},
+ {"get_path",{P,P},P,0,GtkTreePath},
+ {"get_value",{P,P,I},-routine_id("tm_get_value")},
+ {"set_value",{P,I,I,P},-routine_id("tm_set_value")},
+ {"iter_next",{P,P},B},
+ {"iter_previous",{P,P},B},
+ {"iter_children",{P,P,P},B},
+ {"iter_has_child",{P,P},B},
+ {"iter_n_children",{P,P},I},
+ {"iter_nth_child",{P,P,P,I},B},
+ {"iter_parent",{P,P,P},B},
+ {"get_string_from_iter",{P,P},-routine_id("tm_get_string_from_iter")},
+ {"ref_node",{P,P}},
+ {"unref_node",{P,P}},
+ {"foreach",{P,P,P}},
+ {"n_rows",{P},-routine_id("tm_get_n_rows")},
+ {"row_changed",{P,P,P}},
+ {"row_inserted",{P,P,P}},
+ {"row_has_child_toggled",{P,P,P}},
+ {"row_deleted",{P,P}},
+ {"rows_reordered",{P,P,P,P}},
+ {"get_iter_n",{P,I},-routine_id("tm_get_iter_n")},
+ {"get_iter_from_string",{P,P},-routine_id("tm_get_iter_from_string")},
+ {"get_iter_from_path",{P,P},-routine_id("tm_get_iter_from_path")},
+ {"get_col_value",{P,P,I},-routine_id("tm_get_col_value")},
+ {"get_row_values",{P,P},-routine_id("tm_get_row_values")},
+ {"get_col_data",{P,P,P},-routine_id("tm_get_col_data")},
+ {"get_row_data",{P,I},-routine_id("tm_get_row_values")},
+"GtkTreeModel"}
+
+ constant
+ fntmget = define_proc("gtk_tree_model_get_value",{P,P,I,P}),
+ fncoltype = define_func("gtk_tree_model_get_column_type",{P,I},I),
+ gtvfn = define_proc("gtk_tree_model_get",{P,P,I,P,I}),
+ tmncol = define_func("gtk_tree_model_get_n_columns",{P},I)
+
+ function tm_get_n_rows(atom model)
+ atom fn = define_func("gtk_tree_model_iter_n_children",{P,P},I)
+ return c_func(fn,{model,0})
+ end function
+
+ function tm_get_string_from_iter(atom model, atom iter)
+ atom fn = define_func("gtk_tree_model_get_string_from_iter",{P,P},P)
+ return peek_string(c_func(fn,{model,iter}))
+ end function
+
+ function tm_get_iter_from_string(atom model, object str)
+ atom iter = allocate(64)
+ atom fn = define_func("gtk_tree_model_get_iter_from_string",{P,P,P},P)
+ if string(str) then str = allocate_string(str,1) end if
+ if c_func(fn,{model,iter,str}) then
+ return iter
+ end if
+ return 0
+ end function
+
+ function tm_get_iter_n(atom model, integer path)
+ return tm_get_iter_from_string(model,sprintf("%d",path-1))
+ end function
+
+ function tm_get_iter_from_path(atom model, object path)
+ return tm_get_iter_from_string(model,peek_string(path))
+ end function
+
+ function tm_get_value(atom mdl, atom iter, integer col)
+ atom x = allocate(64,1)
+ integer ct = c_func(fncoltype,{mdl,col-1})
+ object result
+
+ ifdef BITS64 then
+ poke8(x,ct)
+ elsedef
+ poke4(x,ct)
+ end ifdef
+
+ c_proc(gtvfn,{mdl,iter,col-1,x,-1})
+ switch ct do
+ case gSTR then
+ ifdef BITS64 then -- thanks pete eberlein
+ result = peek8u(x)
+ elsedef
+ result = peek4u(x)
+ end ifdef
+ if result > 0 then
+ return peek_string(result)
+ else
+ return sprintf("%d",result)
+ end if
+ case gBOOL,gINT then return peek4u(x)
+ case gFLT then return float32_to_atom(peek({x,4}))
+ case gPIX then return peek4u(x)
+ case else return sprintf("%d",x)
+ end switch
+ return sprintf("Oops %d",ct)
+ end function
+
+ function tm_get_row_values(atom mdl, atom iter)
+ integer ncols = c_func(tmncol,{mdl})
+ object results = repeat(0,ncols)
+ for n = 1 to ncols do
+ results[n] = tm_get_value(mdl,iter,n)
+ end for
+ return results
+ end function
+
+ function tm_get_col_value(atom mdl, integer row, integer col)
+ atom iter = allocate(32,1)
+ object data = tm_get_row_values(mdl,iter)
+ return data[col]
+ end function
+
+ function tm_set_col_value(atom mdl, integer row, integer col, object data)
+ atom iter = tm_get_iter_n(mdl,row)
+ atom fn = define_proc("gtk_list_store_set",{P,P,I,P,I})
+ if string(data) then data = allocate_string(data,1) end if
+ c_proc(fn,{mdl,iter,col-1,data,-1})
+ return 1
+ end function
+
+ function tm_get_col_data(atom mdl, integer row, integer col)
+ atom iter = tm_get_iter_n(mdl,row)
+ object data = tm_get_row_values(mdl,iter)
+ return data[col]
+ end function
+
+widget[GtkTreeSortable] = {"gtk_tree_sortable",
+{GtkTreeModel,GObject},
+ {"sort_column_changed",{P}},
+ {"set_sort_column_id",{P,I,I}},
+ {"get_sort_column_id",{P},-routine_id("ts_get_sort_col_id")},
+ {"get_sort_order",{P},-routine_id("ts_get_sort_order")},
+ {"is_sorted",{P},-routine_id("ts_is_sorted")},
+ {"set_sort_func",{P,I,P,P,P}},
+ {"set_default_sort_func",{P,P,P,P}},
+ {"has_default_sort_func",{P},B},
+"GtkTreeSortable"}
+
+ function ts_is_sorted(atom mdl)
+ return gtk_func("gtk_tree_sortable_get_sort_column_id",{P,P,P},{mdl,0,0})
+ end function
+
+ function ts_get_sort_col_id(atom mdl)
+ integer col = allocate(32,1), order = allocate(32,1)
+ if gtk_func("gtk_tree_sortable_get_sort_column_id",{P,P,P},{mdl,col,order}) then
+ return peek4u(col)+1
+ else
+ return -1
+ end if
+ end function
+
+ function ts_get_sort_order(atom mdl)
+ integer col = allocate(32,1), order = allocate(32,1)
+ if gtk_func("gtk_tree_sortable_get_sort_column_id",{P,P,P},{mdl,col,order}) then
+ return peek4u(order)
+ else
+ return -1
+ end if
+ end function
+
+widget[GtkViewport] = {"gtk_viewport",
+{GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkScrollable,GObject},
+ {"new",{P,P},P},
+ {"set_shadow_type",{P,I}},
+ {"get_shadow_type",{P},I},
+ {"get_bin_window",{P},P,0,GdkWindow},
+ {"get_view_window",{P},P,0,GdkWindow},
+"GtkViewport"}
+
+widget[GtkAppChooserWidget] = {"gtk_app_chooser_widget",
+{GtkBox,GtkContainer,GtkWidget,GtkBuildable,GtkOrientable,GtkAppChooser,GObject},
+ {"new",{S},P},
+ {"set_show_default",{P,B}},
+ {"get_show_default",{P},B},
+ {"set_show_recommended",{P,B}},
+ {"get_show_recommended",{P},B},
+ {"set_show_fallback",{P,B}},
+ {"get_show_fallback",{P},B},
+ {"set_show_other",{P,B}},
+ {"get_show_other",{P},B},
+ {"set_show_all",{P,B}},
+ {"get_show_all",{P},B},
+ {"set_default_text",{P,S}},
+ {"get_default_text",{P},S},
+"GtkAppChooserWidget"}
+
+widget[GtkVolumeButton] = {"gtk_volume_button",
+{GtkScaleButton,GtkButton,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkOrientable,GtkActionable,GObject},
+ {"new",{},P},
+"GtkVolumeButton"}
+
+widget[GtkColorChooserWidget] = {"gtk_color_chooser_widget",
+{GtkColorChooser,GtkBox,GtkContainer,GtkWidget,GtkBuildable,GtkOrientable,GObject},
+ {"new",{},P},
+"GtkColorChooserWidget"}
+
+widget[GtkColorChooser] = {"gtk_color_chooser",
+{GObject},
+ {"set_rgba",{P,P},-routine_id("cc_set_rgba")},
+ {"get_rgba",{P,I},-routine_id("cc_get_rgba")},
+ {"set_use_alpha",{P,B},-routine_id("cc_set_alpha")},
+ {"get_use_alpha",{P},-routine_id("cc_get_alpha")},
+ {"add_palette",{P,I,I,I,A}},
+"GtkColorChooser"}
+
+ function cc_set_rgba(atom x, object c)
+ if string(c) then
+ c = to_rgba(c)
+ else
+ c = to_rgba(text:format("#[X]",c))
+ end if
+ gtk_proc("gtk_color_chooser_set_rgba",{P,P},{x,c})
+ return 1
+ end function
+
+ function cc_get_rgba(atom x, integer fmt)
+ atom fn = define_proc("gtk_color_chooser_get_rgba",{P,P})
+ atom rgba = allocate(32,1)
+ c_proc(fn,{x,rgba})
+ object c = gtk_func("gdk_rgba_to_string",{P},{rgba})
+ return fmt_color(c,fmt)
+ end function
+
+ function cc_set_alpha(atom x, integer b)
+ gtk_proc("gtk_color_chooser_set_use_alpha",{P,B},{x,b})
+ return 1
+ end function
+
+ function cc_get_alpha(atom x)
+ atom fn = define_func("gtk_color_chooser_get_use_alpha",{P},B)
+ return c_func(fn,{x})
+ end function
+
+widget[GtkColorSelection] = {"gtk_color_selection", -- deprecated
+{GtkBox,GtkContainer,GtkWidget,GtkBuildable,GtkOrientable,GObject},
+ {"new",{},P},
+ {"set_has_opacity_control",{P,B}},
+ {"get_has_opacity_control",{P},B},
+ {"set_has_palette",{P,B}},
+ {"get_has_palette",{P},B},
+ {"set_current_rgba",{P,S},-routine_id("cs_set_current_rgba")},
+ {"get_current_rgba",{P,I},-routine_id("cs_get_current_rgba")},
+ {"set_current_alpha",{P,I}},
+ {"get_current_alpha",{P},I},
+ {"set_previous_rgba",{P,S},-routine_id("cs_set_previous_rgba")},
+ {"get_previous_rgba",{P,I},-routine_id("cs_get_previous_rgba")},
+ {"set_previous_alpha",{P,I}},
+ {"get_previous_alpha",{P},I},
+ {"is_adjusting",{P},B},
+"GtkColorSelection"}
+
+------------------------------------------------------------------------
+-- following color functions make using RGB colors much easier,
+-- converting automatically between various color notations
+------------------------------------------------------------------------
+
+ function cs_set_current_rgba(atom x, object c)
+ c =peek_string(c)
+ gtk_proc("gtk_color_selection_set_current_rgba",{P,P},{x,to_rgba(c)})
+ return 1
+ end function
+
+ function cs_set_previous_rgba(atom x, object c)
+ c = peek_string(c)
+ gtk_proc("gtk_color_selection_set_previous_rgba",{P,P},{x,to_rgba(c)})
+ return 1
+ end function
+
+ function cs_get_current_rgba(atom x, integer fmt=0)
+ atom rgba = allocate(32,1)
+ atom fn = define_proc("gtk_color_selection_get_current_rgba",{P,P})
+ c_proc(fn,{x,rgba})
+ object c = gtk_func("gdk_rgba_to_string",{P},{rgba})
+ return fmt_color(c,fmt)
+ end function
+
+ function cs_get_previous_rgba(atom x, integer fmt=0)
+ atom rgba = allocate(32,1)
+ atom fn = define_proc("gtk_color_selection_get_previous_rgba",{P,P})
+ c_proc(fn,{x,rgba})
+ object c = gtk_func("gdk_rgba_to_string",{rgba})
+ return fmt_color(c,fmt)
+ end function
+
+widget[GtkNativeDialog] = {"gtk_native_dialog",
+{},
+ {"show",{P}},
+ {"hide",{P}},
+ {"destroy",{P}},
+ {"get_visible",{P},B},
+ {"set_modal",{P,B}},
+ {"get_modal",{P},B},
+ {"set_title",{P,S}},
+ {"get_title",{P},S},
+ {"set_transient_for",{P,P}},
+ {"get_transient_for",{P},P},
+ {"run",{P}},
+"GtkNativeDialog"}
+
+widget[GtkFileChooserNative] = {"gtk_file_chooser_native",
+{},
+ {"new",{S,P,I,S,S},P},
+ {"get_accept_label",{P},S},
+ {"set_accept_label",{P,S}},
+ {"get_cancel_label",{P},S},
+ {"set_cancel_label",{P,S}},
+"GtkFileChooserNative"}
+
+widget[GtkFileChooser] = {"gtk_file_chooser",
+{GtkWidget},
+ {"set_action",{P,I}},
+ {"get_action",{P},I},
+ {"set_local_only",{P,B}},
+ {"get_local_only",{P},B},
+ {"set_select_multiple",{P,B}},
+ {"get_select_multiple",{P},B},
+ {"set_show_hidden",{P,B}},
+ {"get_show_hidden",{P},B},
+ {"set_do_overwrite_confirmation",{P,B}},
+ {"get_do_overwrite_confirmation",{P},B},
+ {"set_create_folders",{P,B}},
+ {"get_create_folders",{P},B},
+ {"get_current_name",{P},S}, --GTK3.10
+ {"set_current_name",{P,S}},
+ {"set_filename",{P,S}},
+ {"get_filename",{P},S},
+ {"get_filenames",{P},A,0,GSList},
+ {"select_filename",{P,S}},
+ {"unselect_filename",{P},S},
+ {"select_all",{P}},
+ {"unselect_all",{P}},
+ {"set_current_folder",{P,S}},
+ {"get_current_folder",{P},S},
+ {"set_uri",{P,S}},
+ {"get_uri",{P},S},
+ {"select_uri",{P,S}},
+ {"unselect_uri",{P,S}},
+ {"get_uris",{P},A,0,GSList},
+ {"set_current_folder_uri",{P,S}},
+ {"get_current_folder_uri",{P},S},
+ {"set_preview_widget",{P,P}},
+ {"get_preview_widget",{P},P,0,GtkWidget},
+ {"set_preview_widget_active",{P,B}},
+ {"get_preview_widget_active",{P},B},
+ {"set_use_preview_label",{P,B}},
+ {"get_use_preview_label",{P},B},
+ {"get_preview_filename",{P},S},
+ {"get_preview_uri",{P},S},
+ {"set_extra_widget",{P,P}},
+ {"get_extra_widget",{P},P,0,GtkWidget},
+ {"add_filter",{P,P}},
+ {"remove_filter",{P,P}},
+ {"list_filters",{P},X,0,GSList},
+ {"set_filter",{P,P}},
+ {"get_filter",{P},P,0,GtkFileFilter},
+ {"add_shortcut_folder",{P,S,P},B},
+ {"remove_shortcut_folder",{P,S,P},B},
+ {"list_shortcut_folders",{P},A,0,GSList},
+ {"add_shortcut_folder_uri",{P,S,P},B},
+ {"remove_shortcut_folder_uri",{P,S,P},B},
+ {"list_shortcut_folder_uris",{P},A,0,GSList},
+ {"get_current_folder_file",{P},P,0,GFile},
+ {"get_file",{P},P,0,GFile},
+ {"get_files",{P},X,0,GFile},
+ {"get_preview_file",{P},P,0,GFile},
+ {"select_file",{P,P,P},B},
+ {"set_current_folder_file",{P,P,P},B},
+ {"set_file",{P,P,P},B},
+ {"unselect_file",{P,P}},
+"GtkFileChooser"}
+
+widget[GtkFileChooserButton] = {"gtk_file_chooser_button",
+{GtkFileChooser,GtkBox,GtkContainer,GtkWidget,GtkBuildable,GtkOrientable,GObject},
+ {"new",{S,I},P},
+ {"new_with_dialog",{P},P},
+ {"set_title",{P,S}},
+ {"get_title",{P},S},
+ {"set_width_chars",{P,I}},
+ {"get_width_chars",{P},I},
+ {"set_focus_on_click",{P,B}},
+ {"get_focus_on_click",{P},B},
+"GtkFileChooserButton"}
+
+widget[GtkFileChooserWidget] = {"gtk_file_chooser_widget",
+{GtkFileChooser,GtkBox,GtkContainer,GtkWidget,GtkBuildable,GtkOrientable,GObject},
+ {"new",{I},P},
+"GtkFileChooserWidget"}
+
+widget[GtkFileFilter] = {"gtk_file_filter",
+{GtkBuildable,GObject},
+ {"new",{},P},
+ {"set_name",{P,S}},
+ {"get_name",{P},S},
+ {"add_mime_type",{P,S}},
+ {"add_pattern",{P,S}},
+ {"add_pixbuf_formats",{P}},
+ {"add_custom",{P,I,P,P,P}},
+ {"get_needed",{P},I},
+ {"filter",{P,P},B},
+"GtkFileFilter"}
+
+widget[GtkFontChooser] = {"gtk_font_chooser",
+{GObject},
+ {"get_font_family",{P},P,0,PangoFontFamily},
+ {"get_font_face",{P},P,0,PangoFontFace},
+ {"get_font_size",{P},I},
+ {"set_font",{P,S}},
+ {"get_font",{P},S},
+ {"set_font_desc",{P,P}},
+ {"get_font_desc",{P},P,0,PangoFontDescription},
+ {"set_preview_text",{P,S}},
+ {"get_preview_text",{P},S},
+ {"set_show_preview_entry",{P,B}},
+ {"get_show_preview_entry",{P},B},
+ {"set_filter_func",{P,P,P,P}},
+ {"get_font_map",{P},P,0,PangoFontMap}, -- 3.18
+ {"set_font_map",{P,P}}, -- 3.18
+"GtkFontChooser"}
+
+widget[GtkFontChooserWidget] = {"gtk_font_chooser_widget",
+{GtkFontChooser,GtkBox,GtkContainer,GtkWidget,GtkBuildable,GtkOrientable,GObject},
+ {"new",{},P},
+"GtkFontChooserWidget"}
+
+widget[GtkInfoBar] = {"gtk_info_bar",
+{GtkBox,GtkContainer,GtkWidget,GtkBuildable,GtkOrientable,GObject},
+ {"new",{},P},
+ {"add_action_widget",{P,P,I}},
+ {"add_button",{P,S,I},P,0,GtkButton},
+ {"set_response_sensitive",{P,I,B}},
+ {"set_default_response",{P,I}},
+ {"response",{P,I}},
+ {"set_message_type",{P,I}},
+ {"get_message_type",{P},I},
+ {"get_action_area",{P},P,0,GtkWidget},
+ {"get_content_area",{P},P,0,GtkWidget},
+ {"set_show_close_button",{P,B}}, -- 3.10
+ {"get_show_close_button",{P},B}, -- 3.10
+"GtkInfoBar"}
+
+widget[GtkRecentChooser] = {"gtk_recent_chooser",
+{GObject},
+ {"set_show_private",{P,B}},
+ {"get_show_private",{P},B},
+ {"set_show_not_found",{P,B}},
+ {"get_show_not_found",{P},B},
+ {"set_show_icons",{P,B}},
+ {"get_show_icons",{P},B},
+ {"set_select_multiple",{P,B}},
+ {"get_select_multiple",{P},B},
+ {"set_local_only",{P,B}},
+ {"get_local_only",{P},B},
+ {"set_limit",{P,I}},
+ {"get_limit",{P},I},
+ {"set_show_tips",{P,B}},
+ {"get_show_tips",{P},B},
+ {"set_sort_type",{P,I}},
+ {"get_sort_type",{P},I},
+ {"set_sort_func",{P,P,P,P}},
+ {"set_current_uri",{P,S,P},B},
+ {"get_current_uri",{P},S},
+ {"get_current_item",{P},P,0,GtkRecentInfo},
+ {"select_uri",{P,S,P},B},
+ {"unselect_uri",{P,S}},
+ {"select_all",{P}},
+ {"unselect_all",{P}},
+ {"get_items",{P},A,0,GSList},
+ {"get_uris",{P},A},
+ {"add_filter",{P,P}},
+ {"remove_filter",{P,P}},
+ {"list_filters",{P},X,0,GSList},
+ {"set_filter",{P,P}},
+ {"get_filter",{P},P,0,GtkRecentFilter},
+"GtkRecentChooser"}
+
+widget[GtkRecentChooserWidget] = {"gtk_recent_chooser_widget",
+{GtkBox,GtkContainer,GtkWidget,GtkBuildable,GtkOrientable,GtkRecentChooser,GObject},
+ {"new",{P},-routine_id("newRecentChooserWidget")},
+"GtkRecentChooserWidget"}
+
+ function newRecentChooserWidget(atom x=0)
+ if class_id(x) = GtkRecentManager then
+ return gtk_func("gtk_recent_chooser_widget_new_for_manager",{P},{x})
+ else
+ return gtk_func("gtk_recent_chooser_widget_new")
+ end if
+ end function
+
+widget[GtkStatusbar] = {"gtk_statusbar",
+{GtkBox,GtkContainer,GtkWidget,GtkBuildable,GtkOrientable,GObject},
+ {"new",{},P},
+ {"get_context_id",{P,S},I},
+ {"push",{P,I,S},I},
+ {"pop",{P,I}},
+ {"remove",{P,I,I}},
+ {"remove_all",{P,I}},
+ {"get_message_area",{P},P},
+"GtkStatusBar"}
+
+widget[GtkFixed] = {"gtk_fixed",
+{GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"put",{P,P,I,I}},
+ {"move",{P,P,I,I}},
+"GtkFixed"}
+
+widget[GtkGrid] = {"gtk_grid",
+{GtkContainer,GtkWidget,GtkBuildable,GtkOrientable,GObject},
+ {"new",{},P},
+ {"attach",{P,P,I,I,I,I}},
+ {"attach_next_to",{P,P,P,I,I,I}},
+ {"get_child_at",{P,I,I},P,0,GtkWidget},
+ {"insert_row",{P,I}},
+ {"remove_row",{P,I}}, --3.10
+ {"insert_column",{P,I}},
+ {"remove_column",{P,I}}, --3.10
+ {"insert_next_to",{P,P,I}},
+ {"set_row_homogeneous",{P,B}},
+ {"get_row_homogeneous",{P},B},
+ {"set_column_homogeneous",{P,B}},
+ {"get_column_homogeneous",{P},B},
+ {"set_row_spacing",{P,I}},
+ {"get_row_spacing",{P},I},
+ {"set_column_spacing",{P,I}},
+ {"get_column_spacing",{P},I},
+ {"set_baseline_row",{P,I}}, --3.10
+ {"get_baseline_row",{P},I}, --3.10
+ {"set_row_baseline_position",{P,I,I}}, --3.10
+ {"get_row_baseline_position",{P,I},I}, --3.10
+"GtkGrid"}
+
+widget[GtkPaned] = {"gtk_paned",
+{GtkContainer,GtkWidget,GtkBuildable,GtkOrientable,GObject},
+ {"new",{I},P},
+ {"add1",{P,P}},
+ {"add2",{P,P}},
+ {"pack1",{P,P,B,B}},
+ {"pack2",{P,P,B,B}},
+ {"get_child1",{P},P,0,GtkWidget},
+ {"get_child2",{P},P,0,GtkWidget},
+ {"set_position",{P,I}},
+ {"get_position",{P},I},
+ {"get_handle_window",{P},P,0,GdkWindow},
+ {"get_wide_handle",{P},B}, -- 3.16
+ {"set_wide_handle",{P,B}}, -- 3.16
+"GtkPaned"}
+
+widget[GtkIconInfo] = {"gtk_icon_info",
+{GObject},
+ {"new",{P,P},-routine_id("newIconInfo")},
+ {"get_base_size",{P},I},
+ {"get_base_scale",{P},I}, --3.10
+ {"get_filename",{P},S},
+ {"get_display_name",{P},S}, -- deprecated 3.14
+ {"get_builtin_pixbuf",{P},P,0,GdkPixbuf}, -- deprecated 3.14
+ {"load_icon",{P},-routine_id("icon_info_load_icon")},
+ {"load_surface",{P,P,P},P,0,CairoSurface_t},
+ {"load_icon_async",{P,P,P,P}},
+ {"load_icon_finish",{P,P,P},P,0,GdkPixbuf},
+ {"load_symbolic",{P,P,P,P,P,B,P},P,0,GdkPixbuf},
+ {"load_symbolic_async",{P,P,P,P,P,P,P,P}},
+ {"load_symbolic_finish",{P,P,P,P},P,0,GdkPixbuf},
+ {"load_symbolic_for_context",{P,P,P,P},P,0,GdkPixbuf},
+ {"load_symbolic_for_context_async",{P,P,P,P,P}},
+ {"load_symbolic_for_context_finish",{P,P,P,P},P,0,GdkPixbuf},
+ {"set_raw_coordinates",{P,B}}, -- deprecated 3.14
+ {"get_embedded_rect",{P,P},B}, -- deprecated 3.14
+ {"get_attach_points",{P,A,P},B}, -- deprecated 3.14
+ {"is_symbolic",{P},B}, -- 3.12
+"GtkIconInfo"}
+
+ function newIconInfo(atom theme, atom pix) -- reorder params;
+ return gtk_func("gtk_icon_info_new_for_pixbuf",{P,P},{theme,pix})
+ end function
+
+ function icon_info_load_icon(atom info) -- allow for err, register object;
+ atom err = allocate(8,1) err = 0
+ atom icn = gtk_func("gtk_icon_info_load_icon",{P,P},{info,err})
+ register(icn,GdkPixbuf)
+ return icn
+ end function
+
+widget[GtkIconTheme] = {"gtk_icon_theme",
+{GObject},
+ {"new",{P},-routine_id("newIconTheme")},
+ {"set_screen",{P,P}},
+ {"set_search_path",{P,S,I}},
+ {"get_search_path",{P,P,I}},
+ {"append_search_path",{P,S}},
+ {"prepend_search_path",{P,S}},
+ {"set_custom_theme",{P,S}},
+ {"has_icon",{P,S},B},
+ {"lookup_icon",{P,P,I,I},P,0,GtkIconInfo},
+ {"lookup_icon_for_scale",{P,P,I,I,I},P,0,GtkIconInfo},
+ {"choose_icon",{P,A,I,I},P,0,GtkIconInfo},
+ {"choose_icon_for_scale",{P,A,I,I,I},P,0,GtkIconInfo},
+ {"lookup_by_gicon",{P,P,I,I},P,0,GtkIconInfo},
+ {"load_icon",{P,S,I,I},-routine_id("icon_theme_load_icon")},
+ {"load_icon_for_scale",{P,S,I,I,I,P},P,0,GdkPixbuf},
+ {"load_surface",{P,S,I,I,P,I,P},P,0,CairoSurface_t},
+ {"list_contexts",{P},-routine_id("icon_theme_list_contexts")},
+ {"list_icons",{P,S},-routine_id("icon_theme_list_icons")},
+ {"get_icon_sizes",{P,S},A},
+ {"rescan_if_needed",{P},B},
+ {"get_example_icon_name",{P},S},
+ {"add_builtin_icon",{S,I,P}},
+ {"add_resource_path",{P,S}}, -- 3.14
+"GtkIconTheme"}
+
+ function newIconTheme(atom x=0)
+ if class_id(x) = GdkScreen then
+ return gtk_func("gtk_icon_theme_get_for_screen",{P},{x})
+ else
+ return gtk_func("gtk_icon_theme_get_default")
+ end if
+ end function
+
+ function icon_theme_load_icon(atom theme, object name, integer size, integer flags)
+ atom err = allocate(8,1) err = 0
+ return gtk_func("gtk_icon_theme_load_icon",{P,P,I,I,P},{theme,name,size,flags,err})
+ end function
+
+ function icon_theme_list_contexts(atom theme)
+ object list = gtk_func("gtk_icon_theme_list_contexts",{P},{theme})
+ return to_sequence(list)
+ end function
+
+ function icon_theme_list_icons(atom theme, object context)
+ object list = gtk_func("gtk_icon_theme_list_icons",{P,P},{theme,context})
+ return to_sequence(list)
+ end function
+
+widget[GtkIconView] = {"gtk_icon_view",
+{GtkCellLayout,GtkScrollable,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"new_with_area",{P},P},
+ {"new_with_model",{P},P},
+ {"set_model",{P,P}},
+ {"get_model",{P},P,0,GtkTreeModel},
+ {"set_text_column",{P,I}},
+ {"get_text_column",{P},I},
+ {"set_markup_column",{P,I}},
+ {"get_markup_column",{P},I},
+ {"set_pixbuf_column",{P,I}},
+ {"get_pixbuf_column",{P},I},
+ {"get_visible_range",{P,I,I},B},
+ {"get_path_at_pos",{P,I,I},P,0,GtkTreePath},
+ {"get_item_at_pos",{P,I,I,I,I},B},
+ {"convert_widget_to_bin_window_coords",{P,I,I,I,I}},
+ {"set_cursor",{P,P,P,B}},
+ {"get_cursor",{P,I,I},B},
+ {"selected_foreach",{P,P,P}},
+ {"set_selection_mode",{P,I}},
+ {"get_selection_mode",{P},I},
+ {"set_columns",{P,I}},
+ {"get_columns",{P},I},
+ {"set_spacing",{P,I}},
+ {"get_spacing",{P},I},
+ {"set_row_spacing",{P,I}},
+ {"get_row_spacing",{P},I},
+ {"set_column_spacing",{P,I}},
+ {"get_column_spacing",{P},I},
+ {"set_margin",{P,I}},
+ {"get_margin",{P},I},
+ {"set_item_padding",{P,I}},
+ {"get_item_padding",{P},I},
+ {"set_activate_on_single_click",{P,B}}, --3.8
+ {"get_activate_on_single_click",{P},B}, --3.8
+ {"get_cell_rect",{P,P,P,P},B}, --3.6
+ {"select_path",{P,P}},
+ {"unselect_path",{P,P}},
+ {"path_is_selected",{P,P},B},
+ {"get_selected_items",{P},X,0,GList},
+ {"select_all",{P}},
+ {"unselect_all",{P}},
+ {"item_activated",{P,P}},
+ {"scroll_to_path",{P,P,B,F,F}},
+ {"get_visible_range",{P,I,I},B},
+ {"set_tooltip_item",{P,P,P}},
+ {"set_tooltip_cell",{P,P,P,P}},
+ {"get_tooltip_context",{P,I,I,B,P,P,P},B},
+ {"set_tooltip_column",{P,I}},
+ {"get_tooltip_column",{P},I},
+ {"get_item_row",{P,P},I},
+ {"get_item_column",{P,P},I},
+ {"enable_model_drag_source",{P,I,P,I,I}},
+ {"enable_model_drag_dest",{P,P,I,I}},
+ {"unset_model_drag_source",{P}},
+ {"unset_model_drag_dest",{P}},
+ {"set_reorderable",{P,B}},
+ {"get_reorderable",{P},B},
+ {"set_drag_dest_item",{P,I,I}},
+ {"get_drag_dest_item",{P,I,I}},
+ {"get_dest_item_at_pos",{P,I,I,I,I},B},
+ {"create_drag_icon",{P,P},P,0,CairoSurface_t},
+"GtkIconView"}
+
+widget[GtkLayout] = {"gtk_layout",
+{GtkContainer,GtkWidget,GtkBuildable,GtkScrollable,GObject},
+ {"new",{P,P},P},
+ {"put",{P,P,I,I}},
+ {"move",{P,P,I,I}},
+ {"set_size",{P,I,I}},
+ {"get_size",{P,I,I}},
+ {"get_bin_window",{P},P,0,GdkWindow},
+"GtkLayout"}
+
+widget[GtkSeparatorMenuItem] = {"gtk_separator_menu_item",
+{GtkMenuItem,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkActionable,GObject},
+ {"new",{},P},
+"GtkSeparatorMenuItem"}
+
+widget[GtkRecentChooserMenu] = {"gtk_recent_chooser_menu",
+{GtkMenu,GtkMenuShell,GtkContainer,GtkWidget,GtkBuildable,GtkRecentChooser,GObject},
+ {"new",{},P},
+ {"new_for_manager",{P},P},
+ {"set_show_numbers",{P,B}},
+ {"get_show_numbers",{P},B},
+"GtkRecentChooserMenu"}
+
+widget[GtkRecentFilter] = {"gtk_recent_filter",
+{GtkBuildable,GObject},
+ {"new",{},P},
+ {"set_name",{P,S}},
+ {"get_name",{P},S},
+ {"add_mime_type",{P,S}},
+ {"add_pattern",{P,S}},
+ {"add_pixbuf_formats",{P}},
+ {"add_group",{P,S}},
+ {"add_age",{P,I}},
+ {"add_application",{P,S}},
+ {"add_custom",{P,I,P,P,P}},
+ {"get_needed",{P},I},
+ {"filter",{P,P},B},
+"GtkRecentFilter"}
+
+widget[GtkRecentInfo] = {"gtk_recent_info",
+{GObject},
+ {"get_uri",{P},S},
+ {"get_display_name",{P},S},
+ {"get_description",{P},S},
+ {"get_mime_type",{P},S},
+ {"get_added",{P},I},
+ {"get_modified",{P},I},
+ {"get_visited",{P},I},
+ {"get_private_hint",{P},B},
+ {"get_application_info",{P,S,S,I,I},B},
+ {"get_applications",{P,I},V},
+ {"last_application",{P},S},
+ {"has_application",{P,S},B},
+ {"create_app_info",{P,S,P},P,0,GAppInfo},
+ {"get_groups",{P,I},A},
+ {"has_group",{P,S},B},
+ {"get_icon",{P,I},P,0,GdkPixbuf},
+ {"get_gicon",{P},P,0,GIcon},
+ {"get_short_name",{P},S},
+ {"get_uri_display",{P},S},
+ {"get_age",{P},I},
+ {"is_local",{P},B},
+ {"exists",{P},B},
+ {"match",{P,P},B},
+"GtkRecentInfo"}
+
+widget[GtkSettings] = {"gtk_settings",
+{GtkStyleProvider,GObject},
+ {"new",{},-routine_id("newSettings")},
+ {"reset_property",{P,S}}, -- 3.20
+"GtkSettings"}
+
+ function newSettings(atom x=0)
+ if class_id(x) = GdkScreen then
+ return gtk_func("gtk_settings_get_for_screen",{P},{x})
+ else
+ return gtk_func("gtk_settings_get_default")
+ end if
+ end function
+
+widget[GtkSizeGroup] = {"gtk_size_group",
+{GtkBuildable,GObject},
+ {"new",{I},P},
+ {"set_mode",{P,I}},
+ {"get_mode",{P},I},
+ {"set_ignore_hidden",{P,B}},
+ {"get_ignore_hidden",{P},B},
+ {"add_widget",{P,P}},
+ {"add_widgets",{P,P},-routine_id("sg_add_widgets")},
+ {"remove_widget",{P,P}},
+ {"get_widgets",{P},X,0,GSList},
+"GtkSizeGroup"}
+
+ function sg_add_widgets(atom group, object widgets) -- allow {list} of widgets;
+ if atom(widgets) then
+ set(group,"add widget",widgets)
+ else
+ for i = 1 to length(widgets) do
+ set(group,"add widget",widgets[i])
+ end for
+ end if
+ return 1
+ end function
+
+widget[GtkTargetEntry] = {"gtk_target_entry",
+{GObject},
+ {"new",{S,I,I},P},
+ {"copy",{P},P,0,GtkTargetEntry},
+ {"free",{P}},
+"GtkTargetEntry"}
+
+widget[GtkTargetList] = {"gtk_target_list",
+{GObject},
+ {"new",{P,I},P},
+ {"add",{P,P,I,I}},
+ {"add_table",{P,P,I}},
+ {"add_text_targets",{P,I}},
+ {"add_image_targets",{P,I,B}},
+ {"add_uri_targets",{P,I}},
+ {"add_rich_text_targets",{P,I,B,P}},
+ {"remove",{P,P}},
+ {"find",{P,P,P},B},
+"GtkTargetList"}
+
+widget[GtkTextChildAnchor] = {"gtk_text_child_anchor",
+{GObject},
+ {"new",{},P},
+ {"get_deleted",{P},B},
+ {"get_widgets",{P},X,0,GList},
+"GtkTextChildAnchor"}
+
+widget[GtkTextMark] = {"gtk_text_mark",
+{GObject},
+ {"new",{S,B},P},
+ {"set_visible",{P,B}},
+ {"get_visible",{P},B},
+ {"get_deleted",{P},B},
+ {"get_name",{P},S},
+ {"get_buffer",{P},P,0,GtkTextBuffer},
+ {"get_left_gravity",{P},B},
+"GtkTextMark"}
+
+widget[GtkTextTag] = {"gtk_text_tag",
+{GObject},
+ {"new",{S},P},
+ {"set_priority",{P,I}},
+ {"get_priority",{P},I},
+ {"event",{P,P,P,P},B},
+ {"changed",{P,B}}, -- 3.20
+"GtkTextTag"}
+
+widget[GtkTextAttributes] = {"gtk_text_attributes",
+{GObject},
+ {"new",{},P},
+ {"copy",{P},P,0,GtkTextAttributes},
+ {"copy_values",{P,P}},
+"GtkTextAttributes"}
+
+widget[GtkTextTagTable] = {"gtk_text_tag_table",
+{GtkBuildable,GObject},
+ {"new",{},P},
+ {"add",{P,P}},
+ {"remove",{P,P}},
+ {"lookup",{P,S},P,0,GtkTextTag},
+ {"foreach",{P,P,P}},
+ {"get_size",{P},I},
+"GtkTextTagTable"}
+
+widget[GtkMenuShell] = {"gtk_menu_shell",
+{GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"append",{P,P},-routine_id("ms_append")},
+ {"prepend",{P,P}},
+ {"insert",{P,P,I}},
+ {"deactivate",{P}},
+ {"select_item",{P,P}},
+ {"select_first",{P,B}},
+ {"deselect",{P}},
+ {"activate_item",{P,P,B}},
+ {"cancel",{P}},
+ {"set_take_focus",{P,B}},
+ {"get_take_focus",{P},B},
+ {"get_selected_item",{P},P,0,GtkWidget},
+ {"get_parent_shell",{P},P,0,GtkWidget},
+ {"bind_model",{P,P,S,B}}, --3.6
+"GtkMenuShell"}
+
+ function ms_append(atom menu, object items) -- allow {list} of items;
+ if atom(items) then
+ gtk_proc("gtk_menu_shell_append",{P,P},{menu,items})
+ else
+ for i = 1 to length(items) do
+ ms_append(menu,items[i])
+ end for
+ end if
+ return 1
+ end function
+
+widget[GtkNotebook] = {"gtk_notebook",
+{GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"append_page",{P,P,P},I},
+ {"append_page_menu",{P,P,P,P},I},
+ {"prepend_page",{P,P,P},I},
+ {"prepend_page_menu",{P,P,P,P},I},
+ {"insert_page",{P,P,P,I},I},
+ {"insert_page_menu",{P,P,P,P,I},I},
+ {"remove_page",{P,I}},
+ {"page_num",{P,I},I},
+ {"next_page",{P}},
+ {"prev_page",{P}},
+ {"reorder_child",{P,P,I}},
+ {"set_tab_pos",{P,I}},
+ {"get_tab_pos",{P},I},
+ {"set_show_tabs",{P,B}},
+ {"get_show_tabs",{P},B},
+ {"set_show_border",{P,B}},
+ {"get_show_border",{P},B},
+ {"set_scrollable",{P,B}},
+ {"get_scrollable",{P},B},
+ {"popup_enable",{P}},
+ {"popup_disable",{P}},
+ {"get_current_page",{P},I},
+ {"set_menu_label",{P,P},0,GtkWidget},
+ {"get_menu_label",{P,P},P},
+ {"get_menu_label_text",{P,P},S},
+ {"get_n_pages",{P},I},
+ {"get_nth_page",{P,I},P,0,GtkWidget},
+ {"set_tab_label",{P,P}},
+ {"get_tab_label",{P,P},P,0,GtkWidget},
+ {"set_tab_label_text",{P,P,S}},
+ {"get_tab_label_text",{P,P},S},
+ {"set_tab_detachable",{P,P,B}},
+ {"get_tab_detachable",{P,P},B},
+ {"set_current_page",{P,I}},
+ {"set_group_name",{P,S}},
+ {"get_group_name",{P},S},
+ {"set_action_widget",{P,P,I}},
+ {"get_action_widget",{P,I},P,0,GtkWidget},
+ {"detach_tab",{P,P}}, -- 3.16
+"GtkNotebook"}
+
+widget[GtkSocket] = {"gtk_socket",
+{GtkContainer,GtkWidget,GObject},
+ {"new",{},P},
+ {"add_id",{P,P}},
+ {"get_id",{P},P},
+ {"get_plug_window",{P},P,0,GdkWindow},
+"GtkSocket"}
+
+widget[GtkPlug] = {"gtk_plug",
+{GtkWindow,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{I},P},
+ {"get_id",{P},I},
+ {"get_embedded",{P},B},
+ {"get_socket_window",{P},P,0,GdkWindow},
+"GtkPlug"}
+
+widget[GtkToolPalette] = {"gtk_tool_palette",
+{GtkScrollable,GtkContainer,GtkWidget,GtkBuildable,GtkOrientable,GObject},
+ {"new",{},P},
+ {"set_exclusive",{P,P,B}},
+ {"get_exclusive",{P,P},B},
+ {"set_expand",{P,P,B}},
+ {"get_expand",{P,P},B},
+ {"set_group_position",{P,P,I}},
+ {"get_group_position",{P,P},I},
+ {"set_icon_size",{P,I}},
+ {"get_icon_size",{P},I},
+ {"unset_icon_size",{P}},
+ {"set_style",{P,I}},
+ {"get_style",{P},I},
+ {"unset_style",{P}},
+ {"add_drag_dest",{P,P,I,I,I}},
+ {"get_drag_item",{P,P},P,0,GtkWidget},
+ {"get_drop_group",{P,I,I},P,0,GtkToolItemGroup},
+ {"set_drag_source",{P,I}},
+"GtkToolPalette"}
+
+widget[GtkTextView] = {"gtk_text_view",
+{GtkScrollable,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"new_with_buffer",{P},P},
+ {"set_buffer",{P,P}},
+ {"get_buffer",{P},P,0,GtkTextBuffer},
+ {"scroll_to_mark",{P,P,D,B,D,D}},
+ {"scroll_to_iter",{P,P,D,B,D,D},B},
+ {"scroll_mark_onscreen",{P,P}},
+ {"place_cursor_onscreen",{P},B},
+ {"get_visible_rect",{P,P}},
+ {"get_iter_location",{P,P,P}},
+ {"get_cursor_locations",{P,P,P,P}},
+ {"get_line_at_y",{P,P,I,I}},
+ {"get_line_yrange",{P,P,I,I}},
+ {"get_iter_at_location",{P,P,I,I}},
+ {"get_iter_at_position",{P,P,I,I,I}},
+ {"buffer_to_window_coords",{P,P,I,I,I,I}},
+ {"window_to_buffer_coords",{P,P,I,I,I,I}},
+ {"get_window",{P,I},P,0,GdkWindow},
+ {"set_border_window_size",{P,I,I}},
+ {"get_border_window_size",{P,P},I},
+ {"forward_display_line",{P,P},B},
+ {"backward_display_line",{P,P},B},
+ {"forward_display_line_end",{P,P},B},
+ {"backward_display_line_start",{P,P},B},
+ {"starts_display_line",{P,P},B},
+ {"move_visually",{P,P,I},B},
+ {"add_child_at_anchor",{P,P,P}},
+ {"add_child_in_window",{P,P,P,I,I}},
+ {"move_child",{P,P,I,I}},
+ {"set_wrap_mode",{P,I}},
+ {"get_wrap_mode",{P},I},
+ {"set_editable",{P,B}},
+ {"get_editable",{P},B},
+ {"set_cursor_visible",{P,B}},
+ {"get_cursor_visible",{P},B},
+ {"set_overwrite",{P,B}},
+ {"get_overwrite",{P},B},
+ {"set_pixels_above_lines",{P,I}},
+ {"get_pixels_above_lines",{P},I},
+ {"set_pixels_below_lines",{P,I}},
+ {"get_pixels_below_lines",{P},I},
+ {"set_pixels_inside_wrap",{P,I}},
+ {"get_pixels_inside_wrap",{P},I},
+ {"set_justification",{P,I}},
+ {"get_justification",{P},I},
+ {"set_left_margin",{P,I}},
+ {"get_left_margin",{P},I},
+ {"set_right_margin",{P,I}},
+ {"get_right_margin",{P},I},
+ {"set_indent",{P,I}},
+ {"get_indent",{P},I},
+ {"set_tabs",{P,A}},
+ {"get_tabs",{P},A,0,PangoTabArray},
+ {"set_accepts_tab",{P,B}},
+ {"get_accepts_tab",{P},B},
+ {"im_context_filter_keypress",{P,P},B},
+ {"get_default_attributes",{P},P,0,GtkTextAttributes},
+ {"reset_im_context",{P}},
+ {"set_input_purpose",{P,I}}, -- 3.6+
+ {"get_input_purpose",{P},I}, -- 3.6+
+ {"set_input_hints",{P,I}}, -- 3.6+
+ {"get_input_hints",{P},I}, -- 3.6+
+ {"get_monospace",{P},B}, -- 3.16
+ {"set_monospace",{P,B}}, -- 3.16
+ {"get_bottom_margin",{P},I}, -- 3.18
+ {"set_bottom_margin",{P,I}}, -- 3.18
+ {"get_top_margin",{P},I}, -- 3.18
+ {"set_top_margin",{P,I}}, -- 3.18
+ {"reset_cursor_blink",{P}}, -- 3.20
+"GtkTextView"}
+
+widget[GtkToolShell] = {"gtk_tool_shell", -- WARNING!
+{GtkWidget}, -- see GTK3 docs re: GtkToolShell functions
+ {"get_ellipsize_mode",{P},I},
+ {"get_icon_size",{P},I},
+ {"get_orientation",{P},I},
+ {"get_relief_style",{P},I},
+ {"get_style",{P},I},
+ {"get_text_alignment",{P},F},
+ {"get_text_orientation",{P},I},
+ {"get_text_size_group",{P},P,0,GtkSizeGroup},
+ {"rebuild_menu",{P}},
+"GtkToolShell"}
+
+widget[GtkToolbar] = {"gtk_toolbar",
+{GtkToolShell,GtkContainer,GtkWidget,GtkOrientable,GtkBuildable,GObject},
+ {"new",{},P},
+ {"insert",{P,P,I}},
+ {"get_item_index",{P,P},I},
+ {"get_n_items",{P},I},
+ {"get_nth_item",{P},P},
+ {"get_drop_index",{P,I,I},I},
+ {"set_drop_highlight_item",{P,P,I}},
+ {"set_show_arrow",{P,B}},
+ {"get_show_arrow",{P},B},
+ {"set_icon_size",{P,I}},
+ {"get_icon_size",{P},I},
+ {"unset_icon_size",{P}},
+ {"set_style",{P,I}},
+ {"get_style",{P},I},
+ {"unset_style",{P}},
+"GtkToolbar"}
+
+widget[GtkToolItemGroup] = {"gtk_tool_item_group",
+{GtkToolShell,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{S},P},
+ {"set_collapsed",{P,B}},
+ {"get_collapsed",{P},B},
+ {"set_ellipsize",{P,I}},
+ {"get_ellipsize",{P},I},
+ {"get_drop_item",{P,I,I},P,0,GtkToolItem},
+ {"get_n_items",{P},I},
+ {"get_nth_item",{P,I},P,0,GtkToolItem},
+ {"set_label",{P,S}},
+ {"get_label",{P},S},
+ {"set_label_widget",{P,P}},
+ {"get_label_widget",{P},P,0,GtkWidget},
+ {"set_header_relief",{P,I}},
+ {"get_header_relief",{P},I},
+ {"insert",{P,P,I}},
+ {"set_item_position",{P,P,I}},
+"GtkToolItemGroup"}
+
+widget[GtkTooltip] = {"gtk_tooltip",
+{GObject},
+ {"set_text",{P,S}},
+ {"set_markup",{P,S}},
+ {"set_icon",{P,P}},
+ {"set_icon_from_icon_name",{P,S,I}},
+ {"set_icon_from_gicon",{P,P,I}},
+ {"set_custom",{P,P}},
+ {"trigger_tooltip_query",{P}},
+ {"set_tip_area",{P,P}},
+"GtkTooltip"}
+
+function newColumn(object params)
+ params = keyvalues(params)
+ atom c = create(GtkTreeViewColumn)
+ atom r = -1
+ object t = vlookup("type",params,1,2)
+
+ switch t do
+ case "text","markup" then r = create(GtkCellRendererText)
+ case "pixbuf" then r = create(GtkCellRendererPixbuf)
+ case "progress" then r = create(GtkCellRendererProgress)
+ case "spin" then r = create(GtkCellRendererSpin)
+ case "toggle" then r = create(GtkCellRendererToggle)
+ case "combo" then r = create(GtkCellRendererCombo)
+ case else display("Error specifying cell renderer type")
+ end switch
+
+ if r = -1 then
+ Warn(,,"Create new column","Must specify a renderer type (i.e. type=text)")
+ abort(1)
+ end if
+
+ set(c,{{"pack start",r,TRUE}})
+
+ for i = 1 to length(params) do
+
+ if equal("TRUE",params[i][2]) then params[i][2] = 1 end if
+ if equal("FALSE",params[i][2]) then params[i][2] = 0 end if
+ if equal("1",params[i][2]) then params[i][2] = 1 end if
+ if equal("0",params[i][2]) then params[i][2] = 0 end if
+
+ if match("column.",params[i][1]) then
+ set(c,params[i][1][8..$],params[i][2])
+
+ elsif match("renderer.",params[i][1]) then
+ set(r,params[i][1][10..$],params[i][2])
+
+ elsif equal("cell_data_func",params[i][1]) then
+ params[i][2] = to_number(params[i][2])
+ set(c,"cell data func",r,params[i][2])
+
+ else
+ switch params[i][1] do
+ case "type" then break -- do nothing
+ case "title","sort_column_id" then set(c,params[i][1],params[i][2])
+ case "toggled" then connect(r,"toggled",_(params[i][2]))
+ case "edited" then connect(r,"edited",_(params[i][2]))
+ --display("Connecting [] []",{params[i][2],_(params[i][2])})
+ case else set(c,"add attribute",r,params[i][1],params[i][2])
+ end switch
+ end if
+
+ end for
+
+ set(c,"data","renderer",sprintf("%d",r))
+
+ return c
+ end function
+
+widget[GtkTreeView] = {"gtk_tree_view",
+{GtkContainer,GtkWidget,GtkBuildable,GtkScrollable,GObject},
+ {"new",{P},-routine_id("newTreeView")},
+ {"set_model",{P,P}},
+ {"get_model",{P},P,0,GtkTreeModel},
+ {"get_selection",{P},P,0,GtkTreeSelection},
+ {"set_headers_visible",{P,B}},
+ {"get_headers_visible",{P},B},
+ {"set_headers_clickable",{P,B}},
+ {"get_headers_clickable",{P},B},
+ {"set_show_expanders",{P,B}},
+ {"get_show_expanders",{P},B},
+ {"set_expander_column",{P,P}},
+ {"get_expander_column",{P},P,0,GtkTreeViewColumn},
+ {"set_level_indentation",{P,I}},
+ {"get_level_indentation",{P},I},
+ {"columns_autosize",{P}},
+ {"set_rules_hint",{P,B}}, -- deprecated 3.14
+ {"get_rules_hint",{P},B}, -- deprecated 3.14
+ {"set_activate_on_single_click",{P,B}}, -- GTK 3.8+
+ {"get_activate_on_single_click",{P},B}, -- GTK 3.8+
+ {"append_column",{P,P},I},
+ {"append_columns",{P,P},-routine_id("tv_append_columns")},
+ {"remove_column",{P,P,I}},
+ {"insert_column",{P,P,I}},
+ {"insert_column_with_attributes",{P,I,S,S,I,I}},
+ {"insert_column_with_data_func",{P,I,S,P,P,P,P}},
+ {"get_n_columns",{P},I},
+ {"get_column",{P,I},P,0,GtkTreeViewColumn},
+ {"get_columns",{P},X,0,GList},
+ {"move_column_after",{P,P,P}},
+ {"set_column_drag_function",{P,P,P,P}},
+ {"scroll_to_point",{P,I,I}},
+ {"scroll_to_cell",{P,P,P,P,F,F},-routine_id("tv_scroll_to_cell")},
+ {"set_cursor",{P,P,P,B}},
+ {"set_cursor_on_cell",{P,P,P,P,B}},
+ {"get_cursor",{P,P,P}},
+ {"row_activated",{P,P,P}},
+ {"expand_row",{P,P,B},B},
+ {"expand_all",{P}},
+ {"expand_to_path",{P,P}},
+ {"collapse_all",{P}},
+ {"map_expanded_rows",{P,P,P}},
+ {"row_expanded",{P,P},B},
+ {"set_reorderable",{P,B}},
+ {"get_reorderable",{P,B}},
+ {"get_path_at_pos",{P,I,I,P,P,I,I},B},
+ {"is_blank_at_pos",{P,I,I,P,P,I,I},B},
+ {"get_cell_area",{P,P,P,P}},
+ {"get_background_area",{P,P,P,P}},
+ {"get_visible_rect",{P,P}},
+ {"get_visible_range",{P,P,P},B},
+ {"get_bin_window",{P},P,0,GdkWindow},
+ {"convert_bin_window_to_tree_coords",{P,I,I,I,I}},
+ {"convert_bin_window_to_widget_coords",{P,I,I,I,I}},
+ {"convert_tree_to_bin_window_coords",{P,I,I,I,I}},
+ {"convert_tree_to_widget_coords",{P,I,I,I,I}},
+ {"convert_widget_to_bin_window_coords",{P,I,I,I,I}},
+ {"convert_widget_to_tree_coords",{P,I,I,I,I}},
+ {"enable_model_drag_dest",{P,P,I,I}},
+ {"enable_model_drag_source",{P,I,P,I,I}},
+ {"unset_rows_drag_source",{P}},
+ {"unset_rows_drag_dest",{P}},
+ {"set_drag_dest_row",{P,P,I}},
+ {"get_drag_dest_row",{P,P,P}},
+ {"get_drag_dest_row_at_pos",{P,I,I,P,P},B},
+ {"create_row_drag_icon",{P,P},P,0,CairoSurface_t},
+ {"set_enable_search",{P,B}},
+ {"get_enable_search",{P},B},
+ {"set_search_column",{P,I}},
+ {"get_search_column",{P},I},
+ {"set_search_equal_func",{P,P,P,P}},
+ {"get_search_equal_func",{P},P},
+ {"set_search_entry",{P,P}},
+ {"get_search_entry",{P},P,0,GtkEntry},
+ {"set_search_position_func",{P,P,P,P}},
+ {"get_search_position_func",{P},P},
+ {"set_fixed_height_mode",{P,B}},
+ {"get_fixed_height_mode",{P},B},
+ {"set_hover_selection",{P,B}},
+ {"get_hover_selection",{P},B},
+ {"set_hover_expand",{P,B}},
+ {"get_hover_expand",{P},B},
+ {"set_destroy_count_func",{P,P,P,P}},
+ {"set_row_separator_func",{P,P,P,P}},
+ {"get_row_separator_func",{P},P},
+ {"set_rubber_banding",{P,B}},
+ {"get_rubber_banding",{P},B},
+ {"set_enable_tree_lines",{P,B}},
+ {"get_enable_tree_lines",{P},B},
+ {"set_grid_lines",{P,B}},
+ {"get_grid_lines",{P},B},
+ {"set_tooltip_row",{P,P,P}},
+ {"set_tooltip_cell",{P,P,P,P,P}},
+ {"set_tooltip_column",{P,I}},
+ {"get_tooltip_column",{P},I},
+ {"get_tooltip_context",{P,I,I,B,P,P,P},B},
+ {"select_row",{P,P,D,D},-routine_id("tv_select_row")},
+ {"get_selected_row_data",{P,P},-routine_id("tv_get_selected_row_data")},
+ {"get_selected_col_data",{P,P,I},-routine_id("tv_get_selected_col_data")},
+"GtkTreeView"}
+
+ function newTreeView(atom x=0)
+ if class_id(x) = GtkTreeModel then
+ return gtk_func("gtk_tree_view_new_with_model",{P},{x})
+ else
+ return gtk_func("gtk_tree_view_new")
+ end if
+ end function
+
+ constant sfn1 = define_func("gtk_tree_view_get_model",{P},P)
+ constant sfn2 = define_func("gtk_tree_model_get_n_columns",{P},I)
+ constant sfn3 = define_func("gtk_tree_model_get_iter",{P,P,P},B)
+ constant sfn4 = define_func("gtk_tree_model_get_column_type",{P,I},I)
+ constant sp1 = define_proc("gtk_tree_model_get",{P,P,I,P,I})
+
+ function tv_get_selected_col_data(atom view, atom path, integer col)
+ object data = tv_get_selected_row_data(view,path)
+ return data[col]
+ end function
+
+ function tv_get_selected_row_data(atom view, atom path)
+ atom mdl = c_func(sfn1,{view})
+ integer ncols = c_func(sfn2,{mdl})
+ object data = repeat(0,ncols)
+ object types = repeat(0,ncols)
+ atom iter = allocate(32,1)
+ object result
+
+ if c_func(sfn3,{mdl,iter,path}) then
+ for i = 1 to length(data) do
+ data[i] = allocate(32,1)
+ types[i] = c_func(sfn4,{mdl,i-1})
+ c_proc(sp1,{mdl,iter,i-1,data[i],-1})
+ end for
+ end if
+
+ for i = 1 to length(data) do
+ switch types[i] do
+ case gSTR then
+ ifdef BITS64 then -- thanks pete eberlein
+ result = peek8u(data[i])
+ elsedef
+ result = peek4u(data[i])
+ end ifdef
+ if result > 0 then
+ result = peek_string(result)
+ end if
+ data[i] = result
+
+ case else data[i] = peek4u(data[i])
+ end switch
+ end for
+
+ return data
+ end function
+
+ function tv_scroll_to_cell(atom v, atom p, atom c=0, integer align=0, atom row=0, atom col=0)
+ gtk_proc("gtk_tree_view_scroll_to_cell",{P,P,P,I,F,F},{v,p,c,align,row,col})
+ return 1
+ end function
+
+ function tv_append_columns(atom store, object cols)
+ if atom(cols) then
+ gtk_func("gtk_tree_view_append_column",{P,P},{store,cols})
+ else
+ for i = 1 to length(cols) do
+ tv_append_columns(store,cols[i])
+ end for
+ end if
+ return 1
+ end function
+
+ function tv_select_row(atom tv, object path, atom rowalign=0, atom colalign=0)
+ path = create(GtkTreePath,path)
+ gtk_func("gtk_tree_view_scroll_to_cell",
+ {P,P,I,I,F,F},{tv,path,0,1,rowalign,colalign})
+ return 1
+ end function
+
+widget[GtkTreeViewColumn] = {"gtk_tree_view_column",
+{GtkCellLayout,GtkBuildable,GObject},
+ {"new",{},P},
+ {"set_title",{P,S}},
+ {"get_title",{P},S},
+ {"pack_start",{P,P,B}},
+ {"pack_end",{P,P,B}},
+ {"clear",{P}},
+ {"clicked",{P}},
+ {"add_attribute",{P,P,S,I}},
+ {"set_spacing",{P,I}},
+ {"get_spacing",{P},I},
+ {"set_visible",{P,B}},
+ {"get_visible",{P},B},
+ {"set_resizable",{P,B}},
+ {"get_resizable",{P},B},
+ {"set_sizing",{P,I}},
+ {"get_sizing",{P},I},
+ {"set_fixed_width",{P,I}},
+ {"get_fixed_width",{P},I},
+ {"set_min_width",{P,I}},
+ {"get_min_width",{P},I},
+ {"set_max_width",{P,I}},
+ {"get_max_width",{P},I},
+ {"set_expand",{P,B}},
+ {"get_expand",{P},B},
+ {"set_clickable",{P,B}},
+ {"get_clickable",{P},B},
+ {"set_widget",{P,P}},
+ {"get_widget",{P},P},
+ {"get_button",{P},P,0,GtkWidget},
+ {"set_alignment",{P,F}},
+ {"get_alignment",{P},F},
+ {"set_reorderable",{P,B}},
+ {"get_reorderable",{P},B},
+ {"set_sort_column_id",{P,I}},
+ {"get_sort_column_id",{P},I},
+ {"set_sort_indicator",{P,B}},
+ {"get_sort_indicator",{P},B},
+ {"set_sort_order",{P,I}},
+ {"get_sort_order",{P},I},
+ {"cell_set_cell_data",{P,P,P,B,B}},
+ {"cell_get_size",{P,P,I,I,I,I}},
+ {"cell_get_position",{P,P,I,I},B},
+ {"cell_is_visible",{P},B},
+ {"focus_cell",{P,P}},
+ {"queue_resize",{P}},
+ {"get_tree_view",{P},P,0,GtkTreeView},
+ {"get_x_offset",{P},I},
+"GtkTreeViewColumn"}
+
+widget[GtkTreeSelection] = {"gtk_tree_selection",
+{GObject},
+ {"set_mode",{P,I}},
+ {"get_mode",{P},I},
+ {"set_select_function",{P,P,P,P}},
+ {"get_select_function",{P},P},
+ {"get_user_data",{P},P},
+ {"get_tree_view",{P},P},
+ {"get_selected",{P,P,P},B},
+ {"selected_foreach",{P,P,P}},
+ {"count_selected_rows",{P},I},
+ {"select_path",{P,P}},
+ {"unselect_path",{P,P}},
+ {"path_is_selected",{P,P},B},
+ {"select_iter",{P,P}},
+ {"unselect_iter",{P,P}},
+ {"iter_is_selected",{P,P},B},
+ {"select_all",{P}},
+ {"unselect_all",{P}},
+ {"select_range",{P,P,P}},
+ {"unselect_range",{P,P,P}},
+ {"get_selected_row",{P,P},-routine_id("ts_get_selected_row")},
+ {"get_selected_rows",{P,P},-routine_id("ts_get_selected_rows")},
+ {"get_selected_row_data",{P},-routine_id("ts_get_selected_row_data")},
+"GtkTreeSelection"}
+
+ function ts_get_selected_rows(atom selection, atom model)
+ object list = gtk_func("gtk_tree_selection_get_selected_rows",
+ {P,P},{selection,model})
+ list = to_sequence(list,3)
+ return list +1
+ end function
+
+ function ts_get_selected_row(atom selection, atom model)
+ object result = ts_get_selected_rows(selection,model)
+ if equal({},result) then return 0
+ else return result[1]
+ end if
+ end function
+
+ function ts_get_selected_row_data(atom selection)
+ atom mdl = allocate(32), iter = allocate(32)
+ integer n
+ object x,t, val, result
+ if gtk_func("gtk_tree_selection_get_selected",{P,P,P},{selection,mdl,iter}) then
+ mdl = peek4u(mdl)
+ n = gtk_func("gtk_tree_model_get_n_columns",{P},{mdl})
+ x = repeat(0,n) t = x
+
+ for i = 1 to n do
+ val = allocate(32,1)
+ gtk_proc("gtk_tree_model_get",{P,P,I,P,I},{mdl,iter,i-1,val,-1})
+ t[i] = gtk_func("gtk_tree_model_get_column_type",{P,I},{mdl,i-1})
+ x[i] = val
+ end for
+
+ for i = 1 to length(x) do
+ switch t[i] do
+ case gSTR then
+ ifdef BITS64 then -- thanks pete eberlein
+ result = peek8u(x[i])
+ elsedef
+ result = peek4u(x[i])
+ end ifdef
+ if result > 0 then
+ x[i] = peek_string(result)
+ end if
+ case gFLT then x[i] = float32_to_atom(peek({x[i],4}))
+ case gDBL then x[i] = float64_to_atom(peek({x[i],8}))
+ case else x[i] = peek4u(x[i])
+ end switch
+ end for
+ return x
+ end if
+
+ return -1
+ end function
+
+widget[GtkActionBar] = {"gtk_action_bar", -- GTK 3.12
+{GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"pack_start",{P,P}},
+ {"pack_end",{P,P}},
+ {"get_center_widget",{P},P},
+ {"set_center_widget",{P,P}},
+"GtkActionBar"}
+
+widget[GtkAccelLabel] = {"gtk_accel_label",
+{GtkLabel,GtkMisc,GtkWidget,GtkBuildable,GObject},
+ {"new",{S},P},
+ {"get_accel",{P,I,I}}, -- 3.14
+ {"set_accel",{P,I,I}},
+ {"set_accel_closure",{P,P}},
+ {"set_accel_widget",{P,P}},
+ {"get_accel_widget",{P},P,0,GtkWidget},
+ {"get_accel_width",{P},I},
+ {"refetch",{P},B},
+"GtkAccelLabel"}
+
+widget[GtkAccelGroup] = {"gtk_accel_group",
+{GObject},
+ {"new",{},P},
+ {"connect",{P,I,I,I,P}},
+ {"connect_by_path",{P,S,P}},
+ {"disconnect",{P,P},B},
+ {"disconnect_key",{P,I,I},B},
+ {"activate",{P,I,P,I,I},B},
+ {"lock",{P}},
+ {"unlock",{P}},
+ {"get_is_locked",{P},B},
+ {"from_accel_closure",{P},P,0,GtkAccelGroup},
+ {"get_modifier_mask",{P},I},
+ {"find",{P,P,P},P},
+"GtkAccelGroup"}
+
+widget[GtkArrow] = {"gtk_arrow", -- deprecated 3.14
+{GtkMisc,GtkWidget,GtkBuildable,GObject},
+ {"new",{I,I},P},
+ {"set",{P,I,I}},
+"GtkArrow"}
+
+widget[GtkCalendar] = {"gtk_calendar",
+{GtkWidget,GtkBuildable,GObject},
+ {"clear_marks",{P}},
+ {"get_date",{P,I},-routine_id("cal_get_date")},
+ {"get_ymd",{P,I},-routine_id("cal_get_ymd")},
+ {"get_eu_date",{P},-routine_id("cal_get_eu_date")},
+ {"get_day",{P},-routine_id("cal_get_day")},
+ {"get_month",{P},-routine_id("cal_get_month")},
+ {"get_year",{P},-routine_id("cal_get_year")},
+ {"get_datetime",{P,I},-routine_id("cal_get_datetime")},
+ {"get_day_is_marked",{P,I},B},
+ {"get_display_options",{P},I},
+ {"mark_day",{P,I},B},
+ {"new",{P},-routine_id("newCalendar")},
+ {"select_day",{P,I}},
+ {"select_month",{P,I,I},-routine_id("cal_select_month")},
+ {"set_display_options",{P,I}},
+ {"unmark_day",{P,I},B},
+ {"set_detail_func",{P,P,P,P}},
+ {"set_detail_width_chars",{P,I}},
+ {"get_detail_width_chars",{P},I},
+ {"get_detail_height_rows",{P},I},
+ {"set_detail_height_rows",{P,I}},
+ {"set_date",{P,P},-routine_id("cal_set_date")},
+ {"set_eu_date",{P,P},-routine_id("cal_set_date")},
+ {"set_day",{P,I},-routine_id("cal_set_day")},
+ {"set_month",{P,I},-routine_id("cal_set_month")},
+ {"set_year",{P,I},-routine_id("cal_set_year")},
+"GtkCalendar"}
+
+ function newCalendar(object d = 0) -- create calendar, set optional date;
+ object cal = gtk_func("gtk_calendar_new")
+ if atom(d) and d = 0 then return cal
+ else gtk_proc("gtk_calendar_select_month",{P,I,I},{cal,d[2]-1,d[1]})
+ gtk_proc("gtk_calendar_select_day",{P,I},{cal,d[3]})
+ return cal
+ end if
+ end function
+
+------------------------------------------------------------------------
+-- Calendar convenience functions
+------------------------------------------------------------------------
+-- Handle odd month numbering scheme:
+-- Q: If the first day of the month is 1, then why is the first month
+-- of the year zero
+-- A: Blame a C programmer!
+
+-- Here we fix that, plus change the set_date routine from two steps
+-- to one; also, provide for standard formatting to be used when
+-- getting the date. See std/datetime.e for the formats available.
+------------------------------------------------------------------------
+
+ constant get_date = define_proc("gtk_calendar_get_date",{P,I,I,I})
+
+ function cal_select_month(atom handle, integer mo, integer yr=0)
+ while mo < 1 do yr -= 1 mo += 12 end while
+ while mo > 12 do yr += 1 mo -= 12 end while
+ gtk_proc("gtk_calendar_select_month",{P,I,I},{handle,mo-1,yr})
+ return 1
+ end function
+
+ function cal_set_day(atom handle, integer day)
+ object curr = get(handle,"date")
+ curr[3] = day
+ cal_set_date(handle,curr)
+ return 1
+ end function
+
+ function cal_set_month(atom handle, integer month)
+ object curr = get(handle,"date")
+ curr[2] = month
+ cal_set_date(handle,curr)
+ return 1
+ end function
+
+ function cal_set_year(atom handle, integer year)
+ object curr = get(handle,"date")
+ curr[1] = year
+ cal_set_date(handle,curr)
+ return 1
+ end function
+
+ function cal_set_date(atom handle, object cdate)
+ object dt = 0
+ integer yr, mo, da
+
+ dt = datetime:parse(cdate,"%Y/%m/%d")
+ if atom(dt) then
+ dt = datetime:parse(cdate,"%Y,%m,%d")
+ end if
+ if atom(dt) then
+ dt = datetime:parse(cdate,"%m/%d/%y")
+ end if
+ if atom(dt) then
+ dt = datetime:parse(cdate,"%m/%d/%Y")
+ end if
+ if atom(dt) then
+ dt = datetime:parse(cdate,"%y/%m/%d")
+ end if
+
+ if atom(dt) then
+ if cdate[1] > 31 then -- Y/M/D
+ yr = cdate[1]
+ mo = cdate[2]
+ da = cdate[3]
+ end if
+ if cdate[3] > 31 then -- M/D/Y
+ mo = cdate[1]
+ da = cdate[2]
+ yr = cdate[3]
+ end if
+ else
+ yr = dt[1]
+ mo = dt[2]
+ da = dt[3]
+ end if
+
+ if yr < 1900 then yr += 1900 end if
+ gtk_proc("gtk_calendar_select_month",{P,I,I},{handle,mo-1,yr})
+ gtk_proc("gtk_calendar_select_day",{P,I},{handle,da})
+ return 1
+ end function
+
+ function setCalendarEuDate(atom handle, object edt)
+ edt[1] += 1900
+ return cal_set_date(handle,edt)
+ end function
+
+ function cal_get_date(atom handle, object fmt=0)
+ atom y = allocate(8,1), m = allocate(8,1), d = allocate(8,1)
+ object clock
+ if atom(fmt) and fmt = 0 then
+ fmt = "%A, %b %d, %Y"
+ else
+ fmt = peek_string(fmt)
+ end if
+ object result
+ c_proc(get_date,{handle,y,m,d})
+ result = datetime:new(peek4u(y),peek4u(m)+1,peek4u(d))
+ clock = datetime:now()
+ result = result[1..3] & clock[4..6]
+ result = datetime:format(result,fmt)
+ return result
+ end function
+
+ function cal_get_datetime(atom handle, object fmt=1)
+ atom y = allocate(8,1), m = allocate(8,1), d = allocate(8,1)
+ object result
+ c_proc(get_date,{handle,y,m,d})
+ result = datetime:now() -- for current hr,min,sec
+ result[1] = peek4u(y)
+ result[2] = peek4u(m)+1
+ result[3] = peek4u(d)
+ if fmt = 0 then -- set hr,min,sec to zero;
+ result[4] = 0
+ result[5] = 0
+ result[6] = 0
+ end if
+ return result
+ end function
+
+ function cal_get_eu_date(atom handle) --returns {y,m,d} in Eu fmt.
+ atom y = allocate(8,1), m = allocate(8,1), d = allocate(8,1)
+ c_proc(get_date,{handle,y,m,d})
+ sequence result = {peek4u(y)-1900,peek4u(m)+1,peek4u(d)}
+ return result
+ end function
+
+ function cal_get_ymd(atom handle, integer full=0)
+ object clock
+ switch full do
+ case 0 then return cal_get_eu_date(handle) + {1900,0,0}
+ case 1 then return cal_get_eu_date(handle) + {1900,0,0} & {0,0,0}
+ case 2 then clock = datetime:now()
+ return cal_get_eu_date(handle) + {1900,0,0} & clock[4..6]
+ case else return cal_get_eu_date(handle) + {1900,0,0}
+ end switch
+ end function
+
+ function cal_get_day(atom handle)
+ atom y = allocate(8,1), m = allocate(8,1), d = allocate(8,1)
+ c_proc(get_date,{handle,y,m,d})
+ integer result = peek4u(d)
+ return result
+ end function
+
+ function cal_get_month(atom handle)
+ atom y = allocate(8,1), m = allocate(8,1), d = allocate(8,1)
+ c_proc(get_date,{handle,y,m,d})
+ integer result = peek4u(m)
+ return result+1
+ end function
+
+ function cal_get_year(atom handle)
+ atom y = allocate(8,1), m = allocate(8,1), d = allocate(8,1)
+ c_proc(get_date,{handle,y,m,d})
+ integer result = peek4u(y)
+ return result
+ end function
+
+widget[GtkCellView] = {"gtk_cell_view",
+{GtkCellLayout,GtkWidget,GtkBuildable,GtkOrientable,GObject},
+ {"new",{P,P},-routine_id("newCellView")},
+ {"set_model",{P,P}},
+ {"get_model",{P},P},
+ {"set_displayed_row",{P,P}},
+ {"get_displayed_row",{P},P,0,GtkTreePath},
+ {"set_draw_sensitive",{P,B}},
+ {"get_draw_sensitive",{P},B},
+ {"set_fit_model",{P,B}},
+ {"get_fit_model",{P},B},
+"GtkCellView"}
+
+ function newCellView(atom x=0, atom y=0)
+ if class_id(x) = GtkCellArea
+ and class_id(y) = GtkCellAreaContext then
+ return gtk_func("gtk_cell_view_new_with_context",{P,P},{x,y})
+ elsif atom(x) and x > 0 then
+ if class_id(x) = GdkPixbuf then
+ return gtk_func("gtk_cell_view_new_with_pixbuf",{P},{x})
+ end if
+ elsif string(x) then
+ return gtk_func("gtk_cell_view_new_with_markup",{P},{allocate_string(x)})
+ end if
+ end function
+
+widget[GtkDrawingArea] = {"gtk_drawing_area",
+{GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+"GtkDrawingArea"}
+
+widget[GtkSearchEntry] = {"gtk_search_entry", --3.6
+{GtkEntry,GtkWidget,GtkBuildable,GtkEditable,GtkCellEditable,GObject},
+ {"new",{},P},
+ {"handle_event",{P,P},B},
+"GtkSearchEntry"}
+
+widget[GtkEntryBuffer] = {"gtk_entry_buffer",
+{GObject},
+ {"new",{S,I},P},
+ {"get_text",{P},S},
+ {"set_text",{P,S,I}},
+ {"get_bytes",{P},I},
+ {"get_length",{P},I},
+ {"set_max_length",{P,I}},
+ {"get_max_length",{P},I},
+ {"insert_text",{P,I,S,I},I},
+ {"delete_text",{P,I,I},I},
+ {"emit_deleted_text",{P,I,I}},
+ {"emit_inserted_text",{P,I,S,I}},
+"GtkEntryBuffer"}
+
+widget[GtkEntryCompletion] = {"gtk_entry_completion",
+{GtkCellLayout,GtkBuildable,GObject},
+ {"new",{P},-routine_id("newEntryCompletion")},
+ {"get_entry",{P},P,0,GtkEntry},
+ {"set_model",{P,P}},
+ {"get_model",{P},P,0,GtkTreeModel},
+ {"set_match_func",{P,P,P,P}},
+ {"set_minimum_key_length",{P,I}},
+ {"get_minimum_key_length",{P},I},
+ {"compute_prefix",{P,S},S},
+ {"get_completion_prefix",{P},S},
+ {"insert_prefix",{P}},
+ {"insert_action_text",{P,I,S}},
+ {"insert_action_markup",{P,I,S}},
+ {"delete_action",{P,I}},
+ {"set_text_column",{P,I}},
+ {"get_text_column",{P},I},
+ {"set_inline_completion",{P,B}},
+ {"get_inline_completion",{P},B},
+ {"set_inline_selection",{P,B}},
+ {"get_inline_selection",{P},B},
+ {"set_popup_completion",{P,B}},
+ {"get_popup_completion",{P},B},
+ {"set_popup_set_width",{P,B}},
+ {"get_popup_set_width",{P},B},
+ {"set_popup_single_match",{P,B}},
+ {"get_popup_single_match",{P},B},
+ {"complete",{P}},
+"GtkEntryCompletion"}
+
+ function newEntryCompletion(atom x=0)
+ if class_id(x) = GtkCellArea then
+ return gtk_func("gtk_entry_completion_new_with_area",{P},{x})
+ else
+ return gtk_func("gtk_entry_completion_new")
+ end if
+ end function
+
+widget[GtkRevealer] = {"gtk_revealer", -- new in GTK 3.10
+{GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"set_reveal_child",{P,B}},
+ {"get_reveal_child",{P},B},
+ {"get_child_revealed",{P},B},
+ {"set_transition_duration",{P,I}},
+ {"get_transition_duration",{P},I},
+ {"set_transition_type",{P,I}},
+ {"get_transition_type",{P},I},
+"GtkRevealer"}
+
+widget[GtkSearchBar] = {"gtk_search_bar", -- new in GTK 3.10
+{GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"connect_entry",{P,P}},
+ {"set_search_mode",{P,B}},
+ {"get_search_mode",{P},B},
+ {"set_show_close_button",{P,B}},
+ {"get_show_close_button",{P},B},
+ {"handle_event",{P,P},B},
+"GtkSearchBar"}
+
+widget[GtkStack] = {"gtk_stack", -- new in GTK 3.10
+{GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"add_named",{P,P,S}},
+ {"add_titled",{P,P,S,S}},
+ {"set_visible_child",{P,P}},
+ {"get_visible_child",{P},P,0,GtkWidget},
+ {"set_visible_child_name",{P,S}},
+ {"get_visible_child_name",{P},S},
+ {"set_visible_child_full",{P,S,I}},
+ {"set_homogeneous",{P,B}},
+ {"get_homogeneous",{P},B},
+ {"set_transition_duration",{P,I}},
+ {"get_transition_duration",{P},I},
+ {"set_transition_type",{P,I}},
+ {"get_transition_type",{P},I},
+ {"get_child_by_name",{P,S},P,0,GtkWidget}, -- 3.12
+ {"get_transition_running",{P},B}, -- 3.12
+ {"get_hhomogeneous",{P},B}, -- 3.16
+ {"set_hhomogeneous",{P,B}}, -- 3.16
+ {"get_vhomogeneous",{P},B}, -- 3.16
+ {"set_vhomogeneous",{P,B}}, -- 3.16
+ {"get_interpolate_size",{P},B}, -- 3.18
+ {"set_interpolate_size",{P,B}}, -- 3.18
+"GtkStack"}
+
+widget[GtkStackSidebar] = {"gtk_stack_sidebar", -- 3.16
+{GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"set_stack",{P,P}},
+ {"get_stack",{P},P,0,GtkStack},
+"GtkStackSidebar"}
+
+widget[GtkStackSwitcher] = {"gtk_stack_switcher",
+{GtkBox,GtkContainer,GtkWidget,GtkBuildable,GtkOrientable,GObject},
+ {"new",{},P},
+ {"set_stack",{P,P}},
+ {"get_stack",{P},P,0,GtkStack},
+"GtkStackSwitcher"}
+
+widget[GtkScrollbar] = {"gtk_scrollbar",
+{GtkRange,GtkWidget,GtkBuildable,GtkOrientable,GObject},
+ {"new",{I,P},P},
+"GtkScrollbar"}
+
+widget[GtkInvisible] = {"gtk_invisible",
+{GtkWidget,GtkBuildable,GObject},
+ {"new",{P},-routine_id("newInvisible")},
+ {"set_screen",{P,P}},
+ {"get_screen",{P},P,0,GdkScreen},
+"GtkInvisible"}
+
+ function newInvisible(atom x=0)
+ if class_id(x) = GdkScreen then
+ return gtk_func("gtk_invisible_new_for_screen",{P},{x})
+ else
+ return gtk_func("gtk_invisible_new")
+ end if
+ end function
+
+widget[GtkProgressBar] = {"gtk_progress_bar",
+{GtkWidget,GtkBuildable,GtkOrientable,GObject},
+ {"new",{},P},
+ {"pulse",{P}},
+ {"set_fraction",{P,D}},
+ {"get_fraction",{P},D},
+ {"set_inverted",{P,B}},
+ {"get_inverted",{P},B},
+ {"set_show_text",{P,B}},
+ {"get_show_text",{P},B},
+ {"set_text",{P,S}},
+ {"get_text",{P},S},
+ {"set_ellipsize",{P,B}},
+ {"get_ellipsize",{P},B},
+ {"set_pulse_step",{P,D}},
+ {"get_pulse_step",{P},D},
+"GtkProgressBar"}
+
+widget[GtkSpinner] = {"gtk_spinner",
+{GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"start",{P}},
+ {"stop",{P}},
+"GtkSpinner"}
+
+widget[GtkSwitch] = {"gtk_switch",
+{GtkWidget,GtkBuildable,GtkActionable,GObject},
+ {"new",{},P},
+ {"set_active",{P,B}},
+ {"get_active",{P},B},
+ {"get_state",{P},B}, -- GTK3.14
+ {"set_state",{P,B}}, -- GTK3.14
+"GtkSwitch"}
+
+widget[GtkLevelBar] = {"gtk_level_bar",-- GTK3.6+
+{GtkWidget,GtkBuildable,GtkBuildable,GtkOrientable,GObject},
+ {"new",{D,D},-routine_id("newLevelBar")},
+ {"new_for_interval",{D,D},P},
+ {"set_mode",{P,I}},
+ {"get_mode",{P},I},
+ {"set_value",{P,D}},
+ {"get_value",{P},D},
+ {"set_min_value",{P,D}},
+ {"get_min_value",{P},D},
+ {"set_max_value",{P,D}},
+ {"get_max_value",{P},D},
+ {"add_offset_value",{P,S,D}},
+ {"remove_offset_value",{P,S}},
+ {"get_offset_value",{P,S},D},
+ {"get_inverted",{P},B}, --GTK3.8+
+ {"set_inverted",{P,B}}, --GTK3.8+
+"GtkLevelBar"}
+
+ function newLevelBar(atom x=0, atom y=0)
+ if x+y > 0 then
+ return gtk_func("gtk_level_bar_new_for_interval",{D,D},{x,y})
+ else
+ return gtk_func("gtk_level_bar_new")
+ end if
+ end function
+
+widget[GtkAboutDialog] = {"gtk_about_dialog",
+{GtkDialog,GtkWindow,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"set_program_name",{P,S}},
+ {"get_program_name",{P},S},
+ {"set_version",{P,S}},
+ {"get_version",{P},S},
+ {"set_copyright",{P,S}},
+ {"get_copyright",{P},S},
+ {"set_comments",{P,S}},
+ {"get_comments",{P},S},
+ {"set_license",{P,S}},
+ {"get_license",{P},S},
+ {"set_wrap_license",{P,B}},
+ {"get_wrap_license",{P},B},
+ {"set_license_type",{P,I}},
+ {"get_license_type",{P},I},
+ {"set_website",{P,S}},
+ {"get_website",{P},S},
+ {"set_website_label",{P,S}},
+ {"get_website_label",{P},S},
+ {"set_authors",{P,A}},
+ {"get_authors",{P},V},
+ {"set_artists",{P,A}},
+ {"get_artists",{P},V},
+ {"set_documenters",{P,A}},
+ {"get_documenters",{P},V},
+ {"set_translator_credits",{P,S}},
+ {"get_translator_credits",{P},S},
+ {"set_logo",{P,P},-routine_id("setAboutLogo")},
+ {"get_logo",{P},P,0,GdkPixbuf},
+ {"set_logo_icon_name",{P,S}},
+ {"get_logo_icon_name",{P},S},
+ {"add_credit_section",{P,S,A}},
+"GtkAboutDialog"}
+
+ function setAboutLogo(atom dlg, object logo)
+ if string(logo) then
+ logo = locate_file(logo)
+ if file_type(logo) = 0 then return 0 end if
+ end if
+ if atom(logo) and class_id(logo) = GdkPixbuf then
+ return 0
+ else
+ logo = create(GdkPixbuf,logo)
+ end if
+ gtk_proc("gtk_about_dialog_set_logo",{P,P},{dlg,logo})
+ return 1
+ end function
+
+widget[GtkAppChooserDialog] = {"gtk_app_chooser_dialog",
+{GtkAppChooser,GtkDialog,GtkWindow,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{P,I,P},-routine_id("newAppChooserDialog")},
+ {"get_widget",{P},P,0,GtkAppChooserWidget},
+ {"set_heading",{P,S}},
+ {"get_heading",{P},S},
+"GtkAppChooserDialog"}
+
+ function newAppChooserDialog(atom parent, integer flags, object x)
+ if string(x) and file_exists(canonical_path(x)) then
+ x = allocate_string(canonical_path(x),1)
+ x = gtk_func("g_file_new_for_path",{P},{x})
+ return gtk_func("gtk_app_chooser_dialog_new",{P,I,P},{parent,flags,x})
+ else
+ if string(x) then
+ x = allocate_string(x,1)
+ end if
+ return gtk_func("gtk_app_chooser_dialog_new_for_content_type",
+ {P,I,P},{parent,flags,x})
+ end if
+ end function
+
+widget[GtkColorChooserDialog] = {"gtk_color_chooser_dialog",
+{GtkColorChooser,GtkDialog,GtkWindow,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{S,P},P},
+"GtkColorChooserDialog"}
+
+widget[GtkColorSelectionDialog] = {"gtk_color_selection_dialog",
+{GtkDialog,GtkWindow,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{S},P},
+ {"get_color_selection",{P},P,0,GtkColorSelection},
+"GtkColorSelectionDialog"}
+
+widget[GtkFileChooserDialog] = {"gtk_file_chooser_dialog",
+{GtkFileChooser,GtkDialog,GtkWindow,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{S,P,I,S},P},
+"GtkFileChooserDialog"}
+
+widget[GtkFontChooserDialog] = {"gtk_font_chooser_dialog",
+{GtkFontChooser,GtkDialog,GtkWindow,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{S,P},P},
+"GtkFontChooserDialog"}
+
+widget[GtkStyleProvider] = {"gtk_style_provider",
+{0},
+ {"get_style_property",{P,P,I,P,P},B},
+"GtkStyleProvider"}
+
+widget[GtkStyleContext] = {"gtk_style_context",
+{GObject},
+ {"new",{},P},
+ {"add_provider",{P,P,I}},
+ {"add_provider_for_screen",{P,P,P,I},-routine_id("sc_add_provider_for_screen")},
+ {"get",{P,I,S,P,I}},
+ {"get_junction_sides",{P},I},
+ {"get_parent",{P},P,0,GtkStyleContext},
+ {"get_path",{P},P,0,GtkWidgetPath},
+ {"get_property",{P,S,I,P}},
+ {"get_screen",{P},P,0,GdkScreen},
+ {"get_frame_clock",{P},P,0,GdkFrameClock},
+ {"get_state",{P},I},
+ {"get_style",{P,S,P,I}},
+ {"get_style_property",{P,S,P}},
+ {"get_section",{P,S},P,0,GtkCssSection},
+ {"get_color",{P,I,P}},
+ {"get_background_color",{P,I,P}}, -- deprecated 3.16
+ {"get_border_color",{P,I,P}}, -- deprecated 3.16
+ {"get_border",{P,I,P}},
+ {"get_padding",{P,I,P}},
+ {"get_margin",{P,I,P}},
+ {"invalidate",{P}},
+ {"lookup_color",{P,S,P},B},
+ {"remove_provider",{P,P}},
+ {"remove_provider_for_screen",{P,P}},
+ {"reset_widgets",{P}},
+ {"set_background",{P,P}},
+ {"restore",{P}},
+ {"save",{P}},
+ {"set_junction_sides",{P,I}},
+ {"set_parent",{P,P}},
+ {"set_path",{P,P}},
+ {"add_class",{P,S}},
+ {"remove_class",{P,S}},
+ {"has_class",{P,S},B},
+ {"list_classes",{P},P,0,GList},
+ {"add_region",{P,S,I}}, -- deprecated 3.14
+ {"remove_region",{P,S}}, -- deprecated 3.14
+ {"has_region",{P,S,I},B}, -- deprecated 3.14
+ {"list_regions",{P},P,0,GList}, -- deprecated 3.14
+ {"get_screen",{P,P}},
+ {"set_frame_clock",{P,P}},
+ {"set_state",{P,I}},
+ {"set_scale",{P,I}}, -- 3.10
+ {"get_scale",{P},I}, -- 3.10
+ {"to_string",{P,I},S}, -- 3.20
+"GtkStyleContext"}
+
+ function sc_add_provider_for_screen(atom context, atom scrn, atom pro, integer pri)
+ gtk_proc("gtk_style_context_add_provider_for_screen",{P,P,I},{scrn,pro,pri})
+ return 1
+ end function
+
+widget[GtkRecentChooserDialog] = {"gtk_recent_chooser_dialog",
+{GtkRecentChooser,GtkDialog,GtkWindow,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{S,P,P},P},
+ {"new_for_manager",{S,P,P,P},P},
+"GtkRecentChooserDialog"}
+
+widget[GtkPrintSettings] = {"gtk_print_settings",
+{GObject},
+ {"new",{P,P},-routine_id("newPrintSettings")},
+ {"load_file",{P,S,P},B},
+ {"to_file",{P,S,P},B},
+ {"load_key_file",{P,P,S,P},B},
+ {"to_key_file",{P,P,S}},
+ {"copy",{P},P,0,GtkPrintSettings},
+ {"has_key",{P,S},B},
+ {"get",{P,S},S},
+ {"set",{P,S,S}},
+ {"unset",{P,S}},
+ {"foreach",{P,P,P}},
+ {"get_bool",{P,S},B},
+ {"set_bool",{P,S,B}},
+ {"get_double",{P,S},D},
+ {"get_double_with_default",{P,S,D},D},
+ {"set_double",{P,S,D}},
+ {"get_length",{P,S,I},D},
+ {"set_length",{P,S,D,I}},
+ {"get_int",{P,S},I},
+ {"get_int_with_default",{P,S,I},I},
+ {"set_int",{P,S,I}},
+ {"get_printer",{P},S},
+ {"set_printer",{P,S}},
+ {"get_orientation",{P},I},
+ {"set_orientation",{P,I}},
+ {"get_paper_size",{P},P,0,GtkPaperSize},
+ {"set_paper_size",{P,P}},
+ {"get_paper_width",{P,I},D},
+ {"set_paper_width",{P,D,I}},
+ {"get_paper_height",{P,I},D},
+ {"set_paper_height",{P,D,I}},
+ {"get_use_color",{P},B},
+ {"set_use_color",{P,B}},
+ {"get_collate",{P},B},
+ {"set_collate",{P,B}},
+ {"get_reverse",{P},B},
+ {"set_reverse",{P,B}},
+ {"get_duplex",{P},I},
+ {"set_duplex",{P,I}},
+ {"get_quality",{P},I},
+ {"set_quality",{P,I}},
+ {"get_n_copies",{P},I},
+ {"set_n_copies",{P,I}},
+ {"get_number_up",{P},I},
+ {"set_number_up",{P,I}},
+ {"get_number_up_layout",{P},I},
+ {"set_number_up_layout",{P,I}},
+ {"get_resolution",{P},I},
+ {"set_resolution",{P,I}},
+ {"get_resolution_x",{P},I},
+ {"get_resolution_y",{P},I},
+ {"get_printer_lpi",{P},D},
+ {"set_printer_lpi",{P,D}},
+ {"get_scale",{P},D},
+ {"set_scale",{P,D}},
+ {"get_print_pages",{P},I},
+ {"set_print_pages",{P,I}},
+ {"get_page_ranges",{P,I},P,0,GtkPageRange},
+ {"set_page_ranges",{P,P},-routine_id("ps_set_page_ranges")},
+ {"get_page_set",{P},I},
+ {"set_page_set",{P,I}},
+ {"get_default_source",{P},S},
+ {"set_default_source",{P,S}},
+ {"get_media_type",{P},S},
+ {"set_media_type",{P,S}},
+ {"get_dither",{P},S},
+ {"set_dither",{P,S}},
+ {"get_finishings",{P},S},
+ {"set_finishings",{P,S}},
+ {"get_output_bin",{P},S},
+ {"set_output_bin",{P,S}},
+"GtkPrintSettings"}
+
+ function newPrintSettings(object x=0, object y=0)
+ atom err=allocate(8,1)
+ if atom(x) and x = 0 then
+ return gtk_func("gtk_print_settings_new")
+ end if
+ if class_id(x) = GKeyFile then
+ y = allocate_string(y,1)
+ return gtk_func("gtk_print_settings_new_from_key_file",{P,P,P},{x,y,err})
+ end if
+ if string(x) and file_exists(canonical_path(x)) then
+ x = allocate_string(canonical_path(x),1)
+ return gtk_func("gtk_print_settings_new_from_file",{P,P},{x,err})
+ end if
+ end function
+
+ function ps_set_page_ranges(atom x, object r)
+ atom m = allocate_data(8)
+ poke(m,r[1])
+ poke(m+4,r[2])
+ gtk_proc("gtk_print_settings_set_pages_ranges",{P,P,I},{x,m,2})
+ return 1
+ end function
+
+widget[GtkPaperSize] = {"gtk_paper_size",
+{0},
+ {"new",{P,P,D,D},-routine_id("newPaperSize")},
+ {"new_from_ppd",{S,S,D,D},P},
+ {"new_from_ipp",{S,D,D},P,0,GtkPaperSize}, -- 3.16
+ {"new_custom",{S,S,D,D,I},P},
+ {"copy",{P},P,0,GtkPaperSize},
+ {"is_equal",{P,P},B},
+ {"get_name",{P},S},
+ {"get_display_name",{P},S},
+ {"get_ppd_name",{P},S},
+ {"get_width",{P,I},D},
+ {"get_height",{P,I},D},
+ {"is_custom",{P},B},
+ {"set_size",{P,D,D,I}},
+ {"get_default_top_margin",{P,I},D},
+ {"get_default_bottom_margin",{P,I},D},
+ {"get_default_left_margin",{P,I},D},
+ {"get_default_right_margin",{P,I},D},
+"GtkPaperSize"}
+
+ function newPaperSize(object a=0, object b=0, atom c=0, atom d=0)
+ if string(a) and atom(b) and b = 0 and c = 0 and d = 0 then
+ a = allocate_string(a,1)
+ return gtk_func("gtk_paper_size_new",{P},{a})
+ end if
+ if string(a) and atom(b) and b > 0 and c > 0 then
+ a = allocate_string(a,1)
+ return gtk_func("gtk_paper_size_new_from_ipp",{P,D,D},{a,b,c})
+ end if
+ if string(a) and string(b) and c > 0 and d > 0 then
+ a = allocate_string(a,1)
+ b = allocate_string(b,1)
+ return gtk_func("gtk_paper_size_new_from_ppd",{P,P,D,D},{a,b,c,d})
+ end if
+ end function
+
+export function get_paper_sizes(integer cust=0)
+ object ps = gtk_func("gtk_paper_size_get_paper_sizes",{P},{cust})
+ ps = unpack_gs_atom_list(ps)
+ return ps
+end function
+
+export function get_paper_size_names(integer cust=0)
+ object ps = get_paper_sizes(cust)
+ for i = 1 to length(ps) do
+ ps[i] = gtk_str_func("gtk_paper_size_get_name",{P},{ps[i]})
+ end for
+ return ps
+end function
+
+widget[GtkPageSetup] = {"gtk_page_setup",
+{GObject},
+ {"new",{},P},
+ {"copy",{P},P,0,GtkPageSetup},
+ {"get_orientation",{P},I},
+ {"set_orientation",{P,I}},
+ {"get_paper_size",{P},P,0,GtkPaperSize},
+ {"set_paper_size",{P,P}},
+ {"get_top_margin",{P,I},D},
+ {"set_top_margin",{P,D,I}},
+ {"get_bottom_margin",{P,I},D},
+ {"set_bottom_margin",{P,D,I}},
+ {"get_left_margin",{P,I},D},
+ {"set_left_margin",{P,D,I}},
+ {"get_right_margin",{P,I},D},
+ {"set_right_margin",{P,D,I}},
+ {"set_paper_size_and_default_margins",{P,P}},
+ {"get_paper_width",{P,I},D},
+ {"get_paper_height",{P,I},D},
+ {"get_page_width",{P,I},D},
+ {"get_page_height",{P,I},D},
+ {"new_from_file",{S,P},P,0,GtkPageSetup},
+ {"load_file",{P,S,P},B},
+ {"to_file",{P,S},-routine_id("ps_to_file")},
+"GtkPageSetup"}
+
+ function ps_to_file(atom setup, object filename)
+ atom err = allocate(8,1) err = 0
+ return gtk_func("gtk_page_setup_to_file",{P,P,P},{setup,filename,err})
+ end function
+
+widget[GtkPageRange] = {"gtk_page_range",
+{0},
+"GtkPageRange"}
+
+widget[GtkPrintOperation] = {"gtk_print_operation",
+{GObject},
+ {"new",{},P},
+ {"set_allow_async",{P,B}},
+ {"get_error",{P,P}},
+ {"set_default_page_setup",{P,P}},
+ {"get_default_page_setup",{P},P,0,GtkPageSetup},
+ {"set_print_settings",{P,P}},
+ {"get_print_settings",{P},P,0,GtkPrintSettings},
+ {"set_job_name",{P,S}},
+ {"get_job_name",{P},-routine_id("getPrintOpJobName")},
+ {"set_n_pages",{P,I}},
+ {"get_n_pages_to_print",{P},I},
+ {"set_current_page",{P,I}},
+ {"set_use_full_page",{P,B}},
+ {"set_unit",{P,I}},
+ {"set_export_filename",{P,S}},
+ {"set_show_progress",{P,B}},
+ {"set_track_print_status",{P,B}},
+ {"set_custom_tab_label",{P,S}},
+ {"run",{P,P,P,P},I},
+ {"cancel",{P}},
+ {"draw_page_finish",{P}},
+ {"set_defer_drawing",{P}},
+ {"get_status",{P},I},
+ {"get_status_string",{P},S},
+ {"is_finished",{P},B},
+ {"set_support_selection",{P,B}},
+ {"get_support_selection",{P},B},
+ {"set_has_selection",{P,B}},
+ {"get_has_selection",{P},B},
+ {"set_embed_page_setup",{P,B}},
+ {"get_embed_page_setup",{P},B},
+"GtkPrintOperation"}
+
+ function getPrintOpJobName(atom op)
+ object job = allocate(32,1), err = allocate(32,1) err = 0
+ gtk_func("g_object_get",{P,P,P,P},{op,"job name",job,err})
+ object result
+ ifdef BITS64 then -- thanks pete eberlein
+ result = peek8u(job)
+ elsedef
+ result = peek4u(job)
+ end ifdef
+ if result > 0 then
+ result = peek_string(result)
+ end if
+ return result
+ end function
+
+widget[GtkPrintContext] = {"gtk_print_context",
+{GObject},
+ {"get_cairo_context",{P},P},
+ {"set_cairo_context",{P,P,D,D}},
+ {"get_page_setup",{P},P,0,GtkPageSetup},
+ {"get_width",{P},D},
+ {"get_height",{P},D},
+ {"get_dpi_x",{P},D},
+ {"get_dpi_y",{P},D},
+ {"get_pango_fontmap",{P},P,0,PangoFontMap},
+ {"create_pango_context",{P},P,0,PangoContext},
+ {"create_pango_layout",{P},P,0,PangoLayout},
+ {"get_hard_margins",{P,D,D,D,D},B},
+"GtkPrintContext"}
+
+widget[GtkPrintUnixDialog] = {"gtk_print_unix_dialog",
+{GtkDialog,GtkWindow,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{S,P},P},
+ {"set_page_setup",{P,P}},
+ {"get_page_setup",{P},P,0,GtkPageSetup},
+ {"set_current_page",{P,I}},
+ {"get_current_page",{P},I},
+ {"set_settings",{P,P}},
+ {"get_settings",{P},P,0,GtkPrintSettings},
+ {"get_selected_printer",{P},P,0,GtkPrinter},
+ {"add_custom_tab",{P,P,P}},
+ {"set_support_selection",{P,B}},
+ {"get_support_selection",{P},B},
+ {"get_has_selection",{P},B},
+ {"set_embed_page_setup",{P,B}},
+ {"get_embed_page_setup",{P},B},
+ {"set_manual_capabilities",{P,I}},
+ {"get_manual_capabilities",{P},I},
+"GtkPrintUnixDialog"}
+
+widget[GtkPageSetupUnixDialog] = {"gtk_page_setup_unix_dialog",
+{GtkDialog,GtkWindow,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{S,P},P},
+ {"set_page_setup",{P,P}},
+ {"get_page_setup",{P},P,0,GtkPageSetup},
+ {"set_print_settings",{P,P}},
+ {"get_print_settings",{P},P,0,GtkPrintSettings},
+"GtkPageSetupUnixDialog"}
+
+widget[GtkListBox] = {"gtk_list_box", -- new in GTK 3.10
+{GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"prepend",{P,P}},
+ {"insert",{P,P,I}},
+ {"select_row",{P,P}},
+ {"select_all",{P}}, -- 3.14
+ {"unselect_all",{P}}, -- 3.14
+ {"unselect_row",{P,P}}, -- 3.14
+ {"get_selected_row",{P},P,0,GtkListBoxRow},
+ {"get_selected_rows",{P},X,0,GList},-- 3.14
+ {"row_is_selected",{P},B}, -- 3.14
+ {"selected_foreach",{P,P,P}}, -- 3.14
+ {"set_selection_mode",{P,I}},
+ {"get_selection_mode",{P},I},
+ {"set_activate_on_single_click",{P,B}},
+ {"get_activate_on_single_click",{P},B},
+ {"set_adjustment",{P,P}},
+ {"get_adjustment",{P},P,0,GtkAdjustment},
+ {"set_placeholder",{P,P}},
+ {"get_row_at_index",{P,I},P,0,GtkListBoxRow},
+ {"get_row_at_y",{P,I},P,0,GtkListBoxRow},
+ {"invalidate_filter",{P}},
+ {"invalidate_headers",{P}},
+ {"invalidate_sort",{P}},
+ {"set_filter_func",{P,P,P,P}},
+ {"set_header_func",{P,P,P,P}},
+ {"set_sort_func",{P,P,P,P}},
+ {"drag_highlight_row",{P,P}},
+ {"drag_unhighlight_row",{P}},
+ {"bind_model",{P,P,P,P,P}}, -- 3.16
+"GtkListBox"}
+
+widget[GtkListBoxRow] = {"gtk_list_box_row",
+{GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"changed",{P}},
+ {"get_header",{P},P,0,GtkWidget},
+ {"get_type",{},I},
+ {"set_header",{P,P}},
+ {"get_index",{P},I},
+ {"set_activatable",{P,B}},
+ {"set_selectable",{P,B}},
+ {"get_selectable",{P},B},
+"GtkListBoxRow"}
+
+widget[GtkPopover] = {"gtk_popover", -- new in GTK 3.12
+{GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{P,P},-routine_id("newPopover")},
+ {"bind_model",{P,P,S}},
+ {"set_relative_to",{P,P}},
+ {"get_relative_to",{P},P,0,GtkWidget},
+ {"set_pointing_to",{P,P}},
+ {"get_pointing_to",{P,P},B},
+ {"set_position",{P,I}},
+ {"get_position",{P},I},
+ {"set_modal",{P,B}},
+ {"get_modal",{P},B},
+ {"get_transitions_enabled",{P},B},
+ {"set_transitions_enabled",{P,B}},
+ {"get_default_widget",{P},P,0,GtkWidget}, -- 3.18
+ {"set_default_widget",{P,P}}, -- 3.18
+ {"get_constrain_to",{P},P}, -- 3.20
+ {"set_constrain_to",{P,P}}, -- 3.20
+ {"popup",{P}}, -- 3.21
+ {"popdown",{P}}, -- 3.21
+"GtkPopover"}
+
+ function newPopover(atom a=0, atom b=0)
+ if class_id(b) = GMenuModel then
+ return gtk_func("gtk_popover_new_from_model",{P,P},{a,b})
+ else
+ return gtk_func("gtk_popover_new",{P},{a})
+ end if
+ end function
+
+widget[GtkPopoverMenu] = {"gtk_popover_menu", -- 3.16
+{GtkPopover,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"open_submenu",{P,S}},
+"GtkPopoverMenu"}
+
+widget[GtkPlacesSidebar] = {"gtk_places_sidebar", -- new 3.10
+{GtkScrolledWindow,GtkBin,GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"set_open_flags",{P,I}},
+ {"get_open_flags",{P},I},
+ {"set_location",{P,P}},
+ {"get_location",{P},P,0,GFile},
+ {"set_show_desktop",{P,B}},
+ {"get_show_desktop",{P},B},
+ {"add_shortcut",{P,P}},
+ {"remove_shortcut",{P,P}},
+ {"list_shortcuts",{P},A,0,GSList},
+ {"get_nth_bookmark",{P,I},P,0,GFile},
+ {"get_show_connect_to_server",{P},B}, -- deprecated 3.18
+ {"set_show_connect_to_server",{P,B}}, -- deprecated 3.18
+ {"set_local_only",{P,B}}, -- 3.12
+ {"get_local_only",{P},B}, -- 3.12
+ {"get_show_enter_location",{P},B}, --3.14
+ {"set_show_enter_location",{P,B}}, --3.14
+ {"get_show_other_locations",{P},B}, -- 3.18
+ {"set_show_other_locations",{P,B}}, -- 3.18
+ {"get_show_recent",{P},B}, -- 3.18
+ {"set_show_recent",{P,B}}, -- 3.18
+ {"get_show_trash",{P},B}, -- 3.18
+ {"set_show_trash",{P,B}}, -- 3.18
+ {"set_drop_targets_visible",{P,B,P}}, -- 3.18
+"GtkPlacesSidebar"}
+
+widget[GtkHeaderBar] = {"gtk_header_bar", -- new in GTK 3.10
+{GtkContainer,GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"set_title",{P,S}},
+ {"get_title",{P},S},
+ {"set_subtitle",{P,S}},
+ {"get_subtitle",{P},S},
+ {"set_has_subtitle",{P,B}}, -- 3.12
+ {"get_has_subtitle",{P},B}, -- 3.12
+ {"set_custom_title",{P,P}},
+ {"get_custom_title",{P},P,0,GtkWidget},
+ {"pack_start",{P,P}},
+ {"pack_end",{P,P}},
+ {"set_show_close_button",{P,B}},
+ {"get_show_close_button",{P},B},
+ {"set_decoration_layout",{P,S}}, -- 3.12
+ {"get_decoration_layout",{P},S}, -- 3.12
+"GtkHeaderBar"}
+
+widget[GtkPrinter] = {"gtk_printer",
+{GObject},
+ {"new",{S,P,B},P},
+ {"get_backend",{P},P},
+ {"get_name",{P},S},
+ {"get_state_message",{P},S},
+ {"get_description",{P},S},
+ {"get_location",{P},S},
+ {"get_icon_name",{P},S},
+ {"get_job_count",{P},I},
+ {"is_active",{P},B},
+ {"is_paused",{P},B},
+ {"is_accepting_jobs",{P},B},
+ {"is_virtual",{P},B},
+ {"is_default",{P},B},
+ {"accepts_ps",{P},B},
+ {"accepts_pdf",{P},B},
+ --{"list_papers",{P},X,0,GList}, -- buggy!
+ {"compare",{P,P},I},
+ {"has_details",{P},B},
+ {"request_details",{P}},
+ {"get_capabilities",{P},I},
+ {"get_default_page_size",{P},P,0,GtkPageSetup},
+ {"get_hard_margins",{P,D,D,D,D},B},
+"GtkPrinter"}
+
+widget[GtkPrintJob] = {"gtk_print_job",
+{GObject},
+ {"new",{S,P,P,P},P},
+ {"get_settings",{P},P,0,GtkPrintSettings},
+ {"get_printer",{P},P,0,GtkPrinter},
+ {"get_title",{P},S},
+ {"get_status",{P},I},
+ {"set_source_file",{P,S,P},B},
+ {"get_surface",{P,P},P,0,CairoSurface_t},
+ {"send",{P,P,P,P}},
+ {"set_track_print_status",{P,B}},
+ {"get_track_print_status",{P},B},
+ {"get_pages",{P},I},
+ {"set_pages",{P,I}},
+ {"get_page_ranges",{P,I},P,0,GtkPageRange},
+ {"set_page_ranges",{P,P},-routine_id("setPageRanges")},
+ {"get_page_set",{P},I},
+ {"set_page_set",{P,I}},
+ {"get_num_copies",{P},I},
+ {"set_num_copies",{P,I}},
+ {"get_scale",{P},D},
+ {"set_scale",{P,D}},
+ {"get_n_up",{P},I},
+ {"set_n_up",{P,I}},
+ {"get_n_up_layout",{P},I},
+ {"set_n_up_layout",{P,I}},
+ {"get_rotate",{P},B},
+ {"set_rotate",{P,B}},
+ {"get_collate",{P},B},
+ {"set_collate",{P,B}},
+ {"get_reverse",{P},B},
+ {"set_reverse",{P,B}},
+"GtkPrintJob"}
+
+widget[GtkFlowBox] = {"gtk_flow_box", -- GTK 3.12
+{GtkContainer,GtkWidget,GtkBuildable,GtkOrientable,GObject},
+ {"new",{},P},
+ {"insert",{P,P,I}},
+ {"get_child_at_index",{P,I},P,0,GtkFlowBoxChild},
+ {"set_hadjustment",{P,P}},
+ {"set_vadjustment",{P,P}},
+ {"set_homogeneous",{P,B}},
+ {"get_homogeneous",{P},B},
+ {"set_row_spacing",{P,I}},
+ {"get_row_spacing",{P},I},
+ {"set_column_spacing",{P,I}},
+ {"get_column_spacing",{P},I},
+ {"set_min_children_per_line",{P,I}},
+ {"get_min_children_per_line",{P},I},
+ {"set_max_children_per_line",{P,I}},
+ {"get_max_children_per_line",{P},I},
+ {"set_activate_on_single_click",{P,B}},
+ {"get_activate_on_single_click",{P},B},
+ {"selected_foreach",{P,P,P}},
+ {"get_selected_children",{P},X,0,GList},
+ {"select_child",{P,P}},
+ {"unselect_child",{P,P}},
+ {"select_all",{P}},
+ {"unselect_all",{P}},
+ {"set_selection_mode",{P,I}},
+ {"get_selection_mode",{P},I},
+ {"set_filter_func",{P,P,P,P}},
+ {"invalidate_filter",{P}},
+ {"set_sort_func",{P,P,P,P}},
+ {"invalidate_sort",{P}},
+ {"bind_model",{P,P,P,P,P}}, -- 3.18
+"GtkFlowBox"}
+
+widget[GtkFlowBoxChild] = {"gtk_flow_box_child", -- GTK 3.12
+{GtkBin,GtkContainer,GtkWidget,GtkBuildable,GtkOrientable,GObject},
+ {"new",{},P},
+ {"get_index",{P},I},
+ {"is_selected",{P},B},
+ {"changed",{P}},
+"GtkFlowBoxChild"}
+
+widget[GtkMountOperation] = {"gtk_mount_operation",
+{GObject},
+ {"new",{P},P},
+ {"is_showing",{P},B},
+ {"set_parent",{P,P}},
+ {"get_parent",{P},P,0,GtkWindow},
+ {"set_screen",{P,P}},
+ {"get_screen",{P},P,0,GdkScreen},
+"GtkMountOperation"}
+
+----------------------------------------------------------------------
+-- stocklist is not a real GTK widget, we just fake it for convenience
+----------------------------------------------------------------------
+widget[GtkStockList] = {"gtk_stocklist", -- deprecated in GTK 3.12+
+{0},
+"GtkStockList"}
+
+ function newStockList()
+ object list = gtk_func("gtk_stock_list_ids")
+ return to_sequence(list)
+ end function
+
+----------------------------------------------------------------------
+-- Support for Gestures;
+----------------------------------------------------------------------
+
+widget[GtkEventController] = {"gtk_event_controller",
+{GObject},
+ {"get_propagation_phase",{P},I},
+ {"set_propagation_phase",{P,I}},
+ {"handle_event",{P,P},B},
+ {"get_widget",{P},P,0,GtkWidget},
+ {"reset",{P}},
+"GtkEventController"}
+
+widget[GdkFrameClock] = {"gdk_frame_clock",
+{GObject},
+ {"get_frame_time",{P},I},
+ {"request_phase",{P,P}},
+ {"begin_updating",{P}},
+ {"end_updating",{P}},
+ {"get_frame_counter",{P},I},
+ {"get_history_start",{P},I},
+ {"get_timings",{P,I},P},
+ {"get_current_timings",{P},P,0,GdkFrameTimings},
+ {"get_refresh_info",{P,I,I,I}},
+"GdkFrameClock"}
+
+widget[GdkFrameTimings] = {"gdk_frame_timings",
+{GObject},
+ {"get_frame_counter",{P},I},
+ {"get_complete",{P},B},
+ {"get_frame_time",{P},I},
+ {"get_presentation_time",{P},I},
+ {"get_refresh_interval",{P},I},
+ {"get_predicted_presentation_time",{P},I},
+"GdkFrameTimings"}
+
+widget[GdkEvent] = {"gdk_event",
+{GObject},
+ {"new",{},P},
+ {"peek",{},P,0,GdkEvent},
+ {"get",{},P,0,GdkEvent},
+ {"put",{P}},
+ {"copy",{P},P,0,GdkEvent},
+ {"get_axis",{P,I,D},B},
+ {"get_button",{P,P},B},
+ {"get_keycode",{P,P},B},
+ {"get_keyval",{P,P},B},
+ {"get_root_coords",{P,D,D},B},
+ {"get_scroll_direction",{P,P},B},
+ {"get_scroll_deltas",{P,D,D},B},
+ {"get_state",{P,P},B},
+ {"get_time",{P},I},
+ {"get_window",{P},P,0,GdkWindow},
+ {"get_event_type",{P},I},
+ {"get_event_sequence",{P},P,0,GdkEventSequence},
+ {"request_motions",{P}},
+ {"get_click_count",{P,P},B},
+ {"get_coords",{P,D,D},B},
+ {"triggers_context_menu",{P},B},
+ {"handler_set",{P,P,P}},
+ {"set_screen",{P,P}},
+ {"get_screen",{P},P,0,GdkScreen},
+ {"set_device",{P,P}},
+ {"get_device",{P},P,0,GdkDevice},
+ {"set_source_device",{P,P}},
+ {"get_source_device",{P},P,0,GdkDevice},
+"GdkEvent"}
+
+widget[GdkEventSequence] = {"gdk_event_sequence",
+{GdkEvent},
+"GdkEventSequence"}
+
+widget[GtkGesture] = {"gtk_gesture", --GTK3.14
+{GtkEventController,GObject},
+ {"get_device",{P},P},
+ {"get_window",{P},P},
+ {"set_window",{P,P}},
+ {"is_active",{P},B},
+ {"is_recognized",{P},B},
+ {"get_sequence_state",{P,P},I},
+ {"set_sequence_state",{P,P,I},B},
+ {"set_state",{P,I},B},
+ {"get_sequences",{P},A},
+ {"handles_sequence",{P,P},B},
+ {"get_last_updated_sequence",{P},P},
+ {"get_last_event",{P,P},P},
+ {"get_point",{P,P,D,D},B},
+ {"get_bounding_box",{P,P},B},
+ {"get_bounding_box_center",{P,D,D},B},
+ {"group",{P,P}},
+ {"ungroup",{P}},
+ {"get_group",{P},A},
+ {"is_grouped_with",{P,P},B},
+"GtkGesture"}
+
+widget[GtkGestureSingle] = {"gtk_gesture_single",
+{GtkGesture,GtkEventController,GObject},
+ {"get_exclusive",{P},B},
+ {"set_exclusive",{P,B}},
+ {"get_touch_only",{P},B},
+ {"set_touch_only",{P,B}},
+ {"get_button",{P},I},
+ {"set_button",{P,I}},
+ {"get_current_button",{P},I},
+ {"get_current_sequence",{P},P},
+"GtkGestureSingle"}
+
+widget[GtkGestureRotate] = {"gtk_gesture_rotate",
+{GtkGesture,GtkEventController,GObject},
+ {"new",{P},P},
+ {"get_angle_delta",{P},D},
+"GtkGestureRotate"}
+
+widget[GtkGestureZoom] = {"gtk_gesture_zoom",
+{GtkGesture,GtkEventController,GObject},
+ {"new",{P},P},
+ {"get_scale_delta",{P},D},
+"GtkGestureZoom"}
+
+widget[GtkGestureDrag] = {"gtk_gesture_drag", -- 3.14
+{GtkGestureSingle,GtkGesture,GtkEventController,GObject},
+ {"new",{P},P},
+ {"get_start_point",{P,D,D},B},
+ {"get_offset",{P,D,D},B},
+"GtkGestureDrag"}
+
+widget[GtkGesturePan] = {"gtk_gesture_pan",
+{GtkGestureDrag,GtkGestureSingle,GtkGesture,GtkEventController,GObject},
+ {"new",{P,I},P},
+ {"get_orientation",{P},I},
+ {"set_orientation",{P,I}},
+"GtkGesturePan"}
+
+widget[GtkGestureSwipe] = {"gtk_gesture_swipe",
+{GtkGestureSingle,GtkGesture,GtkEventController,GObject},
+ {"new",{P},P},
+ {"get_velocity",{P,D,D},B},
+"GtkGestureSwipe"}
+
+widget[GtkGestureLongPress] = {"gtk_gesture_long_press",
+{GtkGestureSingle,GtkGesture,GtkEventController,GObject},
+ {"new",{P},P},
+"GtkGestureLongPress"}
+
+widget[GtkGestureMultiPress] = {"gtk_gesture_multi_press",
+{GtkGestureSingle,GtkGesture,GtkEventController,GObject},
+ {"new",{P},P},
+ {"get_area",{P,P},B},
+ {"set_area",{P,P}},
+"GtkGestureMultiPress"}
+
+widget[GtkPadController] = {"gtk_pad_controller",
+{GtkEventController,GObject},
+ {"new",{P,P,P},P},
+ {"set_action_entries",{P,P,I}},
+ {"set_action",{P,I,I,I,S,S}},
+"GtkPadController"}
+
+--------------------------------------------------------------------
+-- Support for openGL;
+--------------------------------------------------------------------
+
+widget[GdkGLProfile] = {"gdk_gl_profile",
+ {},
+"GdkGLProfile"}
+
+widget[GdkGLContext] = {"gdk_gl_context",
+{GObject},
+ {"new",{},-routine_id("newGLContext")},
+ {"clear_current",{}},
+ {"make_current",{P}},
+ {"get_version",{P,I,I}},
+ {"get_shared_context",{P},P,0,GdkGLContext},
+ {"get_window",{P},P,0,GdkWindow},
+ {"get_visual",{P},P,0,GdkVisual},
+ {"get_display",{P},P,0,GdkDisplay},
+ {"set_forward_compatible",{P,B}},
+ {"get_forward_compatible",{P},B},
+ {"set_debug_enabled",{P,B}},
+ {"get_debug_enabled",{P},B},
+ {"set_required_version",{P,I,I}},
+ {"get_required_version",{P,I,I}},
+"GdkGLContext"}
+
+ function newGLContext() -- alias for new;
+ return c_func("gdk_gl_context_get_current")
+ end function
+
+widget[GtkGLArea] = {"gtk_gl_area", -- GTK 3.16
+{GtkWidget,GtkBuildable,GObject},
+ {"new",{},P},
+ {"get_context",{P},P},
+ {"set_has_alpha",{P,B}},
+ {"get_has_alpha",{P},B},
+ {"set_has_depth_buffer",{P,B}},
+ {"get_has_depth_buffer",{P},B},
+ {"make_current",{P}},
+ {"get_auto_render",{P},B},
+ {"set_auto_render",{P,B}},
+ {"get_error",{P},P},
+ {"set_error",{P,P}},
+ {"queue_render",{P}},
+ {"set_profile",{P,P}},
+ {"get_profile",{P},P,0,GdkGLProfile},
+ {"get_has_stencil_buffer",{P},B},
+ {"set_has_stencil_buffer",{P,B}},
+ {"attach_buffers",{P}},
+ {"get_required_version",{P,I,I}},
+ {"set_required_version",{P,I,I}},
+ {"get_use_es",{P},B}, -- 3.22
+ {"set_use_es",{P,B}}, -- 3.22
+"GtkGLArea"}
+
+----------------------------------------------------------------
+-- low-level x11 functions;
+----------------------------------------------------------------
+
+widget[GdkX11Display] = {"gdk_x11_display",
+{GObject},
+ {"get_user_time",{P},I},
+ {"broadcast_startup_message",{P,S,S,I}},
+ {"get_startup_notification_id",{P},S},
+ {"set_startup_notification_id",{P,S}},
+ {"get_xdisplay",{P},P},
+ {"grab",{P}},
+ {"ungrab",{P}},
+ {"set_cursor_theme",{P,S,I}},
+ {"set_window_scale",{P,I}},
+ {"get_glx_version",{P,I,I}},
+"GdkX11Display"}
+
+
+widget[GdkX11Screen] = {"gdk_x11_screen",
+{GObject},
+ {"get_screen_number",{P},I},
+ {"get_xscreen",{P},P},
+ {"get_window_manager_name",{P},S},
+ {"get_monitor_output",{P,I},I},
+ {"lookup_visual",{P,I},P,0,GdkVisual},
+ {"get_number_of_desktops",{P},I},
+ {"get_current_desktop",{P},I},
+"GdkX11Screen"}
+
+widget[GdkX11Window] = {"gdk_x11_window",
+{GObject},
+ {"lookup_for_display",{P,P},P,0,GdkWindow},
+ {"get_xid",{P},P},
+ {"move_to_current_desktop",{P}},
+ {"move_to_desktop",{P,I}},
+ {"get_desktop",{P},I},
+"GdkX11Window"}
+
+widget[GtkBindingSet] = {"gtk_binding_set",
+{GObject},
+ {"new",{S},P},
+ {"by_class",{P},P},
+ {"find",{S},P},
+ {"activate",{P,I,I,P},B},
+ {"add_path",{P,P,S,I}},
+"GtkBindingSet"}
+
+widget[GtkBindingEntry] = {"gtk_binding_entry",
+{GtkBindingSet},
+ {"add_signal",{P,I,I,S,P}},
+ {"add_signal_from_string",{P,S},I},
+ {"skip",{P,I,I}},
+ {"remove",{P,I,I}},
+"GtkBindingEntry"}
+
+widget[GdkPixbufAnimation] = {"gdk_pixbuf_animation",
+{GdkPixbuf,GObject},
+ {"new",{P},-routine_id("newPixbufAnimation")},
+ {"get_width",{P},I},
+ {"get_height",{P},I},
+ {"get_delay_time",{P},I},
+ {"is_static_image",{P},B},
+ {"get_static_image",{P},P,0,GdkPixbuf},
+ {"get_iter",{P,P},P,0,GdkPixbufAnimationIter},
+"GdkPixbufAnimation"}
+
+ function newPixbufAnimation(object name)
+ atom err = allocate(8,1) err = 0
+ if string(name)
+ and file_exists(canonical_path(name)) then
+ name = allocate_string(canonical_path(name),1)
+ end if
+ return gtk_func("gdk_pixbuf_animation_new_from_file",{P,P},{name,err})
+ end function
+
+widget[GdkPixbufAnimationIter] = {"gdk_pixbuf_animation_iter",
+{GObject},
+ {"get_pixbuf",{P},P,0,GdkPixbuf},
+ {"advance",{P,P},B},
+ {"get_delay_time",{P},I},
+ {"on_currently_loading_frame",{P},B},
+"GdkPixbufAnimationIter"}
+
+widget[GtkRecentManager] = {"gtk_recent_manager",
+{GObject},
+ {"new",{},-routine_id("recent_manager_get_default")},
+ {"add_item",{P,S},B},
+ {"add_full",{P,S,P},B},
+ {"remove_item",{P,S,P},B},
+ {"lookup_item",{P,S,P},P,0,GtkRecentInfo},
+ {"has_item",{P,S},B},
+ {"move_item",{P,S,S,P},B},
+ {"get_items",{P},X,0,GtkRecentInfo},
+ {"purge_items",{P,P},I},
+"GtkRecentManager"}
+
+ function recent_manager_get_default()
+ return gtk_func("gtk_recent_manager_get_default")
+ end function
+
+widget[GtkBuildable] = {"gtk_buildable",
+{GObject},
+ {"set_name",{P,S}},
+ {"get_name",{P},S},
+ {"add_child",{P,P,P,S}},
+ {"set_buildable_property",{P,P,S,P}},
+ {"construct_child",{P,P,S},P,0,GObject},
+ {"custom_tag_start",{P,P,P,S,P,P},B},
+ {"custom_tag_end",{P,P,P,S,P}},
+ {"custom_finished",{P,P,P,S,P}},
+ {"parser_finished",{P,P}},
+ {"get_internal_child",{P,P,S},P,0,GObject},
+"GtkBuildable"}
+
+widget[GtkBuilder] = {"gtk_builder",
+{GObject},
+ {"new",{},P},
+ {"add_callback_symbol",{P,S,P}}, -- 3.10
+ {"lookup_callback_symbol",{P,S},P}, -- 3.10
+ {"set_application",{P,P}}, -- 3.10
+ {"get_application",{P},P,0,GtkApplication}, -- 3.10
+ {"add_from_file",{P,S},-routine_id("addBuilderObjects")},
+ {"add_from_string",{P,P},-routine_id("addBuilderObjectsStr")},
+ {"get_object",{P,P},P},
+ {"get_objects",{P},A,0,GSList},
+ {"connect",{P},-routine_id("builder_connect")},
+ {"set_translation_domain",{P,S}},
+ {"get_translation_domain",{P},S},
+ {"get_type_from_name",{P,S},I},
+"GtkBuilder"}
+
+export constant builder = create(GtkBuilder)
+object current_builder_file = ""
+
+export function ID(atom ctl) -- retrieve the Glade ID property;
+ return vlookup(ctl,registry,1,4,"!")
+end function
+
+export sequence class_name_index = repeat(0,length(widget))
+ for i = 1 to length(widget) do
+ if sequence(widget[i]) then
+ class_name_index[i] = widget[i][$]
+ end if
+ end for
+
+ constant bad_from_file = define_func("gtk_builder_add_from_file",{P,P,P},I)
+ constant bad_from_string = define_func("gtk_builder_add_from_string",{P,P,I,P},I)
+
+ -- add objects from Glade XML file;
+ function addBuilderObjects(atom bld, object fname)
+ atom err = allocate(8,1) err = 0
+ integer result = c_func(bad_from_file,{bld,fname,err})
+ if result = 0 then
+ printf(1,"Error code %d loading Builder\n",err)
+ if err = 0 then
+ printf(1,"***** GTK version mismatch or other error in Glade.\n")
+ printf(1,"\t(remove or change the 'requires...' line)")
+ Error(,,"Error 8623 loading glade file",peek_string(fname))
+ end if
+ abort(0)
+ end if
+ return result
+ end function
+
+ -- add object from inline string or string variable;
+ function addBuilderObjectsStr(atom bld, object str)
+ current_builder_file = str
+ atom err = allocate(8,1) err = 0
+ integer len = length(str)
+ str = allocate_string(str,1)
+ integer result = c_func(bad_from_string,{bld,str,len,err})
+ if result = 0 then
+ printf(1,"Error 8638: loading Builder %s\n",{current_builder_file})
+ if err = 0 then
+ printf(1,"***** GTK version mismatch or other error in Glade.\n")
+ printf(1,"\t(remove or change the 'requires...' line)")
+ end if
+ abort(0)
+ end if
+ return result
+ end function
+
+ -- link signals defined in Glade, this starts a 'for' loop,
+ -- running the builder_connect_function for each control;
+ function builder_connect(atom bld)
+ gtk_func("gtk_builder_connect_signals_full",{P,P,P},{bld,builder_connect_func,0})
+ return 1
+ end function
+
+ constant builder_connect_func = call_back(routine_id("builder_connect_function"))
+
+ -- links Glade controls to user-written or Eu functions
+
+ -----------------------------------------------------------------------------
+ function builder_connect_function(atom bld, atom obj, object sig, object hdlr, atom cxo)
+ -----------------------------------------------------------------------------
+ hdlr = peek_string(hdlr)
+ sig = peek_string(sig)
+
+ if atom(current_builder_file) and (current_builder_file > 0) then
+ current_builder_file = peek_string(current_builder_file)
+ end if
+
+ atom rid = routine_id(hdlr)
+ if rid = -1 then
+ printf(1,"-----------------------------------------------------------------------\n")
+ printf(1,"-- Undeclared function in %s\n",{current_builder_file})
+ printf(1,"-----------------------------------------------------------------------\n")
+ show_template(hdlr)
+ abort(1)
+ else
+ rid = call_back(rid)
+ connect(obj,sig,rid,cxo)
+ end if
+
+ return 1
+ end function
+
+ --------------------------------------------------------------------
+ procedure load_builder(object parent, object child, object prefix=0)
+ --------------------------------------------------------------------
+ object name, class, path
+ object x, tree
+ integer c,n
+ atom err = allocate(8,1)
+
+ current_builder_file = canonical_path(child)
+ if file_exists(current_builder_file) then
+ set(parent,"add from file",current_builder_file,err)
+ set(parent,"connect")
+ prefix = filebase(child)
+ if match(prefix,filebase(prg_name)) then
+ prefix = 0 -- do not prefix main file objects
+ end if
+ x = read_lines(canonical_path(child))
+
+ elsif string(child) then
+ set(parent,"add from string",child,err)
+ set(parent,"connect")
+ x = split(child,'\n')
+ end if
+
+ for i = 1 to length(x) do
+ if string(x[i]) and match("]",{class,name,n})
+ end ifdef
+
+ class = find(class,class_name_index)
+ if class < 1 then
+ display("Error finding class for []",{name})
+ else
+ if not initialized[class] then
+ init(class)
+ end if
+ tree = widget[class][2]
+ for z = 1 to length(tree) do
+ init(tree[z])
+ end for
+ register(n,class,name)
+ end if
+ end if
+end for
+
+end procedure
+
+ -------------------------------------------------------------------------------
+ procedure show_template(object handlr) -- prompt for missing functions w/Glade;
+ -------------------------------------------------------------------------------
+ printf(1,"""
+________
+
+ -----------------------------------------------------------------------
+ global function %s()
+ -----------------------------------------------------------------------
+
+ return 1
+ end function
+
+""",{handlr})
+
+ end procedure
+
+------------------------------------------------------------------------
+-- Internet conveniences
+------------------------------------------------------------------------
+
+------------------------------------
+export function show_uri(object uri)
+------------------------------------
+
+if atom(uri) then
+ return 0
+end if
+
+display("URI: []\n",{uri})
+
+integer x = find('#',uri) -- in case link to html section;
+object tmp
+
+if x > 0 then
+ tmp = canonical_path(uri[1..x-1])
+ if file_exists(tmp) then
+ uri = tmp & uri[x..$]
+ end if
+else
+ tmp = canonical_path(uri)
+ if file_exists(tmp) then
+ uri = tmp
+ end if
+end if
+
+ifdef WINDOWS then
+ system("explore " & uri,0)
+ return 1
+end ifdef
+
+atom err = allocate(8,1) err=0
+
+object result = gtk_func("gtk_show_uri",{P,P,P,P},
+ {0,allocate_string(uri,1),0,err})
+
+ return result
+
+end function
+
+---------------------------------------------------------------------------
+-- Icon functions
+----------------------------
+export function list_icons()
+----------------------------
+ atom theme = gtk_func("gtk_icon_theme_get_default")
+ object list = gtk_func("gtk_icon_theme_list_icons",{P,P},{theme,0})
+ return to_sequence(list)
+end function
+
+----------------------------------------
+export function has_icon(object name)
+----------------------------------------
+ atom theme = gtk_func("gtk_icon_theme_get_default")
+ name = allocate_string(name,1)
+ return gtk_func("gtk_icon_theme_has_icon",{P,P},{theme,name})
+end function
+
+----------------------------------------------------------------
+export function valid_icon(object list)
+----------------------------------------------------------------
+-- check a list of possible icon names
+ object result = 0
+ if atom(list[1]) then
+ list = {list}
+ end if
+ for i = 1 to length(list) do
+ result = get_icon_image(list[i]) --display(result)
+ if string(result) then return 1 end if
+ end for
+ return result
+end function
+
+---------------------------------------------------------------
+export function valid_icon_name(object list)
+---------------------------------------------------------------
+-- check a list of possible icon names,
+-- return string name of first valid
+ for i = 1 to length(list) do
+ if valid_icon({list[i]}) > 0 then
+ return list[i]
+ end if
+ if file_exists(locate_file(list[i])) then
+ return list[i]
+ end if
+ end for
+ return "gtk-missing-image"
+end function
+
+-- get image from a variety of sources;
+------------------------------------------------------------------------------------
+ function get_icon_image(object icon, object sizex=0, object sizey=0, object sizez=1)
+-------------------------------------------------------------------------------------
+ atom img = 0, ani = 0, default_theme, handle
+ handle = to_number(icon)
+
+ if class_id(handle) = GdkPixbuf then
+ img = create(GtkImage,handle)
+ return img
+ end if
+
+ if class_id(handle) = GtkImage then
+ return handle
+ end if
+
+ if find(icon,stock_list) then
+ img = gtk_func("gtk_image_new_from_stock",{P,I},
+ {allocate_string(icon,1),sizex})
+ return img
+ end if
+
+ default_theme = gtk_func("gtk_icon_theme_get_default",{})
+ if gtk_func("gtk_icon_theme_has_icon",{P,P},
+ {default_theme,allocate_string(icon,1)}) then
+ img = create(GdkPixbuf,icon,18,18,sizez)
+ img = create(GtkImage,img)
+ register(img,GtkImage)
+ --display("Has icon []",{icon})
+ return img
+ end if
+
+ icon = locate_file(icon)
+
+ if file_type(icon) = 1 then -- image from file
+ ani = create(GdkPixbufAnimation,icon,sizex,sizey)
+ if gtk_func("gdk_pixbuf_animation_is_static_image",{P},{ani}) then
+ ani = create(GdkPixbuf,icon,sizex*6,sizey*6,sizez)
+ img = create(GtkImage,ani)
+ else
+ img = create(GtkImage)
+ set(img,"from animation",ani)
+ end if
+ return img
+ end if
+
+ return 0
+ end function
+
+--------------------------------------------------------
+export function icon_info(object name, integer size=6)
+--------------------------------------------------------
+ atom theme = gtk_func("gtk_icon_theme_get_default")
+ atom err = allocate(8,1) err = 0
+
+ atom icon_info = gtk_func("gtk_icon_theme_lookup_icon",{P,P,I,I},
+ {theme,name,size,GTK_ICON_LOOKUP_USE_BUILTIN})
+
+ object results = repeat(0,5)
+ results = {
+ gtk_func("gtk_icon_info_load_icon",{P,P},{icon_info,err}),
+ gtk_func("gtk_icon_info_get_display_name",{P},{icon_info}),
+ gtk_str_func("gtk_icon_info_get_filename",{P},{icon_info}),
+ gtk_func("gtk_icon_info_get_base_size",{P},{icon_info}),
+ gtk_func("gtk_icon_info_get_base_scale",{P},{icon_info})
+ }
+ return results
+-- returns {1,2,3,4,5}
+-- 1 = pointer to icon_info structure,
+-- 2 = display name or null,
+-- 3 = full path to icon file,
+-- 4 = base size,
+-- 5 = base scale
+-- some entries missing in some cases
+end function
+
+-----------------------------------------------------------------------------------------
+export function xpm_to_pixbuf(object xpm, integer w=0, integer h=0, integer interp=2)
+-----------------------------------------------------------------------------------------
+ atom x = gtk_func("gdk_pixbuf_new_from_xpm_data",{P},
+ {allocate_string_pointer_array(xpm)})
+ if w + h > 0 then
+ x = gtk_func("gdk_pixbuf_scale_simple",{P,I,I,I},{x,w,h,interp})
+ end if
+ register(x,GdkPixbuf)
+ return x
+end function
+
+------------------------------------------------------------------------
+-- Following 3 functions simplify method calls; used mostly internally,
+-- but can also be called by the programmer to execute any GTK, GDK or
+-- GLib function which has not been implemented in EuGTK.
+-------------------------------------------------------------------------
+export function gtk_func(object name, object params={}, object values={})
+-------------------------------------------------------------------------
+-- syntax: result = gtk_func("gtk_*_*",{formal params},{values})
+-- where formal params might be {P,P,I} (function expects Ptr, Ptr, and Int)
+-- and values are the values to be inserted into the formal params before
+-- the function is called;
+
+ name = '+' & name
+
+ for i = 1 to length(params) do
+ if string(values[i]) then
+ values[i] = allocate_string(values[i],1)
+ end if
+ end for
+
+ if atom(values) then
+ values = {values}
+ end if
+
+ atom fn = define_func(name,params,P)
+
+ if fn > 0 then
+ return c_func(fn,values)
+ else
+ return -1
+ end if
+
+end function
+
+-----------------------------------------------------------------------------
+export function gtk_str_func(object name, object params={}, object values={})
+-----------------------------------------------------------------------------
+-- syntax: same as above, except a string result is returned
+
+ for i = 1 to length(params) do
+ if string(values[i]) then
+ values[i] = allocate_string(values[i],1)
+ end if
+ end for
+
+ name = '+' & name
+
+ atom fn = define_func(name,params,P)
+ object result
+
+ if fn > 0 then
+ if length(params) > 0 then
+ result = c_func(fn,values)
+ else
+ result = c_func(fn,{})
+ end if
+ if result > 0 then
+ return peek_string(result)
+ end if
+ end if
+
+ return 0
+end function
+
+--------------------------------------------------------------------------
+export function gtk_proc(object name, object params={}, object values={})
+--------------------------------------------------------------------------
+-- syntax: same as above, but no value is returned, used to call GTK procs
+atom fn
+
+ if string(values) then values = {values} end if
+
+ name = '+' & name
+
+ for i = 1 to length(params) do
+ if sequence(values) and string(values[i]) then
+ values[i] = allocate_string(values[i]) -- keep
+ end if
+ end for
+
+ if length(params) = 0 then
+ fn = define_proc(name)
+ if fn > 0 then
+ c_proc(fn,{})
+ end if
+ else
+ fn = define_proc(name,params)
+ if fn > 0 then
+ if atom(values) then values = {values} end if
+ c_proc(fn,values)
+ end if
+ end if
+return values
+end function
+
+-- The following 2 functions had to be added for Windows, so that we could search
+-- a list of dlls until we find the function name requested. I'm not sure the '+'
+-- is necessary for 32-bit Windows, since I don't have a 32-bit computer anymore.
+----------------------------------------------------------------------------------------
+export function define_proc(object name, object params={})
+----------------------------------------------------------------------------------------
+atom x
+
+ for i = 1 to length(LIBS) do
+ if atom(LIBS[i]) and LIBS[i] > 0 then
+ x = define_c_proc(LIBS[i],name,params)
+ if x > 0 then
+ return x
+ end if
+ end if
+ end for
+
+ return -1
+end function
+
+---------------------------------------------------------------------------
+export function define_func(object name, object params={}, object values=P)
+---------------------------------------------------------------------------
+atom x
+
+ ifdef BITS32 and WINDOWS then name = '+' & name end ifdef
+ for i = 1 to length(LIBS) do
+ if atom(LIBS[i]) and LIBS[i] > 0 then
+ x = define_c_func(LIBS[i],name,params,values)
+ if x > 0 then
+ return x
+ end if
+ end if
+ end for
+
+ return -1
+end function
+
+-----------------------------------------------------------------------------------
+-- Color handling routines - most are used internally, but exported if you need 'em
+-----------------------------------------------------------------------------------
+
+----------------------------------------
+export function to_rgba(object color) -- converts a color description to rgba ptr;
+----------------------------------------
+ atom rgba = allocate(32) -- keep;
+ object c = color
+ if string(c) then c = allocate_string(c,1) end if
+ if gtk_func("gdk_rgba_parse",{P,P},{rgba,c}) then
+ return rgba
+ else
+ printf(1,"\nError: invalid color '%s'\n******\n",{color})
+ return 0
+ end if
+ return rgba
+end function
+
+-------------------------------------------------------
+export function from_rgba(object rgba, object fmt=0) -- converts rgba ptr to description;
+-------------------------------------------------------
+object result = gtk_str_func("gdk_rgba_to_string",{P},{rgba})
+ if fmt=0 then return result
+ else return fmt_color(result,fmt)
+ end if
+end function
+
+----------------------------------------------
+function fmt_color(object s, integer fmt=0) -- Convert color to various formats;
+----------------------------------------------
+ if atom(s) then
+ if string(peek_string(s)) then
+ s = peek_string(s)
+ end if
+ end if
+object w
+ w = split_any(s,"(,)")
+ if length(w[1]) = 3 then
+ w[5] = "1"
+ end if
+ for i = 2 to 5 do
+ w[i] = to_number(w[i])
+ end for
+ if atom(w[5]) then
+ w[5] = round(w[5],100)
+ end if
+ switch fmt do
+ case 0 then return w[1..length(w[1])+1]
+ case 1 then return sprintf("#%02x%02x%02x",w[2..4])
+ case 2 then return (256*256*w[2])+(256*w[3])+ w[4]
+ case 3 then return {w[2],w[3],w[4]}
+ case 4 then return {w[2],w[3],w[4],w[5]}
+ case 5 then return {w[2],w[3],w[4],256*w[5]}
+ case 6 then return sprintf("rgba(%d,%d,%d,%2.2f)",w[2..$])
+ case 7 then return {w[2]/255,w[3]/255,w[4]/255,w[5]}
+ case 8 then return sprintf("r=#%x, g=#%x, b=#%x, alpha=#%x",w[2..5])
+ case else -- do nothing
+ end switch
+return s
+end function
+
+
+
+------------------------------------------------------------------------
+-- Following are 5 pre-built, easy to use popup dialogs
+-- which save you the trouble of writing tons of code!
+-- Refer to documentation/dialogs.html for details.
+-- Rewritten for 4.8.8 to preserve images on dialog buttons despite
+-- GTK developers' bland, boring preferences :P
+-- Beginning with EuGTK 4.9.3, dialogs can be non-modal if desired.
+------------------------------------------------------------------------
+
+public function Info(object parent=0, object title="Info",
+ object pri_txt="", object sec_txt="",
+ object btns=GTK_BUTTONS_OK,
+ object image="dialog-information",
+ object icon=0,
+ integer modal=1,
+ object addon=0,
+ integer x=-1,
+ integer y=-1,
+ object name="Info")
+ return Custom(parent,title,pri_txt,sec_txt,btns,image,icon,modal,addon,x,y,name)
+end function
+
+public function Warn(object parent=0, object title="Warning",
+ object pri_txt="", object sec_txt="",
+ object btns=GTK_BUTTONS_CLOSE,
+ object image="dialog-warning",
+ object icon=0,
+ integer modal=1,
+ object addon=0,
+ integer x=-1,
+ integer y=-1,
+ object name="Warn")
+ return Custom(parent,title,pri_txt,sec_txt,btns,image,icon,modal,addon,x,y,name)
+end function
+
+public function Error(object parent=0, object title="Error",
+ object pri_txt="", object sec_txt="",
+ object btns=GTK_BUTTONS_OK_CANCEL,
+ object image="dialog-error",
+ object icon=0,
+ integer modal=1,
+ object addon=0,
+ integer x=-1,
+ integer y=-1,
+ object name="Error")
+ return Custom(parent,title,pri_txt,sec_txt,btns,image,icon,modal,addon,x,y,name)
+end function
+
+public function Question(object parent=0, object title="Question",
+ object pri_txt="", object sec_txt="",
+ object btns=GTK_BUTTONS_YES_NO,
+ object image="dialog-question",
+ object icon=0,
+ integer modal=1,
+ object addon=0,
+ integer x=-1,
+ integer y=-1,
+ object name="Question")
+ return Custom(parent,title,pri_txt,sec_txt,btns,image,icon,modal,addon,x,y,name)
+end function
+
+integer closedlg = call_back(routine_id("close_dialog"))
+
+--------------------------------------------------------------
+public function Custom(
+ object parent=0, --1
+ object title="Dialog", --2
+ object pri_txt="", --3
+ object sec_txt="", --4
+ object btns=GTK_BUTTONS_OK, --5
+ object image=0, --6
+ object icon=0, --7
+ integer modal=GTK_DIALOG_MODAL, --8
+ object addon=0, --9
+ integer x=-1, --10
+ integer y=-1, --11
+ object name="Custom") --12
+--------------------------------------------------------------
+ atom dlg = create(GtkDialog)
+ atom btnbox = create(GtkButtonBox)
+ atom ca = 0
+ atom top = 0, left = 0, right = 0
+ atom lbl1 = 0
+ atom capanel = create(GtkBox,VERTICAL)
+ object btn = repeat(0,2)
+
+ if string(parent) then
+ parent = get(builder,"object",parent)
+ end if
+
+ if parent = 0 then
+ for i = 1 to length(registry) do
+ if registry[i][2] = 293 then
+ parent = registry[i][1]
+ exit
+ end if
+ end for
+ end if
+
+ if parent > 0 and atom(icon) and icon = 0 then
+ icon = get(parent,"icon name")
+ end if
+
+ if atom(pri_txt) and pri_txt > 0 then pri_txt = unpack(pri_txt) end if
+ if atom(sec_txt) and sec_txt > 0 then sec_txt = unpack(sec_txt) end if
+ if class_id(addon) = GdkPixbuf then addon = create(GtkImage,addon) end if
+
+ set(dlg,{
+ {"transient for",parent},
+ {"title"," " & title},
+ {"border width",5},
+ {"icon",icon},
+ {"position",GTK_WIN_POS_MOUSE}})
+
+ if string(name) then
+ set(dlg,"name",name)
+ end if
+
+ ca = get(dlg,"content area")
+ capanel = create(GtkBox,VERTICAL)
+ add(ca,capanel)
+
+ top = create(GtkBox,HORIZONTAL,2)
+ add(capanel,top)
+
+ left = create(GtkBox,VERTICAL,5)
+ right = create(GtkBox,VERTICAL,5)
+ add(top,{left,right})
+
+ if string(image) then
+ add(left,create(GtkImage,image,GTK_ICON_SIZE_DIALOG))
+
+ elsif image > 0 then
+ if class_id(image) = GdkPixbuf
+ or class_id(image) = GIcon then
+ image = create(GtkImage,image)
+ end if
+ add(left,image)
+ end if
+
+ lbl1 = create(GtkLabel)
+ set(lbl1,"name",name & "_label")
+ set(lbl1,"markup",text:format("[] \n[]",{pri_txt,sec_txt}))
+ set(lbl1,"halign",0)
+
+ add(right,lbl1)
+
+ if atom(addon) and addon > 0 then
+ atom p2 = create(GtkBox,VERTICAL)
+ add(capanel,p2)
+ if get(addon,"parent") != 0 then
+ set(addon,"reparent",p2)
+ else
+ add(p2,addon)
+ end if
+ end if
+
+ show_all(capanel)
+
+ if integer(btns) then
+
+ switch btns do
+
+ case GTK_BUTTONS_NONE then break
+
+ case GTK_BUTTONS_OK then
+ btn[1] = create(GtkButton,"gtk-ok")
+ set(dlg,"add action widget",btn[1],MB_OK)
+ show(btn[1])
+
+ case GTK_BUTTONS_OK_CANCEL then
+ btn[1] = create(GtkButton,"gtk-cancel")
+ btn[2] = create(GtkButton,"gtk-ok")
+ set(dlg,"add action widget",btn[1],MB_CANCEL)
+ set(dlg,"add action widget",btn[2],MB_OK)
+ show(btn[1]) show(btn[2])
+
+ case GTK_BUTTONS_CLOSE then
+ btn[1] = create(GtkButton,"gtk-close")
+ set(btn[1],"can default",TRUE)
+ set(dlg,"add action widget",btn[1],MB_CLOSE)
+ show(btn[1])
+
+ case GTK_BUTTONS_YES_NO then
+ btn[1] = create(GtkButton,"gtk-yes")
+ set(dlg,"add action widget",btn[1],MB_YES)
+ btn[2] = create(GtkButton,"gtk-no")
+ set(dlg,"add action widget",btn[2],MB_NO)
+ show(btn[1]) show(btn[2])
+
+ case else btn[1] = create(GtkButton,"gtk-ok")
+ set(btn[1],"can default",TRUE)
+ set(dlg,"add action widget",btn[1],MB_OK)
+ show(btn[1])
+
+ end switch
+ end if
+
+ if sequence(btns) and not atom(btns[1]) then
+ set(btnbox,"margin top",5)
+ pack(capanel,-btnbox)
+ for i = 1 to length(btns) do
+ while length(btns[i]) < 3 do btns[i] &= 0 end while
+ if atom(btns[i][2]) and btns[i][2] = 0 then btns[i][2] = closedlg end if
+ if atom(btns[i][3]) and btns[i][3] = 0 then btns[i][3] = {dlg,MB_CANCEL} end if
+ btns[i] = create(GtkButton,btns[i][1],btns[i][2],btns[i][3])
+ end for
+ add(btnbox,btns)
+ show_all(btnbox)
+ end if
+
+ if x+y > 0 then
+ set(dlg,"move",x,y)
+ end if
+
+ atom result = 0
+ set(dlg,"modal",modal)
+ if modal = GTK_DIALOG_NON_MODAL then
+ return show_all(dlg)
+ else
+ result = get(dlg,"run")
+ destroy(dlg)
+ end if
+
+ return result
+end function
+
+-------------------------------
+export function run(object dlg)
+-------------------------------
+ if string(dlg) then
+ dlg = pointer(dlg)
+ end if
+ object result = get(dlg,"run")
+ return result
+end function
+
+global integer dialog_return_value = 0
+
+function close_dialog(object ctl, object dlg)
+ dlg = unpack(dlg)
+ dialog_return_value = dlg[2]
+ set(dlg[1],"hide")
+ return 1
+end function
+
+--------------------------------------------
+-- Nifty shortcut, thanks to Greg Haberek,
+-- allows using local functions without
+-- call_back(routine_id()) and scope issues:
+--------------------------------------------
+export function _(sequence name, atom rid = routine_id(name))
+ if rid > 0 then
+ return call_back(rid)
+ end if
+ return 0
+end function
+
+---------------------------------
+-- © 2016 by Irv Mullins
+---------------------------------
diff --git a/eugtk/examples/GtkEnums.e b/eugtk/examples/GtkEnums.e
new file mode 100644
index 0000000..741f014
--- /dev/null
+++ b/eugtk/examples/GtkEnums.e
@@ -0,0 +1,1514 @@
+
+----------------
+namespace enums
+----------------
+
+export constant version = "4.12.0"
+
+public include std/io.e
+public include std/os.e
+public include std/dll.e
+public include std/text.e
+public include std/math.e
+public include std/error.e
+public include std/text.e
+public include std/types.e
+public include std/search.e
+public include std/convert.e
+public include std/console.e
+public include std/filesys.e
+public include std/machine.e
+public include std/sequence.e
+public include std/serialize.e
+
+public constant LGPL = read_file(locate_file("resources/license.txt"))
+
+---------------------------------------------------------------------------------
+-- ListView/TreeView storage types. Use these when creating new
+-- GtkListStores or GtkTreeStores
+---------------------------------------------------------------------------------
+public enum
+ gCHAR = 12, gUCHAR = 16, gINT = 24, gUINT = 28,
+ gLONG = 32, gULONG = 36, gINT64 = 40, gUINT64 = 44,
+ gDBL = 60, gFLT = 56, gSTR = 64, gPTR = 68, gBOOL= 20, gDOL = 99
+-- plus gPIX and gCOMBO, which must be defined at run-time
+-- by GtkEngine.e ... don't ask me why!
+
+public sequence storage_types = {
+ {12,"gCHAR"},
+ {16,"gUCHAR"},
+ {20,"gBOOL"},
+ {24,"gINT"},
+ {28,"gUINT",
+ {32,"gLONG"},
+ {36,"gULONG"},
+ {40,"gINT64"},
+ {44,"gUINT64"},
+ {56,"gFLT"},
+ {60,"gDBL"},
+ {64,"gSTR"},
+ {68,"gPTR"},
+ {99,"gDOL"}
+}}
+-- here's a list of GObject types;
+public enum type OBJECT by 4
+ void = 4,
+ GInterface,
+ gchar,
+ guchar,
+ gboolean,
+ gint,
+ guint,
+ glong,
+ gulong,
+ gint64,
+ guint64,
+ GEnum,
+ GFlags,
+ gfloat,
+ gdouble,
+ gchararray,
+ gpointer,
+ GBoxed,
+ GParam
+end type
+
+------------------------------------------------------------------------
+-- These are the widget class names used to create GTK widgets;
+-- GObject MUST be first on the list, and GtkFinal must be last!
+-- Other than that, order is unimportant, but try to keep 'em in
+-- alphabetical order just to be neat.
+------------------------------------------------------------------------
+public enum type WIDGET
+ GObject,
+ GAction,
+ GActionGroup,
+ GActionMap,
+ GAppInfo,
+ GApplication,
+ GDateTime,
+ GEmblem,
+ GEmblemedIcon,
+ GFile,
+ GFileIcon,
+ GFileInfo,
+ GFileInputStream,
+ GIcon,
+ GIdle,
+ GInputStream,
+ GKeyFile,
+ GList,
+ GMenu,
+ GMenuItem,
+ GMenuModel,
+ GNotification,
+ GPermission,
+ GPropertyAction,
+ GSettings,
+ GSimpleAction,
+ GSimpleActionGroup,
+ GSimplePermission,
+ GSList,
+ GThemedIcon,
+ GTimeout,
+ Cairo_t,
+ CairoFontOptions,
+ CairoContent_t,
+ CairoLinearGradient,
+ CairoPattern,
+ CairoPattern_t,
+ CairoRadialGradient,
+ CairoRegion_t,
+ CairoImageSurface,
+ CairoStatus_t,
+ CairoSurface_t,
+ GdkAppLaunchContext,
+ GdkCairo_t,
+ GdkCursor,
+ GdkDevice,
+ GdkDeviceManager,
+ GdkDisplay,
+ GdkEvent,
+ GdkEventSequence,
+ GdkFrameClock,
+ GdkFrameTimings,
+ GdkGLContext,
+ GdkGLProfile,
+ GdkInputSource,
+ GdkKeymap,
+ GdkPixbuf,
+ GdkPixbufAnimation,
+ GdkPixbufAnimationIter,
+ GdkPixbufFormat,
+ GdkScreen,
+ GdkVisual,
+ GdkWindow,
+ GdkX11Display,
+ GdkX11Screen,
+ GdkX11Window,
+ GtkAboutDialog,
+ GtkAccelGroup,
+ GtkAccelLabel,
+ GtkActionable,
+ GtkActionBar,
+ GtkAdjustment,
+ GtkAlignment,
+ GtkAppChooser,
+ GtkAppChooserButton,
+ GtkAppChooserDialog,
+ GtkAppChooserWidget,
+ GtkAppLaunchContext,
+ GtkApplication,
+ GtkApplicationWindow,
+ GtkArrow,
+ GtkAspectFrame,
+ GtkAssistant,
+ GtkBin,
+ GtkBindingEntry,
+ GtkBindingSet,
+ GtkBox,
+ GtkBuildable,
+ GtkBuilder,
+ GtkButton,
+ GtkButtonBox,
+ GtkCalendar,
+ GtkCellArea,
+ GtkCellAreaBox,
+ GtkCellAreaCell,
+ GtkCellAreaContext,
+ GtkCellEditable,
+ GtkCellLayout,
+ GtkCellRenderer,
+ GtkCellRendererAccel,
+ GtkCellRendererCombo,
+ GtkCellRendererPixbuf,
+ GtkCellRendererProgress,
+ GtkCellRendererSpin,
+ GtkCellRendererSpinner,
+ GtkCellRendererText,
+ GtkCellRendererToggle,
+ GtkCellView,
+ GtkCheckButton,
+ GtkCheckMenuItem,
+ GtkClipboard,
+ GtkColorButton,
+ GtkColorChooser,
+ GtkColorChooserDialog,
+ GtkColorChooserWidget,
+ GtkColorSelection,
+ GtkColorSelectionDialog,
+ GtkColumn, Column, -- aliases for GtkTreeViewColumn.new function;
+ GtkComboBox,
+ GtkComboBoxEntry,
+ GtkComboBoxText,
+ GtkContainer,
+ GtkCssProvider,
+ GtkCssSection,
+ GtkDialog,
+ GtkDrag,
+ GtkDragDest,
+ GtkDragSource,
+ GtkDrawingArea,
+ GtkEditable,
+ GtkEntry,
+ GtkEntryBuffer,
+ GtkEntryCompletion,
+ GtkEventBox,
+ GtkEventController,
+ GtkExpander,
+ GtkFileChooser,
+ GtkFileChooserButton,
+ GtkFileChooserDialog,
+ GtkFileChooserNative,
+ GtkFileChooserWidget,
+ GtkFileFilter,
+ GtkFixed,
+ GtkFlowBox,
+ GtkFlowBoxChild,
+ GtkFontButton,
+ GtkFontChooser,
+ GtkFontChooserDialog,
+ GtkFontChooserWidget,
+ GtkFrame,
+ GtkGesture,
+ GtkGestureSingle,
+ GtkGestureDrag,
+ GtkGestureLongPress,
+ GtkGestureMultiPress,
+ GtkGesturePan,
+ GtkGestureRotate,
+ GtkGestureSwipe,
+ GtkGestureZoom,
+ GtkGLArea,
+ GtkGrid,
+ GtkHeaderBar,
+ GtkIconInfo,
+ GtkIconTheme,
+ GtkIconView,
+ GtkImage,
+ GtkImageMenuItem,
+ GtkInfoBar,
+ GtkInvisible,
+ GtkLabel,
+ GtkLayout,
+ GtkLevelBar,
+ GtkLinkButton,
+ GtkListBox,
+ GtkListBoxRow,
+ GtkListStore,
+ GtkLockButton,
+ GtkMenu,
+ GtkMenuBar,
+ GtkMenuButton,
+ GtkMenuItem,
+ GtkMenuShell,
+ GtkMenuToolButton,
+ GtkMessageDialog,
+ GtkMisc,
+ GtkModelButton,
+ GtkMountOperation,
+ GtkNativeDialog,
+ GtkNotebook,
+ GtkNumerableIcon,
+ GtkOffscreenWindow,
+ GtkOrientable,
+ GtkOverlay,
+ GtkPadController,
+ GtkPaperSize,
+ GtkPageRange,
+ GtkPageSetup,
+ GtkPageSetupUnixDialog,
+ GtkPaned,
+ GtkPlacesSidebar,
+ GtkPlug,
+ GtkPopover,
+ GtkPopoverMenu,
+ GtkPrinter,
+ GtkPrintContext,
+ GtkPrintJob,
+ GtkPrintSettings,
+ GtkPrintOperation,
+ GtkPrintUnixDialog,
+ GtkProgressBar,
+ GtkRadioButton,
+ GtkRadioMenuItem,
+ GtkRadioToolButton,
+ GtkRange,
+ GtkRecentChooser,
+ GtkRecentChooserDialog,
+ GtkRecentChooserMenu,
+ GtkRecentChooserWidget,
+ GtkRecentFilter,
+ GtkRecentInfo,
+ GtkRecentManager,
+ GtkRevealer,
+ GtkScale,
+ GtkScaleButton,
+ GtkScrollable,
+ GtkScrollbar,
+ GtkScrolledWindow,
+ GtkSearchBar,
+ GtkSearchEntry,
+ GtkSelectionData,
+ GtkSeparator,
+ GtkSeparatorMenuItem,
+ GtkSeparatorToolItem,
+ GtkSettings,
+ GtkShortcutsGesture,
+ GtkShortcutsGroup,
+ GtkShortcutsSection,
+ GtkShortcutsShortcut,
+ GtkShortcutsWindow,
+ GtkSocket,
+ GtkSidebar,
+ GtkSizeGroup,
+ GtkSpinButton,
+ GtkSpinner,
+ GtkStack,
+ GtkStackSidebar,
+ GtkStackSwitcher,
+ GtkStatusbar,
+ GtkStatusIcon,
+ GtkStockList,
+ GtkStyle,
+ GtkStyleContext,
+ GtkStyleProvider,
+ GtkSwitch,
+ GtkTargetEntry,
+ GtkTargetList,
+ GtkTextAttributes,
+ GtkTextBuffer,
+ GtkTextChildAnchor,
+ GtkTextIter,
+ GtkTextMark,
+ GtkTextTag,
+ GtkTextTagTable,
+ GtkTextView,
+ GtkThemedIcon,
+ GtkToggleButton,
+ GtkToggleToolButton,
+ GtkToolbar,
+ GtkToolButton,
+ GtkToolItem,
+ GtkToolItemGroup,
+ GtkToolPalette,
+ GtkToolShell,
+ GtkTooltip,
+ GtkTreeDragDest,
+ GtkTreeDragSource,
+ GtkTreeIter,
+ GtkTreeModel,
+ GtkTreeModelFilter,
+ GtkTreeModelSort,
+ GtkTreePath,
+ GtkTreeRowReference,
+ GtkTreeSelection,
+ GtkTreeSortable,
+ GtkTreeStore,
+ GtkTreeView,
+ GtkTreeViewColumn,
+ GtkViewport,
+ GtkVolumeButton,
+ GtkWidget,
+ GtkWidgetClass,
+ GtkWidgetPath,
+ GtkWindow,
+ GtkWindowGroup,
+ PangoAttrList,
+ PangoCairoLayout,
+ PangoContext,
+ PangoFont,
+ PangoFontSet,
+ PangoFontsetSimple,
+ PangoFontDescription,
+ PangoFontFace,
+ PangoFontFamily,
+ PangoFontMap,
+ PangoLanguage,
+ PangoLayout,
+ PangoLayoutIter,
+ PangoLayoutLine,
+ PangoLayoutRun,
+ PangoTabArray,
+ GtkFinal
+end type
+
+------------------------------------------------------------------------
+
+public enum -- Response codes returned by button presses, etc;
+ MB_YES = -8,
+ MB_NO = -9,
+ MB_OK = -5,
+ MB_CANCEL = -6,
+ MB_CLOSE = -7,
+ MB_ABORT = -4,
+ MB_NONE = -1,
+ MB_REJECT = -2,
+ MB_ACCEPT = -3,
+ MB_APPLY = -10,
+ MB_HELP = -11
+
+-----------------------------------------------------------------------------------------
+-- a zillion or so GTK_CONSTANTS used to make code clearer. See GTK docs.
+-----------------------------------------------------------------------------------------
+
+public enum type Orientation
+ VERTICAL = 1, HORIZONTAL = 0 end type
+
+public enum type SortOrder
+ UNSORTED = -1, ASCENDING = 1, DESCENDING = 2 end type
+
+public enum by 2 -- Cursors:
+ GDK_X_CURSOR = 0,
+ GDK_ARROW,
+ GDK_BASED_ARROW_DOWN,
+ GDK_BASED_ARROW_UP,
+ GDK_BOAT,
+ GDK_BOGOSITY,
+ GDK_BOTTOM_LEFT_CORNER,
+ GDK_BOTTOM_RIGHT_CORNER,
+ GDK_BOTTOM_SIDE,
+ GDK_BOTTOM_TEE,
+ GDK_BOX_SPIRAL,
+ GDK_CENTER_PTR,
+ GDK_CIRCLE,
+ GDK_CLOCK,
+ GDK_COFFEE_MUG,
+ GDK_CROSS,
+ GDK_CROSS_REVERSE,
+ GDK_CROSSHAIR,
+ GDK_DIAMOND_CROSS,
+ GDK_DOT,
+ GDK_DOTBOX,
+ GDK_DOUBLE_ARROW,
+ GDK_DRAFT_LARGE,
+ GDK_DRAFT_SMALL,
+ GDK_DRAPED_BOX,
+ GDK_EXCHANGE,
+ GDK_FLEUR,
+ GDK_GOBBLER,
+ GDK_GUMBY,
+ GDK_HAND1,
+ GDK_HAND2,
+ GDK_HEART,
+ GDK_ICON,
+ GDK_IRON_CROSS,
+ GDK_LEFT_PTR,
+ GDK_LEFT_SIDE,
+ GDK_LEFT_TEE,
+ GDK_LEFTBUTTON,
+ GDK_LL_ANGLE,
+ GDK_LR_ANGLE,
+ GDK_MAN,
+ GDK_MIDDLEBUTTON,
+ GDK_MOUSE,
+ GDK_PENCIL,
+ GDK_PIRATE, --?
+ GDK_PLUS,
+ GDK_QUESTION_ARROW,
+ GDK_RIGHT_PTR,
+ GDK_RIGHT_SIDE,
+ GDK_RIGHT_TEE,
+ GDK_RIGHTBUTTON,
+ GDK_RTL_LOGO,
+ GDK_SAILBOAT,
+ GDK_SB_DOWN_ARROW,
+ GDK_SB_H_DOUBLE_ARROW,
+ GDK_SB_LEFT_ARROW,
+ GDK_SB_RIGHT_ARROW,
+ GDK_SB_UP_ARROW,
+ GDK_SB_V_DOUBLE_ARROW,
+ GDK_SHUTTLE,
+ GDK_SIZING,
+ GDK_SPIDER,
+ GDK_SPRAYCAN,
+ GDK_STAR,
+ GDK_TARGET,
+ GDK_TCROSS,
+ GDK_TOP_LEFT_ARROW,
+ GDK_TOP_LEFT_CORNER,
+ GDK_TOP_RIGHT_CORNER,
+ GDK_TOP_SIDE,
+ GDK_TOP_TEE,
+ GDK_TREK,
+ GDK_UL_ANGLE,
+ GDK_UMBRELLA,
+ GDK_UR_ANGLE,
+ GDK_WATCH,
+ GDK_XTERM,
+ GDK_LAST_CURSOR = 153,
+ GDK_BLANK_CURSOR = -2,
+ GDK_CURSOR_IS_PIXMAP = -1
+
+public enum
+ GTK_LICENSE_UNKNOWN = 0,
+ GTK_LICENSE_CUSTOM,
+ GTK_LICENSE_GPL_2_0,
+ GTK_LICENSE_GPL_3_0,
+ GTK_LICENSE_LGPL_2_1,
+ GTK_LICENSE_LGPL_3_0,
+ GTK_LICENSE_BSD,
+ GTK_LICENSE_MIT_X11,
+ GTK_LICENSE_ARTISTIC,
+ GTK_LICENSE_GPL_2_0_ONLY,
+ GTK_LICENSE_GPL_3_0_ONLY,
+ GTK_LICENSE_LGPL_2_1_ONLY,
+ GTK_LICENSE_LGPL_3_0_ONLY,
+
+ GTK_ACCEL_VISIBLE = 1,
+ GTK_ACCEL_LOCKED = 2,
+ GTK_ACCEL_MASK = 7,
+
+ GTK_ALIGN_FILL = 0,
+ GTK_ALIGN_START,
+ GTK_ALIGN_END,
+ GTK_ALIGN_CENTER,
+
+ GTK_ANCHOR_CENTER = 0,
+ GTK_ANCHOR_NORTH,
+ GTK_ANCHOR_NORTH_WEST,
+ GTK_ANCHOR_NORTH_EAST,
+ GTK_ANCHOR_SOUTH,
+ GTK_ANCHOR_SOUTH_WEST,
+ GTK_ANCHOR_SOUTH_EAST,
+ GTK_ANCHOR_WEST,
+ GTK_ANCHOR_EAST,
+ GTK_ANCHOR_N = 1,
+ GTK_ANCHOR_NW,
+ GTK_ANCHOR_NE,
+ GTK_ANCHOR_S,
+ GTK_ANCHOR_SW,
+ GTK_ANCHOR_SE,
+ GTK_ANCHOR_W,
+ GTK_ANCHOR_E,
+
+ GTK_APPLICATION_INHIBIT_LOGOUT = 1,
+ GTK_APPLICATION_INHIBIT_SWITCH = 2,
+ GTK_APPLICATION_INHIBIT_SUSPEND = 4,
+ GTK_APPLICATION_INHIBIT_IDLE = 8,
+
+ G_APPLICATION_FLAGS_NONE = 0,
+ G_APPLICATION_IS_SERVICE,
+ G_APPLICATION_IS_LAUNCHER,
+ G_APPLICATION_HANDLES_OPEN = 4,
+ G_APPLICATION_HANDLES_COMMAND_LINE = 8,
+ G_APPLICATION_SEND_ENVIRONMENT = 16,
+ G_APPLICATION_NON_UNIQUE = 32,
+
+-- arrows are deprecated
+ GTK_ARROWS_BOTH = 0,
+ GTK_ARROWS_START,
+ GTK_ARROWS_END,
+
+ GTK_ARROW_UP = 0,
+ GTK_ARROW_DOWN,
+ GTK_ARROW_LEFT,
+ GTK_ARROW_RIGHT,
+ GTK_ARROW_NONE,
+
+ GTK_ASSISTANT_PAGE_CONTENT = 0,
+ GTK_ASSISTANT_PAGE_INTRO,
+ GTK_ASSISTANT_PAGE_CONFIRM,
+ GTK_ASSISTANT_PAGE_SUMMARY,
+ GTK_ASSISTANT_PAGE_PROGRESS,
+ GTK_ASSISTANT_PAGE_CUSTOM,
+
+ GTK_EXPAND = 1,
+ GTK_SHRINK = 2,
+ GTK_FILL = 4,
+
+ GTK_BASELINE_POSITION_TOP = 0,
+ GTK_BASELINE_POSITION_CENTER,
+ GTK_BASELINE_POSITION_BOTTOM,
+
+ GTK_BORDER_STYLE_NONE = 0,
+ GTK_BORDER_STYLE_SOLID,
+ GTK_BORDER_STYLE_INSET,
+ GTK_BORDER_STYLE_OUTSET,
+ GTK_BORDER_STYLE_HIDDEN,
+ GTK_BORDER_STYLE_DOTTED,
+ GTK_BORDER_STYLE_DASHED,
+ GTK_BORDER_STYLE_DOUBLE,
+ GTK_BORDER_STYLE_GROOVE,
+ GTK_BORDER_STYLE_RIDGE,
+
+ GTK_BUTTON_ROLE_NORMAL = 0,
+ GTK_BUTTON_ROLE_CHECK,
+ GTK_BUTTON_ROLE_RADIO,
+
+ GTK_BUTTONS_NONE = 0,
+ GTK_BUTTONS_OK,
+ GTK_BUTTONS_CLOSE,
+ GTK_BUTTONS_CANCEL,
+ GTK_BUTTONS_YES_NO,
+ GTK_BUTTONS_OK_CANCEL,
+
+ GTK_BUTTONBOX_DEFAULT_STYLE = 0,
+ GTK_BUTTONBOX_SPREAD,
+ GTK_BUTTONBOX_EDGE,
+ GTK_BUTTONBOX_START,
+ GTK_BUTTONBOX_END,
+ GTK_BUTTONBOX_CENTER,
+ GTK_BUTTONBOX_EXPAND,
+
+ GTK_CALENDAR_SHOW_HEADING = 1,
+ GTK_CALENDAR_SHOW_DAY_NAMES = 2,
+ GTK_CALENDAR_NO_MONTH_CHANGE = 4,
+ GTK_CALENDAR_SHOW_WEEK_NUMBERS = 8,
+ GTK_CALENDAR_SHOW_DETAILS = 16,
+
+ GTK_CORNER_TOP_LEFT = 0,
+ GTK_CORNER_BOTTOM_LEFT,
+ GTK_CORNER_TOP_RIGHT,
+ GTK_CORNER_BOTTOM_RIGHT,
+
+ GTK_CURVE_TYPE_LINEAR = 0,
+ GTK_CURVE_TYPE_SPLINE,
+ GTK_CURVE_TYPE_FREE,
+
+ GTK_DELETE_CHARS = 0,
+ GTK_DELETE_WORD_ENDS,
+ GTK_DELETE_WORDS,
+ GTK_DELETE_DISPLAY_LINES,
+ GTK_DELETE_DISPLAY_LINE_ENDS,
+ GTK_DELETE_PARAGRAPH_ENDS,
+ GTK_DELETE_PARAGRAPHS,
+ GTK_DELETE_WHITESPACE,
+
+ GTK_DIALOG_NON_MODAL = 0,
+ GTK_DIALOG_MODAL = 1,
+ GTK_DIALOG_DESTROY_WITH_PARENT = 2,
+ GTK_DIALOG_NO_SEPARATOR = 4,
+
+ GTK_DIR_TAB_FORWARD = 0,
+ GTK_DIR_TAB_BACKWARD,
+ GTK_DIR_UP,
+ GTK_DIR_DOWN,
+ GTK_DIR_LEFT,
+ GTK_DIR_RIGHT,
+
+ GTK_EVENT_SEQUENCE_NONE = 0,
+ GTK_EVENT_SEQUENCE_CLAIMED,
+ GTK_EVENT_SEQUENCE_DENIED,
+
+ GTK_EXPANDER_COLLAPSED = 0,
+ GTK_EXPANDER_SEMI_COLLAPSED,
+ GTK_EXPANDER_SEMI_EXPANDED,
+ GTK_EXPANDER_EXPANDED,
+
+ GTK_FILE_CHOOSER_ACTION_OPEN = 0,
+ GTK_FILE_CHOOSER_ACTION_SAVE,
+ GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
+ GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER,
+
+ GTK_ICON_SIZE_INVALID = 0,
+ GTK_ICON_SIZE_MENU,
+ GTK_ICON_SIZE_SMALL_TOOLBAR,
+ GTK_ICON_SIZE_LARGE_TOOLBAR,
+ GTK_ICON_SIZE_BUTTON,
+ GTK_ICON_SIZE_DND,
+ GTK_ICON_SIZE_DIALOG,
+
+ GTK_ICON_LOOKUP_NO_SVG = 1,
+ GTK_ICON_LOOKUP_FORCE_SVG = 2,
+ GTK_ICON_LOOKUP_USE_BUILTIN = 4,
+ GTK_ICON_LOOKUP_GENERIC_FALLBACK = 8,
+ GTK_ICON_LOOKUP_FORCE_SIZE = 16,
+
+ GTK_IMAGE_EMPTY = 0,
+ GTK_IMAGE_PIXBUF,
+ GTK_IMAGE_STOCK,
+ GTK_IMAGE_ICON_SET,
+ GTK_IMAGE_ANIMATION,
+ GTK_IMAGE_ICON_NAME,
+ GTK_IMAGE_GICON,
+
+ GTK_IM_PREEDIT_NOTHING = 0,
+ GTK_IM_PREEDIT_CALLBACK,
+ GTK_IM_PREEDIT_NONE,
+
+ GTK_IM_STATUS_NOTHING = 0,
+ GTK_IM_STATUS_CALLBACK,
+ GTK_IM_STATUS_NONE,
+
+ GTK_INPUT_HINT_NONE = 0,
+ GTK_INPUT_HINT_SPELLCHECK,
+ GTK_INPUT_HINT_NO_SPELLCHECK,
+ GTK_INPUT_HINT_WORD_COMPLETION = 4,
+ GTK_INPUT_HINT_LOWERCASE = 8,
+ GTK_INPUT_HINT_UPPERCASE_CHARS = 16,
+ GTK_INPUT_HINT_UPPERCASE_WORDS = 32,
+ GTK_INPUT_HINT_UPPERCASE_SENTENCES = 64,
+
+ GTK_JUSTIFY_LEFT = 0,
+ GTK_JUSTIFY_RIGHT,
+ GTK_JUSTIFY_CENTER,
+ GTK_JUSTIFY_FILL,
+
+ GTK_LEVEL_BAR_MODE_CONTINUOUS = 0,
+ GTK_LEVEL_BAR_MODE_DISCRETE,
+
+ GTK_MATCH_ALL = 0,
+ GTK_MATCH_ALL_TAIL,
+ GTK_MATCH_HEAD,
+ GTK_MATCH_TAIL,
+ GTK_MATCH_EXACT,
+ GTK_MATCH_LAST,
+
+ GTK_PIXELS = 0,
+ GTK_INCHES,
+ GTK_CENTIMETERS,
+
+ GTK_MESSAGE_INFO = 0,
+ GTK_MESSAGE_WARNING,
+ GTK_MESSAGE_QUESTION,
+ GTK_MESSAGE_ERROR,
+ GTK_MESSAGE_OTHER,
+
+ GTK_ICON_INFO = 0,
+ GTK_ICON_WARNING,
+ GTK_ICON_QUESTION,
+ GTK_ICON_ERROR,
+ GTK_ICON_OTHER,
+
+ GTK_MOVEMENT_LOGICAL_POSITIONS = 0,
+ GTK_MOVEMENT_VISUAL_POSITIONS,
+ GTK_MOVEMENT_WORDS,
+ GTK_MOVEMENT_DISPLAY_LINES,
+ GTK_MOVEMENT_DISPLAY_LINE_ENDS,
+ GTK_MOVEMENT_PARAGRAPHS,
+ GTK_MOVEMENT_PARAGRAPH_ENDS,
+ GTK_MOVEMENT_PAGES,
+ GTK_MOVEMENT_BUFFER_ENDS,
+ GTK_MOVEMENT_HORIZONTAL_PAGES,
+
+ GTK_ORIENTATION_HORIZONTAL = 0,
+ GTK_ORIENTATION_VERTICAL,
+
+ GTK_PACK_START = 0,
+ GTK_PACK_END,
+
+ GTK_PAN_DIRECTION_LEFT = 0,
+ GTK_PAN_DIRECTION_RIGHT,
+ GTK_PAN_DIRECTION_UP,
+ GTK_PAN_DIRECTION_DOWN,
+
+ GTK_PATH_PRIO_LOWEST = 0,
+ GTK_PATH_PRIO_GTK = 4,
+ GTK_PATH_PRIO_APPLICATION = 8,
+ GTK_PATH_PRIO_THEME = 10,
+ GTK_PATH_PRIO_RC = 12,
+ GTK_PATH_PRIO_HIGHEST = 15,
+
+ GTK_PATH_WIDGET = 0,
+ GTK_PATH_WIDGET_CLASS,
+ GTK_PATH_CLASS,
+
+ GTK_PHASE_NONE = 0,
+ GTK_PHASE_CAPTURE,
+ GTK_PHASE_BUBBLE,
+ GTK_PHASE_TARGET,
+
+ GTK_POLICY_ALWAYS = 0,
+ GTK_POLICY_AUTOMATIC,
+ GTK_POLICY_NEVER,
+ GTK_POLICY_EXTERNAL,
+
+ GTK_POS_LEFT = 0,
+ GTK_POS_RIGHT,
+ GTK_POS_TOP,
+ GTK_POS_BOTTOM,
+ LEFT = 0, --aliases;
+ RIGHT,
+ TOP,
+ BOTTOM
+
+public enum by * 2
+ GTK_PRINT_CAPABILITY_PAGE_SET = 0,
+ GTK_PRINT_CAPABILITY_COPIES = 2,
+ GTK_PRINT_CAPABILITY_COLLATE,
+ GTK_PRINT_CAPABILITY_REVERSE,
+ GTK_PRINT_CAPABILITY_SCALE,
+ GTK_PRINT_CAPABILITY_GENERATE_PDF,
+ GTK_PRINT_CAPABILITY_GENERATE_PS,
+ GTK_PRINT_CAPABILITY_PREVIEW,
+ GTK_PRINT_CAPABILITY_NUMBER_UP,
+ GTK_PRINT_CAPABILITY_NUMBER_UP_LAYOUT,
+
+ GTK_REGION_EVEN = 0,
+ GTK_REGION_ODD = 1,
+ GTK_REGION_FIRST,
+ GTK_REGION_LAST,
+ GTK_REGION_ONLY,
+ GTK_REGION_SORTED,
+
+ GTK_STATE_FLAG_NORMAL = 0,
+ GTK_STATE_FLAG_ACTIVE = 1,
+ GTK_STATE_FLAG_PRELIGHT,
+ GTK_STATE_FLAG_SELECTED,
+ GTK_STATE_FLAG_INSENSITIVE,
+ GTK_STATE_FLAG_INCONSISTENT,
+ GTK_STATE_FLAG_FOCUSED,
+ GTK_STATE_FLAG_BACKDROP,
+ GTK_STATE_FLAG_DIR_LTR ,
+ GTK_STATE_FLAG_DIR_RTL,
+ GTK_STATE_FLAG_LINK,
+ GTK_STATE_FLAG_VISITED,
+ GTK_STATE_FLAG_CHECKED
+
+public enum
+ GTK_PROGRESS_LEFT_TO_RIGHT = 0,
+ GTK_PROGRESS_RIGHT_TO_LEFT,
+ GTK_PROGRESS_BOTTOM_TO_TOP,
+ GTK_PROGRESS_TOP_TO_BOTTOM,
+
+ GTK_RELIEF_NORMAL = 0,
+ GTK_RELIEF_HALF,
+ GTK_RELIEF_NONE,
+
+ GTK_RESIZE_PARENT = 0,
+ GTK_RESIZE_QUEUE,
+ GTK_RESIZE_IMMEDIATE,
+
+ GTK_REVEALER_TRANSITION_TYPE_NONE = 0,
+ GTK_REVEALER_TRANSITION_TYPE_CROSSFADE,
+ GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT,
+ GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT,
+ GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP,
+ GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN,
+
+ GTK_SCROLL_STEPS = 0,
+ GTK_SCROLL_PAGES,
+ GTK_SCROLL_ENDS,
+ GTK_SCROLL_HORIZONTAL_STEPS,
+ GTK_SCROLL_HORIZONTAL_PAGES,
+ GTK_SCROLL_HORIZONTAL_ENDS,
+
+ GTK_SCROLL_NONE = 0,
+ GTK_SCROLL_JUMP,
+ GTK_SCROLL_STEP_BACKWARD,
+ GTK_SCROLL_STEP_FORWARD,
+ GTK_SCROLL_PAGE_BACKWARD,
+ GTK_SCROLL_PAGE_FORWARD,
+ GTK_SCROLL_STEP_UP,
+ GTK_SCROLL_STEP_DOWN,
+ GTK_SCROLL_PAGE_UP,
+ GTK_SCROLL_PAGE_DOWN,
+ GTK_SCROLL_STEP_LEFT,
+ GTK_SCROLL_STEP_RIGHT,
+ GTK_SCROLL_PAGE_LEFT,
+ GTK_SCROLL_PAGE_RIGHT,
+ GTK_SCROLL_START,
+ GTK_SCROLL_END,
+
+ GTK_SELECTION_NONE = 0,
+ GTK_SELECTION_SINGLE,
+ GTK_SELECTION_BROWSE,
+ GTK_SELECTION_MULTIPLE,
+
+ GTK_SHADOW_NONE = 0,
+ GTK_SHADOW_IN,
+ GTK_SHADOW_OUT,
+ GTK_SHADOW_ETCHED_IN,
+ GTK_SHADOW_ETCHED_OUT,
+
+ GTK_STATE_NORMAL = 0,
+ GTK_STATE_ACTIVE,
+ GTK_STATE_PRELIGHT,
+ GTK_STATE_SELECTED,
+ GTK_STATE_INSENSITIVE,
+ GTK_STATE_INCONSISTENT,
+ GTK_STATE_FOCUSED,
+ GTK_STATE_PRESSED = 1,
+ GTK_STATE_MOUSEOVER,
+
+ GTK_TEXT_DIR_NONE = 0,
+ GTK_TEXT_DIR_LTR,
+ GTK_TEXT_DIR_RTL,
+
+ GTK_TEXT_EXTEND_SELECTION_WORD = 0,
+ GTK_TEXT_EXTEND_SELECTION_LINE,
+
+ GTK_TOOLBAR_ICONS = 0,
+ GTK_TOOLBAR_TEXT,
+ GTK_TOOLBAR_BOTH,
+ GTK_TOOLBAR_BOTH_HORIZ,
+
+ GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID = -1,
+ GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID = -2,
+
+ GTK_UPDATE_CONTINUOUS = 0,
+ GTK_UPDATE_DISCONTINUOUS,
+ GTK_UPDATE_DELAYED,
+
+ GTK_VISIBILITY_NONE = 0,
+ GTK_VISIBILITY_PARTIAL,
+ GTK_VISIBILITY_FULL,
+
+ GTK_WIN_POS_NONE = 0,
+ GTK_WIN_POS_CENTER,
+ GTK_WIN_POS_MOUSE,
+ GTK_WIN_POS_CENTER_ALWAYS,
+ GTK_WIN_POS_CENTER_ON_PARENT,
+
+ GTK_WINDOW_TOPLEVEL = 0,
+ GTK_WINDOW_POPUP,
+
+ GTK_SORT_ASCENDING = 1,
+ GTK_SORT_DESCENDING,
+
+ GTK_DRAG_RESULT_SUCCESS = 0,
+ GTK_DRAG_RESULT_NO_TARGET,
+ GTK_DRAG_RESULT_USER_CANCELLED,
+ GTK_DRAG_RESULT_TIMEOUT_EXPIRED,
+ GTK_DRAG_RESULT_GRAB_BROKEN,
+ GTK_DRAG_RESULT_ERROR,
+
+ PANGO_ELLIPSIZE_NONE = 0,
+ PANGO_ELLIPSIZE_START,
+ PANGO_ELLIPSIZE_MIDDLE,
+ PANGO_ELLIPSIZE_END,
+
+ GDK_SOLID = 0,
+ GDK_TILED,
+ GDK_STIPPLED,
+ GDK_OPAQUE_STIPPLED,
+
+ GTK_RESPONSE_NONE = -1,
+ GTK_RESPONSE_REJECT = -2,
+ GTK_RESPONSE_ACCEPT = -3,
+ GTK_RESPONSE_DELETE_EVENT = -4,
+ GTK_RESPONSE_OK = -5,
+ GTK_RESPONSE_CANCEL = -6,
+ GTK_RESPONSE_CLOSE = -7,
+ GTK_RESPONSE_YES = -8,
+ GTK_RESPONSE_NO = -9,
+ GTK_RESPONSE_APPLY = -10,
+ GTK_RESPONSE_HELP = -11,
+
+ GTK_TREE_VIEW_COLUMN_GROW_ONLY = 0,
+ GTK_TREE_VIEW_COLUMN_AUTOSIZE,
+ GTK_TREE_VIEW_COLUMN_FIXED,
+
+ GTK_TREE_VIEW_GRID_LINES_NONE = 0,
+ GTK_TREE_VIEW_GRID_LINES_HORIZONTAL,
+ GTK_TREE_VIEW_GRID_LINES_VERTICAL,
+ GTK_TREE_VIEW_GRID_LINES_BOTH,
+
+ GTK_TEXT_WINDOW_PRIVATE = 0,
+ GTK_TEXT_WINDOW_WIDGET,
+ GTK_TEXT_WINDOW_TEXT,
+ GTK_TEXT_WINDOW_LEFT,
+ GTK_TEXT_WINDOW_RIGHT,
+ GTK_TEXT_WINDOW_TOP,
+ GTK_TEXT_WINDOW_BOTTOM,
+
+ G_NOTIFICATION_PRIORITY_NORMAL = 0,
+ G_NOTIFICATION_PRIORITY_LOW,
+ G_NOTIFICATION_PRIORITY_HIGH,
+ G_NOTIFICATION_PRIORITY_URGENT,
+
+ G_USER_DIRECTORY_DESKTOP = 0,
+ G_USER_DIRECTORY_DOCUMENTS,
+ G_USER_DIRECTORY_DOWNLOAD,
+ G_USER_DIRECTORY_MUSIC,
+ G_USER_DIRECTORY_PICTURES,
+ G_USER_DIRECTORY_PUBLIC_SHARE,
+ G_USER_DIRECTORY_TEMPLATES,
+ G_USER_DIRECTORY_VIDEOS,
+ G_USER_N_DIRECTORIES,
+
+ GTK_WRAP_NONE = 0,
+ GTK_WRAP_CHAR,
+ GTK_WRAP_WORD,
+ GTK_WRAP_WORD_CHAR,
+
+ GDK_WINDOW_TYPE_HINT_NORMAL = 0,
+ GDK_WINDOW_TYPE_HINT_DIALOG,
+ GDK_WINDOW_TYPE_HINT_MENU,
+ GDK_WINDOW_TYPE_HINT_TOOLBAR,
+ GDK_WINDOW_TYPE_HINT_SPLASHSCREEN,
+ GDK_WINDOW_TYPE_HINT_UTILITY,
+ GDK_WINDOW_TYPE_HINT_DOCK,
+ GDK_WINDOW_TYPE_HINT_DESKTOP,
+ GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU,
+ GDK_WINDOW_TYPE_HINT_POPUP_MENU,
+ GDK_WINDOW_TYPE_HINT_TOOLTIP,
+ GDK_WINDOW_TYPE_HINT_NOTIFICATION,
+ GDK_WINDOW_TYPE_HINT_COMBO,
+ GDK_WINDOW_TYPE_HINT_DND,
+
+ GDK_ACTION_DEFAULT = 0,
+ GDK_ACTION_COPY = 1,
+ GDK_ACTION_MOVE = 2,
+ GDK_ACTION_LINK = 4,
+ GDK_ACTION_PRIVATE = 8,
+ GDK_ACTION_ASK = 16,
+
+ GTK_CELL_RENDERER_MODE_INERT = 0,
+ GTK_CELL_RENDERER_MODE_ACTIVATABLE,
+ GTK_CELL_RENDERER_MODE_EDITABLE,
+
+ GTK_CELL_RENDERER_ACCEL_MODE_GTK = 0,
+ GTK_CELL_RENDERER_ACCEL_MODE_OTHER,
+
+ GTK_DEST_DEFAULT_MOTION = 1,
+ GTK_DEST_DEFAULT_HIGHLIGHT = 2,
+ GTK_DEST_DEFAULT_DROP = 4,
+ GTK_DEST_DEFAULT_ALL = 0x07,
+
+ GTK_TARGET_SAME_APP = 1,
+ GTK_TARGET_SAME_WIDGET = 2,
+ GTK_TARGET_OTHER_APP = 4,
+ GTK_TARGET_OTHER_WIDGET = 8,
+
+ GTK_SIZE_GROUP_NONE = 0,
+ GTK_SIZE_GROUP_HORIZONTAL,
+ GTK_SIZE_GROUP_VERTICAL,
+ GTK_SIZE_GROUP_BOTH
+
+public enum
+ MOUSE_BUTTON1 = 1,
+ MOUSE_BUTTON2,
+ MOUSE_BUTTON3
+
+public enum
+ PANGO_SCALE = 1000,
+ PANGO_STYLE_NORMAL= 0,
+ PANGO_STYLE_OBLIQUE,
+ PANGO_STYLE_ITALIC,
+
+ PANGO_STRETCH_ULTRA_CONDENSED = 0,
+ PANGO_STRETCH_EXTRA_CONDENSED,
+ PANGO_STRETCH_CONDENSED,
+ PANGO_STRETCH_SEMI_CONDENSED,
+ PANGO_STRETCH_NORMAL,
+ PANGO_STRETCH_SEMI_EXPANDED,
+ PANGO_STRETCH_EXPANDED,
+ PANGO_STRETCH_EXTRA_EXPANDED,
+ PANGO_STRETCH_ULTRA_EXPANDED,
+
+ PANGO_VARIANT_NORMAL=1,
+ PANGO_VARIANT_SMALL_CAPS,
+
+ PANGO_WEIGHT_THIN = 100,
+ PANGO_WEIGHT_ULTRALIGHT = 200,
+ PANGO_WEIGHT_LIGHT = 300,
+ PANGO_WEIGHT_BOOK = 380,
+ PANGO_WEIGHT_NORMAL = 400,
+ PANGO_WEIGHT_MEDIUM = 500,
+ PANGO_WEIGHT_SEMIBOLD = 600,
+ PANGO_WEIGHT_BOLD = 700,
+ PANGO_WEIGHT_ULTRABOLD = 800,
+ PANGO_WEIGHT_HEAVY = 900,
+ PANGO_WEIGHT_ULTRAHEAVY = 1000,
+ PANGO_UNIT = 1024
+
+public enum
+ GTK_RECENT_SORT_NONE = 0,
+ GTK_RECENT_SORT_MRU,
+ GTK_RECENT_SORT_LRU,
+ GTK_RECENT_SORT_CUSTOM
+
+ public enum by * 2 -- GdkModifierTypes
+ GDK_SHIFT_MASK = 1,
+ GDK_LOCK_MASK,
+ GDK_CONTROL_MASK,
+ GDK_MOD1_MASK, -- Alt+
+ GDK_MOD2_MASK,
+ GDK_MOD3_MASK,
+ GDK_MOD4_MASK,
+ GDK_MOD5_MASK,
+ GDK_BUTTON1_MASK,
+ GDK_BUTTON2_MASK,
+ GDK_BUTTON3_MASK,
+ GDK_BUTTON4_MASK,
+ GDK_BUTTON5_MASK,
+ SHFT = 1, -- 'shorthand' versions of above
+ LOCK,
+ CTL,
+ ALT
+
+ public enum -- events
+ GDK_NOTHING = -1,
+ GDK_DELETE,
+ GDK_DESTROY,
+ GDK_EXPOSE,
+ GDK_MOTION_NOTIFY,
+ GDK_BUTTON_PRESS,
+ GDK_2BUTTON_PRESS,
+ GDK_3BUTTON_PRESS,
+ GDK_BUTTON_RELEASE,
+ GDK_KEY_PRESS,
+ GDK_KEY_RELEASE,
+ GDK_ENTER_NOTIFY,
+ GDK_LEAVE_NOTIFY,
+ GDK_FOCUS_CHANGE,
+ GDK_CONFIGURE,
+ GDK_MAP,
+ GDK_UNMAP
+
+public enum -- event masks
+ GDK_EXPOSURE_MASK = 2,
+ GDK_POINTER_MOTION_MASK = 4,
+ GDK_POINTER_MOTION_HINT_MASK = 8,
+ GDK_BUTTON_MOTION_MASK = 16,
+ GDK_BUTTON1_MOTION_MASK = #20,
+ GDK_BUTTON2_MOTION_MASK = #40,
+ GDK_BUTTON3_MOTION_MASK = #80,
+ GDK_BUTTON_PRESS_MASK = #100,
+ GDK_BUTTON_RELEASE_MASK = #200,
+ GDK_KEY_PRESS_MASK = #400,
+ GDK_KEY_RELEASE_MASK = #800,
+ GDK_ENTER_NOTIFY_MASK = #1000,
+ GDK_LEAVE_NOTIFY_MASK = #2000,
+ GDK_FOCUS_CHANGE_MASK = #4000,
+ GDK_STRUCTURE_MASK = #8000,
+ GDK_PROPERTY_CHANGE_MASK = #10000,
+ GDK_VISIBILITY_NOTIFY_MASK = #20000,
+ GDK_PROXIMITY_IN_MASK = #40000,
+ GDK_PROXIMITY_OUT_MASK = #80000,
+ GDK_SUBSTRUCTURE_MASK = #100000,
+ GDK_SCROLL_MASK = #200000,
+ GDK_ALL_EVENTS_MASK = #3FFFFE,
+
+ GDK_PROPERTY_NOTIFY = 16,
+ GDK_SELECTION_CLEAR,
+ GDK_SELECTION_REQUEST,
+ GDK_SELECTION_NOTIFY,
+ GDK_PROXIMITY_IN,
+ GDK_PROXIMITY_OUT,
+ GDK_DRAG_ENTER,
+ GDK_DRAG_LEAVE,
+ GDK_DRAG_MOTION,
+ GDK_DRAG_STATUS,
+ GDK_DROP_START,
+ GDK_DROP_FINISHED,
+ GDK_CLIENT_EVENT,
+ GDK_VISIBILITY_NOTIFY,
+ GDK_NO_EXPOSE,
+ GDK_SCROLL,
+ GDK_WINDOW_STATE,
+ GDK_SETTING,
+ GDK_OWNER_CHANGE,
+ GDK_GRAB_BROKEN,
+ GDK_DAMAGE,
+
+ GDK_FULLSCREEN_ON_CURRENT_MONITOR = 0,
+ GDK_FULLSCREEN_ON_ALL_MONITORS,
+
+ GTK_PAGE_SET_ALL = 0,
+ GTK_PAGE_SET_EVEN,
+ GTK_PAGE_SET_ODD,
+
+ GTK_PAGE_ORIENTATION_PORTRAIT = 0,
+ GTK_PAGE_ORIENTATION_LANDSCAPE,
+ GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT,
+ GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE,
+
+ GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG = 0,
+ GTK_PRINT_OPERATION_ACTION_PRINT,
+ GTK_PRINT_OPERATION_ACTION_PREVIEW,
+ GTK_PRINT_OPERATION_ACTION_EXPORT,
+
+ GTK_PRINT_OPERATION_RESULT_ERROR = 0,
+ GTK_PRINT_OPERATION_RESULT_APPLY,
+ GTK_PRINT_OPERATION_RESULT_CANCEL,
+ GTK_PRINT_OPERATION_RESULT_IN_PROGRESS,
+
+ GTK_PRINT_STATUS_INITIAL = 0,
+ GTK_PRINT_STATUS_PREPARING,
+ GTK_PRINT_STATUS_GENERATING_DATA,
+ GTK_PRINT_STATUS_SENDING_DATA,
+ GTK_PRINT_STATUS_PENDING,
+ GTK_PRINT_STATUS_PENDING_ISSUE,
+ GTK_PRINT_STATUS_PRINTING,
+ GTK_PRINT_STATUS_FINISHED,
+ GTK_PRINT_STATUS_FINISHED_ABORTED,
+
+ GTK_PRINT_DUPLEX_SIMPLE = 0,
+ GTK_PRINT_DUPLEX_HORIZONTAL,
+ GTK_PRINT_DUPLEX_VERTICAL,
+
+ GTK_PRINT_PAGES_ALL = 0,
+ GTK_PRINT_PAGES_CURRENT,
+ GTK_PRINT_PAGES_RANGES,
+ GTK_PRINT_PAGES_SELECTION,
+
+ GTK_PRINT_QUALITY_LOW = 0,
+ GTK_PRINT_QUALITY_NORMAL,
+ GTK_PRINT_QUALITY_HIGH,
+ GTK_PRINT_QUALITY_DRAFT,
+
+ GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM = 0,
+ GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP,
+ GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TOP_BOTTOM,
+ GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP,
+ GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT,
+ GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT,
+ GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT,
+ GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT,
+
+ GTK_STYLE_PROVIDER_PRIORITY_FALLBACK = 1,
+ GTK_STYLE_PROVIDER_PRIORITY_THEME = 200,
+ GTK_STYLE_PROVIDER_PRIORITY_SETTINGS = 400,
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION = 600,
+ GTK_STYLE_PROVIDER_PRIORITY_USER = 800,
+
+ GTK_UNIT_PIXEL = 0,
+ GTK_UNIT_POINTS,
+ GTK_UNIT_INCH,
+ GTK_UNIT_MM,
+
+ GTK_STACK_TRANSITION_TYPE_NONE = 0,
+ GTK_STACK_TRANSITION_TYPE_CROSSFADE,
+ GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT,
+ GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT,
+ GTK_STACK_TRANSITION_TYPE_SLIDE_UP,
+ GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN,
+ GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT,
+ GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN,
+ GTK_STACK_TRANSITION_TYPE_OVER_UP, -- GTK3.12 from here down
+ GTK_STACK_TRANSITION_TYPE_OVER_DOWN,
+ GTK_STACK_TRANSITION_TYPE_OVER_LEFT,
+ GTK_STACK_TRANSITION_TYPE_OVER_RIGHT,
+ GTK_STACK_TRANSITION_TYPE_UNDER_UP,
+ GTK_STACK_TRANSITION_TYPE_UNDER_DOWN,
+ GTK_STACK_TRANSITION_TYPE_UNDER_LEFT,
+ GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT,
+ GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN,
+ GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP,
+ GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT,
+ GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT,
+
+ GTK_PLACES_OPEN_NORMAL = 0,
+ GTK_PLACES_OPEN_NEW_TAB,
+ GTK_PLACES_OPEN_NEW_WINDOW,
+
+ GDK_PIXBUF_ROTATE_NONE = 0,
+ GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE = 90,
+ GDK_PIXBUF_ROTATE_UPSIDEDOWN = 180,
+ GDK_PIXBUF_ROTATE_CLOCKWISE = 270,
+
+ GDK_INTERP_NEAREST = 0,
+ GDK_INTERP_TILES,
+ GDK_INTERP_BILINEAR,
+ GDK_INTERP_HYPER,
+
+ CAIRO_EXTEND_REPEAT = 1,
+
+ CAIRO_FILL_RULE_EVEN_ODD = 1,
+ CAIRO_FILL_RULE_WINDING = 0,
+
+ CAIRO_FONT_SLANT_NORMAL = 0,
+ CAIRO_FONT_SLANT_ITALIC,
+ CAIRO_FONT_SLANT_OBLIQUE,
+
+ CAIRO_FONT_WEIGHT_NORMAL = 0, NORMAL = 0,
+ CAIRO_FONT_WEIGHT_BOLD, BOLD = 1,
+
+ CAIRO_FORMAT_INVALID = -1,
+ CAIRO_FORMAT_ARGB32 = 0,
+ CAIRO_FORMAT_RGB24,
+ CAIRO_FORMAT_A8,
+ CAIRO_FORMAT_A1,
+ CAIRO_FORMAT_RGB16_565,
+
+ CAIRO_LINE_CAP_BUTT = 0,
+ CAIRO_LINE_CAP_ROUND,
+ CAIRO_LINE_CAP_SQUARE,
+
+ CAIRO_LINE_JOIN_MITER = 0,
+ CAIRO_LINE_JOIN_ROUND,
+ CAIRO_LINE_JOIN_BEVEL,
+
+ CAIRO_OPERATOR_CLEAR = 0,
+ CAIRO_OPERATOR_SOURCE,
+ CAIRO_OPERATOR_OVER,
+ CAIRO_OPERATOR_IN,
+ CAIRO_OPERATOR_OUT,
+ CAIRO_OPERATOR_ATOP,
+ CAIRO_OPERATOR_DEST,
+ CAIRO_OPERATOR_DEST_OVER,
+ CAIRO_OPERATOR_DEST_IN,
+ CAIRO_OPERATOR_DEST_OUT,
+ CAIRO_OPERATOR_DEST_ATOP,
+ CAIRO_OPERATOR_XOR,
+ CAIRO_OPERATOR_ADD,
+ CAIRO_OPERATOR_SATURATE,
+ CAIRO_OPERATOR_MULTIPLY,
+ CAIRO_OPERATOR_SCREEN,
+ CAIRO_OPERATOR_OVERLAY,
+ CAIRO_OPERATOR_DARKEN,
+ CAIRO_OPERATOR_LIGHTEN,
+ CAIRO_OPERATOR_COLOR_DODGE,
+ CAIRO_OPERATOR_COLOR_BURN,
+ CAIRO_OPERATOR_HARD_LIGHT,
+ CAIRO_OPERATOR_SOFT_LIGHT,
+ CAIRO_OPERATOR_DIFFERENCE,
+ CAIRO_OPERATOR_EXCLUSION,
+ CAIRO_OPERATOR_HSL_HUE,
+ CAIRO_OPERATOR_HSL_SATURATION,
+ CAIRO_OPERATOR_HSL_COLOR,
+ CAIRO_OPERATOR_HSL_LUMINOSITY,
+
+ CAIRO_PDF_VERSION_1_4 = 0,
+ CAIRO_PDF_VERSION_1_5,
+
+ CAIRO_SVG_VERSION_1_1 = 0,
+ CAIRO_SVG_VERSION_1_2,
+
+ CAIRO_SURFACE_TYPE_IMAGE = 0,
+ CAIRO_SURFACE_TYPE_PDF,
+ CAIRO_SURFACE_TYPE_PS,
+ CAIRO_SURFACE_TYPE_XLIB,
+ CAIRO_SURFACE_TYPE_XCB,
+ CAIRO_SURFACE_TYPE_GLITZ,
+ CAIRO_SURFACE_TYPE_QUARTZ,
+ CAIRO_SURFACE_TYPE_WIN32,
+ CAIRO_SURFACE_TYPE_BEOS,
+ CAIRO_SURFACE_TYPE_DIRECTFB,
+ CAIRO_SURFACE_TYPE_SVG,
+ CAIRO_SURFACE_TYPE_OS2,
+ CAIRO_SURFACE_TYPE_WIN32_PRINTING,
+ CAIRO_SURFACE_TYPE_QUARTZ_IMAGE,
+ CAIRO_SURFACE_TYPE_SCRIPT,
+ CAIRO_SURFACE_TYPE_QT,
+ CAIRO_SURFACE_TYPE_RECORDING,
+ CAIRO_SURFACE_TYPE_VG,
+ CAIRO_SURFACE_TYPE_GL,
+ CAIRO_SURFACE_TYPE_DRM,
+ CAIRO_SURFACE_TYPE_TEE,
+ CAIRO_SURFACE_TYPE_XML,
+ CAIRO_SURFACE_TYPE_SKIA,
+ CAIRO_SURFACE_TYPE_SUBSURFACE,
+
+ CAIRO_FONT_TYPE_TOY = 0,
+ CAIRO_FONT_TYPE_FT,
+ CAIRO_FONT_TYPE_WIN32,
+ CAIRO_FONT_TYPE_QUARTZ,
+ CAIRO_FONT_TYPE_USER
+
+public enum
+ ICON_PIXBUF = 1,
+ ICON_DISPLAY_NAME,
+ ICON_FILENAME,
+ ICON_BASE_SIZE,
+ ICON_BASE_SCALE,
+ ICON_IS_SYMBOLIC,
+
+ G_KEY_FILE_NONE = 0,
+ G_KEY_FILE_KEEP_COMMENTS,
+ G_KEY_FILE_KEEP_TRANSLATIONS
+
+
+-- local function to implement widget types;
+function _(atom x, integer t)
+if x = 0 then
+ crash("Invalid type - pointer is null!")
+end if
+init(t) register(x,t)
+return x
+end function
+
+------------------------------------------------------------------------
+-- GTK Widget Types -- used rarely, with caution
+------------------------------------------------------------------------
+global type Object(atom x)return _(x,GObject)end type
+global type Window(atom x)return _(x,GtkWindow)end type
+global type Dialog(atom x)return _(x,GtkDialog)end type
+global type AboutDialog(atom x)return _(x,GtkAboutDialog)end type
+global type Assistant(atom x)return _(x,GtkAssistant)end type
+global type Box(atom x)return _(x,GtkBox)end type
+global type Grid(atom x)return _(x,GtkGrid)end type
+global type Revealer(atom x)return _(x,GtkRevealer)end type
+global type ListBox(atom x)return _(x,GtkListBox)end type
+global type FlowBox(atom x)return _(x,GtkFlowBox)end type
+global type Stack(atom x)return _(x,GtkStack)end type
+global type StackSwitcher(atom x)return _(x,GtkStackSwitcher)end type
+global type Sidebar(atom x)return _(x,GtkSidebar)end type
+global type ActionBar(atom x)return _(x,GtkActionBar)end type
+global type HeaderBar(atom x)return _(x,GtkHeaderBar)end type
+global type Overlay(atom x)return _(x,GtkOverlay)end type
+global type ButtonBox(atom x)return _(x,GtkButtonBox)end type
+global type Paned(atom x)return _(x,GtkPaned)end type
+global type Layout(atom x)return _(x,GtkLayout)end type
+global type Notebook(atom x)return _(x,GtkNotebook)end type
+global type Expander(atom x)return _(x,GtkExpander)end type
+global type AspectFrame(atom x)return _(x,GtkAspectFrame)end type
+global type Label(atom x)return _(x,GtkLabel)end type
+global type Image(atom x)return _(x,GtkImage)end type
+global type Spinner(atom x)return _(x,GtkSpinner)end type
+global type InfoBar(atom x)return _(x,GtkInfoBar)end type
+global type ProgressBar(atom x)return _(x,GtkProgressBar)end type
+global type LevelBar(atom x)return _(x,GtkLevelBar)end type
+global type Statusbar(atom x)return _(x,GtkStatusbar)end type
+global type AccelLabel(atom x)return _(x,GtkAccelLabel)end type
+global type Button(atom x)return _(x,GtkButton)end type
+global type CheckButton(atom x)return _(x,GtkCheckButton)end type
+global type RadioButton(atom x)return _(x,GtkRadioButton)end type
+global type ToggleButton(atom x)return _(x,GtkToggleButton)end type
+global type LinkButton(atom x)return _(x,GtkLinkButton)end type
+global type MenuButton(atom x)return _(x,GtkMenuButton)end type
+global type Switch(atom x)return _(x,GtkSwitch)end type
+global type ScaleButton(atom x)return _(x,GtkScaleButton)end type
+global type VolumeButton(atom x)return _(x,GtkVolumeButton)end type
+global type LockButton(atom x)return _(x,GtkLockButton)end type
+global type Entry(atom x)return _(x,GtkEntry)end type
+global type EntryBuffer(atom x)return _(x,GtkEntryBuffer)end type
+global type EntryCompletion(atom x)return _(x,GtkEntryCompletion)end type
+global type Scale(atom x)return _(x,GtkScale)end type
+global type SpinButton(atom x)return _(x,GtkSpinButton)end type
+global type SearchEntry(atom x)return _(x,GtkSearchEntry)end type
+global type SearchBar(atom x)return _(x,GtkSearchBar)end type
+global type Editable(atom x)return _(x,GtkEditable)end type
+global type TextMark(atom x)return _(x,GtkTextMark)end type
+global type TextBuffer(atom x)return _(x,GtkTextBuffer)end type
+global type TextTag(atom x)return _(x,GtkTextTag)end type
+global type TextTagTable(atom x)return _(x,GtkTextTagTable)end type
+global type TextView(atom x)return _(x,GtkTextView)end type
+global type TreeModel(atom x)return _(x,GtkTreeModel)end type
+global type TreeModelSort(atom x)return _(x,GtkTreeModelSort)end type
+global type TreeSelection(atom x)return _(x,GtkTreeSelection)end type
+global type TreeViewColumn(atom x)return _(x,GtkTreeViewColumn)end type
+global type TreeView(atom x)return _(x,GtkTreeView)end type
+global type IconView(atom x)return _(x,GtkIconView)end type
+global type CellRendererText(atom x)return _(x,GtkCellRendererText)end type
+global type CellRendererAccel(atom x)return _(x,GtkCellRendererAccel)end type
+global type CellRendererCombo(atom x)return _(x,GtkCellRendererCombo)end type
+global type CellRendererPixbuf(atom x)return _(x,GtkCellRendererPixbuf)end type
+global type CellRendererProgress(atom x)return _(x,GtkCellRendererProgress)end type
+global type CellRendererSpin(atom x)return _(x,GtkCellRendererSpin)end type
+global type CellRendererToggle(atom x)return _(x,GtkCellRendererToggle)end type
+global type CellRendererSpinner(atom x)return _(x,GtkCellRendererSpinner)end type
+global type ListStore(atom x)return _(x,GtkListStore)end type
+global type TreeStore(atom x)return _(x,GtkTreeStore)end type
+global type ComboBox(atom x)return _(x,GtkComboBox)end type
+global type ComboBoxText(atom x)return _(x,GtkComboBoxText)end type
+global type Menu(atom x)return _(x,GtkMenu)end type
+global type MenuBar(atom x)return _(x,GtkMenuBar)end type
+global type MenuItem(atom x)return _(x,GtkMenuItem)end type
+global type RadioMenuItem(atom x)return _(x,GtkRadioMenuItem)end type
+global type CheckMenuItem(atom x)return _(x,GtkCheckMenuItem)end type
+global type SeparatorMenuItem(atom x)return _(x,GtkSeparatorMenuItem)end type
+global type Toolbar(atom x)return _(x,GtkToolbar)end type
+global type ToolItem(atom x)return _(x,GtkToolItem)end type
+global type ToolPalette(atom x)return _(x,GtkToolPalette)end type
+global type ToolButton(atom x)return _(x,GtkToolButton)end type
+global type MenuToolButton(atom x)return _(x,GtkMenuToolButton)end type
+global type ToggleToolButton(atom x)return _(x,GtkToggleToolButton)end type
+global type RadioToolButton(atom x)return _(x,GtkRadioToolButton)end type
+global type Popover(atom x)return _(x,GtkPopover)end type
+global type PopoverMenu(atom x)return _(x,GtkPopoverMenu)end type
+global type ColorChooser(atom x)return _(x,GtkColorChooser)end type
+global type ColorButton(atom x)return _(x,GtkColorButton)end type
+global type ColorChooserWidget(atom x)return _(x,GtkColorChooserWidget)end type
+global type ColorChooserDialog(atom x)return _(x,GtkColorChooserDialog)end type
+global type FileChooser(atom x)return _(x,GtkFileChooser)end type
+global type FileChooserButton(atom x)return _(x,GtkFileChooserButton)end type
+global type FileChooserDialog(atom x)return _(x,GtkFileChooserDialog)end type
+global type FileChooserWidget(atom x)return _(x,GtkFileChooserWidget)end type
+global type FileFilter(atom x)return _(x,GtkFileFilter)end type
+global type FontChooser(atom x)return _(x,GtkFontChooser)end type
+global type FontButton(atom x)return _(x,GtkFontButton)end type
+global type FontChooserWidget(atom x)return _(x,GtkFontChooserWidget)end type
+global type FontChooserDialog(atom x)return _(x,GtkFontChooserDialog)end type
+global type PlacesSidebar(atom x)return _(x,GtkPlacesSidebar)end type
+global type Frame(atom x)return _(x,GtkFrame)end type
+global type Scrollbar(atom x)return _(x,GtkScrollbar)end type
+global type ScrolledWindow(atom x)return _(x,GtkScrolledWindow)end type
+global type Adjustment(atom x)return _(x,GtkAdjustment)end type
+global type Calendar(atom x)return _(x,GtkCalendar)end type
+global type GLArea(atom x)return _(x,GtkGLArea)end type
+global type Tooltip(atom x)return _(x,GtkTooltip)end type
+global type Viewport(atom x)return _(x,GtkViewport)end type
+global type Widget(atom x)return _(x,GtkWidget)end type
+global type Container(atom x)return _(x,GtkContainer)end type
+global type Bin(atom x)return _(x,GtkBin)end type
+global type Range(atom x)return _(x,GtkRange)end type
+global type PrintContext(atom x)return _(x,GtkPrintContext)end type
+global type ListBoxRow(atom x)return _(x,GtkListBoxRow)end type
+global type FontFamily(atom x)return _(x,PangoFontFamily)end type
+global type FontFace(atom x)return _(x,PangoFontFace)end type
+global type FontDescription(atom x)return _(x,PangoFontDescription)end type
+global type AppChooserDialog(atom x)return _(x,GtkAppChooserDialog)end type
+global type PaperSize(atom x)return _(x,GtkPaperSize)end type
+global type DrawingArea(atom x)return _(x,GtkDrawingArea)end type
+global type RecentChooserDialog(atom x)return _(x,GtkRecentChooserDialog)end type
+global type RecentChooserWidget(atom x)return _(x,GtkRecentChooserWidget)end type
+global type RecentChooser(atom x)return _(x,GtkRecentChooser)end type
+global type RecentFilter(atom x)return _(x,GtkRecentFilter)end type
+global type RecentChooserMenu(atom x)return _(x,GtkRecentChooserMenu)end type
+global type EventBox(atom x)return _(x,GtkEventBox)end type
+global type TreeModelFilter(atom x)return _(x,GtkTreeModelFilter)end type
+global type Application(atom x)return _(x,GtkApplication)end type
+global type ApplicationWindow(atom x)return _(x,GtkApplicationWindow)end type
+global type Pixbuf(atom x)return _(x,GdkPixbuf)end type
+global type IconTheme(atom x)return _(x,GtkIconTheme)end type
+global type Cairo_T(atom x)return _(x,Cairo_t)end type
+global type CellArea(atom x)return _(x,GtkCellArea)end type
+
+-----------------------------
+-- copyright 2016 Irv Mullins
+-----------------------------
+
diff --git a/eugtk/examples/GtkEvents.e b/eugtk/examples/GtkEvents.e
new file mode 100644
index 0000000..fde1785
--- /dev/null
+++ b/eugtk/examples/GtkEvents.e
@@ -0,0 +1,277 @@
+
+----------------
+namespace events
+----------------
+
+export constant version = "4.12.0"
+
+--Thanks to Pete Eberlein for helping with this!
+
+include GtkEngine.e
+include std/convert.e
+
+if not equal(version,gtk:version) then
+ Error(,,"GtkEvents version mismatch","should be version " & gtk:version)
+end if
+
+-- Maps keys from keypad to match same keys on keyboard,
+-- maps control/arrow keys to negative numbers, so they
+-- can be differentiated from the same ascii character
+-- values;
+
+constant keyvalues = {
+{8,-8}, -- bksp
+{9,-9}, -- tab
+{20,-20}, -- scroll lock
+{27,27}, -- escape
+{80,-80}, -- home 'P'
+{81,-81}, -- left arrow 'Q'
+{82,-82}, -- up arrow 'R'
+{83,-83}, -- right arrow 'S'
+{84,-84}, -- down arrow 'T'
+{85,-85}, -- page up 'U'
+{86,-86}, -- page dn 'V'
+{87,-87}, -- end 'W'
+{99,-99}, -- insert 'c'
+{103,-103},
+{127,-127}, -- num lock
+
+{141,13}, -- keypad Enter, with or w/o numlock;
+
+-- keypad keys w/o numlock;
+{149,-149}, -- keypad home
+{150,-150}, -- keypad left
+{151,-151}, -- keypad up
+{152,-152}, -- keypad right
+{153,-153}, -- keypad down
+{154,-154}, -- keypad pg up
+{155,-155}, -- keypad pg dn
+{156,-156}, -- keypad end
+{157,-157}, -- keypad 5
+{158,-158}, -- keypad ins
+{159,-159}, -- keypad del
+
+-- keypad keys with numlock - return ascii 0..9
+{170,'*'},{171,'+'},{173,'-'},{175,'/'},
+{176,48},{177,49},{178,50},{179,51},{180,52}, -- keypad numbers 0..4
+{181,53},{182,54},{183,55},{184,56},{185,57}, -- keypad numbers 5..9
+
+-- F keys;
+{190,-190}, -- F1
+{191,-191}, -- F2
+{192,-192}, -- F3
+{193,-193}, -- F4
+{194,-194}, -- F5
+{195,-195}, -- F6
+{196,-196}, -- F7
+{197,-197}, -- F8
+{198,-198}, -- F9
+{199,-199}, -- F10
+{200,-200}, -- F11
+{201,-201}, -- F12
+{227,-227}, -- left ctl
+{228,-228}, -- right ctl
+{229,-229},
+{225,-225}, -- left shift
+{226,-226}, -- right shift
+{228,-228},
+{233,-233}, -- left alt
+{234,-234}, -- right alt
+{236,-236},
+{255,-255}, -- delete
+$}
+
+constant shiftkeys = {
+{32,-9}, -- shift tab
+$}
+
+constant event_names = {
+ {3,"focus-in"},
+ {11,"focus-out"}
+ }
+
+----------------------------------------------------------------------
+export function key(atom event) -- get key pressed;
+----------------------------------------------------------------------
+if event = 0 then return 0 end if
+integer k = peek(event+16)
+integer z = peek(event+17)
+integer s = state(event)
+ifdef BITS64 then
+ k = peek(event+28)
+ z = peek(event+29)
+end ifdef
+switch z do
+ case 0 then return k
+ case 255 then return vlookup(k,keyvalues,1,2,k)
+ case 254 then return vlookup(k,shiftkeys,1,2,k)
+end switch
+return 0
+end function
+
+--(32/64)struct GdkEventButton
+-- 0 0 GdkEventType type a.k.a. id
+-- 4 8 GtkWindow *window
+-- 8 16 gint8 send_event
+-- 12 20 guint32 time
+-- 16 24 gdouble x
+-- 24 32 gdouble y
+-- 32 40 gdouble *axes
+-- 36 48 guint state
+-- 40 52 guint button
+-- 44 56 GdkDevice *device
+-- 48 64 gdouble x_root, y_root
+
+---------------------------------------------------------------------
+export function id(atom event)
+---------------------------------------------------------------------
+if event > 0 then return peek4u(event) else return event end if
+end function
+
+---------------------------------------------------------------------
+export function name(atom event)
+---------------------------------------------------------------------
+event = id(event)
+for i = 1 to length(event_names) do
+ if event = event_names[i][1] then
+ return event_names[i][2]
+ end if
+end for
+return -1
+end function
+
+---------------------------------------------------------------------
+export function window(atom event) -- get event window
+---------------------------------------------------------------------
+ifdef BITS64 then
+ return peek8u(event + 8)
+end ifdef
+ return peek4u(event + 4)
+end function
+
+---------------------------------------------------------------------
+export function time(atom event) -- get event time
+---------------------------------------------------------------------
+ifdef BITS64 then
+ return peek4u(event + 20)
+end ifdef
+ return peek4u(event + 12)
+end function
+
+---------------------------------------------------------------------
+export function xy(atom event) -- get mouse button x y;
+---------------------------------------------------------------------
+ifdef BITS64 then
+ return floor({
+ float64_to_atom(peek({event + 24, 8})),
+ float64_to_atom(peek({event + 32, 8}))})
+end ifdef
+ return floor({
+ float64_to_atom(peek({event + 16, 8})),
+ float64_to_atom(peek({event + 24, 8}))})
+end function
+
+---------------------------------------------------------------------
+export function axes(atom event)
+---------------------------------------------------------------------
+ifdef BITS64 then
+ return float64_to_atom(peek({event + 40, 8}))
+end ifdef
+ return float64_to_atom(peek({event + 32, 8}))
+end function
+
+---------------------------------------------------------------------
+export function button(atom event) -- get mouse button clicked;
+---------------------------------------------------------------------
+ifdef BITS64 then
+ return peek(event+52)
+end ifdef
+return peek(event+40)
+end function
+
+----------------------------------------------------------------------
+export function state(atom event)
+----------------------------------------------------------------------
+ifdef BITS64 then
+ return peek(event+48)
+end ifdef
+return peek(event+36)
+end function
+
+----------------------------------------------------------------------
+export function device(atom event)
+----------------------------------------------------------------------
+ifdef BITS64 then
+ return peek(event+56)
+end ifdef
+return peek(event+44)
+end function
+
+---------------------------------------------------------------------
+export function clicks(atom event)
+---------------------------------------------------------------------
+atom ct = allocate(64)
+object result
+ if gtk_func("gdk_event_get_click_count",{P,I},{event,ct}) then
+ result = peek4u(ct)
+ else
+ result = -1
+ end if
+ free(ct)
+return result
+end function
+
+---------------------------------------------------------------------
+export function scroll_dir(atom event)
+---------------------------------------------------------------------
+atom dir = allocate(64)
+object result
+ if gtk_func("gdk_event_get_scroll_direction",{P,I},{event,dir}) then
+ result = peek4u(dir)
+ else
+ result = -1
+ end if
+ free(dir)
+return result
+end function
+
+---------------------------------------------------------------------------------
+export function pending() -- used sometimes when using timeout or eu tasks
+---------------------------------------------------------------------------------
+ return gtk_func("gtk_events_pending")
+end function
+
+------------------------------------------------------------------------
+export procedure main_iteration()
+------------------------------------------------------------------------
+ gtk_proc("gtk_main_iteration")
+end procedure
+
+-----------------------------------------------------------------------------------
+export procedure main_iteration_do(integer i) -- used sometimes when multi-tasking;
+-----------------------------------------------------------------------------------
+ gtk_proc("gtk_main_iteration_do",{I},i)
+end procedure
+
+------------------------------------------------------------------------
+-- following routine traps the enter key when Entry is activated,
+-- and uses it like the tab key - so it works like people expect.
+-- When using Glade, connect each entry's 'activate' signal to
+-- trap_enter_key
+------------------------------------------------------------------------
+constant gsig = define_proc("g_signal_emit_by_name",{P,P,P})
+constant fsig = allocate_string("move-focus")
+------------------------------------------------------------------------
+global function trap_enter_key(atom ctl, atom event)
+-----------------------------------------------------------------------
+ if class_id(ctl) = GtkEntry then
+ if event = 0 then
+ c_proc(gsig,{ctl,allocate_string("move-focus"),0})
+ return 1
+ end if
+ end if
+return 0
+end function
+
+
+
diff --git a/eugtk/examples/GtkFileSelector.e b/eugtk/examples/GtkFileSelector.e
new file mode 100644
index 0000000..91959ac
--- /dev/null
+++ b/eugtk/examples/GtkFileSelector.e
@@ -0,0 +1,454 @@
+
+-------------------------
+namespace fileselector -- Generic file selection dialog;
+-------------------------
+
+--# EXPORTS:
+/*
+ -- functions:
+ fileselector:New()
+ fileselector:Open()
+ fileselector:Save()
+ fileselector:SaveAs()
+ fileselector:CreateFolder()
+ fileselector:SelectFolder()
+
+ -- returns:
+ full file path if successful, e.g. "/home/irv/demos/test99.ex"
+ or an atom:
+ MB_ABORT when dialog is closed
+ MB_CANCEL when cancel button is clicked.
+*/
+
+include GtkEngine.e
+
+export constant version = "4.12.0"
+
+if not equal(version,gtk:version) then
+ Error(,,"GtkFileSelector version mismatch","should be version " & gtk:version)
+end if
+
+
+-- default settings, change before calling the dialog if required;
+export boolean
+ create_folders = TRUE,
+ local_only = TRUE,
+ select_multiple = FALSE,
+ show_hidden = FALSE,
+ do_overwrite_confirmation = TRUE,
+ show_preview = FALSE,
+ preview_widget_active = TRUE
+
+export sequence preview_size = {200,200}
+
+export atom preview_max = 150 -- default size
+
+export object selected_filter=0, filters = {"euphoria","text"}
+
+-- may change filters before calling the dialog
+-- (or every 5,000 miles, whichever comes first)
+
+-- IOW, to show only .css files, add the line:
+-- fileselector:filters = {"css"}
+-- before calling:
+-- fileselector:Open("~/demos/*")
+
+-- note that the syntax of the parameter to Open() is important:
+-- ~/demos or ~/demos/ will only cause the dialog to highlight the ~/demos folder,
+-- ~/demos/* will open the demos folder and display the [filtered] file types
+-- ~/demos/*.css will show folders and all *.css files
+
+-- combining filters with wildcards:
+-- fileselector:filters = {"images"}
+-- fileselector:Open("~/demos/glade/*")
+-- the above will show all images in the specified directory,
+
+-- whereas:
+-- fileselector:Open("~/demos/glade/*.png")
+-- will show only .png images in the specified directory,
+-- regardless of how the filters are set.
+
+-- below, only .png images will be shown, but drop-down options to show .html and .c files
+-- will be available also:
+-- fileselector:filters = {"html","c"}
+-- fileselector:Open("~/demos/glade/*.png")
+
+--------------------------------------
+function generate_filter(object name)
+--------------------------------------
+object filter = 0
+
+ switch name do
+
+ case "images",".jpg",".gif",".png",".xpm" then filter = create(GtkFileFilter,{
+ {"name","Images"},{"add mime type","image/*"}})
+
+ case "euphoria",".eu",".e",".exw" then filter = create(GtkFileFilter,{
+ {"name","Euphoria files"},{"add pattern","*.e"},
+ {"add pattern","*.ex"},{"add pattern","*.cfg"}})
+
+ case "text",".text",".txt" then filter = create(GtkFileFilter,{
+ {"name","All text"},{"add mime type","text/plain"}})
+
+ case "c",".c",".h" then filter = create(GtkFileFilter,{
+ {"name","C source code"},{"add mime type","text/x-c"},
+ {"add pattern","*.c"},{"add pattern","*.h"}})
+
+ case "c++" then filter = create(GtkFileFilter,{
+ {"name","C++ source code"},{"add pattern","*.c++"}})
+
+ case "css",".css" then filter = create(GtkFileFilter,{
+ {"name","css markup"},{"add mime type","text/css"},
+ {"add pattern","*.css"}})
+
+ case "python",".python",".py" then filter = create(GtkFileFilter,{
+ {"name","Python"},{"add mime type","text/x-python"}})
+
+ case "html",".htm",".html" then filter = create(GtkFileFilter,{
+ {"name","html source"},{"add mime type","text/html"},
+ {"add pattern","*.html"}})
+
+ case "ini",".ini" then filter = create(GtkFileFilter,{
+ {"name","ini"},{"add pattern","*.ini"}})
+
+ case "all" then filter = create(GtkFileFilter,{
+ {"name","All files"},{"add pattern","*"}})
+
+ case "dir" then filter = create(GtkFileFilter,{
+ {"name","Directories"},{"add mime type","inode/directory"}})
+
+ end switch
+
+return filter
+
+end function
+
+constant update_preview = call_back(routine_id("UpdatePreview"))
+
+----------------------------------------------------------
+export function New(object current=0)
+----------------------------------------------------------
+object result=0
+atom dlg = create(GtkFileChooserDialog)
+
+set(dlg,{
+ {"name","FileNew"},
+ {"title","Create a new file"},
+ {"action",GTK_FILE_CHOOSER_ACTION_SAVE},
+ {"preview widget active",preview_widget_active},
+
+ {"add button","gtk-cancel",MB_CANCEL},
+ {"add button","gtk-ok",MB_OK},
+ {"create folders",create_folders},
+ {"local only",local_only},
+ {"select multiple",select_multiple},
+ {"show hidden",show_hidden},
+ {"do overwrite confirmation",do_overwrite_confirmation}})
+
+ for i = 1 to length(filters) do
+ set(dlg,"add filter",generate_filter(filters[i]))
+ end for
+
+ if show_preview = TRUE then
+ atom preview = create(GtkImage)
+ set(dlg,"preview widget",preview)
+ connect(dlg,"update-preview",update_preview,preview)
+ end if
+
+ if atom(current) and current > 0 then
+ set(dlg,"current name",unpack(current))
+ end if
+
+ result = get(dlg,"run")
+ if result = MB_OK then
+ result = get(dlg,"filename")
+ end if
+
+destroy(dlg)
+
+return result
+end function
+export constant new = call_back(routine_id("New"))
+
+----------------------------------------------------
+export function Open(object data=0, atom x=0)
+----------------------------------------------------
+object result=0
+object filter=0
+
+if atom(data) and data > 0 then data = unpack(data) end if
+if string(data) and equal("*",filename(data)) then filters &= {"all"} end if
+
+atom dlg = create(GtkFileChooserDialog)
+
+set(dlg,{
+ {"name","FileOpen"},
+ {"title","Open a file"},
+ {"action",GTK_FILE_CHOOSER_ACTION_OPEN},
+ {"preview widget active",preview_widget_active},
+
+ {"add button","gtk-cancel",MB_CANCEL},
+ {"add button","gtk-ok",MB_OK},
+ {"create folders",create_folders},
+ {"local only",local_only},
+ {"select multiple",select_multiple},
+ {"show hidden",show_hidden},
+ {"do overwrite confirmation",do_overwrite_confirmation}})
+
+ for i = 1 to length(filters) do
+ set(dlg,"add filter",generate_filter(filters[i]))
+ end for
+
+ if show_preview = TRUE then
+ atom preview = create(GtkImage)
+ set(dlg,"preview widget",preview)
+ connect(dlg,"update-preview",update_preview,preview)
+ end if
+
+ if atom(data) and data > 0 then
+ data = unpack(data)
+ end if
+
+ if string(data) then
+ if file_exists(canonical_path(data)) then
+ set(dlg,"filename",canonical_path(data))
+ else
+ if not equal("*",filename(data)) then
+ filter = create(GtkFileFilter,{ -- build a custom filter;
+ {"name",filename(data) & " files"},
+ {"add pattern",filename(data)}})
+ set(dlg,"add filter",filter)
+ set(dlg,"filter",filter)
+ end if
+ set(dlg,"filename",canonical_path(data)) -- change to desired folder;
+ end if
+ end if
+
+ result = get(dlg,"run")
+
+ if result = MB_OK then
+ result = get(dlg,"filename")
+ end if
+
+ destroy(dlg)
+
+return result
+end function
+export constant open = call_back(routine_id("Open"))
+
+----------------------------------------------------
+export function Save(object data, object x=0)
+----------------------------------------------------
+object result=0
+atom dlg = create(GtkFileChooserDialog)
+atom f
+
+set(dlg,{
+ {"name","FileSave"},
+ {"title","Save this file"},
+ {"action",GTK_FILE_CHOOSER_ACTION_SAVE},
+
+ {"add button","gtk-cancel",MB_CANCEL},
+ {"add button","gtk-ok",MB_OK},
+ {"create folders",create_folders},
+ {"local only",local_only},
+ {"select multiple",select_multiple},
+ {"show hidden",show_hidden},
+ {"do overwrite confirmation",do_overwrite_confirmation}})
+
+ for i = 1 to length(filters) do
+ set(dlg,"add filter",generate_filter(filters[i]))
+ end for
+
+ if show_preview = TRUE then
+ atom preview = create(GtkImage)
+ set(dlg,"preview widget",preview)
+ connect(dlg,"update-preview",update_preview,preview)
+ end if
+
+ if atom(data) and data > 0 then
+ set(dlg,"current name",unpack(data))
+ end if
+
+ if string(data) then
+ set(dlg,"current name",data)
+ end if
+
+ result = get(dlg,"run")
+
+ if result = MB_OK then
+ result = get(dlg,"filename")
+ end if
+
+destroy(dlg)
+
+return result
+end function
+export constant save = call_back(routine_id("Save"))
+
+-----------------------------------------------------------
+export function SaveAs(object data=0, object x=0)
+-----------------------------------------------------------
+object result=0
+atom dlg = create(GtkFileChooserDialog)
+
+set(dlg,{
+ {"name=FileSaveAs"},
+ {"title","Save this file with a new name"},
+ {"action",GTK_FILE_CHOOSER_ACTION_SAVE},
+
+ {"add button","gtk-cancel",MB_CANCEL},
+ {"add button","gtk-ok",MB_OK},
+ {"create folders",create_folders},
+ {"local only",local_only},
+ {"select multiple",select_multiple},
+ {"show hidden",show_hidden},
+ {"do overwrite confirmation",do_overwrite_confirmation}})
+
+ for i = 1 to length(filters) do
+ set(dlg,"add filter",generate_filter(filters[i]))
+ end for
+
+ if show_preview = TRUE then
+ atom preview = create(GtkImage)
+ set(dlg,"preview widget",preview)
+ connect(dlg,"update-preview",update_preview,preview)
+ end if
+
+ if atom(data) and data > 0 then
+ set(dlg,"current name",unpack(data))
+ elsif string(data) then
+ set(dlg,"current name",data)
+ end if
+
+ result = get(dlg,"run")
+
+ if result = MB_OK then
+ result = get(dlg,"filename")
+ end if
+
+ destroy(dlg)
+
+return result
+end function
+export constant save_as = call_back(routine_id("SaveAs"))
+
+---------------------------------------------------------------
+export function CreateFolder(object data=0, object x=0)
+---------------------------------------------------------------
+object result=0
+atom dlg = create(GtkFileChooserDialog)
+
+set(dlg,{
+ {"name=NewFolder"},
+ {"title","Create a new folder"},
+ {"action",GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER},
+
+ {"add button","gtk-cancel",MB_CANCEL},
+ {"add button","gtk-ok",MB_OK},
+ {"create folders",create_folders},
+ {"local only",local_only},
+ {"select multiple",select_multiple},
+ {"show hidden",show_hidden},
+ {"do overwrite confirmation",do_overwrite_confirmation}})
+
+ for i = 1 to length(filters) do
+ set(dlg,"add filter",generate_filter(filters[i]))
+ end for
+
+ if show_preview = TRUE then
+ atom preview = create(GtkImage)
+ set(dlg,"preview widget",preview)
+ connect(dlg,"update-preview",update_preview,preview)
+ end if
+
+ if atom(data) and data > 0 then
+ set(dlg,"current name",unpack(data))
+ end if
+
+ result = get(dlg,"run")
+
+ if result = MB_OK then
+ result = get(dlg,"filename")
+ end if
+
+destroy(dlg)
+
+return result
+end function
+export constant create_folder = call_back(routine_id("CreateFolder"))
+
+---------------------------------------------------------------
+export function SelectFolder(object data=0, object x=0)
+---------------------------------------------------------------
+object result=0
+atom dlg = create(GtkFileChooserDialog)
+
+set(dlg,{
+ {"name","SelectFolder"},
+ {"title","Select a folder"},
+ {"action",GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER},
+
+ {"add button","gtk-cancel",MB_CANCEL},
+ {"add button","gtk-ok",MB_OK},
+ {"create folders",create_folders},
+ {"local only",local_only},
+ {"select multiple",select_multiple},
+ {"show hidden",show_hidden},
+ {"do overwrite confirmation",do_overwrite_confirmation}})
+
+ for i = 1 to length(filters) do
+ set(dlg,"add filter",generate_filter(filters[i]))
+ end for
+
+ if show_preview = TRUE then
+ atom preview = create(GtkImage)
+ set(dlg,"preview widget",preview)
+ connect(dlg,"update-preview",update_preview,preview)
+ end if
+
+ if atom(data) and data > 0 then
+ data = unpack(data)
+ if string(data) then
+ if file_exists(canonical_path(data)) then
+ set(dlg,"filename",canonical_path(data))
+ else
+ set(dlg,"filename",data)
+ end if
+ end if
+ end if
+
+result = get(dlg,"run")
+
+if result = MB_OK then
+ result = get(dlg,"filename")
+end if
+
+destroy(dlg)
+
+return result
+end function
+export constant select_folder = call_back(routine_id("SelectFolder"))
+
+------------------------------------------------------------------------------
+function UpdatePreview(atom dlg, atom preview) -- local: follow focus changes;
+------------------------------------------------------------------------------
+object pix
+atom ratio
+object dimensions
+object fn = get(dlg,"filename")
+
+if string(fn) then -- avoid trying to preview a directory!
+ pix = create(GdkPixbuf,fn)
+ if pix > 0 then
+ dimensions = get(pix,"size")
+ ratio = preview_max / dimensions[1]
+ dimensions *= {ratio,ratio}
+ pix = get(pix,"scale simple",dimensions[1],dimensions[2],1)
+ set(preview,"from pixbuf",pix)
+ end if
+end if
+
+return 0
+end function
+
diff --git a/eugtk/examples/GtkFontSelector.e b/eugtk/examples/GtkFontSelector.e
new file mode 100644
index 0000000..dc5165f
--- /dev/null
+++ b/eugtk/examples/GtkFontSelector.e
@@ -0,0 +1,154 @@
+
+----------------------
+namespace fontselector -- Generic font selector dialog
+----------------------
+
+--# EXPORTS
+/*
+ -- functions -- callbacks
+ fontselector:Select() fontselector:select
+ fontselector:FilterFonts() fontselector:filter
+
+-- fontlist
+*/
+
+include GtkEngine.e
+include GtkCairo.e
+include std/wildcard.e
+include std/hash.e
+
+export constant version = "4.12.0"
+
+if not equal(version,gtk:version) then
+ Error(,,"GtkFontSelector version mismatch","should be version " & gtk:version)
+end if
+
+-- Optional parameter is preferred (default) font, the one to be
+-- returned if the font dialog ok button is clicked without choosing
+-- a different font. You can just specify a size here: "8" and that
+-- will set only the dialog's size selector.
+--
+-- You can specify a full font name and size: e.g. Purisa bold 16,
+-- and that font will be the one highlighted for selection.
+-- If you specify a font that doesn't exist: e.g. Bogus italic 18,
+-- and then use the returned font, GTK will do the best it can,
+-- which will be to set the existing font to italic in 18pt.
+-- Fairly fail-safe, in other words.
+--
+-- Setting this does not filter the list of fonts shown by the dialog.
+-- to do this, you need to set the pattern. See below.
+--
+-- To exclude unwanted (and unreadable) fonts, such as symbols and
+-- dingbats, add them to the exclude sequence. See below.
+--
+-- pattern can be set prior to the select() call
+-- pattern can be an array of font names, wildcards are ok
+-- e.g. {"Courier*","purisa"}
+-- if you use, for example, just {"Courier"}, without the wildcard,
+-- no fonts will be found.
+--
+-- {"sans"}, {"*sans"}, or {"*sans*"} will each return a different
+-- set of matching font names! trial and error may be required.
+--
+-- if pattern is left unset, ALL fonts will be shown!
+
+export atom dlg = create(GtkFontChooserDialog,"name=FontSelector")
+
+export object
+ name = 0, -- font name
+ title = "Choose a font", -- dialog title
+ preview_text = "This is an EuGTK font selector",
+ description = 0, -- a PangoFontDescription
+ family = 0, -- font family
+ style = 0, -- normal, oblique, italic
+ variant = 0,
+ weight = PANGO_WEIGHT_NORMAL,
+ mono_filter = 0,
+ font_list = {}
+
+export atom size = 12*1024
+export integer points = 12
+export sequence pattern = {"*"}
+
+export sequence exclude = {"*symbol*","*dingbat*","*webdings","*wingdings*"}
+-- above list filters out unusable fonts;
+
+------------------------------------------------------------------------
+export function Select(object curr_fnt=0)
+------------------------------------------------------------------------
+ set(dlg,"title","Select a font")
+ set(dlg,"preview text",preview_text)
+ if string(curr_fnt) then
+ set(dlg,"font",curr_fnt)
+ end if
+ pattern = lower(pattern)
+ exclude = lower(exclude)
+
+ set(dlg,"filter func",filter)
+
+ if get(dlg,"run") then
+ name = get(dlg,"font")
+ description = create(PangoFontDescription,name)
+ family = get(description,"family")
+ size = get(description,"size")
+ points = math:round(size/PANGO_UNIT)
+ variant = get(description,"variant")
+ style = get(description,"style")
+ weight = get(description,"weight")
+ end if
+
+ hide(dlg) -- we keep it around, since it's likely to be used again :p
+
+return name
+end function
+export constant select = call_back(routine_id("Select"))
+
+------------------------------------------------------------------------
+export function FilterFonts(object family, object face, object data)
+------------------------------------------------------------------------
+integer result = 0
+
+if mono_filter then
+ if gtk_func("pango_font_family_is_monospace",{P},{family}) = FALSE then
+ return 0
+ end if
+end if
+
+object name = lower(gtk_str_func("pango_font_family_get_name",{P},{family}))
+ for i = 1 to length(pattern) do
+ result = is_match(pattern[i],name) > 0
+ if result = 1 then
+ for x = 1 to length(exclude) do
+ if is_match(exclude[x],name) then
+ return 0
+ end if
+ end for
+ end if
+ return result
+ end for
+return result
+end function
+export constant filter = call_back(routine_id("FilterFonts"))
+
+sequence weight_names =
+{"thin","ultralight","light","book","normal","medium",
+"semibold","bold","ultrabold","heavy","ultraheavy"}
+
+/* -- reference;
+ PANGO_WEIGHT_THIN = 100,
+ PANGO_WEIGHT_ULTRALIGHT = 200,
+ PANGO_WEIGHT_LIGHT = 300,
+ PANGO_WEIGHT_BOOK = 380,
+ PANGO_WEIGHT_NORMAL = 400,
+ PANGO_WEIGHT_MEDIUM = 500,
+ PANGO_WEIGHT_SEMIBOLD = 600,
+ PANGO_WEIGHT_BOLD = 700,
+ PANGO_WEIGHT_ULTRABOLD = 800,
+ PANGO_WEIGHT_HEAVY = 900,
+ PANGO_WEIGHT_ULTRAHEAVY = 1000,
+ PANGO_UNIT = 1024
+
+ PANGO_STYLE_NORMAL = 0,
+ PANGO_STYLE_OBLIQUE = 1,
+ PANGO_STYLE_ITALIC = 2
+*/
diff --git a/eugtk/examples/GtkPrinter.e b/eugtk/examples/GtkPrinter.e
new file mode 100644
index 0000000..972a083
--- /dev/null
+++ b/eugtk/examples/GtkPrinter.e
@@ -0,0 +1,567 @@
+
+--------------------
+namespace printer -- Utility to make printing easier
+--------------------
+
+export constant version = "4.12.0"
+
+ -- EXPORTS:
+ -- functions callbacks
+ -- printer:PrintFile() printer:print_file
+ -- printer:PrintText() printer:print_text
+
+-- This version handles most common printing needs, but it will not yet respect
+-- 'marked up' a.k.a. 'rich' text, i.e. text with colors and styles as produced
+-- by GTK3's TextView widget. It just prints them as plain text.
+--
+-- However, it DOES print text marked up with GTK's HTML subset, so you can use
+-- , , , , ... etc. in your printouts! This includes various
+-- imbedded font styles and colors.
+--
+-- More documentation is found in ~/documentation/printing.html
+
+include GtkEngine.e
+include GtkCairo.e
+include std/datetime.e
+
+if not equal(version,gtk:version) then
+ Error(,,"GtkPrinter version mismatch","should be version " & gtk:version)
+end if
+
+-- The following exported variables can be modified before calling the
+-- print routine:
+
+public object header = "[1]\n" -- default is just the page title
+
+public object subheader = "[1] page [5]\n\n" -- format for headers on pg.2 ... n
+-- default subheader (above) prints page title and pg #;
+
+public object footer = "\nPrinted by EuGTK [8] on [9]'s computer "
+-- default footer (above) prints date and user name;
+
+-- Info ID's for use in header and footer;
+-- 1 = page title (for first page)
+-- 2 = sub title (for subsequent pages - leave null to use page title (1) on all pgs)
+-- 3 = file name
+-- 4 = short name (file name w/o path)
+-- 5 = current page number
+-- 6 = n_pages printed e.g. pg 1 of n
+-- 7 = n_copies requested
+-- 8 = today's date in date_format
+-- 9 = user name
+--10 = user's real name
+--11 = font name used for this print job
+--12 = file length in bytes
+--13 = file timestamp
+--14 = exported filename, if any
+
+export integer
+ n_pages = 0, -- number of pages to print (0=all)
+ n_copies = 1,
+ collate = FALSE,
+ duplex = 0,
+ number_up = 1,
+ number_up_layout = 1,
+ units = GTK_UNIT_INCH,
+ use_line_numbers = TRUE,
+ use_color = TRUE, -- print eu comments in red if true
+ lines_per_page = 60,
+ wrap_at = 0,
+ track_status = TRUE,
+ show_progress = TRUE, -- enable the built-in progressbar
+ embed_page_setup = TRUE,
+ orientation = 0,
+ order = 0,
+ confirm = FALSE,
+ sourcecode = TRUE,
+ plaintext = FALSE,
+ use_full_page = FALSE, -- ignore margins
+ has_selection = FALSE,
+ support_selection = FALSE,
+ quality = GTK_PRINT_QUALITY_DRAFT,
+ action = GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
+ auto_lpp = TRUE
+
+export atom
+ scale = 100,
+ top_margin = 0.25, -- in inch units
+ left_margin = 0.25,
+ right_margin = 0.25,
+ bottom_margin = 0.25,
+ parent = 0,
+
+ signal_status_changed = call_back(routine_id("show_status")),
+ signal_begin_print = call_back(routine_id("begin_print")),
+ signal_draw_page = call_back(routine_id("draw_page")),
+ signal_end_print = call_back(routine_id("end_print")),
+ signal_request_page_setup = 0,
+ signal_done = 0,
+ signal_ready = 0,
+ signal_got_page_size = 0
+
+export object
+ name = 0,
+ font = "Ubuntu Mono 8",
+ jobname = 0,
+ settings_file = 0,
+ setup_file = 0,
+ export_file = 0,
+ page_ranges = 0,
+ page_set = GTK_PAGE_SET_ALL,
+ custom_tab_hook = 0,
+ custom_tab_label = 0,
+ custom_tab_func = 0
+
+ifdef WINDOWS then font = "Courier New 16" end ifdef
+
+export object
+ line_number_format = "[:4] []\n", -- controls line # format AND code line!
+ paper_name = "na_letter", -- 8.5x11.0"
+ tabs = " ", -- replace tab chars with 8 spaces
+ file_name = 0,
+ short_name = 0,
+ page_title = 0,
+ sub_title = 0
+
+export atom
+ progress = create(GtkProgressBar),
+ settings = create(GtkPrintSettings)
+
+-- use date and time formats in std/datetime.e;
+export sequence date_format = "%A, %B %d %Y %l:%M %p"
+
+sequence user
+ifdef WINDOWS then
+ user = "User"
+elsedef
+ user = proper(getenv("USER"))
+end ifdef
+
+-- for local use;
+atom fontdesc
+integer filesize = 0
+object timestamp = 0
+sequence text
+sequence today = datetime:format(datetime:now(),date_format)
+
+export procedure reset()
+ n_pages = 0
+ n_copies = 1
+ collate = FALSE
+ duplex = 0
+ number_up = 1
+ number_up_layout = 1
+ units = GTK_UNIT_INCH
+ use_line_numbers = TRUE
+ use_color = TRUE
+ lines_per_page = 60
+ wrap_at = 0
+ track_status = TRUE
+ show_progress = TRUE
+ embed_page_setup = TRUE
+ orientation = 0
+ order = 0
+ confirm = FALSE
+ sourcecode = TRUE
+ plaintext = FALSE
+ use_full_page = FALSE
+ has_selection = FALSE
+ support_selection = FALSE
+ quality = GTK_PRINT_QUALITY_DRAFT
+ action = GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG
+ auto_lpp = TRUE
+
+ scale = 100
+ top_margin = 0.25
+ left_margin = 0.25
+ right_margin = 0.25
+ bottom_margin = 0.25
+ parent = 0
+
+ name = 0
+ paper_name = "na_letter"
+ font = "Ubuntu Mono 8"
+ jobname = 0
+ settings_file = 0
+ setup_file = 0
+ export_file = 0
+ page_ranges = 0
+ page_set = GTK_PAGE_SET_ALL
+ custom_tab_hook = 0
+ custom_tab_label = 0
+ custom_tab_func = 0
+
+end procedure
+
+------------------------------------------------------------------------
+export function PrintFile(object f=0, object x=0)
+------------------------------------------------------------------------
+
+if string(f) and string(x) then
+ page_title = f
+ file_name = canonical_path(x)
+ timestamp = file_timestamp(file_name)
+ filesize = file_length(file_name)
+ short_name = filebase(file_name)
+ text = read_file(file_name)
+ setup_printer()
+ return 1
+end if
+
+if string(f) and atom(x) and x = 0 then
+ f = canonical_path(f)
+ file_name = f
+ timestamp = file_timestamp(f)
+ filesize = file_length(f)
+ short_name = filebase(f)
+ page_title = filename(f)
+ text = read_file(f)
+ setup_printer()
+ return 1
+end if
+
+if string(f) and atom(x) and x < 100 then
+ page_title = f
+ short_name = f
+ file_name = f
+ text = read_file(x)
+ setup_printer()
+ return 1
+end if
+
+if atom(f) and atom(x) and x < 101 then
+ if atom(file_name) then
+ file_name = ""
+ end if
+ if atom(short_name) then
+ short_name = ""
+ end if
+ if atom(page_title) then
+ page_title = ""
+ end if
+ text = read_file(x)
+ setup_printer()
+ return 1
+end if
+
+if atom(f) and atom(x) then
+ x = unpack(x)
+ x = canonical_path(x)
+ file_name = x
+ short_name = filebase(x)
+ page_title = filename(x)
+ text = read_file(x)
+ setup_printer()
+ return 1
+end if
+
+return 1
+end function
+export constant print_file = call_back(routine_id("PrintFile"))
+
+------------------------------------------------------------------------
+export function PrintText(object f=0, object x=0)
+------------------------------------------------------------------------
+
+if string(f) and string(x) then
+ page_title = f
+ text = x
+ setup_printer()
+ return 1
+end if
+
+if atom(f) and string(x) then
+ setup_printer()
+ text = x
+ return 1
+end if
+
+if atom(f) and atom(x) then
+ if atom(page_title) and page_title = 0 then
+ page_title = ""
+ end if
+ text = unpack(x)
+ setup_printer()
+ return 1
+end if
+
+return 0
+end function
+export constant print_text = call_back(routine_id("PrintText"))
+
+integer status_code
+sequence status_string
+
+-----------------------------------------------
+export function show_status(atom op)
+-----------------------------------------------
+atom
+ fn1 = define_func("gtk_print_operation_get_status",{P},I),
+ fn2 = define_func("gtk_print_operation_get_status_string",{P},S)
+
+status_code = c_func(fn1,{op})
+status_string = peek_string(c_func(fn2,{op}))
+
+ifdef PRINT then display("Status [] []",{status_code,status_string}) end ifdef
+
+if show_progress then
+ set(progress,"text",status_string)
+end if
+
+ifdef DELAY then sleep(0.15) end ifdef
+
+return 1
+end function
+
+------------------------------------------------------
+export function begin_print(atom op, atom context)
+------------------------------------------------------
+ifdef PRINT then display("Begin printing [] pages ",length(text)) end ifdef
+
+fontdesc = create(PangoFontDescription,font)
+
+if auto_lpp then
+atom setup = get(op,"default page setup")
+ atom pght = get(setup,"page height",GTK_UNIT_POINTS)
+ --display("Page height [] pt.",pght)
+ pght -= length(header)
+ pght -= length(footer)
+ atom fs = get(fontdesc,"size") / 1024
+ --display("Font size []",fs)
+ fs = fs * (96/72)
+ integer lpp = 1
+ while ((fs*lpp)) < pght do
+ lpp += 1
+ --display("Text height [] lpp []",{(fs*lpp),lpp})
+ end while
+ --display("New LPP []",lpp-1)
+ lines_per_page = lpp
+end if
+
+text = process_text(text)
+
+set(op,"n pages",n_pages)
+
+-- important, as a new value for n_pages is computed
+-- based on the length of the file being read, unless a set number
+-- has been provided from the calling program.
+
+if show_progress then -- turn on the progress dialog in the calling program
+ show_all(progress)
+end if
+
+return 1
+end function
+
+----------------------------------------------------------------------------
+export function draw_page(atom op, atom context, integer pg, atom data)
+----------------------------------------------------------------------------
+atom fn6 = define_func("gtk_print_context_get_cairo_context",{P},P)
+
+atom cr = c_func(fn6,{context})
+atom pl = create(PangoCairoLayout,cr)
+ set(pl,"font description",fontdesc)
+
+pg += 1
+if pg > length(text) then
+ set(progress,"text","Printing complete")
+ return 0
+end if
+
+if show_progress then
+ set(progress,"text",sprintf("Printing page %d",pg))
+ set(progress,"fraction",pg/n_pages)
+end if
+
+ifdef DELAY then sleep(0.25) end ifdef
+
+object details = {
+ page_title,sub_title,file_name,short_name,
+ pg,n_pages,n_copies,
+ today,user,real_name,font,filesize,timestamp,export_file
+ }
+
+object page
+
+if atom(header) then header = "[1] page [5] of [6] \n\n" end if
+
+if pg = 1 or atom(subheader) then
+ page = text:format(header,details)
+ & flatten(text[pg])
+ & text:format(footer,details)
+else
+ page = text:format(subheader,details)
+ & flatten(text[pg])
+ & text:format(footer,details)
+end if
+
+if plaintext then
+ set(pl,"text",page,length(page))
+else
+ set(pl,"markup",page,length(page))
+end if
+
+ set(pl,"update layout",cr)
+ set(pl,"show layout",cr)
+
+ifdef PRINT then printf(1,"Page %d\n",pg) end ifdef
+
+return 1
+end function
+
+------------------------------------------------------------------------
+function process_text(object txt)
+------------------------------------------------------------------------
+txt = split(txt,'\n')
+integer comment, n
+object a,b
+object test
+
+
+for i = 1 to length(txt) do -- replace chars which will confuse markup
+
+ txt[i] = join(split(txt[i],'&'),"&")
+ txt[i] = join(split(txt[i],"&"),"&")
+
+ if sourcecode then
+ txt[i] = join(split(txt[i],'<'),"<")
+ txt[i] = join(split(txt[i],'>'),">")
+ end if
+
+ if use_color then
+ if match("--",txt[i]) then -- a comment;
+ txt[i] = split(txt[i],"--")
+ txt[i] = txt[i][1] & "-- " & txt[i][2] & " "
+ end if
+ end if
+
+ if use_line_numbers then
+ txt[i] = text:format(line_number_format,{i,txt[i]})
+ else
+ txt[i] &= '\n'
+ end if
+
+end for
+
+txt = breakup(txt,lines_per_page)
+
+if n_pages = 0 then -- no selection
+ n_pages = length(txt)
+end if
+
+return txt
+end function
+
+------------------------------------------------------------------------
+export function end_print()
+------------------------------------------------------------------------
+status_string = "Printing complete"
+ifdef PRINT then display(status_string) end ifdef
+return 1
+end function
+
+---------------------------------------------------------------
+export function setup_printer()
+---------------------------------------------------------------
+atom _size = create(GtkPaperSize,paper_name)
+atom err = allocate(16) err = 0
+object results = 0
+
+atom fn7 = define_func("gtk_print_operation_run",{P,I,P,P},I)
+atom fn8 = define_func("gtk_print_run_page_setup_dialog",{P,P,P},P)
+
+ set(settings,"paper size",_size,units)
+ set(settings,"n copies",n_copies)
+ set(settings,"collate",collate)
+ set(settings,"duplex",duplex)
+ set(settings,"reverse",order)
+ set(settings,"scale",scale)
+ set(settings,"quality",quality)
+ set(settings,"number up",number_up)
+ set(settings,"number up layout",number_up_layout)
+
+ if string(name) then
+ set(settings,"printer",name)
+ end if
+
+atom setup = create(GtkPageSetup)
+ set(setup,"paper size",_size)
+ set(setup,"orientation",orientation)
+ set(setup,"left margin",left_margin,units)
+ set(setup,"right margin",right_margin,units)
+ set(setup,"top margin",top_margin,units)
+ set(setup,"bottom margin",bottom_margin,units)
+
+atom printop = create(GtkPrintOperation)
+ set(printop,"print settings",settings)
+ set(printop,"default page setup",setup)
+ set(printop,"show progress",show_progress)
+ set(printop,"track print status",track_status)
+ set(printop,"embed page setup",embed_page_setup)
+ set(printop,"support selection",support_selection)
+ set(printop,"has selection",has_selection)
+ set(printop,"use full page",use_full_page)
+
+ if action = GTK_PRINT_OPERATION_ACTION_EXPORT then
+ export_file = canonical_path(export_file)
+ set(printop,"export filename",export_file)
+ end if
+
+ if string(jobname) then
+ set(printop,"job name",jobname)
+ end if
+
+ if custom_tab_hook != 0 then
+ set(printop,"custom tab label",custom_tab_label)
+ connect(printop,"create-custom-widget",custom_tab_func,printop)
+ connect(printop,"custom-widget-apply",custom_tab_hook)
+ end if
+
+ connect(printop,"status-changed",signal_status_changed)
+ connect(printop,"begin-print",signal_begin_print)
+ connect(printop,"draw-page",signal_draw_page)
+ connect(printop,"end-print",signal_end_print)
+ connect(printop,"request-page-setup",signal_request_page_setup)
+ connect(printop,"done",signal_done)
+ connect(printop,"ready",signal_ready)
+ connect(printop,"got-page-size",signal_got_page_size)
+
+ display(get(settings,"printer lpi"))
+
+ c_func(fn7,{printop,action,parent,err}) -- start the print process;
+
+ if string(setup_file) and file_exists(canonical_path(setup_file)) then
+ get(setup,"to file",canonical_path(setup_file))
+ end if
+
+object jobname = get(printop,"job name")
+ if confirm then
+ if action = GTK_PRINT_OPERATION_ACTION_EXPORT then
+ if Question(0,"PDF Written",
+ sprintf("%s\nFolder: %s ",
+ {filename(export_file),pathname(export_file)}),
+ sprintf("%s\nStatus: %d\n%s\nClick Yes to view",{jobname,status_code,status_string})
+ ,,,"printer") then
+ show_uri(export_file)
+ end if
+ else
+ Info(0,"Print Job",jobname,
+ sprintf("Status: %d %s",{status_code,status_string})
+ ,,"printer")
+ end if
+ end if
+
+ page_title = 0
+ n_pages = 0
+ n_copies = 1
+ action = GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG
+
+return 1
+end function
+
+header = "[1] \n\n"
+
+-----------------------------
+-- copyright 2015 Irv Mullins
+-----------------------------
+
diff --git a/eugtk/examples/GtkSettings.e b/eugtk/examples/GtkSettings.e
new file mode 100644
index 0000000..033a31e
--- /dev/null
+++ b/eugtk/examples/GtkSettings.e
@@ -0,0 +1,305 @@
+
+---------------------
+namespace settings -- functions to read and write config files (*.ini);
+---------------------
+
+export constant version = "4.12.0"
+
+--# EXPORTS
+/*
+ --functions:
+ settings:Save()
+ settings:Load()
+ settings:Add()
+
+ -- debug:
+ -d SETTINGS
+*/
+
+include GtkEngine.e
+
+if not equal(version,gtk:version) then
+ Error(,,"GtkSettings version mismatch","should be version " & gtk:version)
+end if
+
+constant fmt = """[].[]=[]"""
+
+------------------------------------------------------------------------
+export function Save(sequence inifile, object ctl_list, integer debug=0)
+------------------------------------------------------------------------
+-- writes an 'ini' type file (file name and extension are up to you)
+-- with an entry for each control on ctl_list. The controls MUST have
+-- been named, otherwise there's no way to save and retrieve the
+-- value/setting for that control.
+------------------------------------------------------------------------
+object comments = {}
+object txt,line
+
+if file_exists(inifile) then
+
+ txt = read_lines(inifile)
+ for i = 1 to length(txt) do -- extract the comments;
+ line = txt[i]
+ if match("--",line) = 1
+ or match("!",line) = 1
+ or match("+",line) = 1
+ or equal("\n",line)
+ or equal({},line) then
+ comments = append(comments,line)
+ end if
+ end for
+ write_lines(inifile,comments) -- removing everything but the comments;
+end if -- file exists
+
+object setting, tmp = 0, pos = {0,0}
+object t1, name, prop
+atom handle
+integer class
+
+atom fn = open(inifile,"a")
+
+for x = 1 to length(ctl_list) do
+
+ if string(ctl_list[x]) then
+ handle = pointer(ctl_list[x])
+ else
+ handle = ctl_list[x]
+ end if
+
+ name = get(handle,"name")
+ class = class_id(handle)
+
+ if class=GtkWindow then -- special handling for multiple properties;
+ printf(fn,"%s\n",{get_setting(handle,"size")})
+ pos = get(handle,"position")
+ printf(fn,"%s.position={%d,%d}\n",{name,pos[1],pos[2]})
+
+ else
+ setting = get_setting(handle) -- others have 1 obvious 'saveable' property
+ if length(setting) < 1 then
+ continue
+ end if
+
+ if sequence(setting) then
+ printf(fn,"%s\n",{setting})
+ end if
+ end if
+end for
+
+flush(fn)
+close(fn)
+
+-- if ! exists for this control:property, then ignore the updated setting;
+tmp = read_lines(inifile)
+for i = 1 to length(tmp) do
+ if match("--!",tmp[i]) = 1 then
+ t1 = split(tmp[i],"=")
+ t1 = t1[1][2..$]
+ end if
+end for
+
+write_lines(inifile,tmp)
+
+return 1
+end function
+
+------------------------------------------------------------------------
+export function Load(sequence inifile, integer debug=0)
+------------------------------------------------------------------------
+-- used to restore settings from the specified ini file.
+-- this should be called after the controls are 'realized'
+
+object txt, line, obj, prop, val1=0, val2=0, val3=0, val4=0
+
+if not(file_exists(inifile)) then
+ write_file(inifile,sprintf("--%s\n\n",{inifile}),TEXT_MODE)
+ display("Creating ini file: []",{inifile})
+else
+ if debug then display("Reading []",{inifile}) end if
+end if
+
+txt = read_lines(inifile)
+
+integer err=0
+object a,b
+
+for i = 1 to length(txt) do
+
+ line = txt[i]
+
+ if match("--",line) > 2 then -- strip trailing comments;
+ line = line[1..match("--",line)-2]
+ end if
+
+ if match("--!",line) = 1 then
+ line = line[4..$] -- keep it
+ end if
+
+ if match("+",line) = 1 or match("!",line) then
+ line = line[2..$] -- dito
+ end if
+
+ if match("--",line) or match(";",line)
+ or match("/*",line) then
+ continue -- a comment, do nothing with it
+ end if
+
+ if length(line) > 0 then
+ line = split(line,'=')
+ a = line[1] b = line[2]
+ a = split(a,'.')
+ line = a & {b}
+
+ if debug > 1 then display(line) end if
+
+ if vlookup(line[1],registry,4,1,-1) = -1 then
+ err = i
+ Error(,"Ini Load Error",
+ sprintf("Invalid object name: %s",{line[1]}),
+ sprintf("Line #%d of %s",{i,filename(inifile)}))
+ else
+ if equal("data",line[2]) then
+ set(line[1],"data",line[3],line[4])
+ else
+ set(line[1],line[2],line[3])
+ end if
+ end if
+ end if
+end for
+
+if debug = 1 then
+ for i = 1 to length(txt) do
+ if i = err then
+ display("ERROR:[:3]:[]",{i,txt[i]})
+ else
+ display("[:3]:[]",{i,txt[i]})
+ end if
+ end for
+end if
+
+write_lines(inifile,txt)
+
+return 1
+end function
+
+-------------------------------------------------------------------------------------------
+export function Add(object ini,object ctl, sequence prop, object v1=0, object v2=0)
+-------------------------------------------------------------------------------------------
+if atom(ctl) then ctl = get(ctl,"name") end if
+
+Delete(ini,ctl,prop)
+
+if equal("position",prop) or equal("size",prop) then
+if string(v1) then v2 = v1[2] v1 = v1[1] end if
+end if
+
+if atom(v2) and v2=0 then
+ writefln("+[].[]=[]",{ctl,prop,v1},{ini,"a"})
+else
+ writefln("+[].[]={[],[]}",{ctl,prop,v1,v2},{ini,"a"})
+end if
+
+return 1
+end function
+
+--------------------------------------------------------------------
+export function Delete(object ini,object ctl, sequence prop)
+--------------------------------------------------------------------
+if atom(ctl) then ctl = get(ctl,"name") end if
+object tmp = read_lines(ini)
+object out = {}
+object s1 = text:format("[].[]",{ctl,prop})
+for i = 1 to length(tmp) do
+ if match(s1,tmp[i]) then -- skip
+ else out &= {tmp[i]}
+ end if
+end for
+write_lines(ini,out)
+return 1
+end function
+
+---------------------------------------------------------------------------------
+function get_setting(object self, object property = 0)
+-- returns the 'important' value from a control
+---------------------------------------------------------------------------------
+-- returns settings string
+-- object must be a named object, e.g. MyButton
+
+-- MyButton.active=1
+-- My Calendar.date={YYYY,MM,DD}
+
+object name = 0
+object dt
+
+if string(self) then
+ name = self
+ self = vlookup(self,registry,4,1)
+end if
+
+object val = 0
+object txt = {}
+
+integer x = find(self,vslice(registry,1))
+
+ ifdef SETTINGS then
+ display("SELF [] []",{x,self})
+ display(registry[x])
+ end ifdef
+
+ switch class_id(self) do
+ -- this decides which value is the important one to save;
+ -- and stores the control's current value into the registry;
+
+ case GtkEntry,GtkEntryBuffer then property = "text"
+
+ case GtkCheckButton,GtkRadioButton, GtkToggleButton,
+ GtkSwitch,GtkComboBox,GtkComboBoxText,
+ GtkCheckMenuItem,GtkToggleToolButton, GtkSearchEntry
+ then property = "active"
+
+ case GtkPopover then property = "position"
+
+ case GtkFontButton then property = "font name"
+
+ case GtkAdjustment,GtkSpinButton,GtkScaleButton,GtkVolumeButton,
+ GtkModelButton,GtkScale
+ then property = "value"
+
+ case GtkEntryCompletion then property = "model"
+
+ case GtkLinkButton then property = "uri"
+
+ case GtkMenuItem then property = "sensitive"
+
+ case GtkPaned then property = "position"
+
+ case GtkFileChooser, GtkFileChooserButton, GtkFileChooserWidget, GtkFileChooserDialog
+ then property = "filename"
+
+ case GtkFontChooser, GtkFontChooserWidget, GtkFontChooserDialog then
+ property = "font"
+
+ case GtkCalendar then
+ dt = get(self,"datetime",0)
+ registry[x][5] = {"date",dt[1..3]}
+ txt &= text:format(fmt,{registry[x][4],"date",dt[1..3]})
+ return txt
+
+ case GtkColorButton,GtkColorChooser,GtkColorChooserWidget,
+ GtkColorChooserDialog then
+ registry[x][5] = {"rgba",get(self,"rgba",1)}
+ txt &= text:format(fmt,{registry[x][4],"rgba",get(self,"rgba",1)})
+ return txt
+
+ end switch
+
+ if atom(property) then
+ return txt
+ end if
+
+ val = get(self,property)
+ registry[x][5] = {property,val}
+ txt &= text:format(fmt,{registry[x][4],property,val})
+
+return txt
+end function
diff --git a/eugtk/examples/GtkSourceView.plugin b/eugtk/examples/GtkSourceView.plugin
new file mode 100644
index 0000000..9e7bb40
--- /dev/null
+++ b/eugtk/examples/GtkSourceView.plugin
@@ -0,0 +1,741 @@
+
+---------------
+namespace sv -- "Plug-in" for GtkSourceView
+---------------
+
+-------------------------------------------------------------------------
+-- A plug-in appends new widgets to the widget array, adding functions
+-- and an additional library file without changing GtkEngine.e source.
+-- This needed to be implemented as a plug-in because the SourceView
+-- library is shipped separately from libgtk3.
+
+-- Many more functions remain to be added, including style selections,
+-- printing options, etc. --
+-------------------------------------------------------------------------
+include GtkEngine.e
+
+export constant version = "4.12.0"
+
+if not equal(version,gtk:version) then
+ Error(,,"GtkSourceView.plugin version mismatch","should be version " & gtk:version)
+end if
+
+ifdef WINDOWS then
+export constant svdll = "libgtksourceview-3.0-1.dll"
+elsedef
+export constant svdll = "libgtksourceview-3.0.so.1"
+end ifdef
+
+export atom LIBSV = open_dll(svdll)
+if LIBSV = 0 then
+ Error(,,"No libgtksourceview found!",
+ "If you're sure you have one, set the library\nname at the top of GtkSourceView.plugin",
+ GTK_BUTTONS_OK)
+ crash("No libgtksourceview found!")
+end if
+
+ifdef SV then display("SOURCEVIEW:[]",{svdll}) end ifdef
+
+LIBS = append(LIBS,LIBSV)
+
+widget = append(widget, {"gtk_source_mark",
+{GtkTextMark,GObject},
+ {"new",{S,S},P},
+ {"get_category",{P},S},
+ {"next",{P,S},P,0,length(widget)},
+ {"prev",{P,S},P,0,length(widget)},
+"GtkSourceMark"})
+export constant GtkSourceMark = length(widget)
+
+widget = append(widget, {"gtk_source_undo_manager",
+{},
+ {"can_undo",{P},B},
+ {"can_redo",{P},B},
+ {"undo",{P}},
+ {"redo",{P}},
+ {"begin_not_undoable_action",{P}},
+ {"end_not_undoable_action",{P}},
+ {"can_undo_changed",{P}},
+ {"can_redo_changed",{P}},
+"GtkSourceUndoManager"})
+export constant GtkSourceUndoManager = length(widget)
+
+widget = append(widget, {"gtk_source_tag_style",
+{GObject},
+ {"new",{},P},
+ {"copy",{P},P},
+ {"free",{P}},
+"GtkSourceTagStyle"})
+export constant GtkSourceTagStyle = length(widget)
+
+widget = append(widget, {"gtk_source_style_scheme",
+{GObject},
+ {"get_id",{P},S},
+ {"get_name",{P},S},
+ {"get_description",{P},S},
+ {"get_authors",{P},A},
+ {"get_filename",{P},S},
+ {"get_style",{P,S},P},
+"GtkSourceStyleScheme"})
+export constant GtkSourceStyleScheme = length(widget)
+
+widget = append(widget, {"gtk_source_language",
+{GObject},
+ {"get_id",{P},S},
+ {"get_name",{P},S},
+ {"get_section",{P},S},
+ {"get_hidden",{P},B},
+ {"get_tags",{P},P},
+ {"get_tag_style",{P,S},P,0,GtkSourceTagStyle},
+ {"set_tag_style",{P,S,P}},
+ {"get_tag_default_style",{P,S},P,0,GtkSourceTagStyle},
+ {"get_escape_char",{P},S},
+ {"get_metadata",{P,S},S},
+ {"get_mime_types",{P},-routine_id("get_mime_types")},
+ {"set_mime_types",{P,A}},
+ {"get_globs",{P},P},
+ {"get_style_name",{P,S},S},
+ {"get_style_scheme",{P},P,0,GtkSourceStyleScheme},
+ {"set_style_scheme",{P,P}},
+ {"get_style_ids",{P},A},
+ {"get_style_name",{P,S},S},
+ {"get_style_fallback",{P,S},S},
+"GtkSourceLanguage"})
+export constant GtkSourceLanguage = length(widget)
+
+ function get_mime_types(atom sl)
+ object mimetypes = {}
+ atom x = gtk_func("gtk_source_language_get_mime_types",{P},{sl})
+ while peek4u(x) > 0 do
+ mimetypes &= peek_string(peek4u(x)) & " "
+ x += 4
+ end while
+ return mimetypes
+ end function
+
+export constant GtkSourceMarker = length(widget)+1
+widget = append(widget, {"gtk_source_marker",
+{GObject},
+ {"set_marker_type",{P,S}},
+ {"get_marker_type",{P},S},
+ {"get_line",{P},I},
+ {"get_name",{P},S},
+ {"get_buffer",{P},P},
+ {"next",{P},P,0,GtkSourceMarker},
+ {"prev",{P},P,0,GtkSourceMarker},
+"GtkSourceMarker"})
+
+widget = append(widget, {"gtk_source_buffer",
+{GObject,GtkTextBuffer,GObject},
+ {"new",{P},P},
+ {"new_with_language",{P},P},
+ {"get_check_brackets",{P},B},
+ {"set_check_brackets",{P,B}},
+ {"set_bracket_match_style",{P,P}},
+ {"get_highlight",{P},B},
+ {"set_highlight",{P,B}},
+ {"set_highlight_syntax",{P,B}},
+ {"get_highlight_syntax",{P},B},
+ {"set_language",{P,P}},
+ {"get_language",{P},P,0,GtkSourceLanguage},
+ {"get_escape_char",{P},S},
+ {"set_escape_char",{P,S}},
+ {"set_highlight_matching_brackets",{P,B}},
+ {"get_highlight_matching_brackets",{P},B},
+ {"set_style_scheme",{P,P}},
+ {"get_style_scheme",{P},P,0,GtkSourceStyleScheme},
+ {"ensure_highlight",{P,P,P}},
+ {"undo",{P}},
+ {"redo",{P}},
+ {"can_undo",{P},B},
+ {"can_redo",{P},B},
+ {"begin_not_undoable_action",{P}},
+ {"end_not_undoable_action",{P}},
+ {"get_max_undo_levels",{P},I},
+ {"set_max_undo_levels",{P,I}},
+ {"get_undo_manager",{P},P,0,GtkSourceUndoManager},
+ {"set_undo_manager",{P,P}},
+ {"iter_has_context_class",{P,P,S},B},
+ {"get_context_classes_at_iter",{P,P,P},P},
+ {"iter_forward_to_context_class_toggle",{P,P,S},B},
+ {"iter_backward_to_context_class_toggle",{P,P,S},B},
+ {"create_marker",{P,S,S,P},P,0,GtkSourceMarker},
+ {"create_source_mark",{P,S,S,P},P,0,GtkSourceMark},
+ {"move_marker",{P,P,P}},
+ {"delete_marker",{P,P}},
+ {"get_marker",{P,S},P,0,GtkSourceMarker},
+ {"get_markers_in_region",{P,P,P},A},
+ {"get_first_marker",{P},P,0,GtkSourceMarker},
+ {"get_last_marker",{P},P,0,GtkSourceMarker},
+ {"get_iter_at_marker",{P,P,P}},
+ {"get_next_marker",{P,P},P,0,GtkSourceMarker},
+ {"get_prev_marker",{P,P},P,0,GtkSourceMarker},
+ {"forward_iter_to_source_mark",{P,P,S},B},
+ {"backward_iter_to_source_mark",{P,P,S},B},
+ {"get_source_marks_at_line",{P,I,S},P,0,GSList},
+ {"get_source_marks_at_iter",{P,P,S},P,0,GSList},
+ {"remove_source_marks",{P,P,P,S}},
+ {"change_case",{P,I,P,P}},
+ {"join_lines",{P,P,P}},
+ {"sort_lines",{P,P,P,I,I}},
+ {"set_implicit_trailing_newline",{P,B}},
+ {"get_implicit_trailing_newline",{P},B},
+"GtkSourceBuffer"})
+export constant GtkSourceBuffer = length(widget)
+
+widget = append(widget, {"gtk_source_gutter_renderer",
+{GObject},
+ {"begin",{P,P,P,P,P,P}},
+ {"draw",{P,P,P,P,P,P,I}},
+ {"end",{P}},
+ {"get_size",{P},I},
+ {"set_size",{P,I}},
+ {"set_visible",{P,B}},
+ {"get_visible",{P},B},
+ {"get_padding",{P,I,I}},
+ {"set_padding",{P,I,I}},
+ {"get_alignment",{P,F,F}},
+ {"set_alignment",{P,F,F}},
+ {"set_alignment_mode",{P,I}},
+ {"get_window_type",{P},I},
+ {"get_view",{P},P,0,GtkTextView},
+ {"get_alignment_mode",{P},I},
+ {"get_background",{P,P},B},
+ {"set_background",{P,P}},
+ {"activate",{P,P,P,P}},
+ {"query_activatable",{P,P,P,P},B},
+ {"queue_draw",{P}},
+ {"query_tooltip",{P,P,P,I,I,P},B},
+ {"query_data",{P,I,I,I}},
+"GtkSourceGutterRenderer"})
+export constant GtkSourceGutterRenderer = length(widget)
+
+widget = append(widget, {"gtk_source_gutter",
+{GObject},
+ {"get_window",{},P,0,GtkWindow},
+ {"insert",{P,P,I},B}, -- 3.0
+ {"reorder",{P,P,I}},
+ {"remove",{P,P}},
+ {"queue_redraw",{P}},
+ {"get_padding",{P,I,I}},
+ {"set_padding",{P,I,I}},
+ {"get_renderer_at_pos",{P,I,I},P,0,GtkSourceGutterRenderer},
+"GtkSourceGutter"})
+export constant GtkSourceGutter = length(widget)
+
+widget = append(widget, {"gtk_source_view",
+{GtkTextView,GtkContainer,GtkWidget,GtkBuildable,GtkScrollable,GObject},
+ {"new",{},P},
+ {"get_buffer",{P},-routine_id("getSVBuffer"),0,GtkSourceBuffer},
+ {"set_show_line_numbers",{P,B}},
+ {"get_show_line_numbers",{P},B},
+ {"set_show_right_margin",{P,B}},
+ {"get_show_right_margin",{P},B},
+ {"set_right_margin_position",{P,I}},
+ {"get_right_margin_position",{P},I},
+ {"set_highlight_current_line",{P,B}},
+ {"get_highlight_current_line",{P},B},
+ {"set_auto_indent",{P,B}},
+ {"get_auto_indent",{P},B},
+ {"set_indent_on_tab",{P,B}},
+ {"get_indent_on_tab",{P},B},
+ {"set_tab_width",{P,I}},
+ {"get_tab_width",{P},I},
+ {"set_indent_width",{P,I}},
+ {"get_indent_width",{P},I},
+ {"set_insert_spaces_instead_of_tabs",{P,B}},
+ {"get_insert_spaces_instead_of_tabs",{P},B},
+ {"indent_lines",{P,P,P}},
+ {"unindent_lines",{P,P,P}},
+ {"get_visual_column",{P,P},I},
+ {"set_smart_home_end",{P,I}},
+ {"get_smart_home_end",{P},I},
+ {"set_mark_attributes",{P,S,P,I}},
+ {"get_mark_attributes",{P,S,I},P},
+ {"set_show_line_marks",{P,B}},
+ {"get_show_line_marks",{P},B},
+ {"set_draw_spaces",{P,I}},
+ {"get_draw_spaces",{P},I},
+ {"get_completion",{P},P},
+ {"get_gutter",{P,I},P,0,GtkSourceGutter},
+ {"set_background_pattern",{P,I}}, -- 3.16
+ {"get_background_pattern",{P},I}, -- 3.16
+ {"set_smart_backspace",{P,B}}, -- 3.18
+ {"get_smart_backspace",{P},B}, -- 3.18
+"GtkSourceView"})
+export constant GtkSourceView = length(widget)
+
+ function getSVBuffer(atom sv)
+ return gtk_func("gtk_text_view_get_buffer",{P},{sv})
+ end function
+
+widget = append(widget, {"gtk_source_map", -- 3.18
+{GtkSourceView,GtkTextView,GtkContainer,GtkWidget,GObject},
+ {"new",{},P},
+ {"set_view",{P,P}},
+ {"get_view",{P},P,0,GtkSourceView},
+"GtkSourceMap"})
+export constant GtkSourceMap = length(widget)
+
+widget = append(widget, {"gtk_source_language_manager",
+{GObject},
+ {"new",{},P},
+ {"get_default",{},P},
+ {"set_search_path",{P,P}},
+ {"get_search_path",{P},P},
+ {"get_language_ids",{P},V},
+ {"get_language",{P,P},P,0,GtkSourceLanguage},
+ {"guess_language",{P,P,P},P,0,GtkSourceLanguage},
+"GtkSourceLanguageManager"})
+export constant GtkSourceLanguageManager = length(widget)
+
+widget = append(widget, {"gtk_source_languages_manager",
+{GObject},
+ {"new",{},P},
+ {"get_available_languages",{P},A},
+ {"get_language_from_mime_type",{P,S},P,0,GtkSourceLanguage},
+ {"get_lang_files_dirs",{P},A},
+"GtkSourceLanguagesManager"})
+export constant GtkSourceLanguagesManager = length(widget)
+
+widget = append(widget, {"gtk_source_print_job", -- doesn't currently work!
+{GObject},
+ {"new",{P},P},
+ {"set_buffer",{P,P}},
+ {"get_buffer",{P},P,0,GtkSourceBuffer},
+ {"set_config",{P,P}},
+ {"get_config",{P},P},
+ {"setup_from_view",{P,P}},
+ {"set_tabs_width",{P,I}},
+ {"get_tabs_width",{P},I},
+ {"set_wrap_mode",{P,I}},
+ {"get_wrap_mode",{P},I},
+ {"set_highlight",{P,B}},
+ {"get_highlight",{P},B},
+ {"set_font_desc",{P,P}},
+ {"set_font",{P,S}},
+ {"get_font_desc",{P},P,0,PangoFontDescription},
+ {"get_font",{P},S},
+ {"set_numbers_font_desc",{P,P}},
+ {"set_numbers_font",{P,S}},
+ {"get_numbers_font_desc",{P},P,0,PangoFontDescription},
+ {"get_numbers_font",{P},S},
+ {"set_print_numbers",{P,I}},
+ {"get_print_numbers",{P},I},
+ {"set_text_margins",{P,D,D,D,D}},
+ {"get_text_margins",{P,D,D,D,D}},
+ {"print",{P},P},
+ {"print_range",{P,P,P},P},
+ {"print_range_async",{P,P,P},B},
+ {"cancel",{P}},
+ {"get_print_job",{P},P},
+ {"get_page",{P},I},
+ {"get_page_count",{P},I},
+ {"get_print_context",{P},P},
+ {"set_print_header",{P,B}},
+ {"get_print_header",{P},B},
+ {"set_print_footer",{P,B}},
+ {"get_print_footer",{P},B},
+ {"set_header_footer_font_desc",{P,P}},
+ {"set_header_footer_font",{P,S}},
+ {"get_header_footer_font_desc",{P},P,0,PangoFontDescription},
+ {"get_header_footer_font",{P},S},
+ {"set_header_format",{P,S,S,S,B}},
+ {"set_footer_format",{P,S,S,S,B}},
+"GtkSourcePrintJob"})
+export constant GtkSourcePrintJob = length(widget)
+
+widget = append(widget, {"gtk_source_style",
+{GObject},
+ {"new",{},P},
+ {"copy",{P},P},
+"GtkSourceStyle"})
+export constant GtkSourceStyle = length(widget)
+
+widget = append(widget, {"gtk_source_tag_table",
+{GObject},
+ {"new",{},P},
+ {"add_tags",{P,P}},
+ {"remove_source_tags",{P}},
+"GtkSourceTagTable"})
+export constant GtkSourceTagTable = length(widget)
+
+widget = append(widget,{"gtk_source_completion_item",
+{GObject},
+ {"new",{S,S,P,S},P},
+ {"new_with_markup",{S,S,P,S},P},
+"GtkSourceCompletionItem"})
+export constant GtkSourceCompletionItem = length(widget)
+
+widget = append(widget, {"gtk_source_completion_context",
+{GObject},
+ {"add_proposals",{P,P,P,B}},
+ {"get_iter",{P,P},B},
+ {"get_activation",{P},I},
+"GtkSourceCompletionContext"})
+export constant GtkSourceCompletionContext = length(widget)
+
+widget = append(widget, {"gtk_source_completion_info",
+{GtkWindow,GtkBin,GtkContainer,GtkWidget,GObject},
+ {"new",{},P},
+ {"move_to_iter",{P,P,P}},
+ {"set_widget",{P,P}},
+ {"get_widget",{P},P,0,GtkWidget},
+"GtkSourceCompletionInfo"})
+export constant GtkSourceCompletionInfo = length(widget)
+
+widget = append(widget, {"gtk_source_completion_proposal",
+{},
+ {"get_label",{P},S},
+ {"get_markup",{P},S},
+ {"get_text",{P},S},
+ {"get_icon",{P},P,0,GdkPixbuf},
+ {"get_icon_name",{P},S},
+ {"get_gicon",{P},P,0,GIcon},
+ {"get_info",{P},S},
+ {"changed",{P}},
+ {"hash",{P},I},
+ {"equal",{P,P},B},
+"GtkSourceCompletionProposal"})
+export constant GtkSourceCompletionProposal = length(widget)
+
+widget = append(widget, {"gtk_source_completion_provider",
+{},
+ {"get_name",{P},S},
+ {"get_icon",{P},P,0,GdkPixbuf},
+ {"get_icon_name",{P},S},
+ {"get_gicon",{P},P,0,GIcon},
+ {"populate",{P,P}},
+ {"get_activation",{P},I},
+ {"match",{P,P},B},
+ {"get_info_widget",{P,P},P,0,GtkWidget},
+ {"update_info",{P,P,P}},
+ {"get_start_iter",{P,P,P,P},B},
+ {"activate_proposal",{P,P,P},B},
+ {"get_interactive_delay",{P},I},
+ {"get_priority",{P},I},
+"GtkSourceCompletionProvider"})
+export constant GtkSourceCompletionProvider = length(widget)
+
+widget = append(widget, {"gtk_source_completion_words",
+{GObject},
+ {"new",{S,P},P},
+ {"register",{P,P}},
+ {"unregister",{P,P}},
+"GtkSourceCompletionWords"})
+export constant GtkSourceCompletionWords = length(widget)
+
+widget = append(widget, {"gtk_source_completion",
+{GObject},
+ {"add_provider",{P,P,X},B},
+ {"remove_provider",{P,P,X},B},
+ {"get_providers",{P},P,0,GList},
+ {"show",{P,P,P},B},
+ {"hide",{P}},
+ {"get_info_window",{P},P,0,GtkSourceCompletionInfo},
+ {"get_view",{P},P,0,GtkSourceView},
+ {"create_context",{P,P},P,0,GtkSourceCompletionContext},
+ {"move_window",{P,P}},
+ {"block_interactive",{P}},
+ {"unblock_interactive",{P}},
+"GtkSourceCompletion"})
+export constant GtkSourceCompletion = length(widget)
+
+export constant GtkSourceEncoding = length(widget)+1
+widget = append(widget, {"gtk_source_encoding",
+{},
+ {"get_utf8",{},P},
+ {"get_current",{},P,0,GtkSourceEncoding},
+ {"get_from_charset",{S},P,0,GtkSourceEncoding},
+ {"to_string",{P},S},
+ {"get_name",{P},S},
+ {"get_charset",{P,S}},
+ {"get_all",{},P,0,GSList},
+ {"get_default_candidates",{},P,0,GSList},
+ {"copy",{P},P,0,GtkSourceEncoding},
+ {"free",{P}},
+"GtkSourceEncoding"})
+
+widget = append(widget, {"gtk_source_file",
+{GObject},
+ {"new",{},P},
+ {"get_location",{P},P,0,GFile},
+ {"set_location",{P,P}},
+ {"get_encoding",{P},P,0,GtkSourceEncoding},
+ {"get_newline_type",{P},I},
+ {"get_compression_type",{P},I},
+ {"check_file_on_disk",{P}},
+ {"is_local",{P},B},
+ {"is_externally_modified",{P},B},
+ {"is_deleted",{P},B},
+ {"is_readonly",{P},B},
+ {"set_mount_operation_factory",{P,P,P,P}},
+"GtkSourceFile"})
+export constant GtkSourceFile = length(widget)
+
+widget = append(widget, {"gtk_source_file_loader",
+{GObject},
+ {"new",{P,P},P},
+ {"set_candidate_encodings",{P,P}},
+ {"get_buffer",{P},P,0,GtkSourceBuffer},
+ {"get_file",{P},P,0,GtkSourceFile},
+ {"get_location",{P},P,0,GFile},
+ {"get_input_stream",{P},P,0,GInputStream},
+ {"load_async",{P,I,P,P,P,P,P,P}},
+ {"load_finish",{P,P,X},B},
+ {"get_encoding",{P},P,0,GtkSourceEncoding},
+ {"get_newline_type",{P},I},
+ {"get_compression_type",{P},I},
+"GtkSourceFileLoader"})
+export constant GtkSourceFileLoader = length(widget)
+
+widget = append(widget, {"gtk_source_file_saver",
+{GObject},
+ {"new",{P,P},P},
+ {"get_buffer",{P},P,0,GtkSourceBuffer},
+ {"get_file",{P},P,0,GtkSourceFile},
+ {"get_location",{P},P,0,GFile},
+ {"set_encoding",{P,P}},
+ {"get_encoding",{P},P,0,GtkSourceEncoding},
+ {"set_newline_type",{P,I}},
+ {"get_newline_type",{P},I},
+ {"set_compression_type",{P,I}},
+ {"get_compression_type",{P},I},
+ {"set_flags",{P,I}},
+ {"get_flags",{P},I},
+ {"save_async",{P,I,P,P,P,P,P,P}},
+ {"save_finish",{P,P,X},B},
+"GtkSourceFileSaver"})
+export constant GtkSourceFileSaver = length(widget)
+
+widget = append(widget, {"gtk_source_gutter_renderer_pixbuf",
+{GtkSourceGutterRenderer,GObject},
+ {"new",{},P},
+ {"set_pixbuf",{P,P}},
+ {"get_pixbuf",{P},P,0,GdkPixbuf},
+ {"set_stock_id",{P,S}},
+ {"get_stock_id",{P},S},
+ {"set_gicon",{P,P}},
+ {"get_gicon",{P},P,0,GIcon},
+ {"set_icon_name",{P,S}},
+ {"get_icon_name",{P},S},
+"GtkSourceGutterRendererPixbuf"})
+export constant GtkSourceGutterRendererPixbuf = length(widget)
+
+widget = append(widget, {"gtk_source_gutter_renderer_text",
+{GtkSourceGutterRenderer,GObject},
+ {"new",{},P},
+ {"set_markup",{P,S,I}},
+ {"set_text",{P,S,I}},
+ {"measure",{P,S,I,I}},
+ {"measure_markup",{P,S,I,I}},
+"GtkSourceGutterRendererText"})
+export constant GtkSourceGutterRendererText = length(widget)
+
+widget = append(widget, {"gtk_source_mark_attributes",
+{GObject},
+ {"new",{},P},
+ {"set_background",{P,P}},
+ {"get_background",{P,P},B},
+ {"set_stock_id",{P,S}},
+ {"get_stock_id",{P},S},
+ {"set_icon_name",{P,S}},
+ {"get_icon_name",{P},S},
+ {"set_gicon",{P,P}},
+ {"get_gicon",{P},0,P,GIcon},
+ {"set_pixbuf",{P,P}},
+ {"get_pixbuf",{P},P,0,GdkPixbuf},
+ {"render_icon",{P,P,I},P,0,GdkPixbuf},
+ {"get_tooltip_text",{P,P},S},
+ {"get_tooltip_markup",{P,P},S},
+"GtkSourceMarkAttriebutes"})
+export constant GtkSourceMarkAttributes = length(widget)
+
+widget = append(widget, {"gtk_source_print_compositor",
+{GObject},
+ {"new",{},P},
+ {"new_from_view",{P},P},
+ {"get_buffer",{P},P,0,GtkSourceBuffer},
+ {"set_tab_width",{P,I}},
+ {"get_tab_width",{P},I},
+ {"set_wrap_mode",{P,I}},
+ {"get_wrap_mode",{P},I},
+ {"set_highlight_syntax",{P,B}},
+ {"get_highlight_syntax",{P},B},
+ {"set_print_line_numbers",{P,B}},
+ {"get_print_line_numbers",{P},B},
+ {"set_body_font_name",{P,S}},
+ {"get_body_font_name",{P},S},
+ {"set_line_numbers_font_name",{P,S}},
+ {"get_line_numbers_font_name",{P},S},
+ {"set_header_font_name",{P,S}},
+ {"get_header_font_name",{P},S},
+ {"set_footer_font_name",{P,S}},
+ {"get_footer_font_name",{P},S},
+ {"get_top_margin",{P,I},D},
+ {"set_top_margin",{P,D,I}},
+ {"get_bottom_margin",{P,I},D},
+ {"set_bottom_margin",{P,D,I}},
+ {"get_left_margin",{P,I},D},
+ {"set_left_margin",{P,D,I}},
+ {"get_right_margin",{P,I},D},
+ {"set_right_margin",{P,D,I}},
+ {"set_print_header",{P,B}},
+ {"get_print_header",{P},B},
+ {"set_print_footer",{P,B}},
+ {"get_print_footer",{P},B},
+ {"set_header_format",{P,B,S,S,S}},
+ {"set_footer_format",{P,B,S,S,S}},
+ {"get_n_pages",{P},I},
+ {"paginate",{P,P},B},
+ {"get_pagination_progress",{P},D},
+ {"draw_page",{P,P,I}},
+"GtkSourcePrintCompositor"})
+export constant GtkSourcePrintCompositor = length(widget)
+
+widget = append(widget, {"gtk_source_search_settings",
+{GObject},
+ {"new",{},P},
+ {"get_search_text",{P},S},
+ {"set_search_text",{P,S}},
+ {"get_case_sensitive",{P},B},
+ {"set_case_sensitive",{P,B}},
+ {"get_at_word_boundaries",{P},B},
+ {"set_at_word_boundaries",{P,B}},
+ {"get_wrap_around",{P},B},
+ {"set_wrap_around",{P,B}},
+ {"get_regex_enabled",{P},B},
+ {"set_regex_enabled",{P,B}},
+"GtkSourceSearchSettings"})
+export constant GtkSourceSearchSettings = length(widget)
+
+widget = append(widget, {"gtk_source_search_context",
+{GObject},
+ {"new",{P,P},P},
+ {"get_buffer",{P},P,0,GtkSourceBuffer},
+ {"get_settings",{P},P,0,GtkSourceSearchSettings},
+ {"set_settings",{P,P}},
+ {"get_highlight",{P},B},
+ {"set_highlight",{P,B}},
+ {"get_match_style",{P},P,0,GtkSourceStyle},
+ {"set_match_style",{P,P}},
+ {"get_occurrences_count",{P},I},
+ {"forward",{P,P,P,P},B},
+ {"forward_async",{P,P,P,P,P}},
+ {"forward_finish",{P,P,P,P,X},B},
+ {"backward",{P,P,P,P},B},
+ {"backward_async",{P,P,P,P,P}},
+ {"backward_finish",{P,P,P,P,X},B},
+ {"replace",{P,P,P,P,I,X},B},
+ {"replace_all",{P,P,I,X},I},
+ {"get_regex_error",{P},P},
+"GtkSourceSearchContext"})
+export constant GtkSourceSearchContext = length(widget)
+
+export constant fnGetSCPos = define_c_func(LIBSV,
+ "gtk_source_search_context_get_occurrence_position",{P,P,P},I)
+
+export function unescape_search_text(object txt)
+return gtk_str_func("gtk_source_utils_unescape_search_text",{P},
+{allocate_string(txt,1)})
+end function
+
+export function escape_search_text(object txt)
+return gtk_str_func("gtk_source_utils_escape_search_text",{P},
+{allocate_string(txt,1)})
+end function
+
+widget = append(widget, {"gtk_source_style_scheme_chooser_button",
+{GtkButton,GtkBin,GtkContainer,GtkWidget,GObject},
+ {"new",{},P,0,GtkWidget},
+"GtkSourceStyleSchemeChooserButton"})
+export constant GtkSourceStyleSchemeChooserButton = length(widget)
+
+widget = append(widget, {"gtk_source_style_scheme_chooser_widget",
+{GtkBin,GtkContainer,GtkWidget,GObject},
+ {"new",{},P,0,GtkWidget},
+"GtkStyleSchemeChooserWidget"})
+export constant GtkSourceStyleSchemeChooserWidget = length(widget)
+
+widget = append(widget, {"gtk_style_scheme_chooser",
+{GtkWidget},
+ {"get_style_scheme",{P},P,0,GtkSourceStyleScheme},
+ {"set_style_scheme",{P,P}},
+"GtkStyleSchemeChooser"})
+export constant GtkStyleSchemeChooser = length(widget)
+
+widget = append(widget, {"gtk_style_scheme",
+{GObject},
+ {"get_id",{P},S},
+ {"get_name",{P},S},
+ {"get_description",{P},S},
+ {"get_authors",{P},A},
+ {"get_filename",{P},S},
+ {"get_style",{P,S},P,0,GtkSourceStyle},
+"GtkStyleScheme"})
+export constant tkStyleScheme = length(widget)
+
+widget = append(widget, {"gtk_source_style_scheme_manager",
+{GObject},
+ {"new",{},P},
+ {"get_default",{},P},
+ {"set_search_path",{P,P}},
+ {"append_search_path",{P,S}},
+ {"prepend_search_path",{P,S}},
+ {"get_search_path",{P},A},
+ {"get_scheme_ids",{P},V},
+ {"get_scheme",{P,P},P,0,GtkSourceStyleScheme},
+ {"force_rescan",{P}},
+"GtkSourceStyleSchemeManager"})
+export constant GtkSourceStyleSchemeManager = length(widget)
+
+---------------------------------------------------------------------
+
+export enum
+ GTK_SOURCE_DRAW_SPACES_SPACE = 1,
+ GTK_SOURCE_DRAW_SPACES_TAB=2,
+ GTK_SOURCE_DRAW_SPACES_NEWLINE=4,
+ GTK_SOURCE_DRAW_SPACES_NBSP = 8,
+ GTK_SOURCE_DRAW_SPACES_LEADING = 16,
+ GTK_SOURCE_DRAW_SPACES_TEXT = 32,
+ GTK_SOURCE_DRAW_SPACES_TRAILING = 64,
+ GTK_SOURCE_DRAW_SPACES_ALL=127,
+ SPACES = 1, -- shorthand for above;
+ TABS = 2,
+ NEWLINES = 4,
+ NBSP = 8,
+ LEADING = 16,
+ TEXT = 32,
+ TRAILING = 64,
+
+ GTK_SOURCE_SMART_HOME_END_DISABLED = 0,
+ GTK_SOURCE_SMART_HOME_END_BEFORE,
+ GTK_SOURCE_SMART_HOME_END_AFTER,
+ GTK_SOURCE_SMART_HOME_END_ALWAYS,
+ DISABLED = 0,
+ BEFORE,
+ AFTER,
+ ALWAYS,
+
+ GTK_SOURCE_VIEW_GUTTER_POSITION_LINES = 0,
+ GTK_SOURCE_VIEW_GUTTER_POSITION_MARKS,
+ LINES = 0,
+ MARKS,
+
+ GTK_SOURCE_BACKGROUND_PATTERN_TYPE_NONE=0,
+ GTK_SOURCE_BACKGROUND_PATTERN_TYPE_GRID,
+ NONE = 0,
+ GRID,
+
+ GTK_SOURCE_CHANGE_CASE_LOWER = 0,
+ GTK_SOURCE_CHANGE_CASE_UPPER,
+ GTK_SOURCE_CHANGE_CASE_TOGGLE,
+ GTK_SOURCE_CHANGE_CASE_TITLE,
+
+ GTK_SOURCE_SORT_FLAGS_NONE = 0,
+ GTK_SOURCE_SORT_FLAGS_CASE_SENSITIVE,
+ GTK_SOURCE_SORT_FLAGS_REVERSE_ORDER,
+ GTK_SOURCE_SORT_FLAGS_REMOVE_DUPLICATES
+
+
+
diff --git a/eugtk/examples/GtkWebKit.plugin b/eugtk/examples/GtkWebKit.plugin
new file mode 100644
index 0000000..7bdbbc7
--- /dev/null
+++ b/eugtk/examples/GtkWebKit.plugin
@@ -0,0 +1,498 @@
+
+---------------
+namespace wk -- "Plug-in" for WebkitGTK
+---------------
+
+include GtkEngine.e
+
+-----------------------------------------------------------------------
+-- A plug-in appends new widgets to the widget array, adding functions
+-- from an additional library file without changing GtkEngine.e source.
+-- This needed to be implemented as a plug-in because the webkit
+-- library is separate from libgtk3.
+
+-- Many more functions remain to be added, including style selections,
+-- printing options, etc.
+-----------------------------------------------------------------------
+
+include GtkEngine.e
+
+export constant version = "4.12.0"
+
+if not equal(version,gtk:version) then
+ Error(,,"GtkWebKit version mismatch","should be version " & gtk:version)
+end if
+
+ifdef WINDOWS then
+export object wkdll = "libwebkit-3.0.dll"
+elsedef
+export object wkdll = walk_dir("/usr/lib/",routine_id("find_lib"),1)
+end ifdef
+
+function find_lib(object path, object item) -- get the latest!
+if match("libwebkit2gtk-3",item[D_NAME])
+or match("libwebkit2gtk-4",item[D_NAME]) then
+ return path & '/' & item[D_NAME]
+end if
+return 0
+end function
+
+atom LIBWK = open_dll(wkdll)
+ if LIBWK = 0 then
+ Error(,,"No libwebkit2gtk-3 found!",
+ "If you're sure you have one, set the library\nname at the top of GtkWebKit.plugin",
+ GTK_BUTTONS_OK)
+ crash("ERROR:\n****** No libwebkit2gtk-3 found!")
+ end if
+
+ifdef WK then display("WEBKIT:[]",{wkdll}) end ifdef
+
+LIBS = append(LIBS,LIBWK)
+
+export constant webkit_version = text:format("[].[].[]",
+ {gtk_func("webkit_get_major_version"),
+ gtk_func("webkit_get_minor_version"),
+ gtk_func("webkit_get_micro_version")})
+
+widget = append(widget, {"webkit_uri_request",
+{GObject},
+ {"new",{S},P},
+ {"get_http_headers",{P},S},
+ {"get_type",{P},I},
+ {"get_uri",{P},S},
+ {"set_uri",{P,S}},
+"WebkitUriRequest"})
+export constant WebkitUriRequest = length(widget)
+
+widget = append(widget, {"webkit_back_forward_list_item",
+{GObject},
+ {"get_title",{P},S},
+ {"get_uri",{P},S},
+ {"get_original_uri",{P},S},
+"WebkitBackForwardListItem"})
+export constant WebkitBackForwardListItem = length(widget)
+
+widget = append(widget, {"webkit_back_forward_list",
+{GObject},
+ {"get_length",{P},I},
+ {"get_current_item",{P},P,0,WebkitBackForwardListItem},
+ {"get_back_item",{P},P,0,WebkitBackForwardListItem},
+ {"get_forward_item",{P},P,0,WebkitBackForwardListItem},
+ {"get_nth_item",{P,I},P,0,WebkitBackForwardListItem},
+ {"get_back_list",{P},A,0,GList},
+ {"get_back_list_with_limit",{P,I},P,0,GList},
+ {"get_forward_list",{P},A,0,GList},
+ {"get_forward_list_with_limit",{P,I},P,0,GList},
+"WebkitBackForwardList"})
+export constant WebkitBackForwardList = length(widget)
+
+widget = append(widget, {"webkit_uri_response",
+{GObject},
+ {"get_uri",{P},S},
+ {"get_status_code",{P},I},
+ {"get_content_length",{P},I},
+ {"get_mime_type",{P},S},
+ {"get_suggested_filename",{P},S},
+ {"get_http_headers",{P},P},-- soup message headers;
+"WebkitUriResponse"})
+export constant WebkitUriResponse = length(widget)
+
+widget = append(widget, {"webkit_web_page",
+{GObject},
+ {"get_dom_document",{P},P},
+ {"get_id",{P},I},
+ {"get_uri",{P},S},
+ {"get_main_frame",{P},P},
+ {"get_editor",{P},P},
+"WebkitWebPage"})
+export constant WebkitWebPage = length(widget)
+
+widget = append(widget, {"webkit_notification",
+{GObject},
+ {"get_id",{P},I},
+ {"get_title",{P},S},
+ {"get_body",{P},S},
+ {"close",{P}},
+"WebkitNotification"})
+export constant WebkitNotification = length(widget)
+
+widget = append(widget, {"webkit_hit_test_result",
+{GObject},
+ {"get_context",{P},I},
+ {"context_is_link",{P},B},
+ {"context_is_image",{P},B},
+ {"context_is_media",{P},B},
+ {"context_is_editable",{P},B},
+ {"context_is_selection",{P},B},
+ {"get_link_uri",{P},S},
+ {"get_link_title",{P},S},
+ {"get_link_label",{P},S},
+ {"get_image_uri",{P},S},
+ {"get_media_uri",{P},S},
+ {"context_is_scrollbar",{P},B},
+"WebkitHitTest"})
+export constant WebkitHitTest = length(widget)
+
+widget = append(widget, {"webkit_web_inspector",
+{GObject},
+ {"get_web_view",{P},P},
+ {"get_inspected_uri",{P},S},
+ {"get_can_attach",{P},B}, --?
+ {"is_attached",{P},B},
+ {"attach",{P}},
+ {"detach",{P}},
+ {"show",{P}},
+ {"close",{P}},
+ {"get_attached_height",{P},I},
+"WebkitWebInspector"})
+export constant WebkitWebInspector = length(widget)
+
+widget = append(widget, {"webkit_web_context",
+{GObject},
+ {"get_default",{},P},
+ {"clear_cache",{P}},
+ {"download_uri",{P,S},P},
+ {"get_cookie_manager",{P},P},
+ {"get_security_manager",{P},P},
+ {"get_spell_checking_enabled",{P},B},
+ {"set_spell_checking_enabled",{P,B}},
+ {"set_spell_checking_languages",{P,A}},
+ {"set_preferred_languages",{P,A}},
+ {"set_tls_errors_policy",{P,I}},
+ {"get_tls_errors_policy",{P},I},
+ {"allow_tls_certificate_for_host",{P,P,S}},
+ {"set_web_extensions_directory",{P,S}},
+ {"set_web_extensions_initialization_user_data",{P,P}},
+ {"prefetch_dns",{P,S}},
+ {"set_process_model",{P,P}},
+ {"get_process_model",{P},P},
+"WebkitWebContext"})
+export constant WebkitWebContext = length(widget)
+
+widget = append(widget, {"webkit_context_menu_item",
+{GObject},
+ {"new",{P},-routine_id("newContextMenuItem")},
+ {"get_action",{P},P},
+ {"is_separator",{P},B},
+ {"set_submenu",{P,P}},
+ {"get_submenu",{P},P},
+"WebkitContextMenuItem"})
+export constant WebkitContextMenuItem = length(widget)
+
+ function newContextMenuItem(atom act)
+ return gtk_func("webkit_context_menu_item_new_from_stock_action",{I},{act})
+ end function
+
+widget = append(widget, {"webkit_context_menu",
+{GObject},
+ {"new",{},P},
+ {"append",{P,P}},
+ {"prepend",{P,P}},
+ {"insert",{P,P,I}},
+ {"move_item",{P,P,I}},
+ {"get_items",{P},P,0,GList},
+ {"get_n_items",{P},I},
+ {"first",{P},P,0,WebkitContextMenuItem},
+ {"last",{P},P,0,WebkitContextMenuItem},
+ {"get_item_at_position",{P,I},P,0,WebkitContextMenuItem},
+ {"remove",{P,P}},
+ {"remove_all",{P}},
+ {"set_user_data",{P,P}},
+ {"get_user_data",{P},P},
+"WebkitContextMenu"})
+export constant WebkitContextMenu = length(widget)
+
+widget = append(widget, {"webkit_settings",
+{GObject},
+ {"new",{},P},
+ {"get_auto_load_images",{P},B},
+ {"set_auto_load_images",{P,B}},
+ {"get_enable_frame_flattening",{P},B},
+ {"set_enable_frame_flattening",{P,B}},
+ {"get_enable_html5_database",{P},B},
+ {"set_enable_html5_database",{P,B}},
+ {"get_enable_html5_local_storage",{P},B},
+ {"set_enable_html5_local_storage",{P,B}},
+ {"get_enable_hyperlink_auditing",{P},B},
+ {"set_enable_hyperlink_auditing",{P,B}},
+ {"get_enable_java",{P},B},
+ {"set_enable_java",{P,B}},
+ {"get_enable_javascript",{P},B},
+ {"set_enable_javascript",{P,B}},
+ {"get_enable_offline_web_application_cache",{P},B},
+ {"set_enable_offline_web_application_cache",{P,B}},
+ {"get_enable_plugins",{P},B},
+ {"set_enable_plugins",{P,B}},
+ {"get_enable_xss_auditor",{P},B},
+ {"set_enable_xss_auditor",{P,B}},
+ {"get_javascript_can_open_windows_automatically",{P},B},
+ {"set_javascript_can_open_windows_automatically",{P,B}},
+ {"get_load_icons_ignoring_image_load_setting",{P},B},
+ {"set_load_icons_ignoring_image_load_setting",{P,B}},
+ {"get_default_font_family",{P},S},
+ {"set_default_font_family",{P,S}},
+ {"get_monospace_font_family",{P},S},
+ {"set_monospace_font_family",{P,S}},
+ {"get_serif_font_family",{P},S},
+ {"set_serif_font_family",{P,S}},
+ {"get_sans_serif_font_family",{P},S},
+ {"set_sans_serif_font_family",{P,S}},
+ {"get_cursive_font_family",{P},S},
+ {"set_cursive_font_family",{P,S}},
+ {"get_fantasy_font_family",{P},S},
+ {"set_fantasy_font_family",{P,S}},
+ {"get_pictograph_font_family",{P},S},
+ {"set_pictograph_font_family",{P,S}},
+ {"get_default_font_size",{P},I},
+ {"set_default_font_size",{P,I}},
+ {"get_default_monospace_font_size",{P},I},
+ {"set_default_monospace_font_size",{P,I}},
+ {"get_minimum_font_size",{P},I},
+ {"set_minimum_font_size",{P,I}},
+ {"get_default_charset",{P},S},
+ {"set_default_charset",{P,S}},
+ {"get_enable_page_cache",{P},B},
+ {"set_enable_page_cache",{P,B}},
+ {"get_enable_site_specific_quirks",{P},B},
+ {"set_enable_site_specific_quirks",{P,B}},
+ {"get_draw_compositing_indicators",{P},B},
+ {"set_draw_compositing_indicators",{P,B}},
+ {"get_enable_private_browsing",{P},B},
+ {"set_enable_private_browsing",{P,B}},
+ {"get_enable_developer_extras",{P},B},
+ {"set_enable_developer_extras",{P,B}},
+ {"get_enable_resizable_text_areas",{P},B},
+ {"set_enable_resizable_text_areas",{P,B}},
+ {"get_enable_tabs_to_links",{P},B},
+ {"set_enable_tabs_to_links",{P,B}},
+ {"get_enable_dns_prefetching",{P},B},
+ {"set_enable_dns_prefetching",{P,B}},
+ {"get_enable_caret_browsing",{P},B},
+ {"set_enable_caret_browsing",{P,B}},
+ {"get_enable_fullscreen",{P},B},
+ {"set_enable_fullscreen",{P,B}},
+ {"get_print_backgrounds",{P},B},
+ {"set_print_backgrounds",{P,B}},
+ {"get_enable_webaudio",{P},B},
+ {"set_enable_webaudio",{P,B}},
+ {"get_enable_webgl",{P},B},
+ {"set_enable_webgl",{P,B}},
+ {"get_allow_modal_dialogs",{P},B},
+ {"set_allow_modal_dialogs",{P,B}},
+ {"get_zoom_text_only",{P},B},
+ {"set_zoom_text_only",{P,B}},
+ {"get_user_agent",{P},S},
+ {"set_user_agent",{P,S}},
+ {"get_javascript_can_access_clipboard",{P},B},
+ {"set_javascript_can_access_clipboard",{P,B}},
+ {"set_enable_write_console_messages_to_stdout",{P,B}},
+ {"get_enable_write_console_messages_to_stdout",{P},B},
+ {"set_enable_developer_extras",{P,B}},
+ {"get_enable_smooth_scrolling",{P},B},
+ {"set_enable_smooth_scrolling",{P,B}},
+ {"get_enable_accelerated_2d_canvas",{P},B},
+ {"set_enable_accelerated_2d_canvas",{P,B}},
+ {"get_enable_media_stream",{P},B},
+ {"set_enable_media_stream",{P,B}},
+ {"get_enable_spacial_navigation",{P},B},
+ {"set_enable_spacial_navigation",{P,B}},
+ {"get_enable_mediasource",{P},B},
+ {"set_enable_mediasource",{P,B}},
+ {"get_allow_file_access_from_file_urls",{P},B},
+ {"set_allow_file_access_from_file_urls",{P,B}},
+ {"get_media_playback_allows_inline",{P},B},
+ {"set_media_playback_allows_inline",{P,B}},
+ {"get_media_playback_requires_user_gesture",{P},B},
+ {"set_media_playback_requires_user_gesture",{P,B}},
+"WebkitSettings"})
+export constant WebkitSettings = length(widget)
+
+widget = append(widget, {"webkit_window_properties",
+{GObject},
+ {"get_geometry",{P,P}},
+ {"get_toolbar_visible",{P},B},
+ {"get_statusbar_visible",{P},B},
+ {"get_scrollbars_visible",{P},B},
+ {"get_menubar_visible",{P},B},
+ {"get_locationbar_visible",{P},B},
+ {"get_resizable",{P},B},
+ {"get_fullscreen",{P},B},
+"WebkitWindowProperties"})
+export constant WebkitWindowProperties = length(widget)
+
+widget = append(widget, {"webkit_uri_response",
+{GObject},
+ {"get_uri",{P},S},
+ {"get_status_code",{P},I},
+ {"get_content_length",{P},I},
+ {"get_mime_type",{P},S},
+ {"get_suggested_filename",{P},S},
+ {"get_http_headers",{P},P}, -- SoupMessageHeaders;
+"WebkitURIResponse"})
+export constant WebkitURIResponse = length(widget)
+
+widget = append(widget, {"webkit_web_resource",
+{GObject},
+ {"get_uri",{P},S},
+ {"get_response",{P},P,0,WebkitURIResponse},
+ {"get_data",{P,P,P,P}},
+ {"get_data_finish",{P,P,P,P},S},
+"WebkitWebResource"})
+export constant WebkitWebResource = length(widget)
+
+widget = append(widget, {"webkit_find_controller",
+{GObject},
+ {"search",{P,S,I,I}},
+ {"search_finish",{P}},
+ {"search_next",{P}},
+ {"search_previous",{P}},
+ {"get_search_text",{P},S},
+ {"count_matches",{P,S,I,I}},
+ {"get_options",{P},I},
+ {"get_match_count",{P},I},
+ {"get_web_view",{P},P},
+"WebkitFindController"})
+export constant WebkitFindController = length(widget)
+
+export constant
+ WEBKIT_FIND_OPTIONS_NONE = 1,
+ WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE = 2,
+ WEBKIT_FIND_OPTIONS_AT_WORD_STARTS = 4,
+ WEBKIT_FIND_OPTIONS_TREAT_MEDIAL_CAPITAL_AS_WORD_START = 8,
+ WEBKIT_FIND_OPTIONS_BACKWARDS = 16,
+ WEBKIT_FIND_OPTIONS_WRAP_AROUND = 32
+
+widget = append(widget, {"webkit_web_view",
+{GtkContainer,GtkWidget,GObject},
+ {"new",{},P},
+ {"load_uri",{P,S}},
+ {"load_html",{P,S,S}},
+ {"load_plain_text",{P,S}},
+ {"load_alternate_html",{P,S,S,S}},
+ {"load_request",{P,P}},
+ {"get_context",{P},P,0,WebkitWebContext},
+ {"can_go_back",{P},B},
+ {"go_back",{P}},
+ {"can_go_forward",{P},B},
+ {"go_forward",{P}},
+ {"get_title",{P},S},
+ {"get_page_id",{P},I},
+ {"reload",{P}},
+ {"reload_bypass_cache",{P}},
+ {"stop_loading",{P}},
+ {"is_loading",{P},B},
+ {"is_playing_audio",{P},B},
+ {"get_estimated_load_progress",{P},D},
+ {"get_custom_charset",{P},S},
+ {"set_custom_charset",{P,S}},
+ {"get_back_forward_list",{P},P,0,WebkitBackForwardList},
+ {"go_to_back_forward_list_item",{P,P}},
+ {"get_uri",{P},S},
+ {"get_favicon",{P},P},
+ {"set_settings",{P,P}},
+ {"get_settings",{P},P,0,WebkitSettings},
+ {"get_window_properties",{P},P,0,WebkitWindowProperties},
+ {"set_zoom_level",{P,D}},
+ {"get_zoom_level",{P},D},
+ {"get_inspector",{P},P,0,WebkitWebInspector},
+ {"can_show_mime_type",{P,S},B},
+ {"save",{P,I,P,P,P}},
+ {"save_to_file",{P,P,P,P,P,P}},
+ {"save_to_file_finish",{P,P,P},B},
+ {"download_uri",{P,S},P},
+ {"set_background_color",{P,P}}, -- ?
+ {"get_main_resource",{P},P,0,WebkitWebResource},
+ {"execute_editing_command",{P,S}},
+ {"get_find_controller",{P},P,0,WebkitFindController},
+"WebkitWebView"})
+export constant WebkitWebView = length(widget)
+
+widget = append(widget, {"webkit_download", --?
+{GObject},
+ {"new",{},P},
+ {"get_request",{P},P,0,WebkitUriRequest},
+ {"get_destination",{P},S},
+ {"set_destination",{P,S}},
+ {"get_response",{P},P,0,WebkitUriResponse},
+ {"cancel",{P}},
+ {"get_estimated_progress",{P},D},
+ {"get_elapsed_time",{P},D},
+ {"get_received_data_length",{P},I},
+ {"get_web_view",{P},P,0,WebkitWebView},
+ {"get_allow_overwrite",{P},B},
+ {"set_allow_overwrite",{P,B}},
+"WebkitDownload"})
+export constant WebkitDownload = length(widget)
+
+widget = append(widget, {"webkit_print_operation", -- doesn't currently work.
+{GObject},
+ {"new",{},P},
+"WebkitPrintOperation"})
+export constant WebkitPrintOperation = length(widget)
+
+widget = append(widget, {"webkit_user_content_manager",
+{GObject},
+ {"new",{},P},
+ {"add_style_sheet",{P,P}},
+ {"remove_all_stylesheets",{P}},
+ {"add_script",{P,P}},
+ {"remove_all_scripts",{P}},
+ {"register_script_message_handler",{P,S},B},
+ {"unregister_script_message_handler",{P,S}},
+"WebkitUserContentManager"})
+export constant WebkitUserContentManager = length(widget)
+
+export enum
+ WEBKIT_LOAD_STARTED = 0,
+ WEBKIT_LOAD_REDIRECTED,
+ WEBKIT_LOAD_COMMITTED,
+ WEBKIT_LOAD_FINISHED,
+
+WEBKIT_CONTEXT_MENU_ACTION_NO_ACTION = 0,
+WEBKIT_CONTEXT_MENU_ACTION_OPEN_LINK,
+WEBKIT_CONTEXT_MENU_ACTION_OPEN_LINK_IN_NEW_WINDOW,
+WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_LINK_TO_DISK,
+WEBKIT_CONTEXT_MENU_ACTION_COPY_LINK_TO_CLIPBOARD,
+WEBKIT_CONTEXT_MENU_ACTION_OPEN_IMAGE_IN_NEW_WINDOW,
+WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_IMAGE_TO_DISK,
+WEBKIT_CONTEXT_MENU_ACTION_COPY_IMAGE_TO_CLIPBOARD,
+WEBKIT_CONTEXT_MENU_ACTION_COPY_IMAGE_URL_TO_CLIPBOARD,
+WEBKIT_CONTEXT_MENU_ACTION_OPEN_FRAME_IN_NEW_WINDOW,
+WEBKIT_CONTEXT_MENU_ACTION_GO_BACK, --10
+WEBKIT_CONTEXT_MENU_ACTION_GO_FORWARD,
+WEBKIT_CONTEXT_MENU_ACTION_STOP,
+WEBKIT_CONTEXT_MENU_ACTION_RELOAD,
+WEBKIT_CONTEXT_MENU_ACTION_COPY,
+WEBKIT_CONTEXT_MENU_ACTION_CUT,
+WEBKIT_CONTEXT_MENU_ACTION_PASTE,
+WEBKIT_CONTEXT_MENU_ACTION_DELETE,
+WEBKIT_CONTEXT_MENU_ACTION_SELECT_ALL,
+WEBKIT_CONTEXT_MENU_ACTION_INPUT_METHODS,
+WEBKIT_CONTEXT_MENU_ACTION_UNICODE, --20
+WEBKIT_CONTEXT_MENU_ACTION_SPELLING_GUESS,
+WEBKIT_CONTEXT_MENU_ACTION_NO_GUESSES_FOUND,
+WEBKIT_CONTEXT_MENU_ACTION_IGNORE_SPELLING,
+WEBKIT_CONTEXT_MENU_ACTION_LEARN_SPELLING,
+WEBKIT_CONTEXT_MENU_ACTION_IGNORE_GRAMMAR,
+WEBKIT_CONTEXT_MENU_ACTION_FONT_MENU,
+WEBKIT_CONTEXT_MENU_ACTION_BOLD,
+WEBKIT_CONTEXT_MENU_ACTION_ITALIC,
+WEBKIT_CONTEXT_MENU_ACTION_UNDERLINE,
+WEBKIT_CONTEXT_MENU_ACTION_OUTLINE, --30
+WEBKIT_CONTEXT_MENU_ACTION_INSPECT_ELEMENT,
+WEBKIT_CONTEXT_MENU_ACTION_OPEN_VIDEO_IN_NEW_WINDOW,
+WEBKIT_CONTEXT_MENU_ACTION_OPEN_AUDIO_IN_NEW_WINDOW,
+WEBKIT_CONTEXT_MENU_ACTION_COPY_VIDEO_LINK_TO_CLIPBOARD,
+WEBKIT_CONTEXT_MENU_ACTION_COPY_AUDIO_LINK_TO_CLIPBOARD,
+WEBKIT_CONTEXT_MENU_ACTION_TOGGLE_MEDIA_CONTROLS,
+WEBKIT_CONTEXT_MENU_ACTION_TOGGLE_MEDIA_LOOP,
+WEBKIT_CONTEXT_MENU_ACTION_ENTER_VIDEO_FULLSCREEN,
+WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PLAY,
+WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PAUSE,
+WEBKIT_CONTEXT_MENU_ACTION_MEDIA_MUTE,
+WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_VIDEO_TO_DISK,
+WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_AUDIO_TO_DISK,
+WEBKIT_CONTEXT_MENU_ACTION_CUSTOM
+
+
+
diff --git a/eugtk/examples/browser.ex b/eugtk/examples/browser.ex
new file mode 100644
index 0000000..6ee8212
--- /dev/null
+++ b/eugtk/examples/browser.ex
@@ -0,0 +1,118 @@
+
+----------------------------------------------------------------------------------
+--# A simple file browser/runner;
+----------------------------------------------------------------------------------
+
+include GtkEngine.e
+include std/sort.e
+include std/datetime.e -- using this requires us to namespace gtk: functions
+
+chdir(login)
+
+constant win = create(GtkWindow,"size=750x550,border=10,sig.destroy=Quit")
+ gtk:set(win,"title","EuGTK Browser - " & login)
+
+constant panel = create(GtkBox,"orientation=VERTICAL")
+ gtk:add(win,panel)
+
+constant lbl = create(GtkLabel,
+ "markup='Use alt-f to search, <enter> or double-click to run! '")
+ gtk:add(panel,lbl)
+
+constant store = create(GtkListStore,{gSTR,gSTR,gINT,gSTR,gINT,gSTR})
+
+constant tv = create(GtkTreeView,{
+ {"model",store},
+ {"reorderable",TRUE},
+ {"headers clickable",TRUE},
+ {"set grid lines",GTK_TREE_VIEW_GRID_LINES_BOTH},
+ {"rules hint",TRUE}})
+
+constant cols = { -- below is a new way to define cols and renderers in 1 line;
+ create(GtkColumn,"title=Name,type=text,text=1,sort_column_id=2"), --[1]
+ create(GtkColumn,"title=Size,type=text,text=3,sort_column_id=3"),
+ create(GtkColumn,"title=Date,type=text,text=4,sort_column_id=5"), --[2]
+ create(GtkColumn,"title=Description,type=text,markup=6,sort_column_id=6")
+}
+--[1] filename in col[1] is sorted by number in col[2]
+--[2] date shown in col[4] is sorted on unix date in col[5]
+
+gtk:add(tv,cols)
+
+constant selection = gtk:get(tv,"selection")
+ set(selection,"mode",GTK_SELECTION_MULTIPLE)
+
+constant scroller = create(GtkScrolledWindow)
+ pack(panel,scroller,TRUE,TRUE,10)
+ gtk:add(scroller,tv)
+
+constant box = create(GtkButtonBox)
+ pack_end(panel,box)
+
+constant btn = create(GtkButton,"gtk-quit","Quit")
+ gtk:add(box,btn)
+
+-- load file list;
+object files = dir("*.ex")
+
+-- convert dates to usable format;
+files = apply(files,routine_id("convert_date"))
+files = apply(files,routine_id("convert_filename"))
+
+-- load files into listview;
+gtk:set(store,"data",files)
+
+-- set up handlers;
+gtk:set(tv,"rules hint",TRUE)
+gtk:set(tv,"columns autosize")
+gtk:set(tv,"search column",6)
+gtk:set(tv,"search equal func",_("search_func"))
+connect(tv,"row-activated","show_choice")
+gtk:set(store,"sort column id",2,GTK_SORT_ASCENDING) -- default startup sort;
+
+-- run the program!
+show_all(win)
+main()
+
+------------------------------------------------
+function convert_filename(object f, object junk) -- allow 'natural' sort order;
+------------------------------------------------
+object tmp = io:read_lines(f[1])
+for i = 1 to length(tmp) do
+ if match("--#",tmp[i]) =1 then
+ f[6] = tmp[i][5..$]
+ end if
+ end for
+f[1] = filebase(f[1]) -- drop extension, build index of #s;
+object x = filter(f[1],"out",{'0','9'},"[]")
+object n = filter(f[1],"in",{'0','9'},"[]")
+f[2] = x & pad_head(n,10,'0')
+return f
+end function
+
+-----------------------------------------
+function convert_date(object a, object b) -- convert dates to unix for sorting;
+-----------------------------------------
+object dt = datetime:new(a[4],a[5],a[6]) -- convert eu dir() date to datetime;
+ a[5] = to_unix(dt) -- store as UNIX timestamp for sorting purposes;
+ a[4] = datetime:format(dt,"%b %d %Y") -- store human-readable date for display;
+ a[6] = "?"
+return a
+end function
+
+-------------------------------------------------------------------------------
+function search_func(atom mdl, integer col, object key, atom iter, object data)
+-------------------------------------------------------------------------------
+key = lower(peek_string(key)) -- key is passed as pointer to string
+data = get(mdl,"value",iter,6) -- value from col 6 of liststore (description)
+return not match(key,lower(data)) -- find word anywhere in description, 0 = found
+end function
+
+------------------------------
+global function show_choice()
+------------------------------
+integer row = gtk:get(selection,"selected row")
+object f = gtk:get(store,"col data",row,1)
+system(sprintf("eui %s &",{f}),0) -- run it;
+return 1
+end function
diff --git a/eugtk/examples/documentation/.httpd.css b/eugtk/examples/documentation/.httpd.css
new file mode 100644
index 0000000..33137b6
--- /dev/null
+++ b/eugtk/examples/documentation/.httpd.css
@@ -0,0 +1,11 @@
+/*
+-- ====================================================================
+-- Styling for the remote display is set here;
+-- ====================================================================
+*/
+
+button {width: 100%;}
+button.dir {background-color: skyblue;}
+button.html {background-color: orange;}
+
+body {background-image: linear-gradient(180deg, yellow, blue); background-repeat: no-repeat;)
diff --git a/eugtk/examples/documentation/Broadway b/eugtk/examples/documentation/Broadway
new file mode 100644
index 0000000..5689166
--- /dev/null
+++ b/eugtk/examples/documentation/Broadway
@@ -0,0 +1,41 @@
+
+launchpad.net GTK+3 with the Broadway (HTML5) backend : Nicolas Delvaux
+
+This is a rebuild of the GTK+3 Ubuntu 12.04, 12.10, 13.04, 13.10, 14.04 and 14.10 packages with an enabled Broadway backend.
+Note that this PPA is no longer necessary starting from Ubuntu 15.04, as the Broadway backend is now enabled by default. The main difference with this PPA is that the "broadwayd" binary is shipped in the "libgtk-3-bin" package when it was in a separated "broadwayd" package in the PPA.
+
+ADDING THIS PPA TO YOUR SYSTEM
+ ==============================
+Run these commands in a terminal:
+sudo add-apt-repository ppa:malizor/gtk-broadway
+ sudo apt-get update
+ sudo apt-get upgrade
+ sudo apt-get install broadwayd # For Ubuntu >= 13.10
+
+HOWTO SINCE SAUCY (gtk+ >= 3.8)
+===============================
+As an example, here is how to run gedit in your browser.
+
+In a terminal, run:
+ broadwayd
+
+In another terminal, run:
+ GDK_BACKEND=broadway UBUNTU_MENUPROXY= LIBOVERLAY_SCROLLBAR=0 eui test0.ex
+
+Finally, open you Web browser and go to http://localhost:8080/
+The "UBUNTU_MENUPROXY= LIBOVERLAY_SCROLLBAR=0" is only useful if you use the global-menu and/or overlay-scrollbars. You have to disable them for Broadway, otherwise the program will segfault.
+Please see the "broadwayd" manpage for more information.
+
+HOWTO BEFORE SAUCY (gtk+ < 3.8)
+ ===============================
+As an example, here is how to run gedit in your browser.
+In a terminal, run:
+ GDK_BACKEND=broadway UBUNTU_MENUPROXY= LIBOVERLAY_SCROLLBAR=0 gedit
+Finally, open you Web browser and go to http://localhost:8080/
+The "UBUNTU_MENUPROXY= LIBOVERLAY_SCROLLBAR=0" is only useful if you use the global-menu and/or overlay-scrollbars. You have to disable them for Broadway, otherwise the program will segfault.
+You can customize the port by setting the BROADWAY_DISPLAY variable.
+
+DISCLAIMER
+ ==========
+I provide this PPA in the hope that it will be useful and I will try to upload new versions whenever the Ubuntu package is updated.
+ However, I do NOT guarantee that this PPA will always be stable and up-to-date nor that packages it contains may not destroy your computer, cause the end of the world and kill kittens. AaCharis SIL CompactAaClear Sans AAAAA DarkLightAuto
diff --git a/eugtk/examples/documentation/Glade.html b/eugtk/examples/documentation/Glade.html
new file mode 100644
index 0000000..5e86e6e
--- /dev/null
+++ b/eugtk/examples/documentation/Glade.html
@@ -0,0 +1,418 @@
+
+
+
+
+
+
+ EuGTK and Glade
+
+
+
+
+
+
+
+
+
+
+
+
+ Calendar program being edited in Glade
+
+
+ EuGTK 4.11.11 and Glade
+ Drag and Drop interface construction
+
+
+
+ Quick Links
+ Starting with Glade
+ Overview
+ Namespaces
+ Problems?
+ Compiling/Shrouding/Binding
+
+
+ Other Files:
+ How EuGTK Works
+ README
+ Alphabetical Guide
+ Built-in EuGTK Dialogs
+ ListView/TreeView widgets
+ Markup
+ Printing
+ Web Server
+ Quick Function List
+ Platforms
+
+
+
+
+
+ Overview
+
+
+It is now possible to use Glade to design your EuGTK
+program interface. I've tested with Glade versions 3.16 and 3.18.
+You will still have to write snippets of code in Euphoria to handle
+user events - just as you would when using Visual Basic™, Delphi™, etc.
+
+
+Begin by reading Starting Glade I and II for an
+introduction, thenread the rest of this page for details.
+
+
+
+Glade has a preview button so that you can see, to a limited extent, what your program
+will look like. Controls won't be linked (can't respond to user interaction) until you
+load the glade XML into your Euphoria program and provide the 'handler' functions.
+Often, these handler functions will only require a few lines of code.
+
+
+
+EuGTK will try to help you with this task by supplying a ready-made template
+for undeclared functions, which you copy and paste into your Euphoria code using whatever
+text exitor you prefer.
+
+
+This template will appear on the terminal from which you run your
+program. See the screenshot below.
+
+
+You must run programs from a terminal (x-term, for example) while
+developing and testing. There's no way around this.
+
+
+
+Your program begins as usual:
+
+
+ include GtkEngine.e
+
+
+
+
+Next, you tell EuGTK's built-in builder object
+to load your program's XML description from the file created by Glade. The builder will
+try to connect any signals for which you have declared a handler
+(in the Glade Properties/Signals tabs). Finally, you call main() to start the GTK
+processing loop.
+
+include GtkEngine.e
+add (builder,"~/demos/examples/widgets.glade" )
+main()
+
+
+With just those three lines of code, you are now ready to run your program!
+Of course, it won't do anything, except perhaps spit out a message telling you that
+you haven't bothered to write handlers for events declared in Glade.
+
+
+
+You should run the program (preferably from WEE with terminal, the BEAR, Geany using
+ gneui.ex, or directly from an x-term).
+EuGTK will prompt you with an error message and hopefully a function template for the
+missing function.
+You can copy and paste that into your editor, and then fill in the body of the function.
+Put these functions after the call to main().
+
+
+
+
+
+Note that when using Glade, your Euphoria code may use string identifiers to refer to
+objects, rather than having to obtain a pointer (a.k.a. 'handle') to them first.
+
+
+
+Glade will assign a unique identifier for widgets (which it calls the ID: ).
+The ID will be something like 'checkbutton1', 'checkbutton2', 'radiobutton1', etc.
+
+
+
This ID property is found on the General tab of the Properties dialog.
+You may change the IDs if you wish, sometimes changing them can make your code clearer.
+
+
+
+Obviously, you should avoid naming two controls with the same name.
+
+
+
+If you are using multiple Glade files, you will almost certainly have more than
+one 'button1', etc. but this isn't a problem, because a namespace will be prepended.
+See namespaces below.
+
+
+
+
+
+
+
+ Namespaces
+When writing a large program with multiple windows, Glade can become difficult to
+navigate safely. Click on the wrong thing in Glade, and you may lose all your work.
+This isn't good, so you should try to break up your program into small, safe 'modules',
+each with it's own Euphoria include (.e) file and corresponding Glade (.glade) file.
+
+
+
+Let's say, for example, I'm going to need a 'main' window, a pop-up 'edit' window, and
+the usual "About..." dialog.
+I'd create three Glade files, one named main.glade, the second edit.glade, and the third
+about.glade.
+After laying out these three windows using Glade, it's very likely that Glade will
+have used identical names for controls in the files. 'button1', for example, might appear
+in all three. You could, if you wish, wade thru all your Glade files and rename these as
+necessary to prevent conflicts, but
+EuGTK version 4.8.9 and up offers a less labor-intensive way.
+
+
+
+EuGTK namespacing allows you to refer to these controls by name in a manner familiar to
+Euphoria programmers:
+"button1" (the button1 in main.ex); "edit:button1" and "about:button1"
+(buttons in the respective edit.e and about.e files).
+ set ("edit:window1" ,"background","blue" )
+
+Note that these are strings. If you wish to convert them to Euphoria objects, you can,
+starting with EuGTK 4.8.9, use the new pointer() function:
+
constant win1 = pointer ("edit:window1" )
+
+Other files can now access the edit.e window in the normal Euphoria way:
+ set (win1,"background" ,...)
+
+
+There seems to be no noticeable delay when accessing controls via the string names.
+In a test which read and set label text using the constant 'handle' to the label, 20,000
+ iterations per second were reported.
+When using the label's name in string form, 18,900 per second were reported.
+
+
+
+
+When using the string form, the namespace prefix will be the same as the Glade file name
+(sans the .glade part) which the include file loaded into the GTK builder.
+When exported as a Eu constant or variable, the namespace prefix will be whatever
+namespace the included .e file declares. To prevent confusion, it's probably best to use
+identical names. IOW, code in 'foo.e' would have the namespace foo.
+
+
+
+
+To keep things neatly organized, you should put your Eu code in separate files as well:
+main.ex, edit.e, and about.e.
+
+
+
+Your Eu file main.ex would then include the line:
+
add (builder,"main.glade" )
+
+
+And your edit.e include file would have the lines:
+
+namespace edit
+include GtkEngine.e
+add (builder,"edit.glade" )
+
+
+
+
+
+
+To examine the namespaced names as loaded by EuGTK, add the line
+ with define BUILDER
+to your main program prior to including GtkEngine.e,
+or add -d BUILDER
to the command-line.
+The namespaced names will be shown on the xterm when you run your program. (as shown above)
+
+
+
+Glade objects loaded by the main (.ex) program will not be namespaced.
+Those items can be addressed directly without a namespace qualifier.
+This is done so that small programs which don't need multiple Glade 'includes' can
+use code that isn't cluttered with unnecessary namespacery.
+
+
+
+Widget names
+Confusingly, Glade also has a Widget name: property, found under the Common tab,
+which you should avoid using except under special circumstances. It isn't normally
+ needed. EuGTK refers to widgets created by Glade by their ID:, e.g. the main window
+ of a program created by Glade would have the default ID of "window1", and your EuGTK
+ program would access that window as "window1".
+
+
+
+There are a few 'trick' uses for this Widget name property, however:
+
One possible use is to pass data to functions which handle more than one control.
+For example, you might have a set of radio buttons which all call a single handler
+function. That function could examine the control's 'name' to determine what to do.
+If, for example, the buttons select various colors, each button could have a different
+color as the name property: 'red', 'green', or 'blue', etc.
+
+
+A more complex use might be to pass function names to a central 'dispatch' function,
+which could then call the desired function by converting the 'name' into a routine_id.
+
+
+
+Some of the demos in the glade subfolder utilize these tricks. See, for example, the
+hello.* files: hello.ex , es.e ,
+etc...
+
+
+
+Cautions
+The XML file created by Glade may include a "requires..." line, demanding a certain GTK
+version be present. You may find it helpful to remove that line under certain conditions,
+for example when designing your program on Linux with a current version of GTK/Glade,
+but running it on Windows™, which lags behind the other platforms.
+Just use a plain-text editor to zap the offending line.
+
+
+
+
+ Common Problems
+
+
+ I run my program without errors but can't see anything!
+
+ You must click on the 'visible' property checkbox for your main window.
+ This is found on the 'Common' tab under 'Widget Flags'.
+ Oh, and while you're there, be sure to link the main window's destroy
+ signal to the built-in function Quit, so that your program will clean up after itself when finished!
+ You must do these two things for the main window of every program you write.
+
+
+ I put buttons in a dialog, such as FileChooserDialog, but they don't do anything!
+ Set a unique 'Response ID' for each button.
+ This is found on the 'General' tab under 'Button Attributes'.
+ This ID is returned when the dialog closes as a result of a button being clicked.
+
+
+
+ How do I make menu items work like check menu items or radio menu items?
+
+ I don't know how to do that using Glade.
+ You'll have to write code in Euphoria, or <gasp!> try to edit the .glade xml directly.
+
+
+
+ I want to use widget x, but can't find it on the Glade palette
+
+ Some things are hard to find, and some just aren't there.
+ New GTK widgets introduced since GTK 3.10 are partially missing.
+ If you're working on the 'bleeding edge' of GTK3, you probably should be
+ coding by hand.
+
+
+
+ How do I know how to name the function that responds to a signal?
+
+ If you click on the widget's Signals tab, you'll see a list of signals that can be linked.
+ For example, a button has a 'clicked' signal.
+ You then click on the <type here> space adjacent to the signal name, and press the 'o' key.
+ (That's the letter o, not a zero!)
+ When you do, a suggested function handler name will be plugged in.
+ You can, of course, type in any global function name you prefer here.
+ For example, the handler name for a Quit or Exit button should usually be Quit
+ (no quotes) This will call EuGTK's built-in Quit() function when the button is clicked.
+
+
+
+ I want to write one Eu function to handle multiple controls.
+
+ Instead of accepting the default handler name, supply your own
+ For example, if you have 3 buttons, Glade will supply handler names:
+ on_button1_clicked on_button2_clicked on_button3_clicked
+ You simply remove the 1,2,and 3 from the handler names, and name your Eu function
+ on_button_clicked . All 3 buttons will call that function.
+ It's then your job to sort them out.
+
+
+
+
+
+
+
+
+ Compiling, Binding, etc...
+
+As usual, you can compile, bind, or shroud your program. If you do any of these, your program
+will still load the GUI description from the Glade XML file at run-time. This could be either good or bad, depending upon your perspective.
+
+
+
+The benefits:
+
+ The GUI appearance can be adjusted without messing with the program logic
+
+
+
+
+The drawbacks:
+
+ Anyone can easily trash your nice program by changing names or removing controls in the .glade file.
+
+ The .glade file must be distributed along with the .ex file
+
+
+
+
+
+
+
+Knowing the way some users think...
+It's almost certain that someone will see that Glade™* file,
+think "I don't care about air fresheners.." and delete it.
+
+* brand name for a common type of room deodorizer in the U.S.
+
+
+
+
+
+One easy solution to this problem is to copy the glade XML, paste it into a new file,
+enclose it in triple quotes, and assign it to an exported constant. Below, the added code is in red, while the XML from Glade is shown in black:
+ export constant XML = """
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!-- Generated with glade 3.16.1 -->
+ <interface>
+ <requires lib="gtk+" version="3.10"/>
+ ---etc---
+ """
+
+
+
+Save this new file as an include, perhaps widgets.xml, with the widgets namespace, and then your code becomes:
+
+ include GtkEngine.e
+ include widgets.xml
+ add (builder,widgets:XML) -- EuGTK can add objects from either a string variable or a filename
+ main()
+
+
+
+
+Now you can bind or compile your program and the interface will be 'hard coded' into it. Changing or deleting
+the widgets.xml or widgets.glade files will make no difference. No changes to your program interface can be made
+without re-compiling or re-binding.
+
+
+
+
+
+
diff --git a/eugtk/examples/documentation/HowItWorks.html b/eugtk/examples/documentation/HowItWorks.html
new file mode 100644
index 0000000..672094e
--- /dev/null
+++ b/eugtk/examples/documentation/HowItWorks.html
@@ -0,0 +1,1195 @@
+
+
+
+
+
+ How EuGTK Works
+
+
+
+
+
+
+
+
+
+
+ How EuGTK Works
+
+
+
+ Quick Links:
+ Create
+ Key Words
+ Properties
+ Set
+ Get
+ Linking to Eu Funcs
+ Passing Data
+ Calendars
+ Colors
+ Settings
+ Debugging
+ Memory Usage
+
+
+ Other Files:
+ README
+ Alphabetical Guide
+ Built-in EuGTK Dialogs
+ ListView/TreeView widgets
+ Markup
+ Printing
+ Web Server
+ Quick Function List
+ Glade GUI Builder
+ Platforms
+
+
+
+
+ Overview:
+
+
+
+
+From the GTK docs:
+
+
+"A GTK+ user interface is constructed by nesting widgets inside widgets.
+Container widgets are the inner nodes in the resulting tree of widgets:
+they contain other widgets. So, for example, you might have a GtkWindow
+containing a GtkFrame containing a GtkLabel. If you wanted an image instead
+of a textual label inside the frame, you might replace the GtkLabel widget
+with a GtkImage widget.
+
+
+
+There are two major kinds of container widgets in GTK+. Both are subclasses of
+the abstract GtkContainer base class.
+The first type of container widget has a single child widget and derives from
+GtkBin. These containers are decorators, which add some kind of functionality
+to the child. For example, a GtkButton makes its child into a clickable button;
+ a GtkFrame draws a frame around its child and a GtkWindow places its child
+ widget inside a top-level window.
+
+
+
+The second type of container can have more than one child; its purpose is to
+manage layout. This means that these containers assign sizes and positions to
+their children. For example, a GtkBox arranges its children in a horizontal
+[or vertical] row, and a GtkGrid arranges the widgets it contains in a
+two-dimensional grid."
+
+
+
+
+
+
+To reiterate the last point: GTK does not expect the programmer to specify
+position and size of each widget as is required when programming for Windows™.
+GTK handles these things automatically, adjusting things 'on-the-fly', as the user resizes
+windows, changes fonts, etc... which makes your programs more user-friendly.
+
+
+
+
+
+Quote:
+
+
+"Note the inherent danger of setting any fixed size - themes, translations into other languages,
+different fonts, and user action can all change the appropriate size for a given widget.
+So, it's basically impossible to hardcode a size that will always be correct.
+"
+
+
+
+
+
+
+If you are accustomed to writing programs for Windows™, you'll wonder why there's not
+a complex IDE to help lay out your GTK program interface. The answer is: because it's not necessary!
+You don't need to specify sizes and positions for GTK controls, GTK takes care of that task for you.
+Your main job will be writing Euphoria functions, for which a plain old text editor works
+just fine! You do have the option to use Glade to design your program interface if you wish.
+See Glade.html .
+
+
+
+ Keywords
+EuGTK allows you to program in an object-oriented style.
+
+There are only a handful of new keywords to know. You can create nice-looking, functional
+programs with only the six shown here:
+
+ create
+ declare a new instance of a given GTK object
+
+
+ set
+ modify a property of an object
+
+
+ get
+ retrieve a property of an object
+
+
+ connect
+ instructs an instance to respond to an event (a.k.a. signal)
+
+
+ show_all
+ make a container and all objects contained therein visible
+
+
+ main
+ start the GTK main event loop, waiting for user input
+
+
+
+
+
+You'll find a more complete list of keywords in functions.html
+
+
+
+ Create
+
+
+New instances of EuGTK containers and controls (collectively called 'widgets' in GTK)
+are created by calling the create() function with a class name.
+These class names are enumerated in GtkEnums.e,
+and they are the same as those used by the GTK
+docs. These class names are the ONLY ones you can send to
+the create() function. Never try numbers or strings. No quotes. Spelling counts!
+
+
+
+The create() function returns a 'handle' (a.k.a. pointer) to the newly created
+instance.
+That handle can (and usually should) be saved in a Euphoria constant for later access:
+
+ constant win = create (GtkWindow) -- generally, a constant is best, because you won't be changing these;
+
+Parameters, if any, which follow the class name vary, and are often optional.
+Refer to the demo programs and the GTK docs for details. Also, explore the new, more compact syntax options for the create() function here , as well as variants , below.
+
+
+
+GtkEngine.e maintains a list of currently created GTK containers and controls, and directs calls from your Euphoria program to the appropriate
+'method' based on the type of widget and whether the call is to
+set or to get one of that widget's properties .
+
+
+
+ Properties
+
+
+Every GTK widget has a list of properties which can be written to
+or read from. For example, a window has a title , a border width ,
+a default size , etc.
+
+
+
+Widgets which display information or accept input from users have properties such as
+text for labels and text entries, value for numeric widgets, and active
+for widgets such as checkboxes.
+
+
+
+To find out what properties exist for a given widget, refer
+to the GTK docs. Remember that widgets inherit properties from ancestor widgets, so if
+you don't find a property for a given widget, follow the Object Hierarchy links in the GTK docs.
+As an example, you can select the font , background or text color for a window,
+but these properties are actually implemented by GtkWindow's ancestor the GtkWidget,
+whereas border width is actually implemented by the GtkWindow's ancestor GtkContainer.
+But you don't need to be concerned about this, all you need do is tell the window what to do, and it - or its parents or grandparents - will see that it gets done.
+
+
+
+EuGTK takes care of finding these ancestor properties for you, but if you don't
+read the GTK docs, you won't be aware that these properties are available!
+In many cases you can just use common sense: for example, if it seems reasonable that a window
+should be able to have a blue background, just try it: set(win,"background","blue")
.
+If you try something that isn't possible, such as setting a window's text , for example,
+you will get an error message on your terminal such as:
+
+
+object class 'GtkWindow' has no property named 'text'
+
+
+
+
+
+
Remember, when writing your EuGTK programs, you must run them from a terminal,
+in order to see warnings such as the one above!
+
+
+
+ Set
+
+The set() function takes a 'handle' to a control, plus a 'property' to
+be set. Handle is almost always an atom (as assigned by the create() function),
+except when you are using Glade to design your interfaces, when you often use the name of the control in string form, e.g. "button1"
+or "help:window".
+
+
+
+'property' is always a string! Following those are one or more parameters. The type and number of
+parameters requred must be determined by looking at the GTK documentation
+and the sample programs included here.
+
+Some examples:
+
+ set (win,"title","My Program" )
+ set (win,"border_width" ,10 )
+ set (win,"default_size" ,300,200 )
+ set ("help:window" ,"Title","Using EuGTK" ) -- using widget name
+ -- the window directly above is created in an include file
+ -- which has the namespace "help"
+
+
+
+
+
+
+Note that you can use widget names to refer to controls, rather than handles,
+if you give the control its own individual name.
+ (When using Glade, a name will be assigned automatically.)
+
+
+
+
+For example: win = create (GtkWindow,"name=Main Window ,size=400x300" )
+ In the above line, you have named this window, and so can refer to it as
+"Main Window" in future set() or get() calls. Sometimes this can come in handy,
+resulting in more-readable code.
+
+
+
+If you supply too many parameters, like:
+
+ set (win,"title","My Program", "well isn't that swell?" ,1,2,3 )
+
+That won't usually cause any problem; the excess parameters are just discarded.
+You'll get an error message if you get carried away and try to send more than 10.
+
+
+
+Too few parameters will usually cause problems, if not crashes, because unfilled values
+default to zero:
+
+ set (win,"default_size" )
+
+This will set the window size to 0x0 pixels, i.e: nothing, which will make it
+kinda hard to see! No error message can help in this case, since such a
+setting could - for some strange reason - be intentional.
+
+
+
+Mismatched parameter types - sending a string where an atom or integer is expected, or vice-versa -
+will usually give an error message, but
+sometimes a crash (segfault) is unavoidable. Again, read the GTK docs!
+
+
+
+ Get
+
+The get() function takes a 'handle' to the control, plus a 'property' to
+be looked up. Handle is always an atom, except when using Glade to design your
+interface, in which case it is sometimes a string. And 'property' is always a string!
+Some examples:
+
+ get (win,"title" ) -- returns a string if a title was set, 0 otherwise
+ get (win,"border_width" ) -- returns an integer (pixels), 0 if unset
+ get (win,"default_size" ) -- returns a sequence {x,y} e.g: {300,200} or {-1,-1} if unset
+ get ("prefs:spinbutton1" ,"value" ) -- returns an atom or integer
+
+Sending the wrong number of parameters to the get() function will
+very likely cause problems! Sometimes a machine-level exception (signal 11).
+Fortunately, this is easy to avoid, as there normally AREN'T ANY
+parameters to 'get', other than the handle and the property name.
+
+
+
+ Conveniences
+
+A few very frequently-used functions have simpler 'shorthand' ways to call them:
+
+
+ Function Parameters Shorthand Parameters
+
+
+ set(x,"add",z)
+
+ For functions on the left, x and z must be atoms
+ (widget handles)
+ or widget names as strings
+ add(x,z)*
+ For shorthand notation,
+ x must be an atom (a widget handle) or a widget name as a string
+ * z can be a handle or a {list} of handles
+
+
+ set(x,"show") show(z)*
+
+
+ set(x,"show_all") show_all(z)
+
+
+ set(x,"hide") hide(z)*
+
+
+ set(x,"hide all") hide_all(z)
+
+
+
+
+These shortcut methods not only save a bit of typing, but more importantly, allow you to send {lists} of items, rather
+than calling the routine over and over, once for each item. {lists} are simply sequences of one or more
+handles to widgets. For example:
+
+ add (panel,{img1,btn1,btn2,btn3})
+ -- or
+ add (panel,x) -- where x can be a {list} of handles to any number of objects, of mixed types (don't all have to be buttons!)')
+ -- or
+ add (panel,x[1..5]) -- you can send slices as well
+
+
+
+
+GTK provides two 'pack' methods: pack_start and pack_end, which are identical except for direction.
+The original calls are still there, but for added convenience, I've also provided pack , which uses the - (neg.) sign to indicate pack at end . This may be helpful when packing several items in one call.
+
+ pack (panel,btn1) -- pack_start (top to bottom for vert. containers, left to right for horiz.)
+ -- or
+ pack (panel,-btn1) -- pack_end (this item will go at the bottom / far right of the container)
+
+
+
+
+ Variants
+
+There are some GTK widgets which have multiple ways to create
+them. An image, for example, might be created from:
+
+a file ~ *.jpg, .png, .gif, etc...
+a stock item ~ "gtk-ok", "gtk-cancel", etc...
+a pixbuf previously created or loaded from a file.
+a themed icon ~ from one of the hundreds supplied: "face-cool", for example.
+something else ~ a GIcon, perhaps.
+or nothing at all
+
+
+
+
+EuGTK tries to figure out which you want by examining the params (if any) you send
+to the create() function:
+
+ constant img = create (GtkImage)
+ --it seems you want an empty container which can hold an image to be set at a later time.
+
+ constant img = create (GtkImage,"~/demos/thumbnails/BabyTux.jpg" )
+ -- looks like you want to create this from the file named, if such file exists.
+ -- Note: cannonical_path() is automatically called to convert the filename/path to a usable form.
+
+ constant img = create (GtkImage,"gtk-ok" ,GTK_ICON_SIZE_DIALOG)
+ -- looks like you want a stock image, in the size given.
+ -- Note: any name beginning with "gtk-" is considered to be a stock item
+
+ constant img = create (GtkImage,"face-smile" ,GTK_ICON_SIZE_DIALOG)
+ -- you want an icon, as named, from the current icon theme, in the size specified.
+ -- size can be either one of the GTK_ICON_SIZE_ enums, or can be a pixel value,
+ -- usually between 16 and 256.
+
+ constant pix = create (GdkPixbuf,"~/demos/thumbnails/mongoose.png" ,80,80 ,TRUE)
+ constant img = create (GtkImage,pix)
+ -- by creating a pixbuf from the file, you can specify a size for the image,
+ -- plus, you have a static pixbuf object which can be re-used.
+ -- If you create an image directly from a file, you can't resize or re-use that image
+
+
+
+
+
+ Connecting controls to functions
+
+It should be obvious, but just to be clear, GTK programs, like Windows™ programs,
+Apple™ programs, and almost every other computer program written in the last few decades,
+are event driven . If you aren't sure what that means, find out before you begin designing your
+nifty new program.
+
+
+
+Your program will need to respond to user actions (events). The various
+events emit signals, for example, a button click emits a "clicked" signal.
+Your job is to connect a widget's signal to the appropriate function to handle the
+event.
+
+ connect (win,"destroy","Quit" ) -- Always do this for the main window!
+
+Where win is the handle, "destroy" [always a string] is a signal,
+a.k.a. the name of an event. "Quit" is what to do in that event. The example above will
+call the function Quit() when the program's main window is destroyed.
+Quit() - a function exported by GtkEngine.e - then shuts down the GTK engine and frees memory it has allocated.
+
+
+
+Quit() is one of very few built-in EuGTK functions you will need to connect to.
+Most other connections will be made to Euphoria functions YOU write.
+Any Euphoria function used for this purpose must be:
+
+A function, not a procedure
+Visible to the code doing the calling
+
+
+
+
+You usually do not have to write a separate line of code to connect a widget to a function. The most commonly-used widgets have a convenient way to make that connection
+at the time the widget is created, which leads to cleaner and easier to maintain code:
+
+
+ (A) constant btn1 = create (GtkButton,"gtk-ok","Foo" ,42 )
+
+ (B) constant btn1 = create (GtkButton,"gtk-ok","Foo","Hello World!" )
+
+ (C) constant foo = call_back(routine_id("Foo" ))
+ constant btn1 = create (GtkButton,"gtk-ok" ,foo ,"Hello World!" )
+
+
+
+
(D) New in 4.11.4!
+ constant btn1 = create (GtkButton,"gtk-ok",_("Foo") ,[...])
+
+ The _() function allows linking to local functions, instead of global.
+ It works better than call_back(routine_id()), since it can
+ 'look forward' to find functions which are defined
+ further down in your code, allowing cleaner program structure.
+
+ Thanks to Greg Haberek for this function.
+
+
+
+
+
+In any of the calls above, you are making a new button with the stock OK image, connecting its default signal (which is 'clicked' , in the case of a button) to
+call your Euphoria function Foo(), and optionally sending some object
+as the data parameter to that function.
+The data item is always optional, and can contain almost anything you
+want.
+
+
+
+See Data passing below for examples of how to pass
+various data types to your Euphoria functions.
+
+
+
+If you use method (A) or (B) then your Euphoria function declaration could look like this:
+
+ --------------------------------------------------------------
+ global function Foo(atom ctl , object data ) -- must be global!
+ --------------------------------------------------------------
+
+If you use method (C) or (D) then you can declare your Euphoria functions as local functions, not global:
+
+ -----------------------------------------------------------
+ function Foo(atom ctl , object data )
+ -----------------------------------------------------------
+
+
+
+
+The parameter ctl will be filled in with the handle of the control which
+dispatched the call, and data will be the data attached to that control,
+or null if no data value was provided.
+
+
+
+If you compile a program which uses method (A) or (B) to link to functions, it may compile
+without error, but you will get a run-time error on the terminal like the following:
+
+
Error: function Foo is not in scope
+****** (make it global or link via routine_id)
+
+
+
+
+
+Use the COMPILE flag for a way to quickly detect these errors in advance, before you go to the trouble of compiling.
+
+
+ $ eui -d COMPILE myprogram.ex
+
+
+
+Connections, alternate methods
+
+You can also connect signals to controls by typing a separate line:
+
+ (1) connect (btn1,"clicked","Foo" ,[...]) -- global function
+
+ (2) connect (btn1,"clicked" ,call_back(routine_id("Foo" )),[...])
+
+ (3) connect (btn1,"clicked" ,_("Foo" ),[...]) -- local function
+
+ (4) constant foo = call_back(routine_id ("Foo" ))
+ connect (btn1,"clicked" ,foo,[...])
+
+
+
+You might use this method instead of the previous one
+if you want to connect a signal other than the default, or if there is no default signal provided for
+that control. See GTK docs for appropriate signal names, and GtkEngine.e for the implemented defaults
+(around line 348 in the create() function). Again, if you plan to compile, use call_back(routine_id()) as shown in (2) , (3) or (4) .
+
+
+
+
Function Parameters
+Different controls can pass different types and number of parameters to your Euphoria "handler" functions when activated, so be sure to check the GTK docs for the particular widget/signal you are using. The GTK docs usually show a prototype of an appropriate signal handler.
+
+Often, your Euphoria functions can ignore the parameters that GTK passes to them.
+If you do not need to access these parameters, just don't bother to declare them!
+
+
+
+
+
Note that you can connect more than one signal and/or more than one function to a control.
+The calls will be executed in order.
+
+To do this, use the alternate 'connect' syntax as shown in (1,2,3) above,
+repeating the connect line for each different function or signal to be called.
+
+
+
+
+
+A practical application of this might be to trap your main window's "delete-event" signal first,
+perhaps calling a routine that saves your work if necessary, then allowing (or not) the "destroy" event to call the "Quit" function to end the program.
+
+
+
+
+
constant win = create (GtkWindow)
+connect (win,"delete-event" ,_("AreYouSure" )) --[1]
+connect (win,"destroy","Quit" ) --[2]
+-- note 1: this will be called first
+-- note 2: this may be called next, depending upon the
+-- value returned by #1
+
+-------------------------------------------------
+function AreYouSure()
+-------------------------------------------------
+if dirty then
+-- *save it* code goes here
+end if
+return Question (win,,"OK to Quit?" ) != MB_YES
+end function
+
+
+
+
+
+The value returned by the first function will determine whether the succeeding function(s) will be called or skipped. Note that we use the syntax not equal MB_YES . This is so closing the popup Question dialog window without actually answering YES or NO will not kill the program.
+
+
+
+If a 1 is returned from the first called function, then succeeding functions will NOT be called, and
+a 0 will allow the succeeding function(s) to be called. One way to look at this so it makes sense is to think
+of the return value as a report: A 1 or TRUE means "I've handled this myself, don't bother any further", while
+a zero or FALSE means "I've done what I can, it's your turn now!".
+
+
+
+
+
+If you find that you need to be able to disconnect a signal,
+use this alternate method, and save the signal_id:
+
integer sigid = connect (btn1,"clicked" ,....)
+
+so that later, you can disconnect that signal by calling:
+ disconnect (btn1,sigid)
+
+Do not use this to disable a control, because it does not change the appearance
+to indicate that the control is disabled. Instead, use
+ set (btn1,"sensitive" ,FALSE )
+
+
+
+ How to figure out which control was activated
+
+Since you can connect several controls to a single Eu function, your function may need to determine which
+control is doing the calling.
+As a rule, the first parameter passed to a called Eu function will be the
+handle of the control that was activated.
+The second parameter is usually the data attached
+when the connection was made.
+These 'rules' vary on occasion. See the GTK docs for a prototype of the respective callback routine.
+ Here are two ways to determine which control was activated:
+
--------------------------------------------
+function Foo(atom ctl, atom data)
+--------------------------------------------
+-- within this function, you might choose to:
+
+
+ Match the ctl parameter to known control handles
+
+ switch ctl do
+ case btn1 then ...
+ case btn2 then ...
+
+ Use the data parameter to pass a unique identifier
+
+
+
+
+
+Note:
+For control groups (such as RadioButtons), which send a 'toggled' signal,
+there will be two controls responding to events,
+and thus two calls to your Eu function!
+
+ One call being from the previously-selected button
+as it is toggled to the de-activated state.
+ The other being
+from the newly-selected button as it is toggled to the activated state.
+
+
+You must check the 'active' property
+to see which of the two you should respond to. In some cases, you may want to respond to
+both , deactivating or closing one thing, and activating or showing another, for example.
+
+if get (ctl,"active" ) then ... -- this is the one just clicked
+
+
+
+ Data passing
+
+
+Frequently, it is convenient to be able to attach data items to an individual control,
+which that control will pass to functions it calls when activated. One advantage of doing things this way
+is that it allows you to write a single Eu function which can handle events from multiple controls.
+Another advantage is that it makes your code easier to read and maintain.
+Depending upon the method chosen, the data can be almost anything, from a simple integer to
+a complex Euphoria sequence containing strings, pointers, routine_id's, and perhaps even images
+or other GTK 'widgets'.
+
+
+Method 1
+
+ Often it is enough to simply attach the data to a control's data space, as in the examples
+ below. This is also the cleanest and most readable method.
+
+
+
+
+(1) -- passing an integer
+constant
+ btn1 = create (GtkButton,"Justin" ,_("DisplayAge" ),17 ),
+ btn2 = create (GtkButton,"Jamie" ,_("DisplayAge" ),15 )
+
+---------------------------------------------------------------
+function DisplayAge(atom ctl, integer age)
+---------------------------------------------------------------
+ printf (1,"Age = %d\n" ,age)
+
+Integers are passed and used directly, with no conversion needed.
+All other data types are passed as pointers,
+and must be 'decoded' by using the unpack() function.
+
+(2) -- passing a float
+
+ constant btn1 = create (GtkButton,"gtk-ok" ,_("Foo" ),123.456 )
+
+ ---------------------------------------------------------------
+ function Foo(atom ctl, object data)
+ ---------------------------------------------------------------
+ atom num = unpack (data)
+
+ The unpack() function will return an atom
+
+(3) -- passing a string
+
+ constant btn1 = create (GtkButton,"gtk-ok" ,_("Foo" ),"James Brown" )
+
+ ---------------------------------------------------------------
+ function Foo(atom ctl, object data) -- must be object
+ ---------------------------------------------------------------
+ data = unpack (data)
+
+ The unpack() function will return a string
+
+ (4) -- passing a Euphoria sequence {} containing almost any mix of data
+
+ constant
+ btn1 = create (GtkButton,"_Pie" ,_("Foo" ),{ "Apple Pie" ,1.95 } ),
+ btn2 = create (GtkButton,"_Cake" ,_("Foo" ),{ "Carrot Cake" ,2.10 } )
+
+ ---------------------------------------------------------------
+ function Foo(atom ctl, object data) -- must be object
+ ---------------------------------------------------------------
+ data = unpack (data)
+ Info (win,"Flo's Bakery" ,
+ format ("Two orders of [1]" ,data),
+ format ("$[2.2]" ,data*2))
+
+The unpack() function will return a sequence
+
+
+
+
+Method 2
+
+Sometimes, the best way to pass multiple data values of varying types might be with Euphoria's map functions.
+One advantage of this method is that it allows you to access the values by
+name, rather than by position, as shown in the method above. The disadvantage - verbosity.
+
+
+ object jerry = map:new()
+ map:put (jerry,"Name","Jerry" )
+ map:put (jerry,"School","Central High" )
+ map:put (jerry,"Age" ,17)
+ map:put (jerry,"Pix" ,create (GdkPixbuf,"~/demos/thumbnails/Jerry.jpg" ))
+ -- above, we store a 'handle' to a picture of
+ -- Jerry in the map structure
+
+ constant btn1 = create (GtkButton,"Student 1" ,_("ShowDetails" ),jerry)
+
+ ----------------------------------------------------------------
+ function ShowDetails(atom ctl, atom data)
+ ----------------------------------------------------------------
+ Info (win,"Student" ,map:get (data,"Name" ),
+ sprintf ("School: \n %s\nAge: \n %d" ,
+ {map:get (data,"School" ),
+ map:get (data,"Age" )}),,map:get (data,"Pix" ))
+ -- above, we use the passed 'handle' to
+ -- display Jerry's photo in the Info pop-up
+
+
+
+
+
+Method 3
+
+Another way is to use each control's "data" space to pass
+name/value pairs. It is possible to combine this method with one of the
+others listed above to pass even more data.
+
+
+A drawback to this method is that you can only pass strings,
+not numbers. You can either pass the numbers as strings, e.g. "$1.95",
+or use one of the above methods
+instead.
+
+
+
+
+
+constant pie = "~/demos/thumbnails/pie.png"
+constant cake = "~/demos/thumbnails/cake.png"
+
+constant
+ btn1 = create (GtkButton,"gtk-quit","Quit" ),
+ btn2 = create (GtkButton,pie & "#_Pie" ),
+ btn3 = create (GtkButton,cake & "#_Cake" )
+ connect ({btn2,btn3},"clicked" ,_("Foo" ))
+ add (box,{btn1,btn2,btn3})
+
+ set (btn2,"data","dessert","Pumpkin Pie" )
+ set (btn2,"data","price","$1.95" )
+ set (btn2,"data","pix" ,pie)
+
+ set (btn3,"data","dessert","Birthday Cake" )
+ set (btn3,"data","price","$2.10" )
+ set (btn3,"data","pix" ,cake)
+
+show_all (win)
+main()
+
+--------------------------------
+function Foo(atom ctl)
+--------------------------------
+Info (win,"Flo's Bakery" ,
+ get (ctl,"data","dessert" ),
+ get (ctl,"data","price" ),,,
+ get (ctl,"data","pix" ))
+return 1
+end function
+
+
+
+
+But Wait, There's More!
+
+You can pass almost any type of Euphoria variable as data attached to
+a control, which means that you can also pass Euphoria routine_id's -
+so your connected function can execute whatever Eu function is attached as
+its data item.
+If you combine this with the ability to store and pass other information in
+name/value pairs as shown in Method 3 above, you can have a single
+Eu function that provides a number of different 'services' with very little code.
+
+
+
+ Calendars
+The GtkCalendar widget has a variety of ways to set and get the calendar date:
+
+
+
+get (cal,"day" ) => 26 -- as integers
+get (cal,"month" ) => 4
+get (cal,"year" ) => 2015
+
+set (cal,"day" ,23 ) -- changes day only
+set (cal,"month" ,3 ) -- changes month only
+set (cal,"year" ,1946 ) -- changes year only
+
+get (cal,"eu_date" ) => {115,4,26} -- Y in Eu format
+set (cal,"eu_date" ,{115,1,4 }) => Jan 4, 2015
+set (cal,"eu_date" ,date()) => current computer date
+
+set (cal,"date" ,{1960,11,2 }) => Nov 2, 1960
+set (cal,"date" ,{44,11,15 }) => Nov 15, 1944
+
+set (cal,"date","11/25/1940" ) => Nov 25, 1940
+set cal,"date","1924/4/25" ) => Apr 25, 1924
+
+
+
+get (cal,"datetime" ) => returns calendar date and current clock time in datetime format.
+get (cal,"datetime" ,0) => returns calendar date in datetime format with h,m,s = 0.
+
+get (cal,"date" ) => Tuesday, May 26, 2015 -- if no format provided,returns a string in default format shown
+get (cal,"date","%a on %A!" ) => "Sun on Sunday!" -- this will be right as often as the weather bureau!
+
+Format string can include the following specifiers, along with other characters of your choice:
+ %% -- a literal %
+ %a -- locale's abbreviated weekday name (e.g., Sun)
+ %A -- locale's full weekday name (e.g., Sunday)
+ %b -- locale's abbreviated month name (e.g., Jan)
+ %B -- locale's full month name (e.g., January)
+ %C -- century; like %Y, except omit last two digits (e.g., 21)
+ %d -- day of month (e.g, 01)
+ %j -- day of year (001..366)
+ %m -- month (01..12)
+ %u -- day of week (1..7); 1 is Monday
+ %w -- day of week (0..6); 0 is Sunday
+ %y -- last two digits of year (00..99)
+ %Y -- year
+
+For example, get (cal,"date","Today is %A, day #%j of the year %Y" )
+
+Results
+Today is Monday, day #126 of the year 2013
+
+The calendar will normally open with the current computer date, if you don't tell it otherwise.
+
+You may also use a datetime function, such as:
+
+ today = datetime:now ()
+ gtk:set (cal,"date" ,today)
+ or
+ gtk:set (cal,"date" ,datetime:add(today,30,DAYS)) -- shows date 30 days from now
+
+
+
+
+
+ RGBA Colors
+
+
+GTK 3 uses a 32-bit RGBA color structure which can be a bit tricky to use, so EuGTK
+implements some functions to make the process simpler. With EuGTK, you can specify colors by:
+
+ name: "red" --this is the preferred way, using the xcolor names
+ Refer to xcolors.txt for a list of names
+ hex value: #FF0000 -- #RRGGBB
+ hex string: "#FF0000" -- as above
+ decimal value: 16711680 -- seldom useful, who can remember what color this is?
+ rgb string: "rgb(255,0,0)" -- r,g, and b colors are 0 => 255
+ rgba string: "rgba(255,0,0,0.5)" -- as above, plus alpha in the range from 0 => 1
+
+
+
+To retrieve colors from, for example, the GtkColorChooserDialog, use:
+
object color = get (ccd,"rgba" ) -- returns rgb or rgba string
+To make manipulating colors easier, there are several format options available for the above call:
+
+ object color = get (ccd,"rgba" ,N) -- see table below for N values
+
+ 0 = Euphoria sequence: {"rgb",255,0,0} or {"rgba",255,0,0,0.51}
+ 1 = hex string: "#FF0000" -- this is a string, not a hex number
+ 2 = decimal number: 16711680 -- this is a number, not a string
+ 3 = 3-element Eu sequence: {255,0,0} -- {R,G,B}, colors are 0=>255
+ 4 = 4-element Eu sequence: {255,0,0,0.51} -- {R,G,B,A} where alpha is 0=>1
+ 5 = 4-element Eu sequence: {255,0,0,130.5} -- {R,G,B,A} where alpha is 0=>255
+ 6 = rgb or rgba string: "rgb(255,0,0)" or "rgba(255,0,0,.51)" -- rgba returned if alpha != 1, otherwise rgb returned
+
+Note: there is no mapping back to a xcolor name from any of the above
+color formats.
+
+
+
+ Memory Usage
+
+
+eui
+A modest sized EuGTK program, when run in interpreted mode, may use a relatively large
+amount of memory, (a minimum of 25 to 50 megs on my computer). This is because almost
+all of the Euphoria std libraries are loaded by EuGTK. The source code will,
+however, run on both 32-bit and 64-bit machines, if they have Euphoria installed.
+WEE editor, for example, uses 107 megs. when interpreted.
+
+
+
+eubind
+The same program, when bound, may only require 10 or 20 megs, and the bound source will
+take up perhaps 4 or 5 megs of disk space, since the binder removes the unused routines.
+Bound programs run almost instantly, compared with interpreted programs.
+In addition, binding takes only a moment - often less than a second. Remember that bound
+programs must be distributed in two forms - 32-bit and 64-bit versions. WEE uses 35.6 megs.
+
+
+
+eushroud
+This also works nicely, producing an obfuscated .il file which loads and runs very
+ quickly. In addition, the .il file will be much smaller than a bound file - perhaps 1/2
+ to 1/5 the size. Like bound programs, there must be both a 32-bit version and a 64-bit
+ version. WEE uses 22.7 megs.
+
+
+
+euc
+When compiled, the program will use only 3 or 4 megs of memory, and the runtime will be
+small, perhaps 1 or 2 megs, and will start even faster, but it takes quite a while to
+compile. I only compile a program when I'm certain that all the bugs have been worked out.
+You may prefer to distribute your program in compiled form. Just remember, you will need
+to provide separate 32-bit and 64-bit versions. WEE uses only 8.3 megs!
+
+
+
+Conserving Memory
+In general, each widget you create will require some amount of memory, so you should
+avoid creating (or re-creating) them in loops that might run for many iterations.
+Instead, create them outside the loop, and simply
+hide() and show() them as required. If widgets must be created within function
+calls, try to destroy() them before
+returning from the call to keep from wasting memory.
+
+
+
+ Debugging
+
+In the table below are some command-line switches you may use to get into the inner
+workings of EuGTK.
+All but the first are generally only needed when maintaining EuGTK itself, but there
+may be times when you can use them to help you find a programming error.
+Of course, you must run your program from an x-terminal in order to see the output!
+
+
+
+ Switch Output Comment
+
+
+ -d COMPILE
+ Caution: function Foo will not link when compiled!
+********
+
+ Use before compiling so you can fix links
+
+
+
+ -d CREATE
+ Create
+ Call: GtkWindow->new
+ Params: Int
+ Return type: Ptr
+ Vector: 101
+ Args: {0}
+ GtkWindow=>37278096
+
+ Vector is the routine_id assigned to the function "gtk_window_new"
+ by EuGTK's "init" procedure. The number following the =>
+ is the 'handle' to the newly-created window.
+
+
+ -d SET
+ Set
+ Call: GtkWindow->set_default_size
+ Params: Ptr Int Int
+ Return type: None
+ Vector: 107
+ Args: {37278096,300,80}
+
+ Args are: 'handle' to the widget being 'set', and following that are
+ the parameters being passed, in this case, two integers, width and height.
+
+
+
+ -d GET
+ Get
+ Call: GtkComboBoxEntry->get_active_text
+ Params: Ptr
+ Return type: Str
+ Vector: 277
+ Args: {30175312}
+ Result: Banana
+
+ Vectors > 0 are direct calls to GTK routines generated via define_c_func or define_c_proc.Vectors less than -1 mean that the call is to a function written in Euphoria, in which case the vector is the negated RID.
+
+
+ -d INIT
+ Init class:GtkButton...
+ set_image_position 510
+ get_image_position 511
+ set_always_show_image -1
+ get_always_show_image -1
+
+ The numbers represent the routine_id that Euphoria has assigned to the GTK calls.
+ Use -d INITX for detailed listing.
+
+
+
+ -d INIT_ERR
+ ERR:GtkWindow set_titlebar -1
+ERR:GtkWindow close -1
+ERR:GtkBox set_baseline_position -1
+ERR:GtkBox get_baseline_position -1
+ERR:GtkButton set_always_show_image -1
+ERR:GtkButton get_always_show_image -1
+ERR:GtkWidget get_frame_clock -1
+When the number is -1, that means the call is invalid, usually because the version
+ of GTK you are using does not implement that call.
+ 'always_show_image' is only available in GTK 3.6+, for example.
+
+
+
+-d INI
+-- Ini file for test173.ex
+My Calendar={"date",{2015,4,5}}
+ColorButton={"rgba","rgb(255,255,255)"}
+MyCheckButton1={"active",1}
+FontButton={"font name","Sans"}
+ Used to display data written to settings (ini) file on x-term
+
+
+
+-d FUNC FUNC g_slist_nth_data 162
+ PARAMS {50331649,16777220}
+ Values {24122256,103}
+Debug calls to gtk_func() and gtk_str_func()
+
+
+
+-d PROC
+PROC g_set_prgname 37
+ PARAMS {117440516}
+ Values widgets.ex
+Debug calls to gtk_proc
+
+
+
+-d PIXBUF Pixbuf from file /home/irv/Pictures/IMG_0020.JPG
+Scaled 300x300 1
+For debugging pixbuf creation
+
+
+
+-d PIXBUF_ERR CAUTION: cannot create pixbuf from /home/irv/Pictures/map.pdf
+For debugging pixbuf errors
+
+
+
+-d BUILDER
+Screenshot
+Used to display namespaced objects loaded from Glade
+
+
+
+
+
+
+
+ Settings
+
+Updated for EuGTK 4.11.10
+
+The ability to very easily save selected settings from one run to the next has been added in EuGTK 4.10.0.
+This includes saving the 'state' of active controls, such as spin buttons, check buttons, color buttons,
+font buttons, etc. as well as saving selected properties of any GtkWidget, such as the preferred background color,
+font, position or size of windows, etc., from run to run.
+
+
+
+IOW, your arrangement of things at the time the program was closed will be restored next time the program is run.
+Refer to test153.ex and test153.ini for some examples. Below is a sample
+file, which can have any name and extension. .ini works fine, and is familiar. Note that it is plain text,
+so it's easily edited, and comments are preserved when it's updated. It uses simple name (dot) property notation.
+
+
+
+For commonly-used controls, there is a default property defined in GtkSettings.e,
+which can be saved/loaded simply by adding the control's handle or name to a list of
+controls to pass to settings:Save(). Note that controls to be saved MUST have a name!
+These default states are restored when the ini file is loaded.
+
+
+
+For saving other (non-default) properties, you must add one line of code to save
+that property. No additional effort is required when loading the settings,
+the property will be reset automatically to the saved value when the ini is loaded.
+
+
+
+For saving bits of data which are NOT properties of a given widget, you can use the
+ widget's named data spaces (a.k.a. key/value pairs) to store almost
+ anything you want. For these, your program code must specifically read the
+ data item when it needs to use it:
+get ("MainWindow","data","Foobar" ) => "Baz!"
+
+
+
+----------------------------------------------------------------------------
+-- Following items are 'persistent', only changed by editing this file:
+----------------------------------------------------------------------------
+--!MainWindow.icon=face-smile
+--!MainWindow.border width=20
+
+--!Label1.text=Move, resize, change color, etc...
+--!ColorChooserButton.tooltip text=Pick a color for the Main Window background
+--!Font Button.tooltip text=Select font for calendar
+
+------------------------------------------------------------
+-- Following items are added by the settings:Save() command
+-- using the default properties for the controls on the list
+-- your program provides, or by the settings:Add() command,
+-- using properties you specify.
+------------------------------------------------------------
+
+MainWindow.data.Foobar =Baz!
+MainWindow.data.Message =Thanks a lot!
+MainWindow.background =#729FCF
+MyCalendar.font =Serif Bold Italic 12
+ColorChooserButton.rgba =#729FCF
+FontButton.font name=Serif Bold Italic 12
+MyCalendar.date ={2016,4,10 }
+
+
+
+
+
+
+
diff --git a/eugtk/examples/documentation/README.html b/eugtk/examples/documentation/README.html
new file mode 100644
index 0000000..9cb3865
--- /dev/null
+++ b/eugtk/examples/documentation/README.html
@@ -0,0 +1,1169 @@
+
+
+
+
+
+
+ EuGTK README
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Pete Eberlein's WEE Euphoria editor
+
+
+
+ EuGTK 4.12.0
+ A cross-platform language binding for Euphoria and the GTK3 graphic user interface
+
+
+
+
+
+
+ Quick Links:
+ Getting Started
+ Writing your programs
+ Error messages
+ Compare with C code
+ Tested Platforms
+ New Features
+ New Syntax
+ New Plugins
+ Recent Changes
+ Broadway
+ BEAR
+ History
+ Legal Disclaimer
+
+ Other Files:
+ How EuGTK Works
+ Alphabetical Guide
+ Built-in EuGTK Dialogs
+ ListView/TreeView widgets
+ Markup
+ Printing
+ Web Server
+ Quick Function List
+ Glade GUI Builder
+ Platforms
+
+
+
+
+
+
+This package should be up-to-date with GTK version 3.21.4.
+Tested with GTK 3.18.9 on Linux Mint 18 Cinnamon 64-bit and
+Gtk 3.10.8 on Mint 17.2 Rafaela 64-bit, as these are the most-popular
+distros with the latest stable GTK 3 versions included.
+Also, tested on Windows 7 64-bit with Gtk 3.20.2.
+
+
+
+
+
+The Good News:
+GTK3 is better both in ease of use and in
+the ability to produce attractive, modern program interfaces than any other GUI libraries
+ I've tried. GTK3, unlike most of the other GUI libraries, has functions
+to handle touch screens.
+
+
+
+Linux distros such as Ubuntu, Mint, Ultimate, Parsix, etc. come with GTK3
+libraries already installed. If necessary, you can install GTK3 alongside GTK2 without
+problems. Apt-get will do it for you.
+Or, in your package manager, look for libgtk-3-0. If you can't get libgtk-3, then it
+may be time
+to think about updating your ancient Linux installation.
+
+
+In addition , EuGTK 4.9.0 and up works with OS X™.
+It also works on Windows™, but I cannot recommend this.
+Windows has become entirely too awkward to use and maintain.
+
+
+
+(Once upon a time I succeeded in nailing some jelly to a tree.
+That doesn't mean I'd consider jelly-nailing to be a good career choice.)
+
+
+
+The same EuGTK engine and sourcecode can be used
+on any of the three platforms without change, except for possibly
+missing icons on different platforms. You can supply your own icons
+if appearance is important.
+
+
+
+More Good News:
+Compared to other programming language/GUI combinations,
+EuGTK is very simple to set up and to use.
+There is only one 'include' you must add to your programs, which is 'include GtkEngine.e'.
+There are only a few files that need to be available when you write, test,
+run or perhaps compile your program - GtkEngine.e and GtkEnums.e. Adding, when required,
+GtkPrinter.e, etc...
+No additional files are produced or needed other than the code you write and the standard
+Euphoria library files. This makes project management simpler, and
+if you want to ship EuGTK with your program, the required files only add about 350k to
+the total package (74k if compressed!).
+
+
+
+Also, EuGTK is easier to use because EuGTK adds some 'intelligence' that is missing from other
+languages, (like C or Python), such as the ability to create images from a variety of sources without the
+programmer having to call a different function for each source type. See variants .
+
+
+
+In addition, EuGTK is easy to keep up-to date with the latest versions of GTK
+because all of EuGTK is written in Euphoria, so it can easily be edited by anyone,
+with no re-compiling or other tricky steps involved.
+
+
+
+You'll need the latest Euphoria 4 interpreter
+from OpenEuphoria.org .
+I use Euphoria 4.1.0 beta.
+Plus, you'll really need the latest GTK docs! Get 'em from gtk.org .
+
+
+
+Just open the gzipped package (I guess you've already done that) and drag the 'demos' folder into your home folder.
+All files are in the demos folder (and subfolders thereof).
+Try them so you'll know what you can do
+with GTK!
+
+
+
+Installation
+Later, you can put these files - GtkEngine.e, GtkEnums.e, GtkPrinter.e, etc. -
+into the folder with your other Euphoria includes, or just add a one-line
+eu.cfg file to any directory you wish to work in, pointing to the location
+of these files. My Euphoria/include folder is /usr/local/share/euphoria/include.
+Moving all the Gtk***.e files from the demos folder into there works.
+
+
+
+
+Be sure to add this eu.cfg to your home directory as well, otherwise, eu programs will
+not be able to find the necessary GtkEngine.e when you start a program
+from your file manager (such as caja).
+
+
+
+My eu.cfg reads:
+
+~/demos
+
+
+
+
+
+
+ Getting Started:
+
+
+First, open an x-term, cd to the demos directory, and run a program:
+$> eui test0
+
+
+
+
+
+
+
+Running from an x-term is mandatory while you are writing your
+Euphoria/GTK programs, so that you can see error messages and crash reports,
+but not necessary once you have your program working and debugged.
+
+
************************************
+Fatal Error: no libgtk-3.so.0 found!
+************************************
+
+
+If you get the above error message, either you do not have
+libgtk-3 installed (try apt-get or your package manager), or it has
+been installed in an unexpected location. Check lines 66 thru 88 at the top of
+GtkEngine.e and make changes as necessary.
+
+
+
+
+
+
+You may also get the above error if you are trying to run --
+32-bit Euphoria on a computer with 64-bit libraries (or vice-versa) --
+
+
+
+
+Now try as many of the test programs as you can, they will help you find incompatibilities (if any) with the
+version of the GTK library you are using.
+
+
+
+Running these test programs is also the best way to see what GTK offers for use in your own programs.
+
+Now, get busy!
+
+
+
+
+ WRITING PROGRAMS:
+If you haven't read How it Works yet, please do so now!
+
+
+
+You can use any plain text editor to create your EuGTK programs. I use
+either Pete Eberlein's great WEE editor
+(written in Euphoria), sometimes Pluma or Geany ,
+ or the GtkSourceView widget,
+ which also works well, and could easily be expanded into a full-featured
+ programmer's editor.See Programmer's Resources
+ for an overview.
+
+
+
+The WEE editor (recommended!) automatically colorizes Euphoria source code, and moves the cursor to
+the file/line where a syntax error occurs.
+
+
+
+
+
+For WEE : Pop-up help for both Euphoria and GTK keywords is available by pressing the [F1] key. See
+instructions here .
+
+
+
+
+In the ~/demos/resources/geany_syntax folder you will find
+files to add Euphoria syntax highlighting to Geany ,
+as well as an add-on program by Kenneth Rhodes which moves the Geany edit cursor to the error line in your Eu program.
+
+
+
+In the ~/demos/resources/gedit_syntax folder you will find
+files to add Euphoria syntax highlighting to Pluma, GEdit, GtkSourceView, the BEAR , etc.
+
+
+ Visual (Drag & Drop) Program design:
+
+
+It is also possible to use Glade to design your program layout.
+You will need the latest version of Glade (3.16 or up). See the following programs
+for demos: calendar.ex and
+calendar.glade .
+and clock.ex and clock.glade .
+Also, please read XML/GtkBuilder .
+
+
+
+Before you start coding, please read HowItWorks to get an overview, then open guide_a.html
+in your browser for links to demos showing how the various controls (a.k.a. widgets) are used.
+
+
+
+You'll also need the latest GTK 3.0 docs (from gtk.org ), since there are perhaps
+4x more methods available than I have used in the demos. Some of these methods
+can be ignored, since there are easier-to-use equivalents in Euphoria itself.
+
+
+
+
+ Error Messages:
+
+There are three possible sources of error messages: Euphoria, GTK, and EuGTK.
+
+Euphoria gives you the line number and description of the error, but these will only appear
+in a console - there will not be a pop-up error dialog - since these come directly from the Euphoria
+interpreter, before GTK is running! Spelling errors, undeclared variables, and such will appear here:
+
+
+<0074>:: Errors resolving the following references:
+ 'GtkBufton' (text16.ex:39) has not been declared.
+
+constant okbtn = create(GtkBufton,"gtk-ok","Foo")
+ ^
+
+
+GTK errors, which also only appear when running from a console,
+will sometimes display an enigmatic message that will take some
+effort to understand. Best way to debug these errors is to comment out blocks of code, and then
+uncomment one line of code at a time, and see which line triggers the error message. Then consult the GTK docs
+to see what GTK is expecting vs. what you've written:
+
+
+
+(test174.ex:3126): Gtk-WARNING **: Can't set a parent on a toplevel widget
+**
+Gtk:ERROR: /build/buildd/gtk+3.0-3.4.2/./gtk/gtkcontainer.c:3292:
+gtk_container_propogate_draw: assertion failed: (gtk_widget_get_parent(child) ==
+GTK_WIDGET (container))
+Aborted
+
+
+
+Above is the type of error message GTK will present, in this case I was trying
+to add a dialog to a window (dialogs are 'run', not added to containers).
+
+
+EuGTK itself will (hopefully) display easy-to-understand messages like the one below.
+Both warnings and fatal errors are displayed here, so if your program doesn't run,
+or doesn't seem to run correctly, run it from a terminal!
+ (x-term, mate-terminal, etc... whatever you have)
+
+
+Error: function Foo is not in scope
+****** (make it global or link via call_back(routine_id())
+
+
+CAUTION!
+
+If you plan to compile your EuGTK program, please read
+HowItWorks to see the correct way to link
+controls to your Euphoria functions!
+
+
+
+
+
+Another possible error occurs when you create a GTK widget with a version of libgtk-3 which
+does not implement that widget. You have 3 choices in this event: use something else, create your own
+custom object to simulate the new widget, or update your version of libgtk-3.
+The last is often not possible, usually you will
+find it easier to
+update to a newer Linux distro which includes the latest libgtk-3 instead.
+
+
+
+
Fatal Error: GtkMenuButton
+************ not implemented in this GTK library version
+
+When you use a recently-implemented GTK widget in a program you plan to distribute, it is a good idea to check the
+libgtk version and if necessary present an error message. Use the requires() function for this. See test193 .
+
+
+
+
+There are several other flags you can set to display debugging info. See
+ Debugging section of HowItWorks.html
+
+
+
+ New Features
+
+Icons
+
+Starting with GTK version 3.10, the old GTK stock items are deprecated, and new programs
+should not use them. Instead, use named icons. This is good, because the set of stock buttons
+was limited, and some were missing altogether. There's a far wider variety of named icons to choose from - except on Windows™, where there are very few. This is a problem which can be avoided by packaging your own custom icons with your program.
+
+
+You can most easily see
+all the available icons by running examples/icons.ex . It now has a handy search feature, which is a great help
+when choosing the buttons and menus for your nifty new programs!
+
+
+
+However, using named icons means more work for the programmer, usually involving several lines of
+code just to create each button. To solve this problem and make the transition to named icons easier,
+this version of EuGTK adds a new, more flexible way to create GtkButtons.
+
+
+
+
+
+
Old Style:
+ constant btn1 = create (GtkButton,"gtk-edit" ,...)
+ -- button caption and icon are pre-set, not easily changed,
+ -- but nice-looking and easy to use. This is the leftmost button above.
+
+ New Style:
+ constant btn1 = create (GtkButton,"text-editor#_Edit" ,...)
+ -- this uses a named icon and your own label.
+ -- Run examples/icons.ex to search for a suitable icon.
+ -- These themed icons should change appearance to match the
+ -- current theme the user selects.
+
+
+
+
+Please note the new hashtag# syntax:
+
constant btn1 = create (GtkButton,{"gtk-edit#_Edit" ,...}
+ -- changing the caption and hot-key as desired
+ -- icon name is first, caption second, separated by #.
+ -- Optional underscore prepends the hot-key in caption
+ -- this button is shown above, center
+
+ constant btn1 = create (GtkButton,"~/demos/thumbnails/4_rhombuses.gif#_Colors" ,...)
+ -- You can set the button image from a file (even animated!),
+ -- so you can customize your program's appearance.
+ -- You can even have "check images" that change depending
+ -- upon their state! (see test15 )
+
+
+
+
+ImageMenuItems
+
+
+
+
+Someone now [only temporarily, I hope] in charge of GTK decided that having images on buttons and menu items was a bad idea.
+They cite some academic study which 'proved' that people are quicker at choosing the correct button out of an array of buttons if the buttons contain
+nothing but boring text captions.
+
+
+
+Did this same 'academic study' prove that traffic signs didn't need to be different colors and shapes? If not, why not?
+
+
+So they're gone as of GTK3.14.
+
+I guess they don't want people with dyslexia to use their computers.
+
+
+
+If you don't like images, you don't have to use 'em, but if you do like them,
+don't worry too much, I can outsmart them and put those images back. See, for example, test25 .
+
+
+
+Interactive Debugger
+
+This change is actually a good idea . You can, starting with GTK3.14, enable a pop-up
+GTK+ Inspector by adding one line of code just before the call to main():
+
show_all (win)
+ set (win,"interactive debugging" ,TRUE)
+ main ()
+
+
+
+
+This interactive debugger allows you to view the widget hierarchy and experiment with various settings
+while your program is running! It also lists the applicable properties and signals for each selected widget.
+
+
+
+New Types
+Gtk widget types have been added to EuGTK. You can now declare Euphoria objects as GTK types,
+as follows:
+
+ function Foo(Window w, Button b)
+
+As you can see, you just use the Gtk widget name, sans the 'Gtk' part.
+It's generally not necessary nor even a good idea to use these.
+They are provided mainly for use in the rare occasion where it is necessary to
+register and "type cast" a Euphoria function parameter. Most objects passed as
+function params already 'know' their type, as do all that are created as Eu
+constants, objects, or atoms, so this is seldom necessary.
+
+
+
+
+Settings
+The ability to very easily save selected settings from one run to the next has been added in EuGTK 4.10.0.
+This includes saving the state of active controls, such as spin buttons, check buttons, color buttons,
+font buttons, etc. as well as saving specified properties of any GtkWidget, such as the preferred background color,
+font, position and size of windows, etc., from run to run. You can do this without having to write lines of code to save, parse, and restore each setting. Just supply the name
+of an .ini file and a list of control handles you wish to save/restore to the save_settings() or load_settings() functions.
+
+
+
+Refer to test153.ex , test153.ini ,
+test173.ex , test173.ini ,
+test201.ex , and test201.ini for some examples. Below is a sample
+file, which can have any name and extension. (.ini works fine, and is familiar) Note that the file is plain text, so it's easily edited, and comments are preserved when it is updated.
+
+
----------------------------------------------------------------------------
+-- Following items are 'persistent', only changed by editing this file:
+----------------------------------------------------------------------------
+--!MainWindow.icon=face-smile
+--!MainWindow.border width=20
+
+--!Label1.text=Move, resize, change color, etc...
+--!ColorChooserButton.tooltip text=Pick a color for the Main Window background
+--!Font Button.tooltip text=Select font for calendar
+
+------------------------------------------------------------
+-- Items beginning with + are added via the settings:Add()
+-- function called in your program code, as they are not a
+-- default property as defined in GtkSettings.e
+-- They can also be added by manually editing the ini file.
+
+-- Items without the leading + sign are saved automatically,
+-- by passing a list of names or handles of controls to
+-- the settings:Save() function.
+
+-- You may also save and restore widgets named data spaces
+-- by settings:Add(ini,ctl,"data.name","value")
+-- see MainWindow.data lines in blue below.
+------------------------------------------------------------
+
++MainWindow.data.Foobar=Baz!
++MainWindow.data.Message=Thanks a lot!
++MainWindow.background=#FCE94F
++MyCalendar.font=TakaoPGothic Bold Italic 12
+ColorChooserButton.rgba=#FCE94F
+Font Button.font name=TakaoPGothic Bold Italic 12
+MyCalendar.date={2016,6,8}
+
+
+
+
+
+ New Syntax
+
+In order to make programming even easier, I've added a new way to set
+properties at the time a widget is created. This doesn't replace the previous set(... functions, just
+allows you to use a shorter method if you wish. It may be faster than
+the old method, since it can avoid multiple lookups.
+
constant win = create (GtkWindow,{
+ {"title" ,"Simple Text Viewer" },
+ {"default size" ,600,500},
+ {"position" ,GTK_WIN_POS_CENTER},
+ {"icon" ,"~/demos/thumbnails/mongoose.png" },
+ {"connect" ,"destroy" ,"Quit" }})
+
+
+In simple cases, an even easier-to-use syntax is possible using key/value pairs.
+See screenshot at top of page.
+
constant win = create (GtkWindow,
+ "title=Hello world!,size=300x100,background=green,border=10" )
+
+
+You can freely mix these styles in your program, using whichever notation is the cleanest and clearest.
+Because this last version uses Eu 4.0 key/value pairs, not all settings can be made this way. You can't, for
+example, pass Eu variables or Gtk constants as part of the settings string, except for the constants TRUE, FALSE, HORIZONTAL, and VERTICAL,
+which are specifically allowed.
+
+ Custom Dialogs
+
+
+EuGTK 4.11.0 has a Custom dialog which allows adding almost any widget(s) to an easy-to-use pop-up dialog,
+with basically one line of code. See dialogs.html and test87.ex for details.
+
+
+
+
+ Plug & Socket
+
+A plug and socket demo (plug.ex, sock.ex) has been added, to
+allow embedding widgets from one process into another process.
+I haven't been able to dream up a real need to do this so far.
+
+
+ To Do: find a useful program that needs this!
+
+
+
+ Plugins
+
+EuGTK 4.8.9 has a new 'plug-in' feature, added in order to
+implement the GtkSourceView and WebKit widgets.
+
+
+
+
+SourceView
+
+
+
+ New GtkSourceView plugin
+
+
+
+The SourceView widget offers automatic language recognition and syntax highlighting
+for a huge number of programming languages (about 110, I think).
+
+
+ I've put the SourceView functions into a plugin. This loads the additional required shared library and the links to the functions contained in that library.
+You only need to include the GtkSourceView.plugin when you want to use this
+editor widget.
+
+
+A set of syntax files for Euphoria 4.0 by Mario Steele can be found in /demos/resources/gedit-syntax.
+Just copy them as instructed in the README.
+
+
+ One reason for making this a plugin is that some installations don't automatically
+include the GtkSourceView library. Making the sourceview code an integral part of GtkEngine.e would cause
+problems if the sourceview library could not be found. A second reason; having it separate makes it easier for me to continue adding sourceview functions. Currently only a few are implemented, but it is useful nevertheless. I use it to edit these web pages and my demo programs. See test201 ).
+
+
+ To Do: implement code completion and search functions
+
+
+
+
+
+
+ Webkit demo
+
+
+WebKit
+
+ EuGTK also includes a WebKit plugin ,
+which allows you to incorporate a web browser widget into your program.
+You are free to implement - in Euphoria! - features that may
+not even be available on Firefox™ or Chrome™!
+
+
+
+The WebKit plugin includes a pop-up Web Inspector, similar to that in
+Firefox™ and Chrome™.
+
+
+Like the SourceView, this plugin is still under development, but is quite usable already.
+See examples/webkit.ex
+
+
+
+ To Do: implement security and script-running features
+
+
+
+
+
+
+ Broadway Server
+
+
+
+
+ EuGTK running on Broadway server in Firefox™ browser window
+
+
+
+
+With the latest versions of GTK, you can specify the Broadway server
+(broadwayd) to run your EuGTK programs, and view them on
+any connected device which has an up-to-date HTML5 web browser such as Firefox™. Neither Euphoria nor EuGTK are required on the client!
+
+
+
+The Broadway server that comes with Mint 18 works GREAT!. Over 95% of the 200+ demos work
+with Firefox 47.0, and most of those that fail could probably could be modified to work.
+
+
+I have had as many as 50 EuGTK programs running simultaneously in
+a single Firefox browser window, while only using about 50% CPU.
+
+
+
+ BEAR
+
+
+
+
+ The BEAR
+
+
+
+That's an acronym for a small program, a little over 800 lines of code, which took a couple of days
+to write and test.
+
+
+Since it's written in Euphoria, the single source code file is only 21.5k in length,
+
The BEAR has already been used extensively to edit these doc pages. If you look at the raw
+html, you'll see how much cleaner
+it is now than before :)
+
+
+Encorporating a full-fledged web browser widget similar to Firefox™, and a source-code
+ editor which can recognize and colorize over 100 programming languages, this allows me to
+ browse and edit html pages, and if those pages contain links to source code, display and
+ edit the source. If the source is Euphoria, you can also test run the program!
+ (Other languages could easily be added.)
+
+
+
+The web browser panel has buttons to zoom in / out, and the editor panel
+has selectable fonts, optional line numbers and the ability to make visible
+"white space" characters, such as spaces and tabs.
+
+
+
+
+When html pages are edited, the Web view is refreshed whenever the editor
+Save button is clicked, so that changes are instantly visible.
+
+
+
+Modified source code is saved to temp files for the test run.
+Your BEAR preferences are stored in a hidden file:
+.bear.ini located in your $HOME directory.
+
+
+The BEAR requires the latest versions of both libgtksourceview-3 and libwebkit2gtk-3.
+
+
+ Compared to C
+
+
+Below is a simple "Hello World!" program written in C, taken from the GTK docs
+(with comments removed). Following that is the same program written in EuGTK.
+
+
+
+
+
+ C Code
+
+
+
+
+
+
+
+
+#include <gtk/gtk.h>
+
+static void
+print_hello (GtkWidget *widget,
+ gpointer data)
+{
+ g_print ("Hello World\n");
+}
+
+static gboolean
+on_delete_event (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer data)
+{
+ g_print ("delete event occurred\n");
+ return TRUE;
+}
+
+int
+main (int argc,
+ char *argv[])
+{
+ GtkWidget *window;
+ GtkWidget *button;
+
+ gtk_init (&argc, &argv);
+
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_title (GTK_WINDOW (window), "Hello");
+ g_signal_connect (window, "delete-event", G_CALLBACK (on_delete_event), NULL);
+ g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
+ gtk_container_set_border_width (GTK_CONTAINER (window), 10);
+ button = gtk_button_new_with_label ("Hello World");
+ g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
+ g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
+ gtk_container_add (GTK_CONTAINER (window), button);
+ gtk_widget_show (button);
+ gtk_widget_show (window);
+ gtk_main ();
+
+ return 0;
+}
+
+
+
+
+
+Euphoria
+
+
+
+
+-----------------------------------------------------------------
+-- Purpose:
+-- Show a window with a button; when the button is clicked,
+-- print "Hello World" on the terminal, then exit.
+---------------------------------------------------------------------
+
+include GtkEngine.e
+
+constant window = create (GtkWindow,
+ {"title" ,"Hello" },
+ {"border width" ,10 },
+ {"connect" ,"destroy" ,"Quit" },
+ {"connect" ,"delete-event" ,"on_delete_event" }})
+
+constant button = create(GtkButton,
+ {"label" ,"Hello World" },
+ {"connect" ,"clicked" ,"print_hello" },
+ {"connect" ,"clicked" ,destroy ,window}})
+ add (window,button)
+
+show_all (window)
+main ()
+
+global function print_hello()
+ puts (1,"Hello World\n" )
+ return FALSE
+end function
+
+global function on_delete_event()
+ puts (1,"delete event occurred\n" )
+ return FALSE
+end function
+
+
+
+
+
+
+
+Now you know why C programmers grow bald at an earlier age than others.
+
+
+Even with this simple program, you can see the difference. As C programs grow larger,
+they become increasingly littered with type-casts, pointer references, etc.,
+while the Euphoria code remains shorter and much more readable.
+
+
+For example, compare the following two equivalent lines of code:
+
+ gtk_window_ set_title (GTK_WINDOW ( window ) , "Hello"); /* C */
+ set (window ,"title","Hello" ) -- Euphoria
+
+The code shown in blue is required because C is not object-oriented, so you must specify the correct routine to be
+called, and must tell C what type of object the window variable is. EuGTK tracks objects as they are
+created, so it knows which routine to call, and what type of object it is dealing with without
+the programmer having to specify each time.
+
+
+
+Or to put it another way, the C code is full of distracting 'noise', while Euphoria is cleaner and quieter. Other than that,
+the program structure is in other respects pretty similar, so that you can port a C or Python program to Eu in many cases without
+much difficulty. I've done just that for many of the test programs in this package.
+
+
+
+ Recent Changes
+
+
+4.11.5 : To make space for new openGL graphics, the seldom-used Pango text and Cairo drawing functions have been moved to their own include:
+GtkCairo.e. If your program uses Cairo graphics or PangoFont calls, the only change needed in your source code is to include GtkCairo.e following GtkEngine.e. See test60 for example.
+
+
+
+ Wee Help Mod
+
+To add [F1] pop-up html help for
+Gtk widgets, as well as Euphoria keywords,
+make the change shown below to wee.exw:
+global procedure context_help()
+ sequence text, decls, word, name_space, path
+ integer pos, junk
+ object help
+
+ text = get_edit_text()
+ pos = get_pos()
+ word = word_pos(text, pos)
+ if length (word) < 2 then
+ name_space = ""
+ word = ""
+ else
+ name_space = word[2]
+ word = word[1]
+ end if
+
+-- add the following 4 lines to add pop-up GTK help:
+ if match ("Gtk",word) = 1 then
+ ui_show_uri("FILE://" & canonical_path(sprintf ("~/gtk3/%s.html" ,{word})))
+ return
+ end if
+ -- my GTK docs are in a gtk3 folder in my home directory
+ -- adjust as necessary for your setup.
+
+
+
+
+ Tested Platforms:
+
+
+
+
+
+ Tested with
+
+
+ Euphoria
+ GTK
+ Distro
+ Arch
+ Platform
+
+
+
+
+
+
+ 4.0.4 3.0.8 Ultimated Edition 3.0 32-bit
+ AMD Athlon II X2 220 processor, 2800mhz, 4gig
+
+ 4.0.5 3.0.8 Ultimated Edition 3.0 32-bit
+ AMD Athlon 64x2 processor, 1000mhz, 873meg
+
+
+ 4.0.5 3.2.0 Mint 12 * 32-bit
+ Pentium M processor, 1500 mhz. 487 megs
+
+
+ 4.1.0 3.0.8 Mint 11 32-bit
+ Pentium M processor 1.5ghz, 512meg
+
+
+
+ 4.1.0 3.4.1 Luninux (Ubuntu 12.04) 64-bit
+ AMD Athlon II X2 220 processor, 2800mhz, 4gig
+
+
+
+ 4.1.0 3.4.2 Mint 13 * 64-bit
+
+
+
+ 4.1.0 3.6.0 Mint 14 * 64-bit
+
+
+
+ 4.1.0 3.6.2 Manjaro xfce 0.8.3-x86-64 * 64-bit
+
+
+
+ 4.1.0 3.6.4 Mint 15 Mate * 64-bit
+
+
+
+ 4.1.0 3.8.4, Mint 16 Cinnamon * 64-bit
+
+
+
+ No longer testing on older platforms listed above.
+ Above, 14-year-old laptops
+
+
+
+ 4.1.0 rev. 4467, 3.10.6 Parsix 4.0 (Gloria) * 64-bit
+ Intel Core 2 Quad CPU 2.33 ghz 8 gig
+
+
+
+ 4.1.0 rev. 5783 3.8.4 Mint 16 * 64-bit
+
+
+
+ 4.1.0 3.10.2 SalentOS (Ubuntu 14.04) * 64-bit
+
+
+
+ 4.1.0 rev. 6238 3.10.8 Mint 17 Cinnamon * 64-bit
+
+
+
+ 4.1.0 3.10.8 Mint 17 Mate * 64-bit
+
+
+
+ 4.1.0 3.14.7 Ubuntu Vivid 3.18.0-9-generic * 64-bit
+
+
+
+ 4.1.0 3.6.4 Windows 7 64-bit
+
+
+
+ 4.1.0 b2 3.10.8 Mint 17 * 64-bit
+
+
+
+ 4.1.0 b2 3.14 Ubuntu Vivid 64-bit
+
+
+
+ 4.1.0 development 3.16.6 Ubuntu MATE 15.10 * 64-bit
+
+
+
+ 4.1.0 rev. 6318 3.16.6 Mint 17 * works fine! 64-bit
+
+
+
+ 4.1.0 rev. 6318 3.18.9 Ubuntu 16 * has a few bugs 64-bit
+
+
+
+ 4.1.0 rev. 6318 3.18.9 Mint 18 * 64-bit
+
+
+
+ 4.1.0 rev. 6318 3.20.2 Windows™ 7 64-bit
+
+
+
+
+ * Best results
+
+
+
+
+
+
+
+
+
+
+ History
+
+
+
+EuGTK 4.6.7 Added GtkPrinter.e, an engine to handle most common printing tasks!
+
+
+
+EuGTK 4.6.9 Modified Kenneth Rhodes' gneui.ex to parse ex.err and position Geany editor at error position.
+
+
+
+EuGTK 4.7.0 Complete re-write to make the code cleaner and hopefully faster!
+
+
+EuGTK 4.7.5 Major code cleanup, new features, improved documentation, more demos!
+
+
+EuGTK 4.7.6 Updated GtkPrinter.e and documentation.
+
+
+
+EuGTK 4.8.0 Update for new GTK versions and bug-fix
+
+
+
+EuGTK 4.8.1 Changes and tests to work with GTK 3.10+
+
+
+EuGTK 4.8.6 Improved ListView functions & documentation, new button and menu options.
+
+
+
+EuGTK 4.8.7 Improved Glade compatibility, added new Glade demos.
+
+
+
+EuGTK 4.8.9 Implemented Glade namespacing, new button images
+
+
+
+EuGTK 4.9.0 Windows 7™, 64-bit tests run 85% successfully! OS X™ also reported to work.
+
+
+
+EuGTK 4.9.5 Updated GtkSettings.e, added plugin capability.
+
+
+
+EuGTK 4.9.8 Bug fixes, inproved Windows™ compatibility.
+
+
+
+EuGTK 4.9.9 Broadway server - run EuGTK programs over network! No Euphoria or GTK required on clients!
+
+
+
+EuGTK 4.10.0 Added convenient functions to save control values and states to a
+config or ini type file.
+
+
+EuGTK 4.10.1 Added demos of GtkSourceView and GtkWebKit plugins.
+
+
+
+EuGTK 4.11.0 Updated demos and documentation. Tested new GTK 3.16 widgets and functions.
+
+
+EuGTK 4.11.2 Added plug/socket demo, updated plug-ins, improved GtkPrinter, fixed some memory leaks.
+
+
+
+EuGTK 4.11.4 Fixed most (hopefully, all) memory leaks, added SourceView functions.
+
+
+
+EuGTK 4.11.5 Moved Cairo functions to a separate include; graphics will use GtkGLArea in the future.
+
+
+
+EuGTK 4.11.6 Updated numerous programs & documentation, added new browser program and BEAR.ex
+
+
+
+EuGTK 4.11.7 Improved httpd.ex and webserver.ex; colorized documentation sourcecode; debugged the BEAR :)
+
+
+
+EuGTK 4.11.8 Improved httpd.ex, added GTK 3.21 functions
+
+
+
+EuGTK 4.11.9 Debugged and tested on Windows 7™; about 80% working.
+
+
+
+EuGTK 4.11.10 Windows™ debugging, improved stability of the BEAR.
+
+
+
+EuGTK 4.11.11 Broadway server works with 90% of demos! (Mint 18); more stable BEAR!
+
+
+
+EuGTK 4.12.0 95% of demos run on Windows 7, added style chooser to SourceView editor.
+
+
+
+
+ Disclaimer
+
+
+
+With the many different options available, I cannot guarantee that everything
+will work 'just fine' everywhere. Different platforms, window managers,
+themes, and unpredictable user-settings make this impossible.
+If you want to be sure your program will work
+on a given computer, send me your program and the computer, I'll be glad to test it,
+providing I can keep the computer afterward :)
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eugtk/examples/documentation/ServerHelp.html b/eugtk/examples/documentation/ServerHelp.html
new file mode 100644
index 0000000..9c77b58
--- /dev/null
+++ b/eugtk/examples/documentation/ServerHelp.html
@@ -0,0 +1,184 @@
+
+
+
+
+ Eu Server
+
+
+
+
+
+
+
+
+
+
+ EuGTK 4.12.0
+
+ Euphoria Web Server
+ version 1.1
+
+
+
+Quick Links
+ Options
+ Screenshots
+
+
+
+Other Files
+ Readme First
+ How EuGTK Works
+ Dialogs
+ Printing
+ Markup
+ TreeViews
+ Alphabetical Guide
+ Quick Function List
+ Glade GUI Builder
+ Platforms
+
+
+
+
+This uses a heavily modified httpd.ex (from the Eu demos) to serve up files over the local network.
+
+
+
+Apache would work, but who wants to deal with all that arcane stuff?, Besides,
+I'd still have to write cgi code to display the pages... so why go thru all that
+just to share some files?
+This solution is much simpler, and is written in Euphoria, so you can modify it as you wish!
+
+
+
+Httpd.ex can work from a command line - just issue
+ %> eui httpd to see the options. When running from the command line, you'll need to enter
+your server's IP address (use ifconfig to get that), and port, perhaps 8080, and the root (starting directory).
+
+
+
+You can run more than one server at a time, just use a different port for each. For example,
+set the root for port 8081 to your Music/Blues folder, and the root for port 8082 to your
+Music/Opera folder - that way, listeners won't have to wade thru albums they may be allergic to:)
+
+
+
+To make the server easier to use, I've added the EuGTK GUI shown above, which lets you select some options, and then starts the server running in the background
+ when you click the OK button. Once it's running, you just enter the IP address and port in your tablet or phone's
+browser address bar to connect. e.g: 192.168.1.100:8080
+
+
+
+ httpd.ex
+
+ -help displays Usage
+ -bind required ip_address:port, e.g. 192.168.1.100:8080
+ -root required e.g. /home/irv/demos/documentation
+ -log optional, name of log file
+ -h optional, show hidden files in directory listing
+ -s optional, sort directory listings
+ -r optional, include full request and response in log
+ -t optional, number of tries to obtain port before giving up
+
+
+ webserver.ex
+
+ IP :
+ Your network address, or 127.0.0.1 (a.k.a. localhost) if not networked.
+ This should be filled in automatically. If it's wrong, use ifconfig
+ to get the inet addr of your computer.
+
+
+ Port :
+ use 8080, 8081, etc. -- Avoid port 80
+
+
+ Root :
+ Starting (root) directory to serve up. Set this to your Music directory or a mounted music CD.
+ Also, try your Pictures directory, Demos, etc...
+ I have tried to make it difficult to browse 'off-limits',
+ i.e: into files or folders which are not in or subfolders of doc_root.
+ You may have better ideas than I do on this topic. Please contribute!
+
+
+ Log file :
+ Name of a file to write transactions to. A new log file will be created if necessary.
+ You should delete it when no longer needed, since it continues to grow...
+ I suggest you make the log file a hidden file, so it won't show in normal directory listings.
+ Log entries will have date and time, client IP, plus name of file requested.
+
+
+ Tail -f :
+ If checked, opens a terminal which follows the log file.
+ With mate-terminal, which I use, this opens a single terminal with two tabs,
+ one for the web server messages, and another for following the log file.
+ You may need to modify the routine at the top of webserver.ex which chooses a terminal,
+ depending upon what terminal programs you have available.
+ If, like mate-terminal, your term has different profiles, it will be helpful to create
+ a new profile named 'logview' with different colors, a tiny font size, etc.
+ for most convenient viewing of the log output.
+ This is how I get the nice transparent log view shown in the screenshot at top.
+
+
+ Sort :
+ If checked, sort the file listing.
+
+
+ Show Full Request
+ Adds the full request string to the server log. This includes info on the browser doing the request.
+ This info might be used to create and return different results depending upon whether the browser was
+ running on a computer, or perhaps a cell phone.
+
+
+ Show Hidden :
+ If checked, show hidden files along with others in the directory listing
+
+
+
+
+
+
+
+
+
+The appearance of the page is controlled by a file named .httpd.css, if it exists in the
+currently-browsed folder. This is done so that directory
+listings from different folders can have their own individual appearances (see screenshot above).
+If no .httpd.css exists in a given folder, defaults built into
+httpd.ex will be used.
+
+
+
+
+Above, webserver.ex serving a specified file as entered on the address bar, or by clicking on a link in a previous page.
+
+
+
+After closing the server, or a crash, it may take several seconds to minutes for your computer to
+free the port you've used. Trying to run again too soon using the same port will result in an error (-2).
+I have included a loop which will retry up to 20 times (unless overridden by the -t option), and then abort. If this happens, and you are running from the GUI, you can try hitting the OK button again. It may take
+several tries, or you may have to shut down the port manually from a terminal.
+
+
+
+
+
+
+
+
+
+
diff --git a/eugtk/examples/documentation/StartingGlade.html b/eugtk/examples/documentation/StartingGlade.html
new file mode 100644
index 0000000..bafddd8
--- /dev/null
+++ b/eugtk/examples/documentation/StartingGlade.html
@@ -0,0 +1,271 @@
+
+
+
+
+ Starting Glade Chap. 1
+
+
+
+
+
+
+
+Using Glade 1
+
+
+Getting Started
+Step 1 - Design a Window
+
+
+ Open Glade, and create a new file
+ (File/New menu item)
+
+
+
+Click on the Window icon
+ (leftmost item under the Toplevels tab)
+
+ This will add a main window to your glade program.
+ It will be named window1 .
+
+
+Next, click on the Common tab in the Window Properties pane
+ (lower right) and scroll down a bit to the Widget Flags section.
+
+
+Check the Visible checkbox.
+ If you don't make the main window visible,
+ how are you going to be able to tell if your program
+ is running? :)
+
+
+Save it with the extension .glade, e.g. test1.glade
+
+
+
+
+This will produce a .glade xml file which describes the interface.
+
+
+
+You don't need to be concerned with this xml, there's no need even
+to look at it, much less edit it. The sample below is provided just
+to satisfy your curiosity:
+
+
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <object class="GtkWindow" id="window1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">Glade Test 1</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+</interface>
+
+Step 2 - Link to Euphoria
+
+Create a Euphoria program to load and run the .xml you just created:
+
+include GtkEngine.e
+
+add (builder,"~/demos/examples/glade/test1.glade" )
+
+main ()
+
+
+
+Save this as test1.ex . If you keep the names the same, it will be less confusing.
+
+
+Step 3 - Test Run
+
+
+You will always run from an x-terminal (mate-terminal, etc) until your program is completely finished. There is no way around this if you ever expect to get it completely debugged.
+
+
+Run the program:
+
+$> eui test1
+
+
+
+
+
+
+
+
+
+Step 4 - Adding Widgets
+
+
+ Add a container for a menu and button to your window
+
+ Go back to Glade, and select a container.
+ Box will do nicely
+ (see in screenshot above)
+
+
+ Drag and drop it into the window
+ (accept the default number of items, and click Create)
+
+
+
+ Add a standard menu to your window
+
+ Click on File
+ (in the little 3-sided box under Containers, also)
+
+
+ Drop it into the top panel in the window.
+
+
+ Add a Quit button to your window
+
+ Click on the OK button
+ (under the Control and Display tab)
+
+
+ Drop that into the bottom panel of the window.
+
+ Click on the actual button (in the window) to select it.
+
+ Select the General tab under Button properties
+ (lower right pane)
+
+
+ Scroll down to the Button Content section, click Stock Button, and from the combo box select Quit (scroll down the list)
+
+
+ Click on the Signals tab in the Button properties pane.
+
+ Select the clicked signal]
+ where it says <Type here>, enter Quit -- no quotes please
+
+
+ Be sure to hit enter or click on something else
+ (so that your typed entry will be saved. -- this is a quirk of Glade )
+
+
+
+ Save your work
+
+ Ctl-s, File/Save, or click on the "save the current project" toolbar icon.
+
+
+
+
+
+
+
+
+
+You'll now have a window with a fairly complete menu and a functioning Quit button.
+
+
+
+But wait! The button works, but the File/Quit menu item doesn't!
+
+
+
+Let's fix that:
+
+ In Glade, click on the File menu item on your new window
+
+ (not the Glade File menu, your new menu)
+
+
+
+ This will select menuitem1 in the upper right Glade pane
+ Click the arrow to open the submenu (menu1)
+ Click its arrow to expand the actual menu items
+ Select imagemenuitem5
+ (That will be your File/Quit menu item.)
+
+
+
+
+
+ From the Menu Item Properties pane (lower right) select the Signals tab.
+ Select the activate signal, and as you did with the Quit button, type in Quit.
+
+
+
+
+Now your File menu Quit option will...erm.. quit.
+
+
+
+Step 5 - Connecting Euphoria Functions
+
+Let's add some actual Euphoria code next. Follow the steps directly above, but this time click on
+the Help menu item, and expand the list so that you can select imagemenuitem10 (Help/About).
+
+ In the Signals tab, select activate and type in help_me (again, no quotes, hit enter)
+ Save your work, and run the program again.
+
+
+In your terminal you should see something like:
+
+
+
+-----------------------------------------------
+-- Undeclared function in test1.glade
+-----------------------------------------------
+
+---------------------------
+global function help_me()
+---------------------------
+
+return 1
+end function
+
+
+
+
+What to do? Copy the function prototype and paste it into your Euphoria program.
+Then edit it to look like the one below:
+
+
+ --------------------------
+ global function help_me()
+ --------------------------
+ Info (,,"About","My fine program!" )
+ return 1
+ end function
+
+
+
+Run it again, and click on the Help/About menu item. Note that your program is still only
+7 lines of code.
+
+
+
+
+
+
+On to topic two
+
+
+
+
+
+
+
+
diff --git a/eugtk/examples/documentation/StartingGlade2.html b/eugtk/examples/documentation/StartingGlade2.html
new file mode 100644
index 0000000..affe23d
--- /dev/null
+++ b/eugtk/examples/documentation/StartingGlade2.html
@@ -0,0 +1,208 @@
+
+
+
+
+ Starting Glade - Chap. 2
+
+
+
+
+
+Using Glade
+
+
+
+Linking more functions
+Opening a file
+
+
+Use Glade to select the File/Open menu item, which will be named imagemenuitem2
+(note that you are free to change the name of any item by typing the new name
+into the ID: entry on the General tab for that item.
+
+
+
+Let's do so, and change this to the more meaningful name: file_open
+(as usual, no quotes).
+
+
+
+Now select the Signals tab, and set the activate handler to be open_file
+(ok, so I'm not being very original, too bad :p)
+
+
+Click the Save the Current Project toolbutton, and run your program again.
+In your terminal you should see something resembling:
+
+-------------------------------------------------
+-- Undeclared function in test1.glade
+-------------------------------------------------
+
+------------------------------
+global function open_file()
+------------------------------
+
+return 1
+end function
+
+
+
+You should have expected that. Copy this template, paste it into your Eu program,
+and fill in the blank.
+
+
+For this program, you'll also have to
+add include GtkFileSelector.e to your program.
+
+
+
+include GtkEngine.e
+include GtkFileSelector.e
+
+add (builder,"~/demos/examples/glade/test1.glade" )
+
+main ()
+
+---------------------------
+global function help_me()
+---------------------------
+return Info (,,"About","My fine program!" )
+end function
+
+----------------------------
+global function open_file()
+----------------------------
+object fname = fileselector:Open("*.ex" )
+if sequence (fname) then
+ Info (,,"You Selected" ,fname)
+end if
+return 1
+end function
+
+
+
+
+Click on a file, and you should see the filename displayed in
+a neat pop-up box.
+
+
+
+
+
+Adding Widgets
+Containers
+
+
+If you recall, the original Box we added as the first item in our window had
+3 'divisions'. We filled the first (top) with a menu, and the 3rd (bottom) with
+a button. The middle one was left empty, and so it doesn't show at all.
+
+
+Let's add some things to the middle.
+We can't put more than one item in there; try it, you'll see.
+
+
+
+We'll need a container if we want more than one thing there, so choose another
+Box ,
+drop it into the empty middle space, change number of items to 2, and click create.
+The default orientation is vertical, which won't do for this particular demo, so change it
+to horizontal.
+
+
+
+Into the left-hand panel of the Box we just added, drop an image container. It's the little house with the yellow roof in the Control and Display section of the left-hand toolbar.
+
+
+
+In the right-hand panel, drop a label container. It's also in the Control and Display section. Under Appearance/Label: type in some text. Use markup if you like, and click the Use Markup checkbox.
+Save your work, you should do this frequently.
+
+
+
+
+
+What about the image?
+We'll need to pick one, so click on the little missing image
+icon on your program's window, and choose one of the following:
+
+ A stock id from the drop-down combo
+ An icon nameface-cool, for example
+ A file
+ Choose one from the file selector on the right.
+ (You'll find that if you use an image loaded from a file,
+ the image must be in the same folder as your program,
+ otherwise it's difficult, but not impossible,
+for your program to find it at runtime.)
+
+
+
+
+
+
+Run the program again, and note that no changes or additions or adjustments were required to the 12 lines of Euphoria source code.
+
+
+
+
+
+
+
+Suppose we want an image more pleasing than the one above?
+Just change the open_file function a bit:
+
+
+
+
-----------------------------
+ global function open_file()
+ -----------------------------
+ fileselector:filters = {"image" }
+ object newfile = fileselector:Open ("*" )
+ if sequence (newfile) then
+ set ("image1","from file" ,newfile)
+ end if
+ return 1
+ end function
+
+
+
+
+Just click on the image you prefer. I like this one!
+
+
+
+In Conclusion
+Chapters 3...99
+
+
+Building more complex objects such as TreeViews, ListViews, etc. with Glade will involve some experimenting.
+Explaining these in detail (using words) would require a whole book, which, like most such
+books, would cost $99.00 plus tax, and would bore you half to death.
+
+
+
+So, if you really feel that you can't handle it on your own from here, start saving your $99.00 (plus tax) for the book. You might have a long wait.
+
+
+But frankly, Glade doesn't save any time when creating these objects, since the process is somewhat tedious. You can achieve the same outcome by writing just a few
+lines of code with an ordinary text editor, cutting and pasting from demo programs where applicable. Try it - this isn't rocket science!
+
+
+
+
+
+
+
+
diff --git a/eugtk/examples/documentation/bear.html b/eugtk/examples/documentation/bear.html
new file mode 100644
index 0000000..4794b43
--- /dev/null
+++ b/eugtk/examples/documentation/bear.html
@@ -0,0 +1,153 @@
+
+
+
+ Bear Docs
+
+
+
+
+
+
+
The Bear Help file
+
+
+
+
+
+
+ The BEAR can even view Bear videos!
+
+
+
+
+
+
+Browser Controls
+
+
+
+To open a page from the web, click the Network button. A dialog box
+will appear for you to type in a web address: http://OpenEuphoria.org,
+for example. This button will be disabled if you are not on a network.
+
+
+To open a local file (.html or otherwise), click the Local button. In most cases,
+the file type will be automatically recognized and placed into the appropriate
+window.
+
+
+
+
+
+
+The sourcecode editor does not automatically 'track' the
+current web page being viewed. If you want to edit the current web page
+.html, you must click on the Edit button in the Browser toolbar!
+
+
+
+
+Source Controls
+
+
+
+
+Click New or Open to create or edit a text file (Euphoria source code, for example).
+If the file extension is .ex, then the Execute button in the Source toolbar
+will be enabled; clicking on it will run a temporary copy of the program in the Source pane.
+If you are satisfied with the way the temporary copy ran, just click on the Save or SaveAs buttons
+to write the updated code to disk.
+
+
+
+
+
+The Execute button will be disabled if the code being edited is not
+a Euphoria program, but the Save and SaveAs buttons will function to save
+text, including .html that you may have modified. If the file is .html, then
+the WebView will be reloaded to show the updated web page.
+
+
+
+
Preferences
+
+Options for the source code editor are:
+
+ Set Editor Font (only monospace fonts are shown in the
+font dialog, since this is primarily for editing source and html
+code)
+ Use Line Numbers
+ Spaces and TabsMake whitespace characters visible
+
+
+
+
+
+
+Navigating
+
+In order to more easily edit html source code, you can highlight
+words or a phrase in the web view, and select 'copy' from the pop-up menu.
+Then click on the Find button in the Web Page control panel.
+This will try to scroll the editor
+pane to find the matching word(s).
+
+
+Avoid clicking on text that
+includes markup, such as italics or bold , as those won't match a text search.
+Neither will markup items such as & < >, etc.,
+or hidden markup such as links.
+
+
+This scheme doesn't always work perfectly,
+(sometimes not at all, try clicking on the find button again),
+but it's certainly
+better than nothing! If you know of a better way, please let me know!
+
+
+
+
+
+