zui 0.0.1 → 0.0.3

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 (135) hide show
  1. checksums.yaml +4 -4
  2. data/Components/Builtins/Accordion.qml +1 -1
  3. data/Components/Builtins/ActionButton.qml +1 -3
  4. data/Components/Builtins/AlertDialog.qml +2 -1
  5. data/Components/Builtins/AnimatedImage.qml +0 -2
  6. data/Components/Builtins/AreaChart.qml +0 -2
  7. data/Components/Builtins/AspectRatio.qml +0 -2
  8. data/Components/Builtins/Avatar.qml +0 -2
  9. data/Components/Builtins/Badge.qml +0 -2
  10. data/Components/Builtins/Banner.qml +2 -2
  11. data/Components/Builtins/BarChart.qml +0 -2
  12. data/Components/Builtins/BarIconButton.qml +1 -3
  13. data/Components/Builtins/BarIndicator.qml +3 -3
  14. data/Components/Builtins/BorderImage.qml +0 -2
  15. data/Components/Builtins/BorderOverlay.qml +0 -2
  16. data/Components/Builtins/Breadcrumb.qml +2 -2
  17. data/Components/Builtins/Button.qml +1 -2
  18. data/Components/Builtins/ButtonGroup.qml +0 -2
  19. data/Components/Builtins/Card.qml +0 -2
  20. data/Components/Builtins/Center.qml +0 -2
  21. data/Components/Builtins/CheckDelegate.qml +2 -1
  22. data/Components/Builtins/Checkbox.qml +1 -3
  23. data/Components/Builtins/Chip.qml +2 -4
  24. data/Components/Builtins/Column.qml +0 -2
  25. data/Components/Builtins/ColumnLayout.qml +0 -2
  26. data/Components/Builtins/ConfirmDialog.qml +0 -2
  27. data/Components/Builtins/ConstrainedBox.qml +0 -2
  28. data/Components/Builtins/Container.qml +0 -2
  29. data/Components/Builtins/CursorSurface.qml +0 -2
  30. data/Components/Builtins/DelayButton.qml +0 -2
  31. data/Components/Builtins/Dial.qml +0 -2
  32. data/Components/Builtins/Divider.qml +0 -2
  33. data/Components/Builtins/Dropdown.qml +0 -2
  34. data/Components/Builtins/ExpansionPanel.qml +1 -1
  35. data/Components/Builtins/FittedBox.qml +0 -2
  36. data/Components/Builtins/Flickable.qml +0 -2
  37. data/Components/Builtins/Flipable.qml +0 -2
  38. data/Components/Builtins/Flow.qml +0 -2
  39. data/Components/Builtins/FocusScope.qml +0 -2
  40. data/Components/Builtins/FontLoader.qml +0 -2
  41. data/Components/Builtins/Grid.qml +0 -2
  42. data/Components/Builtins/GridLayout.qml +0 -2
  43. data/Components/Builtins/GridView.qml +1 -1
  44. data/Components/Builtins/Icon.qml +1 -3
  45. data/Components/Builtins/Image.qml +0 -2
  46. data/Components/Builtins/ItemDelegate.qml +2 -2
  47. data/Components/Builtins/KeyCatcher.qml +0 -2
  48. data/Components/Builtins/Label.qml +0 -2
  49. data/Components/Builtins/LineChart.qml +0 -2
  50. data/Components/Builtins/ListView.qml +1 -3
  51. data/Components/Builtins/Loader.qml +0 -2
  52. data/Components/Builtins/Markdown.qml +0 -2
  53. data/Components/Builtins/ModalSheet.qml +1 -1
  54. data/Components/Builtins/MultiSelect.qml +0 -2
  55. data/Components/Builtins/NavigationRail.qml +1 -1
  56. data/Components/Builtins/NumberField.qml +0 -2
  57. data/Components/Builtins/OpticalGlyph.qml +1 -3
  58. data/Components/Builtins/PanelHero.qml +0 -2
  59. data/Components/Builtins/PasswordField.qml +1 -3
  60. data/Components/Builtins/Progress.qml +0 -2
  61. data/Components/Builtins/RadioButton.qml +0 -2
  62. data/Components/Builtins/RadioGroup.qml +0 -2
  63. data/Components/Builtins/RangeSlider.qml +0 -2
  64. data/Components/Builtins/Rectangle.qml +0 -2
  65. data/Components/Builtins/RichText.qml +0 -2
  66. data/Components/Builtins/RoundButton.qml +3 -3
  67. data/Components/Builtins/Row.qml +0 -2
  68. data/Components/Builtins/RowLayout.qml +0 -2
  69. data/Components/Builtins/ScreenCapture.qml +1 -1
  70. data/Components/Builtins/Scroll.qml +0 -2
  71. data/Components/Builtins/SearchableDropdown.qml +0 -2
  72. data/Components/Builtins/SectionHeader.qml +0 -2
  73. data/Components/Builtins/SelectableText.qml +0 -2
  74. data/Components/Builtins/Separator.qml +0 -2
  75. data/Components/Builtins/Slider.qml +0 -2
  76. data/Components/Builtins/Spacer.qml +0 -2
  77. data/Components/Builtins/SpinBox.qml +0 -2
  78. data/Components/Builtins/SplitView.qml +0 -2
  79. data/Components/Builtins/Stack.qml +0 -2
  80. data/Components/Builtins/StackLayout.qml +0 -2
  81. data/Components/Builtins/SwipeDelegate.qml +3 -3
  82. data/Components/Builtins/TabButton.qml +1 -1
  83. data/Components/Builtins/Text.qml +0 -2
  84. data/Components/Builtins/TextArea.qml +0 -2
  85. data/Components/Builtins/TextField.qml +0 -2
  86. data/Components/Builtins/TextMetrics.qml +0 -2
  87. data/Components/Builtins/Toast.qml +1 -1
  88. data/Components/Builtins/Toggle.qml +0 -2
  89. data/Components/Builtins/ToggleSwitch.qml +0 -2
  90. data/Components/Builtins/ToolButton.qml +3 -3
  91. data/Components/Builtins/Tooltip.qml +0 -2
  92. data/Components/Builtins/VectorImage.qml +1 -2
  93. data/Components/Builtins/Video.qml +1 -2
  94. data/Components/Builtins/WidgetButton.qml +0 -2
  95. data/Components/Builtins/Wrap.qml +0 -2
  96. data/ControlNode.qml +10 -22
  97. data/Controls/BarIconButton.qml +1 -1
  98. data/Controls/BarIndicator.qml +1 -1
  99. data/Controls/Button.qml +2 -1
  100. data/Controls/OpticalGlyph.qml +1 -1
  101. data/Desktop.qml +7 -3
  102. data/Fonts/FontAwesome-Brands.otf +0 -0
  103. data/Fonts/FontAwesome-Solid.otf +0 -0
  104. data/Fonts/LICENSE-FontAwesome.txt +165 -0
  105. data/Fonts/LICENSE-RobotoMono.txt +93 -0
  106. data/Fonts/RobotoMono-Bold.otf +0 -0
  107. data/Fonts/RobotoMono-Regular.otf +0 -0
  108. data/README.md +27 -14
  109. data/Service.qml +30 -6
  110. data/THIRD_PARTY_NOTICES.md +14 -0
  111. data/Theme/Fonts.qml +32 -0
  112. data/Theme/Style.qml +1 -1
  113. data/Theme/qmldir +1 -0
  114. data/lib/zui/application.rb +28 -3
  115. data/lib/zui/builder.rb +0 -1
  116. data/lib/zui/cli.rb +36 -6
  117. data/lib/zui/client.rb +349 -0
  118. data/lib/zui/components.rb +0 -1
  119. data/lib/zui/distribution.rb +53 -16
  120. data/lib/zui/generator.rb +1 -0
  121. data/lib/zui/host.rb +16 -94
  122. data/lib/zui/runner.rb +1 -1
  123. data/lib/zui/runtime.rb +1 -1
  124. data/lib/zui.rb +2 -1
  125. metadata +13 -13
  126. data/Components/Builtins/WebView.qml +0 -57
  127. data/native/CMakeLists.txt +0 -45
  128. data/native/ZuiClipboard.cpp +0 -16
  129. data/native/ZuiClipboard.h +0 -16
  130. data/native/ZuiProcess.cpp +0 -84
  131. data/native/ZuiProcess.h +0 -34
  132. data/native/main.cpp +0 -64
  133. data/vendor/host/linux-x86_64/PROVENANCE.md +0 -15
  134. data/vendor/host/linux-x86_64/zui-host +0 -0
  135. data/vendor/host/linux-x86_64/zui-host.sha256 +0 -1
