buninu-browser 0.2.4 → 0.4.0

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 (249) hide show
  1. package/LICENSES/jsmdcui.txt +22 -0
  2. package/README.md +102 -2
  3. package/frontends/wayland/LICENSE-land +21 -0
  4. package/frontends/wayland/README.md +123 -0
  5. package/frontends/wayland/casty/LICENSE +21 -0
  6. package/frontends/wayland/casty/bookmarks.js +32 -0
  7. package/frontends/wayland/casty/click.js +96 -0
  8. package/frontends/wayland/casty/commands.js +61 -0
  9. package/frontends/wayland/casty/config.js +45 -0
  10. package/frontends/wayland/casty/download-directory.js +28 -0
  11. package/frontends/wayland/casty/download.js +49 -0
  12. package/frontends/wayland/casty/hints.js +334 -0
  13. package/frontends/wayland/casty/keys.js +56 -0
  14. package/frontends/wayland/casty/page-commands.js +80 -0
  15. package/frontends/wayland/casty/prompt-width.js +148 -0
  16. package/frontends/wayland/casty/urlbar.js +606 -0
  17. package/frontends/wayland/client.js +88 -0
  18. package/frontends/wayland/clipboard.js +80 -0
  19. package/frontends/wayland/index.js +116 -0
  20. package/frontends/wayland/input.js +56 -0
  21. package/frontends/wayland/protocol.js +55 -0
  22. package/frontends/wayland/protocols/wayland.xml +3248 -0
  23. package/frontends/wayland/protocols/xdg-shell.xml +1415 -0
  24. package/frontends/wayland/transport.js +120 -0
  25. package/frontends/wayland/urlbar.js +158 -0
  26. package/index.js +28 -1
  27. package/lib/clipboard-command.js +10 -0
  28. package/lib/clipboard-powershell.js +22 -0
  29. package/lib/clipboard.js +57 -0
  30. package/lib/document-types.js +11 -0
  31. package/lib/headless-shell.js +78 -13
  32. package/lib/layout/text-layout.js +17 -9
  33. package/lib/paint/display-list.js +5 -1
  34. package/lib/paint/frame.js +35 -3
  35. package/lib/paint/raw-frames.js +47 -0
  36. package/lib/qml/README.md +971 -0
  37. package/lib/qml/builtins.js +700 -0
  38. package/lib/qml/canvas-dom.js +115 -0
  39. package/lib/qml/document.js +1176 -0
  40. package/lib/qml/format.js +9 -0
  41. package/lib/qml/host.js +324 -0
  42. package/lib/qml/images.js +199 -0
  43. package/lib/qml/launcher.js +132 -0
  44. package/lib/qml/loader.js +517 -0
  45. package/lib/qml/media-renderer.js +49 -0
  46. package/lib/qml/media.js +86 -0
  47. package/lib/qml/models.js +622 -0
  48. package/lib/qml/parser.js +381 -0
  49. package/lib/qml/qs +5 -0
  50. package/lib/qml/qscasty +3 -0
  51. package/lib/qml/qsheadless +3 -0
  52. package/lib/qml/qswayland +3 -0
  53. package/lib/qml/reactive.js +159 -0
  54. package/lib/qml/runtime.js +3381 -0
  55. package/lib/qml/shapes.js +243 -0
  56. package/lib/qml/text.js +109 -0
  57. package/lib/qml/textures.js +123 -0
  58. package/lib/qml/wayland-clipboard.js +32 -0
  59. package/lib/qml/worker-thread.js +70 -0
  60. package/lib/render-tree/index.js +16 -1
  61. package/lib/renderer/bindings.js +11 -0
  62. package/lib/renderer/canvas-2d.js +13 -0
  63. package/lib/renderer/compositor-channel.js +103 -0
  64. package/lib/renderer/compositor.js +25 -33
  65. package/lib/renderer/flags.js +1 -1
  66. package/lib/renderer/host.js +128 -92
  67. package/lib/renderer/main.js +38 -4
  68. package/lib/renderer/page-realm.js +32 -1
  69. package/lib/renderer/page-renderer.js +250 -21
  70. package/lib/renderer/text-input-paint.js +54 -0
  71. package/lib/renderer/text-input.js +57 -0
  72. package/lib/style/computed-style.js +2 -2
  73. package/package.json +1 -1
  74. package/test/clipboard.test.js +54 -0
  75. package/test/fixtures/browser-raw-demo.html +36 -0
  76. package/test/fixtures/flea-helpers/Dockerfile +36 -0
  77. package/test/fixtures/flea-helpers/bat.mjs +43 -0
  78. package/test/fixtures/flea-helpers/bin/bat +3 -0
  79. package/test/fixtures/flea-helpers/bin/bwrap +10 -0
  80. package/test/fixtures/flea-helpers/bin/bwrap-real-filter +9 -0
  81. package/test/fixtures/flea-helpers/bin/glow +3 -0
  82. package/test/fixtures/flea-helpers/bin/qs +3 -0
  83. package/test/fixtures/flea-helpers/bin/unsupported +3 -0
  84. package/test/fixtures/flea-helpers/check-highlighting.mjs +47 -0
  85. package/test/fixtures/flea-helpers/check-media.mjs +29 -0
  86. package/test/fixtures/flea-helpers/check-preview.mjs +27 -0
  87. package/test/fixtures/flea-helpers/check.mjs +36 -0
  88. package/test/fixtures/flea-helpers/highlight-cases.json +227 -0
  89. package/test/fixtures/flea-helpers/source-mime.xml +28 -0
  90. package/test/fixtures/flea-helpers/syntax-compat.mjs +23 -0
  91. package/test/fixtures/flea-thumbnail-stub/flea-placeholder.thumbnailer +4 -0
  92. package/test/fixtures/flea-thumbnail-stub/flea-thumbnail-stub +3 -0
  93. package/test/fixtures/qml/flea/EscapeHint.qml +11 -0
  94. package/test/fixtures/qml/flea/LICENSE +21 -0
  95. package/test/fixtures/qml/flea/README.md +25 -0
  96. package/test/fixtures/qml/flea/Theme.qml +8 -0
  97. package/test/fixtures/qml/flea/demo.qml +24 -0
  98. package/test/fixtures/qml/flea/qmldir +3 -0
  99. package/test/fixtures/qml/flea-theme/LICENSE-Flea +21 -0
  100. package/test/fixtures/qml/flea-theme/LICENSE-Omarchy +20 -0
  101. package/test/fixtures/qml/flea-theme/README.md +70 -0
  102. package/test/fixtures/qml/flea-theme/button.qml +17 -0
  103. package/test/fixtures/qml/flea-theme/demo.qml +27 -0
  104. package/test/fixtures/qml/flea-theme/field.qml +21 -0
  105. package/test/fixtures/qml/flea-theme/imports/qs/Commons/BorderGeometry.js +373 -0
  106. package/test/fixtures/qml/flea-theme/imports/qs/Commons/Color.qml +258 -0
  107. package/test/fixtures/qml/flea-theme/imports/qs/Commons/I18n.qml +118 -0
  108. package/test/fixtures/qml/flea-theme/imports/qs/Commons/Numbers.js +19 -0
  109. package/test/fixtures/qml/flea-theme/imports/qs/Commons/Plural.js +91 -0
  110. package/test/fixtures/qml/flea-theme/imports/qs/Commons/Style.qml +561 -0
  111. package/test/fixtures/qml/flea-theme/imports/qs/Commons/Util.qml +188 -0
  112. package/test/fixtures/qml/flea-theme/imports/qs/Commons/qmldir +13 -0
  113. package/test/fixtures/qml/flea-theme/segment.qml +17 -0
  114. package/test/fixtures/qml/flea-theme/settings.qml +58 -0
  115. package/test/fixtures/qml/flea-theme/text-metrics.qml +10 -0
  116. package/test/fixtures/qml/flea-theme/ui/DialogButton.qml +150 -0
  117. package/test/fixtures/qml/flea-theme/ui/DialogField.qml +147 -0
  118. package/test/fixtures/qml/flea-theme/ui/EscapeHint.qml +11 -0
  119. package/test/fixtures/qml/flea-theme/ui/Glass.qml +114 -0
  120. package/test/fixtures/qml/flea-theme/ui/Glyph.qml +54 -0
  121. package/test/fixtures/qml/flea-theme/ui/GlyphSolid.qml +22 -0
  122. package/test/fixtures/qml/flea-theme/ui/Reveal.qml +54 -0
  123. package/test/fixtures/qml/flea-theme/ui/SettingsRuler.qml +85 -0
  124. package/test/fixtures/qml/flea-theme/ui/SettingsSegment.qml +85 -0
  125. package/test/fixtures/qml/flea-theme/ui/StableModel.qml +89 -0
  126. package/test/fixtures/qml/flea-theme/ui/Theme.qml +460 -0
  127. package/test/fixtures/qml/flea-theme/ui/ThemeColors.qml +43 -0
  128. package/test/fixtures/qml/flea-theme/ui/ViewState.qml +565 -0
  129. package/test/fixtures/qml/flea-theme/ui/js/Anchor.js +379 -0
  130. package/test/fixtures/qml/flea-theme/ui/js/AnchorHold.js +162 -0
  131. package/test/fixtures/qml/flea-theme/ui/js/Archive.js +157 -0
  132. package/test/fixtures/qml/flea-theme/ui/js/BackReturn.js +110 -0
  133. package/test/fixtures/qml/flea-theme/ui/js/Buttons.js +54 -0
  134. package/test/fixtures/qml/flea-theme/ui/js/ColumnMenu.js +111 -0
  135. package/test/fixtures/qml/flea-theme/ui/js/Columns.js +298 -0
  136. package/test/fixtures/qml/flea-theme/ui/js/Contrast.js +157 -0
  137. package/test/fixtures/qml/flea-theme/ui/js/Density.js +44 -0
  138. package/test/fixtures/qml/flea-theme/ui/js/DirSizes.js +129 -0
  139. package/test/fixtures/qml/flea-theme/ui/js/ExtThumbs.js +115 -0
  140. package/test/fixtures/qml/flea-theme/ui/js/Filter.js +284 -0
  141. package/test/fixtures/qml/flea-theme/ui/js/FolderSorts.js +108 -0
  142. package/test/fixtures/qml/flea-theme/ui/js/Format.js +305 -0
  143. package/test/fixtures/qml/flea-theme/ui/js/Icons.js +206 -0
  144. package/test/fixtures/qml/flea-theme/ui/js/Input.js +39 -0
  145. package/test/fixtures/qml/flea-theme/ui/js/KeyName.js +64 -0
  146. package/test/fixtures/qml/flea-theme/ui/js/Keymap.js +370 -0
  147. package/test/fixtures/qml/flea-theme/ui/js/Kinds.js +145 -0
  148. package/test/fixtures/qml/flea-theme/ui/js/Lists.js +11 -0
  149. package/test/fixtures/qml/flea-theme/ui/js/MakeDefault.js +186 -0
  150. package/test/fixtures/qml/flea-theme/ui/js/Match.js +27 -0
  151. package/test/fixtures/qml/flea-theme/ui/js/Material.js +109 -0
  152. package/test/fixtures/qml/flea-theme/ui/js/Menu.js +513 -0
  153. package/test/fixtures/qml/flea-theme/ui/js/Motion.js +16 -0
  154. package/test/fixtures/qml/flea-theme/ui/js/Mounts.js +320 -0
  155. package/test/fixtures/qml/flea-theme/ui/js/MouseNav.js +13 -0
  156. package/test/fixtures/qml/flea-theme/ui/js/Nav.js +328 -0
  157. package/test/fixtures/qml/flea-theme/ui/js/Palette.js +33 -0
  158. package/test/fixtures/qml/flea-theme/ui/js/Places.js +236 -0
  159. package/test/fixtures/qml/flea-theme/ui/js/Protocols.js +296 -0
  160. package/test/fixtures/qml/flea-theme/ui/js/RecentMode.js +154 -0
  161. package/test/fixtures/qml/flea-theme/ui/js/Search.js +396 -0
  162. package/test/fixtures/qml/flea-theme/ui/js/Settings.js +476 -0
  163. package/test/fixtures/qml/flea-theme/ui/js/SettingsAbout.js +99 -0
  164. package/test/fixtures/qml/flea-theme/ui/js/SettingsShelf.js +52 -0
  165. package/test/fixtures/qml/flea-theme/ui/js/Sort.js +127 -0
  166. package/test/fixtures/qml/flea-theme/ui/js/StateWords.js +42 -0
  167. package/test/fixtures/qml/flea-theme/ui/js/Swap.js +166 -0
  168. package/test/fixtures/qml/flea-theme/ui/js/TextSize.js +107 -0
  169. package/test/fixtures/qml/flea-theme/ui/js/Thumbs.js +158 -0
  170. package/test/fixtures/qml/flea-theme/ui/js/UiState.js +438 -0
  171. package/test/fixtures/qml/flea-theme/ui/js/Update.js +132 -0
  172. package/test/fixtures/qml/flea-theme/ui/js/UserDirs.js +56 -0
  173. package/test/fixtures/qml/flea-theme/ui/qmldir +227 -0
  174. package/test/fixtures/qml/hello.qml +26 -0
  175. package/test/fixtures/qml/imports/Demo/Toolkit/VersionLabel.qml +2 -0
  176. package/test/fixtures/qml/imports/Demo/Toolkit/VersionLabelNew.qml +2 -0
  177. package/test/fixtures/qml/imports/Demo/Toolkit/qmldir +3 -0
  178. package/test/fixtures/qml/imports/components/Badge.qml +15 -0
  179. package/test/fixtures/qml/imports/logic/base.js +2 -0
  180. package/test/fixtures/qml/imports/logic/counter.js +4 -0
  181. package/test/fixtures/qml/imports/logic/math.js +3 -0
  182. package/test/fixtures/qml/imports/logic/shared.js +3 -0
  183. package/test/fixtures/qml/imports/main.qml +21 -0
  184. package/test/fixtures/qml/imports/theme/Theme.qml +8 -0
  185. package/test/fixtures/qml/imports/theme/qmldir +2 -0
  186. package/test/fixtures/qml/multiply.qml +61 -0
  187. package/test/fixtures/qml-canvas-dom.js +90 -0
  188. package/test/fixtures/qml-media-audio.js +39 -0
  189. package/test/fixtures/raw-capture-benchmark.json +76 -0
  190. package/test/helpers/flea-sandbox.js +48 -0
  191. package/test/helpers/quickshell-fixture.js +125 -0
  192. package/test/html-clipboard-wayland.test.js +47 -0
  193. package/test/index.test.js +13 -0
  194. package/test/manual-casty-without-qml.js +87 -0
  195. package/test/manual-flea-application.js +49 -0
  196. package/test/manual-flea-binary.js +62 -0
  197. package/test/manual-flea-qml.js +9 -0
  198. package/test/manual-flea-settings.js +40 -0
  199. package/test/manual-flea-theme.js +40 -0
  200. package/test/manual-qml-removal.js +46 -0
  201. package/test/manual-without-qml.js +45 -0
  202. package/test/qml-canvas-dom.test.js +37 -0
  203. package/test/qml-clipboard-bridge.test.js +25 -0
  204. package/test/qml-clipboard-wayland.test.js +40 -0
  205. package/test/qml-connections-timing.test.js +73 -0
  206. package/test/qml-dynamic.test.js +401 -0
  207. package/test/qml-flea-app.test.js +146 -0
  208. package/test/qml-flea-backend.test.js +78 -0
  209. package/test/qml-flea-columns-backend.test.js +38 -0
  210. package/test/qml-flea-compile.test.js +78 -0
  211. package/test/qml-flea-launcher.test.js +88 -0
  212. package/test/qml-flea-markdown-backend.test.js +31 -0
  213. package/test/qml-flea-media.test.js +28 -0
  214. package/test/qml-flea-navigation-backend.test.js +35 -0
  215. package/test/qml-flea-navigation-timing.test.js +147 -0
  216. package/test/qml-flea-preview-backend.test.js +53 -0
  217. package/test/qml-flea-previews.test.js +163 -0
  218. package/test/qml-flea-rows.test.js +101 -0
  219. package/test/qml-flea-textures.test.js +59 -0
  220. package/test/qml-flea-view-switch.test.js +33 -0
  221. package/test/qml-flea-wayland.test.js +68 -0
  222. package/test/qml-flea.test.js +34 -0
  223. package/test/qml-host.test.js +238 -0
  224. package/test/qml-imports.test.js +102 -0
  225. package/test/qml-inherited-handlers.test.js +51 -0
  226. package/test/qml-input-selection.test.js +66 -0
  227. package/test/qml-interactions.test.js +309 -0
  228. package/test/qml-language.test.js +167 -0
  229. package/test/qml-launcher.test.js +54 -0
  230. package/test/qml-layout-text.test.js +205 -0
  231. package/test/qml-media.test.js +63 -0
  232. package/test/qml-persisted-delegates.test.js +45 -0
  233. package/test/qml-quickshell-controls.test.js +65 -0
  234. package/test/qml-quickshell-settings.test.js +62 -0
  235. package/test/qml-repeater.test.js +72 -0
  236. package/test/qml-style-updates.test.js +124 -0
  237. package/test/qml-textures.test.js +66 -0
  238. package/test/qml-views.test.js +332 -0
  239. package/test/qml-worker.test.js +69 -0
  240. package/test/qml.test.js +83 -0
  241. package/test/raw-capture.test.js +152 -0
  242. package/test/renderer-host.test.js +11 -0
  243. package/test/text-input-pointer.test.js +31 -0
  244. package/test/text-input-scroll.test.js +29 -0
  245. package/test/text-input.test.js +47 -0
  246. package/test/wayland-frontend.test.js +83 -0
  247. package/test/wayland-urlbar.test.js +38 -0
  248. package/test/window-resize.test.js +36 -0
  249. package/tools/bench-raw-capture.js +32 -0
