qml 0.0.7 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (296) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +3 -0
  3. data/.travis.yml +5 -9
  4. data/LICENSE.txt +1 -1
  5. data/README.md +84 -114
  6. data/changes.md +5 -0
  7. data/examples/fizzbuzz/fizzbuzz.rb +3 -4
  8. data/examples/todo_array/todo_array.rb +4 -4
  9. data/examples/todo_sequel/todo_sequel.rb +7 -7
  10. data/examples/twitter/twitter.rb +5 -3
  11. data/ext/qml/application.c +88 -0
  12. data/ext/qml/application.h +9 -0
  13. data/ext/qml/component.c +89 -0
  14. data/ext/qml/component.h +10 -0
  15. data/ext/qml/conversion.c +60 -0
  16. data/ext/qml/conversion.h +8 -0
  17. data/ext/qml/dispatcher.c +31 -0
  18. data/ext/qml/dispatcher.h +7 -0
  19. data/ext/qml/engine.c +135 -0
  20. data/ext/qml/engine.h +10 -0
  21. data/ext/qml/exporter.c +93 -0
  22. data/ext/qml/exporter.h +7 -0
  23. data/ext/qml/extconf.rb +38 -97
  24. data/ext/qml/interface.c +156 -0
  25. data/ext/qml/interface.h +11 -0
  26. data/ext/qml/js_array.c +47 -0
  27. data/ext/qml/js_array.h +7 -0
  28. data/ext/qml/js_function.c +109 -0
  29. data/ext/qml/js_function.h +7 -0
  30. data/ext/qml/js_object.c +284 -0
  31. data/ext/qml/js_object.h +19 -0
  32. data/ext/qml/js_wrapper.c +19 -0
  33. data/ext/qml/js_wrapper.h +7 -0
  34. data/ext/qml/lib/libqmlbind/.gitignore +38 -0
  35. data/ext/qml/lib/libqmlbind/.gitmodules +3 -0
  36. data/ext/qml/lib/libqmlbind/.travis.yml +14 -0
  37. data/ext/qml/lib/libqmlbind/LICENSE.txt +22 -0
  38. data/ext/qml/lib/libqmlbind/libqmlbind.pro +3 -0
  39. data/ext/qml/lib/libqmlbind/qmlbind/include/qmlbind.h +14 -0
  40. data/ext/qml/lib/libqmlbind/qmlbind/include/qmlbind/application.h +18 -0
  41. data/ext/qml/lib/libqmlbind/qmlbind/include/qmlbind/component.h +21 -0
  42. data/ext/qml/lib/libqmlbind/qmlbind/include/qmlbind/engine.h +34 -0
  43. data/ext/qml/lib/libqmlbind/qmlbind/include/qmlbind/exporter.h +37 -0
  44. data/ext/qml/lib/libqmlbind/qmlbind/include/qmlbind/interface.h +16 -0
  45. data/ext/qml/lib/libqmlbind/qmlbind/include/qmlbind/iterator.h +19 -0
  46. data/ext/qml/lib/libqmlbind/qmlbind/include/qmlbind/metaobject.h +13 -0
  47. data/ext/qml/lib/libqmlbind/qmlbind/include/qmlbind/plugin.h +17 -0
  48. data/ext/qml/lib/libqmlbind/qmlbind/include/qmlbind/qmlbind_global.h +78 -0
  49. data/ext/qml/lib/libqmlbind/qmlbind/include/qmlbind/register.h +17 -0
  50. data/ext/qml/lib/libqmlbind/qmlbind/include/qmlbind/signal_emitter.h +15 -0
  51. data/ext/qml/lib/libqmlbind/qmlbind/include/qmlbind/string.h +15 -0
  52. data/ext/qml/lib/libqmlbind/qmlbind/include/qmlbind/value.h +100 -0
  53. data/ext/qml/lib/libqmlbind/qmlbind/qmlbind.pro +62 -0
  54. data/ext/qml/lib/libqmlbind/qmlbind/src/api_application.cpp +103 -0
  55. data/ext/qml/lib/libqmlbind/qmlbind/src/api_component.cpp +54 -0
  56. data/ext/qml/lib/libqmlbind/qmlbind/src/api_engine.cpp +65 -0
  57. data/ext/qml/lib/libqmlbind/qmlbind/src/api_exporter.cpp +52 -0
  58. data/ext/qml/lib/libqmlbind/qmlbind/src/api_interface.cpp +19 -0
  59. data/ext/qml/lib/libqmlbind/qmlbind/src/api_iterator.cpp +32 -0
  60. data/ext/qml/lib/libqmlbind/qmlbind/src/api_metaobject.cpp +19 -0
  61. data/ext/qml/lib/libqmlbind/qmlbind/src/api_plugin.cpp +27 -0
  62. data/ext/qml/lib/libqmlbind/qmlbind/src/api_register.cpp +17 -0
  63. data/ext/qml/lib/libqmlbind/qmlbind/src/api_signal_emitter.cpp +27 -0
  64. data/ext/qml/lib/libqmlbind/qmlbind/src/api_string.cpp +22 -0
  65. data/ext/qml/lib/libqmlbind/qmlbind/src/api_value.cpp +215 -0
  66. data/ext/qml/lib/libqmlbind/qmlbind/src/backref.cpp +54 -0
  67. data/ext/qml/lib/libqmlbind/qmlbind/src/backref.h +29 -0
  68. data/ext/qml/lib/libqmlbind/qmlbind/src/engine.cpp +32 -0
  69. data/ext/qml/lib/libqmlbind/qmlbind/src/engine.h +27 -0
  70. data/ext/qml/lib/libqmlbind/qmlbind/src/exporter.cpp +73 -0
  71. data/ext/qml/lib/libqmlbind/qmlbind/src/exporter.h +46 -0
  72. data/ext/qml/lib/libqmlbind/qmlbind/src/interface.cpp +75 -0
  73. data/ext/qml/lib/libqmlbind/qmlbind/src/interface.h +37 -0
  74. data/ext/qml/lib/libqmlbind/qmlbind/src/metaobject.cpp +101 -0
  75. data/ext/qml/lib/libqmlbind/qmlbind/src/metaobject.h +29 -0
  76. data/ext/qml/lib/libqmlbind/qmlbind/src/signalemitter.cpp +33 -0
  77. data/ext/qml/lib/libqmlbind/qmlbind/src/signalemitter.h +25 -0
  78. data/ext/qml/lib/libqmlbind/qmlbind/src/ticktimer.cpp +15 -0
  79. data/ext/qml/lib/libqmlbind/qmlbind/src/ticktimer.h +19 -0
  80. data/ext/qml/lib/libqmlbind/qmlbind/src/typeregisterer.cpp +112 -0
  81. data/ext/qml/lib/libqmlbind/qmlbind/src/typeregisterer.h +28 -0
  82. data/ext/qml/lib/libqmlbind/qmlbind/src/util.h +13 -0
  83. data/ext/qml/lib/libqmlbind/qmlbind/src/wrapper.cpp +23 -0
  84. data/ext/qml/lib/libqmlbind/qmlbind/src/wrapper.h +29 -0
  85. data/ext/qml/lib/libqmlbind/readme.md +14 -0
  86. data/ext/qml/lib/libqmlbind/test/api.c +1 -0
  87. data/ext/qml/lib/libqmlbind/test/application_test.cpp +16 -0
  88. data/ext/qml/lib/libqmlbind/test/component_test.cpp +57 -0
  89. data/ext/qml/lib/libqmlbind/test/engine_test.cpp +94 -0
  90. data/ext/qml/lib/libqmlbind/test/exporter_test.cpp +312 -0
  91. data/ext/qml/lib/libqmlbind/test/fixtures/emptyhandlers.cpp +36 -0
  92. data/ext/qml/lib/libqmlbind/test/fixtures/emptyhandlers.h +6 -0
  93. data/ext/qml/lib/libqmlbind/test/fixtures/test.qml +5 -0
  94. data/ext/qml/lib/libqmlbind/test/fixtures/testmodule/qmldir +2 -0
  95. data/ext/qml/lib/libqmlbind/test/fixtures/testmodule/test.qml +5 -0
  96. data/ext/qml/lib/libqmlbind/test/iterator_test.cpp +37 -0
  97. data/ext/qml/lib/libqmlbind/test/main.cpp +11 -0
  98. data/ext/qml/lib/libqmlbind/test/plugin_test.cpp +41 -0
  99. data/ext/qml/lib/libqmlbind/test/test.pro +26 -0
  100. data/ext/qml/lib/libqmlbind/test/test_helper.h +20 -0
  101. data/ext/qml/lib/libqmlbind/test/value_test.cpp +252 -0
  102. data/ext/qml/lib/libqmlbind/testplugin/testplugin.cpp +11 -0
  103. data/ext/qml/lib/libqmlbind/testplugin/testplugin.h +21 -0
  104. data/ext/qml/lib/libqmlbind/testplugin/testplugin.json +3 -0
  105. data/ext/qml/lib/libqmlbind/testplugin/testplugin.pro +21 -0
  106. data/ext/qml/meta_object.c +81 -0
  107. data/ext/qml/meta_object.h +8 -0
  108. data/ext/qml/plugin_loader.c +71 -0
  109. data/ext/qml/plugin_loader.h +7 -0
  110. data/ext/qml/qml.c +95 -0
  111. data/ext/qml/qml.h +10 -0
  112. data/ext/qml/rubyqml-plugin/listmodel.cpp +102 -0
  113. data/ext/qml/rubyqml-plugin/listmodel.h +37 -0
  114. data/ext/qml/rubyqml-plugin/rubyqml-plugin.pro +19 -0
  115. data/ext/qml/rubyqml-plugin/rubyqmlplugin.cpp +25 -0
  116. data/ext/qml/rubyqml-plugin/rubyqmlplugin.h +19 -0
  117. data/ext/qml/signal_emitter.c +71 -0
  118. data/ext/qml/signal_emitter.h +9 -0
  119. data/lib/qml.rb +11 -10
  120. data/lib/qml/access.rb +64 -86
  121. data/lib/qml/application.rb +20 -71
  122. data/lib/qml/component.rb +41 -33
  123. data/lib/qml/core_ext.rb +1 -0
  124. data/lib/qml/core_ext/to_qml.rb +70 -0
  125. data/lib/qml/data.rb +1 -0
  126. data/lib/qml/data/array_model.rb +99 -101
  127. data/lib/qml/data/list_model.rb +107 -131
  128. data/lib/qml/data/list_model_access.rb +44 -0
  129. data/lib/qml/data/query_model.rb +45 -47
  130. data/lib/qml/dispatcher.rb +5 -13
  131. data/lib/qml/engine.rb +9 -58
  132. data/lib/qml/errors.rb +0 -21
  133. data/lib/qml/interface.rb +21 -0
  134. data/lib/qml/js_array.rb +8 -0
  135. data/lib/qml/js_object.rb +69 -0
  136. data/lib/qml/js_util.rb +18 -0
  137. data/lib/qml/plugin_loader.rb +1 -13
  138. data/lib/qml/plugins.rb +3 -17
  139. data/lib/qml/proc_access.rb +28 -0
  140. data/lib/qml/qt.rb +21 -3
  141. data/lib/qml/reactive.rb +147 -8
  142. data/lib/qml/signal.rb +67 -0
  143. data/lib/qml/version.rb +1 -1
  144. data/qml.gemspec +8 -2
  145. data/spec/qml/access_spec.rb +33 -120
  146. data/spec/qml/application_spec.rb +11 -24
  147. data/spec/qml/component_spec.rb +4 -4
  148. data/spec/qml/data/array_model_spec.rb +2 -2
  149. data/spec/qml/data/list_model_spec.rb +2 -2
  150. data/spec/qml/data/query_model_spec.rb +4 -4
  151. data/spec/qml/engine_spec.rb +23 -21
  152. data/spec/qml/interface_spec.rb +20 -0
  153. data/spec/qml/js_array_spec.rb +29 -0
  154. data/spec/qml/js_function_spec.rb +32 -0
  155. data/spec/qml/js_object_spec.rb +113 -0
  156. data/spec/qml/plugin_loader_spec.rb +9 -11
  157. data/spec/qml/qt_spec.rb +9 -0
  158. data/spec/qml/reactive_spec.rb +37 -0
  159. data/spec/qml/signal_connect_spec.rb +27 -0
  160. data/spec/qml/signal_spec.rb +73 -0
  161. data/spec/qml/to_qml_spec.rb +76 -0
  162. data/spec/shared/qml/access_example.rb +21 -0
  163. data/spec/shared/qml/data/list_model.rb +12 -13
  164. data/spec/spec_helper.rb +2 -3
  165. metadata +141 -166
  166. data/examples/imageprovider/imageprovider.rb +0 -57
  167. data/examples/imageprovider/main.qml +0 -51
  168. data/ext/qml/accessclass.cpp +0 -65
  169. data/ext/qml/accessclass.h +0 -19
  170. data/ext/qml/accessobject.cpp +0 -30
  171. data/ext/qml/accessobject.h +0 -22
  172. data/ext/qml/common.h +0 -18
  173. data/ext/qml/conversionerror.h +0 -14
  174. data/ext/qml/ext_accesswrapperfactory.cpp +0 -75
  175. data/ext/qml/ext_accesswrapperfactory.h +0 -39
  176. data/ext/qml/ext_anywrapper.cpp +0 -34
  177. data/ext/qml/ext_anywrapper.h +0 -23
  178. data/ext/qml/ext_kernel.cpp +0 -81
  179. data/ext/qml/ext_kernel.h +0 -9
  180. data/ext/qml/ext_metaobject.cpp +0 -399
  181. data/ext/qml/ext_metaobject.h +0 -60
  182. data/ext/qml/ext_pluginloader.cpp +0 -53
  183. data/ext/qml/ext_pluginloader.h +0 -30
  184. data/ext/qml/ext_pointer.cpp +0 -132
  185. data/ext/qml/ext_pointer.h +0 -41
  186. data/ext/qml/ext_testutil.cpp +0 -40
  187. data/ext/qml/ext_testutil.h +0 -9
  188. data/ext/qml/foreignclass.cpp +0 -72
  189. data/ext/qml/foreignclass.h +0 -88
  190. data/ext/qml/foreignmetaobject.cpp +0 -345
  191. data/ext/qml/foreignmetaobject.h +0 -46
  192. data/ext/qml/foreignobject.cpp +0 -22
  193. data/ext/qml/foreignobject.h +0 -21
  194. data/ext/qml/functioninfo.h +0 -16
  195. data/ext/qml/init.cpp +0 -67
  196. data/ext/qml/kernel.cpp +0 -39
  197. data/ext/qml/kernel.h +0 -32
  198. data/ext/qml/listmodel.cpp +0 -137
  199. data/ext/qml/listmodel.h +0 -45
  200. data/ext/qml/markable.h +0 -12
  201. data/ext/qml/objectdata.cpp +0 -26
  202. data/ext/qml/objectdata.h +0 -20
  203. data/ext/qml/objectgc.cpp +0 -69
  204. data/ext/qml/objectgc.h +0 -28
  205. data/ext/qml/plugins/core/applicationextension.cpp +0 -29
  206. data/ext/qml/plugins/core/applicationextension.h +0 -25
  207. data/ext/qml/plugins/core/componentextension.cpp +0 -41
  208. data/ext/qml/plugins/core/componentextension.h +0 -28
  209. data/ext/qml/plugins/core/contextextension.cpp +0 -39
  210. data/ext/qml/plugins/core/contextextension.h +0 -29
  211. data/ext/qml/plugins/core/core.pro +0 -29
  212. data/ext/qml/plugins/core/coreplugin.cpp +0 -87
  213. data/ext/qml/plugins/core/coreplugin.h +0 -49
  214. data/ext/qml/plugins/core/engineextension.cpp +0 -43
  215. data/ext/qml/plugins/core/engineextension.h +0 -31
  216. data/ext/qml/plugins/core/imageprovider.cpp +0 -38
  217. data/ext/qml/plugins/core/imageprovider.h +0 -18
  218. data/ext/qml/plugins/core/imagerequestpromise.cpp +0 -19
  219. data/ext/qml/plugins/core/imagerequestpromise.h +0 -21
  220. data/ext/qml/plugins/core/qmlexception.cpp +0 -11
  221. data/ext/qml/plugins/core/qmlexception.h +0 -17
  222. data/ext/qml/plugins/testutil/imageprovidertest.cpp +0 -40
  223. data/ext/qml/plugins/testutil/imageprovidertest.h +0 -17
  224. data/ext/qml/plugins/testutil/objectlifechecker.cpp +0 -17
  225. data/ext/qml/plugins/testutil/objectlifechecker.h +0 -24
  226. data/ext/qml/plugins/testutil/ownershiptest.cpp +0 -26
  227. data/ext/qml/plugins/testutil/ownershiptest.h +0 -30
  228. data/ext/qml/plugins/testutil/testobject.cpp +0 -6
  229. data/ext/qml/plugins/testutil/testobject.h +0 -108
  230. data/ext/qml/plugins/testutil/testobjectsubclass.cpp +0 -10
  231. data/ext/qml/plugins/testutil/testobjectsubclass.h +0 -19
  232. data/ext/qml/plugins/testutil/testutil.pro +0 -22
  233. data/ext/qml/plugins/testutil/testutilplugin.cpp +0 -55
  234. data/ext/qml/plugins/testutil/testutilplugin.h +0 -36
  235. data/ext/qml/qmltyperegisterer.cpp +0 -74
  236. data/ext/qml/qmltyperegisterer.h +0 -30
  237. data/ext/qml/rubyclass.cpp +0 -82
  238. data/ext/qml/rubyclass.h +0 -230
  239. data/ext/qml/rubyvalue.cpp +0 -656
  240. data/ext/qml/rubyvalue.h +0 -224
  241. data/ext/qml/signalforwarder.cpp +0 -64
  242. data/ext/qml/signalforwarder.h +0 -29
  243. data/ext/qml/util.cpp +0 -112
  244. data/ext/qml/util.h +0 -82
  245. data/ext/qml/valuereference.cpp +0 -50
  246. data/ext/qml/valuereference.h +0 -22
  247. data/ext/qml/weakvaluereference.cpp +0 -51
  248. data/ext/qml/weakvaluereference.h +0 -21
  249. data/lib/qml/context.rb +0 -71
  250. data/lib/qml/data/error.rb +0 -5
  251. data/lib/qml/dispatchable.rb +0 -34
  252. data/lib/qml/error_converter.rb +0 -16
  253. data/lib/qml/geometry.rb +0 -3
  254. data/lib/qml/geometry/point.rb +0 -5
  255. data/lib/qml/geometry/rectangle.rb +0 -5
  256. data/lib/qml/geometry/size.rb +0 -5
  257. data/lib/qml/image_provider.rb +0 -87
  258. data/lib/qml/init.rb +0 -29
  259. data/lib/qml/meta_object.rb +0 -20
  260. data/lib/qml/models.rb +0 -1
  261. data/lib/qml/qt_classes.rb +0 -9
  262. data/lib/qml/qt_object_base.rb +0 -233
  263. data/lib/qml/reactive/bindable.rb +0 -79
  264. data/lib/qml/reactive/chained_signal.rb +0 -25
  265. data/lib/qml/reactive/error.rb +0 -5
  266. data/lib/qml/reactive/object.rb +0 -293
  267. data/lib/qml/reactive/property.rb +0 -19
  268. data/lib/qml/reactive/signal.rb +0 -115
  269. data/lib/qml/reactive/signal_spy.rb +0 -27
  270. data/lib/qml/reactive/signals/map_signal.rb +0 -21
  271. data/lib/qml/reactive/signals/merge_signal.rb +0 -21
  272. data/lib/qml/reactive/signals/select_signal.rb +0 -21
  273. data/lib/qml/reactive/simple_property.rb +0 -17
  274. data/lib/qml/reactive/unbound_property.rb +0 -42
  275. data/lib/qml/reactive/unbound_signal.rb +0 -51
  276. data/lib/qml/test_util.rb +0 -1
  277. data/lib/qml/test_util/object_life_checker.rb +0 -17
  278. data/lib/qml/wrappable.rb +0 -9
  279. data/spec/qml/context_spec.rb +0 -43
  280. data/spec/qml/conversion_spec.rb +0 -60
  281. data/spec/qml/dispatchable_spec.rb +0 -26
  282. data/spec/qml/dispatcher_spec.rb +0 -71
  283. data/spec/qml/geometry/point_spec.rb +0 -4
  284. data/spec/qml/geometry/rectangle_spec.rb +0 -4
  285. data/spec/qml/geometry/size_spec.rb +0 -4
  286. data/spec/qml/image_provider_spec.rb +0 -33
  287. data/spec/qml/qt_object_base_spec.rb +0 -119
  288. data/spec/qml/reactive/object_spec.rb +0 -249
  289. data/spec/qml/reactive/property_spec.rb +0 -70
  290. data/spec/qml/reactive/signal_spec.rb +0 -191
  291. data/spec/qml/reactive/signal_spy_spec.rb +0 -26
  292. data/spec/qml/reactive/unbound_property_spec.rb +0 -40
  293. data/spec/qml/reactive/unbound_signal_spec.rb +0 -70
  294. data/spec/qml/test_object_spec.rb +0 -186
  295. data/spec/qml/wrappable_spec.rb +0 -10
  296. data/spec/shared/qml/reactive/object.rb +0 -39
