dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
-AC_INIT([roobuilder], [4.1.0])
+AC_INIT([roobuilder], [4.2.0])
AC_CONFIG_HEADERS([config.h])
dnl and it breaks the build...
PKG_CHECK_MODULES(ROOBUILDER, [ zlib
- clutter-gtk-1.0
glib-2.0 >= 2.24.1
gobject-2.0 >= 2.24.1
gtk+-3.0 >= 3.11.3
88238e82d4463bf68c314510ad98782d ./Makefile.in
d41d8cd98f00b204e9800998ecf8427e ./ChangeLog
dc2a3bd2e90ea29308069119e150d84c ./src/c/jscore_object_call_as_function.c
-2c88d5ad89ce40f359e8414bfd040e45 ./src/Main.vala
-a870dfb3559edf675a9808767d728eef ./src/Builder4/WindowRooView.bjs
+411a6b6f153252fbe1f466afc56939a5 ./src/Main.vala
+bed964c85ee09d151a155f6f0786866c ./src/Builder4/WindowRooView.bjs
9ab1eabf13565763ada54b9a7f0b5912 ./src/Builder4/DialogTemplateSelect.bjs
70800a190a8949d7e047426fdd369747 ./src/Builder4/ProjectSettings.bjs
254a8daff9072d59e32f03113d02e429 ./src/Builder4/DialogTemplateSelect.vala
-c5ef3fde1b376ea73b1006e3d669edb7 ./src/Builder4/ClutterFiles.bjs
+036e1ed256d59ac4d00062792553104f ./src/Builder4/ClutterFiles.bjs
07e060efc0b049e5c87f527f1c959711 ./src/Builder4/RooProjectSettings.bjs
-e09dd27e29d115acecd768c13efc7633 ./src/Builder4/WindowLeftProjects.vala
+ccee29424717d9e0e71cc5761998a58e ./src/Builder4/PopoverEditor.bjs
+cb80babd335d4a99a5f68c2361d89a3c ./src/Builder4/WindowLeftProjects.vala
+27e94923ecac2024343742049b17d262 ./src/Builder4/WindowLeftProjects.c
edc8430ca864508d07046aa44624ab22 ./src/Builder4/ProjectSettings.c
de51165527299a2c386ca4da85454b05 ./src/Builder4/ValaCompileErrors.bjs
+82457c9080d838675a3f463ad406edcd ./src/Builder4/WindowAddProp.c
b4637d799b5e74ac3688fdaac268c8cd ./src/Builder4/ValaCompileResults.bjs
-1d128dabad4f8209a942362d905e0372 ./src/Builder4/WindowLeftTree.bjs
+5b05b95fb4701d39c5dd380d598aef0d ./src/Builder4/WindowLeftTree.bjs
4b3ca347619a75423add229246d6934b ./src/Builder4/ValaProjectSettings.c
-0bc9d997eb1a281f42785b779ff7162d ./src/Builder4/GtkView.bjs
+cff637f595df62fede93be97242156df ./src/Builder4/GtkView.bjs
4f146ffda5805206cf3fc30c41c9bb24 ./src/Builder4/DialogSaveTemplate.bjs
01f94aae4ea0d5d9b6b56f34fa5f79f4 ./src/Builder4/DialogConfirm.vala
2ce7c191c666149680726970ebfdd655 ./src/Builder4/PopoverProperty.vala
-a927514d7a5725861a523749559447a2 ./src/Builder4/MainWindow.vala
-9005b8b5550eeff5287f8d95cd54a030 ./src/Builder4/Editor.bjs
-d6f4ffc749087a615b6084cefeaf0987 ./src/Builder4/PopoverFileDetails.bjs
+44d1f627d432e8c4f39f6bf6e4846bcd ./src/Builder4/MainWindow.vala
+e82c8f07e1f2e06220f571070f0e877c ./src/Builder4/Editor.bjs
+dc38c277643b61d7cd4d0be53dc9d878 ./src/Builder4/PopoverAddObject.vala
+c5b1f40c154dbe7b6cd8e66f809c2a70 ./src/Builder4/PopoverFileDetails.bjs
c9b5314660024b98a92708a49325d0f4 ./src/Builder4/ValaProjectSettings.vala
+2c5a89dca71dc00db12de7d66d845014 ./src/Builder4/PopoverAddObject.bjs
b0b017c153127530146f16d8cf6c1da9 ./src/Builder4/FakeServer.vala
-215dadaf4cf4d649e9010beb4103ab41 ./src/Builder4/Editor.vala
+4b58d99802d7ec3c1f3c8248b555aca5 ./src/Builder4/WindowRightPalete.c
+b6166c62fe472b09fea9b24d1b0074f1 ./src/Builder4/Editor.vala
98410f02491be156d42a51c73b20d849 ./src/Builder4/DialogSaveModule.vala
-1656a9009ddc46e6175159512b9a86fe ./src/Builder4/WindowRightPalete.bjs
+1a92d884098c85e2f96d2a21691086b5 ./src/Builder4/PopoverFiles.bjs
+69840a0e89d8affd86a96e21c94bf783 ./src/Builder4/WindowRightPalete.bjs
1fc179baf6dce16840371f35d4b2f659 ./src/Builder4/EditProject.vala
-3cd8ea2fb7f65354e434b4681d22cf63 ./src/Builder4/WindowRooView.vala
-f97678a1fc03a8f6d3350f4bbf5bbced ./src/Builder4/WindowLeftProjects.bjs
+0e40d48604048974665912a919a1ad22 ./src/Builder4/WindowRooView.vala
+bd95ff872bc3552a40b0a3205ae9d85e ./src/Builder4/WindowLeftProjects.bjs
6278ccc0f64f5c2757895aacda602251 ./src/Builder4/CompileState.vala
-8d3de0f75a2c7a448a1356dce17a8d23 ./src/Builder4/WindowState.vala
+55421262175f8a9807a70bfafb9038a6 ./src/Builder4/WindowState.vala
+a186c7efef54e7e96f2b4488bc63ca49 ./src/Builder4/.deps/ClutterFiles.Po
+dad0227408777290e6c56afc03cf6e12 ./src/Builder4/.deps/WindowRightPalete.Po
+dad0227408777290e6c56afc03cf6e12 ./src/Builder4/.deps/WindowLeftProjects.Po
3240de25cec411f70a664d60a863a5bf ./src/Builder4/.deps/ValaProjectSettings.Po
eac560ca8d937023d780ae709733ee95 ./src/Builder4/.deps/ProjectSettings.Po
9e1a8765021308ba8f73802d9897224d ./src/Builder4/ValaCompileResults.vala
-4f55a16a3c362bf5cb07cca9fe3d07aa ./src/Builder4/About.bjs
+3c1cad3209f7969082713a95e4c10f4a ./src/Builder4/About.bjs
cbbda6c2c27159717513bd3b77066252 ./src/Builder4/DialogSaveTemplate.vala
fd611a15189da35ea6473d62d27ccf89 ./src/Builder4/ValaProjectSettings.bjs
-f91e287023106727e531536b1918ddd5 ./src/Builder4/WindowAddProp.bjs
+0fc9ff3b75b4d5d382666b311ea9df13 ./src/Builder4/WindowAddProp.bjs
+1a56b326a5c38838d23c76f639970fff ./src/Builder4/PopoverEditor.vala
dd2c826f5916481994b8f05060e38561 ./src/Builder4/PopoverFileDetails.vala
1d5c2aaecfb07b255ee7b55bbeb28b94 ./src/Builder4/GladeView.bjs
-dcf242bff22c4c817bc7ee67bd88a1ce ./src/Builder4/PopoverProperty.bjs
+e1e126d97c73742e3825b0c975aaf76c ./src/Builder4/PopoverProperty.bjs
+87c1e9489df82f90048cf97cc3e7f9c9 ./src/Builder4/PopoverAddProp.vala
48da45963803c1c3ac9a3b7b25335ef5 ./src/Builder4/StandardErrorDialog.vala
-654440c2f4e05ed6b4b83860261246ee ./src/Builder4/WindowLeftProps.vala
+dc7e9528040b3bb485f1e9f69df9b5a6 ./src/Builder4/ClutterFiles.c
+bdf3c2fa2f95988a9517ec173b468a7f ./src/Builder4/WindowLeftProps.vala
44a1921066534c10a2aac94e63e1dd1a ./src/Builder4/WindowRightPalete.vala
a6d4c79785530fddc067d050b508c5c6 ./src/Builder4/GladeView.vala
-0aed6f6d1867b8191b565e8fb8d44760 ./src/Builder4/About.vala
+478e895ec4a834ce7c256cf5b5784c9b ./src/Builder4/About.vala
a3102786032699989c21897d8ab47464 ./src/Builder4/ClutterFiles.vala
fb71cc9a6b22c171ea2034fdcf15aa94 ./src/Builder4/WindowAddProp.vala
-d5cacc76623a955e58cc149ae16c92ed ./src/Builder4/MainWindow.bjs
+7664dcb027e58610d5050786c211d605 ./src/Builder4/MainWindow.bjs
+3cd4cf3c0f38460b189c4c874e0a5021 ./src/Builder4/PopoverFiles.vala
1d5825633e811a1dda8727fa2fa5056d ./src/Builder4/EditProject.bjs
-c37d5d443138bd1563e0e698b8610570 ./src/Builder4/WindowLeftProps.bjs
-9273edb5b24f4d231a672609f4d10f72 ./src/Builder4/GtkView.vala
-0f7176a084b7bcb11549068c04180e85 ./src/Builder4/WindowLeftTree.vala
+086b7b5801060e3e4c016022a7a7863b ./src/Builder4/WindowLeftProps.bjs
+ea799b4114f3f078d5fc5b7972f87333 ./src/Builder4/GtkView.vala
+b097cdc837ff7724a1a170e67920bfaa ./src/Builder4/WindowLeftTree.vala
05bcd8817a6e30e5902c651e026e9485 ./src/Builder4/GladeExtras.vala
5cb20f952a96b0162253c5496ed2bc0a ./src/Builder4/DialogConfirm.bjs
f5abeefbed7d8439d841b8eea1098ee0 ./src/Builder4/ValaCompileErrors.vala
372d3a7d2e3792715ab89f2bb3831388 ./src/Builder4/StandardErrorDialog.bjs
05486cb40599ea0075d3dc4e65120e78 ./src/Builder4/ValaProjectSettingsPopover.bjs
-3f7826a3de5f8fb57d36fa042d0ec020 ./src/Builder4/config1.builder
+cc61b99760d88469858401d37c797ac4 ./src/Builder4/config1.builder
c2eb8daa2916479455d30808eedd103e ./src/Builder4/DialogNewComponent.vala
40989c636c2d81e95a9087300a6439f1 ./src/Builder4/DialogNewComponent.bjs
b24d48781f2c87d7e1f2323d18a2b042 ./src/Builder4/ValaProjectSettingsPopover.vala
1f587a243cd750b83a861392add1d4e6 ./src/Builder4/DialogPluginWebkit.bjs
885fc466b28ef592476dc060b0ec8148 ./src/Builder4/ProjectSettings.vala
+dd4d36267dc71900ba0fd97c407887d4 ./src/Builder4/PopoverAddProp.bjs
727ea8f7af68f4dc22aff2a6697250ad ./src/Builder4/RooProjectSettings.vala
898e2fc7aba201e1b3c6c5b3d8e3b7a2 ./src/Builder4/DialogSaveModule.bjs
5b733e38e79a7c9525ac5269225fc9ab ./src/Builder4/DialogPluginWebkit.vala
7b35a871bfb84e6c46b2070249d122ce ./src/Palete/CompletionProvider.vala
9fa897f76b56755cca3e98dbf3530770 ./src/Palete/Flutter.vala
ea0059f1957b5e6b17ca448dad6191c6 ./src/Palete/RooDatabase.vala
-3b69deb58cfb8f0fddb34ccc66efc69a ./src/Palete/VapiParser.vala
+30f1fb4e15bf169cb52092b79c1396c0 ./src/Palete/VapiParser.vala
c6db891ff0e65c05d5959cb082c330b5 ./src/Palete/ValaSource.vala
bc6a13535d1642a67200cbf7e327c15e ./src/Palete/ValaSourceCompiler.vala
-caa831b61659ccfd4db5628015fe12f9 ./src/Palete/Gir.vala
+29711c083c61b3ff5a21cf6dc9b82ad8 ./src/Palete/Gir.vala
b0aed743a03ab341c9ea05c0f6aa2a07 ./src/Palete/Flutter.c
84cd93b853d85de68db59bbdbd9b03ff ./src/Palete/.deps/Flutter.Po
d134216b177ee8b36a9a184617740093 ./src/Palete/Gtk.vala
22231f23ad8545969096d3d88d2caf90 ./src/Resources.vala
3463fa4065b0a0e0d4e1a10a7337ad79 ./src/JsRender/Flutter.vala
c13e885cb9c5d005596d16fba3c47fa8 ./src/JsRender/Lang.vala
-288bd9a3fda1f4200b8a9096bc44dea4 ./src/JsRender/NodeToVala.vala
+452371253a4a802d1e7224d4b473b4c2 ./src/JsRender/NodeToVala.vala
42598d76a0e67353b743eb64e678927f ./src/JsRender/NodeToGlade.vala
cca8742ee92c401d1d773f69cec0310d ./src/JsRender/Flutter.c
795386e67345b780edaa1ee7c6ab76bd ./src/JsRender/.deps/NodeToGlade.Po
66abdb6c4667f431e3b7f402bd78de3b ./src/JsRender/NodeToGlade.c
3b001463dfd5e3a5349c2df61da7e4b7 ./src/JsRender/JsonGen.vala
6b2ee387e2ac8830a2008db930f2cf19 ./src/JsRender/Roo.vala
-5008078b5925d158c146e74ed87862a5 ./src/Makefile.in
+b63e37f0195c1e8032569bfcc5e876dd ./src/Makefile.in
fb95a1ee05ab64c50de5329f58c351e1 ./src/Application.vala
37f5eed98ec91e1f290760bfa4273509 ./src/ccode/valaccodedostatement.vala
87515bca072ccd8e371dab176bc2636a ./src/ccode/valaccodewhilestatement.vala
0b1f00741ade844bb8c4371de08fce26 ./src/ccode/valaccodefunctiondeclarator.vala
7092d3be746731ffe05b0b33be8dac75 ./src/Spawn.vala
700806e5f5f7e6aa79613173c3d57f5d ./src/vapi/webkit2gtk-3.0.vapi
-1352f995b6afaa2b853dc7c0154c7b7a ./src/vapi/disabled/clutter-1.0.vapi
-446a9caaaef7130e2dec0abacc227807 ./src/vapi/disabled/clutter-1.0.deps
659a69a8dee9ae4f08593f514effd91f ./src/vapi/javascriptcore.vapi
747b7b8e9902de789177be05f50c060c ./src/vapi/gladeui-2.0.vapi
68cfd3e90ce15ba9dad4b7b37504f875 ./src/vapi/libgda-5.0.vapi
7c0fd34de7d495cebaee5c7c5e2ed1ac ./src/vapi/libgda-5.0.deps
7c0fd34de7d495cebaee5c7c5e2ed1ac ./src/vapi/libgda-4.0.deps
a7fef8cb9bd957f2b1bb09dd5d6e5251 ./src/vapi/seed.vapi
-ada0cf43b69c40c6a874bbb3566a6aeb ./src/Makefile.am
+683eaa46eca3338a330c3ecc6fc3ca38 ./src/Makefile.am
d743438c4e4b765b7ce4b7e1c98b3b31 ./config.h.in~
-6d400fca1bd4f370a3e45746dfb55679 ./.gitignore
+99edd6b85c3025966d31c083dd4d94b7 ./.gitignore
4d19d0d1522086ac05b136c93e62716a ./README.md
959bffe2993816eb32ec4bc1ec1d5875 ./LICENSE
-3b6594e1e7ee93a742b8efd43b556a3f ./autom4te.cache/requests
-32b972ff7cb98ade71e39f989ced22eb ./autom4te.cache/traces.2
-32b972ff7cb98ade71e39f989ced22eb ./autom4te.cache/traces.1
-717b747bb1ec0f3b15b001921ba25987 ./autom4te.cache/output.1
-f7a5a8347a1d01db5b775d9a35b00974 ./autom4te.cache/output.2
-95e19ac01c304017395b8361d0794200 ./autom4te.cache/traces.0
-717b747bb1ec0f3b15b001921ba25987 ./autom4te.cache/output.0
+5d00c3cc4e311efe51603c477794b930 ./autom4te.cache/requests
+4ab5d64b369bac36c4c5ea81ef5e82f1 ./autom4te.cache/traces.2
+4ab5d64b369bac36c4c5ea81ef5e82f1 ./autom4te.cache/traces.1
+ebdce4485b5f00e0de56dcb6b013f7d9 ./autom4te.cache/output.1
+d5fda530ed7c647cf6bef97166b93fcc ./autom4te.cache/output.2
+3914266c2c3967781639a6c69b429f0b ./autom4te.cache/traces.0
+ebdce4485b5f00e0de56dcb6b013f7d9 ./autom4te.cache/output.0
d32239bcb673463ab874e80d47fae504 ./COPYING
e194375eb17ee97cc2db1c3e680412a3 ./INSTALL.txt
234ae97ddd94d5596656997f26bdd94a ./AUTHORS
f72e9f9fdb220731ee1c3ffe08a536fd ./resources/bootstrap.builder.html
e7e7f422214fb0a99953f132d5b4711e ./resources/bootstrap4.builder.html
bbc8301b56a86029440348e200099c6a ./resources/roo.builder.js
-43132ba4eba80eb9372676e2db556fd4 ./resources/GtkUsage.txt
+e22537f678032101e556465a2c1f168d ./resources/GtkUsage.txt
8dcc309c476908ddf5eb918da5dc693c ./resources/roo.builder.html
-94c371e3148a49216db3b1ea664e178d ./configure.ac
+f35d4655cd7fe49c6e62c668c958f4e2 ./configure.ac
17382ef7b74816c91ee84c6544a6cefc ./tools/flutter_sqlite.php
a04cee5026068c7834e137a397601b7b ./tools/flutter_extract.php
8e994154f15ad797670a43a0d95ec053 ./tools/flutter_nodes.php
8fe4d7396ce59f473126cfaa971bb078 ./pixmaps/16x16/apps/roobuilder.png
93526bdbc7e5a3030f59bc53c8f48030 ./pixmaps/Makefile.am
8fe4d7396ce59f473126cfaa971bb078 ./pixmaps/24x24/apps/roobuilder.png
-7c8c4307dfeebf0ff6dc176647599920 ./configure
+4cc3a90b546664d52b139063fdce815d ./configure
c2562667d7fd74e69b501849575920db ./aclocal.m4
0d3a87501b8bdddc6c10720883d8f0af ./org.roojs.roobuilder.json
5db3cf4d791f482908f0f4a158794ba0 ./notes/flutter.txt
d41d8cd98f00b204e9800998ecf8427e ./ChangeLog
dc2a3bd2e90ea29308069119e150d84c ./src/c/jscore_object_call_as_function.c
-2c88d5ad89ce40f359e8414bfd040e45 ./src/Main.vala
-a870dfb3559edf675a9808767d728eef ./src/Builder4/WindowRooView.bjs
+411a6b6f153252fbe1f466afc56939a5 ./src/Main.vala
+bed964c85ee09d151a155f6f0786866c ./src/Builder4/WindowRooView.bjs
9ab1eabf13565763ada54b9a7f0b5912 ./src/Builder4/DialogTemplateSelect.bjs
70800a190a8949d7e047426fdd369747 ./src/Builder4/ProjectSettings.bjs
254a8daff9072d59e32f03113d02e429 ./src/Builder4/DialogTemplateSelect.vala
-c5ef3fde1b376ea73b1006e3d669edb7 ./src/Builder4/ClutterFiles.bjs
+036e1ed256d59ac4d00062792553104f ./src/Builder4/ClutterFiles.bjs
07e060efc0b049e5c87f527f1c959711 ./src/Builder4/RooProjectSettings.bjs
-e09dd27e29d115acecd768c13efc7633 ./src/Builder4/WindowLeftProjects.vala
+ccee29424717d9e0e71cc5761998a58e ./src/Builder4/PopoverEditor.bjs
+cb80babd335d4a99a5f68c2361d89a3c ./src/Builder4/WindowLeftProjects.vala
+27e94923ecac2024343742049b17d262 ./src/Builder4/WindowLeftProjects.c
edc8430ca864508d07046aa44624ab22 ./src/Builder4/ProjectSettings.c
de51165527299a2c386ca4da85454b05 ./src/Builder4/ValaCompileErrors.bjs
+82457c9080d838675a3f463ad406edcd ./src/Builder4/WindowAddProp.c
b4637d799b5e74ac3688fdaac268c8cd ./src/Builder4/ValaCompileResults.bjs
-1d128dabad4f8209a942362d905e0372 ./src/Builder4/WindowLeftTree.bjs
+5b05b95fb4701d39c5dd380d598aef0d ./src/Builder4/WindowLeftTree.bjs
4b3ca347619a75423add229246d6934b ./src/Builder4/ValaProjectSettings.c
-0bc9d997eb1a281f42785b779ff7162d ./src/Builder4/GtkView.bjs
+cff637f595df62fede93be97242156df ./src/Builder4/GtkView.bjs
4f146ffda5805206cf3fc30c41c9bb24 ./src/Builder4/DialogSaveTemplate.bjs
01f94aae4ea0d5d9b6b56f34fa5f79f4 ./src/Builder4/DialogConfirm.vala
2ce7c191c666149680726970ebfdd655 ./src/Builder4/PopoverProperty.vala
-a927514d7a5725861a523749559447a2 ./src/Builder4/MainWindow.vala
-9005b8b5550eeff5287f8d95cd54a030 ./src/Builder4/Editor.bjs
-d6f4ffc749087a615b6084cefeaf0987 ./src/Builder4/PopoverFileDetails.bjs
+44d1f627d432e8c4f39f6bf6e4846bcd ./src/Builder4/MainWindow.vala
+e82c8f07e1f2e06220f571070f0e877c ./src/Builder4/Editor.bjs
+dc38c277643b61d7cd4d0be53dc9d878 ./src/Builder4/PopoverAddObject.vala
+c5b1f40c154dbe7b6cd8e66f809c2a70 ./src/Builder4/PopoverFileDetails.bjs
c9b5314660024b98a92708a49325d0f4 ./src/Builder4/ValaProjectSettings.vala
+2c5a89dca71dc00db12de7d66d845014 ./src/Builder4/PopoverAddObject.bjs
b0b017c153127530146f16d8cf6c1da9 ./src/Builder4/FakeServer.vala
-215dadaf4cf4d649e9010beb4103ab41 ./src/Builder4/Editor.vala
+4b58d99802d7ec3c1f3c8248b555aca5 ./src/Builder4/WindowRightPalete.c
+b6166c62fe472b09fea9b24d1b0074f1 ./src/Builder4/Editor.vala
98410f02491be156d42a51c73b20d849 ./src/Builder4/DialogSaveModule.vala
-1656a9009ddc46e6175159512b9a86fe ./src/Builder4/WindowRightPalete.bjs
+1a92d884098c85e2f96d2a21691086b5 ./src/Builder4/PopoverFiles.bjs
+69840a0e89d8affd86a96e21c94bf783 ./src/Builder4/WindowRightPalete.bjs
1fc179baf6dce16840371f35d4b2f659 ./src/Builder4/EditProject.vala
-3cd8ea2fb7f65354e434b4681d22cf63 ./src/Builder4/WindowRooView.vala
-f97678a1fc03a8f6d3350f4bbf5bbced ./src/Builder4/WindowLeftProjects.bjs
+0e40d48604048974665912a919a1ad22 ./src/Builder4/WindowRooView.vala
+bd95ff872bc3552a40b0a3205ae9d85e ./src/Builder4/WindowLeftProjects.bjs
6278ccc0f64f5c2757895aacda602251 ./src/Builder4/CompileState.vala
-8d3de0f75a2c7a448a1356dce17a8d23 ./src/Builder4/WindowState.vala
+55421262175f8a9807a70bfafb9038a6 ./src/Builder4/WindowState.vala
+a186c7efef54e7e96f2b4488bc63ca49 ./src/Builder4/.deps/ClutterFiles.Po
+dad0227408777290e6c56afc03cf6e12 ./src/Builder4/.deps/WindowRightPalete.Po
+dad0227408777290e6c56afc03cf6e12 ./src/Builder4/.deps/WindowLeftProjects.Po
3240de25cec411f70a664d60a863a5bf ./src/Builder4/.deps/ValaProjectSettings.Po
eac560ca8d937023d780ae709733ee95 ./src/Builder4/.deps/ProjectSettings.Po
9e1a8765021308ba8f73802d9897224d ./src/Builder4/ValaCompileResults.vala
-4f55a16a3c362bf5cb07cca9fe3d07aa ./src/Builder4/About.bjs
+3c1cad3209f7969082713a95e4c10f4a ./src/Builder4/About.bjs
cbbda6c2c27159717513bd3b77066252 ./src/Builder4/DialogSaveTemplate.vala
fd611a15189da35ea6473d62d27ccf89 ./src/Builder4/ValaProjectSettings.bjs
-f91e287023106727e531536b1918ddd5 ./src/Builder4/WindowAddProp.bjs
+0fc9ff3b75b4d5d382666b311ea9df13 ./src/Builder4/WindowAddProp.bjs
+1a56b326a5c38838d23c76f639970fff ./src/Builder4/PopoverEditor.vala
dd2c826f5916481994b8f05060e38561 ./src/Builder4/PopoverFileDetails.vala
1d5c2aaecfb07b255ee7b55bbeb28b94 ./src/Builder4/GladeView.bjs
-dcf242bff22c4c817bc7ee67bd88a1ce ./src/Builder4/PopoverProperty.bjs
+e1e126d97c73742e3825b0c975aaf76c ./src/Builder4/PopoverProperty.bjs
+87c1e9489df82f90048cf97cc3e7f9c9 ./src/Builder4/PopoverAddProp.vala
48da45963803c1c3ac9a3b7b25335ef5 ./src/Builder4/StandardErrorDialog.vala
-654440c2f4e05ed6b4b83860261246ee ./src/Builder4/WindowLeftProps.vala
+dc7e9528040b3bb485f1e9f69df9b5a6 ./src/Builder4/ClutterFiles.c
+bdf3c2fa2f95988a9517ec173b468a7f ./src/Builder4/WindowLeftProps.vala
44a1921066534c10a2aac94e63e1dd1a ./src/Builder4/WindowRightPalete.vala
a6d4c79785530fddc067d050b508c5c6 ./src/Builder4/GladeView.vala
-0aed6f6d1867b8191b565e8fb8d44760 ./src/Builder4/About.vala
+478e895ec4a834ce7c256cf5b5784c9b ./src/Builder4/About.vala
a3102786032699989c21897d8ab47464 ./src/Builder4/ClutterFiles.vala
fb71cc9a6b22c171ea2034fdcf15aa94 ./src/Builder4/WindowAddProp.vala
-d5cacc76623a955e58cc149ae16c92ed ./src/Builder4/MainWindow.bjs
+7664dcb027e58610d5050786c211d605 ./src/Builder4/MainWindow.bjs
+3cd4cf3c0f38460b189c4c874e0a5021 ./src/Builder4/PopoverFiles.vala
1d5825633e811a1dda8727fa2fa5056d ./src/Builder4/EditProject.bjs
-c37d5d443138bd1563e0e698b8610570 ./src/Builder4/WindowLeftProps.bjs
-9273edb5b24f4d231a672609f4d10f72 ./src/Builder4/GtkView.vala
-0f7176a084b7bcb11549068c04180e85 ./src/Builder4/WindowLeftTree.vala
+086b7b5801060e3e4c016022a7a7863b ./src/Builder4/WindowLeftProps.bjs
+ea799b4114f3f078d5fc5b7972f87333 ./src/Builder4/GtkView.vala
+b097cdc837ff7724a1a170e67920bfaa ./src/Builder4/WindowLeftTree.vala
05bcd8817a6e30e5902c651e026e9485 ./src/Builder4/GladeExtras.vala
5cb20f952a96b0162253c5496ed2bc0a ./src/Builder4/DialogConfirm.bjs
f5abeefbed7d8439d841b8eea1098ee0 ./src/Builder4/ValaCompileErrors.vala
372d3a7d2e3792715ab89f2bb3831388 ./src/Builder4/StandardErrorDialog.bjs
05486cb40599ea0075d3dc4e65120e78 ./src/Builder4/ValaProjectSettingsPopover.bjs
-3f7826a3de5f8fb57d36fa042d0ec020 ./src/Builder4/config1.builder
+cc61b99760d88469858401d37c797ac4 ./src/Builder4/config1.builder
c2eb8daa2916479455d30808eedd103e ./src/Builder4/DialogNewComponent.vala
40989c636c2d81e95a9087300a6439f1 ./src/Builder4/DialogNewComponent.bjs
b24d48781f2c87d7e1f2323d18a2b042 ./src/Builder4/ValaProjectSettingsPopover.vala
1f587a243cd750b83a861392add1d4e6 ./src/Builder4/DialogPluginWebkit.bjs
885fc466b28ef592476dc060b0ec8148 ./src/Builder4/ProjectSettings.vala
+dd4d36267dc71900ba0fd97c407887d4 ./src/Builder4/PopoverAddProp.bjs
727ea8f7af68f4dc22aff2a6697250ad ./src/Builder4/RooProjectSettings.vala
898e2fc7aba201e1b3c6c5b3d8e3b7a2 ./src/Builder4/DialogSaveModule.bjs
5b733e38e79a7c9525ac5269225fc9ab ./src/Builder4/DialogPluginWebkit.vala
7b35a871bfb84e6c46b2070249d122ce ./src/Palete/CompletionProvider.vala
9fa897f76b56755cca3e98dbf3530770 ./src/Palete/Flutter.vala
ea0059f1957b5e6b17ca448dad6191c6 ./src/Palete/RooDatabase.vala
-3b69deb58cfb8f0fddb34ccc66efc69a ./src/Palete/VapiParser.vala
+30f1fb4e15bf169cb52092b79c1396c0 ./src/Palete/VapiParser.vala
c6db891ff0e65c05d5959cb082c330b5 ./src/Palete/ValaSource.vala
bc6a13535d1642a67200cbf7e327c15e ./src/Palete/ValaSourceCompiler.vala
-caa831b61659ccfd4db5628015fe12f9 ./src/Palete/Gir.vala
+29711c083c61b3ff5a21cf6dc9b82ad8 ./src/Palete/Gir.vala
b0aed743a03ab341c9ea05c0f6aa2a07 ./src/Palete/Flutter.c
84cd93b853d85de68db59bbdbd9b03ff ./src/Palete/.deps/Flutter.Po
d134216b177ee8b36a9a184617740093 ./src/Palete/Gtk.vala
22231f23ad8545969096d3d88d2caf90 ./src/Resources.vala
3463fa4065b0a0e0d4e1a10a7337ad79 ./src/JsRender/Flutter.vala
c13e885cb9c5d005596d16fba3c47fa8 ./src/JsRender/Lang.vala
-288bd9a3fda1f4200b8a9096bc44dea4 ./src/JsRender/NodeToVala.vala
+452371253a4a802d1e7224d4b473b4c2 ./src/JsRender/NodeToVala.vala
42598d76a0e67353b743eb64e678927f ./src/JsRender/NodeToGlade.vala
cca8742ee92c401d1d773f69cec0310d ./src/JsRender/Flutter.c
795386e67345b780edaa1ee7c6ab76bd ./src/JsRender/.deps/NodeToGlade.Po
0b1f00741ade844bb8c4371de08fce26 ./src/ccode/valaccodefunctiondeclarator.vala
7092d3be746731ffe05b0b33be8dac75 ./src/Spawn.vala
700806e5f5f7e6aa79613173c3d57f5d ./src/vapi/webkit2gtk-3.0.vapi
-1352f995b6afaa2b853dc7c0154c7b7a ./src/vapi/disabled/clutter-1.0.vapi
-446a9caaaef7130e2dec0abacc227807 ./src/vapi/disabled/clutter-1.0.deps
659a69a8dee9ae4f08593f514effd91f ./src/vapi/javascriptcore.vapi
747b7b8e9902de789177be05f50c060c ./src/vapi/gladeui-2.0.vapi
68cfd3e90ce15ba9dad4b7b37504f875 ./src/vapi/libgda-5.0.vapi
7c0fd34de7d495cebaee5c7c5e2ed1ac ./src/vapi/libgda-5.0.deps
7c0fd34de7d495cebaee5c7c5e2ed1ac ./src/vapi/libgda-4.0.deps
a7fef8cb9bd957f2b1bb09dd5d6e5251 ./src/vapi/seed.vapi
-ada0cf43b69c40c6a874bbb3566a6aeb ./src/Makefile.am
-6d400fca1bd4f370a3e45746dfb55679 ./.gitignore
+683eaa46eca3338a330c3ecc6fc3ca38 ./src/Makefile.am
+99edd6b85c3025966d31c083dd4d94b7 ./.gitignore
4d19d0d1522086ac05b136c93e62716a ./README.md
959bffe2993816eb32ec4bc1ec1d5875 ./LICENSE
d32239bcb673463ab874e80d47fae504 ./COPYING
f72e9f9fdb220731ee1c3ffe08a536fd ./resources/bootstrap.builder.html
e7e7f422214fb0a99953f132d5b4711e ./resources/bootstrap4.builder.html
bbc8301b56a86029440348e200099c6a ./resources/roo.builder.js
-43132ba4eba80eb9372676e2db556fd4 ./resources/GtkUsage.txt
+e22537f678032101e556465a2c1f168d ./resources/GtkUsage.txt
8dcc309c476908ddf5eb918da5dc693c ./resources/roo.builder.html
-94c371e3148a49216db3b1ea664e178d ./configure.ac
+f35d4655cd7fe49c6e62c668c958f4e2 ./configure.ac
17382ef7b74816c91ee84c6544a6cefc ./tools/flutter_sqlite.php
a04cee5026068c7834e137a397601b7b ./tools/flutter_extract.php
8e994154f15ad797670a43a0d95ec053 ./tools/flutter_nodes.php
+roobuilder (4.2.0) UNRELEASED; urgency=medium
+
+ * Remove Clutter dependancy and interface
+ * Change Project and File management to Popover
+ * Property editing now expand right
+ * Popover property editing
+ * Popover for adding properties, events and children
+ * Cleaner User interface - icons and text for most things now.
+
+ -- Alan <alan@office.roojs.com> Wed, 25 May 2022 14:41:34 +0800
+
roobuilder (4.1.0) unstable; urgency=medium
* upgrade json file format - better support for diffable files - other features like better child object detection from code docs
--- /dev/null
+roobuilder (4.2.0) UNRELEASED; urgency=medium
+
+ *
+
+ -- Alan <alan@office.roojs.com> Wed, 25 May 2022 14:41:34 +0800
+
+roobuilder (4.1.0) unstable; urgency=medium
+
+ * upgrade json file format - better support for diffable files - other features like better child object detection from code docs
+ * support for vala 0.56+ due to copying code from valac (as codegen and ccode are not exported)
+
+ -- Alan <alan@office.roojs.com> Tue, 03 May 2022 17:40:50 +0800
+
+roobuilder (4.0.0) unstable; urgency=medium
+
+ * Initial Release.
+
+ -- Alan <alan@roojs.com> Thu, 16 May 2019 17:47:00 +0800
-roobuilder-dbgsym_4.1.0_amd64.ddeb debug optional automatic=yes
-roobuilder_4.1.0_amd64.buildinfo unknown optional
-roobuilder_4.1.0_amd64.deb unknown optional
+roobuilder-dbgsym_4.2.0_amd64.ddeb debug optional automatic=yes
+roobuilder_4.2.0_amd64.buildinfo unknown optional
+roobuilder_4.2.0_amd64.deb unknown optional
-shlibs:Depends=libc6 (>= 2.34), libcairo2 (>= 1.2.4), libclutter-1.0-0 (>= 1.11.10), libclutter-gtk-1.0-0 (>= 0.91.8), libgda-5.0-4 (>= 5.0.2), libgdk-pixbuf-2.0-0 (>= 2.22.0), libgee-0.8-2 (>= 0.8.3), libglib2.0-0 (>= 2.37.3), libgtk-3-0 (>= 3.16.2), libgtksourceview-3.0-1 (>= 3.10.1), libjavascriptcoregtk-4.0-18 (>= 2.36.0), libjson-glib-1.0-0 (>= 1.5.2), libpango-1.0-0 (>= 1.14.0), libsoup2.4-1 (>= 2.41.90), libvala-0.56-0 (>= 0.55.90), libwebkit2gtk-4.0-37 (>= 2.5.3), roojspacker
+shlibs:Depends=libc6 (>= 2.34), libcairo2 (>= 1.2.4), libgda-5.0-4 (>= 5.0.2), libgdk-pixbuf-2.0-0 (>= 2.22.0), libgee-0.8-2 (>= 0.8.3), libglib2.0-0 (>= 2.37.3), libgtk-3-0 (>= 3.16.2), libgtksourceview-3.0-1 (>= 3.10.1), libjavascriptcoregtk-4.0-18 (>= 2.36.2), libjson-glib-1.0-0 (>= 1.5.2), libpango-1.0-0 (>= 1.14.0), libsoup2.4-1 (>= 2.41.90), libvala-0.56-0 (>= 0.55.90), libwebkit2gtk-4.0-37 (>= 2.5.3), roojspacker
misc:Depends=
misc:Pre-Depends=
"program_name" : "roobuilder",
"string copyright" : "LGPL",
"string license" : "LGPL",
- "string version" : 2.1000000000000001,
+ "string version" : "4.2.0",
"website" : "https://github.com/roojs/roobuilder",
"xtype" : "AboutDialog",
"| void show" : [
this.el.program_name = "roobuilder";
this.el.license = "LGPL";
this.el.authors = { "Alan Knowles" };
- this.el.version = "2.1";
+ this.el.version = "4.2.0";
this.el.website = "https://github.com/roojs/roobuilder";
this.el.modal = true;
this.el.copyright = "LGPL";
"Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
"Gtk.SourceSearchContext searchcontext" : "null",
"bool hexpand" : true,
+ "bool vexpand" : true,
"int last_search_end" : 0,
"items" : [
{
// set gobject values
this.el.homogeneous = false;
this.el.hexpand = true;
+ this.el.vexpand = true;
var child_0 = new Xcls_Box2( _this );
child_0.ref();
this.el.pack_start ( child_0.el , false,true );
{
- "name" : "GtkView",
- "parent" : "",
- "title" : "",
- "path" : "/home/alan/gitlive/roobuilder/src/Builder4/GtkView.bjs",
- "permname" : "",
- "modOrder" : "",
"build_module" : "builder",
"items" : [
{
- "listeners" : {
- "size_allocate" : "(aloc) => {\n \n this.width = aloc.width;\n this.height =aloc.height;\n}\n "
- },
- "| void scroll_to_line" : "(int line) {\n this.notebook.el.page = 1;// code preview...\n \n GLib.Timeout.add(500, () => {\n \n \n\t \n\t \n\t\t var buf = this.sourceview.el.get_buffer();\n\t \n\t\tvar sbuf = (Gtk.SourceBuffer) buf;\n\n\n\t\tGtk.TextIter iter; \n\t\tsbuf.get_iter_at_line(out iter, line);\n\t\tthis.sourceview.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);\n\t\treturn false;\n\t}); \n\n \n}\n",
- "id" : "GtkView",
"# Gtk.Widget lastObj" : "null",
- "| void createThumb" : "() {\n \n \n if (this.file == null) {\n return;\n }\n // only screenshot the gtk preview..\n if (this.notebook.el.page > 0 ) {\n return;\n }\n \n \n var filename = this.file.getIconFileName(false);\n \n var win = this.el.get_parent_window();\n var width = win.get_width();\n var height = win.get_height();\n try {\n Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height); // this.el.position?\n screenshot.save(filename,\"png\");\n } catch (Error e) {\n \n }\n\n \n return;\n \n \n \n \n \n // should we hold until it's printed...\n \n \n\n \n \n\n\n \n \n}\n",
- "| void loadFile" : "(JsRender.JsRender file) \n{\n this.file = null;\n \n if (file.tree == null) {\n return;\n }\n this.notebook.el.page = 0;// gtk preview \n \n \n \n this.file = file; \n this.sourceview.loadFile();\n this.searchcontext = null;\n \n\n if (this.lastObj != null) {\n this.container.el.remove(this.lastObj);\n }\n \n // hide the compile view at present..\n \n \n var w = this.width;\n var h = this.height;\n \n print(\"ALLOC SET SIZES %d, %d\\n\", w,h); \n \n // set the container size min to 500/500 or 20 px less than max..\n w = int.max (w-20, 500);\n h = int.max (h-20, 500); \n \n print(\"SET SIZES %d, %d\\n\", w,h); \n _this.container.el.set_size_request(w,h);\n \n _this.view_layout.el.set_size(w,h); // should be baded on calc.. -- see update_scrolled.\n var rgba = Gdk.RGBA ();\n rgba.parse (\"#ccc\");\n _this.view_layout.el.override_background_color(Gtk.StateFlags.NORMAL, rgba);\n \n \n\tvar x = new JsRender.NodeToGtk((Project.Gtk) file.project, file.tree);\n var obj = x.munge() as Gtk.Widget;\n this.lastObj = null;\n\tif (obj == null) {\n \treturn;\n\t}\n\tthis.lastObj = obj;\n \n this.container.el.add(obj);\n obj.show_all();\n \n \n \n}\n ",
- "int width" : 0,
- "bool hexpand" : true,
- "| int search" : "(string txt) {\n\tthis.notebook.el.page = 1;\n \tvar s = new Gtk.SourceSearchSettings();\n\tvar buf = (Gtk.SourceBuffer) this.sourceview.el.get_buffer();\n\tthis.searchcontext = new Gtk.SourceSearchContext(buf,s);\n\tthis.searchcontext.set_highlight(true);\n\ts.set_search_text(txt);\n\t\n\tGtk.TextIter beg, st,en;\n\t \n\tbuf.get_start_iter(out beg);\n\tthis.searchcontext.forward(beg, out st, out en);\n\tthis.last_search_end = 0;\n\treturn this.searchcontext.get_occurrences_count();\n\n \n}\n",
- "int last_search_end" : 0,
- "xtype" : "Box",
- "Gtk.SourceSearchContext searchcontext" : "",
"# JsRender.JsRender file" : "null",
- "int height" : 0,
+ "# Xcls_MainWindow main_window" : "",
"$ xns" : "Gtk",
"Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
- "# Xcls_MainWindow main_window" : "",
- "| void forwardSearch" : "(bool change_focus) {\n\n\tif (this.searchcontext == null) {\n\t\treturn;\n\t}\n\tthis.notebook.el.page = 1;\n\tGtk.TextIter beg, st,en, stl;\n\t\n\tvar buf = this.sourceview.el.get_buffer();\n\tbuf.get_iter_at_offset(out beg, this.last_search_end);\n\tif (!this.searchcontext.forward(beg, out st, out en)) {\n\t\tthis.last_search_end = 0;\n\t} else { \n\t\tthis.last_search_end = en.get_offset();\n\t\tif (change_focus) {\n\t\t\tthis.sourceview.el.grab_focus();\t\n\t\t}\n\t\tbuf.place_cursor(st);\n\t\tvar ln = st.get_line();\n\t\tbuf.get_iter_at_line(out stl,ln);\n\t\t \n\t\tthis.sourceview.el.scroll_to_iter(stl, 0.0f, true, 0.0f, 0.5f);\n\t}\n\n}\n",
+ "Gtk.SourceSearchContext searchcontext" : "",
+ "bool hexpand" : true,
+ "bool vexpand" : true,
+ "id" : "GtkView",
+ "int height" : 0,
+ "int last_search_end" : 0,
+ "int width" : 0,
"items" : [
{
- "id" : "notebook",
- "xtype" : "Notebook",
- "* pack" : "pack_start,true,true,0",
"$ xns" : "Gtk",
+ "* pack" : "pack_start,true,true,0",
+ "id" : "notebook",
"items" : [
{
- "id" : "label_preview",
- "xtype" : "Label",
- "* pack" : false,
"$ xns" : "Gtk",
- "utf8 label" : "Preview"
+ "* pack" : false,
+ "id" : "label_preview",
+ "utf8 label" : "Preview",
+ "xtype" : "Label"
},
{
- "id" : "label_code",
- "* pack" : false,
- "xtype" : "Label",
"$ xns" : "Gtk",
- "utf8 label" : "Preview Generated Code"
+ "* pack" : false,
+ "id" : "label_code",
+ "utf8 label" : "Preview Generated Code",
+ "xtype" : "Label"
},
{
- "* pack" : "append_page,_this.label_preview.el",
- "xtype" : "ScrolledWindow",
"$ xns" : "Gtk",
+ "* pack" : "append_page,_this.label_preview.el",
"items" : [
{
- "id" : "view_layout",
- "* pack" : "add",
- "xtype" : "Layout",
"$ xns" : "Gtk",
+ "* pack" : "add",
+ "id" : "view_layout",
"items" : [
{
- "id" : "container",
- "xtype" : "Box",
- "* pack" : "put,10,10",
"$ xns" : "Gtk",
- "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL"
+ "* pack" : "put,10,10",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+ "id" : "container",
+ "xtype" : "Box"
}
- ]
+ ],
+ "xtype" : "Layout"
}
- ]
+ ],
+ "xtype" : "ScrolledWindow"
},
{
- "xtype" : "ScrolledWindow",
- "* pack" : "append_page,_this.label_code.el",
"$ xns" : "Gtk",
+ "* pack" : "append_page,_this.label_code.el",
"items" : [
{
- "gboolean show_line_marks" : true,
- "id" : "sourceview",
- "* init" : "{\n \n var description = Pango.FontDescription.from_string(\"monospace\");\n description.set_size(8000);\n this.el.override_font(description);\n\n this.loading = true;\n var buf = this.el.get_buffer();\n buf.notify.connect((ps) => {\n if (this.loading) {\n return;\n }\n if (ps.name != \"cursor-position\") {\n return;\n }\n print(\"cursor changed : %d\\n\", buf.cursor_position);\n Gtk.TextIter cpos;\n buf.get_iter_at_offset(out cpos, buf.cursor_position);\n \n var ln = cpos.get_line();\n \n var node = _this.file.lineToNode(ln);\n \n if (node == null) {\n print(\"can not find node\\n\");\n return;\n }\n var ltree = _this.main_window.windowstate.left_tree;\n var tp = ltree.model.treePathFromNode(node);\n print(\"got tree path %s\\n\", tp);\n if (tp != \"\") {\n\t this.allow_node_scroll = false; \n\t print(\"changing cursor on tree..\\n\");\n ltree.view.el.set_cursor(new Gtk.TreePath.from_string(tp), null, false);\n // scrolling is disabled... as node selection calls scroll 10ms after it changes.\n GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {\n\t this.allow_node_scroll = true;\n\t return false;\n });\n }\n \n // highlight the node..\n \n });\n \n \n \n var attrs = new Gtk.SourceMarkAttributes();\n var pink = Gdk.RGBA();\n pink.parse ( \"pink\");\n attrs.set_background ( pink);\n attrs.set_icon_name ( \"process-stop\"); \n attrs.query_tooltip_text.connect(( mark) => {\n //print(\"tooltip query? %s\\n\", mark.name);\n return mark.name;\n });\n \n this.el.set_mark_attributes (\"ERR\", attrs, 1);\n \n var wattrs = new Gtk.SourceMarkAttributes();\n var blue = Gdk.RGBA();\n blue.parse ( \"#ABF4EB\");\n wattrs.set_background ( blue);\n wattrs.set_icon_name ( \"process-stop\"); \n wattrs.query_tooltip_text.connect(( mark) => {\n //print(\"tooltip query? %s\\n\", mark.name);\n return mark.name;\n });\n \n this.el.set_mark_attributes (\"WARN\", wattrs, 1);\n \n \n \n var dattrs = new Gtk.SourceMarkAttributes();\n var purple = Gdk.RGBA();\n purple.parse ( \"#EEA9FF\");\n dattrs.set_background ( purple);\n dattrs.set_icon_name ( \"process-stop\"); \n dattrs.query_tooltip_text.connect(( mark) => {\n //print(\"tooltip query? %s\\n\", mark.name);\n return mark.name;\n });\n \n this.el.set_mark_attributes (\"DEPR\", dattrs, 1);\n \n \n var gattrs = new Gtk.SourceMarkAttributes();\n var grey = Gdk.RGBA();\n grey.parse ( \"#ccc\");\n gattrs.set_background ( grey);\n \n \n this.el.set_mark_attributes (\"grey\", gattrs, 1);\n \n \n \n \n \n \n}\n ",
- "| void nodeSelected" : "(JsRender.Node? sel) {\n \n \n \n // this is connected in widnowstate\n print(\"Roo-view - node selected\\n\");\n var buf = this.el.get_buffer();\n \n var sbuf = (Gtk.SourceBuffer) buf;\n\n \n while(Gtk.events_pending()) {\n Gtk.main_iteration();\n }\n \n \n // clear all the marks..\n Gtk.TextIter start;\n Gtk.TextIter end; \n \n sbuf.get_bounds (out start, out end);\n sbuf.remove_source_marks (start, end, \"grey\");\n \n \n if (sel == null) {\n // no highlighting..\n return;\n }\n Gtk.TextIter iter; \n sbuf.get_iter_at_line(out iter, sel.line_start);\n \n \n Gtk.TextIter cur_iter;\n sbuf.get_iter_at_offset(out cur_iter, sbuf.cursor_position);\n \n //var cur_line = cur_iter.get_line();\n //if (cur_line > sel.line_start && cur_line < sel.line_end) {\n \n //} else {\n if (this.allow_node_scroll) {\n\t\t \n \tthis.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);\n\t}\n \n \n \n for (var i = 0; i < buf.get_line_count();i++) {\n if (i < sel.line_start || i > sel.line_end) {\n \n sbuf.get_iter_at_line(out iter, i);\n sbuf.create_source_mark(null, \"grey\", iter);\n \n }\n \n }\n \n\n}\n",
- "bool loading" : true,
- "| string toString" : "() {\n Gtk.TextIter s;\n Gtk.TextIter e;\n this.el.get_buffer().get_start_iter(out s);\n this.el.get_buffer().get_end_iter(out e);\n var ret = this.el.get_buffer().get_text(s,e,true);\n //print(\"TO STRING? \" + ret);\n return ret;\n}\n",
- "| void loadFile" : "( ) {\n this.loading = true;\n var buf = this.el.get_buffer();\n buf.set_text(\"\",0);\n var sbuf = (Gtk.SourceBuffer) buf;\n\n \n\n if (_this.file == null || _this.file.xtype != \"Gtk\") {\n print(\"xtype != Gtk\");\n this.loading = false;\n return;\n }\n \n var valafn = \"\";\n try { \n var regex = new Regex(\"\\\\.bjs$\");\n \n \n valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , \".vala\");\n } catch (GLib.RegexError e) {\n this.loading = false;\n return;\n } \n \n\n if (!FileUtils.test(valafn,FileTest.IS_REGULAR) ) {\n print(\"File path has no errors\\n\");\n this.loading = false;\n return ;\n }\n \n string str;\n try {\n \n GLib.FileUtils.get_contents (valafn, out str);\n } catch (Error e) {\n this.loading = false;\n return ;\n }\n\n// print(\"setting str %d\\n\", str.length);\n buf.set_text(str, str.length);\n var lm = Gtk.SourceLanguageManager.get_default();\n \n //?? is javascript going to work as js?\n \n ((Gtk.SourceBuffer)(buf)) .set_language(lm.get_language(_this.file.language));\n \n \n Gtk.TextIter start;\n Gtk.TextIter end; \n \n sbuf.get_bounds (out start, out end);\n sbuf.remove_source_marks (start, end, null); // remove all marks..\n \n \n if (_this.main_window.windowstate.last_compile_result != null) {\n var obj = _this.main_window.windowstate.last_compile_result;\n this.highlightErrorsJson(\"ERR\", obj);\n this.highlightErrorsJson(\"WARN\", obj);\n this.highlightErrorsJson(\"DEPR\", obj);\t\t\t\n }\n //while (Gtk.events_pending()) {\n // Gtk.main_iteration();\n // }\n \n this.loading = false; \n}\n",
+ "$ xns" : "Gtk",
+ "* init" : [
+ "{",
+ " ",
+ " var description = Pango.FontDescription.from_string(\"monospace\");",
+ " description.set_size(8000);",
+ " this.el.override_font(description);",
+ "",
+ " this.loading = true;",
+ " var buf = this.el.get_buffer();",
+ " buf.notify.connect((ps) => {",
+ " if (this.loading) {",
+ " return;",
+ " }",
+ " if (ps.name != \"cursor-position\") {",
+ " return;",
+ " }",
+ " print(\"cursor changed : %d\\n\", buf.cursor_position);",
+ " Gtk.TextIter cpos;",
+ " buf.get_iter_at_offset(out cpos, buf.cursor_position);",
+ " ",
+ " var ln = cpos.get_line();",
+ " ",
+ " var node = _this.file.lineToNode(ln);",
+ " ",
+ " if (node == null) {",
+ " print(\"can not find node\\n\");",
+ " return;",
+ " }",
+ " var ltree = _this.main_window.windowstate.left_tree;",
+ " var tp = ltree.model.treePathFromNode(node);",
+ " print(\"got tree path %s\\n\", tp);",
+ " if (tp != \"\") {",
+ "\t this.allow_node_scroll = false; ",
+ "\t print(\"changing cursor on tree..\\n\");",
+ " ltree.view.el.set_cursor(new Gtk.TreePath.from_string(tp), null, false);",
+ " // scrolling is disabled... as node selection calls scroll 10ms after it changes.",
+ " GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {",
+ "\t this.allow_node_scroll = true;",
+ "\t return false;",
+ " });",
+ " }",
+ " ",
+ " // highlight the node..",
+ " ",
+ " });",
+ " ",
+ " ",
+ " ",
+ " var attrs = new Gtk.SourceMarkAttributes();",
+ " var pink = Gdk.RGBA();",
+ " pink.parse ( \"pink\");",
+ " attrs.set_background ( pink);",
+ " attrs.set_icon_name ( \"process-stop\"); ",
+ " attrs.query_tooltip_text.connect(( mark) => {",
+ " //print(\"tooltip query? %s\\n\", mark.name);",
+ " return mark.name;",
+ " });",
+ " ",
+ " this.el.set_mark_attributes (\"ERR\", attrs, 1);",
+ " ",
+ " var wattrs = new Gtk.SourceMarkAttributes();",
+ " var blue = Gdk.RGBA();",
+ " blue.parse ( \"#ABF4EB\");",
+ " wattrs.set_background ( blue);",
+ " wattrs.set_icon_name ( \"process-stop\"); ",
+ " wattrs.query_tooltip_text.connect(( mark) => {",
+ " //print(\"tooltip query? %s\\n\", mark.name);",
+ " return mark.name;",
+ " });",
+ " ",
+ " this.el.set_mark_attributes (\"WARN\", wattrs, 1);",
+ " ",
+ " ",
+ " ",
+ " var dattrs = new Gtk.SourceMarkAttributes();",
+ " var purple = Gdk.RGBA();",
+ " purple.parse ( \"#EEA9FF\");",
+ " dattrs.set_background ( purple);",
+ " dattrs.set_icon_name ( \"process-stop\"); ",
+ " dattrs.query_tooltip_text.connect(( mark) => {",
+ " //print(\"tooltip query? %s\\n\", mark.name);",
+ " return mark.name;",
+ " });",
+ " ",
+ " this.el.set_mark_attributes (\"DEPR\", dattrs, 1);",
+ " ",
+ " ",
+ " var gattrs = new Gtk.SourceMarkAttributes();",
+ " var grey = Gdk.RGBA();",
+ " grey.parse ( \"#ccc\");",
+ " gattrs.set_background ( grey);",
+ " ",
+ " ",
+ " this.el.set_mark_attributes (\"grey\", gattrs, 1);",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "}",
+ " "
+ ],
"* pack" : "add",
- "xtype" : "SourceView",
"bool allow_node_scroll" : true,
- "| void highlightErrorsJson" : " (string type, Json.Object obj) {\n Gtk.TextIter start;\n Gtk.TextIter end; \n \n var buf = this.el.get_buffer();\n var sbuf = (Gtk.SourceBuffer)buf;\n buf.get_bounds (out start, out end);\n \n sbuf.remove_source_marks (start, end, type);\n \n \n // we should highlight other types of errors..\n \n if (!obj.has_member(type)) {\n print(\"Return has no errors\\n\");\n return ;\n }\n var err = obj.get_object_member(type);\n \n if (_this.file == null) { \n return; // just in case the file has not loaded yet?\n }\n \n\n var valafn = \"\";\n try { \n var regex = new Regex(\"\\\\.bjs$\");\n \n \n valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , \".vala\");\n } catch (GLib.RegexError e) {\n return;\n } \n\n if (!err.has_member(valafn)) {\n print(\"File path has no errors\\n\");\n return ;\n }\n var lines = err.get_object_member(valafn);\n \n \n \n var tlines = buf.get_line_count () +1;\n \n lines.foreach_member((obj, line, node) => {\n \n Gtk.TextIter iter;\n // print(\"get inter\\n\");\n var eline = int.parse(line) -1 ;\n print(\"GOT ERROR on line %s -- converted to %d\\n\", line,eline);\n \n \n if (eline > tlines || eline < 0) {\n return;\n }\n sbuf.get_iter_at_line( out iter, eline);\n //print(\"mark line\\n\");\n var msg = type + \" on line: %d - %s\".printf(eline+1, valafn);\n var ar = lines.get_array_member(line);\n for (var i = 0 ; i < ar.get_length(); i++) {\n\t\t msg += (msg.length > 0) ? \"\\n\" : \"\";\n\t\t msg += ar.get_string_element(i);\n\t }\n \n \n sbuf.create_source_mark(msg, type, iter);\n } );\n return ;\n \n \n\n\n}",
- "$ xns" : "Gtk",
+ "bool loading" : true,
+ "gboolean editable" : false,
+ "gboolean show_line_marks" : true,
"gboolean show_line_numbers" : true,
- "gboolean editable" : false
+ "id" : "sourceview",
+ "xtype" : "SourceView",
+ "| string toString" : [
+ "() {",
+ " Gtk.TextIter s;",
+ " Gtk.TextIter e;",
+ " this.el.get_buffer().get_start_iter(out s);",
+ " this.el.get_buffer().get_end_iter(out e);",
+ " var ret = this.el.get_buffer().get_text(s,e,true);",
+ " //print(\"TO STRING? \" + ret);",
+ " return ret;",
+ "}",
+ ""
+ ],
+ "| void highlightErrorsJson" : [
+ " (string type, Json.Object obj) {",
+ " Gtk.TextIter start;",
+ " Gtk.TextIter end; ",
+ " ",
+ " var buf = this.el.get_buffer();",
+ " var sbuf = (Gtk.SourceBuffer)buf;",
+ " buf.get_bounds (out start, out end);",
+ " ",
+ " sbuf.remove_source_marks (start, end, type);",
+ " ",
+ " ",
+ " // we should highlight other types of errors..",
+ " ",
+ " if (!obj.has_member(type)) {",
+ " print(\"Return has no errors\\n\");",
+ " return ;",
+ " }",
+ " var err = obj.get_object_member(type);",
+ " ",
+ " if (_this.file == null) { ",
+ " return; // just in case the file has not loaded yet?",
+ " }",
+ " ",
+ "",
+ " var valafn = \"\";",
+ " try { ",
+ " var regex = new Regex(\"\\\\.bjs$\");",
+ " ",
+ " ",
+ " valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , \".vala\");",
+ " } catch (GLib.RegexError e) {",
+ " return;",
+ " } ",
+ "",
+ " if (!err.has_member(valafn)) {",
+ " print(\"File path has no errors\\n\");",
+ " return ;",
+ " }",
+ " var lines = err.get_object_member(valafn);",
+ " ",
+ " ",
+ " ",
+ " var tlines = buf.get_line_count () +1;",
+ " ",
+ " lines.foreach_member((obj, line, node) => {",
+ " ",
+ " Gtk.TextIter iter;",
+ " // print(\"get inter\\n\");",
+ " var eline = int.parse(line) -1 ;",
+ " print(\"GOT ERROR on line %s -- converted to %d\\n\", line,eline);",
+ " ",
+ " ",
+ " if (eline > tlines || eline < 0) {",
+ " return;",
+ " }",
+ " sbuf.get_iter_at_line( out iter, eline);",
+ " //print(\"mark line\\n\");",
+ " var msg = type + \" on line: %d - %s\".printf(eline+1, valafn);",
+ " var ar = lines.get_array_member(line);",
+ " for (var i = 0 ; i < ar.get_length(); i++) {",
+ "\t\t msg += (msg.length > 0) ? \"\\n\" : \"\";",
+ "\t\t msg += ar.get_string_element(i);",
+ "\t }",
+ " ",
+ " ",
+ " sbuf.create_source_mark(msg, type, iter);",
+ " } );",
+ " return ;",
+ " ",
+ " ",
+ "",
+ "",
+ "}"
+ ],
+ "| void loadFile" : [
+ "( ) {",
+ " this.loading = true;",
+ " var buf = this.el.get_buffer();",
+ " buf.set_text(\"\",0);",
+ " var sbuf = (Gtk.SourceBuffer) buf;",
+ "",
+ " ",
+ "",
+ " if (_this.file == null || _this.file.xtype != \"Gtk\") {",
+ " print(\"xtype != Gtk\");",
+ " this.loading = false;",
+ " return;",
+ " }",
+ " ",
+ " var valafn = \"\";",
+ " try { ",
+ " var regex = new Regex(\"\\\\.bjs$\");",
+ " ",
+ " ",
+ " valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , \".vala\");",
+ " } catch (GLib.RegexError e) {",
+ " this.loading = false;",
+ " return;",
+ " } ",
+ " ",
+ "",
+ " if (!FileUtils.test(valafn,FileTest.IS_REGULAR) ) {",
+ " print(\"File path has no errors\\n\");",
+ " this.loading = false;",
+ " return ;",
+ " }",
+ " ",
+ " string str;",
+ " try {",
+ " ",
+ " GLib.FileUtils.get_contents (valafn, out str);",
+ " } catch (Error e) {",
+ " this.loading = false;",
+ " return ;",
+ " }",
+ "",
+ "// print(\"setting str %d\\n\", str.length);",
+ " buf.set_text(str, str.length);",
+ " var lm = Gtk.SourceLanguageManager.get_default();",
+ " ",
+ " //?? is javascript going to work as js?",
+ " ",
+ " ((Gtk.SourceBuffer)(buf)) .set_language(lm.get_language(_this.file.language));",
+ " ",
+ " ",
+ " Gtk.TextIter start;",
+ " Gtk.TextIter end; ",
+ " ",
+ " sbuf.get_bounds (out start, out end);",
+ " sbuf.remove_source_marks (start, end, null); // remove all marks..",
+ " ",
+ " ",
+ " if (_this.main_window.windowstate.last_compile_result != null) {",
+ " var obj = _this.main_window.windowstate.last_compile_result;",
+ " this.highlightErrorsJson(\"ERR\", obj);",
+ " this.highlightErrorsJson(\"WARN\", obj);",
+ " this.highlightErrorsJson(\"DEPR\", obj);\t\t\t",
+ " }",
+ " //while (Gtk.events_pending()) {",
+ " // Gtk.main_iteration();",
+ " // }",
+ " ",
+ " this.loading = false; ",
+ "}",
+ ""
+ ],
+ "| void nodeSelected" : [
+ "(JsRender.Node? sel) {",
+ " ",
+ " ",
+ " ",
+ " // this is connected in widnowstate",
+ " print(\"Roo-view - node selected\\n\");",
+ " var buf = this.el.get_buffer();",
+ " ",
+ " var sbuf = (Gtk.SourceBuffer) buf;",
+ "",
+ " ",
+ " while(Gtk.events_pending()) {",
+ " Gtk.main_iteration();",
+ " }",
+ " ",
+ " ",
+ " // clear all the marks..",
+ " Gtk.TextIter start;",
+ " Gtk.TextIter end; ",
+ " ",
+ " sbuf.get_bounds (out start, out end);",
+ " sbuf.remove_source_marks (start, end, \"grey\");",
+ " ",
+ " ",
+ " if (sel == null) {",
+ " // no highlighting..",
+ " return;",
+ " }",
+ " Gtk.TextIter iter; ",
+ " sbuf.get_iter_at_line(out iter, sel.line_start);",
+ " ",
+ " ",
+ " Gtk.TextIter cur_iter;",
+ " sbuf.get_iter_at_offset(out cur_iter, sbuf.cursor_position);",
+ " ",
+ " //var cur_line = cur_iter.get_line();",
+ " //if (cur_line > sel.line_start && cur_line < sel.line_end) {",
+ " ",
+ " //} else {",
+ " if (this.allow_node_scroll) {",
+ "\t\t ",
+ " \tthis.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);",
+ "\t}",
+ " ",
+ " ",
+ " ",
+ " for (var i = 0; i < buf.get_line_count();i++) {",
+ " if (i < sel.line_start || i > sel.line_end) {",
+ " ",
+ " sbuf.get_iter_at_line(out iter, i);",
+ " sbuf.create_source_mark(null, \"grey\", iter);",
+ " ",
+ " }",
+ " ",
+ " }",
+ " ",
+ "",
+ "}",
+ ""
+ ]
}
- ]
+ ],
+ "xtype" : "ScrolledWindow"
}
- ]
+ ],
+ "xtype" : "Notebook"
}
+ ],
+ "listeners" : {
+ "size_allocate" : [
+ "(aloc) => {",
+ " ",
+ " this.width = aloc.width;",
+ " this.height =aloc.height;",
+ "}",
+ " "
+ ]
+ },
+ "xtype" : "Box",
+ "| int search" : [
+ "(string txt) {",
+ "\tthis.notebook.el.page = 1;",
+ " \tvar s = new Gtk.SourceSearchSettings();",
+ "\tvar buf = (Gtk.SourceBuffer) this.sourceview.el.get_buffer();",
+ "\tthis.searchcontext = new Gtk.SourceSearchContext(buf,s);",
+ "\tthis.searchcontext.set_highlight(true);",
+ "\ts.set_search_text(txt);",
+ "\t",
+ "\tGtk.TextIter beg, st,en;",
+ "\t ",
+ "\tbuf.get_start_iter(out beg);",
+ "\tthis.searchcontext.forward(beg, out st, out en);",
+ "\tthis.last_search_end = 0;",
+ "\treturn this.searchcontext.get_occurrences_count();",
+ "",
+ " ",
+ "}",
+ ""
+ ],
+ "| void createThumb" : [
+ "() {",
+ " ",
+ " ",
+ " if (this.file == null) {",
+ " return;",
+ " }",
+ " // only screenshot the gtk preview..",
+ " if (this.notebook.el.page > 0 ) {",
+ " return;",
+ " }",
+ " ",
+ " ",
+ " var filename = this.file.getIconFileName(false);",
+ " ",
+ " var win = this.el.get_parent_window();",
+ " var width = win.get_width();",
+ " var height = win.get_height();",
+ " try {",
+ " Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height); // this.el.position?",
+ " screenshot.save(filename,\"png\");",
+ " } catch (Error e) {",
+ " ",
+ " }",
+ "",
+ " ",
+ " return;",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " // should we hold until it's printed...",
+ " ",
+ " ",
+ "",
+ " ",
+ " ",
+ "",
+ "",
+ " ",
+ " ",
+ "}",
+ ""
+ ],
+ "| void forwardSearch" : [
+ "(bool change_focus) {",
+ "",
+ "\tif (this.searchcontext == null) {",
+ "\t\treturn;",
+ "\t}",
+ "\tthis.notebook.el.page = 1;",
+ "\tGtk.TextIter beg, st,en, stl;",
+ "\t",
+ "\tvar buf = this.sourceview.el.get_buffer();",
+ "\tbuf.get_iter_at_offset(out beg, this.last_search_end);",
+ "\tif (!this.searchcontext.forward(beg, out st, out en)) {",
+ "\t\tthis.last_search_end = 0;",
+ "\t} else { ",
+ "\t\tthis.last_search_end = en.get_offset();",
+ "\t\tif (change_focus) {",
+ "\t\t\tthis.sourceview.el.grab_focus();\t",
+ "\t\t}",
+ "\t\tbuf.place_cursor(st);",
+ "\t\tvar ln = st.get_line();",
+ "\t\tbuf.get_iter_at_line(out stl,ln);",
+ "\t\t ",
+ "\t\tthis.sourceview.el.scroll_to_iter(stl, 0.0f, true, 0.0f, 0.5f);",
+ "\t}",
+ "",
+ "}",
+ ""
+ ],
+ "| void loadFile" : [
+ "(JsRender.JsRender file) ",
+ "{",
+ " this.file = null;",
+ " ",
+ " if (file.tree == null) {",
+ " return;",
+ " }",
+ " this.notebook.el.page = 0;// gtk preview ",
+ " ",
+ " ",
+ " ",
+ " this.file = file; ",
+ " this.sourceview.loadFile();",
+ " this.searchcontext = null;",
+ " ",
+ "",
+ " if (this.lastObj != null) {",
+ " this.container.el.remove(this.lastObj);",
+ " }",
+ " ",
+ " // hide the compile view at present..",
+ " ",
+ " ",
+ " var w = this.width;",
+ " var h = this.height;",
+ " ",
+ " print(\"ALLOC SET SIZES %d, %d\\n\", w,h); ",
+ " ",
+ " // set the container size min to 500/500 or 20 px less than max..",
+ " w = int.max (w-20, 500);",
+ " h = int.max (h-20, 500); ",
+ " ",
+ " print(\"SET SIZES %d, %d\\n\", w,h); ",
+ " _this.container.el.set_size_request(w,h);",
+ " ",
+ " _this.view_layout.el.set_size(w,h); // should be baded on calc.. -- see update_scrolled.",
+ " var rgba = Gdk.RGBA ();",
+ " rgba.parse (\"#ccc\");",
+ " _this.view_layout.el.override_background_color(Gtk.StateFlags.NORMAL, rgba);",
+ " ",
+ " ",
+ "\tvar x = new JsRender.NodeToGtk((Project.Gtk) file.project, file.tree);",
+ " var obj = x.munge() as Gtk.Widget;",
+ " this.lastObj = null;",
+ "\tif (obj == null) {",
+ " \treturn;",
+ "\t}",
+ "\tthis.lastObj = obj;",
+ " ",
+ " this.container.el.add(obj);",
+ " obj.show_all();",
+ " ",
+ " ",
+ " ",
+ "}",
+ " "
+ ],
+ "| void scroll_to_line" : [
+ "(int line) {",
+ " this.notebook.el.page = 1;// code preview...",
+ " ",
+ " GLib.Timeout.add(500, () => {",
+ " ",
+ " ",
+ "\t ",
+ "\t ",
+ "\t\t var buf = this.sourceview.el.get_buffer();",
+ "\t ",
+ "\t\tvar sbuf = (Gtk.SourceBuffer) buf;",
+ "",
+ "",
+ "\t\tGtk.TextIter iter; ",
+ "\t\tsbuf.get_iter_at_line(out iter, line);",
+ "\t\tthis.sourceview.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);",
+ "\t\treturn false;",
+ "\t}); ",
+ "",
+ " ",
+ "}",
+ ""
]
}
- ]
+ ],
+ "modOrder" : "",
+ "name" : "GtkView",
+ "parent" : "",
+ "path" : "/home/alan/gitlive/roobuilder/src/Builder4/GtkView.bjs",
+ "permname" : "",
+ "title" : ""
}
\ No newline at end of file
// set gobject values
this.el.hexpand = true;
+ this.el.vexpand = true;
var child_0 = new Xcls_notebook( _this );
child_0.ref();
this.el.pack_start ( child_0.el , true,true,0 );
"//\t}"
],
"border_width" : 0,
- "default_height" : 750,
+ "default_height" : 850,
"default_width" : 1200,
"id" : "MainWindow",
"items" : [
"items" : [
{
"$ xns" : "Gtk",
- "* pack" : "add1",
- "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+ "* pack" : "add",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
"id" : "leftpane",
"items" : [
{
"$ xns" : "Gtk",
"* pack" : "pack_start,true,true,0",
- "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
"id" : "editpane",
"items" : [
{
"xtype" : "Box"
}
],
+ "listeners" : {
+ "accept_position" : [
+ "() => {",
+ "\tGLib.debug(\"Accept postion\");",
+ "\treturn true;",
+ "}"
+ ],
+ "move_handle" : [
+ "(scroll) => {",
+ "\tGLib.debug(\"Move handle\");",
+ "\treturn true;",
+ "}"
+ ]
+ },
"xtype" : "Paned"
}
],
"Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
"items" : [
{
- "$ xns" : "GtkClutter",
- "* init" : [
- " var stage = this.el.get_stage();",
- " stage.set_background_color( Clutter.Color.from_string(\"#000\"));",
- " ",
- " ",
- ""
- ],
- "* pack" : "pack_start,true,true,0",
- "id" : "clutterembed",
- "items" : [
- {
- "$ xns" : "GtkClutter",
- "* init" : [
- "{",
- " ",
- " ",
- " this.el.add_constraint(",
- " new Clutter.AlignConstraint(",
- " _this.clutterembed.el.get_stage(), ",
- " Clutter.AlignAxis.X_AXIS,",
- " 1.0f",
- " )",
- " );",
- " ",
- " //this.el.set_position(100,100);",
- " this.el.set_pivot_point(1.0f,1.0f);",
- " ",
- " this.el.set_size(_this.clutterembed.el.get_stage().width-50,",
- " _this.clutterembed.el.get_stage().height);",
- " ",
- "}"
- ],
- "* pack" : "get_stage().add_child",
- "id" : "rooview",
- "xtype" : "Actor"
- },
- {
- "$ xns" : "GtkClutter",
- "* init" : [
- "{",
- " ",
- " /*",
- " this.el.add_constraint(",
- " new Clutter.AlignConstraint(",
- " _this.clutterembed.el.get_stage(), ",
- " Clutter.AlignAxis.X_AXIS,",
- " 0.0f",
- " )",
- " );",
- " */",
- " this.el.fixed_x = 50.0f;",
- " this.el.fixed_y = 0.0f;",
- " //this.el.set_position(100,100);",
- " this.el.set_pivot_point(0.0f,0.0f);",
- " this.el.set_scale(0.0f,1.0f);",
- " this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,",
- " _this.clutterembed.el.get_stage().height);",
- " ",
- "}"
- ],
- "* pack" : "get_stage().add_child",
- "id" : "objectview",
- "xtype" : "Actor"
- },
- {
- "$ xns" : "GtkClutter",
- "* init" : [
- "{",
- " ",
- " /*",
- " this.el.add_constraint(",
- " new Clutter.AlignConstraint(",
- " _this.clutterembed.el.get_stage(), ",
- " Clutter.AlignAxis.X_AXIS,",
- " 0.0f",
- " )",
- " );",
- " */",
- " this.el.fixed_x = 50.0f;",
- " this.el.fixed_y = 0.0f;",
- " //this.el.set_position(100,100);",
- " this.el.set_pivot_point(0.0f,0.0f);",
- " this.el.set_scale(0.0f,1.0f);",
- " this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,",
- " _this.clutterembed.el.get_stage().height);",
- " ",
- "}"
- ],
- "* pack" : "get_stage().add_child",
- "id" : "codeeditview",
- "xtype" : "Actor"
- },
- {
- "$ xns" : "GtkClutter",
- "* init" : [
- "{",
- " ",
- " /*",
- " this.el.add_constraint(",
- " new Clutter.AlignConstraint(",
- " _this.clutterembed.el.get_stage(), ",
- " Clutter.AlignAxis.X_AXIS,",
- " 0.0f",
- " )",
- " );",
- " */",
- " this.el.fixed_x = 50.0f;",
- " this.el.fixed_y = 0.0f;",
- " //this.el.set_position(100,100);",
- " this.el.set_pivot_point(0.0f,0.0f);",
- " this.el.set_scale(0.0f,1.0f);",
- " this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,",
- " _this.clutterembed.el.get_stage().height);",
- " ",
- "}"
- ],
- "* pack" : "get_stage().add_child",
- "id" : "addpropsview",
- "xtype" : "Actor"
- },
- {
- "$ xns" : "Clutter",
- "* init" : [
- "{",
- " ",
- " this.el.add_constraint(",
- " new Clutter.AlignConstraint(",
- " _this.clutterembed.el.get_stage(), ",
- " Clutter.AlignAxis.X_AXIS,",
- " 0.0f",
- " )",
- " );",
- " ",
- " ",
- " //this.el.set_position(100,100);",
- " this.el.set_pivot_point(0.5f,0.5f);",
- " this.el.set_size(50,",
- " _this.clutterembed.el.get_stage().height);",
- " ",
- "}"
- ],
- "* pack" : "get_stage().add_child",
- "id" : "buttonlayout",
- "items" : [
- {
- "$ orientation" : "Clutter.Orientation.VERTICAL",
- "$ xns" : "Clutter",
- "* prop" : "layout_manager",
- "xtype" : "BoxLayout"
- },
- {
- "$ xns" : "Clutter",
- "* init" : "this.el.set_size(50,50);",
- "* pack" : "add_child",
- "id" : "backbutton",
- "items" : [
- {
- "$ xns" : "GtkClutter",
- "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
- "* pack" : "add_child",
- "items" : [
- {
- "$ xns" : "Gtk",
- "* pack" : false,
- "height_request" : 50,
- "items" : [
- {
- "$ xns" : "Gtk",
- "* pack" : "set_image",
- "utf8 icon_name" : "go-previous",
- "xtype" : "Image"
- }
- ],
- "listeners" : {
- "clicked" : [
- " ( ) => {",
- " // if (_this.windowstate.state == WindowState.State.FILEPROJECT) {",
- " ",
- "//\t _this.windowstate.switchState(WindowState.State.FILES);",
- " // } else { ",
- "\t _this.windowstate.switchState(WindowState.State.PREVIEW);",
- " // }",
- " ",
- "",
- "}"
- ]
- },
- "utf8 tooltip_text" : "Back",
- "width_request" : 50,
- "xtype" : "Button"
- }
- ],
- "xtype" : "Actor"
- }
- ],
- "xtype" : "Actor"
- },
- {
- "$ xns" : "Clutter",
- "* init" : "this.el.set_size(50,50);",
- "* pack" : "add_child",
- "id" : "objectshowbutton",
- "items" : [
- {
- "$ xns" : "GtkClutter",
- "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
- "* pack" : "add_child",
- "items" : [
- {
- "$ tooltip_text" : "\"Add Child Element\"",
- "$ xns" : "Gtk",
- "* pack" : false,
- "height_request" : 50,
- "items" : [
- {
- "$ xns" : "Gtk",
- "* pack" : "set_image",
- "utf8 icon_name" : "list-add",
- "xtype" : "Image"
- }
- ],
- "listeners" : {
- "clicked" : [
- " ( ) => {",
- " ",
- "",
- " \t_this.windowstate.showAddObject(this.el);",
- " ",
- "}"
- ]
- },
- "width_request" : 50,
- "xtype" : "Button"
- }
- ],
- "xtype" : "Actor"
- }
- ],
- "listeners" : {
- "enter_event" : [
- "( event) => {",
- " this.el.background_color = Clutter.Color.from_string(\"#333\");",
- " return false;",
- "}"
- ],
- "leave_event" : [
- "( event) => {",
- " this.el.background_color = Clutter.Color.from_string(\"#000\");",
- " return false;",
- "}"
- ]
- },
- "xtype" : "Actor"
- },
- {
- "$ xns" : "Clutter",
- "* init" : "this.el.set_size(50,50);",
- "* pack" : "add_child",
- "id" : "addpropbutton",
- "items" : [
- {
- "$ xns" : "GtkClutter",
- "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
- "* pack" : "add_child",
- "items" : [
- {
- "$ tooltip_text" : "\"Add Property\"",
- "$ xns" : "Gtk",
- "* pack" : false,
- "height_request" : 50,
- "items" : [
- {
- "$ xns" : "Gtk",
- "* pack" : "set_image",
- "utf8 icon_name" : "format-justify-left",
- "xtype" : "Image"
- }
- ],
- "listeners" : {
- "clicked" : [
- " ( ) => {",
- " ",
- " _this.windowstate.showProps(this.el, \"props\");",
- " ",
- "",
- "}"
- ]
- },
- "width_request" : 50,
- "xtype" : "Button"
- }
- ],
- "xtype" : "Actor"
- }
- ],
- "xtype" : "Actor"
- },
- {
- "$ xns" : "Clutter",
- "* init" : "this.el.set_size(50,50);",
- "* pack" : "add_child",
- "id" : "addlistenerbutton",
- "items" : [
- {
- "$ xns" : "GtkClutter",
- "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
- "* pack" : "add_child",
- "items" : [
- {
- "$ tooltip_text" : "\"Add Event Code\"",
- "$ xns" : "Gtk",
- "* pack" : false,
- "height_request" : 50,
- "items" : [
- {
- "$ xns" : "Gtk",
- "* pack" : "set_image",
- "utf8 icon_name" : "appointment-new",
- "xtype" : "Image"
- }
- ],
- "listeners" : {
- "clicked" : [
- " ( ) => {",
- " ",
- " ",
- " _this.windowstate.showProps(this.el, \"signals\");",
- "",
- "",
- "}"
- ]
- },
- "width_request" : 50,
- "xtype" : "Button"
- }
- ],
- "xtype" : "Actor"
- }
- ],
- "xtype" : "Actor"
- }
- ],
- "xtype" : "Actor"
- }
- ],
- "listeners" : {
- "size_allocate" : [
- " ( alloc) => {",
- " if (_this.windowstate == null) {",
- " return;",
- " }",
- " _this.windowstate.resizeCanvas(); ",
- " ",
- "}"
- ]
- },
- "xtype" : "Embed"
+ "$ xns" : "Gtk",
+ "* pack" : "add",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+ "bool vexpand" : true,
+ "id" : "rooviewbox",
+ "xtype" : "Box"
+ },
+ {
+ "$ xns" : "Gtk",
+ "* pack" : "add",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+ "bool vexpand" : true,
+ "id" : "codeeditviewbox",
+ "xtype" : "Box"
}
],
"xtype" : "Box"
"$ xns" : "Gtk",
"* pack" : "add",
"bool always_show_image" : true,
- "height_request" : 50,
"items" : [
{
"$ xns" : "Gtk",
" ",
" _this.windowstate.projectPopoverShow(this.el, _this.project);",
" ",
- " ",
+ " ",
"}"
]
},
"string label" : "Edit Project Settings",
- "width_request" : 50,
"xtype" : "Button"
},
{
"$ xns" : "Gtk",
"* pack" : "add",
"bool always_show_image" : true,
- "height_request" : 50,
"items" : [
{
"$ xns" : "Gtk",
]
},
"string label" : "Edit File Properties",
- "width_request" : 50,
"xtype" : "Button"
},
{
],
"* pack" : "pack_start,false,true,0",
"id" : "search_entry",
+ "int width_request" : 300,
"listeners" : {
"changed" : [
"() => {",
" this.windowstate = new WindowState(this);",
" ",
"",
- " //w.el.show_all();",
- " var tl = new Clutter.Timeline(6000);",
- " tl.set_repeat_count(-1);",
- " tl.start();",
- " tl.ref();",
+ " ",
"",
" ",
"",
public Xcls_editpane editpane;
public Xcls_tree tree;
public Xcls_props props;
- public Xcls_clutterembed clutterembed;
- public Xcls_rooview rooview;
- public Xcls_objectview objectview;
- public Xcls_codeeditview codeeditview;
- public Xcls_addpropsview addpropsview;
- public Xcls_buttonlayout buttonlayout;
- public Xcls_backbutton backbutton;
- public Xcls_objectshowbutton objectshowbutton;
- public Xcls_addpropbutton addpropbutton;
- public Xcls_addlistenerbutton addlistenerbutton;
+ public Xcls_rooviewbox rooviewbox;
+ public Xcls_codeeditviewbox codeeditviewbox;
public Xcls_topbarmenu topbarmenu;
public Xcls_statusbar statusbar;
public Xcls_search_entry search_entry;
// set gobject values
this.el.border_width = 0;
- this.el.default_height = 750;
+ this.el.default_height = 850;
this.el.default_width = 1200;
var child_0 = new Xcls_headerbar( _this );
child_0.ref();
this.windowstate = new WindowState(this);
- //w.el.show_all();
- var tl = new Clutter.Timeline(6000);
- tl.set_repeat_count(-1);
- tl.start();
- tl.ref();
+
var child_0 = new Xcls_mainpane( _this );
child_0.ref();
this.el.pack_start ( child_0.el , true,true,0 );
- var child_1 = new Xcls_Box38( _this );
+ var child_1 = new Xcls_Box17( _this );
child_1.ref();
this.el.pack_end ( child_1.el , false,true,0 );
}
this.el.position = 400;
var child_0 = new Xcls_leftpane( _this );
child_0.ref();
- this.el.add1 ( child_0.el );
- var child_1 = new Xcls_Box14( _this );
- child_1.ref();
- this.el.add2 ( child_1.el );
- }
-
- // user defined functions
- }
- public class Xcls_leftpane : Object
- {
- public Gtk.Box el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_leftpane(Xcls_MainWindow _owner )
- {
- _this = _owner;
- _this.leftpane = this;
- this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
-
- // my vars (dec)
-
- // set gobject values
- var child_0 = new Xcls_editpane( _this );
- child_0.ref();
- this.el.pack_start ( child_0.el , true,true,0 );
- }
-
- // user defined functions
- }
- public class Xcls_editpane : Object
- {
- public Gtk.Paned el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_editpane(Xcls_MainWindow _owner )
- {
- _this = _owner;
- _this.editpane = this;
- this.el = new Gtk.Paned( Gtk.Orientation.VERTICAL );
-
- // my vars (dec)
-
- // set gobject values
- var child_0 = new Xcls_tree( _this );
- child_0.ref();
- this.el.add1 ( child_0.el );
- var child_1 = new Xcls_props( _this );
- child_1.ref();
- this.el.add2 ( child_1.el );
- }
-
- // user defined functions
- }
- public class Xcls_tree : Object
- {
- public Gtk.Box el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_tree(Xcls_MainWindow _owner )
- {
- _this = _owner;
- _this.tree = this;
- this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
-
- // my vars (dec)
-
- // set gobject values
- }
-
- // user defined functions
- }
-
- public class Xcls_props : Object
- {
- public Gtk.Box el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_props(Xcls_MainWindow _owner )
- {
- _this = _owner;
- _this.props = this;
- this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
-
- // my vars (dec)
-
- // set gobject values
- }
-
- // user defined functions
- }
-
-
-
- public class Xcls_Box14 : Object
- {
- public Gtk.Box el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_Box14(Xcls_MainWindow _owner )
- {
- _this = _owner;
- this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
-
- // my vars (dec)
-
- // set gobject values
- var child_0 = new Xcls_clutterembed( _this );
- child_0.ref();
- this.el.pack_start ( child_0.el , true,true,0 );
- }
-
- // user defined functions
- }
- public class Xcls_clutterembed : Object
- {
- public GtkClutter.Embed el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_clutterembed(Xcls_MainWindow _owner )
- {
- _this = _owner;
- _this.clutterembed = this;
- this.el = new GtkClutter.Embed();
-
- // my vars (dec)
-
- // set gobject values
- var child_0 = new Xcls_rooview( _this );
- child_0.ref();
- this.el.get_stage().add_child ( child_0.el );
- var child_1 = new Xcls_objectview( _this );
- child_1.ref();
- this.el.get_stage().add_child ( child_1.el );
- var child_2 = new Xcls_codeeditview( _this );
- child_2.ref();
- this.el.get_stage().add_child ( child_2.el );
- var child_3 = new Xcls_addpropsview( _this );
- child_3.ref();
- this.el.get_stage().add_child ( child_3.el );
- var child_4 = new Xcls_buttonlayout( _this );
- child_4.ref();
- this.el.get_stage().add_child ( child_4.el );
-
- // init method
-
- var stage = this.el.get_stage();
- stage.set_background_color( Clutter.Color.from_string("#000"));
-
- //listeners
- this.el.size_allocate.connect( ( alloc) => {
- if (_this.windowstate == null) {
- return;
- }
- _this.windowstate.resizeCanvas();
-
- });
- }
-
- // user defined functions
- }
- public class Xcls_rooview : Object
- {
- public GtkClutter.Actor el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_rooview(Xcls_MainWindow _owner )
- {
- _this = _owner;
- _this.rooview = this;
- this.el = new GtkClutter.Actor();
-
- // my vars (dec)
-
- // set gobject values
-
- // init method
-
- {
-
-
- this.el.add_constraint(
- new Clutter.AlignConstraint(
- _this.clutterembed.el.get_stage(),
- Clutter.AlignAxis.X_AXIS,
- 1.0f
- )
- );
-
- //this.el.set_position(100,100);
- this.el.set_pivot_point(1.0f,1.0f);
-
- this.el.set_size(_this.clutterembed.el.get_stage().width-50,
- _this.clutterembed.el.get_stage().height);
-
- }
- }
-
- // user defined functions
- }
-
- public class Xcls_objectview : Object
- {
- public GtkClutter.Actor el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_objectview(Xcls_MainWindow _owner )
- {
- _this = _owner;
- _this.objectview = this;
- this.el = new GtkClutter.Actor();
-
- // my vars (dec)
-
- // set gobject values
-
- // init method
-
- {
-
- /*
- this.el.add_constraint(
- new Clutter.AlignConstraint(
- _this.clutterembed.el.get_stage(),
- Clutter.AlignAxis.X_AXIS,
- 0.0f
- )
- );
- */
- this.el.fixed_x = 50.0f;
- this.el.fixed_y = 0.0f;
- //this.el.set_position(100,100);
- this.el.set_pivot_point(0.0f,0.0f);
- this.el.set_scale(0.0f,1.0f);
- this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,
- _this.clutterembed.el.get_stage().height);
-
- }
- }
-
- // user defined functions
- }
-
- public class Xcls_codeeditview : Object
- {
- public GtkClutter.Actor el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_codeeditview(Xcls_MainWindow _owner )
- {
- _this = _owner;
- _this.codeeditview = this;
- this.el = new GtkClutter.Actor();
-
- // my vars (dec)
-
- // set gobject values
-
- // init method
-
- {
-
- /*
- this.el.add_constraint(
- new Clutter.AlignConstraint(
- _this.clutterembed.el.get_stage(),
- Clutter.AlignAxis.X_AXIS,
- 0.0f
- )
- );
- */
- this.el.fixed_x = 50.0f;
- this.el.fixed_y = 0.0f;
- //this.el.set_position(100,100);
- this.el.set_pivot_point(0.0f,0.0f);
- this.el.set_scale(0.0f,1.0f);
- this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,
- _this.clutterembed.el.get_stage().height);
-
- }
- }
-
- // user defined functions
- }
-
- public class Xcls_addpropsview : Object
- {
- public GtkClutter.Actor el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_addpropsview(Xcls_MainWindow _owner )
- {
- _this = _owner;
- _this.addpropsview = this;
- this.el = new GtkClutter.Actor();
-
- // my vars (dec)
-
- // set gobject values
-
- // init method
-
- {
-
- /*
- this.el.add_constraint(
- new Clutter.AlignConstraint(
- _this.clutterembed.el.get_stage(),
- Clutter.AlignAxis.X_AXIS,
- 0.0f
- )
- );
- */
- this.el.fixed_x = 50.0f;
- this.el.fixed_y = 0.0f;
- //this.el.set_position(100,100);
- this.el.set_pivot_point(0.0f,0.0f);
- this.el.set_scale(0.0f,1.0f);
- this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,
- _this.clutterembed.el.get_stage().height);
-
- }
- }
-
- // user defined functions
- }
-
- public class Xcls_buttonlayout : Object
- {
- public Clutter.Actor el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_buttonlayout(Xcls_MainWindow _owner )
- {
- _this = _owner;
- _this.buttonlayout = this;
- this.el = new Clutter.Actor();
-
- // my vars (dec)
-
- // set gobject values
- var child_0 = new Xcls_BoxLayout21( _this );
- child_0.ref();
- this.el.layout_manager = child_0.el;
- var child_1 = new Xcls_backbutton( _this );
- child_1.ref();
- this.el.add_child ( child_1.el );
- var child_2 = new Xcls_objectshowbutton( _this );
- child_2.ref();
- this.el.add_child ( child_2.el );
- var child_3 = new Xcls_addpropbutton( _this );
- child_3.ref();
- this.el.add_child ( child_3.el );
- var child_4 = new Xcls_addlistenerbutton( _this );
- child_4.ref();
- this.el.add_child ( child_4.el );
-
- // init method
-
- {
-
- this.el.add_constraint(
- new Clutter.AlignConstraint(
- _this.clutterembed.el.get_stage(),
- Clutter.AlignAxis.X_AXIS,
- 0.0f
- )
- );
-
-
- //this.el.set_position(100,100);
- this.el.set_pivot_point(0.5f,0.5f);
- this.el.set_size(50,
- _this.clutterembed.el.get_stage().height);
-
- }
- }
-
- // user defined functions
- }
- public class Xcls_BoxLayout21 : Object
- {
- public Clutter.BoxLayout el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_BoxLayout21(Xcls_MainWindow _owner )
- {
- _this = _owner;
- this.el = new Clutter.BoxLayout();
-
- // my vars (dec)
-
- // set gobject values
- this.el.orientation = Clutter.Orientation.VERTICAL;
- }
-
- // user defined functions
- }
-
- public class Xcls_backbutton : Object
- {
- public Clutter.Actor el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_backbutton(Xcls_MainWindow _owner )
- {
- _this = _owner;
- _this.backbutton = this;
- this.el = new Clutter.Actor();
-
- // my vars (dec)
-
- // set gobject values
- var child_0 = new Xcls_Actor23( _this );
- child_0.ref();
- this.el.add_child ( child_0.el );
-
- // init method
-
- this.el.set_size(50,50);
- }
-
- // user defined functions
- }
- public class Xcls_Actor23 : Object
- {
- public GtkClutter.Actor el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_Actor23(Xcls_MainWindow _owner )
- {
- _this = _owner;
- this.el = new GtkClutter.Actor();
-
- // my vars (dec)
-
- // set gobject values
- var child_0 = new Xcls_Button24( _this );
- child_0.ref();
-
- // init method
-
- ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
+ this.el.add ( child_0.el );
+ var child_1 = new Xcls_Box14( _this );
+ child_1.ref();
+ this.el.add2 ( child_1.el );
}
// user defined functions
}
- public class Xcls_Button24 : Object
+ public class Xcls_leftpane : Object
{
- public Gtk.Button el;
+ public Gtk.Box el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_Button24(Xcls_MainWindow _owner )
+ public Xcls_leftpane(Xcls_MainWindow _owner )
{
_this = _owner;
- this.el = new Gtk.Button();
+ _this.leftpane = this;
+ this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
// my vars (dec)
// set gobject values
- this.el.width_request = 50;
- this.el.height_request = 50;
- this.el.tooltip_text = "Back";
- var child_0 = new Xcls_Image25( _this );
+ var child_0 = new Xcls_editpane( _this );
child_0.ref();
- this.el.set_image ( child_0.el );
-
- //listeners
- this.el.clicked.connect( ( ) => {
- // if (_this.windowstate.state == WindowState.State.FILEPROJECT) {
-
- // _this.windowstate.switchState(WindowState.State.FILES);
- // } else {
- _this.windowstate.switchState(WindowState.State.PREVIEW);
- // }
-
-
- });
- }
-
- // user defined functions
- }
- public class Xcls_Image25 : Object
- {
- public Gtk.Image el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_Image25(Xcls_MainWindow _owner )
- {
- _this = _owner;
- this.el = new Gtk.Image();
-
- // my vars (dec)
-
- // set gobject values
- this.el.icon_name = "go-previous";
+ this.el.pack_start ( child_0.el , true,true,0 );
}
// user defined functions
}
-
-
-
-
- public class Xcls_objectshowbutton : Object
+ public class Xcls_editpane : Object
{
- public Clutter.Actor el;
+ public Gtk.Paned el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_objectshowbutton(Xcls_MainWindow _owner )
+ public Xcls_editpane(Xcls_MainWindow _owner )
{
_this = _owner;
- _this.objectshowbutton = this;
- this.el = new Clutter.Actor();
+ _this.editpane = this;
+ this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
// my vars (dec)
// set gobject values
- var child_0 = new Xcls_Actor27( _this );
+ var child_0 = new Xcls_tree( _this );
child_0.ref();
- this.el.add_child ( child_0.el );
-
- // init method
-
- this.el.set_size(50,50);
+ this.el.add1 ( child_0.el );
+ var child_1 = new Xcls_props( _this );
+ child_1.ref();
+ this.el.add2 ( child_1.el );
//listeners
- this.el.enter_event.connect( ( event) => {
- this.el.background_color = Clutter.Color.from_string("#333");
- return false;
- });
- this.el.leave_event.connect( ( event) => {
- this.el.background_color = Clutter.Color.from_string("#000");
- return false;
+ this.el.accept_position.connect( () => {
+ GLib.debug("Accept postion");
+ return true;
});
- }
-
- // user defined functions
- }
- public class Xcls_Actor27 : Object
- {
- public GtkClutter.Actor el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_Actor27(Xcls_MainWindow _owner )
- {
- _this = _owner;
- this.el = new GtkClutter.Actor();
-
- // my vars (dec)
-
- // set gobject values
- var child_0 = new Xcls_Button28( _this );
- child_0.ref();
-
- // init method
-
- ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
- }
-
- // user defined functions
- }
- public class Xcls_Button28 : Object
- {
- public Gtk.Button el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_Button28(Xcls_MainWindow _owner )
- {
- _this = _owner;
- this.el = new Gtk.Button();
-
- // my vars (dec)
-
- // set gobject values
- this.el.width_request = 50;
- this.el.height_request = 50;
- this.el.tooltip_text = "Add Child Element";
- var child_0 = new Xcls_Image29( _this );
- child_0.ref();
- this.el.set_image ( child_0.el );
-
- //listeners
- this.el.clicked.connect( ( ) => {
-
-
- _this.windowstate.showAddObject(this.el);
-
+ this.el.move_handle.connect( (scroll) => {
+ GLib.debug("Move handle");
+ return true;
});
}
// user defined functions
}
- public class Xcls_Image29 : Object
- {
- public Gtk.Image el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_Image29(Xcls_MainWindow _owner )
- {
- _this = _owner;
- this.el = new Gtk.Image();
-
- // my vars (dec)
-
- // set gobject values
- this.el.icon_name = "list-add";
- }
-
- // user defined functions
- }
-
-
-
-
- public class Xcls_addpropbutton : Object
- {
- public Clutter.Actor el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_addpropbutton(Xcls_MainWindow _owner )
- {
- _this = _owner;
- _this.addpropbutton = this;
- this.el = new Clutter.Actor();
-
- // my vars (dec)
-
- // set gobject values
- var child_0 = new Xcls_Actor31( _this );
- child_0.ref();
- this.el.add_child ( child_0.el );
-
- // init method
-
- this.el.set_size(50,50);
- }
-
- // user defined functions
- }
- public class Xcls_Actor31 : Object
+ public class Xcls_tree : Object
{
- public GtkClutter.Actor el;
+ public Gtk.Box el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_Actor31(Xcls_MainWindow _owner )
+ public Xcls_tree(Xcls_MainWindow _owner )
{
_this = _owner;
- this.el = new GtkClutter.Actor();
+ _this.tree = this;
+ this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
// my vars (dec)
// set gobject values
- var child_0 = new Xcls_Button32( _this );
- child_0.ref();
-
- // init method
-
- ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
}
// user defined functions
}
- public class Xcls_Button32 : Object
- {
- public Gtk.Button el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_Button32(Xcls_MainWindow _owner )
- {
- _this = _owner;
- this.el = new Gtk.Button();
-
- // my vars (dec)
- // set gobject values
- this.el.width_request = 50;
- this.el.height_request = 50;
- this.el.tooltip_text = "Add Property";
- var child_0 = new Xcls_Image33( _this );
- child_0.ref();
- this.el.set_image ( child_0.el );
-
- //listeners
- this.el.clicked.connect( ( ) => {
-
- _this.windowstate.showProps(this.el, "props");
-
-
- });
- }
-
- // user defined functions
- }
- public class Xcls_Image33 : Object
+ public class Xcls_props : Object
{
- public Gtk.Image el;
+ public Gtk.Box el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_Image33(Xcls_MainWindow _owner )
+ public Xcls_props(Xcls_MainWindow _owner )
{
_this = _owner;
- this.el = new Gtk.Image();
+ _this.props = this;
+ this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
// my vars (dec)
// set gobject values
- this.el.icon_name = "format-justify-left";
}
// user defined functions
-
- public class Xcls_addlistenerbutton : Object
+ public class Xcls_Box14 : Object
{
- public Clutter.Actor el;
+ public Gtk.Box el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_addlistenerbutton(Xcls_MainWindow _owner )
+ public Xcls_Box14(Xcls_MainWindow _owner )
{
_this = _owner;
- _this.addlistenerbutton = this;
- this.el = new Clutter.Actor();
+ this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
// my vars (dec)
// set gobject values
- var child_0 = new Xcls_Actor35( _this );
+ var child_0 = new Xcls_rooviewbox( _this );
child_0.ref();
- this.el.add_child ( child_0.el );
-
- // init method
-
- this.el.set_size(50,50);
+ this.el.add ( child_0.el );
+ var child_1 = new Xcls_codeeditviewbox( _this );
+ child_1.ref();
+ this.el.add ( child_1.el );
}
// user defined functions
}
- public class Xcls_Actor35 : Object
+ public class Xcls_rooviewbox : Object
{
- public GtkClutter.Actor el;
+ public Gtk.Box el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_Actor35(Xcls_MainWindow _owner )
+ public Xcls_rooviewbox(Xcls_MainWindow _owner )
{
_this = _owner;
- this.el = new GtkClutter.Actor();
+ _this.rooviewbox = this;
+ this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
// my vars (dec)
// set gobject values
- var child_0 = new Xcls_Button36( _this );
- child_0.ref();
-
- // init method
-
- ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
+ this.el.vexpand = true;
}
// user defined functions
}
- public class Xcls_Button36 : Object
- {
- public Gtk.Button el;
- private Xcls_MainWindow _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_Button36(Xcls_MainWindow _owner )
- {
- _this = _owner;
- this.el = new Gtk.Button();
- // my vars (dec)
-
- // set gobject values
- this.el.width_request = 50;
- this.el.height_request = 50;
- this.el.tooltip_text = "Add Event Code";
- var child_0 = new Xcls_Image37( _this );
- child_0.ref();
- this.el.set_image ( child_0.el );
-
- //listeners
- this.el.clicked.connect( ( ) => {
-
-
- _this.windowstate.showProps(this.el, "signals");
-
-
- });
- }
-
- // user defined functions
- }
- public class Xcls_Image37 : Object
+ public class Xcls_codeeditviewbox : Object
{
- public Gtk.Image el;
+ public Gtk.Box el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_Image37(Xcls_MainWindow _owner )
+ public Xcls_codeeditviewbox(Xcls_MainWindow _owner )
{
_this = _owner;
- this.el = new Gtk.Image();
+ _this.codeeditviewbox = this;
+ this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
// my vars (dec)
// set gobject values
- this.el.icon_name = "appointment-new";
+ this.el.vexpand = true;
}
// user defined functions
-
-
-
-
-
- public class Xcls_Box38 : Object
+ public class Xcls_Box17 : Object
{
public Gtk.Box el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_Box38(Xcls_MainWindow _owner )
+ public Xcls_Box17(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
// set gobject values
this.el.homogeneous = false;
- var child_0 = new Xcls_Button39( _this );
+ var child_0 = new Xcls_Button18( _this );
child_0.ref();
this.el.add ( child_0.el );
- var child_1 = new Xcls_Button41( _this );
+ var child_1 = new Xcls_Button20( _this );
child_1.ref();
this.el.add ( child_1.el );
- var child_2 = new Xcls_MenuButton43( _this );
+ var child_2 = new Xcls_MenuButton22( _this );
child_2.ref();
this.el.add ( child_2.el );
- var child_3 = new Xcls_Label48( _this );
+ var child_3 = new Xcls_Label27( _this );
child_3.ref();
this.el.pack_start ( child_3.el , true,true,0 );
var child_4 = new Xcls_statusbar( _this );
var child_5 = new Xcls_search_entry( _this );
child_5.ref();
this.el.pack_start ( child_5.el , false,true,0 );
- var child_6 = new Xcls_MenuBar51( _this );
+ var child_6 = new Xcls_MenuBar30( _this );
child_6.ref();
this.el.add ( child_6.el );
var child_7 = new Xcls_statusbar_compile_spinner( _this );
// user defined functions
}
- public class Xcls_Button39 : Object
+ public class Xcls_Button18 : Object
{
public Gtk.Button el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_Button39(Xcls_MainWindow _owner )
+ public Xcls_Button18(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Button();
// my vars (dec)
// set gobject values
- this.el.width_request = 50;
- this.el.height_request = 50;
this.el.always_show_image = true;
this.el.tooltip_text = "Project Details";
this.el.label = "Edit Project Settings";
- var child_0 = new Xcls_Image40( _this );
+ var child_0 = new Xcls_Image19( _this );
child_0.ref();
this.el.set_image ( child_0.el );
_this.windowstate.projectPopoverShow(this.el, _this.project);
-
+
});
}
// user defined functions
}
- public class Xcls_Image40 : Object
+ public class Xcls_Image19 : Object
{
public Gtk.Image el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_Image40(Xcls_MainWindow _owner )
+ public Xcls_Image19(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Image();
}
- public class Xcls_Button41 : Object
+ public class Xcls_Button20 : Object
{
public Gtk.Button el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_Button41(Xcls_MainWindow _owner )
+ public Xcls_Button20(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Button();
// my vars (dec)
// set gobject values
- this.el.width_request = 50;
- this.el.height_request = 50;
this.el.always_show_image = true;
this.el.tooltip_text = "File Details";
this.el.label = "Edit File Properties";
- var child_0 = new Xcls_Image42( _this );
+ var child_0 = new Xcls_Image21( _this );
child_0.ref();
this.el.set_image ( child_0.el );
// user defined functions
}
- public class Xcls_Image42 : Object
+ public class Xcls_Image21 : Object
{
public Gtk.Image el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_Image42(Xcls_MainWindow _owner )
+ public Xcls_Image21(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Image();
}
- public class Xcls_MenuButton43 : Object
+ public class Xcls_MenuButton22 : Object
{
public Gtk.MenuButton el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_MenuButton43(Xcls_MainWindow _owner )
+ public Xcls_MenuButton22(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.MenuButton();
var child_0 = new Xcls_topbarmenu( _this );
child_0.ref();
this.el.set_popup ( child_0.el );
- var child_1 = new Xcls_Image47( _this );
+ var child_1 = new Xcls_Image26( _this );
child_1.ref();
this.el.set_image ( child_1.el );
}
// my vars (dec)
// set gobject values
- var child_0 = new Xcls_MenuItem45( _this );
+ var child_0 = new Xcls_MenuItem24( _this );
child_0.ref();
this.el.append ( child_0.el );
- var child_1 = new Xcls_MenuItem46( _this );
+ var child_1 = new Xcls_MenuItem25( _this );
child_1.ref();
this.el.append ( child_1.el );
// user defined functions
}
- public class Xcls_MenuItem45 : Object
+ public class Xcls_MenuItem24 : Object
{
public Gtk.MenuItem el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_MenuItem45(Xcls_MainWindow _owner )
+ public Xcls_MenuItem24(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_MenuItem46 : Object
+ public class Xcls_MenuItem25 : Object
{
public Gtk.MenuItem el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_MenuItem46(Xcls_MainWindow _owner )
+ public Xcls_MenuItem25(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
}
- public class Xcls_Image47 : Object
+ public class Xcls_Image26 : Object
{
public Gtk.Image el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_Image47(Xcls_MainWindow _owner )
+ public Xcls_Image26(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Image();
}
- public class Xcls_Label48 : Object
+ public class Xcls_Label27 : Object
{
public Gtk.Label el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_Label48(Xcls_MainWindow _owner )
+ public Xcls_Label27(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Label( " " );
// my vars (dec)
// set gobject values
+ this.el.width_request = 300;
// init method
}
}
- public class Xcls_MenuBar51 : Object
+ public class Xcls_MenuBar30 : Object
{
public Gtk.MenuBar el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_MenuBar51(Xcls_MainWindow _owner )
+ public Xcls_MenuBar30(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.MenuBar();
// set gobject values
this.el.always_show_image = true;
this.el.label = "Matches";
- var child_0 = new Xcls_Image53( _this );
+ var child_0 = new Xcls_Image32( _this );
child_0.ref();
this.el.set_image ( child_0.el );
// user defined functions
}
- public class Xcls_Image53 : Object
+ public class Xcls_Image32 : Object
{
public Gtk.Image el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_Image53(Xcls_MainWindow _owner )
+ public Xcls_Image32(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Image();
// set gobject values
this.el.always_show_image = true;
this.el.label = "Errors";
- var child_0 = new Xcls_Image56( _this );
+ var child_0 = new Xcls_Image35( _this );
child_0.ref();
this.el.set_image ( child_0.el );
}
}
- public class Xcls_Image56 : Object
+ public class Xcls_Image35 : Object
{
public Gtk.Image el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_Image56(Xcls_MainWindow _owner )
+ public Xcls_Image35(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Image();
// set gobject values
this.el.always_show_image = true;
this.el.label = "Warnings";
- var child_0 = new Xcls_Image58( _this );
+ var child_0 = new Xcls_Image37( _this );
child_0.ref();
this.el.set_image ( child_0.el );
}
}
- public class Xcls_Image58 : Object
+ public class Xcls_Image37 : Object
{
public Gtk.Image el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_Image58(Xcls_MainWindow _owner )
+ public Xcls_Image37(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Image();
// set gobject values
this.el.always_show_image = true;
this.el.label = "Depricated";
- var child_0 = new Xcls_Image60( _this );
+ var child_0 = new Xcls_Image39( _this );
child_0.ref();
this.el.set_image ( child_0.el );
}
}
- public class Xcls_Image60 : Object
+ public class Xcls_Image39 : Object
{
public Gtk.Image el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_Image60(Xcls_MainWindow _owner )
+ public Xcls_Image39(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Image();
// set gobject values
this.el.always_show_image = true;
this.el.label = "Run";
- var child_0 = new Xcls_Image62( _this );
+ var child_0 = new Xcls_Image41( _this );
child_0.ref();
this.el.set_image ( child_0.el );
// user defined functions
}
- public class Xcls_Image62 : Object
+ public class Xcls_Image41 : Object
{
public Gtk.Image el;
private Xcls_MainWindow _this;
// my vars (def)
// ctor
- public Xcls_Image62(Xcls_MainWindow _owner )
+ public Xcls_Image41(Xcls_MainWindow _owner )
{
_this = _owner;
this.el = new Gtk.Image();
{
- "name" : "WindowLeftProps",
- "parent" : "",
- "title" : "",
- "path" : "/home/alan/gitlive/roobuilder/src/Builder4/WindowLeftProps.bjs",
- "permname" : "",
- "modOrder" : "",
"build_module" : "builder",
"items" : [
{
- "# bool allow_edit" : false,
- "| void updateKey" : "(string oldkey, string type, string key ) {\n\n \n\t\n\t_this.model.el.foreach((mod, path, iter) => {\n\t\t \n \n \t \n \n\t\t GLib.Value gvaltype, gval,kvalue;\n\t\t mod.get_value(iter, 1 , out gval); // one is key..\n\t\t\n\t mod.get_value(iter,0, out gvaltype);\n\t \n \t mod.get_value(iter,3, out kvalue);\n\t \n\t if (oldkey == ((string)gval) && type == ((string)gvaltype)) {\n\t \n\t\t \t //print(\"update iter type=%s, key=%s value=%s\\n\", type, key,(string) kvalue);\n\t \n \t \t this.updateIter(iter, type, key, (string)kvalue);\n \t \t return true;\n\t \t }\n\t \n\n\t\treturn false;\n\t});\n\t\n\tthis.changed();\n\n\n}\n",
- "id" : "LeftProps",
- "| void before_edit" : "()\n{\n\n GLib.debug(\"before edit - stop editing\\n\");\n \n // these do not appear to trigger save...\n _this.keyrender.el.stop_editing(false);\n _this.keyrender.el.editable =false;\n\n _this.valrender.el.stop_editing(false);\n _this.valrender.el.editable =false; \n \n \n// technicall stop the popup editor..\n\n}\n",
- "| string keySortFormat" : "(string key) {\n // listeners first - with 0\n // specials\n if (key[0] == '*') {\n return \"1 \" + key;\n }\n // functions\n \n var bits = key.split(\" \");\n \n if (key[0] == '|') {\n return \"2 \" + bits[bits.length -1];\n }\n // signals\n if (key[0] == '@') {\n return \"3 \" + bits[bits.length -1];\n }\n \n // props\n if (key[0] == '#') {\n return \"4 \" + bits[bits.length -1];\n }\n // the rest..\n return \"5 \" + bits[bits.length -1]; \n\n\n\n}",
- "| void finish_editing" : "() {\n // \n this.before_edit();\n}",
- "| bool startEditingValue" : "( Gtk.TreePath path) {\n\n // ONLY return true if editing is allowed - eg. combo..\n\n GLib.debug(\"start editing?\\n\");\n if (!this.stop_editor()) {\n GLib.debug(\"stop editor failed\\n\");\n return false;\n }\n \n Gtk.TreeIter iter;\n\n var mod = this.model.el;\n mod.get_iter (out iter, path);\n \n /*\n m.set(iter, \n 0, \"listener\",\n 1, miter.get_key(),\n 2, \"<b>\" + miter.get_key() + \"</b>\",\n 3, miter.get_value()\n ); \n \n */\n GLib.Value gval;\n mod.get_value(iter, 3 , out gval);\n var val = (string)gval;\n\n mod.get_value(iter, 1 , out gval);\n var key = (string)gval;\n \n \n string kname, kflag, ktype;\n this.node.normalize_key(key, out kname, out kflag, out ktype);\n \n \n mod.get_value(iter, 0 , out gval);\n var type = (string)gval; // listerner or prop..\n \n \n \n var use_textarea = false;\n\n //------------ things that require the text editor...\n \n if (type == \"listener\") {\n use_textarea = true;\n }\n if (key.length > 0 && key[0] == '|') { // user defined method\n use_textarea = true;\n }\n if (key.length > 0 && key[0] == '$') { // raw string\n use_textarea = true;\n }\n if (key.length > 0 && key == \"* init\") {\n use_textarea = true;\n }\n if (val.length > 40) { // long value...\n use_textarea = true;\n }\n \n \n \n if (use_textarea) {\n GLib.debug(\"Call show editor\\n\");\n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n this.view.el.get_selection().select_path(path);\n \n this.show_editor(file, node, type, key);\n \n return false;\n });\n \n \n return false;\n }\n \n var pal = this.file.project.palete;\n \n string[] opts;\n var has_opts = pal.typeOptions(this.node.fqn(), kname, ktype, out opts);\n \n \n \n // others... - fill in options for true/false?\n GLib.debug(\"turn on editing %s \\n\" , mod.get_path(iter).to_string());\n \n GLib.debug (ktype.up());\n if (has_opts) {\n GLib.debug(\"start editing try/false)???\");\n this.valrender.el.has_entry = false;\n \n this.valrender.setOptions(opts);\n \n this.valrender.el.has_entry = false;\n this.valrender.el.editable = true;\n this.allow_edit = true;\n GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {\n this.view.el.set_cursor_on_cell(\n path,\n this.valcol.el,\n this.valrender.el,\n true\n );\n return false;\n });\n return true;\n }\n \n // see if type is a Enum.\n \n \n \n \n \n opts = { };\n this.valrender.setOptions(opts);\n \n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n \n // at this point - work out the type...\n // if its' a combo... then show the options..\n this.valrender.el.has_entry = true;\n \n this.valrender.el.editable = true; \n \n \n this.allow_edit = true;\n \n \n \n \n\n this.view.el.set_cursor_on_cell(\n path,\n this.valcol.el,\n this.valrender.el,\n true\n );\n return false;\n });\n return false;\n}\n",
- "| void load" : "(JsRender.JsRender file, JsRender.Node? node) \n{\n GLib.debug(\"load leftprops\\n\");\n this.before_edit();\n this.node = node;\n this.file = file;\n \n \n this.model.el.clear();\n \n //this.get('/RightEditor').el.hide();\n if (node ==null) {\n return ;\n }\n \n \n\n //var provider = this.get('/LeftTree').getPaleteProvider();\n Gtk.TreeIter iter;\n \n //typeof(string), // 0 key type\n //typeof(string), // 1 key\n //typeof(string), // 2 key (display)\n //typeof(string), // 3 value\n //typeof(string), // 4 value (display)\n //typeof(string), // 5 both (tooltip)\n \n \n \n // really need a way to sort the hashmap...\n var m = this.model.el;\n \n var miter = node.listeners.map_iterator();\n var i = 0;\n \n while(miter.next()) {\n i++;\n m.append(out iter,null);\n \n this.updateIter(iter, \"listener\", miter.get_key(), miter.get_value());\n \n \n }\n \n \n miter = node.props.map_iterator();\n \n \n while(miter.next()) {\n i++;\n m.append(out iter,null);\n this.updateIter(iter, \"prop\", miter.get_key(), miter.get_value());\n \n }\n GLib.debug(\"clear selection\\n\");\n // clear selection?\n this.model.el.set_sort_column_id(6,Gtk.SortType.ASCENDING); // sort by real key..\n \n this.view.el.get_selection().unselect_all();\n \n var pane = _this.main_window.editpane.el;\n var try_size = (i * 25) + 60; // est. 20px per line + 40px header\n GLib.Timeout.add_seconds(1, () => { \n\t\t// max 80%...\n\t\tpane.set_position( \n\t\t ((try_size * 1.0f) / (pane.max_position * 1.0f)) > 0.8f ? \n\t\t (int) (pane.max_position * 0.2f) :\n\t\t pane.max_position-try_size);\n\t return GLib.Source.REMOVE;\n\t});\n \n}\n",
- "xtype" : "Box",
- "| string keyFormat" : "(string val, string type) {\n \n // Glib.markup_escape_text(val);\n\n if (type == \"listener\") {\n return \"<span font_weight=\\\"bold\\\" color=\\\"#660000\\\">\" + \n GLib.Markup.escape_text(val) +\n \"</span>\";\n }\n // property..\n if (val.length < 1) {\n return \"<span color=\\\"#FF0000\\\">--empty--</span>\";\n }\n \n //@ = signal\n //$ = property with \n //# - object properties\n //* = special\n // all of these... - display value is last element..\n var ar = val.strip().split(\" \");\n \n \n var dval = GLib.Markup.escape_text(ar[ar.length-1]);\n \n \n \n \n switch(val[0]) {\n case '@': // signal // just bold balck?\n if (dval[0] == '@') {\n dval = dval.substring(1);\n }\n \n return @\"<span font_weight=\\\"bold\\\">@ $dval</span>\"; \n case '#': // object properties?\n if (dval[0] == '#') {\n dval = dval.substring(1);\n }\n return @\"<span font_weight=\\\"bold\\\">$dval</span>\";\n case '*': // special\n if (dval[0] == '*') {\n dval = dval.substring(1);\n }\n return @\"<span color=\\\"#0000CC\\\" font_weight=\\\"bold\\\">$dval</span>\"; \n case '$':\n if (dval[0] == '$') {\n dval = dval.substring(1);\n }\n return @\"<span style=\\\"italic\\\">$dval</span>\";\n case '|': // user defined methods\n if (dval[0] == '|') {\n dval = dval.substring(1);\n }\n return @\"<span color=\\\"#008000\\\" font_weight=\\\"bold\\\">$dval</span>\";\n \n \n \n default:\n return dval;\n }\n \n \n\n}",
"# JsRender.JsRender file" : "",
+ "# JsRender.Node node" : "",
+ "# Xcls_MainWindow main_window" : "null",
+ "# bool allow_edit" : false,
+ "$ homogeneous" : "false ",
+ "$ xns" : "Gtk",
"@ bool stop_editor" : "()",
- "@ void show_editor" : "(JsRender.JsRender file, JsRender.Node node, string type, string key)",
"@ void changed" : "()",
- "| void deleteSelected" : " () {\n \n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n \n var s = this.view.el.get_selection();\n s.get_selected(out mod, out iter);\n \n \n GLib.Value gval;\n mod.get_value(iter, 0 , out gval);\n var type = (string)gval;\n \n mod.get_value(iter, 1 , out gval);\n var key = (string)gval;\n \n switch(type) {\n case \"listener\":\n this.node.listeners.unset(key);\n break;\n \n case \"props\":\n this.node.props.unset(key);\n break;\n }\n this.load(this.file, this.node);\n \n _this.changed();\n}",
- "$ xns" : "Gtk",
- "| void startEditingKey" : "( Gtk.TreePath path) {\n \n if (!this.stop_editor()) {\n return;\n }\n \n // others... - fill in options for true/false?\n \n \n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n this.allow_edit = true;\n this.keyrender.el.editable = true;\n \n this.view.el.set_cursor_on_cell(\n path,\n this.keycol.el,\n this.keyrender.el,\n true\n );\n \n return false;\n });\n \n \n}\n",
"@ void show_add_props" : "(string type)",
+ "@ void show_editor" : "(JsRender.JsRender file, JsRender.Node node, string type, string key)",
"Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
- "$ homogeneous" : "false ",
- "# Xcls_MainWindow main_window" : "null",
- "| void addProp" : " (string in_type, string key, string value, string value_type) {\n // info includes key, val, skel, etype..\n //console.dump(info);\n //type = info.type.toLowerCase();\n //var data = this.toJS();\n \n var type = in_type == \"signals\" ? \"listener\" : in_type;\n \n var fkey = (value_type.length > 0 ? value_type + \" \" : \"\") + key;\n \n if (type == \"listener\") {\n if (this.node.listeners.has_key(key)) {\n return;\n }\n this.node.listeners.set(key,value);\n } else {\n assert(this.node != null);\n assert(this.node.props != null);\n if (this.node.props.has_key(fkey)) {\n return;\n }\n this.node.props.set(fkey,value);\n }\n \n \n // add a row???\n this.load(this.file, this.node);\n \n \n \n /// need to find the row which I've just added..\n \n \n var s = this.view.el.get_selection();\n s.unselect_all();\n \n GLib.debug(\"trying to find new iter\");\n \n this.model.el.foreach((model, path, iter) => {\n GLib.Value gval;\n \n this.model.el.get_value(iter, 0 , out gval);\n if ((string)gval != type) {\n GLib.debug(\"not type: %s = %s\\n\", (string)gval , type);\n return false;\n }\n this.model.el.get_value(iter, 1 , out gval);\n if ((string)gval != fkey) {\n GLib.debug(\"not key: %s = %s\\n\", (string)gval , fkey);\n return false;\n }\n // delay this?\n GLib.Timeout.add_full(GLib.Priority.DEFAULT,40 , () => {\n \n this.startEditingValue(this.model.el.get_path(iter));\n return false;\n });\n //s.select_iter(iter);\n return true; \n });\n \n \n \n \n}\n",
- "| void updateIter" : "(Gtk.TreeIter iter, string type, string key, string kvalue) {\n\n //print(\"update Iter %s, %s\\n\", key,kvalue);\n //typeof(string), // 0 key type\n //typeof(string), // 1 key\n //typeof(string), // 2 key (display)\n //typeof(string), // 3 value\n //typeof(string), // 4 value (display)\n //typeof(string), // 5 both (tooltip)\n //typeof(string), // 6 key (sort)\n \n var dl = kvalue.strip().split(\"\\n\");\n\n var dis_val = dl.length > 1 ? (dl[0].strip()+ \"...\") : dl[0];\n \n if (type == \"listener\") {\n \n \n \n this.model.el.set(iter, \n 0, type,\n 1, key,\n 2, this.keyFormat(key ,type),\n 3, kvalue,\n 4, dis_val,\n 5, \"<tt>\" + GLib.Markup.escape_text(key + \" \" +kvalue) + \"</tt>\",\n 6, \"0 \" + key\n ); \n return;\n }\n \n\n\n this.model.el.set(iter, \n 0, \"props\",\n 1, key,\n 2, this.keyFormat(key , \"prop\"),\n 3, kvalue,\n 4, dis_val,\n 5, \"<tt>\" + GLib.Markup.escape_text(key + \" \" + kvalue) + \"</tt>\",\n 6, this.keySortFormat(key)\n ); \n}",
- "# JsRender.Node node" : "",
+ "id" : "LeftProps",
"items" : [
{
- "* pack" : "pack_start,false,true,0",
- "xtype" : "Box",
"$ xns" : "Gtk",
+ "* pack" : "pack_start,false,true,0",
"Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
"items" : [
{
- "listeners" : {
- "button_press_event" : " (self, ev) => {\n _this.before_edit();\n \n \n var p = _this.AddPropertyPopup;\n p.el.set_screen(Gdk.Screen.get_default());\n p.el.show_all();\n p.el.popup(null, null, null, ev.button, ev.time);\n return true;\n}"
- },
- "bool hexpand" : true,
+ "$ xns" : "Gtk",
"* pack" : "add",
- "xtype" : "Button",
+ "int margin_left" : 5,
+ "int margin_right" : 5,
+ "string label" : "Add:",
+ "xtype" : "Label"
+ },
+ {
"$ xns" : "Gtk",
+ "* pack" : "add",
+ "bool hexpand" : true,
"items" : [
{
- "* pack" : "add",
- "xtype" : "Box",
"$ xns" : "Gtk",
- "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
- "items" : [
- {
- "$ Gtk.Stock stock" : "Gtk.Stock.ADD",
- "xtype" : "Image",
- "* pack" : "add",
- "$ xns" : "Gtk",
- "$ icon_size" : "Gtk.IconSize.MENU"
- },
- {
- "label" : "Other",
- "* pack" : "add",
- "xtype" : "Label",
- "$ xns" : "Gtk"
- }
- ]
- },
- {
- "id" : "AddPropertyPopup",
"* pack" : false,
- "xtype" : "Menu",
- "$ xns" : "Gtk",
+ "id" : "AddPropertyPopup",
"items" : [
{
+ "$ xns" : "Gtk",
+ "* pack" : "append",
+ "label" : "id: _this.{ID} (Vala)",
"listeners" : {
- "activate" : " () => {\n _this.addProp( \"prop\", \"id\", \"\", \"\");\n}"
+ "activate" : [
+ " () => {",
+ " _this.addProp( \"prop\", \"id\", \"\", \"\");",
+ "}"
+ ]
},
- "label" : "id: _this.{ID} (Vala)",
- "* pack" : "append",
- "xtype" : "MenuItem",
"tooltip_markup" : "Using _this.{ID} will map to this element",
- "$ xns" : "Gtk"
+ "xtype" : "MenuItem"
},
{
+ "$ xns" : "Gtk",
+ "* pack" : "append",
+ "label" : "pack: Pack method (Vala)",
"listeners" : {
- "activate" : " ( ) => {\n\n _this.addProp( \"prop\", \"pack\",\"add\", \"*\");\n}"
+ "activate" : [
+ " ( ) => {",
+ "",
+ " _this.addProp( \"prop\", \"pack\",\"add\", \"*\");",
+ "}"
+ ]
},
- "label" : "pack: Pack method (Vala)",
- "xtype" : "MenuItem",
- "* pack" : "append",
"tooltip_markup" : "how to pack this element onto parent, (method, 2nd arg, 3rd arg) .. the 1st argument is filled by the element",
- "$ xns" : "Gtk"
+ "xtype" : "MenuItem"
},
{
+ "$ xns" : "Gtk",
+ "* pack" : "append",
+ "label" : "ctor: Alterative to default contructor (Vala)",
"listeners" : {
- "activate" : " ( ) => {\n\n _this.addProp( \"prop\", \"ctor\",\"\", \"*\");\n}"
+ "activate" : [
+ " ( ) => {",
+ "",
+ " _this.addProp( \"prop\", \"ctor\",\"\", \"*\");",
+ "}"
+ ]
},
- "label" : "ctor: Alterative to default contructor (Vala)",
- "* pack" : "append",
- "xtype" : "MenuItem",
- "tooltip_markup" : "eg. \n\nnew Clutter.Image.from_file(.....)",
- "$ xns" : "Gtk"
+ "tooltip_markup" : [
+ "eg. ",
+ "",
+ "new Clutter.Image.from_file(.....)"
+ ],
+ "xtype" : "MenuItem"
},
{
+ "$ xns" : "Gtk",
+ "* pack" : "append",
+ "label" : "init: initialziation code (vala)",
"listeners" : {
- "activate" : " ( ) => {\n\n _this.addProp( \"prop\", \"init\", \"{\\n\\n}\\n\", \"*\" );\n}"
+ "activate" : [
+ " ( ) => {",
+ "",
+ " _this.addProp( \"prop\", \"init\", \"{\\n\\n}\\n\", \"*\" );",
+ "}"
+ ]
},
- "label" : "init: initialziation code (vala)",
- "* pack" : "append",
- "xtype" : "MenuItem",
"tooltip_markup" : "This code is called after the ctor",
- "$ xns" : "Gtk"
+ "xtype" : "MenuItem"
},
{
+ "$ xns" : "Gtk",
+ "* pack" : "append",
+ "label" : "cms-id: (Roo JS/Pman library)",
"listeners" : {
- "activate" : " () => {\n _this.addProp( \"prop\", \"cms-id\", \"\", \"string\");\n}"
+ "activate" : [
+ " () => {",
+ " _this.addProp( \"prop\", \"cms-id\", \"\", \"string\");",
+ "}"
+ ]
},
- "label" : "cms-id: (Roo JS/Pman library)",
- "xtype" : "MenuItem",
- "* pack" : "append",
- "tooltip_markup" : "set the cms-id for this element, when converted to javascript, the html value will be wrapped with Pman.Cms.content({cms-id},{original-html})\n",
- "$ xns" : "Gtk"
+ "tooltip_markup" : [
+ "set the cms-id for this element, when converted to javascript, the html value will be wrapped with Pman.Cms.content({cms-id},{original-html})",
+ ""
+ ],
+ "xtype" : "MenuItem"
},
{
+ "$ xns" : "Gtk",
"* pack" : "add",
- "xtype" : "SeparatorMenuItem",
- "$ xns" : "Gtk"
+ "xtype" : "SeparatorMenuItem"
},
{
+ "$ xns" : "Gtk",
+ "* pack" : "append",
+ "label" : "String",
"listeners" : {
- "activate" : " (self) => {\n\n _this.addProp( \"prop\", \"XXXX\", \"\",\"string\");\n\n}"
+ "activate" : [
+ " (self) => {",
+ "",
+ " _this.addProp( \"prop\", \"XXXX\", \"\",\"string\");",
+ "",
+ "}"
+ ]
},
- "label" : "String",
- "* pack" : "append",
- "xtype" : "MenuItem",
"tooltip_markup" : "Add a user defined string property",
- "$ xns" : "Gtk"
+ "xtype" : "MenuItem"
},
{
+ "$ xns" : "Gtk",
+ "* pack" : "append",
+ "label" : "Number",
"listeners" : {
- "activate" : " ( ) =>{\n\n _this.addProp(\"prop\", \"XXX\", \"0\", \"int\");\n}"
+ "activate" : [
+ " ( ) =>{",
+ "",
+ " _this.addProp(\"prop\", \"XXX\", \"0\", \"int\");",
+ "}"
+ ]
},
- "label" : "Number",
- "* pack" : "append",
- "xtype" : "MenuItem",
"tooltip_markup" : "Add a user defined number property",
- "$ xns" : "Gtk"
+ "xtype" : "MenuItem"
},
{
+ "$ xns" : "Gtk",
+ "* pack" : "append",
+ "label" : "Boolean",
"listeners" : {
- "activate" : " ( ) =>{\n\n _this.addProp( \"prop\", \"XXX\", \"true\", \"bool\");\n}"
+ "activate" : [
+ " ( ) =>{",
+ "",
+ " _this.addProp( \"prop\", \"XXX\", \"true\", \"bool\");",
+ "}"
+ ]
},
- "label" : "Boolean",
- "* pack" : "append",
- "xtype" : "MenuItem",
"tooltip_markup" : "Add a user defined boolean property",
- "$ xns" : "Gtk"
+ "xtype" : "MenuItem"
},
{
+ "$ xns" : "Gtk",
"* pack" : "add",
- "xtype" : "SeparatorMenuItem",
- "$ xns" : "Gtk"
+ "xtype" : "SeparatorMenuItem"
},
{
+ "$ xns" : "Gtk",
+ "* pack" : "append",
+ "label" : "Javascript Function",
"listeners" : {
- "activate" : " ( ) =>{\n\n _this.addProp(\"prop\", \"XXXX\", \"function() { }\", \"| function\");\n}"
+ "activate" : [
+ " ( ) =>{",
+ "",
+ " _this.addProp(\"prop\", \"XXXX\", \"function() { }\", \"| function\");",
+ "}"
+ ]
},
- "label" : "Javascript Function",
- "* pack" : "append",
- "xtype" : "MenuItem",
"tooltip_markup" : "Add a user function boolean property",
- "$ xns" : "Gtk"
+ "xtype" : "MenuItem"
},
{
+ "$ xns" : "Gtk",
+ "* pack" : "append",
+ "label" : "Vala Method",
"listeners" : {
- "activate" : " ( ) =>{\n\n _this.addProp( \"prop\", \"XXXX\", \"() {\\n\\n}\\n\", \"| return_type\");\n}"
+ "activate" : [
+ " ( ) =>{",
+ "",
+ " _this.addProp( \"prop\", \"XXXX\", \"() {\\n\\n}\\n\", \"| return_type\");",
+ "}"
+ ]
},
- "label" : "Vala Method",
- "xtype" : "MenuItem",
- "* pack" : "append",
"tooltip_markup" : "Add a user function boolean property",
- "$ xns" : "Gtk"
+ "xtype" : "MenuItem"
},
{
+ "$ xns" : "Gtk",
+ "* pack" : "append",
+ "label" : "Vala Signal",
"listeners" : {
- "activate" : " ( ) =>{\n\n _this.addProp( \"prop\", \"XXXX\", \"()\", \"@ void\");\n}"
+ "activate" : [
+ " ( ) =>{",
+ "",
+ " _this.addProp( \"prop\", \"XXXX\", \"()\", \"@ void\");",
+ "}"
+ ]
},
- "label" : "Vala Signal",
- "* pack" : "append",
- "xtype" : "MenuItem",
"tooltip_markup" : "Add a vala signal",
- "$ xns" : "Gtk"
+ "xtype" : "MenuItem"
},
{
+ "$ xns" : "Gtk",
"* pack" : "add",
- "xtype" : "SeparatorMenuItem",
- "$ xns" : "Gtk"
+ "xtype" : "SeparatorMenuItem"
},
{
+ "$ xns" : "Gtk",
+ "* pack" : "append",
+ "label" : "Flexy - If",
"listeners" : {
- "activate" : " ( ) =>{\n\n _this.addProp(\"prop\", \"flexy:if\", \"value_or_condition\", \"string\");\n}"
+ "activate" : [
+ " ( ) =>{",
+ "",
+ " _this.addProp(\"prop\", \"flexy:if\", \"value_or_condition\", \"string\");",
+ "}"
+ ]
},
- "label" : "Flexy - If",
- "* pack" : "append",
- "xtype" : "MenuItem",
"tooltip_markup" : "Add a flexy if (for HTML templates)",
- "$ xns" : "Gtk"
+ "xtype" : "MenuItem"
},
{
+ "$ xns" : "Gtk",
+ "* pack" : "append",
+ "label" : "Flexy - Include",
"listeners" : {
- "activate" : " ( ) =>{\n\n _this.addProp(\"prop\", \"flexy:include\", \"name_of_file.html\", \"string\");\n}"
+ "activate" : [
+ " ( ) =>{",
+ "",
+ " _this.addProp(\"prop\", \"flexy:include\", \"name_of_file.html\", \"string\");",
+ "}"
+ ]
},
- "label" : "Flexy - Include",
- "xtype" : "MenuItem",
- "* pack" : "append",
"tooltip_markup" : "Add a flexy include (for HTML templates)",
- "$ xns" : "Gtk"
+ "xtype" : "MenuItem"
},
{
+ "$ xns" : "Gtk",
+ "* pack" : "append",
+ "label" : "Flexy - Foreach",
"listeners" : {
- "activate" : " ( ) =>{\n\n _this.addProp(\"prop\", \"flexy:foreach\", \"array,key,value\", \"string\");\n}"
+ "activate" : [
+ " ( ) =>{",
+ "",
+ " _this.addProp(\"prop\", \"flexy:foreach\", \"array,key,value\", \"string\");",
+ "}"
+ ]
},
- "label" : "Flexy - Foreach",
- "xtype" : "MenuItem",
- "* pack" : "append",
"tooltip_markup" : "Add a flexy foreach (for HTML templates)",
- "$ xns" : "Gtk"
+ "xtype" : "MenuItem"
}
- ]
+ ],
+ "xtype" : "Menu"
+ },
+ {
+ "$ Gtk.Stock stock" : "Gtk.Stock.ADD",
+ "$ icon_size" : "Gtk.IconSize.MENU",
+ "$ xns" : "Gtk",
+ "* pack" : "set_image",
+ "xtype" : "Image"
+ }
+ ],
+ "listeners" : {
+ "button_press_event" : [
+ " (self, ev) => {",
+ " _this.before_edit();",
+ " ",
+ " ",
+ " var p = _this.AddPropertyPopup;",
+ " p.el.set_screen(Gdk.Screen.get_default());",
+ " p.el.show_all();",
+ " p.el.popup(null, null, null, ev.button, ev.time);",
+ " return true;",
+ "}"
+ ]
+ },
+ "string label" : "Other",
+ "xtype" : "Button"
+ },
+ {
+ "$ tooltip_text" : "\"Add Property\"",
+ "$ xns" : "Gtk",
+ "* pack" : "add",
+ "bool always_show_image" : true,
+ "bool hexpand" : true,
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* pack" : "set_image",
+ "utf8 icon_name" : "format-justify-left",
+ "xtype" : "Image"
+ }
+ ],
+ "listeners" : {
+ "clicked" : [
+ " ( ) => {",
+ " ",
+ " _this.main_window.windowstate.showProps(this.el, \"props\");",
+ " ",
+ "",
+ "}"
+ ]
+ },
+ "string label" : "Property",
+ "xtype" : "Button"
+ },
+ {
+ "$ tooltip_text" : "\"Add Event Code\"",
+ "$ xns" : "Gtk",
+ "* pack" : "add",
+ "bool always_show_image" : true,
+ "bool hexpand" : true,
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* pack" : "set_image",
+ "utf8 icon_name" : "appointment-new",
+ "xtype" : "Image"
}
- ]
+ ],
+ "listeners" : {
+ "clicked" : [
+ " ( ) => {",
+ " ",
+ " ",
+ " _this.main_window.windowstate.showProps(this.el, \"signals\");",
+ "",
+ " ",
+ "}"
+ ]
+ },
+ "string label" : "Event",
+ "xtype" : "Button"
}
- ]
+ ],
+ "xtype" : "Box"
},
{
"# bool editing" : false,
- "id" : "EditProps",
- "* init" : " {\n \n this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n}\n",
"$ shadow_type" : "Gtk.ShadowType.IN",
- "* pack" : "pack_end,true,true,0",
- "xtype" : "ScrolledWindow",
"$ xns" : "Gtk",
+ "* init" : [
+ " {",
+ " ",
+ " this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
+ "}",
+ ""
+ ],
+ "* pack" : "pack_end,true,true,0",
+ "id" : "EditProps",
"items" : [
{
- "listeners" : {
- "button_press_event" : " ( ev) => {\n \n Gtk.TreeViewColumn col;\n int cell_x;\n int cell_y;\n Gtk.TreePath path;\n if (!this.el.get_path_at_pos((int)ev.x, (int) ev.y, out path, out col, out cell_x, out cell_y )) {\n GLib.debug(\"nothing selected on click\");\n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n this.el.get_selection().unselect_all();\n\n return false;\n });\n _this.before_edit();\n return false; //not on a element.\n }\n \n \n // double click on name..\n if (ev.type == Gdk.EventType.2BUTTON_PRESS && ev.button == 1 && col.title == \"Name\") { \n // show popup!. \n \n if (this.popover == null) {\n \t\t this.popover = new Xcls_PopoverProperty();\n \t\t this.popover.mainwindow = _this.main_window;\n \t\t}\n \t\t\n \n _this.before_edit();\n _this.stop_editor();\n\t\t \n _this.keyrender.el.stop_editing(false);\n _this.keyrender.el.editable =false;\n \n _this.valrender.el.stop_editing(false);\n _this.valrender.el.editable =false;\n Gtk.TreeIter iter;\n var mod = this.el.get_model();\n\t\t mod.get_iter (out iter, path);\n\t\t \n \n\t\tGLib.Value gvaltype, gval;\n\t\tmod.get_value(iter, 1 , out gval); // one is key..\n\t\t\n\t mod.get_value(iter,0, out gvaltype);\n\n this.popover.show(this.el, _this.node, (string)gvaltype, (string)gval);\n \n // _this.startEditingKey(path); \n \n return false;\n }\n \n \n \n \n // right click.\n if (ev.type == Gdk.EventType.BUTTON_PRESS && ev.button == 3) { \n // show popup!. \n //if (col.title == \"Value\") {\n // _this.before_edit();\n // return false;\n //}\n\n var p = _this.ContextMenu;\n\n p.el.set_screen(Gdk.Screen.get_default());\n p.el.show_all();\n p.el.popup(null, null, null, ev.button, ev.time);\n //Seed.print(\"click:\" + res.column.title);\n // select the \n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n \n this.el.get_selection().select_path(path);\n return false;\n });\n _this.before_edit();\n return false;\n }\n \n \n if (col.title != \"Value\") {\n GLib.debug(\"col title != Value\");\n \n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n this.el.get_selection().select_path(path);\n return false;\n });\n \n _this.before_edit();\n // XObject.error(\"column is not value?\");\n return false; // ignore.. - key click.. ??? should we do this??\n }\n \n \n // if the cell can be edited with a pulldown\n // then we should return true... - and let the start_editing handle it?\n \n \n \n \n \n \n // _this.before_edit(); <<< we really need to stop the other editor..\n _this.keyrender.el.stop_editing(false);\n _this.keyrender.el.editable =false;\n \n \n return _this.startEditingValue(path); // assumes selected row..\n \n \n\n \n \n}"
- },
- "id" : "view",
- "* init" : "{\n var selection = this.el.get_selection();\n selection.set_mode( Gtk.SelectionMode.SINGLE);\n\n\n var description = new Pango.FontDescription();\n description.set_size(10000);\n this.el.override_font(description);\n}\n",
- "tooltip_column" : 5,
- "xtype" : "TreeView",
"$ enable_tree_lines" : true,
"$ headers_visible" : true,
- "* pack" : "add",
"$ xns" : "Gtk",
+ "* init" : [
+ "{",
+ " var selection = this.el.get_selection();",
+ " selection.set_mode( Gtk.SelectionMode.SINGLE);",
+ "",
+ "",
+ " var description = new Pango.FontDescription();",
+ " description.set_size(10000);",
+ " this.el.override_font(description);",
+ "}",
+ ""
+ ],
+ "* pack" : "add",
"Xcls_PopoverProperty popover" : "null",
+ "id" : "view",
"items" : [
{
- "id" : "model",
- "$ changed" : "function(str, doRefresh) {\n if (!this.activePath) {\n return;\n }\n var iter = new Gtk.TreeIter();\n this.el.get_iter(iter, new Gtk.TreePath.from_string(this.activePath));\n \n this.el.set_value(iter, 1, '' +str);\n this.el.set_value(iter, 3, '' + this.toShort(str));\n var type = this.getIterValue(iter, 4);\n\n this.el.set_value(iter, 5, type + ' : ' + str);\n // update the tree... \n\n this.get('/LeftTree.model').changed(this.toJS(), doRefresh); \n}\n",
+ "$ changed" : [
+ "function(str, doRefresh) {",
+ " if (!this.activePath) {",
+ " return;",
+ " }",
+ " var iter = new Gtk.TreeIter();",
+ " this.el.get_iter(iter, new Gtk.TreePath.from_string(this.activePath));",
+ " ",
+ " this.el.set_value(iter, 1, '' +str);",
+ " this.el.set_value(iter, 3, '' + this.toShort(str));",
+ " var type = this.getIterValue(iter, 4);",
+ "",
+ " this.el.set_value(iter, 5, type + ' : ' + str);",
+ " // update the tree... ",
+ "",
+ " this.get('/LeftTree.model').changed(this.toJS(), doRefresh); ",
+ "}",
+ ""
+ ],
+ "$ columns" : [
+ " typeof(string), // 0 key type",
+ " typeof(string), // 1 key",
+ " typeof(string), // 2 key (display)",
+ " typeof(string), // 3 value",
+ " typeof(string), // 4 value (display)",
+ " typeof(string), // 5 both (tooltip) ",
+ " typeof(string) // 6 key (for sorting)",
+ ""
+ ],
+ "$ toShort" : [
+ "function(str) {",
+ " var a = typeof(str) == 'string' ? str.split(\"\\n\") : [];",
+ " return a.length > 1 ? a[0] + '....' : '' + str;",
+ "}",
+ ""
+ ],
+ "$ xns" : "Gtk",
"* pack" : "set_model",
- "xtype" : "TreeStore",
- "$ columns" : " typeof(string), // 0 key type\n typeof(string), // 1 key\n typeof(string), // 2 key (display)\n typeof(string), // 3 value\n typeof(string), // 4 value (display)\n typeof(string), // 5 both (tooltip) \n typeof(string) // 6 key (for sorting)\n",
+ "id" : "model",
"n_columns" : 7,
- "$ xns" : "Gtk",
- "$ toShort" : "function(str) {\n var a = typeof(str) == 'string' ? str.split(\"\\n\") : [];\n return a.length > 1 ? a[0] + '....' : '' + str;\n}\n"
+ "xtype" : "TreeStore"
},
{
- "id" : "keycol",
- "* init" : " this.el.add_attribute(_this.keyrender.el , \"markup\", 2 );\n this.el.add_attribute(_this.keyrender.el , \"text\", 1 );\n ",
- "title" : "Name",
- "* pack" : "append_column",
- "xtype" : "TreeViewColumn",
"$ resizable" : true,
"$ xns" : "Gtk",
+ "* init" : [
+ " this.el.add_attribute(_this.keyrender.el , \"markup\", 2 );",
+ " this.el.add_attribute(_this.keyrender.el , \"text\", 1 );",
+ " "
+ ],
+ "* pack" : "append_column",
+ "id" : "keycol",
"items" : [
{
+ "$ xns" : "Gtk",
+ "* pack" : "pack_start,false",
+ "id" : "keyrender",
"listeners" : {
- "editing_started" : "( editable, path) => {\n\n Gtk.TreeIter iter;\n _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));\n GLib.Value gval;\n \n\n\n // this.get('/LeftPanel.model').activePath = path;\n _this.model.el.get_value(iter,1, out gval);\n var val = (string)gval;\n \n ((Gtk.Entry)editable).set_text(val); \n}",
- "edited" : " (path, newtext) => {\n GLib.debug(\"Keyrender - signal:edited\\n\");\n \n this.el.editable = false;\n \n \n\n Gtk.TreeIter iter;\n _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));\n GLib.Value gval;\n \n _this.model.el.get_value(iter,1, out gval);\n var oldval = (string)gval;\n \n _this.model.el.get_value(iter,0, out gval);\n var ktype = (string)gval;\n \n _this.model.el.set_value(iter, 1, newtext);\n \n if (oldval == newtext) {\n return;\n }\n \n \n GLib.debug(\"ktype: %s\\n\",ktype);\n switch(ktype) {\n case \"listener\":\n var ov = _this.node.listeners.get(oldval);\n _this.node.listeners.set(newtext, ov);\n _this.node.listeners.unset(oldval);\n \n _this.updateIter(iter, ktype, newtext, ov);\n \n break;\n case \"props\":\n var ov = _this.node.props.get(oldval);\n _this.node.props.set(newtext, ov);\n _this.node.props.unset(oldval);\n _this.updateIter(iter, ktype, newtext, ov);\n break;\n }\n _this.changed();\n \n}"
+ "edited" : [
+ " (path, newtext) => {",
+ " GLib.debug(\"Keyrender - signal:edited\\n\");",
+ " ",
+ " this.el.editable = false;",
+ " ",
+ " ",
+ "",
+ " Gtk.TreeIter iter;",
+ " _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));",
+ " GLib.Value gval;",
+ " ",
+ " _this.model.el.get_value(iter,1, out gval);",
+ " var oldval = (string)gval;",
+ " ",
+ " _this.model.el.get_value(iter,0, out gval);",
+ " var ktype = (string)gval;",
+ " ",
+ " _this.model.el.set_value(iter, 1, newtext);",
+ " ",
+ " if (oldval == newtext) {",
+ " return;",
+ " }",
+ " ",
+ " ",
+ " GLib.debug(\"ktype: %s\\n\",ktype);",
+ " switch(ktype) {",
+ " case \"listener\":",
+ " var ov = _this.node.listeners.get(oldval);",
+ " _this.node.listeners.set(newtext, ov);",
+ " _this.node.listeners.unset(oldval);",
+ " ",
+ " _this.updateIter(iter, ktype, newtext, ov);",
+ " ",
+ " break;",
+ " case \"props\":",
+ " var ov = _this.node.props.get(oldval);",
+ " _this.node.props.set(newtext, ov);",
+ " _this.node.props.unset(oldval);",
+ " _this.updateIter(iter, ktype, newtext, ov);",
+ " break;",
+ " }",
+ " _this.changed();",
+ " ",
+ "}"
+ ],
+ "editing_started" : [
+ "( editable, path) => {",
+ "",
+ " Gtk.TreeIter iter;",
+ " _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));",
+ " GLib.Value gval;",
+ " ",
+ "",
+ "",
+ " // this.get('/LeftPanel.model').activePath = path;",
+ " _this.model.el.get_value(iter,1, out gval);",
+ " var val = (string)gval;",
+ " ",
+ " ((Gtk.Entry)editable).set_text(val); ",
+ "}"
+ ]
},
- "id" : "keyrender",
- "xtype" : "CellRendererText",
- "* pack" : "pack_start,false",
- "$ xns" : "Gtk"
+ "xtype" : "CellRendererText"
}
- ]
+ ],
+ "title" : "Name",
+ "xtype" : "TreeViewColumn"
},
{
- "id" : "valcol",
- "* init" : "{\n\t\n\t// typeof(string), // 0 key type\n // typeof(string), // 1 key\n // typeof(string), // 2 key (display)\n // typeof(string), // 3 value\n // typeof(string) // 4 value (display)\n\n\t\n\tthis.el.add_attribute(_this.valrender.el , \"text\", 4 );\n\t//this.el.add_attribute(_this.valrender.el , \"sensitive\", 4 );\n\t//this.el.add_attribute(this.items[0].el , 'editable', 3 );\n // this.el.set_cell_data_func(cell, age_cell_data_func, NULL, NULL);\n\n //\tthis.get('/LeftPanel').editableColumn= this;\n}\n",
- "* pack" : "append_column",
- "title" : "Value",
- "xtype" : "TreeViewColumn",
"$ resizable" : true,
"$ xns" : "Gtk",
+ "* init" : [
+ "{",
+ "\t",
+ "\t// typeof(string), // 0 key type",
+ " // typeof(string), // 1 key",
+ " // typeof(string), // 2 key (display)",
+ " // typeof(string), // 3 value",
+ " // typeof(string) // 4 value (display)",
+ "",
+ "\t",
+ "\tthis.el.add_attribute(_this.valrender.el , \"text\", 4 );",
+ "\t//this.el.add_attribute(_this.valrender.el , \"sensitive\", 4 );",
+ "\t//this.el.add_attribute(this.items[0].el , 'editable', 3 );",
+ " // this.el.set_cell_data_func(cell, age_cell_data_func, NULL, NULL);",
+ "",
+ " //\tthis.get('/LeftPanel').editableColumn= this;",
+ "}",
+ ""
+ ],
+ "* pack" : "append_column",
+ "id" : "valcol",
"items" : [
{
- "listeners" : {
- "editing_started" : "( editable, path) => {\n //_this.editing = true;\n GLib.debug(\"editing started called\\n\");\n if (!_this.allow_edit) {\n \n GLib.debug(\"val - editing_Started\\n\");\n this.el.editable = false; // make sure it's not editor...\n \n \n return;\n }\n _this.allow_edit =false;\n \n \n if ( this.el.has_entry ) {\n \n Gtk.TreeIter iter;\n _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));\n GLib.Value gval;\n \n\n \n // this.get('/LeftPanel.model').activePath = path;\n _this.model.el.get_value(iter,3, out gval);\n \n\n var val = (string)gval;\n var combo = (Gtk.ComboBox)editable;\n\n var entry = (Gtk.Entry) combo.get_child(); \n entry.set_text(val);\n }\n \n}",
- "edited" : " (path, newtext) => {\n GLib.debug(\"Valrender - signal:edited\\n\");\n \n this.el.editable = false;\n/* \n m.set(iter, \n 0, \"listener\",\n 1, miter.get_key(),\n 2, \"<b>\" + miter.get_key() + \"</b>\",\n 3, miter.get_value(),\n 4, display_value(short);\n ); \n\n */ \n\n Gtk.TreeIter iter;\n _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));\n GLib.Value gval;\n \n _this.model.el.get_value(iter,0, out gval);\n var ktype = (string)gval;\n \n \n _this.model.el.get_value(iter,3, out gval);\n var oldval = (string)gval;\n \n _this.model.el.get_value(iter,1, out gval);\n var key = (string)gval;\n \n \n \n switch(ktype) {\n case \"listener\":\n _this.node.listeners.set(key, newtext);\n _this.updateIter(iter,ktype,key,newtext);\n break;\n case \"props\":\n _this.node.props.set(key,newtext);\n _this.updateIter(iter,ktype, key,newtext); \n break;\n }\n// _this.load(_this.file,_this.node);\n _this.changed();\n \n}"
- },
- "id" : "valrender",
- "* pack" : "pack_start,true",
- "xtype" : "CellRendererCombo",
"$ editable" : false,
"$ has_entry" : true,
"$ xns" : "Gtk",
- "| void setOptions" : "(string[] ar) {\n var m = _this.valrendermodel.el;\n m.clear();\n Gtk.TreeIter iret;\n for (var i =0; i < ar.length; i++) {\n m.append(out iret);\n m.set_value(iret, 0, ar[i]);\n }\n\n}",
- "text_column" : 0,
+ "* pack" : "pack_start,true",
+ "id" : "valrender",
"items" : [
{
- "id" : "valrendermodel",
- "* pack" : false,
- "xtype" : "ListStore",
"$ columns" : "typeof(string)",
- "n_columns" : 1,
"$ xns" : "Gtk",
- "* prop" : "model"
+ "* pack" : false,
+ "* prop" : "model",
+ "id" : "valrendermodel",
+ "n_columns" : 1,
+ "xtype" : "ListStore"
}
+ ],
+ "listeners" : {
+ "edited" : [
+ " (path, newtext) => {",
+ " GLib.debug(\"Valrender - signal:edited\\n\");",
+ " ",
+ " this.el.editable = false;",
+ "/* ",
+ " m.set(iter, ",
+ " 0, \"listener\",",
+ " 1, miter.get_key(),",
+ " 2, \"<b>\" + miter.get_key() + \"</b>\",",
+ " 3, miter.get_value(),",
+ " 4, display_value(short);",
+ " ); ",
+ "",
+ " */ ",
+ "",
+ " Gtk.TreeIter iter;",
+ " _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));",
+ " GLib.Value gval;",
+ " ",
+ " _this.model.el.get_value(iter,0, out gval);",
+ " var ktype = (string)gval;",
+ " ",
+ " ",
+ " _this.model.el.get_value(iter,3, out gval);",
+ " var oldval = (string)gval;",
+ " ",
+ " _this.model.el.get_value(iter,1, out gval);",
+ " var key = (string)gval;",
+ " ",
+ " ",
+ " ",
+ " switch(ktype) {",
+ " case \"listener\":",
+ " _this.node.listeners.set(key, newtext);",
+ " _this.updateIter(iter,ktype,key,newtext);",
+ " break;",
+ " case \"props\":",
+ " _this.node.props.set(key,newtext);",
+ " _this.updateIter(iter,ktype, key,newtext); ",
+ " break;",
+ " }",
+ "// _this.load(_this.file,_this.node);",
+ " _this.changed();",
+ " ",
+ "}"
+ ],
+ "editing_started" : [
+ "( editable, path) => {",
+ " //_this.editing = true;",
+ " GLib.debug(\"editing started called\\n\");",
+ " if (!_this.allow_edit) {",
+ " ",
+ " GLib.debug(\"val - editing_Started\\n\");",
+ " this.el.editable = false; // make sure it's not editor...",
+ " ",
+ " ",
+ " return;",
+ " }",
+ " _this.allow_edit =false;",
+ " ",
+ " ",
+ " if ( this.el.has_entry ) {",
+ " ",
+ " Gtk.TreeIter iter;",
+ " _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));",
+ " GLib.Value gval;",
+ " ",
+ "",
+ " ",
+ " // this.get('/LeftPanel.model').activePath = path;",
+ " _this.model.el.get_value(iter,3, out gval);",
+ " ",
+ "",
+ " var val = (string)gval;",
+ " var combo = (Gtk.ComboBox)editable;",
+ "",
+ " var entry = (Gtk.Entry) combo.get_child(); ",
+ " entry.set_text(val);",
+ " }",
+ " ",
+ "}"
+ ]
+ },
+ "text_column" : 0,
+ "xtype" : "CellRendererCombo",
+ "| void setOptions" : [
+ "(string[] ar) {",
+ " var m = _this.valrendermodel.el;",
+ " m.clear();",
+ " Gtk.TreeIter iret;",
+ " for (var i =0; i < ar.length; i++) {",
+ " m.append(out iret);",
+ " m.set_value(iret, 0, ar[i]);",
+ " }",
+ "",
+ "}"
]
}
- ]
+ ],
+ "title" : "Value",
+ "xtype" : "TreeViewColumn"
},
{
- "id" : "ContextMenu",
- "xtype" : "Menu",
- "* pack" : false,
"$ xns" : "Gtk",
+ "* pack" : false,
+ "id" : "ContextMenu",
"items" : [
{
+ "$ xns" : "Gtk",
+ "* pack" : "append",
+ "label" : "Edit (double click)",
"listeners" : {
- "activate" : " ( ) =>{\n \n var s = _this.view.el.get_selection();\n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n s.get_selected (out mod, out iter);\n \n if (_this.view.popover == null) {\n \t\t _this.view.popover = new Xcls_PopoverProperty();\n \t\t _this.view.popover.mainwindow = _this.main_window;\n \t\t}\n \t\t\n \n _this.before_edit();\n _this.stop_editor();\n\t \n _this.keyrender.el.stop_editing(false);\n _this.keyrender.el.editable =false;\n\n _this.valrender.el.stop_editing(false);\n _this.valrender.el.editable =false;\n \n \n\tGLib.Value gvaltype, gval;\n\tmod.get_value(iter, 1 , out gval); // one is key..\n\t\n mod.get_value(iter,0, out gvaltype);\n\n\t_this.view.popover.show(_this.view.el, _this.node, (string)gvaltype, (string)gval);\n \n \n \n // _this.startEditingKey(model.get_path(iter));\n}"
+ "activate" : [
+ " ( ) =>{",
+ " ",
+ " var s = _this.view.el.get_selection();",
+ " Gtk.TreeIter iter;",
+ " Gtk.TreeModel mod;",
+ " s.get_selected (out mod, out iter);",
+ " ",
+ " if (_this.view.popover == null) {",
+ " \t\t _this.view.popover = new Xcls_PopoverProperty();",
+ " \t\t _this.view.popover.mainwindow = _this.main_window;",
+ " \t\t}",
+ " \t\t",
+ " ",
+ " _this.before_edit();",
+ " _this.stop_editor();",
+ "\t ",
+ " _this.keyrender.el.stop_editing(false);",
+ " _this.keyrender.el.editable =false;",
+ "",
+ " _this.valrender.el.stop_editing(false);",
+ " _this.valrender.el.editable =false;",
+ " ",
+ " ",
+ "\tGLib.Value gvaltype, gval;",
+ "\tmod.get_value(iter, 1 , out gval); // one is key..",
+ "\t",
+ " mod.get_value(iter,0, out gvaltype);",
+ "",
+ "\t_this.view.popover.show(_this.view.el, _this.node, (string)gvaltype, (string)gval);",
+ " ",
+ " ",
+ " ",
+ " // _this.startEditingKey(model.get_path(iter));",
+ "}"
+ ]
},
- "label" : "Edit (double click)",
- "xtype" : "MenuItem",
- "* pack" : "append",
- "$ xns" : "Gtk"
+ "xtype" : "MenuItem"
},
{
+ "$ xns" : "Gtk",
"* pack" : "append",
- "xtype" : "SeparatorMenuItem",
- "$ xns" : "Gtk"
+ "xtype" : "SeparatorMenuItem"
},
{
+ "$ xns" : "Gtk",
+ "* pack" : "append",
+ "label" : "Delete",
"listeners" : {
- "activate" : " ( ) =>{\n\t_this.deleteSelected();\n}"
+ "activate" : [
+ " ( ) =>{",
+ "\t_this.deleteSelected();",
+ "}"
+ ]
},
- "label" : "Delete",
- "xtype" : "MenuItem",
- "* pack" : "append",
- "$ xns" : "Gtk"
+ "xtype" : "MenuItem"
}
- ]
+ ],
+ "xtype" : "Menu"
}
- ]
+ ],
+ "listeners" : {
+ "button_press_event" : [
+ " ( ev) => {",
+ " ",
+ " Gtk.TreeViewColumn col;",
+ " int cell_x;",
+ " int cell_y;",
+ " Gtk.TreePath path;",
+ " if (!this.el.get_path_at_pos((int)ev.x, (int) ev.y, out path, out col, out cell_x, out cell_y )) {",
+ " GLib.debug(\"nothing selected on click\");",
+ " GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {",
+ " this.el.get_selection().unselect_all();",
+ "",
+ " return false;",
+ " });",
+ " _this.before_edit();",
+ " return false; //not on a element.",
+ " }",
+ " ",
+ " ",
+ " // double click on name..",
+ " if (ev.type == Gdk.EventType.2BUTTON_PRESS && ev.button == 1 && col.title == \"Name\") { ",
+ " // show popup!. ",
+ " ",
+ " if (this.popover == null) {",
+ " \t\t this.popover = new Xcls_PopoverProperty();",
+ " \t\t this.popover.mainwindow = _this.main_window;",
+ " \t\t}",
+ " \t\t",
+ " ",
+ " _this.before_edit();",
+ " _this.stop_editor();",
+ "\t\t ",
+ " _this.keyrender.el.stop_editing(false);",
+ " _this.keyrender.el.editable =false;",
+ " ",
+ " _this.valrender.el.stop_editing(false);",
+ " _this.valrender.el.editable =false;",
+ " Gtk.TreeIter iter;",
+ " var mod = this.el.get_model();",
+ "\t\t mod.get_iter (out iter, path);",
+ "\t\t ",
+ " ",
+ "\t\tGLib.Value gvaltype, gval;",
+ "\t\tmod.get_value(iter, 1 , out gval); // one is key..",
+ "\t\t",
+ "\t mod.get_value(iter,0, out gvaltype);",
+ "",
+ " this.popover.show(this.el, _this.node, (string)gvaltype, (string)gval);",
+ " ",
+ " // _this.startEditingKey(path); ",
+ " ",
+ " return false;",
+ " }",
+ " ",
+ " ",
+ " ",
+ " ",
+ " // right click.",
+ " if (ev.type == Gdk.EventType.BUTTON_PRESS && ev.button == 3) { ",
+ " // show popup!. ",
+ " //if (col.title == \"Value\") {",
+ " // _this.before_edit();",
+ " // return false;",
+ " //}",
+ "",
+ " var p = _this.ContextMenu;",
+ "",
+ " p.el.set_screen(Gdk.Screen.get_default());",
+ " p.el.show_all();",
+ " p.el.popup(null, null, null, ev.button, ev.time);",
+ " //Seed.print(\"click:\" + res.column.title);",
+ " // select the ",
+ " GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {",
+ " ",
+ " this.el.get_selection().select_path(path);",
+ " return false;",
+ " });",
+ " _this.before_edit();",
+ " return false;",
+ " }",
+ " ",
+ " ",
+ " if (col.title != \"Value\") {",
+ " GLib.debug(\"col title != Value\");",
+ " ",
+ " GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {",
+ " this.el.get_selection().select_path(path);",
+ " return false;",
+ " });",
+ " ",
+ " _this.before_edit();",
+ " // XObject.error(\"column is not value?\");",
+ " return false; // ignore.. - key click.. ??? should we do this??",
+ " }",
+ " ",
+ " ",
+ " // if the cell can be edited with a pulldown",
+ " // then we should return true... - and let the start_editing handle it?",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " // _this.before_edit(); <<< we really need to stop the other editor..",
+ " _this.keyrender.el.stop_editing(false);",
+ " _this.keyrender.el.editable =false;",
+ " ",
+ " ",
+ " return _this.startEditingValue(path); // assumes selected row..",
+ " ",
+ " ",
+ "",
+ " ",
+ " ",
+ "}"
+ ]
+ },
+ "tooltip_column" : 5,
+ "xtype" : "TreeView"
}
- ]
+ ],
+ "xtype" : "ScrolledWindow"
}
+ ],
+ "xtype" : "Box",
+ "| string keyFormat" : [
+ "(string val, string type) {",
+ " ",
+ " // Glib.markup_escape_text(val);",
+ "",
+ " if (type == \"listener\") {",
+ " return \"<span font_weight=\\\"bold\\\" color=\\\"#660000\\\">\" + ",
+ " GLib.Markup.escape_text(val) +",
+ " \"</span>\";",
+ " }",
+ " // property..",
+ " if (val.length < 1) {",
+ " return \"<span color=\\\"#FF0000\\\">--empty--</span>\";",
+ " }",
+ " ",
+ " //@ = signal",
+ " //$ = property with ",
+ " //# - object properties",
+ " //* = special",
+ " // all of these... - display value is last element..",
+ " var ar = val.strip().split(\" \");",
+ " ",
+ " ",
+ " var dval = GLib.Markup.escape_text(ar[ar.length-1]);",
+ " ",
+ " ",
+ " ",
+ " ",
+ " switch(val[0]) {",
+ " case '@': // signal // just bold balck?",
+ " if (dval[0] == '@') {",
+ " dval = dval.substring(1);",
+ " }",
+ " ",
+ " return @\"<span font_weight=\\\"bold\\\">@ $dval</span>\"; ",
+ " case '#': // object properties?",
+ " if (dval[0] == '#') {",
+ " dval = dval.substring(1);",
+ " }",
+ " return @\"<span font_weight=\\\"bold\\\">$dval</span>\";",
+ " case '*': // special",
+ " if (dval[0] == '*') {",
+ " dval = dval.substring(1);",
+ " }",
+ " return @\"<span color=\\\"#0000CC\\\" font_weight=\\\"bold\\\">$dval</span>\"; ",
+ " case '$':",
+ " if (dval[0] == '$') {",
+ " dval = dval.substring(1);",
+ " }",
+ " return @\"<span style=\\\"italic\\\">$dval</span>\";",
+ " case '|': // user defined methods",
+ " if (dval[0] == '|') {",
+ " dval = dval.substring(1);",
+ " }",
+ " return @\"<span color=\\\"#008000\\\" font_weight=\\\"bold\\\">$dval</span>\";",
+ " ",
+ " ",
+ " ",
+ " default:",
+ " return dval;",
+ " }",
+ " ",
+ " ",
+ "",
+ "}"
+ ],
+ "| string keySortFormat" : [
+ "(string key) {",
+ " // listeners first - with 0",
+ " // specials",
+ " if (key[0] == '*') {",
+ " return \"1 \" + key;",
+ " }",
+ " // functions",
+ " ",
+ " var bits = key.split(\" \");",
+ " ",
+ " if (key[0] == '|') {",
+ " return \"2 \" + bits[bits.length -1];",
+ " }",
+ " // signals",
+ " if (key[0] == '@') {",
+ " return \"3 \" + bits[bits.length -1];",
+ " }",
+ " ",
+ " // props",
+ " if (key[0] == '#') {",
+ " return \"4 \" + bits[bits.length -1];",
+ " }",
+ " // the rest..",
+ " return \"5 \" + bits[bits.length -1]; ",
+ "",
+ "",
+ "",
+ "}"
+ ],
+ "| void addProp" : [
+ " (string in_type, string key, string value, string value_type) {",
+ " // info includes key, val, skel, etype..",
+ " //console.dump(info);",
+ " //type = info.type.toLowerCase();",
+ " //var data = this.toJS();",
+ " ",
+ " var type = in_type == \"signals\" ? \"listener\" : in_type;",
+ " ",
+ " var fkey = (value_type.length > 0 ? value_type + \" \" : \"\") + key;",
+ " ",
+ " if (type == \"listener\") {",
+ " if (this.node.listeners.has_key(key)) {",
+ " return;",
+ " }",
+ " this.node.listeners.set(key,value);",
+ " } else {",
+ " assert(this.node != null);",
+ " assert(this.node.props != null);",
+ " if (this.node.props.has_key(fkey)) {",
+ " return;",
+ " }",
+ " this.node.props.set(fkey,value);",
+ " }",
+ " ",
+ " ",
+ " // add a row???",
+ " this.load(this.file, this.node);",
+ " ",
+ " ",
+ " ",
+ " /// need to find the row which I've just added..",
+ " ",
+ " ",
+ " var s = this.view.el.get_selection();",
+ " s.unselect_all();",
+ " ",
+ " GLib.debug(\"trying to find new iter\");",
+ " ",
+ " this.model.el.foreach((model, path, iter) => {",
+ " GLib.Value gval;",
+ " ",
+ " this.model.el.get_value(iter, 0 , out gval);",
+ " if ((string)gval != type) {",
+ " GLib.debug(\"not type: %s = %s\\n\", (string)gval , type);",
+ " return false;",
+ " }",
+ " this.model.el.get_value(iter, 1 , out gval);",
+ " if ((string)gval != fkey) {",
+ " GLib.debug(\"not key: %s = %s\\n\", (string)gval , fkey);",
+ " return false;",
+ " }",
+ " // delay this?",
+ " GLib.Timeout.add_full(GLib.Priority.DEFAULT,40 , () => {",
+ " ",
+ " this.startEditingValue(this.model.el.get_path(iter));",
+ " return false;",
+ " });",
+ " //s.select_iter(iter);",
+ " return true; ",
+ " });",
+ " ",
+ " ",
+ " ",
+ " ",
+ "}",
+ ""
+ ],
+ "| void before_edit" : [
+ "()",
+ "{",
+ "",
+ " GLib.debug(\"before edit - stop editing\\n\");",
+ " ",
+ " // these do not appear to trigger save...",
+ " _this.keyrender.el.stop_editing(false);",
+ " _this.keyrender.el.editable =false;",
+ "",
+ " _this.valrender.el.stop_editing(false);",
+ " _this.valrender.el.editable =false; ",
+ " ",
+ " ",
+ "// technicall stop the popup editor..",
+ "",
+ "}",
+ ""
+ ],
+ "| void deleteSelected" : [
+ " () {",
+ " ",
+ " Gtk.TreeIter iter;",
+ " Gtk.TreeModel mod;",
+ " ",
+ " var s = this.view.el.get_selection();",
+ " s.get_selected(out mod, out iter);",
+ " ",
+ " ",
+ " GLib.Value gval;",
+ " mod.get_value(iter, 0 , out gval);",
+ " var type = (string)gval;",
+ " ",
+ " mod.get_value(iter, 1 , out gval);",
+ " var key = (string)gval;",
+ " ",
+ " switch(type) {",
+ " case \"listener\":",
+ " this.node.listeners.unset(key);",
+ " break;",
+ " ",
+ " case \"props\":",
+ " this.node.props.unset(key);",
+ " break;",
+ " }",
+ " this.load(this.file, this.node);",
+ " ",
+ " _this.changed();",
+ "}"
+ ],
+ "| void finish_editing" : [
+ "() {",
+ " // ",
+ " this.before_edit();",
+ "}"
+ ],
+ "| void load" : [
+ "(JsRender.JsRender file, JsRender.Node? node) ",
+ "{",
+ " GLib.debug(\"load leftprops\\n\");",
+ " this.before_edit();",
+ " this.node = node;",
+ " this.file = file;",
+ " ",
+ " ",
+ " this.model.el.clear();",
+ " ",
+ " //this.get('/RightEditor').el.hide();",
+ " if (node ==null) {",
+ " return ;",
+ " }",
+ " ",
+ " ",
+ "",
+ " //var provider = this.get('/LeftTree').getPaleteProvider();",
+ " Gtk.TreeIter iter;",
+ " ",
+ " //typeof(string), // 0 key type",
+ " //typeof(string), // 1 key",
+ " //typeof(string), // 2 key (display)",
+ " //typeof(string), // 3 value",
+ " //typeof(string), // 4 value (display)",
+ " //typeof(string), // 5 both (tooltip)",
+ " ",
+ " ",
+ " ",
+ " // really need a way to sort the hashmap...",
+ " var m = this.model.el;",
+ " ",
+ " var miter = node.listeners.map_iterator();",
+ " var i = 0;",
+ " ",
+ " while(miter.next()) {",
+ " i++;",
+ " m.append(out iter,null);",
+ " ",
+ " this.updateIter(iter, \"listener\", miter.get_key(), miter.get_value());",
+ " ",
+ " ",
+ " }",
+ " ",
+ " ",
+ " miter = node.props.map_iterator();",
+ " ",
+ " ",
+ " while(miter.next()) {",
+ " i++;",
+ " m.append(out iter,null);",
+ " this.updateIter(iter, \"prop\", miter.get_key(), miter.get_value());",
+ " ",
+ " }",
+ " GLib.debug(\"clear selection\\n\");",
+ " // clear selection?",
+ " this.model.el.set_sort_column_id(6,Gtk.SortType.ASCENDING); // sort by real key..",
+ " ",
+ " this.view.el.get_selection().unselect_all();",
+ " ",
+ " ",
+ " /**",
+ " ",
+ " make outerpane = {current width of left pane} + width of props",
+ " make innerpane = {current width of left pane}",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " var outerpane = _this.main_window.leftpane.el;",
+ " var pane = _this.main_window.editpane.el;",
+ " ",
+ " ",
+ " ",
+ " var try_size = (i * 25) + 60; // est. 20px per line + 40px header",
+ " GLib.Timeout.add_seconds(1, () => { ",
+ "\t\t// max 80%...",
+ "\t\tpane.set_position( ",
+ "\t\t ((try_size * 1.0f) / (pane.max_position * 1.0f)) > 0.8f ? ",
+ "\t\t (int) (pane.max_position * 0.2f) :",
+ "\t\t pane.max_position-try_size);",
+ "\t return GLib.Source.REMOVE;",
+ "\t});",
+ "\t*/",
+ " ",
+ "}",
+ ""
+ ],
+ "| void startEditingKey" : [
+ "( Gtk.TreePath path) {",
+ " ",
+ " if (!this.stop_editor()) {",
+ " return;",
+ " }",
+ " ",
+ " // others... - fill in options for true/false?",
+ " ",
+ " ",
+ " GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {",
+ " this.allow_edit = true;",
+ " this.keyrender.el.editable = true;",
+ " ",
+ " this.view.el.set_cursor_on_cell(",
+ " path,",
+ " this.keycol.el,",
+ " this.keyrender.el,",
+ " true",
+ " );",
+ " ",
+ " return false;",
+ " });",
+ " ",
+ " ",
+ "}",
+ ""
+ ],
+ "| void updateIter" : [
+ "(Gtk.TreeIter iter, string type, string key, string kvalue) {",
+ "",
+ " //print(\"update Iter %s, %s\\n\", key,kvalue);",
+ " //typeof(string), // 0 key type",
+ " //typeof(string), // 1 key",
+ " //typeof(string), // 2 key (display)",
+ " //typeof(string), // 3 value",
+ " //typeof(string), // 4 value (display)",
+ " //typeof(string), // 5 both (tooltip)",
+ " //typeof(string), // 6 key (sort)",
+ " ",
+ " var dl = kvalue.strip().split(\"\\n\");",
+ "",
+ " var dis_val = dl.length > 1 ? (dl[0].strip()+ \"...\") : dl[0];",
+ " ",
+ " if (type == \"listener\") {",
+ " ",
+ " ",
+ " ",
+ " this.model.el.set(iter, ",
+ " 0, type,",
+ " 1, key,",
+ " 2, this.keyFormat(key ,type),",
+ " 3, kvalue,",
+ " 4, dis_val,",
+ " 5, \"<tt>\" + GLib.Markup.escape_text(key + \" \" +kvalue) + \"</tt>\",",
+ " 6, \"0 \" + key",
+ " ); ",
+ " return;",
+ " }",
+ " ",
+ "",
+ "",
+ " this.model.el.set(iter, ",
+ " 0, \"props\",",
+ " 1, key,",
+ " 2, this.keyFormat(key , \"prop\"),",
+ " 3, kvalue,",
+ " 4, dis_val,",
+ " 5, \"<tt>\" + GLib.Markup.escape_text(key + \" \" + kvalue) + \"</tt>\",",
+ " 6, this.keySortFormat(key)",
+ " ); ",
+ "}"
+ ],
+ "| bool startEditingValue" : [
+ "( Gtk.TreePath path) {",
+ "",
+ " // ONLY return true if editing is allowed - eg. combo..",
+ "",
+ " GLib.debug(\"start editing?\\n\");",
+ " if (!this.stop_editor()) {",
+ " GLib.debug(\"stop editor failed\\n\");",
+ " return false;",
+ " }",
+ " ",
+ " Gtk.TreeIter iter;",
+ "",
+ " var mod = this.model.el;",
+ " mod.get_iter (out iter, path);",
+ " ",
+ " /*",
+ " m.set(iter, ",
+ " 0, \"listener\",",
+ " 1, miter.get_key(),",
+ " 2, \"<b>\" + miter.get_key() + \"</b>\",",
+ " 3, miter.get_value()",
+ " ); ",
+ " ",
+ " */",
+ " GLib.Value gval;",
+ " mod.get_value(iter, 3 , out gval);",
+ " var val = (string)gval;",
+ "",
+ " mod.get_value(iter, 1 , out gval);",
+ " var key = (string)gval;",
+ " ",
+ " ",
+ " string kname, kflag, ktype;",
+ " this.node.normalize_key(key, out kname, out kflag, out ktype);",
+ " ",
+ " ",
+ " mod.get_value(iter, 0 , out gval);",
+ " var type = (string)gval; // listerner or prop..",
+ " ",
+ " ",
+ " ",
+ " var use_textarea = false;",
+ "",
+ " //------------ things that require the text editor...",
+ " ",
+ " if (type == \"listener\") {",
+ " use_textarea = true;",
+ " }",
+ " if (key.length > 0 && key[0] == '|') { // user defined method",
+ " use_textarea = true;",
+ " }",
+ " if (key.length > 0 && key[0] == '$') { // raw string",
+ " use_textarea = true;",
+ " }",
+ " if (key.length > 0 && key == \"* init\") {",
+ " use_textarea = true;",
+ " }",
+ " if (val.length > 40) { // long value...",
+ " use_textarea = true;",
+ " }",
+ " ",
+ " ",
+ " ",
+ " if (use_textarea) {",
+ " GLib.debug(\"Call show editor\\n\");",
+ " GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {",
+ " this.view.el.get_selection().select_path(path);",
+ " ",
+ " this.show_editor(file, node, type, key);",
+ " ",
+ " return false;",
+ " });",
+ " ",
+ " ",
+ " return false;",
+ " }",
+ " ",
+ " var pal = this.file.project.palete;",
+ " ",
+ " string[] opts;",
+ " var has_opts = pal.typeOptions(this.node.fqn(), kname, ktype, out opts);",
+ " ",
+ " ",
+ " ",
+ " // others... - fill in options for true/false?",
+ " GLib.debug(\"turn on editing %s \\n\" , mod.get_path(iter).to_string());",
+ " ",
+ " GLib.debug (ktype.up());",
+ " if (has_opts) {",
+ " GLib.debug(\"start editing try/false)???\");",
+ " this.valrender.el.has_entry = false;",
+ " ",
+ " this.valrender.setOptions(opts);",
+ " ",
+ " this.valrender.el.has_entry = false;",
+ " this.valrender.el.editable = true;",
+ " this.allow_edit = true;",
+ " GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {",
+ " this.view.el.set_cursor_on_cell(",
+ " path,",
+ " this.valcol.el,",
+ " this.valrender.el,",
+ " true",
+ " );",
+ " return false;",
+ " });",
+ " return true;",
+ " }",
+ " ",
+ " // see if type is a Enum.",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " opts = { };",
+ " this.valrender.setOptions(opts);",
+ " ",
+ " GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {",
+ " ",
+ " // at this point - work out the type...",
+ " // if its' a combo... then show the options..",
+ " this.valrender.el.has_entry = true;",
+ " ",
+ " this.valrender.el.editable = true; ",
+ " ",
+ " ",
+ " this.allow_edit = true;",
+ " ",
+ " ",
+ " ",
+ " ",
+ "",
+ " this.view.el.set_cursor_on_cell(",
+ " path,",
+ " this.valcol.el,",
+ " this.valrender.el,",
+ " true",
+ " );",
+ " return false;",
+ " });",
+ " return false;",
+ "}",
+ ""
+ ],
+ "| void updateKey" : [
+ "(string oldkey, string type, string key ) {",
+ "",
+ " ",
+ "\t",
+ "\t_this.model.el.foreach((mod, path, iter) => {",
+ "\t\t ",
+ " ",
+ " \t ",
+ " ",
+ "\t\t GLib.Value gvaltype, gval,kvalue;",
+ "\t\t mod.get_value(iter, 1 , out gval); // one is key..",
+ "\t\t",
+ "\t mod.get_value(iter,0, out gvaltype);",
+ "\t ",
+ " \t mod.get_value(iter,3, out kvalue);",
+ "\t ",
+ "\t if (oldkey == ((string)gval) && type == ((string)gvaltype)) {",
+ "\t ",
+ "\t\t \t //print(\"update iter type=%s, key=%s value=%s\\n\", type, key,(string) kvalue);",
+ "\t ",
+ " \t \t this.updateIter(iter, type, key, (string)kvalue);",
+ " \t \t return true;",
+ "\t \t }",
+ "\t ",
+ "",
+ "\t\treturn false;",
+ "\t});",
+ "\t",
+ "\tthis.changed();",
+ "",
+ "",
+ "}",
+ ""
]
}
- ]
+ ],
+ "modOrder" : "",
+ "name" : "WindowLeftProps",
+ "parent" : "",
+ "path" : "/home/alan/gitlive/roobuilder/src/Builder4/WindowLeftProps.bjs",
+ "permname" : "",
+ "title" : ""
}
\ No newline at end of file
this.view.el.get_selection().unselect_all();
+
+ /**
+
+ make outerpane = {current width of left pane} + width of props
+ make innerpane = {current width of left pane}
+
+
+
+
+
+ var outerpane = _this.main_window.leftpane.el;
var pane = _this.main_window.editpane.el;
+
+
+
var try_size = (i * 25) + 60; // est. 20px per line + 40px header
GLib.Timeout.add_seconds(1, () => {
// max 80%...
pane.max_position-try_size);
return GLib.Source.REMOVE;
});
+ */
}
public string keyFormat (string val, string type) {
// my vars (dec)
// set gobject values
- var child_0 = new Xcls_Button3( _this );
- child_0.ref();
- this.el.add ( child_0.el );
- }
-
- // user defined functions
- }
- public class Xcls_Button3 : Object
- {
- public Gtk.Button el;
- private Xcls_LeftProps _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_Button3(Xcls_LeftProps _owner )
- {
- _this = _owner;
- this.el = new Gtk.Button();
-
- // my vars (dec)
-
- // set gobject values
- this.el.hexpand = true;
- var child_0 = new Xcls_Box4( _this );
- child_0.ref();
- this.el.add ( child_0.el );
- var child_1 = new Xcls_AddPropertyPopup( _this );
- child_1.ref();
-
- //listeners
- this.el.button_press_event.connect( (self, ev) => {
- _this.before_edit();
-
-
- var p = _this.AddPropertyPopup;
- p.el.set_screen(Gdk.Screen.get_default());
- p.el.show_all();
- p.el.popup(null, null, null, ev.button, ev.time);
- return true;
- });
- }
-
- // user defined functions
- }
- public class Xcls_Box4 : Object
- {
- public Gtk.Box el;
- private Xcls_LeftProps _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_Box4(Xcls_LeftProps _owner )
- {
- _this = _owner;
- this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
-
- // my vars (dec)
-
- // set gobject values
- var child_0 = new Xcls_Image5( _this );
+ var child_0 = new Xcls_Label3( _this );
child_0.ref();
this.el.add ( child_0.el );
- var child_1 = new Xcls_Label6( _this );
+ var child_1 = new Xcls_Button4( _this );
child_1.ref();
this.el.add ( child_1.el );
+ var child_2 = new Xcls_Button24( _this );
+ child_2.ref();
+ this.el.add ( child_2.el );
+ var child_3 = new Xcls_Button26( _this );
+ child_3.ref();
+ this.el.add ( child_3.el );
}
// user defined functions
}
- public class Xcls_Image5 : Object
+ public class Xcls_Label3 : Object
{
- public Gtk.Image el;
+ public Gtk.Label el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_Image5(Xcls_LeftProps _owner )
+ public Xcls_Label3(Xcls_LeftProps _owner )
{
_this = _owner;
- this.el = new Gtk.Image();
+ this.el = new Gtk.Label( "Add:" );
// my vars (dec)
// set gobject values
- this.el.stock = Gtk.Stock.ADD;
- this.el.icon_size = Gtk.IconSize.MENU;
+ this.el.margin_right = 5;
+ this.el.margin_left = 5;
}
// user defined functions
}
- public class Xcls_Label6 : Object
+ public class Xcls_Button4 : Object
{
- public Gtk.Label el;
+ public Gtk.Button el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_Label6(Xcls_LeftProps _owner )
+ public Xcls_Button4(Xcls_LeftProps _owner )
{
_this = _owner;
- this.el = new Gtk.Label( "Other" );
+ this.el = new Gtk.Button();
// my vars (dec)
// set gobject values
+ this.el.hexpand = true;
+ this.el.label = "Other";
+ var child_0 = new Xcls_AddPropertyPopup( _this );
+ child_0.ref();
+ var child_1 = new Xcls_Image23( _this );
+ child_1.ref();
+ this.el.set_image ( child_1.el );
+
+ //listeners
+ this.el.button_press_event.connect( (self, ev) => {
+ _this.before_edit();
+
+
+ var p = _this.AddPropertyPopup;
+ p.el.set_screen(Gdk.Screen.get_default());
+ p.el.show_all();
+ p.el.popup(null, null, null, ev.button, ev.time);
+ return true;
+ });
}
// user defined functions
}
-
-
public class Xcls_AddPropertyPopup : Object
{
public Gtk.Menu el;
// my vars (dec)
// set gobject values
- var child_0 = new Xcls_MenuItem8( _this );
+ var child_0 = new Xcls_MenuItem6( _this );
child_0.ref();
this.el.append ( child_0.el );
- var child_1 = new Xcls_MenuItem9( _this );
+ var child_1 = new Xcls_MenuItem7( _this );
child_1.ref();
this.el.append ( child_1.el );
- var child_2 = new Xcls_MenuItem10( _this );
+ var child_2 = new Xcls_MenuItem8( _this );
child_2.ref();
this.el.append ( child_2.el );
- var child_3 = new Xcls_MenuItem11( _this );
+ var child_3 = new Xcls_MenuItem9( _this );
child_3.ref();
this.el.append ( child_3.el );
- var child_4 = new Xcls_MenuItem12( _this );
+ var child_4 = new Xcls_MenuItem10( _this );
child_4.ref();
this.el.append ( child_4.el );
- var child_5 = new Xcls_SeparatorMenuItem13( _this );
+ var child_5 = new Xcls_SeparatorMenuItem11( _this );
child_5.ref();
this.el.add ( child_5.el );
- var child_6 = new Xcls_MenuItem14( _this );
+ var child_6 = new Xcls_MenuItem12( _this );
child_6.ref();
this.el.append ( child_6.el );
- var child_7 = new Xcls_MenuItem15( _this );
+ var child_7 = new Xcls_MenuItem13( _this );
child_7.ref();
this.el.append ( child_7.el );
- var child_8 = new Xcls_MenuItem16( _this );
+ var child_8 = new Xcls_MenuItem14( _this );
child_8.ref();
this.el.append ( child_8.el );
- var child_9 = new Xcls_SeparatorMenuItem17( _this );
+ var child_9 = new Xcls_SeparatorMenuItem15( _this );
child_9.ref();
this.el.add ( child_9.el );
- var child_10 = new Xcls_MenuItem18( _this );
+ var child_10 = new Xcls_MenuItem16( _this );
child_10.ref();
this.el.append ( child_10.el );
- var child_11 = new Xcls_MenuItem19( _this );
+ var child_11 = new Xcls_MenuItem17( _this );
child_11.ref();
this.el.append ( child_11.el );
- var child_12 = new Xcls_MenuItem20( _this );
+ var child_12 = new Xcls_MenuItem18( _this );
child_12.ref();
this.el.append ( child_12.el );
- var child_13 = new Xcls_SeparatorMenuItem21( _this );
+ var child_13 = new Xcls_SeparatorMenuItem19( _this );
child_13.ref();
this.el.add ( child_13.el );
- var child_14 = new Xcls_MenuItem22( _this );
+ var child_14 = new Xcls_MenuItem20( _this );
child_14.ref();
this.el.append ( child_14.el );
- var child_15 = new Xcls_MenuItem23( _this );
+ var child_15 = new Xcls_MenuItem21( _this );
child_15.ref();
this.el.append ( child_15.el );
- var child_16 = new Xcls_MenuItem24( _this );
+ var child_16 = new Xcls_MenuItem22( _this );
child_16.ref();
this.el.append ( child_16.el );
}
// user defined functions
}
- public class Xcls_MenuItem8 : Object
+ public class Xcls_MenuItem6 : Object
{
public Gtk.MenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_MenuItem8(Xcls_LeftProps _owner )
+ public Xcls_MenuItem6(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_MenuItem9 : Object
+ public class Xcls_MenuItem7 : Object
{
public Gtk.MenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_MenuItem9(Xcls_LeftProps _owner )
+ public Xcls_MenuItem7(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_MenuItem10 : Object
+ public class Xcls_MenuItem8 : Object
{
public Gtk.MenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_MenuItem10(Xcls_LeftProps _owner )
+ public Xcls_MenuItem8(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_MenuItem11 : Object
+ public class Xcls_MenuItem9 : Object
{
public Gtk.MenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_MenuItem11(Xcls_LeftProps _owner )
+ public Xcls_MenuItem9(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_MenuItem12 : Object
+ public class Xcls_MenuItem10 : Object
{
public Gtk.MenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_MenuItem12(Xcls_LeftProps _owner )
+ public Xcls_MenuItem10(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_SeparatorMenuItem13 : Object
+ public class Xcls_SeparatorMenuItem11 : Object
{
public Gtk.SeparatorMenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_SeparatorMenuItem13(Xcls_LeftProps _owner )
+ public Xcls_SeparatorMenuItem11(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.SeparatorMenuItem();
// user defined functions
}
- public class Xcls_MenuItem14 : Object
+ public class Xcls_MenuItem12 : Object
{
public Gtk.MenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_MenuItem14(Xcls_LeftProps _owner )
+ public Xcls_MenuItem12(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_MenuItem15 : Object
+ public class Xcls_MenuItem13 : Object
{
public Gtk.MenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_MenuItem15(Xcls_LeftProps _owner )
+ public Xcls_MenuItem13(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_MenuItem16 : Object
+ public class Xcls_MenuItem14 : Object
{
public Gtk.MenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_MenuItem16(Xcls_LeftProps _owner )
+ public Xcls_MenuItem14(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_SeparatorMenuItem17 : Object
+ public class Xcls_SeparatorMenuItem15 : Object
{
public Gtk.SeparatorMenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_SeparatorMenuItem17(Xcls_LeftProps _owner )
+ public Xcls_SeparatorMenuItem15(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.SeparatorMenuItem();
// user defined functions
}
- public class Xcls_MenuItem18 : Object
+ public class Xcls_MenuItem16 : Object
{
public Gtk.MenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_MenuItem18(Xcls_LeftProps _owner )
+ public Xcls_MenuItem16(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_MenuItem19 : Object
+ public class Xcls_MenuItem17 : Object
{
public Gtk.MenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_MenuItem19(Xcls_LeftProps _owner )
+ public Xcls_MenuItem17(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_MenuItem20 : Object
+ public class Xcls_MenuItem18 : Object
{
public Gtk.MenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_MenuItem20(Xcls_LeftProps _owner )
+ public Xcls_MenuItem18(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_SeparatorMenuItem21 : Object
+ public class Xcls_SeparatorMenuItem19 : Object
{
public Gtk.SeparatorMenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_SeparatorMenuItem21(Xcls_LeftProps _owner )
+ public Xcls_SeparatorMenuItem19(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.SeparatorMenuItem();
// user defined functions
}
- public class Xcls_MenuItem22 : Object
+ public class Xcls_MenuItem20 : Object
{
public Gtk.MenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_MenuItem22(Xcls_LeftProps _owner )
+ public Xcls_MenuItem20(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_MenuItem23 : Object
+ public class Xcls_MenuItem21 : Object
{
public Gtk.MenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_MenuItem23(Xcls_LeftProps _owner )
+ public Xcls_MenuItem21(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_MenuItem24 : Object
+ public class Xcls_MenuItem22 : Object
{
public Gtk.MenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_MenuItem24(Xcls_LeftProps _owner )
+ public Xcls_MenuItem22(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
}
+ public class Xcls_Image23 : Object
+ {
+ public Gtk.Image el;
+ private Xcls_LeftProps _this;
+
+
+ // my vars (def)
+
+ // ctor
+ public Xcls_Image23(Xcls_LeftProps _owner )
+ {
+ _this = _owner;
+ this.el = new Gtk.Image();
+
+ // my vars (dec)
+
+ // set gobject values
+ this.el.stock = Gtk.Stock.ADD;
+ this.el.icon_size = Gtk.IconSize.MENU;
+ }
+
+ // user defined functions
+ }
+
+
+ public class Xcls_Button24 : Object
+ {
+ public Gtk.Button el;
+ private Xcls_LeftProps _this;
+
+
+ // my vars (def)
+
+ // ctor
+ public Xcls_Button24(Xcls_LeftProps _owner )
+ {
+ _this = _owner;
+ this.el = new Gtk.Button();
+
+ // my vars (dec)
+
+ // set gobject values
+ this.el.hexpand = true;
+ this.el.always_show_image = true;
+ this.el.tooltip_text = "Add Property";
+ this.el.label = "Property";
+ var child_0 = new Xcls_Image25( _this );
+ child_0.ref();
+ this.el.set_image ( child_0.el );
+
+ //listeners
+ this.el.clicked.connect( ( ) => {
+
+ _this.main_window.windowstate.showProps(this.el, "props");
+
+
+ });
+ }
+
+ // user defined functions
+ }
+ public class Xcls_Image25 : Object
+ {
+ public Gtk.Image el;
+ private Xcls_LeftProps _this;
+
+
+ // my vars (def)
+
+ // ctor
+ public Xcls_Image25(Xcls_LeftProps _owner )
+ {
+ _this = _owner;
+ this.el = new Gtk.Image();
+
+ // my vars (dec)
+
+ // set gobject values
+ this.el.icon_name = "format-justify-left";
+ }
+
+ // user defined functions
+ }
+
+
+ public class Xcls_Button26 : Object
+ {
+ public Gtk.Button el;
+ private Xcls_LeftProps _this;
+
+
+ // my vars (def)
+
+ // ctor
+ public Xcls_Button26(Xcls_LeftProps _owner )
+ {
+ _this = _owner;
+ this.el = new Gtk.Button();
+
+ // my vars (dec)
+
+ // set gobject values
+ this.el.hexpand = true;
+ this.el.always_show_image = true;
+ this.el.tooltip_text = "Add Event Code";
+ this.el.label = "Event";
+ var child_0 = new Xcls_Image27( _this );
+ child_0.ref();
+ this.el.set_image ( child_0.el );
+
+ //listeners
+ this.el.clicked.connect( ( ) => {
+
+
+ _this.main_window.windowstate.showProps(this.el, "signals");
+
+
+ });
+ }
+
+ // user defined functions
+ }
+ public class Xcls_Image27 : Object
+ {
+ public Gtk.Image el;
+ private Xcls_LeftProps _this;
+
+
+ // my vars (def)
+
+ // ctor
+ public Xcls_Image27(Xcls_LeftProps _owner )
+ {
+ _this = _owner;
+ this.el = new Gtk.Image();
+
+ // my vars (dec)
+
+ // set gobject values
+ this.el.icon_name = "appointment-new";
+ }
+
+ // user defined functions
+ }
+
public class Xcls_EditProps : Object
// my vars (dec)
// set gobject values
- var child_0 = new Xcls_MenuItem34( _this );
+ var child_0 = new Xcls_MenuItem37( _this );
child_0.ref();
this.el.append ( child_0.el );
- var child_1 = new Xcls_SeparatorMenuItem35( _this );
+ var child_1 = new Xcls_SeparatorMenuItem38( _this );
child_1.ref();
this.el.append ( child_1.el );
- var child_2 = new Xcls_MenuItem36( _this );
+ var child_2 = new Xcls_MenuItem39( _this );
child_2.ref();
this.el.append ( child_2.el );
}
// user defined functions
}
- public class Xcls_MenuItem34 : Object
+ public class Xcls_MenuItem37 : Object
{
public Gtk.MenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_MenuItem34(Xcls_LeftProps _owner )
+ public Xcls_MenuItem37(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_SeparatorMenuItem35 : Object
+ public class Xcls_SeparatorMenuItem38 : Object
{
public Gtk.SeparatorMenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_SeparatorMenuItem35(Xcls_LeftProps _owner )
+ public Xcls_SeparatorMenuItem38(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.SeparatorMenuItem();
// user defined functions
}
- public class Xcls_MenuItem36 : Object
+ public class Xcls_MenuItem39 : Object
{
public Gtk.MenuItem el;
private Xcls_LeftProps _this;
// my vars (def)
// ctor
- public Xcls_MenuItem36(Xcls_LeftProps _owner )
+ public Xcls_MenuItem39(Xcls_LeftProps _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
{
- "name" : "WindowLeftTree",
- "parent" : "",
- "title" : "",
- "path" : "/home/alan/gitlive/roobuilder/src/Builder4/WindowLeftTree.bjs",
- "permname" : "",
- "modOrder" : "",
"build_module" : "builder",
"items" : [
{
- "| JsRender.Node? getActiveElement" : " () { // return path to actie node.\n\n var path = this.getActivePath();\n if (path.length < 1) {\n return null;\n }\n return _this.model.pathToNode(path);\n \n}\n",
- "@ bool before_node_change" : "()",
- "id" : "WindowLeftTree",
- "$ shadow_type" : "Gtk.ShadowType.IN",
- "* init" : " this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n",
- "| JsRender.JsRender getActiveFile" : "() {\n return this.main_window.windowstate.file;\n}\n",
+ "# Xcls_MainWindow main_window" : "null",
+ "$ xns" : "Gtk",
"* pack" : "add",
- "xtype" : "ScrolledWindow",
+ "@ bool before_node_change" : "()",
"@ void changed" : "()",
- "$ xns" : "Gtk",
"@ void node_selected" : "(JsRender.Node? node, string source)",
- "# Xcls_MainWindow main_window" : "null",
- "| string getActivePath" : " () {\n \n var view = this.view.el;\n if (view.get_selection().count_selected_rows() < 1) {\n return \"\";\n }\n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n view.get_selection().get_selected(out mod, out iter);\n return mod.get_path(iter).to_string();\n}\n ",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+ "id" : "WindowLeftTree",
"items" : [
{
- "listeners" : {
- "button_release_event" : "(ev) => { \n this.button_is_pressed = false;\n return false;\n}",
- "button_press_event" : " ( ev) => {\n //console.log(\"button press?\");\n this.button_is_pressed = true;\n print(\"BUTTON DOWN\\n\");\n \n this.lastEventSource = \"tree\";\n if (! _this.before_node_change() ) {\n \n return true;\n }\n \n\n \n if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {\n //print(\"click\" + ev.type);\n return false;\n }\n Gtk.TreePath res;\n if (!_this.view.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {\n return true;\n }\n \n this.el.get_selection().select_path(res);\n \n //if (!this.get('/LeftTreeMenu').el) { \n // this.get('/LeftTreeMenu').init(); \n // }\n \n _this.LeftTreeMenu.el.set_screen(Gdk.Screen.get_default());\n _this.LeftTreeMenu.el.show_all();\n _this.LeftTreeMenu.el.popup(null, null, null, 3, ev.time);\n // print(\"click:\" + res.path.to_string());\n return true;\n}",
- "cursor_changed" : " ( ) => {\n print(\"LEFT TREE Cursor Changed\\n\");\n\tif (!this.button_is_pressed && !this.key_is_pressed) {\n\t\t// then event was started by some other action\n\t\t// which should manually trigger all the events..\n\t\tprint(\"SKIPPING select - no button or key pressed\\n\");\n\t\treturn;\n\t}\n\n\n if (this.blockChanges) { // probably not needed.. \n\t\tprint(\"SKIPPING select - blockchanges set..\\n\"); \n return ;\n }\n if (!_this.before_node_change( ) ) {\n\t this.blockChanges = true;\n\t this.el.get_selection().unselect_all();\n\t this.blockChanges = false;\n\t \n\t return;\n }\n if (_this.main_window.windowstate.file == null) {\n \t\tprint(\"SKIPPING select windowstate file is not set...\\n\"); \n return;\n } \n \n //var render = this.get('/LeftTree').getRenderer(); \n print(\"LEFT TREE -> view -> selection changed called\\n\");\n \n \n // -- it appears that the selection is not updated.\n \n GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n print(\"LEFT TREE -> view -> selection changed TIMEOUT CALLED\\n\");\n\n if (this.el.get_selection().count_selected_rows() < 1) {\n\n print(\"selected rows < 1\\n\");\n //??this.model.load( false);\n _this.node_selected(null, this.lastEventSource);\n \n return false ;\n }\n \n //console.log('changed');\n var s = this.el.get_selection();\n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n s.get_selected(out mod, out iter);\n \n \n // var val = \"\";\n GLib.Value value;\n _this.model.el.get_value(iter, 2, out value);\n _this.model.activePath = mod.get_path(iter).to_string();\n \n var node = (JsRender.Node)value.dup_object();\n print (\"calling left_tree.node_selected\\n\");\n _this.node_selected(node, this.lastEventSource);\n while (Gtk.events_pending()) {\n Gtk.main_iteration();\n }\n var cp = mod.get_path(iter);\n Gtk.TreePath sp, ep;\n this.el.get_visible_range(out sp, out ep);\n // if sp is before cp then retuns 1.\n // if cp is before ep then retuns 1.\n if (cp.compare(sp) >= 0 && ep.compare(cp) >=1) {\n return false;\n }\n \n \n \n this.el.scroll_to_cell(new Gtk.TreePath.from_string(_this.model.activePath), null, true, 0.1f,0.0f);\n \n return false;\n }); \n //_this.after_node_change(node);\n\n// _this.model.file.changed(node, \"tree\");\n \n //Seed.print( value.get_string());\n return ;\n \n}",
- "drag_begin" : "( ctx) => {\n\t//print('SOURCE: drag-begin');\n \n \n //this.targetData = \"\";\n \n // find what is selected in our tree...\n \n var s = _this.view.el.get_selection();\n if (s.count_selected_rows() < 1) {\n return;\n }\n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n s.get_selected(out mod, out iter);\n\n \n\n // set some properties of the tree for use by the dropped element.\n GLib.Value value;\n _this.model.el.get_value(iter, 2, out value);\n var tp = mod.get_path(iter).to_string();\n var data = (JsRender.Node)(value.dup_object());\n var xname = data.fqn();\n print (\"XNAME IS \" + xname+ \"\\n\");\n this.dragData = tp;\n this.dropList = _this.main_window.windowstate.file.palete().getDropList(xname);\n \n print (\"DROP LIST IS \" + string.joinv(\", \", this.dropList) + \"\\n\");\n \n\n // make the drag icon a picture of the node that was selected\n \n \n // by default returns the path..\n var path = _this.model.el.get_path(iter);\n\n \n var pix = this.el.create_row_drag_icon ( path);\n \n Gtk.drag_set_icon_surface (ctx, pix) ;\n \n return;\n}",
- "drag_end" : " (drag_context) => {\n\t//Seed.print('LEFT-TREE: drag-end');\n this.dragData = \"\";\n this.dropList = null;\n// this.targetData = \"\";\n this.highlightDropPath(\"\",0);\n// return true;\n}",
- "drag_motion" : " ( ctx, x, y, time) => {\n print(\"got drag motion\\n\");\n var src = Gtk.drag_get_source_widget(ctx);\n this.drag_x = x;\n this.drag_y = y; \n\n if (src != this.el) {\n \n \n \n // the point of this is to detect where an item could be dropped..\n print(\"requesting drag data\\n\");\n this.drag_in_motion = true;\n \n // request data that will be recieved by the recieve... \n Gtk.drag_get_data\n (\n this.el, // will receive 'drag-data-received' signal \n ctx, // represents the current state of the DnD \n Gdk.Atom.intern(\"STRING\",true), // the target type we want \n time // time stamp \n );\n return true;\n } \n\n\n print(\"action: %d\\n\", ctx.get_actions());\n //print(\"GETTING POS\");\n var targetData = \"\";\n\n Gtk.TreePath path;\n Gtk.TreeViewDropPosition pos;\n var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);\n\n // if there are not items in the tree.. the we have to set isOver to true for anything..\n var isEmpty = false;\n if (_this.model.el.iter_n_children(null) < 1) {\n print(\"got NO children?\\n\");\n isOver = true; //??? \n isEmpty = true;\n pos = Gtk.TreeViewDropPosition.INTO_OR_AFTER;\n }\n\n\n // ------------- a drag from self..\n\n\n //var action = Gdk.DragAction.COPY;\n // unless we are copying!!! ctl button..\n \n var action = (ctx.get_actions() & Gdk.DragAction.MOVE) > 0 ?\n Gdk.DragAction.COPY : Gdk.DragAction.MOVE ;\n // Gdk.DragAction.MOVE : Gdk.DragAction.COPY ;\n\n\n if (_this.model.el.iter_n_children(null) < 1) {\n // no children.. -- asume it's ok..\n \n targetData = \"|%d|\".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);\n \n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0); \n Gdk.drag_status(ctx, action ,time);\n return true;\n \n // continue through to allow drop...\n\n } \n \n \n\n \n \n //print(\"ISOVER? \" + isOver);\n if (!isOver) {\n \n Gdk.drag_status(ctx, 0 ,time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0); \n return false;\n\n }\n \n // drag node is parent of child..\n //console.log(\"SRC TREEPATH: \" + src.treepath);\n //console.log(\"TARGET TREEPATH: \" + data.path.to_string());\n \n // nned to check a few here..\n //Gtk.TreeViewDropPosition.INTO_OR_AFTER\n //Gtk.TreeViewDropPosition.INTO_OR_BEFORE\n //Gtk.TreeViewDropPosition.AFTER\n //Gtk.TreeViewDropPosition.BEFORE\n \n // locally dragged items to not really use the \n var selection_text = this.dragData;\n \n \n \n if (selection_text == null || selection_text.length < 1) {\n //print(\"Error - drag selection text returned NULL\");\n Gdk.drag_status(ctx, 0 ,time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return false;\n }\n \n \n // see if we are dragging into ourself?\n var target_path = path.to_string(); \n print (\"Drag %s onto %s--%d\\n \", selection_text, target_path, pos);\n \n // pos : 3 = ontop - 0 = after, 1 = before\n //print(\"target_path=\"+target_path);\n\n // \n if (selection_text == target_path) {\n print(\"self drag ?? == we should perhaps allow copy onto self..\\n\");\n \n Gdk.drag_status(ctx, 0 ,time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return false;\n// -- fixme -- this is not really correct..\n\n }\n \n // check that \n //print(\"DUMPING DATA\");\n //console.dump(data);\n // path, pos\n \n //print(data.path.to_string() +' => '+ data.pos);\n \n // dropList is a list of xtypes that this node could be dropped on.\n // it is set up when we start to drag..\n \n \n targetData = _this.model.findDropNodeByPath( path.to_string(), this.dropList, pos);\n \n print(\"targetDAta: \" + targetData +\"\\n\");\n \n if (targetData.length < 1) {\n //print(\"Can not find drop node path\");\n \n Gdk.drag_status(ctx, 0, time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return false;\n }\n \n var td_ar = targetData.split(\"|\");\n \n \n\n Gdk.drag_status(ctx, action ,time);\n this.highlightDropPath(td_ar[0], (Gtk.TreeViewDropPosition)int.parse(td_ar[1]));\n return true;\n \n \n}",
- "drag_data_get" : "( drag_context, data, info, time) => {\n \n \n //print(\"drag-data-get\");\n var s = this.el.get_selection();\n if (s.count_selected_rows() < 1) {\n data.set_text(\"\",0); \n print(\"return empty string - no selection..\");\n return;\n }\n \n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n \n s.get_selected(out mod, out iter);\n \n \n \n GLib.Value value;\n _this.model.el.get_value(iter, 2, out value);\n var ndata = (JsRender.Node)(value.dup_object());\n \n \n \n var tp = mod.get_path(iter).to_string();\n // by default returns the path..\n \n if ( info != Gdk.Atom.intern(\"STRING\",true) ) {\n tp = ndata.toJsonString();\n } \n \n //data.set_text(tp,tp.length); \n \n data.set (data.get_target (), 8, (uchar[]) tp.to_utf8 ());\n \n \n // print(\"return \" + tp);\n }",
- "key_press_event" : "(ev) => {\n this.key_is_pressed = true;\n return false;\n}",
- "key_release_event" : "(ev) => {\n this.key_is_pressed = false;\n return false;\n}\n",
- "drag_data_received" : " (ctx, x, y, sel, info, time) => {\n \n // THIS CODE ONLY RELATES TO drag or drop of \"NEW\" elements or \"FROM another tree..\"\n \n \n // print(\"Tree: drag-data-received\\n\");\n var selection_text = (string)sel.get_data();\n //print(\"selection_text= %s\\n\",selection_text);\n\n var is_drag = this.drag_in_motion;\n \n \n\n\t\tGLib.debug(\"Is Drag %s\\n\", is_drag ? \"Y\": \"N\");\n var targetData = \"\";\n \n Gtk.TreePath path;\n Gtk.TreeViewDropPosition pos;\n var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);\n \n // if there are not items in the tree.. the we have to set isOver to true for anything..\n var isEmpty = false;\n if (_this.model.el.iter_n_children(null) < 1) {\n GLib.debug(\"got NO children?\\n\");\n isOver = true; //??? \n isEmpty = true;\n pos = Gtk.TreeViewDropPosition.INTO_OR_AFTER;\n }\n \n \n //console.log(\"LEFT-TREE: drag-motion\");\n var src = Gtk.drag_get_source_widget(ctx);\n \n // a drag from self - this should be handled by drop and motion.\n if (src == this.el) {\n GLib.debug(\"Source == this element should not happen.. ? \\n\");\n return;\n }\n //print(\"drag_data_recieved from another element\");\n \n \n \n \n if (selection_text == null || selection_text.length < 1 || !isOver) {\n // nothing valid foudn to drop...\n GLib.debug(\"empty sel text or not over\");\n if (is_drag) {\n Gdk.drag_status(ctx, 0, time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n // no drop action...\n return; \n \n }\n var dropNode = new JsRender.Node(); \n \n var dropNodeType = selection_text;\n var show_templates = true;\n // for drop\n if (dropNodeType[0] == '{') {\n var pa = new Json.Parser();\n try {\n pa.load_from_data(dropNodeType);\n } catch (Error e) {\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n // no drop action...\n return; \n }\n \n dropNode.loadFromJson( pa.get_root().get_object(), 2);\n dropNodeType = dropNode.fqn();\n show_templates = false;\n \n \n } else {\n \tif (selection_text.contains(\":\")) {\n\t \tvar bits = selection_text.split(\":\");\n\t dropNode.setFqn(bits[0]);\n\t dropNode.props.set(\"* prop\", bits[1]);\n \t} else {\n\n\t dropNode.setFqn(selection_text);\n }\n }\n\n \n // dropList --- need to gather this ... \n GLib.debug(\"get dropList for : %s\\n\",dropNodeType); \n var dropList = _this.main_window.windowstate.file.palete().getDropList(dropNodeType);\n \n GLib.debug(\"dropList: %s\\n\", string.joinv(\" , \", dropList));\n \n // if drag action is link ... then we can drop it anywahere...\n if ((ctx.get_actions() & Gdk.DragAction.LINK) > 0) {\n // if path is null?? dragging into an empty tree?\n targetData = (path == null ? \"\" : path.to_string()) + \"|%d\".printf((int)pos);\n } else {\n \n \n targetData = _this.model.findDropNodeByPath( isEmpty ? \"\" : path.to_string(), dropList, pos);\n }\n \n \n \n GLib.debug(\"targetDAta: %s\", targetData );\n \n if (targetData.length < 1) {\n \n // invalid drop path..\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0, time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n // no drop action...\n return;\n }\n \n \n \n var td_ar = targetData.split(\"|\");\n \n \n if (this.drag_in_motion) { \n Gdk.drag_status(ctx, Gdk.DragAction.COPY ,time);\n\n this.highlightDropPath( td_ar[0] , (Gtk.TreeViewDropPosition)int.parse(td_ar[1]));\n return;\n }\n // continue on to allow drop..\n \n\n // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..\n //targetData\n \t\t// {parent}|{pos}|{prop}\n \n\n _this.model.dropNode(targetData, dropNode, show_templates);\n GLib.debug(\"ADD new node!!!\\n\");\n \n ///Xcls_DialogTemplateSelect.singleton().show( _this.model.file.palete(), node);\n \n Gtk.drag_finish (ctx, false, false,time);\n \n \n \n \n \n}",
- "drag_drop" : " ( ctx, x, y, time) => {\n //Seed.print(\"TARGET: drag-drop\");\n \n \n var src = Gtk.drag_get_source_widget(ctx);\n \n if (src != this.el) {\n \n \n \n this.drag_in_motion = false; \n // request data that will be recieved by the recieve... \n Gtk.drag_get_data\n (\n this.el, // will receive 'drag-data-received' signal \n ctx, // represents the current state of the DnD \n Gdk.Atom.intern(\"application/json\",true), // the target type we want \n time // time stamp \n );\n\n \n // No target offered by source => error\n \n\n return false;\n }\n \n // handle drop around self..\n \n \n \n //print(\"GETTING POS\");\n var targetData = \"\";\n \n Gtk.TreePath path;\n Gtk.TreeViewDropPosition pos;\n var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);\n \n // if there are not items in the tree.. the we have to set isOver to true for anything..\n var isEmpty = false;\n if (_this.model.el.iter_n_children(null) < 1) {\n print(\"got NO children?\\n\");\n isOver = true; //??? \n isEmpty = true;\n pos = Gtk.TreeViewDropPosition.INTO_OR_AFTER;\n }\n \n \n \n //var action = Gdk.DragAction.COPY;\n // unless we are copying!!! ctl button..\n \n var action = (ctx.get_actions() & Gdk.DragAction.MOVE) > 0 ?\n Gdk.DragAction.COPY : Gdk.DragAction.MOVE ;\n // Gdk.DragAction.MOVE : Gdk.DragAction.COPY ;\n\n \n if (_this.model.el.iter_n_children(null) < 1) {\n // no children.. -- asume it's ok..\n \n targetData = \"|%d|\".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);\n \n // continue through to allow drop...\n\n } else {\n \n \n \n \n \n //print(\"ISOVER? \" + isOver);\n if (!isOver) {\n \n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n return true; // not over apoint!?! - no action on drop or motion..\n }\n \n // drag node is parent of child..\n //console.log(\"SRC TREEPATH: \" + src.treepath);\n //console.log(\"TARGET TREEPATH: \" + data.path.to_string());\n \n // nned to check a few here..\n //Gtk.TreeViewDropPosition.INTO_OR_AFTER\n //Gtk.TreeViewDropPosition.INTO_OR_BEFORE\n //Gtk.TreeViewDropPosition.AFTER\n //Gtk.TreeViewDropPosition.BEFORE\n \n // locally dragged items to not really use the \n var selection_text = this.dragData;\n \n \n \n if (selection_text == null || selection_text.length < 1) {\n //print(\"Error - drag selection text returned NULL\");\n \n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n return true; /// -- fixme -- this is not really correct..\n } \n \n // see if we are dragging into ourself?\n print (\"got selection text of \" + selection_text);\n \n var target_path = path.to_string();\n //print(\"target_path=\"+target_path);\n\n // \n if (selection_text == target_path) {\n print(\"self drag ?? == we should perhaps allow copy onto self..\\n\");\n \n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n\n return true; /// -- fixme -- this is not really correct..\n\n }\n \n // check that \n //print(\"DUMPING DATA\");\n //console.dump(data);\n // path, pos\n \n //print(data.path.to_string() +' => '+ data.pos);\n \n // dropList is a list of xtypes that this node could be dropped on.\n // it is set up when we start to drag..\n \n \n targetData = _this.model.findDropNodeByPath( path.to_string(), this.dropList, pos);\n \n print(\"targetDAta: \" + targetData +\"\\n\");\n \n if (targetData.length < 1) {\n //print(\"Can not find drop node path\");\n \n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n return true;\n }\n \n \n \n // continue on to allow drop..\n }\n // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..\n\n\n var delete_selection_data = false;\n \n if (action == Gdk.DragAction.ASK) {\n /* Ask the user to move or copy, then set the ctx action. */\n }\n\n if (action == Gdk.DragAction.MOVE) {\n delete_selection_data = true;\n }\n \n // drag around.. - reorder..\n _this.model.moveNode(targetData, action);\n \n \n \n \n \n // we can send stuff to souce here...\n\n\n// do we always say failure, so we handle the reall drop?\n Gtk.drag_finish (ctx, false, false,time); //delete_selection_data, time);\n\n return true;\n \n \n \n \n \n \n}"
- },
- "# string dragData" : "",
- "# string[] dropList" : "",
- "# int drag_x" : "",
- "id" : "view",
- "gboolean headers_visible" : true,
- "# int drag_y" : "",
- "* init" : "{\n var description = new Pango.FontDescription();\n description.set_size(8000);\n this.el.override_font(description);\n\n var selection = this.el.get_selection();\n selection.set_mode( Gtk.SelectionMode.SINGLE);\n\n\n // is this really needed??\n /*\n this.selection.signal['changed'].connect(function() {\n\t _this.get('/LeftTree.view').listeners.cursor_changed.apply(\n\t _this.get('/LeftTree.view'), [ _this.get('/LeftTree.view'), '']\n\t );\n });\n */\n Gtk.drag_source_set (\n\t this.el, /* widget will be drag-able */\n\t Gdk.ModifierType.BUTTON1_MASK, /* modifier that will start a drag */\n\t BuilderApplication.targetList, /* lists of target to support */\n\t Gdk.DragAction.COPY | Gdk.DragAction.MOVE | Gdk.DragAction.LINK /* what to do with data after dropped */\n );\n\n // ?? needed??\n //Gtk.drag_source_add_text_targets(this.el); \n\n Gtk.drag_dest_set\n (\n this.el, /* widget that will accept a drop */\n Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT,\n BuilderApplication.targetList, /* lists of target to support */\n Gdk.DragAction.COPY | Gdk.DragAction.MOVE | Gdk.DragAction.LINK /* what to do with data after dropped */\n );\n\n //Gtk.drag_dest_set_target_list(this.el, Builder.Application.targetList);\n //Gtk.drag_dest_add_text_targets(this.el);\n}\n",
- "tooltip_column" : 1,
- "bool expand" : true,
- "* pack" : "add",
- "xtype" : "TreeView",
- "$ enable_tree_lines" : true,
- "$ headers_visible" : false,
- "bool button_is_pressed" : false,
- "| void highlightDropPath" : " ( string treepath, Gtk.TreeViewDropPosition pos) {\n\n // highlighting for drag/drop\n if (treepath.length > 0) {\n this.el.set_drag_dest_row( new Gtk.TreePath.from_string( treepath ), pos);\n } else {\n this.el.set_drag_dest_row(null, Gtk.TreeViewDropPosition.INTO_OR_AFTER);\n }\n \n}",
- "$ string lastEventSource" : "\"\"",
- "bool key_is_pressed" : false,
- "# bool drag_in_motion" : "",
- "# bool blockChanges" : false,
"$ xns" : "Gtk",
- "| void setCursor" : "(string treepath, string sourceEvent) {\n\tthis.lastEventSource = sourceEvent;\n\t//this.blockChanges = true; << block changes prevents loading of 'node data' and firing of node_selected..\n this.el.set_cursor(new Gtk.TreePath.from_string(treepath), null, false); \n // fire node_selected..\n //this.blockChanges = false;\n\tthis.lastEventSource = \"\";\n}\n",
- "| void selectNode" : "(string treepath_str, string source) {\n\tthis.lastEventSource = source;\n //this.selection.select_path(new Gtk.TreePath.from_string( treepath_str));\n var tp = new Gtk.TreePath.from_string(treepath_str);\n \n this.el.set_cursor(tp, null, false); \n this.el.scroll_to_cell(tp, null, false, 0,0);\n}\n",
+ "* pack" : "add",
+ "bool always_show_image" : true,
+ "bool hexpand" : true,
"items" : [
{
- "| string findDropNode" : " (string treepath_str, string[] targets) {\n\n // this is used by the dragdrop code in the roo version AFAIR..\n\n //var path = treepath_str.replace(/^builder-/, '');\n // treemap is depreciated... - should really check if model has any entries..\n\n if (this.el.iter_n_children(null) < 1) {\n //print(\"NO KEYS\");\n return \"|%d\".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);\n }\n //print(\"FIND treepath: \" + path);\n //console.dump(this.treemap);\n \n //if (!treepath_str.match(/^builder-/)) {\n // return []; // nothing!\n //}\n if (targets.length > 0 && targets[0] == \"*\") {\n return treepath_str;\n }\n return this.findDropNodeByPath(treepath_str,targets, -1);\n}\n",
- "id" : "model",
- "currentTree" : false,
- "# DialogTemplateSelect template_select" : "null",
- "* init" : "print(\"model initialized\");\n\n",
- "| void loadFile" : "(JsRender.JsRender f) {\n //console.dump(f);\n this.el.clear();\n \n // needed???\n _this.main_window.windowstate.file = f;\n \n \n if (f.tree == null) {\n\t try {\n\t f.loadItems( );\n } catch (Error e) {\n \t\treturn;\n }\n }\n // if it's still null?\n if (f.tree == null) {\n return;\n }\n \n var o = new Gee.ArrayList<JsRender.Node>();\n o.add(f.tree);\n this.load(o,null);\n \n _this.view.el.expand_all();\n\n if (f.tree.items.size < 1) {\n // single item..\n \n //this.get('/Window.leftvpaned').el.set_position(80);\n // select first...\n _this.view.el.set_cursor( \n new Gtk.TreePath.from_string(\"0\"), null, false);\n \n \n } else {\n //this.get('/Window.leftvpaned').el.set_position(200);\n }\n \n return;\n \n \n}\n",
- "| void updateSelected" : "() {\n \n \n var s = _this.view.el.get_selection();\n \n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n \n \n \n if (!s.get_selected(out mod, out iter)) {\n return; // nothing seleted..\n }\n \n GLib.Value value;\n this.el.get_value(iter, 2, out value);\n var node = (JsRender.Node)(value.get_object());\n \n this.el.set(iter, 0, node.nodeTitle(),\n 1, node.nodeTip(), -1\n );\n}\n",
- "* pack" : "set_model",
- "xtype" : "TreeStore",
- "| string findDropNodeByPath" : " (string treepath_str, string[] targets, int in_pref = -1) {\n\n var path = treepath_str; // dupe it..\n \n \n // pref : 3 = ontop - 0 = after, 1 = before\n int pref = in_pref < 0 ? Gtk.TreeViewDropPosition.INTO_OR_AFTER : in_pref;\n \n var last = \"\";\n \n //console.dump(this.treemap);\n \n print(\"findDropNodeByPath : got path length %d / %s\\n\", path.length, path);\n \n if (path.length == 0) {\n // top drop. // just return empty..\n return \"|%d\".printf((int)pref) ;\n \n }\n \n \n while (path.length > 0) {\n \n if (path.length == treepath_str.length && pref != Gtk.TreeViewDropPosition.INTO_OR_AFTER) {\n if (path.last_index_of(\":\") < 0 ) {\n return \"\";\n }\n path = path.substring(0, path.last_index_of(\":\"));\n last = treepath_str;\n print(\"DROP before or after : using %s\\n\",path);\n continue;\n }\n \n //print(\"LOOKING FOR PATH: \" + path);\n var node_data = this.pathToNode(path);\n \n if (node_data == null) {\n print(\"node not found\");\n return \"\";\n }\n \n var xname = node_data.fqn();\n var match = \"\";\n var prop = \"\";\n \n for (var i =0; i < targets.length; i++) {\n var tg = targets[i];\n if ((tg == xname) ) {\n match = tg;\n break;\n }\n // if target is \"xxxx:name\"\n if (tg.contains(xname +\":\")) {\n match = tg;\n var ar = tg.split(\":\");\n prop = ar[1];\n break;\n }\n }\n \n if (match.length > 0) {\n if (last.length > 0) { // pref is after/before..\n // then it's after last\n //if (pref > 1) {\n // return \"\";\n //}\n return last + \"|%d\".printf((int)pref) + \"|\" + prop;\n\n \n }\n // we need to add prop - as :store -> needs to bee added when dropping onto.\n return path + \"|%d\".printf( (int) Gtk.TreeViewDropPosition.INTO_OR_AFTER) + \"|\" + prop;\n }\n /*\n last = \"\" + path;\n var par = path.split(\":\");\n string [] ppar = {};\n for (var i = 0; i < par.length-1; i++) {\n ppar += par[i];\n }\n \n path = string.joinv(\":\", ppar);\n */\n break;\n\n }\n \n return \"\";\n \n}\n",
- "| void moveNode" : "(string target_data, Gdk.DragAction action) \n{\n \n /// target_data = \"path|pos\");\n \n \n //print(\"MOVE NODE\");\n // console.dump(target_data);\n Gtk.TreeIter old_iter;\n Gtk.TreeModel mod;\n \n var s = _this.view.el.get_selection();\n s.get_selected(out mod , out old_iter);\n mod.get_path(old_iter);\n \n var node = this.pathToNode(mod.get_path(old_iter).to_string());\n //console.dump(node);\n if (node == null) {\n print(\"moveNode: ERROR - node is null?\");\n }\n \n \n\n // needs to drop first, otherwise the target_data \n // treepath will be invalid.\n\n \n if ((action & Gdk.DragAction.MOVE) > 0) {\n print(\"REMOVING OLD NODE : \" + target_data + \"\\n\");\n node.remove();\n this.dropNode(target_data, node, false);\n this.el.remove(ref old_iter);\n \n \n \n } else {\n print(\"DROPPING NODE // copy: \" + target_data + \"\\n\");\n node = node.deepClone();\n this.dropNode(target_data, node, false);\n }\n _this.changed();\n this.activePath= \"\";\n //this.updateNode(false,true);\n}\n",
- "# string activePath" : "\"\"",
- "$ columns" : "typeof(string),typeof(string),typeof(Object)",
- "| void load" : "(Gee.ArrayList<JsRender.Node> tr, Gtk.TreeIter? iter) \n{\n Gtk.TreeIter citer;\n //this.insert(citer,iter,0);\n for(var i =0 ; i < tr.size; i++) {\n if (iter != null) {\n this.el.insert(out citer,iter,-1); // why not append?\n } else {\n this.el.append(out citer,null);\n }\n \n this.el.set(citer, 0, tr.get(i).nodeTitle(),\n 1, tr.get(i).nodeTip(), -1\n );\n var o = GLib.Value(typeof(Object));\n o.set_object((Object)tr.get(i));\n \n this.el.set_value(citer, 2, o);\n \n if (tr.get(i).items.size > 0) {\n this.load(tr.get(i).items, citer);\n }\n \n }\n\n \n}",
- "| void deleteSelected" : "() {\n \n print(\"DELETE SELECTED?\");\n //_this.view.blockChanges = true;\n print(\"GET SELECTION?\");\n\n var s = _this.view.el.get_selection();\n \n print(\"GET SELECTED?\");\n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n\n \n if (!s.get_selected(out mod, out iter)) {\n return; // nothing seleted..\n }\n \n\n\n this.activePath= \"\"; \n print(\"GET vnode value?\");\n\n GLib.Value value;\n this.el.get_value(iter, 2, out value);\n var data = (JsRender.Node)(value.get_object());\n print(\"removing node from Render\\n\");\n if (data.parent == null) {\n _this.main_window.windowstate.file.tree = null;\n } else {\n data.remove();\n }\n print(\"removing node from Tree\\n\"); \n s.unselect_all();\n this.el.remove(ref iter);\n\n \n \n \n // \n \n \n\n\n this.activePath= \"\"; // again!?!? \n //this.changed(null,true);\n \n _this.changed();\n \n _this.view.blockChanges = false;\n}\n",
- "n_columns" : 3,
- "$ xns" : "Gtk",
- "| JsRender.Node pathToNode" : "(string path) {\n \n \n Gtk.TreeIter iter;\n _this.model.el.get_iter_from_string(out iter, path);\n \n GLib.Value value;\n _this.model.el.get_value(iter, 2, out value);\n \n return (JsRender.Node)value.dup_object();\n\n}",
- "| void dropNode" : "(string target_data_str, JsRender.Node node, bool show_templates) {\n// print(\"drop Node\");\n // console.dump(node);\n // console.dump(target_data);\n \n \t\t//target_data_str\n \t\t// {parent}|{pos}|{prop}\n \n \n // 0 = before , 1=after 2/3 onto\n \n \t\tGLib.debug(\"dropNode %s\", target_data_str);\n var target_data= target_data_str.split(\"|\");\n \n var parent_str = target_data[0].length > 0 ? target_data[0] : \"\";\n var pos = target_data.length > 1 ? int.parse(target_data[1]) : 2; // ontop..\n \n \n Gtk.TreePath tree_path = parent_str.length > 0 ? new Gtk.TreePath.from_string( parent_str ) : null;\n \n \n \n //print(\"add \" + tp + \"@\" + target_data[1] );\n \n JsRender.Node parentNode = null;\n \n Gtk.TreeIter iter_after;\n Gtk.TreeIter iter_par ;\n \n \n if (target_data.length == 3 && target_data[2].length > 0) {\n node.props.set(\"* prop\", target_data[2]);\n }\n\n Gtk.TreePath expand_parent = null;\n \n // we only need to show the template if it's come from else where?\n if (show_templates) {\n \n var ts = _this.main_window.windowstate.template_select;\n \n var new_node = ts.show(\n _this.main_window, // (Gtk.Window) _this.el.get_toplevel (),\n _this.main_window.windowstate.file.palete(),\n node,\n _this.main_window.windowstate.project);\n \n if (new_node == null) {\n return; // do not add?\n }\n node = new_node;\n } \n \n //print(\"pos is %d \\n\".printf(pos));\n \n Gtk.TreeIter n_iter; \n \n if ( parent_str.length < 1) {\n this.el.append(out n_iter, null); // drop at top level..\n node.parent = null;\n _this.main_window.windowstate.file.tree = node;\n \n \n } else if (pos < 2) {\n //print(target_data[1] > 0 ? 'insert_after' : 'insert_before');\n \n this.el.get_iter(out iter_after, tree_path ); \n this.el.iter_parent(out iter_par, iter_after);\n expand_parent = this.el.get_path(iter_par);\n \n GLib.Value value;\n this.el.get_value( iter_par, 2, out value);\n parentNode = (JsRender.Node)value.dup_object();\n \n \n this.el.get_value( iter_after, 2, out value);\n var relNode = (JsRender.Node)value.dup_object();\n \n if ( pos > 0 ) {\n \n this.el.insert_after(out n_iter, iter_par , iter_after);\n var ix = parentNode.items.index_of(relNode);\n parentNode.items.insert(ix+1, node);\n \n } else {\n this.el.insert_before(out n_iter, iter_par , iter_after);\n var ix = parentNode.items.index_of(relNode);\n parentNode.items.insert(ix, node);\n \n }\n node.parent = parentNode;\n \n \n \n } else {\n // print(\"appending to \" + parent_str);\n this.el.get_iter(out iter_par, tree_path);\n this.el.append(out n_iter, iter_par );\n expand_parent = this.el.get_path(iter_par);\n \n GLib.Value value;\n this.el.get_value( iter_par, 2, out value);\n parentNode = (JsRender.Node)value.dup_object();\n node.parent = parentNode;\n parentNode.items.add(node);\n }\n \n // reparent node in tree...\n \n \n // why only on no parent???\n \n //if (node.parent = null) {\n \n \n \n //}\n \n \n // work out what kind of packing to use.. -- should be in \n if (!node.has(\"pack\") && parent_str.length > 1) {\n \n _this.main_window.windowstate.file.palete().fillPack(node,parentNode);\n \n \n }\n \n // add the node...\n \n this.el.set(n_iter, 0, node.nodeTitle(), 1, node.nodeTip(), -1 );\n var o = GLib.Value(typeof(Object));\n o.set_object((Object)node);\n \n this.el.set_value(n_iter, 2, o);\n \n \n \n \n// load children - if it has any..\n \n if (node.items.size > 0) {\n this.load(node.items, n_iter);\n _this.view.el.expand_row(this.el.get_path(n_iter), true);\n } else if (expand_parent != null && !_this.view.el.is_row_expanded(expand_parent)) {\n _this.view.el.expand_row(expand_parent,true);\n }\n\n //if (tp != null && (node.items.length() > 0 || pos > 1)) {\n // _this.view.el.expand_row(this.el.get_path(iter_par), true);\n // }\n // wee need to get the empty proptypes from somewhere..\n \n //var olditer = this.activeIter;\n this.activePath = this.el.get_path(n_iter).to_string();\n\n\n // pretend button was pressed, so that we can trigger select node...\n _this.view.button_is_pressed = true;\n _this.view.lastEventSource = \"\";\n _this.view.el.set_cursor(this.el.get_path(n_iter), null, false);\n _this.view.button_is_pressed = false;\n _this.changed();\n \n \n \n}\n",
- "$ listAllTypes" : "function() {\n var s = this.get('/LeftTree.view').selection;\n print (\"LIST ALL TYPES: \" + s.count_selected_rows() );\n \n if (s.count_selected_rows() > 0) {\n var iter = new Gtk.TreeIter(); \n s.get_selected(this.el, iter);\n\n // set some properties of the tree for use by the dropped element.\n var value = new GObject.Value('');\n this.el.get_value(iter, 2, value);\n var data = JSON.parse(value.value);\n \n \n var xname = this.get('/LeftTree.model').file.guessName(data);\n console.log('selected:' + xname);\n if (xname.length) {\n return [ xname ];\n }\n return []; // could not find it..\n }\n \n var ret = [ ];\n \n var _this = this;\n function addall(li)\n {\n li.forEach(function(el) {\n // this is specific to roo!!!?\n if (!el) { // skip empty?\n return;\n }\n var fullpath = _this.file.guessName(el);\n if (fullpath.length && ret.indexOf(fullpath) < 0) {\n ret.push(fullpath);\n }\n \n \n if (el.items && el.items.length) {\n addall(el.items);\n }\n \n });\n \n \n }\n \n addall([this.currentTree]);\n \n // only if we have nothing, should we add '*top'\n if (!ret.length) {\n ret = [ '*top' ];\n }\n //console.log('all types in tree');\n //console.dump(ret);\n \n return ret;\n \n}\n",
- "| string treePathFromNode" : "(JsRender.Node node) {\n // iterate through the tree and find the node\n var ret = \"\";\n \n this.el.foreach((mod, pth, iter) => {\n // get the node..\n \n \n GLib.Value value;\n _this.model.el.get_value(iter, 2, out value);\n \n\n \n var n = (JsRender.Node)value;\n\n print(\"compare %s to %s\\n\", n.fqn(), node.fqn());\n if (node == n) {\n ret = pth.to_string();\n return true;\n }\n return false;\n });\n return ret;\n\n}\n"
- },
- {
- "utf8 title" : "test",
- "* init" : " this.el.add_attribute(_this.renderer.el , \"markup\", 0 );\n ",
- "xtype" : "TreeViewColumn",
- "* pack" : "append_column",
"$ xns" : "Gtk",
- "items" : [
- {
- "id" : "renderer",
- "* pack" : "pack_start,true",
- "xtype" : "CellRendererText",
- "$ xns" : "Gtk"
- }
- ]
+ "* pack" : "set_image",
+ "utf8 icon_name" : "list-add",
+ "xtype" : "Image"
}
- ]
+ ],
+ "listeners" : {
+ "clicked" : [
+ " ( ) => {",
+ " ",
+ "",
+ " \t_this.main_window.windowstate.showAddObject(this.el);",
+ " ",
+ "}"
+ ]
+ },
+ "string label" : "Add Child Element",
+ "xtype" : "Button"
},
{
- "id" : "LeftTreeMenu",
- "* pack" : false,
- "xtype" : "Menu",
"$ xns" : "Gtk",
+ "* init" : [
+ " this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
+ " ",
+ ""
+ ],
+ "* pack" : "add",
+ "Gtk.ShadowType shadow_type" : "Gtk.ShadowType.IN",
"items" : [
{
- "listeners" : {
- "activate" : " ( ) => {\n \n print(\"ACTIVATE?\");\n \n \n _this.model.deleteSelected();\n}"
- },
- "label" : "Delete Element",
+ "# bool blockChanges" : false,
+ "# bool drag_in_motion" : "",
+ "# int drag_x" : "",
+ "# int drag_y" : "",
+ "# string dragData" : "",
+ "# string[] dropList" : "",
+ "$ enable_tree_lines" : true,
+ "$ headers_visible" : false,
+ "$ string lastEventSource" : "\"\"",
+ "$ xns" : "Gtk",
+ "* init" : [
+ "{",
+ " var description = new Pango.FontDescription();",
+ " description.set_size(8000);",
+ " this.el.override_font(description);",
+ "",
+ " var selection = this.el.get_selection();",
+ " selection.set_mode( Gtk.SelectionMode.SINGLE);",
+ "",
+ "",
+ " // is this really needed??",
+ " /*",
+ " this.selection.signal['changed'].connect(function() {",
+ "\t _this.get('/LeftTree.view').listeners.cursor_changed.apply(",
+ "\t _this.get('/LeftTree.view'), [ _this.get('/LeftTree.view'), '']",
+ "\t );",
+ " });",
+ " */",
+ " Gtk.drag_source_set (",
+ "\t this.el, /* widget will be drag-able */",
+ "\t Gdk.ModifierType.BUTTON1_MASK, /* modifier that will start a drag */",
+ "\t BuilderApplication.targetList, /* lists of target to support */",
+ "\t Gdk.DragAction.COPY | Gdk.DragAction.MOVE | Gdk.DragAction.LINK /* what to do with data after dropped */",
+ " );",
+ "",
+ " // ?? needed??",
+ " //Gtk.drag_source_add_text_targets(this.el); ",
+ "",
+ " Gtk.drag_dest_set",
+ " (",
+ " this.el, /* widget that will accept a drop */",
+ " Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT,",
+ " BuilderApplication.targetList, /* lists of target to support */",
+ " Gdk.DragAction.COPY | Gdk.DragAction.MOVE | Gdk.DragAction.LINK /* what to do with data after dropped */",
+ " );",
+ "",
+ " //Gtk.drag_dest_set_target_list(this.el, Builder.Application.targetList);",
+ " //Gtk.drag_dest_add_text_targets(this.el);",
+ "}",
+ ""
+ ],
"* pack" : "add",
- "xtype" : "MenuItem",
- "$ xns" : "Gtk"
- },
- {
+ "bool button_is_pressed" : false,
+ "bool expand" : true,
+ "bool key_is_pressed" : false,
+ "gboolean headers_visible" : true,
+ "id" : "view",
+ "items" : [
+ {
+ "# DialogTemplateSelect template_select" : "null",
+ "# string activePath" : "\"\"",
+ "$ columns" : "typeof(string),typeof(string),typeof(Object)",
+ "$ listAllTypes" : [
+ "function() {",
+ " var s = this.get('/LeftTree.view').selection;",
+ " print (\"LIST ALL TYPES: \" + s.count_selected_rows() );",
+ " ",
+ " if (s.count_selected_rows() > 0) {",
+ " var iter = new Gtk.TreeIter(); ",
+ " s.get_selected(this.el, iter);",
+ "",
+ " // set some properties of the tree for use by the dropped element.",
+ " var value = new GObject.Value('');",
+ " this.el.get_value(iter, 2, value);",
+ " var data = JSON.parse(value.value);",
+ " ",
+ " ",
+ " var xname = this.get('/LeftTree.model').file.guessName(data);",
+ " console.log('selected:' + xname);",
+ " if (xname.length) {",
+ " return [ xname ];",
+ " }",
+ " return []; // could not find it..",
+ " }",
+ " ",
+ " var ret = [ ];",
+ " ",
+ " var _this = this;",
+ " function addall(li)",
+ " {",
+ " li.forEach(function(el) {",
+ " // this is specific to roo!!!?",
+ " if (!el) { // skip empty?",
+ " return;",
+ " }",
+ " var fullpath = _this.file.guessName(el);",
+ " if (fullpath.length && ret.indexOf(fullpath) < 0) {",
+ " ret.push(fullpath);",
+ " }",
+ " ",
+ " ",
+ " if (el.items && el.items.length) {",
+ " addall(el.items);",
+ " }",
+ " ",
+ " });",
+ " ",
+ " ",
+ " }",
+ " ",
+ " addall([this.currentTree]);",
+ " ",
+ " // only if we have nothing, should we add '*top'",
+ " if (!ret.length) {",
+ " ret = [ '*top' ];",
+ " }",
+ " //console.log('all types in tree');",
+ " //console.dump(ret);",
+ " ",
+ " return ret;",
+ " ",
+ "}",
+ ""
+ ],
+ "$ xns" : "Gtk",
+ "* init" : [
+ "print(\"model initialized\");",
+ "",
+ ""
+ ],
+ "* pack" : "set_model",
+ "currentTree" : false,
+ "id" : "model",
+ "n_columns" : 3,
+ "xtype" : "TreeStore",
+ "| JsRender.Node pathToNode" : [
+ "(string path) {",
+ " ",
+ " ",
+ " Gtk.TreeIter iter;",
+ " _this.model.el.get_iter_from_string(out iter, path);",
+ " ",
+ " GLib.Value value;",
+ " _this.model.el.get_value(iter, 2, out value);",
+ " ",
+ " return (JsRender.Node)value.dup_object();",
+ "",
+ "}"
+ ],
+ "| string findDropNode" : [
+ " (string treepath_str, string[] targets) {",
+ "",
+ " // this is used by the dragdrop code in the roo version AFAIR..",
+ "",
+ " //var path = treepath_str.replace(/^builder-/, '');",
+ " // treemap is depreciated... - should really check if model has any entries..",
+ "",
+ " if (this.el.iter_n_children(null) < 1) {",
+ " //print(\"NO KEYS\");",
+ " return \"|%d\".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);",
+ " }",
+ " //print(\"FIND treepath: \" + path);",
+ " //console.dump(this.treemap);",
+ " ",
+ " //if (!treepath_str.match(/^builder-/)) {",
+ " // return []; // nothing!",
+ " //}",
+ " if (targets.length > 0 && targets[0] == \"*\") {",
+ " return treepath_str;",
+ " }",
+ " return this.findDropNodeByPath(treepath_str,targets, -1);",
+ "}",
+ ""
+ ],
+ "| string findDropNodeByPath" : [
+ " (string treepath_str, string[] targets, int in_pref = -1) {",
+ "",
+ " var path = treepath_str; // dupe it..",
+ " ",
+ " ",
+ " // pref : 3 = ontop - 0 = after, 1 = before",
+ " int pref = in_pref < 0 ? Gtk.TreeViewDropPosition.INTO_OR_AFTER : in_pref;",
+ " ",
+ " var last = \"\";",
+ " ",
+ " //console.dump(this.treemap);",
+ " ",
+ " print(\"findDropNodeByPath : got path length %d / %s\\n\", path.length, path);",
+ " ",
+ " if (path.length == 0) {",
+ " // top drop. // just return empty..",
+ " return \"|%d\".printf((int)pref) ;",
+ " ",
+ " }",
+ " ",
+ " ",
+ " while (path.length > 0) {",
+ " ",
+ " if (path.length == treepath_str.length && pref != Gtk.TreeViewDropPosition.INTO_OR_AFTER) {",
+ " if (path.last_index_of(\":\") < 0 ) {",
+ " return \"\";",
+ " }",
+ " path = path.substring(0, path.last_index_of(\":\"));",
+ " last = treepath_str;",
+ " print(\"DROP before or after : using %s\\n\",path);",
+ " continue;",
+ " }",
+ " ",
+ " //print(\"LOOKING FOR PATH: \" + path);",
+ " var node_data = this.pathToNode(path);",
+ " ",
+ " if (node_data == null) {",
+ " print(\"node not found\");",
+ " return \"\";",
+ " }",
+ " ",
+ " var xname = node_data.fqn();",
+ " var match = \"\";",
+ " var prop = \"\";",
+ " ",
+ " for (var i =0; i < targets.length; i++) {",
+ " var tg = targets[i];",
+ " if ((tg == xname) ) {",
+ " match = tg;",
+ " break;",
+ " }",
+ " // if target is \"xxxx:name\"",
+ " if (tg.contains(xname +\":\")) {",
+ " match = tg;",
+ " var ar = tg.split(\":\");",
+ " prop = ar[1];",
+ " break;",
+ " }",
+ " }",
+ " ",
+ " if (match.length > 0) {",
+ " if (last.length > 0) { // pref is after/before..",
+ " // then it's after last",
+ " //if (pref > 1) {",
+ " // return \"\";",
+ " //}",
+ " return last + \"|%d\".printf((int)pref) + \"|\" + prop;",
+ "",
+ " ",
+ " }",
+ " // we need to add prop - as :store -> needs to bee added when dropping onto.",
+ " return path + \"|%d\".printf( (int) Gtk.TreeViewDropPosition.INTO_OR_AFTER) + \"|\" + prop;",
+ " }",
+ " /*",
+ " last = \"\" + path;",
+ " var par = path.split(\":\");",
+ " string [] ppar = {};",
+ " for (var i = 0; i < par.length-1; i++) {",
+ " ppar += par[i];",
+ " }",
+ " ",
+ " path = string.joinv(\":\", ppar);",
+ " */",
+ " break;",
+ "",
+ " }",
+ " ",
+ " return \"\";",
+ " ",
+ "}",
+ ""
+ ],
+ "| void deleteSelected" : [
+ "() {",
+ " ",
+ " print(\"DELETE SELECTED?\");",
+ " //_this.view.blockChanges = true;",
+ " print(\"GET SELECTION?\");",
+ "",
+ " var s = _this.view.el.get_selection();",
+ " ",
+ " print(\"GET SELECTED?\");",
+ " Gtk.TreeIter iter;",
+ " Gtk.TreeModel mod;",
+ "",
+ " ",
+ " if (!s.get_selected(out mod, out iter)) {",
+ " return; // nothing seleted..",
+ " }",
+ " ",
+ "",
+ "",
+ " this.activePath= \"\"; ",
+ " print(\"GET vnode value?\");",
+ "",
+ " GLib.Value value;",
+ " this.el.get_value(iter, 2, out value);",
+ " var data = (JsRender.Node)(value.get_object());",
+ " print(\"removing node from Render\\n\");",
+ " if (data.parent == null) {",
+ " _this.main_window.windowstate.file.tree = null;",
+ " } else {",
+ " data.remove();",
+ " }",
+ " print(\"removing node from Tree\\n\"); ",
+ " s.unselect_all();",
+ " this.el.remove(ref iter);",
+ "",
+ " ",
+ " ",
+ " ",
+ " // ",
+ " ",
+ " ",
+ "",
+ "",
+ " this.activePath= \"\"; // again!?!? ",
+ " //this.changed(null,true);",
+ " ",
+ " _this.changed();",
+ " ",
+ " _this.view.blockChanges = false;",
+ "}",
+ ""
+ ],
+ "| void dropNode" : [
+ "(string target_data_str, JsRender.Node node, bool show_templates) {",
+ "// print(\"drop Node\");",
+ " // console.dump(node);",
+ " // console.dump(target_data);",
+ " ",
+ " \t\t//target_data_str",
+ " \t\t// {parent}|{pos}|{prop}",
+ " ",
+ " ",
+ " // 0 = before , 1=after 2/3 onto",
+ " ",
+ " \t\tGLib.debug(\"dropNode %s\", target_data_str);",
+ " var target_data= target_data_str.split(\"|\");",
+ " ",
+ " var parent_str = target_data[0].length > 0 ? target_data[0] : \"\";",
+ " var pos = target_data.length > 1 ? int.parse(target_data[1]) : 2; // ontop..",
+ " ",
+ " ",
+ " Gtk.TreePath tree_path = parent_str.length > 0 ? new Gtk.TreePath.from_string( parent_str ) : null;",
+ " ",
+ " ",
+ " ",
+ " //print(\"add \" + tp + \"@\" + target_data[1] );",
+ " ",
+ " JsRender.Node parentNode = null;",
+ " ",
+ " Gtk.TreeIter iter_after;",
+ " Gtk.TreeIter iter_par ;",
+ " ",
+ " ",
+ " if (target_data.length == 3 && target_data[2].length > 0) {",
+ " node.props.set(\"* prop\", target_data[2]);",
+ " }",
+ "",
+ " Gtk.TreePath expand_parent = null;",
+ " ",
+ " // we only need to show the template if it's come from else where?",
+ " if (show_templates) {",
+ " ",
+ " var ts = _this.main_window.windowstate.template_select;",
+ " ",
+ " var new_node = ts.show(",
+ " _this.main_window, // (Gtk.Window) _this.el.get_toplevel (),",
+ " _this.main_window.windowstate.file.palete(),",
+ " node,",
+ " _this.main_window.windowstate.project);",
+ " ",
+ " if (new_node == null) {",
+ " return; // do not add?",
+ " }",
+ " node = new_node;",
+ " } ",
+ " ",
+ " //print(\"pos is %d \\n\".printf(pos));",
+ " ",
+ " Gtk.TreeIter n_iter; ",
+ " ",
+ " if ( parent_str.length < 1) {",
+ " this.el.append(out n_iter, null); // drop at top level..",
+ " node.parent = null;",
+ " _this.main_window.windowstate.file.tree = node;",
+ " ",
+ " ",
+ " } else if (pos < 2) {",
+ " //print(target_data[1] > 0 ? 'insert_after' : 'insert_before');",
+ " ",
+ " this.el.get_iter(out iter_after, tree_path ); ",
+ " this.el.iter_parent(out iter_par, iter_after);",
+ " expand_parent = this.el.get_path(iter_par);",
+ " ",
+ " GLib.Value value;",
+ " this.el.get_value( iter_par, 2, out value);",
+ " parentNode = (JsRender.Node)value.dup_object();",
+ " ",
+ " ",
+ " this.el.get_value( iter_after, 2, out value);",
+ " var relNode = (JsRender.Node)value.dup_object();",
+ " ",
+ " if ( pos > 0 ) {",
+ " ",
+ " this.el.insert_after(out n_iter, iter_par , iter_after);",
+ " var ix = parentNode.items.index_of(relNode);",
+ " parentNode.items.insert(ix+1, node);",
+ " ",
+ " } else {",
+ " this.el.insert_before(out n_iter, iter_par , iter_after);",
+ " var ix = parentNode.items.index_of(relNode);",
+ " parentNode.items.insert(ix, node);",
+ " ",
+ " }",
+ " node.parent = parentNode;",
+ " ",
+ " ",
+ " ",
+ " } else {",
+ " // print(\"appending to \" + parent_str);",
+ " this.el.get_iter(out iter_par, tree_path);",
+ " this.el.append(out n_iter, iter_par );",
+ " expand_parent = this.el.get_path(iter_par);",
+ " ",
+ " GLib.Value value;",
+ " this.el.get_value( iter_par, 2, out value);",
+ " parentNode = (JsRender.Node)value.dup_object();",
+ " node.parent = parentNode;",
+ " parentNode.items.add(node);",
+ " }",
+ " ",
+ " // reparent node in tree...",
+ " ",
+ " ",
+ " // why only on no parent???",
+ " ",
+ " //if (node.parent = null) {",
+ " ",
+ " ",
+ " ",
+ " //}",
+ " ",
+ " ",
+ " // work out what kind of packing to use.. -- should be in ",
+ " if (!node.has(\"pack\") && parent_str.length > 1) {",
+ " ",
+ " _this.main_window.windowstate.file.palete().fillPack(node,parentNode);",
+ " ",
+ " ",
+ " }",
+ " ",
+ " // add the node...",
+ " ",
+ " this.el.set(n_iter, 0, node.nodeTitle(), 1, node.nodeTip(), -1 );",
+ " var o = GLib.Value(typeof(Object));",
+ " o.set_object((Object)node);",
+ " ",
+ " this.el.set_value(n_iter, 2, o);",
+ " ",
+ " ",
+ " ",
+ " ",
+ "// load children - if it has any..",
+ " ",
+ " if (node.items.size > 0) {",
+ " this.load(node.items, n_iter);",
+ " _this.view.el.expand_row(this.el.get_path(n_iter), true);",
+ " } else if (expand_parent != null && !_this.view.el.is_row_expanded(expand_parent)) {",
+ " _this.view.el.expand_row(expand_parent,true);",
+ " }",
+ "",
+ " //if (tp != null && (node.items.length() > 0 || pos > 1)) {",
+ " // _this.view.el.expand_row(this.el.get_path(iter_par), true);",
+ " // }",
+ " // wee need to get the empty proptypes from somewhere..",
+ " ",
+ " //var olditer = this.activeIter;",
+ " this.activePath = this.el.get_path(n_iter).to_string();",
+ "",
+ "",
+ " // pretend button was pressed, so that we can trigger select node...",
+ " _this.view.button_is_pressed = true;",
+ " _this.view.lastEventSource = \"\";",
+ " _this.view.el.set_cursor(this.el.get_path(n_iter), null, false);",
+ " _this.view.button_is_pressed = false;",
+ " _this.changed();",
+ " ",
+ " ",
+ " ",
+ "}",
+ ""
+ ],
+ "| void load" : [
+ "(Gee.ArrayList<JsRender.Node> tr, Gtk.TreeIter? iter) ",
+ "{",
+ " Gtk.TreeIter citer;",
+ " //this.insert(citer,iter,0);",
+ " for(var i =0 ; i < tr.size; i++) {",
+ " if (iter != null) {",
+ " this.el.insert(out citer,iter,-1); // why not append?",
+ " } else {",
+ " this.el.append(out citer,null);",
+ " }",
+ " ",
+ " this.el.set(citer, 0, tr.get(i).nodeTitle(),",
+ " 1, tr.get(i).nodeTip(), -1",
+ " );",
+ " var o = GLib.Value(typeof(Object));",
+ " o.set_object((Object)tr.get(i));",
+ " ",
+ " this.el.set_value(citer, 2, o);",
+ " ",
+ " if (tr.get(i).items.size > 0) {",
+ " this.load(tr.get(i).items, citer);",
+ " }",
+ " ",
+ " }",
+ "",
+ " ",
+ "}"
+ ],
+ "| void loadFile" : [
+ "(JsRender.JsRender f) {",
+ " //console.dump(f);",
+ " this.el.clear();",
+ " _this.main_window.windowstate.leftTreeNodeSelected(null, \"\");",
+ " // needed???",
+ " _this.main_window.windowstate.file = f;",
+ " ",
+ " ",
+ " if (f.tree == null) {",
+ "\t try {",
+ "\t f.loadItems( );",
+ " } catch (Error e) {",
+ " \t\treturn;",
+ " }",
+ " }",
+ " // if it's still null?",
+ " if (f.tree == null) {",
+ " return;",
+ " }",
+ " ",
+ " var o = new Gee.ArrayList<JsRender.Node>();",
+ " o.add(f.tree);",
+ " this.load(o,null);",
+ " ",
+ " _this.view.el.expand_all();",
+ "",
+ " if (f.tree.items.size < 1) {",
+ " // single item..",
+ " ",
+ " //this.get('/Window.leftvpaned').el.set_position(80);",
+ " // select first...",
+ " _this.view.el.set_cursor( ",
+ " new Gtk.TreePath.from_string(\"0\"), null, false);",
+ " ",
+ " ",
+ " } else {",
+ " //this.get('/Window.leftvpaned').el.set_position(200);",
+ " }",
+ " ",
+ " return;",
+ " ",
+ " ",
+ "}",
+ ""
+ ],
+ "| void moveNode" : [
+ "(string target_data, Gdk.DragAction action) ",
+ "{",
+ " ",
+ " /// target_data = \"path|pos\");",
+ " ",
+ " ",
+ " //print(\"MOVE NODE\");",
+ " // console.dump(target_data);",
+ " Gtk.TreeIter old_iter;",
+ " Gtk.TreeModel mod;",
+ " ",
+ " var s = _this.view.el.get_selection();",
+ " s.get_selected(out mod , out old_iter);",
+ " mod.get_path(old_iter);",
+ " ",
+ " var node = this.pathToNode(mod.get_path(old_iter).to_string());",
+ " //console.dump(node);",
+ " if (node == null) {",
+ " print(\"moveNode: ERROR - node is null?\");",
+ " }",
+ " ",
+ " ",
+ "",
+ " // needs to drop first, otherwise the target_data ",
+ " // treepath will be invalid.",
+ "",
+ " ",
+ " if ((action & Gdk.DragAction.MOVE) > 0) {",
+ " print(\"REMOVING OLD NODE : \" + target_data + \"\\n\");",
+ " node.remove();",
+ " this.dropNode(target_data, node, false);",
+ " this.el.remove(ref old_iter);",
+ " ",
+ " ",
+ " ",
+ " } else {",
+ " print(\"DROPPING NODE // copy: \" + target_data + \"\\n\");",
+ " node = node.deepClone();",
+ " this.dropNode(target_data, node, false);",
+ " }",
+ " _this.changed();",
+ " this.activePath= \"\";",
+ " //this.updateNode(false,true);",
+ "}",
+ ""
+ ],
+ "| void updateSelected" : [
+ "() {",
+ " ",
+ " ",
+ " var s = _this.view.el.get_selection();",
+ " ",
+ " Gtk.TreeIter iter;",
+ " Gtk.TreeModel mod;",
+ " ",
+ " ",
+ " ",
+ " if (!s.get_selected(out mod, out iter)) {",
+ " return; // nothing seleted..",
+ " }",
+ " ",
+ " GLib.Value value;",
+ " this.el.get_value(iter, 2, out value);",
+ " var node = (JsRender.Node)(value.get_object());",
+ " ",
+ " this.el.set(iter, 0, node.nodeTitle(),",
+ " 1, node.nodeTip(), -1",
+ " );",
+ "}",
+ ""
+ ],
+ "| string treePathFromNode" : [
+ "(JsRender.Node node) {",
+ " // iterate through the tree and find the node",
+ " var ret = \"\";",
+ " ",
+ " this.el.foreach((mod, pth, iter) => {",
+ " // get the node..",
+ " ",
+ " ",
+ " GLib.Value value;",
+ " _this.model.el.get_value(iter, 2, out value);",
+ " ",
+ "",
+ " ",
+ " var n = (JsRender.Node)value;",
+ "",
+ " print(\"compare %s to %s\\n\", n.fqn(), node.fqn());",
+ " if (node == n) {",
+ " ret = pth.to_string();",
+ " return true;",
+ " }",
+ " return false;",
+ " });",
+ " return ret;",
+ "",
+ "}",
+ ""
+ ]
+ },
+ {
+ "$ xns" : "Gtk",
+ "* init" : [
+ " this.el.add_attribute(_this.renderer.el , \"markup\", 0 );",
+ " "
+ ],
+ "* pack" : "append_column",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* pack" : "pack_start,true",
+ "id" : "renderer",
+ "xtype" : "CellRendererText"
+ }
+ ],
+ "utf8 title" : "test",
+ "xtype" : "TreeViewColumn"
+ }
+ ],
"listeners" : {
- "activate" : " () => {\n\n DialogSaveTemplate.singleton().show(\n (Gtk.Window) _this.el.get_toplevel (), \n _this.main_window.windowstate.file.palete(), \n _this.getActiveElement()\n );\n \n \n}"
+ "button_press_event" : [
+ " ( ev) => {",
+ " //console.log(\"button press?\");",
+ " this.button_is_pressed = true;",
+ " print(\"BUTTON DOWN\\n\");",
+ " ",
+ " this.lastEventSource = \"tree\";",
+ " if (! _this.before_node_change() ) {",
+ " ",
+ " return true;",
+ " }",
+ " ",
+ "",
+ " ",
+ " if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {",
+ " //print(\"click\" + ev.type);",
+ " return false;",
+ " }",
+ " Gtk.TreePath res;",
+ " if (!_this.view.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {",
+ " return true;",
+ " }",
+ " ",
+ " this.el.get_selection().select_path(res);",
+ " ",
+ " //if (!this.get('/LeftTreeMenu').el) { ",
+ " // this.get('/LeftTreeMenu').init(); ",
+ " // }",
+ " ",
+ " _this.LeftTreeMenu.el.set_screen(Gdk.Screen.get_default());",
+ " _this.LeftTreeMenu.el.show_all();",
+ " _this.LeftTreeMenu.el.popup(null, null, null, 3, ev.time);",
+ " // print(\"click:\" + res.path.to_string());",
+ " return true;",
+ "}"
+ ],
+ "button_release_event" : [
+ "(ev) => { ",
+ " this.button_is_pressed = false;",
+ " return false;",
+ "}"
+ ],
+ "cursor_changed" : [
+ " ( ) => {",
+ " print(\"LEFT TREE Cursor Changed\\n\");",
+ "\tif (!this.button_is_pressed && !this.key_is_pressed) {",
+ "\t\t// then event was started by some other action",
+ "\t\t// which should manually trigger all the events..",
+ "\t\tprint(\"SKIPPING select - no button or key pressed\\n\");",
+ "\t\treturn;",
+ "\t}",
+ "",
+ "",
+ " if (this.blockChanges) { // probably not needed.. ",
+ "\t\tprint(\"SKIPPING select - blockchanges set..\\n\"); ",
+ " return ;",
+ " }",
+ " if (!_this.before_node_change( ) ) {",
+ "\t this.blockChanges = true;",
+ "\t this.el.get_selection().unselect_all();",
+ "\t this.blockChanges = false;",
+ "\t ",
+ "\t return;",
+ " }",
+ " if (_this.main_window.windowstate.file == null) {",
+ " \t\tprint(\"SKIPPING select windowstate file is not set...\\n\"); ",
+ " return;",
+ " } ",
+ " ",
+ " //var render = this.get('/LeftTree').getRenderer(); ",
+ " print(\"LEFT TREE -> view -> selection changed called\\n\");",
+ " ",
+ " ",
+ " // -- it appears that the selection is not updated.",
+ " ",
+ " GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {",
+ " print(\"LEFT TREE -> view -> selection changed TIMEOUT CALLED\\n\");",
+ "",
+ " if (this.el.get_selection().count_selected_rows() < 1) {",
+ "",
+ " print(\"selected rows < 1\\n\");",
+ " //??this.model.load( false);",
+ " _this.node_selected(null, this.lastEventSource);",
+ " ",
+ " return false ;",
+ " }",
+ " ",
+ " //console.log('changed');",
+ " var s = this.el.get_selection();",
+ " Gtk.TreeIter iter;",
+ " Gtk.TreeModel mod;",
+ " s.get_selected(out mod, out iter);",
+ " ",
+ " ",
+ " // var val = \"\";",
+ " GLib.Value value;",
+ " _this.model.el.get_value(iter, 2, out value);",
+ " _this.model.activePath = mod.get_path(iter).to_string();",
+ " ",
+ " var node = (JsRender.Node)value.dup_object();",
+ " print (\"calling left_tree.node_selected\\n\");",
+ " _this.node_selected(node, this.lastEventSource);",
+ " while (Gtk.events_pending()) {",
+ " Gtk.main_iteration();",
+ " }",
+ " var cp = mod.get_path(iter);",
+ " Gtk.TreePath sp, ep;",
+ " this.el.get_visible_range(out sp, out ep);",
+ " // if sp is before cp then retuns 1.",
+ " // if cp is before ep then retuns 1.",
+ " if (cp.compare(sp) >= 0 && ep.compare(cp) >=1) {",
+ " return false;",
+ " }",
+ " ",
+ " ",
+ " ",
+ " this.el.scroll_to_cell(new Gtk.TreePath.from_string(_this.model.activePath), null, true, 0.1f,0.0f);",
+ " ",
+ " return false;",
+ " }); ",
+ " //_this.after_node_change(node);",
+ "",
+ "// _this.model.file.changed(node, \"tree\");",
+ " ",
+ " //Seed.print( value.get_string());",
+ " return ;",
+ " ",
+ "}"
+ ],
+ "drag_begin" : [
+ "( ctx) => {",
+ "\t//print('SOURCE: drag-begin');",
+ " ",
+ " ",
+ " //this.targetData = \"\";",
+ " ",
+ " // find what is selected in our tree...",
+ " ",
+ " var s = _this.view.el.get_selection();",
+ " if (s.count_selected_rows() < 1) {",
+ " return;",
+ " }",
+ " Gtk.TreeIter iter;",
+ " Gtk.TreeModel mod;",
+ " s.get_selected(out mod, out iter);",
+ "",
+ " ",
+ "",
+ " // set some properties of the tree for use by the dropped element.",
+ " GLib.Value value;",
+ " _this.model.el.get_value(iter, 2, out value);",
+ " var tp = mod.get_path(iter).to_string();",
+ " var data = (JsRender.Node)(value.dup_object());",
+ " var xname = data.fqn();",
+ " print (\"XNAME IS \" + xname+ \"\\n\");",
+ " this.dragData = tp;",
+ " this.dropList = _this.main_window.windowstate.file.palete().getDropList(xname);",
+ " ",
+ " print (\"DROP LIST IS \" + string.joinv(\", \", this.dropList) + \"\\n\");",
+ " ",
+ "",
+ " // make the drag icon a picture of the node that was selected",
+ " ",
+ " ",
+ " // by default returns the path..",
+ " var path = _this.model.el.get_path(iter);",
+ "",
+ " ",
+ " var pix = this.el.create_row_drag_icon ( path);",
+ " ",
+ " Gtk.drag_set_icon_surface (ctx, pix) ;",
+ " ",
+ " return;",
+ "}"
+ ],
+ "drag_data_get" : [
+ "( drag_context, data, info, time) => {",
+ " ",
+ " ",
+ " //print(\"drag-data-get\");",
+ " var s = this.el.get_selection();",
+ " if (s.count_selected_rows() < 1) {",
+ " data.set_text(\"\",0); ",
+ " print(\"return empty string - no selection..\");",
+ " return;",
+ " }",
+ " ",
+ " Gtk.TreeIter iter;",
+ " Gtk.TreeModel mod;",
+ " ",
+ " s.get_selected(out mod, out iter);",
+ " ",
+ " ",
+ " ",
+ " GLib.Value value;",
+ " _this.model.el.get_value(iter, 2, out value);",
+ " var ndata = (JsRender.Node)(value.dup_object());",
+ " ",
+ " ",
+ " ",
+ " var tp = mod.get_path(iter).to_string();",
+ " // by default returns the path..",
+ " ",
+ " if ( info != Gdk.Atom.intern(\"STRING\",true) ) {",
+ " tp = ndata.toJsonString();",
+ " } ",
+ " ",
+ " //data.set_text(tp,tp.length); ",
+ " ",
+ " data.set (data.get_target (), 8, (uchar[]) tp.to_utf8 ());",
+ " ",
+ " ",
+ " // print(\"return \" + tp);",
+ " }"
+ ],
+ "drag_data_received" : [
+ " (ctx, x, y, sel, info, time) => {",
+ " ",
+ " // THIS CODE ONLY RELATES TO drag or drop of \"NEW\" elements or \"FROM another tree..\"",
+ " ",
+ " ",
+ " // print(\"Tree: drag-data-received\\n\");",
+ " var selection_text = (string)sel.get_data();",
+ " //print(\"selection_text= %s\\n\",selection_text);",
+ "",
+ " var is_drag = this.drag_in_motion;",
+ " ",
+ " ",
+ "",
+ "\t\tGLib.debug(\"Is Drag %s\\n\", is_drag ? \"Y\": \"N\");",
+ " var targetData = \"\";",
+ " ",
+ " Gtk.TreePath path;",
+ " Gtk.TreeViewDropPosition pos;",
+ " var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);",
+ " ",
+ " // if there are not items in the tree.. the we have to set isOver to true for anything..",
+ " var isEmpty = false;",
+ " if (_this.model.el.iter_n_children(null) < 1) {",
+ " GLib.debug(\"got NO children?\\n\");",
+ " isOver = true; //??? ",
+ " isEmpty = true;",
+ " pos = Gtk.TreeViewDropPosition.INTO_OR_AFTER;",
+ " }",
+ " ",
+ " ",
+ " //console.log(\"LEFT-TREE: drag-motion\");",
+ " var src = Gtk.drag_get_source_widget(ctx);",
+ " ",
+ " // a drag from self - this should be handled by drop and motion.",
+ " if (src == this.el) {",
+ " GLib.debug(\"Source == this element should not happen.. ? \\n\");",
+ " return;",
+ " }",
+ " //print(\"drag_data_recieved from another element\");",
+ " ",
+ " ",
+ " ",
+ " ",
+ " if (selection_text == null || selection_text.length < 1 || !isOver) {",
+ " // nothing valid foudn to drop...",
+ " GLib.debug(\"empty sel text or not over\");",
+ " if (is_drag) {",
+ " Gdk.drag_status(ctx, 0, time);",
+ " this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);",
+ " return;",
+ " }",
+ " Gtk.drag_finish (ctx, false, false, time); // drop failed..",
+ " // no drop action...",
+ " return; ",
+ " ",
+ " }",
+ " var dropNode = new JsRender.Node(); ",
+ " ",
+ " var dropNodeType = selection_text;",
+ " var show_templates = true;",
+ " // for drop",
+ " if (dropNodeType[0] == '{') {",
+ " var pa = new Json.Parser();",
+ " try {",
+ " pa.load_from_data(dropNodeType);",
+ " } catch (Error e) {",
+ " Gtk.drag_finish (ctx, false, false, time); // drop failed..",
+ " // no drop action...",
+ " return; ",
+ " }",
+ " ",
+ " dropNode.loadFromJson( pa.get_root().get_object(), 2);",
+ " dropNodeType = dropNode.fqn();",
+ " show_templates = false;",
+ " ",
+ " ",
+ " } else {",
+ " \tif (selection_text.contains(\":\")) {",
+ "\t \tvar bits = selection_text.split(\":\");",
+ "\t dropNode.setFqn(bits[0]);",
+ "\t dropNode.props.set(\"* prop\", bits[1]);",
+ " \t} else {",
+ "",
+ "\t dropNode.setFqn(selection_text);",
+ " }",
+ " }",
+ "",
+ " ",
+ " // dropList --- need to gather this ... ",
+ " GLib.debug(\"get dropList for : %s\\n\",dropNodeType); ",
+ " var dropList = _this.main_window.windowstate.file.palete().getDropList(dropNodeType);",
+ " ",
+ " GLib.debug(\"dropList: %s\\n\", string.joinv(\" , \", dropList));",
+ " ",
+ " // if drag action is link ... then we can drop it anywahere...",
+ " if ((ctx.get_actions() & Gdk.DragAction.LINK) > 0) {",
+ " // if path is null?? dragging into an empty tree?",
+ " targetData = (path == null ? \"\" : path.to_string()) + \"|%d\".printf((int)pos);",
+ " } else {",
+ " ",
+ " ",
+ " targetData = _this.model.findDropNodeByPath( isEmpty ? \"\" : path.to_string(), dropList, pos);",
+ " }",
+ " ",
+ " ",
+ " ",
+ " GLib.debug(\"targetDAta: %s\", targetData );",
+ " ",
+ " if (targetData.length < 1) {",
+ " ",
+ " // invalid drop path..",
+ " if (this.drag_in_motion) {",
+ " Gdk.drag_status(ctx, 0, time);",
+ " this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);",
+ " return;",
+ " }",
+ " Gtk.drag_finish (ctx, false, false, time); // drop failed..",
+ " // no drop action...",
+ " return;",
+ " }",
+ " ",
+ " ",
+ " ",
+ " var td_ar = targetData.split(\"|\");",
+ " ",
+ " ",
+ " if (this.drag_in_motion) { ",
+ " Gdk.drag_status(ctx, Gdk.DragAction.COPY ,time);",
+ "",
+ " this.highlightDropPath( td_ar[0] , (Gtk.TreeViewDropPosition)int.parse(td_ar[1]));",
+ " return;",
+ " }",
+ " // continue on to allow drop..",
+ " ",
+ "",
+ " // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..",
+ " //targetData",
+ " \t\t// {parent}|{pos}|{prop}",
+ " ",
+ "",
+ " _this.model.dropNode(targetData, dropNode, show_templates);",
+ " GLib.debug(\"ADD new node!!!\\n\");",
+ " ",
+ " ///Xcls_DialogTemplateSelect.singleton().show( _this.model.file.palete(), node);",
+ " ",
+ " Gtk.drag_finish (ctx, false, false,time);",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "}"
+ ],
+ "drag_drop" : [
+ " ( ctx, x, y, time) => {",
+ " //Seed.print(\"TARGET: drag-drop\");",
+ " ",
+ " ",
+ " var src = Gtk.drag_get_source_widget(ctx);",
+ " ",
+ " if (src != this.el) {",
+ " ",
+ " ",
+ " ",
+ " this.drag_in_motion = false; ",
+ " // request data that will be recieved by the recieve... ",
+ " Gtk.drag_get_data",
+ " (",
+ " this.el, // will receive 'drag-data-received' signal ",
+ " ctx, // represents the current state of the DnD ",
+ " Gdk.Atom.intern(\"application/json\",true), // the target type we want ",
+ " time // time stamp ",
+ " );",
+ "",
+ " ",
+ " // No target offered by source => error",
+ " ",
+ "",
+ " return false;",
+ " }",
+ " ",
+ " // handle drop around self..",
+ " ",
+ " ",
+ " ",
+ " //print(\"GETTING POS\");",
+ " var targetData = \"\";",
+ " ",
+ " Gtk.TreePath path;",
+ " Gtk.TreeViewDropPosition pos;",
+ " var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);",
+ " ",
+ " // if there are not items in the tree.. the we have to set isOver to true for anything..",
+ " var isEmpty = false;",
+ " if (_this.model.el.iter_n_children(null) < 1) {",
+ " print(\"got NO children?\\n\");",
+ " isOver = true; //??? ",
+ " isEmpty = true;",
+ " pos = Gtk.TreeViewDropPosition.INTO_OR_AFTER;",
+ " }",
+ " ",
+ " ",
+ " ",
+ " //var action = Gdk.DragAction.COPY;",
+ " // unless we are copying!!! ctl button..",
+ " ",
+ " var action = (ctx.get_actions() & Gdk.DragAction.MOVE) > 0 ?",
+ " Gdk.DragAction.COPY : Gdk.DragAction.MOVE ;",
+ " // Gdk.DragAction.MOVE : Gdk.DragAction.COPY ;",
+ "",
+ " ",
+ " if (_this.model.el.iter_n_children(null) < 1) {",
+ " // no children.. -- asume it's ok..",
+ " ",
+ " targetData = \"|%d|\".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);",
+ " ",
+ " // continue through to allow drop...",
+ "",
+ " } else {",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " //print(\"ISOVER? \" + isOver);",
+ " if (!isOver) {",
+ " ",
+ " Gtk.drag_finish (ctx, false, false, time); // drop failed..",
+ " return true; // not over apoint!?! - no action on drop or motion..",
+ " }",
+ " ",
+ " // drag node is parent of child..",
+ " //console.log(\"SRC TREEPATH: \" + src.treepath);",
+ " //console.log(\"TARGET TREEPATH: \" + data.path.to_string());",
+ " ",
+ " // nned to check a few here..",
+ " //Gtk.TreeViewDropPosition.INTO_OR_AFTER",
+ " //Gtk.TreeViewDropPosition.INTO_OR_BEFORE",
+ " //Gtk.TreeViewDropPosition.AFTER",
+ " //Gtk.TreeViewDropPosition.BEFORE",
+ " ",
+ " // locally dragged items to not really use the ",
+ " var selection_text = this.dragData;",
+ " ",
+ " ",
+ " ",
+ " if (selection_text == null || selection_text.length < 1) {",
+ " //print(\"Error - drag selection text returned NULL\");",
+ " ",
+ " Gtk.drag_finish (ctx, false, false, time); // drop failed..",
+ " return true; /// -- fixme -- this is not really correct..",
+ " } ",
+ " ",
+ " // see if we are dragging into ourself?",
+ " print (\"got selection text of \" + selection_text);",
+ " ",
+ " var target_path = path.to_string();",
+ " //print(\"target_path=\"+target_path);",
+ "",
+ " // ",
+ " if (selection_text == target_path) {",
+ " print(\"self drag ?? == we should perhaps allow copy onto self..\\n\");",
+ " ",
+ " Gtk.drag_finish (ctx, false, false, time); // drop failed..",
+ "",
+ " return true; /// -- fixme -- this is not really correct..",
+ "",
+ " }",
+ " ",
+ " // check that ",
+ " //print(\"DUMPING DATA\");",
+ " //console.dump(data);",
+ " // path, pos",
+ " ",
+ " //print(data.path.to_string() +' => '+ data.pos);",
+ " ",
+ " // dropList is a list of xtypes that this node could be dropped on.",
+ " // it is set up when we start to drag..",
+ " ",
+ " ",
+ " targetData = _this.model.findDropNodeByPath( path.to_string(), this.dropList, pos);",
+ " ",
+ " print(\"targetDAta: \" + targetData +\"\\n\");",
+ " ",
+ " if (targetData.length < 1) {",
+ " //print(\"Can not find drop node path\");",
+ " ",
+ " Gtk.drag_finish (ctx, false, false, time); // drop failed..",
+ " return true;",
+ " }",
+ " ",
+ " ",
+ " ",
+ " // continue on to allow drop..",
+ " }",
+ " // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..",
+ "",
+ "",
+ " var delete_selection_data = false;",
+ " ",
+ " if (action == Gdk.DragAction.ASK) {",
+ " /* Ask the user to move or copy, then set the ctx action. */",
+ " }",
+ "",
+ " if (action == Gdk.DragAction.MOVE) {",
+ " delete_selection_data = true;",
+ " }",
+ " ",
+ " // drag around.. - reorder..",
+ " _this.model.moveNode(targetData, action);",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " // we can send stuff to souce here...",
+ "",
+ "",
+ "// do we always say failure, so we handle the reall drop?",
+ " Gtk.drag_finish (ctx, false, false,time); //delete_selection_data, time);",
+ "",
+ " return true;",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "}"
+ ],
+ "drag_end" : [
+ " (drag_context) => {",
+ "\t//Seed.print('LEFT-TREE: drag-end');",
+ " this.dragData = \"\";",
+ " this.dropList = null;",
+ "// this.targetData = \"\";",
+ " this.highlightDropPath(\"\",0);",
+ "// return true;",
+ "}"
+ ],
+ "drag_motion" : [
+ " ( ctx, x, y, time) => {",
+ " print(\"got drag motion\\n\");",
+ " var src = Gtk.drag_get_source_widget(ctx);",
+ " this.drag_x = x;",
+ " this.drag_y = y; ",
+ "",
+ " if (src != this.el) {",
+ " ",
+ " ",
+ " ",
+ " // the point of this is to detect where an item could be dropped..",
+ " print(\"requesting drag data\\n\");",
+ " this.drag_in_motion = true;",
+ " ",
+ " // request data that will be recieved by the recieve... ",
+ " Gtk.drag_get_data",
+ " (",
+ " this.el, // will receive 'drag-data-received' signal ",
+ " ctx, // represents the current state of the DnD ",
+ " Gdk.Atom.intern(\"STRING\",true), // the target type we want ",
+ " time // time stamp ",
+ " );",
+ " return true;",
+ " } ",
+ "",
+ "",
+ " print(\"action: %d\\n\", ctx.get_actions());",
+ " //print(\"GETTING POS\");",
+ " var targetData = \"\";",
+ "",
+ " Gtk.TreePath path;",
+ " Gtk.TreeViewDropPosition pos;",
+ " var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);",
+ "",
+ " // if there are not items in the tree.. the we have to set isOver to true for anything..",
+ " var isEmpty = false;",
+ " if (_this.model.el.iter_n_children(null) < 1) {",
+ " print(\"got NO children?\\n\");",
+ " isOver = true; //??? ",
+ " isEmpty = true;",
+ " pos = Gtk.TreeViewDropPosition.INTO_OR_AFTER;",
+ " }",
+ "",
+ "",
+ " // ------------- a drag from self..",
+ "",
+ "",
+ " //var action = Gdk.DragAction.COPY;",
+ " // unless we are copying!!! ctl button..",
+ " ",
+ " var action = (ctx.get_actions() & Gdk.DragAction.MOVE) > 0 ?",
+ " Gdk.DragAction.COPY : Gdk.DragAction.MOVE ;",
+ " // Gdk.DragAction.MOVE : Gdk.DragAction.COPY ;",
+ "",
+ "",
+ " if (_this.model.el.iter_n_children(null) < 1) {",
+ " // no children.. -- asume it's ok..",
+ " ",
+ " targetData = \"|%d|\".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);",
+ " ",
+ " this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0); ",
+ " Gdk.drag_status(ctx, action ,time);",
+ " return true;",
+ " ",
+ " // continue through to allow drop...",
+ "",
+ " } ",
+ " ",
+ " ",
+ "",
+ " ",
+ " ",
+ " //print(\"ISOVER? \" + isOver);",
+ " if (!isOver) {",
+ " ",
+ " Gdk.drag_status(ctx, 0 ,time);",
+ " this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0); ",
+ " return false;",
+ "",
+ " }",
+ " ",
+ " // drag node is parent of child..",
+ " //console.log(\"SRC TREEPATH: \" + src.treepath);",
+ " //console.log(\"TARGET TREEPATH: \" + data.path.to_string());",
+ " ",
+ " // nned to check a few here..",
+ " //Gtk.TreeViewDropPosition.INTO_OR_AFTER",
+ " //Gtk.TreeViewDropPosition.INTO_OR_BEFORE",
+ " //Gtk.TreeViewDropPosition.AFTER",
+ " //Gtk.TreeViewDropPosition.BEFORE",
+ " ",
+ " // locally dragged items to not really use the ",
+ " var selection_text = this.dragData;",
+ " ",
+ " ",
+ " ",
+ " if (selection_text == null || selection_text.length < 1) {",
+ " //print(\"Error - drag selection text returned NULL\");",
+ " Gdk.drag_status(ctx, 0 ,time);",
+ " this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);",
+ " return false;",
+ " }",
+ " ",
+ " ",
+ " // see if we are dragging into ourself?",
+ " var target_path = path.to_string(); ",
+ " print (\"Drag %s onto %s--%d\\n \", selection_text, target_path, pos);",
+ " ",
+ " // pos : 3 = ontop - 0 = after, 1 = before",
+ " //print(\"target_path=\"+target_path);",
+ "",
+ " // ",
+ " if (selection_text == target_path) {",
+ " print(\"self drag ?? == we should perhaps allow copy onto self..\\n\");",
+ " ",
+ " Gdk.drag_status(ctx, 0 ,time);",
+ " this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);",
+ " return false;",
+ "// -- fixme -- this is not really correct..",
+ "",
+ " }",
+ " ",
+ " // check that ",
+ " //print(\"DUMPING DATA\");",
+ " //console.dump(data);",
+ " // path, pos",
+ " ",
+ " //print(data.path.to_string() +' => '+ data.pos);",
+ " ",
+ " // dropList is a list of xtypes that this node could be dropped on.",
+ " // it is set up when we start to drag..",
+ " ",
+ " ",
+ " targetData = _this.model.findDropNodeByPath( path.to_string(), this.dropList, pos);",
+ " ",
+ " print(\"targetDAta: \" + targetData +\"\\n\");",
+ " ",
+ " if (targetData.length < 1) {",
+ " //print(\"Can not find drop node path\");",
+ " ",
+ " Gdk.drag_status(ctx, 0, time);",
+ " this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);",
+ " return false;",
+ " }",
+ " ",
+ " var td_ar = targetData.split(\"|\");",
+ " ",
+ " ",
+ "",
+ " Gdk.drag_status(ctx, action ,time);",
+ " this.highlightDropPath(td_ar[0], (Gtk.TreeViewDropPosition)int.parse(td_ar[1]));",
+ " return true;",
+ " ",
+ " ",
+ "}"
+ ],
+ "key_press_event" : [
+ "(ev) => {",
+ " this.key_is_pressed = true;",
+ " return false;",
+ "}"
+ ],
+ "key_release_event" : [
+ "(ev) => {",
+ " this.key_is_pressed = false;",
+ " return false;",
+ "}",
+ ""
+ ]
},
- "label" : "Save as Template",
- "* pack" : "add",
- "xtype" : "MenuItem",
- "$ xns" : "Gtk"
+ "tooltip_column" : 1,
+ "xtype" : "TreeView",
+ "| void highlightDropPath" : [
+ " ( string treepath, Gtk.TreeViewDropPosition pos) {",
+ "",
+ " // highlighting for drag/drop",
+ " if (treepath.length > 0) {",
+ " this.el.set_drag_dest_row( new Gtk.TreePath.from_string( treepath ), pos);",
+ " } else {",
+ " this.el.set_drag_dest_row(null, Gtk.TreeViewDropPosition.INTO_OR_AFTER);",
+ " }",
+ " ",
+ "}"
+ ],
+ "| void selectNode" : [
+ "(string treepath_str, string source) {",
+ "\tthis.lastEventSource = source;",
+ " //this.selection.select_path(new Gtk.TreePath.from_string( treepath_str));",
+ " var tp = new Gtk.TreePath.from_string(treepath_str);",
+ " ",
+ " this.el.set_cursor(tp, null, false); ",
+ " this.el.scroll_to_cell(tp, null, false, 0,0);",
+ "}",
+ ""
+ ],
+ "| void setCursor" : [
+ "(string treepath, string sourceEvent) {",
+ "\tthis.lastEventSource = sourceEvent;",
+ "\t//this.blockChanges = true; << block changes prevents loading of 'node data' and firing of node_selected..",
+ " this.el.set_cursor(new Gtk.TreePath.from_string(treepath), null, false); ",
+ " // fire node_selected..",
+ " //this.blockChanges = false;",
+ "\tthis.lastEventSource = \"\";",
+ "}",
+ ""
+ ]
},
{
- "listeners" : {
- "activate" : " () => {\n var node = _this.getActiveElement();\n var name = DialogSaveModule.singleton().show(\n (Gtk.Window) _this.el.get_toplevel (), \n _this.main_window.windowstate.project, \n node\n );\n if (name.length < 1) {\n return;\n \n }\n node.props.set(\"* xinclude\", name);\n node.items.clear();\n\n\n var s = _this.view.el.get_selection();\n \n print(\"GET SELECTED?\");\n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n\n \n if (!s.get_selected(out mod, out iter)) {\n return; // nothing seleted..\n }\n Gtk.TreeIter citer;\n var n_cn = mod.iter_n_children(iter) -1;\n for (var i = n_cn; i > -1; i--) {\n mod.iter_nth_child(out citer, iter, i);\n \n\n print(\"removing node from Tree\\n\"); \n \n _this.model.el.remove(ref citer);\n }\n _this.changed();\n _this.node_selected(node, \"tree\");\n \n \n}"
- },
- "label" : "Save as Module",
- "* pack" : "add",
- "xtype" : "MenuItem",
- "$ xns" : "Gtk"
+ "$ xns" : "Gtk",
+ "* pack" : false,
+ "id" : "LeftTreeMenu",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* pack" : "add",
+ "label" : "Delete Element",
+ "listeners" : {
+ "activate" : [
+ " ( ) => {",
+ " ",
+ " print(\"ACTIVATE?\");",
+ " ",
+ " ",
+ " _this.model.deleteSelected();",
+ "}"
+ ]
+ },
+ "xtype" : "MenuItem"
+ },
+ {
+ "$ xns" : "Gtk",
+ "* pack" : "add",
+ "label" : "Save as Template",
+ "listeners" : {
+ "activate" : [
+ " () => {",
+ "",
+ " DialogSaveTemplate.singleton().show(",
+ " (Gtk.Window) _this.el.get_toplevel (), ",
+ " _this.main_window.windowstate.file.palete(), ",
+ " _this.getActiveElement()",
+ " );",
+ " ",
+ " ",
+ "}"
+ ]
+ },
+ "xtype" : "MenuItem"
+ },
+ {
+ "$ xns" : "Gtk",
+ "* pack" : "add",
+ "label" : "Save as Module",
+ "listeners" : {
+ "activate" : [
+ " () => {",
+ " var node = _this.getActiveElement();",
+ " var name = DialogSaveModule.singleton().show(",
+ " (Gtk.Window) _this.el.get_toplevel (), ",
+ " _this.main_window.windowstate.project, ",
+ " node",
+ " );",
+ " if (name.length < 1) {",
+ " return;",
+ " ",
+ " }",
+ " node.props.set(\"* xinclude\", name);",
+ " node.items.clear();",
+ "",
+ "",
+ " var s = _this.view.el.get_selection();",
+ " ",
+ " print(\"GET SELECTED?\");",
+ " Gtk.TreeIter iter;",
+ " Gtk.TreeModel mod;",
+ "",
+ " ",
+ " if (!s.get_selected(out mod, out iter)) {",
+ " return; // nothing seleted..",
+ " }",
+ " Gtk.TreeIter citer;",
+ " var n_cn = mod.iter_n_children(iter) -1;",
+ " for (var i = n_cn; i > -1; i--) {",
+ " mod.iter_nth_child(out citer, iter, i);",
+ " ",
+ "",
+ " print(\"removing node from Tree\\n\"); ",
+ " ",
+ " _this.model.el.remove(ref citer);",
+ " }",
+ " _this.changed();",
+ " _this.node_selected(node, \"tree\");",
+ " ",
+ " ",
+ "}"
+ ]
+ },
+ "xtype" : "MenuItem"
+ }
+ ],
+ "xtype" : "Menu"
}
- ]
+ ],
+ "xtype" : "ScrolledWindow"
}
+ ],
+ "xtype" : "Box",
+ "| JsRender.JsRender getActiveFile" : [
+ "() {",
+ " return this.main_window.windowstate.file;",
+ "}",
+ ""
+ ],
+ "| JsRender.Node? getActiveElement" : [
+ " () { // return path to actie node.",
+ "",
+ " var path = this.getActivePath();",
+ " if (path.length < 1) {",
+ " return null;",
+ " }",
+ " return _this.model.pathToNode(path);",
+ " ",
+ "}",
+ ""
+ ],
+ "| string getActivePath" : [
+ " () {",
+ " ",
+ " var view = this.view.el;",
+ " if (view.get_selection().count_selected_rows() < 1) {",
+ " return \"\";",
+ " }",
+ " Gtk.TreeIter iter;",
+ " Gtk.TreeModel mod;",
+ " view.get_selection().get_selected(out mod, out iter);",
+ " return mod.get_path(iter).to_string();",
+ "}",
+ " "
]
}
- ]
+ ],
+ "modOrder" : "",
+ "name" : "WindowLeftTree",
+ "parent" : "",
+ "path" : "/home/alan/gitlive/roobuilder/src/Builder4/WindowLeftTree.bjs",
+ "permname" : "",
+ "title" : ""
}
\ No newline at end of file
public class Xcls_WindowLeftTree : Object
{
- public Gtk.ScrolledWindow el;
+ public Gtk.Box el;
private Xcls_WindowLeftTree _this;
public static Xcls_WindowLeftTree singleton()
public Xcls_WindowLeftTree()
{
_this = this;
- this.el = new Gtk.ScrolledWindow( null, null );
+ this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
// my vars (dec)
this.main_window = null;
// set gobject values
- this.el.shadow_type = Gtk.ShadowType.IN;
- var child_0 = new Xcls_view( _this );
+ var child_0 = new Xcls_Button2( _this );
child_0.ref();
this.el.add ( child_0.el );
- var child_1 = new Xcls_LeftTreeMenu( _this );
+ var child_1 = new Xcls_ScrolledWindow4( _this );
child_1.ref();
-
- // init method
-
- this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
+ this.el.add ( child_1.el );
}
// user defined functions
view.get_selection().get_selected(out mod, out iter);
return mod.get_path(iter).to_string();
}
+ public class Xcls_Button2 : Object
+ {
+ public Gtk.Button el;
+ private Xcls_WindowLeftTree _this;
+
+
+ // my vars (def)
+
+ // ctor
+ public Xcls_Button2(Xcls_WindowLeftTree _owner )
+ {
+ _this = _owner;
+ this.el = new Gtk.Button();
+
+ // my vars (dec)
+
+ // set gobject values
+ this.el.hexpand = true;
+ this.el.always_show_image = true;
+ this.el.label = "Add Child Element";
+ var child_0 = new Xcls_Image3( _this );
+ child_0.ref();
+ this.el.set_image ( child_0.el );
+
+ //listeners
+ this.el.clicked.connect( ( ) => {
+
+
+ _this.main_window.windowstate.showAddObject(this.el);
+
+ });
+ }
+
+ // user defined functions
+ }
+ public class Xcls_Image3 : Object
+ {
+ public Gtk.Image el;
+ private Xcls_WindowLeftTree _this;
+
+
+ // my vars (def)
+
+ // ctor
+ public Xcls_Image3(Xcls_WindowLeftTree _owner )
+ {
+ _this = _owner;
+ this.el = new Gtk.Image();
+
+ // my vars (dec)
+
+ // set gobject values
+ this.el.icon_name = "list-add";
+ }
+
+ // user defined functions
+ }
+
+
+ public class Xcls_ScrolledWindow4 : Object
+ {
+ public Gtk.ScrolledWindow el;
+ private Xcls_WindowLeftTree _this;
+
+
+ // my vars (def)
+
+ // ctor
+ public Xcls_ScrolledWindow4(Xcls_WindowLeftTree _owner )
+ {
+ _this = _owner;
+ this.el = new Gtk.ScrolledWindow( null, null );
+
+ // my vars (dec)
+
+ // set gobject values
+ this.el.shadow_type = Gtk.ShadowType.IN;
+ var child_0 = new Xcls_view( _this );
+ child_0.ref();
+ this.el.add ( child_0.el );
+ var child_1 = new Xcls_LeftTreeMenu( _this );
+ child_1.ref();
+
+ // init method
+
+ this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
+ }
+
+ // user defined functions
+ }
public class Xcls_view : Object
{
public Gtk.TreeView el;
// my vars (def)
public string dragData;
- public string[] dropList;
public int drag_x;
+ public string[] dropList;
public int drag_y;
public bool button_is_pressed;
public string lastEventSource;
var child_0 = new Xcls_model( _this );
child_0.ref();
this.el.set_model ( child_0.el );
- var child_1 = new Xcls_TreeViewColumn4( _this );
+ var child_1 = new Xcls_TreeViewColumn7( _this );
child_1.ref();
this.el.append_column ( child_1.el );
return;
});
+ this.el.drag_data_get.connect( ( drag_context, data, info, time) => {
+
+
+ //print("drag-data-get");
+ var s = this.el.get_selection();
+ if (s.count_selected_rows() < 1) {
+ data.set_text("",0);
+ print("return empty string - no selection..");
+ return;
+ }
+
+ Gtk.TreeIter iter;
+ Gtk.TreeModel mod;
+
+ s.get_selected(out mod, out iter);
+
+
+
+ GLib.Value value;
+ _this.model.el.get_value(iter, 2, out value);
+ var ndata = (JsRender.Node)(value.dup_object());
+
+
+
+ var tp = mod.get_path(iter).to_string();
+ // by default returns the path..
+
+ if ( info != Gdk.Atom.intern("STRING",true) ) {
+ tp = ndata.toJsonString();
+ }
+
+ //data.set_text(tp,tp.length);
+
+ data.set (data.get_target (), 8, (uchar[]) tp.to_utf8 ());
+
+
+ // print("return " + tp);
+ });
this.el.drag_end.connect( (drag_context) => {
//Seed.print('LEFT-TREE: drag-end');
this.dragData = "";
});
- this.el.drag_data_get.connect( ( drag_context, data, info, time) => {
-
-
- //print("drag-data-get");
- var s = this.el.get_selection();
- if (s.count_selected_rows() < 1) {
- data.set_text("",0);
- print("return empty string - no selection..");
- return;
- }
-
- Gtk.TreeIter iter;
- Gtk.TreeModel mod;
-
- s.get_selected(out mod, out iter);
-
-
-
- GLib.Value value;
- _this.model.el.get_value(iter, 2, out value);
- var ndata = (JsRender.Node)(value.dup_object());
-
-
-
- var tp = mod.get_path(iter).to_string();
- // by default returns the path..
-
- if ( info != Gdk.Atom.intern("STRING",true) ) {
- tp = ndata.toJsonString();
- }
-
- //data.set_text(tp,tp.length);
-
- data.set (data.get_target (), 8, (uchar[]) tp.to_utf8 ());
-
-
- // print("return " + tp);
- });
this.el.key_press_event.connect( (ev) => {
this.key_is_pressed = true;
return false;
public void loadFile (JsRender.JsRender f) {
//console.dump(f);
this.el.clear();
-
+ _this.main_window.windowstate.leftTreeNodeSelected(null, "");
// needed???
_this.main_window.windowstate.file = f;
_this.changed();
this.activePath= "";
//this.updateNode(false,true);
- }
- public void load (Gee.ArrayList<JsRender.Node> tr, Gtk.TreeIter? iter)
- {
- Gtk.TreeIter citer;
- //this.insert(citer,iter,0);
- for(var i =0 ; i < tr.size; i++) {
- if (iter != null) {
- this.el.insert(out citer,iter,-1); // why not append?
- } else {
- this.el.append(out citer,null);
- }
-
- this.el.set(citer, 0, tr.get(i).nodeTitle(),
- 1, tr.get(i).nodeTip(), -1
- );
- var o = GLib.Value(typeof(Object));
- o.set_object((Object)tr.get(i));
-
- this.el.set_value(citer, 2, o);
-
- if (tr.get(i).items.size > 0) {
- this.load(tr.get(i).items, citer);
- }
-
- }
-
-
}
public void deleteSelected () {
_this.changed();
_this.view.blockChanges = false;
+ }
+ public void load (Gee.ArrayList<JsRender.Node> tr, Gtk.TreeIter? iter)
+ {
+ Gtk.TreeIter citer;
+ //this.insert(citer,iter,0);
+ for(var i =0 ; i < tr.size; i++) {
+ if (iter != null) {
+ this.el.insert(out citer,iter,-1); // why not append?
+ } else {
+ this.el.append(out citer,null);
+ }
+
+ this.el.set(citer, 0, tr.get(i).nodeTitle(),
+ 1, tr.get(i).nodeTip(), -1
+ );
+ var o = GLib.Value(typeof(Object));
+ o.set_object((Object)tr.get(i));
+
+ this.el.set_value(citer, 2, o);
+
+ if (tr.get(i).items.size > 0) {
+ this.load(tr.get(i).items, citer);
+ }
+
+ }
+
+
}
public JsRender.Node pathToNode (string path) {
}
}
- public class Xcls_TreeViewColumn4 : Object
+ public class Xcls_TreeViewColumn7 : Object
{
public Gtk.TreeViewColumn el;
private Xcls_WindowLeftTree _this;
// my vars (def)
// ctor
- public Xcls_TreeViewColumn4(Xcls_WindowLeftTree _owner )
+ public Xcls_TreeViewColumn7(Xcls_WindowLeftTree _owner )
{
_this = _owner;
this.el = new Gtk.TreeViewColumn();
// my vars (dec)
// set gobject values
- var child_0 = new Xcls_MenuItem7( _this );
+ var child_0 = new Xcls_MenuItem10( _this );
child_0.ref();
this.el.add ( child_0.el );
- var child_1 = new Xcls_MenuItem8( _this );
+ var child_1 = new Xcls_MenuItem11( _this );
child_1.ref();
this.el.add ( child_1.el );
- var child_2 = new Xcls_MenuItem9( _this );
+ var child_2 = new Xcls_MenuItem12( _this );
child_2.ref();
this.el.add ( child_2.el );
}
// user defined functions
}
- public class Xcls_MenuItem7 : Object
+ public class Xcls_MenuItem10 : Object
{
public Gtk.MenuItem el;
private Xcls_WindowLeftTree _this;
// my vars (def)
// ctor
- public Xcls_MenuItem7(Xcls_WindowLeftTree _owner )
+ public Xcls_MenuItem10(Xcls_WindowLeftTree _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_MenuItem8 : Object
+ public class Xcls_MenuItem11 : Object
{
public Gtk.MenuItem el;
private Xcls_WindowLeftTree _this;
// my vars (def)
// ctor
- public Xcls_MenuItem8(Xcls_WindowLeftTree _owner )
+ public Xcls_MenuItem11(Xcls_WindowLeftTree _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_MenuItem9 : Object
+ public class Xcls_MenuItem12 : Object
{
public Gtk.MenuItem el;
private Xcls_WindowLeftTree _this;
// my vars (def)
// ctor
- public Xcls_MenuItem9(Xcls_WindowLeftTree _owner )
+ public Xcls_MenuItem12(Xcls_WindowLeftTree _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
}
+
}
{
- "name" : "WindowRooView",
- "parent" : "",
- "title" : "",
- "path" : "/home/alan/gitlive/roobuilder/src/Builder4/WindowRooView.bjs",
- "permname" : "",
- "modOrder" : "",
"build_module" : "builder",
"items" : [
{
- "| void scroll_to_line" : "(int line) {\n this.notebook.el.page = 1;// code preview...\n \n GLib.Timeout.add(500, () => {\n \n \n\t \n\t \n\t\t var buf = this.sourceview.el.get_buffer();\n\t \n\t\tvar sbuf = (Gtk.SourceBuffer) buf;\n\n\n\t\tGtk.TextIter iter; \n\t\tsbuf.get_iter_at_line(out iter, line);\n\t\tthis.sourceview.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);\n\t\treturn false;\n\t}); \n\n \n}\n",
- "id" : "WindowRooView",
"# Gtk.Widget lastObj" : "null",
- "| void createThumb" : "() {\n \n \n if (this.file == null) {\n return;\n }\n\tif (this.notebook.el.page > 0 ) {\n return;\n }\n \n var filename = this.file.getIconFileName(false);\n \n var win = this.el.get_parent_window();\n var width = win.get_width();\n // var height = win.get_height();\n try { \n Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, this.paned.el.position);\n screenshot.save(filename,\"png\");\n } catch(Error e) {\n //noop\n }\n\n \n \n \n \n}\n",
- "| void loadFile" : "\n(JsRender.JsRender file)\n{\n this.file = file;\n this.view.renderJS(true);\n this.notebook.el.page = 0;// gtk preview \n this.sourceview.loadFile(); \n \n}\n \n ",
- "int width" : 0,
- "bool hexpand" : true,
- "| int search" : "(string txt) {\n\tthis.notebook.el.page = 1;\n \tvar s = new Gtk.SourceSearchSettings();\n\tvar buf = (Gtk.SourceBuffer) this.sourceview.el.get_buffer();\n\tthis.searchcontext = new Gtk.SourceSearchContext(buf,s);\n\tthis.searchcontext.set_highlight(true);\n\ts.set_search_text(txt);\n\t\n\tGtk.TextIter beg, st,en;\n\t \n\tbuf.get_start_iter(out beg);\n\tthis.searchcontext.forward(beg, out st, out en);\n\tthis.last_search_end = 0;\n\treturn this.searchcontext.get_occurrences_count();\n\n \n}\n",
- "int last_search_end" : 0,
- "xtype" : "Box",
- "Gtk.SourceSearchContext searchcontext" : "",
"# JsRender.JsRender file" : "null",
- "int height" : 0,
- "| void requestRedraw" : "() {\n this.view.renderJS(false);\n this.sourceview.loadFile(); \n}",
+ "# Xcls_MainWindow main_window" : "",
"$ xns" : "Gtk",
"Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
- "# Xcls_MainWindow main_window" : "",
- "| void forwardSearch" : "(bool change_focus) {\n\n\tif (this.searchcontext == null) {\n\t\treturn;\n\t}\n\tthis.notebook.el.page = 1;\n\tGtk.TextIter beg, st,en, stl;\n\t\n\tvar buf = this.sourceview.el.get_buffer();\n\tbuf.get_iter_at_offset(out beg, this.last_search_end);\n\tif (!this.searchcontext.forward(beg, out st, out en)) {\n\t\tthis.last_search_end = 0;\n\t\treturn;\n\t}\n\tthis.last_search_end = en.get_offset();\n\tif (change_focus) {\n\t\tthis.sourceview.el.grab_focus();\n\t}\n\tbuf.place_cursor(st);\n\tvar ln = st.get_line();\n\tbuf.get_iter_at_line(out stl,ln);\n\t \n\tthis.sourceview.el.scroll_to_iter(stl, 0.0f, true, 0.0f, 0.5f);\n\t\n\t// highlight node...\n\t\n\t\t\n var node = _this.file.lineToNode(ln+1);\n \n if (node == null) {\n //print(\"can not find node\\n\");\n return;\n }\n var prop = node.lineToProp(ln+1);\n print(\"prop : %s\", prop == null ? \"???\" : prop);\n \n \n // ---------- this selects the tree's node...\n \n var ltree = _this.main_window.windowstate.left_tree;\n var tp = ltree.model.treePathFromNode(node);\n print(\"got tree path %s\\n\", tp);\n if (tp == \"\") {\n\t\treturn;\n\t}\n //_this.sourceview.allow_node_scroll = false; /// block node scrolling..\n\t \n \n //print(\"changing cursor on tree..\\n\");\n \n\n \n // let's try allowing editing on the methods.\n // a little klunky at present..\n\t_this.sourceview.prop_selected = \"\";\n if (prop != null) {\n\t\t//see if we can find it..\n\t\tvar kv = prop.split(\":\");\n\t\tif (kv[0] == \"p\") {\n\t\t\n \t\t//var k = prop.get_key(kv[1]);\n \t\t// fixme -- need to determine if it's an editable property...\n \t\t_this.sourceview.prop_selected = prop;\n \t\t\n\t\t} else if (kv[0] == \"l\") {\n\t\t\t _this.sourceview.prop_selected = prop;\n\t\t\t\n\t\t}\n }\n ltree.view.setCursor(tp, \"editor\");\n // ltree.view.el.set_cursor(new Gtk.TreePath.from_string(tp), null, false); \n _this.sourceview.nodeSelected(node,false);\n \n // scrolling is disabled... as node selection calls scroll 10ms after it changes.\n // GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {\n\t // this.allow_node_scroll = true;\n\t // return false;\n // });\n // }\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t \n\n}\n",
+ "Gtk.SourceSearchContext searchcontext" : "",
+ "bool hexpand" : true,
+ "bool vexpand" : true,
+ "id" : "WindowRooView",
+ "int last_search_end" : 0,
"items" : [
{
- "id" : "notebook",
- "xtype" : "Notebook",
- "* pack" : "pack_start,true,true,0",
"$ xns" : "Gtk",
+ "* pack" : "pack_start,true,true,0",
+ "id" : "notebook",
"items" : [
{
- "id" : "label_preview",
- "xtype" : "Label",
- "* pack" : false,
"$ xns" : "Gtk",
- "utf8 label" : "Preview"
+ "* pack" : false,
+ "id" : "label_preview",
+ "utf8 label" : "Preview",
+ "xtype" : "Label"
},
{
- "id" : "label_code",
- "* pack" : false,
- "xtype" : "Label",
"$ xns" : "Gtk",
- "utf8 label" : "Preview Generated Code"
+ "* pack" : false,
+ "id" : "label_code",
+ "utf8 label" : "Preview Generated Code",
+ "xtype" : "Label"
},
{
- "id" : "paned",
- "xtype" : "Paned",
- "* pack" : "append_page,_this.label_preview.el",
"$ xns" : "Gtk",
+ "* pack" : "append_page,_this.label_preview.el",
"Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+ "id" : "paned",
"items" : [
{
- "id" : "viewbox",
- "xtype" : "Box",
- "* pack" : "pack1,true,true",
+ "$ homogeneous" : false,
"$ xns" : "Gtk",
+ "* pack" : "pack1,true,true",
"Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
- "$ homogeneous" : false,
+ "id" : "viewbox",
"items" : [
{
- "$ vexpand" : false,
- "* pack" : "pack_start,false,true,0",
"$ height_request" : 20,
- "xtype" : "Box",
+ "$ homogeneous" : true,
+ "$ vexpand" : false,
"$ xns" : "Gtk",
+ "* pack" : "pack_start,false,true,0",
"Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
- "$ homogeneous" : true,
"items" : [
{
+ "$ xns" : "Gtk",
+ "* pack" : "pack_start,false,false,0",
+ "label" : "Redraw",
"listeners" : {
- "clicked" : "( ) => {\n _this.view.renderJS( true);\n}"
+ "clicked" : [
+ "( ) => {",
+ " _this.view.renderJS( true);",
+ "}"
+ ]
},
- "label" : "Redraw",
- "* pack" : "pack_start,false,false,0",
- "xtype" : "Button",
- "$ xns" : "Gtk"
+ "xtype" : "Button"
},
{
- "listeners" : {
- "toggled" : " (state) => {\n this.el.set_label(this.el.active ? \"Auto Redraw On\" : \"Auto Redraw Off\");\n}"
- },
- "label" : "Auto Redraw On",
- "id" : "AutoRedraw",
"$ active" : true,
+ "$ xns" : "Gtk",
"* pack" : "pack_start,false,false,0",
- "xtype" : "CheckButton",
- "$ xns" : "Gtk"
+ "id" : "AutoRedraw",
+ "label" : "Auto Redraw On",
+ "listeners" : {
+ "toggled" : [
+ " (state) => {",
+ " this.el.set_label(this.el.active ? \"Auto Redraw On\" : \"Auto Redraw Off\");",
+ "}"
+ ]
+ },
+ "xtype" : "CheckButton"
},
{
+ "$ xns" : "Gtk",
+ "* pack" : "pack_start,false,false,0",
+ "label" : "Full Redraw",
"listeners" : {
- "clicked" : " () => {\n _this.view.redraws = 99;\n _this.view.el.web_context.clear_cache(); \n //_this.view.renderJS(true);\n FakeServerCache.clear();\n _this.view.reInit();\n\n}"
+ "clicked" : [
+ " () => {",
+ " _this.view.redraws = 99;",
+ " _this.view.el.web_context.clear_cache(); ",
+ " //_this.view.renderJS(true);",
+ " FakeServerCache.clear();",
+ " _this.view.reInit();",
+ "",
+ "}"
+ ]
},
- "label" : "Full Redraw",
- "* pack" : "pack_start,false,false,0",
- "xtype" : "Button",
- "$ xns" : "Gtk"
+ "xtype" : "Button"
}
- ]
+ ],
+ "xtype" : "Box"
},
{
- "id" : "viewcontainer",
"$ shadow_type" : "Gtk.ShadowType.IN",
- "* init" : " this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n",
- "* pack" : "pack_end,true,true,0",
- "xtype" : "ScrolledWindow",
"$ xns" : "Gtk",
+ "* init" : [
+ " this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
+ " ",
+ ""
+ ],
+ "* pack" : "pack_end,true,true,0",
+ "id" : "viewcontainer",
"items" : [
{
- "listeners" : {
- "script_dialog" : " (dialog) => {\n \n \n if (this.el == null) {\n return true;\n }\n \n var msg = dialog.get_message();\n if (msg.length < 4) {\n return false;\n }\n if (msg.substring(0,4) != \"IPC:\") {\n return false;\n }\n var ar = msg.split(\":\", 3);\n if (ar.length < 3) {\n return false;\n }\n\n switch(ar[1]) {\n case \"SAVEHTML\":\n\t print(\"GOT saveHTML %d?\\n\", ar[2].length);\n _this.file.saveHTML(ar[2]);\n return true;\n default:\n return false;\n }\n \n}",
- "show" : " ( ) => {\n this.initInspector();;\n}",
- "drag_drop" : " ( ctx, x, y,time, ud) => {\n return false;\n /*\n\tprint(\"TARGET: drag-drop\");\n var is_valid_drop_site = true;\n \n \n Gtk.drag_get_data\n (\n w, // will receive 'drag-data-received' signal \n ctx, /* represents the current state of the DnD \n this.get('/Window').atoms[\"STRING\"], /* the target type we want \n time /* time stamp \n );\n \n \n /* No target offered by source => error \n \n\n\treturn is_valid_drop_site;\n\t*/\n}",
- "load_changed" : "(le) => {\n if (le != WebKit.LoadEvent.FINISHED) {\n return;\n }\n if (this.runjs.length < 1) {\n return;\n }\n // this.el.run_javascript(this.runjs, null);\n FakeServerCache.remove( this.runjs);\n this.runjs = \"\";\n}"
- },
- "# string renderedData" : "\"\"",
- "id" : "view",
+ "# GLib.DateTime lastRedraw" : "null",
+ "# WebKit.WebInspector inspector" : "",
+ "# bool pendingRedraw" : false,
"# bool refreshRequired" : false,
- "* init" : " {\n // this may not work!?\n var settings = this.el.get_settings();\n settings.enable_developer_extras = true;\n \n \n var fs= new FakeServer(this.el);\n fs.ref();\n // this was an attempt to change the url perms.. did not work..\n // settings.enable_file_access_from_file_uris = true;\n // settings.enable_offline_web_application_cache - true;\n // settings.enable_universal_access_from_file_uris = true;\n \n \n \n \n \n\n // FIXME - base url of script..\n // we need it so some of the database features work.\n this.el.load_html( \"Render not ready\" , \n //fixme - should be a config option!\n // or should we catch stuff and fix it up..\n \"http://localhost/app.Builder/\"\n );\n \n \n //this.el.open('file:///' + __script_path__ + '/../builder.html');\n /*\n Gtk.drag_dest_set\n (\n this.el, //\n Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT,\n null, // list of targets\n Gdk.DragAction.COPY // what to do with data after dropped \n );\n \n // print(\"RB: TARGETS : \" + LeftTree.atoms[\"STRING\"]);\n Gtk.drag_dest_set_target_list(this.el, this.get('/Window').targetList);\n */\n GLib.Timeout.add_seconds(1, () =>{\n //print(\"run refresh?\");\n if (this.el == null) {\n return false;\n }\n this.runRefresh(); \n return true;\n });\n \n \n}\n",
- "| void reInit" : "() {\n print(\"reInit?\");\n // if this happens destroy the webkit..\n // recreate it..\n this.el.stop_loading();\n \n if (_this.viewbox.el.get_parent() == null) {\n return;\n }\n \n \n _this.viewbox.el.remove(_this.viewcontainer.el);\n _this.paned.el.remove(_this.inspectorcontainer.el); \n \n // destory seems to cause problems.\n //this.el.destroy();\n //_this.viewcontainer.el.destroy();\n //_this.inspectorcontainer.el.destroy();\n var inv =new Xcls_inspectorcontainer(_this);\n inv.ref();\n _this.paned.el.pack2(inv.el,true,true);\n \n \n this.el = null; \n var nv =new Xcls_viewcontainer(_this);\n nv.ref();\n _this.viewbox.el.pack_end(nv.el,true,true,0);\n \n \n inv.el.show_all();\n nv.el.show_all();\n //while(Gtk.events_pending ()) Gtk.main_iteration ();\n //_this.view.renderJS(true); \n _this.view.refreshRequired = true;\n}\n",
+ "# int redraws" : 0,
+ "# string renderedData" : "\"\"",
+ "# string runhtml" : "\"\"",
+ "# string runjs" : "\"\"",
+ "$ xns" : "WebKit",
+ "* init" : [
+ " {",
+ " // this may not work!?",
+ " var settings = this.el.get_settings();",
+ " settings.enable_developer_extras = true;",
+ " ",
+ " ",
+ " var fs= new FakeServer(this.el);",
+ " fs.ref();",
+ " // this was an attempt to change the url perms.. did not work..",
+ " // settings.enable_file_access_from_file_uris = true;",
+ " // settings.enable_offline_web_application_cache - true;",
+ " // settings.enable_universal_access_from_file_uris = true;",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "",
+ " // FIXME - base url of script..",
+ " // we need it so some of the database features work.",
+ " this.el.load_html( \"Render not ready\" , ",
+ " //fixme - should be a config option!",
+ " // or should we catch stuff and fix it up..",
+ " \"http://localhost/app.Builder/\"",
+ " );",
+ " ",
+ " ",
+ " //this.el.open('file:///' + __script_path__ + '/../builder.html');",
+ " /*",
+ " Gtk.drag_dest_set",
+ " (",
+ " this.el, //",
+ " Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT,",
+ " null, // list of targets",
+ " Gdk.DragAction.COPY // what to do with data after dropped ",
+ " );",
+ " ",
+ " // print(\"RB: TARGETS : \" + LeftTree.atoms[\"STRING\"]);",
+ " Gtk.drag_dest_set_target_list(this.el, this.get('/Window').targetList);",
+ " */",
+ " GLib.Timeout.add_seconds(1, () =>{",
+ " //print(\"run refresh?\");",
+ " if (this.el == null) {",
+ " return false;",
+ " }",
+ " this.runRefresh(); ",
+ " return true;",
+ " });",
+ " ",
+ " ",
+ "}",
+ ""
+ ],
"* pack" : "add",
+ "id" : "view",
+ "listeners" : {
+ "drag_drop" : [
+ " ( ctx, x, y,time, ud) => {",
+ " return false;",
+ " /*",
+ "\tprint(\"TARGET: drag-drop\");",
+ " var is_valid_drop_site = true;",
+ " ",
+ " ",
+ " Gtk.drag_get_data",
+ " (",
+ " w, // will receive 'drag-data-received' signal ",
+ " ctx, /* represents the current state of the DnD ",
+ " this.get('/Window').atoms[\"STRING\"], /* the target type we want ",
+ " time /* time stamp ",
+ " );",
+ " ",
+ " ",
+ " /* No target offered by source => error ",
+ " ",
+ "",
+ "\treturn is_valid_drop_site;",
+ "\t*/",
+ "}"
+ ],
+ "load_changed" : [
+ "(le) => {",
+ " if (le != WebKit.LoadEvent.FINISHED) {",
+ " return;",
+ " }",
+ " if (this.runjs.length < 1) {",
+ " return;",
+ " }",
+ " // this.el.run_javascript(this.runjs, null);",
+ " FakeServerCache.remove( this.runjs);",
+ " this.runjs = \"\";",
+ "}"
+ ],
+ "script_dialog" : [
+ " (dialog) => {",
+ " ",
+ " ",
+ " if (this.el == null) {",
+ " return true;",
+ " }",
+ " ",
+ " var msg = dialog.get_message();",
+ " if (msg.length < 4) {",
+ " return false;",
+ " }",
+ " if (msg.substring(0,4) != \"IPC:\") {",
+ " return false;",
+ " }",
+ " var ar = msg.split(\":\", 3);",
+ " if (ar.length < 3) {",
+ " return false;",
+ " }",
+ "",
+ " switch(ar[1]) {",
+ " case \"SAVEHTML\":",
+ "\t print(\"GOT saveHTML %d?\\n\", ar[2].length);",
+ " _this.file.saveHTML(ar[2]);",
+ " return true;",
+ " default:",
+ " return false;",
+ " }",
+ " ",
+ "}"
+ ],
+ "show" : [
+ " ( ) => {",
+ " this.initInspector();;",
+ "}"
+ ]
+ },
"redraws" : 0,
"xtype" : "WebView",
- "# WebKit.WebInspector inspector" : "",
- "# string runjs" : "\"\"",
- "# int redraws" : 0,
- "| void runRefresh" : " () \n{\n // this is run every 2 seconds from the init..\n\n \n \n if (!this.refreshRequired) {\n // print(\"no refresh required\");\n return;\n }\n\n if (this.lastRedraw != null) {\n // do not redraw if last redraw was less that 5 seconds ago.\n if ((int64)(new DateTime.now_local()).difference(this.lastRedraw) < 5000 ) {\n return;\n }\n }\n \n if (_this.file == null) {\n return;\n }\n \n \n this.refreshRequired = false;\n // print(\"HTML RENDERING\");\n \n \n //this.get('/BottomPane').el.show();\n //this.get('/BottomPane').el.set_current_page(2);// webkit inspector\n _this.file.webkit_page_id = this.el.get_page_id();\n \n var js = _this.file.toSourcePreview();\n\n if (js.length < 1) {\n print(\"no data\");\n return;\n }\n// var data = js[0];\n this.redraws++;\n \n var project = _this.file.project; \n\n //print (project.fn);\n // set it to non-empty.\n \n// runhtml = runhtml.length ? runhtml : '<script type=\"text/javascript\"></script>'; \n\n\n// this.runhtml = this.runhtml || '';\n \n \n // then we need to reload the browser using\n // load_html_string..\n\n // then trigger a redraw once it's loaded..\n this.pendingRedraw = true;\n\n var runhtml = \"<script type=\\\"text/javascript\\\">\\n\" ;\n string builderhtml;\n \n try {\n GLib.FileUtils.get_contents(BuilderApplication.configDirectory() + \"/resources/roo.builder.js\", out builderhtml);\n } catch (Error e) {\n builderhtml = \"\";\n }\n\n runhtml += builderhtml + \"\\n\";\n runhtml += \"</script>\\n\" ;\n\n // fix to make sure they are the same..\n this.runhtml = project.runhtml;\n // need to modify paths\n\n string inhtml;\n var base_template = _this.file.project.base_template;\n \n if (base_template.length > 0 && !FileUtils.test(\n BuilderApplication.configDirectory() + \"/resources/\" + base_template, FileTest.EXISTS) \n ) {\n print(\"invalid base_template name - using default: %s\\n\", base_template);\n base_template = \"\";\n \n }\n try {\n GLib.FileUtils.get_contents(\n BuilderApplication.configDirectory() + \"/resources/\" + \n (base_template.length > 0 ? base_template : \"roo.builder.html\")\n , out inhtml);\n \n } catch (Error e) {\n inhtml = \"\";\n } \n this.renderedData = js;\n\n\n string js_src = js + \"\\n\" +\n\t\"Roo.onReady(function() {\\n\" +\n\t\"if (\" + _this.file.name +\".show) \" + _this.file.name +\".show({});\\n\" +\n\t\"Roo.XComponent.build();\\n\" +\n\t\"});\\n\";\n\t\n // print(\"render js: \" + js);\n //if (!this.ready) {\n // console.log('not loaded yet');\n //}\n this.lastRedraw = new DateTime.now_local();\n\n\n //this.runjs = js_src;\n var fc = FakeServerCache.factory_with_data(js_src);\n this.runjs = fc.fname;\n \n var html = inhtml.replace(\"</head>\", runhtml + this.runhtml + \n \"<script type=\\\"text/javascript\\\" src=\\\"xhttp://localhost\" + fc.fname + \"\\\"></script>\" + \n // \"<script type=\\\"text/javascript\\\">\\n\" +\n // js_src + \"\\n\" + \n // \"</script>\" + \n \n \"</head>\");\n //print(\"LOAD HTML \" + html);\n \n var rootURL = _this.file.project.rootURL;\n \n \n \n this.el.load_html( html , \n //fixme - should be a config option!\n (rootURL.length > 0 ? rootURL : \"xhttp://localhost/roobuilder/\")\n );\n \n // force the inspector... \n // this.initInspector();\n \n // - no need for this, the builder javascript will call it when build is complete\n //GLib.Timeout.add_seconds(1, () => {\n // this.el.run_javascript(\"Builder.saveHTML()\",null);\n // return false;\n //});\n// print( \"before render\" + this.lastRedraw);\n// print( \"after render\" + (new Date()));\n \n}\n ",
- "$ xns" : "WebKit",
- "| void initInspector" : "() {\n \n /* if (this.inspector == this.el.get_inspector()) {\n this.inspector.show();\n this.inspector.open_window(); \n print(\"init inspecter called, and inspector is the same as existing\\n\");\n return;\n }\n print(\"new inspector?\\n\");\n*/\n this.inspector = this.el.get_inspector();\n this.inspector.ref();\n \n // got a new inspector...\n \n this.inspector.open_window.connect(() => {\n this.inspector = this.el.get_inspector();\n print(\"inspector attach\\n\");\n var wv = this.inspector.get_web_view();\n if (wv != null) {\n print(\"got inspector web view\\n\");\n \n var cn = _this.inspectorcontainer.el.get_child();\n if (cn != null) {\n _this.inspectorcontainer.el.remove(cn);\n }\n \n _this.inspectorcontainer.el.add(wv);\n wv.show();\n } else {\n //this.inspector.close();\n \n //this.inspector = null;\n \n \n }\n return true;\n \n });\n /*\n this.inspector.closed.connect(() => {\n print(\"inspector closed?!?\");\n // if this happens destroy the webkit..\n // recreate it..\n this.el.stop_loading();\n \n if (_this.viewbox.el.get_parent() == null) {\n return;\n }\n \n \n _this.viewbox.el.remove(_this.viewcontainer.el);\n _this.el.remove(_this.inspectorcontainer.el); \n \n // destory seems to cause problems.\n //this.el.destroy();\n //_this.viewcontainer.el.destroy();\n //_this.inspectorcontainer.el.destroy();\n\n this.el = null; \n var nv =new Xcls_viewcontainer(_this);\n nv.ref();\n _this.viewbox.el.pack_end(nv.el,true,true,0);\n \n var inv =new Xcls_inspectorcontainer(_this);\n inv.ref();\n _this.el.pack2(inv.el,true,true);\n \n inv.el.show_all();\n nv.el.show_all();\n //while(Gtk.events_pending ()) Gtk.main_iteration ();\n //_this.view.renderJS(true); \n _this.view.refreshRequired = true;\n \n }); \n */\n \n this.inspector.show();\n}\n",
- "# GLib.DateTime lastRedraw" : "null",
- "# string runhtml" : "\"\"",
- "# bool pendingRedraw" : false,
- "| void renderJS" : "(bool force) {\n\n // this is the public redraw call..\n // we refresh in a loop privately..\n var autodraw = _this.AutoRedraw.el.active;\n if (!autodraw && !force) {\n print(\"Skipping redraw - no force, and autodraw off\");\n return;\n }\n \n this.refreshRequired = true;\n}\n"
+ "| void initInspector" : [
+ "() {",
+ " ",
+ " /* if (this.inspector == this.el.get_inspector()) {",
+ " this.inspector.show();",
+ " this.inspector.open_window(); ",
+ " print(\"init inspecter called, and inspector is the same as existing\\n\");",
+ " return;",
+ " }",
+ " print(\"new inspector?\\n\");",
+ "*/",
+ " this.inspector = this.el.get_inspector();",
+ " this.inspector.ref();",
+ " ",
+ " // got a new inspector...",
+ " ",
+ " this.inspector.open_window.connect(() => {",
+ " this.inspector = this.el.get_inspector();",
+ " print(\"inspector attach\\n\");",
+ " var wv = this.inspector.get_web_view();",
+ " if (wv != null) {",
+ " print(\"got inspector web view\\n\");",
+ " ",
+ " var cn = _this.inspectorcontainer.el.get_child();",
+ " if (cn != null) {",
+ " _this.inspectorcontainer.el.remove(cn);",
+ " }",
+ " ",
+ " _this.inspectorcontainer.el.add(wv);",
+ " wv.show();",
+ " } else {",
+ " //this.inspector.close();",
+ " ",
+ " //this.inspector = null;",
+ " ",
+ " ",
+ " }",
+ " return true;",
+ " ",
+ " });",
+ " /*",
+ " this.inspector.closed.connect(() => {",
+ " print(\"inspector closed?!?\");",
+ " // if this happens destroy the webkit..",
+ " // recreate it..",
+ " this.el.stop_loading();",
+ " ",
+ " if (_this.viewbox.el.get_parent() == null) {",
+ " return;",
+ " }",
+ " ",
+ " ",
+ " _this.viewbox.el.remove(_this.viewcontainer.el);",
+ " _this.el.remove(_this.inspectorcontainer.el); ",
+ " ",
+ " // destory seems to cause problems.",
+ " //this.el.destroy();",
+ " //_this.viewcontainer.el.destroy();",
+ " //_this.inspectorcontainer.el.destroy();",
+ "",
+ " this.el = null; ",
+ " var nv =new Xcls_viewcontainer(_this);",
+ " nv.ref();",
+ " _this.viewbox.el.pack_end(nv.el,true,true,0);",
+ " ",
+ " var inv =new Xcls_inspectorcontainer(_this);",
+ " inv.ref();",
+ " _this.el.pack2(inv.el,true,true);",
+ " ",
+ " inv.el.show_all();",
+ " nv.el.show_all();",
+ " //while(Gtk.events_pending ()) Gtk.main_iteration ();",
+ " //_this.view.renderJS(true); ",
+ " _this.view.refreshRequired = true;",
+ " ",
+ " }); ",
+ " */",
+ " ",
+ " this.inspector.show();",
+ "}",
+ ""
+ ],
+ "| void reInit" : [
+ "() {",
+ " print(\"reInit?\");",
+ " // if this happens destroy the webkit..",
+ " // recreate it..",
+ " this.el.stop_loading();",
+ " ",
+ " if (_this.viewbox.el.get_parent() == null) {",
+ " return;",
+ " }",
+ " ",
+ " ",
+ " _this.viewbox.el.remove(_this.viewcontainer.el);",
+ " _this.paned.el.remove(_this.inspectorcontainer.el); ",
+ " ",
+ " // destory seems to cause problems.",
+ " //this.el.destroy();",
+ " //_this.viewcontainer.el.destroy();",
+ " //_this.inspectorcontainer.el.destroy();",
+ " var inv =new Xcls_inspectorcontainer(_this);",
+ " inv.ref();",
+ " _this.paned.el.pack2(inv.el,true,true);",
+ " ",
+ " ",
+ " this.el = null; ",
+ " var nv =new Xcls_viewcontainer(_this);",
+ " nv.ref();",
+ " _this.viewbox.el.pack_end(nv.el,true,true,0);",
+ " ",
+ " ",
+ " inv.el.show_all();",
+ " nv.el.show_all();",
+ " //while(Gtk.events_pending ()) Gtk.main_iteration ();",
+ " //_this.view.renderJS(true); ",
+ " _this.view.refreshRequired = true;",
+ "}",
+ ""
+ ],
+ "| void renderJS" : [
+ "(bool force) {",
+ "",
+ " // this is the public redraw call..",
+ " // we refresh in a loop privately..",
+ " var autodraw = _this.AutoRedraw.el.active;",
+ " if (!autodraw && !force) {",
+ " print(\"Skipping redraw - no force, and autodraw off\");",
+ " return;",
+ " }",
+ " ",
+ " this.refreshRequired = true;",
+ "}",
+ ""
+ ],
+ "| void runRefresh" : [
+ " () ",
+ "{",
+ " // this is run every 2 seconds from the init..",
+ "",
+ " ",
+ " ",
+ " if (!this.refreshRequired) {",
+ " // print(\"no refresh required\");",
+ " return;",
+ " }",
+ "",
+ " if (this.lastRedraw != null) {",
+ " // do not redraw if last redraw was less that 5 seconds ago.",
+ " if ((int64)(new DateTime.now_local()).difference(this.lastRedraw) < 5000 ) {",
+ " return;",
+ " }",
+ " }",
+ " ",
+ " if (_this.file == null) {",
+ " return;",
+ " }",
+ " ",
+ " ",
+ " this.refreshRequired = false;",
+ " // print(\"HTML RENDERING\");",
+ " ",
+ " ",
+ " //this.get('/BottomPane').el.show();",
+ " //this.get('/BottomPane').el.set_current_page(2);// webkit inspector",
+ " _this.file.webkit_page_id = this.el.get_page_id();",
+ " ",
+ " var js = _this.file.toSourcePreview();",
+ "",
+ " if (js.length < 1) {",
+ " print(\"no data\");",
+ " return;",
+ " }",
+ "// var data = js[0];",
+ " this.redraws++;",
+ " ",
+ " var project = _this.file.project; ",
+ "",
+ " //print (project.fn);",
+ " // set it to non-empty.",
+ " ",
+ "// runhtml = runhtml.length ? runhtml : '<script type=\"text/javascript\"></script>'; ",
+ "",
+ "",
+ "// this.runhtml = this.runhtml || '';",
+ " ",
+ " ",
+ " // then we need to reload the browser using",
+ " // load_html_string..",
+ "",
+ " // then trigger a redraw once it's loaded..",
+ " this.pendingRedraw = true;",
+ "",
+ " var runhtml = \"<script type=\\\"text/javascript\\\">\\n\" ;",
+ " string builderhtml;",
+ " ",
+ " try {",
+ " GLib.FileUtils.get_contents(BuilderApplication.configDirectory() + \"/resources/roo.builder.js\", out builderhtml);",
+ " } catch (Error e) {",
+ " builderhtml = \"\";",
+ " }",
+ "",
+ " runhtml += builderhtml + \"\\n\";",
+ " runhtml += \"</script>\\n\" ;",
+ "",
+ " // fix to make sure they are the same..",
+ " this.runhtml = project.runhtml;",
+ " // need to modify paths",
+ "",
+ " string inhtml;",
+ " var base_template = _this.file.project.base_template;",
+ " ",
+ " if (base_template.length > 0 && !FileUtils.test(",
+ " BuilderApplication.configDirectory() + \"/resources/\" + base_template, FileTest.EXISTS) ",
+ " ) {",
+ " print(\"invalid base_template name - using default: %s\\n\", base_template);",
+ " base_template = \"\";",
+ " ",
+ " }",
+ " try {",
+ " GLib.FileUtils.get_contents(",
+ " BuilderApplication.configDirectory() + \"/resources/\" + ",
+ " (base_template.length > 0 ? base_template : \"roo.builder.html\")",
+ " , out inhtml);",
+ " ",
+ " } catch (Error e) {",
+ " inhtml = \"\";",
+ " } ",
+ " this.renderedData = js;",
+ "",
+ "",
+ " string js_src = js + \"\\n\" +",
+ "\t\"Roo.onReady(function() {\\n\" +",
+ "\t\"if (\" + _this.file.name +\".show) \" + _this.file.name +\".show({});\\n\" +",
+ "\t\"Roo.XComponent.build();\\n\" +",
+ "\t\"});\\n\";",
+ "\t",
+ " // print(\"render js: \" + js);",
+ " //if (!this.ready) {",
+ " // console.log('not loaded yet');",
+ " //}",
+ " this.lastRedraw = new DateTime.now_local();",
+ "",
+ "",
+ " //this.runjs = js_src;",
+ " var fc = FakeServerCache.factory_with_data(js_src);",
+ " this.runjs = fc.fname;",
+ " ",
+ " var html = inhtml.replace(\"</head>\", runhtml + this.runhtml + ",
+ " \"<script type=\\\"text/javascript\\\" src=\\\"xhttp://localhost\" + fc.fname + \"\\\"></script>\" + ",
+ " // \"<script type=\\\"text/javascript\\\">\\n\" +",
+ " // js_src + \"\\n\" + ",
+ " // \"</script>\" + ",
+ " ",
+ " \"</head>\");",
+ " //print(\"LOAD HTML \" + html);",
+ " ",
+ " var rootURL = _this.file.project.rootURL;",
+ " ",
+ " ",
+ " ",
+ " this.el.load_html( html , ",
+ " //fixme - should be a config option!",
+ " (rootURL.length > 0 ? rootURL : \"xhttp://localhost/roobuilder/\")",
+ " );",
+ " ",
+ " // force the inspector... ",
+ " // this.initInspector();",
+ " ",
+ " // - no need for this, the builder javascript will call it when build is complete",
+ " //GLib.Timeout.add_seconds(1, () => {",
+ " // this.el.run_javascript(\"Builder.saveHTML()\",null);",
+ " // return false;",
+ " //});",
+ "// print( \"before render\" + this.lastRedraw);",
+ "// print( \"after render\" + (new Date()));",
+ " ",
+ "}",
+ " "
+ ]
}
- ]
+ ],
+ "xtype" : "ScrolledWindow"
}
- ]
+ ],
+ "xtype" : "Box"
},
{
- "id" : "inspectorcontainer",
"$ shadow_type" : "Gtk.ShadowType.IN",
- "* init" : " this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n",
- "xtype" : "ScrolledWindow",
+ "$ xns" : "Gtk",
+ "* init" : [
+ " this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
+ " ",
+ ""
+ ],
"* pack" : "pack2,true,true",
- "$ xns" : "Gtk"
+ "id" : "inspectorcontainer",
+ "xtype" : "ScrolledWindow"
}
- ]
+ ],
+ "xtype" : "Paned"
},
{
- "xtype" : "ScrolledWindow",
- "* pack" : "append_page,_this.label_code.el",
"$ xns" : "Gtk",
+ "* pack" : "append_page,_this.label_code.el",
"items" : [
{
- "listeners" : {
- "button_release_event" : "() => {\n\n\tprint(\"BUTTON RELEASE EVENT\\n\");\n\tthis.onCursorChanged();\n\tthis.button_is_pressed = false;\n\treturn false;\n}",
- "button_press_event" : "() => {\n\t\n\t\n\t\n\t\n\tthis.button_is_pressed = true;\n\treturn false;\n}\t \n",
- "key_press_event" : "(src, key) => {\n\tthis.key_is_pressed = true;\n\t// is it ctrl-G -- find next?\n\t// which will will still ignore..\n\t \n\tif \t(key.str == \"g\" && key.state == Gdk.ModifierType.CONTROL_MASK) {\n\t\tthis.key_is_pressed = false;\n\t}\n\t\n\t// if cursor postion is 'at start' of editing range, \n\t// and backspace is pressed...\n\t// block it..\n\t\n\t var buf = this.el.get_buffer();\n //print(\"cursor changed : %d\\n\", buf.cursor_position);\n \n\tif (buf.cursor_position <= this.editable_start_pos && key.keyval == Gdk.Key.BackSpace) {\n\t\treturn true; // block...\n\t}\n\t// what about 'last line of 'grey...'\n\t// get the buffer - find the line, find the next line ?? see if it's grey?\n\t\n\t\n\tprint(\"KEY PRESS EVENT \\n\");\n\tthis.onCursorChanged();\n\treturn false; \n}",
- "key_release_event" : "() => { \n\tthis.key_is_pressed = false;\n\treturn false;\n}\n"
- },
- "gboolean show_line_marks" : true,
- "| void onCursorChanged" : "(/*ParamSpec ps*/) {\n\n\t\tif (!this.key_is_pressed && !this.button_is_pressed) {\n\t\t\treturn;\n\t\t}\n\n\t if (this.loading) {\n return;\n }\n // if (ps.name != \"cursor-position\") {\n // return;\n // }\n\n var buf = this.el.get_buffer();\n //print(\"cursor changed : %d\\n\", buf.cursor_position);\n Gtk.TextIter cpos;\n buf.get_iter_at_offset(out cpos, buf.cursor_position);\n \n var ln = cpos.get_line();\n \n \n // --- select node at line....\n \n var node = _this.file.lineToNode(ln+1);\n \n if (node == null) {\n print(\"can not find node\\n\");\n return;\n }\n var prop = node.lineToProp(ln+1);\n print(\"prop : %s\", prop == null ? \"???\" : prop);\n \n \n // ---------- this selects the tree's node...\n \n var ltree = _this.main_window.windowstate.left_tree;\n var tp = ltree.model.treePathFromNode(node);\n print(\"got tree path %s\\n\", tp);\n if (tp != \"\") {\n\t \n\t \n\t //print(\"changing cursor on tree..\\n\");\n\t \n \n \n // let's try allowing editing on the methods.\n // a little klunky at present..\n this.prop_selected = \"\";\n if (prop != null) {\n \t\t//see if we can find it..\n \t\tvar kv = prop.split(\":\");\n \t\tif (kv[0] == \"p\") {\n \t\t\n\t \t\t//var k = prop.get_key(kv[1]);\n\t \t\t// fixme -- need to determine if it's an editable property...\n\t \t\tthis.prop_selected = prop;\n\t \t\t\n \t\t} else if (kv[0] == \"l\") {\n \t\t\t this.prop_selected = prop;\n \t\t\t\n \t\t}\n }\n ltree.view.setCursor(tp, \"editor\");\n // ltree.view.el.set_cursor(new Gtk.TreePath.from_string(tp), null, false); \n this.nodeSelected(node,false);\n \n // scrolling is disabled... as node selection calls scroll 10ms after it changes.\n \n }\n \n // highlight the node..\n}\n ",
- "id" : "sourceview",
- "| void clearGreySelection" : "() {\n // clear all the marks..\n var sbuf = (Gtk.SourceBuffer)this.el.buffer;\n \n Gtk.TextIter start;\n Gtk.TextIter end; \n \n sbuf.get_bounds (out start, out end);\n sbuf.remove_source_marks (start, end, \"grey\");\n \n \n}\n",
- "* init" : "{\n \n var description = Pango.FontDescription.from_string(\"monospace\");\n description.set_size(8000);\n this.el.override_font(description);\n\n this.loading = true;\n //var buf = this.el.get_buffer();\n //buf.notify.connect(this.onCursorChanged);\n \n \n \n var attrs = new Gtk.SourceMarkAttributes();\n var pink = Gdk.RGBA();\n pink.parse ( \"pink\");\n attrs.set_background ( pink);\n attrs.set_icon_name ( \"process-stop\"); \n attrs.query_tooltip_text.connect(( mark) => {\n //print(\"tooltip query? %s\\n\", mark.name);\n return mark.name;\n });\n \n this.el.set_mark_attributes (\"ERR\", attrs, 1);\n \n var wattrs = new Gtk.SourceMarkAttributes();\n var blue = Gdk.RGBA();\n blue.parse ( \"#ABF4EB\");\n wattrs.set_background ( blue);\n wattrs.set_icon_name ( \"process-stop\"); \n wattrs.query_tooltip_text.connect(( mark) => {\n //print(\"tooltip query? %s\\n\", mark.name);\n return mark.name;\n });\n \n this.el.set_mark_attributes (\"WARN\", wattrs, 1);\n \n \n \n var dattrs = new Gtk.SourceMarkAttributes();\n var purple = Gdk.RGBA();\n purple.parse ( \"#EEA9FF\");\n dattrs.set_background ( purple);\n dattrs.set_icon_name ( \"process-stop\"); \n dattrs.query_tooltip_text.connect(( mark) => {\n //print(\"tooltip query? %s\\n\", mark.name);\n return mark.name;\n });\n \n this.el.set_mark_attributes (\"DEPR\", dattrs, 1);\n \n \n var gattrs = new Gtk.SourceMarkAttributes();\n var grey = Gdk.RGBA();\n grey.parse ( \"#ccc\");\n gattrs.set_background ( grey);\n \n \n this.el.set_mark_attributes (\"grey\", gattrs, 1);\n \n \n \n \n \n \n}\n ",
- "| void nodeSelected" : "(JsRender.Node? sel, bool scroll ) {\n \n \n\t\n // this is connected in widnowstate\n\n\n\t// not sure why.... \n while(Gtk.events_pending()) {\n Gtk.main_iteration();\n }\n \n this.node_selected = sel;\n \n this.updateGreySelection(scroll);\n \n \n \n}\n\n \n",
- "bool loading" : true,
- "| string toString" : "() {\n Gtk.TextIter s;\n Gtk.TextIter e;\n this.el.get_buffer().get_start_iter(out s);\n this.el.get_buffer().get_end_iter(out e);\n var ret = this.el.get_buffer().get_text(s,e,true);\n //print(\"TO STRING? \" + ret);\n return ret;\n}\n",
- "| void loadFile" : "( ) {\n this.loading = true;\n \n \n // get the cursor and scroll position....\n var buf = this.el.get_buffer();\n\tvar cpos = buf.cursor_position;\n \n print(\"BEFORE LOAD cursor = %d\\n\", cpos);\n \n var vadj_pos = this.el.get_vadjustment().get_value();\n \n \n \n buf.set_text(\"\",0);\n var sbuf = (Gtk.SourceBuffer) buf;\n\n \n\n if (_this.file == null || _this.file.xtype != \"Roo\") {\n print(\"xtype != Roo\");\n this.loading = false;\n return;\n }\n \n // get the string from the rendered tree...\n \n var str = _this.file.toSource();\n \n// print(\"setting str %d\\n\", str.length);\n buf.set_text(str, str.length);\n var lm = Gtk.SourceLanguageManager.get_default();\n \n //?? is javascript going to work as js?\n \n ((Gtk.SourceBuffer)(buf)) .set_language(lm.get_language(_this.file.language));\n \n \n Gtk.TextIter start;\n Gtk.TextIter end; \n \n sbuf.get_bounds (out start, out end);\n sbuf.remove_source_marks (start, end, null); // remove all marks..\n \n GLib.Timeout.add(500, () => {\n\n print(\"RESORTING cursor to = %d\\n\", cpos);\n\t\tGtk.TextIter cpos_iter;\n\t\tbuf.get_iter_at_offset(out cpos_iter, cpos);\n\t\tbuf.place_cursor(cpos_iter); \n\t\t\n\t\tthis.el.get_vadjustment().set_value(vadj_pos);;\n\t\t\n\n\t\tthis.onCursorChanged();\n\t\t\n\t\t\n\t\t_this.buffer.checkSyntax();\n\t\treturn false;\n\t});\n\t\t\n this.loading = false; \n _this.buffer.dirty = false;\n}\n",
- "* pack" : "add",
- "xtype" : "SourceView",
- "bool button_is_pressed" : false,
+ "# JsRender.Node? node_selected" : "null",
+ "# bool button_is_pressed" : false,
+ "# bool key_is_pressed" : false,
+ "# bool loading" : true,
+ "# int editable_start_pos" : "-1",
"$ string prop_selected" : "\"\"",
- "| void updateGreySelection" : "(bool scroll) { \n\tvar sel = this.node_selected;\n\tprint(\"node selected\\n\");\n var buf = this.el.get_buffer();\n var sbuf = (Gtk.SourceBuffer) buf;\n\n \n this.clearGreySelection();\n \n \n \n if (sel == null) {\n\t print(\"no selected node\\n\");\n // no highlighting..\n return;\n }\n \n print(\"highlight region %d to %d\\n\", sel.line_start,sel.line_end);\n Gtk.TextIter iter; \n sbuf.get_iter_at_line(out iter, sel.line_start);\n \n \n Gtk.TextIter cur_iter;\n sbuf.get_iter_at_offset(out cur_iter, sbuf.cursor_position);\n \n var cursor_at_line = cur_iter.get_line();\n \n \n //var cur_line = cur_iter.get_line();\n //if (cur_line > sel.line_start && cur_line < sel.line_end) {\n \n //} else {\n if (scroll) {\n\t\tprint(\"scrolling to node -- should occur on node picking.\\n\");\n \tthis.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);\n\t}\n \n var start_line = sel.line_start;\n var end_line = sel.line_end;\n \n \n this.el.editable = false;\n \n //var colon_pos = 0;\n \n this.editable_start_pos = -1;\n \n // now if we have selected a property...\n if (this.prop_selected.length> 0 ) {\n\n\t\tint nstart, nend;\n\t\tif (sel.getPropertyRange(this.prop_selected, out nstart, out nend) && nend > nstart) {\n\t\t\tstart_line = nstart;\n\t\t\tend_line = nend;\n\t\t\tthis.el.editable = true;\n\t\t\tprint(\"start line = %d, end line = %d\\n\", start_line, end_line);\n\t\t\t\n\t\t\t\t// see if we are 'right of ':'\n\t\t\t\t// get an iter for the start of the line.\n\t\t\tGtk.TextIter start_first_line_iter,end_first_line_iter;\n\t\t\tthis.el.buffer.get_iter_at_line(out start_first_line_iter, start_line -1);\n\t\t\tthis.el.buffer.get_iter_at_line(out end_first_line_iter, start_line -1);\n\t\t\t \n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif (end_first_line_iter.forward_to_line_end()) {\n\t\t\t\tvar first_line = this.el.buffer.get_text(start_first_line_iter, end_first_line_iter, false);\n\t\t\t\t\n\t\t\t\tprint(\"first line = %s\\n\", first_line);\n\t\t\t\tif (first_line.contains(\":\")) {\n\t\t\t\t\tthis.editable_start_pos = start_first_line_iter.get_offset() + first_line.index_of(\":\") + 1;\n\t\t\t\t\tprint(\"colon_pos = %d\\n\", this.editable_start_pos);\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\t//Gtk.TextIter colon_iter;\n\t\t\t\t//sbuf.get_iter_at_offset (out colon_iter, colon_pos);\n\t\t\t\t//sbuf.create_source_mark(null, \"active_text\", colon_iter);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//print(\"is cursor at line? %d ?= %d\\n\", start_line -1 , cursor_at_line);\n\t\t\t//if (start_line - 1 == cursor_at_line) {\n\t\t\t// should be ok - current_posssion can not be less than '-1'...\n\t\t\tif (sbuf.cursor_position < this.editable_start_pos) {\n\t\t\t\n\t\t\t\tprint(\"cursor is before start pos.. - turn off editable...\\n\");\n\t\t\t\t//var before_cursor_string = this.el.buffer.get_text(start_line_iter, cur_iter, false);\n\t\t\t\t//print(\"before cursor string = %s\\n\", before_cursor_string);\n\t\t\t\t//if (!before_cursor_string.contains(\":\")) {\n\t\t\t\t\tthis.el.editable = false;\n\t\t\t\t//}\n\t\t\t\t\n\t\t\t}\n\t\t\t \n\t\t\t \n\n\t\t\t \n\t\t}\n\t\tprint(\"propSelected = %s range %d -> %d\\n\", this.prop_selected, start_line, end_line);\t\t\n\t\t\n\t\t\n }\n \n\tprint(\"checking selection\\n\");\n \n \n // check selection - if it's out of 'bounds'\n if (this.el.editable && sbuf.get_has_selection()) {\n\t\tGtk.TextIter sel_start_iter, sel_end_iter;\n\t\tsbuf.get_selection_bounds(out sel_start_iter, out sel_end_iter);\n\t\t\n\t\tif (sel_start_iter.get_line() < start_line || sel_end_iter.get_line() > end_line ||\n\t\t\tsel_start_iter.get_line() > end_line || sel_end_iter.get_line() < start_line\t\t\t) {\n\t\t\t// save?\n\t\t\tthis.el.editable = false;\n\t\t}\n\t\tif (this.editable_start_pos > 0 &&\n\t\t\t(sel_start_iter.get_offset() < this.editable_start_pos || sel_end_iter.get_offset() < this.editable_start_pos)\n\t\t\t\n\t\t) {\n\t\t\tthis.el.editable = false;\n\t\t}\n\t\t\n\t\t \n \n }\n \n \n \n \n for (var i = 0; i < buf.get_line_count();i++) {\n if (i < (start_line -1) || i > (end_line -1)) {\n \n sbuf.get_iter_at_line(out iter, i);\n sbuf.create_source_mark(null, \"grey\", iter);\n \n }\n \n }\n if (scroll && (cursor_at_line > end_line || cursor_at_line < start_line)) {\n\t Gtk.TextIter cpos_iter;\n\t\tbuf.get_iter_at_line(out cpos_iter, start_line);\n\t\t\n\t\tbuf.place_cursor(cpos_iter); \n\t}\n\n\n}",
- "bool key_is_pressed" : false,
- "| void highlightErrorsJson" : " (string type, Json.Object obj) {\n // this is a hook for the vala code - it has no value in javascript \n // as we only have one error ususally....\n return ;\n \n \n\n\n}",
- "JsRender.Node? node_selected" : "null",
- "int editable_start_pos" : "-1",
"$ xns" : "Gtk",
- "gboolean show_line_numbers" : true,
+ "* init" : [
+ "{",
+ " ",
+ " ",
+ " var description = Pango.FontDescription.from_string(\"monospace\");",
+ " description.set_size(8000);",
+ " this.el.override_font(description);",
+ "",
+ " this.loading = true;",
+ " //var buf = this.el.get_buffer();",
+ " //buf.notify.connect(this.onCursorChanged);",
+ " ",
+ " ",
+ " var attrs = new Gtk.SourceMarkAttributes();",
+ " var pink = Gdk.RGBA();",
+ " pink.parse ( \"pink\");",
+ " attrs.set_background ( pink);",
+ " attrs.set_icon_name ( \"process-stop\"); ",
+ " attrs.query_tooltip_text.connect(( mark) => {",
+ " //print(\"tooltip query? %s\\n\", mark.name);",
+ " return mark.name;",
+ " });",
+ " ",
+ " this.el.set_mark_attributes (\"ERR\", attrs, 1);",
+ " ",
+ " var wattrs = new Gtk.SourceMarkAttributes();",
+ " var blue = Gdk.RGBA();",
+ " blue.parse ( \"#ABF4EB\");",
+ " wattrs.set_background ( blue);",
+ " wattrs.set_icon_name ( \"process-stop\"); ",
+ " wattrs.query_tooltip_text.connect(( mark) => {",
+ " //print(\"tooltip query? %s\\n\", mark.name);",
+ " return mark.name;",
+ " });",
+ " ",
+ " this.el.set_mark_attributes (\"WARN\", wattrs, 1);",
+ " ",
+ " ",
+ " ",
+ " var dattrs = new Gtk.SourceMarkAttributes();",
+ " var purple = Gdk.RGBA();",
+ " purple.parse ( \"#EEA9FF\");",
+ " dattrs.set_background ( purple);",
+ " dattrs.set_icon_name ( \"process-stop\"); ",
+ " dattrs.query_tooltip_text.connect(( mark) => {",
+ " //print(\"tooltip query? %s\\n\", mark.name);",
+ " return mark.name;",
+ " });",
+ " ",
+ " this.el.set_mark_attributes (\"DEPR\", dattrs, 1);",
+ " ",
+ " ",
+ " var gattrs = new Gtk.SourceMarkAttributes();",
+ " var grey = Gdk.RGBA();",
+ " grey.parse ( \"#ccc\");",
+ " gattrs.set_background ( grey);",
+ " ",
+ " ",
+ " this.el.set_mark_attributes (\"grey\", gattrs, 1);",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "}",
+ " "
+ ],
+ "* pack" : "add",
"gboolean editable" : false,
+ "gboolean show_line_marks" : true,
+ "gboolean show_line_numbers" : true,
+ "id" : "sourceview",
"items" : [
{
- "listeners" : {
- "changed" : " () => {\n \n\n // check syntax??\n // ??needed..??\n // _this.save_button.el.sensitive = true;\n ///?? has changed occured during loading?\n \n // only trigger this if \n \n \n \n \n if (_this.sourceview.loading) {\n\t\treturn;\n\t}\n\t\n\n\t\n print(\"- PREVIEW EDITOR CHANGED--\");\n\n this.dirty = true; \n this.checkSyntax(); // this calls backs and highlights errors.. in theory... \n\n\n\n\tif (!_this.sourceview.button_is_pressed && !_this.sourceview.key_is_pressed) {\n\t\tprint(\"button or key not pressed to generate change?!\\n\");\n\t\treturn;\n\t}\n\t\t\n \n\t// what are we editing??\n\tif (null == _this.sourceview.node_selected || _this.sourceview.prop_selected.length < 1) {\n\t\treturn;\n\t}\n\t\n\t// find the colon on the first line...\n\t\n\tif (_this.sourceview.editable_start_pos > -1) {\n\t\t\n\t\tvar buf = (Gtk.SourceBuffer)_this.sourceview.el.get_buffer();\n\t\t\n //print(\"cursor changed : %d\\n\", buf.cursor_position);\n Gtk.TextIter spos,epos;\n buf.get_iter_at_offset(out spos, _this.sourceview.editable_start_pos);\n buf.get_iter_at_offset(out epos, _this.sourceview.editable_start_pos); // initialize epos..\n \n var gotit= false;\n var line = spos.get_line();\n var endline = buf.get_line_count();\n while (line < endline) {\n \t\tline++;\n\t buf.get_iter_at_line(out epos, line);\n\t if (buf.get_source_marks_at_line(line, \"grey\").length() > 0) {\n\t\t buf.get_iter_at_line(out epos, line);\t \t\t\n\t \t\tgotit=true;\n\t \t\tbreak;\n \t\t}\n\t\t}\n \n \t\tif (gotit) {\n\t \t\tprint(\"End Offset = %d/%d\\n\", epos.get_line(), epos.get_offset());\n\t\t\t// get the pos...\n\t\t\t// in theory the last char will be '}' or '},' .. or ','\n\t\t\t// we should chop the ',' of the end...\n\t\t\tvar str = buf.get_text(spos, epos, false);\n\t\t\tprint(\"got string\\n%s\\n\", str);\n\t\t\n\t\t}\n\t}\n return ;\n}\n\n \n"
- },
+ "$ xns" : "Gtk",
+ "* pack" : "set_buffer",
"bool dirty" : false,
- "int error_line" : "-1",
"id" : "buffer",
- "| bool highlightErrors" : "( Gee.HashMap<int,string> validate_res) {\n \n this.error_line = validate_res.size;\n\t\n if (this.error_line < 1) {\n return true;\n }\n var tlines = this.el.get_line_count ();\n Gtk.TextIter iter;\n var valiter = validate_res.map_iterator();\n while (valiter.next()) {\n \n// print(\"get inter\\n\");\n var eline = valiter.get_key();\n if (eline > tlines) {\n continue;\n }\n this.el.get_iter_at_line( out iter, eline);\n //print(\"mark line\\n\");\n this.el.create_source_mark(valiter.get_value(), \"ERR\", iter);\n } \n return false;\n}",
- "| string toString" : " () {\n \n Gtk.TextIter s;\n Gtk.TextIter e;\n this.el.get_start_iter(out s);\n this.el.get_end_iter(out e);\n var ret = this.el.get_text(s,e,true);\n //print(\"TO STRING? \" + ret);\n return ret;\n}\n ",
- "| bool checkSyntax" : " () {\n \n \n var str = this.toString();\n \n // needed???\n if (this.error_line > 0) {\n Gtk.TextIter start;\n Gtk.TextIter end; \n this.el.get_bounds (out start, out end);\n\n this.el.remove_source_marks (start, end, \"WARN\");\n this.el.remove_source_marks (start, end, \"ERR\"); \n\n }\n \n if (str.length < 1) {\n print(\"checkSyntax - empty string?\\n\");\n return false;\n }\n \n if (_this.file == null) {\n return false;\n }\n var p = _this.file.project.palete;\n \n \n if (_this.file.language != \"js\") {\n\t\treturn false; // fake syntax error.\n\t}\n\t\n //Gee.HashMap<int,string> ret_x;\n\n\treturn p.javascriptHasErrors(\n\t\t_this.main_window.windowstate,\n str, \n \"\", // _this.key, \n \"file\", //_this.ptype,\n _this.file, \n null\n ); \n \n}\n",
- "* pack" : "set_buffer",
+ "int error_line" : "-1",
+ "listeners" : {
+ "changed" : [
+ " () => {",
+ " ",
+ "",
+ " // check syntax??",
+ " // ??needed..??",
+ " // _this.save_button.el.sensitive = true;",
+ " ///?? has changed occured during loading?",
+ " ",
+ " // only trigger this if ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " if (_this.sourceview.loading) {",
+ "\t\treturn;",
+ "\t}",
+ "\t",
+ "",
+ "\t",
+ " print(\"- PREVIEW EDITOR CHANGED--\");",
+ "",
+ " this.dirty = true; ",
+ " this.checkSyntax(); // this calls backs and highlights errors.. in theory... ",
+ "",
+ "",
+ "",
+ "\tif (!_this.sourceview.button_is_pressed && !_this.sourceview.key_is_pressed) {",
+ "\t\tprint(\"button or key not pressed to generate change?!\\n\");",
+ "\t\treturn;",
+ "\t}",
+ "\t\t",
+ " ",
+ "\t// what are we editing??",
+ "\tif (null == _this.sourceview.node_selected || _this.sourceview.prop_selected.length < 1) {",
+ "\t\treturn;",
+ "\t}",
+ "\t",
+ "\t// find the colon on the first line...",
+ "\t",
+ "\tif (_this.sourceview.editable_start_pos > -1) {",
+ "\t\t",
+ "\t\tvar buf = (Gtk.SourceBuffer)_this.sourceview.el.get_buffer();",
+ "\t\t",
+ " //print(\"cursor changed : %d\\n\", buf.cursor_position);",
+ " Gtk.TextIter spos,epos;",
+ " buf.get_iter_at_offset(out spos, _this.sourceview.editable_start_pos);",
+ " buf.get_iter_at_offset(out epos, _this.sourceview.editable_start_pos); // initialize epos..",
+ " ",
+ " var gotit= false;",
+ " var line = spos.get_line();",
+ " var endline = buf.get_line_count();",
+ " while (line < endline) {",
+ " \t\tline++;",
+ "\t buf.get_iter_at_line(out epos, line);",
+ "\t if (buf.get_source_marks_at_line(line, \"grey\").length() > 0) {",
+ "\t\t buf.get_iter_at_line(out epos, line);\t \t\t",
+ "\t \t\tgotit=true;",
+ "\t \t\tbreak;",
+ " \t\t}",
+ "\t\t}",
+ " ",
+ " \t\tif (gotit) {",
+ "\t \t\tprint(\"End Offset = %d/%d\\n\", epos.get_line(), epos.get_offset());",
+ "\t\t\t// get the pos...",
+ "\t\t\t// in theory the last char will be '}' or '},' .. or ','",
+ "\t\t\t// we should chop the ',' of the end...",
+ "\t\t\tvar str = buf.get_text(spos, epos, false);",
+ "\t\t\tprint(\"got string\\n%s\\n\", str);",
+ "\t\t",
+ "\t\t}",
+ "\t}",
+ " return ;",
+ "}",
+ "",
+ " ",
+ ""
+ ]
+ },
"xtype" : "SourceBuffer",
- "$ xns" : "Gtk"
+ "| bool checkSyntax" : [
+ " () {",
+ " ",
+ " ",
+ " var str = this.toString();",
+ " ",
+ " // needed???",
+ " if (this.error_line > 0) {",
+ " Gtk.TextIter start;",
+ " Gtk.TextIter end; ",
+ " this.el.get_bounds (out start, out end);",
+ "",
+ " this.el.remove_source_marks (start, end, \"WARN\");",
+ " this.el.remove_source_marks (start, end, \"ERR\"); ",
+ "",
+ " }",
+ " ",
+ " if (str.length < 1) {",
+ " print(\"checkSyntax - empty string?\\n\");",
+ " return false;",
+ " }",
+ " ",
+ " if (_this.file == null) {",
+ " return false;",
+ " }",
+ " var p = _this.file.project.palete;",
+ " ",
+ " ",
+ " if (_this.file.language != \"js\") {",
+ "\t\treturn false; // fake syntax error.",
+ "\t}",
+ "\t",
+ " //Gee.HashMap<int,string> ret_x;",
+ "",
+ "\treturn p.javascriptHasErrors(",
+ "\t\t_this.main_window.windowstate,",
+ " str, ",
+ " \"\", // _this.key, ",
+ " \"file\", //_this.ptype,",
+ " _this.file, ",
+ " null",
+ " ); ",
+ " ",
+ "}",
+ ""
+ ],
+ "| string toString" : [
+ " () {",
+ " ",
+ " Gtk.TextIter s;",
+ " Gtk.TextIter e;",
+ " this.el.get_start_iter(out s);",
+ " this.el.get_end_iter(out e);",
+ " var ret = this.el.get_text(s,e,true);",
+ " //print(\"TO STRING? \" + ret);",
+ " return ret;",
+ "}",
+ " "
+ ],
+ "| bool highlightErrors" : [
+ "( Gee.HashMap<int,string> validate_res) {",
+ " ",
+ " this.error_line = validate_res.size;",
+ "\t",
+ " if (this.error_line < 1) {",
+ " return true;",
+ " }",
+ " var tlines = this.el.get_line_count ();",
+ " Gtk.TextIter iter;",
+ " var valiter = validate_res.map_iterator();",
+ " while (valiter.next()) {",
+ " ",
+ "// print(\"get inter\\n\");",
+ " var eline = valiter.get_key();",
+ " if (eline > tlines) {",
+ " continue;",
+ " }",
+ " this.el.get_iter_at_line( out iter, eline);",
+ " //print(\"mark line\\n\");",
+ " this.el.create_source_mark(valiter.get_value(), \"ERR\", iter);",
+ " } ",
+ " return false;",
+ "}"
+ ]
}
+ ],
+ "listeners" : {
+ "button_press_event" : [
+ "() => {",
+ "\t",
+ "\t",
+ "\tthis.button_is_pressed = true;",
+ "\treturn false;",
+ "}\t ",
+ ""
+ ],
+ "button_release_event" : [
+ "() => {",
+ "",
+ "\tprint(\"BUTTON RELEASE EVENT\\n\");",
+ "\tthis.onCursorChanged();",
+ "\tthis.button_is_pressed = false;",
+ "\treturn false;",
+ "}"
+ ],
+ "key_press_event" : [
+ "(src, key) => {",
+ "\tthis.key_is_pressed = true;",
+ "\t// is it ctrl-G -- find next?",
+ "\t// which will will still ignore..",
+ "\t ",
+ "\tif \t(key.str == \"g\" && key.state == Gdk.ModifierType.CONTROL_MASK) {",
+ "\t\tthis.key_is_pressed = false;",
+ "\t}",
+ "\t",
+ "\t// if cursor postion is 'at start' of editing range, ",
+ "\t// and backspace is pressed...",
+ "\t// block it..",
+ "\t",
+ "\t var buf = this.el.get_buffer();",
+ " //print(\"cursor changed : %d\\n\", buf.cursor_position);",
+ " ",
+ "\tif (buf.cursor_position <= this.editable_start_pos && key.keyval == Gdk.Key.BackSpace) {",
+ "\t\treturn true; // block...",
+ "\t}",
+ "\t// what about 'last line of 'grey...'",
+ "\t// get the buffer - find the line, find the next line ?? see if it's grey?",
+ "\t",
+ "\t",
+ "\tprint(\"KEY PRESS EVENT \\n\");",
+ "\tthis.onCursorChanged();",
+ "\treturn false; ",
+ "}"
+ ],
+ "key_release_event" : [
+ "() => { ",
+ "\tthis.key_is_pressed = false;",
+ "\treturn false;",
+ "}",
+ ""
+ ]
+ },
+ "xtype" : "SourceView",
+ "| string toString" : [
+ "() {",
+ " Gtk.TextIter s;",
+ " Gtk.TextIter e;",
+ " this.el.get_buffer().get_start_iter(out s);",
+ " this.el.get_buffer().get_end_iter(out e);",
+ " var ret = this.el.get_buffer().get_text(s,e,true);",
+ " //print(\"TO STRING? \" + ret);",
+ " return ret;",
+ "}",
+ ""
+ ],
+ "| void clearGreySelection" : [
+ "() {",
+ " // clear all the marks..",
+ " var sbuf = (Gtk.SourceBuffer)this.el.buffer;",
+ " ",
+ " Gtk.TextIter start;",
+ " Gtk.TextIter end; ",
+ " ",
+ " sbuf.get_bounds (out start, out end);",
+ " sbuf.remove_source_marks (start, end, \"grey\");",
+ " ",
+ " ",
+ "}",
+ ""
+ ],
+ "| void highlightErrorsJson" : [
+ " (string type, Json.Object obj) {",
+ " // this is a hook for the vala code - it has no value in javascript ",
+ " // as we only have one error ususally....",
+ " return ;",
+ " ",
+ " ",
+ "",
+ "",
+ "}"
+ ],
+ "| void loadFile" : [
+ "( ) {",
+ " this.loading = true;",
+ " ",
+ " ",
+ " // get the cursor and scroll position....",
+ " var buf = this.el.get_buffer();",
+ "\tvar cpos = buf.cursor_position;",
+ " ",
+ " print(\"BEFORE LOAD cursor = %d\\n\", cpos);",
+ " ",
+ " var vadj_pos = this.el.get_vadjustment().get_value();",
+ " ",
+ " ",
+ " ",
+ " buf.set_text(\"\",0);",
+ " var sbuf = (Gtk.SourceBuffer) buf;",
+ "",
+ " ",
+ "",
+ " if (_this.file == null || _this.file.xtype != \"Roo\") {",
+ " print(\"xtype != Roo\");",
+ " this.loading = false;",
+ " return;",
+ " }",
+ " ",
+ " // get the string from the rendered tree...",
+ " ",
+ " var str = _this.file.toSource();",
+ " ",
+ "// print(\"setting str %d\\n\", str.length);",
+ " buf.set_text(str, str.length);",
+ " var lm = Gtk.SourceLanguageManager.get_default();",
+ " ",
+ " //?? is javascript going to work as js?",
+ " ",
+ " ((Gtk.SourceBuffer)(buf)) .set_language(lm.get_language(_this.file.language));",
+ " ",
+ " ",
+ " Gtk.TextIter start;",
+ " Gtk.TextIter end; ",
+ " ",
+ " sbuf.get_bounds (out start, out end);",
+ " sbuf.remove_source_marks (start, end, null); // remove all marks..",
+ " ",
+ " GLib.Timeout.add(500, () => {",
+ "",
+ " print(\"RESORTING cursor to = %d\\n\", cpos);",
+ "\t\tGtk.TextIter cpos_iter;",
+ "\t\tbuf.get_iter_at_offset(out cpos_iter, cpos);",
+ "\t\tbuf.place_cursor(cpos_iter); ",
+ "\t\t",
+ "\t\tthis.el.get_vadjustment().set_value(vadj_pos);;",
+ "\t\t",
+ "",
+ "\t\tthis.onCursorChanged();",
+ "\t\t",
+ "\t\t",
+ "\t\t_this.buffer.checkSyntax();",
+ "\t\treturn false;",
+ "\t});",
+ "\t\t",
+ " this.loading = false; ",
+ " _this.buffer.dirty = false;",
+ "}",
+ ""
+ ],
+ "| void nodeSelected" : [
+ "(JsRender.Node? sel, bool scroll ) {",
+ " ",
+ " ",
+ "\t",
+ " // this is connected in widnowstate",
+ "",
+ "",
+ "\t// not sure why.... ",
+ " while(Gtk.events_pending()) {",
+ " Gtk.main_iteration();",
+ " }",
+ " ",
+ " this.node_selected = sel;",
+ " ",
+ " this.updateGreySelection(scroll);",
+ " ",
+ " ",
+ " ",
+ "}",
+ "",
+ " ",
+ ""
+ ],
+ "| void onCursorChanged" : [
+ "(/*ParamSpec ps*/) {",
+ "",
+ "\t\tif (!this.key_is_pressed && !this.button_is_pressed) {",
+ "\t\t\treturn;",
+ "\t\t}",
+ "",
+ "\t if (this.loading) {",
+ " return;",
+ " }",
+ " // if (ps.name != \"cursor-position\") {",
+ " // return;",
+ " // }",
+ "",
+ " var buf = this.el.get_buffer();",
+ " //print(\"cursor changed : %d\\n\", buf.cursor_position);",
+ " Gtk.TextIter cpos;",
+ " buf.get_iter_at_offset(out cpos, buf.cursor_position);",
+ " ",
+ " var ln = cpos.get_line();",
+ " ",
+ " ",
+ " // --- select node at line....",
+ " ",
+ " var node = _this.file.lineToNode(ln+1);",
+ " ",
+ " if (node == null) {",
+ " print(\"can not find node\\n\");",
+ " return;",
+ " }",
+ " var prop = node.lineToProp(ln+1);",
+ " print(\"prop : %s\", prop == null ? \"???\" : prop);",
+ " ",
+ " ",
+ " // ---------- this selects the tree's node...",
+ " ",
+ " var ltree = _this.main_window.windowstate.left_tree;",
+ " var tp = ltree.model.treePathFromNode(node);",
+ " print(\"got tree path %s\\n\", tp);",
+ " if (tp != \"\") {",
+ "\t ",
+ "\t ",
+ "\t //print(\"changing cursor on tree..\\n\");",
+ "\t ",
+ " ",
+ " ",
+ " // let's try allowing editing on the methods.",
+ " // a little klunky at present..",
+ " this.prop_selected = \"\";",
+ " if (prop != null) {",
+ " \t\t//see if we can find it..",
+ " \t\tvar kv = prop.split(\":\");",
+ " \t\tif (kv[0] == \"p\") {",
+ " \t\t",
+ "\t \t\t//var k = prop.get_key(kv[1]);",
+ "\t \t\t// fixme -- need to determine if it's an editable property...",
+ "\t \t\tthis.prop_selected = prop;",
+ "\t \t\t",
+ " \t\t} else if (kv[0] == \"l\") {",
+ " \t\t\t this.prop_selected = prop;",
+ " \t\t\t",
+ " \t\t}",
+ " }",
+ " ltree.view.setCursor(tp, \"editor\");",
+ " // ltree.view.el.set_cursor(new Gtk.TreePath.from_string(tp), null, false); ",
+ " this.nodeSelected(node,false);",
+ " ",
+ " // scrolling is disabled... as node selection calls scroll 10ms after it changes.",
+ " ",
+ " }",
+ " ",
+ " // highlight the node..",
+ "}",
+ " "
+ ],
+ "| void updateGreySelection" : [
+ "(bool scroll) { ",
+ "\tvar sel = this.node_selected;",
+ "\tprint(\"node selected\\n\");",
+ " var buf = this.el.get_buffer();",
+ " var sbuf = (Gtk.SourceBuffer) buf;",
+ "",
+ " ",
+ " this.clearGreySelection();",
+ " ",
+ " ",
+ " ",
+ " if (sel == null) {",
+ "\t print(\"no selected node\\n\");",
+ " // no highlighting..",
+ " return;",
+ " }",
+ " ",
+ " print(\"highlight region %d to %d\\n\", sel.line_start,sel.line_end);",
+ " Gtk.TextIter iter; ",
+ " sbuf.get_iter_at_line(out iter, sel.line_start);",
+ " ",
+ " ",
+ " Gtk.TextIter cur_iter;",
+ " sbuf.get_iter_at_offset(out cur_iter, sbuf.cursor_position);",
+ " ",
+ " var cursor_at_line = cur_iter.get_line();",
+ " ",
+ " ",
+ " //var cur_line = cur_iter.get_line();",
+ " //if (cur_line > sel.line_start && cur_line < sel.line_end) {",
+ " ",
+ " //} else {",
+ " if (scroll) {",
+ "\t\tprint(\"scrolling to node -- should occur on node picking.\\n\");",
+ " \tthis.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);",
+ "\t}",
+ " ",
+ " var start_line = sel.line_start;",
+ " var end_line = sel.line_end;",
+ " ",
+ " ",
+ " this.el.editable = false;",
+ " ",
+ " //var colon_pos = 0;",
+ " ",
+ " this.editable_start_pos = -1;",
+ " ",
+ " // now if we have selected a property...",
+ " if (this.prop_selected.length> 0 ) {",
+ "",
+ "\t\tint nstart, nend;",
+ "\t\tif (sel.getPropertyRange(this.prop_selected, out nstart, out nend) && nend > nstart) {",
+ "\t\t\tstart_line = nstart;",
+ "\t\t\tend_line = nend;",
+ "\t\t\tthis.el.editable = true;",
+ "\t\t\tprint(\"start line = %d, end line = %d\\n\", start_line, end_line);",
+ "\t\t\t",
+ "\t\t\t\t// see if we are 'right of ':'",
+ "\t\t\t\t// get an iter for the start of the line.",
+ "\t\t\tGtk.TextIter start_first_line_iter,end_first_line_iter;",
+ "\t\t\tthis.el.buffer.get_iter_at_line(out start_first_line_iter, start_line -1);",
+ "\t\t\tthis.el.buffer.get_iter_at_line(out end_first_line_iter, start_line -1);",
+ "\t\t\t ",
+ "\t\t\t",
+ "\t\t\t",
+ "\t\t\t",
+ "\t\t\tif (end_first_line_iter.forward_to_line_end()) {",
+ "\t\t\t\tvar first_line = this.el.buffer.get_text(start_first_line_iter, end_first_line_iter, false);",
+ "\t\t\t\t",
+ "\t\t\t\tprint(\"first line = %s\\n\", first_line);",
+ "\t\t\t\tif (first_line.contains(\":\")) {",
+ "\t\t\t\t\tthis.editable_start_pos = start_first_line_iter.get_offset() + first_line.index_of(\":\") + 1;",
+ "\t\t\t\t\tprint(\"colon_pos = %d\\n\", this.editable_start_pos);",
+ "\t\t\t\t}",
+ "\t\t\t\t",
+ "",
+ "\t\t\t\t//Gtk.TextIter colon_iter;",
+ "\t\t\t\t//sbuf.get_iter_at_offset (out colon_iter, colon_pos);",
+ "\t\t\t\t//sbuf.create_source_mark(null, \"active_text\", colon_iter);",
+ "\t\t\t}",
+ "\t\t\t",
+ "\t\t\t",
+ "\t\t\t",
+ "\t\t\t//print(\"is cursor at line? %d ?= %d\\n\", start_line -1 , cursor_at_line);",
+ "\t\t\t//if (start_line - 1 == cursor_at_line) {",
+ "\t\t\t// should be ok - current_posssion can not be less than '-1'...",
+ "\t\t\tif (sbuf.cursor_position < this.editable_start_pos) {",
+ "\t\t\t",
+ "\t\t\t\tprint(\"cursor is before start pos.. - turn off editable...\\n\");",
+ "\t\t\t\t//var before_cursor_string = this.el.buffer.get_text(start_line_iter, cur_iter, false);",
+ "\t\t\t\t//print(\"before cursor string = %s\\n\", before_cursor_string);",
+ "\t\t\t\t//if (!before_cursor_string.contains(\":\")) {",
+ "\t\t\t\t\tthis.el.editable = false;",
+ "\t\t\t\t//}",
+ "\t\t\t\t",
+ "\t\t\t}",
+ "\t\t\t ",
+ "\t\t\t ",
+ "",
+ "\t\t\t ",
+ "\t\t}",
+ "\t\tprint(\"propSelected = %s range %d -> %d\\n\", this.prop_selected, start_line, end_line);\t\t",
+ "\t\t",
+ "\t\t",
+ " }",
+ " ",
+ "\tprint(\"checking selection\\n\");",
+ " ",
+ " ",
+ " // check selection - if it's out of 'bounds'",
+ " if (this.el.editable && sbuf.get_has_selection()) {",
+ "\t\tGtk.TextIter sel_start_iter, sel_end_iter;",
+ "\t\tsbuf.get_selection_bounds(out sel_start_iter, out sel_end_iter);",
+ "\t\t",
+ "\t\tif (sel_start_iter.get_line() < start_line || sel_end_iter.get_line() > end_line ||",
+ "\t\t\tsel_start_iter.get_line() > end_line || sel_end_iter.get_line() < start_line\t\t\t) {",
+ "\t\t\t// save?",
+ "\t\t\tthis.el.editable = false;",
+ "\t\t}",
+ "\t\tif (this.editable_start_pos > 0 &&",
+ "\t\t\t(sel_start_iter.get_offset() < this.editable_start_pos || sel_end_iter.get_offset() < this.editable_start_pos)",
+ "\t\t\t",
+ "\t\t) {",
+ "\t\t\tthis.el.editable = false;",
+ "\t\t}",
+ "\t\t",
+ "\t\t ",
+ " ",
+ " }",
+ " ",
+ " ",
+ " ",
+ " ",
+ " for (var i = 0; i < buf.get_line_count();i++) {",
+ " if (i < (start_line -1) || i > (end_line -1)) {",
+ " ",
+ " sbuf.get_iter_at_line(out iter, i);",
+ " sbuf.create_source_mark(null, \"grey\", iter);",
+ " ",
+ " }",
+ " ",
+ " }",
+ " if (scroll && (cursor_at_line > end_line || cursor_at_line < start_line)) {",
+ "\t Gtk.TextIter cpos_iter;",
+ "\t\tbuf.get_iter_at_line(out cpos_iter, start_line);",
+ "\t\t",
+ "\t\tbuf.place_cursor(cpos_iter); ",
+ "\t}",
+ "",
+ "",
+ "}"
]
}
- ]
+ ],
+ "xtype" : "ScrolledWindow"
}
- ]
+ ],
+ "xtype" : "Notebook"
}
+ ],
+ "xtype" : "Box",
+ "| int search" : [
+ "(string txt) {",
+ "\tthis.notebook.el.page = 1;",
+ " \tvar s = new Gtk.SourceSearchSettings();",
+ "\tvar buf = (Gtk.SourceBuffer) this.sourceview.el.get_buffer();",
+ "\tthis.searchcontext = new Gtk.SourceSearchContext(buf,s);",
+ "\tthis.searchcontext.set_highlight(true);",
+ "\ts.set_search_text(txt);",
+ "\t",
+ "\tGtk.TextIter beg, st,en;",
+ "\t ",
+ "\tbuf.get_start_iter(out beg);",
+ "\tthis.searchcontext.forward(beg, out st, out en);",
+ "\tthis.last_search_end = 0;",
+ "\treturn this.searchcontext.get_occurrences_count();",
+ "",
+ " ",
+ "}",
+ ""
+ ],
+ "| void createThumb" : [
+ "() {",
+ " ",
+ " ",
+ " if (this.file == null) {",
+ " return;",
+ " }",
+ "\tif (this.notebook.el.page > 0 ) {",
+ " return;",
+ " }",
+ " ",
+ " var filename = this.file.getIconFileName(false);",
+ " ",
+ " var win = this.el.get_parent_window();",
+ " var width = win.get_width();",
+ " // var height = win.get_height();",
+ " try { ",
+ " Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, this.paned.el.position);",
+ " screenshot.save(filename,\"png\");",
+ " } catch(Error e) {",
+ " //noop",
+ " }",
+ "",
+ " ",
+ " ",
+ " ",
+ " ",
+ "}",
+ ""
+ ],
+ "| void forwardSearch" : [
+ "(bool change_focus) {",
+ "",
+ "\tif (this.searchcontext == null) {",
+ "\t\treturn;",
+ "\t}",
+ "\tthis.notebook.el.page = 1;",
+ "\tGtk.TextIter beg, st,en, stl;",
+ "\t",
+ "\tvar buf = this.sourceview.el.get_buffer();",
+ "\tbuf.get_iter_at_offset(out beg, this.last_search_end);",
+ "\tif (!this.searchcontext.forward(beg, out st, out en)) {",
+ "\t\tthis.last_search_end = 0;",
+ "\t\treturn;",
+ "\t}",
+ "\tthis.last_search_end = en.get_offset();",
+ "\tif (change_focus) {",
+ "\t\tthis.sourceview.el.grab_focus();",
+ "\t}",
+ "\tbuf.place_cursor(st);",
+ "\tvar ln = st.get_line();",
+ "\tbuf.get_iter_at_line(out stl,ln);",
+ "\t ",
+ "\tthis.sourceview.el.scroll_to_iter(stl, 0.0f, true, 0.0f, 0.5f);",
+ "\t",
+ "\t// highlight node...",
+ "\t",
+ "\t\t",
+ " var node = _this.file.lineToNode(ln+1);",
+ " ",
+ " if (node == null) {",
+ " //print(\"can not find node\\n\");",
+ " return;",
+ " }",
+ " var prop = node.lineToProp(ln+1);",
+ " print(\"prop : %s\", prop == null ? \"???\" : prop);",
+ " ",
+ " ",
+ " // ---------- this selects the tree's node...",
+ " ",
+ " var ltree = _this.main_window.windowstate.left_tree;",
+ " var tp = ltree.model.treePathFromNode(node);",
+ " print(\"got tree path %s\\n\", tp);",
+ " if (tp == \"\") {",
+ "\t\treturn;",
+ "\t}",
+ " //_this.sourceview.allow_node_scroll = false; /// block node scrolling..",
+ "\t ",
+ " ",
+ " //print(\"changing cursor on tree..\\n\");",
+ " ",
+ "",
+ " ",
+ " // let's try allowing editing on the methods.",
+ " // a little klunky at present..",
+ "\t_this.sourceview.prop_selected = \"\";",
+ " if (prop != null) {",
+ "\t\t//see if we can find it..",
+ "\t\tvar kv = prop.split(\":\");",
+ "\t\tif (kv[0] == \"p\") {",
+ "\t\t",
+ " \t\t//var k = prop.get_key(kv[1]);",
+ " \t\t// fixme -- need to determine if it's an editable property...",
+ " \t\t_this.sourceview.prop_selected = prop;",
+ " \t\t",
+ "\t\t} else if (kv[0] == \"l\") {",
+ "\t\t\t _this.sourceview.prop_selected = prop;",
+ "\t\t\t",
+ "\t\t}",
+ " }",
+ " ltree.view.setCursor(tp, \"editor\");",
+ " // ltree.view.el.set_cursor(new Gtk.TreePath.from_string(tp), null, false); ",
+ " _this.sourceview.nodeSelected(node,false);",
+ " ",
+ " // scrolling is disabled... as node selection calls scroll 10ms after it changes.",
+ " // GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {",
+ "\t // this.allow_node_scroll = true;",
+ "\t // return false;",
+ " // });",
+ " // }",
+ "\t\t",
+ "\t\t",
+ "\t\t",
+ "\t\t",
+ "\t\t",
+ "\t\t",
+ "\t\t",
+ "\t\t",
+ "\t\t",
+ "\t\t ",
+ "",
+ "}",
+ ""
+ ],
+ "| void loadFile" : [
+ "",
+ "(JsRender.JsRender file)",
+ "{",
+ " this.file = file;",
+ " this.view.renderJS(true);",
+ " this.notebook.el.page = 0;// gtk preview ",
+ " this.sourceview.loadFile(); ",
+ " ",
+ "}",
+ " ",
+ " "
+ ],
+ "| void requestRedraw" : [
+ "() {",
+ " this.view.renderJS(false);",
+ " this.sourceview.loadFile(); ",
+ "}"
+ ],
+ "| void scroll_to_line" : [
+ "(int line) {",
+ " this.notebook.el.page = 1;// code preview...",
+ " ",
+ " GLib.Timeout.add(500, () => {",
+ " ",
+ " ",
+ "\t ",
+ "\t ",
+ "\t\t var buf = this.sourceview.el.get_buffer();",
+ "\t ",
+ "\t\tvar sbuf = (Gtk.SourceBuffer) buf;",
+ "",
+ "",
+ "\t\tGtk.TextIter iter; ",
+ "\t\tsbuf.get_iter_at_line(out iter, line);",
+ "\t\tthis.sourceview.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);",
+ "\t\treturn false;",
+ "\t}); ",
+ "",
+ " ",
+ "}",
+ ""
]
}
- ]
+ ],
+ "modOrder" : "",
+ "name" : "WindowRooView",
+ "parent" : "",
+ "path" : "/home/alan/gitlive/roobuilder/src/Builder4/WindowRooView.bjs",
+ "permname" : "",
+ "title" : ""
}
\ No newline at end of file
// my vars (def)
public Gtk.Widget lastObj;
- public int width;
public int last_search_end;
public Gtk.SourceSearchContext searchcontext;
public JsRender.JsRender file;
- public int height;
public Xcls_MainWindow main_window;
// ctor
// my vars (dec)
this.lastObj = null;
- this.width = 0;
this.last_search_end = 0;
this.file = null;
- this.height = 0;
// set gobject values
this.el.hexpand = true;
+ this.el.vexpand = true;
var child_0 = new Xcls_notebook( _this );
child_0.ref();
this.el.pack_start ( child_0.el , true,true,0 );
});
+ }
+ public int search (string txt) {
+ this.notebook.el.page = 1;
+ var s = new Gtk.SourceSearchSettings();
+ var buf = (Gtk.SourceBuffer) this.sourceview.el.get_buffer();
+ this.searchcontext = new Gtk.SourceSearchContext(buf,s);
+ this.searchcontext.set_highlight(true);
+ s.set_search_text(txt);
+
+ Gtk.TextIter beg, st,en;
+
+ buf.get_start_iter(out beg);
+ this.searchcontext.forward(beg, out st, out en);
+ this.last_search_end = 0;
+ return this.searchcontext.get_occurrences_count();
+
+
}
public void createThumb () {
this.notebook.el.page = 0;// gtk preview
this.sourceview.loadFile();
- }
- public int search (string txt) {
- this.notebook.el.page = 1;
- var s = new Gtk.SourceSearchSettings();
- var buf = (Gtk.SourceBuffer) this.sourceview.el.get_buffer();
- this.searchcontext = new Gtk.SourceSearchContext(buf,s);
- this.searchcontext.set_highlight(true);
- s.set_search_text(txt);
-
- Gtk.TextIter beg, st,en;
-
- buf.get_start_iter(out beg);
- this.searchcontext.forward(beg, out st, out en);
- this.last_search_end = 0;
- return this.searchcontext.get_occurrences_count();
-
-
}
public void requestRedraw () {
this.view.renderJS(false);
// my vars (def)
- public bool loading;
public bool button_is_pressed;
- public string prop_selected;
- public bool key_is_pressed;
public JsRender.Node? node_selected;
+ public bool loading;
public int editable_start_pos;
+ public string prop_selected;
+ public bool key_is_pressed;
// ctor
public Xcls_sourceview(Xcls_WindowRooView _owner )
this.el = new Gtk.SourceView();
// my vars (dec)
- this.loading = true;
this.button_is_pressed = false;
- this.prop_selected = "";
- this.key_is_pressed = false;
this.node_selected = null;
+ this.loading = true;
this.editable_start_pos = -1;
+ this.prop_selected = "";
+ this.key_is_pressed = false;
// set gobject values
this.el.editable = false;
{
+
var description = Pango.FontDescription.from_string("monospace");
description.set_size(8000);
this.el.override_font(description);
//buf.notify.connect(this.onCursorChanged);
-
var attrs = new Gtk.SourceMarkAttributes();
var pink = Gdk.RGBA();
pink.parse ( "pink");
this.el.button_press_event.connect( () => {
-
-
this.button_is_pressed = true;
return false;
});
}
// user defined functions
+ public void clearGreySelection () {
+ // clear all the marks..
+ var sbuf = (Gtk.SourceBuffer)this.el.buffer;
+
+ Gtk.TextIter start;
+ Gtk.TextIter end;
+
+ sbuf.get_bounds (out start, out end);
+ sbuf.remove_source_marks (start, end, "grey");
+
+
+ }
public void onCursorChanged (/*ParamSpec ps*/) {
if (!this.key_is_pressed && !this.button_is_pressed) {
// highlight the node..
}
- public void clearGreySelection () {
- // clear all the marks..
- var sbuf = (Gtk.SourceBuffer)this.el.buffer;
-
- Gtk.TextIter start;
- Gtk.TextIter end;
-
- sbuf.get_bounds (out start, out end);
- sbuf.remove_source_marks (start, end, "grey");
-
-
+ public string toString () {
+ Gtk.TextIter s;
+ Gtk.TextIter e;
+ this.el.get_buffer().get_start_iter(out s);
+ this.el.get_buffer().get_end_iter(out e);
+ var ret = this.el.get_buffer().get_text(s,e,true);
+ //print("TO STRING? " + ret);
+ return ret;
}
public void nodeSelected (JsRender.Node? sel, bool scroll ) {
- }
- public string toString () {
- Gtk.TextIter s;
- Gtk.TextIter e;
- this.el.get_buffer().get_start_iter(out s);
- this.el.get_buffer().get_end_iter(out e);
- var ret = this.el.get_buffer().get_text(s,e,true);
- //print("TO STRING? " + ret);
- return ret;
}
public void loadFile ( ) {
this.loading = true;
}
return false;
}
- public string toString () {
-
- Gtk.TextIter s;
- Gtk.TextIter e;
- this.el.get_start_iter(out s);
- this.el.get_end_iter(out e);
- var ret = this.el.get_text(s,e,true);
- //print("TO STRING? " + ret);
- return ret;
- }
public bool checkSyntax () {
);
}
+ public string toString () {
+
+ Gtk.TextIter s;
+ Gtk.TextIter e;
+ this.el.get_start_iter(out s);
+ this.el.get_end_iter(out e);
+ var ret = this.el.get_text(s,e,true);
+ //print("TO STRING? " + ret);
+ return ret;
+ }
}
this.left_tree.ref();
this.left_tree.main_window = this.win;
- this.win.tree.el.pack_start(this.left_tree.el,true, true,0);
+ this.win.leftpane.el.remove(this.win.editpane.el);
+ //this.win.tree.el.remove(this.left_tree.el);
+ this.win.leftpane.el.add(this.left_tree.el);
+
+
+ //this.win.tree.el.pack_start(this.left_tree.el,true, true,0);
this.left_tree.el.show_all();
this.left_tree.before_node_change.connect(() => {
//if (!this.code_editor.saveContents()) {
// return false;
//}
- return false;
+ //return false;
}
+ int tree_width = 300;
+ int props_width = 300;
+
public void leftTreeNodeSelected(JsRender.Node? sel, string source)
{
print("node_selected called %s\n", (sel == null) ? "NULL" : "a value");
+ this.add_props.hide(); // always hide add node/add listener if we change node.
+ this.rightpalete.hide();
+
+ this.left_props.load(this.left_tree.getActiveFile(), sel);
+
+ var outerpane = this.win.mainpane.el;
+ var innerpane = this.win.editpane.el;
+
+ if (this.win.editpane.el.parent != null && sel != null) {
+ // select another node... no change to show hide/resize
+ return;
+ }
+
if (sel == null) {
+ // remove win.editpane from leftpane
+ // remove lefttree from from win.tree
+ // add win.tree to leftpane
+ if (this.win.editpane.el.parent != null) {
+ this.props_width = outerpane.get_position() - innerpane.get_position();
+ this.tree_width = innerpane.get_position();
+ GLib.debug("HIDE: prop_w = %d, tree_w = %d", this.props_width, this.tree_width);
+
+ this.win.leftpane.el.remove(this.win.editpane.el);
+ this.win.tree.el.remove(this.left_tree.el);
+ this.win.leftpane.el.add(this.left_tree.el);
+ }
+
+
+ //GLib.debug("Hide Properties");
+ outerpane.show_all(); // make sure it's visiable..
this.left_props.el.hide();
- }
- this.left_props.el.show();
- this.left_props.load(this.left_tree.getActiveFile(), sel);
+ GLib.debug("set position: %d", this.tree_width);
+ outerpane.set_position(this.tree_width);
+ //outerpane.set_position(int.max(250,innerpane.get_position()));
+ //this.left_props.el.width_request = this.left_props.el.get_allocated_width();
+ return;
+ }
+
+ // at this point we are showing the outer only,
+
+
+
+
+ this.tree_width = outerpane.get_position();
+
+ GLib.debug("SHOW: prop_w = %d, tree_w = %d", this.props_width, this.tree_width);
+
+ // remove this.ldeftree from this.win.leftpane
+ this.win.leftpane.el.remove(this.left_tree.el);
+ this.win.tree.el.add(this.left_tree.el);
+ this.win.leftpane.el.add(this.win.editpane.el);
+
+
+
+
+ GLib.debug("left props is %s", this.left_props.el.visible ? "shown" : "hidden");
+ // at start (hidden) - outer = 400 inner = 399
+ // expanded out -> outer = 686, inner = 399
+ //this.win.props.el.pack_start(this.left_props.el,true, true,0);
+ this.left_props.el.show_all();
+ //if (!this.left_props.el.visible) {
+
+ GLib.debug("outerpos : %d, innerpos : %d", outerpane.get_position(), innerpane.get_position());
+ outerpane.set_position(this.tree_width + this.props_width);
+ innerpane.set_position(this.tree_width);
+ /* var cw = outerpane.el.get_position();
+ var rw = int.min(this.left_props.el.width_request, 150);
+ print("outerpos : %d, innerpos : %d", cw + rw, cw);
+
+ innerpane.set_position(cw); */
+ this.left_props.el.show();
+
+ //}
+
+
+
+
+
+
// if either of these are active.. then we should update them??
- this.add_props.hide(); // always hide add node/add listener if we change node.
- this.rightpalete.hide();
+
+
+ /**
+
+ make outerpane = {current width of left pane} + width of props
+ make innerpane = {current width of left pane}
+
+
+
+
+
+ var outerpane = _this.main_window.leftpane.el;
+ var pane = _this.main_window.editpane.el;
+
+
+
+ var try_size = (i * 25) + 60; // est. 20px per line + 40px header
+ GLib.Timeout.add_seconds(1, () => {
+ // max 80%...
+ pane.set_position(
+ ((try_size * 1.0f) / (pane.max_position * 1.0f)) > 0.8f ?
+ (int) (pane.max_position * 0.2f) :
+ pane.max_position-try_size);
+ return GLib.Source.REMOVE;
+ });
+ */
/*
{
this.code_editor_tab = new Editor();
//this.code_editor.ref(); /// really?
- ((Gtk.Container)(this.win.codeeditview.el.get_widget())).add(this.code_editor_tab.el);
+ this.win.codeeditviewbox.el.add(this.code_editor_tab.el);
+ this.win.codeeditviewbox.el.hide();
this.code_editor_tab.window = this.win;
-
- var stage = this.win.codeeditview.el.get_stage();
- stage.set_background_color( Clutter.Color.from_string("#000"));
// editor.save...
this.code_editor_tab.save.connect( () => {
if (file.xtype == "PlainFile") {
+ this.win.codeeditviewbox.el.show();
this.switchState (State.CODEONLY);
file.loadItems();
this.code_editor_tab.show(file, null, "", "");
}
- var ctr= ((Gtk.Container)(this.win.rooview.el.get_widget()));
+ var ctr= this.win.rooviewbox.el;
if (file.project.xtype == "Roo" ) {
+ // removes all the childe elemnts from rooviewbox
+
ctr.foreach( (w) => { ctr.remove(w); });
ctr.add(this.window_rooview.el);
if (file.xtype != "PlainFile") {
+
this.window_rooview.loadFile(file);
this.window_rooview.el.show_all();
}
ctr.add(this.window_gladeview.el);
if (file.xtype != "PlainFile") {
+
this.window_gladeview.loadFile(file);
this.window_gladeview.el.show_all();
}
}
print("OPEN : " + file.name);
- if (file.xtype != "PlainFile") {
- this.win.editpane.el.set_position(this.win.editpane.el.max_position);
+ if (file.xtype != "PlainFile") {
+ // hide the file editor.
+ this.win.codeeditviewbox.el.hide();
+ //this.win.editpane.el.set_position(this.win.editpane.el.max_position);
}
this.win.setTitle(file.project.name + " : " + file.name);
this.window_rooview =new Xcls_WindowRooView();
this.window_rooview.main_window = this.win;
this.window_rooview.ref();
- ((Gtk.Container)(this.win.rooview.el.get_widget())).add(this.window_rooview.el);
+ this.win.rooviewbox.el.add(this.window_rooview.el);
+
this.window_rooview.el.show_all();
-
- var stage = this.win.rooview.el.get_stage();
- stage.set_background_color( Clutter.Color.from_string("#000"));
+ this.win.rooviewbox.el.hide();
+
}
// ------ Gtk - view
this.window_gladeview.main_window = this.win;
}
- public void easingSaveAll()
- {
- this.win.addpropsview.el.save_easing_state();
- this.win.codeeditview.el.save_easing_state();
- this.win.objectview.el.save_easing_state();
- this.win.rooview.el.save_easing_state();
- // this.clutterfiles.el.save_easing_state();
-
- }
- public void easingRestoreAll()
- {
- this.win.addpropsview.el.restore_easing_state();
- this.win.codeeditview.el.restore_easing_state();
- this.win.objectview.el.restore_easing_state();
- this.win.rooview.el.restore_easing_state();
- //this.clutterfiles.el.restore_easing_state();
-
- }
+
public void showProps(Gtk.Widget btn, string sig_or_listen)
// return;
//}
// save the easing state of everything..
- this.easingSaveAll();
+
switch (this.state) {
break;
-
+ }
-
- case State.CODEONLY:
- // going from codeonly..
-
- // enable re-calc of canvas..
-
- //this.code_editor.saveContents(); << not yet...
-
- this.win.rooview.el.show();
- this.win.leftpane.el.show();
- this.win.codeeditview.el.set_scale(0.0f,0.0f);
-
-
-
- while (Gtk.events_pending()) {
- Gtk.main_iteration();
- }
-
- // hides it completely...
-
- break;
-
- /*
- case State.FILES: // goes to preview or codeonly...
- // hide files...
-
-
- if (new_state == State.CODEONLY) {
- this.win.rooview.el.hide();
- } else {
- this.win.rooview.el.show();
- }
-
- this.win.rooview.el.set_easing_duration(1000);
- this.win.rooview.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
- this.win.rooview.el.set_scale(1.0f,1.0f);
- this.win.rooview.el.set_pivot_point(0.5f,0.5f);
- this.win.rooview.el.set_opacity(0xff);
-
- this.clutterfiles.el.set_easing_duration(1000);
- this.clutterfiles.el.set_pivot_point(0.5f,0.5f);
- this.clutterfiles.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, -180.0f);
- this.clutterfiles.el.set_opacity(0);
-
-
- //this.clutterfiles.el.hide();
-
-
- break;
- */
+
- }
+
+ this.win.rooviewbox.el.hide();
+ this.win.codeeditviewbox.el.hide();
+
var oldstate =this.state;
this.state = new_state;
// print ("changing state to preview from NOT files..");
- this.win.rooview.el.set_scale(1.0f,1.0f);
+ this.win.rooviewbox.el.show();
// }
break;
case State.CODEONLY:
- // going to codeonly..
- this.win.codeeditview.el.show();
- // recalc canvas...
- //while (Gtk.events_pending()) {
- // Gtk.main_iteration();
- //}
this.win.leftpane.el.hide();
- this.win.codeeditview.el.show();
- //while (Gtk.events_pending()) {
- // Gtk.main_iteration();
- //}
+ this.win.codeeditviewbox.el.show();
this.code_editor_tab.el.show_all();
- this.win.codeeditview.el.set_scale(1.0f,1.0f);
- this.win.rooview.el.set_pivot_point(1.0f,0.5f);
- break;
-/*
-
- case State.FILES: // can only get here from PREVIEW (or code-only) state.. in theory..
-
-
- this.win.editpane.el.hide(); // holder for tree and properties..
-
- this.left_projects.el.show();
-
- // rotate the preview to hidden...
- this.win.rooview.el.set_easing_duration(1000);
- this.win.rooview.el.set_pivot_point(0.5f,0.5f);
- this.win.rooview.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 180.0f);
- this.win.rooview.el.set_opacity(0);
-
-
-
-
- if (this.win.project != null) {
- this.left_projects.selectProject(this.win.project);
- }
-
-
- this.clutterfiles.el.show();
-
- this.clutterfiles.el.set_easing_duration(1000);
- this.clutterfiles.el.set_pivot_point(0.5f,0.5f);
- this.clutterfiles.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
- this.clutterfiles.el.set_opacity(0xff);
-
-
-
- break;
-*/
- }
- this.resizeCanvasElements();
- this.easingRestoreAll();
-
- // run the animation.. - then load files...
- GLib.Timeout.add(500, () =>{
- this.resizeCanvasElements();
- return false;
- });
-
- }
-
- public int redraw_count = 0;
- public void resizeCanvas() // called by window resize .. delays redraw
- {
- var rc = this.redraw_count;
- this.redraw_count = 2;
- if (rc == 0) {
- GLib.Timeout.add(100, () =>{
- return this.resizeCanvasQueue();
- });
- }
- }
- public bool resizeCanvasQueue()
- {
- //print("WindowState.resizeCanvasQueue %d\n", this.redraw_count);
-
- if (this.redraw_count < 1) {
- return false; // should not really happen...
- }
-
-
- this.redraw_count--;
- if (this.redraw_count > 0) {
- return true; // do it again in 1 second...
- }
- // got down to 0 or -1....
- this.redraw_count = 0;
- this.resizeCanvasElements();
- return false;
-
- }
- public void resizeCanvasElements()
- {
- Gtk.Allocation alloc;
- this.win.clutterembed.el.get_allocation(out alloc);
+ break;
+
- // print("WindowState.resizeCanvasElements\n");
- if (!this.children_loaded || this.win.clutterembed == null) {
- print("WindowState.resizeCanvasElements = ingnore not loaded or no clutterfiles\n");
- return;
}
-
- var avail = alloc.width < 50.0f ? 0 : alloc.width - 50.0f;
- var palsize = avail < 300.0f ? avail : 300.0f;
-
-
- // -------- code edit min 600
-
- var codesize = avail < 800.0f ? avail : 800.0f;
-
-
- //print("set code size %f\n", codesize);
-
- switch ( this.state) {
- case State.PREVIEW:
-
- this.win.rooview.el.set_size(alloc.width-50, alloc.height);
- break;
- //case State.FILES:
- //this.clutterfiles.set_size(alloc.width-50, alloc.height);
- // break;
-
-
-
- case State.CODEONLY:
- this.win.codeeditview.el.set_size(codesize, alloc.height);
- var scale = avail > 0.0f ? (avail - codesize -10 ) / avail : 0.0f;
- //this.win.rooview.el.save_easing_state();
- this.win.rooview.el.hide();
- this.win.rooview.el.set_scale(scale,scale);
- // this.win.rooview.el.restore_easing_state();
- break;
-
- }
+
}
+
+
// -- buttons show hide.....
-
- this.win.objectshowbutton.el.hide(); // add objects
- this.win.addpropbutton.el.hide();
- this.win.addlistenerbutton.el.hide();
-
+
this.win.search_entry.el.hide();
- this.win.objectshowbutton.el.show(); // add objects
- this.win.addpropbutton.el.show();
- this.win.addlistenerbutton.el.show();
+
this.win.search_entry.el.show();
// this.win.openbtn.el.show();
"target_bin" : "/tmp/builder",
"sources" : [
"../Builder4/About.vala",
- "../Builder4/ClutterFiles.vala",
"../Builder4/DialogConfirm.vala",
"../Builder4/DialogPluginWebkit.vala",
"../Builder4/DialogSaveModule.vala",
"gtk+-3.0",
"gtksourceview-3.0",
"libgda-5.0",
- "clutter-gtk-1.0",
"glib-2.0",
"gobject-introspection-1.0",
"gobject-2.0",
"librsvg-2.0",
"libvala-0.32",
"libvala-0.34",
- "roojspacker-1.0",
"libvala-0.36",
"gee-0.8",
"roojspacker-1.4",
void addMyVars()
{
+ GLib.debug("callinged addMhyVars");
+
this.addLine();
this.addLine(this.ipad + "// my vars (def)");
var cls = Palete.Gir.factoryFqn((Project.Gtk) this.file.project, this.node.fqn());
if (cls == null) {
+ GLib.debug("Gir factory failed to find class %s", this.node.fqn());
+
return;
}
this.ignore(k);
continue;
}
+ GLib.debug("Got myvars: %s", k.strip());
var min = (vv[0] == "$" || vv[0] == "#") ? 3 : 2;
if (vv.length < min) {
// skip 'old js style properties without a type'
var app = BuilderApplication.singleton( args);
Gtk.init (ref args);
- GtkClutter.init (ref args);
+
// not sure why this was done?? - it caused crash bugs on gtk_Box_gadget so removed critical.
--pkg json-glib-1.0 \
--pkg gee-0.8 \
--pkg gobject-introspection-1.0 \
- --pkg clutter-gtk-1.0 \
--pkg libsoup-2.4 \
--pkg javascriptcore \
--pkg roojspacker-1.4 \
Builder4/WindowLeftTree.vala \
Builder4/WindowRooView.vala \
Builder4/WindowLeftProps.vala \
- Builder4/ClutterFiles.vala \
Builder4/PopoverAddProp.vala \
Builder4/GtkView.vala \
Builder4/ValaProjectSettingsPopover.vala \
- public static GirObject? factoryFqn(Project.Project project, string fqn)
+ public static GirObject? factoryFqn(Project.Project project, string in_fqn)
{
+ var fqn = in_fqn;
+ // swap Gtk.Source* to GtkSource.
+
+ GLib.debug("Gir.facotryFqn search %s", fqn);
var bits = fqn.split(".");
if (bits.length < 1) {
return null;
vapidirs += (BuilderApplication.configDirectory() + "/resources/vapi");
vapidirs += "/usr/share/vala-0.%d/vapi".printf(ver);
+ vapidirs += "/usr/share/vala/vapi";
context.vapi_directories = vapidirs;
// or context.get_vapi_path("glib-2.0"); // should return path..