@@ -0,0 +1,700 @@
1
+ export const nonvisualTypes = new Set([
2
+ 'MediaPlayer','AudioOutput','IdleInhibitor',
3
+ 'LinearGradient',
4
+ 'XmlListModel',
5
+ 'XmlListModelRole',
6
+ 'WorkerScript',
7
+ 'LoggingCategory',
8
+ 'ListModel',
9
+ 'DelegateModel',
10
+ 'DelegateModelGroup',
11
+ 'PointHandler',
12
+ 'Binding',
13
+ 'Gradient',
14
+ 'GradientStop',
15
+ 'IpcHandler',
16
+ 'DragHandler',
17
+ 'FrameAnimation',
18
+ 'ShellRoot',
19
+ 'Behavior',
20
+ 'NumberAnimation',
21
+ 'PropertyAnimation',
22
+ 'PauseAnimation',
23
+ 'SequentialAnimation',
24
+ 'ParallelAnimation',
25
+ 'ScriptAction',
26
+ 'PropertyAction',
27
+ 'Component',
28
+ 'Scale',
29
+ 'Translate',
30
+ 'Repeater',
31
+ 'TapHandler',
32
+ 'HoverHandler',
33
+ 'QtObject',
34
+ 'Singleton',
35
+ 'Timer',
36
+ 'Connections',
37
+ 'FileView',
38
+ 'Process',
39
+ 'StdioCollector',
40
+ 'SplitParser',
41
+ 'TextMetrics',
42
+ 'FontMetrics',
43
+ ]);
44
+ export const typeProperties = {
45
+ MediaPlayer:['source','autoPlay','audioOutput','videoOutput','position','duration','playbackState','playing','mediaStatus','error','errorString','hasAudio','hasVideo','seekable','bufferProgress','loops','play','pause','stop'],
46
+ AudioOutput:['muted','volume'],
47
+ VideoOutput:['fillMode','sourceRect','contentRect'],
48
+ IdleInhibitor:['enabled','window','supported'],
49
+
50
+ LinearGradient: ['x1', 'y1', 'x2', 'y2', 'stops'],
51
+ XmlListModel: [
52
+ 'source',
53
+ 'xml',
54
+ 'query',
55
+ 'status',
56
+ 'progress',
57
+ 'count',
58
+ 'reload',
59
+ 'get',
60
+ 'index',
61
+ 'data',
62
+ 'errorString',
63
+ ],
64
+ XmlListModelRole: ['name', 'elementName', 'attributeName'],
65
+ WorkerScript: ['source', 'ready', 'sendMessage'],
66
+ LoggingCategory: ['name', 'defaultLogLevel'],
67
+ ListView: [
68
+ 'footer',
69
+ 'header',
70
+ 'footerItem',
71
+ 'headerItem',
72
+ 'model',
73
+ 'delegate',
74
+ 'count',
75
+ 'currentIndex',
76
+ 'currentItem',
77
+ 'contentItem',
78
+ 'itemAtIndex',
79
+ 'itemAt',
80
+ 'indexAt',
81
+ 'positionViewAtIndex',
82
+ 'positionViewAtBeginning',
83
+ 'positionViewAtEnd',
84
+ 'forceLayout',
85
+ 'cacheBuffer',
86
+ 'displayMarginBeginning',
87
+ 'displayMarginEnd',
88
+ 'reuseItems',
89
+ 'keyNavigationEnabled',
90
+ 'keyNavigationWraps',
91
+ 'highlightMoveDuration',
92
+ 'highlightRangeMode',
93
+ 'highlightFollowsCurrentItem',
94
+ 'preferredHighlightBegin',
95
+ 'preferredHighlightEnd',
96
+ 'orientation',
97
+ 'section',
98
+ ],
99
+ GridView: [
100
+ 'highlightFollowsCurrentItem',
101
+ 'highlightRangeMode',
102
+ 'preferredHighlightBegin',
103
+ 'preferredHighlightEnd',
104
+ 'footer',
105
+ 'header',
106
+ 'footerItem',
107
+ 'headerItem',
108
+ 'model',
109
+ 'delegate',
110
+ 'count',
111
+ 'currentIndex',
112
+ 'currentItem',
113
+ 'itemAtIndex',
114
+ 'itemAt',
115
+ 'indexAt',
116
+ 'positionViewAtIndex',
117
+ 'positionViewAtBeginning',
118
+ 'positionViewAtEnd',
119
+ 'forceLayout',
120
+ 'cacheBuffer',
121
+ 'displayMarginBeginning',
122
+ 'displayMarginEnd',
123
+ 'reuseItems',
124
+ 'keyNavigationEnabled',
125
+ 'keyNavigationWraps',
126
+ 'highlightMoveDuration',
127
+ 'cellWidth',
128
+ 'cellHeight',
129
+ 'flow',
130
+ ],
131
+ ListModel: [
132
+ 'count',
133
+ 'get',
134
+ 'append',
135
+ 'insert',
136
+ 'remove',
137
+ 'clear',
138
+ 'set',
139
+ 'setProperty',
140
+ 'move',
141
+ 'dynamicRoles',
142
+ ],
143
+ DelegateModel: [
144
+ 'model',
145
+ 'delegate',
146
+ 'groups',
147
+ 'items',
148
+ 'persistedItems',
149
+ 'filterOnGroup',
150
+ 'count',
151
+ ],
152
+ DelegateModelGroup: [
153
+ 'name',
154
+ 'includeByDefault',
155
+ 'count',
156
+ 'get',
157
+ 'addGroups',
158
+ 'removeGroups',
159
+ 'create',
160
+ 'insert',
161
+ 'remove',
162
+ 'move',
163
+ ],
164
+ IpcHandler: ['target', 'enabled'],
165
+ Binding: ['target', 'property', 'value', 'when', 'delayed', 'restoreMode'],
166
+ Gradient: ['orientation', 'stops'],
167
+ GradientStop: ['position', 'color'],
168
+ PathRectangle: [
169
+ 'x',
170
+ 'y',
171
+ 'width',
172
+ 'height',
173
+ 'radius',
174
+ 'topLeftRadius',
175
+ 'topRightRadius',
176
+ 'bottomLeftRadius',
177
+ 'bottomRightRadius',
178
+ ],
179
+ PointHandler: [
180
+ 'enabled',
181
+ 'acceptedButtons',
182
+ 'active',
183
+ 'point',
184
+ 'target',
185
+ 'grabPermissions',
186
+ ],
187
+ DropArea: ['keys', 'containsDrag', 'drag'],
188
+ DragHandler: [
189
+ 'target',
190
+ 'enabled',
191
+ 'acceptedButtons',
192
+ 'active',
193
+ 'dragThreshold',
194
+ 'persistentTranslation',
195
+ 'activeTranslation',
196
+ 'centroid',
197
+ 'xAxis',
198
+ 'yAxis',
199
+ 'grabPermissions',
200
+ ],
201
+ FrameAnimation: [
202
+ 'running',
203
+ 'paused',
204
+ 'frameTime',
205
+ 'smoothFrameTime',
206
+ 'elapsedTime',
207
+ 'currentFrame',
208
+ 'start',
209
+ 'stop',
210
+ 'restart',
211
+ ],
212
+ Image: [
213
+ 'source',
214
+ 'sourceSize',
215
+ 'sourceClipRect',
216
+ 'fillMode',
217
+ 'asynchronous',
218
+ 'cache',
219
+ 'status',
220
+ 'progress',
221
+ 'smooth',
222
+ 'mipmap',
223
+ 'paintedWidth',
224
+ 'paintedHeight',
225
+ 'mirror',
226
+ 'autoTransform',
227
+ 'retainWhileLoading',
228
+ ],
229
+ Flickable: [
230
+ 'contentX',
231
+ 'contentY',
232
+ 'contentWidth',
233
+ 'contentHeight',
234
+ 'contentItem',
235
+ 'interactive',
236
+ 'boundsBehavior',
237
+ 'boundsMovement',
238
+ 'flickableDirection',
239
+ 'moving',
240
+ 'flicking',
241
+ 'dragging',
242
+ 'originX',
243
+ 'originY',
244
+ 'leftMargin',
245
+ 'rightMargin',
246
+ 'topMargin',
247
+ 'bottomMargin',
248
+ 'atXBeginning',
249
+ 'atXEnd',
250
+ 'atYBeginning',
251
+ 'atYEnd',
252
+ 'cancelFlick',
253
+ 'returnToBounds',
254
+ 'flick',
255
+ 'pressDelay',
256
+ 'pixelAligned',
257
+ 'maximumFlickVelocity',
258
+ 'flickDeceleration',
259
+ ],
260
+ TextInput: [
261
+ 'text',
262
+ 'font',
263
+ 'color',
264
+ 'cursorPosition',
265
+ 'cursorVisible',
266
+ 'selectionStart',
267
+ 'selectionEnd',
268
+ 'selectedText',
269
+ 'select',
270
+ 'selectAll',
271
+ 'deselect',
272
+ 'insert',
273
+ 'remove',
274
+ 'positionAt',
275
+ 'positionToRectangle',
276
+ 'cursorRectangle',
277
+ 'contentWidth',
278
+ 'contentHeight',
279
+ 'echoMode',
280
+ 'passwordCharacter',
281
+ 'maximumLength',
282
+ 'inputMethodHints',
283
+ 'inputMethodComposing',
284
+ 'acceptableInput',
285
+ 'validator',
286
+ 'autoScroll',
287
+ 'persistentSelection',
288
+ 'renderType',
289
+ 'selectionColor',
290
+ 'selectedTextColor',
291
+ ],
292
+ TextEdit: [
293
+ 'text',
294
+ 'font',
295
+ 'color',
296
+ 'cursorPosition',
297
+ 'cursorVisible',
298
+ 'selectionStart',
299
+ 'selectionEnd',
300
+ 'selectedText',
301
+ 'select',
302
+ 'selectAll',
303
+ 'deselect',
304
+ 'insert',
305
+ 'remove',
306
+ 'contentWidth',
307
+ 'contentHeight',
308
+ ],
309
+ Behavior: ['enabled', 'targetProperty', 'animation'],
310
+ NumberAnimation: [
311
+ 'target',
312
+ 'targets',
313
+ 'property',
314
+ 'properties',
315
+ 'from',
316
+ 'to',
317
+ 'duration',
318
+ 'easing',
319
+ 'running',
320
+ 'loops',
321
+ 'alwaysRunToEnd',
322
+ 'start',
323
+ 'stop',
324
+ 'restart',
325
+ 'complete',
326
+ ],
327
+ PropertyAnimation: [
328
+ 'target',
329
+ 'targets',
330
+ 'property',
331
+ 'properties',
332
+ 'from',
333
+ 'to',
334
+ 'duration',
335
+ 'easing',
336
+ 'running',
337
+ 'loops',
338
+ 'start',
339
+ 'stop',
340
+ 'restart',
341
+ 'complete',
342
+ ],
343
+ PauseAnimation: ['duration', 'running', 'loops', 'start', 'stop', 'restart'],
344
+ SequentialAnimation: ['running', 'loops', 'start', 'stop', 'restart'],
345
+ ParallelAnimation: ['running', 'loops', 'start', 'stop', 'restart'],
346
+ ScriptAction: ['script', 'running'],
347
+ PropertyAction: ['target', 'property', 'value', 'running'],
348
+ Component: ['status', 'createObject', 'errorString'],
349
+ Loader: [
350
+ 'source',
351
+ 'sourceComponent',
352
+ 'active',
353
+ 'asynchronous',
354
+ 'item',
355
+ 'status',
356
+ 'progress',
357
+ 'setSource',
358
+ ],
359
+
360
+ Scale: ['xScale', 'yScale', 'origin'],
361
+ Translate: ['x', 'y'],
362
+ Shape: ['preferredRendererType', 'transform'],
363
+ ShaderEffectSource: ['sourceItem', 'sourceRect', 'textureSize', 'hideSource', 'live', 'scheduleUpdate', 'scheduledUpdateCompleted'],
364
+ ShapePath: [
365
+ 'fillItem',
366
+ 'fillGradient',
367
+ 'strokeColor',
368
+ 'fillColor',
369
+ 'strokeWidth',
370
+ 'capStyle',
371
+ 'joinStyle',
372
+ 'strokeStyle',
373
+ 'dashPattern',
374
+ 'dashOffset',
375
+ 'fillRule',
376
+ ],
377
+ PathSvg: ['path'],
378
+ Row: ['spacing'],
379
+ Flow: ['flow', 'spacing', 'layoutDirection'],
380
+ RowLayout: ['spacing', 'layoutDirection', 'uniformCellSizes'],
381
+ ColumnLayout: ['spacing', 'uniformCellSizes'],
382
+ Grid: ['columns', 'rows', 'spacing', 'rowSpacing', 'columnSpacing'],
383
+
384
+ Repeater: ['model', 'delegate', 'count', 'itemAt'],
385
+ MouseArea: [
386
+ 'acceptedButtons',
387
+ 'hoverEnabled',
388
+ 'pressed',
389
+ 'containsMouse',
390
+ 'mouseX',
391
+ 'mouseY',
392
+ 'preventStealing',
393
+ 'propagateComposedEvents',
394
+ 'cursorShape',
395
+ ],
396
+ TapHandler: [
397
+ 'enabled',
398
+ 'acceptedButtons',
399
+ 'gesturePolicy',
400
+ 'tapped',
401
+ 'pressed',
402
+ 'point',
403
+ 'tapCount',
404
+ ],
405
+ HoverHandler: ['enabled', 'cursorShape', 'hovered', 'point'],
406
+ Timer: [
407
+ 'interval',
408
+ 'running',
409
+ 'repeat',
410
+ 'triggeredOnStart',
411
+ 'start',
412
+ 'stop',
413
+ 'restart',
414
+ 'triggered',
415
+ ],
416
+ Connections: ['target', 'enabled', 'ignoreUnknownSignals'],
417
+ FileView: [
418
+ 'atomicWrites',
419
+ 'setText',
420
+ 'setData',
421
+ 'path',
422
+ 'blockLoading',
423
+ 'preload',
424
+ 'watchChanges',
425
+ 'printErrors',
426
+ 'loaded',
427
+ 'text',
428
+ 'data',
429
+ 'reload',
430
+ 'waitForJob',
431
+ 'loadedChanged',
432
+ 'fileChanged',
433
+ 'loadFailed',
434
+ ],
435
+ Process: [
436
+ 'running',
437
+ 'command',
438
+ 'stdout',
439
+ 'stderr',
440
+ 'exited',
441
+ 'startDetached',
442
+ 'stdinEnabled',
443
+ 'write',
444
+ 'signal',
445
+ 'closeWriteChannel',
446
+ 'workingDirectory',
447
+ 'environment',
448
+ 'clearEnvironment',
449
+ 'processId',
450
+ ],
451
+ SplitParser: ['splitMarker', 'read'],
452
+ StdioCollector: ['text', 'data', 'waitForEnd', 'streamFinished'],
453
+ TextMetrics: [
454
+ 'elide',
455
+ 'elideWidth',
456
+ 'elidedText',
457
+ 'text',
458
+ 'font',
459
+ 'advanceWidth',
460
+ 'width',
461
+ 'height',
462
+ 'boundingRect',
463
+ ],
464
+ FontMetrics: [
465
+ 'elidedText',
466
+ 'boundingRect',
467
+ 'tightBoundingRect',
468
+ 'font',
469
+ 'height',
470
+ 'ascent',
471
+ 'descent',
472
+ 'averageCharacterWidth',
473
+ 'advanceWidth',
474
+ ],
475
+ };
476
+ for (const type of ['ListView', 'GridView'])
477
+ typeProperties[type].push(...typeProperties.Flickable);
478
+
479
+ // Serialized into the page together with the reactive runtime.
480
+ export function createQt() {
481
+ const bindingValues = new WeakMap();
482
+ const clamp = (x) => Math.max(0, Math.min(1, Number(x)));
483
+ function rgba(r, g, b, a = 1) {
484
+ r = clamp(r);
485
+ g = clamp(g);
486
+ b = clamp(b);
487
+ a = clamp(a);
488
+ const max = Math.max(r, g, b),
489
+ min = Math.min(r, g, b),
490
+ d = max - min;
491
+ const hue =
492
+ d === 0
493
+ ? -1
494
+ : (max === r
495
+ ? (g - b) / d + (g < b ? 6 : 0)
496
+ : max === g
497
+ ? (b - r) / d + 2
498
+ : (r - g) / d + 4) / 6;
499
+ const hex = (v) =>
500
+ Math.round(v * 255)
501
+ .toString(16)
502
+ .padStart(2, '0');
503
+ return Object.freeze({
504
+ r,
505
+ g,
506
+ b,
507
+ a,
508
+ hsvSaturation: max === 0 ? 0 : d / max,
509
+ hsvValue: max,
510
+ hsvHue: hue,
511
+ toString() {
512
+ return '#' + (a < 1 ? hex(a) : '') + hex(r) + hex(g) + hex(b);
513
+ },
514
+ });
515
+ }
516
+ function color(value) {
517
+ if (value && typeof value === 'object' && 'r' in value) return value;
518
+ let s = String(value).toLowerCase();
519
+ s =
520
+ {
521
+ black: '#000000',
522
+ white: '#ffffff',
523
+ transparent: '#00000000',
524
+ red: '#ff0000',
525
+ blue: '#0000ff',
526
+ green: '#008000',
527
+ }[s] || s;
528
+ if (/^#[0-9a-f]{3}$/.test(s))
529
+ s = '#' + [...s.slice(1)].map((c) => c + c).join('');
530
+ if (/^#[0-9a-f]{6}$/.test(s))
531
+ return rgba(
532
+ parseInt(s.slice(1, 3), 16) / 255,
533
+ parseInt(s.slice(3, 5), 16) / 255,
534
+ parseInt(s.slice(5, 7), 16) / 255,
535
+ );
536
+ if (/^#[0-9a-f]{8}$/.test(s))
537
+ return rgba(
538
+ parseInt(s.slice(3, 5), 16) / 255,
539
+ parseInt(s.slice(5, 7), 16) / 255,
540
+ parseInt(s.slice(7, 9), 16) / 255,
541
+ parseInt(s.slice(1, 3), 16) / 255,
542
+ );
543
+ throw Error('Unsupported QML color: ' + s);
544
+ }
545
+ const keys = {
546
+ Escape: 0x01000000,
547
+ Tab: 0x01000001,
548
+ Backtab: 0x01000002,
549
+ Backspace: 0x01000003,
550
+ Return: 0x01000004,
551
+ Enter: 0x01000005,
552
+ Insert: 0x01000006,
553
+ Delete: 0x01000007,
554
+ Home: 0x01000010,
555
+ End: 0x01000011,
556
+ Left: 0x01000012,
557
+ Up: 0x01000013,
558
+ Right: 0x01000014,
559
+ Down: 0x01000015,
560
+ PageUp: 0x01000016,
561
+ PageDown: 0x01000017,
562
+ Space: 32,
563
+ AltGr: 0x01001103,
564
+ CapsLock: 0x01000024,
565
+ NumLock: 0x01000025,
566
+ ScrollLock: 0x01000026,
567
+ Menu: 0x01000055,
568
+ };
569
+ Object.assign(keys, {
570
+ Exclam: 33,
571
+ QuoteDbl: 34,
572
+ NumberSign: 35,
573
+ Dollar: 36,
574
+ Percent: 37,
575
+ Ampersand: 38,
576
+ Apostrophe: 39,
577
+ ParenLeft: 40,
578
+ ParenRight: 41,
579
+ Asterisk: 42,
580
+ Plus: 43,
581
+ Comma: 44,
582
+ Minus: 45,
583
+ Period: 46,
584
+ Slash: 47,
585
+ Colon: 58,
586
+ Semicolon: 59,
587
+ Less: 60,
588
+ Equal: 61,
589
+ Greater: 62,
590
+ Question: 63,
591
+ At: 64,
592
+ BracketLeft: 91,
593
+ Backslash: 92,
594
+ BracketRight: 93,
595
+ AsciiCircum: 94,
596
+ Underscore: 95,
597
+ QuoteLeft: 96,
598
+ BraceLeft: 123,
599
+ Bar: 124,
600
+ BraceRight: 125,
601
+ AsciiTilde: 126,
602
+ Shift: 0x01000020,
603
+ Control: 0x01000021,
604
+ Meta: 0x01000022,
605
+ Alt: 0x01000023,
606
+ });
607
+ for (let i = 0; i < 26; i++) keys[String.fromCharCode(65 + i)] = 65 + i;
608
+ for (let i = 0; i < 10; i++) keys[String(i)] = 48 + i;
609
+ for (let i = 1; i <= 35; i++) keys['F' + i] = 0x01000030 + i - 1;
610
+ return {
611
+ ...Object.fromEntries(
612
+ Object.entries(keys).map(([name, value]) => ['Key_' + name, value]),
613
+ ),
614
+ rgba,
615
+ color,
616
+ darker: (v, f = 2) => {
617
+ const c = color(v);
618
+ return rgba(c.r / f, c.g / f, c.b / f, c.a);
619
+ },
620
+ application: { active: true },
621
+ styleHints: {
622
+ wheelScrollLines: 3,
623
+ mouseDoubleClickInterval: 400,
624
+ startDragDistance: 10,
625
+ startDragTime: 500,
626
+ },
627
+ atob,
628
+ alpha: (value, a) => {
629
+ const c = color(value);
630
+ return rgba(c.r, c.g, c.b, a);
631
+ },
632
+ colorEqual: (a, b) => {
633
+ const x = color(a),
634
+ y = color(b);
635
+ return ['r', 'g', 'b', 'a'].every((k) => Math.abs(x[k] - y[k]) < 1 / 255);
636
+ },
637
+ point: (x, y) => ({ x, y }),
638
+ size: (width, height) => ({ width, height }),
639
+ rect: (x, y, width, height) => ({ x, y, width, height }),
640
+ MouseFocusReason: 0,
641
+ TabFocusReason: 1,
642
+ BacktabFocusReason: 2,
643
+ ActiveWindowFocusReason: 3,
644
+ OtherFocusReason: 7,
645
+ Horizontal: 1,
646
+ Vertical: 2,
647
+ SplitHCursor: 12,
648
+ UserRole: 256,
649
+ AlignLeft: 1,
650
+ AlignRight: 2,
651
+ AlignHCenter: 4,
652
+ AlignTop: 32,
653
+ AlignBottom: 64,
654
+ AlignVCenter: 128,
655
+ AlignBaseline: 256,
656
+ AlignCenter: 132,
657
+ LeftToRight: 0,
658
+ RightToLeft: 1,
659
+ CopyAction: 1,
660
+ MoveAction: 2,
661
+ LinkAction: 4,
662
+ IgnoreAction: 0,
663
+ LeftButton: 1,
664
+ RightButton: 2,
665
+ MiddleButton: 4,
666
+ BackButton: 8,
667
+ ForwardButton: 16,
668
+ ArrowCursor: 0,
669
+ IBeamCursor: 4,
670
+ SizeVerCursor: 5,
671
+ SizeHorCursor: 6,
672
+ OpenHandCursor: 17,
673
+ ClosedHandCursor: 18,
674
+ NoButton: 0,
675
+ AllButtons: 0x07ffffff,
676
+ NoModifier: 0,
677
+ NoScrollPhase: 0,
678
+ ScrollBegin: 1,
679
+ ScrollUpdate: 2,
680
+ ScrollEnd: 3,
681
+ ScrollMomentum: 4,
682
+ ShiftModifier: 0x02000000,
683
+ PointingHandCursor: 13,
684
+ ControlModifier: 0x04000000,
685
+ AltModifier: 0x08000000,
686
+ MetaModifier: 0x10000000,
687
+ binding: (fn) => {
688
+ if (typeof fn !== 'function')
689
+ throw Error('Qt.binding expects a function');
690
+ const value = {};
691
+ bindingValues.set(value, fn);
692
+ return value;
693
+ },
694
+ bindingValue: (value) =>
695
+ value && typeof value === 'object' ? bindingValues.get(value) : undefined,
696
+ createComponent: () => {
697
+ throw Error('Qt.createComponent is not implemented');
698
+ },
699
+ };
700
+ }