zui 0.0.1
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.
- checksums.yaml +7 -0
- data/Components/Builtins/Accordion.qml +208 -0
- data/Components/Builtins/Action.qml +43 -0
- data/Components/Builtins/ActionButton.qml +19 -0
- data/Components/Builtins/ActionGroup.qml +81 -0
- data/Components/Builtins/AlertDialog.qml +398 -0
- data/Components/Builtins/AnchorAnimation.qml +3 -0
- data/Components/Builtins/AnchorChanges.qml +11 -0
- data/Components/Builtins/AnimatedImage.qml +39 -0
- data/Components/Builtins/Animation.qml +3 -0
- data/Components/Builtins/AnimationController.qml +11 -0
- data/Components/Builtins/ApplicationWindow.qml +103 -0
- data/Components/Builtins/AreaChart.qml +70 -0
- data/Components/Builtins/AspectRatio.qml +30 -0
- data/Components/Builtins/Audio.qml +85 -0
- data/Components/Builtins/AudioInput.qml +10 -0
- data/Components/Builtins/AudioOutput.qml +10 -0
- data/Components/Builtins/Avatar.qml +46 -0
- data/Components/Builtins/Badge.qml +38 -0
- data/Components/Builtins/Banner.qml +133 -0
- data/Components/Builtins/BarChart.qml +67 -0
- data/Components/Builtins/BarIconButton.qml +30 -0
- data/Components/Builtins/BarIndicator.qml +26 -0
- data/Components/Builtins/Behavior.qml +13 -0
- data/Components/Builtins/Blur.qml +14 -0
- data/Components/Builtins/BorderImage.qml +38 -0
- data/Components/Builtins/BorderOverlay.qml +25 -0
- data/Components/Builtins/BottomSheet.qml +211 -0
- data/Components/Builtins/Breadcrumb.qml +169 -0
- data/Components/Builtins/BubbleChart.qml +3 -0
- data/Components/Builtins/BusyIndicator.qml +24 -0
- data/Components/Builtins/Button.qml +55 -0
- data/Components/Builtins/ButtonGroup.qml +18 -0
- data/Components/Builtins/Calendar.qml +55 -0
- data/Components/Builtins/Camera.qml +18 -0
- data/Components/Builtins/CandlestickChart.qml +3 -0
- data/Components/Builtins/Canvas.qml +159 -0
- data/Components/Builtins/CaptureSession.qml +19 -0
- data/Components/Builtins/Card.qml +23 -0
- data/Components/Builtins/Carousel.qml +72 -0
- data/Components/Builtins/Center.qml +20 -0
- data/Components/Builtins/CheckDelegate.qml +132 -0
- data/Components/Builtins/Checkbox.qml +62 -0
- data/Components/Builtins/Chip.qml +65 -0
- data/Components/Builtins/Circle.qml +35 -0
- data/Components/Builtins/Clipboard.qml +29 -0
- data/Components/Builtins/ColorAnimation.qml +3 -0
- data/Components/Builtins/ColorPicker.qml +70 -0
- data/Components/Builtins/Colorize.qml +14 -0
- data/Components/Builtins/Column.qml +17 -0
- data/Components/Builtins/ColumnLayout.qml +13 -0
- data/Components/Builtins/ConfirmDialog.qml +20 -0
- data/Components/Builtins/ConstrainedBox.qml +28 -0
- data/Components/Builtins/Container.qml +30 -0
- data/Components/Builtins/ContextMenu.qml +140 -0
- data/Components/Builtins/CursorSurface.qml +18 -0
- data/Components/Builtins/DataTable.qml +69 -0
- data/Components/Builtins/DatePicker.qml +180 -0
- data/Components/Builtins/DayOfWeekRow.qml +11 -0
- data/Components/Builtins/DelayButton.qml +47 -0
- data/Components/Builtins/DelegateModel.qml +10 -0
- data/Components/Builtins/DelegateModelGroup.qml +10 -0
- data/Components/Builtins/Dial.qml +42 -0
- data/Components/Builtins/Dialog.qml +128 -0
- data/Components/Builtins/DialogButtonBox.qml +137 -0
- data/Components/Builtins/Divider.qml +26 -0
- data/Components/Builtins/DonutChart.qml +3 -0
- data/Components/Builtins/DoubleSpinBox.qml +58 -0
- data/Components/Builtins/DragArea.qml +43 -0
- data/Components/Builtins/Drawer.qml +107 -0
- data/Components/Builtins/DropArea.qml +19 -0
- data/Components/Builtins/DropShadow.qml +16 -0
- data/Components/Builtins/Dropdown.qml +19 -0
- data/Components/Builtins/ExpansionPanel.qml +157 -0
- data/Components/Builtins/FilePicker.qml +140 -0
- data/Components/Builtins/FittedBox.qml +40 -0
- data/Components/Builtins/Flickable.qml +40 -0
- data/Components/Builtins/Flipable.qml +45 -0
- data/Components/Builtins/Flow.qml +16 -0
- data/Components/Builtins/FocusScope.qml +29 -0
- data/Components/Builtins/FolderListModel.qml +9 -0
- data/Components/Builtins/FolderPicker.qml +93 -0
- data/Components/Builtins/FontLoader.qml +21 -0
- data/Components/Builtins/FontPicker.qml +91 -0
- data/Components/Builtins/Frame.qml +71 -0
- data/Components/Builtins/FrameAnimation.qml +13 -0
- data/Components/Builtins/Gauge.qml +3 -0
- data/Components/Builtins/Glow.qml +15 -0
- data/Components/Builtins/Gradient.qml +93 -0
- data/Components/Builtins/Grid.qml +16 -0
- data/Components/Builtins/GridLayout.qml +16 -0
- data/Components/Builtins/GridView.qml +226 -0
- data/Components/Builtins/GroupBox.qml +95 -0
- data/Components/Builtins/Heatmap.qml +3 -0
- data/Components/Builtins/Histogram.qml +3 -0
- data/Components/Builtins/HorizontalHeader.qml +23 -0
- data/Components/Builtins/HorizontalHeaderDelegate.qml +39 -0
- data/Components/Builtins/HoverArea.qml +19 -0
- data/Components/Builtins/Icon.qml +16 -0
- data/Components/Builtins/Image.qml +110 -0
- data/Components/Builtins/ImageCapture.qml +14 -0
- data/Components/Builtins/ItemDelegate.qml +152 -0
- data/Components/Builtins/KeyCatcher.qml +25 -0
- data/Components/Builtins/Label.qml +43 -0
- data/Components/Builtins/LayoutItemProxy.qml +51 -0
- data/Components/Builtins/Legend.qml +86 -0
- data/Components/Builtins/Line.qml +28 -0
- data/Components/Builtins/LineChart.qml +87 -0
- data/Components/Builtins/ListModel.qml +8 -0
- data/Components/Builtins/ListView.qml +65 -0
- data/Components/Builtins/Loader.qml +33 -0
- data/Components/Builtins/Markdown.qml +23 -0
- data/Components/Builtins/MediaDevices.qml +10 -0
- data/Components/Builtins/MediaPlayer.qml +27 -0
- data/Components/Builtins/MediaRecorder.qml +16 -0
- data/Components/Builtins/Menu.qml +119 -0
- data/Components/Builtins/MenuBar.qml +128 -0
- data/Components/Builtins/MenuItem.qml +77 -0
- data/Components/Builtins/MenuSeparator.qml +30 -0
- data/Components/Builtins/MessageDialog.qml +104 -0
- data/Components/Builtins/ModalSheet.qml +222 -0
- data/Components/Builtins/ModelView3d.qml +50 -0
- data/Components/Builtins/MonthGrid.qml +23 -0
- data/Components/Builtins/MultiEffect.qml +48 -0
- data/Components/Builtins/MultiSelect.qml +23 -0
- data/Components/Builtins/NavigationRail.qml +154 -0
- data/Components/Builtins/NumberAnimation.qml +3 -0
- data/Components/Builtins/NumberField.qml +18 -0
- data/Components/Builtins/OpacityAnimator.qml +3 -0
- data/Components/Builtins/OpacityMask.qml +21 -0
- data/Components/Builtins/OpticalGlyph.qml +16 -0
- data/Components/Builtins/Page.qml +111 -0
- data/Components/Builtins/PageIndicator.qml +63 -0
- data/Components/Builtins/Pagination.qml +158 -0
- data/Components/Builtins/Pane.qml +72 -0
- data/Components/Builtins/PanelHero.qml +15 -0
- data/Components/Builtins/ParallelAnimation.qml +3 -0
- data/Components/Builtins/ParentAnimation.qml +3 -0
- data/Components/Builtins/ParentChange.qml +10 -0
- data/Components/Builtins/ParticleSystem.qml +81 -0
- data/Components/Builtins/PasswordField.qml +58 -0
- data/Components/Builtins/Path.qml +35 -0
- data/Components/Builtins/PathAnimation.qml +3 -0
- data/Components/Builtins/PauseAnimation.qml +3 -0
- data/Components/Builtins/PieChart.qml +3 -0
- data/Components/Builtins/PinchArea.qml +23 -0
- data/Components/Builtins/Popup.qml +130 -0
- data/Components/Builtins/Progress.qml +15 -0
- data/Components/Builtins/ProgressRing.qml +120 -0
- data/Components/Builtins/PropertyAction.qml +11 -0
- data/Components/Builtins/PropertyAnimation.qml +3 -0
- data/Components/Builtins/PropertyChanges.qml +10 -0
- data/Components/Builtins/RadarChart.qml +3 -0
- data/Components/Builtins/RadialGauge.qml +3 -0
- data/Components/Builtins/RadioButton.qml +46 -0
- data/Components/Builtins/RadioDelegate.qml +115 -0
- data/Components/Builtins/RadioGroup.qml +58 -0
- data/Components/Builtins/RangeSlider.qml +39 -0
- data/Components/Builtins/Rectangle.qml +23 -0
- data/Components/Builtins/RectangularShadow.qml +23 -0
- data/Components/Builtins/ReorderableList.qml +204 -0
- data/Components/Builtins/RichText.qml +23 -0
- data/Components/Builtins/RotationAnimation.qml +3 -0
- data/Components/Builtins/RotationAnimator.qml +3 -0
- data/Components/Builtins/RoundButton.qml +42 -0
- data/Components/Builtins/Row.qml +17 -0
- data/Components/Builtins/RowLayout.qml +13 -0
- data/Components/Builtins/ScaleAnimator.qml +3 -0
- data/Components/Builtins/ScatterChart.qml +3 -0
- data/Components/Builtins/ScreenCapture.qml +78 -0
- data/Components/Builtins/ScriptAction.qml +15 -0
- data/Components/Builtins/Scroll.qml +18 -0
- data/Components/Builtins/ScrollBar.qml +18 -0
- data/Components/Builtins/ScrollIndicator.qml +15 -0
- data/Components/Builtins/SearchField.qml +178 -0
- data/Components/Builtins/SearchableDropdown.qml +21 -0
- data/Components/Builtins/SectionHeader.qml +14 -0
- data/Components/Builtins/SelectableText.qml +33 -0
- data/Components/Builtins/SelectionRectangle.qml +17 -0
- data/Components/Builtins/Separator.qml +13 -0
- data/Components/Builtins/SequentialAnimation.qml +3 -0
- data/Components/Builtins/Settings.qml +10 -0
- data/Components/Builtins/ShaderEffect.qml +115 -0
- data/Components/Builtins/ShaderEffectSource.qml +61 -0
- data/Components/Builtins/Shaders/grayscale.frag +14 -0
- data/Components/Builtins/Shaders/grayscale.frag.qsb +0 -0
- data/Components/Builtins/Shaders/passthrough.frag +11 -0
- data/Components/Builtins/Shaders/passthrough.frag.qsb +0 -0
- data/Components/Builtins/Shaders/pixelate.frag +16 -0
- data/Components/Builtins/Shaders/pixelate.frag.qsb +0 -0
- data/Components/Builtins/Shaders/vignette.frag +18 -0
- data/Components/Builtins/Shaders/vignette.frag.qsb +0 -0
- data/Components/Builtins/Shaders/wave.frag +18 -0
- data/Components/Builtins/Shaders/wave.frag.qsb +0 -0
- data/Components/Builtins/Shape.qml +53 -0
- data/Components/Builtins/Skeleton.qml +78 -0
- data/Components/Builtins/Slider.qml +21 -0
- data/Components/Builtins/SmoothedAnimation.qml +3 -0
- data/Components/Builtins/Snackbar.qml +181 -0
- data/Components/Builtins/SortFilterProxyModel.qml +16 -0
- data/Components/Builtins/SoundEffect.qml +10 -0
- data/Components/Builtins/Spacer.qml +13 -0
- data/Components/Builtins/Sparkline.qml +3 -0
- data/Components/Builtins/SpinBox.qml +44 -0
- data/Components/Builtins/SplitView.qml +31 -0
- data/Components/Builtins/SpringAnimation.qml +3 -0
- data/Components/Builtins/Stack.qml +14 -0
- data/Components/Builtins/StackLayout.qml +19 -0
- data/Components/Builtins/StackView.qml +122 -0
- data/Components/Builtins/StackedBarChart.qml +3 -0
- data/Components/Builtins/StandardPaths.qml +9 -0
- data/Components/Builtins/State.qml +13 -0
- data/Components/Builtins/StateGroup.qml +11 -0
- data/Components/Builtins/Support/AnimationDriver.qml +79 -0
- data/Components/Builtins/Support/AnimationGroupDriver.qml +32 -0
- data/Components/Builtins/Support/ChartCanvas.qml +629 -0
- data/Components/Builtins/Support/ModelView3dScene.qml +292 -0
- data/Components/Builtins/Support/OptionalModuleState.js +5 -0
- data/Components/Builtins/SwipeDelegate.qml +231 -0
- data/Components/Builtins/SwipeView.qml +69 -0
- data/Components/Builtins/SwitchDelegate.qml +140 -0
- data/Components/Builtins/TabBar.qml +117 -0
- data/Components/Builtins/TabButton.qml +105 -0
- data/Components/Builtins/TableView.qml +388 -0
- data/Components/Builtins/TableViewDelegate.qml +17 -0
- data/Components/Builtins/Tabs.qml +138 -0
- data/Components/Builtins/Text.qml +24 -0
- data/Components/Builtins/TextArea.qml +59 -0
- data/Components/Builtins/TextField.qml +21 -0
- data/Components/Builtins/TextMetrics.qml +39 -0
- data/Components/Builtins/TimePicker.qml +213 -0
- data/Components/Builtins/Timer.qml +13 -0
- data/Components/Builtins/Toast.qml +213 -0
- data/Components/Builtins/Toggle.qml +19 -0
- data/Components/Builtins/ToggleSwitch.qml +22 -0
- data/Components/Builtins/ToolBar.qml +61 -0
- data/Components/Builtins/ToolButton.qml +41 -0
- data/Components/Builtins/ToolSeparator.qml +36 -0
- data/Components/Builtins/Tooltip.qml +20 -0
- data/Components/Builtins/Transition.qml +3 -0
- data/Components/Builtins/TreeView.qml +423 -0
- data/Components/Builtins/TreeViewDelegate.qml +46 -0
- data/Components/Builtins/Tumbler.qml +18 -0
- data/Components/Builtins/UniformAnimator.qml +3 -0
- data/Components/Builtins/VectorAnimation.qml +3 -0
- data/Components/Builtins/VectorImage.qml +62 -0
- data/Components/Builtins/VerticalHeader.qml +21 -0
- data/Components/Builtins/VerticalHeaderDelegate.qml +35 -0
- data/Components/Builtins/Video.qml +54 -0
- data/Components/Builtins/VideoOutput.qml +54 -0
- data/Components/Builtins/WebView.qml +57 -0
- data/Components/Builtins/WeekNumberColumn.qml +13 -0
- data/Components/Builtins/WidgetButton.qml +26 -0
- data/Components/Builtins/Window.qml +90 -0
- data/Components/Builtins/WindowCapture.qml +11 -0
- data/Components/Builtins/Wrap.qml +18 -0
- data/Components/Builtins/XAnimator.qml +3 -0
- data/Components/Builtins/YAnimator.qml +3 -0
- data/Components/README.md +45 -0
- data/ControlNode.qml +1369 -0
- data/Controls/BarIconButton.qml +27 -0
- data/Controls/BarIndicator.qml +22 -0
- data/Controls/BorderOverlay.qml +10 -0
- data/Controls/BorderSurface.qml +10 -0
- data/Controls/Button.qml +78 -0
- data/Controls/ButtonGroup.qml +19 -0
- data/Controls/ConfirmDialog.qml +37 -0
- data/Controls/CursorSurface.qml +29 -0
- data/Controls/Dropdown.qml +59 -0
- data/Controls/MultiSelect.qml +32 -0
- data/Controls/NumberField.qml +24 -0
- data/Controls/OpticalGlyph.qml +14 -0
- data/Controls/PanelActionButton.qml +10 -0
- data/Controls/PanelHero.qml +18 -0
- data/Controls/PanelKeyCatcher.qml +25 -0
- data/Controls/PanelSectionHeader.qml +11 -0
- data/Controls/PanelSeparator.qml +10 -0
- data/Controls/PanelSlider.qml +36 -0
- data/Controls/PanelToolTip.qml +13 -0
- data/Controls/SearchableDropdown.qml +11 -0
- data/Controls/TextField.qml +25 -0
- data/Controls/Toggle.qml +22 -0
- data/Controls/ToggleSwitch.qml +26 -0
- data/Controls/WidgetButton.qml +35 -0
- data/Controls/qmldir +25 -0
- data/Desktop.qml +76 -0
- data/LICENSE +22 -0
- data/README.md +112 -0
- data/Service.qml +430 -0
- data/Theme/Border.qml +22 -0
- data/Theme/Color.qml +22 -0
- data/Theme/Style.qml +47 -0
- data/Theme/Util.qml +6 -0
- data/Theme/qmldir +5 -0
- data/bin/zui +7 -0
- data/lib/zui/animation.rb +24 -0
- data/lib/zui/application.rb +327 -0
- data/lib/zui/builder.rb +725 -0
- data/lib/zui/cli.rb +91 -0
- data/lib/zui/command.rb +101 -0
- data/lib/zui/component_registry.rb +91 -0
- data/lib/zui/components.rb +262 -0
- data/lib/zui/distribution.rb +200 -0
- data/lib/zui/generator.rb +84 -0
- data/lib/zui/host.rb +123 -0
- data/lib/zui/node.rb +30 -0
- data/lib/zui/platform.rb +40 -0
- data/lib/zui/protocol.rb +29 -0
- data/lib/zui/runner.rb +37 -0
- data/lib/zui/runtime.rb +23 -0
- data/lib/zui/scheduler.rb +136 -0
- data/lib/zui/source_bundle.rb +63 -0
- data/lib/zui/state_store.rb +100 -0
- data/lib/zui/value.rb +44 -0
- data/lib/zui.rb +33 -0
- data/native/CMakeLists.txt +45 -0
- data/native/ZuiClipboard.cpp +16 -0
- data/native/ZuiClipboard.h +16 -0
- data/native/ZuiProcess.cpp +84 -0
- data/native/ZuiProcess.h +34 -0
- data/native/main.cpp +64 -0
- data/vendor/host/linux-x86_64/PROVENANCE.md +15 -0
- data/vendor/host/linux-x86_64/zui-host +0 -0
- data/vendor/host/linux-x86_64/zui-host.sha256 +1 -0
- metadata +365 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls as QQC
|
|
3
|
+
import QtQuick.Layouts
|
|
4
|
+
import QtMultimedia
|
|
5
|
+
import QtQuick.VectorImage
|
|
6
|
+
import "../../Theme"
|
|
7
|
+
import "../../Controls" as ZuiControls
|
|
8
|
+
|
|
9
|
+
Video {
|
|
10
|
+
id: videoRoot
|
|
11
|
+
required property var renderer
|
|
12
|
+
|
|
13
|
+
function synchronizeCapabilities() {
|
|
14
|
+
var mirroredValue = renderer.prop("mirrored", false) === true
|
|
15
|
+
if (videoRoot["mirrored"] !== undefined)
|
|
16
|
+
videoRoot["mirrored"] = mirroredValue
|
|
17
|
+
else if (mirroredValue)
|
|
18
|
+
renderer.componentError("video_mirroring_unsupported",
|
|
19
|
+
"The installed Qt version does not support mirrored video output", {})
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
source: String(renderer.prop("source", ""))
|
|
23
|
+
implicitWidth: Number(renderer.prop("width", 640))
|
|
24
|
+
implicitHeight: Number(renderer.prop("height", 360))
|
|
25
|
+
autoPlay: renderer.prop("auto_play", false) === true
|
|
26
|
+
loops: Number(renderer.prop("loops", 1))
|
|
27
|
+
volume: Math.max(0, Math.min(1, Number(renderer.prop("volume", 1))))
|
|
28
|
+
muted: renderer.prop("muted", false) === true
|
|
29
|
+
playbackRate: Number(renderer.prop("playback_rate", 1))
|
|
30
|
+
orientation: Number(renderer.prop("orientation", 0))
|
|
31
|
+
fillMode: {
|
|
32
|
+
var mode = String(renderer.prop("fill_mode", "contain"))
|
|
33
|
+
if (mode === "cover") return VideoOutput.PreserveAspectCrop
|
|
34
|
+
if (mode === "stretch") return VideoOutput.Stretch
|
|
35
|
+
return VideoOutput.PreserveAspectFit
|
|
36
|
+
}
|
|
37
|
+
onPlaying: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "play", {})
|
|
38
|
+
onPaused: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "pause", {})
|
|
39
|
+
onStopped: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "stop", {})
|
|
40
|
+
onErrorOccurred: function(error, message) {
|
|
41
|
+
renderer.componentError("video_playback_failed", message, { native_code: error, source: String(source) })
|
|
42
|
+
}
|
|
43
|
+
onPositionChanged: {
|
|
44
|
+
if (renderer.subscribed("position")) renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "position", { value: position, duration: duration })
|
|
45
|
+
}
|
|
46
|
+
onDurationChanged: {
|
|
47
|
+
if (renderer.subscribed("duration")) renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "duration", { value: duration })
|
|
48
|
+
}
|
|
49
|
+
Component.onCompleted: synchronizeCapabilities()
|
|
50
|
+
Connections {
|
|
51
|
+
target: videoRoot.renderer
|
|
52
|
+
function onNodeChanged() { videoRoot.synchronizeCapabilities() }
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtMultimedia
|
|
3
|
+
|
|
4
|
+
VideoOutput {
|
|
5
|
+
id: videoRoot
|
|
6
|
+
property var renderer: null
|
|
7
|
+
readonly property var sourceItem: renderer ? renderer.findRenderedItem(renderer.prop("source", "")) : null
|
|
8
|
+
function synchronizeCapabilities() {
|
|
9
|
+
var mirroredValue = renderer && renderer.prop("mirrored", false) === true
|
|
10
|
+
if (videoRoot["mirrored"] !== undefined)
|
|
11
|
+
videoRoot["mirrored"] = mirroredValue
|
|
12
|
+
else if (mirroredValue)
|
|
13
|
+
renderer.componentError("video_mirroring_unsupported",
|
|
14
|
+
"The installed Qt version does not support mirrored video output", {})
|
|
15
|
+
|
|
16
|
+
var policy = String(renderer ? renderer.prop("end_of_stream_policy", "clear") : "clear")
|
|
17
|
+
if (videoRoot["endOfStreamPolicy"] !== undefined)
|
|
18
|
+
videoRoot["endOfStreamPolicy"] = policy === "keep" ? VideoOutput.KeepLastFrame : VideoOutput.ClearOutput
|
|
19
|
+
else if (policy === "keep")
|
|
20
|
+
renderer.componentError("video_end_policy_unsupported",
|
|
21
|
+
"The installed Qt version does not support keeping the final video frame", {})
|
|
22
|
+
}
|
|
23
|
+
implicitWidth: Number(renderer ? renderer.prop("width", 640) : 640)
|
|
24
|
+
implicitHeight: Number(renderer ? renderer.prop("height", 360) : 360)
|
|
25
|
+
fillMode: {
|
|
26
|
+
var mode = String(renderer ? renderer.prop("fill_mode", "contain") : "contain")
|
|
27
|
+
if (mode === "cover") return VideoOutput.PreserveAspectCrop
|
|
28
|
+
if (mode === "stretch") return VideoOutput.Stretch
|
|
29
|
+
return VideoOutput.PreserveAspectFit
|
|
30
|
+
}
|
|
31
|
+
orientation: Number(renderer ? renderer.prop("orientation", 0) : 0)
|
|
32
|
+
function connectSource() {
|
|
33
|
+
if (!sourceItem) return
|
|
34
|
+
if (sourceItem.mediaPlayer !== undefined) sourceItem.mediaPlayer.videoOutput = videoRoot
|
|
35
|
+
else if (sourceItem.captureSession !== undefined) sourceItem.captureSession.videoOutput = videoRoot
|
|
36
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "source_change", { value: renderer.prop("source", "") })
|
|
37
|
+
}
|
|
38
|
+
Component.onCompleted: {
|
|
39
|
+
connectSource()
|
|
40
|
+
synchronizeCapabilities()
|
|
41
|
+
}
|
|
42
|
+
onSourceItemChanged: connectSource()
|
|
43
|
+
Connections {
|
|
44
|
+
target: renderer
|
|
45
|
+
function onNodeChanged() { videoRoot.synchronizeCapabilities() }
|
|
46
|
+
}
|
|
47
|
+
Connections {
|
|
48
|
+
target: videoSink
|
|
49
|
+
function onVideoFrameChanged() {
|
|
50
|
+
if (renderer.subscribed("frame"))
|
|
51
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "frame", {})
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtWebEngine
|
|
3
|
+
|
|
4
|
+
WebEngineView {
|
|
5
|
+
id: webRoot
|
|
6
|
+
property var renderer: null
|
|
7
|
+
property int handledCommandRevision: -1
|
|
8
|
+
implicitWidth: Number(renderer ? renderer.prop("width", 800) : 800)
|
|
9
|
+
implicitHeight: Number(renderer ? renderer.prop("height", 600) : 600)
|
|
10
|
+
url: renderer ? renderer.assetUrl(renderer.prop("url", "about:blank")) : "about:blank"
|
|
11
|
+
zoomFactor: Number(renderer ? renderer.prop("zoom_factor", 1) : 1)
|
|
12
|
+
backgroundColor: renderer ? renderer.prop("background_color", "white") : "white"
|
|
13
|
+
activeFocusOnPress: !renderer || renderer.prop("active_focus_on_press", true) !== false
|
|
14
|
+
settings.javascriptEnabled: !renderer || renderer.prop("javascript_enabled", true) !== false
|
|
15
|
+
settings.localStorageEnabled: !renderer || renderer.prop("local_storage_enabled", true) !== false
|
|
16
|
+
settings.autoLoadImages: !renderer || renderer.prop("auto_load_images", true) !== false
|
|
17
|
+
settings.fullScreenSupportEnabled: renderer && renderer.prop("full_screen_support", false) === true
|
|
18
|
+
|
|
19
|
+
function send(name, payload) {
|
|
20
|
+
if (renderer && renderer.subscribed(name)) renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, name, payload || {})
|
|
21
|
+
}
|
|
22
|
+
function handleCommand() {
|
|
23
|
+
if (!renderer) return
|
|
24
|
+
var revision = Number(renderer.prop("command_revision", 0))
|
|
25
|
+
if (revision === handledCommandRevision) return
|
|
26
|
+
handledCommandRevision = revision
|
|
27
|
+
var command = String(renderer.prop("command", ""))
|
|
28
|
+
if (command === "back" && canGoBack) goBack()
|
|
29
|
+
else if (command === "forward" && canGoForward) goForward()
|
|
30
|
+
else if (command === "reload") reload()
|
|
31
|
+
else if (command === "stop") stop()
|
|
32
|
+
}
|
|
33
|
+
function loadHtmlIfNeeded() {
|
|
34
|
+
if (!renderer) return
|
|
35
|
+
var markup = String(renderer.prop("html", ""))
|
|
36
|
+
if (markup !== "") loadHtml(markup, String(renderer.prop("base_url", "")))
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
onLoadingChanged: function(request) {
|
|
40
|
+
if (request.status === WebEngineLoadingInfo.LoadStartedStatus) send("load_start", { url: String(request.url) })
|
|
41
|
+
else if (request.status === WebEngineLoadingInfo.LoadSucceededStatus) send("load_success", { url: String(request.url) })
|
|
42
|
+
else if (request.status === WebEngineLoadingInfo.LoadFailedStatus) {
|
|
43
|
+
var payload = { url: String(request.url), native_code: request.errorCode }
|
|
44
|
+
if (renderer) renderer.componentError("web_load_failed", request.errorString, payload)
|
|
45
|
+
send("load_failure", { url: String(request.url), code: request.errorCode, message: request.errorString })
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
onLoadProgressChanged: send("load_progress", { value: loadProgress })
|
|
49
|
+
onUrlChanged: send("url_change", { value: String(url), can_go_back: canGoBack, can_go_forward: canGoForward })
|
|
50
|
+
onTitleChanged: send("title_change", { value: title })
|
|
51
|
+
onNavigationRequested: function(request) { send("navigation", { url: String(request.url), navigation_type: request.navigationType, main_frame: request.isMainFrame }) }
|
|
52
|
+
onFullScreenRequested: function(request) { send("full_screen", { value: request.toggleOn }); request.accept() }
|
|
53
|
+
onPermissionRequested: function(permission) { send("permission", { origin: String(permission.origin), type: permission.permissionType }) }
|
|
54
|
+
onNewWindowRequested: function(request) { send("new_window", { url: String(request.requestedUrl), disposition: request.destination }) }
|
|
55
|
+
Component.onCompleted: { loadHtmlIfNeeded(); handleCommand() }
|
|
56
|
+
Connections { target: renderer; function onNodeChanged() { webRoot.loadHtmlIfNeeded(); webRoot.handleCommand() } }
|
|
57
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls as QQC
|
|
3
|
+
import "../../Theme"
|
|
4
|
+
|
|
5
|
+
QQC.WeekNumberColumn {
|
|
6
|
+
id: weekRoot
|
|
7
|
+
property var renderer: null
|
|
8
|
+
implicitWidth: Number(renderer ? renderer.prop("width", 44) : 44); implicitHeight: Number(renderer ? renderer.prop("height", 280) : 280)
|
|
9
|
+
month: Number(renderer ? renderer.prop("month", new Date().getMonth() + 1) : new Date().getMonth() + 1) - 1
|
|
10
|
+
year: Number(renderer ? renderer.prop("year", new Date().getFullYear()) : new Date().getFullYear())
|
|
11
|
+
locale: Qt.locale(String(renderer ? renderer.prop("locale", Qt.locale().name) : Qt.locale().name))
|
|
12
|
+
delegate: Rectangle { required property var model; color: renderer.prop("background", "transparent"); Text { anchors.fill: parent; text: model.weekNumber; color: renderer.prop("foreground", renderer.prop("muted", renderer.foreground)); font.family: renderer.prop("font_family", renderer.fontFamily); font.pixelSize: Number(renderer.prop("font_size", Style.font.body)); horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter } TapHandler { onTapped: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "week_click", { value: model.weekNumber }) } }
|
|
13
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls as QQC
|
|
3
|
+
import QtQuick.Layouts
|
|
4
|
+
import QtMultimedia
|
|
5
|
+
import QtQuick.VectorImage
|
|
6
|
+
import "../../Theme"
|
|
7
|
+
import "../../Controls" as ZuiControls
|
|
8
|
+
|
|
9
|
+
ZuiControls.WidgetButton {
|
|
10
|
+
required property var renderer
|
|
11
|
+
text: renderer.escapeAutoText(renderer.prop("text", "")); tooltipText: renderer.escapeAutoText(renderer.prop("tooltip", "")); active: renderer.prop("active", false) === true
|
|
12
|
+
dimmed: renderer.prop("dimmed", false) === true; concealed: renderer.prop("concealed", false) === true
|
|
13
|
+
interactive: renderer.prop("interactive", true) !== false; pressable: renderer.prop("pressable", true) !== false
|
|
14
|
+
fontFamily: String(renderer.prop("font_family", renderer.fontFamily)); fontSize: Number(renderer.prop("font_size", Style.font.body))
|
|
15
|
+
foreground: renderer.prop("foreground", renderer.foreground); activeColor: renderer.prop("active_color", Color.urgent)
|
|
16
|
+
horizontalMargin: Number(renderer.prop("horizontal_margin", 8.5)); verticalPadding: Number(renderer.prop("vertical_padding", 6))
|
|
17
|
+
fixedWidth: Number(renderer.prop("fixed_width", -1)); fixedHeight: Number(renderer.prop("fixed_height", -1)); textRotation: Number(renderer.prop("text_rotation", 0))
|
|
18
|
+
keepSpace: renderer.prop("keep_space", false) === true; useActiveColor: renderer.prop("use_active_color", true) !== false
|
|
19
|
+
maintainIndicatorReveal: renderer.prop("maintain_indicator_reveal", false) === true
|
|
20
|
+
labelVisible: renderer.prop("label_visible", true) !== false; hasVisualContent: renderer.prop("has_visual_content", text !== "") === true
|
|
21
|
+
onPressed: function(button) {
|
|
22
|
+
var eventName = button === Qt.RightButton ? "right_click" : (button === Qt.MiddleButton ? "middle_click" : "click")
|
|
23
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, eventName, { button: button })
|
|
24
|
+
}
|
|
25
|
+
onWheelMoved: function(delta) { renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "wheel", { delta: delta }) }
|
|
26
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Window
|
|
3
|
+
|
|
4
|
+
Window {
|
|
5
|
+
id: nativeWindow
|
|
6
|
+
|
|
7
|
+
required property var renderer
|
|
8
|
+
|
|
9
|
+
function visibilityValue(value) {
|
|
10
|
+
var name = String(value || "automatic")
|
|
11
|
+
if (name === "hidden") return Window.Hidden
|
|
12
|
+
if (name === "minimized") return Window.Minimized
|
|
13
|
+
if (name === "maximized") return Window.Maximized
|
|
14
|
+
if (name === "fullscreen" || name === "full_screen") return Window.FullScreen
|
|
15
|
+
if (name === "windowed") return Window.Windowed
|
|
16
|
+
return Window.AutomaticVisibility
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function modalityValue(value) {
|
|
20
|
+
var name = String(value || "none")
|
|
21
|
+
if (name === "window" || name === "window_modal") return Qt.WindowModal
|
|
22
|
+
if (name === "application" || name === "application_modal") return Qt.ApplicationModal
|
|
23
|
+
return Qt.NonModal
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function flagsValue(value) {
|
|
27
|
+
if (typeof value === "number") return value
|
|
28
|
+
var names = Array.isArray(value) ? value : [value || "window"]
|
|
29
|
+
var result = 0
|
|
30
|
+
for (var index = 0; index < names.length; index++) {
|
|
31
|
+
var name = String(names[index])
|
|
32
|
+
if (name === "dialog") result |= Qt.Dialog
|
|
33
|
+
else if (name === "sheet") result |= Qt.Sheet
|
|
34
|
+
else if (name === "drawer") result |= Qt.Drawer
|
|
35
|
+
else if (name === "popup") result |= Qt.Popup
|
|
36
|
+
else if (name === "tool") result |= Qt.Tool
|
|
37
|
+
else if (name === "tooltip") result |= Qt.ToolTip
|
|
38
|
+
else if (name === "splash") result |= Qt.SplashScreen
|
|
39
|
+
else if (name === "frameless") result |= Qt.FramelessWindowHint
|
|
40
|
+
else if (name === "stay_on_top") result |= Qt.WindowStaysOnTopHint
|
|
41
|
+
else if (name === "stay_on_bottom") result |= Qt.WindowStaysOnBottomHint
|
|
42
|
+
else result |= Qt.Window
|
|
43
|
+
}
|
|
44
|
+
return result || Qt.Window
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function orientationValue(value) {
|
|
48
|
+
var name = String(value || "primary")
|
|
49
|
+
if (name === "portrait") return Qt.PortraitOrientation
|
|
50
|
+
if (name === "landscape") return Qt.LandscapeOrientation
|
|
51
|
+
if (name === "inverted_portrait") return Qt.InvertedPortraitOrientation
|
|
52
|
+
if (name === "inverted_landscape") return Qt.InvertedLandscapeOrientation
|
|
53
|
+
return Qt.PrimaryOrientation
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
title: String(renderer.prop("title", ""))
|
|
57
|
+
x: Number(renderer.prop("x", 0))
|
|
58
|
+
y: Number(renderer.prop("y", 0))
|
|
59
|
+
width: Number(renderer.prop("width", 640))
|
|
60
|
+
height: Number(renderer.prop("height", 480))
|
|
61
|
+
minimumWidth: Number(renderer.prop("minimum_width", 0))
|
|
62
|
+
minimumHeight: Number(renderer.prop("minimum_height", 0))
|
|
63
|
+
maximumWidth: Number(renderer.prop("maximum_width", 16777215))
|
|
64
|
+
maximumHeight: Number(renderer.prop("maximum_height", 16777215))
|
|
65
|
+
color: renderer.prop("color", "transparent")
|
|
66
|
+
visible: renderer.prop("visible", false) === true
|
|
67
|
+
visibility: visibilityValue(renderer.prop("visibility", "automatic"))
|
|
68
|
+
modality: modalityValue(renderer.prop("modality", "none"))
|
|
69
|
+
flags: flagsValue(renderer.prop("flags", "window"))
|
|
70
|
+
opacity: Number(renderer.prop("opacity", 1))
|
|
71
|
+
contentOrientation: orientationValue(renderer.prop("content_orientation", "primary"))
|
|
72
|
+
|
|
73
|
+
onClosing: function(close) {
|
|
74
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "close", {
|
|
75
|
+
accepted: close.accepted
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
onVisibleChanged: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "visible_change", { value: visible })
|
|
79
|
+
onActiveChanged: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "active_change", { value: active })
|
|
80
|
+
onVisibilityChanged: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "visibility_change", { value: visibility })
|
|
81
|
+
onXChanged: if (renderer.subscribed("move")) renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "move", { x: x, y: y })
|
|
82
|
+
onYChanged: if (renderer.subscribed("move")) renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "move", { x: x, y: y })
|
|
83
|
+
onWidthChanged: if (renderer.subscribed("resize")) renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "resize", { width: width, height: height })
|
|
84
|
+
onHeightChanged: if (renderer.subscribed("resize")) renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "resize", { width: width, height: height })
|
|
85
|
+
|
|
86
|
+
Repeater {
|
|
87
|
+
model: renderer.node.children || []
|
|
88
|
+
delegate: renderer.childDelegateComponent
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtMultimedia
|
|
3
|
+
|
|
4
|
+
Item {
|
|
5
|
+
id:windowRoot;property var renderer:null;property alias windowCapture:nativeCapture;property int handledCommandRevision:-1
|
|
6
|
+
function selectedWindow(){var windows=nativeCapture.capturableWindows();var requested=renderer?renderer.prop("window",0):0;if(typeof requested==="number"){if(requested>=0&&requested<windows.length)return windows[requested]}else{for(var i=0;i<windows.length;i++)if(String(windows[i].id)===String(requested)||windows[i].description===String(requested))return windows[i]}if(renderer)renderer.componentError("window_not_found","The declared window does not exist",{window:String(requested)});return undefined}
|
|
7
|
+
function synchronizeWindow(){var selected=selectedWindow();if(selected!==undefined)nativeCapture.window=selected}
|
|
8
|
+
function command(){if(!renderer)return;var revision=Number(renderer.prop("command_revision",0));if(revision===handledCommandRevision)return;handledCommandRevision=revision;var value=String(renderer.prop("command",""));if(value==="start")nativeCapture.start();else if(value==="stop")nativeCapture.stop()}
|
|
9
|
+
WindowCapture{id:nativeCapture;active:renderer&&renderer.prop("active",false)===true&&windowRoot.selectedWindow()!==undefined;onActiveChanged:if(renderer)renderer.bridge.sendEvent(renderer.surfaceName,renderer.controlId,active?"start":"stop",{});onErrorOccurred:function(error,errorString){renderer.componentError("window_capture_failed",errorString,{native_code:error})}}
|
|
10
|
+
Component.onCompleted:{synchronizeWindow();command()} Connections{target:renderer;function onNodeChanged(){windowRoot.synchronizeWindow();windowRoot.command()}}
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls as QQC
|
|
3
|
+
import QtQuick.Layouts
|
|
4
|
+
import QtMultimedia
|
|
5
|
+
import QtQuick.VectorImage
|
|
6
|
+
import "../../Theme"
|
|
7
|
+
import "../../Controls" as ZuiControls
|
|
8
|
+
|
|
9
|
+
Flow {
|
|
10
|
+
required property var renderer
|
|
11
|
+
width: Number(renderer.prop("width", 420))
|
|
12
|
+
height: renderer.prop("height", null) === null ? childrenRect.height : Number(renderer.prop("height", childrenRect.height))
|
|
13
|
+
spacing: Number(renderer.prop("spacing", Style.spacing.controlGap))
|
|
14
|
+
flow: String(renderer.prop("orientation", "horizontal")) === "vertical" ? Flow.TopToBottom : Flow.LeftToRight
|
|
15
|
+
layoutDirection: String(renderer.prop("layout_direction", "left_to_right")) === "right_to_left"
|
|
16
|
+
? Qt.RightToLeft : Qt.LeftToRight
|
|
17
|
+
Repeater { model: renderer.node.children || []; delegate: renderer.childDelegateComponent }
|
|
18
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# QML component adapters
|
|
2
|
+
|
|
3
|
+
`Builtins/` contains the framework-owned renderer for each Ruby component. Every built-in
|
|
4
|
+
widget has one file—for example, `Builtins/Button.qml`, `Builtins/Icon.qml`, and
|
|
5
|
+
`Builtins/Text.qml`. `ControlNode.qml` only selects a renderer and provides shared lifecycle,
|
|
6
|
+
event, animation, and recursive-child infrastructure.
|
|
7
|
+
|
|
8
|
+
Applications can extend the framework without modifying `ControlNode.qml` or `Service.qml`.
|
|
9
|
+
Register an adapter before declaring surfaces:
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
register_component :sparkline,
|
|
13
|
+
qml: "Sparkline.qml",
|
|
14
|
+
properties: %i[values color],
|
|
15
|
+
events: %i[click]
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Then place `Sparkline.qml` in this directory and render it with:
|
|
19
|
+
|
|
20
|
+
```ruby
|
|
21
|
+
component :sparkline, values: [2, 8, 5, 12], color: "#f44"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
An adapter is a QML `Item` with any of these framework-injected properties it needs:
|
|
25
|
+
`bridge`, `surfaceName`, `controlId`, and `node`. Events are sent with
|
|
26
|
+
`bridge.sendEvent(surfaceName, controlId, "click", payload)`.
|
|
27
|
+
|
|
28
|
+
The registry only accepts local adapter basenames and declares every allowed property and
|
|
29
|
+
event. QML source is never accepted from the runtime JSON stream as executable text.
|
|
30
|
+
|
|
31
|
+
## Animation
|
|
32
|
+
|
|
33
|
+
Reactive patches can carry native QML transitions:
|
|
34
|
+
|
|
35
|
+
```ruby
|
|
36
|
+
bind(chart, :opacity, animation: animation(duration: 240, easing: :out_cubic)) do
|
|
37
|
+
state.visible ? 1.0 : 0.0
|
|
38
|
+
end
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The bridge validates the transition, preserves the previous value, and runs a QML
|
|
42
|
+
`PropertyAnimation` against the adapter property. For an animatable custom property, expose
|
|
43
|
+
a QML property with the same name as the registered Ruby property. Adapters remain free to
|
|
44
|
+
use QML `Behavior`, `Transition`, `SequentialAnimation`, `ParallelAnimation`, states,
|
|
45
|
+
shaders, particles, and any other native QML animation internally.
|