@@ -0,0 +1,7 @@
1
+ #pragma once
2
+
3
+ #include "js_object.h"
4
+
5
+ extern VALUE rbqml_cJSWrapper;
6
+
7
+ void rbqml_init_js_wrapper(void);
@@ -0,0 +1,38 @@
1
+ # Created by https://www.gitignore.io
2
+
3
+ ### Qt ###
4
+ # C++ objects and libs
5
+
6
+ *.slo
7
+ *.lo
8
+ *.o
9
+ *.a
10
+ *.la
11
+ *.lai
12
+ *.so
13
+ *.dll
14
+ *.dylib
15
+
16
+ # Qt-es
17
+
18
+ /.qmake.cache
19
+ /.qmake.stash
20
+ *.pro.user
21
+ *.pro.user.*
22
+ *.moc
23
+ moc_*.cpp
24
+ qrc_*.cpp
25
+ ui_*.h
26
+ Makefile*
27
+ *-build-*
28
+ .qmake.stash
29
+
30
+ # QtCreator
31
+
32
+ *.autosave
33
+
34
+ #QtCtreator Qml
35
+ *.qmlproject.user
36
+ *.qmlproject.user.*
37
+
38
+ /test/test
@@ -0,0 +1,3 @@
1
+ [submodule "test/lib/Catch"]
2
+ path = test/lib/Catch
3
+ url = https://github.com/philsquared/Catch.git
@@ -0,0 +1,14 @@
1
+ language: cpp
2
+ compiler:
3
+ - clang
4
+ before_install:
5
+ - sudo apt-add-repository -y ppa:beineri/opt-qt541
6
+ - sudo apt-get update
7
+ - sudo apt-get install -y qt54base qt54declarative
8
+ script:
9
+ - source /opt/qt54/bin/qt54-env.sh
10
+ - qmake -r QMAKE_CC=$CC QMAKE_CXX=$CXX
11
+ - make
12
+ - export LD_LIBRARY_PATH=$PWD/qmlbind
13
+ - cd ./test
14
+ - ./test -platform offscreen
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014-2015 Ryohei Ikegami
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,3 @@
1
+ TEMPLATE = subdirs
2
+ SUBDIRS = qmlbind test \
3
+ testplugin
@@ -0,0 +1,14 @@
1
+ #pragma once
2
+
3
+ #include "qmlbind/application.h"
4
+ #include "qmlbind/component.h"
5
+ #include "qmlbind/engine.h"
6
+ #include "qmlbind/interface.h"
7
+ #include "qmlbind/exporter.h"
8
+ #include "qmlbind/iterator.h"
9
+ #include "qmlbind/metaobject.h"
10
+ #include "qmlbind/plugin.h"
11
+ #include "qmlbind/signal_emitter.h"
12
+ #include "qmlbind/string.h"
13
+ #include "qmlbind/value.h"
14
+ #include "qmlbind/register.h"
@@ -0,0 +1,18 @@
1
+ #pragma once
2
+
3
+ #include "qmlbind_global.h"
4
+
5
+ #ifdef __cplusplus
6
+ extern "C" {
7
+ #endif
8
+
9
+ QMLBIND_API qmlbind_application qmlbind_application_new(int argc, char **argv);
10
+ QMLBIND_API void qmlbind_application_release(qmlbind_application app);
11
+ QMLBIND_API int qmlbind_application_exec(qmlbind_application app);
12
+
13
+ QMLBIND_API void qmlbind_process_events();
14
+ QMLBIND_API void qmlbind_set_tick_callback(void (*func)());
15
+
16
+ #ifdef __cplusplus
17
+ }
18
+ #endif
@@ -0,0 +1,21 @@
1
+ #pragma once
2
+
3
+ #include "qmlbind_global.h"
4
+
5
+ #ifdef __cplusplus
6
+ extern "C" {
7
+ #endif
8
+
9
+ QMLBIND_API qmlbind_component qmlbind_component_new(qmlbind_engine engine);
10
+ QMLBIND_API void qmlbind_component_release(qmlbind_component component);
11
+
12
+ QMLBIND_API void qmlbind_component_load_path(qmlbind_component component, const char *path);
13
+ QMLBIND_API void qmlbind_component_set_data(qmlbind_component component, const char *data, const char *path);
14
+
15
+ QMLBIND_API qmlbind_string qmlbind_component_get_error_string(qmlbind_component component);
16
+
17
+ QMLBIND_API qmlbind_value qmlbind_component_create(qmlbind_component component);
18
+
19
+ #ifdef __cplusplus
20
+ }
21
+ #endif
@@ -0,0 +1,34 @@
1
+ #pragma once
2
+
3
+ #include "qmlbind_global.h"
4
+
5
+ #ifdef __cplusplus
6
+ extern "C" {
7
+ #endif
8
+
9
+ QMLBIND_API qmlbind_engine qmlbind_engine_new();
10
+ QMLBIND_API void qmlbind_engine_release(qmlbind_engine engine);
11
+
12
+ QMLBIND_API qmlbind_value qmlbind_engine_eval(
13
+ qmlbind_engine engine,
14
+ const char *str, const char *file, int lineNumber
15
+ );
16
+
17
+ QMLBIND_API qmlbind_value qmlbind_engine_get_global_object(qmlbind_engine engine);
18
+
19
+ QMLBIND_API qmlbind_value qmlbind_engine_new_object(qmlbind_engine engine);
20
+ QMLBIND_API qmlbind_value qmlbind_engine_new_array(qmlbind_engine engine, int length);
21
+
22
+ QMLBIND_API qmlbind_value qmlbind_engine_new_wrapper(
23
+ qmlbind_engine engine,
24
+ qmlbind_metaobject metaobj,
25
+ qmlbind_backref ref
26
+ );
27
+
28
+ QMLBIND_API void qmlbind_engine_add_import_path(qmlbind_engine engine, const char *path);
29
+
30
+ QMLBIND_API void qmlbind_engine_collect_garbage(qmlbind_engine engine);
31
+
32
+ #ifdef __cplusplus
33
+ }
34
+ #endif
@@ -0,0 +1,37 @@
1
+ #pragma once
2
+ #include "qmlbind_global.h"
3
+
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+ QMLBIND_API qmlbind_exporter qmlbind_exporter_new(
9
+ qmlbind_backref classHandle,
10
+ const char *className,
11
+ qmlbind_interface interface
12
+ );
13
+
14
+ QMLBIND_API void qmlbind_exporter_release(qmlbind_exporter exporter);
15
+
16
+ QMLBIND_API int qmlbind_exporter_add_method(
17
+ qmlbind_exporter exporter,
18
+ const char *name,
19
+ int arity
20
+ );
21
+
22
+ QMLBIND_API int qmlbind_exporter_add_signal(
23
+ qmlbind_exporter exporter,
24
+ const char *name,
25
+ int arity,
26
+ const char **params
27
+ );
28
+
29
+ QMLBIND_API int qmlbind_exporter_add_property(
30
+ qmlbind_exporter exporter,
31
+ const char *name,
32
+ const char *notifierSignal
33
+ );
34
+
35
+ #ifdef __cplusplus
36
+ }
37
+ #endif
@@ -0,0 +1,16 @@
1
+ #pragma once
2
+ #include "qmlbind_global.h"
3
+
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+ QMLBIND_API qmlbind_interface qmlbind_interface_new(
9
+ qmlbind_interface_handlers handlers
10
+ );
11
+
12
+ QMLBIND_API void qmlbind_interface_release(qmlbind_interface interface);
13
+
14
+ #ifdef __cplusplus
15
+ }
16
+ #endif
@@ -0,0 +1,19 @@
1
+ #pragma once
2
+ #include "qmlbind_global.h"
3
+
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+ QMLBIND_API qmlbind_iterator qmlbind_iterator_new(qmlbind_value object);
9
+ QMLBIND_API void qmlbind_iterator_release(qmlbind_iterator self);
10
+
11
+ QMLBIND_API qmlbind_string qmlbind_iterator_get_key(qmlbind_iterator self);
12
+ QMLBIND_API qmlbind_value qmlbind_iterator_get_value(qmlbind_iterator self);
13
+
14
+ QMLBIND_API void qmlbind_iterator_next(qmlbind_iterator self);
15
+ QMLBIND_API int qmlbind_iterator_has_next(qmlbind_iterator self);
16
+
17
+ #ifdef __cplusplus
18
+ }
19
+ #endif
@@ -0,0 +1,13 @@
1
+ #pragma once
2
+ #include "qmlbind_global.h"
3
+
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+ QMLBIND_API qmlbind_metaobject qmlbind_metaobject_new(qmlbind_exporter exporter);
9
+ QMLBIND_API void qmlbind_metaobject_release(qmlbind_metaobject metaobject);
10
+
11
+ #ifdef __cplusplus
12
+ }
13
+ #endif
@@ -0,0 +1,17 @@
1
+ #pragma once
2
+
3
+ #include "qmlbind_global.h"
4
+
5
+ #ifdef __cplusplus
6
+ extern "C" {
7
+ #endif
8
+
9
+ QMLBIND_API qmlbind_plugin qmlbind_plugin_new(const char *filename);
10
+ QMLBIND_API void qmlbind_plugin_release(qmlbind_plugin plugin);
11
+
12
+ QMLBIND_API qmlbind_string qmlbind_plugin_get_error_string(qmlbind_plugin plugin);
13
+ QMLBIND_API qmlbind_value qmlbind_plugin_get_instance(qmlbind_plugin plugin, qmlbind_engine engine);
14
+
15
+ #ifdef __cplusplus
16
+ }
17
+ #endif
@@ -0,0 +1,78 @@
1
+ #pragma once
2
+
3
+ # if defined(_WIN32) || defined(_WIN64)
4
+ # ifdef QMLBIND_LIBRARY
5
+ # define QMLBIND_API __declspec(dllexport)
6
+ # else
7
+ # define QMLBIND_API __declspec(dllimport)
8
+ # endif
9
+ # else
10
+ # define QMLBIND_API
11
+ # endif
12
+
13
+ #ifdef QMLBIND_LIBRARY
14
+
15
+ template <typename T> class QSharedPointer;
16
+ class QApplication;
17
+ class QQmlComponent;
18
+ class QJSValue;
19
+ class QJSValueIterator;
20
+ class QByteArray;
21
+ class QPluginLoader;
22
+
23
+ namespace QmlBind {
24
+
25
+ class Engine;
26
+ class Interface;
27
+ class MetaObject;
28
+ class Exporter;
29
+ class SignalEmitter;
30
+
31
+ }
32
+
33
+ typedef QApplication *qmlbind_application;
34
+
35
+ typedef QmlBind::Engine *qmlbind_engine;
36
+ typedef QQmlComponent *qmlbind_component;
37
+ typedef QPluginLoader *qmlbind_plugin;
38
+
39
+ typedef QJSValue *qmlbind_value;
40
+ typedef QJSValueIterator *qmlbind_iterator;
41
+ typedef QByteArray *qmlbind_string;
42
+
43
+ // Use shared pointer for widely referenced classes
44
+ typedef QSharedPointer<QmlBind::Interface> *qmlbind_interface;
45
+ typedef QSharedPointer<QmlBind::MetaObject> *qmlbind_metaobject;
46
+ typedef QSharedPointer<QmlBind::Exporter> *qmlbind_exporter;
47
+
48
+ typedef QmlBind::SignalEmitter *qmlbind_signal_emitter;
49
+
50
+ #else
51
+
52
+ typedef struct {} *qmlbind_application;
53
+
54
+ typedef struct {} *qmlbind_engine;
55
+ typedef struct {} *qmlbind_component;
56
+ typedef struct {} *qmlbind_plugin;
57
+
58
+ typedef struct {} *qmlbind_value;
59
+ typedef struct {} *qmlbind_iterator;
60
+ typedef struct {} *qmlbind_string;
61
+
62
+ typedef struct {} *qmlbind_interface;
63
+ typedef struct {} *qmlbind_metaobject;
64
+ typedef struct {} *qmlbind_exporter;
65
+
66
+ typedef struct {} *qmlbind_signal_emitter;
67
+
68
+ #endif
69
+
70
+ typedef struct qmlbind_backref_s *qmlbind_backref;
71
+
72
+ typedef struct {
73
+ qmlbind_backref (*new_object)(qmlbind_backref classRef, qmlbind_signal_emitter signalEmitter);
74
+ void (*delete_object)(qmlbind_backref objRef);
75
+ qmlbind_value (*call_method)(qmlbind_engine engine, qmlbind_backref objRef, const char *name, int argc, qmlbind_value *argv);
76
+ qmlbind_value (*get_property)(qmlbind_engine engine, qmlbind_backref objRef, const char *name);
77
+ void (*set_property)(qmlbind_engine engine, qmlbind_backref objRef, const char *name, qmlbind_value value);
78
+ } qmlbind_interface_handlers;
@@ -0,0 +1,17 @@
1
+ #pragma once
2
+ #include "qmlbind_global.h"
3
+
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+ QMLBIND_API int qmlbind_register_type(
9
+ qmlbind_metaobject metaobjet,
10
+ const char *uri,
11
+ int versionMajor, int versionMinor,
12
+ const char *qmlName
13
+ );
14
+
15
+ #ifdef __cplusplus
16
+ }
17
+ #endif
@@ -0,0 +1,15 @@
1
+ #pragma once
2
+
3
+ #include "qmlbind_global.h"
4
+
5
+ #ifdef __cplusplus
6
+ extern "C" {
7
+ #endif
8
+
9
+ QMLBIND_API void qmlbind_signal_emitter_emit(qmlbind_signal_emitter emitter, const char *signal_name, int argc, qmlbind_value *argv);
10
+ QMLBIND_API qmlbind_engine qmlbind_signal_emitter_get_engine(qmlbind_signal_emitter emitter);
11
+ QMLBIND_API void qmlbind_signal_emitter_release(qmlbind_signal_emitter emitter);
12
+
13
+ #ifdef __cplusplus
14
+ }
15
+ #endif
@@ -0,0 +1,15 @@
1
+ #pragma once
2
+
3
+ #include "qmlbind_global.h"
4
+
5
+ #ifdef __cplusplus
6
+ extern "C" {
7
+ #endif
8
+
9
+ QMLBIND_API char *qmlbind_string_get_chars(qmlbind_string str);
10
+ QMLBIND_API int qmlbind_string_get_length(qmlbind_string str);
11
+ QMLBIND_API void qmlbind_string_release(qmlbind_string str);
12
+
13
+ #ifdef __cplusplus
14
+ }
15
+ #endif
@@ -0,0 +1,100 @@
1
+ #pragma once
2
+ #include "qmlbind_global.h"
3
+ #include <time.h>
4
+ #include <stdlib.h>
5
+
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ typedef enum {
11
+ QMLBIND_PROPERTY_WRITABLE = 1,
12
+ QMLBIND_PROPERTY_CONFIGURABLE = 1 << 1,
13
+ QMLBIND_PROPERTY_ENUMERABLE = 1 << 2
14
+ } qmlbind_property_option;
15
+
16
+ /* basic */
17
+
18
+ QMLBIND_API qmlbind_value qmlbind_value_new_undefined();
19
+ QMLBIND_API qmlbind_value qmlbind_value_new_null();
20
+ QMLBIND_API void qmlbind_value_release(qmlbind_value self);
21
+ QMLBIND_API qmlbind_value qmlbind_value_clone(qmlbind_value self);
22
+
23
+ QMLBIND_API int qmlbind_value_is_equal(qmlbind_value value1, qmlbind_value value2);
24
+ QMLBIND_API int qmlbind_value_is_identical(qmlbind_value value1, qmlbind_value value2);
25
+
26
+ QMLBIND_API int qmlbind_value_is_undefined(qmlbind_value self);
27
+ QMLBIND_API int qmlbind_value_is_null(qmlbind_value self);
28
+ QMLBIND_API int qmlbind_value_is_boolean(qmlbind_value self);
29
+ QMLBIND_API int qmlbind_value_is_number(qmlbind_value self);
30
+ QMLBIND_API int qmlbind_value_is_string(qmlbind_value self);
31
+ QMLBIND_API int qmlbind_value_is_object(qmlbind_value self);
32
+
33
+ QMLBIND_API int qmlbind_value_is_array(qmlbind_value self);
34
+ QMLBIND_API int qmlbind_value_is_function(qmlbind_value self);
35
+ QMLBIND_API int qmlbind_value_is_error(qmlbind_value self);
36
+
37
+ QMLBIND_API int qmlbind_value_is_wrapper(qmlbind_value self);
38
+
39
+ /* boolean */
40
+
41
+ QMLBIND_API qmlbind_value qmlbind_value_new_boolean(int x);
42
+ QMLBIND_API int qmlbind_value_get_boolean(qmlbind_value self);
43
+
44
+ /* number */
45
+
46
+ QMLBIND_API qmlbind_value qmlbind_value_new_number(double x);
47
+ QMLBIND_API double qmlbind_value_get_number(qmlbind_value self);
48
+
49
+ /* string */
50
+
51
+ QMLBIND_API qmlbind_value qmlbind_value_new_string(int len, const char *str);
52
+ QMLBIND_API qmlbind_value qmlbind_value_new_string_cstr(const char *str);
53
+ QMLBIND_API qmlbind_string qmlbind_value_get_string(qmlbind_value self);
54
+
55
+ /* object (see also: engine.h) */
56
+
57
+ QMLBIND_API qmlbind_value qmlbind_value_get_property(qmlbind_value self, const char *key);
58
+ QMLBIND_API void qmlbind_value_set_property(qmlbind_value self, const char *key, qmlbind_value value);
59
+
60
+ QMLBIND_API int qmlbind_value_delete_property(qmlbind_value value, const char *key);
61
+ QMLBIND_API int qmlbind_value_has_property(qmlbind_value value, const char *key);
62
+ QMLBIND_API int qmlbind_value_has_index(qmlbind_value value, int index);
63
+ QMLBIND_API int qmlbind_value_has_own_property(qmlbind_value value, const char *key);
64
+
65
+ QMLBIND_API qmlbind_value qmlbind_value_get_prototype(qmlbind_value value);
66
+ QMLBIND_API void qmlbind_value_set_prototype(qmlbind_value value, qmlbind_value proto);
67
+
68
+ /* array */
69
+
70
+ QMLBIND_API qmlbind_value qmlbind_value_get_array_item(qmlbind_value value, int index);
71
+ QMLBIND_API void qmlbind_value_set_array_item(qmlbind_value value, int index, qmlbind_value property);
72
+
73
+ /* function */
74
+
75
+ QMLBIND_API qmlbind_value qmlbind_value_call(
76
+ qmlbind_value self,
77
+ int argc,
78
+ qmlbind_value *argv
79
+ );
80
+
81
+ QMLBIND_API qmlbind_value qmlbind_value_call_constructor(
82
+ qmlbind_value function,
83
+ int argc,
84
+ qmlbind_value *argv
85
+ );
86
+
87
+ QMLBIND_API qmlbind_value qmlbind_value_call_with_instance(
88
+ qmlbind_value self,
89
+ qmlbind_value instance,
90
+ int argc,
91
+ qmlbind_value *argv
92
+ );
93
+
94
+ /* wrapper */
95
+
96
+ QMLBIND_API qmlbind_backref qmlbind_value_get_backref(qmlbind_value self);
97
+
98
+ #ifdef __cplusplus
99
+ }
100
+ #endif