Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
Use SVGs for common cursors (#722)
Nalin Dalal1fe4cd27d930
diff --git a/Cargo.lock b/Cargo.lockindex c5679d39d..d8479db2f 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -213,6 +213,12 @@ dependencies = ["syn 2.0.104",]+[[package]]+name = "arrayref"+version = "0.3.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb"+[[package]]name = "arrayvec"version = "0.7.6"@@ -307,9 +313,9 @@ dependencies = [[[package]]name = "async-lock"-version = "3.4.0"+version = "3.4.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18"+checksum = "5fd03604047cee9b6ce9de9f70c6cd540a0520c813cbd49bae61f33ab80ed1dc"dependencies = ["event-listener","event-listener-strategy",@@ -949,6 +955,18 @@ dependencies = ["device_query",]+[[package]]+name = "cap-cursor-info"+version = "0.0.0"+dependencies = [+ "hex",+ "image",+ "objc2 0.6.1",+ "objc2-app-kit",+ "sha2",+ "windows 0.60.0",+]+[[package]]name = "cap-desktop"version = "0.3.61-beta.1"@@ -1223,13 +1241,16 @@ dependencies = ["ffmpeg-next","flume","futures",+ "hex","image","objc",+ "objc2-app-kit","relative-path","scap","screencapturekit","serde","serde_json",+ "sha2","specta","tempfile","thiserror 1.0.69",@@ -1248,6 +1269,7 @@ dependencies = ["bezier_easing","build-time","bytemuck",+ "cap-cursor-info","cap-flags","cap-project","cap-video-decode",@@ -1262,9 +1284,11 @@ dependencies = ["log","pretty_assertions","reactive_graph",+ "resvg","serde","specta","thiserror 1.0.69",+ "tiny-skia","tokio","tracing","wgpu",@@ -1348,9 +1372,9 @@ dependencies = [[[package]]name = "cc"-version = "1.2.30"+version = "1.2.31"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "deec109607ca693028562ed836a5f1c4b8bd77755c4e132fc5ce11b0b6211ae7"+checksum = "c3a42d84bb6b69d3a8b3eaacf0d88f179e1929695e1ad012b6cf64d9caaa5fd2"dependencies = ["jobserver","libc",@@ -1854,6 +1878,15 @@ dependencies = ["thiserror 2.0.12",]+[[package]]+name = "core_maths"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "77745e017f5edba1a9c1d854f6f3a52dac8a12dd5af5d2f54aecf61e43d80d30"+dependencies = [+ "libm",+]+[[package]]name = "coreaudio-rs"version = "0.11.3"@@ -1881,11 +1914,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "da46a9d5a8905cc538a4a5bceb6a4510de7a51049c5588c0114efce102bcbbe8"dependencies = ["bitflags 2.9.1",- "fontdb",+ "fontdb 0.16.2","log","rangemap","rustc-hash 1.1.0",- "rustybuzz",+ "rustybuzz 0.14.1","self_cell","smol_str","swash",@@ -2532,9 +2565,9 @@ dependencies = [[[package]]name = "event-listener"-version = "5.4.0"+version = "5.4.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae"+checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab"dependencies = ["concurrent-queue","parking",@@ -2663,6 +2696,12 @@ dependencies = ["miniz_oxide",]+[[package]]+name = "float-cmp"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4"+[[package]]name = "flume"version = "0.11.1"@@ -2719,6 +2758,20 @@ dependencies = ["ttf-parser 0.20.0",]+[[package]]+name = "fontdb"+version = "0.23.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "457e789b3d1202543297a350643cf459f836cade38934e7a4cf6a39e7cde2905"+dependencies = [+ "fontconfig-parser",+ "log",+ "memmap2",+ "slotmap",+ "tinyvec",+ "ttf-parser 0.25.1",+]+[[package]]name = "foreign-types"version = "0.3.2"@@ -2853,9 +2906,9 @@ checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"[[package]]name = "futures-lite"-version = "2.6.0"+version = "2.6.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532"+checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad"dependencies = ["fastrand","futures-core",@@ -3811,6 +3864,12 @@ dependencies = ["quick-error",]+[[package]]+name = "imagesize"+version = "0.13.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "edcd27d72f2f071c64249075f42e205ff93c9a4c5f6c6da53e79ed9f9832c285"+[[package]]name = "imgref"version = "1.11.0"@@ -4115,6 +4174,17 @@ dependencies = ["selectors",]+[[package]]+name = "kurbo"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c62026ae44756f8a599ba21140f350303d4f08dcdcc71b5ad9c9bb8128c13c62"+dependencies = [+ "arrayvec",+ "euclid",+ "smallvec",+]+[[package]]name = "lazy_static"version = "1.5.0"@@ -5565,6 +5635,12 @@ dependencies = ["siphasher 1.0.1",]+[[package]]+name = "pico-args"+version = "0.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315"+[[package]]name = "pin-project-lite"version = "0.2.16"@@ -5630,7 +5706,7 @@ checksum = "3af6b589e163c5a788fab00ce0c0366f6efbb9959c2f9874b224936af7fce7e1"dependencies = ["base64 0.22.1","indexmap 2.10.0",- "quick-xml 0.38.0",+ "quick-xml 0.38.1","serde","time",]@@ -5650,9 +5726,9 @@ dependencies = [[[package]]name = "polling"-version = "3.9.0"+version = "3.10.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "8ee9b2fa7a4517d2c91ff5bc6c297a427a96749d15f98fcdbb22c05571a4d4b7"+checksum = "b5bd19146350fe804f7cb2669c851c03d69da628803dab0d98018142aaa5d829"dependencies = ["cfg-if","concurrent-queue",@@ -5861,9 +5937,9 @@ dependencies = [[[package]]name = "quick-xml"-version = "0.38.0"+version = "0.38.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "8927b0664f5c5a98265138b7e3f90aa19a6b21353182469ace36d4ac527b7b1b"+checksum = "9845d9dccf565065824e69f9f235fafba1587031eda353c1f1561cd6a6be78f4"dependencies = ["memchr",]@@ -6188,9 +6264,9 @@ dependencies = [[[package]]name = "redox_users"-version = "0.5.1"+version = "0.5.2"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "78eaea1f52c56d57821be178b2d47e09ff26481a6042e8e042fcb0ced068b470"+checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac"dependencies = ["getrandom 0.2.16","libredox",@@ -6327,6 +6403,23 @@ dependencies = ["webpki-roots",]+[[package]]+name = "resvg"+version = "0.45.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a8928798c0a55e03c9ca6c4c6846f76377427d2c1e1f7e6de3c06ae57942df43"+dependencies = [+ "gif",+ "image-webp",+ "log",+ "pico-args",+ "rgb",+ "svgtypes",+ "tiny-skia",+ "usvg",+ "zune-jpeg",+]+[[package]]name = "rfd"version = "0.15.4"@@ -6357,6 +6450,9 @@ name = "rgb"version = "0.8.52"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "0c6a884d2998352bb4daf0183589aec883f16a6da1f4dde84d8e2e9a5409a1ce"+dependencies = [+ "bytemuck",+][[package]]name = "ring"@@ -6518,8 +6614,26 @@ dependencies = ["libm","smallvec","ttf-parser 0.21.1",- "unicode-bidi-mirroring",- "unicode-ccc",+ "unicode-bidi-mirroring 0.2.0",+ "unicode-ccc 0.2.0",+ "unicode-properties",+ "unicode-script",+]++[[package]]+name = "rustybuzz"+version = "0.20.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fd3c7c96f8a08ee34eff8857b11b49b07d71d1c3f4e88f8a88d4c9e9f90b1702"+dependencies = [+ "bitflags 2.9.1",+ "bytemuck",+ "core_maths",+ "log",+ "smallvec",+ "ttf-parser 0.25.1",+ "unicode-bidi-mirroring 0.4.0",+ "unicode-ccc 0.4.0","unicode-properties","unicode-script",]@@ -6875,9 +6989,9 @@ dependencies = [[[package]]name = "serde_json"-version = "1.0.141"+version = "1.0.142"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3"+checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7"dependencies = ["itoa","memchr",@@ -7082,9 +7196,9 @@ dependencies = [[[package]]name = "signal-hook-registry"-version = "1.4.5"+version = "1.4.6"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410"+checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b"dependencies = ["libc",]@@ -7104,6 +7218,15 @@ dependencies = ["quote",]+[[package]]+name = "simplecss"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7a9c6883ca9c3c7c90e888de77b7a5c849c779d25d74a1269b0218b14e8b136c"+dependencies = [+ "log",+]+[[package]]name = "siphasher"version = "0.3.11"@@ -7325,6 +7448,15 @@ version = "1.1.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"+[[package]]+name = "strict-num"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731"+dependencies = [+ "float-cmp",+]+[[package]]name = "string_cache"version = "0.8.9"@@ -7389,6 +7521,16 @@ version = "0.4.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "0193cc4331cfd2f3d2011ef287590868599a2f33c3e69bc22c1a3d3acf9e02fb"+[[package]]+name = "svgtypes"+version = "0.15.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "68c7541fff44b35860c1a7a47a7cadf3e4a304c457b58f9870d9706ece028afc"+dependencies = [+ "kurbo",+ "siphasher 1.0.1",+]+[[package]]name = "swash"version = "0.2.5"@@ -8359,6 +8501,32 @@ dependencies = ["crunchy",]+[[package]]+name = "tiny-skia"+version = "0.11.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab"+dependencies = [+ "arrayref",+ "arrayvec",+ "bytemuck",+ "cfg-if",+ "log",+ "png",+ "tiny-skia-path",+]++[[package]]+name = "tiny-skia-path"+version = "0.11.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93"+dependencies = [+ "arrayref",+ "bytemuck",+ "strict-num",+]+[[package]]name = "tinystr"version = "0.8.1"@@ -8386,9 +8554,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"[[package]]name = "tokio"-version = "1.47.0"+version = "1.47.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "43864ed400b6043a4757a25c7a64a8efde741aed79a056a2fb348a406701bb35"+checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038"dependencies = ["backtrace","bytes",@@ -8461,9 +8629,9 @@ dependencies = [[[package]]name = "tokio-util"-version = "0.7.15"+version = "0.7.16"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df"+checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5"dependencies = ["bytes","futures-core",@@ -8747,6 +8915,15 @@ version = "0.21.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8"+[[package]]+name = "ttf-parser"+version = "0.25.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31"+dependencies = [+ "core_maths",+]+[[package]]name = "tungstenite"version = "0.24.0"@@ -8856,12 +9033,24 @@ version = "0.2.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "23cb788ffebc92c5948d0e997106233eeb1d8b9512f93f41651f52b6c5f5af86"+[[package]]+name = "unicode-bidi-mirroring"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5dfa6e8c60bb66d49db113e0125ee8711b7647b5579dc7f5f19c42357ed039fe"+[[package]]name = "unicode-ccc"version = "0.2.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "1df77b101bcc4ea3d78dafc5ad7e4f58ceffe0b2b16bf446aeb50b6cb4157656"+[[package]]+name = "unicode-ccc"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ce61d488bcdc9bc8b5d1772c404828b17fc481c0a582b5581e95fb233aef503e"+[[package]]name = "unicode-ident"version = "1.0.18"@@ -8892,6 +9081,12 @@ version = "1.12.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"+[[package]]+name = "unicode-vo"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b1d386ff53b415b7fe27b50bb44679e2cc4660272694b7b6f3326d8480823a94"+[[package]]name = "unicode-width"version = "0.1.14"@@ -8947,6 +9142,33 @@ dependencies = ["url",]+[[package]]+name = "usvg"+version = "0.45.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "80be9b06fbae3b8b303400ab20778c80bbaf338f563afe567cf3c9eea17b47ef"+dependencies = [+ "base64 0.22.1",+ "data-url",+ "flate2",+ "fontdb 0.23.0",+ "imagesize",+ "kurbo",+ "log",+ "pico-args",+ "roxmltree",+ "rustybuzz 0.20.1",+ "simplecss",+ "siphasher 1.0.1",+ "strict-num",+ "svgtypes",+ "tiny-skia-path",+ "unicode-bidi",+ "unicode-script",+ "unicode-vo",+ "xmlwriter",+]+[[package]]name = "utf-8"version = "0.7.6"@@ -10389,6 +10611,12 @@ version = "0.8.27"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "6fd8403733700263c6eb89f192880191f1b83e332f7a20371ddcf421c4a337c7"+[[package]]+name = "xmlwriter"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9"+[[package]]name = "yansi"version = "1.0.1"diff --git a/apps/desktop/src/routes/editor/ConfigSidebar.tsx b/apps/desktop/src/routes/editor/ConfigSidebar.tsxindex eddb0837d..bcc5be6cf 100644--- a/apps/desktop/src/routes/editor/ConfigSidebar.tsx+++ b/apps/desktop/src/routes/editor/ConfigSidebar.tsx@@ -33,7 +33,7 @@ import {import { createStore, produce } from "solid-js/store";import { Dynamic } from "solid-js/web";import toast from "solid-toast";-+import IconLucideSparkles from "~icons/lucide/sparkles";import colorBg from "~/assets/illustrations/color.webp";import gradientBg from "~/assets/illustrations/gradient.webp";import imageBg from "~/assets/illustrations/image.webp";@@ -241,7 +241,7 @@ export function ConfigSidebar() {id: TAB_IDS.camera,icon: IconCapCamera,disabled: editorInstance.recordings.segments.every(- (s) => s.camera === null+ (s) => s.camera === null,),},{ id: TAB_IDS.audio, icon: IconCapAudioOn },@@ -275,7 +275,7 @@ export function ConfigSidebar() {class={cx("flex justify-center relative border-transparent border z-10 items-center rounded-md size-9 transition will-change-transform",state.selectedTab !== item.id &&- "group-hover:border-gray-300 group-disabled:border-none"+ "group-hover:border-gray-300 group-disabled:border-none",)}><Dynamic component={item.icon} />@@ -313,7 +313,7 @@ export function ConfigSidebar() {optionValue="value"optionTextValue="name"value={STEREO_MODES.find(- (v) => v.value === project.audio.micStereoMode+ (v) => v.value === project.audio.micStereoMode,)}onChange={(v) => {if (v) setProject("audio", "micStereoMode", v.value);@@ -480,6 +480,18 @@ export function ConfigSidebar() {</div></KCollapsible.Content></KCollapsible>+ <Field+ name="High Quality SVG Cursors"+ icon={<IconLucideSparkles />}+ value={+ <Toggle+ checked={(project.cursor as any).useSvg ?? true}+ onChange={(value) => {+ setProject("cursor", "useSvg" as any, value);+ }}+ />+ }+ /></Show>{/* <Field name="Motion Blur">@@ -660,7 +672,7 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {// Get the raw path without any URL prefixesconst rawPath = decodeURIComponent(- photoUrl.replace("file://", "")+ photoUrl.replace("file://", ""),);debouncedSetProject(rawPath);@@ -720,7 +732,7 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {}},},- { passive: false }+ { passive: false },);let fileInput!: HTMLInputElement;@@ -886,7 +898,7 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {project.background.source.path) {const convertedPath = convertFileSrc(- project.background.source.path+ project.background.source.path,);// Only use converted path if it's validif (convertedPath) {@@ -904,7 +916,7 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {project.background.source as {path?: string;}- ).path?.includes(w.id)+ ).path?.includes(w.id),);// Only use wallpaper URL if it existsif (selectedWallpaper?.url) {@@ -971,7 +983,7 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {<KTabs.TriggeronClick={() =>setBackgroundTab(- key as keyof typeof BACKGROUND_THEMES+ key as keyof typeof BACKGROUND_THEMES,)}value={key}@@ -988,17 +1000,17 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {<KRadioGroupvalue={project.background.source.type === "wallpaper"- ? wallpapers()?.find((w) =>+ ? (wallpapers()?.find((w) =>(project.background.source as { path?: string }- ).path?.includes(w.id)- )?.url ?? undefined+ ).path?.includes(w.id),+ )?.url ?? undefined): undefined}onChange={(photoUrl) => {try {const wallpaper = wallpapers()?.find(- (w) => w.url === photoUrl+ (w) => w.url === photoUrl,);if (!wallpaper) return;@@ -1199,7 +1211,7 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {setProject("background","source",- backgrounds.color+ backgrounds.color,);}}}@@ -1283,7 +1295,7 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {const rawNewAngle =Math.round(start +- (downEvent.clientY - moveEvent.clientY)+ (downEvent.clientY - moveEvent.clientY),) % max;const newAngle = moveEvent.shiftKey? rawNewAngle@@ -1298,7 +1310,7 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {) {commands.performHapticFeedback("Alignment",- "Now"+ "Now",);}@@ -1308,7 +1320,7 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {newAngle < 0 ? newAngle + max : newAngle,});},- })+ }),);}}>@@ -1333,7 +1345,7 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {setProject("background","source",- backgrounds.gradient+ backgrounds.gradient,);}}}@@ -1342,7 +1354,7 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {class="rounded-lg transition-all duration-200 cursor-pointer size-8 peer-checked:hover:opacity-100 peer-hover:opacity-70 peer-checked:ring-2 peer-checked:ring-gray-500 peer-checked:ring-offset-2 peer-checked:ring-offset-gray-200"style={{background: `linear-gradient(${angle()}deg, rgb(${gradient.from.join(- ","+ ",",)}), rgb(${gradient.to.join(",")}))`,}}/>@@ -1506,9 +1518,9 @@ function CameraConfig(props: { scrollRef: HTMLDivElement }) {item.x === "left"? "left-2": item.x === "right"- ? "right-2"- : "left-1/2 transform -translate-x-1/2",- item.y === "top" ? "top-2" : "bottom-2"+ ? "right-2"+ : "left-1/2 transform -translate-x-1/2",+ item.y === "top" ? "top-2" : "bottom-2",)}onClick={() => setProject("camera", "position", item)}>@@ -1537,7 +1549,7 @@ function CameraConfig(props: { scrollRef: HTMLDivElement }) {optionValue="value"optionTextValue="name"value={CAMERA_SHAPES.find(- (v) => v.value === project.camera.shape+ (v) => v.value === project.camera.shape,)}onChange={(v) => {if (v) setProject("camera", "shape", v.value);@@ -1744,7 +1756,7 @@ function ZoomSegmentConfig(props: {"zoomSegments",props.segmentIndex,"amount",- v[0]+ v[0],)}minValue={1}@@ -1763,7 +1775,7 @@ function ZoomSegmentConfig(props: {"zoomSegments",props.segmentIndex,"mode",- v === "auto" ? "auto" : { manual: states.manual }+ v === "auto" ? "auto" : { manual: states.manual },);}}>@@ -1804,7 +1816,7 @@ function ZoomSegmentConfig(props: {const st = start();let i = project.timeline?.segments.findIndex(- (s) => s.start <= st && s.end > st+ (s) => s.start <= st && s.end > st,);if (i === undefined || i === -1) return 0;return i;@@ -1816,7 +1828,7 @@ function ZoomSegmentConfig(props: {// TODO: this shouldn't be so hardcoded`${editorInstance.path- }/content/segments/segment-${segmentIndex()}/display.mp4`+ }/content/segments/segment-${segmentIndex()}/display.mp4`,);});@@ -1834,8 +1846,8 @@ function ZoomSegmentConfig(props: {},() => {render();- }- )+ },+ ),);const render = () => {@@ -1850,7 +1862,7 @@ function ZoomSegmentConfig(props: {0,0,canvasRef.width!,- canvasRef.height!+ canvasRef.height!,);};@@ -1913,19 +1925,19 @@ function ZoomSegmentConfig(props: {Math.min((moveEvent.clientX - bounds.left) /bounds.width,- 1+ 1,),- 0+ 0,),y: Math.max(Math.min((moveEvent.clientY - bounds.top) /bounds.height,- 1+ 1,),- 0+ 0,),- }+ },);},});@@ -1989,7 +2001,7 @@ function ClipSegmentConfig(props: {disabled={(project.timeline?.segments.filter(- (s) => s.recordingSegment === props.segment.recordingSegment+ (s) => s.recordingSegment === props.segment.recordingSegment,) ?? []).length < 2}diff --git a/apps/desktop/src/utils/tauri.ts b/apps/desktop/src/utils/tauri.tsindex dcdbbed2e..283e5f4a1 100644--- a/apps/desktop/src/utils/tauri.ts+++ b/apps/desktop/src/utils/tauri.ts@@ -334,8 +334,8 @@ export type CurrentRecording = { target: CurrentRecordingTarget; type: Recordingexport type CurrentRecordingChanged = nullexport type CurrentRecordingTarget = { window: { id: number; bounds: Bounds } } | { screen: { id: number } } | { area: { screen: number; bounds: Bounds } }export type CursorAnimationStyle = "regular" | "slow" | "fast"-export type CursorConfiguration = { hide?: boolean; hideWhenIdle: boolean; size: number; type: CursorType; animationStyle: CursorAnimationStyle; tension: number; mass: number; friction: number; raw?: boolean; motionBlur?: number }-export type CursorMeta = { imagePath: string; hotspot: XY<number> }+export type CursorConfiguration = { hide?: boolean; hideWhenIdle: boolean; size: number; type: CursorType; animationStyle: CursorAnimationStyle; tension: number; mass: number; friction: number; raw?: boolean; motionBlur?: number; useSvg?: boolean }+export type CursorMeta = { imagePath: string; hotspot: XY<number>; hash?: string | null }export type CursorType = "pointer" | "circle"export type Cursors = { [key in string]: string } | { [key in string]: CursorMeta }export type DeviceOrModelID = { DeviceID: string } | { ModelID: ModelIDType }diff --git a/crates/cursor-info/Cargo.toml b/crates/cursor-info/Cargo.tomlnew file mode 100644index 000000000..b604feab2--- /dev/null+++ b/crates/cursor-info/Cargo.toml@@ -0,0 +1,23 @@+[package]+name = "cap-cursor-info"+version = "0.0.0"+edition = "2024"+publish = false++[dev-dependencies]+hex = "0.4.3"+image = "0.25.6"+sha2 = "0.10.9"++[target.'cfg(target_os = "macos")'.dev-dependencies]+objc2-app-kit = "0.3.1"+objc2 = "0.6.1"++[target.'cfg(target_os= "windows")'.dev-dependencies]+windows = { workspace = true, features = [+ "Win32_Graphics_Gdi",+ "Win32_UI_WindowsAndMessaging",+] }++[lints]+workspace = truediff --git a/crates/cursor-info/assets/mac/LICENCE b/crates/cursor-info/assets/mac/LICENCEnew file mode 100644index 000000000..915e9e733--- /dev/null+++ b/crates/cursor-info/assets/mac/LICENCE@@ -0,0 +1,3 @@+This software is released under the Apple User Agreement.++Icons taken from: https://github.com/daviddarnes/mac-cursorsdiff --git a/crates/cursor-info/assets/mac/arrow.svg b/crates/cursor-info/assets/mac/arrow.svgnew file mode 100644index 000000000..42ae068a3--- /dev/null+++ b/crates/cursor-info/assets/mac/arrow.svg@@ -0,0 +1 @@+<svg height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" transform="translate(10 7)"><path d="m6.148 18.473 1.863-1.003 1.615-.839-2.568-4.816h4.332l-11.379-11.408v16.015l3.316-3.221z" fill="#fff"/><path d="m6.431 17 1.765-.941-2.775-5.202h3.604l-8.025-8.043v11.188l2.53-2.442z" fill="#000"/></g></svg>\ No newline at end of filediff --git a/crates/cursor-info/assets/mac/closed_hand.svg b/crates/cursor-info/assets/mac/closed_hand.svgnew file mode 100644index 000000000..e30f0c8c0--- /dev/null+++ b/crates/cursor-info/assets/mac/closed_hand.svg@@ -0,0 +1 @@+<svg height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" transform="translate(8 9)"><path d="m3.44281398 1.68449726c-.74326136.27630142-1.05584685.8131257-1.07636853 1.38003696-.01344897.37336893.06665513.72649286.23114214 1.18694303-.02596219-.07267623.09676488.29282004.12116236.37362273.05052942.16918921-.4865367-.05865774-.81377307.00741883-.36363321.07113868-.84783757.38332307-1.10006887.79754775-.29643467.48542737-.3109609 1.04368567-.08235979 2.04824266.12491868.54736183.36572145 1.00836814.71076689 1.44594879.15329951.1944118.5713628.64726015.60307236.6875974l.84854343.94062339c.15080214.1358526.25794954.2361946.57590427.5380259.3147558.2987762.4647038.4380078.60308951.555976.05846214.0492474.10784267.1797116.12740685.3736249.01609788.1595565.01049553.3375341-.0090192.5090254-.00674888.0593077-.01325791.1020883-.01698742.1224696-.04189161.228932.13269563.4403386.36541902.4424835.21585671.0019894.38528595.0046546.82216479.0123538.09483476.0016698.09483476.0016698.18993053.0033129 1.16876447.0200186 1.75308289.0147904 2.17807912-.0385723.45429894-.0572869.92650915-.6110188 1.32698393-1.2957591.34289141.6108338.81859723 1.2057867 1.2995685 1.2820532.1510118.0244148.3353555.0322555.548787.0275887.1606725-.0035131.3307029-.0140241.5021961-.0293376.1276907-.0114022.2293359-.0228648.29003-.0307451.2258836-.0293282.373669-.251611.3133108-.4712481-.0130351-.0474332-.0339838-.1345011-.0551094-.2441635-.0245945-.1276687-.0423383-.2523857-.0503381-.365988-.0050217-.0713101-.0059948-.1359317-.0027687-.1918983.0059157-.0980798.0077938-.1530073.0108033-.281125.0010795-.0448938.0010795-.0448938.0024606-.0845172.0054208-.1364475.0233824-.2649146.0815132-.544638.0250088-.1201275.1473169-.352189.3398902-.639435.0571394-.0852302.1195783-.1742239.1864664-.26609712.1272143-.17473362.2641361-.35131772.4011075-.52030772.082051-.10123129.145482-.17695689.1808122-.21807676.2967593-.42378347.612817-1.11823437.7291396-1.52536348.1117407-.39153936.202351-1.12501196.254373-1.81690429.029923-.39968605.0410555-.72381216.0410555-1.23011613.0000742-.09758414.0000742-.09758414.0002975-.17670236.0003569-.11115478.0003569-.11115478.000115-.20711835-.0008934-.15683883-.0055282-.31323355-.0207085-.69507578-.0313109-.81293139-.4771727-1.33911388-1.1344906-1.44058831-.559108-.08631314-1.0586051.08188477-1.2779293.31625977-.0755526.08073733.0036753-.2781823-.2159489-.62316278-.1644465-.25841586-.593184-.58905957-.9209287-.65355552-.335487-.06535532-.73539548-.05811715-1.1017193.00667481-.32093157.05742909-.68608434.33741751-.87176225.64688068-.12411885.20686477.03884667-.00592296-.09368743-.23401341-.18231052-.31422641-.60754287-.59486422-1.01411454-.67799709-.34643562-.07139428-.74182572-.04452925-1.09945614.0633873-.43336319.1291117-1.01795827.61460976-.94899189 1.15552627-.34375-.54091651-1.25026717-.691379-1.97906097-.42111797z" fill="#000"/><path d="m7.31951013 1.62138197c.20710357.04234751.44724204.20083012.51632974.31990811.08404358.1446387.15562749.36413806.21048667.6366124.02933373.14569467.12179446 1.2125285.29383112 1.32370243.41279229.04533731.41279229.04533731.52658055-.12364345.03545705-.07383858.03545705-.07383858.04226523-.1029106.01416796-.06009544.02463332-.12677987.0351322-.21754028l.00854738-.07915386.00047673-.00942804.00327525-.03167185c.01085148-.11424313.04184125-.4312127.05388392-.53034902.03788792-.31189663.08766449-.52757784.13944093-.6138719.0713024-.11883734.31942298-.28274442.43149612-.30279961.2804398-.04960082.58940103-.05519288.82623993-.00905543.1084394.02134018.3709471.22378689.432331.32024744.1291079.20279957.2524316.84889766.3225486 1.4970065-.0102194.04624251-.0102194.04624251.1640069.28984194.5843296-.06677889.5843296-.06677889.5703629-.17490247.0159511-.03856429.0284824-.08294031.045969-.15118961.0423876-.16089067.0697594-.25204451.111066-.35549917.0288558-.07227096.0592914-.13391873.0904889-.18278042.1209187-.19031132.4335712-.319392.7077174-.27707028.2943447.04543991.4816904.26653537.4994912.72869815.0148821.37434892.0193146.5239164.0201469.6700184l-.0004247.37954865c0 .48831141-.0104951.79388164-.0389535 1.17400348-.0480918.63962116-.1348512 1.34192123-.227649 1.66708484-.0946325.33121345-.3766371.95084197-.6003915 1.27298482-.0161892.01580846-.0841508.09694273-.1710333.20413492-.1445842.17838247-.2892181.36491271-.4247891.5511244-.0723398.09936149-.1402862.19620479-.2030964.2898938-.2440054.36396314-.400553.66098894-.4512157.90434304-.0659304.3172546-.0893838.4850003-.0966379.6675968-.0017072.0490782-.0017072.0490782-.002845.096677-.0028064.119476-.004437.1671639-.0097087.2545848-.0052654.091322-.0038193.187354.00332.2887353.0103318.1467182.1058713.3478531.1058713.3478531s-.2321503-.0119819-.3742084-.0088758c-.1718098.0037567-.3147843-.0023244-.4138162-.0183342-.1440353-.0228411-.53014068-.5057331-.7278511-.8821737-.30227042-.5764228-1.03604858-.5484427-1.33684295-.0394061-.26854779.4591613-.65918083.9172326-.7740684.9317199-.37404082.0469647-.94643778.0520862-2.07160079.0328144-.09480875-.0016381-.46003446-.0128683-.64600494-.0157445-.18597048-.0028763.05008807-.1790283.02786486-.399297-.03726222-.36933-.15125405-.6704984-.38877094-.8705429-.12241569-.1043631-.26774964-.2393104-.56509654-.5215613-.33323493-.3163366-.44236499-.4185353-.57290215-.533275l-.80130455-.89071892c-.03955779-.05174211-.45812831-.5051399-.5872217-.6688539-.28069963-.35597842-.47062947-.71959073-.56844755-1.14820437-.18921973-.83150113-.1793328-1.21146622-.00855589-1.49112273.13743587-.2257023.43815377-.4195862.60596039-.45241793.17165981-.03465512.55153059-.01648617.62179422.02229321.09902279.05401056.13357243.07300285.16379074.09097645.03572494.02124891.05965747.03799198.08182912.05708809.03426437.02951139.07235014.07170412.12420211.14044502.03611591.04821025.07806642.1053997.1423779.19304882.06054643.0816627.09183576.12069421.13369221.1590035.28038907.25662728.68391532.03238058.65052057-.32606956-.00567036-.06086415-.02203766-.12694598-.05458621-.23708502-.04356824-.15021272.00433013-.05284275-.26002629-.56642281-.08720664-.16942124-.13955864-.28835362-.17428227-.4046158l-.03412852-.10219113c-.03838756-.11059767-.09558223-.26854489-.12612861-.35199347l-.02009957-.05467087.002.008-.05974804-.17751191c-.09232236-.28807194-.13413567-.51358087-.12645475-.72681781.01040781-.28751553.16037753-.54506871.58790983-.70400047.40142488-.1488616 1.07786076.00117106 1.20581167.27856864.04319814.09369738.08927466.21199471.13900415.35457792l.03930997.11680217c.05539717.16759437.13470873.41493582.13860471.42816881.02724222.08344874.0471839.13860719.06943813.18441246.00217869.06301886.00217869.06301886.35429398.23177937.41699479-.29154152.41699479-.29154152.38019201-.37525838.00571063-.08773482.00758408-.17356287.00965287-.37317647.00242546-.23402898.00423842-.33154773.00994479-.45966208.01316411-.29554918.0437926-.51142116.09291227-.63864415.09160418-.23801371.25279279-.40993649.4432431-.46667832.24458613-.07380253.51465245-.09215236.73323569-.04710649zm1.21356228 4.27672201c-.20710459.00095412-.37422255.16961903-.37326843.37672361l.016 3.473c.00095412.20710459.16961903.37422251.37672361.37326841.20710459-.0009541.37422255-.16961901.37326843-.37672359l-.016-3.473c-.00095412-.20710459-.16961903-.37422255-.37672361-.37326843zm2.03332759.00229602c-.2071068 0-.375.16789322-.375.375v3.459c0 .20710678.1678932.375.375.375s.375-.16789322.375-.375v-3.459c0-.20710678-.1678932-.375-.375-.375zm-4.01399856.02930704c-.20710289.00126946-.37396385.17018863-.3726944.37729152l.021 3.426c.00126946.20710289.17018863.37396384.37729152.37269444.20710289-.0012695.37396385-.17018867.3726944-.37729156l-.021-3.426c-.00126946-.20710289-.17018863-.37396385-.37729152-.3726944z" fill="#fff"/></g></svg>\ No newline at end of filediff --git a/crates/cursor-info/assets/mac/contextual_menu.svg b/crates/cursor-info/assets/mac/contextual_menu.svgnew file mode 100644index 000000000..2d3e11929--- /dev/null+++ b/crates/cursor-info/assets/mac/contextual_menu.svg@@ -0,0 +1 @@+<svg height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" transform="translate(8 7)"><g fill="#fff"><path d="m8 17.47v.53h9v-10h-9v.427z"/><path d="m9.085 17.096-3.606 1.535-4.682-11.089 3.687-1.553z"/><path d="m0 16.422v-16.015l11.591 11.619h-6.781l-.411.124z"/></g><path d="m15 12h-5v-1h5zm0 2h-5v-1h5zm0 2h-5v-1h5zm-6 1h7v-8h-7z" fill="#000"/><path d="m7.751 16.416-1.844.773-3.1-7.373 1.841-.776z" fill="#000"/><path d="m1 2.814v11.188l2.969-2.866.428-.139h4.768z" fill="#000"/></g></svg>\ No newline at end of filediff --git a/crates/cursor-info/assets/mac/crosshair.svg b/crates/cursor-info/assets/mac/crosshair.svgnew file mode 100644index 000000000..5e78d1eec--- /dev/null+++ b/crates/cursor-info/assets/mac/crosshair.svg@@ -0,0 +1 @@+<svg height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><g fill="none" transform="translate(9 9)"><path d="m15 6h-6.01v-6h-2.98v6h-6.01v3h6.01v6h2.98v-6h6.01z" fill="#fff"/><path d="m13.99 7.01h-6v-6.01h-.98v6.01h-6v.98h6v6.01h.98v-6.01h6z" fill="#231f1f"/></g></svg>\ No newline at end of filediff --git a/crates/cursor-info/assets/mac/drag_copy.svg b/crates/cursor-info/assets/mac/drag_copy.svgnew file mode 100644index 000000000..adf185db2--- /dev/null+++ b/crates/cursor-info/assets/mac/drag_copy.svg@@ -0,0 +1 @@+<svg height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="copya" x1="50%" x2="50%" y1="0%" y2="100%"><stop offset="0" stop-color="#5bd230"/><stop offset="1" stop-color="#068b03"/></linearGradient><g fill="none" transform="translate(7)"><g transform="translate(1 14)"><path d="m0 9c0 4.97 4.03 9 9 9 4.97 0 9-4.03 9-9 0-4.971-4.03-9-9-9-4.97 0-9 4.029-9 9" fill="url(#copya)"/><path d="m13 8h-3v-3c0-.552-.448-1-1-1s-1 .448-1 1v3h-3c-.552 0-1 .448-1 1s.448 1 1 1h3v3c0 .552.448 1 1 1s1-.448 1-1v-3h3c.552 0 1-.448 1-1s-.448-1-1-1" fill="#fff"/></g><path d="m0 16.422v-16.015l11.591 11.619h-7.041l-.151.124z" fill="#fff"/><path d="m1 2.814v11.188l2.969-2.866.16-.139h5.036z" fill="#000"/></g></svg>\ No newline at end of filediff --git a/crates/cursor-info/assets/mac/drag_link.svg b/crates/cursor-info/assets/mac/drag_link.svgnew file mode 100644index 000000000..33d460479--- /dev/null+++ b/crates/cursor-info/assets/mac/drag_link.svg@@ -0,0 +1 @@+<svg height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" transform="translate(10 9)"><path d="m11 .0781-10.25.078 3.494 3.12c-.289.312-.527.571-.572.63-.156.203-.781 1.125-.969 1.516-.187.39-.562 1.39-.672 2.031-.1.589-.094 1.656-.078 2.109.015.423.16 1.258.297 1.641.219.609.344.938.625 1.375.316.492.593.767 1.031 1.188.391.375 2.188 1.234 2.188 1.234-.282-.359-.813-1.391-.938-1.75-.066-.19-.239-1.111-.281-1.531-.047-.469-.078-1.125-.063-1.594.014-.409.102-.809.204-1.172.109-.391.428-.907.687-1.266.203-.281.448-.572.797-.906.254-.244.551-.503.854-.727l3.615 3.227z" fill="#fff"/><path d="m9.9648 7.2402-.004-6.184-6.161.004 1.798 1.802c-.138.146-.326.345-.437.484-.277.347-.443.537-.61.732-.118.138-.262.317-.377.474-.159.217-.28.43-.361.575-.111.196-.226.46-.367.75-.196.404-.262.746-.319.982-.039.16-.13.571-.166.953-.028.29-.008.624-.008.759 0 .236-.024.52.027.98.047.421.296 1.351.482 1.722.156.313.462.93.462.93s-.17-1.518-.116-2.285c.032-.438.235-1.183.493-1.728.045-.093.053-.21.186-.422.103-.162.24-.386.355-.568.214-.337.654-.875.759-1.015.169-.225.66-.672.938-.917.142-.125.493-.419.793-.668z" fill="#000"/></g></svg>\ No newline at end of filediff --git a/crates/cursor-info/assets/mac/ibeam.svg b/crates/cursor-info/assets/mac/ibeam.svgnew file mode 100644index 000000000..b7de00fe1--- /dev/null+++ b/crates/cursor-info/assets/mac/ibeam.svg@@ -0,0 +1 @@+<svg height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><path d="m6.12306605-.48331676c.43304536-.02942018.89723494-.01586641 1.23506765.01110645l.09836607 2.00031187c-.52088553-.02633116-.86402421-.03615261-1.16297111-.01823278-.57216322.1246759-.83397559.26379885-1.13476879.47262866-.20678677.14251521-.54543639.60542479-.68837291.9244994v4.53970853h.998v1.984h-.998v3.57686113c.14285978.3186299.48159131.7805976.69278827.9256073.28177652.1964385.52739561.3374074.74486623.4121252.92617851.1117241.86141186.0439655 1.38886347.0608526l.24148845 1.9771822c-.63869922.0316331-1.03914186.0381475-1.41606129.0122618-.31198863-.0214264-.57343006-.0643378-.77405544-.129216-.41684626-.1296585-.85258908-.3604995-1.32295099-.6884424-.16852556-.1156905-.3571101-.2906327-.54285865-.4981462-.17040902.2017941-.33955796.3725205-.48392771.4855461-.40405946.3138676-.86631905.544191-1.35971316.6990619-.21164232.068207-.47249574.1108318-.78353769.1322303-.43450358.0298922-.90002831.0163041-1.23810501-.010835l-.09691742-2.0002571c.51770616.0263348.86168069.0362399 1.16109487.0181487.6186734-.1394818.87678125-.2519735 1.08726671-.4154673.19712987-.1543365.58456002-.6802379.70170954-.9838289l.01232275-3.57368433h-1.00027293v-1.984h1.002v-4.53315423c-.13203427-.30699537-.51655024-.83390163-.71128328-.98567507-.2013222-.15578504-.43877755-.27368925-.70166256-.36109174-.92774648-.11104657-.86334532-.04378063-1.3908609-.06035307l-.24301648-1.97729129c.64057546-.03160079 1.04058994-.03810767 1.41699023-.01249118.31067274.02114331.57118123.06339129.7795926.13006754.50016024.15848101.96025701.38783055 1.36565801.70154178.14340254.11176212.31252725.28238091.4832615.48453047.18451625-.20650555.37147758-.38041205.53791304-.49511426.47467546-.32956039.90822271-.55967002 1.31895768-.68980909.21133301-.06776711.4720386-.11004715.78312925-.13118199z" fill-rule="evenodd" stroke="#fff" stroke-linejoin="round" transform="translate(13 8)"/></svg>\ No newline at end of filediff --git a/crates/cursor-info/assets/mac/ibeam_vertical.svg b/crates/cursor-info/assets/mac/ibeam_vertical.svgnew file mode 100644index 000000000..4d77ae9c0--- /dev/null+++ b/crates/cursor-info/assets/mac/ibeam_vertical.svg@@ -0,0 +1 @@+<svg height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><path d="m11.123066-4.48331676c.4330454-.02942018.897235-.01586641 1.2350677.01110645l.0983661 2.00031187c-.5208856-.02633116-.8640242-.03615261-1.1629711-.01823278-.5721633.1246759-.8339756.26379885-1.1347688.47262866-.2067868.14251521-.54543642.60542479-.68837294.9244994v4.53970853h.99800004v1.984h-.99800004v3.5768611c.14285978.31862996.48159131.78059759.69278824.92560737.2817766.19643846.5273956.33740736.7448663.41212516.9261785.1117241.8614118.0439655 1.3888634.0608526l.2414885 1.9771822c-.6386992.0316331-1.0391419.0381475-1.4160613.0122618-.3119886-.0214264-.5734301-.0643378-.7740554-.129216-.41684631-.1296585-.85258913-.3604995-1.32295104-.6884424-.16852556-.1156905-.3571101-.2906327-.54285865-.4981462-.17040902.2017941-.33955796.3725205-.48392771.4855461-.40405946.3138676-.86631905.544191-1.35971316.6990619-.21164232.068207-.47249574.1108318-.78353769.1322303-.43450358.0298922-.90002831.0163041-1.23810501-.010835l-.09691742-2.0002571c.51770616.0263348.86168069.0362399 1.16109487.0181487.6186734-.1394818.87678125-.2519735 1.08726671-.41546726.19712987-.15433655.58456002-.68023797.70170954-.98382894l.01232275-3.57368433h-1.00027293v-1.984h1.002v-4.53315423c-.13203427-.30699537-.51655024-.83390163-.71128328-.98567507-.2013222-.15578504-.43877755-.27368925-.70166256-.36109174-.92774648-.11104657-.86334533-.04378063-1.3908609-.06035307l-.24301648-1.97729129c.64057546-.03160079 1.04058994-.03810766 1.41699023-.01249117.31067274.0211433.57118123.06339128.7795926.13006753.50016024.15848101.96025701.38783055 1.36565801.70154178.14340254.11176212.31252725.28238091.4832615.48453047.18451625-.20650555.37147758-.38041205.53791304-.49511426.47467546-.32956039.90822271-.55967002 1.31895768-.68980909.211333-.06776711.4720386-.11004715.7831292-.13118199z" fill-rule="evenodd" stroke="#fff" stroke-linejoin="round" transform="matrix(0 -1 1 0 12.1 23.976)"/></svg>\ No newline at end of filediff --git a/crates/cursor-info/assets/mac/open_hand.svg b/crates/cursor-info/assets/mac/open_hand.svgnew file mode 100644index 000000000..9b4b6a096--- /dev/null+++ b/crates/cursor-info/assets/mac/open_hand.svg@@ -0,0 +1 @@+<svg height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" transform="translate(7 6)"><path d="m4.5557 8.5742c-.098-.375-.196-.847-.406-1.552-.167-.557-.342-.859-.47-1.233-.155-.455-.303-.721-.496-1.181-.139-.329-.364-1.048-.457-1.44-.119-.509.033-.924.244-1.206.253-.339.962-.49 1.357-.351.371.13.744.512.916.788.288.46.357.632.717 1.542.393.992.564 1.918.611 2.231l.085.452c-.001-.04-.043-1.122-.044-1.162-.035-1.029-.06-1.823-.038-2.939.002-.126.064-.587.084-.715.078-.5.305-.8.673-.979.412-.201.926-.215 1.401-.017.423.173.626.55.687 1.022.014.109.094.987.093 1.107-.013 1.025.006 1.641.015 2.174.004.231.003 1.625.017 1.469.061-.656.094-3.189.344-3.942.144-.433.405-.746.794-.929.431-.203 1.113-.07 1.404.243.285.305.446.692.482 1.153.032.405-.019.897-.02 1.245 0 .867-.021 1.324-.037 2.121-.001.038-.015.298.023.182.094-.28.188-.542.266-.745.049-.125.241-.614.359-.859.114-.234.211-.369.415-.688.2-.313.415-.448.668-.561.54-.235 1.109.112 1.301.591.086.215.009.713-.028 1.105-.061.647-.254 1.306-.352 1.648-.128.447-.274 1.235-.34 1.601-.072.394-.234 1.382-.359 1.82-.086.301-.371.978-.652 1.384 0 0-1.074 1.25-1.192 1.812-.117.563-.078.567-.101.965-.024.399.121.923.121.923s-.802.104-1.234.034c-.391-.062-.875-.841-1-1.078-.172-.328-.539-.265-.682-.023-.225.383-.709 1.07-1.051 1.113-.668.084-2.054.03-3.139.02 0 0 .185-1.011-.227-1.358-.305-.26-.83-.784-1.144-1.06l-.832-.921c-.284-.36-.629-1.093-1.243-1.985-.348-.504-1.027-1.085-1.284-1.579-.223-.425-.331-.954-.19-1.325.225-.594.675-.897 1.362-.832.519.05.848.206 1.238.537.225.19.573.534.75.748.163.195.203.276.377.509.23.307.302.459.214.121" fill="#fff"/><g stroke="#000" stroke-linecap="round" stroke-width=".75"><path d="m4.5557 8.5742c-.098-.375-.196-.847-.406-1.552-.167-.557-.342-.859-.47-1.233-.155-.455-.303-.721-.496-1.181-.139-.329-.364-1.048-.457-1.44-.119-.509.033-.924.244-1.206.253-.339.962-.49 1.357-.351.371.13.744.512.916.788.288.46.357.632.717 1.542.393.992.564 1.918.611 2.231l.085.452c-.001-.04-.043-1.122-.044-1.162-.035-1.029-.06-1.823-.038-2.939.002-.126.064-.587.084-.715.078-.5.305-.8.673-.979.412-.201.926-.215 1.401-.017.423.173.626.55.687 1.022.014.109.094.987.093 1.107-.013 1.025.006 1.641.015 2.174.004.231.003 1.625.017 1.469.061-.656.094-3.189.344-3.942.144-.433.405-.746.794-.929.431-.203 1.113-.07 1.404.243.285.305.446.692.482 1.153.032.405-.019.897-.02 1.245 0 .867-.021 1.324-.037 2.121-.001.038-.015.298.023.182.094-.28.188-.542.266-.745.049-.125.241-.614.359-.859.114-.234.211-.369.415-.688.2-.313.415-.448.668-.561.54-.235 1.109.112 1.301.591.086.215.009.713-.028 1.105-.061.647-.254 1.306-.352 1.648-.128.447-.274 1.235-.34 1.601-.072.394-.234 1.382-.359 1.82-.086.301-.371.978-.652 1.384 0 0-1.074 1.25-1.192 1.812-.117.563-.078.567-.101.965-.024.399.121.923.121.923s-.802.104-1.234.034c-.391-.062-.875-.841-1-1.078-.172-.328-.539-.265-.682-.023-.225.383-.709 1.07-1.051 1.113-.668.084-2.054.03-3.139.02 0 0 .185-1.011-.227-1.358-.305-.26-.83-.784-1.144-1.06l-.832-.921c-.284-.36-.629-1.093-1.243-1.985-.348-.504-1.027-1.085-1.284-1.579-.223-.425-.331-.954-.19-1.325.225-.594.675-.897 1.362-.832.519.05.848.206 1.238.537.225.19.573.534.75.748.163.195.203.276.377.509.23.307.302.459.214.121" stroke-linejoin="round"/><path d="m11.566 12.734v-3.459"/><path d="m9.551 12.746-.016-3.473"/><path d="m7.555 9.305.021 3.426"/></g></g></svg>\ No newline at end of filediff --git a/crates/cursor-info/assets/mac/operation_not_allowed.svg b/crates/cursor-info/assets/mac/operation_not_allowed.svgnew file mode 100644index 000000000..65d0d2a3c--- /dev/null+++ b/crates/cursor-info/assets/mac/operation_not_allowed.svg@@ -0,0 +1 @@+<svg height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="notalloweda" x1="50%" x2="50%" y1="0%" y2="100%"><stop offset="0" stop-color="#f0f0f0"/><stop offset="1" stop-color="#d5d5d5"/></linearGradient><g fill="none" fill-rule="evenodd" transform="translate(7)"><path d="m1 23c0 4.97 4.03 9 9 9 4.97 0 9-4.03 9-9 0-4.971-4.03-9-9-9-4.97 0-9 4.029-9 9zm4.826-5.61c1.167-.869 2.608-1.39 4.174-1.39 3.866 0 7 3.134 7 7 0 1.567-.52 3.008-1.39 4.174zm-2.826 5.61c0-1.578.529-3.029 1.409-4.199l9.79 9.79c-1.171.881-2.622 1.409-4.199 1.409-3.866 0-7-3.134-7-7z" fill="url(#notalloweda)"/><path d="m0 16.422v-16.015l11.591 11.619h-7.041l-.151.124z" fill="#fff"/><path d="m1 2.814v11.188l2.969-2.866.16-.139h5.036z" fill="#000"/></g></svg>\ No newline at end of filediff --git a/crates/cursor-info/assets/mac/pointing_hand.svg b/crates/cursor-info/assets/mac/pointing_hand.svgnew file mode 100644index 000000000..ef77a7d70--- /dev/null+++ b/crates/cursor-info/assets/mac/pointing_hand.svg@@ -0,0 +1 @@+<svg height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" transform="translate(9 8)"><path d="m3.8852309 13.5522788c.15029277.1354048.25406355.2326609.57471053.5372549.31406586.2983172.46594413.439273.60482646.5572091.05791893.0487853.10729946.1792495.12686364.3731628.01609788.1595565.01049553.3375341-.0090192.5090254-.00674888.0593077-.01325791.1020883-.01698742.1224696-.04186639.2287942.13249226.4401222.36507344.4424801.20929712.0021219.37056581.00472.79741331.0123273.10679864.0019014.10679864.0019014.21395196.0037648 1.16029156.0199598 1.75290683.01448 2.1782236-.039003.45462139-.05716.92282087-.6061887 1.32754658-1.2951218.3429437.6096032.818651 1.2048784 1.2990136 1.282277.1525992.0243739.3372104.0319365.5511764.0270146.1595258-.0036697.328349-.0141847.4987188-.0294071.1284742-.0114791.2308379-.0230173.2919821-.0309462.2259121-.0292954.3737346-.2515956.31337-.4712558-.0130388-.0474468-.0339905-.1345046-.0551176-.2441066-.0244927-.1270617-.0421932-.2511642-.0502379-.3642189-.0051002-.0716765-.0061057-.1365707-.0028638-.1926702.0056365-.097781.007395-.1525378.0101327-.2790463.0010457-.0470941.0010457-.0470941.0024433-.0883088.0052898-.134881.0234093-.2629524.0820463-.5422232.0251901-.1212103.1472903-.3531692.3395862-.6402332.0572734-.0854992.1198813-.1747825.1869659-.2669588.127207-.1747861.2641214-.3514011.4010853-.5204043.0820457-.1012383.1454717-.1769623.1807968-.2180763.2962199-.424403.6120842-1.1191696.7281396-1.5253635.111416-.3904017.2005405-1.10937558.2553074-1.81604479.0300143-.40088807.0411211-.72405394.0411211-1.23097561.0000507-.08891816.0000507-.08891816.0002032-.16234685.0002858-.12025251.0003032-.16573976-.0000887-.22195195-.0010706-.15358041-.0055478-.30580145-.0203882-.6940256-.0319191-.81365149-.4778003-1.3396911-1.1348711-1.44115781-.5589865-.08632026-1.2393839.37795756-1.2393839.37795756s-.1514404-.5228127-.2537197-.6842075c-.1661957-.25934741-.5941748-.58982828-.9213451-.65421118-.3365014-.0653413-.7354024-.05811592-1.1017193.00667481-.3207944.05740454-.64034865.34382687-.82518751.65277182-.13223727.22039488-.00786932-.01169164-.14013104-.2396787-.1830552-.31402315-.60932935-.59522407-1.01524567-.67822294-.34396352-.07112559-.73801897-.04403625-1.09795562.06293793-.46304125.13836397-.53675291.49073282-.55516748.38984626-.06158674-.3382385-.06727482-.3160095-.105656-.55729603-.14258072-.89527436-.30213161-1.51473549-.54406219-2.05528331.01391678.0310773-.08860981-.20214701-.12592279-.28256779-.06461002-.13925416-.12910532-.2652956-.19999629-.38652204-.21850342-.37364978-.46891278-.65340904-.7830908-.81233894-.54561037-.27629378-1.3634177-.14183064-1.75105565.31064856-.38495968.44966797-.4491432 1.20149287-.3521966 2.13184003.03702376.36121263.16678627 1.02066144.28444961 1.50812387.04160602.1691894.07805979.32348903.14491578.60851331.01149723.04848415.01149723.04848415.02309483.09698036.05172236.21571896.09707607.39320067.15122332.5879629-.00568154-.02030261.09701461.344086.11888835.42472961.00727686.02691587.00727686.02691587.01448296.05395339.04082856.15377935.08074083.31959314.14309954.5963099.03412572.1521447.06742545.31468601.09999775.48699018.08883553.46993091.089274.37207374.00375852.27186198-.05907319-.06922522-.11463055-.13209255-.16830659-.19003644-.09976937-.10770214-.19148509-.19677225-.2785569-.2678141-.6343975-.51905295-1.02312991-.74839425-1.55681885-.79878106-.87541567-.08410158-1.70619803.53426712-1.83111632 1.36882761-.07682697.51169638-.05207639.74723271.18463583 1.19942735.13026223.24432805.35060714.53942202.76172732 1.04735429.02515953.031068.02515953.031068.05030428.06206416.50464537.62186746.55962098.69095396.67961467.86473786.32435479.4706845 1.1139501 1.8221455 1.25748612 2.0035872z" fill="#000"/><path d="m1.68266944 9.2716401c-.02488625-.03067752-.02488625-.03067752-.04970567-.06132555-.37729166-.46613768-.58418002-.74321015-.68156241-.9258495-.15281729-.29195235-.1611316-.37107459-.10605794-.73788601.06473349-.43247455.53181583-.78013371 1.01829549-.73339767.33660502.03178017.63068475.20527903 1.15339692.63295262.0565942.04617564.12482853.1124417.20288232.19670163.04616569.04983637.09513192.10524534.14800114.16720042.0794093.0930562.34702847.42052231.30761424.37286894.05814283.06991619.09971852.12407704.14721655.19045018.0941062.13434104.14705111.20894642.21874992.30454484-.0336171-.04487143.21473082.29843305.26732159.34863333.27859812.26593456.68203289.04195871.65675979-.31244785-.00421914-.05916537-.01812774-.12308431-.04717934-.23466885-.11487425-.81923739-.15505751-1.08218312-.24678252-1.56739907-.03407352-.18024544-.06905328-.35098727-.10521102-.5121905-.06435409-.28557213-.10635725-.46007245-.14994794-.62425526-.00774801-.02907063-.00774801-.02907063-.01552357-.05783095-.02300644-.08481964-.12725123-.45470311-.12030828-.42989063-.05134381-.18468043-.0945453-.35373996-.14431997-.56133562-.01130896-.04728909-.01130896-.04728909-.02259904-.09489949-.06649254-.28350912-.10387999-.44176072-.14606063-.6132721-.10998732-.45567652-.23425389-1.08719519-.2671036-1.40768017-.07546665-.72422018-.02339381-1.33418457.17582284-1.56688778.15554834-.1815673.59641015-.25405339.84271752-.12932486.16107512.0814814.32204278.26131571.47435101.521769.05764302.09857191.11172763.20426801.16708381.32357735.0335256.07225783.13292567.29837003.12172905.27336705.21032209.46992469.354801 1.03086841.48791736 1.86671535.03939531.24766201.08813662.52823537.15063928.87150416.01857903.10178746.01857903.10178746.03722922.20314381.30139226 1.63533599.27933797 1.51139381.28367122 1.64182468.01580667.47578071.71810567.4869267.74900255.01188722.00979855-.15065269.00630989-.2851661-.01107827-.67146517-.00245496-.05465243-.00245496-.05465243-.00481877-.10910149-.01521525-.35590459-.01433687-.56066672.00670546-.67705709.03834708-.21223125.22887-.4499778.40434754-.50241339.24641865-.07323589.51640341-.09179599.73269877-.04707051.20703808.0423346.44864736.20171736.51796318.32062499.08353628.14399789.15516008.36337367.21006107.63530456.04431149.21947986.07480439.45493493.0962536.70624261.00667352.0781897.01103024.13859819.01772256.23854675.00285005.04183594.00285005.04183594.00568968.07635213.00160285.01731471.00160285.01731471.00551199.04467336.00303535.01917374.00303535.01917374.01734216.06773608.00727602.13782339.00727602.13782339.56081544.18893151.16530264-.19982737.16530264-.19982737.16077268-.23486454.02708074-.1183491.04365279-.250265.06727822-.49813693.01508098-.16112409.02268576-.24033521.03157416-.32249887.036794-.34012028.0835164-.55621578.140511-.65120691.0707148-.11819408.3197845-.28280909.4314962-.30279961.2805348-.04961763.5886064-.0551978.8264635-.00901194.1077347.021202.3705429.22413969.4327499.32121002.1277282.20156171.2519621.8513817.3219188 1.49611734-.0110122.04228902-.0110122.04228902.1607163.28760404.5903408-.06730286.5903408-.06730286.5737568-.17389206.0155734-.03799147.0279666-.08191522.0455068-.15013809.0421947-.1597068.0701719-.25243998.1118273-.35635899.0288165-.07188915.0591935-.13335501.0903398-.18227881.120675-.18992919.4330876-.31896311.7070596-.2766556.2942545.0454396.4817569.26665023.4998934.72896761.0145423.38042999.0188438.52667972.0198445.67022961.0003693.0529684.0003531.09548963.0000723.21509672-.0001536.07391241-.0001536.07391241-.000205.16397385 0 .48892448-.010469.79353263-.0389535 1.17400348-.0506294.653266-.1361064 1.34281542-.228649 1.66708482-.094456.330596-.3764591.9508823-.5997469 1.2734975-.0158389.0153017-.0838055.0964468-.1706932.2036597-.1445918.1784155-.2892331.364998-.4248114.5512865-.0725632.099704-.140705.1968792-.2036767.2908847-.2436695.3637558-.4000227.6607868-.4506249.9042828-.0664376.3164194-.0901813.4842425-.0973169.666189-.0017426.0515155-.0017426.0515155-.0028439.1014735-.0025547.1180556-.0040857.165727-.0090621.2520573-.0052398.0906702-.0037444.1871795.0035093.2891187.0103883.145992.0000001.3454812.0000001.3454812s-.1266332-.0118299-.2678551-.0085813c-.1725177.0039685-.3159859-.0019087-.4151297-.0177442-.143046-.0230487-.5293508-.5064503-.7271506-.8830611-.3022704-.5764228-1.03604858-.5484427-1.33684295-.0394061-.27130191.4618137-.65965243.9172085-.77493336.9317029-.37460536.047106-.95471158.0524702-2.07175566.0332544-.10679478-.0018572-.10679478-.0018572-.21348729-.0037567-.42889761-.0076439-.41241496.0647655-.40363307-.0124079.02506967-.2203068.02222332-.1790312.00000011-.3992999-.03726222-.36933-.15125405-.6704984-.38877094-.8705429-.12286946-.1043424-.26983033-.2407345-.56500741-.5211097-.33722428-.3203411-.44283686-.4193233-.57299128-.5337266l-.80130455-.8907189c-.08795856-.1124788-.86002339-1.4339349-1.21248613-1.9454077-.13710846-.19857111-.18839645-.26302343-.71461353-.9114734zm9.50873056.0037599v3.459c0 .5.75.5.75 0v-3.459c0-.5-.75-.5-.75 0zm-2.03159602-.00057241.016 3.47300001c.00230346.4999947.7522955.4965395.74999204-.0034552l-.016-3.47299999c-.00230346-.4999947-.7522955-.49653951-.74999204.00345518zm-1.20911102 3.45357381-.021-3.42599996c-.00306475-.4999906-.75305066-.49539349-.74998592.00459712l.021 3.42600004c.00306475.4999906.75305066.4953935.74998592-.0045972z" fill="#fff"/></g></svg>\ No newline at end of filediff --git a/crates/cursor-info/assets/mac/resize_down.svg b/crates/cursor-info/assets/mac/resize_down.svgnew file mode 100644index 000000000..794d7a672--- /dev/null+++ b/crates/cursor-info/assets/mac/resize_down.svg@@ -0,0 +1 @@+<svg height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><g fill="none" transform="translate(8 11)"><path d="m0 .001v3.98h6.006v1.059h-3.466l5.472 5.961 5.461-5.961h-3.478v-1.059h6.005v-3.98z" fill="#fff"/><path d="m1 2.98h6v3.04h-2.24l3.251 3.32 3.223-3.32h-2.254v-3.04h6v-1.96h-13.98z" fill="#000"/></g></svg>\ No newline at end of filediff --git a/crates/cursor-info/assets/mac/resize_left.svg b/crates/cursor-info/assets/mac/resize_left.svgnew file mode 100644index 000000000..ee59c47d4--- /dev/null+++ b/crates/cursor-info/assets/mac/resize_left.svg@@ -0,0 +1 @@+<svg height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><g fill="none" transform="translate(11 8)"><path d="m7.02 0v6.006h-1.02v-3.866l-6 5.872 6 5.89v-3.907h1.02v6.005h3.98v-16z" fill="#fff"/><path d="m8 1v6h-3.02v-2.24l-3.32 3.251 3.32 3.223v-2.254h3.02v6h1.98v-13.98z" fill="#000"/></g></svg>\ No newline at end of filediff --git a/crates/cursor-info/assets/mac/resize_left_right.svg b/crates/cursor-info/assets/mac/resize_left_right.svgnew file mode 100644index 000000000..fc280d407--- /dev/null+++ b/crates/cursor-info/assets/mac/resize_left_right.svg@@ -0,0 +1 @@+<svg height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><g fill="none" transform="translate(7 8)"><path d="m7 0v6.006h-1.021v-3.466l-5.979 5.472 5.979 5.461v-3.478h1.021v6.005h.02 3.961v-6.006h1.058v3.467l5.961-5.473-5.961-5.461v3.478h-1.058v-6.005z" fill="#fff"/><path d="m16.34 7.989-3.32-3.223v2.254h-3.02v-5.96h-.019v-.02h-1.941v6h-3.06v-2.28l-3.32 3.251 3.32 3.224v-2.254h3.06v6h.02 1.921.019v-6h3.02v2.259z" fill="#000"/></g></svg>\ No newline at end of filediff --git a/crates/cursor-info/assets/mac/resize_right.svg b/crates/cursor-info/assets/mac/resize_right.svgnew file mode 100644index 000000000..f0fe6c64b--- /dev/null+++ b/crates/cursor-info/assets/mac/resize_right.svg@@ -0,0 +1 @@+<svg height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><g fill="none" transform="translate(11 8)"><path d="m.001 0v16h3.98v-6.006h1.059v3.467l5.961-5.473-5.961-5.461v3.478h-1.059v-6.005z" fill="#fff"/><path d="m3 14.98v-6h3.02v2.261l3.32-3.252-3.32-3.223v2.253h-3.02v-5.999h-1.98v13.96z" fill="#000"/></g></svg>\ No newline at end of filediff --git a/crates/cursor-info/assets/mac/resize_up.svg b/crates/cursor-info/assets/mac/resize_up.svgnew file mode 100644index 000000000..41bcc685b--- /dev/null+++ b/crates/cursor-info/assets/mac/resize_up.svg@@ -0,0 +1 @@+<svg height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><g fill="none" transform="translate(8 10)"><path d="m2.527 6.961h3.478v1.058h-6.005v3.981h16v-3.981h-6.006v-1.058h3.467l-5.473-5.962z" fill="#fff"/><path d="m15 9.02h-6v-3.039h2.24l-3.251-3.321-3.223 3.321h2.254v3.039h-6v1.96h13.98z" fill="#000"/></g></svg>\ No newline at end of filediff --git a/crates/cursor-info/assets/mac/resize_up_down.svg b/crates/cursor-info/assets/mac/resize_up_down.svgnew file mode 100644index 000000000..09eccb196--- /dev/null+++ b/crates/cursor-info/assets/mac/resize_up_down.svg@@ -0,0 +1 @@+<svg height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><g fill="none" transform="translate(8 7)"><path d="m7.988 0-5.461 5.962h3.478v1.038h-6.005v.019 3.942.02h6.005v1.058h-3.466l5.472 5.961 5.462-5.961h-3.478v-1.058h6.005v-3.981h-6.006v-1.038h3.467z" fill="#fff"/><path d="m14.961 8.02h-5.981v-3.039h2.26l-3.251-3.32-3.223 3.32h2.254v3.039h-5.98-.02v1.96h.02 6v3.04h-2.28l3.251 3.32 3.223-3.32h-2.253v-3.04h5.98.02v-1.96z" fill="#000"/></g></svg>\ No newline at end of filediff --git a/crates/cursor-info/assets/windows/arrow.svg b/crates/cursor-info/assets/windows/arrow.svgnew file mode 100644index 000000000..8fc222050--- /dev/null+++ b/crates/cursor-info/assets/windows/arrow.svg@@ -0,0 +1,3 @@+<svg width="75" height="122" viewBox="0 0 75 122" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M2 98.8824V5L70 73.2781H37.5315L54.0721 112.904L37.5315 119L21.6036 79.984L2 98.8824Z" fill="white" stroke="black" stroke-width="4"/>+</svg>diff --git a/crates/cursor-info/assets/windows/cross.svg b/crates/cursor-info/assets/windows/cross.svgnew file mode 100644index 000000000..a96f1b0a0--- /dev/null+++ b/crates/cursor-info/assets/windows/cross.svg@@ -0,0 +1,3 @@+<svg width="121" height="121" viewBox="0 0 121 121" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M54 54V2H67V54H119V67H67V119H54V67H2V54H54Z" fill="#FFFFFE" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+</svg>diff --git a/crates/cursor-info/assets/windows/hand.svg b/crates/cursor-info/assets/windows/hand.svgnew file mode 100644index 000000000..970581190--- /dev/null+++ b/crates/cursor-info/assets/windows/hand.svg@@ -0,0 +1,8 @@+<svg width="97" height="125" viewBox="0 0 97 125" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M48.0596 62.0496V38.8046C48.0596 38.8046 48.0596 31.0562 55.8079 31.0562C63.5562 31.0562 63.5562 38.8046 63.5562 38.8046V62.0496" fill="#FFFFFE"/>+<path d="M48.0596 62.0496V38.8046C48.0596 38.8046 48.0596 31.0562 55.8079 31.0562C63.5562 31.0562 63.5562 38.8046 63.5562 38.8046V62.0496" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M63.5562 62.0495V42.6787C63.5562 42.6787 63.5562 34.9304 71.3045 34.9304C79.0529 34.9304 79.0529 42.6787 79.0529 42.6787V62.0495" fill="#FFFFFE"/>+<path d="M63.5562 62.0495V42.6787C63.5562 42.6787 63.5562 34.9304 71.3045 34.9304C79.0529 34.9304 79.0529 42.6787 79.0529 42.6787V62.0495" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M79.0529 62.0496V46.5529C79.0529 46.5529 79.0529 38.8046 86.8012 38.8046C94.5496 38.8046 94.5496 46.5529 94.5496 46.5529V83.3575C94.5496 83.3575 98.4238 122.099 59.6821 122.099C59.6821 122.099 45.4331 122.856 32.5629 110.477L5.44371 79.4833C5.44371 79.4833 -2.30463 71.735 5.44371 63.9866C5.44371 63.9866 11.2549 58.1754 20.9404 67.8608L27.6674 74.5878C29.474 76.3944 32.5629 75.1149 32.5629 72.56V9.74834C32.5629 9.74834 32.5629 2 40.3112 2C48.0596 2 48.0596 9.74834 48.0596 9.74834V62.0496" fill="#FFFFFE"/>+<path d="M79.0529 62.0496V46.5529C79.0529 46.5529 79.0529 38.8046 86.8012 38.8046C94.5496 38.8046 94.5496 46.5529 94.5496 46.5529V83.3575C94.5496 83.3575 98.4238 122.099 59.6821 122.099C59.6821 122.099 45.4331 122.856 32.5629 110.477L5.44371 79.4833C5.44371 79.4833 -2.30463 71.735 5.44371 63.9866C5.44371 63.9866 11.2549 58.1754 20.9404 67.8608L27.6674 74.5878C29.474 76.3944 32.5629 75.1149 32.5629 72.56V9.74834C32.5629 9.74834 32.5629 2 40.3112 2C48.0596 2 48.0596 9.74834 48.0596 9.74834V62.0496" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+</svg>diff --git a/crates/cursor-info/assets/windows/ibeam.svg b/crates/cursor-info/assets/windows/ibeam.svgnew file mode 100644index 000000000..bd12ae6b2--- /dev/null+++ b/crates/cursor-info/assets/windows/ibeam.svg@@ -0,0 +1,3 @@+<svg width="78" height="130" viewBox="0 0 78 130" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M76 16.814V2.10815H46.4V5.78462H31.6V2.10815H2V16.814H31.6V112.402H2V127.108H31.6V123.432H46.4V127.108H76V112.402H46.4V16.814H76Z" fill="#FFFFFE" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+</svg>diff --git a/crates/cursor-info/assets/windows/no.svg b/crates/cursor-info/assets/windows/no.svgnew file mode 100644index 000000000..c9a3dc140--- /dev/null+++ b/crates/cursor-info/assets/windows/no.svg@@ -0,0 +1,3 @@+<svg width="129" height="130" viewBox="0 0 129 130" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M127 64.6082C127 30.1462 98.962 2.10815 64.5 2.10815C30.038 2.10815 2 30.1462 2 64.6082C2 99.0701 30.038 127.108 64.5 127.108C98.962 127.108 127 99.0701 127 64.6082ZM64.5 111.483C54.7702 111.483 45.7259 108.5 38.2267 103.406L103.298 38.3368C108.392 45.8356 111.375 54.8788 111.375 64.6082C111.375 90.4565 90.3484 111.483 64.5 111.483ZM64.5 17.7332C74.9871 17.7332 84.6469 21.2365 92.4641 27.0763L26.9667 92.5708C21.1278 84.7535 17.625 75.0942 17.625 64.6082C17.625 38.7598 38.6516 17.7332 64.5 17.7332Z" fill="#FFFFFE" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+</svg>diff --git a/crates/cursor-info/assets/windows/pen.svg b/crates/cursor-info/assets/windows/pen.svgnew file mode 100644index 000000000..720137b75--- /dev/null+++ b/crates/cursor-info/assets/windows/pen.svg@@ -0,0 +1,11 @@+<svg width="105" height="106" viewBox="0 0 105 106" fill="none" xmlns="http://www.w3.org/2000/svg">+<g clip-path="url(#clip0_18_60)">+<path d="M3.21875 102.781C5.13255 80.6168 21.2415 66.5513 21.2415 66.5513L84.051 3.74174C85.3317 2.46109 87.408 2.46109 88.6887 3.74174L95.4735 10.5265L102.258 17.3113C103.539 18.592 103.539 20.6683 102.258 21.949L39.4487 84.7585C39.4487 84.7585 25.3832 100.867 3.21875 102.781Z" fill="#FFFFFE" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M71.2188 16.7812L89.2188 34.7812" stroke="black" stroke-width="4" stroke-miterlimit="10"/>+</g>+<defs>+<clipPath id="clip0_18_60">+<rect width="105" height="106" fill="white"/>+</clipPath>+</defs>+</svg>diff --git a/crates/cursor-info/assets/windows/size-nesw.svg b/crates/cursor-info/assets/windows/size-nesw.svgnew file mode 100644index 000000000..889732e75--- /dev/null+++ b/crates/cursor-info/assets/windows/size-nesw.svg@@ -0,0 +1,3 @@+<svg width="115" height="116" viewBox="0 0 115 116" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M80.3529 93.5199L64.0294 109.843L67.2941 113.108H113V67.4022L109.735 64.1375L93.4118 80.4611L34.647 21.6963L50.9706 5.37286L47.7058 2.10815H2V47.814L5.26471 51.0787L21.5882 34.7552L80.3529 93.5199Z" fill="#FFFFFE" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+</svg>diff --git a/crates/cursor-info/assets/windows/size-ns.svg b/crates/cursor-info/assets/windows/size-ns.svgnew file mode 100644index 000000000..6d1be6bf4--- /dev/null+++ b/crates/cursor-info/assets/windows/size-ns.svg@@ -0,0 +1,3 @@+<svg width="55" height="131" viewBox="0 0 55 131" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M20.2143 32.5199H2V28.8435L27.5 3.10815L53 28.8435V32.5199H34.7857V98.6964H53V102.373L27.5 128.108L2 102.373V98.6964H20.2143V32.5199Z" fill="#FFFFFE" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+</svg>diff --git a/crates/cursor-info/assets/windows/sizeall.svg b/crates/cursor-info/assets/windows/sizeall.svgnew file mode 100644index 000000000..a3d615abd--- /dev/null+++ b/crates/cursor-info/assets/windows/sizeall.svg@@ -0,0 +1,3 @@+<svg width="123" height="123" viewBox="0 0 123 123" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M30.5294 68.4905V85.6964H27.0882L3 61.6082L27.0882 37.5199H30.5294V54.7258H54.6176V30.6376H37.4118V27.1964L61.5 3.10815L85.5882 27.1964V30.6376H68.3824V54.7258H92.4706V37.5199H95.9118L120 61.6082L95.9118 85.6964H92.4706V68.4905H68.3824V92.5787H85.5882V96.0199L61.5 120.108L37.4118 96.0199V92.5787H54.6176V68.4905H30.5294Z" fill="#FFFFFE" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+</svg>diff --git a/crates/cursor-info/assets/windows/wait.svg b/crates/cursor-info/assets/windows/wait.svgnew file mode 100644index 000000000..256de2f5d--- /dev/null+++ b/crates/cursor-info/assets/windows/wait.svg@@ -0,0 +1,46 @@+<svg width="76" height="123" viewBox="0 0 76 123" fill="none" xmlns="http://www.w3.org/2000/svg">+<g clip-path="url(#clip0_18_13)">+<path d="M7.25 109.796H68.75V89.2957L48.25 68.7957V58.5457L68.75 38.0457V12.4207H7.25V38.0457L27.75 58.5457V68.7957L7.25 89.2957V109.796Z" fill="#FFFFFE"/>+<path d="M68.75 109.796V89.2957L48.25 68.7957V58.5457L68.75 38.0457V12.4207" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M7.25 12.4207V38.0457L27.75 58.5457V68.7957L7.25 89.2957V109.796" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M73.875 2.17065H2.125V12.4207H73.875V2.17065Z" fill="#FFFFFE" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M73.875 109.796H2.125V120.046H73.875V109.796Z" fill="#FFFFFE" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M35.4375 53.4207H40.5625" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M40.5625 48.2957H45.6875" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M40.5625 38.0457H45.6875" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M30.3125 38.0457H35.4375" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M35.4375 32.9207H40.5625" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M25.1875 32.9207H30.3125" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M30.3125 27.7957H35.4375" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M40.5625 27.7957H45.6875" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M45.6875 32.9207H50.8125" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M50.8125 27.7957H55.9375" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M55.9375 22.6707H61.0625" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M45.6875 22.6707H50.8125" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M35.4375 22.6707H40.5625" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M25.1875 22.6707H30.3125" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M20.0625 27.7957H25.1875" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M14.9375 22.6707H20.0625" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M14.9375 99.5457H20.0625" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M25.1875 99.5457H30.3125" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M35.4375 99.5457H40.5625" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M45.6875 99.5457H50.8125" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M55.9375 99.5457H61.0625" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M20.0625 94.4207H25.1875" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M30.3125 94.4207H35.4375" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M40.5625 94.4207H45.6875" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M50.8125 94.4207H55.9375" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M25.1875 89.2957H30.3125" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M35.4375 89.2957H40.5625" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M30.3125 84.1707H35.4375" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M40.5625 84.1707H45.6875" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M35.4375 79.0457H40.5625" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M45.6875 89.2957H50.8125" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+<path d="M35.4375 63.6707H40.5625" stroke="#000001" stroke-width="4" stroke-miterlimit="10"/>+</g>+<defs>+<clipPath id="clip0_18_13">+<rect width="76" height="122" fill="white" transform="translate(0 0.108154)"/>+</clipPath>+</defs>+</svg>diff --git a/crates/cursor-info/cursors.html b/crates/cursor-info/cursors.htmlnew file mode 100644index 000000000..df920e5f0--- /dev/null+++ b/crates/cursor-info/cursors.html@@ -0,0 +1,427 @@+<!DOCTYPE html>+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>Cursor Hotspot Viewer</title>+ <style>+ body {+ font-family: Arial, sans-serif;+ margin: 20px;+ background-color: #f5f5f5;+ }++ .header {+ text-align: center;+ margin-bottom: 30px;+ }++ .cursor-grid {+ display: grid;+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));+ gap: 20px;+ max-width: 1200px;+ margin: 0 auto;+ }++ .cursor-item {+ background: white;+ border-radius: 8px;+ padding: 20px;+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);+ text-align: center;+ }++ .cursor-name {+ font-weight: bold;+ margin-bottom: 10px;+ color: #333;+ }++ .cursor-hash {+ font-size: 10px;+ color: #666;+ margin-bottom: 15px;+ word-break: break-all;+ }++ .cursor-container {+ position: relative;+ display: inline-block;+ border: 2px solid #ddd;+ border-radius: 4px;+ background: linear-gradient(45deg, #ccc 25%, transparent 25%),+ linear-gradient(-45deg, #ccc 25%, transparent 25%),+ linear-gradient(45deg, transparent 75%, #ccc 75%),+ linear-gradient(-45deg, transparent 75%, #ccc 75%);+ background-size: 10px 10px;+ background-position: 0 0, 0 5px, 5px -5px, -5px 0px;+ cursor: crosshair;+ }++ .cursor-svg {+ display: block;+ max-width: 200px;+ max-height: 200px;+ }++ .hotspot {+ position: absolute;+ width: 8px;+ height: 8px;+ background: red;+ border: 2px solid white;+ border-radius: 50%;+ transform: translate(-50%, -50%);+ pointer-events: none;+ box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);+ }++ .hotspot-info {+ margin-top: 10px;+ font-size: 12px;+ color: #666;+ }++ .mouse-position {+ margin-top: 5px;+ font-size: 11px;+ color: #999;+ min-height: 15px;+ }++ .copy-button {+ margin-top: 5px;+ padding: 2px 8px;+ font-size: 10px;+ background: #007bff;+ color: white;+ border: none;+ border-radius: 3px;+ cursor: pointer;+ }++ .copy-button:hover {+ background: #0056b3;+ }++ .platform-section {+ margin-bottom: 40px;+ }++ .platform-title {+ font-size: 24px;+ font-weight: bold;+ margin-bottom: 20px;+ color: #333;+ border-bottom: 2px solid #007bff;+ padding-bottom: 10px;+ }++ .todo-marker {+ background: #fff3cd;+ color: #856404;+ padding: 5px;+ border-radius: 4px;+ font-size: 12px;+ }+ </style>+ </head>+ <body>+ <div class="header">+ <h1>Cursor Hotspot Viewer</h1>+ <p>+ Hover over cursors to see mouse coordinates, click to copy hotspot+ values+ </p>+ </div>++ <div class="platform-section">+ <h2 class="platform-title">macOS Cursors</h2>+ <div class="cursor-grid" id="macos-cursors"></div>+ </div>++ <div class="platform-section">+ <h2 class="platform-title">Windows Cursors</h2>+ <div class="cursor-grid" id="windows-cursors"></div>+ </div>++ <script>+ const cursors = {+ macos: [+ {+ name: "arrow",+ hash: "de2d1f4a81e520b65fd1317b845b00a1c51a4d1f71cca3cd4ccdab52b98d1ac9",+ svg: "assets/mac/arrow.svg",+ hotspot: [0.235, 0.174],+ },+ {+ name: "contextual_menu",+ hash: "ab26ca862492d41355b711c58544687a799dd7ae14cf161959ca524bbc97c322",+ svg: "assets/mac/contextual_menu.svg",+ hotspot: [0.179, 0.125],+ },+ {+ name: "closed_hand",+ hash: "fbb165d4603dd8808b536f45bb74a9a72d9358ad19714b318bb7c06358a7d3c2",+ svg: "assets/mac/closed_hand.svg",+ hotspot: [0.5, 0.5],+ },+ {+ name: "crosshair",+ hash: "c583f776531f4e7b76ea7ba2ab159765e2da11fd63cb897cc10362183859d1d8",+ svg: "assets/mac/crosshair.svg",+ hotspot: [0.458, 0.458],+ },+ {+ name: "drag_copy",+ hash: "af060876004c8647d82411eeac1bbd613d2991d46794aba16b56c91d3081e128",+ svg: "assets/mac/drag_copy.svg",+ hotspot: [0.179, 0.125],+ },+ {+ name: "drag_link",+ hash: "59ac2483461f4ad577a0a6b68be89fe663c36263b583c5f038eee2ae6a5ad98f",+ svg: "assets/mac/drag_link.svg",+ hotspot: [0.688, 0.143],+ },+ {+ name: "ibeam",+ hash: "492dca0bb6751a30607ac728803af992ba69365052b7df2dff1c0dfe463e653c",+ svg: "assets/mac/ibeam.svg",+ hotspot: [0.444, 0.5],+ },+ {+ name: "open_hand",+ hash: "3f6a5594a3c9334065944b9c56d9f73fd5fe5f02108a5e28f37e222e770be476",+ svg: "assets/mac/open_hand.svg",+ hotspot: [0.5, 0.5],+ },+ {+ name: "operation_not_allowed",+ hash: "37287ef1d097704d3e9d0be9c1049ce1fb6dfabd6d210af0429b1b6ec7084c59",+ svg: "assets/mac/operation_not_allowed.svg",+ hotspot: [0.179, 0.125],+ },+ {+ name: "pointing_hand",+ hash: "b0443e9f72e724cb6d94b879bf29c6cb18376d0357c6233e5a7561cf8a9943c6",+ svg: "assets/mac/pointing_hand.svg",+ hotspot: [0.406, 0.25],+ },+ {+ name: "resize_down",+ hash: "3c9bf0ce893b64fe9e4363793b406140d4b3900b7beafa1c409e78cf5a8cf954",+ svg: "assets/mac/resize_down.svg",+ hotspot: [0.5, 0.5],+ },+ {+ name: "resize_left",+ hash: "50431d8fd537119aefb4c3673f9b9ff00d3cd1d2bf6c35e5dfb09ed40cfd5e7c",+ svg: "assets/mac/resize_left.svg",+ hotspot: [0.5, 0.5],+ },+ {+ name: "resize_left_right",+ hash: "0fdaea89910bcbe34ad0d4d63a6ada2095489df18537bbf54dd0d0769588b381",+ svg: "assets/mac/resize_left_right.svg",+ hotspot: [0.5, 0.5],+ },+ {+ name: "resize_right",+ hash: "e74de88f863f059e5beb27152b2dfc2cd1e8dcc458ce775607765e9a4859667e",+ svg: "assets/mac/resize_right.svg",+ hotspot: [0.5, 0.5],+ },+ {+ name: "resize_up",+ hash: "912ca42451a9624f6fb8c1d53c29c26782b7590d383a66075a6768c4409024d9",+ svg: "assets/mac/resize_up.svg",+ hotspot: [0.5, 0.5],+ },+ {+ name: "resize_up_down",+ hash: "9c93eb53df68d7fd86298ba1eb3e3b32ccd34d168b81a31a6fc4bb79f131331f",+ svg: "assets/mac/resize_up_down.svg",+ hotspot: [0.5, 0.5],+ },+ {+ name: "ibeam_vertical",+ hash: "024e1d486a7f16368669d419e69c9a326e464ec1b8ed39645e5c89cb183e03c5",+ svg: "assets/mac/ibeam_vertical.svg",+ hotspot: [0.389, 0.25],+ },+ ],+ windows: [+ {+ name: "arrow",+ hash: "19502718917bb8a86b83ffb168021cf90517b5c5e510c33423060d230c9e2d20",+ svg: "assets/windows/arrow.svg",+ hotspot: [0.027, 0.041],+ },+ {+ name: "ibeam",+ hash: "77cc4cedcf68f3e1d41bfe16c567961b2306c6236b35b966cd3d5c9516565e33",+ svg: "assets/windows/ibeam.svg",+ hotspot: [0.5, 0.5],+ },+ {+ name: "wait",+ hash: "5991d86a0d4e915dd0cb0fdd9bef3bf37ed6a3b321256fcb5b240db7ac1a6324",+ svg: "assets/windows/wait.svg",+ hotspot: [0.5, 0.5],+ },+ {+ name: "cross",+ hash: "cd2c775b1a124e4deaed1ed345efae25eb28a9133fc39691555902a2c1d7d578",+ svg: "assets/windows/cross.svg",+ hotspot: [0.5, 0.5],+ },+ {+ name: "size-nesw",+ hash: "47b4d609cb404feae70c7e20b525ac901d1e7a5f1a2e8a240418b3710ee43473",+ svg: "assets/windows/size-nesw.svg",+ hotspot: [0.5, 0.5],+ },+ {+ name: "size-ns",+ hash: "253b9e5360de1e12561be6a8f84484d4b108fd54d31e7d2c8f3b66d1c71b9880",+ svg: "assets/windows/size-ns.svg",+ hotspot: [0.5, 0.5],+ },+ {+ name: "no",+ hash: "7df883a459aced72acf32b969ff1119676d334d9acfcbe668ef92fe01094a7d6",+ svg: "assets/windows/no.svg",+ hotspot: [0.5, 0.5],+ },+ {+ name: "hand",+ hash: "44a554b439a681410d337d239bf08afe7c66486538563ebb93dc1c309f0a9209",+ svg: "assets/windows/hand.svg",+ hotspot: [0.421, 0.009],+ },+ {+ name: "pen",+ hash: "7340ea75802db8fef3a103e9385e65b2c8c358e077ef949faaf572fb502dd9e2",+ svg: "assets/windows/pen.svg",+ hotspot: [0.03, 0.97],+ },+ ],+ };++ function createCursorElement(cursor, platform) {+ const item = document.createElement("div");+ item.className = "cursor-item";++ const name = document.createElement("div");+ name.className = "cursor-name";+ name.textContent = cursor.name;++ const hash = document.createElement("div");+ hash.className = "cursor-hash";+ hash.textContent = cursor.hash;++ const container = document.createElement("div");+ container.className = "cursor-container";++ const svg = document.createElement("object");+ svg.className = "cursor-svg";+ svg.data = cursor.svg;+ svg.type = "image/svg+xml";++ const hotspotDiv = document.createElement("div");+ hotspotDiv.className = "hotspot";++ const hotspotInfo = document.createElement("div");+ hotspotInfo.className = "hotspot-info";++ const mousePosition = document.createElement("div");+ mousePosition.className = "mouse-position";++ const copyButton = document.createElement("button");+ copyButton.className = "copy-button";+ copyButton.textContent = "Copy Hotspot";+ copyButton.style.display = "none";++ if (cursor.hotspot) {+ hotspotInfo.textContent = `Hotspot: (${cursor.hotspot[0].toFixed(+ 3+ )}, ${cursor.hotspot[1].toFixed(3)})`;+ } else {+ hotspotInfo.innerHTML =+ '<span class="todo-marker">TODO: Hotspot not defined</span>';+ }++ container.appendChild(svg);+ if (cursor.hotspot) {+ container.appendChild(hotspotDiv);+ }++ let currentMousePos = null;++ container.addEventListener("mousemove", (e) => {+ const rect = container.getBoundingClientRect();+ const x = (e.clientX - rect.left) / rect.width;+ const y = (e.clientY - rect.top) / rect.height;+ currentMousePos = [x, y];+ mousePosition.textContent = `Mouse: (${x.toFixed(3)}, ${y.toFixed(+ 3+ )})`;+ copyButton.style.display = "inline-block";+ });++ container.addEventListener("mouseleave", () => {+ mousePosition.textContent = "";+ copyButton.style.display = "none";+ });++ container.addEventListener("click", () => {+ if (currentMousePos) {+ const hotspotText = `hotspot: (${currentMousePos[0].toFixed(+ 3+ )}, ${currentMousePos[1].toFixed(3)})`;+ navigator.clipboard.writeText(hotspotText).then(() => {+ copyButton.textContent = "Copied!";+ setTimeout(() => {+ copyButton.textContent = "Copy Hotspot";+ }, 1000);+ });+ }+ });++ svg.addEventListener("load", () => {+ if (cursor.hotspot) {+ const rect = container.getBoundingClientRect();+ hotspotDiv.style.left = cursor.hotspot[0] * 100 + "%";+ hotspotDiv.style.top = cursor.hotspot[1] * 100 + "%";+ }+ });++ item.appendChild(name);+ item.appendChild(hash);+ item.appendChild(container);+ item.appendChild(hotspotInfo);+ item.appendChild(mousePosition);+ item.appendChild(copyButton);++ return item;+ }++ function initializeCursors() {+ const macosContainer = document.getElementById("macos-cursors");+ const windowsContainer = document.getElementById("windows-cursors");++ cursors.macos.forEach((cursor) => {+ macosContainer.appendChild(createCursorElement(cursor, "macos"));+ });++ cursors.windows.forEach((cursor) => {+ windowsContainer.appendChild(createCursorElement(cursor, "windows"));+ });+ }++ document.addEventListener("DOMContentLoaded", initializeCursors);+ </script>+ </body>+</html>diff --git a/crates/cursor-info/examples/cli.rs b/crates/cursor-info/examples/cli.rsnew file mode 100644index 000000000..9047c9c60--- /dev/null+++ b/crates/cursor-info/examples/cli.rs@@ -0,0 +1,451 @@+use std::collections::HashMap;++use sha2::{Digest, Sha256};++fn main() {+ #[cfg(any(target_os = "macos", target_os = "windows"))]+ return run();+ #[allow(unreachable_code)]+ panic!("Unsupported platform!");+}++#[cfg(target_os = "macos")]+#[allow(deprecated)]+fn run() {+ use objc2::{MainThreadMarker, rc::Retained};+ use objc2_app_kit::{NSApplication, NSCursor};++ let mtm = MainThreadMarker::new().expect("Not on main thread");+ let _app: Retained<NSApplication> = NSApplication::sharedApplication(mtm);++ let cursors = vec![+ ("arrow", NSCursor::arrowCursor()),+ ("contextualMenu", NSCursor::contextualMenuCursor()),+ ("closedHand", NSCursor::closedHandCursor()),+ ("crosshair", NSCursor::crosshairCursor()),+ ("disappearingItem", NSCursor::disappearingItemCursor()),+ ("dragCopy", NSCursor::dragCopyCursor()),+ ("dragLink", NSCursor::dragLinkCursor()),+ ("IBeam", NSCursor::IBeamCursor()),+ ("openHand", NSCursor::openHandCursor()),+ ("operationNotAllowed", NSCursor::operationNotAllowedCursor()),+ ("pointingHand", NSCursor::pointingHandCursor()),+ ("resizeDown", NSCursor::resizeDownCursor()),+ ("resizeLeft", NSCursor::resizeLeftCursor()),+ ("resizeLeftRight", NSCursor::resizeLeftRightCursor()),+ ("resizeRight", NSCursor::resizeRightCursor()),+ ("resizeUp", NSCursor::resizeUpCursor()),+ ("resizeUpDown", NSCursor::resizeUpDownCursor()),+ ("IBeamVertical", NSCursor::IBeamCursorForVerticalLayout()),+ ];++ unsafe {+ let mut cursor_lookup = HashMap::new();++ for (name, cursor) in cursors {+ let hash = hex::encode(Sha256::digest(+ &cursor+ .image()+ .TIFFRepresentation()+ .expect("Failed to get TIFF representation of built-in cursor")+ .as_bytes_unchecked(),+ ));+ println!("{name}: {}", hash);+ cursor_lookup.insert(hash, name);+ }++ // return;++ loop {+ #[allow(deprecated)]+ let cursor = NSCursor::currentSystemCursor().unwrap_or(NSCursor::currentCursor());+ let hash = hex::encode(Sha256::digest(+ &cursor+ .image()+ .TIFFRepresentation()+ .expect("Failed to get TIFF representation of built-in cursor")+ .as_bytes_unchecked(),+ ));++ if cursor_lookup.get(&hash).is_none() {+ panic!("Cursor hash '{hash}' not known",);+ };++ println!(+ "{cursor:?} {hash} {}",+ cursor_lookup.get(&hash).unwrap_or(&"Unknown")+ );+ }+ };+}++#[cfg(target_os = "windows")]+fn run() {+ use windows::{+ Win32::{+ Foundation::POINT,+ UI::WindowsAndMessaging::{+ CURSORINFO, CURSORINFO_FLAGS, GetCursorInfo, GetIconInfo, HCURSOR, ICONINFO,+ IDC_APPSTARTING, IDC_ARROW, IDC_CROSS, IDC_HAND, IDC_HELP, IDC_IBEAM, IDC_NO,+ IDC_PERSON, IDC_PIN, IDC_SIZEALL, IDC_SIZENESW, IDC_SIZENS, IDC_SIZENWSE,+ IDC_SIZEWE, IDC_UPARROW, IDC_WAIT, LoadCursorW,+ },+ },+ core::PCWSTR,+ };++ #[inline]+ fn load_cursor(lpcursorname: PCWSTR) -> HCURSOR {+ unsafe { LoadCursorW(None, lpcursorname) }.expect("Failed to load default system cursors")+ }++ fn get_icon(hCursor: HCURSOR) -> Vec<u8> {+ unsafe {+ // Get icon info+ use windows::Win32::{+ Foundation::HWND,+ Graphics::Gdi::{+ BITMAP, BITMAPINFO, BITMAPINFOHEADER, CreateCompatibleDC, CreateDIBSection,+ DIB_RGB_COLORS, DeleteDC, DeleteObject, GetDC, GetObjectA, ReleaseDC,+ SelectObject,+ },+ UI::WindowsAndMessaging::{DI_NORMAL, DrawIconEx},+ };+ let mut icon_info = ICONINFO::default();+ if GetIconInfo(hCursor, &mut icon_info).is_err() {+ panic!("Error getting icon info");+ }++ // Get bitmap info for the cursor+ let mut bitmap = BITMAP::default();+ let bitmap_handle = if !icon_info.hbmColor.is_invalid() {+ icon_info.hbmColor+ } else {+ icon_info.hbmMask+ };++ if GetObjectA(+ bitmap_handle,+ std::mem::size_of::<BITMAP>() as i32,+ Some(&mut bitmap as *mut _ as *mut _),+ ) == 0+ {+ // Clean up handles+ if !icon_info.hbmColor.is_invalid() {+ use windows::Win32::Graphics::Gdi::DeleteObject;++ DeleteObject(icon_info.hbmColor);+ }+ if !icon_info.hbmMask.is_invalid() {+ use windows::Win32::Graphics::Gdi::DeleteObject;++ DeleteObject(icon_info.hbmMask);+ }+ panic!("Error");+ }++ // Create DCs+ let screen_dc = GetDC(HWND::default());+ let mem_dc = CreateCompatibleDC(screen_dc);++ // Get cursor dimensions+ let width = bitmap.bmWidth;+ let height = if icon_info.hbmColor.is_invalid() && bitmap.bmHeight > 0 {+ // For mask cursors, the height is doubled (AND mask + XOR mask)+ bitmap.bmHeight / 2+ } else {+ bitmap.bmHeight+ };++ // Create bitmap info header for 32-bit RGBA+ let bi = BITMAPINFOHEADER {+ biSize: std::mem::size_of::<BITMAPINFOHEADER>() as u32,+ biWidth: width,+ biHeight: -height, // Negative for top-down DIB+ biPlanes: 1,+ biBitCount: 32, // 32-bit RGBA+ biCompression: 0,+ biSizeImage: 0,+ biXPelsPerMeter: 0,+ biYPelsPerMeter: 0,+ biClrUsed: 0,+ biClrImportant: 0,+ };++ let bitmap_info = BITMAPINFO {+ bmiHeader: bi,+ bmiColors: [Default::default()],+ };++ // Create DIB section+ let mut bits: *mut std::ffi::c_void = std::ptr::null_mut();+ let dib = CreateDIBSection(mem_dc, &bitmap_info, DIB_RGB_COLORS, &mut bits, None, 0);++ if dib.is_err() {+ // Clean up++ use windows::Win32::Graphics::Gdi::{DeleteDC, ReleaseDC};+ DeleteDC(mem_dc);+ ReleaseDC(HWND::default(), screen_dc);+ if !icon_info.hbmColor.is_invalid() {+ use windows::Win32::Graphics::Gdi::DeleteObject;++ DeleteObject(icon_info.hbmColor);+ }+ if !icon_info.hbmMask.is_invalid() {+ use windows::Win32::Graphics::Gdi::DeleteObject;++ DeleteObject(icon_info.hbmMask);+ }+ panic!("Error");+ }++ let dib = dib.unwrap();++ // Select DIB into DC+ let old_bitmap = SelectObject(mem_dc, dib);++ // Draw the cursor onto our bitmap with transparency+ if DrawIconEx(+ mem_dc, 0, 0, hCursor, 0, // Use actual size+ 0, // Use actual size+ 0, None, DI_NORMAL,+ )+ .is_err()+ {+ // Clean up++ use windows::Win32::Graphics::Gdi::{DeleteDC, DeleteObject, ReleaseDC};+ SelectObject(mem_dc, old_bitmap);+ DeleteObject(dib);+ DeleteDC(mem_dc);+ ReleaseDC(HWND::default(), screen_dc);+ if !icon_info.hbmColor.is_invalid() {+ DeleteObject(icon_info.hbmColor);+ }+ if !icon_info.hbmMask.is_invalid() {+ DeleteObject(icon_info.hbmMask);+ }+ panic!("Error");+ }++ // Get image data+ let size = (width * height * 4) as usize;+ let mut image_data = vec![0u8; size];+ unsafe { std::ptr::copy_nonoverlapping(bits, image_data.as_mut_ptr() as *mut _, size) };++ // Calculate hotspot+ let mut hotspot_x = if icon_info.fIcon.as_bool() == false {+ icon_info.xHotspot as f64 / width as f64+ } else {+ 0.5+ };++ let mut hotspot_y = if icon_info.fIcon.as_bool() == false {+ icon_info.yHotspot as f64 / height as f64+ } else {+ 0.5+ };++ // Cleanup+ SelectObject(mem_dc, old_bitmap);+ DeleteObject(dib);+ DeleteDC(mem_dc);+ ReleaseDC(HWND::default(), screen_dc);+ if !icon_info.hbmColor.is_invalid() {+ DeleteObject(icon_info.hbmColor);+ }+ if !icon_info.hbmMask.is_invalid() {+ DeleteObject(icon_info.hbmMask);+ }++ // Process the image data to ensure proper alpha channel+ for i in (0..size).step_by(4) {+ // Windows DIB format is BGRA, we need to:+ // 1. Swap B and R channels+ let b = image_data[i];+ image_data[i] = image_data[i + 2]; // B <- R+ image_data[i + 2] = b; // R <- B++ // 2. Pre-multiply alpha if needed+ // This is already handled by DrawIconEx+ }++ // Convert to RGBA image+ let mut rgba_image =+ image::RgbaImage::from_raw(width as u32, height as u32, image_data).unwrap();++ // For text cursor (I-beam), enhance visibility by adding a shadow/outline+ // Check if this is likely a text cursor by examining dimensions and pixels+ let is_text_cursor = width <= 20 && height >= 20 && width <= height / 2;++ if is_text_cursor {+ // Add a subtle shadow/outline to make it visible on white backgrounds+ for y in 0..height as u32 {+ for x in 0..width as u32 {+ let pixel = rgba_image.get_pixel(x, y);+ // If this is a solid pixel of the cursor+ if pixel[3] > 200 {+ // If alpha is high (visible pixel)+ // Add shadow pixels around it+ for dx in [-1, 0, 1].iter() {+ for dy in [-1, 0, 1].iter() {+ let nx = x as i32 + dx;+ let ny = y as i32 + dy;++ // Skip if out of bounds or same pixel+ if nx < 0+ || ny < 0+ || nx >= width as i32+ || ny >= height as i32+ || (*dx == 0 && *dy == 0)+ {+ continue;+ }++ let nx = nx as u32;+ let ny = ny as u32;++ let shadow_pixel = rgba_image.get_pixel(nx, ny);+ // Only add shadow where there isn't already content+ if shadow_pixel[3] < 100 {+ rgba_image.put_pixel(nx, ny, image::Rgba([0, 0, 0, 100]));+ }+ }+ }+ }+ }+ }+ }++ // Find the bounds of non-transparent pixels to trim whitespace+ let mut min_x = width as u32;+ let mut min_y = height as u32;+ let mut max_x = 0u32;+ let mut max_y = 0u32;++ let mut has_content = false;++ for y in 0..height as u32 {+ for x in 0..width as u32 {+ let pixel = rgba_image.get_pixel(x, y);+ if pixel[3] > 0 {+ // If pixel has any opacity+ has_content = true;+ min_x = min_x.min(x);+ min_y = min_y.min(y);+ max_x = max_x.max(x);+ max_y = max_y.max(y);+ }+ }+ }++ // Only trim if we found content and there's actually whitespace to trim+ if has_content+ && (min_x > 0 || min_y > 0 || max_x < width as u32 - 1 || max_y < height as u32 - 1)+ {+ // Add a small padding (2 pixels) around the content+ let padding = 2u32;+ let trim_min_x = min_x.saturating_sub(padding);+ let trim_min_y = min_y.saturating_sub(padding);+ let trim_max_x = (max_x + padding).min(width as u32 - 1);+ let trim_max_y = (max_y + padding).min(height as u32 - 1);++ let trim_width = trim_max_x - trim_min_x + 1;+ let trim_height = trim_max_y - trim_min_y + 1;++ // Create a new image with the trimmed dimensions+ let mut trimmed = image::RgbaImage::new(trim_width, trim_height);++ // Copy the content to the new image+ for y in 0..trim_height {+ for x in 0..trim_width {+ let src_x = trim_min_x + x;+ let src_y = trim_min_y + y;+ let pixel = rgba_image.get_pixel(src_x, src_y);+ trimmed.put_pixel(x, y, *pixel);+ }+ }++ // Adjust hotspot coordinates for the trimmed image+ hotspot_x = (hotspot_x * width as f64 - trim_min_x as f64) / trim_width as f64;+ hotspot_y = (hotspot_y * height as f64 - trim_min_y as f64) / trim_height as f64;++ trimmed+ } else {+ rgba_image+ }+ .to_vec()+ }+ }++ let cursors = vec![+ ("IDC_ARROW", load_cursor(IDC_ARROW)),+ ("IDC_IBEAM", load_cursor(IDC_IBEAM)),+ ("IDC_WAIT", load_cursor(IDC_WAIT)),+ ("IDC_CROSS", load_cursor(IDC_CROSS)),+ ("IDC_UPARROW", load_cursor(IDC_UPARROW)),+ ("IDC_SIZENWSE", load_cursor(IDC_SIZENWSE)),+ ("IDC_SIZENESW", load_cursor(IDC_SIZENESW)),+ ("IDC_SIZEWE", load_cursor(IDC_SIZEWE)),+ ("IDC_SIZENS", load_cursor(IDC_SIZENS)),+ ("IDC_SIZEALL", load_cursor(IDC_SIZEALL)),+ ("IDC_NO", load_cursor(IDC_NO)),+ ("IDC_HAND", load_cursor(IDC_HAND)),+ ("IDC_APPSTARTING", load_cursor(IDC_APPSTARTING)),+ ("IDC_HELP", load_cursor(IDC_HELP)),+ ("IDC_PIN", load_cursor(IDC_PIN)),+ ("IDC_PERSON", load_cursor(IDC_PERSON)),+ ("Pen", load_cursor(PCWSTR(32631u16 as _))),+ ("ScrolNS", load_cursor(PCWSTR(32652u16 as _))),+ ("ScrollWE", load_cursor(PCWSTR(32653u16 as _))),+ ("ScrollNSEW", load_cursor(PCWSTR(32654u16 as _))),+ ("ScrollN", load_cursor(PCWSTR(32655u16 as _))),+ ("ScrollS", load_cursor(PCWSTR(32656u16 as _))),+ ("ScrollW", load_cursor(PCWSTR(32657u16 as _))),+ ("ScrollE", load_cursor(PCWSTR(32658u16 as _))),+ ("ScrollNW", load_cursor(PCWSTR(32659u16 as _))),+ ("ScrollNE", load_cursor(PCWSTR(32660u16 as _))),+ ("ScrollSW", load_cursor(PCWSTR(32661u16 as _))),+ ("ScrollSE", load_cursor(PCWSTR(32662u16 as _))),+ ("ArrowCD", load_cursor(PCWSTR(32663u16 as _))),+ ];++ let mut cursor_lookup = HashMap::new();++ for (name, cursor) in cursors {+ let icon = get_icon(cursor);+ let hash = hex::encode(Sha256::digest(icon));+ println!("{name}: {hash}");+ cursor_lookup.insert(hash, name);+ }++ return;++ loop {+ let mut cursor_info = CURSORINFO {+ cbSize: std::mem::size_of::<CURSORINFO>() as u32,+ flags: CURSORINFO_FLAGS(0),+ hCursor: Default::default(),+ ptScreenPos: POINT::default(),+ };++ if unsafe { GetCursorInfo(&mut cursor_info).is_err() } {+ panic!("Failed to get cursor info")+ }++ if cursor_info.hCursor.is_invalid() {+ panic!("Hcursor is invalid")+ }++ let trimmed_image = get_icon(cursor_info.hCursor);++ let hash = hex::encode(Sha256::digest(&trimmed_image));++ if !cursor_lookup.contains_key(&*hash) {+ panic!("Found unknown cursor hash {hash}");+ }++ println!("{hash} {}", cursor_lookup.get(&*hash).unwrap_or(&"Unknown"));+ }+}diff --git a/crates/cursor-info/src/lib.rs b/crates/cursor-info/src/lib.rsnew file mode 100644index 000000000..db0a9b3c2--- /dev/null+++ b/crates/cursor-info/src/lib.rs@@ -0,0 +1,206 @@+//! Cap Cursor Info: A crate for getting cursor information, assets and hotspot information.++/// Information about a resolved cursor shape+#[derive(Debug, Clone)]+pub struct ResolvedCursor {+ /// Raw svg definition of the cursor asset+ pub raw: &'static str,+ /// The location of the hotspot within the cursor asset+ pub hotspot: (f64, f64),+}++impl ResolvedCursor {+ /// Resolve the SVG asset from a given cursor hash+ ///+ /// We hash the cursor's image on macOS as `NSCursor`'s can't be reliably compared.+ /// On Windows we technically don't need to but storing a hash is useful as it means we can modify the cursors,+ /// interpretation without rerecording if we were to support custom cursors or add new OS cursors.+ pub fn from_hash(s: String) -> Option<ResolvedCursor> {+ Some(match s.as_str() {+ //+ // macOS Cursors+ // https://developer.apple.com/documentation/appkit/nscursor+ //++ // https://developer.apple.com/documentation/appkit/nscursor/arrow+ "de2d1f4a81e520b65fd1317b845b00a1c51a4d1f71cca3cd4ccdab52b98d1ac9" => ResolvedCursor {+ raw: include_str!("../assets/mac/arrow.svg"),+ hotspot: (0.235, 0.174), // 40.0/170.0, 40.0/230.0+ },+ // https://developer.apple.com/documentation/appkit/nscursor/contextualmenu+ "ab26ca862492d41355b711c58544687a799dd7ae14cf161959ca524bbc97c322" => ResolvedCursor {+ raw: include_str!("../assets/mac/contextual_menu.svg"),+ hotspot: (0.179, 0.125), // 10.0/56.0, 10.0/80.0+ },+ // https://developer.apple.com/documentation/appkit/nscursor/closedhand+ "fbb165d4603dd8808b536f45bb74a9a72d9358ad19714b318bb7c06358a7d3c2" => ResolvedCursor {+ raw: include_str!("../assets/mac/closed_hand.svg"),+ hotspot: (0.5, 0.5), // 32.0/64.0, 32.0/64.0+ },+ // https://developer.apple.com/documentation/appkit/nscursor/crosshair+ "c583f776531f4e7b76ea7ba2ab159765e2da11fd63cb897cc10362183859d1d8" => ResolvedCursor {+ raw: include_str!("../assets/mac/crosshair.svg"),+ hotspot: (0.458, 0.458), // 22.0/48.0, 22.0/48.0+ },+ // https://developer.apple.com/documentation/appkit/nscursor/disappearingitem+ "67c369820fbc37af9b59b840c675ca24117ca8dfdccec7702b10894058617951" => return None,+ // https://developer.apple.com/documentation/appkit/nscursor/dragcopy+ "af060876004c8647d82411eeac1bbd613d2991d46794aba16b56c91d3081e128" => ResolvedCursor {+ raw: include_str!("../assets/mac/drag_copy.svg"),+ hotspot: (0.179, 0.125), // 10.0/56.0, 10.0/80.0+ },+ // https://developer.apple.com/documentation/appkit/nscursor/draglink+ "59ac2483461f4ad577a0a6b68be89fe663c36263b583c5f038eee2ae6a5ad98f" => ResolvedCursor {+ raw: include_str!("../assets/mac/drag_link.svg"),+ hotspot: (0.688, 0.143), // 22.0/32.0, 6.0/42.0+ },+ // https://developer.apple.com/documentation/appkit/nscursor/ibeam+ "492dca0bb6751a30607ac728803af992ba69365052b7df2dff1c0dfe463e653c" => ResolvedCursor {+ raw: include_str!("../assets/mac/ibeam.svg"),+ hotspot: (0.444, 0.5), // 40.0/90.0, 90.0/180.0+ },+ // https://developer.apple.com/documentation/appkit/nscursor/openhand+ "3f6a5594a3c9334065944b9c56d9f73fd5fe5f02108a5e28f37e222e770be476" => ResolvedCursor {+ raw: include_str!("../assets/mac/open_hand.svg"),+ hotspot: (0.5, 0.5), // 32.0/64.0, 32.0/64.0+ },+ // https://developer.apple.com/documentation/appkit/nscursor/operationnotallowed+ "37287ef1d097704d3e9d0be9c1049ce1fb6dfabd6d210af0429b1b6ec7084c59" => ResolvedCursor {+ raw: include_str!("../assets/mac/operation_not_allowed.svg"),+ hotspot: (0.179, 0.125), // 10.0/56.0, 10.0/80.0+ },+ // https://developer.apple.com/documentation/appkit/nscursor/pointinghand+ "b0443e9f72e724cb6d94b879bf29c6cb18376d0357c6233e5a7561cf8a9943c6" => ResolvedCursor {+ raw: include_str!("../assets/mac/pointing_hand.svg"),+ hotspot: (0.406, 0.25), // 26.0/64.0, 16.0/64.0+ },+ // https://developer.apple.com/documentation/appkit/nscursor/resizedown+ "3c9bf0ce893b64fe9e4363793b406140d4b3900b7beafa1c409e78cf5a8cf954" => ResolvedCursor {+ raw: include_str!("../assets/mac/resize_down.svg"),+ hotspot: (0.5, 0.5), // 24.0/48.0, 24.0/48.0+ },+ // https://developer.apple.com/documentation/appkit/nscursor/resizeleft+ "50431d8fd537119aefb4c3673f9b9ff00d3cd1d2bf6c35e5dfb09ed40cfd5e7c" => ResolvedCursor {+ raw: include_str!("../assets/mac/resize_left.svg"),+ hotspot: (0.5, 0.5), // 24.0/48.0, 24.0/48.0+ },+ // https://developer.apple.com/documentation/appkit/nscursor/resizeleftright+ "0fdaea89910bcbe34ad0d4d63a6ada2095489df18537bbf54dd0d0769588b381" => ResolvedCursor {+ raw: include_str!("../assets/mac/resize_left_right.svg"),+ hotspot: (0.5, 0.5), // 24.0/48.0, 24.0/48.0+ },+ // https://developer.apple.com/documentation/appkit/nscursor/resizeright+ "e74de88f863f059e5beb27152b2dfc2cd1e8dcc458ce775607765e9a4859667e" => ResolvedCursor {+ raw: include_str!("../assets/mac/resize_right.svg"),+ hotspot: (0.5, 0.5), // 24.0/48.0, 24.0/48.0+ },+ // https://developer.apple.com/documentation/appkit/nscursor/resizeup+ "912ca42451a9624f6fb8c1d53c29c26782b7590d383a66075a6768c4409024d9" => ResolvedCursor {+ raw: include_str!("../assets/mac/resize_up.svg"),+ hotspot: (0.5, 0.5), // 24.0/48.0, 24.0/48.0+ },+ // https://developer.apple.com/documentation/appkit/nscursor/resizeupdown+ "9c93eb53df68d7fd86298ba1eb3e3b32ccd34d168b81a31a6fc4bb79f131331f" => ResolvedCursor {+ raw: include_str!("../assets/mac/resize_up_down.svg"),+ hotspot: (0.5, 0.5), // 24.0/48.0, 24.0/48.0+ },+ // https://developer.apple.com/documentation/appkit/nscursor/ibeamcursorforverticallayout+ "024e1d486a7f16368669d419e69c9a326e464ec1b8ed39645e5c89cb183e03c5" => ResolvedCursor {+ raw: include_str!("../assets/mac/ibeam_vertical.svg"),+ hotspot: (0.389, 0.25), // 14.0/36.0, 8.0/32.0+ },++ //+ // Windows Cursors+ // https://learn.microsoft.com/en-us/windows/win32/menurc/about-cursors+ //++ // IDC_ARROW+ "19502718917bb8a86b83ffb168021cf90517b5c5e510c33423060d230c9e2d20" => ResolvedCursor {+ raw: include_str!("../assets/windows/arrow.svg"),+ hotspot: (0.027, 0.041), // Arrow tip at top-left+ },+ // IDC_IBEAM+ "77cc4cedcf68f3e1d41bfe16c567961b2306c6236b35b966cd3d5c9516565e33" => ResolvedCursor {+ raw: include_str!("../assets/windows/ibeam.svg"),+ hotspot: (0.5, 0.5), // Center of I-beam+ },+ // IDC_WAIT+ "5991d86a0d4e915dd0cb0fdd9bef3bf37ed6a3b321256fcb5b240db7ac1a6324" => ResolvedCursor {+ raw: include_str!("../assets/windows/wait.svg"),+ hotspot: (0.5, 0.5), // Center of hourglass+ },+ // IDC_CROSS+ "cd2c775b1a124e4deaed1ed345efae25eb28a9133fc39691555902a2c1d7d578" => ResolvedCursor {+ raw: include_str!("../assets/windows/cross.svg"),+ hotspot: (0.5, 0.5), // Center of crosshair+ },+ // // IDC_UPARROW+ // "823d642acdc51ffbc29c2710303606270ed24936daf45215ead531333df102ba" => todo!(),+ // // IDC_SIZENWSE+ // "2daf2a40e4c7ecadec3270fbdb243a12ac22a14bb0b3a08a56b38a38322f9296" => todo!(),+ // IDC_SIZENESW+ "47b4d609cb404feae70c7e20b525ac901d1e7a5f1a2e8a240418b3710ee43473" => ResolvedCursor {+ raw: include_str!("../assets/windows/size-nesw.svg"),+ hotspot: (0.5, 0.5), // Center of resize cursor+ },+ // // IDC_SIZEWE+ // "8a024cf4bec4d58a4c149af2320206088981357312b3d82fbfcc07bee38c71ac" => todo!(),+ // IDC_SIZENS+ "253b9e5360de1e12561be6a8f84484d4b108fd54d31e7d2c8f3b66d1c71b9880" => ResolvedCursor {+ raw: include_str!("../assets/windows/size-ns.svg"),+ hotspot: (0.5, 0.5), // Center of vertical resize cursor+ },+ // // IDC_SIZEALL+ // "8066a12792e4e8ef21636e5ade61adaaf0fecc2ffc69536ffa0c2dd5bedc6903" => todo!(),+ // IDC_NO+ "7df883a459aced72acf32b969ff1119676d334d9acfcbe668ef92fe01094a7d6" => ResolvedCursor {+ raw: include_str!("../assets/windows/no.svg"),+ hotspot: (0.5, 0.5), // Center of "not allowed" symbol+ },+ // IDC_HAND+ "44a554b439a681410d337d239bf08afe7c66486538563ebb93dc1c309f0a9209" => ResolvedCursor {+ raw: include_str!("../assets/windows/hand.svg"),+ hotspot: (0.421, 0.009), // Tip of pointing finger+ },+ // // IDC_APPSTARTING+ // "1486a2339478da61a52a6eecf8ee3446be62f12d375dba8befd42bb553eea7bf" => todo!(),+ // // IDC_HELP+ // "5d0b4df6188bc8d540abfbd4235199cc0f67fb41d5e0dcbfd40a3011f8808fea" => todo!(),+ // // IDC_PIN+ // "cb74a2d34774dbc43004882e43f9c058b2d2ee60184185567d0328ca013f5bc3" => todo!(),+ // // IDC_PERSON+ // "1f5209791a75916697c26cf2d018d267ae1102c71dbd196de6c83132f5627f09" => todo!(),+ // MAKEINTRESOURCE(32631) - Pen+ "7340ea75802db8fef3a103e9385e65b2c8c358e077ef949faaf572fb502dd9e2" => ResolvedCursor {+ raw: include_str!("../assets/windows/pen.svg"),+ hotspot: (0.03, 0.97), // Tip of pen at bottom-left+ },+ // // MAKEINTRESOURCE(32652) - ScrolNS+ // "4c89e1d64c35cc88d09aaddcc78ab685ceab8d974006d3d94af23a9e888a74d7" => todo!(),+ // // MAKEINTRESOURCE(32653) - ScrollWE+ // "c5b16cfc625082dfdaa8e43111909baf9201fca39433ee8cdd117221f66cb4d1" => todo!(),+ // // MAKEINTRESOURCE(32654) - ScrollNSEW+ // "65527a0605a3bf225f90b9fe5b27b1c70743f4fa017b780abe27d5910cfdf69d" => todo!(),+ // // MAKEINTRESOURCE(32655) - ScrollN+ // "fe1b1ac207a874a452b4dd28949008282e6038c3ca903aba5da151d718e3d811" => todo!(),+ // // MAKEINTRESOURCE(32656) - ScrollS+ // "1d7c1ea6ecedfa467c8b082f4082a8382c76d01033222f59f367267ba04c2b18" => todo!(),+ // // MAKEINTRESOURCE(32657) - ScrollW+ // "81fc32f5284680bf9503fe6af204f4a2494da213de935e5e0a59e85ce3ed7685" => todo!(),+ // // MAKEINTRESOURCE(32658) - ScrollE+ // "c0a4f452e2f564bfa0193523e47ab4fbdcb9ac2c475566c01ef8df61752ab8af" => todo!(),+ // // MAKEINTRESOURCE(32659) - ScrollNW+ // "b5c891535897b0665553d8ec1217a9919a1ca6147144d8b142516c9e829ca15a" => todo!(),+ // // MAKEINTRESOURCE(32660) - ScrollNE+ // "7b6008d5752a204e0aca2e45db3ea8d0901419b4d772c49bcb46821f9c23b85b" => todo!(),+ // // MAKEINTRESOURCE(32661) - ScrollSW+ // "56b8ae43318dd75770a10786e60b9f12f9ba8408eee8cb3a946a56ebbace7297" => todo!(),+ // // MAKEINTRESOURCE(32662) - ScrollSE+ // "178f8c96aaace35760dd01d5a7d4341b0690f7e3de45919bfd696d0c60c14895" => todo!(),+ // // MAKEINTRESOURCE(32663) - ArrowCD+ // "a8bcbabdbb363b9be601cbeaa29b46e0e64834ff1ae0812646ad6d0c64efb2da" => todo!(),+ _ => return None,+ })+ }+}diff --git a/crates/editor/src/editor_instance.rs b/crates/editor/src/editor_instance.rsindex 4804911dc..14eae6f0a 100644--- a/crates/editor/src/editor_instance.rs+++ b/crates/editor/src/editor_instance.rs@@ -65,7 +65,7 @@ impl EditorInstance {let (ws_port, ws_shutdown_token) = create_frame_ws(frame_rx).await;let render_constants = Arc::new(- RenderVideoConstants::new(&recordings.segments, &recording_meta, meta)+ RenderVideoConstants::new(&recordings.segments, recording_meta.clone(), meta.clone()).await.unwrap(),);diff --git a/crates/export/src/lib.rs b/crates/export/src/lib.rsindex 9923c977f..ccb4fe953 100644--- a/crates/export/src/lib.rs+++ b/crates/export/src/lib.rs@@ -2,7 +2,7 @@ pub mod gif;pub mod mp4;use cap_editor::Segment;-use cap_project::{ProjectConfiguration, RecordingMeta, StudioRecordingMeta, XY};+use cap_project::{ProjectConfiguration, RecordingMeta, StudioRecordingMeta};use cap_rendering::{ProjectRecordingsMeta, RenderVideoConstants};use std::{path::PathBuf, sync::Arc};use tracing::error;@@ -82,9 +82,13 @@ impl ExporterBuilder {);let render_constants = Arc::new(- RenderVideoConstants::new(&recordings.segments, &recording_meta, studio_meta)- .await- .unwrap(),+ RenderVideoConstants::new(+ &recordings.segments,+ recording_meta.clone(),+ studio_meta.clone(),+ )+ .await+ .unwrap(),);let segments = cap_editor::create_segments(&recording_meta, studio_meta)diff --git a/crates/media/src/platform/mod.rs b/crates/media/src/platform/mod.rsindex fc667d5d7..894d20d4b 100644--- a/crates/media/src/platform/mod.rs+++ b/crates/media/src/platform/mod.rs@@ -28,74 +28,6 @@ pub struct Window {pub bounds: Bounds,}-#[derive(Debug, Clone, Copy, Serialize, Deserialize, Type, PartialEq, Eq, PartialOrd, Ord)]-pub enum CursorShape {- /// Windows: IDC_ARROW- Arrow,- /// Windows: IDC_IBEAM- IBeam,- /// Windows: IDC_CROSS- Crosshair,- /// macOS Only. Windows not supported.- ClosedHand,- /// macOS Only. Windows not supported.- OpenHand,- /// macOS Only. Windows not supported.- PointingHand,- /// macOS Only. Windows not supported.- ResizeLeft,- /// macOS Only. Windows not supported.- ResizeRight,- /// Windows: IDC_SIZEWE- ResizeLeftRight,- /// Windows: IDC_UPARROW- ResizeUp,- /// macOS Only. Windows not supported.- ResizeDown,- /// Windows: IDC_SIZENS- ResizeUpDown,- /// Windows: IDC_SIZENWSE- ///- /// Windows only. macOS not supported.- ResizeUpLeftAndDownRight,- /// Windows: IDC_SIZENESW- ///- /// Windows only. macOS not supported.- ResizeUpRightAndDownLeft,- /// Windows: IDC_SIZEALL- ///- /// Windows only. macOS not supported.- ResizeAll,- /// macOS Only. Windows not supported.- DisappearingItem,- /// macOS Only. Windows not supported.- VerticalIBeam,- /// Windows: IDC_NO- NotAllowed,- /// macOS Only. Windows not supported.- DragLink,- /// macOS Only. Windows not supported.- DragCopy,- /// macOS Only. Windows not supported.- ContextualMenu,- /// Windows only. macOS not supported.- Appstarting,- /// Windows: IDC_WAIT- ///- /// Windows only. macOS not supported.- Wait,- /// Windows: IDC_HELP- ///- /// Windows only. macOS not supported.- Help,- /// Windows only. macOS not supported.- ///- /// Indicates the cursor is not visible.- Hidden,- /// Couldn't get the cursor shape.- Unknown,-}-#[derive(Debug, Clone, Copy)]pub struct LogicalPosition {pub x: f64,diff --git a/crates/media/src/platform/win.rs b/crates/media/src/platform/win.rsindex 80d44d2e2..897b4a789 100644--- a/crates/media/src/platform/win.rs+++ b/crates/media/src/platform/win.rs@@ -3,7 +3,7 @@ use std::ffi::{c_void, OsString};use std::os::windows::ffi::OsStringExt;use std::path::PathBuf;-use super::{Bounds, CursorShape, LogicalBounds, LogicalPosition, LogicalSize, Window};+use super::{Bounds, LogicalBounds, LogicalPosition, LogicalSize, Window};use tracing::debug;use windows::core::{BOOL, PCWSTR, PWSTR};@@ -35,87 +35,6 @@ pub fn bring_window_to_focus(window_id: u32) {let _ = unsafe { SetForegroundWindow(HWND(window_id as *mut c_void)) };}-pub fn get_cursor_shape(cursors: &DefaultCursors) -> CursorShape {- let mut cursor_info = CURSORINFO {- cbSize: std::mem::size_of::<CURSORINFO>() as u32,- ..Default::default()- };- match unsafe { GetCursorInfo(&mut cursor_info) } {- Ok(_) => match cursor_info.hCursor.0 {- ptr if ptr == cursors.arrow => CursorShape::Arrow,- ptr if ptr == cursors.ibeam => CursorShape::IBeam,- ptr if ptr == cursors.wait => CursorShape::Wait,- ptr if ptr == cursors.cross => CursorShape::Crosshair,- ptr if ptr == cursors.up_arrow => CursorShape::ResizeUp,- ptr if ptr == cursors.size_we => CursorShape::ResizeLeftRight,- ptr if ptr == cursors.size_ns => CursorShape::ResizeUpDown,- ptr if ptr == cursors.size_nwse => CursorShape::ResizeUpLeftAndDownRight,- ptr if ptr == cursors.size_nesw => CursorShape::ResizeUpRightAndDownLeft,- ptr if ptr == cursors.size_all => CursorShape::ResizeAll,- ptr if ptr == cursors.hand => CursorShape::OpenHand,- ptr if ptr == cursors.no => CursorShape::NotAllowed,- ptr if ptr == cursors.appstarting => CursorShape::Appstarting,- ptr if ptr == cursors.help => CursorShape::Help,- ptr if ptr == cursors.pin || ptr == cursors.person => CursorShape::OpenHand,- // Usually 0, meaning the cursor is hidden. On Windows 8+, a value of 2 means the cursor is supressed- // as the user is using touch input instead.- _ => CursorShape::Hidden,- },- Err(_) => CursorShape::Unknown,- }-}--/// Keeps handles to default cursor.-/// Read more: [MS Doc - About Cursors](https://learn.microsoft.com/en-us/windows/win32/menurc/about-cursors)-pub struct DefaultCursors {- arrow: *mut c_void,- ibeam: *mut c_void,- wait: *mut c_void,- cross: *mut c_void,- up_arrow: *mut c_void,- size_nwse: *mut c_void,- size_nesw: *mut c_void,- size_we: *mut c_void,- size_ns: *mut c_void,- size_all: *mut c_void,- no: *mut c_void,- hand: *mut c_void,- appstarting: *mut c_void,- help: *mut c_void,- pin: *mut c_void,- person: *mut c_void,-}--impl Default for DefaultCursors {- fn default() -> Self {- #[inline]- fn load_cursor(lpcursorname: PCWSTR) -> *mut c_void {- unsafe { LoadCursorW(None, lpcursorname) }- .expect("Failed to load default system cursors")- .0- }-- DefaultCursors {- arrow: load_cursor(IDC_ARROW),- ibeam: load_cursor(IDC_IBEAM),- cross: load_cursor(IDC_CROSS),- hand: load_cursor(IDC_HAND),- help: load_cursor(IDC_HELP),- no: load_cursor(IDC_NO),- size_all: load_cursor(IDC_SIZEALL),- size_ns: load_cursor(IDC_SIZENS),- size_we: load_cursor(IDC_SIZEWE),- size_nwse: load_cursor(IDC_SIZENWSE),- size_nesw: load_cursor(IDC_SIZENESW),- up_arrow: load_cursor(IDC_UPARROW),- wait: load_cursor(IDC_WAIT),- appstarting: load_cursor(IDC_APPSTARTING),- pin: load_cursor(IDC_PIN),- person: load_cursor(IDC_PERSON),- }- }-}-unsafe fn pid_to_exe_path(pid: u32) -> Result<PathBuf, windows::core::Error> {let handle = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, false, pid)?;if handle.is_invalid() {diff --git a/crates/project/src/configuration.rs b/crates/project/src/configuration.rsindex 3e29d07c3..1e9fae991 100644--- a/crates/project/src/configuration.rs+++ b/crates/project/src/configuration.rs@@ -59,7 +59,7 @@ pub struct XY<T> {}impl<T> XY<T> {- pub fn new(x: T, y: T) -> Self {+ pub const fn new(x: T, y: T) -> Self {Self { x, y }}@@ -148,6 +148,24 @@ impl<T: Div<Output = T>> Div<XY<T>> for XY<T> {}}+impl Into<XY<f64>> for XY<f32> {+ fn into(self) -> XY<f64> {+ XY {+ x: self.x as f64,+ y: self.y as f64,+ }+ }+}++impl<T> Into<XY<T>> for (T, T) {+ fn into(self) -> XY<T> {+ XY {+ x: self.0,+ y: self.1,+ }+ }+}+#[derive(Type, Serialize, Deserialize, Clone, Debug, Default)]#[serde(rename_all = "camelCase")]pub struct Crop {@@ -354,6 +372,12 @@ pub struct CursorConfiguration {pub raw: bool,#[serde(default)]pub motion_blur: f32,+ #[serde(default = "yes")]+ pub use_svg: bool,+}++fn yes() -> bool {+ true}impl Default for CursorConfiguration {@@ -369,6 +393,7 @@ impl Default for CursorConfiguration {friction: 20.0,raw: false,motion_blur: 0.5,+ use_svg: true,}}}@@ -539,7 +564,7 @@ impl ProjectConfiguration {pub fn load(project_path: impl AsRef<Path>) -> Result<Self, std::io::Error> {let config_str =std::fs::read_to_string(project_path.as_ref().join("project-config.json"))?;- let mut config: Self = serde_json::from_str(&config_str).unwrap_or_default();+ let config: Self = serde_json::from_str(&config_str).unwrap_or_default();Ok(config)}diff --git a/crates/project/src/meta.rs b/crates/project/src/meta.rsindex 45e0e0560..2d8013dca 100644--- a/crates/project/src/meta.rs+++ b/crates/project/src/meta.rs@@ -10,7 +10,7 @@ use std::{use tracing::{debug, info, warn};// use tracing::{debug, warn};-use crate::{CaptionsData, CursorEvents, CursorImage, CursorImages, ProjectConfiguration, XY};+use crate::{CaptionsData, CursorEvents, CursorImage, ProjectConfiguration, XY};#[derive(Debug, Clone, Serialize, Deserialize, Type)]pub struct VideoMeta {@@ -60,6 +60,7 @@ impl Default for Platform {#[derive(Debug, Clone, Serialize, Deserialize, Type)]pub struct RecordingMeta {+ #[serde(default)]pub platform: Option<Platform>,// this field is just for convenience, it shouldn't be persisted#[serde(skip_serializing, default)]@@ -242,6 +243,8 @@ pub struct CursorMeta {#[specta(type = String)]pub image_path: RelativePathBuf,pub hotspot: XY<f64>,+ #[serde(default)]+ pub hash: Option<String>,}impl MultipleSegments {@@ -249,22 +252,17 @@ impl MultipleSegments {meta.project_path.join(path)}- pub fn cursor_images(&self, meta: &RecordingMeta) -> Result<CursorImages, CursorImage> {- Ok(CursorImages(match &self.cursors {- Cursors::Old(_) => Default::default(),- Cursors::Correct(map) => map- .iter()- .map(|(k, v)| {- (- k.clone(),- CursorImage {- path: meta.path(&v.image_path),- hotspot: v.hotspot,- },- )+ pub fn get_cursor_image(&self, meta: &RecordingMeta, id: &str) -> Option<CursorImage> {+ match &self.cursors {+ Cursors::Old(_) => None,+ Cursors::Correct(map) => {+ let cursor = map.get(id)?;+ Some(CursorImage {+ path: meta.path(&cursor.image_path),+ hotspot: cursor.hotspot,})- .collect::<_>(),- }))+ }+ }}}diff --git a/crates/recording/Cargo.toml b/crates/recording/Cargo.tomlindex 4468eb9c9..ab6bb41b7 100644--- a/crates/recording/Cargo.toml+++ b/crates/recording/Cargo.toml@@ -34,12 +34,15 @@ tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }relative-path = "1.9.3"futures = "0.3.31"tokio-util = "0.7.15"+sha2 = "0.10.9"+hex = "0.4.3"[target.'cfg(target_os = "macos")'.dependencies]screencapturekit = "0.3.5"cocoa = "0.26.0"objc = "0.2.7"cidre = { workspace = true }+objc2-app-kit = "0.3.1"[target.'cfg(target_os = "windows")'.dependencies]windows = { workspace = true, features = [diff --git a/crates/recording/src/cursor.rs b/crates/recording/src/cursor.rsindex 27dea0132..926243efe 100644--- a/crates/recording/src/cursor.rs+++ b/crates/recording/src/cursor.rs@@ -13,6 +13,7 @@ use cap_project::{CursorClickEvent, CursorMoveEvent, XY};use cap_utils::spawn_actor;use device_query::{DeviceQuery, DeviceState};use futures::future::Either;+use sha2::{Digest, Sha256};use tokio::sync::oneshot;use tokio_util::sync::CancellationToken;use tracing::{error, info};@@ -21,6 +22,7 @@ pub struct Cursor {pub file_name: String,pub id: u32,pub hotspot: XY<f64>,+ pub hash: String,}pub type Cursors = HashMap<u64, Cursor>;@@ -90,7 +92,7 @@ pub fn spawn_cursor_recorder(let elapsed = elapsed.as_secs_f64() * 1000.0;let mouse_state = device_state.get_mouse();- let cursor_data = get_cursor_image_data();+ let cursor_data = get_cursor_data();let cursor_id = if let Some(data) = cursor_data {let mut hasher = DefaultHasher::default();data.image.hash(&mut hasher);@@ -105,6 +107,7 @@ pub fn spawn_cursor_recorder(let file_name = format!("cursor_{}.png", cursor_id);let cursor_path = cursors_dir.join(&file_name);+ let hash = hex::encode(Sha256::digest(&data.image));if let Ok(image) = image::load_from_memory(&data.image) {// Convert to RGBAlet rgba_image = image.into_rgba8();@@ -119,6 +122,7 @@ pub fn spawn_cursor_recorder(file_name,id: response.next_cursor_id,hotspot: data.hotspot,+ hash,},);response.next_cursor_id += 1;@@ -243,64 +247,32 @@ struct CursorData {}#[cfg(target_os = "macos")]-fn get_cursor_image_data() -> Option<CursorData> {- use cocoa::base::{id, nil};- use cocoa::foundation::{NSPoint, NSSize, NSUInteger};+fn get_cursor_data() -> Option<CursorData> {use objc::rc::autoreleasepool;- use objc::runtime::Class;- use objc::*;+ use objc2_app_kit::NSCursor;- autoreleasepool(|| {- let nscursor_class = match Class::get("NSCursor") {- Some(cls) => cls,- None => return None,- };-- unsafe {- // Get the current system cursor- let current_cursor: id = msg_send![nscursor_class, currentSystemCursor];- if current_cursor == nil {- return None;- }-- // Get the image of the cursor- let cursor_image: id = msg_send![current_cursor, image];- if cursor_image == nil {- return None;- }-- let cursor_size: NSSize = msg_send![cursor_image, size];- let cursor_hotspot: NSPoint = msg_send![current_cursor, hotSpot];-- // Get the TIFF representation of the image- let image_data: id = msg_send![cursor_image, TIFFRepresentation];- if image_data == nil {- return None;- }-- // Get the length of the data- let length: NSUInteger = msg_send![image_data, length];+ autoreleasepool(|| unsafe {+ #[allow(deprecated)]+ let cursor = NSCursor::currentSystemCursor().unwrap_or(NSCursor::currentCursor());- // Get the bytes of the data- let bytes: *const u8 = msg_send![image_data, bytes];+ let image = cursor.image();+ let size = image.size();+ let hotspot = cursor.hotSpot();+ let Some(image_data) = image.TIFFRepresentation() else {+ return None;+ };- // Copy the data into a Vec<u8>- let slice = std::slice::from_raw_parts(bytes, length as usize);- let data = slice.to_vec();+ let image = image_data.as_bytes_unchecked().to_vec();- Some(CursorData {- image: data,- hotspot: XY::new(- cursor_hotspot.x / cursor_size.width,- cursor_hotspot.y / cursor_size.height,- ),- })- }+ Some(CursorData {+ image,+ hotspot: XY::new(hotspot.x / size.width, hotspot.y / size.height),+ })})}#[cfg(windows)]-fn get_cursor_image_data() -> Option<CursorData> {+fn get_cursor_data() -> Option<CursorData> {use windows::Win32::Foundation::{HWND, POINT};use windows::Win32::Graphics::Gdi::{CreateCompatibleDC, CreateDIBSection, DeleteDC, DeleteObject, GetDC, GetObjectA, ReleaseDC,diff --git a/crates/recording/src/studio_recording.rs b/crates/recording/src/studio_recording.rsindex b178ce16f..b068d282e 100644--- a/crates/recording/src/studio_recording.rs+++ b/crates/recording/src/studio_recording.rs@@ -525,6 +525,7 @@ async fn stop_recording(image_path: RelativePathBuf::from("content/cursors").join(&cursor.file_name),hotspot: cursor.hotspot,+ hash: Some(cursor.hash),},)})diff --git a/crates/rendering/Cargo.toml b/crates/rendering/Cargo.tomlindex be9653265..2baf9af11 100644--- a/crates/rendering/Cargo.toml+++ b/crates/rendering/Cargo.toml@@ -1,7 +1,7 @@[package]name = "cap-rendering"version = "0.1.0"-edition = "2021"+edition = "2024"[lints]workspace = true@@ -12,6 +12,7 @@ bytemuck = { version = "1.7", features = ["derive"] }cap-flags = { path = "../flags" }cap-project = { path = "../project" }cap-video-decode = { path = "../video-decode" }+cap-cursor-info = { path = "../cursor-info" }ffmpeg-hw-device = { path = "../ffmpeg-hw-device" }tokio.workspace = trueffmpeg.workspace = true@@ -28,6 +29,8 @@ bezier_easing = "0.1.1"reactive_graph = "0.1.5"glyphon = "0.9.0"tracing.workspace = true+resvg = "0.45"+tiny-skia = "0.11"[target.'cfg(target_os = "macos")'.dependencies]cidre.workspace = truediff --git a/crates/rendering/src/coord.rs b/crates/rendering/src/coord.rsindex f301dd128..29cc5046f 100644--- a/crates/rendering/src/coord.rs+++ b/crates/rendering/src/coord.rs@@ -2,7 +2,7 @@ use std::ops::{Add, Deref, Mul, Sub};use cap_project::{ProjectConfiguration, XY};-use crate::{zoom::InterpolatedZoom, ProjectUniforms, RenderOptions};+use crate::{ProjectUniforms, RenderOptions, zoom::InterpolatedZoom};#[derive(Default, Clone, Copy, Debug)]pub struct RawDisplaySpace;diff --git a/crates/rendering/src/cursor_interpolation.rs b/crates/rendering/src/cursor_interpolation.rsindex cd6201438..3b8992366 100644--- a/crates/rendering/src/cursor_interpolation.rs+++ b/crates/rendering/src/cursor_interpolation.rs@@ -1,8 +1,8 @@use cap_project::{CursorEvents, CursorMoveEvent, XY};use crate::{- spring_mass_damper::{SpringMassDamperSimulation, SpringMassDamperSimulationConfig},Coord, RawDisplayUVSpace,+ spring_mass_damper::{SpringMassDamperSimulation, SpringMassDamperSimulationConfig},};#[derive(Debug, Clone)]diff --git a/crates/rendering/src/decoder/avassetreader.rs b/crates/rendering/src/decoder/avassetreader.rsindex 0e9d87b22..6b3fc203a 100644--- a/crates/rendering/src/decoder/avassetreader.rs+++ b/crates/rendering/src/decoder/avassetreader.rs@@ -3,17 +3,17 @@ use std::{collections::BTreeMap,path::PathBuf,rc::Rc,- sync::{mpsc, Arc},+ sync::{Arc, mpsc},};use cidre::{arc::R,cv::{self, pixel_buffer::LockFlags},};-use ffmpeg::{format, frame, Rational};+use ffmpeg::{Rational, format, frame};use tokio::{runtime::Handle as TokioHandle, sync::oneshot};-use super::{pts_to_frame, VideoDecoderMessage, FRAME_CACHE_SIZE};+use super::{FRAME_CACHE_SIZE, VideoDecoderMessage, pts_to_frame};#[derive(Clone)]struct ProcessedFrame {@@ -338,11 +338,7 @@ impl AVAssetReaderDecoder {let min = *cache.keys().min().unwrap();let max = *cache.keys().max().unwrap();- if current_frame > max {- min- } else {- max- }+ if current_frame > max { min } else { max }};cache.remove(&frame);diff --git a/crates/rendering/src/decoder/ffmpeg.rs b/crates/rendering/src/decoder/ffmpeg.rsindex 8d23341b3..d60e65aca 100644--- a/crates/rendering/src/decoder/ffmpeg.rs+++ b/crates/rendering/src/decoder/ffmpeg.rs@@ -3,15 +3,15 @@ use std::{collections::BTreeMap,path::PathBuf,rc::Rc,- sync::{mpsc, Arc},+ sync::{Arc, mpsc},};-use ffmpeg::{codec, format, frame, software, Codec};-use ffmpeg_sys_next::{avcodec_find_decoder, AVHWDeviceType};+use ffmpeg::{Codec, codec, format, frame, software};+use ffmpeg_sys_next::{AVHWDeviceType, avcodec_find_decoder};use log::debug;use tokio::sync::oneshot;-use super::{pts_to_frame, VideoDecoderMessage, FRAME_CACHE_SIZE};+use super::{FRAME_CACHE_SIZE, VideoDecoderMessage, pts_to_frame};#[derive(Clone)]struct ProcessedFrame {@@ -201,11 +201,7 @@ impl FfmpegDecoder {let min = *cache.keys().min().unwrap();let max = *cache.keys().max().unwrap();- if current_frame > max {- min- } else {- max- }+ if current_frame > max { min } else { max }};cache.remove(&frame);diff --git a/crates/rendering/src/decoder/mod.rs b/crates/rendering/src/decoder/mod.rsindex 1ff92d5f5..0cad645b2 100644--- a/crates/rendering/src/decoder/mod.rs+++ b/crates/rendering/src/decoder/mod.rs@@ -1,7 +1,7 @@use ::ffmpeg::Rational;use std::{path::PathBuf,- sync::{mpsc, Arc},+ sync::{Arc, mpsc},};use tokio::sync::oneshot;diff --git a/crates/rendering/src/layers/background.rs b/crates/rendering/src/layers/background.rsindex b328c8e0d..441e9f449 100644--- a/crates/rendering/src/layers/background.rs+++ b/crates/rendering/src/layers/background.rs@@ -6,8 +6,8 @@ use specta::Type;use wgpu::{include_wgsl, util::DeviceExt};use crate::{- create_shader_render_pipeline, srgb_to_linear, ProjectUniforms, RenderVideoConstants,- RenderingError,+ ProjectUniforms, RenderVideoConstants, RenderingError, create_shader_render_pipeline,+ srgb_to_linear,};#[derive(PartialEq, Debug, Clone, Copy, Serialize, Deserialize, Type)]diff --git a/crates/rendering/src/layers/camera.rs b/crates/rendering/src/layers/camera.rsindex 8b92395f2..9fa14f514 100644--- a/crates/rendering/src/layers/camera.rs+++ b/crates/rendering/src/layers/camera.rs@@ -2,7 +2,7 @@ use cap_project::XY;use wgpu::util::DeviceExt;use crate::{- composite_frame::CompositeVideoFramePipeline, CompositeVideoFrameUniforms, DecodedFrame,+ CompositeVideoFrameUniforms, DecodedFrame, composite_frame::CompositeVideoFramePipeline,};pub struct CameraLayer {diff --git a/crates/rendering/src/layers/captions.rs b/crates/rendering/src/layers/captions.rsindex eb7e51c9c..1a8b3461d 100644--- a/crates/rendering/src/layers/captions.rs+++ b/crates/rendering/src/layers/captions.rs@@ -5,9 +5,9 @@ use glyphon::{TextArea, TextAtlas, TextBounds, TextRenderer, Viewport,};use log::{debug, info, warn};-use wgpu::{util::DeviceExt, Device, Queue};+use wgpu::{Device, Queue, util::DeviceExt};-use crate::{parse_color_component, DecodedSegmentFrames, ProjectUniforms, RenderVideoConstants};+use crate::{DecodedSegmentFrames, ProjectUniforms, RenderVideoConstants, parse_color_component};/// Represents a caption segment with timing and text#[derive(Debug, Clone)]diff --git a/crates/rendering/src/layers/cursor.rs b/crates/rendering/src/layers/cursor.rsindex ef90e5b73..fd6f912b9 100644--- a/crates/rendering/src/layers/cursor.rs+++ b/crates/rendering/src/layers/cursor.rs@@ -1,19 +1,29 @@+use std::collections::HashMap;+use bytemuck::{Pod, Zeroable};+use cap_cursor_info::ResolvedCursor;use cap_project::*;-use wgpu::{include_wgsl, util::DeviceExt, BindGroup, FilterMode};+use image::GenericImageView;+use tracing::error;+use wgpu::{BindGroup, FilterMode, include_wgsl, util::DeviceExt};use crate::{- zoom::InterpolatedZoom, DecodedSegmentFrames, ProjectUniforms, RenderVideoConstants,- STANDARD_CURSOR_HEIGHT,+ DecodedSegmentFrames, ProjectUniforms, RenderVideoConstants, STANDARD_CURSOR_HEIGHT,+ zoom::InterpolatedZoom,};const CURSOR_CLICK_DURATION: f64 = 0.25;const CURSOR_CLICK_DURATION_MS: f64 = CURSOR_CLICK_DURATION * 1000.0;const CLICK_SHRINK_SIZE: f32 = 0.7;+/// The size to render the svg to.+static SVG_CURSOR_RASTERIZED_HEIGHT: u32 = 200;+pub struct CursorLayer {statics: Statics,bind_group: Option<BindGroup>,+ cursors: HashMap<String, CursorTexture>,+ prev_is_svg_assets_enabled: Option<bool>,}struct Statics {@@ -169,6 +179,8 @@ impl CursorLayer {Self {statics,bind_group: None,+ cursors: Default::default(),+ prev_is_svg_assets_enabled: None,}}@@ -201,40 +213,116 @@ impl CursorLayer {let speed = (velocity[0] * velocity[0] + velocity[1] * velocity[1]).sqrt();let motion_blur_amount = (speed * 0.3).min(1.0) * 0.0; // uniforms.project.cursor.motion_blur;- let Some(cursor_texture) = constants- .cursor_textures- .get(&interpolated_cursor.cursor_id)- else {+ let is_svg_assets_enabled = !uniforms.project.cursor.raw && uniforms.project.cursor.use_svg;++ // Remove all cursor assets if the svg configuration changes.+ // it might change the texture.+ //+ // This would be better if it only invalidated the required assets but that would be more complicated.+ if self.prev_is_svg_assets_enabled != Some(is_svg_assets_enabled) {+ self.prev_is_svg_assets_enabled = Some(is_svg_assets_enabled);+ self.cursors.drain();+ }++ if !self.cursors.contains_key(&interpolated_cursor.cursor_id) {+ let mut cursor = None;++ let cursor_hash = match &constants.recording_meta.inner {+ RecordingMetaInner::Studio(StudioRecordingMeta::MultipleSegments {+ inner:+ MultipleSegments {+ cursors: Cursors::Correct(cursors),+ ..+ },+ }) => cursors+ .get(&interpolated_cursor.cursor_id)+ .and_then(|v| v.hash.clone()),+ _ => None,+ };++ // Attempt to find and load a higher-quality SVG cursor included in Cap.+ // These are used instead of the OS provided cursor images when possible as the quality is better.+ if let Some(cursor_hash) = cursor_hash+ && !uniforms.project.cursor.raw+ && uniforms.project.cursor.use_svg+ {+ if let Some(info) = ResolvedCursor::from_hash(cursor_hash) {+ cursor = CursorTexture::prepare_svg(&constants, info.raw, info.hotspot.into())+ .map_err(|err| {+ error!(+ "Error loading SVG cursor {:?}: {err}",+ interpolated_cursor.cursor_id+ )+ })+ .ok();+ }+ }++ // If not we attempt to load the low-quality image cursor+ if let StudioRecordingMeta::MultipleSegments { inner, .. } = &constants.meta+ && cursor.is_none()+ {+ if let Some(c) = inner+ .get_cursor_image(&constants.recording_meta, &interpolated_cursor.cursor_id)+ {+ if let Ok(img) = image::open(&c.path).map_err(|err| {+ error!("Failed to load cursor image from {:?}: {err}", c.path)+ }) {+ cursor = Some(CursorTexture::prepare(+ constants,+ &img.to_rgba8(),+ img.dimensions(),+ c.hotspot,+ ));+ }+ }+ }++ if let Some(cursor) = cursor {+ self.cursors+ .insert(interpolated_cursor.cursor_id.clone(), cursor);+ }+ }+ let Some(cursor_texture) = self.cursors.get(&interpolated_cursor.cursor_id) else {+ error!("Cursor {:?} not found!", interpolated_cursor.cursor_id);return;};let cursor_base_size_px = {- let cursor_texture_size = cursor_texture.inner.size();+ let cursor_texture_size = cursor_texture.texture.size();let cursor_texture_size_aspect =cursor_texture_size.width as f32 / cursor_texture_size.height as f32;- let screen_size = constants.options.screen_size;let cursor_size_percentage = if uniforms.cursor_size <= 0.0 {100.0} else {uniforms.cursor_size / 100.0};+ let factor = STANDARD_CURSOR_HEIGHT / constants.options.screen_size.y as f32+ * uniforms.output_size.1 as f32;- let factor =- STANDARD_CURSOR_HEIGHT / screen_size.y as f32 * uniforms.output_size.1 as f32;+ let cursor_size_constant =+ factor * cursor_size_percentage * zoom.display_amount() as f32;- XY::new(- factor * cursor_texture_size_aspect * cursor_size_percentage,- factor * cursor_size_percentage,- )+ if cursor_texture_size_aspect > 1.0 {+ // Wide cursor: base sizing on width to prevent excessive width+ let width = cursor_size_constant;+ let height = cursor_size_constant / cursor_texture_size_aspect;+ XY::new(width, height)+ } else {+ // Tall or square cursor: base sizing on height (current behavior)+ XY::new(+ cursor_size_constant * cursor_texture_size_aspect,+ cursor_size_constant,+ )+ }};let click_scale_factor = get_click_t(&cursor.clicks, (time_s as f64) * 1000.0)* (1.0 - CLICK_SHRINK_SIZE)+ CLICK_SHRINK_SIZE;- let cursor_size_px =- cursor_base_size_px * click_scale_factor * zoom.display_amount() as f32;+ let cursor_size_px: XY<f64> = (cursor_base_size_px * click_scale_factor).into();let hotspot_px = cursor_texture.hotspot * cursor_size_px;@@ -254,7 +342,7 @@ impl CursorLayer {let uniforms = CursorUniforms {position: [position.x as f32, position.y as f32],- size: [cursor_size_px.x, cursor_size_px.y],+ size: [cursor_size_px.x as f32, cursor_size_px.y as f32],output_size: [uniforms.output_size.0 as f32, uniforms.output_size.1 as f32],screen_bounds: uniforms.display.target_bounds,velocity,@@ -270,7 +358,7 @@ impl CursorLayer {self.bind_group = Some(self.statics- .create_bind_group(&constants.device, &cursor_texture.inner),+ .create_bind_group(&constants.device, &cursor_texture.texture),);}@@ -363,3 +451,104 @@ fn get_click_t(clicks: &[CursorClickEvent], time_ms: f64) -> f32 {1.0}++struct CursorTexture {+ texture: wgpu::Texture,+ hotspot: XY<f64>,+}++impl CursorTexture {+ /// Prepare a cursor texture on the GPU from RGBA data.+ fn prepare(+ constants: &RenderVideoConstants,+ rgba: &[u8],+ dimensions: (u32, u32),+ hotspot: XY<f64>,+ ) -> Self {+ let texture = constants.device.create_texture(&wgpu::TextureDescriptor {+ label: Some("Cursor Texture"),+ size: wgpu::Extent3d {+ width: dimensions.0,+ height: dimensions.1,+ depth_or_array_layers: 1,+ },+ mip_level_count: 1,+ sample_count: 1,+ dimension: wgpu::TextureDimension::D2,+ format: wgpu::TextureFormat::Rgba8UnormSrgb,+ usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST,+ view_formats: &[],+ });++ constants.queue.write_texture(+ wgpu::TexelCopyTextureInfo {+ texture: &texture,+ mip_level: 0,+ origin: wgpu::Origin3d::ZERO,+ aspect: wgpu::TextureAspect::All,+ },+ &rgba,+ wgpu::TexelCopyBufferLayout {+ offset: 0,+ bytes_per_row: Some(4 * dimensions.0),+ rows_per_image: None,+ },+ wgpu::Extent3d {+ width: dimensions.0,+ height: dimensions.1,+ depth_or_array_layers: 1,+ },+ );++ Self { texture, hotspot }+ }++ /// Prepare a cursor texture on the GPU from a raw SVG file+ fn prepare_svg(+ constants: &RenderVideoConstants,+ svg_data: &str,+ hotspot: XY<f64>,+ ) -> Result<Self, String> {+ let rtree = resvg::usvg::Tree::from_str(svg_data, &resvg::usvg::Options::default())+ .map_err(|e| format!("Failed to parse SVG: {}", e))?;++ // Although we could probably determine the size that the cursor is going to be render,+ // that would depend on the cursor size the user selects.+ //+ // This would require reinitializing the texture every time that changes which would be more complicated.+ // So we trade a small about VRAM for only initializing it once.+ let aspect_ratio = rtree.size().width() / rtree.size().height();+ let width = (aspect_ratio * SVG_CURSOR_RASTERIZED_HEIGHT as f32) as u32;++ let mut pixmap = tiny_skia::Pixmap::new(width as u32, SVG_CURSOR_RASTERIZED_HEIGHT as u32)+ .ok_or("Failed to create pixmap")?;++ // Calculate scale to fit the SVG into the target size while maintaining aspect ratio+ let scale_x = width as f32 / rtree.size().width();+ let scale_y = SVG_CURSOR_RASTERIZED_HEIGHT as f32 / rtree.size().height();+ let scale = scale_x.min(scale_y) * 1.5;+ let transform = tiny_skia::Transform::from_row(+ scale,+ 0.0,+ 0.0,+ scale,+ (SVG_CURSOR_RASTERIZED_HEIGHT / 4) as f32 * -1.0,+ (SVG_CURSOR_RASTERIZED_HEIGHT / 4) as f32 * -1.0,+ );++ resvg::render(&rtree, transform, &mut pixmap.as_mut());++ let rgba: Vec<u8> = pixmap+ .pixels()+ .iter()+ .flat_map(|p| [p.red(), p.green(), p.red(), p.alpha()])+ .collect();++ Ok(Self::prepare(+ constants,+ &rgba,+ (pixmap.width(), pixmap.height()),+ hotspot,+ ))+ }+}diff --git a/crates/rendering/src/layers/display.rs b/crates/rendering/src/layers/display.rsindex bc8eb5ff0..f86e40e5f 100644--- a/crates/rendering/src/layers/display.rs+++ b/crates/rendering/src/layers/display.rs@@ -1,8 +1,8 @@use cap_project::XY;use crate::{- composite_frame::{CompositeVideoFramePipeline, CompositeVideoFrameUniforms},DecodedSegmentFrames,+ composite_frame::{CompositeVideoFramePipeline, CompositeVideoFrameUniforms},};pub struct DisplayLayer {diff --git a/crates/rendering/src/lib.rs b/crates/rendering/src/lib.rsindex d82d5b076..06756a2e6 100644--- a/crates/rendering/src/lib.rs+++ b/crates/rendering/src/lib.rs@@ -5,12 +5,11 @@ use cap_project::{};use composite_frame::CompositeVideoFrameUniforms;use core::f64;-use cursor_interpolation::{interpolate_cursor, InterpolatedCursorPosition};-use decoder::{spawn_decoder, AsyncVideoDecoderHandle};+use cursor_interpolation::{InterpolatedCursorPosition, interpolate_cursor};+use decoder::{AsyncVideoDecoderHandle, spawn_decoder};use frame_pipeline::finish_encoder;-use futures::future::OptionFuture;use futures::FutureExt;-use image::GenericImageView;+use futures::future::OptionFuture;use layers::{Background, BackgroundLayer, BlurLayer, CameraLayer, CaptionsLayer, CursorLayer, DisplayLayer,};@@ -19,6 +18,7 @@ use spring_mass_damper::SpringMassDamperSimulationConfig;use std::{collections::HashMap, sync::Arc};use std::{path::PathBuf, time::Instant};use tokio::sync::mpsc;+use tracing::error;mod composite_frame;mod coord;@@ -293,26 +293,22 @@ pub fn get_duration(}}-pub struct CursorTexture {- inner: wgpu::Texture,- hotspot: XY<f32>,-}-pub struct RenderVideoConstants {pub _instance: wgpu::Instance,pub _adapter: wgpu::Adapter,pub queue: wgpu::Queue,pub device: wgpu::Device,pub options: RenderOptions,- pub cursor_textures: HashMap<String, CursorTexture>,- background_textures: std::sync::Arc<tokio::sync::RwLock<HashMap<String, wgpu::Texture>>>,+ pub meta: StudioRecordingMeta,+ pub recording_meta: RecordingMeta,+ pub background_textures: std::sync::Arc<tokio::sync::RwLock<HashMap<String, wgpu::Texture>>>,}impl RenderVideoConstants {pub async fn new(segments: &[SegmentRecordings],- recording_meta: &RecordingMeta,- meta: &StudioRecordingMeta,+ recording_meta: RecordingMeta,+ meta: StudioRecordingMeta,) -> Result<Self, RenderingError> {let options = RenderOptions {screen_size: XY::new(segments[0].display.width, segments[0].display.height),@@ -334,7 +330,6 @@ impl RenderVideoConstants {}).await?;- let cursor_textures = Self::load_cursor_textures(&device, &queue, recording_meta, meta);let background_textures = Arc::new(tokio::sync::RwLock::new(HashMap::new()));Ok(Self {@@ -343,95 +338,11 @@ impl RenderVideoConstants {device,queue,options,- cursor_textures,background_textures,+ meta,+ recording_meta,})}-- fn load_cursor_textures(- device: &wgpu::Device,- queue: &wgpu::Queue,- recording_meta: &RecordingMeta,- meta: &StudioRecordingMeta,- ) -> HashMap<String, CursorTexture> {- let mut textures = HashMap::new();-- let cursor_images = match &meta {- StudioRecordingMeta::SingleSegment { .. } => Default::default(),- StudioRecordingMeta::MultipleSegments { inner, .. } => {- inner.cursor_images(recording_meta).unwrap_or_default()- }- };-- for (cursor_id, cursor) in &cursor_images.0 {- if !cursor.path.exists() {- continue;- }-- match image::open(&cursor.path) {- Ok(img) => {- let dimensions = img.dimensions();-- let rgba = img.into_rgba8();-- // Create the texture- let texture = device.create_texture(&wgpu::TextureDescriptor {- label: Some(&format!("Cursor Texture {}", cursor_id)),- size: wgpu::Extent3d {- width: dimensions.0,- height: dimensions.1,- depth_or_array_layers: 1,- },- mip_level_count: 1,- sample_count: 1,- dimension: wgpu::TextureDimension::D2,- format: wgpu::TextureFormat::Rgba8UnormSrgb,- usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST,- view_formats: &[],- });-- queue.write_texture(- wgpu::TexelCopyTextureInfo {- texture: &texture,- mip_level: 0,- origin: wgpu::Origin3d::ZERO,- aspect: wgpu::TextureAspect::All,- },- &rgba,- wgpu::TexelCopyBufferLayout {- offset: 0,- bytes_per_row: Some(4 * dimensions.0),- rows_per_image: None,- },- wgpu::Extent3d {- width: dimensions.0,- height: dimensions.1,- depth_or_array_layers: 1,- },- );-- textures.insert(- cursor_id.clone(),- CursorTexture {- inner: texture,- hotspot: cursor.hotspot.map(|v| v as f32),- },- );- }- Err(e) => {- println!(- "Failed to load cursor image {}: {}",- cursor.path.display(),- e- );- // Don't return error, just skip this cursor image- continue;- }- }- }-- textures- }}#[derive(Clone, Debug)]@@ -1266,9 +1177,5 @@ fn srgb_to_linear(c: u16) -> f32 {}fn get_either<T>((a, b): (T, T), left: bool) -> T {- if left {- a- } else {- b- }+ if left { a } else { b }}diff --git a/crates/rendering/src/zoom.rs b/crates/rendering/src/zoom.rsindex 752292412..068badd92 100644--- a/crates/rendering/src/zoom.rs+++ b/crates/rendering/src/zoom.rs@@ -1,4 +1,4 @@-use cap_project::{ZoomSegment, XY};+use cap_project::{XY, ZoomSegment};use crate::{Coord, RawDisplayUVSpace};diff --git a/packages/ui-solid/src/auto-imports.d.ts b/packages/ui-solid/src/auto-imports.d.tsindex 6d1f4abd4..4bc684315 100644--- a/packages/ui-solid/src/auto-imports.d.ts+++ b/packages/ui-solid/src/auto-imports.d.ts@@ -6,78 +6,106 @@// biome-ignore lint: disableexport {}declare global {- const IconCapArrows: typeof import('~icons/cap/arrows.jsx')['default']- const IconCapAudioOn: typeof import('~icons/cap/audio-on.jsx')['default']- const IconCapBgBlur: typeof import('~icons/cap/bg-blur.jsx')['default']+ const IconCapArrows: typeof import("~icons/cap/arrows.jsx")["default"]+ const IconCapAudioOn: typeof import("~icons/cap/audio-on.jsx")["default"]+ const IconCapAuto: typeof import("~icons/cap/auto.jsx")["default"]+ const IconCapBgBlur: typeof import("~icons/cap/bg-blur.jsx")["default"]+ const IconCapBlur: typeof import("~icons/cap/blur.jsx")["default"]const IconCapCamera: typeof import('~icons/cap/camera.jsx')['default']- const IconCapCaptions: typeof import('~icons/cap/captions.jsx')['default']+ const IconCapCaptions: typeof import("~icons/cap/captions.jsx")["default"]+ const IconCapCheck: typeof import("~icons/cap/check.jsx")["default"]const IconCapChevronDown: typeof import('~icons/cap/chevron-down.jsx')['default']- const IconCapCircle: typeof import('~icons/cap/circle.jsx')['default']- const IconCapCircleCheck: typeof import('~icons/cap/circle-check.jsx')['default']- const IconCapCirclePlus: typeof import('~icons/cap/circle-plus.jsx')['default']- const IconCapCircleX: typeof import('~icons/cap/circle-x.jsx')['default']- const IconCapCopy: typeof import('~icons/cap/copy.jsx')['default']- const IconCapCorners: typeof import('~icons/cap/corners.jsx')['default']+ const IconCapCircle: typeof import("~icons/cap/circle.jsx")["default"]+ const IconCapCircleCheck: typeof import("~icons/cap/circle-check.jsx")["default"]+ const IconCapCirclePlus: typeof import("~icons/cap/circle-plus.jsx")["default"]+ const IconCapCircleX: typeof import("~icons/cap/circle-x.jsx")["default"]+ const IconCapClock: typeof import("~icons/cap/clock.jsx")["default"]+ const IconCapCopy: typeof import("~icons/cap/copy.jsx")["default"]+ const IconCapCorners: typeof import("~icons/cap/corners.jsx")["default"]const IconCapCrop: typeof import('~icons/cap/crop.jsx')['default']- const IconCapCursor: typeof import('~icons/cap/cursor.jsx')['default']- const IconCapEditor: typeof import('~icons/cap/editor.jsx')['default']- const IconCapEnlarge: typeof import('~icons/cap/enlarge.jsx')['default']- const IconCapFile: typeof import('~icons/cap/file.jsx')['default']+ const IconCapCursor: typeof import("~icons/cap/cursor.jsx")["default"]+ const IconCapDownload: typeof import("~icons/cap/download.jsx")["default"]+ const IconCapEditor: typeof import("~icons/cap/editor.jsx")["default"]+ const IconCapEnlarge: typeof import("~icons/cap/enlarge.jsx")["default"]+ const IconCapFile: typeof import("~icons/cap/file.jsx")["default"]const IconCapFilmCut: typeof import('~icons/cap/film-cut.jsx')['default']- const IconCapGauge: typeof import('~icons/cap/gauge.jsx')['default']- const IconCapHotkeys: typeof import('~icons/cap/hotkeys.jsx')['default']- const IconCapImage: typeof import('~icons/cap/image.jsx')['default']+ const IconCapFrameFirst: typeof import("~icons/cap/frame-first.jsx")["default"]+ const IconCapFrameLast: typeof import("~icons/cap/frame-last.jsx")["default"]+ const IconCapGauge: typeof import("~icons/cap/gauge.jsx")["default"]+ const IconCapHotkeys: typeof import("~icons/cap/hotkeys.jsx")["default"]+ const IconCapImage: typeof import("~icons/cap/image.jsx")["default"]const IconCapInfo: typeof import('~icons/cap/info.jsx')['default']+ const IconCapInset: typeof import("~icons/cap/inset.jsx")["default"]const IconCapInstant: typeof import('~icons/cap/instant.jsx')['default']- const IconCapLayout: typeof import('~icons/cap/layout.jsx')['default']- const IconCapLink: typeof import('~icons/cap/link.jsx')['default']+ const IconCapLayout: typeof import("~icons/cap/layout.jsx")["default"]+ const IconCapLink: typeof import("~icons/cap/link.jsx")["default"]const IconCapLogo: typeof import('~icons/cap/logo.jsx')['default']const IconCapLogoFull: typeof import('~icons/cap/logo-full.jsx')['default']const IconCapLogoFullDark: typeof import('~icons/cap/logo-full-dark.jsx')['default']- const IconCapMessageBubble: typeof import('~icons/cap/message-bubble.jsx')['default']+ const IconCapMessageBubble: typeof import("~icons/cap/message-bubble.jsx")["default"]const IconCapMicrophone: typeof import('~icons/cap/microphone.jsx')['default']- const IconCapMoreVertical: typeof import('~icons/cap/more-vertical.jsx')['default']- const IconCapNext: typeof import('~icons/cap/next.jsx')['default']- const IconCapPadding: typeof import('~icons/cap/padding.jsx')['default']- const IconCapPause: typeof import('~icons/cap/pause.jsx')['default']- const IconCapPauseCircle: typeof import('~icons/cap/pause-circle.jsx')['default']- const IconCapPlay: typeof import('~icons/cap/play.jsx')['default']- const IconCapPlayCircle: typeof import('~icons/cap/play-circle.jsx')['default']- const IconCapPresets: typeof import('~icons/cap/presets.jsx')['default']- const IconCapPrev: typeof import('~icons/cap/prev.jsx')['default']- const IconCapRedo: typeof import('~icons/cap/redo.jsx')['default']- const IconCapRestart: typeof import('~icons/cap/restart.jsx')['default']- const IconCapScissors: typeof import('~icons/cap/scissors.jsx')['default']+ const IconCapMoreVertical: typeof import("~icons/cap/more-vertical.jsx")["default"]+ const IconCapMoveLeft: typeof import("~icons/cap/move-left.jsx")["default"]+ const IconCapMoveRight: typeof import("~icons/cap/move-right.jsx")["default"]+ const IconCapNext: typeof import("~icons/cap/next.jsx")["default"]+ const IconCapPadding: typeof import("~icons/cap/padding.jsx")["default"]+ const IconCapPause: typeof import("~icons/cap/pause.jsx")["default"]+ const IconCapPauseCircle: typeof import("~icons/cap/pause-circle.jsx")["default"]+ const IconCapPlay: typeof import("~icons/cap/play.jsx")["default"]+ const IconCapPlayCircle: typeof import("~icons/cap/play-circle.jsx")["default"]+ const IconCapPresets: typeof import("~icons/cap/presets.jsx")["default"]+ const IconCapPrev: typeof import("~icons/cap/prev.jsx")["default"]+ const IconCapRedo: typeof import("~icons/cap/redo.jsx")["default"]+ const IconCapRefresh: typeof import("~icons/cap/refresh.jsx")["default"]+ const IconCapRestart: typeof import("~icons/cap/restart.jsx")["default"]+ const IconCapScissors: typeof import("~icons/cap/scissors.jsx")["default"]const IconCapSettings: typeof import('~icons/cap/settings.jsx')['default']- const IconCapShadow: typeof import('~icons/cap/shadow.jsx')['default']- const IconCapSquare: typeof import('~icons/cap/square.jsx')['default']- const IconCapStopCircle: typeof import('~icons/cap/stop-circle.jsx')['default']- const IconCapTrash: typeof import('~icons/cap/trash.jsx')['default']- const IconCapUndo: typeof import('~icons/cap/undo.jsx')['default']- const IconCapUpload: typeof import('~icons/cap/upload.jsx')['default']- const IconCapZoomIn: typeof import('~icons/cap/zoom-in.jsx')['default']- const IconCapZoomOut: typeof import('~icons/cap/zoom-out.jsx')['default']- const IconHugeiconsEaseCurveControlPoints: typeof import('~icons/hugeicons/ease-curve-control-points.jsx')['default']+ const IconCapShadow: typeof import("~icons/cap/shadow.jsx")["default"]+ const IconCapSize: typeof import("~icons/cap/size.jsx")["default"]+ const IconCapSquare: typeof import("~icons/cap/square.jsx")["default"]+ const IconCapStop: typeof import("~icons/cap/stop.jsx")["default"]+ const IconCapStopCircle: typeof import("~icons/cap/stop-circle.jsx")["default"]+ const IconCapTrash: typeof import("~icons/cap/trash.jsx")["default"]+ const IconCapUndo: typeof import("~icons/cap/undo.jsx")["default"]+ const IconCapUpload: typeof import("~icons/cap/upload.jsx")["default"]+ const IconCapWindow: typeof import("~icons/cap/window.jsx")["default"]+ const IconCapX: typeof import("~icons/cap/x.jsx")["default"]+ const IconCapZoomIn: typeof import("~icons/cap/zoom-in.jsx")["default"]+ const IconCapZoomOut: typeof import("~icons/cap/zoom-out.jsx")["default"]+ const IconHugeiconsEaseCurveControlPoints: typeof import("~icons/hugeicons/ease-curve-control-points.jsx")["default"]+ const IconIcBaselineMonitor: typeof import("~icons/ic/baseline-monitor.jsx")["default"]+ const IconIcRoundSearch: typeof import("~icons/ic/round-search.jsx")["default"]const IconLucideBell: typeof import('~icons/lucide/bell.jsx')['default']const IconLucideBug: typeof import('~icons/lucide/bug.jsx')['default']- const IconLucideCheck: typeof import('~icons/lucide/check.jsx')['default']- const IconLucideClock: typeof import('~icons/lucide/clock.jsx')['default']- const IconLucideDatabase: typeof import('~icons/lucide/database.jsx')['default']- const IconLucideEdit: typeof import('~icons/lucide/edit.jsx')['default']- const IconLucideEye: typeof import('~icons/lucide/eye.jsx')['default']- const IconLucideFolder: typeof import('~icons/lucide/folder.jsx')['default']+ const IconLucideCamera: typeof import("~icons/lucide/camera.jsx")["default"]+ const IconLucideCheck: typeof import("~icons/lucide/check.jsx")["default"]+ const IconLucideChevronDown: typeof import("~icons/lucide/chevron-down.jsx")["default"]+ const IconLucideClock: typeof import("~icons/lucide/clock.jsx")["default"]+ const IconLucideDatabase: typeof import("~icons/lucide/database.jsx")["default"]+ const IconLucideEdit: typeof import("~icons/lucide/edit.jsx")["default"]+ const IconLucideEye: typeof import("~icons/lucide/eye.jsx")["default"]+ const IconLucideFolder: typeof import("~icons/lucide/folder.jsx")["default"]const IconLucideGift: typeof import('~icons/lucide/gift.jsx')['default']- const IconLucideHardDrive: typeof import('~icons/lucide/hard-drive.jsx')['default']- const IconLucideLoaderCircle: typeof import('~icons/lucide/loader-circle.jsx')['default']- const IconLucideMessageSquarePlus: typeof import('~icons/lucide/message-square-plus.jsx')['default']- const IconLucideMicOff: typeof import('~icons/lucide/mic-off.jsx')['default']- const IconLucideMonitor: typeof import('~icons/lucide/monitor.jsx')['default']- const IconLucideRectangleHorizontal: typeof import('~icons/lucide/rectangle-horizontal.jsx')['default']- const IconLucideRotateCcw: typeof import('~icons/lucide/rotate-ccw.jsx')['default']- const IconLucideSearch: typeof import('~icons/lucide/search.jsx')['default']+ const IconLucideHardDrive: typeof import("~icons/lucide/hard-drive.jsx")["default"]+ const IconLucideLayoutGrid: typeof import("~icons/lucide/layout-grid.jsx")["default"]+ const IconLucideLoaderCircle: typeof import("~icons/lucide/loader-circle.jsx")["default"]+ const IconLucideMessageCircle: typeof import("~icons/lucide/message-circle.jsx")["default"]+ const IconLucideMessageSquare: typeof import("~icons/lucide/message-square.jsx")["default"]+ const IconLucideMessageSquarePlus: typeof import("~icons/lucide/message-square-plus.jsx")["default"]+ const IconLucideMicOff: typeof import("~icons/lucide/mic-off.jsx")["default"]+ const IconLucideMonitor: typeof import("~icons/lucide/monitor.jsx")["default"]+ const IconLucideRabbit: typeof import("~icons/lucide/rabbit.jsx")["default"]+ const IconLucideRectangle: typeof import("~icons/lucide/rectangle.jsx")["default"]+ const IconLucideRectangleHorizontal: typeof import("~icons/lucide/rectangle-horizontal.jsx")["default"]+ const IconLucideRectangleSquare: typeof import("~icons/lucide/rectangle-square.jsx")["default"]+ const IconLucideRotateCcw: typeof import("~icons/lucide/rotate-ccw.jsx")["default"]+ const IconLucideSearch: typeof import("~icons/lucide/search.jsx")["default"]const IconLucideSquarePlay: typeof import('~icons/lucide/square-play.jsx')['default']- const IconLucideUnplug: typeof import('~icons/lucide/unplug.jsx')['default']- const IconLucideVolume2: typeof import('~icons/lucide/volume2.jsx')['default']- const IconLucideVolumeX: typeof import('~icons/lucide/volume-x.jsx')['default']+ const IconLucideUnplug: typeof import("~icons/lucide/unplug.jsx")["default"]+ const IconLucideVideo: typeof import("~icons/lucide/video.jsx")["default"]+ const IconLucideVolume2: typeof import("~icons/lucide/volume2.jsx")["default"]+ const IconLucideVolumeX: typeof import("~icons/lucide/volume-x.jsx")["default"]+ const IconLucideX: typeof import("~icons/lucide/x.jsx")["default"]+ const IconMdiMonitor: typeof import("~icons/mdi/monitor.jsx")["default"]const IconPhMonitorBold: typeof import('~icons/ph/monitor-bold.jsx')['default']}