data/Desktop.qml CHANGED
@@ -46,7 +46,7 @@ QQC.ApplicationWindow {
46
46
  id: renderer
47
47
  anchors.fill: parent
48
48
  anchors.margins: Number(window.option("padding", 20))
49
- visible: window.activeSurface !== "" && service.rootId(window.activeSurface) !== ""
49
+ visible: Fonts.ready && window.activeSurface !== "" && service.rootId(window.activeSurface) !== ""
50
50
  bridge: service
51
51
  surfaceName: window.activeSurface
52
52
  controlId: service.rootId(surfaceName)
@@ -58,10 +58,14 @@ QQC.ApplicationWindow {
58
58
  anchors.centerIn: parent
59
59
  spacing: Style.spacing.sm
60
60
  visible: !renderer.visible
61
- QQC.BusyIndicator { anchors.horizontalCenter: parent.horizontalCenter; running: !service.ready && service.lastError === "" }
61
+ QQC.BusyIndicator {
62
+ anchors.horizontalCenter: parent.horizontalCenter
63
+ running: (!service.ready || !Fonts.ready) && service.lastError === "" && !Fonts.failed
64
+ }
62
65
  Text {
63
66
  anchors.horizontalCenter: parent.horizontalCenter
64
- text: service.lastError !== "" ? service.lastError : "Starting Zui…"
67
+ text: service.lastError !== "" ? service.lastError
68
+ : (Fonts.failed ? "Zui could not load its bundled fonts" : "Starting Zui…")
65
69
  color: Color.foreground
66
70
  font.family: Style.font.family
67
71
  font.pixelSize: Style.font.body
Binary file
Binary file
@@ -0,0 +1,165 @@
1
+ Fonticons, Inc. (https://fontawesome.com)
2
+
3
+ --------------------------------------------------------------------------------
4
+
5
+ Font Awesome Free License
6
+
7
+ Font Awesome Free is free, open source, and GPL friendly. You can use it for
8
+ commercial projects, open source projects, or really almost whatever you want.
9
+ Full Font Awesome Free license: https://fontawesome.com/license/free.
10
+
11
+ --------------------------------------------------------------------------------
12
+
13
+ # Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/)
14
+
15
+ The Font Awesome Free download is licensed under a Creative Commons
16
+ Attribution 4.0 International License and applies to all icons packaged
17
+ as SVG and JS file types.
18
+
19
+ --------------------------------------------------------------------------------
20
+
21
+ # Fonts: SIL OFL 1.1 License
22
+
23
+ In the Font Awesome Free download, the SIL OFL license applies to all icons
24
+ packaged as web and desktop font files.
25
+
26
+ Copyright (c) 2026 Fonticons, Inc. (https://fontawesome.com)
27
+ with Reserved Font Name: "Font Awesome".
28
+
29
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
30
+ This license is copied below, and is also available with a FAQ at:
31
+ http://scripts.sil.org/OFL
32
+
33
+ SIL OPEN FONT LICENSE
34
+ Version 1.1 - 26 February 2007
35
+
36
+ PREAMBLE
37
+ The goals of the Open Font License (OFL) are to stimulate worldwide
38
+ development of collaborative font projects, to support the font creation
39
+ efforts of academic and linguistic communities, and to provide a free and
40
+ open framework in which fonts may be shared and improved in partnership
41
+ with others.
42
+
43
+ The OFL allows the licensed fonts to be used, studied, modified and
44
+ redistributed freely as long as they are not sold by themselves. The
45
+ fonts, including any derivative works, can be bundled, embedded,
46
+ redistributed and/or sold with any software provided that any reserved
47
+ names are not used by derivative works. The fonts and derivatives,
48
+ however, cannot be released under any other type of license. The
49
+ requirement for fonts to remain under this license does not apply
50
+ to any document created using the fonts or their derivatives.
51
+
52
+ DEFINITIONS
53
+ "Font Software" refers to the set of files released by the Copyright
54
+ Holder(s) under this license and clearly marked as such. This may
55
+ include source files, build scripts and documentation.
56
+
57
+ "Reserved Font Name" refers to any names specified as such after the
58
+ copyright statement(s).
59
+
60
+ "Original Version" refers to the collection of Font Software components as
61
+ distributed by the Copyright Holder(s).
62
+
63
+ "Modified Version" refers to any derivative made by adding to, deleting,
64
+ or substituting — in part or in whole — any of the components of the
65
+ Original Version, by changing formats or by porting the Font Software to a
66
+ new environment.
67
+
68
+ "Author" refers to any designer, engineer, programmer, technical
69
+ writer or other person who contributed to the Font Software.
70
+
71
+ PERMISSION & CONDITIONS
72
+ Permission is hereby granted, free of charge, to any person obtaining
73
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
74
+ redistribute, and sell modified and unmodified copies of the Font
75
+ Software, subject to the following conditions:
76
+
77
+ 1) Neither the Font Software nor any of its individual components,
78
+ in Original or Modified Versions, may be sold by itself.
79
+
80
+ 2) Original or Modified Versions of the Font Software may be bundled,
81
+ redistributed and/or sold with any software, provided that each copy
82
+ contains the above copyright notice and this license. These can be
83
+ included either as stand-alone text files, human-readable headers or
84
+ in the appropriate machine-readable metadata fields within text or
85
+ binary files as long as those fields can be easily viewed by the user.
86
+
87
+ 3) No Modified Version of the Font Software may use the Reserved Font
88
+ Name(s) unless explicit written permission is granted by the corresponding
89
+ Copyright Holder. This restriction only applies to the primary font name as
90
+ presented to the users.
91
+
92
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
93
+ Software shall not be used to promote, endorse or advertise any
94
+ Modified Version, except to acknowledge the contribution(s) of the
95
+ Copyright Holder(s) and the Author(s) or with their explicit written
96
+ permission.
97
+
98
+ 5) The Font Software, modified or unmodified, in part or in whole,
99
+ must be distributed entirely under this license, and must not be
100
+ distributed under any other license. The requirement for fonts to
101
+ remain under this license does not apply to any document created
102
+ using the Font Software.
103
+
104
+ TERMINATION
105
+ This license becomes null and void if any of the above conditions are
106
+ not met.
107
+
108
+ DISCLAIMER
109
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
110
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
111
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
112
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
113
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
114
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
115
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
116
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
117
+ OTHER DEALINGS IN THE FONT SOFTWARE.
118
+
119
+ --------------------------------------------------------------------------------
120
+
121
+ # Code: MIT License (https://opensource.org/licenses/MIT)
122
+
123
+ In the Font Awesome Free download, the MIT license applies to all non-font and
124
+ non-icon files.
125
+
126
+ Copyright 2026 Fonticons, Inc.
127
+
128
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
129
+ this software and associated documentation files (the "Software"), to deal in the
130
+ Software without restriction, including without limitation the rights to use, copy,
131
+ modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
132
+ and to permit persons to whom the Software is furnished to do so, subject to the
133
+ following conditions:
134
+
135
+ The above copyright notice and this permission notice shall be included in all
136
+ copies or substantial portions of the Software.
137
+
138
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
139
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
140
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
141
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
142
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
143
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
144
+
145
+ --------------------------------------------------------------------------------
146
+
147
+ # Attribution
148
+
149
+ Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font
150
+ Awesome Free files already contain embedded comments with sufficient
151
+ attribution, so you shouldn't need to do anything additional when using these
152
+ files normally.
153
+
154
+ We've kept attribution comments terse, so we ask that you do not actively work
155
+ to remove them from files, especially code. They're a great way for folks to
156
+ learn about Font Awesome.
157
+
158
+ --------------------------------------------------------------------------------
159
+
160
+ # Brand Icons
161
+
162
+ All brand icons are trademarks of their respective owners. The use of these
163
+ trademarks does not indicate endorsement of the trademark holder by Font
164
+ Awesome, nor vice versa. **Please do not use brand logos for any purpose except
165
+ to represent the company, product, or service to which they refer.**
@@ -0,0 +1,93 @@
1
+ Copyright 2015 The Roboto Mono Project Authors (https://github.com/googlefonts/robotomono)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ https://openfontlicense.org
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file
Binary file
data/README.md CHANGED
@@ -1,8 +1,11 @@
1
1
  # Zui
2
2
 
3
- Zui is a platform-neutral Ruby framework for native desktop interfaces powered by Qt and QML.
4
- Ruby owns the application, component tree, state, events, bindings, animation descriptions, and
5
- business logic. QML is the rendering backend, not application code.
3
+ Zui builds beautiful native desktop applications in pure Ruby, with first-class UI, state,
4
+ events, bindings, animation, media, GPU effects, 3D, and application logic. Applications are
5
+ Ruby and assets—there is no application UI language to learn alongside Ruby.
6
+
7
+ Zui is desktop-only. Its native client intentionally excludes browser-engine payloads while
8
+ retaining the complete desktop component catalog.
6
9
 
7
10
  This repository is the reusable core. Distribution integrations live at its edges:
8
11
 
@@ -38,6 +41,7 @@ end
38
41
 
39
42
  ```bash
40
43
  gem install zui
44
+ zui doctor --fix
41
45
  zui new telemetry-console
42
46
  cd telemetry-console
43
47
  zui run main.rb
@@ -48,23 +52,32 @@ Build and install the gem directly from a checkout:
48
52
 
49
53
  ```bash
50
54
  gem build zui.gemspec
51
- gem install ./zui-0.0.1.gem
55
+ gem install ./zui-0.0.3.gem
52
56
  ```
53
57
 
54
- `zui run` uses the bundled host for supported release targets. If a matching host is not
55
- bundled, Zui builds and caches it from the checked-in C++ source with CMake and Qt 6.8 or newer.
58
+ `zui doctor --fix` is the one-time setup for each Zui version and platform. It downloads the
59
+ matching versioned client from GitHub Releases, verifies its SHA-256 checksum and manifest, and
60
+ installs it in the native user cache. `zui configure` performs the same explicit setup operation.
61
+ The prebuilt client is never packaged in or downloaded from the RubyGem. It contains the native
62
+ host and its Qt/QML engine libraries—not the developer's application, Ruby source, or the Zui
63
+ Ruby/QML framework. Setup never changes the global shell environment; `zui run` supplies the
64
+ client paths only to the child application.
65
+
66
+ Developers install Ruby and the `zui` gem. They do not install CMake, a C++ compiler, or Qt. Those
67
+ tools are used only by Zui's release CI to produce the platform clients.
56
68
 
57
- `zui bundle` produces an application directory on Linux and Windows and a standard `.app` bundle
58
- on macOS. Each package includes the application, Zui Ruby runtime, QML renderer, component catalog,
59
- theme, controls, and native host. Ruby and the required Qt runtime libraries must be available on
60
- the destination machine; native installers can add them with the platform's normal deployment
61
- tools.
69
+ `zui bundle` uses a platform template to produce an application directory on Linux and Windows or
70
+ a standard `.app` on macOS. The package combines the application's Ruby/assets, the Zui framework
71
+ runtime and catalog, and a private copy of the configured native Qt/QML client. No system Qt
72
+ installation is used by the finished bundle. The current bundle format expects Ruby 3.1 or newer
73
+ on the destination and supports `ZUI_RUBY` when an installer provides a private Ruby executable.
62
74
 
63
75
  See [Platform support](docs/platforms.md) for host requirements and bundle layouts.
64
76
 
65
- Zui has no separate validation command. `run` opens the app directly, and
66
- `bundle` packages the project directly. Ruby, DSL, protocol, resource, and QML
67
- errors are reported by the operation that actually encounters them.
77
+ `zui doctor` is read-only: it reports platform, Ruby, client, run, and bundle readiness. Add
78
+ `--fix` to download and install the missing client from GitHub Releases. Zui has no separate
79
+ validation command; Ruby, DSL, protocol, resource, and QML errors are reported by the operation
80
+ that encounters them.
68
81
 
69
82
  ## Reusable application UI
70
83
 
data/Service.qml CHANGED
@@ -184,7 +184,17 @@ Item {
184
184
 
185
185
  function applyPatch(message) {
186
186
  if (!validId(message.id))
187
- return reject("invalid patch")
187
+ if (message.op !== "batch") return reject("invalid patch")
188
+ if (message.op === "batch") {
189
+ if (!Array.isArray(message.patches) || message.patches.length === 0 || message.patches.length > 256)
190
+ return reject("patch batch rejected")
191
+ for (var batchIndex = 0; batchIndex < message.patches.length; batchIndex++)
192
+ if (!validSetPatch(message.patches[batchIndex])) return reject("patch batch rejected")
193
+ for (var applyIndex = 0; applyIndex < message.patches.length; applyIndex++)
194
+ applySetPatch(message.patches[applyIndex], false)
195
+ revision += 1
196
+ return true
197
+ }
188
198
  var node = nodeIndex[message.id]
189
199
  if (!node) return reject("patch target rejected")
190
200
 
@@ -250,12 +260,25 @@ Item {
250
260
 
251
261
  if (message.op !== "set" || typeof message.property !== "string") return reject("invalid patch")
252
262
  if (!allowedProperties[node.type][message.property]) return reject("patch target rejected")
253
- var value = message.value
254
- if (!boundedValue(value, 0)) return reject("patch value rejected")
263
+ if (!boundedValue(message.value, 0)) return reject("patch value rejected")
264
+ if (message.animation !== undefined && !validAnimation(message.animation))
265
+ return reject("patch animation rejected")
266
+ return applySetPatch(message, true)
267
+ }
255
268
 
256
- var animation = message.animation
257
- if (animation !== undefined && !validAnimation(animation)) return reject("patch animation rejected")
269
+ function validSetPatch(message) {
270
+ if (!plainObject(message) || message.op !== "set" || !validId(message.id)
271
+ || typeof message.property !== "string") return false
272
+ var node = nodeIndex[message.id]
273
+ if (!node || !allowedProperties[node.type][message.property]) return false
274
+ if (!boundedValue(message.value, 0)) return false
275
+ return message.animation === undefined || validAnimation(message.animation)
276
+ }
258
277
 
278
+ function applySetPatch(message, incrementRevision) {
279
+ var node = nodeIndex[message.id]
280
+ var value = message.value
281
+ var animation = message.animation
259
282
  var replacement = ({ type: node.type, id: node.id })
260
283
  var props = ({})
261
284
  var oldProps = node.props || {}
@@ -280,7 +303,8 @@ Item {
280
303
  for (var id in nodeIndex) nextIndex[id] = nodeIndex[id]
281
304
  nextIndex[node.id] = replacement
282
305
  nodeIndex = nextIndex
283
- revision += 1
306
+ if (incrementRevision) revision += 1
307
+ return true
284
308
  }
285
309
 
286
310
  function validAnimation(animation) {
@@ -0,0 +1,14 @@
1
+ # Third-party notices
2
+
3
+ Zui includes the following fonts so applications render consistently on every
4
+ supported desktop platform:
5
+
6
+ - Roboto Mono Regular and Bold, copyright the Roboto Mono Project Authors,
7
+ licensed under the SIL Open Font License 1.1. The license is included at
8
+ `Fonts/LICENSE-RobotoMono.txt`.
9
+ - Font Awesome Free Solid and Brands, copyright Fonticons, Inc., licensed under the SIL
10
+ Open Font License 1.1. The license is included at
11
+ `Fonts/LICENSE-FontAwesome.txt`.
12
+
13
+ The fonts remain subject to their respective licenses. Zui's source code
14
+ remains licensed under the MIT License.
data/Theme/Fonts.qml ADDED
@@ -0,0 +1,32 @@
1
+ pragma Singleton
2
+ import QtQuick
3
+
4
+ QtObject {
5
+ readonly property FontLoader regularLoader: FontLoader {
6
+ source: Qt.resolvedUrl("../Fonts/RobotoMono-Regular.otf")
7
+ }
8
+ readonly property FontLoader boldLoader: FontLoader {
9
+ source: Qt.resolvedUrl("../Fonts/RobotoMono-Bold.otf")
10
+ }
11
+ readonly property FontLoader iconLoader: FontLoader {
12
+ source: Qt.resolvedUrl("../Fonts/FontAwesome-Solid.otf")
13
+ }
14
+ readonly property FontLoader brandIconLoader: FontLoader {
15
+ source: Qt.resolvedUrl("../Fonts/FontAwesome-Brands.otf")
16
+ }
17
+
18
+ readonly property string family: regularLoader.status === FontLoader.Ready
19
+ ? regularLoader.name : ""
20
+ readonly property string iconFamily: iconLoader.status === FontLoader.Ready
21
+ ? iconLoader.name : family
22
+ readonly property string brandIconFamily: brandIconLoader.status === FontLoader.Ready
23
+ ? brandIconLoader.name : iconFamily
24
+ readonly property bool ready: regularLoader.status === FontLoader.Ready
25
+ && boldLoader.status === FontLoader.Ready
26
+ && iconLoader.status === FontLoader.Ready
27
+ && brandIconLoader.status === FontLoader.Ready
28
+ readonly property bool failed: regularLoader.status === FontLoader.Error
29
+ || boldLoader.status === FontLoader.Error
30
+ || iconLoader.status === FontLoader.Error
31
+ || brandIconLoader.status === FontLoader.Error
32
+ }
data/Theme/Style.qml CHANGED
@@ -11,7 +11,7 @@ QtObject {
11
11
  function selectedFillFor(foreground, accent) { return Qt.rgba(accent.r, accent.g, accent.b, 0.22) }
12
12
 
13
13
  readonly property QtObject font: QtObject {
14
- readonly property string family: "Sans Serif"
14
+ readonly property string family: Fonts.family
15
15
  readonly property int caption: 11
16
16
  readonly property int bodySmall: 12
17
17
  readonly property int body: 14
data/Theme/qmldir CHANGED
@@ -1,5 +1,6 @@
1
1
  module Zui.Theme
2
2
  singleton Color 1.0 Color.qml
3
3
  singleton Style 1.0 Style.qml
4
+ singleton Fonts 1.0 Fonts.qml
4
5
  singleton Border 1.0 Border.qml
5
6
  singleton Util 1.0 Util.qml
@@ -19,6 +19,7 @@ module Zui
19
19
  @output = nil
20
20
  @error = $stderr
21
21
  @running = false
22
+ @patch_batch = nil
22
23
  @write_lock = Mutex.new
23
24
  @state_change_lock = Mutex.new
24
25
  @components = components.dup
@@ -174,13 +175,33 @@ module Zui
174
175
 
175
176
  def state_changed(_name, _previous, _value)
176
177
  @state_change_lock.synchronize do
177
- @structures.dup.each do |structure|
178
- reconcile_structure(structure) if @structures.include?(structure)
178
+ @patch_batch = []
179
+ begin
180
+ @structures.dup.each do |structure|
181
+ reconcile_structure(structure) if @structures.include?(structure)
182
+ end
183
+ @bindings.dup.each { |binding| update_binding(binding) }
184
+ ensure
185
+ patches = @patch_batch
186
+ @patch_batch = nil
179
187
  end
180
- @bindings.dup.each { |binding| update_binding(binding) }
188
+ flush_patch_batch(patches)
181
189
  end
182
190
  end
183
191
 
192
+ def flush_patch_batch(patches)
193
+ return if patches.empty?
194
+ return emit(patches.first) if patches.length == 1
195
+
196
+ batch = {
197
+ "v" => PROTOCOL_VERSION, "type" => "patch", "op" => "batch",
198
+ "patches" => patches.map { |patch| patch.reject { |key, _| %w[v type].include?(key) } }
199
+ }
200
+ return emit(batch) if JSON.generate(batch).bytesize <= MAX_MESSAGE_BYTES
201
+
202
+ patches.each { |patch| emit(patch) }
203
+ end
204
+
184
205
  def update_binding(binding)
185
206
  value = normalize_value(evaluate(binding.reader), binding.property)
186
207
  return if value == binding.last_value
@@ -302,6 +323,10 @@ module Zui
302
323
 
303
324
  def emit(message)
304
325
  return unless @running && @output
326
+ if @patch_batch && message["type"] == "patch" && message["op"] == "set"
327
+ @patch_batch << message
328
+ return
329
+ end
305
330
  encoded = JSON.generate(message)
306
331
  raise ProtocolError, "outgoing message exceeds #{MAX_MESSAGE_BYTES} bytes" if encoded.bytesize > MAX_MESSAGE_BYTES
307
332
  @write_lock.synchronize { @output.puts(encoded) }
data/lib/zui/builder.rb CHANGED
@@ -113,7 +113,6 @@ module Zui
113
113
  def model_view_3d(source, id: nil, **props) = component(:model_view_3d, id:, source: source.to_s, **props)
114
114
  def font_loader(source, id: nil, **props) = component(:font_loader, id:, source: source.to_s, **props)
115
115
  def text_metrics(value, id: nil, **props) = component(:text_metrics, id:, text: value.to_s, **props)
116
- def web_view(url = "", id: nil, **props) = component(:web_view, id:, url: url.to_s, **props)
117
116
  def animated_image(source, id: nil, **props) = component(:animated_image, id:, source: source.to_s, **props)
118
117
  def video(source, id: nil, **props) = component(:video, id:, source: source.to_s, **props)
119
118
  def audio(source, id: nil, **props) = component(:audio, id:, source: source.to_s, **props)
data/lib/zui/cli.rb CHANGED
@@ -5,7 +5,7 @@ require "rbconfig"
5
5
 
6
6
  module Zui
7
7
  class CLI
8
- USAGE = "Usage: zui <new NAME|run FILE|bundle [DIRECTORY]|doctor|version>"
8
+ USAGE = "Usage: zui <new NAME|configure|doctor [--fix]|run FILE|bundle [DIRECTORY]|version>"
9
9
 
10
10
  def self.run(arguments, out: $stdout, err: $stderr)
11
11
  new(out:, err:).run(arguments.dup)
@@ -20,6 +20,7 @@ module Zui
20
20
  command = arguments.shift
21
21
  case command
22
22
  when "new" then new_project(arguments)
23
+ when "configure" then configure(arguments)
23
24
  when "run" then run_file(arguments)
24
25
  when "bundle" then bundle_project(arguments)
25
26
  when "doctor" then doctor(arguments)
@@ -63,15 +64,44 @@ module Zui
63
64
  end
64
65
 
65
66
  def doctor(arguments)
66
- raise ArgumentError, "doctor accepts no arguments" unless arguments.empty?
67
+ fix = arguments.delete("--fix")
68
+ raise ArgumentError, "doctor accepts only --fix" unless arguments.empty?
67
69
  platform = Platform.current
68
- host = Host.new(platform:)
69
70
  @out.puts("Zui #{VERSION}")
70
71
  @out.puts("Platform: #{platform.id}#{platform.supported? ? '' : ' (unsupported)'}")
71
72
  @out.puts("Ruby: #{RbConfig.ruby} (#{RUBY_VERSION})")
72
- @out.puts("Host: #{host.executable(build: false) || 'not built'}") if platform.supported?
73
- @out.puts("Qt build requirements: #{host.platform_help}") if platform.supported? && !host.available?
74
- platform.supported? ? 0 : 1
73
+ return 1 unless platform.supported?
74
+
75
+ client = Client.new(platform:)
76
+ if client.configured?
77
+ report_ready(client)
78
+ 0
79
+ elsif fix
80
+ @out.puts("Repair: downloading the verified native client from GitHub Releases...")
81
+ client.configure!
82
+ report_ready(client)
83
+ 0
84
+ else
85
+ @out.puts("Client: not configured")
86
+ @out.puts("Run `zui doctor --fix` to install the native client and bundle support.")
87
+ 1
88
+ end
89
+ end
90
+
91
+ def configure(arguments)
92
+ raise ArgumentError, "configure accepts no arguments" unless arguments.empty?
93
+ platform = Platform.current.assert_supported!
94
+ client = Client.new(platform:)
95
+ @out.puts("Configuring Zui #{VERSION} for #{platform.id}...")
96
+ client.configure!
97
+ report_ready(client)
98
+ 0
99
+ end
100
+
101
+ def report_ready(client)
102
+ @out.puts("Client: #{client.root}")
103
+ @out.puts("Run: ready")
104
+ @out.puts("Bundle: ready")
75
105
  end
76
106
 
77
107
  def option_value(arguments, name)