slikui-python 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. slikui_python-0.1.1/.github/workflows/cpp.yml +79 -0
  2. slikui_python-0.1.1/.github/workflows/python.yml +128 -0
  3. slikui_python-0.1.1/.gitignore +14 -0
  4. slikui_python-0.1.1/CMakeLists.txt +71 -0
  5. slikui_python-0.1.1/LICENSE +21 -0
  6. slikui_python-0.1.1/PKG-INFO +112 -0
  7. slikui_python-0.1.1/README.md +372 -0
  8. slikui_python-0.1.1/cmake/slikuiConfig.cmake.in +8 -0
  9. slikui_python-0.1.1/compile_flags.txt +9 -0
  10. slikui_python-0.1.1/dist/slikui.hpp +18749 -0
  11. slikui_python-0.1.1/dist/slikui_default_font.hpp +1492 -0
  12. slikui_python-0.1.1/docs/architecture.md +114 -0
  13. slikui_python-0.1.1/docs/backend-contract.md +118 -0
  14. slikui_python-0.1.1/docs/images/buttons.png +0 -0
  15. slikui_python-0.1.1/docs/images/containers.png +0 -0
  16. slikui_python-0.1.1/docs/images/cube_viewer.png +0 -0
  17. slikui_python-0.1.1/docs/images/image.png +0 -0
  18. slikui_python-0.1.1/docs/images/inputs.png +0 -0
  19. slikui_python-0.1.1/docs/images/labels.png +0 -0
  20. slikui_python-0.1.1/docs/images/layout.png +0 -0
  21. slikui_python-0.1.1/docs/images/sliders.png +0 -0
  22. slikui_python-0.1.1/docs/images/themes.png +0 -0
  23. slikui_python-0.1.1/docs/images/toggles.png +0 -0
  24. slikui_python-0.1.1/docs/images/tooltip.png +0 -0
  25. slikui_python-0.1.1/docs/images/views.png +0 -0
  26. slikui_python-0.1.1/examples/01_hello/main.cpp +50 -0
  27. slikui_python-0.1.1/examples/02_raw_pixels/main.cpp +51 -0
  28. slikui_python-0.1.1/examples/03_gallery/main.cpp +149 -0
  29. slikui_python-0.1.1/examples/04_glfw_opengl/main.cpp +865 -0
  30. slikui_python-0.1.1/examples/04_glfw_software/main.cpp +132 -0
  31. slikui_python-0.1.1/examples/CMakeLists.txt +45 -0
  32. slikui_python-0.1.1/include/slikui/backends/glfw/glfw_window.hpp +240 -0
  33. slikui_python-0.1.1/include/slikui/backends/opengl/opengl.hpp +366 -0
  34. slikui_python-0.1.1/include/slikui/backends/software/software.hpp +282 -0
  35. slikui_python-0.1.1/include/slikui/context.hpp +448 -0
  36. slikui_python-0.1.1/include/slikui/core/color.hpp +73 -0
  37. slikui_python-0.1.1/include/slikui/core/input.hpp +64 -0
  38. slikui_python-0.1.1/include/slikui/core/math.hpp +86 -0
  39. slikui_python-0.1.1/include/slikui/core/time.hpp +18 -0
  40. slikui_python-0.1.1/include/slikui/core/utf8.hpp +28 -0
  41. slikui_python-0.1.1/include/slikui/layout/layout.hpp +87 -0
  42. slikui_python-0.1.1/include/slikui/render/draw_list.hpp +103 -0
  43. slikui_python-0.1.1/include/slikui/render/sink.hpp +33 -0
  44. slikui_python-0.1.1/include/slikui/slikui.hpp +28 -0
  45. slikui_python-0.1.1/include/slikui/style/anim.hpp +28 -0
  46. slikui_python-0.1.1/include/slikui/style/theme.hpp +215 -0
  47. slikui_python-0.1.1/include/slikui/text/default_font.hpp +1492 -0
  48. slikui_python-0.1.1/include/slikui/text/detail/stb_image.h +7988 -0
  49. slikui_python-0.1.1/include/slikui/text/detail/stb_rect_pack.h +623 -0
  50. slikui_python-0.1.1/include/slikui/text/detail/stb_truetype.h +5079 -0
  51. slikui_python-0.1.1/include/slikui/text/font.hpp +311 -0
  52. slikui_python-0.1.1/include/slikui/text/system_fonts.hpp +43 -0
  53. slikui_python-0.1.1/include/slikui/version.hpp +23 -0
  54. slikui_python-0.1.1/include/slikui/widgets/all.hpp +9 -0
  55. slikui_python-0.1.1/include/slikui/widgets/containers.hpp +515 -0
  56. slikui_python-0.1.1/include/slikui/widgets/controls.hpp +521 -0
  57. slikui_python-0.1.1/include/slikui/widgets/env.hpp +29 -0
  58. slikui_python-0.1.1/include/slikui/widgets/image.hpp +109 -0
  59. slikui_python-0.1.1/include/slikui/widgets/inputs.hpp +534 -0
  60. slikui_python-0.1.1/include/slikui/widgets/text.hpp +92 -0
  61. slikui_python-0.1.1/include/slikui/widgets/views.hpp +452 -0
  62. slikui_python-0.1.1/include/slikui/widgets/widget.hpp +171 -0
  63. slikui_python-0.1.1/pyproject.toml +56 -0
  64. slikui_python-0.1.1/python/CMakeLists.txt +32 -0
  65. slikui_python-0.1.1/python/README.md +86 -0
  66. slikui_python-0.1.1/python/examples/capture_check.py +162 -0
  67. slikui_python-0.1.1/python/examples/gallery.png +0 -0
  68. slikui_python-0.1.1/python/examples/gallery.ppm +4 -0
  69. slikui_python-0.1.1/python/examples/gallery.py +93 -0
  70. slikui_python-0.1.1/python/examples/glfw_demo.py +764 -0
  71. slikui_python-0.1.1/python/examples/hello.png +0 -0
  72. slikui_python-0.1.1/python/examples/hello.ppm +4 -0
  73. slikui_python-0.1.1/python/examples/hello.py +31 -0
  74. slikui_python-0.1.1/python/examples/pyrenderer_demo.py +88 -0
  75. slikui_python-0.1.1/python/slikui/__init__.py +115 -0
  76. slikui_python-0.1.1/python/slikui/_py/__init__.py +0 -0
  77. slikui_python-0.1.1/python/slikui/_py/app.py +112 -0
  78. slikui_python-0.1.1/python/slikui/_py/builder.py +37 -0
  79. slikui_python-0.1.1/python/slikui/_py/events.py +103 -0
  80. slikui_python-0.1.1/python/slikui/_py/pixels.py +17 -0
  81. slikui_python-0.1.1/python/slikui/_py/renderer.py +329 -0
  82. slikui_python-0.1.1/python/slikui/py.typed +0 -0
  83. slikui_python-0.1.1/python/src/slikui_py.cpp +753 -0
  84. slikui_python-0.1.1/python/tests/examples_glfw_demo_support.py +17 -0
  85. slikui_python-0.1.1/python/tests/test_events.py +147 -0
  86. slikui_python-0.1.1/python/tests/test_glfw_demo.py +83 -0
  87. slikui_python-0.1.1/python/tests/test_pyrenderer.py +82 -0
  88. slikui_python-0.1.1/python/tests/test_shutdown_leaks.py +43 -0
  89. slikui_python-0.1.1/python/tests/test_smoke.py +163 -0
  90. slikui_python-0.1.1/python/tests/test_version.py +31 -0
  91. slikui_python-0.1.1/python/tests/test_widgets.py +138 -0
  92. slikui_python-0.1.1/tests/CMakeLists.txt +16 -0
  93. slikui_python-0.1.1/tests/main.cpp +7 -0
  94. slikui_python-0.1.1/tests/smoke.cpp +25 -0
  95. slikui_python-0.1.1/tests/test.hpp +94 -0
  96. slikui_python-0.1.1/tests/test_core.cpp +58 -0
  97. slikui_python-0.1.1/tests/test_font.cpp +116 -0
  98. slikui_python-0.1.1/tests/test_golden.cpp +156 -0
  99. slikui_python-0.1.1/tests/test_layout.cpp +40 -0
  100. slikui_python-0.1.1/tests/test_theme.cpp +51 -0
  101. slikui_python-0.1.1/tests/test_widgets.cpp +531 -0
  102. slikui_python-0.1.1/third_party/fonts/DejaVuSans-subset.ttf +0 -0
  103. slikui_python-0.1.1/third_party/fonts/LICENSE-DejaVu.txt +187 -0
  104. slikui_python-0.1.1/third_party/fonts/README.md +34 -0
  105. slikui_python-0.1.1/third_party/nanobind/.gitignore +45 -0
  106. slikui_python-0.1.1/third_party/nanobind/.gitmodules +3 -0
  107. slikui_python-0.1.1/third_party/nanobind/.readthedocs.yaml +18 -0
  108. slikui_python-0.1.1/third_party/nanobind/CMakeLists.txt +157 -0
  109. slikui_python-0.1.1/third_party/nanobind/LICENSE +26 -0
  110. slikui_python-0.1.1/third_party/nanobind/README.md +117 -0
  111. slikui_python-0.1.1/third_party/nanobind/cmake/collect-symbols-pypy.py +29 -0
  112. slikui_python-0.1.1/third_party/nanobind/cmake/collect-symbols.py +45 -0
  113. slikui_python-0.1.1/third_party/nanobind/cmake/darwin-ld-cpython.sym +1010 -0
  114. slikui_python-0.1.1/third_party/nanobind/cmake/darwin-ld-pypy.sym +1135 -0
  115. slikui_python-0.1.1/third_party/nanobind/cmake/darwin-python-path.py +15 -0
  116. slikui_python-0.1.1/third_party/nanobind/cmake/nanobind-config.cmake +982 -0
  117. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/.clang-format +1 -0
  118. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/.codecov.yml +5 -0
  119. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/.github/workflows/ci.yml +136 -0
  120. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/CMakeLists.txt +87 -0
  121. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/LICENSE +21 -0
  122. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/README.md +521 -0
  123. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/cmake/tsl-robin-mapConfig.cmake.in +9 -0
  124. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/doxygen.conf +2483 -0
  125. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/include/tsl/robin_growth_policy.h +415 -0
  126. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/include/tsl/robin_hash.h +1589 -0
  127. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/include/tsl/robin_map.h +815 -0
  128. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/include/tsl/robin_set.h +668 -0
  129. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/tests/CMakeLists.txt +26 -0
  130. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/tests/custom_allocator_tests.cpp +138 -0
  131. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/tests/main.cpp +26 -0
  132. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/tests/policy_tests.cpp +97 -0
  133. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/tests/robin_map_tests.cpp +1462 -0
  134. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/tests/robin_set_tests.cpp +174 -0
  135. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/tests/utils.h +443 -0
  136. slikui_python-0.1.1/third_party/nanobind/ext/robin_map/tsl-robin-map.natvis +78 -0
  137. slikui_python-0.1.1/third_party/nanobind/include/nanobind/eigen/dense.h +492 -0
  138. slikui_python-0.1.1/third_party/nanobind/include/nanobind/eigen/sparse.h +293 -0
  139. slikui_python-0.1.1/third_party/nanobind/include/nanobind/eigen/tensor.h +332 -0
  140. slikui_python-0.1.1/third_party/nanobind/include/nanobind/eval.h +69 -0
  141. slikui_python-0.1.1/third_party/nanobind/include/nanobind/intrusive/counter.h +273 -0
  142. slikui_python-0.1.1/third_party/nanobind/include/nanobind/intrusive/counter.inl +158 -0
  143. slikui_python-0.1.1/third_party/nanobind/include/nanobind/intrusive/ref.h +153 -0
  144. slikui_python-0.1.1/third_party/nanobind/include/nanobind/make_iterator.h +368 -0
  145. slikui_python-0.1.1/third_party/nanobind/include/nanobind/nanobind.h +70 -0
  146. slikui_python-0.1.1/third_party/nanobind/include/nanobind/nb_accessor.h +347 -0
  147. slikui_python-0.1.1/third_party/nanobind/include/nanobind/nb_attr.h +356 -0
  148. slikui_python-0.1.1/third_party/nanobind/include/nanobind/nb_backend.h +715 -0
  149. slikui_python-0.1.1/third_party/nanobind/include/nanobind/nb_backend_slots.h +593 -0
  150. slikui_python-0.1.1/third_party/nanobind/include/nanobind/nb_call.h +141 -0
  151. slikui_python-0.1.1/third_party/nanobind/include/nanobind/nb_cast.h +813 -0
  152. slikui_python-0.1.1/third_party/nanobind/include/nanobind/nb_class.h +787 -0
  153. slikui_python-0.1.1/third_party/nanobind/include/nanobind/nb_defs.h +255 -0
  154. slikui_python-0.1.1/third_party/nanobind/include/nanobind/nb_descr.h +146 -0
  155. slikui_python-0.1.1/third_party/nanobind/include/nanobind/nb_error.h +189 -0
  156. slikui_python-0.1.1/third_party/nanobind/include/nanobind/nb_func.h +508 -0
  157. slikui_python-0.1.1/third_party/nanobind/include/nanobind/nb_misc.h +196 -0
  158. slikui_python-0.1.1/third_party/nanobind/include/nanobind/nb_platform.h +98 -0
  159. slikui_python-0.1.1/third_party/nanobind/include/nanobind/nb_python.h +60 -0
  160. slikui_python-0.1.1/third_party/nanobind/include/nanobind/nb_traits.h +245 -0
  161. slikui_python-0.1.1/third_party/nanobind/include/nanobind/nb_tuple.h +80 -0
  162. slikui_python-0.1.1/third_party/nanobind/include/nanobind/nb_types.h +1738 -0
  163. slikui_python-0.1.1/third_party/nanobind/include/nanobind/ndarray.h +703 -0
  164. slikui_python-0.1.1/third_party/nanobind/include/nanobind/operators.h +149 -0
  165. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/array.h +22 -0
  166. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/bind_map.h +248 -0
  167. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/bind_vector.h +281 -0
  168. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/chrono.h +312 -0
  169. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/complex.h +55 -0
  170. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/detail/nb_array.h +67 -0
  171. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/detail/nb_dict.h +86 -0
  172. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/detail/nb_list.h +83 -0
  173. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/detail/nb_optional.h +49 -0
  174. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/detail/nb_set.h +89 -0
  175. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/detail/traits.h +92 -0
  176. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/filesystem.h +89 -0
  177. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/function.h +102 -0
  178. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/list.h +22 -0
  179. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/map.h +23 -0
  180. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/optional.h +30 -0
  181. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/pair.h +87 -0
  182. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/set.h +24 -0
  183. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/shared_ptr.h +138 -0
  184. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/string.h +41 -0
  185. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/string_view.h +41 -0
  186. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/tuple.h +103 -0
  187. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/unique_ptr.h +177 -0
  188. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/unordered_map.h +23 -0
  189. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/unordered_set.h +24 -0
  190. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/variant.h +114 -0
  191. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/vector.h +22 -0
  192. slikui_python-0.1.1/third_party/nanobind/include/nanobind/stl/wstring.h +42 -0
  193. slikui_python-0.1.1/third_party/nanobind/include/nanobind/trampoline.h +96 -0
  194. slikui_python-0.1.1/third_party/nanobind/include/nanobind/typing.h +36 -0
  195. slikui_python-0.1.1/third_party/nanobind/pyproject.toml +59 -0
  196. slikui_python-0.1.1/third_party/nanobind/src/__init__.py +26 -0
  197. slikui_python-0.1.1/third_party/nanobind/src/__main__.py +36 -0
  198. slikui_python-0.1.1/third_party/nanobind/src/buffer.h +166 -0
  199. slikui_python-0.1.1/third_party/nanobind/src/common.cpp +1161 -0
  200. slikui_python-0.1.1/third_party/nanobind/src/error.cpp +288 -0
  201. slikui_python-0.1.1/third_party/nanobind/src/hash.h +33 -0
  202. slikui_python-0.1.1/third_party/nanobind/src/implicit.cpp +57 -0
  203. slikui_python-0.1.1/third_party/nanobind/src/nb_backend.cpp +121 -0
  204. slikui_python-0.1.1/third_party/nanobind/src/nb_combined.cpp +91 -0
  205. slikui_python-0.1.1/third_party/nanobind/src/nb_datetime.cpp +241 -0
  206. slikui_python-0.1.1/third_party/nanobind/src/nb_enum.cpp +433 -0
  207. slikui_python-0.1.1/third_party/nanobind/src/nb_ft.cpp +56 -0
  208. slikui_python-0.1.1/third_party/nanobind/src/nb_ft.h +67 -0
  209. slikui_python-0.1.1/third_party/nanobind/src/nb_func.cpp +1856 -0
  210. slikui_python-0.1.1/third_party/nanobind/src/nb_internals.cpp +1308 -0
  211. slikui_python-0.1.1/third_party/nanobind/src/nb_internals.h +1155 -0
  212. slikui_python-0.1.1/third_party/nanobind/src/nb_ndarray.cpp +1338 -0
  213. slikui_python-0.1.1/third_party/nanobind/src/nb_static_property.cpp +56 -0
  214. slikui_python-0.1.1/third_party/nanobind/src/nb_type.cpp +2742 -0
  215. slikui_python-0.1.1/third_party/nanobind/src/stubgen.py +1760 -0
  216. slikui_python-0.1.1/third_party/nanobind/src/trampoline.cpp +494 -0
  217. slikui_python-0.1.1/third_party/nanobind/src/version.py +169 -0
  218. slikui_python-0.1.1/third_party/nanobind/tests/CMakeLists.txt +333 -0
  219. slikui_python-0.1.1/third_party/nanobind/tests/common.py +42 -0
  220. slikui_python-0.1.1/third_party/nanobind/tests/conftest.py +6 -0
  221. slikui_python-0.1.1/third_party/nanobind/tests/inter_module.cpp +13 -0
  222. slikui_python-0.1.1/third_party/nanobind/tests/inter_module.h +15 -0
  223. slikui_python-0.1.1/third_party/nanobind/tests/object_py.h +28 -0
  224. slikui_python-0.1.1/third_party/nanobind/tests/pattern_file.nb +48 -0
  225. slikui_python-0.1.1/third_party/nanobind/tests/pattern_file_recursive.nb +4 -0
  226. slikui_python-0.1.1/third_party/nanobind/tests/py_recursive_stub_test/__init__.py +6 -0
  227. slikui_python-0.1.1/third_party/nanobind/tests/py_recursive_stub_test/__init__.pyi.ref +10 -0
  228. slikui_python-0.1.1/third_party/nanobind/tests/py_recursive_stub_test/alias.py +23 -0
  229. slikui_python-0.1.1/third_party/nanobind/tests/py_recursive_stub_test/alias.pyi.ref +17 -0
  230. slikui_python-0.1.1/third_party/nanobind/tests/py_recursive_stub_test/bar.py +1 -0
  231. slikui_python-0.1.1/third_party/nanobind/tests/py_recursive_stub_test/bar.pyi.ref +1 -0
  232. slikui_python-0.1.1/third_party/nanobind/tests/py_recursive_stub_test/sub/__init__.py +1 -0
  233. slikui_python-0.1.1/third_party/nanobind/tests/py_recursive_stub_test/sub/__init__.pyi.ref +4 -0
  234. slikui_python-0.1.1/third_party/nanobind/tests/py_recursive_stub_test/sub/mod.py +12 -0
  235. slikui_python-0.1.1/third_party/nanobind/tests/py_recursive_stub_test/sub/mod.pyi.ref +4 -0
  236. slikui_python-0.1.1/third_party/nanobind/tests/py_stub_test.py +123 -0
  237. slikui_python-0.1.1/third_party/nanobind/tests/py_stub_test.pyi.ref +78 -0
  238. slikui_python-0.1.1/third_party/nanobind/tests/test_abi.py +129 -0
  239. slikui_python-0.1.1/third_party/nanobind/tests/test_abi_layout.cpp +155 -0
  240. slikui_python-0.1.1/third_party/nanobind/tests/test_abi_missing.cpp +8 -0
  241. slikui_python-0.1.1/third_party/nanobind/tests/test_abi_multi.h +34 -0
  242. slikui_python-0.1.1/third_party/nanobind/tests/test_abi_multi_1.cpp +21 -0
  243. slikui_python-0.1.1/third_party/nanobind/tests/test_abi_multi_2.cpp +16 -0
  244. slikui_python-0.1.1/third_party/nanobind/tests/test_accessor.cpp +133 -0
  245. slikui_python-0.1.1/third_party/nanobind/tests/test_accessor.py +138 -0
  246. slikui_python-0.1.1/third_party/nanobind/tests/test_callbacks.cpp +138 -0
  247. slikui_python-0.1.1/third_party/nanobind/tests/test_callbacks.py +58 -0
  248. slikui_python-0.1.1/third_party/nanobind/tests/test_chrono.cpp +124 -0
  249. slikui_python-0.1.1/third_party/nanobind/tests/test_chrono.py +367 -0
  250. slikui_python-0.1.1/third_party/nanobind/tests/test_classes.cpp +1103 -0
  251. slikui_python-0.1.1/third_party/nanobind/tests/test_classes.h +21 -0
  252. slikui_python-0.1.1/third_party/nanobind/tests/test_classes.py +1727 -0
  253. slikui_python-0.1.1/third_party/nanobind/tests/test_classes_ext.pyi.ref +533 -0
  254. slikui_python-0.1.1/third_party/nanobind/tests/test_classes_extra.cpp +22 -0
  255. slikui_python-0.1.1/third_party/nanobind/tests/test_eigen.cpp +330 -0
  256. slikui_python-0.1.1/third_party/nanobind/tests/test_eigen.py +558 -0
  257. slikui_python-0.1.1/third_party/nanobind/tests/test_eigen_tensor.cpp +108 -0
  258. slikui_python-0.1.1/third_party/nanobind/tests/test_eigen_tensor.py +139 -0
  259. slikui_python-0.1.1/third_party/nanobind/tests/test_enum.cpp +140 -0
  260. slikui_python-0.1.1/third_party/nanobind/tests/test_enum.py +281 -0
  261. slikui_python-0.1.1/third_party/nanobind/tests/test_enum_ext.pyi.ref +166 -0
  262. slikui_python-0.1.1/third_party/nanobind/tests/test_eval.cpp +96 -0
  263. slikui_python-0.1.1/third_party/nanobind/tests/test_eval.py +49 -0
  264. slikui_python-0.1.1/third_party/nanobind/tests/test_exception.cpp +76 -0
  265. slikui_python-0.1.1/third_party/nanobind/tests/test_exception.py +129 -0
  266. slikui_python-0.1.1/third_party/nanobind/tests/test_foreign.cpp +82 -0
  267. slikui_python-0.1.1/third_party/nanobind/tests/test_foreign.py +14 -0
  268. slikui_python-0.1.1/third_party/nanobind/tests/test_functions.cpp +739 -0
  269. slikui_python-0.1.1/third_party/nanobind/tests/test_functions.py +1044 -0
  270. slikui_python-0.1.1/third_party/nanobind/tests/test_functions_ext.pyi.ref +364 -0
  271. slikui_python-0.1.1/third_party/nanobind/tests/test_holders.cpp +279 -0
  272. slikui_python-0.1.1/third_party/nanobind/tests/test_holders.py +476 -0
  273. slikui_python-0.1.1/third_party/nanobind/tests/test_inter_module.py +89 -0
  274. slikui_python-0.1.1/third_party/nanobind/tests/test_inter_module_1.cpp +8 -0
  275. slikui_python-0.1.1/third_party/nanobind/tests/test_inter_module_2.cpp +10 -0
  276. slikui_python-0.1.1/third_party/nanobind/tests/test_intrusive.cpp +68 -0
  277. slikui_python-0.1.1/third_party/nanobind/tests/test_intrusive.py +58 -0
  278. slikui_python-0.1.1/third_party/nanobind/tests/test_intrusive_impl.cpp +1 -0
  279. slikui_python-0.1.1/third_party/nanobind/tests/test_issue.cpp +68 -0
  280. slikui_python-0.1.1/third_party/nanobind/tests/test_issue.py +37 -0
  281. slikui_python-0.1.1/third_party/nanobind/tests/test_jax.cpp +25 -0
  282. slikui_python-0.1.1/third_party/nanobind/tests/test_jax.py +97 -0
  283. slikui_python-0.1.1/third_party/nanobind/tests/test_jax_ext.pyi.ref +8 -0
  284. slikui_python-0.1.1/third_party/nanobind/tests/test_make_iterator.cpp +102 -0
  285. slikui_python-0.1.1/third_party/nanobind/tests/test_make_iterator.py +48 -0
  286. slikui_python-0.1.1/third_party/nanobind/tests/test_make_iterator_ext.pyi.ref +33 -0
  287. slikui_python-0.1.1/third_party/nanobind/tests/test_ndarray.cpp +694 -0
  288. slikui_python-0.1.1/third_party/nanobind/tests/test_ndarray.py +1265 -0
  289. slikui_python-0.1.1/third_party/nanobind/tests/test_ndarray_ext.pyi.ref +245 -0
  290. slikui_python-0.1.1/third_party/nanobind/tests/test_prefix_module/__init__.py +6 -0
  291. slikui_python-0.1.1/third_party/nanobind/tests/test_prefix_module/__init__.pyi.ref +8 -0
  292. slikui_python-0.1.1/third_party/nanobind/tests/test_prefix_module/prefix.py +5 -0
  293. slikui_python-0.1.1/third_party/nanobind/tests/test_prefix_module/prefix.pyi.ref +5 -0
  294. slikui_python-0.1.1/third_party/nanobind/tests/test_prefix_module/prefixabc.py +7 -0
  295. slikui_python-0.1.1/third_party/nanobind/tests/test_prefix_module/prefixabc.pyi.ref +2 -0
  296. slikui_python-0.1.1/third_party/nanobind/tests/test_specialization.py +103 -0
  297. slikui_python-0.1.1/third_party/nanobind/tests/test_stl.cpp +589 -0
  298. slikui_python-0.1.1/third_party/nanobind/tests/test_stl.py +973 -0
  299. slikui_python-0.1.1/third_party/nanobind/tests/test_stl_bind_map.cpp +113 -0
  300. slikui_python-0.1.1/third_party/nanobind/tests/test_stl_bind_map.py +304 -0
  301. slikui_python-0.1.1/third_party/nanobind/tests/test_stl_bind_vector.cpp +85 -0
  302. slikui_python-0.1.1/third_party/nanobind/tests/test_stl_bind_vector.py +250 -0
  303. slikui_python-0.1.1/third_party/nanobind/tests/test_stl_ext.pyi.ref +297 -0
  304. slikui_python-0.1.1/third_party/nanobind/tests/test_stubgen.py +157 -0
  305. slikui_python-0.1.1/third_party/nanobind/tests/test_stubs.py +110 -0
  306. slikui_python-0.1.1/third_party/nanobind/tests/test_tensorflow.cpp +27 -0
  307. slikui_python-0.1.1/third_party/nanobind/tests/test_tensorflow.py +97 -0
  308. slikui_python-0.1.1/third_party/nanobind/tests/test_tensorflow_ext.pyi.ref +8 -0
  309. slikui_python-0.1.1/third_party/nanobind/tests/test_thread.cpp +101 -0
  310. slikui_python-0.1.1/third_party/nanobind/tests/test_thread.py +253 -0
  311. slikui_python-0.1.1/third_party/nanobind/tests/test_typing.cpp +146 -0
  312. slikui_python-0.1.1/third_party/nanobind/tests/test_typing.py +12 -0
  313. slikui_python-0.1.1/third_party/nanobind/tests/test_typing_ext.pyi.ref +110 -0
  314. slikui_python-0.1.1/tools/amalgamate.py +135 -0
  315. slikui_python-0.1.1/tools/check_headers.sh +21 -0
  316. slikui_python-0.1.1/tools/components_capture.cpp +320 -0
  317. slikui_python-0.1.1/tools/embed_font.py +66 -0
  318. slikui_python-0.1.1/tools/gallery_capture.cpp +188 -0
  319. slikui_python-0.1.1/tools/ppm2png.py +51 -0
  320. slikui_python-0.1.1/tools/snapshot.cpp +101 -0
