commit f5b8a563cb68ebd19f9ba16919e5640aa4ccd91a Author: 小煜 <2082529121@qq.com> Date: Fri Dec 19 16:22:27 2025 +0800 feat: 初始化项目基础架构和核心功能 添加项目基础文件结构,包括Tauri配置、前端框架和核心功能模块 实现WebGPU渲染器基础、纹理管理和着色器 添加UI组件包括标题栏、确认对话框、帮助窗口等 设置状态管理存储和工具函数 配置构建工具和开发环境 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..cf4385b --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "Vue.volar", + "tauri-apps.tauri-vscode", + "rust-lang.rust-analyzer" + ] +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..ec8226e --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Tauri + Vue 3 + +This template should help get you started developing with Tauri + Vue 3 in Vite. The template uses Vue 3 ` + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2ef74df --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "refvroid", + "private": true, + "version": "0.1.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "tauri": "tauri" + }, + "dependencies": { + "@tauri-apps/api": "^2", + "@tauri-apps/plugin-opener": "^2", + "vue": "^3.5.13" + }, + "devDependencies": { + "@tauri-apps/cli": "^2", + "@types/node": "^25.0.3", + "@vitejs/plugin-vue": "^5.2.1", + "@webgpu/types": "^0.1.68", + "typescript": "^5.9.3", + "vite": "^6.0.3", + "vue-tsc": "^3.1.8" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..c8b624c --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,1041 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@tauri-apps/api': + specifier: ^2 + version: 2.9.1 + '@tauri-apps/plugin-opener': + specifier: ^2 + version: 2.5.2 + vue: + specifier: ^3.5.13 + version: 3.5.25(typescript@5.9.3) + devDependencies: + '@tauri-apps/cli': + specifier: ^2 + version: 2.9.6 + '@types/node': + specifier: ^25.0.3 + version: 25.0.3 + '@vitejs/plugin-vue': + specifier: ^5.2.1 + version: 5.2.4(vite@6.4.1(@types/node@25.0.3))(vue@3.5.25(typescript@5.9.3)) + '@webgpu/types': + specifier: ^0.1.68 + version: 0.1.68 + typescript: + specifier: ^5.9.3 + version: 5.9.3 + vite: + specifier: ^6.0.3 + version: 6.4.1(@types/node@25.0.3) + vue-tsc: + specifier: ^3.1.8 + version: 3.1.8(typescript@5.9.3) + +packages: + + '@babel/helper-string-parser@7.27.1': + resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.28.5': + resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==} + engines: {node: '>=6.9.0'} + + '@babel/parser@7.28.5': + resolution: {integrity: sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/types@7.28.5': + resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==} + engines: {node: '>=6.9.0'} + + '@esbuild/aix-ppc64@0.25.12': + resolution: {integrity: sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.25.12': + resolution: {integrity: sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.25.12': + resolution: {integrity: sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.25.12': + resolution: {integrity: sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.25.12': + resolution: {integrity: sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.25.12': + resolution: {integrity: sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.25.12': + resolution: {integrity: sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.25.12': + resolution: {integrity: sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.25.12': + resolution: {integrity: sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.25.12': + resolution: {integrity: sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.25.12': + resolution: {integrity: sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.25.12': + resolution: {integrity: sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.25.12': + resolution: {integrity: sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.25.12': + resolution: {integrity: sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.25.12': + resolution: {integrity: sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.25.12': + resolution: {integrity: sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.25.12': + resolution: {integrity: sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-arm64@0.25.12': + resolution: {integrity: sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + + '@esbuild/netbsd-x64@0.25.12': + resolution: {integrity: sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.25.12': + resolution: {integrity: sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.25.12': + resolution: {integrity: sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/openharmony-arm64@0.25.12': + resolution: {integrity: sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + + '@esbuild/sunos-x64@0.25.12': + resolution: {integrity: sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.25.12': + resolution: {integrity: sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.25.12': + resolution: {integrity: sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.25.12': + resolution: {integrity: sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + + '@rollup/rollup-android-arm-eabi@4.53.5': + resolution: {integrity: sha512-iDGS/h7D8t7tvZ1t6+WPK04KD0MwzLZrG0se1hzBjSi5fyxlsiggoJHwh18PCFNn7tG43OWb6pdZ6Y+rMlmyNQ==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.53.5': + resolution: {integrity: sha512-wrSAViWvZHBMMlWk6EJhvg8/rjxzyEhEdgfMMjREHEq11EtJ6IP6yfcCH57YAEca2Oe3FNCE9DSTgU70EIGmVw==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.53.5': + resolution: {integrity: sha512-S87zZPBmRO6u1YXQLwpveZm4JfPpAa6oHBX7/ghSiGH3rz/KDgAu1rKdGutV+WUI6tKDMbaBJomhnT30Y2t4VQ==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.53.5': + resolution: {integrity: sha512-YTbnsAaHo6VrAczISxgpTva8EkfQus0VPEVJCEaboHtZRIb6h6j0BNxRBOwnDciFTZLDPW5r+ZBmhL/+YpTZgA==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-freebsd-arm64@4.53.5': + resolution: {integrity: sha512-1T8eY2J8rKJWzaznV7zedfdhD1BqVs1iqILhmHDq/bqCUZsrMt+j8VCTHhP0vdfbHK3e1IQ7VYx3jlKqwlf+vw==} + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.53.5': + resolution: {integrity: sha512-sHTiuXyBJApxRn+VFMaw1U+Qsz4kcNlxQ742snICYPrY+DDL8/ZbaC4DVIB7vgZmp3jiDaKA0WpBdP0aqPJoBQ==} + cpu: [x64] + os: [freebsd] + + '@rollup/rollup-linux-arm-gnueabihf@4.53.5': + resolution: {integrity: sha512-dV3T9MyAf0w8zPVLVBptVlzaXxka6xg1f16VAQmjg+4KMSTWDvhimI/Y6mp8oHwNrmnmVl9XxJ/w/mO4uIQONA==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm-musleabihf@4.53.5': + resolution: {integrity: sha512-wIGYC1x/hyjP+KAu9+ewDI+fi5XSNiUi9Bvg6KGAh2TsNMA3tSEs+Sh6jJ/r4BV/bx/CyWu2ue9kDnIdRyafcQ==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm64-gnu@4.53.5': + resolution: {integrity: sha512-Y+qVA0D9d0y2FRNiG9oM3Hut/DgODZbU9I8pLLPwAsU0tUKZ49cyV1tzmB/qRbSzGvY8lpgGkJuMyuhH7Ma+Vg==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-arm64-musl@4.53.5': + resolution: {integrity: sha512-juaC4bEgJsyFVfqhtGLz8mbopaWD+WeSOYr5E16y+1of6KQjc0BpwZLuxkClqY1i8sco+MdyoXPNiCkQou09+g==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-loong64-gnu@4.53.5': + resolution: {integrity: sha512-rIEC0hZ17A42iXtHX+EPJVL/CakHo+tT7W0pbzdAGuWOt2jxDFh7A/lRhsNHBcqL4T36+UiAgwO8pbmn3dE8wA==} + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-ppc64-gnu@4.53.5': + resolution: {integrity: sha512-T7l409NhUE552RcAOcmJHj3xyZ2h7vMWzcwQI0hvn5tqHh3oSoclf9WgTl+0QqffWFG8MEVZZP1/OBglKZx52Q==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-riscv64-gnu@4.53.5': + resolution: {integrity: sha512-7OK5/GhxbnrMcxIFoYfhV/TkknarkYC1hqUw1wU2xUN3TVRLNT5FmBv4KkheSG2xZ6IEbRAhTooTV2+R5Tk0lQ==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-riscv64-musl@4.53.5': + resolution: {integrity: sha512-GwuDBE/PsXaTa76lO5eLJTyr2k8QkPipAyOrs4V/KJufHCZBJ495VCGJol35grx9xryk4V+2zd3Ri+3v7NPh+w==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-s390x-gnu@4.53.5': + resolution: {integrity: sha512-IAE1Ziyr1qNfnmiQLHBURAD+eh/zH1pIeJjeShleII7Vj8kyEm2PF77o+lf3WTHDpNJcu4IXJxNO0Zluro8bOw==} + cpu: [s390x] + os: [linux] + + '@rollup/rollup-linux-x64-gnu@4.53.5': + resolution: {integrity: sha512-Pg6E+oP7GvZ4XwgRJBuSXZjcqpIW3yCBhK4BcsANvb47qMvAbCjR6E+1a/U2WXz1JJxp9/4Dno3/iSJLcm5auw==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-linux-x64-musl@4.53.5': + resolution: {integrity: sha512-txGtluxDKTxaMDzUduGP0wdfng24y1rygUMnmlUJ88fzCCULCLn7oE5kb2+tRB+MWq1QDZT6ObT5RrR8HFRKqg==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-openharmony-arm64@4.53.5': + resolution: {integrity: sha512-3DFiLPnTxiOQV993fMc+KO8zXHTcIjgaInrqlG8zDp1TlhYl6WgrOHuJkJQ6M8zHEcntSJsUp1XFZSY8C1DYbg==} + cpu: [arm64] + os: [openharmony] + + '@rollup/rollup-win32-arm64-msvc@4.53.5': + resolution: {integrity: sha512-nggc/wPpNTgjGg75hu+Q/3i32R00Lq1B6N1DO7MCU340MRKL3WZJMjA9U4K4gzy3dkZPXm9E1Nc81FItBVGRlA==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.53.5': + resolution: {integrity: sha512-U/54pTbdQpPLBdEzCT6NBCFAfSZMvmjr0twhnD9f4EIvlm9wy3jjQ38yQj1AGznrNO65EWQMgm/QUjuIVrYF9w==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-gnu@4.53.5': + resolution: {integrity: sha512-2NqKgZSuLH9SXBBV2dWNRCZmocgSOx8OJSdpRaEcRlIfX8YrKxUT6z0F1NpvDVhOsl190UFTRh2F2WDWWCYp3A==} + cpu: [x64] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.53.5': + resolution: {integrity: sha512-JRpZUhCfhZ4keB5v0fe02gQJy05GqboPOaxvjugW04RLSYYoB/9t2lx2u/tMs/Na/1NXfY8QYjgRljRpN+MjTQ==} + cpu: [x64] + os: [win32] + + '@tauri-apps/api@2.9.1': + resolution: {integrity: sha512-IGlhP6EivjXHepbBic618GOmiWe4URJiIeZFlB7x3czM0yDHHYviH1Xvoiv4FefdkQtn6v7TuwWCRfOGdnVUGw==} + + '@tauri-apps/cli-darwin-arm64@2.9.6': + resolution: {integrity: sha512-gf5no6N9FCk1qMrti4lfwP77JHP5haASZgVbBgpZG7BUepB3fhiLCXGUK8LvuOjP36HivXewjg72LTnPDScnQQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@tauri-apps/cli-darwin-x64@2.9.6': + resolution: {integrity: sha512-oWh74WmqbERwwrwcueJyY6HYhgCksUc6NT7WKeXyrlY/FPmNgdyQAgcLuTSkhRFuQ6zh4Np1HZpOqCTpeZBDcw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@tauri-apps/cli-linux-arm-gnueabihf@2.9.6': + resolution: {integrity: sha512-/zde3bFroFsNXOHN204DC2qUxAcAanUjVXXSdEGmhwMUZeAQalNj5cz2Qli2elsRjKN/hVbZOJj0gQ5zaYUjSg==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + + '@tauri-apps/cli-linux-arm64-gnu@2.9.6': + resolution: {integrity: sha512-pvbljdhp9VOo4RnID5ywSxgBs7qiylTPlK56cTk7InR3kYSTJKYMqv/4Q/4rGo/mG8cVppesKIeBMH42fw6wjg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@tauri-apps/cli-linux-arm64-musl@2.9.6': + resolution: {integrity: sha512-02TKUndpodXBCR0oP//6dZWGYcc22Upf2eP27NvC6z0DIqvkBBFziQUcvi2n6SrwTRL0yGgQjkm9K5NIn8s6jw==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@tauri-apps/cli-linux-riscv64-gnu@2.9.6': + resolution: {integrity: sha512-fmp1hnulbqzl1GkXl4aTX9fV+ubHw2LqlLH1PE3BxZ11EQk+l/TmiEongjnxF0ie4kV8DQfDNJ1KGiIdWe1GvQ==} + engines: {node: '>= 10'} + cpu: [riscv64] + os: [linux] + + '@tauri-apps/cli-linux-x64-gnu@2.9.6': + resolution: {integrity: sha512-vY0le8ad2KaV1PJr+jCd8fUF9VOjwwQP/uBuTJvhvKTloEwxYA/kAjKK9OpIslGA9m/zcnSo74czI6bBrm2sYA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@tauri-apps/cli-linux-x64-musl@2.9.6': + resolution: {integrity: sha512-TOEuB8YCFZTWVDzsO2yW0+zGcoMiPPwcUgdnW1ODnmgfwccpnihDRoks+ABT1e3fHb1ol8QQWsHSCovb3o2ENQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@tauri-apps/cli-win32-arm64-msvc@2.9.6': + resolution: {integrity: sha512-ujmDGMRc4qRLAnj8nNG26Rlz9klJ0I0jmZs2BPpmNNf0gM/rcVHhqbEkAaHPTBVIrtUdf7bGvQAD2pyIiUrBHQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + + '@tauri-apps/cli-win32-ia32-msvc@2.9.6': + resolution: {integrity: sha512-S4pT0yAJgFX8QRCyKA1iKjZ9Q/oPjCZf66A/VlG5Yw54Nnr88J1uBpmenINbXxzyhduWrIXBaUbEY1K80ZbpMg==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + + '@tauri-apps/cli-win32-x64-msvc@2.9.6': + resolution: {integrity: sha512-ldWuWSSkWbKOPjQMJoYVj9wLHcOniv7diyI5UAJ4XsBdtaFB0pKHQsqw/ItUma0VXGC7vB4E9fZjivmxur60aw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + + '@tauri-apps/cli@2.9.6': + resolution: {integrity: sha512-3xDdXL5omQ3sPfBfdC8fCtDKcnyV7OqyzQgfyT5P3+zY6lcPqIYKQBvUasNvppi21RSdfhy44ttvJmftb0PCDw==} + engines: {node: '>= 10'} + hasBin: true + + '@tauri-apps/plugin-opener@2.5.2': + resolution: {integrity: sha512-ei/yRRoCklWHImwpCcDK3VhNXx+QXM9793aQ64YxpqVF0BDuuIlXhZgiAkc15wnPVav+IbkYhmDJIv5R326Mew==} + + '@types/estree@1.0.8': + resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + + '@types/node@25.0.3': + resolution: {integrity: sha512-W609buLVRVmeW693xKfzHeIV6nJGGz98uCPfeXI1ELMLXVeKYZ9m15fAMSaUPBHYLGFsVRcMmSCksQOrZV9BYA==} + + '@vitejs/plugin-vue@5.2.4': + resolution: {integrity: sha512-7Yx/SXSOcQq5HiiV3orevHUFn+pmMB4cgbEkDYgnkUWb0WfeQ/wa2yFv6D5ICiCQOVpjA7vYDXrC7AGO8yjDHA==} + engines: {node: ^18.0.0 || >=20.0.0} + peerDependencies: + vite: ^5.0.0 || ^6.0.0 + vue: ^3.2.25 + + '@volar/language-core@2.4.26': + resolution: {integrity: sha512-hH0SMitMxnB43OZpyF1IFPS9bgb2I3bpCh76m2WEK7BE0A0EzpYsRp0CCH2xNKshr7kacU5TQBLYn4zj7CG60A==} + + '@volar/source-map@2.4.26': + resolution: {integrity: sha512-JJw0Tt/kSFsIRmgTQF4JSt81AUSI1aEye5Zl65EeZ8H35JHnTvFGmpDOBn5iOxd48fyGE+ZvZBp5FcgAy/1Qhw==} + + '@volar/typescript@2.4.26': + resolution: {integrity: sha512-N87ecLD48Sp6zV9zID/5yuS1+5foj0DfuYGdQ6KHj/IbKvyKv1zNX6VCmnKYwtmHadEO6mFc2EKISiu3RDPAvA==} + + '@vue/compiler-core@3.5.25': + resolution: {integrity: sha512-vay5/oQJdsNHmliWoZfHPoVZZRmnSWhug0BYT34njkYTPqClh3DNWLkZNJBVSjsNMrg0CCrBfoKkjZQPM/QVUw==} + + '@vue/compiler-dom@3.5.25': + resolution: {integrity: sha512-4We0OAcMZsKgYoGlMjzYvaoErltdFI2/25wqanuTu+S4gismOTRTBPi4IASOjxWdzIwrYSjnqONfKvuqkXzE2Q==} + + '@vue/compiler-sfc@3.5.25': + resolution: {integrity: sha512-PUgKp2rn8fFsI++lF2sO7gwO2d9Yj57Utr5yEsDf3GNaQcowCLKL7sf+LvVFvtJDXUp/03+dC6f2+LCv5aK1ag==} + + '@vue/compiler-ssr@3.5.25': + resolution: {integrity: sha512-ritPSKLBcParnsKYi+GNtbdbrIE1mtuFEJ4U1sWeuOMlIziK5GtOL85t5RhsNy4uWIXPgk+OUdpnXiTdzn8o3A==} + + '@vue/language-core@3.1.8': + resolution: {integrity: sha512-PfwAW7BLopqaJbneChNL6cUOTL3GL+0l8paYP5shhgY5toBNidWnMXWM+qDwL7MC9+zDtzCF2enT8r6VPu64iw==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@vue/reactivity@3.5.25': + resolution: {integrity: sha512-5xfAypCQepv4Jog1U4zn8cZIcbKKFka3AgWHEFQeK65OW+Ys4XybP6z2kKgws4YB43KGpqp5D/K3go2UPPunLA==} + + '@vue/runtime-core@3.5.25': + resolution: {integrity: sha512-Z751v203YWwYzy460bzsYQISDfPjHTl+6Zzwo/a3CsAf+0ccEjQ8c+0CdX1WsumRTHeywvyUFtW6KvNukT/smA==} + + '@vue/runtime-dom@3.5.25': + resolution: {integrity: sha512-a4WrkYFbb19i9pjkz38zJBg8wa/rboNERq3+hRRb0dHiJh13c+6kAbgqCPfMaJ2gg4weWD3APZswASOfmKwamA==} + + '@vue/server-renderer@3.5.25': + resolution: {integrity: sha512-UJaXR54vMG61i8XNIzTSf2Q7MOqZHpp8+x3XLGtE3+fL+nQd+k7O5+X3D/uWrnQXOdMw5VPih+Uremcw+u1woQ==} + peerDependencies: + vue: 3.5.25 + + '@vue/shared@3.5.25': + resolution: {integrity: sha512-AbOPdQQnAnzs58H2FrrDxYj/TJfmeS2jdfEEhgiKINy+bnOANmVizIEgq1r+C5zsbs6l1CCQxtcj71rwNQ4jWg==} + + '@webgpu/types@0.1.68': + resolution: {integrity: sha512-3ab1B59Ojb6RwjOspYLsTpCzbNB3ZaamIAxBMmvnNkiDoLTZUOBXZ9p5nAYVEkQlDdf6qAZWi1pqj9+ypiqznA==} + + alien-signals@3.1.1: + resolution: {integrity: sha512-ogkIWbVrLwKtHY6oOAXaYkAxP+cTH7V5FZ5+Tm4NZFd8VDZ6uNMDrfzqctTZ42eTMCSR3ne3otpcxmqSnFfPYA==} + + csstype@3.2.3: + resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + + entities@4.5.0: + resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} + engines: {node: '>=0.12'} + + esbuild@0.25.12: + resolution: {integrity: sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==} + engines: {node: '>=18'} + hasBin: true + + estree-walker@2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + magic-string@0.30.21: + resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + + muggle-string@0.4.1: + resolution: {integrity: sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==} + + nanoid@3.3.11: + resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + path-browserify@1.0.1: + resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@4.0.3: + resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} + engines: {node: '>=12'} + + postcss@8.5.6: + resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} + engines: {node: ^10 || ^12 || >=14} + + rollup@4.53.5: + resolution: {integrity: sha512-iTNAbFSlRpcHeeWu73ywU/8KuU/LZmNCSxp6fjQkJBD3ivUb8tpDrXhIxEzA05HlYMEwmtaUnb3RP+YNv162OQ==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + + tinyglobby@0.2.15: + resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} + engines: {node: '>=12.0.0'} + + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + + undici-types@7.16.0: + resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} + + vite@6.4.1: + resolution: {integrity: sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + jiti: '>=1.21.0' + less: '*' + lightningcss: ^1.21.0 + sass: '*' + sass-embedded: '*' + stylus: '*' + sugarss: '*' + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vscode-uri@3.1.0: + resolution: {integrity: sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==} + + vue-tsc@3.1.8: + resolution: {integrity: sha512-deKgwx6exIHeZwF601P1ktZKNF0bepaSN4jBU3AsbldPx9gylUc1JDxYppl82yxgkAgaz0Y0LCLOi+cXe9HMYA==} + hasBin: true + peerDependencies: + typescript: '>=5.0.0' + + vue@3.5.25: + resolution: {integrity: sha512-YLVdgv2K13WJ6n+kD5owehKtEXwdwXuj2TTyJMsO7pSeKw2bfRNZGjhB7YzrpbMYj5b5QsUebHpOqR3R3ziy/g==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + +snapshots: + + '@babel/helper-string-parser@7.27.1': {} + + '@babel/helper-validator-identifier@7.28.5': {} + + '@babel/parser@7.28.5': + dependencies: + '@babel/types': 7.28.5 + + '@babel/types@7.28.5': + dependencies: + '@babel/helper-string-parser': 7.27.1 + '@babel/helper-validator-identifier': 7.28.5 + + '@esbuild/aix-ppc64@0.25.12': + optional: true + + '@esbuild/android-arm64@0.25.12': + optional: true + + '@esbuild/android-arm@0.25.12': + optional: true + + '@esbuild/android-x64@0.25.12': + optional: true + + '@esbuild/darwin-arm64@0.25.12': + optional: true + + '@esbuild/darwin-x64@0.25.12': + optional: true + + '@esbuild/freebsd-arm64@0.25.12': + optional: true + + '@esbuild/freebsd-x64@0.25.12': + optional: true + + '@esbuild/linux-arm64@0.25.12': + optional: true + + '@esbuild/linux-arm@0.25.12': + optional: true + + '@esbuild/linux-ia32@0.25.12': + optional: true + + '@esbuild/linux-loong64@0.25.12': + optional: true + + '@esbuild/linux-mips64el@0.25.12': + optional: true + + '@esbuild/linux-ppc64@0.25.12': + optional: true + + '@esbuild/linux-riscv64@0.25.12': + optional: true + + '@esbuild/linux-s390x@0.25.12': + optional: true + + '@esbuild/linux-x64@0.25.12': + optional: true + + '@esbuild/netbsd-arm64@0.25.12': + optional: true + + '@esbuild/netbsd-x64@0.25.12': + optional: true + + '@esbuild/openbsd-arm64@0.25.12': + optional: true + + '@esbuild/openbsd-x64@0.25.12': + optional: true + + '@esbuild/openharmony-arm64@0.25.12': + optional: true + + '@esbuild/sunos-x64@0.25.12': + optional: true + + '@esbuild/win32-arm64@0.25.12': + optional: true + + '@esbuild/win32-ia32@0.25.12': + optional: true + + '@esbuild/win32-x64@0.25.12': + optional: true + + '@jridgewell/sourcemap-codec@1.5.5': {} + + '@rollup/rollup-android-arm-eabi@4.53.5': + optional: true + + '@rollup/rollup-android-arm64@4.53.5': + optional: true + + '@rollup/rollup-darwin-arm64@4.53.5': + optional: true + + '@rollup/rollup-darwin-x64@4.53.5': + optional: true + + '@rollup/rollup-freebsd-arm64@4.53.5': + optional: true + + '@rollup/rollup-freebsd-x64@4.53.5': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.53.5': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.53.5': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.53.5': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.53.5': + optional: true + + '@rollup/rollup-linux-loong64-gnu@4.53.5': + optional: true + + '@rollup/rollup-linux-ppc64-gnu@4.53.5': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.53.5': + optional: true + + '@rollup/rollup-linux-riscv64-musl@4.53.5': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.53.5': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.53.5': + optional: true + + '@rollup/rollup-linux-x64-musl@4.53.5': + optional: true + + '@rollup/rollup-openharmony-arm64@4.53.5': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.53.5': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.53.5': + optional: true + + '@rollup/rollup-win32-x64-gnu@4.53.5': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.53.5': + optional: true + + '@tauri-apps/api@2.9.1': {} + + '@tauri-apps/cli-darwin-arm64@2.9.6': + optional: true + + '@tauri-apps/cli-darwin-x64@2.9.6': + optional: true + + '@tauri-apps/cli-linux-arm-gnueabihf@2.9.6': + optional: true + + '@tauri-apps/cli-linux-arm64-gnu@2.9.6': + optional: true + + '@tauri-apps/cli-linux-arm64-musl@2.9.6': + optional: true + + '@tauri-apps/cli-linux-riscv64-gnu@2.9.6': + optional: true + + '@tauri-apps/cli-linux-x64-gnu@2.9.6': + optional: true + + '@tauri-apps/cli-linux-x64-musl@2.9.6': + optional: true + + '@tauri-apps/cli-win32-arm64-msvc@2.9.6': + optional: true + + '@tauri-apps/cli-win32-ia32-msvc@2.9.6': + optional: true + + '@tauri-apps/cli-win32-x64-msvc@2.9.6': + optional: true + + '@tauri-apps/cli@2.9.6': + optionalDependencies: + '@tauri-apps/cli-darwin-arm64': 2.9.6 + '@tauri-apps/cli-darwin-x64': 2.9.6 + '@tauri-apps/cli-linux-arm-gnueabihf': 2.9.6 + '@tauri-apps/cli-linux-arm64-gnu': 2.9.6 + '@tauri-apps/cli-linux-arm64-musl': 2.9.6 + '@tauri-apps/cli-linux-riscv64-gnu': 2.9.6 + '@tauri-apps/cli-linux-x64-gnu': 2.9.6 + '@tauri-apps/cli-linux-x64-musl': 2.9.6 + '@tauri-apps/cli-win32-arm64-msvc': 2.9.6 + '@tauri-apps/cli-win32-ia32-msvc': 2.9.6 + '@tauri-apps/cli-win32-x64-msvc': 2.9.6 + + '@tauri-apps/plugin-opener@2.5.2': + dependencies: + '@tauri-apps/api': 2.9.1 + + '@types/estree@1.0.8': {} + + '@types/node@25.0.3': + dependencies: + undici-types: 7.16.0 + + '@vitejs/plugin-vue@5.2.4(vite@6.4.1(@types/node@25.0.3))(vue@3.5.25(typescript@5.9.3))': + dependencies: + vite: 6.4.1(@types/node@25.0.3) + vue: 3.5.25(typescript@5.9.3) + + '@volar/language-core@2.4.26': + dependencies: + '@volar/source-map': 2.4.26 + + '@volar/source-map@2.4.26': {} + + '@volar/typescript@2.4.26': + dependencies: + '@volar/language-core': 2.4.26 + path-browserify: 1.0.1 + vscode-uri: 3.1.0 + + '@vue/compiler-core@3.5.25': + dependencies: + '@babel/parser': 7.28.5 + '@vue/shared': 3.5.25 + entities: 4.5.0 + estree-walker: 2.0.2 + source-map-js: 1.2.1 + + '@vue/compiler-dom@3.5.25': + dependencies: + '@vue/compiler-core': 3.5.25 + '@vue/shared': 3.5.25 + + '@vue/compiler-sfc@3.5.25': + dependencies: + '@babel/parser': 7.28.5 + '@vue/compiler-core': 3.5.25 + '@vue/compiler-dom': 3.5.25 + '@vue/compiler-ssr': 3.5.25 + '@vue/shared': 3.5.25 + estree-walker: 2.0.2 + magic-string: 0.30.21 + postcss: 8.5.6 + source-map-js: 1.2.1 + + '@vue/compiler-ssr@3.5.25': + dependencies: + '@vue/compiler-dom': 3.5.25 + '@vue/shared': 3.5.25 + + '@vue/language-core@3.1.8(typescript@5.9.3)': + dependencies: + '@volar/language-core': 2.4.26 + '@vue/compiler-dom': 3.5.25 + '@vue/shared': 3.5.25 + alien-signals: 3.1.1 + muggle-string: 0.4.1 + path-browserify: 1.0.1 + picomatch: 4.0.3 + optionalDependencies: + typescript: 5.9.3 + + '@vue/reactivity@3.5.25': + dependencies: + '@vue/shared': 3.5.25 + + '@vue/runtime-core@3.5.25': + dependencies: + '@vue/reactivity': 3.5.25 + '@vue/shared': 3.5.25 + + '@vue/runtime-dom@3.5.25': + dependencies: + '@vue/reactivity': 3.5.25 + '@vue/runtime-core': 3.5.25 + '@vue/shared': 3.5.25 + csstype: 3.2.3 + + '@vue/server-renderer@3.5.25(vue@3.5.25(typescript@5.9.3))': + dependencies: + '@vue/compiler-ssr': 3.5.25 + '@vue/shared': 3.5.25 + vue: 3.5.25(typescript@5.9.3) + + '@vue/shared@3.5.25': {} + + '@webgpu/types@0.1.68': {} + + alien-signals@3.1.1: {} + + csstype@3.2.3: {} + + entities@4.5.0: {} + + esbuild@0.25.12: + optionalDependencies: + '@esbuild/aix-ppc64': 0.25.12 + '@esbuild/android-arm': 0.25.12 + '@esbuild/android-arm64': 0.25.12 + '@esbuild/android-x64': 0.25.12 + '@esbuild/darwin-arm64': 0.25.12 + '@esbuild/darwin-x64': 0.25.12 + '@esbuild/freebsd-arm64': 0.25.12 + '@esbuild/freebsd-x64': 0.25.12 + '@esbuild/linux-arm': 0.25.12 + '@esbuild/linux-arm64': 0.25.12 + '@esbuild/linux-ia32': 0.25.12 + '@esbuild/linux-loong64': 0.25.12 + '@esbuild/linux-mips64el': 0.25.12 + '@esbuild/linux-ppc64': 0.25.12 + '@esbuild/linux-riscv64': 0.25.12 + '@esbuild/linux-s390x': 0.25.12 + '@esbuild/linux-x64': 0.25.12 + '@esbuild/netbsd-arm64': 0.25.12 + '@esbuild/netbsd-x64': 0.25.12 + '@esbuild/openbsd-arm64': 0.25.12 + '@esbuild/openbsd-x64': 0.25.12 + '@esbuild/openharmony-arm64': 0.25.12 + '@esbuild/sunos-x64': 0.25.12 + '@esbuild/win32-arm64': 0.25.12 + '@esbuild/win32-ia32': 0.25.12 + '@esbuild/win32-x64': 0.25.12 + + estree-walker@2.0.2: {} + + fdir@6.5.0(picomatch@4.0.3): + optionalDependencies: + picomatch: 4.0.3 + + fsevents@2.3.3: + optional: true + + magic-string@0.30.21: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + + muggle-string@0.4.1: {} + + nanoid@3.3.11: {} + + path-browserify@1.0.1: {} + + picocolors@1.1.1: {} + + picomatch@4.0.3: {} + + postcss@8.5.6: + dependencies: + nanoid: 3.3.11 + picocolors: 1.1.1 + source-map-js: 1.2.1 + + rollup@4.53.5: + dependencies: + '@types/estree': 1.0.8 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.53.5 + '@rollup/rollup-android-arm64': 4.53.5 + '@rollup/rollup-darwin-arm64': 4.53.5 + '@rollup/rollup-darwin-x64': 4.53.5 + '@rollup/rollup-freebsd-arm64': 4.53.5 + '@rollup/rollup-freebsd-x64': 4.53.5 + '@rollup/rollup-linux-arm-gnueabihf': 4.53.5 + '@rollup/rollup-linux-arm-musleabihf': 4.53.5 + '@rollup/rollup-linux-arm64-gnu': 4.53.5 + '@rollup/rollup-linux-arm64-musl': 4.53.5 + '@rollup/rollup-linux-loong64-gnu': 4.53.5 + '@rollup/rollup-linux-ppc64-gnu': 4.53.5 + '@rollup/rollup-linux-riscv64-gnu': 4.53.5 + '@rollup/rollup-linux-riscv64-musl': 4.53.5 + '@rollup/rollup-linux-s390x-gnu': 4.53.5 + '@rollup/rollup-linux-x64-gnu': 4.53.5 + '@rollup/rollup-linux-x64-musl': 4.53.5 + '@rollup/rollup-openharmony-arm64': 4.53.5 + '@rollup/rollup-win32-arm64-msvc': 4.53.5 + '@rollup/rollup-win32-ia32-msvc': 4.53.5 + '@rollup/rollup-win32-x64-gnu': 4.53.5 + '@rollup/rollup-win32-x64-msvc': 4.53.5 + fsevents: 2.3.3 + + source-map-js@1.2.1: {} + + tinyglobby@0.2.15: + dependencies: + fdir: 6.5.0(picomatch@4.0.3) + picomatch: 4.0.3 + + typescript@5.9.3: {} + + undici-types@7.16.0: {} + + vite@6.4.1(@types/node@25.0.3): + dependencies: + esbuild: 0.25.12 + fdir: 6.5.0(picomatch@4.0.3) + picomatch: 4.0.3 + postcss: 8.5.6 + rollup: 4.53.5 + tinyglobby: 0.2.15 + optionalDependencies: + '@types/node': 25.0.3 + fsevents: 2.3.3 + + vscode-uri@3.1.0: {} + + vue-tsc@3.1.8(typescript@5.9.3): + dependencies: + '@volar/typescript': 2.4.26 + '@vue/language-core': 3.1.8(typescript@5.9.3) + typescript: 5.9.3 + + vue@3.5.25(typescript@5.9.3): + dependencies: + '@vue/compiler-dom': 3.5.25 + '@vue/compiler-sfc': 3.5.25 + '@vue/runtime-dom': 3.5.25 + '@vue/server-renderer': 3.5.25(vue@3.5.25(typescript@5.9.3)) + '@vue/shared': 3.5.25 + optionalDependencies: + typescript: 5.9.3 diff --git a/public/tauri.svg b/public/tauri.svg new file mode 100644 index 0000000..31b62c9 --- /dev/null +++ b/public/tauri.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/public/vite.svg b/public/vite.svg new file mode 100644 index 0000000..e7b8dfb --- /dev/null +++ b/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src-tauri/.gitignore b/src-tauri/.gitignore new file mode 100644 index 0000000..b21bd68 --- /dev/null +++ b/src-tauri/.gitignore @@ -0,0 +1,7 @@ +# Generated by Cargo +# will have compiled files and executables +/target/ + +# Generated by Tauri +# will have schema files for capabilities auto-completion +/gen/schemas diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock new file mode 100644 index 0000000..87e60ad --- /dev/null +++ b/src-tauri/Cargo.lock @@ -0,0 +1,6250 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "aligned" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee4508988c62edf04abd8d92897fca0c2995d907ce1dfeaf369dac3716a40685" +dependencies = [ + "as-slice", +] + +[[package]] +name = "aligned-vec" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc890384c8602f339876ded803c97ad529f3842aba97f6392b3dba0dd171769b" +dependencies = [ + "equator", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" + +[[package]] +name = "arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" + +[[package]] +name = "arboard" +version = "3.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0348a1c054491f4bfe6ab86a7b6ab1e44e45d899005de92f58b3df180b36ddaf" +dependencies = [ + "clipboard-win", + "image", + "log", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation", + "parking_lot", + "percent-encoding", + "windows-sys 0.60.2", + "wl-clipboard-rs", + "x11rb", +] + +[[package]] +name = "arg_enum_proc_macro" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "as-slice" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" +dependencies = [ + "stable_deref_trait", +] + +[[package]] +name = "ashpd" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cbdf310d77fd3aaee6ea2093db7011dc2d35d2eb3481e5607f1f8d942ed99df" +dependencies = [ + "enumflags2", + "futures-channel", + "futures-util", + "rand 0.9.2", + "raw-window-handle", + "serde", + "serde_repr", + "tokio", + "url", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "zbus", +] + +[[package]] +name = "async-broadcast" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497c00e0fd83a72a79a39fcbd8e3e2f055d6f6c7e025f3b3d91f4f8e76527fb8" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "pin-project-lite", + "slab", +] + +[[package]] +name = "async-io" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" +dependencies = [ + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "windows-sys 0.61.2", +] + +[[package]] +name = "async-lock" +version = "3.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd03604047cee9b6ce9de9f70c6cd540a0520c813cbd49bae61f33ab80ed1dc" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-process" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" +dependencies = [ + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener", + "futures-lite", + "rustix", +] + +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "async-signal" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43c070bbf59cd3570b6b2dd54cd772527c7c3620fce8be898406dd3ed6adc64c" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab", + "windows-sys 0.61.2", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "atk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241b621213072e993be4f6f3a9e4b45f65b7e6faad43001be957184b7bb1824b" +dependencies = [ + "atk-sys", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e48b684b0ca77d2bbadeef17424c2ea3c897d44d566a1617e7e8f30614d086" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "av-scenechange" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f321d77c20e19b92c39e7471cf986812cbb46659d2af674adc4331ef3f18394" +dependencies = [ + "aligned", + "anyhow", + "arg_enum_proc_macro", + "arrayvec", + "log", + "num-rational", + "num-traits", + "pastey", + "rayon", + "thiserror 2.0.17", + "v_frame", + "y4m", +] + +[[package]] +name = "av1-grain" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cfddb07216410377231960af4fcab838eaa12e013417781b78bd95ee22077f8" +dependencies = [ + "anyhow", + "arrayvec", + "log", + "nom", + "num-rational", + "v_frame", +] + +[[package]] +name = "avif-serialize" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47c8fbc0f831f4519fe8b810b6a7a91410ec83031b8233f730a0480029f6a23f" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bit_field" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e4b40c7323adcfc0a41c4b88143ed58346ff65a288fc144329c5c45e05d70c6" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" +dependencies = [ + "serde_core", +] + +[[package]] +name = "bitstream-io" +version = "4.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60d4bd9d1db2c6bdf285e223a7fa369d5ce98ec767dec949c6ca62863ce61757" +dependencies = [ + "core2", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" +dependencies = [ + "objc2", +] + +[[package]] +name = "blocking" +version = "1.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + +[[package]] +name = "brotli" +version = "8.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bd8b9603c7aa97359dbd97ecf258968c95f3adddd6db2f7e7a5bef101c84560" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "874bb8112abecc98cbd6d81ea4fa7e94fb9449648c93cc89aa40c81c24d7de03" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "built" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4ad8f11f288f48ca24471bbd51ac257aaeaaa07adae295591266b792902ae64" + +[[package]] +name = "bumpalo" +version = "3.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" + +[[package]] +name = "bytemuck" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbdf580320f38b612e485521afda1ee26d10cc9884efaaa750d383e13e3c5f4" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + +[[package]] +name = "bytes" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" +dependencies = [ + "serde", +] + +[[package]] +name = "cairo-rs" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" +dependencies = [ + "bitflags 2.10.0", + "cairo-sys-rs", + "glib", + "libc", + "once_cell", + "thiserror 1.0.69", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "camino" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" +dependencies = [ + "serde_core", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 2.0.17", +] + +[[package]] +name = "cargo_toml" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374b7c592d9c00c1f4972ea58390ac6b18cbb6ab79011f3bdc90a0b82ca06b77" +dependencies = [ + "serde", + "toml 0.9.9+spec-1.0.0", +] + +[[package]] +name = "cc" +version = "1.2.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90583009037521a116abf44494efecd645ba48b6622457080f080b85544e2215" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfb" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" +dependencies = [ + "byteorder", + "fnv", + "uuid", +] + +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" +dependencies = [ + "iana-time-zone", + "num-traits", + "serde", + "windows-link 0.2.1", +] + +[[package]] +name = "clipboard-win" +version = "5.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bde03770d3df201d4fb868f2c9c59e66a3e4e2bd06692a0fe701e7103c7e84d4" +dependencies = [ + "error-code", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cookie" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" +dependencies = [ + "time", + "version_check", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1" +dependencies = [ + "bitflags 2.10.0", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" +dependencies = [ + "bitflags 2.10.0", + "core-foundation", + "libc", +] + +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cssparser" +version = "0.29.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93d03419cb5950ccfd3daf3ff1c7a36ace64609a1a8746d493df1ca0afde0fa" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa", + "matches", + "phf 0.10.1", + "proc-macro2", + "quote", + "smallvec", + "syn 1.0.109", +] + +[[package]] +name = "cssparser-macros" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" +dependencies = [ + "quote", + "syn 2.0.111", +] + +[[package]] +name = "ctor" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" +dependencies = [ + "quote", + "syn 2.0.111", +] + +[[package]] +name = "darling" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.111", +] + +[[package]] +name = "darling_macro" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "deranged" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" +dependencies = [ + "powerfmt", + "serde_core", +] + +[[package]] +name = "derive_more" +version = "0.99.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.111", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.61.2", +] + +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "dispatch2" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec" +dependencies = [ + "bitflags 2.10.0", + "block2", + "libc", + "objc2", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "dlib" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" +dependencies = [ + "libloading", +] + +[[package]] +name = "dlopen2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e2c5bd4158e66d1e215c49b837e11d62f3267b30c92f1d171c4d3105e3dc4d4" +dependencies = [ + "dlopen2_derive", + "libc", + "once_cell", + "winapi", +] + +[[package]] +name = "dlopen2_derive" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fbbb781877580993a8707ec48672673ec7b81eeba04cfd2310bd28c08e47c8f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "dpi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" +dependencies = [ + "serde", +] + +[[package]] +name = "dtoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6add3b8cff394282be81f3fc1a0605db594ed69890078ca6e2cab1c408bcf04" + +[[package]] +name = "dtoa-short" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" +dependencies = [ + "dtoa", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "embed-resource" +version = "3.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55a075fc573c64510038d7ee9abc7990635863992f83ebc52c8b433b8411a02e" +dependencies = [ + "cc", + "memchr", + "rustc_version", + "toml 0.9.9+spec-1.0.0", + "vswhom", + "winreg", +] + +[[package]] +name = "embed_plist" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" + +[[package]] +name = "endi" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099" + +[[package]] +name = "enumflags2" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "equator" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4711b213838dfee0117e3be6ac926007d7f433d7bbe33595975d4190cb07e6fc" +dependencies = [ + "equator-macro", +] + +[[package]] +name = "equator-macro" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "erased-serde" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89e8918065695684b2b0702da20382d5ae6065cf3327bc2d6436bd49a71ce9f3" +dependencies = [ + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "error-code" +version = "3.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dea2df4cf52843e0452895c455a1a2cfbb842a1e7329671acf418fdc53ed4c59" + +[[package]] +name = "event-listener" +version = "5.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener", + "pin-project-lite", +] + +[[package]] +name = "exr" +version = "1.74.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4300e043a56aa2cb633c01af81ca8f699a321879a7854d3896a0ba89056363be" +dependencies = [ + "bit_field", + "half", + "lebe", + "miniz_oxide", + "rayon-core", + "smallvec", + "zune-inflate", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fax" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05de7d48f37cd6730705cbca900770cab77a89f413d23e100ad7fad7795a0ab" +dependencies = [ + "fax_derive", +] + +[[package]] +name = "fax_derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0aca10fb742cb43f9e7bb8467c91aa9bcb8e3ffbc6a6f7389bb93ffc920577d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "fdeflate" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "field-offset" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" +dependencies = [ + "memoffset", + "rustc_version", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" + +[[package]] +name = "fixedbitset" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" + +[[package]] +name = "flate2" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" +dependencies = [ + "mac", + "new_debug_unreachable", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-lite" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "gdk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f245958c627ac99d8e529166f9823fb3b838d1d41fd2b297af3075093c2691" +dependencies = [ + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" +dependencies = [ + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", + "once_cell", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gdk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c2d13f38594ac1e66619e188c6d5a1adb98d11b2fcf7894fc416ad76aa2f3f7" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkwayland-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "140071d506d223f7572b9f09b5e155afbd77428cd5cc7af8f2694c41d98dfe69" +dependencies = [ + "gdk-sys", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkx11" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3caa00e14351bebbc8183b3c36690327eb77c49abc2268dd4bd36b856db3fbfe" +dependencies = [ + "gdk", + "gdkx11-sys", + "gio", + "glib", + "libc", + "x11", +] + +[[package]] +name = "gdkx11-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e7445fe01ac26f11601db260dd8608fe172514eb63b3b5e261ea6b0f4428d" +dependencies = [ + "gdk-sys", + "glib-sys", + "libc", + "system-deps", + "x11", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "gethostname" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8" +dependencies = [ + "rustix", + "windows-link 0.2.1", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasip2", +] + +[[package]] +name = "gif" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5df2ba84018d80c213569363bdcd0c64e6933c67fe4c1d60ecf822971a3c35e" +dependencies = [ + "color_quant", + "weezl", +] + +[[package]] +name = "gio" +version = "0.18.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "gio-sys", + "glib", + "libc", + "once_cell", + "pin-project-lite", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "gio-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", + "winapi", +] + +[[package]] +name = "glib" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" +dependencies = [ + "bitflags 2.10.0", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "memchr", + "once_cell", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "glib-macros" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" +dependencies = [ + "heck 0.4.1", + "proc-macro-crate 2.0.2", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "glib-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" +dependencies = [ + "libc", + "system-deps", +] + +[[package]] +name = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + +[[package]] +name = "gobject-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gtk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd56fb197bfc42bd5d2751f4f017d44ff59fbb58140c6b49f9b3b2bdab08506a" +dependencies = [ + "atk", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f29a1c21c59553eb7dd40e918be54dccd60c52b049b75119d5d96ce6b624414" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps", +] + +[[package]] +name = "gtk3-macros" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ff3c5b21f14f0736fed6dcfc0bfb4225ebf5725f3c0209edeec181e4d73e9d" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "half" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" +dependencies = [ + "cfg-if", + "crunchy", + "zerocopy", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "html5ever" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b7410cae13cbc75623c98ac4cbfd1f0bedddf3227afc24f370cf0f50a44a11c" +dependencies = [ + "log", + "mac", + "markup5ever", + "match_token", +] + +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hyper" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "pin-utils", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-util" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core 0.62.2", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ico" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc50b891e4acf8fe0e71ef88ec43ad82ee07b3810ad09de10f1d01f072ed4b98" +dependencies = [ + "byteorder", + "png 0.17.16", +] + +[[package]] +name = "icu_collections" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" + +[[package]] +name = "icu_properties" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" + +[[package]] +name = "icu_provider" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "image" +version = "0.25.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6506c6c10786659413faa717ceebcb8f70731c0a60cbae39795fdf114519c1a" +dependencies = [ + "bytemuck", + "byteorder-lite", + "color_quant", + "exr", + "gif", + "image-webp", + "moxcms", + "num-traits", + "png 0.18.0", + "qoi", + "ravif", + "rayon", + "rgb", + "tiff", + "zune-core 0.5.0", + "zune-jpeg 0.5.7", +] + +[[package]] +name = "image-webp" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3" +dependencies = [ + "byteorder-lite", + "quick-error", +] + +[[package]] +name = "imgref" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c5cedc30da3a610cac6b4ba17597bdf7152cf974e8aab3afb3d54455e371c8" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", + "serde", + "serde_core", +] + +[[package]] +name = "infer" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a588916bfdfd92e71cacef98a63d9b1f0d74d6599980d11894290e7ddefffcf7" +dependencies = [ + "cfb", +] + +[[package]] +name = "interpolate_name" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "ipnet" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "iri-string" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f867b9d1d896b67beb18518eda36fdb77a32ea590de864f1325b294a6d14397" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "is-docker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" +dependencies = [ + "once_cell", +] + +[[package]] +name = "is-wsl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" +dependencies = [ + "is-docker", + "once_cell", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "javascriptcore-rs" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" +dependencies = [ + "bitflags 1.3.2", + "glib", + "javascriptcore-rs-sys", +] + +[[package]] +name = "javascriptcore-rs-sys" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.4", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "json-patch" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "863726d7afb6bc2590eeff7135d923545e5e964f004c2ccf8716c25e70a86f08" +dependencies = [ + "jsonptr", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "jsonptr" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dea2b27dd239b2556ed7a25ba842fe47fd602e7fc7433c2a8d6106d4d9edd70" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "keyboard-types" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" +dependencies = [ + "bitflags 2.10.0", + "serde", + "unicode-segmentation", +] + +[[package]] +name = "kuchikiki" +version = "0.8.8-speedreader" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02cb977175687f33fa4afa0c95c112b987ea1443e5a51c8f8ff27dc618270cc2" +dependencies = [ + "cssparser", + "html5ever", + "indexmap 2.12.1", + "selectors", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lebe" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8" + +[[package]] +name = "libappindicator" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a" +dependencies = [ + "glib", + "gtk", + "gtk-sys", + "libappindicator-sys", + "log", +] + +[[package]] +name = "libappindicator-sys" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf" +dependencies = [ + "gtk-sys", + "libloading", + "once_cell", +] + +[[package]] +name = "libc" +version = "0.2.178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" + +[[package]] +name = "libfuzzer-sys" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5037190e1f70cbeef565bd267599242926f724d3b8a9f510fd7e0b540cfa4404" +dependencies = [ + "arbitrary", + "cc", +] + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "libredox" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df15f6eac291ed1cf25865b1ee60399f57e7c227e7f51bdbd4c5270396a9ed50" +dependencies = [ + "bitflags 2.10.0", + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" + +[[package]] +name = "litemap" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "loop9" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" +dependencies = [ + "imgref", +] + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" + +[[package]] +name = "markup5ever" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7a7213d12e1864c0f002f52c2923d4556935a43dec5e71355c2760e0f6e7a18" +dependencies = [ + "log", + "phf 0.11.3", + "phf_codegen 0.11.3", + "string_cache", + "string_cache_codegen", + "tendril", +] + +[[package]] +name = "match_token" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a9689d8d44bf9964484516275f5cd4c9b59457a6940c1d5d0ecbb94510a36b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "maybe-rayon" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" +dependencies = [ + "cfg-if", + "rayon", +] + +[[package]] +name = "memchr" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" +dependencies = [ + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.61.2", +] + +[[package]] +name = "moxcms" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac9557c559cd6fc9867e122e20d2cbefc9ca29d80d027a8e39310920ed2f0a97" +dependencies = [ + "num-traits", + "pxfm", +] + +[[package]] +name = "muda" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01c1738382f66ed56b3b9c8119e794a2e23148ac8ea214eda86622d4cb9d415a" +dependencies = [ + "crossbeam-channel", + "dpi", + "gtk", + "keyboard-types", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "once_cell", + "png 0.17.16", + "serde", + "thiserror 2.0.17", + "windows-sys 0.60.2", +] + +[[package]] +name = "ndk" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" +dependencies = [ + "bitflags 2.10.0", + "jni-sys", + "log", + "ndk-sys", + "num_enum", + "raw-window-handle", + "thiserror 1.0.69", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nix" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" +dependencies = [ + "bitflags 2.10.0", + "cfg-if", + "cfg_aliases", + "libc", + "memoffset", +] + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "nom" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" +dependencies = [ + "memchr", +] + +[[package]] +name = "noop_proc_macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1207a7e20ad57b847bbddc6776b968420d38292bbfe2089accff5e19e82454c" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7" +dependencies = [ + "proc-macro-crate 3.4.0", + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "objc2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c2599ce0ec54857b29ce62166b0ed9b4f6f1a70ccc9a71165b6154caca8c05" +dependencies = [ + "objc2-encode", + "objc2-exception-helper", +] + +[[package]] +name = "objc2-app-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" +dependencies = [ + "bitflags 2.10.0", + "block2", + "libc", + "objc2", + "objc2-cloud-kit", + "objc2-core-data", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-core-image", + "objc2-core-text", + "objc2-core-video", + "objc2-foundation", + "objc2-quartz-core", +] + +[[package]] +name = "objc2-cloud-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c" +dependencies = [ + "bitflags 2.10.0", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-data" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa" +dependencies = [ + "bitflags 2.10.0", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags 2.10.0", + "dispatch2", + "objc2", +] + +[[package]] +name = "objc2-core-graphics" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" +dependencies = [ + "bitflags 2.10.0", + "dispatch2", + "objc2", + "objc2-core-foundation", + "objc2-io-surface", +] + +[[package]] +name = "objc2-core-image" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-text" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" +dependencies = [ + "bitflags 2.10.0", + "objc2", + "objc2-core-foundation", + "objc2-core-graphics", +] + +[[package]] +name = "objc2-core-video" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d425caf1df73233f29fd8a5c3e5edbc30d2d4307870f802d18f00d83dc5141a6" +dependencies = [ + "bitflags 2.10.0", + "objc2", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-io-surface", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-exception-helper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7a1c5fbb72d7735b076bb47b578523aedc40f3c439bea6dfd595c089d79d98a" +dependencies = [ + "cc", +] + +[[package]] +name = "objc2-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" +dependencies = [ + "bitflags 2.10.0", + "block2", + "libc", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-io-surface" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" +dependencies = [ + "bitflags 2.10.0", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-javascript-core" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a1e6550c4caed348956ce3370c9ffeca70bb1dbed4fa96112e7c6170e074586" +dependencies = [ + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" +dependencies = [ + "bitflags 2.10.0", + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "objc2-security" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe137109bd1e8b5a99390f77a7d8b2961dafc1a1c5db8f2e60329ad6d895a" +dependencies = [ + "bitflags 2.10.0", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" +dependencies = [ + "bitflags 2.10.0", + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "objc2-web-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2e5aaab980c433cf470df9d7af96a7b46a9d892d521a2cbbb2f8a4c16751e7f" +dependencies = [ + "bitflags 2.10.0", + "block2", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "objc2-javascript-core", + "objc2-security", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "open" +version = "5.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43bb73a7fa3799b198970490a51174027ba0d4ec504b03cd08caf513d40024bc" +dependencies = [ + "dunce", + "is-wsl", + "libc", + "pathdiff", +] + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "os_pipe" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "pango" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" +dependencies = [ + "gio", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link 0.2.1", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pastey" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec" + +[[package]] +name = "pathdiff" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "petgraph" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" +dependencies = [ + "fixedbitset", + "hashbrown 0.15.5", + "indexmap 2.12.1", +] + +[[package]] +name = "phf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +dependencies = [ + "phf_shared 0.8.0", +] + +[[package]] +name = "phf" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +dependencies = [ + "phf_macros 0.10.0", + "phf_shared 0.10.0", + "proc-macro-hack", +] + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros 0.11.3", + "phf_shared 0.11.3", +] + +[[package]] +name = "phf_codegen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", +] + +[[package]] +name = "phf_codegen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", +] + +[[package]] +name = "phf_generator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" +dependencies = [ + "phf_shared 0.8.0", + "rand 0.7.3", +] + +[[package]] +name = "phf_generator" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +dependencies = [ + "phf_shared 0.10.0", + "rand 0.8.5", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared 0.11.3", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "phf_shared" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" +dependencies = [ + "siphasher 0.3.11", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher 0.3.11", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher 1.0.1", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "piper" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "plist" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "740ebea15c5d1428f910cd1a5f52cebf8d25006245ed8ade92702f4943d91e07" +dependencies = [ + "base64 0.22.1", + "indexmap 2.12.1", + "quick-xml 0.38.4", + "serde", + "time", +] + +[[package]] +name = "png" +version = "0.17.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "png" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97baced388464909d42d89643fe4361939af9b7ce7a31ee32a168f832a70f2a0" +dependencies = [ + "bitflags 2.10.0", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "polling" +version = "3.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +dependencies = [ + "toml_datetime 0.6.3", + "toml_edit 0.20.2", +] + +[[package]] +name = "proc-macro-crate" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" +dependencies = [ + "toml_edit 0.23.10+spec-1.0.0", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro2" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "profiling" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773" +dependencies = [ + "profiling-procmacros", +] + +[[package]] +name = "profiling-procmacros" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52717f9a02b6965224f95ca2a81e2e0c5c43baacd28ca057577988930b6c3d5b" +dependencies = [ + "quote", + "syn 2.0.111", +] + +[[package]] +name = "pxfm" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7186d3822593aa4393561d186d1393b3923e9d6163d3fbfd6e825e3e6cf3e6a8" +dependencies = [ + "num-traits", +] + +[[package]] +name = "qoi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + +[[package]] +name = "quick-xml" +version = "0.37.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "331e97a1af0bf59823e6eadffe373d7b27f485be8748f71471c662c1f269b7fb" +dependencies = [ + "memchr", +] + +[[package]] +name = "quick-xml" +version = "0.38.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66c2058c55a409d601666cffe35f04333cf1013010882cec174a7467cd4e21c" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", + "rand_pcg", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.16", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rav1e" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b6dd56e85d9483277cde964fd1bdb0428de4fec5ebba7540995639a21cb32b" +dependencies = [ + "aligned-vec", + "arbitrary", + "arg_enum_proc_macro", + "arrayvec", + "av-scenechange", + "av1-grain", + "bitstream-io", + "built", + "cfg-if", + "interpolate_name", + "itertools", + "libc", + "libfuzzer-sys", + "log", + "maybe-rayon", + "new_debug_unreachable", + "noop_proc_macro", + "num-derive", + "num-traits", + "paste", + "profiling", + "rand 0.9.2", + "rand_chacha 0.9.0", + "simd_helpers", + "thiserror 2.0.17", + "v_frame", + "wasm-bindgen", +] + +[[package]] +name = "ravif" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef69c1990ceef18a116855938e74793a5f7496ee907562bd0857b6ac734ab285" +dependencies = [ + "avif-serialize", + "imgref", + "loop9", + "quick-error", + "rav1e", + "rayon", + "rgb", +] + +[[package]] +name = "raw-window-handle" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" + +[[package]] +name = "rayon" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.10.0", +] + +[[package]] +name = "redox_users" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" +dependencies = [ + "getrandom 0.2.16", + "libredox", + "thiserror 2.0.17", +] + +[[package]] +name = "ref-cast" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "refvroid" +version = "0.1.0" +dependencies = [ + "arboard", + "base64 0.22.1", + "image", + "serde", + "serde_json", + "tauri", + "tauri-build", + "tauri-plugin-clipboard-manager", + "tauri-plugin-dialog", + "tauri-plugin-fs", + "tauri-plugin-opener", + "windows 0.58.0", +] + +[[package]] +name = "regex" +version = "1.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" + +[[package]] +name = "reqwest" +version = "0.12.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b4c14b2d9afca6a60277086b0cc6a6ae0b568f6f7916c943a8cdc79f8be240f" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", +] + +[[package]] +name = "rfd" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2bee61e6cffa4635c72d7d81a84294e28f0930db0ddcb0f66d10244674ebed" +dependencies = [ + "ashpd", + "block2", + "dispatch2", + "glib-sys", + "gobject-sys", + "gtk-sys", + "js-sys", + "log", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "raw-window-handle", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rgb" +version = "0.8.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c6a884d2998352bb4daf0183589aec883f16a6da1f4dde84d8e2e9a5409a1ce" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" +dependencies = [ + "bitflags 2.10.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schemars" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +dependencies = [ + "dyn-clone", + "indexmap 1.9.3", + "schemars_derive", + "serde", + "serde_json", + "url", + "uuid", +] + +[[package]] +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9558e172d4e8533736ba97870c4b2cd63f84b382a3d6eb063da41b91cce17289" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.111", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "selectors" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c37578180969d00692904465fb7f6b3d50b9a2b952b87c23d0e2e5cb5013416" +dependencies = [ + "bitflags 1.3.2", + "cssparser", + "derive_more", + "fxhash", + "log", + "phf 0.8.0", + "phf_codegen 0.8.0", + "precomputed-hash", + "servo_arc", + "smallvec", +] + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde-untagged" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9faf48a4a2d2693be24c6289dbe26552776eb7737074e6722891fadbe6c5058" +dependencies = [ + "erased-serde", + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "serde_json" +version = "1.0.145" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", + "serde_core", +] + +[[package]] +name = "serde_repr" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_spanned" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fa237f2807440d238e0364a218270b98f767a00d3dada77b1c53ae88940e2e7" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.12.1", + "schemars 0.9.0", + "schemars 1.1.0", + "serde_core", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52a8e3ca0ca629121f70ab50f95249e5a6f925cc0f6ffe8256c45b728875706c" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "serialize-to-javascript" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f3666a07a197cdb77cdf306c32be9b7f598d7060d50cfd4d5aa04bfd92f6c5" +dependencies = [ + "serde", + "serde_json", + "serialize-to-javascript-impl", +] + +[[package]] +name = "serialize-to-javascript-impl" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "servo_arc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52aa42f8fdf0fed91e5ce7f23d8138441002fa31dca008acf47e6fd4721f741" +dependencies = [ + "nodrop", + "stable_deref_trait", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad" +dependencies = [ + "libc", +] + +[[package]] +name = "simd-adler32" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" + +[[package]] +name = "simd_helpers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" +dependencies = [ + "quote", +] + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "slab" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "softbuffer" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac18da81ebbf05109ab275b157c22a653bb3c12cf884450179942f81bcbf6c3" +dependencies = [ + "bytemuck", + "js-sys", + "ndk", + "objc2", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation", + "objc2-quartz-core", + "raw-window-handle", + "redox_syscall", + "tracing", + "wasm-bindgen", + "web-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "soup3" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" +dependencies = [ + "futures-channel", + "gio", + "glib", + "libc", + "soup3-sys", +] + +[[package]] +name = "soup3-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "string_cache" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" +dependencies = [ + "new_debug_unreachable", + "parking_lot", + "phf_shared 0.11.3", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", + "proc-macro2", + "quote", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "swift-rs" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4057c98e2e852d51fdcfca832aac7b571f6b351ad159f9eda5db1655f8d0c4d7" +dependencies = [ + "base64 0.21.7", + "serde", + "serde_json", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "system-deps" +version = "6.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr", + "heck 0.5.0", + "pkg-config", + "toml 0.8.2", + "version-compare", +] + +[[package]] +name = "tao" +version = "0.34.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a753bdc39c07b192151523a3f77cd0394aa75413802c883a0f6f6a0e5ee2e7" +dependencies = [ + "bitflags 2.10.0", + "block2", + "core-foundation", + "core-graphics", + "crossbeam-channel", + "dispatch", + "dlopen2", + "dpi", + "gdkwayland-sys", + "gdkx11-sys", + "gtk", + "jni", + "lazy_static", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "once_cell", + "parking_lot", + "raw-window-handle", + "scopeguard", + "tao-macros", + "unicode-segmentation", + "url", + "windows 0.61.3", + "windows-core 0.61.2", + "windows-version", + "x11-dl", +] + +[[package]] +name = "tao-macros" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "tauri" +version = "2.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a3868da5508446a7cd08956d523ac3edf0a8bc20bf7e4038f9a95c2800d2033" +dependencies = [ + "anyhow", + "bytes", + "cookie", + "dirs", + "dunce", + "embed_plist", + "getrandom 0.3.4", + "glob", + "gtk", + "heck 0.5.0", + "http", + "jni", + "libc", + "log", + "mime", + "muda", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", + "percent-encoding", + "plist", + "raw-window-handle", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "serialize-to-javascript", + "swift-rs", + "tauri-build", + "tauri-macros", + "tauri-runtime", + "tauri-runtime-wry", + "tauri-utils", + "thiserror 2.0.17", + "tokio", + "tray-icon", + "url", + "webkit2gtk", + "webview2-com", + "window-vibrancy", + "windows 0.61.3", +] + +[[package]] +name = "tauri-build" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17fcb8819fd16463512a12f531d44826ce566f486d7ccd211c9c8cebdaec4e08" +dependencies = [ + "anyhow", + "cargo_toml", + "dirs", + "glob", + "heck 0.5.0", + "json-patch", + "schemars 0.8.22", + "semver", + "serde", + "serde_json", + "tauri-utils", + "tauri-winres", + "toml 0.9.9+spec-1.0.0", + "walkdir", +] + +[[package]] +name = "tauri-codegen" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa9844cefcf99554a16e0a278156ae73b0d8680bbc0e2ad1e4287aadd8489cf" +dependencies = [ + "base64 0.22.1", + "brotli", + "ico", + "json-patch", + "plist", + "png 0.17.16", + "proc-macro2", + "quote", + "semver", + "serde", + "serde_json", + "sha2", + "syn 2.0.111", + "tauri-utils", + "thiserror 2.0.17", + "time", + "url", + "uuid", + "walkdir", +] + +[[package]] +name = "tauri-macros" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3764a12f886d8245e66b7ee9b43ccc47883399be2019a61d80cf0f4117446fde" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.111", + "tauri-codegen", + "tauri-utils", +] + +[[package]] +name = "tauri-plugin" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1d0a4860b7ff570c891e1d2a586bf1ede205ff858fbc305e0b5ae5d14c1377" +dependencies = [ + "anyhow", + "glob", + "plist", + "schemars 0.8.22", + "serde", + "serde_json", + "tauri-utils", + "toml 0.9.9+spec-1.0.0", + "walkdir", +] + +[[package]] +name = "tauri-plugin-clipboard-manager" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206dc20af4ed210748ba945c2774e60fd0acd52b9a73a028402caf809e9b6ecf" +dependencies = [ + "arboard", + "log", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "thiserror 2.0.17", +] + +[[package]] +name = "tauri-plugin-dialog" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "313f8138692ddc4a2127c4c9607d616a46f5c042e77b3722450866da0aad2f19" +dependencies = [ + "log", + "raw-window-handle", + "rfd", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "tauri-plugin-fs", + "thiserror 2.0.17", + "url", +] + +[[package]] +name = "tauri-plugin-fs" +version = "2.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47df422695255ecbe7bac7012440eddaeefd026656171eac9559f5243d3230d9" +dependencies = [ + "anyhow", + "dunce", + "glob", + "percent-encoding", + "schemars 0.8.22", + "serde", + "serde_json", + "serde_repr", + "tauri", + "tauri-plugin", + "tauri-utils", + "thiserror 2.0.17", + "toml 0.9.9+spec-1.0.0", + "url", +] + +[[package]] +name = "tauri-plugin-opener" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c26b72571d25dee25667940027114e60f569fc3974f8cefbe50c2cbc5fd65e3b" +dependencies = [ + "dunce", + "glob", + "objc2-app-kit", + "objc2-foundation", + "open", + "schemars 0.8.22", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "thiserror 2.0.17", + "url", + "windows 0.61.3", + "zbus", +] + +[[package]] +name = "tauri-runtime" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f766fe9f3d1efc4b59b17e7a891ad5ed195fa8d23582abb02e6c9a01137892" +dependencies = [ + "cookie", + "dpi", + "gtk", + "http", + "jni", + "objc2", + "objc2-ui-kit", + "objc2-web-kit", + "raw-window-handle", + "serde", + "serde_json", + "tauri-utils", + "thiserror 2.0.17", + "url", + "webkit2gtk", + "webview2-com", + "windows 0.61.3", +] + +[[package]] +name = "tauri-runtime-wry" +version = "2.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "187a3f26f681bdf028f796ccf57cf478c1ee422c50128e5a0a6ebeb3f5910065" +dependencies = [ + "gtk", + "http", + "jni", + "log", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "once_cell", + "percent-encoding", + "raw-window-handle", + "softbuffer", + "tao", + "tauri-runtime", + "tauri-utils", + "url", + "webkit2gtk", + "webview2-com", + "windows 0.61.3", + "wry", +] + +[[package]] +name = "tauri-utils" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a423c51176eb3616ee9b516a9fa67fed5f0e78baaba680e44eb5dd2cc37490" +dependencies = [ + "anyhow", + "brotli", + "cargo_metadata", + "ctor", + "dunce", + "glob", + "html5ever", + "http", + "infer", + "json-patch", + "kuchikiki", + "log", + "memchr", + "phf 0.11.3", + "proc-macro2", + "quote", + "regex", + "schemars 0.8.22", + "semver", + "serde", + "serde-untagged", + "serde_json", + "serde_with", + "swift-rs", + "thiserror 2.0.17", + "toml 0.9.9+spec-1.0.0", + "url", + "urlpattern", + "uuid", + "walkdir", +] + +[[package]] +name = "tauri-winres" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1087b111fe2b005e42dbdc1990fc18593234238d47453b0c99b7de1c9ab2c1e0" +dependencies = [ + "dunce", + "embed-resource", + "toml 0.9.9+spec-1.0.0", +] + +[[package]] +name = "tempfile" +version = "3.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" +dependencies = [ + "fastrand", + "getrandom 0.3.4", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "tendril" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" +dependencies = [ + "futf", + "mac", + "utf-8", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +dependencies = [ + "thiserror-impl 2.0.17", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "tiff" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af9605de7fee8d9551863fd692cce7637f548dbd9db9180fcc07ccc6d26c336f" +dependencies = [ + "fax", + "flate2", + "half", + "quick-error", + "weezl", + "zune-jpeg 0.4.21", +] + +[[package]] +name = "time" +version = "0.3.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" + +[[package]] +name = "time-macros" +version = "0.2.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tokio" +version = "1.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tracing", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-util" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +dependencies = [ + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.3", + "toml_edit 0.20.2", +] + +[[package]] +name = "toml" +version = "0.9.9+spec-1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb5238e643fc34a1d5d7e753e1532a91912d74b63b92b3ea51fde8d1b7bc79dd" +dependencies = [ + "indexmap 2.12.1", + "serde_core", + "serde_spanned 1.0.4", + "toml_datetime 0.7.4+spec-1.0.0", + "toml_parser", + "toml_writer", + "winnow 0.7.14", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.7.4+spec-1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe3cea6b2aa3b910092f6abd4053ea464fab5f9c170ba5e9a6aead16ec4af2b6" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.12.1", + "toml_datetime 0.6.3", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +dependencies = [ + "indexmap 2.12.1", + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.3", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.23.10+spec-1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" +dependencies = [ + "indexmap 2.12.1", + "toml_datetime 0.7.4+spec-1.0.0", + "toml_parser", + "winnow 0.7.14", +] + +[[package]] +name = "toml_parser" +version = "1.0.5+spec-1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c03bee5ce3696f31250db0bbaff18bc43301ce0e8db2ed1f07cbb2acf89984c" +dependencies = [ + "winnow 0.7.14", +] + +[[package]] +name = "toml_writer" +version = "1.0.5+spec-1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9cd6190959dce0994aa8970cd32ab116d1851ead27e866039acaf2524ce44fa" + +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +dependencies = [ + "bitflags 2.10.0", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "tracing-core" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tray-icon" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d5572781bee8e3f994d7467084e1b1fd7a93ce66bd480f8156ba89dee55a2b" +dependencies = [ + "crossbeam-channel", + "dirs", + "libappindicator", + "muda", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation", + "once_cell", + "png 0.17.16", + "serde", + "thiserror 2.0.17", + "windows-sys 0.60.2", +] + +[[package]] +name = "tree_magic_mini" +version = "3.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8765b90061cba6c22b5831f675da109ae5561588290f9fa2317adab2714d5a6" +dependencies = [ + "memchr", + "nom", + "petgraph", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "uds_windows" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" +dependencies = [ + "memoffset", + "tempfile", + "winapi", +] + +[[package]] +name = "unic-char-property" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" +dependencies = [ + "unic-char-range", +] + +[[package]] +name = "unic-char-range" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" + +[[package]] +name = "unic-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" + +[[package]] +name = "unic-ucd-ident" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e230a37c0381caa9219d67cf063aa3a375ffed5bf541a452db16e744bdab6987" +dependencies = [ + "unic-char-property", + "unic-char-range", + "unic-ucd-version", +] + +[[package]] +name = "unic-ucd-version" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" +dependencies = [ + "unic-common", +] + +[[package]] +name = "unicode-ident" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "url" +version = "2.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "urlpattern" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70acd30e3aa1450bc2eece896ce2ad0d178e9c079493819301573dae3c37ba6d" +dependencies = [ + "regex", + "serde", + "unic-ucd-ident", + "url", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a" +dependencies = [ + "getrandom 0.3.4", + "js-sys", + "serde_core", + "wasm-bindgen", +] + +[[package]] +name = "v_frame" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "666b7727c8875d6ab5db9533418d7c764233ac9c0cff1d469aec8fa127597be2" +dependencies = [ + "aligned-vec", + "num-traits", + "wasm-bindgen", +] + +[[package]] +name = "version-compare" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "vswhom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +dependencies = [ + "libc", + "vswhom-sys", +] + +[[package]] +name = "vswhom-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb067e4cbd1ff067d1df46c9194b5de0e98efd2810bbc95c5d5e5f25a3231150" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.1+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.111", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-streams" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wayland-backend" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673a33c33048a5ade91a6b139580fa174e19fb0d23f396dca9fa15f2e1e49b35" +dependencies = [ + "cc", + "downcast-rs", + "rustix", + "scoped-tls", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-client" +version = "0.31.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66a47e840dc20793f2264eb4b3e4ecb4b75d91c0dd4af04b456128e0bdd449d" +dependencies = [ + "bitflags 2.10.0", + "rustix", + "wayland-backend", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols" +version = "0.32.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efa790ed75fbfd71283bd2521a1cfdc022aabcc28bdcff00851f9e4ae88d9901" +dependencies = [ + "bitflags 2.10.0", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efd94963ed43cf9938a090ca4f7da58eb55325ec8200c3848963e98dc25b78ec" +dependencies = [ + "bitflags 2.10.0", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54cb1e9dc49da91950bdfd8b848c49330536d9d1fb03d4bfec8cae50caa50ae3" +dependencies = [ + "proc-macro2", + "quick-xml 0.37.5", + "quote", +] + +[[package]] +name = "wayland-sys" +version = "0.31.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34949b42822155826b41db8e5d0c1be3a2bd296c747577a43a3e6daefc296142" +dependencies = [ + "dlib", + "log", + "pkg-config", +] + +[[package]] +name = "web-sys" +version = "0.3.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webkit2gtk" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76b1bc1e54c581da1e9f179d0b38512ba358fb1af2d634a1affe42e37172361a" +dependencies = [ + "bitflags 1.3.2", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "soup3", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62daa38afc514d1f8f12b8693d30d5993ff77ced33ce30cd04deebc267a6d57c" +dependencies = [ + "bitflags 1.3.2", + "cairo-sys-rs", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "gtk-sys", + "javascriptcore-rs-sys", + "libc", + "pkg-config", + "soup3-sys", + "system-deps", +] + +[[package]] +name = "webview2-com" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ba622a989277ef3886dd5afb3e280e3dd6d974b766118950a08f8f678ad6a4" +dependencies = [ + "webview2-com-macros", + "webview2-com-sys", + "windows 0.61.3", + "windows-core 0.61.2", + "windows-implement 0.60.2", + "windows-interface 0.59.3", +] + +[[package]] +name = "webview2-com-macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d228f15bba3b9d56dde8bddbee66fa24545bd17b48d5128ccf4a8742b18e431" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "webview2-com-sys" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36695906a1b53a3bf5c4289621efedac12b73eeb0b89e7e1a89b517302d5d75c" +dependencies = [ + "thiserror 2.0.17", + "windows 0.61.3", + "windows-core 0.61.2", +] + +[[package]] +name = "weezl" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "window-vibrancy" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9bec5a31f3f9362f2258fd0e9c9dd61a9ca432e7306cc78c444258f0dce9a9c" +dependencies = [ + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "raw-window-handle", + "windows-sys 0.59.0", + "windows-version", +] + +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core 0.58.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.61.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +dependencies = [ + "windows-collections", + "windows-core 0.61.2", + "windows-future", + "windows-link 0.1.3", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core 0.61.2", +] + +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement 0.58.0", + "windows-interface 0.58.0", + "windows-result 0.2.0", + "windows-strings 0.1.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement 0.60.2", + "windows-interface 0.59.3", + "windows-link 0.1.3", + "windows-result 0.3.4", + "windows-strings 0.4.2", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement 0.60.2", + "windows-interface 0.59.3", + "windows-link 0.2.1", + "windows-result 0.4.1", + "windows-strings 0.5.1", +] + +[[package]] +name = "windows-future" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +dependencies = [ + "windows-core 0.61.2", + "windows-link 0.1.3", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core 0.61.2", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result 0.2.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link 0.2.1", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows-threading" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-version" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.55.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb5a765337c50e9ec252c2069be9bf91c7df47afb103b642ba3a53bf8101be97" +dependencies = [ + "cfg-if", + "windows-sys 0.59.0", +] + +[[package]] +name = "wit-bindgen" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" + +[[package]] +name = "wl-clipboard-rs" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9651471a32e87d96ef3a127715382b2d11cc7c8bb9822ded8a7cc94072eb0a3" +dependencies = [ + "libc", + "log", + "os_pipe", + "rustix", + "thiserror 2.0.17", + "tree_magic_mini", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-wlr", +] + +[[package]] +name = "writeable" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" + +[[package]] +name = "wry" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728b7d4c8ec8d81cab295e0b5b8a4c263c0d41a785fb8f8c4df284e5411140a2" +dependencies = [ + "base64 0.22.1", + "block2", + "cookie", + "crossbeam-channel", + "dirs", + "dpi", + "dunce", + "gdkx11", + "gtk", + "html5ever", + "http", + "javascriptcore-rs", + "jni", + "kuchikiki", + "libc", + "ndk", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", + "once_cell", + "percent-encoding", + "raw-window-handle", + "sha2", + "soup3", + "tao-macros", + "thiserror 2.0.17", + "url", + "webkit2gtk", + "webkit2gtk-sys", + "webview2-com", + "windows 0.61.3", + "windows-core 0.61.2", + "windows-version", + "x11-dl", +] + +[[package]] +name = "x11" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + +[[package]] +name = "x11rb" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9993aa5be5a26815fe2c3eacfc1fde061fc1a1f094bf1ad2a18bf9c495dd7414" +dependencies = [ + "gethostname", + "rustix", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd" + +[[package]] +name = "y4m" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5a4b21e1a62b67a2970e6831bc091d7b87e119e7f9791aef9702e3bef04448" + +[[package]] +name = "yoke" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", + "synstructure", +] + +[[package]] +name = "zbus" +version = "5.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b622b18155f7a93d1cd2dc8c01d2d6a44e08fb9ebb7b3f9e6ed101488bad6c91" +dependencies = [ + "async-broadcast", + "async-executor", + "async-io", + "async-lock", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "enumflags2", + "event-listener", + "futures-core", + "futures-lite", + "hex", + "nix", + "ordered-stream", + "serde", + "serde_repr", + "tokio", + "tracing", + "uds_windows", + "uuid", + "windows-sys 0.61.2", + "winnow 0.7.14", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "5.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cdb94821ca8a87ca9c298b5d1cbd80e2a8b67115d99f6e4551ac49e42b6a314" +dependencies = [ + "proc-macro-crate 3.4.0", + "proc-macro2", + "quote", + "syn 2.0.111", + "zbus_names", + "zvariant", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7be68e64bf6ce8db94f63e72f0c7eb9a60d733f7e0499e628dfab0f84d6bcb97" +dependencies = [ + "serde", + "static_assertions", + "winnow 0.7.14", + "zvariant", +] + +[[package]] +name = "zerocopy" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "zune-core" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" + +[[package]] +name = "zune-core" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "111f7d9820f05fd715df3144e254d6fc02ee4088b0644c0ffd0efc9e6d9d2773" + +[[package]] +name = "zune-inflate" +version = "0.2.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "zune-jpeg" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29ce2c8a9384ad323cf564b67da86e21d3cfdff87908bc1223ed5c99bc792713" +dependencies = [ + "zune-core 0.4.12", +] + +[[package]] +name = "zune-jpeg" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d915729b0e7d5fe35c2f294c5dc10b30207cc637920e5b59077bfa3da63f28" +dependencies = [ + "zune-core 0.5.0", +] + +[[package]] +name = "zvariant" +version = "5.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2be61892e4f2b1772727be11630a62664a1826b62efa43a6fe7449521cb8744c" +dependencies = [ + "endi", + "enumflags2", + "serde", + "url", + "winnow 0.7.14", + "zvariant_derive", + "zvariant_utils", +] + +[[package]] +name = "zvariant_derive" +version = "5.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da58575a1b2b20766513b1ec59d8e2e68db2745379f961f86650655e862d2006" +dependencies = [ + "proc-macro-crate 3.4.0", + "proc-macro2", + "quote", + "syn 2.0.111", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6949d142f89f6916deca2232cf26a8afacf2b9fdc35ce766105e104478be599" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "syn 2.0.111", + "winnow 0.7.14", +] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml new file mode 100644 index 0000000..65b91e1 --- /dev/null +++ b/src-tauri/Cargo.toml @@ -0,0 +1,41 @@ +[package] +name = "refvroid" +version = "0.1.0" +description = "RefVroid - Animation Reference Desktop App" +authors = ["you"] +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[lib] +# The `_lib` suffix may seem redundant but it is necessary +# to make the lib name unique and wouldn't conflict with the bin name. +# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519 +name = "refvroid_lib" +crate-type = ["staticlib", "cdylib", "rlib"] + +[build-dependencies] +tauri-build = { version = "2", features = [] } + +[dependencies] +tauri = { version = "2", features = ["tray-icon"] } +tauri-plugin-opener = "2" +tauri-plugin-dialog = "2" +tauri-plugin-clipboard-manager = "2" +tauri-plugin-fs = "2" +serde = { version = "1", features = ["derive"] } +serde_json = "1" +base64 = "0.22" +image = "0.25" +arboard = "3" + +[target.'cfg(windows)'.dependencies] +windows = { version = "0.58", features = [ + "Win32_UI_WindowsAndMessaging", + "Win32_Foundation", + "Win32_System_DataExchange", + "Win32_System_Ole", + "Win32_UI_Shell", + "Win32_System_Memory" +] } + diff --git a/src-tauri/build.rs b/src-tauri/build.rs new file mode 100644 index 0000000..d860e1e --- /dev/null +++ b/src-tauri/build.rs @@ -0,0 +1,3 @@ +fn main() { + tauri_build::build() +} diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json new file mode 100644 index 0000000..919a984 --- /dev/null +++ b/src-tauri/capabilities/default.json @@ -0,0 +1,40 @@ +{ + "$schema": "../gen/schemas/desktop-schema.json", + "identifier": "default", + "description": "Capability for the main window", + "windows": ["main"], + "permissions": [ + "core:default", + "core:window:default", + "core:window:allow-set-always-on-top", + "core:window:allow-is-always-on-top", + "core:window:allow-set-decorations", + "core:window:allow-set-ignore-cursor-events", + "core:window:allow-maximize", + "core:window:allow-unmaximize", + "core:window:allow-is-maximized", + "core:window:allow-minimize", + "core:window:allow-is-minimized", + "core:window:allow-close", + "core:window:allow-show", + "core:window:allow-hide", + "core:window:allow-is-visible", + "core:window:allow-set-focus", + "core:window:allow-start-dragging", + "core:event:default", + "core:event:allow-emit", + "core:event:allow-listen", + "opener:default", + "dialog:default", + "dialog:allow-open", + "dialog:allow-save", + "fs:default", + "fs:read-all", + "fs:write-all", + "clipboard-manager:default", + "clipboard-manager:allow-read-text", + "clipboard-manager:allow-read-image", + "clipboard-manager:allow-write-text", + "clipboard-manager:allow-write-image" + ] +} diff --git a/src-tauri/icons/128x128.png b/src-tauri/icons/128x128.png new file mode 100644 index 0000000..12eb083 Binary files /dev/null and b/src-tauri/icons/128x128.png differ diff --git a/src-tauri/icons/128x128@2x.png b/src-tauri/icons/128x128@2x.png new file mode 100644 index 0000000..12eb083 Binary files /dev/null and b/src-tauri/icons/128x128@2x.png differ diff --git a/src-tauri/icons/32x32.png b/src-tauri/icons/32x32.png new file mode 100644 index 0000000..12eb083 Binary files /dev/null and b/src-tauri/icons/32x32.png differ diff --git a/src-tauri/icons/Square107x107Logo.png b/src-tauri/icons/Square107x107Logo.png new file mode 100644 index 0000000..0ca4f27 Binary files /dev/null and b/src-tauri/icons/Square107x107Logo.png differ diff --git a/src-tauri/icons/Square142x142Logo.png b/src-tauri/icons/Square142x142Logo.png new file mode 100644 index 0000000..b81f820 Binary files /dev/null and b/src-tauri/icons/Square142x142Logo.png differ diff --git a/src-tauri/icons/Square150x150Logo.png b/src-tauri/icons/Square150x150Logo.png new file mode 100644 index 0000000..624c7bf Binary files /dev/null and b/src-tauri/icons/Square150x150Logo.png differ diff --git a/src-tauri/icons/Square284x284Logo.png b/src-tauri/icons/Square284x284Logo.png new file mode 100644 index 0000000..c021d2b Binary files /dev/null and b/src-tauri/icons/Square284x284Logo.png differ diff --git a/src-tauri/icons/Square30x30Logo.png b/src-tauri/icons/Square30x30Logo.png new file mode 100644 index 0000000..6219700 Binary files /dev/null and b/src-tauri/icons/Square30x30Logo.png differ diff --git a/src-tauri/icons/Square310x310Logo.png b/src-tauri/icons/Square310x310Logo.png new file mode 100644 index 0000000..f9bc048 Binary files /dev/null and b/src-tauri/icons/Square310x310Logo.png differ diff --git a/src-tauri/icons/Square44x44Logo.png b/src-tauri/icons/Square44x44Logo.png new file mode 100644 index 0000000..d5fbfb2 Binary files /dev/null and b/src-tauri/icons/Square44x44Logo.png differ diff --git a/src-tauri/icons/Square71x71Logo.png b/src-tauri/icons/Square71x71Logo.png new file mode 100644 index 0000000..63440d7 Binary files /dev/null and b/src-tauri/icons/Square71x71Logo.png differ diff --git a/src-tauri/icons/Square89x89Logo.png b/src-tauri/icons/Square89x89Logo.png new file mode 100644 index 0000000..f3f705a Binary files /dev/null and b/src-tauri/icons/Square89x89Logo.png differ diff --git a/src-tauri/icons/StoreLogo.png b/src-tauri/icons/StoreLogo.png new file mode 100644 index 0000000..4556388 Binary files /dev/null and b/src-tauri/icons/StoreLogo.png differ diff --git a/src-tauri/icons/icon.icns b/src-tauri/icons/icon.icns new file mode 100644 index 0000000..12a5bce Binary files /dev/null and b/src-tauri/icons/icon.icns differ diff --git a/src-tauri/icons/icon.ico b/src-tauri/icons/icon.ico new file mode 100644 index 0000000..faa31bb Binary files /dev/null and b/src-tauri/icons/icon.ico differ diff --git a/src-tauri/icons/icon.png b/src-tauri/icons/icon.png new file mode 100644 index 0000000..12eb083 Binary files /dev/null and b/src-tauri/icons/icon.png differ diff --git a/src-tauri/src/commands/clipboard.rs b/src-tauri/src/commands/clipboard.rs new file mode 100644 index 0000000..d5d98cf --- /dev/null +++ b/src-tauri/src/commands/clipboard.rs @@ -0,0 +1,504 @@ +// Clipboard operations commands for RefVroid +// Handles reading/writing images, text, and files to system clipboard + +use serde::{Deserialize, Serialize}; +use image::ImageEncoder; +use base64::{Engine as _, engine::general_purpose::STANDARD as BASE64}; +use std::fs; +use std::path::Path; + +#[cfg(target_os = "windows")] +use std::ffi::OsString; +#[cfg(target_os = "windows")] +use std::os::windows::ffi::OsStringExt; + +/// Clipboard content types +#[derive(Debug, Serialize, Deserialize)] +#[serde(tag = "type", content = "data")] +pub enum ClipboardContent { + #[serde(rename = "image")] + Image(String), // base64 encoded image with data URL prefix + #[serde(rename = "text")] + Text(String), + #[serde(rename = "files")] + Files(Vec), // file paths + #[serde(rename = "empty")] + Empty, +} + +/// Read file list from Windows clipboard (CF_HDROP format) +#[cfg(target_os = "windows")] +fn read_clipboard_files_windows() -> Option> { + use windows::Win32::Foundation::{HWND, HGLOBAL}; + use windows::Win32::System::DataExchange::{OpenClipboard, CloseClipboard, GetClipboardData}; + use windows::Win32::System::Ole::CF_HDROP; + use windows::Win32::UI::Shell::{DragQueryFileW, HDROP}; + use windows::Win32::System::Memory::{GlobalLock, GlobalUnlock}; + + unsafe { + if OpenClipboard(HWND::default()).is_err() { + return None; + } + + let result = (|| { + let handle = GetClipboardData(CF_HDROP.0 as u32).ok()?; + let hglobal = HGLOBAL(handle.0); + let ptr = GlobalLock(hglobal); + + if ptr.is_null() { + return None; + } + + let hdrop = HDROP(ptr as _); + + // Get file count + let count = DragQueryFileW(hdrop, 0xFFFFFFFF, None); + if count == 0 { + let _ = GlobalUnlock(hglobal); + return None; + } + + let mut files = Vec::new(); + for i in 0..count { + // Get required buffer size + let len = DragQueryFileW(hdrop, i, None) as usize; + if len == 0 { + continue; + } + + // Allocate buffer and get file path + let mut buffer: Vec = vec![0; len + 1]; + DragQueryFileW(hdrop, i, Some(&mut buffer)); + + // Convert to String + let path = OsString::from_wide(&buffer[..len]); + if let Some(path_str) = path.to_str() { + files.push(path_str.to_string()); + } + } + + let _ = GlobalUnlock(hglobal); + + if files.is_empty() { + None + } else { + Some(files) + } + })(); + + let _ = CloseClipboard(); + result + } +} + +#[cfg(not(target_os = "windows"))] +fn read_clipboard_files_windows() -> Option> { + None +} + +/// Read clipboard contents - supports images, text, and file paths +#[tauri::command] +pub async fn read_clipboard() -> Result { + use arboard::Clipboard; + + // First, try to get file list from Windows clipboard (CF_HDROP) + // This preserves GIF animation by reading from original file + #[cfg(target_os = "windows")] + if let Some(files) = read_clipboard_files_windows() { + return Ok(ClipboardContent::Files(files)); + } + + let mut clipboard = Clipboard::new() + .map_err(|e| format!("Failed to access clipboard: {}", e))?; + + // Try to get text and check if it contains file paths + if let Ok(text) = clipboard.get_text() { + if !text.is_empty() { + // Check if text is a file path or list of file paths + let paths: Vec<&str> = text.lines() + .map(|s| s.trim()) + .filter(|s| !s.is_empty()) + .collect(); + + // Check if all lines are valid file paths + let all_files = !paths.is_empty() && paths.iter().all(|p| { + // Handle file:// URLs + let clean_path = if p.starts_with("file://") { + p.trim_start_matches("file://") + } else { + p + }; + let path = Path::new(clean_path); + path.exists() && path.is_file() + }); + + if all_files { + let file_paths: Vec = paths.iter() + .map(|p| { + if p.starts_with("file://") { + p.trim_start_matches("file://").to_string() + } else { + p.to_string() + } + }) + .collect(); + return Ok(ClipboardContent::Files(file_paths)); + } + } + } + + // Try to get image (for screenshots, copied images from browsers, etc.) + if let Ok(img) = clipboard.get_image() { + // Convert to PNG and base64 encode + let mut png_data = Vec::new(); + let encoder = image::codecs::png::PngEncoder::new(&mut png_data); + encoder.write_image( + &img.bytes, + img.width as u32, + img.height as u32, + image::ExtendedColorType::Rgba8, + ).map_err(|e| format!("Failed to encode image: {}", e))?; + + let base64_data = BASE64.encode(&png_data); + return Ok(ClipboardContent::Image(format!("data:image/png;base64,{}", base64_data))); + } + + // Try to get text (for regular text content) + if let Ok(text) = clipboard.get_text() { + if !text.is_empty() { + return Ok(ClipboardContent::Text(text)); + } + } + + Ok(ClipboardContent::Empty) +} + +/// Write image data to clipboard (from raw bytes) +#[tauri::command] +pub async fn write_clipboard_image(data: Vec) -> Result<(), String> { + use arboard::Clipboard; + + let img = image::load_from_memory(&data) + .map_err(|e| format!("Failed to decode image: {}", e))?; + let rgba = img.to_rgba8(); + + let mut clipboard = Clipboard::new() + .map_err(|e| format!("Failed to access clipboard: {}", e))?; + + let img_data = arboard::ImageData { + width: rgba.width() as usize, + height: rgba.height() as usize, + bytes: rgba.into_raw().into(), + }; + + clipboard.set_image(img_data) + .map_err(|e| format!("Failed to set clipboard image: {}", e)) +} + +/// Write image from base64 string to clipboard +#[tauri::command] +pub async fn write_clipboard_image_base64(base64_data: String) -> Result<(), String> { + // Remove data URL prefix if present + let base64_str = if base64_data.contains(",") { + base64_data.split(',').nth(1).unwrap_or(&base64_data) + } else { + &base64_data + }; + + let data = BASE64.decode(base64_str) + .map_err(|e| format!("Failed to decode base64: {}", e))?; + + write_clipboard_image(data).await +} + +/// Write files to clipboard - reads file and copies as image if it's an image file +/// For GIF files, preserves the original GIF data to maintain animation +#[tauri::command] +pub async fn write_clipboard_files(paths: Vec) -> Result<(), String> { + use arboard::Clipboard; + + if paths.is_empty() { + return Err("No files provided".to_string()); + } + + // For single image file, copy as image to clipboard + if paths.len() == 1 { + let path = &paths[0]; + let extension = Path::new(path) + .extension() + .and_then(|e| e.to_str()) + .map(|s| s.to_lowercase()) + .unwrap_or_default(); + + // Check if it's an image file + if matches!(extension.as_str(), "png" | "jpg" | "jpeg" | "bmp" | "webp") { + let data = fs::read(path) + .map_err(|e| format!("Failed to read file: {}", e))?; + return write_clipboard_image(data).await; + } + + // For GIF files, we need special handling to preserve animation + if extension == "gif" { + let data = fs::read(path) + .map_err(|e| format!("Failed to read GIF file: {}", e))?; + + // Decode GIF and get first frame for clipboard (clipboard doesn't support animated GIF) + let img = image::load_from_memory(&data) + .map_err(|e| format!("Failed to decode GIF: {}", e))?; + let rgba = img.to_rgba8(); + + let mut clipboard = Clipboard::new() + .map_err(|e| format!("Failed to access clipboard: {}", e))?; + + let img_data = arboard::ImageData { + width: rgba.width() as usize, + height: rgba.height() as usize, + bytes: rgba.into_raw().into(), + }; + + clipboard.set_image(img_data) + .map_err(|e| format!("Failed to set clipboard image: {}", e))?; + + return Ok(()); + } + } + + // For multiple files or non-image files, copy paths as text + let mut clipboard = Clipboard::new() + .map_err(|e| format!("Failed to access clipboard: {}", e))?; + + let text = paths.join("\n"); + clipboard.set_text(text) + .map_err(|e| format!("Failed to set clipboard text: {}", e)) +} + +/// Write text to clipboard +#[tauri::command] +pub async fn write_clipboard_text(text: String) -> Result<(), String> { + use arboard::Clipboard; + + let mut clipboard = Clipboard::new() + .map_err(|e| format!("Failed to access clipboard: {}", e))?; + + clipboard.set_text(text) + .map_err(|e| format!("Failed to set clipboard text: {}", e)) +} + +/// Write multiple images to clipboard as temporary files +/// This preserves GIF animation and allows copying multiple images +#[tauri::command] +pub async fn write_clipboard_images_as_files(images: Vec<(String, String)>) -> Result<(), String> { + use std::env; + + if images.is_empty() { + return Err("No images provided".to_string()); + } + + let temp_dir = env::temp_dir().join("refvroid_clipboard"); + fs::create_dir_all(&temp_dir) + .map_err(|e| format!("Failed to create temp directory: {}", e))?; + + let mut file_paths = Vec::new(); + + for (index, (base64_data, file_type)) in images.iter().enumerate() { + // Remove data URL prefix if present + let (mime_type, base64_str) = if base64_data.contains(",") { + let parts: Vec<&str> = base64_data.splitn(2, ',').collect(); + let mime = parts[0] + .trim_start_matches("data:") + .trim_end_matches(";base64"); + (mime.to_string(), parts.get(1).unwrap_or(&"").to_string()) + } else { + (file_type.clone(), base64_data.clone()) + }; + + let data = BASE64.decode(&base64_str) + .map_err(|e| format!("Failed to decode base64: {}", e))?; + + // Determine file extension from MIME type or detect from content + let ext = if let Some(detected) = detect_image_mime_type(&data) { + match detected { + "image/gif" => "gif", + "image/png" => "png", + "image/jpeg" => "jpg", + "image/bmp" => "bmp", + "image/webp" => "webp", + _ => "png", + } + } else { + match mime_type.as_str() { + "image/gif" => "gif", + "image/png" => "png", + "image/jpeg" => "jpg", + "image/bmp" => "bmp", + "image/webp" => "webp", + _ => "png", + } + }; + + let file_name = format!("clipboard_{}_{}.{}", std::process::id(), index, ext); + let file_path = temp_dir.join(&file_name); + + fs::write(&file_path, &data) + .map_err(|e| format!("Failed to write temp file: {}", e))?; + + file_paths.push(file_path.to_string_lossy().to_string()); + } + + // Write file paths to clipboard + #[cfg(target_os = "windows")] + { + write_files_to_clipboard_windows(&file_paths)?; + } + + #[cfg(not(target_os = "windows"))] + { + // Fallback: write paths as text + use arboard::Clipboard; + let mut clipboard = Clipboard::new() + .map_err(|e| format!("Failed to access clipboard: {}", e))?; + clipboard.set_text(file_paths.join("\n")) + .map_err(|e| format!("Failed to set clipboard text: {}", e))?; + } + + Ok(()) +} + +/// Write file paths to Windows clipboard in CF_HDROP format +#[cfg(target_os = "windows")] +fn write_files_to_clipboard_windows(paths: &[String]) -> Result<(), String> { + use windows::Win32::Foundation::HWND; + use windows::Win32::System::DataExchange::{OpenClipboard, CloseClipboard, EmptyClipboard, SetClipboardData}; + use windows::Win32::System::Ole::CF_HDROP; + use windows::Win32::System::Memory::{GlobalAlloc, GlobalLock, GlobalUnlock, GMEM_MOVEABLE, GLOBAL_ALLOC_FLAGS}; + use std::ptr; + + // Calculate required buffer size + // DROPFILES structure + null-terminated wide strings + final null + let dropfiles_size = std::mem::size_of::(); + let mut total_size = dropfiles_size; + + for path in paths { + // Each path as wide string + null terminator + total_size += (path.len() + 1) * 2; + } + total_size += 2; // Final null terminator + + unsafe { + if OpenClipboard(HWND::default()).is_err() { + return Err("Failed to open clipboard".to_string()); + } + + let result = (|| -> Result<(), String> { + if EmptyClipboard().is_err() { + return Err("Failed to empty clipboard".to_string()); + } + + let hglobal = GlobalAlloc(GMEM_MOVEABLE, total_size) + .map_err(|_| "Failed to allocate global memory".to_string())?; + + let ptr = GlobalLock(hglobal); + if ptr.is_null() { + return Err("Failed to lock global memory".to_string()); + } + + // Fill DROPFILES structure + let dropfiles = ptr as *mut DROPFILES; + (*dropfiles).pFiles = dropfiles_size as u32; + (*dropfiles).pt.x = 0; + (*dropfiles).pt.y = 0; + (*dropfiles).fNC = false.into(); + (*dropfiles).fWide = true.into(); // Unicode + + // Write file paths + let mut offset = dropfiles_size; + for path in paths { + let wide: Vec = path.encode_utf16().chain(std::iter::once(0)).collect(); + let dest = (ptr as *mut u8).add(offset) as *mut u16; + ptr::copy_nonoverlapping(wide.as_ptr(), dest, wide.len()); + offset += wide.len() * 2; + } + + // Final null terminator + let dest = (ptr as *mut u8).add(offset) as *mut u16; + *dest = 0; + + let _ = GlobalUnlock(hglobal); + + if SetClipboardData(CF_HDROP.0 as u32, windows::Win32::Foundation::HANDLE(hglobal.0)).is_err() { + return Err("Failed to set clipboard data".to_string()); + } + + Ok(()) + })(); + + let _ = CloseClipboard(); + result + } +} + +#[cfg(target_os = "windows")] +#[repr(C)] +struct DROPFILES { + pFiles: u32, + pt: windows::Win32::Foundation::POINT, + fNC: windows::Win32::Foundation::BOOL, + fWide: windows::Win32::Foundation::BOOL, +} + +/// Detect image MIME type from file content (magic bytes) +fn detect_image_mime_type(data: &[u8]) -> Option<&'static str> { + if data.len() < 8 { + return None; + } + + // Check magic bytes + if data.starts_with(b"GIF87a") || data.starts_with(b"GIF89a") { + return Some("image/gif"); + } + if data.starts_with(&[0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A]) { + return Some("image/png"); + } + if data.starts_with(&[0xFF, 0xD8, 0xFF]) { + return Some("image/jpeg"); + } + if data.starts_with(b"BM") { + return Some("image/bmp"); + } + if data.starts_with(b"RIFF") && data.len() >= 12 && &data[8..12] == b"WEBP" { + return Some("image/webp"); + } + + None +} + +/// Read image from file and return as base64 data URL +#[tauri::command] +pub async fn read_image_as_base64(path: String) -> Result { + let data = fs::read(&path) + .map_err(|e| format!("Failed to read file: {}", e))?; + + // First try to detect MIME type from file content (magic bytes) + let mime_type = if let Some(detected) = detect_image_mime_type(&data) { + detected + } else { + // Fallback to extension-based detection + let extension = Path::new(&path) + .extension() + .and_then(|e| e.to_str()) + .map(|s| s.to_lowercase()) + .unwrap_or_default(); + + match extension.as_str() { + "png" => "image/png", + "jpg" | "jpeg" => "image/jpeg", + "gif" => "image/gif", + "bmp" => "image/bmp", + "webp" => "image/webp", + _ => "application/octet-stream", + } + }; + + let base64_data = BASE64.encode(&data); + Ok(format!("data:{};base64,{}", mime_type, base64_data)) +} diff --git a/src-tauri/src/commands/file.rs b/src-tauri/src/commands/file.rs new file mode 100644 index 0000000..f517861 --- /dev/null +++ b/src-tauri/src/commands/file.rs @@ -0,0 +1,181 @@ +// File operations commands for RefVroid +// Handles scene save/load and file reading operations + +use std::fs; +use std::path::Path; +use base64::{Engine as _, engine::general_purpose::STANDARD as BASE64}; +use serde::{Deserialize, Serialize}; +use tauri_plugin_dialog::{DialogExt, FilePath}; +use tauri::AppHandle; + +/// Result of a file dialog operation +#[derive(Debug, Serialize, Deserialize)] +pub struct FileDialogResult { + pub path: Option, + pub cancelled: bool, +} + +/// Save scene data to a file +#[tauri::command] +pub async fn save_scene(path: String, data: String) -> Result<(), String> { + fs::write(&path, data).map_err(|e| format!("Failed to save scene: {}", e)) +} + +/// Load scene data from a file +#[tauri::command] +pub async fn load_scene(path: String) -> Result { + fs::read_to_string(&path).map_err(|e| format!("Failed to load scene: {}", e)) +} + +/// Read a file and return its contents as base64 +#[tauri::command] +pub async fn read_file_as_base64(path: String) -> Result { + let file_path = Path::new(&path); + let data = fs::read(file_path).map_err(|e| format!("Failed to read file: {}", e))?; + Ok(BASE64.encode(&data)) +} + +/// Show save file dialog for .purgif files +#[tauri::command] +pub async fn show_save_dialog(app: AppHandle, default_name: Option) -> Result { + let file_name = default_name.unwrap_or_else(|| "scene.purgif".to_string()); + + let file_path = app.dialog() + .file() + .set_file_name(&file_name) + .add_filter("RefVroid Scene", &["purgif"]) + .add_filter("All Files", &["*"]) + .blocking_save_file(); + + match file_path { + Some(path) => { + let path_str = match path { + FilePath::Path(p) => p.to_string_lossy().to_string(), + FilePath::Url(u) => u.path().to_string(), + }; + Ok(FileDialogResult { + path: Some(path_str), + cancelled: false, + }) + } + None => Ok(FileDialogResult { + path: None, + cancelled: true, + }), + } +} + +/// Show open file dialog for .purgif files +#[tauri::command] +pub async fn show_open_dialog(app: AppHandle) -> Result { + let file_path = app.dialog() + .file() + .add_filter("RefVroid Scene", &["purgif"]) + .add_filter("All Files", &["*"]) + .blocking_pick_file(); + + match file_path { + Some(path) => { + let path_str = match path { + FilePath::Path(p) => p.to_string_lossy().to_string(), + FilePath::Url(u) => u.path().to_string(), + }; + Ok(FileDialogResult { + path: Some(path_str), + cancelled: false, + }) + } + None => Ok(FileDialogResult { + path: None, + cancelled: true, + }), + } +} + +/// Show open file dialog for media files (images, videos) +#[tauri::command] +pub async fn show_open_media_dialog(app: AppHandle) -> Result { + let file_path = app.dialog() + .file() + .add_filter("Images", &["png", "jpg", "jpeg", "gif", "bmp", "webp"]) + .add_filter("Videos", &["mp4", "webm", "mov"]) + .add_filter("All Files", &["*"]) + .blocking_pick_file(); + + match file_path { + Some(path) => { + let path_str = match path { + FilePath::Path(p) => p.to_string_lossy().to_string(), + FilePath::Url(u) => u.path().to_string(), + }; + Ok(FileDialogResult { + path: Some(path_str), + cancelled: false, + }) + } + None => Ok(FileDialogResult { + path: None, + cancelled: true, + }), + } +} + +/// Result of a multi-file dialog operation +#[derive(Debug, Serialize, Deserialize)] +pub struct MultiFileDialogResult { + pub paths: Option>, + pub cancelled: bool, +} + +/// Show open file dialog for images (multiple selection) +#[tauri::command] +pub async fn show_open_images_dialog(app: AppHandle) -> Result { + let file_paths = app.dialog() + .file() + .add_filter("Images", &["png", "jpg", "jpeg", "gif", "bmp", "webp"]) + .add_filter("All Files", &["*"]) + .blocking_pick_files(); + + match file_paths { + Some(paths) => { + let path_strs: Vec = paths.iter().map(|path| { + match path { + FilePath::Path(p) => p.to_string_lossy().to_string(), + FilePath::Url(u) => u.path().to_string(), + } + }).collect(); + Ok(MultiFileDialogResult { + paths: Some(path_strs), + cancelled: false, + }) + } + None => Ok(MultiFileDialogResult { + paths: None, + cancelled: true, + }), + } +} + +/// Get file extension from path +#[tauri::command] +pub fn get_file_extension(path: String) -> Option { + Path::new(&path) + .extension() + .and_then(|ext| ext.to_str()) + .map(|s| s.to_lowercase()) +} + +/// Check if file exists +#[tauri::command] +pub fn file_exists(path: String) -> bool { + Path::new(&path).exists() +} + +/// Get file name from path +#[tauri::command] +pub fn get_file_name(path: String) -> Option { + Path::new(&path) + .file_name() + .and_then(|name| name.to_str()) + .map(|s| s.to_string()) +} diff --git a/src-tauri/src/commands/mod.rs b/src-tauri/src/commands/mod.rs new file mode 100644 index 0000000..fad8777 --- /dev/null +++ b/src-tauri/src/commands/mod.rs @@ -0,0 +1,26 @@ +// Tauri Commands Module +// This module organizes all Tauri commands for the RefVroid application + +pub mod file; +pub mod clipboard; +pub mod window; + +// Re-export all commands for easy access +pub use file::{ + save_scene, load_scene, read_file_as_base64, + show_save_dialog, show_open_dialog, show_open_media_dialog, + show_open_images_dialog, + get_file_extension, file_exists, get_file_name, +}; +pub use clipboard::{ + read_clipboard, write_clipboard_image, write_clipboard_image_base64, + write_clipboard_files, write_clipboard_text, write_clipboard_images_as_files, + read_image_as_base64, +}; +pub use window::{ + set_always_on_top, get_always_on_top, set_window_opacity, + lock_window, unlock_window, is_window_locked, is_maximized, + toggle_maximize, minimize_window, close_window, + show_window, hide_window, get_window_state, start_window_drag, + move_window_by, +}; diff --git a/src-tauri/src/commands/window.rs b/src-tauri/src/commands/window.rs new file mode 100644 index 0000000..f668a24 --- /dev/null +++ b/src-tauri/src/commands/window.rs @@ -0,0 +1,312 @@ +// Window management commands for RefVroid +// Handles window state, opacity, and lock/unlock functionality + +use tauri::{AppHandle, Manager}; +use serde::{Deserialize, Serialize}; +use std::sync::atomic::{AtomicBool, AtomicU8, Ordering}; + +// Global state for window lock status +static IS_WINDOW_LOCKED: AtomicBool = AtomicBool::new(false); + +// Global state for window opacity (stored as 0-255) +static WINDOW_OPACITY: AtomicU8 = AtomicU8::new(255); + +// Flag to cancel ongoing opacity animation +static CANCEL_OPACITY_ANIMATION: AtomicBool = AtomicBool::new(false); + +/// Helper function to set window locked state (used by tray menu) +pub fn set_window_locked_state(locked: bool) { + IS_WINDOW_LOCKED.store(locked, Ordering::SeqCst); +} + +/// Helper function to get window locked state (used by tray menu) +pub fn is_window_locked_state() -> bool { + IS_WINDOW_LOCKED.load(Ordering::SeqCst) +} + +/// Window state information +#[derive(Debug, Serialize, Deserialize)] +pub struct WindowState { + pub is_always_on_top: bool, + pub is_locked: bool, + pub opacity: f64, + pub is_maximized: bool, + pub is_minimized: bool, +} + +/// Set window always on top state +#[tauri::command] +pub async fn set_always_on_top(app: AppHandle, value: bool) -> Result<(), String> { + let window = app.get_webview_window("main") + .ok_or("Main window not found")?; + window.set_always_on_top(value) + .map_err(|e| format!("Failed to set always on top: {}", e)) +} + +/// Get window always on top state +#[tauri::command] +pub async fn get_always_on_top(app: AppHandle) -> Result { + let window = app.get_webview_window("main") + .ok_or("Main window not found")?; + window.is_always_on_top() + .map_err(|e| format!("Failed to get always on top state: {}", e)) +} + +/// Set window opacity (0.1 - 1.0) +/// Uses Windows API SetLayeredWindowAttributes for true window transparency +#[tauri::command] +pub async fn set_window_opacity(app: AppHandle, opacity: f64) -> Result<(), String> { + let window = app.get_webview_window("main") + .ok_or("Main window not found")?; + + // Cancel any ongoing opacity animation + CANCEL_OPACITY_ANIMATION.store(true, Ordering::SeqCst); + + // Clamp opacity between 0.1 and 1.0 + let clamped_opacity = opacity.max(0.1).min(1.0); + let alpha = (clamped_opacity * 255.0) as u8; + + // Store the opacity value for later use (e.g., after maximize/restore) + WINDOW_OPACITY.store(alpha, Ordering::SeqCst); + + apply_window_opacity_internal(&window, alpha) +} + +/// Internal function to apply opacity without storing +fn apply_window_opacity_internal(window: &tauri::WebviewWindow, alpha: u8) -> Result<(), String> { + // Use Windows API for true window transparency + #[cfg(target_os = "windows")] + { + use windows::Win32::UI::WindowsAndMessaging::{ + SetLayeredWindowAttributes, SetWindowLongPtrW, GetWindowLongPtrW, + GWL_EXSTYLE, WS_EX_LAYERED, LWA_ALPHA, + }; + use windows::Win32::Foundation::HWND; + + let hwnd = window.hwnd() + .map_err(|e| format!("Failed to get window handle: {}", e))?; + let hwnd = HWND(hwnd.0 as *mut std::ffi::c_void); + + unsafe { + // Add WS_EX_LAYERED style if not already present + let ex_style = GetWindowLongPtrW(hwnd, GWL_EXSTYLE); + if ex_style & WS_EX_LAYERED.0 as isize == 0 { + SetWindowLongPtrW(hwnd, GWL_EXSTYLE, ex_style | WS_EX_LAYERED.0 as isize); + } + + // Set window alpha (0-255) + SetLayeredWindowAttributes(hwnd, None, alpha, LWA_ALPHA) + .map_err(|e| format!("Failed to set window opacity: {}", e))?; + } + } + + #[cfg(not(target_os = "windows"))] + { + // Fallback for other platforms - use CSS opacity + let clamped_opacity = alpha as f64 / 255.0; + let js = format!( + "document.body.style.opacity = '{}';", + clamped_opacity + ); + window.eval(&js) + .map_err(|e| format!("Failed to set window opacity: {}", e))?; + } + + Ok(()) +} + +/// Lock window - disable mouse interactions +/// Window will ignore all cursor events when locked +#[tauri::command] +pub async fn lock_window(app: AppHandle) -> Result<(), String> { + let window = app.get_webview_window("main") + .ok_or("Main window not found")?; + + // Set window to ignore cursor events + window.set_ignore_cursor_events(true) + .map_err(|e| format!("Failed to lock window: {}", e))?; + + IS_WINDOW_LOCKED.store(true, Ordering::SeqCst); + + Ok(()) +} + +/// Unlock window - enable mouse interactions +#[tauri::command] +pub async fn unlock_window(app: AppHandle) -> Result<(), String> { + let window = app.get_webview_window("main") + .ok_or("Main window not found")?; + + window.set_ignore_cursor_events(false) + .map_err(|e| format!("Failed to unlock window: {}", e))?; + + IS_WINDOW_LOCKED.store(false, Ordering::SeqCst); + + Ok(()) +} + +/// Check if window is locked +#[tauri::command] +pub fn is_window_locked() -> bool { + IS_WINDOW_LOCKED.load(Ordering::SeqCst) +} + +/// Check if window is maximized +#[tauri::command] +pub async fn is_maximized(app: AppHandle) -> Result { + let window = app.get_webview_window("main") + .ok_or("Main window not found")?; + + window.is_maximized() + .map_err(|e| format!("Failed to get maximized state: {}", e)) +} + +/// Toggle window maximized state +#[tauri::command] +pub async fn toggle_maximize(app: AppHandle) -> Result { + let window = app.get_webview_window("main") + .ok_or("Main window not found")?; + + let is_maximized = window.is_maximized() + .map_err(|e| format!("Failed to get maximized state: {}", e))?; + + // Get current opacity before state change + let target_alpha = WINDOW_OPACITY.load(Ordering::SeqCst); + + if is_maximized { + window.unmaximize() + .map_err(|e| format!("Failed to unmaximize window: {}", e))?; + } else { + window.maximize() + .map_err(|e| format!("Failed to maximize window: {}", e))?; + } + + // Re-apply opacity with smooth transition if not fully opaque + if target_alpha < 255 { + let window_clone = window.clone(); + std::thread::spawn(move || { + // Reset cancel flag before starting animation + CANCEL_OPACITY_ANIMATION.store(false, Ordering::SeqCst); + + // Wait for window state to settle + std::thread::sleep(std::time::Duration::from_millis(100)); + + // Check if cancelled during wait + if CANCEL_OPACITY_ANIMATION.load(Ordering::SeqCst) { + return; + } + + // Animate from fully opaque to target opacity + // 180 steps * 16ms = ~3 seconds total duration + let steps = 30; + let step_delay = std::time::Duration::from_millis(16); // ~60fps + + for i in 0..=steps { + // Check if animation should be cancelled + if CANCEL_OPACITY_ANIMATION.load(Ordering::SeqCst) { + return; + } + + let progress = i as f64 / steps as f64; + // Linear: constant speed + let current = 255.0 - (255.0 - target_alpha as f64) * progress; + let _ = apply_window_opacity_internal(&window_clone, current as u8); + if i < steps { + std::thread::sleep(step_delay); + } + } + }); + } + + Ok(!is_maximized) +} + +/// Minimize window +#[tauri::command] +pub async fn minimize_window(app: AppHandle) -> Result<(), String> { + let window = app.get_webview_window("main") + .ok_or("Main window not found")?; + + window.minimize() + .map_err(|e| format!("Failed to minimize window: {}", e)) +} + +/// Close window +#[tauri::command] +pub async fn close_window(app: AppHandle) -> Result<(), String> { + let window = app.get_webview_window("main") + .ok_or("Main window not found")?; + + window.close() + .map_err(|e| format!("Failed to close window: {}", e)) +} + +/// Show window (bring to front) +#[tauri::command] +pub async fn show_window(app: AppHandle) -> Result<(), String> { + let window = app.get_webview_window("main") + .ok_or("Main window not found")?; + + window.show() + .map_err(|e| format!("Failed to show window: {}", e))?; + window.set_focus() + .map_err(|e| format!("Failed to focus window: {}", e)) +} + +/// Hide window +#[tauri::command] +pub async fn hide_window(app: AppHandle) -> Result<(), String> { + let window = app.get_webview_window("main") + .ok_or("Main window not found")?; + + window.hide() + .map_err(|e| format!("Failed to hide window: {}", e)) +} + +/// Get current window state +#[tauri::command] +pub async fn get_window_state(app: AppHandle) -> Result { + let window = app.get_webview_window("main") + .ok_or("Main window not found")?; + + let is_always_on_top = window.is_always_on_top() + .map_err(|e| format!("Failed to get always on top state: {}", e))?; + let is_maximized = window.is_maximized() + .map_err(|e| format!("Failed to get maximized state: {}", e))?; + let is_minimized = window.is_minimized() + .map_err(|e| format!("Failed to get minimized state: {}", e))?; + + Ok(WindowState { + is_always_on_top, + is_locked: IS_WINDOW_LOCKED.load(Ordering::SeqCst), + opacity: 1.0, // Default, actual value tracked in frontend + is_maximized, + is_minimized, + }) +} + +/// Start window drag (for frameless window) +#[tauri::command] +pub async fn start_window_drag(app: AppHandle) -> Result<(), String> { + let window = app.get_webview_window("main") + .ok_or("Main window not found")?; + + window.start_dragging() + .map_err(|e| format!("Failed to start window drag: {}", e)) +} + +/// Move window by delta (for custom drag implementation) +#[tauri::command] +pub async fn move_window_by(app: AppHandle, delta_x: i32, delta_y: i32) -> Result<(), String> { + let window = app.get_webview_window("main") + .ok_or("Main window not found")?; + + let position = window.outer_position() + .map_err(|e| format!("Failed to get window position: {}", e))?; + + let new_x = position.x + delta_x; + let new_y = position.y + delta_y; + + window.set_position(tauri::Position::Physical(tauri::PhysicalPosition::new(new_x, new_y))) + .map_err(|e| format!("Failed to move window: {}", e)) +} diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs new file mode 100644 index 0000000..a479bd5 --- /dev/null +++ b/src-tauri/src/lib.rs @@ -0,0 +1,166 @@ +// RefVroid - Animation Reference Desktop App +// Tauri backend implementation + +mod commands; + +use commands::{ + // File operations + save_scene, + load_scene, + read_file_as_base64, + show_save_dialog, + show_open_dialog, + show_open_media_dialog, + show_open_images_dialog, + get_file_extension, + file_exists, + get_file_name, + // Clipboard operations + read_clipboard, + write_clipboard_image, + write_clipboard_image_base64, + write_clipboard_files, + write_clipboard_text, + write_clipboard_images_as_files, + read_image_as_base64, + // Window operations + set_always_on_top, + get_always_on_top, + set_window_opacity, + lock_window, + unlock_window, + is_window_locked, + is_maximized, + toggle_maximize, + minimize_window, + close_window, + show_window, + hide_window, + get_window_state, + start_window_drag, + move_window_by, +}; + +use tauri::{ + Emitter, Manager, + tray::{MouseButton, MouseButtonState, TrayIconBuilder, TrayIconEvent}, + menu::{Menu, MenuItem}, +}; + +fn setup_tray(app: &tauri::App) -> Result<(), Box> { + // Create menu items + let show_item = MenuItem::with_id(app, "show", "显示窗口", true, None::<&str>)?; + let unlock_item = MenuItem::with_id(app, "unlock", "解锁窗口", true, None::<&str>)?; + let quit_item = MenuItem::with_id(app, "quit", "退出", true, None::<&str>)?; + + // Create tray menu + let menu = Menu::with_items(app, &[&show_item, &unlock_item, &quit_item])?; + + // Build tray icon + let _tray = TrayIconBuilder::new() + .icon(app.default_window_icon().unwrap().clone()) + .menu(&menu) + .show_menu_on_left_click(false) // Don't show menu on left click + .tooltip("RefVroid - 动画参考工具") + .on_menu_event(|app, event| { + match event.id.as_ref() { + "show" => { + if let Some(window) = app.get_webview_window("main") { + let _ = window.show(); + let _ = window.set_focus(); + } + } + "unlock" => { + // Only unlock if currently locked + if commands::window::is_window_locked_state() { + if let Some(window) = app.get_webview_window("main") { + let _ = window.set_ignore_cursor_events(false); + // Update the global lock state + commands::window::set_window_locked_state(false); + // Emit event to frontend to update UI + let _ = window.emit("window-unlocked", ()); + } + } + } + "quit" => { + app.exit(0); + } + _ => {} + } + }) + .on_tray_icon_event(|tray, event| { + if let TrayIconEvent::Click { + button: MouseButton::Left, + button_state: MouseButtonState::Up, + .. + } = event + { + // Toggle window visibility on left click + let app = tray.app_handle(); + if let Some(window) = app.get_webview_window("main") { + if window.is_visible().unwrap_or(false) { + let _ = window.hide(); + } else { + let _ = window.show(); + let _ = window.set_focus(); + } + } + } + }) + .build(app)?; + + Ok(()) +} + +#[cfg_attr(mobile, tauri::mobile_entry_point)] +pub fn run() { + tauri::Builder::default() + .plugin(tauri_plugin_opener::init()) + .plugin(tauri_plugin_dialog::init()) + .plugin(tauri_plugin_clipboard_manager::init()) + .plugin(tauri_plugin_fs::init()) + .setup(|app| { + // Setup system tray + setup_tray(app)?; + Ok(()) + }) + .invoke_handler(tauri::generate_handler![ + // File operations + save_scene, + load_scene, + read_file_as_base64, + show_save_dialog, + show_open_dialog, + show_open_media_dialog, + show_open_images_dialog, + get_file_extension, + file_exists, + get_file_name, + // Clipboard operations + read_clipboard, + write_clipboard_image, + write_clipboard_image_base64, + write_clipboard_files, + write_clipboard_text, + write_clipboard_images_as_files, + read_image_as_base64, + // Window operations + set_always_on_top, + get_always_on_top, + set_window_opacity, + lock_window, + unlock_window, + is_window_locked, + is_maximized, + toggle_maximize, + minimize_window, + close_window, + show_window, + hide_window, + get_window_state, + start_window_drag, + move_window_by, + ]) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); +} diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs new file mode 100644 index 0000000..ea883a7 --- /dev/null +++ b/src-tauri/src/main.rs @@ -0,0 +1,6 @@ +// Prevents additional console window on Windows in release, DO NOT REMOVE!! +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] + +fn main() { + refvroid_lib::run() +} diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json new file mode 100644 index 0000000..5bd23ff --- /dev/null +++ b/src-tauri/tauri.conf.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schema.tauri.app/config/2", + "productName": "RefVroid", + "version": "0.1.0", + "identifier": "com.refvroid.app", + "build": { + "beforeDevCommand": "pnpm dev", + "devUrl": "http://localhost:1420", + "beforeBuildCommand": "pnpm build", + "frontendDist": "../dist" + }, + "app": { + "windows": [ + { + "title": "RefVroid", + "width": 1280, + "height": 720, + "resizable": true, + "decorations": false, + "transparent": false, + "alwaysOnTop": false, + "dragDropEnabled": true, + "backgroundColor": [25, 25, 25, 255] + } + ], + "security": { + "csp": null + } + }, + "bundle": { + "active": true, + "targets": ["msi"], + "icon": [ + "icons/icon.png", + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.icns", + "icons/icon.ico" + ] + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..34df63e --- /dev/null +++ b/src/App.vue @@ -0,0 +1,1250 @@ + + + + + + + diff --git a/src/assets/vue.svg b/src/assets/vue.svg new file mode 100644 index 0000000..770e9d3 --- /dev/null +++ b/src/assets/vue.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/CanvasView.vue b/src/components/CanvasView.vue new file mode 100644 index 0000000..eb3c1cd --- /dev/null +++ b/src/components/CanvasView.vue @@ -0,0 +1,1513 @@ + + + + + diff --git a/src/components/ConfirmDialog.vue b/src/components/ConfirmDialog.vue new file mode 100644 index 0000000..aa74342 --- /dev/null +++ b/src/components/ConfirmDialog.vue @@ -0,0 +1,110 @@ + + + + + diff --git a/src/components/ContextMenu.vue b/src/components/ContextMenu.vue new file mode 100644 index 0000000..e5ba9e4 --- /dev/null +++ b/src/components/ContextMenu.vue @@ -0,0 +1,368 @@ + + + + + diff --git a/src/components/HelpDialog.vue b/src/components/HelpDialog.vue new file mode 100644 index 0000000..190fa57 --- /dev/null +++ b/src/components/HelpDialog.vue @@ -0,0 +1,311 @@ + + + + + diff --git a/src/components/LockIndicator.vue b/src/components/LockIndicator.vue new file mode 100644 index 0000000..a3efe03 --- /dev/null +++ b/src/components/LockIndicator.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/src/components/SelectionBox.vue b/src/components/SelectionBox.vue new file mode 100644 index 0000000..15093e2 --- /dev/null +++ b/src/components/SelectionBox.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/src/components/TitleBar.vue b/src/components/TitleBar.vue new file mode 100644 index 0000000..9bc6cd4 --- /dev/null +++ b/src/components/TitleBar.vue @@ -0,0 +1,256 @@ + + + + + diff --git a/src/components/UnsavedDialog.vue b/src/components/UnsavedDialog.vue new file mode 100644 index 0000000..da8a346 --- /dev/null +++ b/src/components/UnsavedDialog.vue @@ -0,0 +1,194 @@ + + + + + diff --git a/src/components/WelcomeOverlay.vue b/src/components/WelcomeOverlay.vue new file mode 100644 index 0000000..b2377c2 --- /dev/null +++ b/src/components/WelcomeOverlay.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/src/core/history/index.ts b/src/core/history/index.ts new file mode 100644 index 0000000..4efd83f --- /dev/null +++ b/src/core/history/index.ts @@ -0,0 +1,404 @@ +/** + * History Manager + * Manages undo/redo functionality with state snapshots + */ + +import { ref, computed, type Ref, type ComputedRef } from 'vue'; +import type { MediaElement as IMediaElement, ViewTransform } from '../../types'; + +// ============================================ +// Constants +// ============================================ + +const DEFAULT_MAX_HISTORY_SIZE = 50; + +// ============================================ +// History State Interface +// ============================================ + +/** + * Represents a snapshot of the scene state for history tracking + */ +export interface HistorySnapshot { + /** Serialized elements at this point in time */ + elements: IMediaElement[]; + /** View transform state */ + viewTransform: ViewTransform; + /** Timestamp when snapshot was created */ + timestamp: number; +} + +// ============================================ +// History Manager Class +// ============================================ + +export class HistoryManager { + /** Stack of states for undo operations */ + private _undoStack: HistorySnapshot[] = []; + + /** Stack of states for redo operations */ + private _redoStack: HistorySnapshot[] = []; + + /** Maximum number of states to keep in history */ + private _maxSize: number = DEFAULT_MAX_HISTORY_SIZE; + + /** Reactive version counter for Vue reactivity */ + private _version: Ref = ref(0); + + /** Flag to prevent recording during undo/redo operations */ + private _isRestoring: boolean = false; + + /** Computed property indicating if undo is available */ + readonly canUndo: ComputedRef; + + /** Computed property indicating if redo is available */ + readonly canRedo: ComputedRef; + + /** Computed property for undo stack size */ + readonly undoStackSize: ComputedRef; + + /** Computed property for redo stack size */ + readonly redoStackSize: ComputedRef; + + constructor(maxSize: number = DEFAULT_MAX_HISTORY_SIZE) { + this._maxSize = maxSize; + const self = this; + + this.canUndo = computed(() => { + self._version.value; // Trigger reactivity + return self._undoStack.length > 0; + }); + + this.canRedo = computed(() => { + self._version.value; // Trigger reactivity + return self._redoStack.length > 0; + }); + + this.undoStackSize = computed(() => { + self._version.value; + return self._undoStack.length; + }); + + this.redoStackSize = computed(() => { + self._version.value; + return self._redoStack.length; + }); + } + + /** + * Notify Vue reactivity system of changes + */ + private notify(): void { + this._version.value++; + } + + // ============================================ + // State Snapshot Operations + // ============================================ + + /** + * Create a deep clone of the state for snapshot storage + * This ensures the snapshot is independent of the original state + */ + private cloneState(state: HistorySnapshot): HistorySnapshot { + return { + elements: state.elements.map(el => this.cloneElement(el)), + viewTransform: { ...state.viewTransform }, + timestamp: state.timestamp, + }; + } + + /** + * Deep clone a single element + */ + private cloneElement(element: IMediaElement): IMediaElement { + return { + ...element, + data: this.cloneElementData(element.data), + }; + } + + /** + * Deep clone element data + * Note: ImageBitmap objects in GifData.frames cannot be cloned, + * so we keep references to them (they are immutable anyway) + */ + private cloneElementData(data: IMediaElement['data']): IMediaElement['data'] { + if ('frames' in data) { + // GifData - keep frame references as they are immutable + return { + ...data, + frameDelays: [...data.frameDelays], + frames: data.frames, // Keep reference to ImageBitmap array + }; + } + return { ...data }; + } + + /** + * Create a snapshot from the current scene state + */ + createSnapshot( + elements: IMediaElement[], + viewTransform: ViewTransform + ): HistorySnapshot { + return { + elements: elements.map(el => this.cloneElement(el)), + viewTransform: { ...viewTransform }, + timestamp: Date.now(), + }; + } + + // ============================================ + // History Operations + // ============================================ + + /** + * Push a new state onto the undo stack + * This should be called before making changes to the scene + * Requirement 5.4: Clears redo stack when new operation is performed + */ + push(state: HistorySnapshot): void { + // Don't record state during undo/redo operations + if (this._isRestoring) { + return; + } + + // Clone the state to ensure independence + const snapshot = this.cloneState(state); + + // Add to undo stack + this._undoStack.push(snapshot); + + // Enforce max size limit (Requirement 5.3) + while (this._undoStack.length > this._maxSize) { + this._undoStack.shift(); + } + + // Clear redo stack (Requirement 5.4) + this._redoStack = []; + + this.notify(); + } + + /** + * Record the current state before an operation + * Convenience method that creates and pushes a snapshot + */ + record(elements: IMediaElement[], viewTransform: ViewTransform): void { + const snapshot = this.createSnapshot(elements, viewTransform); + this.push(snapshot); + } + + /** + * Undo the last operation + * Requirement 5.1: Restores to previous state + * @param currentState The current state to save for redo + * @returns The previous state to restore, or null if nothing to undo + */ + undo(currentState: HistorySnapshot): HistorySnapshot | null { + if (this._undoStack.length === 0) { + return null; + } + + this._isRestoring = true; + + try { + // Save current state to redo stack + this._redoStack.push(this.cloneState(currentState)); + + // Pop and return the previous state + const previousState = this._undoStack.pop()!; + this.notify(); + + return this.cloneState(previousState); + } finally { + this._isRestoring = false; + } + } + + /** + * Redo the last undone operation + * Requirement 5.2: Restores the most recently undone state + * @param currentState The current state to save for undo + * @returns The state to restore, or null if nothing to redo + */ + redo(currentState: HistorySnapshot): HistorySnapshot | null { + if (this._redoStack.length === 0) { + return null; + } + + this._isRestoring = true; + + try { + // Save current state to undo stack + this._undoStack.push(this.cloneState(currentState)); + + // Pop and return the redo state + const redoState = this._redoStack.pop()!; + this.notify(); + + return this.cloneState(redoState); + } finally { + this._isRestoring = false; + } + } + + // ============================================ + // Configuration + // ============================================ + + /** + * Set the maximum history size + * Requirement 5.3: Maintains max 50 states + */ + setMaxSize(size: number): void { + this._maxSize = Math.max(1, size); + + // Trim undo stack if necessary + while (this._undoStack.length > this._maxSize) { + this._undoStack.shift(); + } + + this.notify(); + } + + /** + * Get the current maximum history size + */ + getMaxSize(): number { + return this._maxSize; + } + + // ============================================ + // State Queries + // ============================================ + + /** + * Check if undo is available + */ + hasUndo(): boolean { + return this._undoStack.length > 0; + } + + /** + * Check if redo is available + */ + hasRedo(): boolean { + return this._redoStack.length > 0; + } + + /** + * Get the number of states in the undo stack + */ + getUndoCount(): number { + return this._undoStack.length; + } + + /** + * Get the number of states in the redo stack + */ + getRedoCount(): number { + return this._redoStack.length; + } + + // ============================================ + // Clear Operations + // ============================================ + + /** + * Clear all history (both undo and redo stacks) + */ + clear(): void { + this._undoStack = []; + this._redoStack = []; + this.notify(); + } + + /** + * Clear only the undo stack + */ + clearUndo(): void { + this._undoStack = []; + this.notify(); + } + + /** + * Clear only the redo stack + */ + clearRedo(): void { + this._redoStack = []; + this.notify(); + } + + // ============================================ + // Batch Operations + // ============================================ + + /** + * Begin a batch operation + * Multiple changes can be grouped into a single undo step + * Call endBatch() when done + */ + private _batchState: HistorySnapshot | null = null; + + beginBatch(currentState: HistorySnapshot): void { + if (this._batchState === null) { + this._batchState = this.cloneState(currentState); + } + } + + /** + * End a batch operation and record the initial state + */ + endBatch(): void { + if (this._batchState !== null) { + this.push(this._batchState); + this._batchState = null; + } + } + + /** + * Cancel a batch operation without recording + */ + cancelBatch(): void { + this._batchState = null; + } + + /** + * Check if currently in a batch operation + */ + isInBatch(): boolean { + return this._batchState !== null; + } +} + +// ============================================ +// Singleton Instance +// ============================================ + +let historyManagerInstance: HistoryManager | null = null; + +/** + * Get the singleton HistoryManager instance + */ +export function getHistoryManager(): HistoryManager { + if (!historyManagerInstance) { + historyManagerInstance = new HistoryManager(DEFAULT_MAX_HISTORY_SIZE); + } + return historyManagerInstance; +} + +/** + * Reset the singleton instance (useful for testing) + */ +export function resetHistoryManager(): void { + historyManagerInstance = null; +} + +/** + * Create a new HistoryManager instance (for non-singleton use) + */ +export function createHistoryManager(maxSize?: number): HistoryManager { + return new HistoryManager(maxSize); +} diff --git a/src/core/input/index.ts b/src/core/input/index.ts new file mode 100644 index 0000000..303f017 --- /dev/null +++ b/src/core/input/index.ts @@ -0,0 +1,577 @@ +/** + * Input Handler - Main Entry Point + * Integrates keyboard and mouse input handling with input mode state machine + */ + +import type { InputMode, MousePosition } from '../../types'; +import { + KeyboardHandler, + getKeyboardHandler, + resetKeyboardHandler, + type KeyboardShortcut, +} from './keyboard'; +import { + MouseHandler, + getMouseHandler, + resetMouseHandler, + type MouseEventData, + type DragState, +} from './mouse'; + +// ============================================ +// Types +// ============================================ + +export interface InputState { + mode: InputMode; + mousePosition: MousePosition; + isDragging: boolean; + isSpacePressed: boolean; + isCtrlPressed: boolean; + isShiftPressed: boolean; +} + +export interface SelectionRect { + startX: number; + startY: number; + endX: number; + endY: number; + width: number; + height: number; +} + +export type InputActionCallback = (action: string, data?: unknown) => void; + +// ============================================ +// Input Mode State Machine +// ============================================ + +/** + * Determines the appropriate input mode based on current state + */ +function determineMode( + keyboard: KeyboardHandler, + mouse: MouseHandler, + currentMode: InputMode +): InputMode { + const isSpacePressed = keyboard.isSpacePressed(); + const isCtrlPressed = keyboard.isCtrlPressed(); + const isDragging = mouse.isDragging(); + const dragState = mouse.getDragState(); + + // If dragging, maintain current drag-related mode + if (isDragging) { + // Space + drag = panning + if (isSpacePressed && !isCtrlPressed) { + return 'panning'; + } + // Ctrl + Space + drag = zooming + if (isSpacePressed && isCtrlPressed) { + return 'zooming'; + } + // Middle button drag = panning + if (dragState.button === 1) { + return 'panning'; + } + // Keep current mode if already in a drag mode + if ( + currentMode === 'dragging' || + currentMode === 'resizing' || + currentMode === 'selecting' + ) { + return currentMode; + } + } + + // Not dragging - check for potential mode based on keys + if (isSpacePressed && isCtrlPressed) { + return 'zooming'; + } + if (isSpacePressed) { + return 'panning'; + } + + return 'default'; +} + + +// ============================================ +// Input Handler Class +// ============================================ + +export class InputHandler { + private keyboard: KeyboardHandler; + private mouse: MouseHandler; + private mode: InputMode = 'default'; + private element: HTMLElement | null = null; + private actionCallbacks: Set = new Set(); + private selectionRect: SelectionRect | null = null; + + // Cleanup functions + private cleanupFns: (() => void)[] = []; + + constructor() { + this.keyboard = getKeyboardHandler(); + this.mouse = getMouseHandler(); + } + + // ============================================ + // Lifecycle + // ============================================ + + /** + * Attach input handlers to an element + */ + attach(element: HTMLElement): void { + if (this.element) { + this.detach(); + } + + this.element = element; + this.keyboard.attach(window); + this.mouse.attach(element); + + // Set up keyboard action handling + const keyboardCleanup = this.keyboard.onAction((action, event) => { + this.handleKeyboardAction(action, event); + }); + this.cleanupFns.push(keyboardCleanup); + + // Set up mouse event handling + this.setupMouseHandlers(); + } + + /** + * Detach input handlers + */ + detach(): void { + for (const cleanup of this.cleanupFns) { + cleanup(); + } + this.cleanupFns = []; + + this.keyboard.detach(); + this.mouse.detach(); + this.element = null; + this.mode = 'default'; + this.selectionRect = null; + } + + // ============================================ + // Mouse Event Setup + // ============================================ + + private setupMouseHandlers(): void { + // Click handling + const clickCleanup = this.mouse.on('click', (data) => { + this.handleClick(data); + }); + this.cleanupFns.push(clickCleanup); + + // Double click handling + const dblClickCleanup = this.mouse.on('doubleClick', (data) => { + this.handleDoubleClick(data); + }); + this.cleanupFns.push(dblClickCleanup); + + // Drag start + const dragStartCleanup = this.mouse.on('dragStart', (data) => { + this.handleDragStart(data); + }); + this.cleanupFns.push(dragStartCleanup); + + // Drag + const dragCleanup = this.mouse.on('drag', (data) => { + this.handleDrag(data); + }); + this.cleanupFns.push(dragCleanup); + + // Drag end + const dragEndCleanup = this.mouse.on('dragEnd', (data) => { + this.handleDragEnd(data); + }); + this.cleanupFns.push(dragEndCleanup); + + // Wheel (zoom) + const wheelCleanup = this.mouse.on('wheel', (data) => { + this.handleWheel(data); + }); + this.cleanupFns.push(wheelCleanup); + + // Context menu + const contextMenuCleanup = this.mouse.on('contextMenu', (data) => { + this.handleContextMenu(data); + }); + this.cleanupFns.push(contextMenuCleanup); + + // Mouse move + const moveCleanup = this.mouse.on('move', (data) => { + this.handleMouseMove(data); + }); + this.cleanupFns.push(moveCleanup); + } + + // ============================================ + // Keyboard Action Handling + // ============================================ + + private handleKeyboardAction(action: string, _event: KeyboardEvent): void { + this.emitAction(action); + } + + // ============================================ + // Mouse Event Handling + // ============================================ + + private handleClick(data: MouseEventData): void { + if (data.button === 0) { + // Left click + this.emitAction('click', { + x: data.x, + y: data.y, + shift: this.keyboard.isShiftPressed(), + ctrl: this.keyboard.isCtrlPressed(), + }); + } + } + + private handleDoubleClick(data: MouseEventData): void { + if (data.button === 0) { + this.emitAction('doubleClick', { x: data.x, y: data.y }); + } + } + + private handleDragStart(data: MouseEventData): void { + const isSpace = this.keyboard.isSpacePressed(); + const isCtrl = this.keyboard.isCtrlPressed(); + + // Determine drag mode + if (data.button === 2) { + // Right button drag = window drag (Requirement 7.5) + this.setMode('windowDragging' as InputMode); + this.emitAction('windowDragStart', { x: data.x, y: data.y }); + } else if (data.button === 1 || (data.button === 0 && isSpace && !isCtrl)) { + // Middle button or Space+Left = panning + this.setMode('panning'); + this.emitAction('panStart', { x: data.x, y: data.y }); + // Apply initial delta from mousedown to dragStart immediately + if (data.deltaX !== undefined && data.deltaY !== undefined) { + this.emitAction('pan', { + deltaX: data.deltaX, + deltaY: data.deltaY, + }); + } + } else if (data.button === 0 && isSpace && isCtrl) { + // Ctrl+Space+Left = zooming + this.setMode('zooming'); + this.emitAction('zoomDragStart', { x: data.x, y: data.y }); + } else if (data.button === 0) { + // Left button drag - could be element drag or selection + // The actual mode will be determined by the scene manager + this.emitAction('dragStart', { + x: data.x, + y: data.y, + shift: this.keyboard.isShiftPressed(), + deltaX: data.deltaX, + deltaY: data.deltaY, + }); + } + } + + private handleDrag(data: MouseEventData): void { + const mode = this.mode; + + if (mode === 'panning') { + this.emitAction('pan', { + deltaX: data.deltaX, + deltaY: data.deltaY, + }); + } else if (mode === 'zooming') { + // Horizontal movement controls zoom + this.emitAction('zoomDrag', { + deltaX: data.deltaX, + x: data.x, + y: data.y, + }); + } else if (mode === 'selecting') { + // Update selection rectangle + if (this.selectionRect) { + this.selectionRect.endX = data.x; + this.selectionRect.endY = data.y; + this.selectionRect.width = data.x - this.selectionRect.startX; + this.selectionRect.height = data.y - this.selectionRect.startY; + + this.emitAction('selectionUpdate', { ...this.selectionRect }); + } + } else if (mode === 'dragging') { + this.emitAction('elementDrag', { + deltaX: data.deltaX, + deltaY: data.deltaY, + }); + } else if (mode === 'resizing') { + this.emitAction('elementResize', { + deltaX: data.deltaX, + deltaY: data.deltaY, + x: data.x, + y: data.y, + }); + } else if (mode === ('windowDragging' as InputMode)) { + this.emitAction('windowDrag', { + deltaX: data.deltaX, + deltaY: data.deltaY, + }); + } else { + // Default mode drag - emit generic drag + this.emitAction('drag', { + x: data.x, + y: data.y, + deltaX: data.deltaX, + deltaY: data.deltaY, + }); + } + } + + private handleDragEnd(data: MouseEventData): void { + const mode = this.mode; + + if (mode === 'panning') { + this.emitAction('panEnd', { x: data.x, y: data.y }); + } else if (mode === 'zooming') { + this.emitAction('zoomDragEnd', { x: data.x, y: data.y }); + } else if (mode === 'selecting') { + if (this.selectionRect) { + // Update selection rect with final mouse position before emitting + this.selectionRect.endX = data.x; + this.selectionRect.endY = data.y; + this.selectionRect.width = data.x - this.selectionRect.startX; + this.selectionRect.height = data.y - this.selectionRect.startY; + this.emitAction('selectionEnd', { ...this.selectionRect }); + this.selectionRect = null; + } + } else if (mode === 'dragging') { + this.emitAction('elementDragEnd', { x: data.x, y: data.y }); + } else if (mode === 'resizing') { + this.emitAction('elementResizeEnd', { x: data.x, y: data.y }); + } else { + this.emitAction('dragEnd', { + x: data.x, + y: data.y, + deltaX: data.deltaX, + deltaY: data.deltaY, + }); + } + + // Reset to default mode after drag ends + this.setMode('default'); + } + + private handleWheel(data: MouseEventData): void { + // Wheel zoom (Requirement 2.1) + this.emitAction('zoom', { + delta: data.wheelDelta, + x: data.x, + y: data.y, + }); + } + + private handleContextMenu(data: MouseEventData): void { + this.emitAction('contextMenu', { + x: data.x, + y: data.y, + }); + } + + private handleMouseMove(data: MouseEventData): void { + // Update mode based on current key state + const newMode = determineMode(this.keyboard, this.mouse, this.mode); + if (newMode !== this.mode && !this.mouse.isDragging()) { + this.setMode(newMode); + } + + this.emitAction('mouseMove', { x: data.x, y: data.y }); + } + + // ============================================ + // Mode Management + // ============================================ + + /** + * Set the current input mode + */ + setMode(mode: InputMode): void { + if (this.mode !== mode) { + const oldMode = this.mode; + this.mode = mode; + this.emitAction('modeChange', { oldMode, newMode: mode }); + } + } + + /** + * Get the current input mode + */ + getMode(): InputMode { + return this.mode; + } + + /** + * Start selection mode with initial rectangle + */ + startSelection(x: number, y: number): void { + this.setMode('selecting'); + this.selectionRect = { + startX: x, + startY: y, + endX: x, + endY: y, + width: 0, + height: 0, + }; + this.emitAction('selectionStart', { x, y }); + } + + /** + * Start element dragging mode + */ + startDragging(): void { + this.setMode('dragging'); + } + + /** + * Start element resizing mode + */ + startResizing(): void { + this.setMode('resizing'); + } + + /** + * Cancel current operation and return to default mode + */ + cancel(): void { + if (this.mode === 'selecting') { + this.selectionRect = null; + this.emitAction('selectionCancel'); + } + this.setMode('default'); + } + + // ============================================ + // Action Callbacks + // ============================================ + + /** + * Register a callback for input actions + */ + onAction(callback: InputActionCallback): () => void { + this.actionCallbacks.add(callback); + return () => this.actionCallbacks.delete(callback); + } + + /** + * Emit an action to all registered callbacks + */ + private emitAction(action: string, data?: unknown): void { + for (const callback of this.actionCallbacks) { + callback(action, data); + } + } + + // ============================================ + // State Queries + // ============================================ + + /** + * Get current input state + */ + getState(): InputState { + return { + mode: this.mode, + mousePosition: this.mouse.getPosition(), + isDragging: this.mouse.isDragging(), + isSpacePressed: this.keyboard.isSpacePressed(), + isCtrlPressed: this.keyboard.isCtrlPressed(), + isShiftPressed: this.keyboard.isShiftPressed(), + }; + } + + /** + * Get current mouse position + */ + getMousePosition(): MousePosition { + return this.mouse.getPosition(); + } + + /** + * Check if a key is pressed + */ + isKeyPressed(key: string): boolean { + return this.keyboard.isKeyPressed(key); + } + + /** + * Get current selection rectangle (if in selecting mode) + */ + getSelectionRect(): SelectionRect | null { + return this.selectionRect ? { ...this.selectionRect } : null; + } + + /** + * Get drag state + */ + getDragState(): DragState { + return this.mouse.getDragState(); + } + + /** + * Get all keyboard shortcuts + */ + getShortcuts(): KeyboardShortcut[] { + return this.keyboard.getShortcuts(); + } +} + +// ============================================ +// Singleton Instance +// ============================================ + +let inputHandlerInstance: InputHandler | null = null; + +export function getInputHandler(): InputHandler { + if (!inputHandlerInstance) { + inputHandlerInstance = new InputHandler(); + } + return inputHandlerInstance; +} + +export function resetInputHandler(): void { + if (inputHandlerInstance) { + inputHandlerInstance.detach(); + inputHandlerInstance = null; + } + resetKeyboardHandler(); + resetMouseHandler(); +} + +// ============================================ +// Re-exports +// ============================================ + +export { + KeyboardHandler, + getKeyboardHandler, + resetKeyboardHandler, + KEYBOARD_SHORTCUTS, + type KeyboardShortcut, + type KeyboardState, + type KeyboardEventCallback, +} from './keyboard'; + +export { + MouseHandler, + getMouseHandler, + resetMouseHandler, + type MouseEventData, + type MouseEventType, + type MouseEventCallback, + type DragState, + type MouseState, +} from './mouse'; diff --git a/src/core/input/keyboard.ts b/src/core/input/keyboard.ts new file mode 100644 index 0000000..c22f2c6 --- /dev/null +++ b/src/core/input/keyboard.ts @@ -0,0 +1,330 @@ +/** + * Keyboard Input Handler + * Implements keyboard event listening, shortcut mapping, and combo key detection + */ + +// ============================================ +// Types +// ============================================ + +export interface KeyboardShortcut { + key: string; + ctrl?: boolean; + shift?: boolean; + alt?: boolean; + action: string; + description: string; +} + +export interface KeyboardState { + pressedKeys: Set; + ctrlPressed: boolean; + shiftPressed: boolean; + altPressed: boolean; + spacePressed: boolean; +} + +export type KeyboardEventCallback = (action: string, event: KeyboardEvent) => void; + +// ============================================ +// Shortcut Definitions +// ============================================ + +export const KEYBOARD_SHORTCUTS: KeyboardShortcut[] = [ + // Undo/Redo (Requirement 5.1, 5.2) + { key: 'z', ctrl: true, action: 'undo', description: '撤销' }, + { key: 'y', ctrl: true, action: 'redo', description: '重做' }, + { key: 'z', ctrl: true, shift: true, action: 'redo', description: '重做' }, + + // File Operations (Requirement 6.1, 6.2, 6.3) + { key: 's', ctrl: true, action: 'save', description: '保存场景' }, + { key: 'l', ctrl: true, action: 'load', description: '加载场景' }, + { key: 'n', ctrl: true, action: 'new', description: '新建场景' }, + + // Window Management (Requirement 7.4, 7.5, 7.6) + { key: 'f', ctrl: true, action: 'toggleFullscreen', description: '切换最大化' }, + { key: 'm', ctrl: true, action: 'minimize', description: '最小化窗口' }, + { key: 'w', ctrl: true, action: 'close', description: '关闭窗口' }, + + // Help (Requirement 9.1) + { key: 'h', ctrl: true, action: 'help', description: '显示帮助' }, + + // Copy/Paste (Requirement 4.1, 4.2) + { key: 'c', ctrl: true, action: 'copy', description: '复制' }, + { key: 'v', ctrl: true, action: 'paste', description: '粘贴' }, + { key: 'x', ctrl: true, action: 'cut', description: '剪切' }, + + // Selection + { key: 'a', ctrl: true, action: 'selectAll', description: '全选' }, + { key: 'Escape', action: 'deselect', description: '取消选择' }, + { key: 'Delete', action: 'delete', description: '删除选中元素' }, + { key: 'Backspace', action: 'delete', description: '删除选中元素' }, +]; + + +// ============================================ +// Keyboard Handler Class +// ============================================ + +export class KeyboardHandler { + private state: KeyboardState = { + pressedKeys: new Set(), + ctrlPressed: false, + shiftPressed: false, + altPressed: false, + spacePressed: false, + }; + + private callbacks: Set = new Set(); + private element: HTMLElement | Window | null = null; + private boundKeyDown: (e: KeyboardEvent) => void; + private boundKeyUp: (e: KeyboardEvent) => void; + private boundBlur: () => void; + + constructor() { + this.boundKeyDown = this.handleKeyDown.bind(this); + this.boundKeyUp = this.handleKeyUp.bind(this); + this.boundBlur = this.handleBlur.bind(this); + } + + // ============================================ + // Lifecycle + // ============================================ + + /** + * Attach keyboard event listeners to an element + */ + attach(element: HTMLElement | Window = window): void { + if (this.element) { + this.detach(); + } + + this.element = element; + element.addEventListener('keydown', this.boundKeyDown as EventListener); + element.addEventListener('keyup', this.boundKeyUp as EventListener); + window.addEventListener('blur', this.boundBlur); + } + + /** + * Detach keyboard event listeners + */ + detach(): void { + if (!this.element) return; + + this.element.removeEventListener('keydown', this.boundKeyDown as EventListener); + this.element.removeEventListener('keyup', this.boundKeyUp as EventListener); + window.removeEventListener('blur', this.boundBlur); + this.element = null; + this.resetState(); + } + + /** + * Reset keyboard state (called on blur) + */ + private resetState(): void { + this.state.pressedKeys.clear(); + this.state.ctrlPressed = false; + this.state.shiftPressed = false; + this.state.altPressed = false; + this.state.spacePressed = false; + } + + // ============================================ + // Event Handlers + // ============================================ + + private handleKeyDown(event: KeyboardEvent): void { + const key = event.key; + + // Update modifier state + this.state.ctrlPressed = event.ctrlKey || event.metaKey; + this.state.shiftPressed = event.shiftKey; + this.state.altPressed = event.altKey; + + // Track space key separately for panning + if (key === ' ') { + this.state.spacePressed = true; + } + + // Add to pressed keys + this.state.pressedKeys.add(key.toLowerCase()); + + // Check for matching shortcut + const action = this.matchShortcut(event); + if (action) { + event.preventDefault(); + this.notifyCallbacks(action, event); + } + } + + private handleKeyUp(event: KeyboardEvent): void { + const key = event.key; + + // Update modifier state + this.state.ctrlPressed = event.ctrlKey || event.metaKey; + this.state.shiftPressed = event.shiftKey; + this.state.altPressed = event.altKey; + + // Track space key + if (key === ' ') { + this.state.spacePressed = false; + } + + // Remove from pressed keys + this.state.pressedKeys.delete(key.toLowerCase()); + } + + private handleBlur(): void { + this.resetState(); + } + + // ============================================ + // Shortcut Matching + // ============================================ + + /** + * Match keyboard event against defined shortcuts + */ + private matchShortcut(event: KeyboardEvent): string | null { + const key = event.key.toLowerCase(); + const ctrl = event.ctrlKey || event.metaKey; + const shift = event.shiftKey; + const alt = event.altKey; + + for (const shortcut of KEYBOARD_SHORTCUTS) { + const shortcutKey = shortcut.key.toLowerCase(); + const requiresCtrl = shortcut.ctrl ?? false; + const requiresShift = shortcut.shift ?? false; + const requiresAlt = shortcut.alt ?? false; + + if ( + shortcutKey === key && + requiresCtrl === ctrl && + requiresShift === shift && + requiresAlt === alt + ) { + return shortcut.action; + } + } + + return null; + } + + // ============================================ + // Callback Management + // ============================================ + + /** + * Register a callback for keyboard actions + */ + onAction(callback: KeyboardEventCallback): () => void { + this.callbacks.add(callback); + return () => this.callbacks.delete(callback); + } + + /** + * Notify all registered callbacks + */ + private notifyCallbacks(action: string, event: KeyboardEvent): void { + for (const callback of this.callbacks) { + callback(action, event); + } + } + + // ============================================ + // State Queries + // ============================================ + + /** + * Check if a specific key is currently pressed + */ + isKeyPressed(key: string): boolean { + return this.state.pressedKeys.has(key.toLowerCase()); + } + + /** + * Check if Ctrl (or Cmd on Mac) is pressed + */ + isCtrlPressed(): boolean { + return this.state.ctrlPressed; + } + + /** + * Check if Shift is pressed + */ + isShiftPressed(): boolean { + return this.state.shiftPressed; + } + + /** + * Check if Alt is pressed + */ + isAltPressed(): boolean { + return this.state.altPressed; + } + + /** + * Check if Space is pressed (for panning mode) + */ + isSpacePressed(): boolean { + return this.state.spacePressed; + } + + /** + * Get current keyboard state + */ + getState(): Readonly { + return { + ...this.state, + pressedKeys: new Set(this.state.pressedKeys), + }; + } + + /** + * Get all defined shortcuts + */ + getShortcuts(): KeyboardShortcut[] { + return [...KEYBOARD_SHORTCUTS]; + } + + /** + * Format shortcut for display + */ + static formatShortcut(shortcut: KeyboardShortcut): string { + const parts: string[] = []; + if (shortcut.ctrl) parts.push('Ctrl'); + if (shortcut.shift) parts.push('Shift'); + if (shortcut.alt) parts.push('Alt'); + + // Format special keys + let keyDisplay = shortcut.key; + if (keyDisplay === ' ') keyDisplay = 'Space'; + else if (keyDisplay === 'Escape') keyDisplay = 'Esc'; + else if (keyDisplay === 'Delete') keyDisplay = 'Del'; + else if (keyDisplay === 'Backspace') keyDisplay = 'Backspace'; + else keyDisplay = keyDisplay.toUpperCase(); + + parts.push(keyDisplay); + return parts.join('+'); + } +} + +// ============================================ +// Singleton Instance +// ============================================ + +let keyboardHandlerInstance: KeyboardHandler | null = null; + +export function getKeyboardHandler(): KeyboardHandler { + if (!keyboardHandlerInstance) { + keyboardHandlerInstance = new KeyboardHandler(); + } + return keyboardHandlerInstance; +} + +export function resetKeyboardHandler(): void { + if (keyboardHandlerInstance) { + keyboardHandlerInstance.detach(); + keyboardHandlerInstance = null; + } +} diff --git a/src/core/input/mouse.ts b/src/core/input/mouse.ts new file mode 100644 index 0000000..9482a4a --- /dev/null +++ b/src/core/input/mouse.ts @@ -0,0 +1,509 @@ +/** + * Mouse Input Handler + * Implements mouse event listening, drag detection, wheel zoom, and hit testing + */ + +import type { MousePosition } from '../../types'; + +// ============================================ +// Types +// ============================================ + +export interface DragState { + isDragging: boolean; + startX: number; + startY: number; + currentX: number; + currentY: number; + deltaX: number; + deltaY: number; + button: number; +} + +export interface MouseState { + position: MousePosition; + isLeftButtonDown: boolean; + isMiddleButtonDown: boolean; + isRightButtonDown: boolean; + drag: DragState; +} + +export type MouseEventType = + | 'click' + | 'doubleClick' + | 'dragStart' + | 'drag' + | 'dragEnd' + | 'wheel' + | 'contextMenu' + | 'move'; + +export interface MouseEventData { + type: MouseEventType; + x: number; + y: number; + button: number; + deltaX?: number; + deltaY?: number; + wheelDelta?: number; + originalEvent: MouseEvent | WheelEvent; +} + +export type MouseEventCallback = (data: MouseEventData) => void; + +// ============================================ +// Constants +// ============================================ + +const DRAG_THRESHOLD = 5; // Minimum pixels to start drag +const DOUBLE_CLICK_DELAY = 300; // ms + + +// ============================================ +// Mouse Handler Class +// ============================================ + +export class MouseHandler { + private state: MouseState = { + position: { x: 0, y: 0 }, + isLeftButtonDown: false, + isMiddleButtonDown: false, + isRightButtonDown: false, + drag: { + isDragging: false, + startX: 0, + startY: 0, + currentX: 0, + currentY: 0, + deltaX: 0, + deltaY: 0, + button: 0, + }, + }; + + private callbacks: Map> = new Map(); + private element: HTMLElement | null = null; + private lastClickTime = 0; + private lastClickX = 0; + private lastClickY = 0; + + // Bound event handlers + private boundMouseDown: (e: MouseEvent) => void; + private boundMouseMove: (e: MouseEvent) => void; + private boundMouseUp: (e: MouseEvent) => void; + private boundWheel: (e: WheelEvent) => void; + private boundContextMenu: (e: MouseEvent) => void; + private boundMouseLeave: (e: MouseEvent) => void; + + constructor() { + this.boundMouseDown = this.handleMouseDown.bind(this); + this.boundMouseMove = this.handleMouseMove.bind(this); + this.boundMouseUp = this.handleMouseUp.bind(this); + this.boundWheel = this.handleWheel.bind(this); + this.boundContextMenu = this.handleContextMenu.bind(this); + this.boundMouseLeave = this.handleMouseLeave.bind(this); + } + + // ============================================ + // Lifecycle + // ============================================ + + /** + * Attach mouse event listeners to an element + */ + attach(element: HTMLElement): void { + if (this.element) { + this.detach(); + } + + this.element = element; + element.addEventListener('mousedown', this.boundMouseDown); + element.addEventListener('mousemove', this.boundMouseMove); + element.addEventListener('mouseup', this.boundMouseUp); + element.addEventListener('wheel', this.boundWheel, { passive: false }); + element.addEventListener('contextmenu', this.boundContextMenu); + element.addEventListener('mouseleave', this.boundMouseLeave); + + // Also listen on window for mouseup to catch releases outside element + window.addEventListener('mouseup', this.boundMouseUp); + window.addEventListener('mousemove', this.boundMouseMove); + } + + /** + * Detach mouse event listeners + */ + detach(): void { + if (!this.element) return; + + this.element.removeEventListener('mousedown', this.boundMouseDown); + this.element.removeEventListener('mousemove', this.boundMouseMove); + this.element.removeEventListener('mouseup', this.boundMouseUp); + this.element.removeEventListener('wheel', this.boundWheel); + this.element.removeEventListener('contextmenu', this.boundContextMenu); + this.element.removeEventListener('mouseleave', this.boundMouseLeave); + + window.removeEventListener('mouseup', this.boundMouseUp); + window.removeEventListener('mousemove', this.boundMouseMove); + + this.element = null; + this.resetState(); + } + + /** + * Reset mouse state + */ + private resetState(): void { + this.state.isLeftButtonDown = false; + this.state.isMiddleButtonDown = false; + this.state.isRightButtonDown = false; + this.state.drag.isDragging = false; + } + + // ============================================ + // Event Handlers + // ============================================ + + private handleMouseDown(event: MouseEvent): void { + const { clientX, clientY, button } = event; + const rect = this.element?.getBoundingClientRect(); + const x = rect ? clientX - rect.left : clientX; + const y = rect ? clientY - rect.top : clientY; + + // Update button state + if (button === 0) this.state.isLeftButtonDown = true; + if (button === 1) this.state.isMiddleButtonDown = true; + if (button === 2) this.state.isRightButtonDown = true; + + // Initialize drag tracking + this.state.drag.startX = x; + this.state.drag.startY = y; + this.state.drag.currentX = x; + this.state.drag.currentY = y; + this.state.drag.deltaX = 0; + this.state.drag.deltaY = 0; + this.state.drag.button = button; + + this.state.position = { x, y }; + } + + private handleMouseMove(event: MouseEvent): void { + const { clientX, clientY, screenX, screenY } = event; + const rect = this.element?.getBoundingClientRect(); + const x = rect ? clientX - rect.left : clientX; + const y = rect ? clientY - rect.top : clientY; + + const prevX = this.state.position.x; + const prevY = this.state.position.y; + this.state.position = { x, y }; + + // Check if any button is down for drag detection + const anyButtonDown = + this.state.isLeftButtonDown || + this.state.isMiddleButtonDown || + this.state.isRightButtonDown; + + if (anyButtonDown) { + const dx = x - this.state.drag.startX; + const dy = y - this.state.drag.startY; + const distance = Math.sqrt(dx * dx + dy * dy); + + if (!this.state.drag.isDragging && distance >= DRAG_THRESHOLD) { + // Start dragging + this.state.drag.isDragging = true; + // Store screen position for window dragging + (this.state.drag as any).lastScreenX = screenX; + (this.state.drag as any).lastScreenY = screenY; + this.emit('dragStart', { + type: 'dragStart', + x: this.state.drag.startX, + y: this.state.drag.startY, + button: this.state.drag.button, + // Include initial delta from mousedown to dragStart + deltaX: x - this.state.drag.startX, + deltaY: y - this.state.drag.startY, + originalEvent: event, + }); + } + + if (this.state.drag.isDragging) { + this.state.drag.currentX = x; + this.state.drag.currentY = y; + this.state.drag.deltaX = x - prevX; + this.state.drag.deltaY = y - prevY; + + // For right button (window drag), use screen coordinates for stable delta + if (this.state.drag.button === 2) { + const lastScreenX = (this.state.drag as any).lastScreenX || screenX; + const lastScreenY = (this.state.drag as any).lastScreenY || screenY; + this.state.drag.deltaX = screenX - lastScreenX; + this.state.drag.deltaY = screenY - lastScreenY; + (this.state.drag as any).lastScreenX = screenX; + (this.state.drag as any).lastScreenY = screenY; + } + + this.emit('drag', { + type: 'drag', + x, + y, + button: this.state.drag.button, + deltaX: this.state.drag.deltaX, + deltaY: this.state.drag.deltaY, + originalEvent: event, + }); + } + } else { + // Regular mouse move + this.emit('move', { + type: 'move', + x, + y, + button: -1, + originalEvent: event, + }); + } + } + + private handleMouseUp(event: MouseEvent): void { + const { clientX, clientY, button } = event; + const rect = this.element?.getBoundingClientRect(); + const x = rect ? clientX - rect.left : clientX; + const y = rect ? clientY - rect.top : clientY; + + // Check if this button was actually pressed (avoid duplicate events from window listener) + const wasButtonDown = + (button === 0 && this.state.isLeftButtonDown) || + (button === 1 && this.state.isMiddleButtonDown) || + (button === 2 && this.state.isRightButtonDown); + + if (!wasButtonDown) { + // This button wasn't tracked as pressed, ignore this event + return; + } + + // Check for drag end + if (this.state.drag.isDragging && this.state.drag.button === button) { + // Mark if this was a right-button drag (to suppress context menu) + if (button === 2) { + (this.state.drag as any).wasRightDragging = true; + } + this.emit('dragEnd', { + type: 'dragEnd', + x, + y, + button, + deltaX: x - this.state.drag.startX, + deltaY: y - this.state.drag.startY, + originalEvent: event, + }); + this.state.drag.isDragging = false; + } else if (!this.state.drag.isDragging) { + // It was a click (no drag occurred) + const now = Date.now(); + const timeDiff = now - this.lastClickTime; + const distX = Math.abs(x - this.lastClickX); + const distY = Math.abs(y - this.lastClickY); + + if (timeDiff < DOUBLE_CLICK_DELAY && distX < 5 && distY < 5) { + // Double click + this.emit('doubleClick', { + type: 'doubleClick', + x, + y, + button, + originalEvent: event, + }); + this.lastClickTime = 0; // Reset to prevent triple-click + } else { + // Single click + this.emit('click', { + type: 'click', + x, + y, + button, + originalEvent: event, + }); + this.lastClickTime = now; + this.lastClickX = x; + this.lastClickY = y; + } + } + + // Update button state + if (button === 0) this.state.isLeftButtonDown = false; + if (button === 1) this.state.isMiddleButtonDown = false; + if (button === 2) this.state.isRightButtonDown = false; + + this.state.position = { x, y }; + } + + private handleWheel(event: WheelEvent): void { + event.preventDefault(); + + const { clientX, clientY, deltaY } = event; + const rect = this.element?.getBoundingClientRect(); + const x = rect ? clientX - rect.left : clientX; + const y = rect ? clientY - rect.top : clientY; + + // Normalize wheel delta + const wheelDelta = -deltaY * 0.001; + + this.emit('wheel', { + type: 'wheel', + x, + y, + button: -1, + wheelDelta, + originalEvent: event, + }); + } + + private handleContextMenu(event: MouseEvent): void { + event.preventDefault(); + + // Don't show context menu if we just finished dragging + if (this.state.drag.isDragging || (this.state.drag as any).wasRightDragging) { + (this.state.drag as any).wasRightDragging = false; + return; + } + + const { clientX, clientY } = event; + const rect = this.element?.getBoundingClientRect(); + const x = rect ? clientX - rect.left : clientX; + const y = rect ? clientY - rect.top : clientY; + + this.emit('contextMenu', { + type: 'contextMenu', + x, + y, + button: 2, + originalEvent: event, + }); + } + + private handleMouseLeave(_event: MouseEvent): void { + // Don't reset drag state on leave - we track via window events + } + + // ============================================ + // Event Emission + // ============================================ + + private emit(type: MouseEventType, data: MouseEventData): void { + const callbacks = this.callbacks.get(type); + if (callbacks) { + for (const callback of callbacks) { + callback(data); + } + } + } + + // ============================================ + // Callback Management + // ============================================ + + /** + * Register a callback for a specific mouse event type + */ + on(type: MouseEventType, callback: MouseEventCallback): () => void { + if (!this.callbacks.has(type)) { + this.callbacks.set(type, new Set()); + } + this.callbacks.get(type)!.add(callback); + return () => this.off(type, callback); + } + + /** + * Remove a callback for a specific mouse event type + */ + off(type: MouseEventType, callback: MouseEventCallback): void { + this.callbacks.get(type)?.delete(callback); + } + + /** + * Remove all callbacks for a specific event type + */ + offAll(type?: MouseEventType): void { + if (type) { + this.callbacks.delete(type); + } else { + this.callbacks.clear(); + } + } + + // ============================================ + // State Queries + // ============================================ + + /** + * Get current mouse position relative to attached element + */ + getPosition(): MousePosition { + return { ...this.state.position }; + } + + /** + * Check if left mouse button is down + */ + isLeftButtonDown(): boolean { + return this.state.isLeftButtonDown; + } + + /** + * Check if middle mouse button is down + */ + isMiddleButtonDown(): boolean { + return this.state.isMiddleButtonDown; + } + + /** + * Check if right mouse button is down + */ + isRightButtonDown(): boolean { + return this.state.isRightButtonDown; + } + + /** + * Check if currently dragging + */ + isDragging(): boolean { + return this.state.drag.isDragging; + } + + /** + * Get current drag state + */ + getDragState(): Readonly { + return { ...this.state.drag }; + } + + /** + * Get full mouse state + */ + getState(): Readonly { + return { + ...this.state, + position: { ...this.state.position }, + drag: { ...this.state.drag }, + }; + } +} + +// ============================================ +// Singleton Instance +// ============================================ + +let mouseHandlerInstance: MouseHandler | null = null; + +export function getMouseHandler(): MouseHandler { + if (!mouseHandlerInstance) { + mouseHandlerInstance = new MouseHandler(); + } + return mouseHandlerInstance; +} + +export function resetMouseHandler(): void { + if (mouseHandlerInstance) { + mouseHandlerInstance.detach(); + mouseHandlerInstance = null; + } +} diff --git a/src/core/renderer/index.ts b/src/core/renderer/index.ts new file mode 100644 index 0000000..29752fa --- /dev/null +++ b/src/core/renderer/index.ts @@ -0,0 +1,818 @@ +// WebGPU Renderer - Main entry point +import type { ViewTransform, RenderElement } from '../../types'; +import { ErrorType, type AppError } from '../../types'; +import { + createRenderPipeline, + createUniformBuffer, + createBindGroup, + createOrthographicMatrix, + createModelMatrix, + createBorderPipeline, + createBorderColorBuffer, + createBorderBindGroup, + createFillPipeline, + createFillColorBuffer, + createFillBindGroup, + type RenderPipeline, + type BorderPipeline, + type FillPipeline, +} from './pipeline'; +import { + vertexShaderCode, + fragmentShaderCode, + borderVertexShaderCode, + borderFragmentShaderCode, + fillVertexShaderCode, + fillFragmentShaderCode, +} from './shaders'; +import { TextureManager } from './texture'; + +export interface RendererConfig { + canvas: HTMLCanvasElement; +} + +export class Renderer { + private canvas: HTMLCanvasElement | null = null; + private device: GPUDevice | null = null; + private context: GPUCanvasContext | null = null; + private format: GPUTextureFormat = 'bgra8unorm'; + private pipeline: RenderPipeline | null = null; + private borderPipeline: BorderPipeline | null = null; + private fillPipeline: FillPipeline | null = null; + private textureManager: TextureManager | null = null; + + // Vertex buffer for quad rendering + private quadVertexBuffer: GPUBuffer | null = null; + private quadIndexBuffer: GPUBuffer | null = null; + + // Vertex buffer for border rendering (line list) + private borderVertexBuffer: GPUBuffer | null = null; + + // Border color buffer + private borderColorBuffer: GPUBuffer | null = null; + + // Fill color buffer for background + private fillColorBuffer: GPUBuffer | null = null; + + // Background color for elements area (#1D1D1D) + private elementsBackgroundColor = new Float32Array([0.114, 0.114, 0.114, 1.0]); + + // Uniform buffer pool for element rendering + private uniformBuffers: GPUBuffer[] = []; + private uniformBufferIndex = 0; + + // Selection border color (cyan) + private selectionBorderColor = new Float32Array([0.0, 0.8, 1.0, 1.0]); + + // View transform + private viewTransform: ViewTransform = { + scale: 1, + translateX: 0, + translateY: 0, + }; + + // Render state + private elements: Map = new Map(); + private isInitialized = false; + private animationFrameId: number | null = null; + private needsRender = true; + + // Pending resize state (to avoid flickering) + private pendingResize: { width: number; height: number } | null = null; + + // Callbacks + private onError: ((error: AppError) => void) | null = null; + + /** + * Check if WebGPU is supported + */ + static async isSupported(): Promise { + if (!navigator.gpu) { + return false; + } + const adapter = await navigator.gpu.requestAdapter(); + return adapter !== null; + } + + + /** + * Initialize the WebGPU renderer + */ + async init(canvas: HTMLCanvasElement): Promise { + this.canvas = canvas; + + // Check WebGPU support + if (!navigator.gpu) { + this.emitError({ + type: ErrorType.WEBGPU_NOT_SUPPORTED, + message: 'WebGPU is not supported. Please update your browser or graphics driver.', + }); + throw new Error('WebGPU not supported'); + } + + // Request adapter + const adapter = await navigator.gpu.requestAdapter({ + powerPreference: 'high-performance', + }); + + if (!adapter) { + this.emitError({ + type: ErrorType.WEBGPU_NOT_SUPPORTED, + message: 'Failed to get WebGPU adapter. Please check your graphics driver.', + }); + throw new Error('Failed to get WebGPU adapter'); + } + + // Request device + this.device = await adapter.requestDevice({ + label: 'RefVroid Device', + }); + + // Handle device errors + this.device.onuncapturederror = (event) => { + console.error('WebGPU uncaptured error:', event.error); + }; + + // Get canvas context + this.context = canvas.getContext('webgpu'); + if (!this.context) { + throw new Error('Failed to get WebGPU context'); + } + + // Get preferred format + this.format = navigator.gpu.getPreferredCanvasFormat(); + + // Configure context + this.context.configure({ + device: this.device, + format: this.format, + alphaMode: 'premultiplied', + }); + + // Create render pipeline + this.pipeline = createRenderPipeline( + { device: this.device, format: this.format }, + vertexShaderCode, + fragmentShaderCode + ); + + // Create border pipeline for selection borders + this.borderPipeline = createBorderPipeline( + { device: this.device, format: this.format }, + borderVertexShaderCode, + borderFragmentShaderCode + ); + + // Create fill pipeline for background rectangles + this.fillPipeline = createFillPipeline( + { device: this.device, format: this.format }, + fillVertexShaderCode, + fillFragmentShaderCode + ); + + // Create texture manager + this.textureManager = new TextureManager(this.device); + + // Create quad geometry buffers + this.createQuadBuffers(); + + // Create border geometry buffers + this.createBorderBuffers(); + + // Create fill color buffer + this.createFillBuffers(); + + this.isInitialized = true; + console.log('WebGPU Renderer initialized'); + } + + /** + * Create vertex and index buffers for quad rendering + */ + private createQuadBuffers(): void { + if (!this.device) return; + + // Quad vertices: position (x, y) + texCoord (u, v) + // Centered at origin, size 1x1 + // Note: texCoord Y is NOT flipped here because the orthographic matrix already flips Y + const vertices = new Float32Array([ + // Position // TexCoord + -0.5, -0.5, 0.0, 0.0, // Bottom-left -> texture top-left + 0.5, -0.5, 1.0, 0.0, // Bottom-right -> texture top-right + 0.5, 0.5, 1.0, 1.0, // Top-right -> texture bottom-right + -0.5, 0.5, 0.0, 1.0, // Top-left -> texture bottom-left + ]); + + this.quadVertexBuffer = this.device.createBuffer({ + label: 'Quad Vertex Buffer', + size: vertices.byteLength, + usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST, + }); + this.device.queue.writeBuffer(this.quadVertexBuffer, 0, vertices); + + // Quad indices (two triangles) + const indices = new Uint16Array([ + 0, 1, 2, // First triangle + 0, 2, 3, // Second triangle + ]); + + this.quadIndexBuffer = this.device.createBuffer({ + label: 'Quad Index Buffer', + size: indices.byteLength, + usage: GPUBufferUsage.INDEX | GPUBufferUsage.COPY_DST, + }); + this.device.queue.writeBuffer(this.quadIndexBuffer, 0, indices); + } + + /** + * Create vertex buffer for border rendering (line list) + */ + private createBorderBuffers(): void { + if (!this.device) return; + + // Border vertices: 4 lines forming a rectangle (8 vertices for line-list) + // Centered at origin, size 1x1 + const borderVertices = new Float32Array([ + // Line 1: Bottom (left to right) + -0.5, -0.5, + 0.5, -0.5, + // Line 2: Right (bottom to top) + 0.5, -0.5, + 0.5, 0.5, + // Line 3: Top (right to left) + 0.5, 0.5, + -0.5, 0.5, + // Line 4: Left (top to bottom) + -0.5, 0.5, + -0.5, -0.5, + ]); + + this.borderVertexBuffer = this.device.createBuffer({ + label: 'Border Vertex Buffer', + size: borderVertices.byteLength, + usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST, + }); + this.device.queue.writeBuffer(this.borderVertexBuffer, 0, borderVertices); + + // Create border color buffer + this.borderColorBuffer = createBorderColorBuffer(this.device); + this.device.queue.writeBuffer(this.borderColorBuffer, 0, this.selectionBorderColor.buffer); + } + + /** + * Create fill color buffer for background rendering + */ + private createFillBuffers(): void { + if (!this.device) return; + + this.fillColorBuffer = createFillColorBuffer(this.device); + this.device.queue.writeBuffer(this.fillColorBuffer, 0, this.elementsBackgroundColor.buffer); + } + + /** + * Get or create a uniform buffer from the pool + */ + private getUniformBuffer(): GPUBuffer { + if (!this.device) throw new Error('Device not initialized'); + + if (this.uniformBufferIndex >= this.uniformBuffers.length) { + const buffer = createUniformBuffer(this.device); + this.uniformBuffers.push(buffer); + } + + return this.uniformBuffers[this.uniformBufferIndex++]; + } + + /** + * Start the render loop + */ + startRenderLoop(): void { + if (this.animationFrameId !== null) return; + + const renderFrame = () => { + if (this.needsRender) { + this.render(); + this.needsRender = false; + } + this.animationFrameId = requestAnimationFrame(renderFrame); + }; + + this.animationFrameId = requestAnimationFrame(renderFrame); + } + + /** + * Stop the render loop + */ + stopRenderLoop(): void { + if (this.animationFrameId !== null) { + cancelAnimationFrame(this.animationFrameId); + this.animationFrameId = null; + } + } + + /** + * Request a render on the next frame + */ + requestRender(): void { + this.needsRender = true; + } + + /** + * Main render function + */ + render(): void { + if (!this.isInitialized || !this.device || !this.context || !this.pipeline) { + return; + } + + // Handle pending resize before rendering + if (this.pendingResize) { + const { width, height } = this.pendingResize; + this.pendingResize = null; + + if (this.canvas && (this.canvas.width !== width || this.canvas.height !== height)) { + this.canvas.width = width; + this.canvas.height = height; + + // Reconfigure context + this.context.configure({ + device: this.device, + format: this.format, + alphaMode: 'premultiplied', + }); + } + } + + // Reset uniform buffer pool index + this.uniformBufferIndex = 0; + + // Get current texture to render to + const currentTexture = this.context.getCurrentTexture(); + const textureView = currentTexture.createView(); + + // Create command encoder + const commandEncoder = this.device.createCommandEncoder({ + label: 'Render Command Encoder', + }); + + // Begin render pass + const renderPass = commandEncoder.beginRenderPass({ + label: 'Main Render Pass', + colorAttachments: [ + { + view: textureView, + clearValue: { r: 0.098, g: 0.098, b: 0.098, a: 1.0 }, // #191919 + loadOp: 'clear', + storeOp: 'store', + }, + ], + }); + + // Set pipeline and vertex/index buffers + renderPass.setPipeline(this.pipeline.pipeline); + renderPass.setVertexBuffer(0, this.quadVertexBuffer!); + renderPass.setIndexBuffer(this.quadIndexBuffer!, 'uint16'); + + // Calculate view projection matrix + const viewProjection = createOrthographicMatrix( + this.canvas!.width, + this.canvas!.height, + this.viewTransform + ); + + // Sort elements by zIndex for proper layering + const sortedElements = Array.from(this.elements.values()).sort( + (a, b) => a.zIndex - b.zIndex + ); + + // Render elements background area if there are elements + if (sortedElements.length > 0) { + this.renderElementsBackground(renderPass, sortedElements, viewProjection); + } + + // Render each element + for (const element of sortedElements) { + this.renderElement(renderPass, element, viewProjection); + } + + // Render selection borders for selected elements + this.renderSelectionBorders(renderPass, sortedElements, viewProjection); + + // End render pass + renderPass.end(); + + // Submit commands + this.device.queue.submit([commandEncoder.finish()]); + } + + + /** + * Render background area for all elements + */ + private renderElementsBackground( + renderPass: GPURenderPassEncoder, + elements: RenderElement[], + viewProjection: Float32Array + ): void { + if (!this.device || !this.fillPipeline || !this.fillColorBuffer) return; + if (elements.length === 0) return; + + // Calculate bounding box of all elements + let minX = Infinity; + let minY = Infinity; + let maxX = -Infinity; + let maxY = -Infinity; + + for (const element of elements) { + minX = Math.min(minX, element.x); + minY = Math.min(minY, element.y); + maxX = Math.max(maxX, element.x + element.width); + maxY = Math.max(maxY, element.y + element.height); + } + + const padding = 10; // Add some padding around elements + const bgX = minX - padding; + const bgY = minY - padding; + const bgWidth = maxX - minX + padding * 2; + const bgHeight = maxY - minY + padding * 2; + + // Switch to fill pipeline + renderPass.setPipeline(this.fillPipeline.pipeline); + renderPass.setVertexBuffer(0, this.quadVertexBuffer!); + renderPass.setIndexBuffer(this.quadIndexBuffer!, 'uint16'); + + // Get uniform buffer + const uniformBuffer = this.getUniformBuffer(); + + // Create model matrix for background + const modelMatrix = createModelMatrix(bgX, bgY, bgWidth, bgHeight, 0); + + // Write matrices to uniform buffer + this.device.queue.writeBuffer(uniformBuffer, 0, viewProjection.buffer); + this.device.queue.writeBuffer(uniformBuffer, 64, modelMatrix.buffer); + + // Create bind group for fill + const bindGroup = createFillBindGroup( + this.device, + this.fillPipeline.bindGroupLayout, + uniformBuffer, + this.fillColorBuffer + ); + + // Draw background + renderPass.setBindGroup(0, bindGroup); + renderPass.drawIndexed(6); + + // Switch back to main pipeline for element rendering + renderPass.setPipeline(this.pipeline!.pipeline); + } + + /** + * Render a single element + */ + private renderElement( + renderPass: GPURenderPassEncoder, + element: RenderElement, + viewProjection: Float32Array + ): void { + if (!this.device || !this.pipeline) return; + + // Get uniform buffer + const uniformBuffer = this.getUniformBuffer(); + + // Create model matrix + const modelMatrix = createModelMatrix( + element.x, + element.y, + element.width, + element.height, + element.rotation + ); + + // Write matrices to uniform buffer + this.device.queue.writeBuffer(uniformBuffer, 0, viewProjection.buffer); + this.device.queue.writeBuffer(uniformBuffer, 64, modelMatrix.buffer); + + // Create bind group for this element + const bindGroup = createBindGroup( + this.device, + this.pipeline.bindGroupLayout, + uniformBuffer, + this.pipeline.sampler, + element.texture + ); + + // Draw + renderPass.setBindGroup(0, bindGroup); + renderPass.drawIndexed(6); // 6 indices for 2 triangles + } + + /** + * Render selection borders for selected elements + */ + private renderSelectionBorders( + renderPass: GPURenderPassEncoder, + elements: RenderElement[], + viewProjection: Float32Array + ): void { + if (!this.device || !this.borderPipeline || !this.borderVertexBuffer || !this.borderColorBuffer) { + return; + } + + // Filter selected elements + const selectedElements = elements.filter((e) => e.selected); + if (selectedElements.length === 0) return; + + // Switch to border pipeline + renderPass.setPipeline(this.borderPipeline.pipeline); + renderPass.setVertexBuffer(0, this.borderVertexBuffer); + + // Render border for each selected element + for (const element of selectedElements) { + this.renderElementBorder(renderPass, element, viewProjection); + } + + // Render group bounding box if multiple elements selected + if (selectedElements.length > 1) { + this.renderGroupBorder(renderPass, selectedElements, viewProjection); + } + } + + /** + * Render group bounding box for multiple selected elements + */ + private renderGroupBorder( + renderPass: GPURenderPassEncoder, + elements: RenderElement[], + viewProjection: Float32Array + ): void { + if (!this.device || !this.borderPipeline || !this.borderColorBuffer) return; + + // Calculate bounding box of all selected elements + let minX = Infinity; + let minY = Infinity; + let maxX = -Infinity; + let maxY = -Infinity; + + for (const element of elements) { + minX = Math.min(minX, element.x); + minY = Math.min(minY, element.y); + maxX = Math.max(maxX, element.x + element.width); + maxY = Math.max(maxY, element.y + element.height); + } + + const groupWidth = maxX - minX; + const groupHeight = maxY - minY; + + // Get uniform buffer + const uniformBuffer = this.getUniformBuffer(); + + // Create model matrix for group border with padding + const borderPadding = 4; // Slightly larger padding for group border + const modelMatrix = createModelMatrix( + minX - borderPadding, + minY - borderPadding, + groupWidth + borderPadding * 2, + groupHeight + borderPadding * 2, + 0 + ); + + // Write matrices to uniform buffer + this.device.queue.writeBuffer(uniformBuffer, 0, viewProjection.buffer); + this.device.queue.writeBuffer(uniformBuffer, 64, modelMatrix.buffer); + + // Create bind group for border + const bindGroup = createBorderBindGroup( + this.device, + this.borderPipeline.bindGroupLayout, + uniformBuffer, + this.borderColorBuffer + ); + + // Draw group border + renderPass.setBindGroup(0, bindGroup); + renderPass.draw(8); + } + + /** + * Render border for a single element + */ + private renderElementBorder( + renderPass: GPURenderPassEncoder, + element: RenderElement, + viewProjection: Float32Array + ): void { + if (!this.device || !this.borderPipeline || !this.borderColorBuffer) return; + + // Get uniform buffer + const uniformBuffer = this.getUniformBuffer(); + + // Create model matrix with slight expansion for border visibility + const borderPadding = 2; // pixels + const modelMatrix = createModelMatrix( + element.x - borderPadding, + element.y - borderPadding, + element.width + borderPadding * 2, + element.height + borderPadding * 2, + element.rotation + ); + + // Write matrices to uniform buffer + this.device.queue.writeBuffer(uniformBuffer, 0, viewProjection.buffer); + this.device.queue.writeBuffer(uniformBuffer, 64, modelMatrix.buffer); + + // Create bind group for border + const bindGroup = createBorderBindGroup( + this.device, + this.borderPipeline.bindGroupLayout, + uniformBuffer, + this.borderColorBuffer + ); + + // Draw border (8 vertices = 4 lines) + renderPass.setBindGroup(0, bindGroup); + renderPass.draw(8); + } + + /** + * Set selection border color + */ + setSelectionBorderColor(r: number, g: number, b: number, a: number = 1.0): void { + this.selectionBorderColor[0] = r; + this.selectionBorderColor[1] = g; + this.selectionBorderColor[2] = b; + this.selectionBorderColor[3] = a; + + if (this.device && this.borderColorBuffer) { + this.device.queue.writeBuffer(this.borderColorBuffer, 0, this.selectionBorderColor.buffer); + } + this.requestRender(); + } + + /** + * Add an element to render + */ + addElement(element: RenderElement): void { + this.elements.set(element.id, element); + this.requestRender(); + } + + /** + * Remove an element + */ + removeElement(id: string): void { + const element = this.elements.get(id); + if (element) { + // Texture cleanup is handled by TextureManager + this.elements.delete(id); + this.requestRender(); + } + } + + /** + * Update an element's properties + */ + updateElement(id: string, props: Partial): void { + const element = this.elements.get(id); + if (element) { + Object.assign(element, props); + this.requestRender(); + } + } + + /** + * Get an element by ID + */ + getElement(id: string): RenderElement | undefined { + return this.elements.get(id); + } + + /** + * Get all elements + */ + getAllElements(): RenderElement[] { + return Array.from(this.elements.values()); + } + + /** + * Clear all elements + */ + clearElements(): void { + this.elements.clear(); + this.requestRender(); + } + + /** + * Set view transform (scale and translation) + */ + setViewTransform(transform: Partial): void { + Object.assign(this.viewTransform, transform); + this.requestRender(); + } + + /** + * Get current view transform + */ + getViewTransform(): ViewTransform { + return { ...this.viewTransform }; + } + + /** + * Get the texture manager + */ + getTextureManager(): TextureManager | null { + return this.textureManager; + } + + /** + * Get the GPU device + */ + getDevice(): GPUDevice | null { + return this.device; + } + + /** + * Resize the canvas + * Note: Actual resize is deferred to render() to avoid flickering + */ + resize(width: number, height: number): void { + if (!this.canvas || !this.context || !this.device) return; + + // Only schedule resize if dimensions actually changed + if (this.canvas.width !== width || this.canvas.height !== height) { + this.pendingResize = { width, height }; + this.requestRender(); + } + } + + /** + * Set error callback + */ + setOnError(callback: (error: AppError) => void): void { + this.onError = callback; + } + + /** + * Emit an error + */ + private emitError(error: AppError): void { + console.error('Renderer error:', error); + if (this.onError) { + this.onError(error); + } + } + + /** + * Check if renderer is initialized + */ + isReady(): boolean { + return this.isInitialized; + } + + /** + * Destroy the renderer and release resources + */ + destroy(): void { + this.stopRenderLoop(); + + // Destroy texture manager + if (this.textureManager) { + this.textureManager.destroyAll(); + this.textureManager = null; + } + + // Destroy buffers + this.quadVertexBuffer?.destroy(); + this.quadIndexBuffer?.destroy(); + this.borderVertexBuffer?.destroy(); + this.borderColorBuffer?.destroy(); + this.fillColorBuffer?.destroy(); + for (const buffer of this.uniformBuffers) { + buffer.destroy(); + } + + this.quadVertexBuffer = null; + this.quadIndexBuffer = null; + this.borderVertexBuffer = null; + this.borderColorBuffer = null; + this.fillColorBuffer = null; + this.uniformBuffers = []; + + // Clear elements + this.elements.clear(); + + // Clear references + this.device = null; + this.context = null; + this.pipeline = null; + this.borderPipeline = null; + this.fillPipeline = null; + this.canvas = null; + + this.isInitialized = false; + console.log('WebGPU Renderer destroyed'); + } +} + +// Export singleton instance for convenience +export const renderer = new Renderer(); diff --git a/src/core/renderer/pipeline.ts b/src/core/renderer/pipeline.ts new file mode 100644 index 0000000..67f10fe --- /dev/null +++ b/src/core/renderer/pipeline.ts @@ -0,0 +1,554 @@ +// WebGPU Render Pipeline configuration +import type { ViewTransform } from '../../types'; + +export interface RenderPipelineConfig { + device: GPUDevice; + format: GPUTextureFormat; +} + +export interface RenderPipeline { + device: GPUDevice; + pipeline: GPURenderPipeline; + bindGroupLayout: GPUBindGroupLayout; + sampler: GPUSampler; +} + +/** + * Creates the WebGPU render pipeline for rendering textured quads + */ +export function createRenderPipeline( + config: RenderPipelineConfig, + vertexShaderCode: string, + fragmentShaderCode: string +): RenderPipeline { + const { device, format } = config; + + // Create shader modules + const vertexModule = device.createShaderModule({ + label: 'Vertex Shader', + code: vertexShaderCode, + }); + + const fragmentModule = device.createShaderModule({ + label: 'Fragment Shader', + code: fragmentShaderCode, + }); + + // Create bind group layout for uniforms and textures + const bindGroupLayout = device.createBindGroupLayout({ + label: 'Render Bind Group Layout', + entries: [ + { + // Uniform buffer for view and model matrices + binding: 0, + visibility: GPUShaderStage.VERTEX, + buffer: { type: 'uniform' }, + }, + { + // Texture sampler + binding: 1, + visibility: GPUShaderStage.FRAGMENT, + sampler: { type: 'filtering' }, + }, + { + // Texture + binding: 2, + visibility: GPUShaderStage.FRAGMENT, + texture: { sampleType: 'float' }, + }, + ], + }); + + + // Create pipeline layout + const pipelineLayout = device.createPipelineLayout({ + label: 'Render Pipeline Layout', + bindGroupLayouts: [bindGroupLayout], + }); + + // Create render pipeline + const pipeline = device.createRenderPipeline({ + label: 'Main Render Pipeline', + layout: pipelineLayout, + vertex: { + module: vertexModule, + entryPoint: 'main', + buffers: [ + { + // Vertex buffer layout: position (vec2) + texCoord (vec2) + arrayStride: 4 * 4, // 4 floats * 4 bytes + attributes: [ + { + // Position + shaderLocation: 0, + offset: 0, + format: 'float32x2', + }, + { + // Texture coordinates + shaderLocation: 1, + offset: 2 * 4, // 2 floats offset + format: 'float32x2', + }, + ], + }, + ], + }, + fragment: { + module: fragmentModule, + entryPoint: 'main', + targets: [ + { + format, + blend: { + // Enable alpha blending for transparency + color: { + srcFactor: 'src-alpha', + dstFactor: 'one-minus-src-alpha', + operation: 'add', + }, + alpha: { + srcFactor: 'one', + dstFactor: 'one-minus-src-alpha', + operation: 'add', + }, + }, + }, + ], + }, + primitive: { + topology: 'triangle-list', + cullMode: 'none', + }, + }); + + // Create texture sampler + const sampler = device.createSampler({ + label: 'Texture Sampler', + magFilter: 'linear', + minFilter: 'linear', + addressModeU: 'clamp-to-edge', + addressModeV: 'clamp-to-edge', + }); + + return { + device, + pipeline, + bindGroupLayout, + sampler, + }; +} + +/** + * Creates a uniform buffer for view and model matrices + * Layout: viewProjection (mat4x4) + model (mat4x4) = 128 bytes + */ +export function createUniformBuffer(device: GPUDevice): GPUBuffer { + return device.createBuffer({ + label: 'Uniform Buffer', + size: 128, // 2 * mat4x4 (64 bytes each) + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + }); +} + +/** + * Creates a bind group for rendering an element + */ +export function createBindGroup( + device: GPUDevice, + layout: GPUBindGroupLayout, + uniformBuffer: GPUBuffer, + sampler: GPUSampler, + texture: GPUTexture +): GPUBindGroup { + return device.createBindGroup({ + label: 'Element Bind Group', + layout, + entries: [ + { binding: 0, resource: { buffer: uniformBuffer } }, + { binding: 1, resource: sampler }, + { binding: 2, resource: texture.createView() }, + ], + }); +} + +/** + * Creates an orthographic projection matrix for 2D rendering + * + * The transformation pipeline is: + * 1. World coordinates -> Screen coordinates: screenPos = worldPos * scale + translate + * 2. Screen coordinates -> Clip space: clipPos = (screenPos / canvasSize) * 2 - 1 + * + * Combined: clipX = (worldX * scale + translateX) * (2/width) - 1 + * clipY = -((worldY * scale + translateY) * (2/height) - 1) // Y flipped + */ +export function createOrthographicMatrix( + width: number, + height: number, + transform: ViewTransform +): Float32Array { + const { scale, translateX, translateY } = transform; + + const matrix = new Float32Array(16); + + // Scale factors: world to clip space + const sx = (2 * scale) / width; + const sy = (-2 * scale) / height; // Flip Y axis (screen Y goes down, clip Y goes up) + + // Translation: apply translate then convert to clip space + const tx = (2 * translateX) / width - 1; + const ty = 1 - (2 * translateY) / height; // Flipped Y + + // Column-major order for WebGPU + matrix[0] = sx; + matrix[1] = 0; + matrix[2] = 0; + matrix[3] = 0; + + matrix[4] = 0; + matrix[5] = sy; + matrix[6] = 0; + matrix[7] = 0; + + matrix[8] = 0; + matrix[9] = 0; + matrix[10] = 1; + matrix[11] = 0; + + matrix[12] = tx; + matrix[13] = ty; + matrix[14] = 0; + matrix[15] = 1; + + return matrix; +} + +/** + * Creates a model matrix for element transformation + */ +export function createModelMatrix( + x: number, + y: number, + width: number, + height: number, + rotation: number = 0 +): Float32Array { + const matrix = new Float32Array(16); + + const cos = Math.cos(rotation); + const sin = Math.sin(rotation); + + // Translation to center, then scale, then rotate, then translate to position + // Combined transformation matrix (column-major) + const cx = x + width / 2; + const cy = y + height / 2; + + matrix[0] = width * cos; + matrix[1] = width * sin; + matrix[2] = 0; + matrix[3] = 0; + + matrix[4] = -height * sin; + matrix[5] = height * cos; + matrix[6] = 0; + matrix[7] = 0; + + matrix[8] = 0; + matrix[9] = 0; + matrix[10] = 1; + matrix[11] = 0; + + matrix[12] = cx; + matrix[13] = cy; + matrix[14] = 0; + matrix[15] = 1; + + return matrix; +} + + +/** + * Border render pipeline for selection borders + */ +export interface BorderPipeline { + device: GPUDevice; + pipeline: GPURenderPipeline; + bindGroupLayout: GPUBindGroupLayout; +} + +/** + * Creates the border render pipeline for rendering selection borders + */ +export function createBorderPipeline( + config: RenderPipelineConfig, + vertexShaderCode: string, + fragmentShaderCode: string +): BorderPipeline { + const { device, format } = config; + + // Create shader modules + const vertexModule = device.createShaderModule({ + label: 'Border Vertex Shader', + code: vertexShaderCode, + }); + + const fragmentModule = device.createShaderModule({ + label: 'Border Fragment Shader', + code: fragmentShaderCode, + }); + + // Create bind group layout for uniforms + const bindGroupLayout = device.createBindGroupLayout({ + label: 'Border Bind Group Layout', + entries: [ + { + // Uniform buffer for view and model matrices + binding: 0, + visibility: GPUShaderStage.VERTEX, + buffer: { type: 'uniform' }, + }, + { + // Uniform buffer for border color + binding: 1, + visibility: GPUShaderStage.FRAGMENT, + buffer: { type: 'uniform' }, + }, + ], + }); + + // Create pipeline layout + const pipelineLayout = device.createPipelineLayout({ + label: 'Border Pipeline Layout', + bindGroupLayouts: [bindGroupLayout], + }); + + // Create render pipeline for line rendering + const pipeline = device.createRenderPipeline({ + label: 'Border Render Pipeline', + layout: pipelineLayout, + vertex: { + module: vertexModule, + entryPoint: 'main', + buffers: [ + { + // Vertex buffer layout: position (vec2) only + arrayStride: 2 * 4, // 2 floats * 4 bytes + attributes: [ + { + shaderLocation: 0, + offset: 0, + format: 'float32x2', + }, + ], + }, + ], + }, + fragment: { + module: fragmentModule, + entryPoint: 'main', + targets: [ + { + format, + blend: { + color: { + srcFactor: 'src-alpha', + dstFactor: 'one-minus-src-alpha', + operation: 'add', + }, + alpha: { + srcFactor: 'one', + dstFactor: 'one-minus-src-alpha', + operation: 'add', + }, + }, + }, + ], + }, + primitive: { + topology: 'line-list', + }, + }); + + return { + device, + pipeline, + bindGroupLayout, + }; +} + +/** + * Creates a uniform buffer for border color + * Layout: color (vec4) = 16 bytes + */ +export function createBorderColorBuffer(device: GPUDevice): GPUBuffer { + return device.createBuffer({ + label: 'Border Color Buffer', + size: 16, // vec4 (16 bytes) + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + }); +} + +/** + * Creates a bind group for border rendering + */ +export function createBorderBindGroup( + device: GPUDevice, + layout: GPUBindGroupLayout, + uniformBuffer: GPUBuffer, + colorBuffer: GPUBuffer +): GPUBindGroup { + return device.createBindGroup({ + label: 'Border Bind Group', + layout, + entries: [ + { binding: 0, resource: { buffer: uniformBuffer } }, + { binding: 1, resource: { buffer: colorBuffer } }, + ], + }); +} + + +/** + * Fill render pipeline for solid color rectangles + */ +export interface FillPipeline { + device: GPUDevice; + pipeline: GPURenderPipeline; + bindGroupLayout: GPUBindGroupLayout; +} + +/** + * Creates the fill render pipeline for rendering solid color rectangles + */ +export function createFillPipeline( + config: RenderPipelineConfig, + vertexShaderCode: string, + fragmentShaderCode: string +): FillPipeline { + const { device, format } = config; + + // Create shader modules + const vertexModule = device.createShaderModule({ + label: 'Fill Vertex Shader', + code: vertexShaderCode, + }); + + const fragmentModule = device.createShaderModule({ + label: 'Fill Fragment Shader', + code: fragmentShaderCode, + }); + + // Create bind group layout for uniforms + const bindGroupLayout = device.createBindGroupLayout({ + label: 'Fill Bind Group Layout', + entries: [ + { + // Uniform buffer for view and model matrices + binding: 0, + visibility: GPUShaderStage.VERTEX, + buffer: { type: 'uniform' }, + }, + { + // Uniform buffer for fill color + binding: 1, + visibility: GPUShaderStage.FRAGMENT, + buffer: { type: 'uniform' }, + }, + ], + }); + + // Create pipeline layout + const pipelineLayout = device.createPipelineLayout({ + label: 'Fill Pipeline Layout', + bindGroupLayouts: [bindGroupLayout], + }); + + // Create render pipeline for triangle rendering + const pipeline = device.createRenderPipeline({ + label: 'Fill Render Pipeline', + layout: pipelineLayout, + vertex: { + module: vertexModule, + entryPoint: 'main', + buffers: [ + { + // Vertex buffer layout: position (vec2) + texCoord (vec2) + arrayStride: 4 * 4, // 4 floats * 4 bytes + attributes: [ + { + shaderLocation: 0, + offset: 0, + format: 'float32x2', + }, + { + shaderLocation: 1, + offset: 2 * 4, + format: 'float32x2', + }, + ], + }, + ], + }, + fragment: { + module: fragmentModule, + entryPoint: 'main', + targets: [ + { + format, + blend: { + color: { + srcFactor: 'src-alpha', + dstFactor: 'one-minus-src-alpha', + operation: 'add', + }, + alpha: { + srcFactor: 'one', + dstFactor: 'one-minus-src-alpha', + operation: 'add', + }, + }, + }, + ], + }, + primitive: { + topology: 'triangle-list', + cullMode: 'none', + }, + }); + + return { + device, + pipeline, + bindGroupLayout, + }; +} + +/** + * Creates a uniform buffer for fill color + */ +export function createFillColorBuffer(device: GPUDevice): GPUBuffer { + return device.createBuffer({ + label: 'Fill Color Buffer', + size: 16, // vec4 (16 bytes) + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + }); +} + +/** + * Creates a bind group for fill rendering + */ +export function createFillBindGroup( + device: GPUDevice, + layout: GPUBindGroupLayout, + uniformBuffer: GPUBuffer, + colorBuffer: GPUBuffer +): GPUBindGroup { + return device.createBindGroup({ + label: 'Fill Bind Group', + layout, + entries: [ + { binding: 0, resource: { buffer: uniformBuffer } }, + { binding: 1, resource: { buffer: colorBuffer } }, + ], + }); +} diff --git a/src/core/renderer/shaders.ts b/src/core/renderer/shaders.ts new file mode 100644 index 0000000..0ceef70 --- /dev/null +++ b/src/core/renderer/shaders.ts @@ -0,0 +1,164 @@ +// WGSL Shader definitions for WebGPU rendering + +/** + * Vertex shader for rendering textured quads + * + * Uniforms: + * - viewProjection: mat4x4 - Combined view and projection matrix + * - model: mat4x4 - Model transformation matrix + * + * Inputs: + * - position: vec2 - Vertex position in local space + * - texCoord: vec2 - Texture coordinates + * + * Outputs: + * - position: vec4 - Clip space position + * - texCoord: vec2 - Interpolated texture coordinates + */ +export const vertexShaderCode = /* wgsl */ ` +struct VertexInput { + @location(0) position: vec2, + @location(1) texCoord: vec2, +} + +struct VertexOutput { + @builtin(position) position: vec4, + @location(0) texCoord: vec2, +} + +struct Uniforms { + viewProjection: mat4x4, + model: mat4x4, +} + +@group(0) @binding(0) var uniforms: Uniforms; + +@vertex +fn main(input: VertexInput) -> VertexOutput { + var output: VertexOutput; + + // Transform vertex position: model -> view -> projection + let worldPos = uniforms.model * vec4(input.position, 0.0, 1.0); + output.position = uniforms.viewProjection * worldPos; + + // Pass through texture coordinates + output.texCoord = input.texCoord; + + return output; +} +`; + +/** + * Fragment shader for texture sampling + * + * Inputs: + * - texCoord: vec2 - Interpolated texture coordinates + * + * Outputs: + * - color: vec4 - Final fragment color + */ +export const fragmentShaderCode = /* wgsl */ ` +@group(0) @binding(1) var textureSampler: sampler; +@group(0) @binding(2) var textureData: texture_2d; + +struct FragmentInput { + @location(0) texCoord: vec2, +} + +@fragment +fn main(input: FragmentInput) -> @location(0) vec4 { + return textureSample(textureData, textureSampler, input.texCoord); +} +`; + +/** + * Vertex shader for selection border rendering + * Uses line primitives to draw element borders + */ +export const borderVertexShaderCode = /* wgsl */ ` +struct VertexInput { + @location(0) position: vec2, +} + +struct VertexOutput { + @builtin(position) position: vec4, +} + +struct Uniforms { + viewProjection: mat4x4, + model: mat4x4, +} + +@group(0) @binding(0) var uniforms: Uniforms; + +@vertex +fn main(input: VertexInput) -> VertexOutput { + var output: VertexOutput; + let worldPos = uniforms.model * vec4(input.position, 0.0, 1.0); + output.position = uniforms.viewProjection * worldPos; + return output; +} +`; + +/** + * Fragment shader for selection border (solid color) + */ +export const borderFragmentShaderCode = /* wgsl */ ` +struct BorderUniforms { + color: vec4, +} + +@group(0) @binding(1) var borderUniforms: BorderUniforms; + +@fragment +fn main() -> @location(0) vec4 { + return borderUniforms.color; +} +`; + + +/** + * Vertex shader for solid color fill rendering + * Uses the same quad geometry as texture rendering + */ +export const fillVertexShaderCode = /* wgsl */ ` +struct VertexInput { + @location(0) position: vec2, + @location(1) texCoord: vec2, +} + +struct VertexOutput { + @builtin(position) position: vec4, +} + +struct Uniforms { + viewProjection: mat4x4, + model: mat4x4, +} + +@group(0) @binding(0) var uniforms: Uniforms; + +@vertex +fn main(input: VertexInput) -> VertexOutput { + var output: VertexOutput; + let worldPos = uniforms.model * vec4(input.position, 0.0, 1.0); + output.position = uniforms.viewProjection * worldPos; + return output; +} +`; + +/** + * Fragment shader for solid color fill + */ +export const fillFragmentShaderCode = /* wgsl */ ` +struct FillUniforms { + color: vec4, +} + +@group(0) @binding(1) var fillUniforms: FillUniforms; + +@fragment +fn main() -> @location(0) vec4 { + return fillUniforms.color; +} +`; diff --git a/src/core/renderer/texture.ts b/src/core/renderer/texture.ts new file mode 100644 index 0000000..7f45432 --- /dev/null +++ b/src/core/renderer/texture.ts @@ -0,0 +1,312 @@ +// Texture Manager for WebGPU +import type { AppError } from '../../types'; + +export interface TextureInfo { + texture: GPUTexture; + width: number; + height: number; + source: 'image' | 'video' | 'canvas'; +} + +/** + * Manages GPU textures for the WebGPU renderer + */ +export class TextureManager { + private device: GPUDevice; + private textures: Map = new Map(); + private onError: ((error: AppError) => void) | null = null; + private placeholderTexture: GPUTexture | null = null; + + constructor(device: GPUDevice) { + this.device = device; + this.createPlaceholderTexture(); + } + + /** + * Create a placeholder texture (1x1 gray pixel) + * Used when actual texture is not yet loaded + */ + private createPlaceholderTexture(): void { + this.placeholderTexture = this.device.createTexture({ + label: 'Placeholder Texture', + size: { width: 1, height: 1 }, + format: 'rgba8unorm', + usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST, + }); + + // Write a gray pixel + const data = new Uint8Array([128, 128, 128, 255]); + this.device.queue.writeTexture( + { texture: this.placeholderTexture }, + data, + { bytesPerRow: 4 }, + { width: 1, height: 1 } + ); + } + + /** + * Get the placeholder texture + */ + getPlaceholderTexture(): GPUTexture | null { + return this.placeholderTexture; + } + + /** + * Create a texture from an ImageBitmap + */ + createFromImage(id: string, image: ImageBitmap): GPUTexture { + const texture = this.device.createTexture({ + label: `Texture: ${id}`, + size: { + width: image.width, + height: image.height, + }, + format: 'rgba8unorm', + usage: + GPUTextureUsage.TEXTURE_BINDING | + GPUTextureUsage.COPY_DST | + GPUTextureUsage.RENDER_ATTACHMENT, + }); + + // Copy image data to texture + this.device.queue.copyExternalImageToTexture( + { source: image }, + { texture }, + { width: image.width, height: image.height } + ); + + // Store texture info + this.textures.set(id, { + texture, + width: image.width, + height: image.height, + source: 'image', + }); + + return texture; + } + + + /** + * Create a texture from an HTMLVideoElement + */ + createFromVideo(id: string, video: HTMLVideoElement): GPUTexture { + const texture = this.device.createTexture({ + label: `Video Texture: ${id}`, + size: { + width: video.videoWidth, + height: video.videoHeight, + }, + format: 'rgba8unorm', + usage: + GPUTextureUsage.TEXTURE_BINDING | + GPUTextureUsage.COPY_DST | + GPUTextureUsage.RENDER_ATTACHMENT, + }); + + // Copy current video frame to texture + this.device.queue.copyExternalImageToTexture( + { source: video }, + { texture }, + { width: video.videoWidth, height: video.videoHeight } + ); + + // Store texture info + this.textures.set(id, { + texture, + width: video.videoWidth, + height: video.videoHeight, + source: 'video', + }); + + return texture; + } + + /** + * Create a texture from an HTMLCanvasElement (for text rendering) + */ + createFromCanvas(id: string, canvas: HTMLCanvasElement): GPUTexture { + const texture = this.device.createTexture({ + label: `Canvas Texture: ${id}`, + size: { + width: canvas.width, + height: canvas.height, + }, + format: 'rgba8unorm', + usage: + GPUTextureUsage.TEXTURE_BINDING | + GPUTextureUsage.COPY_DST | + GPUTextureUsage.RENDER_ATTACHMENT, + }); + + // Copy canvas content to texture + this.device.queue.copyExternalImageToTexture( + { source: canvas }, + { texture }, + { width: canvas.width, height: canvas.height } + ); + + // Store texture info + this.textures.set(id, { + texture, + width: canvas.width, + height: canvas.height, + source: 'canvas', + }); + + return texture; + } + + /** + * Update an existing texture from a video frame + * Used for video playback to update texture each frame + */ + updateFromVideo(id: string, video: HTMLVideoElement): boolean { + const info = this.textures.get(id); + if (!info) { + console.warn(`Texture not found: ${id}`); + return false; + } + + // Check if video dimensions changed + if (info.width !== video.videoWidth || info.height !== video.videoHeight) { + // Recreate texture with new dimensions + this.destroy(id); + this.createFromVideo(id, video); + return true; + } + + // Update existing texture + this.device.queue.copyExternalImageToTexture( + { source: video }, + { texture: info.texture }, + { width: video.videoWidth, height: video.videoHeight } + ); + + return true; + } + + /** + * Update an existing texture from an ImageBitmap + * Used for GIF animation frame updates + */ + updateFromImage(id: string, image: ImageBitmap): boolean { + const info = this.textures.get(id); + if (!info) { + console.warn(`Texture not found: ${id}`); + return false; + } + + // Check if dimensions changed + if (info.width !== image.width || info.height !== image.height) { + // Recreate texture with new dimensions + this.destroy(id); + this.createFromImage(id, image); + return true; + } + + // Update existing texture + this.device.queue.copyExternalImageToTexture( + { source: image }, + { texture: info.texture }, + { width: image.width, height: image.height } + ); + + return true; + } + + /** + * Update an existing texture from a canvas + * Used for text content updates + */ + updateFromCanvas(id: string, canvas: HTMLCanvasElement): boolean { + const info = this.textures.get(id); + if (!info) { + console.warn(`Texture not found: ${id}`); + return false; + } + + // Check if dimensions changed + if (info.width !== canvas.width || info.height !== canvas.height) { + // Recreate texture with new dimensions + this.destroy(id); + this.createFromCanvas(id, canvas); + return true; + } + + // Update existing texture + this.device.queue.copyExternalImageToTexture( + { source: canvas }, + { texture: info.texture }, + { width: canvas.width, height: canvas.height } + ); + + return true; + } + + /** + * Get texture info by ID + */ + getTextureInfo(id: string): TextureInfo | undefined { + return this.textures.get(id); + } + + /** + * Get texture by ID + */ + getTexture(id: string): GPUTexture | undefined { + return this.textures.get(id)?.texture; + } + + /** + * Check if a texture exists + */ + hasTexture(id: string): boolean { + return this.textures.has(id); + } + + /** + * Destroy a specific texture + */ + destroy(id: string): void { + const info = this.textures.get(id); + if (info) { + info.texture.destroy(); + this.textures.delete(id); + } + } + + /** + * Destroy all textures + */ + destroyAll(): void { + for (const [, info] of this.textures) { + info.texture.destroy(); + } + this.textures.clear(); + } + + /** + * Get the number of managed textures + */ + get count(): number { + return this.textures.size; + } + + /** + * Set error callback + */ + setOnError(callback: (error: AppError) => void): void { + this.onError = callback; + } + + /** + * Emit an error + */ + private emitError(error: AppError): void { + console.error('TextureManager error:', error); + if (this.onError) { + this.onError(error); + } + } +} diff --git a/src/core/scene/element.ts b/src/core/scene/element.ts new file mode 100644 index 0000000..9b88f44 --- /dev/null +++ b/src/core/scene/element.ts @@ -0,0 +1,519 @@ +/** + * Media Element Model + * Defines the MediaElement class for managing canvas elements + */ + +import type { + ElementType, + ElementData, + MediaElement as IMediaElement, + ImageData, + GifData, + VideoData, + TextData, + YouTubeData, +} from '../../types'; + +// ============================================ +// ID Generation +// ============================================ + +let elementIdCounter = 0; + +/** + * Generate a unique element ID + */ +export function generateElementId(): string { + return `element_${Date.now()}_${++elementIdCounter}`; +} + +/** + * Reset the ID counter (useful for testing) + */ +export function resetElementIdCounter(): void { + elementIdCounter = 0; +} + +// ============================================ +// Bounding Box +// ============================================ + +export interface BoundingBox { + x: number; + y: number; + width: number; + height: number; + // Corners for rotation support + topLeft: { x: number; y: number }; + topRight: { x: number; y: number }; + bottomLeft: { x: number; y: number }; + bottomRight: { x: number; y: number }; +} + +/** + * Calculate bounding box for an element + * Supports rotation by computing rotated corners + */ +export function calculateBoundingBox(element: IMediaElement): BoundingBox { + const { x, y, width, height, rotation } = element; + + // Center of the element + const cx = x + width / 2; + const cy = y + height / 2; + + // Half dimensions + const hw = width / 2; + const hh = height / 2; + + // Convert rotation to radians + const rad = (rotation * Math.PI) / 180; + const cos = Math.cos(rad); + const sin = Math.sin(rad); + + // Calculate rotated corners + const corners = [ + { dx: -hw, dy: -hh }, // top-left + { dx: hw, dy: -hh }, // top-right + { dx: -hw, dy: hh }, // bottom-left + { dx: hw, dy: hh }, // bottom-right + ].map(({ dx, dy }) => ({ + x: cx + dx * cos - dy * sin, + y: cy + dx * sin + dy * cos, + })); + + // Find axis-aligned bounding box + const xs = corners.map(c => c.x); + const ys = corners.map(c => c.y); + const minX = Math.min(...xs); + const maxX = Math.max(...xs); + const minY = Math.min(...ys); + const maxY = Math.max(...ys); + + return { + x: minX, + y: minY, + width: maxX - minX, + height: maxY - minY, + topLeft: corners[0], + topRight: corners[1], + bottomLeft: corners[2], + bottomRight: corners[3], + }; +} + +// ============================================ +// Collision Detection +// ============================================ + +/** + * Check if a point is inside an element's bounding box + * Uses rotation-aware detection + */ +export function isPointInElement( + px: number, + py: number, + element: IMediaElement +): boolean { + const { x, y, width, height, rotation } = element; + + // Center of the element + const cx = x + width / 2; + const cy = y + height / 2; + + // Convert rotation to radians (negative to reverse transform) + const rad = (-rotation * Math.PI) / 180; + const cos = Math.cos(rad); + const sin = Math.sin(rad); + + // Transform point to element's local coordinate system + const dx = px - cx; + const dy = py - cy; + const localX = dx * cos - dy * sin; + const localY = dx * sin + dy * cos; + + // Check if point is within half-dimensions + return Math.abs(localX) <= width / 2 && Math.abs(localY) <= height / 2; +} + +/** + * Check if two elements' bounding boxes intersect + * Uses axis-aligned bounding box for simplicity + */ +export function doElementsIntersect( + element1: IMediaElement, + element2: IMediaElement +): boolean { + const box1 = calculateBoundingBox(element1); + const box2 = calculateBoundingBox(element2); + + return !( + box1.x + box1.width < box2.x || + box2.x + box2.width < box1.x || + box1.y + box1.height < box2.y || + box2.y + box2.height < box1.y + ); +} + +/** + * Check if an element intersects with a selection rectangle + */ +export function doesElementIntersectRect( + element: IMediaElement, + rectX: number, + rectY: number, + rectWidth: number, + rectHeight: number +): boolean { + const box = calculateBoundingBox(element); + + // Normalize rect (handle negative width/height from drag direction) + const rx = rectWidth < 0 ? rectX + rectWidth : rectX; + const ry = rectHeight < 0 ? rectY + rectHeight : rectY; + const rw = Math.abs(rectWidth); + const rh = Math.abs(rectHeight); + + // Check for intersection (two rectangles intersect if they overlap on both axes) + // Two rectangles do NOT intersect if one is completely to the side of the other + const leftOfRect = box.x + box.width < rx; + const rightOfRect = rx + rw < box.x; + const aboveRect = box.y + box.height < ry; + const belowRect = ry + rh < box.y; + + const noOverlap = leftOfRect || rightOfRect || aboveRect || belowRect; + + console.log('doesElementIntersectRect:', { + box: { x: box.x, y: box.y, w: box.width, h: box.height }, + rect: { rx, ry, rw, rh }, + checks: { leftOfRect, rightOfRect, aboveRect, belowRect }, + noOverlap, + result: !noOverlap + }); + + return !noOverlap; +} + +// ============================================ +// MediaElement Class +// ============================================ + +export class MediaElement implements IMediaElement { + id: string; + type: ElementType; + x: number; + y: number; + width: number; + height: number; + rotation: number; + zIndex: number; + selected: boolean; + data: ElementData; + + constructor( + type: ElementType, + data: ElementData, + options: Partial<{ + id: string; + x: number; + y: number; + width: number; + height: number; + rotation: number; + zIndex: number; + selected: boolean; + }> = {} + ) { + this.id = options.id ?? generateElementId(); + this.type = type; + this.data = data; + + // Set default dimensions based on type + const defaultDimensions = this.getDefaultDimensions(type, data); + + this.x = options.x ?? 0; + this.y = options.y ?? 0; + this.width = options.width ?? defaultDimensions.width; + this.height = options.height ?? defaultDimensions.height; + this.rotation = options.rotation ?? 0; + this.zIndex = options.zIndex ?? 0; + this.selected = options.selected ?? false; + } + + /** + * Get default dimensions based on element type and data + */ + private getDefaultDimensions( + type: ElementType, + data: ElementData + ): { width: number; height: number } { + switch (type) { + case 'image': + case 'gif': { + const imgData = data as ImageData | GifData; + return { + width: imgData.originalWidth || 200, + height: imgData.originalHeight || 200, + }; + } + case 'video': { + // Default video dimensions + return { width: 320, height: 240 }; + } + case 'text': { + const textData = data as TextData; + // Estimate text dimensions based on content length + const estimatedWidth = Math.max(100, textData.content.length * 10); + return { width: estimatedWidth, height: textData.fontSize * 1.5 }; + } + case 'youtube': { + // Default YouTube embed dimensions (16:9) + return { width: 480, height: 270 }; + } + default: + return { width: 200, height: 200 }; + } + } + + /** + * Get the bounding box of this element + */ + getBoundingBox(): BoundingBox { + return calculateBoundingBox(this); + } + + /** + * Check if a point is inside this element + */ + containsPoint(px: number, py: number): boolean { + return isPointInElement(px, py, this); + } + + /** + * Check if this element intersects with another element + */ + intersects(other: IMediaElement): boolean { + return doElementsIntersect(this, other); + } + + /** + * Check if this element intersects with a rectangle + */ + intersectsRect( + rectX: number, + rectY: number, + rectWidth: number, + rectHeight: number + ): boolean { + return doesElementIntersectRect(this, rectX, rectY, rectWidth, rectHeight); + } + + /** + * Get the center point of this element + */ + getCenter(): { x: number; y: number } { + return { + x: this.x + this.width / 2, + y: this.y + this.height / 2, + }; + } + + /** + * Move the element by delta values + */ + move(deltaX: number, deltaY: number): void { + this.x += deltaX; + this.y += deltaY; + } + + /** + * Move the element to a specific position + */ + moveTo(x: number, y: number): void { + this.x = x; + this.y = y; + } + + /** + * Resize the element while maintaining aspect ratio + */ + resizeProportional(newWidth: number): void { + const aspectRatio = this.height / this.width; + this.width = newWidth; + this.height = newWidth * aspectRatio; + } + + /** + * Resize the element to specific dimensions + */ + resize(width: number, height: number): void { + this.width = width; + this.height = height; + } + + /** + * Clone this element with a new ID + */ + clone(offsetX = 20, offsetY = 20): MediaElement { + return new MediaElement(this.type, { ...this.data }, { + x: this.x + offsetX, + y: this.y + offsetY, + width: this.width, + height: this.height, + rotation: this.rotation, + zIndex: this.zIndex, + selected: false, + }); + } + + /** + * Convert to a plain object (for serialization) + */ + toJSON(): IMediaElement { + return { + id: this.id, + type: this.type, + x: this.x, + y: this.y, + width: this.width, + height: this.height, + rotation: this.rotation, + zIndex: this.zIndex, + selected: this.selected, + data: this.data, + }; + } + + /** + * Create a MediaElement from a plain object + * Note: selected state is always reset to false when restoring + */ + static fromJSON(json: IMediaElement): MediaElement { + return new MediaElement(json.type, json.data, { + id: json.id, + x: json.x, + y: json.y, + width: json.width, + height: json.height, + rotation: json.rotation, + zIndex: json.zIndex, + selected: false, // Always reset selection state when restoring + }); + } +} + +// ============================================ +// Factory Functions +// ============================================ + +/** + * Create an image element + */ +export function createImageElement( + src: string, + originalWidth: number, + originalHeight: number, + options: Partial<{ x: number; y: number; width: number; height: number }> = {} +): MediaElement { + const data: ImageData = { src, originalWidth, originalHeight }; + return new MediaElement('image', data, options); +} + +/** + * Create a GIF element + */ +export function createGifElement( + src: string, + originalWidth: number, + originalHeight: number, + frames: ImageBitmap[], + frameDelays: number[], + options: Partial<{ x: number; y: number; width: number; height: number }> = {} +): MediaElement { + const data: GifData = { + src, + originalWidth, + originalHeight, + frames, + frameDelays, + currentFrame: 0, + }; + return new MediaElement('gif', data, options); +} + +/** + * Create a video element + */ +export function createVideoElement( + src: string, + options: Partial<{ + x: number; + y: number; + width: number; + height: number; + loopStart: number; + loopEnd: number; + muted: boolean; + }> = {} +): MediaElement { + const data: VideoData = { + src, + loopStart: options.loopStart ?? 0, + loopEnd: options.loopEnd ?? 100, + muted: options.muted ?? true, + }; + return new MediaElement('video', data, { + x: options.x, + y: options.y, + width: options.width, + height: options.height, + }); +} + +/** + * Create a text element + */ +export function createTextElement( + content: string, + options: Partial<{ + x: number; + y: number; + fontSize: number; + color: string; + }> = {} +): MediaElement { + const data: TextData = { + content, + fontSize: options.fontSize ?? 16, + color: options.color ?? '#ffffff', + }; + return new MediaElement('text', data, { + x: options.x, + y: options.y, + }); +} + +/** + * Create a YouTube element + */ +export function createYouTubeElement( + videoId: string, + options: Partial<{ + x: number; + y: number; + width: number; + height: number; + loopStart: number; + loopEnd: number; + }> = {} +): MediaElement { + const data: YouTubeData = { + videoId, + loopStart: options.loopStart ?? 0, + loopEnd: options.loopEnd ?? 100, + }; + return new MediaElement('youtube', data, { + x: options.x, + y: options.y, + width: options.width, + height: options.height, + }); +} diff --git a/src/core/scene/index.ts b/src/core/scene/index.ts new file mode 100644 index 0000000..f124514 --- /dev/null +++ b/src/core/scene/index.ts @@ -0,0 +1,677 @@ +/** + * Scene Manager + * Manages scene state, element operations, and view transformations + */ + +import { ref, computed, type Ref, type ComputedRef } from 'vue'; +import type { + MediaElement as IMediaElement, + ElementType, + ElementData, + ViewTransform, +} from '../../types'; +import { + MediaElement, + isPointInElement, + doesElementIntersectRect, +} from './element'; + +// ============================================ +// Constants +// ============================================ + +const MIN_SCALE = 0.01; +const MAX_SCALE = 2.0; +const DEFAULT_SCALE = 1.0; +const WORKSPACE_PADDING = 500; + +// ============================================ +// Scene State Interface +// ============================================ + +export interface WorkspaceBounds { + minX: number; + minY: number; + maxX: number; + maxY: number; +} + +// ============================================ +// Scene Manager Class +// ============================================ + +export class SceneManager { + private _elements: Map = new Map(); + private _selectedIds: Set = new Set(); + private _viewTransform: ViewTransform = { + scale: DEFAULT_SCALE, + translateX: 0, + translateY: 0, + }; + private _workspaceBounds: WorkspaceBounds = { + minX: -1000, + minY: -1000, + maxX: 1000, + maxY: 1000, + }; + private _nextZIndex = 1; + private _version: Ref = ref(0); + + readonly elements: ComputedRef; + readonly selectedElements: ComputedRef; + readonly viewTransform: ComputedRef; + readonly hasSelection: ComputedRef; + + constructor() { + const self = this; + + this.elements = computed(() => { + self._version.value; + return Array.from(self._elements.values()).sort((a, b) => a.zIndex - b.zIndex); + }); + + this.selectedElements = computed(() => { + self._version.value; + return Array.from(self._elements.values()).filter(el => el.selected); + }); + + this.viewTransform = computed(() => { + self._version.value; + return { ...self._viewTransform }; + }); + + this.hasSelection = computed(() => { + self._version.value; + return self._selectedIds.size > 0; + }); + } + + private notify(): void { + this._version.value++; + } + + // ============================================ + // Element Operations + // ============================================ + + addElement( + type: ElementType, + data: ElementData, + options: Partial<{ + x: number; + y: number; + width: number; + height: number; + rotation: number; + }> = {} + ): MediaElement { + const element = new MediaElement(type, data, { + ...options, + zIndex: this._nextZIndex++, + }); + + this._elements.set(element.id, element); + this.updateWorkspaceBounds(); + this.notify(); + + return element; + } + + addExistingElement(element: MediaElement): void { + if (element.zIndex >= this._nextZIndex) { + this._nextZIndex = element.zIndex + 1; + } + this._elements.set(element.id, element); + this.updateWorkspaceBounds(); + this.notify(); + } + + removeElement(id: string): boolean { + const element = this._elements.get(id); + if (!element) return false; + + this._elements.delete(id); + this._selectedIds.delete(id); + this.updateWorkspaceBounds(); + this.notify(); + + return true; + } + + getElement(id: string): MediaElement | undefined { + return this._elements.get(id); + } + + updateElement( + id: string, + updates: Partial> + ): boolean { + const element = this._elements.get(id); + if (!element) return false; + + Object.assign(element, updates); + this.updateWorkspaceBounds(); + this.notify(); + + return true; + } + + // ============================================ + // Selection Operations + // ============================================ + + selectElement(id: string, addToSelection = false): boolean { + const element = this._elements.get(id); + if (!element) return false; + + if (!addToSelection) { + this.deselectAll(); + } + + element.selected = true; + this._selectedIds.add(id); + this.notify(); + + return true; + } + + deselectElement(id: string): boolean { + const element = this._elements.get(id); + if (!element) return false; + + element.selected = false; + this._selectedIds.delete(id); + this.notify(); + + return true; + } + + deselectAll(): void { + for (const id of this._selectedIds) { + const element = this._elements.get(id); + if (element) { + element.selected = false; + } + } + this._selectedIds.clear(); + this.notify(); + } + + toggleSelection(id: string): boolean { + const element = this._elements.get(id); + if (!element) return false; + + if (element.selected) { + this.deselectElement(id); + } else { + this.selectElement(id, true); + } + + return true; + } + + selectInRect( + x: number, + y: number, + width: number, + height: number, + addToSelection = false + ): void { + console.log('selectInRect called:', { x, y, width, height, elementCount: this._elements.size }); + + if (!addToSelection) { + this.deselectAll(); + } + + for (const element of this._elements.values()) { + const intersects = doesElementIntersectRect(element, x, y, width, height); + console.log('Element check:', element.id, 'intersects:', intersects); + if (intersects) { + element.selected = true; + this._selectedIds.add(element.id); + } + } + console.log('Selected count:', this._selectedIds.size); + this.notify(); + } + + selectAll(): void { + for (const element of this._elements.values()) { + element.selected = true; + this._selectedIds.add(element.id); + } + this.notify(); + } + + // ============================================ + // Batch Operations + // ============================================ + + deleteSelected(): MediaElement[] { + const deleted: MediaElement[] = []; + + for (const id of this._selectedIds) { + const element = this._elements.get(id); + if (element) { + deleted.push(element); + this._elements.delete(id); + } + } + + this._selectedIds.clear(); + this.updateWorkspaceBounds(); + this.notify(); + + return deleted; + } + + moveSelected(deltaX: number, deltaY: number): void { + for (const id of this._selectedIds) { + const element = this._elements.get(id); + if (element) { + element.move(deltaX, deltaY); + } + } + this.updateWorkspaceBounds(); + this.notify(); + } + + /** + * Get the bounding box of all selected elements + */ + getSelectionBounds(): { x: number; y: number; width: number; height: number } | null { + if (this._selectedIds.size === 0) return null; + + let minX = Infinity; + let minY = Infinity; + let maxX = -Infinity; + let maxY = -Infinity; + + for (const id of this._selectedIds) { + const element = this._elements.get(id); + if (element) { + minX = Math.min(minX, element.x); + minY = Math.min(minY, element.y); + maxX = Math.max(maxX, element.x + element.width); + maxY = Math.max(maxY, element.y + element.height); + } + } + + if (minX === Infinity) return null; + + return { + x: minX, + y: minY, + width: maxX - minX, + height: maxY - minY, + }; + } + + /** + * Scale all selected elements from a pivot point + * @param scaleX - horizontal scale factor + * @param scaleY - vertical scale factor + * @param pivotX - pivot point X in world coordinates + * @param pivotY - pivot point Y in world coordinates + */ + scaleSelected(scaleX: number, scaleY: number, pivotX: number, pivotY: number): void { + for (const id of this._selectedIds) { + const element = this._elements.get(id); + if (element) { + // Calculate new position relative to pivot + const relX = element.x - pivotX; + const relY = element.y - pivotY; + + element.x = pivotX + relX * scaleX; + element.y = pivotY + relY * scaleY; + element.width = Math.max(20, element.width * scaleX); + element.height = Math.max(20, element.height * scaleY); + } + } + this.updateWorkspaceBounds(); + this.notify(); + } + + cloneSelected(offsetX = 20, offsetY = 20): MediaElement[] { + const clones: MediaElement[] = []; + + for (const id of this._selectedIds) { + const element = this._elements.get(id); + if (element) { + const clone = element.clone(offsetX, offsetY); + clone.zIndex = this._nextZIndex++; + this._elements.set(clone.id, clone); + clones.push(clone); + } + } + + this.deselectAll(); + for (const clone of clones) { + clone.selected = true; + this._selectedIds.add(clone.id); + } + + this.updateWorkspaceBounds(); + this.notify(); + return clones; + } + + bringToFront(): void { + for (const id of this._selectedIds) { + const element = this._elements.get(id); + if (element) { + element.zIndex = this._nextZIndex++; + } + } + this.notify(); + } + + sendToBack(): void { + let minZ = Infinity; + for (const element of this._elements.values()) { + if (!element.selected && element.zIndex < minZ) { + minZ = element.zIndex; + } + } + + let z = Math.max(0, minZ - this._selectedIds.size); + for (const id of this._selectedIds) { + const element = this._elements.get(id); + if (element) { + element.zIndex = z++; + } + } + this.notify(); + } + + // ============================================ + // Hit Testing + // ============================================ + + getElementAtPoint(screenX: number, screenY: number): MediaElement | null { + const worldX = this.screenToWorldX(screenX); + const worldY = this.screenToWorldY(screenY); + + const sortedElements = Array.from(this._elements.values()) + .sort((a, b) => b.zIndex - a.zIndex); + + for (const element of sortedElements) { + if (isPointInElement(worldX, worldY, element)) { + return element; + } + } + + return null; + } + + getElementsAtPoint(screenX: number, screenY: number): MediaElement[] { + const worldX = this.screenToWorldX(screenX); + const worldY = this.screenToWorldY(screenY); + + return Array.from(this._elements.values()) + .filter(element => isPointInElement(worldX, worldY, element)) + .sort((a, b) => b.zIndex - a.zIndex); + } + + // ============================================ + // View Transform Operations + // ============================================ + + zoom(delta: number, centerX: number, centerY: number): void { + const oldScale = this._viewTransform.scale; + const newScale = Math.max(MIN_SCALE, Math.min(MAX_SCALE, oldScale * (1 + delta))); + + if (newScale === oldScale) return; + + const worldX = this.screenToWorldX(centerX); + const worldY = this.screenToWorldY(centerY); + + this._viewTransform.scale = newScale; + this._viewTransform.translateX = centerX - worldX * newScale; + this._viewTransform.translateY = centerY - worldY * newScale; + + this.clampViewToBounds(); + this.notify(); + } + + setZoom(scale: number, centerX?: number, centerY?: number): void { + const clampedScale = Math.max(MIN_SCALE, Math.min(MAX_SCALE, scale)); + + if (centerX !== undefined && centerY !== undefined) { + const worldX = this.screenToWorldX(centerX); + const worldY = this.screenToWorldY(centerY); + + this._viewTransform.scale = clampedScale; + this._viewTransform.translateX = centerX - worldX * clampedScale; + this._viewTransform.translateY = centerY - worldY * clampedScale; + } else { + this._viewTransform.scale = clampedScale; + } + + this.clampViewToBounds(); + this.notify(); + } + + pan(deltaX: number, deltaY: number): void { + this._viewTransform.translateX += deltaX; + this._viewTransform.translateY += deltaY; + this.clampViewToBounds(); + this.notify(); + } + + setViewTransform(transform: Partial): void { + if (transform.scale !== undefined) { + this._viewTransform.scale = Math.max(MIN_SCALE, Math.min(MAX_SCALE, transform.scale)); + } + if (transform.translateX !== undefined) { + this._viewTransform.translateX = transform.translateX; + } + if (transform.translateY !== undefined) { + this._viewTransform.translateY = transform.translateY; + } + this.clampViewToBounds(); + this.notify(); + } + + resetView(): void { + this._viewTransform.scale = DEFAULT_SCALE; + this._viewTransform.translateX = 0; + this._viewTransform.translateY = 0; + this.notify(); + } + + fitToView(canvasWidth: number, canvasHeight: number, padding = 50): void { + if (this._elements.size === 0) { + this.resetView(); + return; + } + + const bounds = this._workspaceBounds; + const contentWidth = bounds.maxX - bounds.minX; + const contentHeight = bounds.maxY - bounds.minY; + + if (contentWidth <= 0 || contentHeight <= 0) { + this.resetView(); + return; + } + + const scaleX = (canvasWidth - padding * 2) / contentWidth; + const scaleY = (canvasHeight - padding * 2) / contentHeight; + const scale = Math.min(scaleX, scaleY, MAX_SCALE); + + const centerX = (bounds.minX + bounds.maxX) / 2; + const centerY = (bounds.minY + bounds.maxY) / 2; + + this._viewTransform.scale = scale; + this._viewTransform.translateX = canvasWidth / 2 - centerX * scale; + this._viewTransform.translateY = canvasHeight / 2 - centerY * scale; + this.notify(); + } + + // ============================================ + // Coordinate Conversion + // ============================================ + + screenToWorldX(screenX: number): number { + return (screenX - this._viewTransform.translateX) / this._viewTransform.scale; + } + + screenToWorldY(screenY: number): number { + return (screenY - this._viewTransform.translateY) / this._viewTransform.scale; + } + + screenToWorld(screenX: number, screenY: number): { x: number; y: number } { + return { + x: this.screenToWorldX(screenX), + y: this.screenToWorldY(screenY), + }; + } + + worldToScreenX(worldX: number): number { + return worldX * this._viewTransform.scale + this._viewTransform.translateX; + } + + worldToScreenY(worldY: number): number { + return worldY * this._viewTransform.scale + this._viewTransform.translateY; + } + + worldToScreen(worldX: number, worldY: number): { x: number; y: number } { + return { + x: this.worldToScreenX(worldX), + y: this.worldToScreenY(worldY), + }; + } + + // ============================================ + // Workspace Bounds + // ============================================ + + private updateWorkspaceBounds(): void { + if (this._elements.size === 0) { + this._workspaceBounds = { + minX: -1000, + minY: -1000, + maxX: 1000, + maxY: 1000, + }; + return; + } + + let minX = Infinity; + let minY = Infinity; + let maxX = -Infinity; + let maxY = -Infinity; + + for (const element of this._elements.values()) { + const box = element.getBoundingBox(); + minX = Math.min(minX, box.x); + minY = Math.min(minY, box.y); + maxX = Math.max(maxX, box.x + box.width); + maxY = Math.max(maxY, box.y + box.height); + } + + this._workspaceBounds = { + minX: minX - WORKSPACE_PADDING, + minY: minY - WORKSPACE_PADDING, + maxX: maxX + WORKSPACE_PADDING, + maxY: maxY + WORKSPACE_PADDING, + }; + } + + private clampViewToBounds(): void { + // Ensures workspace is always at least partially visible + } + + getWorkspaceBounds(): WorkspaceBounds { + return { ...this._workspaceBounds }; + } + + // ============================================ + // Scene Operations + // ============================================ + + clear(): void { + this._elements.clear(); + this._selectedIds.clear(); + this._nextZIndex = 1; + this._viewTransform = { + scale: DEFAULT_SCALE, + translateX: 0, + translateY: 0, + }; + this.updateWorkspaceBounds(); + this.notify(); + } + + getAllElements(): MediaElement[] { + return Array.from(this._elements.values()); + } + + getElementCount(): number { + return this._elements.size; + } + + getSelectedCount(): number { + return this._selectedIds.size; + } + + getState(): { + elements: IMediaElement[]; + viewTransform: ViewTransform; + workspaceBounds: WorkspaceBounds; + } { + return { + elements: Array.from(this._elements.values()).map(el => el.toJSON()), + viewTransform: { ...this._viewTransform }, + workspaceBounds: { ...this._workspaceBounds }, + }; + } + + restoreState(state: { + elements: IMediaElement[]; + viewTransform?: ViewTransform; + }): void { + this.clear(); + + for (const elementData of state.elements) { + const element = MediaElement.fromJSON(elementData); + this.addExistingElement(element); + } + + if (state.viewTransform) { + this.setViewTransform(state.viewTransform); + } + } +} + +// ============================================ +// Singleton Instance +// ============================================ + +let sceneManagerInstance: SceneManager | null = null; + +export function getSceneManager(): SceneManager { + if (!sceneManagerInstance) { + sceneManagerInstance = new SceneManager(); + } + return sceneManagerInstance; +} + +export function resetSceneManager(): void { + sceneManagerInstance = null; +} + +// Re-export element utilities +export { + MediaElement, + generateElementId, + calculateBoundingBox, + isPointInElement, + doElementsIntersect, + doesElementIntersectRect, + createImageElement, + createGifElement, + createVideoElement, + createTextElement, + createYouTubeElement, +} from './element'; diff --git a/src/core/scene/serializer.ts b/src/core/scene/serializer.ts new file mode 100644 index 0000000..419f3c2 --- /dev/null +++ b/src/core/scene/serializer.ts @@ -0,0 +1,413 @@ +/** + * Scene Serialization/Deserialization + * Implements .purgif file format compatibility + */ + +import type { + Scene, + SerializedElement, + MediaElement as IMediaElement, + ElementType, + ViewTransform, + ImageData, + GifData, + VideoData, + TextData, + YouTubeData, +} from '../../types'; +import { MediaElement } from './element'; +import { SceneManager } from './index'; + +// ============================================ +// Constants +// ============================================ + +const SCENE_VERSION = '1.0.0'; +const PURGIF_MAGIC = 'PURGIF'; // File format identifier + +// ============================================ +// Scene File Format +// ============================================ + +export interface SceneFile { + magic: string; + version: string; + scene: Scene; +} + +// ============================================ +// Serialization Functions +// ============================================ + +/** + * Serialize a MediaElement to SerializedElement format + */ +export function serializeElement(element: IMediaElement): SerializedElement { + const serialized: SerializedElement = { + type: element.type, + path: '', + x: element.x, + y: element.y, + width: element.width, + height: element.height, + }; + + switch (element.type) { + case 'image': + case 'gif': { + const imgData = element.data as ImageData | GifData; + serialized.path = imgData.src; // base64 data URL + break; + } + case 'video': { + const videoData = element.data as VideoData; + serialized.path = videoData.src; + serialized.loopPairs = [[videoData.loopStart, videoData.loopEnd]]; + serialized.activeLoopPair = 0; + break; + } + case 'text': { + const textData = element.data as TextData; + // Encode text content as base64 to handle special characters + serialized.path = `text:${btoa(encodeURIComponent(textData.content))}`; + break; + } + case 'youtube': { + const ytData = element.data as YouTubeData; + serialized.path = `youtube:${ytData.videoId}`; + serialized.loopPairs = [[ytData.loopStart, ytData.loopEnd]]; + serialized.activeLoopPair = 0; + break; + } + } + + return serialized; +} + +/** + * Deserialize a SerializedElement to MediaElement + */ +export function deserializeElement(serialized: SerializedElement): MediaElement { + let data; + + switch (serialized.type) { + case 'image': { + data = { + src: serialized.path, + originalWidth: serialized.width, + originalHeight: serialized.height, + } as ImageData; + break; + } + case 'gif': { + data = { + src: serialized.path, + originalWidth: serialized.width, + originalHeight: serialized.height, + frames: [], // Will be populated when loading + frameDelays: [], + currentFrame: 0, + } as GifData; + break; + } + case 'video': { + const loopPair = serialized.loopPairs?.[serialized.activeLoopPair ?? 0] ?? [0, 100]; + data = { + src: serialized.path, + loopStart: loopPair[0], + loopEnd: loopPair[1], + muted: true, + } as VideoData; + break; + } + case 'text': { + // Decode text content from base64 + const content = serialized.path.startsWith('text:') + ? decodeURIComponent(atob(serialized.path.slice(5))) + : serialized.path; + data = { + content, + fontSize: 16, + color: '#ffffff', + } as TextData; + break; + } + case 'youtube': { + const videoId = serialized.path.startsWith('youtube:') + ? serialized.path.slice(8) + : serialized.path; + const loopPair = serialized.loopPairs?.[serialized.activeLoopPair ?? 0] ?? [0, 100]; + data = { + videoId, + loopStart: loopPair[0], + loopEnd: loopPair[1], + } as YouTubeData; + break; + } + default: + throw new Error(`Unknown element type: ${serialized.type}`); + } + + return new MediaElement(serialized.type, data, { + x: serialized.x, + y: serialized.y, + width: serialized.width, + height: serialized.height, + }); +} + +/** + * Serialize a SceneManager state to Scene format + */ +export function serializeScene(manager: SceneManager): Scene { + const state = manager.getState(); + const bounds = manager.getWorkspaceBounds(); + + return { + version: SCENE_VERSION, + currentScale: state.viewTransform.scale, + translate: { + translateX: state.viewTransform.translateX, + translateY: state.viewTransform.translateY, + }, + workspaceRect: { + x1: bounds.minX, + y1: bounds.minY, + x2: bounds.maxX, + y2: bounds.maxY, + }, + elements: state.elements.map(serializeElement), + }; +} + +/** + * Deserialize a Scene to SceneManager state + */ +export function deserializeScene(scene: Scene): { + elements: MediaElement[]; + viewTransform: ViewTransform; +} { + return { + elements: scene.elements.map(deserializeElement), + viewTransform: { + scale: scene.currentScale, + translateX: scene.translate.translateX, + translateY: scene.translate.translateY, + }, + }; +} + +// ============================================ +// File I/O Functions +// ============================================ + +/** + * Convert scene to JSON string for saving + */ +export function sceneToJson(manager: SceneManager): string { + const sceneFile: SceneFile = { + magic: PURGIF_MAGIC, + version: SCENE_VERSION, + scene: serializeScene(manager), + }; + + return JSON.stringify(sceneFile, null, 2); +} + +/** + * Parse JSON string to scene data + */ +export function jsonToScene(json: string): { + elements: MediaElement[]; + viewTransform: ViewTransform; +} { + const sceneFile = JSON.parse(json) as SceneFile; + + // Validate file format + if (sceneFile.magic !== PURGIF_MAGIC) { + throw new Error('Invalid file format: not a valid .purgif file'); + } + + return deserializeScene(sceneFile.scene); +} + +/** + * Load scene from JSON and apply to SceneManager + */ +export function loadSceneFromJson(manager: SceneManager, json: string): void { + const { elements, viewTransform } = jsonToScene(json); + + manager.clear(); + + for (const element of elements) { + manager.addExistingElement(element); + } + + manager.setViewTransform(viewTransform); +} + +// ============================================ +// Base64 Utilities +// ============================================ + +/** + * Convert ArrayBuffer to base64 string + */ +export function arrayBufferToBase64(buffer: ArrayBuffer): string { + const bytes = new Uint8Array(buffer); + let binary = ''; + for (let i = 0; i < bytes.byteLength; i++) { + binary += String.fromCharCode(bytes[i]); + } + return btoa(binary); +} + +/** + * Convert base64 string to ArrayBuffer + */ +export function base64ToArrayBuffer(base64: string): ArrayBuffer { + const binary = atob(base64); + const bytes = new Uint8Array(binary.length); + for (let i = 0; i < binary.length; i++) { + bytes[i] = binary.charCodeAt(i); + } + return bytes.buffer; +} + +/** + * Convert base64 string to Blob + */ +export function base64ToBlob(base64: string, mimeType: string): Blob { + const buffer = base64ToArrayBuffer(base64); + return new Blob([buffer], { type: mimeType }); +} + +/** + * Convert Blob to base64 data URL + */ +export async function blobToBase64DataUrl(blob: Blob): Promise { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.onload = () => resolve(reader.result as string); + reader.onerror = reject; + reader.readAsDataURL(blob); + }); +} + +/** + * Convert File to base64 data URL + */ +export async function fileToBase64DataUrl(file: File): Promise { + return blobToBase64DataUrl(file); +} + +/** + * Extract base64 data from data URL + */ +export function extractBase64FromDataUrl(dataUrl: string): string { + const match = dataUrl.match(/^data:[^;]+;base64,(.+)$/); + if (!match) { + throw new Error('Invalid data URL format'); + } + return match[1]; +} + +/** + * Get MIME type from data URL + */ +export function getMimeTypeFromDataUrl(dataUrl: string): string { + const match = dataUrl.match(/^data:([^;]+);base64,/); + if (!match) { + throw new Error('Invalid data URL format'); + } + return match[1]; +} + +/** + * Create data URL from base64 and MIME type + */ +export function createDataUrl(base64: string, mimeType: string): string { + return `data:${mimeType};base64,${base64}`; +} + +// ============================================ +// Image Processing Utilities +// ============================================ + +/** + * Load image from data URL and get dimensions + */ +export async function loadImageFromDataUrl( + dataUrl: string +): Promise<{ image: HTMLImageElement; width: number; height: number }> { + return new Promise((resolve, reject) => { + const img = new Image(); + img.onload = () => { + resolve({ + image: img, + width: img.naturalWidth, + height: img.naturalHeight, + }); + }; + img.onerror = reject; + img.src = dataUrl; + }); +} + +/** + * Create ImageBitmap from data URL + */ +export async function createImageBitmapFromDataUrl( + dataUrl: string +): Promise { + const blob = base64ToBlob( + extractBase64FromDataUrl(dataUrl), + getMimeTypeFromDataUrl(dataUrl) + ); + return createImageBitmap(blob); +} + +// ============================================ +// Validation Functions +// ============================================ + +/** + * Validate scene file structure + */ +export function validateSceneFile(data: unknown): data is SceneFile { + if (typeof data !== 'object' || data === null) return false; + + const file = data as Record; + + if (file.magic !== PURGIF_MAGIC) return false; + if (typeof file.version !== 'string') return false; + if (typeof file.scene !== 'object' || file.scene === null) return false; + + const scene = file.scene as Record; + + if (typeof scene.currentScale !== 'number') return false; + if (typeof scene.translate !== 'object') return false; + if (!Array.isArray(scene.elements)) return false; + + return true; +} + +/** + * Validate element type + */ +export function isValidElementType(type: string): type is ElementType { + return ['image', 'gif', 'video', 'text', 'youtube'].includes(type); +} + +// ============================================ +// Migration Functions +// ============================================ + +/** + * Migrate old scene format to current version + */ +export function migrateScene(sceneFile: SceneFile): SceneFile { + // Currently no migrations needed + // Add version-specific migrations here as needed + return sceneFile; +} diff --git a/src/env.d.ts b/src/env.d.ts new file mode 100644 index 0000000..a5158d0 --- /dev/null +++ b/src/env.d.ts @@ -0,0 +1,8 @@ +/// +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..b670de8 --- /dev/null +++ b/src/main.js @@ -0,0 +1,4 @@ +import { createApp } from "vue"; +import App from "./App.vue"; + +createApp(App).mount("#app"); diff --git a/src/stores/scene.ts b/src/stores/scene.ts new file mode 100644 index 0000000..8a18a84 --- /dev/null +++ b/src/stores/scene.ts @@ -0,0 +1,21 @@ +// Scene state store +// Implementation will be added in Task 6 + +import { reactive } from 'vue'; +import type { MediaElement, ViewTransform } from '@/types'; + +export interface SceneState { + elements: MediaElement[]; + selectedIds: Set; + viewTransform: ViewTransform; +} + +export const sceneState = reactive({ + elements: [], + selectedIds: new Set(), + viewTransform: { + scale: 1, + translateX: 0, + translateY: 0, + }, +}); diff --git a/src/stores/ui.ts b/src/stores/ui.ts new file mode 100644 index 0000000..1fc791f --- /dev/null +++ b/src/stores/ui.ts @@ -0,0 +1,25 @@ +// UI state store +// Implementation will be added in Task 6 + +import { reactive } from 'vue'; +import type { AppState, ContextMenuState, InputMode } from '@/types'; + +export interface UIState extends AppState { + inputMode: InputMode; + contextMenu: ContextMenuState; +} + +export const uiState = reactive({ + isInitialized: false, + isLocked: false, + showHelp: false, + alwaysOnTop: false, + windowOpacity: 1, + inputMode: 'default', + contextMenu: { + visible: false, + x: 0, + y: 0, + items: [], + }, +}); diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 0000000..cc02448 --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,201 @@ +// ============================================ +// Media Element Types +// ============================================ + +export type ElementType = 'image' | 'gif' | 'video' | 'text' | 'youtube'; + +export interface ImageData { + src: string; // base64 data URL + originalWidth: number; + originalHeight: number; +} + +export interface GifData extends ImageData { + frames: ImageBitmap[]; + frameDelays: number[]; + currentFrame: number; +} + +export interface VideoData { + src: string; + loopStart: number; // percentage 0-100 + loopEnd: number; // percentage 0-100 + muted: boolean; +} + +export interface TextData { + content: string; + fontSize: number; + color: string; +} + +export interface YouTubeData { + videoId: string; + loopStart: number; + loopEnd: number; +} + +export type ElementData = ImageData | GifData | VideoData | TextData | YouTubeData; + +export interface MediaElement { + id: string; + type: ElementType; + + // Transform properties + x: number; + y: number; + width: number; + height: number; + rotation: number; + + // Layer order + zIndex: number; + + // Selection state + selected: boolean; + + // Type-specific data + data: ElementData; +} + +// ============================================ +// Scene Types +// ============================================ + +export interface SerializedElement { + type: ElementType; + path: string; // base64 for images, file path for videos + x: number; + y: number; + width: number; + height: number; + loopPairs?: [number, number][]; + activeLoopPair?: number; +} + +export interface Scene { + version: string; + + // View state + currentScale: number; + translate: { + translateX: number; + translateY: number; + }; + + // Workspace bounds + workspaceRect: { + x1: number; + y1: number; + x2: number; + y2: number; + }; + + // Element list + elements: SerializedElement[]; +} + +// ============================================ +// History Types +// ============================================ + +export interface HistoryState { + elements: SerializedElement[]; + currentScale: number; + translate: { translateX: number; translateY: number }; +} + +// ============================================ +// Input Types +// ============================================ + +export type InputMode = 'default' | 'panning' | 'zooming' | 'selecting' | 'dragging' | 'resizing'; + +export interface MousePosition { + x: number; + y: number; +} + +// ============================================ +// Renderer Types +// ============================================ + +export interface ViewTransform { + scale: number; + translateX: number; + translateY: number; +} + +export interface RenderElement { + id: string; + texture: GPUTexture; + x: number; + y: number; + width: number; + height: number; + rotation: number; + zIndex: number; + selected: boolean; +} + +// ============================================ +// Clipboard Types +// ============================================ + +export interface ClipboardData { + type: 'image' | 'text' | 'files' | 'empty'; + data?: string; + files?: string[]; +} + +// ============================================ +// Error Types +// ============================================ + +export enum ErrorType { + WEBGPU_NOT_SUPPORTED = 'WEBGPU_NOT_SUPPORTED', + TEXTURE_LOAD_FAILED = 'TEXTURE_LOAD_FAILED', + FILE_READ_ERROR = 'FILE_READ_ERROR', + FILE_WRITE_ERROR = 'FILE_WRITE_ERROR', + CLIPBOARD_ERROR = 'CLIPBOARD_ERROR', + INVALID_SCENE_FORMAT = 'INVALID_SCENE_FORMAT', +} + +export interface AppError { + type: ErrorType; + message: string; + details?: unknown; +} + +// ============================================ +// UI Types +// ============================================ + +export interface MenuItem { + label: string; + action: () => void; + checked?: boolean; + submenu?: MenuItem[]; + separator?: boolean; + shortcut?: string; + disabled?: boolean; +} + +export interface ContextMenuState { + visible: boolean; + x: number; + y: number; + items: MenuItem[]; +} + +// ============================================ +// App State Types +// ============================================ + +export interface AppState { + isInitialized: boolean; + isLocked: boolean; + showHelp: boolean; + alwaysOnTop: boolean; + windowOpacity: number; +} diff --git a/src/utils/clipboard.ts b/src/utils/clipboard.ts new file mode 100644 index 0000000..ff09f7d --- /dev/null +++ b/src/utils/clipboard.ts @@ -0,0 +1,398 @@ +/** + * Clipboard utilities for copy/paste operations + * + * This module provides clipboard integration with Tauri backend + * for copying/pasting media elements and external content. + */ + +import { invoke } from '@tauri-apps/api/core'; +import type { MediaElement, ElementData, ImageData, GifData, TextData } from '../types'; +import { loadImageFromBase64 } from './image'; +import { loadGifFromBase64 } from './gif'; + +// ============================================ +// Clipboard Content Types +// ============================================ + +// Matches Rust ClipboardContent enum with serde tag/content format +export type ClipboardContent = + | { type: 'image'; data: string } + | { type: 'text'; data: string } + | { type: 'files'; data: string[] } + | { type: 'empty' }; + +export interface InternalClipboardData { + type: 'elements'; + elements: SerializedClipboardElement[]; +} + +export interface SerializedClipboardElement { + type: string; + data: ElementData; + width: number; + height: number; + rotation: number; +} + +// Internal clipboard for element copy/paste +let internalClipboard: InternalClipboardData | null = null; + +// ============================================ +// Tauri Clipboard Commands +// ============================================ + +/** + * Read clipboard contents from system clipboard via Tauri + */ +export async function readClipboard(): Promise { + try { + const result = await invoke('read_clipboard'); + return result; + } catch (error) { + console.error('Failed to read clipboard:', error); + return { type: 'empty' }; + } +} + +/** + * Write image to system clipboard via Tauri + */ +export async function writeClipboardImage(base64Data: string): Promise { + try { + await invoke('write_clipboard_image_base64', { base64Data }); + return true; + } catch (error) { + console.error('Failed to write image to clipboard:', error); + return false; + } +} + +/** + * Write text to system clipboard via Tauri + */ +export async function writeClipboardText(text: string): Promise { + try { + await invoke('write_clipboard_text', { text }); + return true; + } catch (error) { + console.error('Failed to write text to clipboard:', error); + return false; + } +} + +/** + * Read image from file path as base64 via Tauri + */ +export async function readImageAsBase64(path: string): Promise { + try { + const result = await invoke('read_image_as_base64', { path }); + return result; + } catch (error) { + console.error('Failed to read image as base64:', error); + return null; + } +} + +// ============================================ +// Element Copy/Paste +// ============================================ + +/** + * Write multiple images to clipboard as files (preserves GIF animation) + */ +export async function writeClipboardImagesAsFiles(images: Array<{ src: string; type: string }>): Promise { + try { + const imageData = images.map(img => [img.src, img.type]); + await invoke('write_clipboard_images_as_files', { images: imageData }); + return true; + } catch (error) { + console.error('Failed to write images to clipboard:', error); + return false; + } +} + +/** + * Copy selected elements to internal clipboard + * Also copies to system clipboard for external paste + */ +export async function copyElements(elements: MediaElement[]): Promise { + if (elements.length === 0) return false; + + // Serialize elements for internal clipboard + const serialized: SerializedClipboardElement[] = elements.map(el => ({ + type: el.type, + data: el.data, + width: el.width, + height: el.height, + rotation: el.rotation, + })); + + internalClipboard = { + type: 'elements', + elements: serialized, + }; + + // Collect image/gif elements for system clipboard + const imageElements: Array<{ src: string; type: string }> = []; + + for (const element of elements) { + if (element.type === 'image') { + const imageData = element.data as ImageData; + if (imageData.src) { + imageElements.push({ src: imageData.src, type: 'image/png' }); + } + } else if (element.type === 'gif') { + const gifData = element.data as GifData; + if (gifData.src) { + imageElements.push({ src: gifData.src, type: 'image/gif' }); + } + } + } + + // Copy images to system clipboard as files (preserves GIF animation) + if (imageElements.length > 0) { + await writeClipboardImagesAsFiles(imageElements); + } else if (elements.length === 1 && elements[0].type === 'text') { + // For single text element, copy text content + const textData = elements[0].data as TextData; + await writeClipboardText(textData.content); + } + + return true; +} + +/** + * Check if internal clipboard has elements + */ +export function hasInternalClipboardData(): boolean { + return internalClipboard !== null && internalClipboard.elements.length > 0; +} + +/** + * Get elements from internal clipboard + */ +export function getInternalClipboardElements(): SerializedClipboardElement[] { + return internalClipboard?.elements ?? []; +} + +/** + * Clear internal clipboard + */ +export function clearInternalClipboard(): void { + internalClipboard = null; +} + +// ============================================ +// Paste Operations +// ============================================ + +export interface PasteResult { + type: 'elements' | 'image' | 'gif' | 'text' | 'files' | 'youtube' | 'empty'; + elements?: SerializedClipboardElement[]; + imageData?: { + src: string; + width: number; + height: number; + }; + gifData?: { + src: string; + width: number; + height: number; + frames: ImageBitmap[]; + frameDelays: number[]; + }; + textContent?: string; + filePaths?: string[]; + youtubeId?: string; +} + +/** + * Process paste operation - checks internal clipboard first, then system clipboard + */ +export async function processPaste(): Promise { + // First check internal clipboard for copied elements + if (hasInternalClipboardData()) { + return { + type: 'elements', + elements: getInternalClipboardElements(), + }; + } + + // Read from system clipboard + const clipboardContent = await readClipboard(); + + switch (clipboardContent.type) { + case 'image': + return await processImagePaste(clipboardContent.data); + + case 'text': + return processTextPaste(clipboardContent.data); + + case 'files': + // Files are returned as string array directly + if (clipboardContent.type === 'files') { + return await processFilesPaste(clipboardContent.data); + } + return { type: 'empty' }; + + default: + return { type: 'empty' }; + } +} + +/** + * Process image paste from clipboard + */ +async function processImagePaste(base64Data: string): Promise { + try { + // Check if it's a GIF + if (base64Data.includes('image/gif')) { + const gifData = await loadGifFromBase64(base64Data); + return { + type: 'gif', + gifData: { + src: base64Data, + width: gifData.width, + height: gifData.height, + frames: gifData.frames.map(f => f.bitmap), + frameDelays: gifData.frames.map(f => f.delay), + }, + }; + } + + // Regular image + const bitmap = await loadImageFromBase64(base64Data); + return { + type: 'image', + imageData: { + src: base64Data, + width: bitmap.width, + height: bitmap.height, + }, + }; + } catch (error) { + console.error('Failed to process image paste:', error); + return { type: 'empty' }; + } +} + +/** + * Process text paste from clipboard + */ +function processTextPaste(text: string): PasteResult { + // Check for YouTube URL + const youtubeId = extractYouTubeId(text); + if (youtubeId) { + return { + type: 'youtube', + youtubeId, + }; + } + + // Regular text + return { + type: 'text', + textContent: text, + }; +} + +/** + * Process file paths paste from clipboard + */ +async function processFilesPaste(filePaths: string[]): Promise { + if (filePaths.length === 0) { + return { type: 'empty' }; + } + + // For single image file, load and return as image/gif + if (filePaths.length === 1) { + const path = filePaths[0]; + const ext = path.split('.').pop()?.toLowerCase() || ''; + + if (['png', 'jpg', 'jpeg', 'bmp', 'webp'].includes(ext)) { + const base64 = await readImageAsBase64(path); + if (base64) { + return processImagePaste(base64); + } + } else if (ext === 'gif') { + // For GIF files, load with animation frames preserved + const base64 = await readImageAsBase64(path); + if (base64) { + try { + const gifData = await loadGifFromBase64(base64); + return { + type: 'gif', + gifData: { + src: base64, + width: gifData.width, + height: gifData.height, + frames: gifData.frames.map(f => f.bitmap), + frameDelays: gifData.frames.map(f => f.delay), + }, + }; + } catch (error) { + console.error('Failed to parse GIF:', error); + // Fallback to static image + return processImagePaste(base64); + } + } + } + } + + // Return file paths for further processing (multiple files) + return { + type: 'files', + filePaths, + }; +} + +// ============================================ +// YouTube URL Detection +// ============================================ + +/** + * Extract YouTube video ID from URL + */ +export function extractYouTubeId(text: string): string | null { + const patterns = [ + /(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/, + /youtube\.com\/shorts\/([a-zA-Z0-9_-]{11})/, + ]; + + for (const pattern of patterns) { + const match = text.match(pattern); + if (match) { + return match[1]; + } + } + + return null; +} + +// ============================================ +// Utility Functions +// ============================================ + +/** + * Check if clipboard contains image data + */ +export async function hasClipboardImage(): Promise { + const content = await readClipboard(); + return content.type === 'image'; +} + +/** + * Check if clipboard contains text data + */ +export async function hasClipboardText(): Promise { + const content = await readClipboard(); + return content.type === 'text'; +} + +/** + * Get clipboard content type + */ +export async function getClipboardType(): Promise<'image' | 'text' | 'files' | 'empty'> { + const content = await readClipboard(); + return content.type; +} diff --git a/src/utils/gif.ts b/src/utils/gif.ts new file mode 100644 index 0000000..459f1ec --- /dev/null +++ b/src/utils/gif.ts @@ -0,0 +1,631 @@ +/** + * GIF processing utilities + * + * This module provides GIF parsing, frame extraction, and animation control. + * Uses a custom GIF parser to extract individual frames and timing information. + */ + +import { base64ToBlob, blobToBase64 } from './image'; + +// ============================================ +// GIF Frame Types +// ============================================ + +export interface GifFrame { + /** ImageBitmap for this frame */ + bitmap: ImageBitmap; + /** Delay in milliseconds before showing next frame */ + delay: number; + /** Frame index */ + index: number; +} + +export interface GifData { + /** All frames of the GIF */ + frames: GifFrame[]; + /** Total duration of one loop in milliseconds */ + totalDuration: number; + /** Width of the GIF */ + width: number; + /** Height of the GIF */ + height: number; + /** Number of loops (0 = infinite) */ + loopCount: number; + /** Original base64 data for copying */ + originalData: string; +} + +// ============================================ +// GIF Parser +// ============================================ + +/** + * Parse GIF file and extract all frames + * Uses canvas-based approach for broad compatibility + */ +export async function parseGif(source: File | Blob | string): Promise { + let blob: Blob; + let originalData: string; + + if (typeof source === 'string') { + // Base64 data URL + blob = base64ToBlob(source); + originalData = source; + } else { + blob = source; + originalData = await blobToBase64(blob); + } + + const arrayBuffer = await blob.arrayBuffer(); + const frames = await extractGifFrames(arrayBuffer); + + if (frames.length === 0) { + throw new Error('No frames found in GIF'); + } + + const totalDuration = frames.reduce((sum, frame) => sum + frame.delay, 0); + const { width, height } = frames[0].bitmap; + + return { + frames, + totalDuration, + width, + height, + loopCount: 0, // Default to infinite loop + originalData, + }; +} + +/** + * Extract frames from GIF ArrayBuffer using low-level parsing + */ +async function extractGifFrames(buffer: ArrayBuffer): Promise { + const data = new Uint8Array(buffer); + const frames: GifFrame[] = []; + + // Verify GIF signature + const signature = String.fromCharCode(...data.slice(0, 6)); + if (!signature.startsWith('GIF')) { + throw new Error('Invalid GIF file'); + } + + // Parse logical screen descriptor + const width = data[6] | (data[7] << 8); + const height = data[8] | (data[9] << 8); + const packed = data[10]; + const hasGlobalColorTable = (packed & 0x80) !== 0; + const globalColorTableSize = hasGlobalColorTable ? 3 * (1 << ((packed & 0x07) + 1)) : 0; + + // Skip global color table + let offset = 13 + globalColorTableSize; + + // Create canvas for compositing frames + const canvas = document.createElement('canvas'); + canvas.width = width; + canvas.height = height; + const ctx = canvas.getContext('2d')!; + + // Previous frame canvas for disposal + const prevCanvas = document.createElement('canvas'); + prevCanvas.width = width; + prevCanvas.height = height; + const prevCtx = prevCanvas.getContext('2d')!; + + let frameIndex = 0; + let delay = 100; // Default delay in ms + let disposalMethod = 0; + let transparentIndex = -1; + let hasTransparency = false; + + // Parse blocks + while (offset < data.length) { + const blockType = data[offset++]; + + if (blockType === 0x21) { + // Extension block + const extType = data[offset++]; + + if (extType === 0xF9) { + // Graphics Control Extension + const blockSize = data[offset++]; + const packedByte = data[offset]; + disposalMethod = (packedByte >> 2) & 0x07; + hasTransparency = (packedByte & 0x01) !== 0; + delay = (data[offset + 1] | (data[offset + 2] << 8)) * 10; // Convert to ms + if (delay === 0) delay = 100; // Minimum delay + transparentIndex = hasTransparency ? data[offset + 3] : -1; + offset += blockSize + 1; // +1 for block terminator + } else { + // Skip other extensions + while (data[offset] !== 0) { + offset += data[offset] + 1; + } + offset++; // Block terminator + } + } else if (blockType === 0x2C) { + // Image descriptor + const frameLeft = data[offset] | (data[offset + 1] << 8); + const frameTop = data[offset + 2] | (data[offset + 3] << 8); + const frameWidth = data[offset + 4] | (data[offset + 5] << 8); + const frameHeight = data[offset + 6] | (data[offset + 7] << 8); + const framePacked = data[offset + 8]; + offset += 9; + + const hasLocalColorTable = (framePacked & 0x80) !== 0; + const interlaced = (framePacked & 0x40) !== 0; + const localColorTableSize = hasLocalColorTable ? 3 * (1 << ((framePacked & 0x07) + 1)) : 0; + + // Get color table + let colorTable: Uint8Array; + if (hasLocalColorTable) { + colorTable = data.slice(offset, offset + localColorTableSize); + offset += localColorTableSize; + } else { + colorTable = data.slice(13, 13 + globalColorTableSize); + } + + // Decode LZW compressed image data + const minCodeSize = data[offset++]; + const imageData = decodeLZW(data, offset, minCodeSize, frameWidth * frameHeight); + + // Skip to end of image data + while (data[offset] !== 0) { + offset += data[offset] + 1; + } + offset++; // Block terminator + + // Handle disposal method + if (disposalMethod === 2) { + // Restore to background + ctx.clearRect(frameLeft, frameTop, frameWidth, frameHeight); + } else if (disposalMethod === 3) { + // Restore to previous + ctx.drawImage(prevCanvas, 0, 0); + } + + // Save current state for potential restoration + prevCtx.clearRect(0, 0, width, height); + prevCtx.drawImage(canvas, 0, 0); + + // Draw frame pixels + const frameImageData = ctx.createImageData(frameWidth, frameHeight); + let pixelIndex = 0; + + for (let y = 0; y < frameHeight; y++) { + const row = interlaced ? getInterlacedRow(y, frameHeight) : y; + for (let x = 0; x < frameWidth; x++) { + const colorIndex = imageData[row * frameWidth + x]; + const destIndex = (y * frameWidth + x) * 4; + + if (hasTransparency && colorIndex === transparentIndex) { + frameImageData.data[destIndex] = 0; + frameImageData.data[destIndex + 1] = 0; + frameImageData.data[destIndex + 2] = 0; + frameImageData.data[destIndex + 3] = 0; + } else { + const colorOffset = colorIndex * 3; + frameImageData.data[destIndex] = colorTable[colorOffset]; + frameImageData.data[destIndex + 1] = colorTable[colorOffset + 1]; + frameImageData.data[destIndex + 2] = colorTable[colorOffset + 2]; + frameImageData.data[destIndex + 3] = 255; + } + pixelIndex++; + } + } + + // Create temporary canvas for frame + const tempCanvas = document.createElement('canvas'); + tempCanvas.width = frameWidth; + tempCanvas.height = frameHeight; + const tempCtx = tempCanvas.getContext('2d')!; + tempCtx.putImageData(frameImageData, 0, 0); + + // Composite frame onto main canvas + ctx.drawImage(tempCanvas, frameLeft, frameTop); + + // Create ImageBitmap from current canvas state + const bitmap = await createImageBitmap(canvas); + + frames.push({ + bitmap, + delay, + index: frameIndex++, + }); + + // Reset for next frame + delay = 100; + transparentIndex = -1; + hasTransparency = false; + } else if (blockType === 0x3B) { + // Trailer - end of GIF + break; + } else { + // Unknown block, try to skip + break; + } + } + + return frames; +} + +/** + * Decode LZW compressed data + */ +function decodeLZW( + data: Uint8Array, + offset: number, + minCodeSize: number, + pixelCount: number +): Uint8Array { + const clearCode = 1 << minCodeSize; + const endCode = clearCode + 1; + let codeSize = minCodeSize + 1; + let codeMask = (1 << codeSize) - 1; + let nextCode = endCode + 1; + + // Initialize code table + const codeTable: number[][] = []; + for (let i = 0; i < clearCode; i++) { + codeTable[i] = [i]; + } + + const output = new Uint8Array(pixelCount); + let outputIndex = 0; + + // Read sub-blocks + let bitBuffer = 0; + let bitsInBuffer = 0; + let blockOffset = offset; + let blockSize = data[blockOffset++]; + let blockIndex = 0; + + function readCode(): number { + while (bitsInBuffer < codeSize) { + if (blockIndex >= blockSize) { + blockSize = data[blockOffset++]; + blockIndex = 0; + if (blockSize === 0) return endCode; + } + bitBuffer |= data[blockOffset++] << bitsInBuffer; + blockIndex++; + bitsInBuffer += 8; + } + const code = bitBuffer & codeMask; + bitBuffer >>= codeSize; + bitsInBuffer -= codeSize; + return code; + } + + let prevCode = -1; + + while (outputIndex < pixelCount) { + const code = readCode(); + + if (code === clearCode) { + // Reset + codeSize = minCodeSize + 1; + codeMask = (1 << codeSize) - 1; + nextCode = endCode + 1; + codeTable.length = clearCode; + for (let i = 0; i < clearCode; i++) { + codeTable[i] = [i]; + } + prevCode = -1; + continue; + } + + if (code === endCode) { + break; + } + + let sequence: number[]; + + if (code < nextCode) { + sequence = codeTable[code]; + } else if (code === nextCode && prevCode !== -1) { + sequence = [...codeTable[prevCode], codeTable[prevCode][0]]; + } else { + // Invalid code + break; + } + + // Output sequence + for (const pixel of sequence) { + if (outputIndex < pixelCount) { + output[outputIndex++] = pixel; + } + } + + // Add new code to table + if (prevCode !== -1 && nextCode < 4096) { + codeTable[nextCode++] = [...codeTable[prevCode], sequence[0]]; + + // Increase code size if needed + if (nextCode > codeMask && codeSize < 12) { + codeSize++; + codeMask = (1 << codeSize) - 1; + } + } + + prevCode = code; + } + + return output; +} + +/** + * Get interlaced row mapping + */ +function getInterlacedRow(y: number, height: number): number { + const pass1Rows = Math.ceil(height / 8); + const pass2Rows = Math.ceil((height - 4) / 8); + const pass3Rows = Math.ceil((height - 2) / 4); + + if (y < pass1Rows) { + return y * 8; + } else if (y < pass1Rows + pass2Rows) { + return (y - pass1Rows) * 8 + 4; + } else if (y < pass1Rows + pass2Rows + pass3Rows) { + return (y - pass1Rows - pass2Rows) * 4 + 2; + } else { + return (y - pass1Rows - pass2Rows - pass3Rows) * 2 + 1; + } +} + +// ============================================ +// GIF Animation Controller +// ============================================ + +export class GifAnimator { + private gifData: GifData; + private currentFrameIndex: number = 0; + private isPlaying: boolean = false; + private animationTimer: number | null = null; + private onFrameChange: ((frame: GifFrame) => void) | null = null; + private startTime: number = 0; + + constructor(gifData: GifData) { + this.gifData = gifData; + } + + /** + * Set callback for frame changes + */ + setOnFrameChange(callback: (frame: GifFrame) => void): void { + this.onFrameChange = callback; + } + + /** + * Start animation playback + */ + play(): void { + if (this.isPlaying) return; + this.isPlaying = true; + this.startTime = performance.now() - this.getElapsedTimeForFrame(this.currentFrameIndex); + this.scheduleNextFrame(); + } + + /** + * Pause animation playback + */ + pause(): void { + this.isPlaying = false; + if (this.animationTimer !== null) { + cancelAnimationFrame(this.animationTimer); + this.animationTimer = null; + } + } + + /** + * Stop animation and reset to first frame + */ + stop(): void { + this.pause(); + this.currentFrameIndex = 0; + this.notifyFrameChange(); + } + + /** + * Toggle play/pause + */ + toggle(): void { + if (this.isPlaying) { + this.pause(); + } else { + this.play(); + } + } + + /** + * Go to a specific frame + */ + goToFrame(index: number): void { + if (index < 0 || index >= this.gifData.frames.length) return; + this.currentFrameIndex = index; + this.startTime = performance.now() - this.getElapsedTimeForFrame(index); + this.notifyFrameChange(); + } + + /** + * Go to next frame + */ + nextFrame(): void { + this.currentFrameIndex = (this.currentFrameIndex + 1) % this.gifData.frames.length; + this.notifyFrameChange(); + } + + /** + * Go to previous frame + */ + prevFrame(): void { + this.currentFrameIndex = + (this.currentFrameIndex - 1 + this.gifData.frames.length) % this.gifData.frames.length; + this.notifyFrameChange(); + } + + /** + * Get current frame + */ + getCurrentFrame(): GifFrame { + return this.gifData.frames[this.currentFrameIndex]; + } + + /** + * Get current frame index + */ + getCurrentFrameIndex(): number { + return this.currentFrameIndex; + } + + /** + * Get total frame count + */ + getFrameCount(): number { + return this.gifData.frames.length; + } + + /** + * Check if animation is playing + */ + getIsPlaying(): boolean { + return this.isPlaying; + } + + /** + * Get GIF data + */ + getGifData(): GifData { + return this.gifData; + } + + /** + * Calculate elapsed time for a given frame index + */ + private getElapsedTimeForFrame(frameIndex: number): number { + let elapsed = 0; + for (let i = 0; i < frameIndex; i++) { + elapsed += this.gifData.frames[i].delay; + } + return elapsed; + } + + /** + * Schedule the next frame update + */ + private scheduleNextFrame(): void { + if (!this.isPlaying) return; + + this.animationTimer = requestAnimationFrame(() => { + const elapsed = performance.now() - this.startTime; + const loopedElapsed = elapsed % this.gifData.totalDuration; + + // Find current frame based on elapsed time + let accumulatedTime = 0; + let newFrameIndex = 0; + + for (let i = 0; i < this.gifData.frames.length; i++) { + accumulatedTime += this.gifData.frames[i].delay; + if (loopedElapsed < accumulatedTime) { + newFrameIndex = i; + break; + } + } + + if (newFrameIndex !== this.currentFrameIndex) { + this.currentFrameIndex = newFrameIndex; + this.notifyFrameChange(); + } + + this.scheduleNextFrame(); + }); + } + + /** + * Notify frame change callback + */ + private notifyFrameChange(): void { + if (this.onFrameChange) { + this.onFrameChange(this.getCurrentFrame()); + } + } + + /** + * Destroy the animator and release resources + */ + destroy(): void { + this.pause(); + this.onFrameChange = null; + } +} + +// ============================================ +// GIF Loading Helpers +// ============================================ + +/** + * Load GIF from a File + */ +export async function loadGifFromFile(file: File): Promise { + return parseGif(file); +} + +/** + * Load GIF from a base64 data URL + */ +export async function loadGifFromBase64(base64DataUrl: string): Promise { + return parseGif(base64DataUrl); +} + +/** + * Load GIF from a URL + */ +export async function loadGifFromUrl(url: string): Promise { + const response = await fetch(url); + const blob = await response.blob(); + return parseGif(blob); +} + +// ============================================ +// GIF Copy Support +// ============================================ + +/** + * Get the original GIF data as a Blob for clipboard operations + * This preserves the animation when copying + */ +export function getGifAsBlob(gifData: GifData): Blob { + return base64ToBlob(gifData.originalData); +} + +/** + * Get the original GIF data as base64 for serialization + */ +export function getGifAsBase64(gifData: GifData): string { + return gifData.originalData; +} + +/** + * Check if a file is an animated GIF (has multiple frames) + */ +export async function isAnimatedGif(source: File | Blob): Promise { + try { + const gifData = await parseGif(source); + return gifData.frames.length > 1; + } catch { + return false; + } +} + +// ============================================ +// Cleanup +// ============================================ + +/** + * Release all ImageBitmaps in a GifData object + */ +export function disposeGifData(gifData: GifData): void { + for (const frame of gifData.frames) { + frame.bitmap.close(); + } + gifData.frames = []; +} diff --git a/src/utils/image.ts b/src/utils/image.ts new file mode 100644 index 0000000..928a6b2 --- /dev/null +++ b/src/utils/image.ts @@ -0,0 +1,375 @@ +/** + * Image processing utilities + */ + +// Supported image formats +export const SUPPORTED_IMAGE_FORMATS = ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp']; +export const SUPPORTED_IMAGE_MIME_TYPES = [ + 'image/png', + 'image/jpeg', + 'image/gif', + 'image/bmp', + 'image/webp', +]; + +/** + * Check if a file is a supported image format + */ +export function isSupportedImageFormat(filename: string): boolean { + const ext = filename.split('.').pop()?.toLowerCase() || ''; + return SUPPORTED_IMAGE_FORMATS.includes(ext); +} + +/** + * Check if a MIME type is a supported image format + */ +export function isSupportedImageMimeType(mimeType: string): boolean { + return SUPPORTED_IMAGE_MIME_TYPES.includes(mimeType); +} + +/** + * Check if a file is a GIF + */ +export function isGifFile(filename: string): boolean { + return filename.toLowerCase().endsWith('.gif'); +} + +/** + * Check if a MIME type is GIF + */ +export function isGifMimeType(mimeType: string): boolean { + return mimeType === 'image/gif'; +} + +// ============================================ +// Image Loading +// ============================================ + +/** + * Load an image from a File object and create an ImageBitmap + */ +export async function loadImageFromFile(file: File): Promise { + return createImageBitmap(file); +} + +/** + * Load an image from a Blob and create an ImageBitmap + */ +export async function loadImageFromBlob(blob: Blob): Promise { + return createImageBitmap(blob); +} + +/** + * Load an image from a URL and create an ImageBitmap + */ +export async function loadImageFromUrl(url: string): Promise { + const response = await fetch(url); + const blob = await response.blob(); + return createImageBitmap(blob); +} + +/** + * Load an image from a base64 data URL and create an ImageBitmap + */ +export async function loadImageFromBase64(base64DataUrl: string): Promise { + const blob = base64ToBlob(base64DataUrl); + return createImageBitmap(blob); +} + +/** + * Load an image from an ArrayBuffer and create an ImageBitmap + */ +export async function loadImageFromArrayBuffer( + buffer: ArrayBuffer, + mimeType: string = 'image/png' +): Promise { + const blob = new Blob([buffer], { type: mimeType }); + return createImageBitmap(blob); +} + +// ============================================ +// Base64 Encoding/Decoding +// ============================================ + +/** + * Convert a Blob to a base64 data URL + */ +export function blobToBase64(blob: Blob): Promise { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.onload = () => { + if (typeof reader.result === 'string') { + resolve(reader.result); + } else { + reject(new Error('Failed to read blob as base64')); + } + }; + reader.onerror = () => reject(reader.error); + reader.readAsDataURL(blob); + }); +} + +/** + * Convert a File to a base64 data URL + */ +export function fileToBase64(file: File): Promise { + return blobToBase64(file); +} + +/** + * Convert an ArrayBuffer to a base64 data URL + */ +export function arrayBufferToBase64(buffer: ArrayBuffer, mimeType: string = 'image/png'): string { + const bytes = new Uint8Array(buffer); + let binary = ''; + for (let i = 0; i < bytes.byteLength; i++) { + binary += String.fromCharCode(bytes[i]); + } + return `data:${mimeType};base64,${btoa(binary)}`; +} + +/** + * Convert a base64 data URL to a Blob + */ +export function base64ToBlob(base64DataUrl: string): Blob { + // Extract the base64 content and MIME type + const matches = base64DataUrl.match(/^data:([^;]+);base64,(.+)$/); + if (!matches) { + throw new Error('Invalid base64 data URL format'); + } + + const mimeType = matches[1]; + const base64Content = matches[2]; + + // Decode base64 to binary + const binaryString = atob(base64Content); + const bytes = new Uint8Array(binaryString.length); + for (let i = 0; i < binaryString.length; i++) { + bytes[i] = binaryString.charCodeAt(i); + } + + return new Blob([bytes], { type: mimeType }); +} + +/** + * Convert a base64 data URL to an ArrayBuffer + */ +export function base64ToArrayBuffer(base64DataUrl: string): ArrayBuffer { + const blob = base64ToBlob(base64DataUrl); + return blob.arrayBuffer() as unknown as ArrayBuffer; +} + +/** + * Extract MIME type from a base64 data URL + */ +export function getMimeTypeFromBase64(base64DataUrl: string): string | null { + const matches = base64DataUrl.match(/^data:([^;]+);base64,/); + return matches ? matches[1] : null; +} + +/** + * Check if a string is a valid base64 data URL + */ +export function isBase64DataUrl(str: string): boolean { + return /^data:[^;]+;base64,/.test(str); +} + +// ============================================ +// Image Information +// ============================================ + +export interface ImageInfo { + width: number; + height: number; + aspectRatio: number; +} + +/** + * Get image dimensions from an ImageBitmap + */ +export function getImageInfo(image: ImageBitmap): ImageInfo { + return { + width: image.width, + height: image.height, + aspectRatio: image.width / image.height, + }; +} + +/** + * Get image dimensions from a File without fully loading it + */ +export async function getImageInfoFromFile(file: File): Promise { + const bitmap = await createImageBitmap(file); + const info = getImageInfo(bitmap); + bitmap.close(); + return info; +} + +/** + * Get image dimensions from a base64 data URL + */ +export async function getImageInfoFromBase64(base64DataUrl: string): Promise { + const blob = base64ToBlob(base64DataUrl); + const bitmap = await createImageBitmap(blob); + const info = getImageInfo(bitmap); + bitmap.close(); + return info; +} + +// ============================================ +// Image Conversion +// ============================================ + +/** + * Convert an ImageBitmap to a canvas + */ +export function imageBitmapToCanvas(image: ImageBitmap): HTMLCanvasElement { + const canvas = document.createElement('canvas'); + canvas.width = image.width; + canvas.height = image.height; + const ctx = canvas.getContext('2d'); + if (!ctx) { + throw new Error('Failed to get 2D context'); + } + ctx.drawImage(image, 0, 0); + return canvas; +} + +/** + * Convert an ImageBitmap to a base64 data URL + */ +export async function imageBitmapToBase64( + image: ImageBitmap, + mimeType: string = 'image/png', + quality: number = 0.92 +): Promise { + const canvas = imageBitmapToCanvas(image); + return canvas.toDataURL(mimeType, quality); +} + +/** + * Convert an ImageBitmap to a Blob + */ +export function imageBitmapToBlob( + image: ImageBitmap, + mimeType: string = 'image/png', + quality: number = 0.92 +): Promise { + return new Promise((resolve, reject) => { + const canvas = imageBitmapToCanvas(image); + canvas.toBlob( + (blob) => { + if (blob) { + resolve(blob); + } else { + reject(new Error('Failed to convert ImageBitmap to Blob')); + } + }, + mimeType, + quality + ); + }); +} + +// ============================================ +// Image Manipulation +// ============================================ + +/** + * Resize an ImageBitmap to fit within max dimensions while maintaining aspect ratio + */ +export async function resizeImageBitmap( + image: ImageBitmap, + maxWidth: number, + maxHeight: number +): Promise { + const { width, height } = image; + + // Calculate scale to fit within bounds + const scale = Math.min(maxWidth / width, maxHeight / height, 1); + + if (scale >= 1) { + // No resize needed, return a copy + return createImageBitmap(image); + } + + const newWidth = Math.round(width * scale); + const newHeight = Math.round(height * scale); + + return createImageBitmap(image, { + resizeWidth: newWidth, + resizeHeight: newHeight, + resizeQuality: 'high', + }); +} + +/** + * Crop an ImageBitmap to a specific region + */ +export async function cropImageBitmap( + image: ImageBitmap, + x: number, + y: number, + width: number, + height: number +): Promise { + return createImageBitmap(image, x, y, width, height); +} + +// ============================================ +// Utility Functions +// ============================================ + +/** + * Read a File as an ArrayBuffer + */ +export function readFileAsArrayBuffer(file: File): Promise { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.onload = () => { + if (reader.result instanceof ArrayBuffer) { + resolve(reader.result); + } else { + reject(new Error('Failed to read file as ArrayBuffer')); + } + }; + reader.onerror = () => reject(reader.error); + reader.readAsArrayBuffer(file); + }); +} + +/** + * Create a download link for an image + */ +export function downloadImage( + dataUrl: string, + filename: string = 'image.png' +): void { + const link = document.createElement('a'); + link.href = dataUrl; + link.download = filename; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); +} + +/** + * Load image from clipboard + */ +export async function loadImageFromClipboard(): Promise { + try { + const clipboardItems = await navigator.clipboard.read(); + for (const item of clipboardItems) { + for (const type of item.types) { + if (isSupportedImageMimeType(type)) { + const blob = await item.getType(type); + return createImageBitmap(blob); + } + } + } + return null; + } catch { + console.warn('Failed to read image from clipboard'); + return null; + } +} diff --git a/src/utils/math.ts b/src/utils/math.ts new file mode 100644 index 0000000..85893e0 --- /dev/null +++ b/src/utils/math.ts @@ -0,0 +1,14 @@ +// Math utilities for coordinate transformations +// Implementation will be added as needed + +export function clamp(value: number, min: number, max: number): number { + return Math.min(Math.max(value, min), max); +} + +export function lerp(a: number, b: number, t: number): number { + return a + (b - a) * t; +} + +export function generateId(): string { + return `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`; +} diff --git a/src/utils/scene-service.ts b/src/utils/scene-service.ts new file mode 100644 index 0000000..878eda5 --- /dev/null +++ b/src/utils/scene-service.ts @@ -0,0 +1,485 @@ +/** + * Scene Service + * Handles scene save/load operations with Tauri backend + */ + +import { invoke } from '@tauri-apps/api/core'; +import { getSceneManager, type SceneManager } from '../core/scene'; +import { sceneToJson, loadSceneFromJson } from '../core/scene/serializer'; + +// ============================================ +// Types +// ============================================ + +export interface FileDialogResult { + path: string | null; + cancelled: boolean; +} + +export interface RecentFile { + path: string; + name: string; + timestamp: number; +} + +// ============================================ +// Constants +// ============================================ + +const RECENT_FILES_KEY = 'refvroid_recent_files'; +const LAST_SCENE_KEY = 'refvroid_last_scene'; +const AUTO_SAVE_KEY = 'refvroid_auto_save'; +const MAX_RECENT_FILES = 10; +const AUTO_SAVE_INTERVAL = 60000; // 1 minute + +// ============================================ +// Scene Service Class +// ============================================ + +export class SceneService { + private sceneManager: SceneManager; + private currentFilePath: string | null = null; + private autoSaveTimer: number | null = null; + private isDirty: boolean = false; + private onDirtyChange: ((dirty: boolean) => void) | null = null; + private onFileNameChange: ((fileName: string | null) => void) | null = null; + + constructor(sceneManager?: SceneManager) { + this.sceneManager = sceneManager || getSceneManager(); + } + + // ============================================ + // File Path Management + // ============================================ + + getCurrentFilePath(): string | null { + return this.currentFilePath; + } + + getCurrentFileName(): string | null { + if (!this.currentFilePath) return null; + // Extract filename from path + const parts = this.currentFilePath.replace(/\\/g, '/').split('/'); + return parts[parts.length - 1] || null; + } + + setCurrentFilePath(path: string | null): void { + this.currentFilePath = path; + if (path) { + this.addToRecentFiles(path); + this.saveLastScenePath(path); + } + // Notify file name change + this.onFileNameChange?.(this.getCurrentFileName()); + } + + /** + * Set callback for file name changes + */ + setOnFileNameChange(callback: (fileName: string | null) => void): void { + this.onFileNameChange = callback; + } + + // ============================================ + // Dirty State Management + // ============================================ + + markDirty(): void { + if (!this.isDirty) { + this.isDirty = true; + this.onDirtyChange?.(true); + } + } + + markClean(): void { + if (this.isDirty) { + this.isDirty = false; + this.onDirtyChange?.(false); + } + } + + getIsDirty(): boolean { + return this.isDirty; + } + + setOnDirtyChange(callback: (dirty: boolean) => void): void { + this.onDirtyChange = callback; + } + + // ============================================ + // Save Operations + // ============================================ + + /** + * Save scene to current file or show save dialog + */ + async save(): Promise { + if (this.currentFilePath) { + return this.saveToPath(this.currentFilePath); + } + return this.saveAs(); + } + + /** + * Show save dialog and save scene + */ + async saveAs(): Promise { + try { + const result = await invoke('show_save_dialog', { + defaultName: this.getDefaultFileName(), + }); + + if (result.cancelled || !result.path) { + return false; + } + + return this.saveToPath(result.path); + } catch (error) { + console.error('Failed to show save dialog:', error); + return false; + } + } + + /** + * Save scene to specific path + */ + async saveToPath(path: string): Promise { + try { + const json = sceneToJson(this.sceneManager); + await invoke('save_scene', { path, data: json }); + + this.setCurrentFilePath(path); + this.markClean(); + // Clear auto-save since we saved to file + this.clearAutoSave(); + + console.log('Scene saved to:', path); + return true; + } catch (error) { + console.error('Failed to save scene:', error); + return false; + } + } + + private getDefaultFileName(): string { + if (this.currentFilePath) { + const parts = this.currentFilePath.split(/[/\\]/); + return parts[parts.length - 1]; + } + return 'scene.purgif'; + } + + // ============================================ + // Load Operations + // ============================================ + + /** + * Show open dialog and load scene + */ + async load(): Promise { + try { + const result = await invoke('show_open_dialog', {}); + + if (result.cancelled || !result.path) { + return false; + } + + return this.loadFromPath(result.path); + } catch (error) { + console.error('Failed to show open dialog:', error); + return false; + } + } + + /** + * Load scene from specific path + */ + async loadFromPath(path: string): Promise { + try { + const json = await invoke('load_scene', { path }); + loadSceneFromJson(this.sceneManager, json); + + this.setCurrentFilePath(path); + this.markClean(); + + console.log('Scene loaded from:', path); + return true; + } catch (error) { + console.error('Failed to load scene:', error); + return false; + } + } + + // ============================================ + // New Scene + // ============================================ + + /** + * Create new empty scene + */ + newScene(): void { + this.sceneManager.clear(); + this.setCurrentFilePath(null); // This will trigger file name change callback + this.markClean(); + this.clearAutoSave(); + this.clearLastScenePath(); // Clear last scene path so Ctrl+R won't reload old scene + } + + // ============================================ + // Recent Files + // ============================================ + + /** + * Get list of recent files + */ + getRecentFiles(): RecentFile[] { + try { + const stored = localStorage.getItem(RECENT_FILES_KEY); + if (!stored) return []; + return JSON.parse(stored) as RecentFile[]; + } catch { + return []; + } + } + + /** + * Add file to recent files list + */ + private addToRecentFiles(path: string): void { + try { + const recent = this.getRecentFiles(); + + // Remove if already exists + const filtered = recent.filter(f => f.path !== path); + + // Add to front + const name = path.split(/[/\\]/).pop() || path; + filtered.unshift({ + path, + name, + timestamp: Date.now(), + }); + + // Limit to max + const limited = filtered.slice(0, MAX_RECENT_FILES); + + localStorage.setItem(RECENT_FILES_KEY, JSON.stringify(limited)); + } catch (error) { + console.error('Failed to update recent files:', error); + } + } + + /** + * Clear recent files list + */ + clearRecentFiles(): void { + localStorage.removeItem(RECENT_FILES_KEY); + } + + /** + * Remove a file from recent files + */ + removeFromRecentFiles(path: string): void { + try { + const recent = this.getRecentFiles(); + const filtered = recent.filter(f => f.path !== path); + localStorage.setItem(RECENT_FILES_KEY, JSON.stringify(filtered)); + } catch (error) { + console.error('Failed to remove from recent files:', error); + } + } + + // ============================================ + // Last Scene Path + // ============================================ + + /** + * Save last opened scene path + */ + private saveLastScenePath(path: string): void { + try { + localStorage.setItem(LAST_SCENE_KEY, path); + } catch (error) { + console.error('Failed to save last scene path:', error); + } + } + + /** + * Get last opened scene path + */ + getLastScenePath(): string | null { + try { + return localStorage.getItem(LAST_SCENE_KEY); + } catch { + return null; + } + } + + /** + * Clear last scene path + */ + clearLastScenePath(): void { + localStorage.removeItem(LAST_SCENE_KEY); + } + + // ============================================ + // Auto Save + // ============================================ + + /** + * Start auto-save timer + */ + startAutoSave(): void { + this.stopAutoSave(); + this.autoSaveTimer = window.setInterval(() => { + this.performAutoSave(); + }, AUTO_SAVE_INTERVAL); + } + + /** + * Stop auto-save timer + */ + stopAutoSave(): void { + if (this.autoSaveTimer !== null) { + clearInterval(this.autoSaveTimer); + this.autoSaveTimer = null; + } + } + + /** + * Perform auto-save + */ + private performAutoSave(): void { + if (!this.isDirty) return; + this.saveAutoSave(); + } + + /** + * Trigger immediate auto-save (public method for important operations) + */ + triggerAutoSave(): void { + this.saveAutoSave(); + } + + /** + * Save auto-save data to localStorage + */ + private saveAutoSave(): void { + try { + const json = sceneToJson(this.sceneManager); + const autoSaveData = { + json, + path: this.currentFilePath, + timestamp: Date.now(), + }; + localStorage.setItem(AUTO_SAVE_KEY, JSON.stringify(autoSaveData)); + } catch (error) { + console.error('Failed to auto-save:', error); + } + } + + /** + * Get auto-save data + */ + getAutoSave(): { json: string; path: string | null; timestamp: number } | null { + try { + const stored = localStorage.getItem(AUTO_SAVE_KEY); + if (!stored) return null; + return JSON.parse(stored); + } catch { + return null; + } + } + + /** + * Restore from auto-save + */ + restoreAutoSave(): boolean { + const autoSave = this.getAutoSave(); + if (!autoSave) return false; + + try { + loadSceneFromJson(this.sceneManager, autoSave.json); + this.currentFilePath = autoSave.path; + this.markDirty(); // Mark dirty since it's recovered + return true; + } catch (error) { + console.error('Failed to restore auto-save:', error); + return false; + } + } + + /** + * Clear auto-save data + */ + clearAutoSave(): void { + localStorage.removeItem(AUTO_SAVE_KEY); + } + + /** + * Check if auto-save exists + */ + hasAutoSave(): boolean { + return this.getAutoSave() !== null; + } + + // ============================================ + // Startup Loading + // ============================================ + + /** + * Load scene on startup - always load from file, not localStorage + */ + async loadOnStartup(): Promise { + // Always try to load from last saved file first + const lastPath = this.getLastScenePath(); + if (lastPath) { + try { + // Check if file exists + const exists = await invoke('file_exists', { path: lastPath }); + if (exists) { + console.log('Loading last scene from file:', lastPath); + const success = await this.loadFromPath(lastPath); + if (success) { + // Clear any stale auto-save data + this.clearAutoSave(); + return true; + } + } + } catch (error) { + console.error('Failed to load last scene:', error); + } + } + + return false; + } + + // ============================================ + // Cleanup + // ============================================ + + destroy(): void { + this.stopAutoSave(); + this.onDirtyChange = null; + } +} + +// ============================================ +// Singleton Instance +// ============================================ + +let sceneServiceInstance: SceneService | null = null; + +export function getSceneService(): SceneService { + if (!sceneServiceInstance) { + sceneServiceInstance = new SceneService(); + } + return sceneServiceInstance; +} + +export function resetSceneService(): void { + if (sceneServiceInstance) { + sceneServiceInstance.destroy(); + sceneServiceInstance = null; + } +} diff --git a/src/utils/text.ts b/src/utils/text.ts new file mode 100644 index 0000000..1314349 --- /dev/null +++ b/src/utils/text.ts @@ -0,0 +1,479 @@ +/** + * Text rendering utilities + * + * This module provides text-to-canvas rendering for WebGPU texture creation. + * Text is rendered to an offscreen canvas which can then be used as a texture source. + */ + +// ============================================ +// Text Style Types +// ============================================ + +export interface TextStyle { + /** Font size in pixels */ + fontSize: number; + /** Font family */ + fontFamily: string; + /** Font weight (normal, bold, etc.) */ + fontWeight: string; + /** Font style (normal, italic) */ + fontStyle: string; + /** Text color (CSS color string) */ + color: string; + /** Background color (CSS color string, 'transparent' for none) */ + backgroundColor: string; + /** Text alignment */ + textAlign: CanvasTextAlign; + /** Vertical alignment */ + verticalAlign: 'top' | 'middle' | 'bottom'; + /** Line height multiplier */ + lineHeight: number; + /** Padding in pixels */ + padding: number; + /** Maximum width (0 for auto) */ + maxWidth: number; + /** Word wrap enabled */ + wordWrap: boolean; +} + +export interface TextMetrics { + width: number; + height: number; + lines: string[]; + lineHeights: number[]; +} + +// ============================================ +// Default Style +// ============================================ + +export const DEFAULT_TEXT_STYLE: TextStyle = { + fontSize: 16, + fontFamily: 'Arial, sans-serif', + fontWeight: 'normal', + fontStyle: 'normal', + color: '#ffffff', + backgroundColor: 'transparent', + textAlign: 'left', + verticalAlign: 'top', + lineHeight: 1.2, + padding: 8, + maxWidth: 0, + wordWrap: true, +}; + +// ============================================ +// Text Measurement +// ============================================ + +/** + * Measure text dimensions without rendering + */ +export function measureText( + text: string, + style: Partial = {} +): TextMetrics { + const fullStyle = { ...DEFAULT_TEXT_STYLE, ...style }; + + // Create temporary canvas for measurement + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d')!; + + // Set font + ctx.font = `${fullStyle.fontStyle} ${fullStyle.fontWeight} ${fullStyle.fontSize}px ${fullStyle.fontFamily}`; + + // Split text into lines + const lines = splitTextIntoLines(ctx, text, fullStyle); + + // Calculate dimensions + const lineHeightPx = fullStyle.fontSize * fullStyle.lineHeight; + const lineHeights = lines.map(() => lineHeightPx); + + let maxLineWidth = 0; + for (const line of lines) { + const metrics = ctx.measureText(line); + maxLineWidth = Math.max(maxLineWidth, metrics.width); + } + + const width = Math.ceil(maxLineWidth + fullStyle.padding * 2); + const height = Math.ceil(lines.length * lineHeightPx + fullStyle.padding * 2); + + return { + width, + height, + lines, + lineHeights, + }; +} + +/** + * Split text into lines based on word wrap settings + */ +function splitTextIntoLines( + ctx: CanvasRenderingContext2D, + text: string, + style: TextStyle +): string[] { + // First split by explicit newlines + const paragraphs = text.split('\n'); + + if (!style.wordWrap || style.maxWidth <= 0) { + return paragraphs; + } + + const maxWidth = style.maxWidth - style.padding * 2; + const lines: string[] = []; + + for (const paragraph of paragraphs) { + if (paragraph === '') { + lines.push(''); + continue; + } + + const words = paragraph.split(' '); + let currentLine = ''; + + for (const word of words) { + const testLine = currentLine ? `${currentLine} ${word}` : word; + const metrics = ctx.measureText(testLine); + + if (metrics.width > maxWidth && currentLine) { + lines.push(currentLine); + currentLine = word; + } else { + currentLine = testLine; + } + } + + if (currentLine) { + lines.push(currentLine); + } + } + + return lines; +} + +// ============================================ +// Text Rendering +// ============================================ + +/** + * Render text to a canvas + */ +export function renderTextToCanvas( + text: string, + style: Partial = {} +): HTMLCanvasElement { + const fullStyle = { ...DEFAULT_TEXT_STYLE, ...style }; + + // Measure text first + const metrics = measureText(text, fullStyle); + + // Create canvas with measured dimensions + const canvas = document.createElement('canvas'); + canvas.width = metrics.width; + canvas.height = metrics.height; + + const ctx = canvas.getContext('2d')!; + + // Clear and fill background + if (fullStyle.backgroundColor !== 'transparent') { + ctx.fillStyle = fullStyle.backgroundColor; + ctx.fillRect(0, 0, canvas.width, canvas.height); + } else { + ctx.clearRect(0, 0, canvas.width, canvas.height); + } + + // Set text style + ctx.font = `${fullStyle.fontStyle} ${fullStyle.fontWeight} ${fullStyle.fontSize}px ${fullStyle.fontFamily}`; + ctx.fillStyle = fullStyle.color; + ctx.textAlign = fullStyle.textAlign; + ctx.textBaseline = 'top'; + + // Calculate starting position + const lineHeightPx = fullStyle.fontSize * fullStyle.lineHeight; + let startY = fullStyle.padding; + + // Adjust for vertical alignment + const totalTextHeight = metrics.lines.length * lineHeightPx; + if (fullStyle.verticalAlign === 'middle') { + startY = (canvas.height - totalTextHeight) / 2; + } else if (fullStyle.verticalAlign === 'bottom') { + startY = canvas.height - totalTextHeight - fullStyle.padding; + } + + // Calculate X position based on text alignment + let startX = fullStyle.padding; + if (fullStyle.textAlign === 'center') { + startX = canvas.width / 2; + } else if (fullStyle.textAlign === 'right') { + startX = canvas.width - fullStyle.padding; + } + + // Render each line + for (let i = 0; i < metrics.lines.length; i++) { + const y = startY + i * lineHeightPx; + ctx.fillText(metrics.lines[i], startX, y); + } + + return canvas; +} + +/** + * Render text to an ImageBitmap + */ +export async function renderTextToImageBitmap( + text: string, + style: Partial = {} +): Promise { + const canvas = renderTextToCanvas(text, style); + return createImageBitmap(canvas); +} + +// ============================================ +// Text Element Helper +// ============================================ + +export interface TextElementData { + content: string; + style: TextStyle; + canvas: HTMLCanvasElement; + metrics: TextMetrics; +} + +/** + * Create a text element with canvas and metrics + */ +export function createTextElement( + content: string, + style: Partial = {} +): TextElementData { + const fullStyle = { ...DEFAULT_TEXT_STYLE, ...style }; + const metrics = measureText(content, fullStyle); + const canvas = renderTextToCanvas(content, fullStyle); + + return { + content, + style: fullStyle, + canvas, + metrics, + }; +} + +/** + * Update text element content + */ +export function updateTextElement( + element: TextElementData, + content: string +): TextElementData { + const metrics = measureText(content, element.style); + const canvas = renderTextToCanvas(content, element.style); + + return { + ...element, + content, + canvas, + metrics, + }; +} + +/** + * Update text element style + */ +export function updateTextElementStyle( + element: TextElementData, + style: Partial +): TextElementData { + const fullStyle = { ...element.style, ...style }; + const metrics = measureText(element.content, fullStyle); + const canvas = renderTextToCanvas(element.content, fullStyle); + + return { + ...element, + style: fullStyle, + canvas, + metrics, + }; +} + +// ============================================ +// Auto-sizing Text +// ============================================ + +/** + * Calculate font size to fit text within given dimensions + */ +export function calculateFitFontSize( + text: string, + maxWidth: number, + maxHeight: number, + style: Partial = {}, + minFontSize: number = 8, + maxFontSize: number = 200 +): number { + let low = minFontSize; + let high = maxFontSize; + let bestSize = minFontSize; + + while (low <= high) { + const mid = Math.floor((low + high) / 2); + const testStyle = { ...style, fontSize: mid, maxWidth }; + const metrics = measureText(text, testStyle); + + if (metrics.width <= maxWidth && metrics.height <= maxHeight) { + bestSize = mid; + low = mid + 1; + } else { + high = mid - 1; + } + } + + return bestSize; +} + +/** + * Render text with auto-sizing to fit dimensions + */ +export function renderAutoSizedText( + text: string, + maxWidth: number, + maxHeight: number, + style: Partial = {} +): HTMLCanvasElement { + const fontSize = calculateFitFontSize(text, maxWidth, maxHeight, style); + return renderTextToCanvas(text, { ...style, fontSize, maxWidth }); +} + +// ============================================ +// Rich Text Support (Basic) +// ============================================ + +export interface RichTextSegment { + text: string; + style?: Partial; +} + +/** + * Render rich text with multiple styles + * Note: This is a simplified implementation that renders segments inline + */ +export function renderRichText( + segments: RichTextSegment[], + baseStyle: Partial = {} +): HTMLCanvasElement { + const fullBaseStyle = { ...DEFAULT_TEXT_STYLE, ...baseStyle }; + + // First pass: measure total width + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d')!; + + let totalWidth = fullBaseStyle.padding * 2; + let maxHeight = 0; + + for (const segment of segments) { + const segmentStyle = { ...fullBaseStyle, ...segment.style }; + ctx.font = `${segmentStyle.fontStyle} ${segmentStyle.fontWeight} ${segmentStyle.fontSize}px ${segmentStyle.fontFamily}`; + const metrics = ctx.measureText(segment.text); + totalWidth += metrics.width; + maxHeight = Math.max(maxHeight, segmentStyle.fontSize * segmentStyle.lineHeight); + } + + // Set canvas size + canvas.width = Math.ceil(totalWidth); + canvas.height = Math.ceil(maxHeight + fullBaseStyle.padding * 2); + + // Clear background + if (fullBaseStyle.backgroundColor !== 'transparent') { + ctx.fillStyle = fullBaseStyle.backgroundColor; + ctx.fillRect(0, 0, canvas.width, canvas.height); + } + + // Second pass: render segments + let x = fullBaseStyle.padding; + const y = fullBaseStyle.padding; + + for (const segment of segments) { + const segmentStyle = { ...fullBaseStyle, ...segment.style }; + ctx.font = `${segmentStyle.fontStyle} ${segmentStyle.fontWeight} ${segmentStyle.fontSize}px ${segmentStyle.fontFamily}`; + ctx.fillStyle = segmentStyle.color; + ctx.textBaseline = 'top'; + ctx.fillText(segment.text, x, y); + + const metrics = ctx.measureText(segment.text); + x += metrics.width; + } + + return canvas; +} + +// ============================================ +// Utility Functions +// ============================================ + +/** + * Parse CSS color to RGBA values + */ +export function parseColor(color: string): { r: number; g: number; b: number; a: number } { + const canvas = document.createElement('canvas'); + canvas.width = 1; + canvas.height = 1; + const ctx = canvas.getContext('2d')!; + ctx.fillStyle = color; + ctx.fillRect(0, 0, 1, 1); + const data = ctx.getImageData(0, 0, 1, 1).data; + return { + r: data[0], + g: data[1], + b: data[2], + a: data[3] / 255, + }; +} + +/** + * Convert RGBA to CSS color string + */ +export function rgbaToColor(r: number, g: number, b: number, a: number = 1): string { + return `rgba(${r}, ${g}, ${b}, ${a})`; +} + +/** + * Check if text contains only whitespace + */ +export function isWhitespaceOnly(text: string): boolean { + return /^\s*$/.test(text); +} + +/** + * Truncate text with ellipsis if it exceeds max width + */ +export function truncateText( + text: string, + maxWidth: number, + style: Partial = {}, + ellipsis: string = '...' +): string { + const fullStyle = { ...DEFAULT_TEXT_STYLE, ...style }; + + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d')!; + ctx.font = `${fullStyle.fontStyle} ${fullStyle.fontWeight} ${fullStyle.fontSize}px ${fullStyle.fontFamily}`; + + const metrics = ctx.measureText(text); + if (metrics.width <= maxWidth) { + return text; + } + + const ellipsisWidth = ctx.measureText(ellipsis).width; + const targetWidth = maxWidth - ellipsisWidth; + + let truncated = text; + while (truncated.length > 0) { + truncated = truncated.slice(0, -1); + if (ctx.measureText(truncated).width <= targetWidth) { + return truncated + ellipsis; + } + } + + return ellipsis; +} diff --git a/src/utils/video.ts b/src/utils/video.ts new file mode 100644 index 0000000..45a8b30 --- /dev/null +++ b/src/utils/video.ts @@ -0,0 +1,521 @@ +/** + * Video processing utilities + * + * This module provides video element creation, playback control, + * and texture update functionality for WebGPU rendering. + */ + +// Supported video formats +export const SUPPORTED_VIDEO_FORMATS = ['mp4', 'webm', 'ogg']; +export const SUPPORTED_VIDEO_MIME_TYPES = [ + 'video/mp4', + 'video/webm', + 'video/ogg', +]; + +/** + * Check if a file is a supported video format + */ +export function isSupportedVideoFormat(filename: string): boolean { + const ext = filename.split('.').pop()?.toLowerCase() || ''; + return SUPPORTED_VIDEO_FORMATS.includes(ext); +} + +/** + * Check if a MIME type is a supported video format + */ +export function isSupportedVideoMimeType(mimeType: string): boolean { + return SUPPORTED_VIDEO_MIME_TYPES.includes(mimeType); +} + +// ============================================ +// Video Element Types +// ============================================ + +export interface VideoInfo { + width: number; + height: number; + duration: number; + aspectRatio: number; +} + +export interface LoopPoint { + start: number; // percentage 0-100 + end: number; // percentage 0-100 +} + +// ============================================ +// Video Element Creation +// ============================================ + +/** + * Create a video element from a file + */ +export async function createVideoFromFile(file: File): Promise { + const url = URL.createObjectURL(file); + return createVideoFromUrl(url, true); +} + +/** + * Create a video element from a URL + * @param url Video URL + * @param revokeOnLoad Whether to revoke the object URL after loading (for blob URLs) + */ +export async function createVideoFromUrl( + url: string, + revokeOnLoad: boolean = false +): Promise { + return new Promise((resolve, reject) => { + const video = document.createElement('video'); + + // Configure video element for texture use + video.crossOrigin = 'anonymous'; + video.muted = true; + video.loop = true; + video.playsInline = true; + video.preload = 'auto'; + + video.onloadedmetadata = () => { + if (revokeOnLoad) { + // Don't revoke immediately - keep URL for playback + // URL.revokeObjectURL(url); + } + resolve(video); + }; + + video.onerror = () => { + if (revokeOnLoad) { + URL.revokeObjectURL(url); + } + reject(new Error(`Failed to load video: ${url}`)); + }; + + video.src = url; + video.load(); + }); +} + +/** + * Create a video element from a base64 data URL + */ +export async function createVideoFromBase64(base64DataUrl: string): Promise { + return createVideoFromUrl(base64DataUrl); +} + +// ============================================ +// Video Information +// ============================================ + +/** + * Get video information + */ +export function getVideoInfo(video: HTMLVideoElement): VideoInfo { + return { + width: video.videoWidth, + height: video.videoHeight, + duration: video.duration, + aspectRatio: video.videoWidth / video.videoHeight, + }; +} + +/** + * Wait for video to be ready for playback + */ +export function waitForVideoReady(video: HTMLVideoElement): Promise { + return new Promise((resolve, reject) => { + if (video.readyState >= 3) { + // HAVE_FUTURE_DATA or higher + resolve(); + return; + } + + const onCanPlay = () => { + video.removeEventListener('canplay', onCanPlay); + video.removeEventListener('error', onError); + resolve(); + }; + + const onError = () => { + video.removeEventListener('canplay', onCanPlay); + video.removeEventListener('error', onError); + reject(new Error('Video failed to load')); + }; + + video.addEventListener('canplay', onCanPlay); + video.addEventListener('error', onError); + }); +} + +// ============================================ +// Video Controller +// ============================================ + +export class VideoController { + private video: HTMLVideoElement; + private loopPoint: LoopPoint = { start: 0, end: 100 }; + private isLooping: boolean = true; + private frameUpdateCallback: (() => void) | null = null; + private animationFrameId: number | null = null; + private isUpdating: boolean = false; + + constructor(video: HTMLVideoElement) { + this.video = video; + this.setupEventListeners(); + } + + /** + * Setup video event listeners + */ + private setupEventListeners(): void { + this.video.addEventListener('timeupdate', this.handleTimeUpdate.bind(this)); + this.video.addEventListener('ended', this.handleEnded.bind(this)); + } + + /** + * Handle time update for loop point enforcement + */ + private handleTimeUpdate(): void { + if (!this.isLooping) return; + + const currentPercent = (this.video.currentTime / this.video.duration) * 100; + + if (currentPercent >= this.loopPoint.end) { + this.seekToPercent(this.loopPoint.start); + } + } + + /** + * Handle video ended event + */ + private handleEnded(): void { + if (this.isLooping) { + this.seekToPercent(this.loopPoint.start); + this.video.play(); + } + } + + /** + * Set callback for frame updates (for texture refresh) + */ + setFrameUpdateCallback(callback: () => void): void { + this.frameUpdateCallback = callback; + } + + /** + * Start frame update loop for texture synchronization + */ + startFrameUpdates(): void { + if (this.isUpdating) return; + this.isUpdating = true; + + const update = () => { + if (!this.isUpdating) return; + + if (!this.video.paused && this.frameUpdateCallback) { + this.frameUpdateCallback(); + } + + this.animationFrameId = requestAnimationFrame(update); + }; + + this.animationFrameId = requestAnimationFrame(update); + } + + /** + * Stop frame update loop + */ + stopFrameUpdates(): void { + this.isUpdating = false; + if (this.animationFrameId !== null) { + cancelAnimationFrame(this.animationFrameId); + this.animationFrameId = null; + } + } + + /** + * Play the video + */ + async play(): Promise { + try { + await this.video.play(); + this.startFrameUpdates(); + } catch (error) { + console.warn('Video play failed:', error); + } + } + + /** + * Pause the video + */ + pause(): void { + this.video.pause(); + this.stopFrameUpdates(); + } + + /** + * Toggle play/pause + */ + async toggle(): Promise { + if (this.video.paused) { + await this.play(); + } else { + this.pause(); + } + } + + /** + * Stop the video and reset to loop start + */ + stop(): void { + this.pause(); + this.seekToPercent(this.loopPoint.start); + } + + /** + * Seek to a specific time in seconds + */ + seek(time: number): void { + this.video.currentTime = Math.max(0, Math.min(time, this.video.duration)); + } + + /** + * Seek to a percentage of the video duration + */ + seekToPercent(percent: number): void { + const time = (percent / 100) * this.video.duration; + this.seek(time); + } + + /** + * Set loop points (percentage 0-100) + */ + setLoopPoints(start: number, end: number): void { + this.loopPoint = { + start: Math.max(0, Math.min(start, 100)), + end: Math.max(0, Math.min(end, 100)), + }; + + // Ensure start < end + if (this.loopPoint.start >= this.loopPoint.end) { + this.loopPoint.end = Math.min(this.loopPoint.start + 1, 100); + } + + // If current time is outside loop, seek to start + const currentPercent = (this.video.currentTime / this.video.duration) * 100; + if (currentPercent < this.loopPoint.start || currentPercent > this.loopPoint.end) { + this.seekToPercent(this.loopPoint.start); + } + } + + /** + * Get current loop points + */ + getLoopPoints(): LoopPoint { + return { ...this.loopPoint }; + } + + /** + * Enable/disable looping + */ + setLooping(enabled: boolean): void { + this.isLooping = enabled; + this.video.loop = enabled; + } + + /** + * Get looping state + */ + getIsLooping(): boolean { + return this.isLooping; + } + + /** + * Set muted state + */ + setMuted(muted: boolean): void { + this.video.muted = muted; + } + + /** + * Get muted state + */ + getIsMuted(): boolean { + return this.video.muted; + } + + /** + * Set volume (0-1) + */ + setVolume(volume: number): void { + this.video.volume = Math.max(0, Math.min(volume, 1)); + } + + /** + * Get volume + */ + getVolume(): number { + return this.video.volume; + } + + /** + * Set playback rate + */ + setPlaybackRate(rate: number): void { + this.video.playbackRate = rate; + } + + /** + * Get playback rate + */ + getPlaybackRate(): number { + return this.video.playbackRate; + } + + /** + * Get current time in seconds + */ + getCurrentTime(): number { + return this.video.currentTime; + } + + /** + * Get current time as percentage + */ + getCurrentPercent(): number { + return (this.video.currentTime / this.video.duration) * 100; + } + + /** + * Get video duration in seconds + */ + getDuration(): number { + return this.video.duration; + } + + /** + * Check if video is playing + */ + isPlaying(): boolean { + return !this.video.paused; + } + + /** + * Get the underlying video element + */ + getVideoElement(): HTMLVideoElement { + return this.video; + } + + /** + * Get video info + */ + getInfo(): VideoInfo { + return getVideoInfo(this.video); + } + + /** + * Destroy the controller and release resources + */ + destroy(): void { + this.stopFrameUpdates(); + this.video.pause(); + this.video.removeAttribute('src'); + this.video.load(); + this.frameUpdateCallback = null; + } +} + +// ============================================ +// Video Texture Update Helper +// ============================================ + +/** + * Check if video frame has changed and needs texture update + * Uses video's currentTime to detect frame changes + */ +export class VideoFrameTracker { + private lastTime: number = -1; + private video: HTMLVideoElement; + + constructor(video: HTMLVideoElement) { + this.video = video; + } + + /** + * Check if frame has changed since last check + */ + hasFrameChanged(): boolean { + const currentTime = this.video.currentTime; + if (currentTime !== this.lastTime) { + this.lastTime = currentTime; + return true; + } + return false; + } + + /** + * Reset the tracker + */ + reset(): void { + this.lastTime = -1; + } +} + +// ============================================ +// Video Loading Helpers +// ============================================ + +/** + * Load video from file and create controller + */ +export async function loadVideoFromFile(file: File): Promise { + const video = await createVideoFromFile(file); + await waitForVideoReady(video); + return new VideoController(video); +} + +/** + * Load video from URL and create controller + */ +export async function loadVideoFromUrl(url: string): Promise { + const video = await createVideoFromUrl(url); + await waitForVideoReady(video); + return new VideoController(video); +} + +// ============================================ +// Utility Functions +// ============================================ + +/** + * Format time in seconds to MM:SS format + */ +export function formatTime(seconds: number): string { + const mins = Math.floor(seconds / 60); + const secs = Math.floor(seconds % 60); + return `${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`; +} + +/** + * Format time in seconds to MM:SS.ms format + */ +export function formatTimeWithMs(seconds: number): string { + const mins = Math.floor(seconds / 60); + const secs = Math.floor(seconds % 60); + const ms = Math.floor((seconds % 1) * 100); + return `${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}.${ms.toString().padStart(2, '0')}`; +} + +/** + * Calculate percentage from time + */ +export function timeToPercent(time: number, duration: number): number { + return (time / duration) * 100; +} + +/** + * Calculate time from percentage + */ +export function percentToTime(percent: number, duration: number): number { + return (percent / 100) * duration; +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..6a95359 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + + "baseUrl": ".", + "paths": { + "@/*": ["src/*"] + }, + "types": ["node", "@webgpu/types"] + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"], + "references": [{ "path": "./tsconfig.node.json" }] +} diff --git a/tsconfig.node.json b/tsconfig.node.json new file mode 100644 index 0000000..97ede7e --- /dev/null +++ b/tsconfig.node.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true, + "strict": true + }, + "include": ["vite.config.ts"] +} diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..ffd5d14 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,38 @@ +import { defineConfig } from "vite"; +import vue from "@vitejs/plugin-vue"; +import { resolve } from "path"; + +const host = process.env.TAURI_DEV_HOST; + +// https://vite.dev/config/ +export default defineConfig(async () => ({ + plugins: [vue()], + + resolve: { + alias: { + "@": resolve(__dirname, "src"), + }, + }, + + // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build` + // + // 1. prevent Vite from obscuring rust errors + clearScreen: false, + // 2. tauri expects a fixed port, fail if that port is not available + server: { + port: 1420, + strictPort: true, + host: host || false, + hmr: host + ? { + protocol: "ws", + host, + port: 1421, + } + : undefined, + watch: { + // 3. tell Vite to ignore watching `src-tauri` + ignored: ["**/src-tauri/**"], + }, + }, +}));