buninu-browser 0.3.0 → 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.
- package/LICENSES/jsmdcui.txt +22 -0
- package/README.md +19 -4
- package/frontends/wayland/LICENSE-land +21 -0
- package/frontends/wayland/README.md +123 -0
- package/frontends/wayland/casty/LICENSE +21 -0
- package/frontends/wayland/casty/bookmarks.js +32 -0
- package/frontends/wayland/casty/click.js +96 -0
- package/frontends/wayland/casty/commands.js +61 -0
- package/frontends/wayland/casty/config.js +45 -0
- package/frontends/wayland/casty/download-directory.js +28 -0
- package/frontends/wayland/casty/download.js +49 -0
- package/frontends/wayland/casty/hints.js +334 -0
- package/frontends/wayland/casty/keys.js +56 -0
- package/frontends/wayland/casty/page-commands.js +80 -0
- package/frontends/wayland/casty/prompt-width.js +148 -0
- package/frontends/wayland/casty/urlbar.js +606 -0
- package/frontends/wayland/client.js +88 -0
- package/frontends/wayland/clipboard.js +80 -0
- package/frontends/wayland/index.js +116 -0
- package/frontends/wayland/input.js +56 -0
- package/frontends/wayland/protocol.js +55 -0
- package/frontends/wayland/protocols/wayland.xml +3248 -0
- package/frontends/wayland/protocols/xdg-shell.xml +1415 -0
- package/frontends/wayland/transport.js +120 -0
- package/frontends/wayland/urlbar.js +158 -0
- package/index.js +28 -1
- package/lib/clipboard-command.js +10 -0
- package/lib/clipboard-powershell.js +22 -0
- package/lib/clipboard.js +37 -2
- package/lib/document-types.js +11 -0
- package/lib/headless-shell.js +47 -8
- package/lib/layout/text-layout.js +17 -9
- package/lib/paint/display-list.js +5 -1
- package/lib/qml/README.md +971 -0
- package/lib/qml/builtins.js +700 -0
- package/lib/qml/canvas-dom.js +115 -0
- package/lib/qml/document.js +1176 -0
- package/lib/qml/format.js +9 -0
- package/lib/qml/host.js +324 -0
- package/lib/qml/images.js +199 -0
- package/lib/qml/launcher.js +132 -0
- package/lib/qml/loader.js +517 -0
- package/lib/qml/media-renderer.js +49 -0
- package/lib/qml/media.js +86 -0
- package/lib/qml/models.js +622 -0
- package/lib/qml/parser.js +381 -0
- package/lib/qml/qs +5 -0
- package/lib/qml/qscasty +3 -0
- package/lib/qml/qsheadless +3 -0
- package/lib/qml/qswayland +3 -0
- package/lib/qml/reactive.js +159 -0
- package/lib/qml/runtime.js +3381 -0
- package/lib/qml/shapes.js +243 -0
- package/lib/qml/text.js +109 -0
- package/lib/qml/textures.js +123 -0
- package/lib/qml/wayland-clipboard.js +32 -0
- package/lib/qml/worker-thread.js +70 -0
- package/lib/render-tree/index.js +16 -1
- package/lib/renderer/bindings.js +11 -0
- package/lib/renderer/canvas-2d.js +13 -0
- package/lib/renderer/host.js +31 -6
- package/lib/renderer/main.js +19 -6
- package/lib/renderer/page-realm.js +16 -1
- package/lib/renderer/page-renderer.js +230 -13
- package/lib/renderer/text-input-paint.js +54 -0
- package/lib/renderer/text-input.js +57 -0
- package/lib/style/computed-style.js +2 -2
- package/package.json +1 -1
- package/test/clipboard.test.js +19 -0
- package/test/fixtures/flea-helpers/Dockerfile +36 -0
- package/test/fixtures/flea-helpers/bat.mjs +43 -0
- package/test/fixtures/flea-helpers/bin/bat +3 -0
- package/test/fixtures/flea-helpers/bin/bwrap +10 -0
- package/test/fixtures/flea-helpers/bin/bwrap-real-filter +9 -0
- package/test/fixtures/flea-helpers/bin/glow +3 -0
- package/test/fixtures/flea-helpers/bin/qs +3 -0
- package/test/fixtures/flea-helpers/bin/unsupported +3 -0
- package/test/fixtures/flea-helpers/check-highlighting.mjs +47 -0
- package/test/fixtures/flea-helpers/check-media.mjs +29 -0
- package/test/fixtures/flea-helpers/check-preview.mjs +27 -0
- package/test/fixtures/flea-helpers/check.mjs +36 -0
- package/test/fixtures/flea-helpers/highlight-cases.json +227 -0
- package/test/fixtures/flea-helpers/source-mime.xml +28 -0
- package/test/fixtures/flea-helpers/syntax-compat.mjs +23 -0
- package/test/fixtures/flea-thumbnail-stub/flea-placeholder.thumbnailer +4 -0
- package/test/fixtures/flea-thumbnail-stub/flea-thumbnail-stub +3 -0
- package/test/fixtures/qml/flea/EscapeHint.qml +11 -0
- package/test/fixtures/qml/flea/LICENSE +21 -0
- package/test/fixtures/qml/flea/README.md +25 -0
- package/test/fixtures/qml/flea/Theme.qml +8 -0
- package/test/fixtures/qml/flea/demo.qml +24 -0
- package/test/fixtures/qml/flea/qmldir +3 -0
- package/test/fixtures/qml/flea-theme/LICENSE-Flea +21 -0
- package/test/fixtures/qml/flea-theme/LICENSE-Omarchy +20 -0
- package/test/fixtures/qml/flea-theme/README.md +70 -0
- package/test/fixtures/qml/flea-theme/button.qml +17 -0
- package/test/fixtures/qml/flea-theme/demo.qml +27 -0
- package/test/fixtures/qml/flea-theme/field.qml +21 -0
- package/test/fixtures/qml/flea-theme/imports/qs/Commons/BorderGeometry.js +373 -0
- package/test/fixtures/qml/flea-theme/imports/qs/Commons/Color.qml +258 -0
- package/test/fixtures/qml/flea-theme/imports/qs/Commons/I18n.qml +118 -0
- package/test/fixtures/qml/flea-theme/imports/qs/Commons/Numbers.js +19 -0
- package/test/fixtures/qml/flea-theme/imports/qs/Commons/Plural.js +91 -0
- package/test/fixtures/qml/flea-theme/imports/qs/Commons/Style.qml +561 -0
- package/test/fixtures/qml/flea-theme/imports/qs/Commons/Util.qml +188 -0
- package/test/fixtures/qml/flea-theme/imports/qs/Commons/qmldir +13 -0
- package/test/fixtures/qml/flea-theme/segment.qml +17 -0
- package/test/fixtures/qml/flea-theme/settings.qml +58 -0
- package/test/fixtures/qml/flea-theme/text-metrics.qml +10 -0
- package/test/fixtures/qml/flea-theme/ui/DialogButton.qml +150 -0
- package/test/fixtures/qml/flea-theme/ui/DialogField.qml +147 -0
- package/test/fixtures/qml/flea-theme/ui/EscapeHint.qml +11 -0
- package/test/fixtures/qml/flea-theme/ui/Glass.qml +114 -0
- package/test/fixtures/qml/flea-theme/ui/Glyph.qml +54 -0
- package/test/fixtures/qml/flea-theme/ui/GlyphSolid.qml +22 -0
- package/test/fixtures/qml/flea-theme/ui/Reveal.qml +54 -0
- package/test/fixtures/qml/flea-theme/ui/SettingsRuler.qml +85 -0
- package/test/fixtures/qml/flea-theme/ui/SettingsSegment.qml +85 -0
- package/test/fixtures/qml/flea-theme/ui/StableModel.qml +89 -0
- package/test/fixtures/qml/flea-theme/ui/Theme.qml +460 -0
- package/test/fixtures/qml/flea-theme/ui/ThemeColors.qml +43 -0
- package/test/fixtures/qml/flea-theme/ui/ViewState.qml +565 -0
- package/test/fixtures/qml/flea-theme/ui/js/Anchor.js +379 -0
- package/test/fixtures/qml/flea-theme/ui/js/AnchorHold.js +162 -0
- package/test/fixtures/qml/flea-theme/ui/js/Archive.js +157 -0
- package/test/fixtures/qml/flea-theme/ui/js/BackReturn.js +110 -0
- package/test/fixtures/qml/flea-theme/ui/js/Buttons.js +54 -0
- package/test/fixtures/qml/flea-theme/ui/js/ColumnMenu.js +111 -0
- package/test/fixtures/qml/flea-theme/ui/js/Columns.js +298 -0
- package/test/fixtures/qml/flea-theme/ui/js/Contrast.js +157 -0
- package/test/fixtures/qml/flea-theme/ui/js/Density.js +44 -0
- package/test/fixtures/qml/flea-theme/ui/js/DirSizes.js +129 -0
- package/test/fixtures/qml/flea-theme/ui/js/ExtThumbs.js +115 -0
- package/test/fixtures/qml/flea-theme/ui/js/Filter.js +284 -0
- package/test/fixtures/qml/flea-theme/ui/js/FolderSorts.js +108 -0
- package/test/fixtures/qml/flea-theme/ui/js/Format.js +305 -0
- package/test/fixtures/qml/flea-theme/ui/js/Icons.js +206 -0
- package/test/fixtures/qml/flea-theme/ui/js/Input.js +39 -0
- package/test/fixtures/qml/flea-theme/ui/js/KeyName.js +64 -0
- package/test/fixtures/qml/flea-theme/ui/js/Keymap.js +370 -0
- package/test/fixtures/qml/flea-theme/ui/js/Kinds.js +145 -0
- package/test/fixtures/qml/flea-theme/ui/js/Lists.js +11 -0
- package/test/fixtures/qml/flea-theme/ui/js/MakeDefault.js +186 -0
- package/test/fixtures/qml/flea-theme/ui/js/Match.js +27 -0
- package/test/fixtures/qml/flea-theme/ui/js/Material.js +109 -0
- package/test/fixtures/qml/flea-theme/ui/js/Menu.js +513 -0
- package/test/fixtures/qml/flea-theme/ui/js/Motion.js +16 -0
- package/test/fixtures/qml/flea-theme/ui/js/Mounts.js +320 -0
- package/test/fixtures/qml/flea-theme/ui/js/MouseNav.js +13 -0
- package/test/fixtures/qml/flea-theme/ui/js/Nav.js +328 -0
- package/test/fixtures/qml/flea-theme/ui/js/Palette.js +33 -0
- package/test/fixtures/qml/flea-theme/ui/js/Places.js +236 -0
- package/test/fixtures/qml/flea-theme/ui/js/Protocols.js +296 -0
- package/test/fixtures/qml/flea-theme/ui/js/RecentMode.js +154 -0
- package/test/fixtures/qml/flea-theme/ui/js/Search.js +396 -0
- package/test/fixtures/qml/flea-theme/ui/js/Settings.js +476 -0
- package/test/fixtures/qml/flea-theme/ui/js/SettingsAbout.js +99 -0
- package/test/fixtures/qml/flea-theme/ui/js/SettingsShelf.js +52 -0
- package/test/fixtures/qml/flea-theme/ui/js/Sort.js +127 -0
- package/test/fixtures/qml/flea-theme/ui/js/StateWords.js +42 -0
- package/test/fixtures/qml/flea-theme/ui/js/Swap.js +166 -0
- package/test/fixtures/qml/flea-theme/ui/js/TextSize.js +107 -0
- package/test/fixtures/qml/flea-theme/ui/js/Thumbs.js +158 -0
- package/test/fixtures/qml/flea-theme/ui/js/UiState.js +438 -0
- package/test/fixtures/qml/flea-theme/ui/js/Update.js +132 -0
- package/test/fixtures/qml/flea-theme/ui/js/UserDirs.js +56 -0
- package/test/fixtures/qml/flea-theme/ui/qmldir +227 -0
- package/test/fixtures/qml/hello.qml +26 -0
- package/test/fixtures/qml/imports/Demo/Toolkit/VersionLabel.qml +2 -0
- package/test/fixtures/qml/imports/Demo/Toolkit/VersionLabelNew.qml +2 -0
- package/test/fixtures/qml/imports/Demo/Toolkit/qmldir +3 -0
- package/test/fixtures/qml/imports/components/Badge.qml +15 -0
- package/test/fixtures/qml/imports/logic/base.js +2 -0
- package/test/fixtures/qml/imports/logic/counter.js +4 -0
- package/test/fixtures/qml/imports/logic/math.js +3 -0
- package/test/fixtures/qml/imports/logic/shared.js +3 -0
- package/test/fixtures/qml/imports/main.qml +21 -0
- package/test/fixtures/qml/imports/theme/Theme.qml +8 -0
- package/test/fixtures/qml/imports/theme/qmldir +2 -0
- package/test/fixtures/qml/multiply.qml +61 -0
- package/test/fixtures/qml-canvas-dom.js +90 -0
- package/test/fixtures/qml-media-audio.js +39 -0
- package/test/helpers/flea-sandbox.js +48 -0
- package/test/helpers/quickshell-fixture.js +125 -0
- package/test/html-clipboard-wayland.test.js +47 -0
- package/test/index.test.js +13 -0
- package/test/manual-casty-without-qml.js +87 -0
- package/test/manual-flea-application.js +49 -0
- package/test/manual-flea-binary.js +62 -0
- package/test/manual-flea-qml.js +9 -0
- package/test/manual-flea-settings.js +40 -0
- package/test/manual-flea-theme.js +40 -0
- package/test/manual-qml-removal.js +46 -0
- package/test/manual-without-qml.js +45 -0
- package/test/qml-canvas-dom.test.js +37 -0
- package/test/qml-clipboard-bridge.test.js +25 -0
- package/test/qml-clipboard-wayland.test.js +40 -0
- package/test/qml-connections-timing.test.js +73 -0
- package/test/qml-dynamic.test.js +401 -0
- package/test/qml-flea-app.test.js +146 -0
- package/test/qml-flea-backend.test.js +78 -0
- package/test/qml-flea-columns-backend.test.js +38 -0
- package/test/qml-flea-compile.test.js +78 -0
- package/test/qml-flea-launcher.test.js +88 -0
- package/test/qml-flea-markdown-backend.test.js +31 -0
- package/test/qml-flea-media.test.js +28 -0
- package/test/qml-flea-navigation-backend.test.js +35 -0
- package/test/qml-flea-navigation-timing.test.js +147 -0
- package/test/qml-flea-preview-backend.test.js +53 -0
- package/test/qml-flea-previews.test.js +163 -0
- package/test/qml-flea-rows.test.js +101 -0
- package/test/qml-flea-textures.test.js +59 -0
- package/test/qml-flea-view-switch.test.js +33 -0
- package/test/qml-flea-wayland.test.js +68 -0
- package/test/qml-flea.test.js +34 -0
- package/test/qml-host.test.js +238 -0
- package/test/qml-imports.test.js +102 -0
- package/test/qml-inherited-handlers.test.js +51 -0
- package/test/qml-input-selection.test.js +66 -0
- package/test/qml-interactions.test.js +309 -0
- package/test/qml-language.test.js +167 -0
- package/test/qml-launcher.test.js +54 -0
- package/test/qml-layout-text.test.js +205 -0
- package/test/qml-media.test.js +63 -0
- package/test/qml-persisted-delegates.test.js +45 -0
- package/test/qml-quickshell-controls.test.js +65 -0
- package/test/qml-quickshell-settings.test.js +62 -0
- package/test/qml-repeater.test.js +72 -0
- package/test/qml-style-updates.test.js +124 -0
- package/test/qml-textures.test.js +66 -0
- package/test/qml-views.test.js +332 -0
- package/test/qml-worker.test.js +69 -0
- package/test/qml.test.js +83 -0
- package/test/renderer-host.test.js +11 -0
- package/test/text-input-pointer.test.js +31 -0
- package/test/text-input-scroll.test.js +29 -0
- package/test/text-input.test.js +47 -0
- package/test/wayland-frontend.test.js +83 -0
- package/test/wayland-urlbar.test.js +38 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
module flea
|
|
2
|
+
RowDropTarget 1.0 RowDropTarget.qml
|
|
3
|
+
TrashDropHandler 1.0 TrashDropHandler.qml
|
|
4
|
+
singleton Theme 1.0 Theme.qml
|
|
5
|
+
ThemeColors 1.0 ThemeColors.qml
|
|
6
|
+
singleton Glass 1.0 Glass.qml
|
|
7
|
+
GlassTagger 1.0 GlassTagger.qml
|
|
8
|
+
singleton MediaSound 1.0 MediaSound.qml
|
|
9
|
+
singleton Scripts 1.0 Scripts.qml
|
|
10
|
+
singleton ViewState 1.0 ViewState.qml
|
|
11
|
+
singleton UserDirs 1.0 UserDirs.qml
|
|
12
|
+
singleton UpdateCheck 1.0 UpdateCheck.qml
|
|
13
|
+
singleton DefaultClaim 1.0 DefaultClaim.qml
|
|
14
|
+
singleton SettingsMetrics 1.0 SettingsMetrics.qml
|
|
15
|
+
Backend 1.0 Backend.qml
|
|
16
|
+
CheckBox 1.0 CheckBox.qml
|
|
17
|
+
ChromeBar 1.0 ChromeBar.qml
|
|
18
|
+
ChromeButton 1.0 ChromeButton.qml
|
|
19
|
+
ChromeModes 1.0 ChromeModes.qml
|
|
20
|
+
ColumnsArea 1.0 ColumnsArea.qml
|
|
21
|
+
ColumnsLanding 1.0 ColumnsLanding.qml
|
|
22
|
+
ColumnPane 1.0 ColumnPane.qml
|
|
23
|
+
ColumnRow 1.0 ColumnRow.qml
|
|
24
|
+
CountedWorker 1.0 CountedWorker.qml
|
|
25
|
+
Crumb 1.0 Crumb.qml
|
|
26
|
+
CursorMark 1.0 CursorMark.qml
|
|
27
|
+
PreviewColumn 1.0 PreviewColumn.qml
|
|
28
|
+
CodeLines 1.0 CodeLines.qml
|
|
29
|
+
CompareView 1.0 CompareView.qml
|
|
30
|
+
CodeRefusal 1.0 CodeRefusal.qml
|
|
31
|
+
CsvTable 1.0 CsvTable.qml
|
|
32
|
+
PreviewLines 1.0 PreviewLines.qml
|
|
33
|
+
PreviewScroll 1.0 PreviewScroll.qml
|
|
34
|
+
PreviewMarkdown 1.0 PreviewMarkdown.qml
|
|
35
|
+
PreviewHtml 1.0 PreviewHtml.qml
|
|
36
|
+
HtmlPane 1.0 HtmlPane.qml
|
|
37
|
+
HtmlClip 1.0 HtmlClip.qml
|
|
38
|
+
MarkdownSource 1.0 MarkdownSource.qml
|
|
39
|
+
MarkdownRemote 1.0 MarkdownRemote.qml
|
|
40
|
+
QuickLookBar 1.0 QuickLookBar.qml
|
|
41
|
+
MarkdownPane 1.0 MarkdownPane.qml
|
|
42
|
+
FontPane 1.0 FontPane.qml
|
|
43
|
+
MarkdownText 1.0 MarkdownText.qml
|
|
44
|
+
MarkdownPictures 1.0 MarkdownPictures.qml
|
|
45
|
+
MarkdownImages 1.0 MarkdownImages.qml
|
|
46
|
+
MarkdownMathsText 1.0 MarkdownMathsText.qml
|
|
47
|
+
MarkdownQuote 1.0 MarkdownQuote.qml
|
|
48
|
+
MarkdownList 1.0 MarkdownList.qml
|
|
49
|
+
MarkdownBlocks 1.0 MarkdownBlocks.qml
|
|
50
|
+
MarkdownBlockView 1.0 MarkdownBlockView.qml
|
|
51
|
+
MarkdownTable 1.0 MarkdownTable.qml
|
|
52
|
+
MarkdownTableScroll 1.0 MarkdownTableScroll.qml
|
|
53
|
+
MarkdownTableWheel 1.0 MarkdownTableWheel.qml
|
|
54
|
+
MarkdownFigure 1.0 MarkdownFigure.qml
|
|
55
|
+
singleton FigureService 1.0 FigureService.qml
|
|
56
|
+
FigureStore 1.0 FigureStore.qml
|
|
57
|
+
PreviewPdf 1.0 PreviewPdf.qml
|
|
58
|
+
PreviewSwap 1.0 PreviewSwap.qml
|
|
59
|
+
PreviewImage 1.0 PreviewImage.qml
|
|
60
|
+
PreviewImagePan 1.0 PreviewImagePan.qml
|
|
61
|
+
PreviewImageSharp 1.0 PreviewImageSharp.qml
|
|
62
|
+
PreviewAnimation 1.0 PreviewAnimation.qml
|
|
63
|
+
ConvertDialog 1.0 ConvertDialog.qml
|
|
64
|
+
BulkOldNames 1.0 BulkOldNames.qml
|
|
65
|
+
BulkRenameDialog 1.0 BulkRenameDialog.qml
|
|
66
|
+
DialogButton 1.0 DialogButton.qml
|
|
67
|
+
ProtocolChip 1.0 ProtocolChip.qml
|
|
68
|
+
DialogField 1.0 DialogField.qml
|
|
69
|
+
DialogHeader 1.0 DialogHeader.qml
|
|
70
|
+
DialogScrim 1.0 DialogScrim.qml
|
|
71
|
+
DialogTitle 1.0 DialogTitle.qml
|
|
72
|
+
Divider 1.0 Divider.qml
|
|
73
|
+
EscapeHint 1.0 EscapeHint.qml
|
|
74
|
+
ContextMenu 1.0 ContextMenu.qml
|
|
75
|
+
MenuHost 1.0 MenuHost.qml
|
|
76
|
+
KeymapSheet 1.0 KeymapSheet.qml
|
|
77
|
+
KeymapSheetResult 1.0 KeymapSheetResult.qml
|
|
78
|
+
SettingsPanel 1.0 SettingsPanel.qml
|
|
79
|
+
SettingsPane 1.0 SettingsPane.qml
|
|
80
|
+
SettingsRail 1.0 SettingsRail.qml
|
|
81
|
+
SettingsRow 1.0 SettingsRow.qml
|
|
82
|
+
SettingsGroup 1.0 SettingsGroup.qml
|
|
83
|
+
SettingsHint 1.0 SettingsHint.qml
|
|
84
|
+
SettingsRuler 1.0 SettingsRuler.qml
|
|
85
|
+
SettingsSegment 1.0 SettingsSegment.qml
|
|
86
|
+
MediaSession 1.0 MediaSession.qml
|
|
87
|
+
MediaStrip 1.0 MediaStrip.qml
|
|
88
|
+
MediaTrack 1.0 MediaTrack.qml
|
|
89
|
+
MediaVolume 1.0 MediaVolume.qml
|
|
90
|
+
MenuRow 1.0 MenuRow.qml
|
|
91
|
+
MenuEdgeFade 1.0 MenuEdgeFade.qml
|
|
92
|
+
RenameField 1.0 RenameField.qml
|
|
93
|
+
EmptyState 1.0 EmptyState.qml
|
|
94
|
+
FastScrollHandler 1.0 FastScrollHandler.qml
|
|
95
|
+
ViewportScrollBar 1.0 ViewportScrollBar.qml
|
|
96
|
+
ViewportScrollBars 1.0 ViewportScrollBars.qml
|
|
97
|
+
CardScroll 1.0 CardScroll.qml
|
|
98
|
+
CardFrame 1.0 CardFrame.qml
|
|
99
|
+
Reveal 1.0 Reveal.qml
|
|
100
|
+
FlyoutFade 1.0 FlyoutFade.qml
|
|
101
|
+
DeviceMounts 1.0 DeviceMounts.qml
|
|
102
|
+
DropboxMark 1.0 DropboxMark.qml
|
|
103
|
+
HyprlandMark 1.0 HyprlandMark.qml
|
|
104
|
+
DropInto 1.0 DropInto.qml
|
|
105
|
+
FileDrag 1.0 FileDrag.qml
|
|
106
|
+
FitMetrics 1.0 FitMetrics.qml
|
|
107
|
+
RowDrag 1.0 RowDrag.qml
|
|
108
|
+
WindowDrag 1.0 WindowDrag.qml
|
|
109
|
+
Glyph 1.0 Glyph.qml
|
|
110
|
+
LangMark 1.0 LangMark.qml
|
|
111
|
+
GlyphSolid 1.0 GlyphSolid.qml
|
|
112
|
+
GvfsBridge 1.0 GvfsBridge.qml
|
|
113
|
+
GridTile 1.0 GridTile.qml
|
|
114
|
+
GridArea 1.0 GridArea.qml
|
|
115
|
+
Header 1.0 Header.qml
|
|
116
|
+
Ipc 1.0 Ipc.qml
|
|
117
|
+
IpcControls 1.0 IpcControls.qml
|
|
118
|
+
IpcMenuState 1.0 IpcMenuState.qml
|
|
119
|
+
IpcPreviewState 1.0 IpcPreviewState.qml
|
|
120
|
+
List 1.0 List.qml
|
|
121
|
+
MatchText 1.0 MatchText.qml
|
|
122
|
+
PathJump 1.0 PathJump.qml
|
|
123
|
+
JumpPath 1.0 JumpPath.qml
|
|
124
|
+
LoadingState 1.0 LoadingState.qml
|
|
125
|
+
NetworkDialog 1.0 NetworkDialog.qml
|
|
126
|
+
NetworkForm 1.0 NetworkForm.qml
|
|
127
|
+
NetworkMounts 1.0 NetworkMounts.qml
|
|
128
|
+
NetworkPlaces 1.0 NetworkPlaces.qml
|
|
129
|
+
MountListing 1.0 MountListing.qml
|
|
130
|
+
PhoneMounts 1.0 PhoneMounts.qml
|
|
131
|
+
FleaMark 1.0 FleaMark.qml
|
|
132
|
+
Opener 1.0 Opener.qml
|
|
133
|
+
Preview 1.0 Preview.qml
|
|
134
|
+
PreviewArchive 1.0 PreviewArchive.qml
|
|
135
|
+
PreviewFacts 1.0 PreviewFacts.qml
|
|
136
|
+
PreviewFactsLine 1.0 PreviewFactsLine.qml
|
|
137
|
+
PreviewMedia 1.0 PreviewMedia.qml
|
|
138
|
+
QuickLookPrepare 1.0 QuickLookPrepare.qml
|
|
139
|
+
QuickLookWarm 1.0 QuickLookWarm.qml
|
|
140
|
+
QuickLookSwap 1.0 QuickLookSwap.qml
|
|
141
|
+
PreviewText 1.0 PreviewText.qml
|
|
142
|
+
Row 1.0 Row.qml
|
|
143
|
+
ResizeHandle 1.0 ResizeHandle.qml
|
|
144
|
+
PreviewEdge 1.0 PreviewEdge.qml
|
|
145
|
+
Pane 1.0 Pane.qml
|
|
146
|
+
PickerBox 1.0 PickerBox.qml
|
|
147
|
+
PickerChrome 1.0 PickerChrome.qml
|
|
148
|
+
PickerGrid 1.0 PickerGrid.qml
|
|
149
|
+
PickerHeader 1.0 PickerHeader.qml
|
|
150
|
+
PickerList 1.0 PickerList.qml
|
|
151
|
+
PickerSelection 1.0 PickerSelection.qml
|
|
152
|
+
PickerPlaces 1.0 PickerPlaces.qml
|
|
153
|
+
PickerRecent 1.0 PickerRecent.qml
|
|
154
|
+
PickerSave 1.0 PickerSave.qml
|
|
155
|
+
PickerAnswers 1.0 PickerAnswers.qml
|
|
156
|
+
PickerFilter 1.0 PickerFilter.qml
|
|
157
|
+
PickerPathBar 1.0 PickerPathBar.qml
|
|
158
|
+
PathEntry 1.0 PathEntry.qml
|
|
159
|
+
PanePath 1.0 PanePath.qml
|
|
160
|
+
PaneRail 1.0 PaneRail.qml
|
|
161
|
+
PaneWire 1.0 PaneWire.qml
|
|
162
|
+
PaneSwap 1.0 PaneSwap.qml
|
|
163
|
+
ParkedWait 1.0 ParkedWait.qml
|
|
164
|
+
ShareBrowser 1.0 ShareBrowser.qml
|
|
165
|
+
Sidebar 1.0 Sidebar.qml
|
|
166
|
+
SidebarRow 1.0 SidebarRow.qml
|
|
167
|
+
RailDrop 1.0 RailDrop.qml
|
|
168
|
+
RailTrashRow 1.0 RailTrashRow.qml
|
|
169
|
+
DropTarget 1.0 DropTarget.qml
|
|
170
|
+
Spinner 1.0 Spinner.qml
|
|
171
|
+
SearchStrip 1.0 SearchStrip.qml
|
|
172
|
+
FilterStrip 1.0 FilterStrip.qml
|
|
173
|
+
ShareLink 1.0 ShareLink.qml
|
|
174
|
+
StateMessage 1.0 StateMessage.qml
|
|
175
|
+
TailscaleMark 1.0 TailscaleMark.qml
|
|
176
|
+
StatusBar 1.0 StatusBar.qml
|
|
177
|
+
StableModel 1.0 StableModel.qml
|
|
178
|
+
PrebuildDriver 1.0 PrebuildDriver.qml
|
|
179
|
+
SelectionBand 1.0 SelectionBand.qml
|
|
180
|
+
TabBar 1.0 TabBar.qml
|
|
181
|
+
TabDragGeometry 1.0 TabDragGeometry.qml
|
|
182
|
+
TransferCard 1.0 TransferCard.qml
|
|
183
|
+
Taildrop 1.0 Taildrop.qml
|
|
184
|
+
LocalSend 1.0 LocalSend.qml
|
|
185
|
+
LocalSendMark 1.0 LocalSendMark.qml
|
|
186
|
+
FactsTable 1.0 FactsTable.qml
|
|
187
|
+
KindStack 1.0 KindStack.qml
|
|
188
|
+
AboutFacts 1.0 AboutFacts.qml
|
|
189
|
+
SelectionPreview 1.0 SelectionPreview.qml
|
|
190
|
+
PermissionsDialog 1.0 PermissionsDialog.qml
|
|
191
|
+
PermissionsHeadings 1.0 PermissionsHeadings.qml
|
|
192
|
+
singleton Favourites 1.0 Favourites.qml
|
|
193
|
+
singleton RailPlaces 1.0 RailPlaces.qml
|
|
194
|
+
singleton ShelfPins 1.0 ShelfPins.qml
|
|
195
|
+
SettingsFavourite 1.0 SettingsFavourite.qml
|
|
196
|
+
TrashView 1.0 TrashView.qml
|
|
197
|
+
TrashConfirm 1.0 TrashConfirm.qml
|
|
198
|
+
TagSlot 1.0 TagSlot.qml
|
|
199
|
+
TagSwatch 1.0 TagSwatch.qml
|
|
200
|
+
RailHeading 1.0 RailHeading.qml
|
|
201
|
+
TagState 1.0 TagState.qml
|
|
202
|
+
TagRailSection 1.0 TagRailSection.qml
|
|
203
|
+
TagMenuMark 1.0 TagMenuMark.qml
|
|
204
|
+
CollideConfirm 1.0 CollideConfirm.qml
|
|
205
|
+
CollideHost 1.0 CollideHost.qml
|
|
206
|
+
RunCard 1.0 RunCard.qml
|
|
207
|
+
FatNamesConfirm 1.0 FatNamesConfirm.qml
|
|
208
|
+
TrashMonitor 1.0 TrashMonitor.qml
|
|
209
|
+
TrashHost 1.0 TrashHost.qml
|
|
210
|
+
FlashView 1.0 FlashView.qml
|
|
211
|
+
FlashHost 1.0 FlashHost.qml
|
|
212
|
+
FlashImageRow 1.0 FlashImageRow.qml
|
|
213
|
+
FlashDriveRows 1.0 FlashDriveRows.qml
|
|
214
|
+
FlashStepRow 1.0 FlashStepRow.qml
|
|
215
|
+
FlashRunner 1.0 FlashRunner.qml
|
|
216
|
+
FlashStrip 1.0 FlashStrip.qml
|
|
217
|
+
UnlockDialog 1.0 UnlockDialog.qml
|
|
218
|
+
UnlockHost 1.0 UnlockHost.qml
|
|
219
|
+
DeviceLock 1.0 DeviceLock.qml
|
|
220
|
+
PaneMenuActions 1.0 PaneMenuActions.qml
|
|
221
|
+
PaneStates 1.0 PaneStates.qml
|
|
222
|
+
MenuActionDialog 1.0 MenuActionDialog.qml
|
|
223
|
+
PickerListing 1.0 PickerListing.qml
|
|
224
|
+
PickerLifecycle 1.0 PickerLifecycle.qml
|
|
225
|
+
ArchiveCompressDialog 1.0 ArchiveCompressDialog.qml
|
|
226
|
+
ArchivePasswordDialog 1.0 ArchivePasswordDialog.qml
|
|
227
|
+
ArchiveCards 1.0 ArchiveCards.qml
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import Quickshell
|
|
3
|
+
FloatingWindow {
|
|
4
|
+
id: root
|
|
5
|
+
title: "QML DOM experiment"
|
|
6
|
+
color: "#172b36"
|
|
7
|
+
property int count: 0
|
|
8
|
+
Rectangle {
|
|
9
|
+
id: button
|
|
10
|
+
width: parent.width / 2
|
|
11
|
+
height: 100
|
|
12
|
+
anchors.centerIn: parent
|
|
13
|
+
color: root.count % 2 ? "#245c66" : "#26404d"
|
|
14
|
+
radius: 12
|
|
15
|
+
Text {
|
|
16
|
+
anchors.centerIn: parent
|
|
17
|
+
text: "Hello World! Clicks: " + root.count
|
|
18
|
+
color: "#70e1e8"
|
|
19
|
+
font.pixelSize: 24
|
|
20
|
+
}
|
|
21
|
+
MouseArea {
|
|
22
|
+
anchors.fill: parent
|
|
23
|
+
onClicked: { root.count++; }
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import "../theme"
|
|
3
|
+
import "../logic/counter.js" as Counter
|
|
4
|
+
import "../logic/shared.js" as Shared
|
|
5
|
+
Rectangle {
|
|
6
|
+
id: root
|
|
7
|
+
property string caption: "default"
|
|
8
|
+
property int serial: 0
|
|
9
|
+
property int sharedSerial: 0
|
|
10
|
+
property alias value: label.text
|
|
11
|
+
width: 320; height: 60
|
|
12
|
+
color: "#26404d"
|
|
13
|
+
Text { id: label; x: 10; y: 10; color: Theme.ink; text: Counter.captionText() + ":" + Theme.count + ":" + root.serial + "/" + root.sharedSerial }
|
|
14
|
+
Component.onCompleted: { root.serial = Counter.next(); root.sharedSerial = Shared.next(); }
|
|
15
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import Quickshell
|
|
3
|
+
import "./components" as UI
|
|
4
|
+
import "./theme" as Skin
|
|
5
|
+
import "./logic/math.js" as Calc
|
|
6
|
+
import Demo.Toolkit 1.0 as Tools
|
|
7
|
+
FloatingWindow {
|
|
8
|
+
title: "Real QML imports"
|
|
9
|
+
color: "#172b36"
|
|
10
|
+
UI.Badge { id: first; x: 30; y: 30; caption: "one" }
|
|
11
|
+
UI.Badge { id: second; x: 30; y: 110; caption: "two" }
|
|
12
|
+
Text { id: summary; x: 30; y: 200; color: Skin.Theme.ink; text: "Shared: " + Skin.Theme.count + " / multiply: " + Calc.multiply(6, 7) }
|
|
13
|
+
Text { id: privateScope; x: 30; y: 225; color: "white"; text: "Private ID: " + typeof label }
|
|
14
|
+
Tools.VersionLabel { id: versionLabel; x: 30; y: 250 }
|
|
15
|
+
Rectangle {
|
|
16
|
+
id: button
|
|
17
|
+
x: 30; y: 300; width: 240; height: 50; color: "#315d6c"
|
|
18
|
+
Text { anchors.centerIn: parent; color: "white"; text: "Increment shared singleton" }
|
|
19
|
+
MouseArea { anchors.fill: parent; onClicked: { Skin.Theme.bump(); first.value = "changed"; } }
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls
|
|
3
|
+
import Quickshell
|
|
4
|
+
|
|
5
|
+
FloatingWindow {
|
|
6
|
+
id: root
|
|
7
|
+
title: "Multiply — Quickshell"
|
|
8
|
+
implicitWidth: 580
|
|
9
|
+
implicitHeight: 440
|
|
10
|
+
color: "#172b36"
|
|
11
|
+
|
|
12
|
+
Column {
|
|
13
|
+
anchors.centerIn: parent
|
|
14
|
+
width: Math.min(420, parent.width - 48)
|
|
15
|
+
spacing: 12
|
|
16
|
+
|
|
17
|
+
Text {
|
|
18
|
+
text: "Multiply two numbers"
|
|
19
|
+
color: "#70e1e8"
|
|
20
|
+
font.pixelSize: 26
|
|
21
|
+
}
|
|
22
|
+
Label { text: "First number"; color: "#e0edf0" }
|
|
23
|
+
TextField {
|
|
24
|
+
id: first
|
|
25
|
+
width: parent.width
|
|
26
|
+
text: "6"
|
|
27
|
+
placeholderText: "Enter a number"
|
|
28
|
+
selectByMouse: true
|
|
29
|
+
Accessible.name: "First number"
|
|
30
|
+
}
|
|
31
|
+
Label { text: "Second number"; color: "#e0edf0" }
|
|
32
|
+
TextField {
|
|
33
|
+
id: second
|
|
34
|
+
width: parent.width
|
|
35
|
+
text: "7"
|
|
36
|
+
placeholderText: "Enter a number"
|
|
37
|
+
selectByMouse: true
|
|
38
|
+
Accessible.name: "Second number"
|
|
39
|
+
}
|
|
40
|
+
Button {
|
|
41
|
+
width: parent.width
|
|
42
|
+
text: "Multiply"
|
|
43
|
+
onClicked: {
|
|
44
|
+
const a = Number(first.text.trim());
|
|
45
|
+
const b = Number(second.text.trim());
|
|
46
|
+
result.text = first.text.trim() !== "" && second.text.trim() !== ""
|
|
47
|
+
&& Number.isFinite(a) && Number.isFinite(b)
|
|
48
|
+
? String(a * b) : "Please enter two valid numbers";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
Label { text: "Result"; color: "#e0edf0" }
|
|
52
|
+
TextField {
|
|
53
|
+
id: result
|
|
54
|
+
width: parent.width
|
|
55
|
+
readOnly: true
|
|
56
|
+
selectByMouse: true
|
|
57
|
+
placeholderText: "Press Multiply"
|
|
58
|
+
Accessible.name: "Result"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { strict as assert } from 'node:assert';
|
|
2
|
+
import { createPageRenderer } from '../../lib/renderer/page-renderer.js';
|
|
3
|
+
const mode = process.argv[2] ?? 'local';
|
|
4
|
+
const redPng = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAIAAAADCAIAAAA2iEnWAAAAEElEQVR4nGP4z8AARAwoFABE0AX7pM/egAAAAABJRU5ErkJggg==', 'base64');
|
|
5
|
+
const renderer = await createPageRenderer({ reportError: error => console.error(error),
|
|
6
|
+
fetchResource: async url => ({ ok: true, status: 200, url, body: redPng }),
|
|
7
|
+
});
|
|
8
|
+
renderer.resize(400, 300, 1);
|
|
9
|
+
renderer.setScripting('host');
|
|
10
|
+
const source = 'import QtQuick\nRectangle { width: 400; height: 300; color: "white" }';
|
|
11
|
+
const evaluate = code => renderer.evaluate(code);
|
|
12
|
+
const pixel = (x, y) => evaluate(`[...ctx.getImageData(${x},${y},1,1).data]`);
|
|
13
|
+
const setup = `
|
|
14
|
+
globalThis.outer=document.createElement('div');
|
|
15
|
+
outer.style.cssText='position:absolute;left:50px;top:60px;width:10px;height:10px;overflow:hidden;opacity:0.2';
|
|
16
|
+
document.body.appendChild(outer);
|
|
17
|
+
globalThis.src=document.createElement('div');
|
|
18
|
+
src.style.cssText='position:relative;width:40px;height:30px;background:red';
|
|
19
|
+
outer.appendChild(src);
|
|
20
|
+
const child=document.createElement('div');
|
|
21
|
+
child.style.cssText='position:absolute;left:20px;top:0;width:20px;height:30px;background:blue;z-index:2';
|
|
22
|
+
src.appendChild(child);
|
|
23
|
+
const overlay=document.createElement('div');
|
|
24
|
+
overlay.style.cssText='position:absolute;left:0;top:0;width:400px;height:300px;background:lime;z-index:99';
|
|
25
|
+
document.body.appendChild(overlay);
|
|
26
|
+
globalThis.dest=document.createElement('canvas');dest.width=80;dest.height=60;
|
|
27
|
+
globalThis.ctx=dest.getContext('2d');
|
|
28
|
+
`;
|
|
29
|
+
try {
|
|
30
|
+
const url = mode === 'local' ? 'file:///tmp/qml-canvas-test.qml' : mode === 'html' ? 'file:///tmp/plain.html' : 'https://qml.test/main.qml';
|
|
31
|
+
await renderer.loadDocument({ url, contentType: mode === 'html' ? 'text/html' : 'text/x-qml', source: mode === 'html' ? '<body></body>' : source });
|
|
32
|
+
await renderer.whenLoaded();
|
|
33
|
+
await evaluate(setup);
|
|
34
|
+
if (mode !== 'local') {
|
|
35
|
+
await evaluate('document.__qmlHost={};globalThis.__qmlHost={};ctx.drawImage(src,0,0)');
|
|
36
|
+
assert.deepEqual(await pixel(5, 5), [0, 0, 0, 0], 'no DOM capture capability');
|
|
37
|
+
} else {
|
|
38
|
+
const before = await evaluate('outer.style.cssText+src.style.cssText');
|
|
39
|
+
await evaluate('ctx.drawImage(src,0,0)');
|
|
40
|
+
assert.deepEqual(await pixel(5, 5), [255, 0, 0, 255], 'no ancestor opacity/clip or sibling overlay');
|
|
41
|
+
assert.deepEqual(await pixel(25, 5), [0, 0, 255, 255], 'internal stacking retained');
|
|
42
|
+
assert.equal(await evaluate('outer.style.cssText+src.style.cssText'), before, 'source DOM untouched');
|
|
43
|
+
assert.deepEqual(await pixel(45, 5), [0, 0, 0, 0], 'intrinsic DOM border-box dimensions');
|
|
44
|
+
await evaluate('src.style.background="yellow"');
|
|
45
|
+
assert.deepEqual(await pixel(5, 5), [255, 0, 0, 255], 'snapshot remains frozen');
|
|
46
|
+
await evaluate('ctx.clearRect(0,0,80,60);ctx.drawImage(src,0,0,80,60)');
|
|
47
|
+
assert.deepEqual(await pixel(35, 20), [255, 255, 0, 255], 'mutation and scaling');
|
|
48
|
+
assert.deepEqual(await pixel(45, 20), [0, 0, 255, 255]);
|
|
49
|
+
await evaluate('ctx.clearRect(0,0,80,60);ctx.drawImage(src,20,0,20,30,10,10,20,30)');
|
|
50
|
+
assert.deepEqual(await pixel(15, 15), [0, 0, 255, 255], '9-argument source cropping');
|
|
51
|
+
assert.deepEqual(await pixel(5, 5), [0, 0, 0, 0]);
|
|
52
|
+
assert.equal(await evaluate('outer.style.opacity'), '0.2');
|
|
53
|
+
assert.equal(await evaluate('src.parentNode===outer'), true);
|
|
54
|
+
// The source's own clipping still applies, unlike outside ancestor clips.
|
|
55
|
+
await evaluate(`src.style.overflow='hidden';src.firstChild.style.left='35px';
|
|
56
|
+
ctx.clearRect(0,0,80,60);ctx.drawImage(src,0,0)`);
|
|
57
|
+
assert.deepEqual(await pixel(38, 5), [0, 0, 255, 255]);
|
|
58
|
+
assert.deepEqual(await pixel(42, 5), [0, 0, 0, 0]);
|
|
59
|
+
await evaluate(`globalThis.nested=document.createElement('canvas');nested.width=nested.height=10;
|
|
60
|
+
nested.style.cssText='position:absolute;left:0;top:0;width:10px;height:10px';
|
|
61
|
+
src.appendChild(nested);const nc=nested.getContext('2d');nc.fillStyle='lime';nc.fillRect(0,0,10,10);
|
|
62
|
+
ctx.clearRect(0,0,80,60);ctx.drawImage(src,0,0)`);
|
|
63
|
+
assert.deepEqual(await pixel(5, 5), [0, 255, 0, 255], 'nested canvas uses its latest native image');
|
|
64
|
+
await evaluate('ctx.clearRect(0,0,80,60);ctx.translate(10,10);ctx.globalAlpha=0.5;ctx.drawImage(src,0,0);ctx.resetTransform();ctx.globalAlpha=1');
|
|
65
|
+
const blended = await pixel(15, 15);
|
|
66
|
+
assert.equal(blended[1], 255);assert.ok(blended[3] >= 127 && blended[3] <= 128);
|
|
67
|
+
assert.equal(await evaluate(`(()=>{src.appendChild(dest);try{ctx.drawImage(src,0,0);return 'allowed'}catch(e){return e.name}finally{dest.remove()}})()`), 'InvalidStateError');
|
|
68
|
+
assert.equal(await evaluate(`(()=>{src.style.width='9000px';try{ctx.drawImage(src,0,0);return 'allowed'}catch(e){return e.name}finally{src.style.width='40px'}})()`), 'InvalidStateError');
|
|
69
|
+
// Render text through the ordinary painter as well as box decorations.
|
|
70
|
+
await evaluate(`nested.remove();src.firstChild.remove();src.style.background='white';
|
|
71
|
+
src.style.color='black';src.style.fontSize='18px';src.textContent='Hi';
|
|
72
|
+
ctx.clearRect(0,0,80,60);ctx.drawImage(src,0,0)`);
|
|
73
|
+
assert.equal(await evaluate(`[...ctx.getImageData(0,0,40,30).data].some((v,i)=>i%4===0&&v<100)`), true);
|
|
74
|
+
await evaluate(`src.textContent='';globalThis.foreign=document.createElement('img');
|
|
75
|
+
foreign.style.cssText='width:10px;height:10px';foreign.src='https://foreign.test/red.png';src.appendChild(foreign)`);
|
|
76
|
+
for (let i=0;i<100 && !await evaluate('foreign.complete&&foreign.naturalWidth===2');i++) await Bun.sleep(10);
|
|
77
|
+
assert.equal(await evaluate('foreign.naturalWidth'), 2);
|
|
78
|
+
await evaluate('ctx.drawImage(src,0,0)');
|
|
79
|
+
assert.deepEqual(await evaluate(`[()=>ctx.getImageData(0,0,1,1),()=>dest.toDataURL()].map(fn=>{try{fn();return 'allowed'}catch(e){return e.name}})`), ['SecurityError','SecurityError']);
|
|
80
|
+
// A tainted nested canvas cannot launder the image through a DOM snapshot.
|
|
81
|
+
await evaluate(`nested.getContext('2d').drawImage(foreign,0,0);foreign.remove();
|
|
82
|
+
src.appendChild(nested);dest.width=80;ctx.drawImage(src,0,0)`);
|
|
83
|
+
assert.equal(await evaluate(`(()=>{try{ctx.getImageData(0,0,1,1);return 'allowed'}catch(e){return e.name}})()`), 'SecurityError');
|
|
84
|
+
await evaluate('dest.width=80;nested.remove();src.style.background="red"');
|
|
85
|
+
// Oversized/rejected draws do not break the next successful capture.
|
|
86
|
+
await evaluate('ctx.drawImage(src,0,0)');
|
|
87
|
+
assert.deepEqual(await pixel(5,5), [255,0,0,255]);
|
|
88
|
+
assert.equal(await evaluate(`(()=>{src.remove();try{ctx.drawImage(src,0,0);return 'allowed'}catch(e){return e.name}})()`), 'InvalidStateError');
|
|
89
|
+
}
|
|
90
|
+
} finally { renderer.dispose(); }
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Isolated host realm, real MP3 decoder, in-memory audio device (no loudspeaker).
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import {createPageRenderer} from '../../lib/renderer/page-renderer.js';
|
|
4
|
+
import wasmpeg from '../../vendor/wasmpeg/src/js/index.js';
|
|
5
|
+
const sleep=Bun.sleep,fixture=new URL('./tone.mp3',import.meta.url);
|
|
6
|
+
await wasmpeg.load();
|
|
7
|
+
const bytes=new Uint8Array(await Bun.file(fixture).arrayBuffer());
|
|
8
|
+
let listener,closed=0;const chunks=[];
|
|
9
|
+
const renderer=await createPageRenderer({videoDecoder:wasmpeg,
|
|
10
|
+
fetchResource:async()=>({ok:true,body:bytes,contentType:'audio/mpeg'}),
|
|
11
|
+
audio:{open(options,fn){listener=fn;return 1},write(id,pcm){chunks.push(Buffer.from(pcm))},finish(){},close(){closed++;return Promise.resolve(0)}},
|
|
12
|
+
});
|
|
13
|
+
try{
|
|
14
|
+
renderer.setScripting('host');
|
|
15
|
+
await renderer.loadDocument({url:'file:///tmp/qml-media-audio.qml',contentType:'text/x-qml',source:`import QtQuick
|
|
16
|
+
import QtMultimedia
|
|
17
|
+
Item {width:100;height:100
|
|
18
|
+
AudioOutput {id:out;volume:1}
|
|
19
|
+
MediaPlayer {id:player;source:${JSON.stringify(fixture.href)};audioOutput:out}
|
|
20
|
+
Button {id:play;onClicked:player.play()}
|
|
21
|
+
Button {id:mute;onClicked:out.muted=true}
|
|
22
|
+
Button {id:pause;onClicked:player.pause()}
|
|
23
|
+
}`});
|
|
24
|
+
await renderer.whenLoaded();
|
|
25
|
+
await sleep(100);
|
|
26
|
+
await renderer.evaluate("document.getElementById('play').click()");
|
|
27
|
+
for(let i=0;i<100&&!listener;i++)await sleep(20);
|
|
28
|
+
assert.ok(listener,'real MP3 opens the existing audio output');
|
|
29
|
+
listener({event:'request',bytes:2048});
|
|
30
|
+
assert.ok(chunks.length>0);
|
|
31
|
+
assert.ok(chunks.at(-1).some(x=>x!==0),'decoded MP3 produces nonzero PCM');
|
|
32
|
+
await renderer.evaluate("document.getElementById('mute').click()");
|
|
33
|
+
await sleep(20);
|
|
34
|
+
listener({event:'request',bytes:2048});
|
|
35
|
+
assert.ok(chunks.at(-1).every(x=>x===0),'mute clears the output chunk');
|
|
36
|
+
await renderer.evaluate("document.getElementById('pause').click()");
|
|
37
|
+
assert.ok(closed>0,'pause closes the audio output');
|
|
38
|
+
process.stdout.write('QML real MP3 PCM playback passed\n');
|
|
39
|
+
}finally{renderer.dispose()}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { mkdtempSync, mkdirSync, symlinkSync, rmSync } from 'node:fs';
|
|
2
|
+
import { join, resolve } from 'node:path';
|
|
3
|
+
// Application tests own every XDG directory. Backend replies are never replaced.
|
|
4
|
+
export function fleaSandbox(flea, omarchy) {
|
|
5
|
+
const dir = mkdtempSync('/tmp/qml-flea-'),
|
|
6
|
+
saved = {};
|
|
7
|
+
const values = {
|
|
8
|
+
HOME: join(dir, 'home'),
|
|
9
|
+
XDG_CONFIG_HOME: join(dir, 'config'),
|
|
10
|
+
XDG_STATE_HOME: join(dir, 'state'),
|
|
11
|
+
XDG_DATA_HOME: join(dir, 'data'),
|
|
12
|
+
XDG_CACHE_HOME: join(dir, 'cache'),
|
|
13
|
+
QML_IMPORT_PATH: join(dir, 'imports'),
|
|
14
|
+
HYPRLAND_INSTANCE_SIGNATURE: '',
|
|
15
|
+
FLEA_BIN: process.env.FLEA_BIN || join(dir, 'no-flea-backend'),
|
|
16
|
+
};
|
|
17
|
+
for (const [key, value] of Object.entries(values)) {
|
|
18
|
+
saved[key] = process.env[key];
|
|
19
|
+
process.env[key] = value;
|
|
20
|
+
}
|
|
21
|
+
for (const key of [
|
|
22
|
+
'HOME',
|
|
23
|
+
'XDG_CONFIG_HOME',
|
|
24
|
+
'XDG_STATE_HOME',
|
|
25
|
+
'XDG_DATA_HOME',
|
|
26
|
+
'XDG_CACHE_HOME',
|
|
27
|
+
])
|
|
28
|
+
mkdirSync(values[key], { recursive: true });
|
|
29
|
+
mkdirSync(join(dir, 'imports/qs'), { recursive: true });
|
|
30
|
+
for (const name of ['Commons', 'Ui'])
|
|
31
|
+
symlinkSync(
|
|
32
|
+
resolve(omarchy, 'shell', name),
|
|
33
|
+
join(dir, 'imports/qs', name),
|
|
34
|
+
'dir',
|
|
35
|
+
);
|
|
36
|
+
return {
|
|
37
|
+
dir,
|
|
38
|
+
flea: resolve(flea),
|
|
39
|
+
values,
|
|
40
|
+
close() {
|
|
41
|
+
for (const [key, value] of Object.entries(saved)) {
|
|
42
|
+
if (value === undefined) delete process.env[key];
|
|
43
|
+
else process.env[key] = value;
|
|
44
|
+
}
|
|
45
|
+
rmSync(dir, { recursive: true, force: true });
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|