@@ -0,0 +1,79 @@
1
+ name: cpp
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ concurrency:
9
+ group: cpp-${{ github.ref }}
10
+ cancel-in-progress: true
11
+
12
+ jobs:
13
+ tests:
14
+ name: ${{ matrix.os }} / ${{ matrix.cxx }}
15
+ runs-on: ${{ matrix.os }}
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ include:
20
+ - { os: ubuntu-latest, cc: gcc, cxx: g++ }
21
+ - { os: ubuntu-latest, cc: clang, cxx: clang++ }
22
+ - { os: macos-latest, cc: clang, cxx: clang++ }
23
+ - { os: windows-latest, cc: msvc, cxx: msvc }
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+
27
+ - name: set compilers
28
+ if: matrix.cc != 'msvc'
29
+ shell: bash
30
+ run: |
31
+ echo "CC=${{ matrix.cc }}" >> "$GITHUB_ENV"
32
+ echo "CXX=${{ matrix.cxx }}" >> "$GITHUB_ENV"
33
+
34
+ # Examples pull in GLFW/OpenGL system deps; CI exercises the library
35
+ # itself. The GL/GLFW backends get a dedicated compile check below.
36
+ - name: configure
37
+ run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DSLIKUI_BUILD_EXAMPLES=OFF
38
+
39
+ - name: build
40
+ run: cmake --build build --config Release --parallel
41
+
42
+ - name: test
43
+ run: ctest --test-dir build --output-on-failure -C Release
44
+
45
+ # Every public header must compile standalone — apple-libc++ hides missing
46
+ # std includes (cstdint, functional, ...) that libstdc++/MSVC reject.
47
+ headers:
48
+ name: every header compiles standalone (linux/gcc)
49
+ runs-on: ubuntu-latest
50
+ steps:
51
+ - uses: actions/checkout@v4
52
+ # opengl.hpp includes the system <GL/gl.h> unconditionally; GLFW makes
53
+ # glfw_window.hpp compile its real body instead of self-gating to empty.
54
+ - name: install dev headers
55
+ run: sudo apt-get update && sudo apt-get install -y libgl-dev libglfw3-dev
56
+ - name: standalone header check
57
+ run: ./tools/check_headers.sh
58
+ env:
59
+ CXX: g++
60
+
61
+ # Compile-only smoke for the windowing/GL backends: they self-gate on
62
+ # __has_include(<GLFW/glfw3.h>), so without dev headers installed they
63
+ # silently compile to nothing and rot. Install them and force the check.
64
+ gl-backends:
65
+ name: GL/GLFW backends compile (linux)
66
+ runs-on: ubuntu-latest
67
+ steps:
68
+ - uses: actions/checkout@v4
69
+ - name: install dev headers
70
+ run: sudo apt-get update && sudo apt-get install -y libglfw3-dev libgl1-mesa-dev
71
+ - name: syntax-check backend headers
72
+ shell: bash
73
+ run: |
74
+ cat > /tmp/backends.cpp <<'EOF'
75
+ #include <slikui/backends/glfw/glfw_window.hpp>
76
+ #include <slikui/backends/opengl/opengl.hpp>
77
+ int main() { return 0; }
78
+ EOF
79
+ clang++ -std=c++20 -Iinclude -fsyntax-only /tmp/backends.cpp
@@ -0,0 +1,128 @@
1
+ name: python
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ tags: ['v*']
7
+ pull_request:
8
+ workflow_dispatch:
9
+
10
+ concurrency:
11
+ group: python-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ jobs:
15
+ sdist:
16
+ name: sdist + wheel-from-sdist
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - uses: actions/setup-python@v5
21
+ with:
22
+ python-version: '3.12'
23
+
24
+ - name: build sdist
25
+ run: |
26
+ python -m pip install build
27
+ python -m build --sdist --outdir dist .
28
+
29
+ - name: build a wheel FROM the sdist
30
+ run: |
31
+ python -m pip wheel --no-deps -w wheelhouse dist/*.tar.gz
32
+ python -m pip install wheelhouse/*.whl
33
+ python -c "import slikui; print('sdist round-trip OK,', slikui.__version__)"
34
+
35
+ - uses: actions/upload-artifact@v4
36
+ with:
37
+ name: sdist
38
+ path: dist/*.tar.gz
39
+
40
+ wheels:
41
+ name: wheels ${{ matrix.os }}
42
+ runs-on: ${{ matrix.os }}
43
+ strategy:
44
+ fail-fast: false
45
+ matrix:
46
+ include:
47
+ - { os: ubuntu-latest } # linux x86_64
48
+ - { os: ubuntu-24.04-arm } # linux aarch64
49
+ - { os: macos-latest } # macOS arm64 (no x86_64: Intel Macs build from the sdist)
50
+ - { os: windows-latest } # windows amd64
51
+ env:
52
+ CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-*"
53
+ # gcc 13 on manylinux_2_28 — C++20 needs more than 2014's devtoolset
54
+ CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
55
+ CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
56
+ CIBW_TEST_REQUIRES: "pytest numpy"
57
+ CIBW_TEST_COMMAND: "python -m pytest {package}/python/tests -q"
58
+ CIBW_BUILD_VERBOSITY: 1
59
+ steps:
60
+ - uses: actions/checkout@v4
61
+
62
+ - name: build + test wheels
63
+ uses: pypa/cibuildwheel@v3.4
64
+
65
+ - uses: actions/upload-artifact@v4
66
+ with:
67
+ name: wheels-${{ matrix.os }}
68
+ path: wheelhouse/*.whl
69
+
70
+ # Tag push (v*) -> GitHub Release with the sdist + every wheel attached;
71
+ # the pypi job below then uploads the same files to PyPI.
72
+ release:
73
+ name: GitHub Release
74
+ if: startsWith(github.ref, 'refs/tags/v')
75
+ needs: [sdist, wheels] # every platform built and tested, or no release
76
+ runs-on: ubuntu-latest
77
+ permissions:
78
+ contents: write # create the release + upload assets
79
+ steps:
80
+ - uses: actions/checkout@v4
81
+
82
+ # Not into dist/: that's the tracked folder holding the amalgamated
83
+ # C++ headers (attached to the release explicitly below).
84
+ - uses: actions/download-artifact@v4
85
+ with:
86
+ path: packages
87
+ merge-multiple: true # sdist + wheels-* -> one flat folder
88
+
89
+ # The built files carry the version from include/slikui/version.hpp (via
90
+ # the pyproject regex provider) in their names; the tag must agree.
91
+ - name: tag must match package version
92
+ run: |
93
+ v="${GITHUB_REF_NAME#v}"
94
+ bad=$(ls packages | grep -v -e "^slikui_python-$v\.tar\.gz$" -e "^slikui_python-$v-.*\.whl$" || true)
95
+ if [ ! -f "packages/slikui_python-$v.tar.gz" ] || [ -n "$bad" ]; then
96
+ echo "::error::tag $GITHUB_REF_NAME does not match the built version (include/slikui/version.hpp)"
97
+ ls packages
98
+ exit 1
99
+ fi
100
+
101
+ - name: create release
102
+ run: |
103
+ ls -l packages dist
104
+ gh release create "$GITHUB_REF_NAME" packages/* dist/slikui.hpp dist/slikui_default_font.hpp \
105
+ --generate-notes --verify-tag
106
+ env:
107
+ GH_TOKEN: ${{ github.token }}
108
+
109
+ # Tag push (v*) -> upload the same sdist + wheels to PyPI via Trusted
110
+ # Publishing (OIDC): no stored token. PyPI must list this repo, workflow
111
+ # python.yml and environment "pypi" as a trusted publisher for slikui-python.
112
+ pypi:
113
+ name: publish to PyPI
114
+ if: startsWith(github.ref, 'refs/tags/v')
115
+ needs: [release] # tag/version check passed, GitHub Release exists
116
+ runs-on: ubuntu-latest
117
+ environment:
118
+ name: pypi
119
+ url: https://pypi.org/p/slikui-python
120
+ permissions:
121
+ id-token: write # mint the OIDC token PyPI exchanges for an upload token
122
+ steps:
123
+ - uses: actions/download-artifact@v4
124
+ with:
125
+ path: dist
126
+ merge-multiple: true # sdist + wheels-* -> one flat folder
127
+
128
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,14 @@
1
+ build/
2
+ build-asan/
3
+ .cache/
4
+ .venv/
5
+ .jimbo/
6
+ python/build/
7
+ __pycache__/
8
+ *.pyc
9
+ .pytest_cache/
10
+ .DS_Store
11
+ compile_commands.json
12
+ shots/
13
+ hello_raw.ppm
14
+ .venv-asan/
@@ -0,0 +1,71 @@
1
+ cmake_minimum_required(VERSION 3.20)
2
+
3
+ # Version comes from include/slikui/version.hpp — the single source of truth
4
+ # for C++ and Python alike.
5
+ set(_slikui_version "")
6
+ foreach(_part MAJOR MINOR PATCH)
7
+ file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/include/slikui/version.hpp" _line
8
+ REGEX "^#define SLIKUI_VERSION_${_part} [0-9]+$")
9
+ if(NOT _line)
10
+ message(FATAL_ERROR "SLIKUI_VERSION_${_part} not found in include/slikui/version.hpp")
11
+ endif()
12
+ string(REGEX REPLACE "^#define SLIKUI_VERSION_${_part} ([0-9]+)$" "\\1" _num "${_line}")
13
+ list(APPEND _slikui_version "${_num}")
14
+ endforeach()
15
+ list(JOIN _slikui_version "." _slikui_version)
16
+
17
+ project(slikui VERSION "${_slikui_version}" LANGUAGES CXX)
18
+ message(STATUS "slikui ${PROJECT_VERSION}")
19
+
20
+ set(CMAKE_CXX_STANDARD 20)
21
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
22
+
23
+ add_library(slikui INTERFACE)
24
+ target_include_directories(slikui INTERFACE
25
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
26
+ $<INSTALL_INTERFACE:include>)
27
+ target_compile_features(slikui INTERFACE cxx_std_20)
28
+
29
+ option(SLIKUI_BUILD_TESTS "Build slikui tests" ON)
30
+ option(SLIKUI_BUILD_EXAMPLES "Build slikui examples" ON)
31
+
32
+ if(SKBUILD)
33
+ # Python wheel build (scikit-build-core): only the bindings, which install
34
+ # into the wheel — the install/export rules below don't apply.
35
+ add_subdirectory(python)
36
+ else()
37
+ if(SLIKUI_BUILD_TESTS)
38
+ enable_testing()
39
+ add_subdirectory(tests)
40
+ endif()
41
+
42
+ if(SLIKUI_BUILD_EXAMPLES)
43
+ add_subdirectory(examples)
44
+ endif()
45
+
46
+ # --- install / export: FetchContent / find_package(slikui) support ---
47
+ include(GNUInstallDirs)
48
+ include(CMakePackageConfigHelpers)
49
+
50
+ install(TARGETS slikui EXPORT slikuiTargets)
51
+ install(DIRECTORY include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
52
+
53
+ set(SLIKUI_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/slikui")
54
+ install(EXPORT slikuiTargets
55
+ FILE slikuiTargets.cmake
56
+ NAMESPACE slikui::
57
+ DESTINATION "${SLIKUI_INSTALL_CMAKEDIR}")
58
+
59
+ configure_package_config_file(
60
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake/slikuiConfig.cmake.in"
61
+ "${CMAKE_CURRENT_BINARY_DIR}/slikuiConfig.cmake"
62
+ INSTALL_DESTINATION "${SLIKUI_INSTALL_CMAKEDIR}")
63
+ write_basic_package_version_file(
64
+ "${CMAKE_CURRENT_BINARY_DIR}/slikuiConfigVersion.cmake"
65
+ VERSION "${PROJECT_VERSION}"
66
+ COMPATIBILITY SameMajorVersion)
67
+ install(FILES
68
+ "${CMAKE_CURRENT_BINARY_DIR}/slikuiConfig.cmake"
69
+ "${CMAKE_CURRENT_BINARY_DIR}/slikuiConfigVersion.cmake"
70
+ DESTINATION "${SLIKUI_INSTALL_CMAKEDIR}")
71
+ endif()
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 slikui contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,112 @@
1
+ Metadata-Version: 2.4
2
+ Name: slikui-python
3
+ Version: 0.1.1
4
+ Summary: Python bindings for slikui — a header-only C++20 UI library
5
+ Author: slikui contributors
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ License-File: third_party/fonts/LICENSE-DejaVu.txt
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Programming Language :: C++
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Topic :: Software Development :: User Interfaces
15
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
+ Project-URL: Homepage, https://github.com/jamesgregson/slikui
17
+ Project-URL: Documentation, https://github.com/jamesgregson/slikui/tree/main/python
18
+ Requires-Python: >=3.10
19
+ Requires-Dist: numpy>=1.24
20
+ Provides-Extra: test
21
+ Requires-Dist: pytest>=8; extra == "test"
22
+ Provides-Extra: demo
23
+ Requires-Dist: glfw>=2.5; extra == "demo"
24
+ Requires-Dist: PyOpenGL; extra == "demo"
25
+ Description-Content-Type: text/markdown
26
+
27
+ # slikui — Python bindings for slikui
28
+
29
+ Install from PyPI · import `slikui` · compiled module `slikui._slikui`.
30
+
31
+ ```sh
32
+ pip install slikui-python
33
+ ```
34
+
35
+ pip picks the wheel matching your OS, CPU and Python (3.10–3.14 on Linux
36
+ x86_64/aarch64, macOS arm64, Windows x64). No wheel for your platform (e.g.
37
+ Intel macOS)? pip builds from the sdist instead — that needs a C++20 compiler.
38
+
39
+ The same wheels and sdist are attached to every
40
+ [GitHub Release](https://github.com/jamesgregson/slikui/releases).
41
+
42
+ Headless, testable UI: the software rasterizer renders into a `numpy`
43
+ framebuffer — no window, no GPU, no event loop required.
44
+
45
+ ```python
46
+ import slikui
47
+
48
+ ui = slikui.App(320, 200) # Target + Sink + Context + font (system, else bundled)
49
+ root = ui.set_root(slikui.Column, padding=16, gap=8)
50
+ root.add(slikui.Label, "Hello, slikui!", font_size=26)
51
+ root.add(slikui.Button, "Save", variant=slikui.ButtonVariant.Primary)
52
+
53
+ ui.tick(0.0, 1 / 60) # layout + animation
54
+ frame = ui.render() # zero-copy np.ndarray (H, W) uint32
55
+ ```
56
+
57
+ `App.close()` — also run by `with App(...)` and automatically at exit —
58
+ destroys the tree and releases Python callbacks it holds, so shutdown is
59
+ leak-free even when callbacks capture widget wrappers.
60
+
61
+ Build from source (the C++ side is header-only, nothing to link):
62
+
63
+ ```
64
+ pip install -e . # editable, into your venv — from the repo root
65
+ python -m pytest python/tests # 38 tests: widgets, events, renderer parity
66
+ python python/examples/hello.py # writes hello.ppm
67
+ ```
68
+
69
+ Events are first-class: build slikui events in Python and drive the real
70
+ dispatch path (see `python/tests/test_events.py`):
71
+
72
+ ```python
73
+ ui.handle(slikui.mouse_press((60, 40))) # click through hit-testing
74
+ ui.handle(slikui.text_input("h")) # into the focused TextField
75
+ ui.handle(slikui.scroll(pos, (0, -1))) # wheel, "ctrl+shift" mods supported
76
+ ```
77
+
78
+ Interactive demo — a Python-native GLFW + OpenGL host with the slikui software
79
+ rasterizer as the UI layer (`pip install glfw PyOpenGL`):
80
+
81
+ ```
82
+ python python/examples/glfw_demo.py
83
+ ```
84
+
85
+ Lit cube/sphere/torus over a procedural sky; the controls panel is rasterized
86
+ on the CPU into a `uint32` buffer and blended over the GL scene as one
87
+ texture. Drag orbits, wheel zooms, the panel edits material/sky/light/camera.
88
+
89
+ **Your own renderer.** `slikui.RenderSink` is a trampoline over C++
90
+ `IRenderSink`: subclass it, implement `upload(tex)` and `render(commands,
91
+ fb_size)`, and slikui hands you every frame as a flat command list — point it at
92
+ pygame, moderngl, PIL, anything. `slikui.CanvasSink` is a worked example: a
93
+ pure-numpy rasterizer that produces **pixel-identical** output to the C++
94
+ software backend (same blend/SDF/sampling math, verified by test):
95
+
96
+ ```python
97
+ sink = slikui.CanvasSink(320, 240)
98
+ ctx = slikui.Context(sink) # any RenderSink subclass works here
99
+ ctx.set_frame_size(320, 240)
100
+ ctx.load_default_font() # bundled DejaVu Sans subset; or load_font_file(path)
101
+ # ... build the tree, tick ...
102
+ ctx.render()
103
+ frame = sink.buffer # (240, 320) uint32, 0xAABBGGRR
104
+ ```
105
+
106
+ See it side by side: `python python/examples/pyrenderer_demo.py` renders one
107
+ tree through both renderers and reports the pixel diff (it is 0).
108
+
109
+ Design and milestones: `docs/python-bindings-plan.md` — M0 (values, software
110
+ backend, core widgets), M1 (full widget surface + themes) and M2 (events,
111
+ popups, tooltips, simulated-input tests) are done; M3 (wheels/CI/docs) and
112
+ M4 (GLFW+GL backend bindings) are tabled.