glycin-utils-4.0.2/.cargo_vcs_info.json 0000644 00000000152 00000000001 0013460 0 ustar {
"git": {
"sha1": "5d6bbc04b33024d583a8e83455a124fddf38beb7"
},
"path_in_vcs": "glycin-utils"
} glycin-utils-4.0.2/Cargo.lock 0000644 00000120023 00000000001 0011433 0 ustar # This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "addr2line"
version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1"
dependencies = [
"gimli",
]
[[package]]
name = "adler2"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
[[package]]
name = "async-broadcast"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532"
dependencies = [
"event-listener",
"event-listener-strategy",
"futures-core",
"pin-project-lite",
]
[[package]]
name = "async-channel"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2"
dependencies = [
"concurrent-queue",
"event-listener-strategy",
"futures-core",
"pin-project-lite",
]
[[package]]
name = "async-executor"
version = "1.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "497c00e0fd83a72a79a39fcbd8e3e2f055d6f6c7e025f3b3d91f4f8e76527fb8"
dependencies = [
"async-task",
"concurrent-queue",
"fastrand",
"futures-lite",
"pin-project-lite",
"slab",
]
[[package]]
name = "async-io"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19634d6336019ef220f09fd31168ce5c184b295cbf80345437cc36094ef223ca"
dependencies = [
"async-lock",
"cfg-if",
"concurrent-queue",
"futures-io",
"futures-lite",
"parking",
"polling",
"rustix",
"slab",
"windows-sys 0.60.2",
]
[[package]]
name = "async-lock"
version = "3.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fd03604047cee9b6ce9de9f70c6cd540a0520c813cbd49bae61f33ab80ed1dc"
dependencies = [
"event-listener",
"event-listener-strategy",
"pin-project-lite",
]
[[package]]
name = "async-process"
version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "65daa13722ad51e6ab1a1b9c01299142bc75135b337923cfa10e79bbbd669f00"
dependencies = [
"async-channel",
"async-io",
"async-lock",
"async-signal",
"async-task",
"blocking",
"cfg-if",
"event-listener",
"futures-lite",
"rustix",
]
[[package]]
name = "async-recursion"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "async-signal"
version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f567af260ef69e1d52c2b560ce0ea230763e6fbb9214a85d768760a920e3e3c1"
dependencies = [
"async-io",
"async-lock",
"atomic-waker",
"cfg-if",
"futures-core",
"futures-io",
"rustix",
"signal-hook-registry",
"slab",
"windows-sys 0.60.2",
]
[[package]]
name = "async-task"
version = "4.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
[[package]]
name = "async-trait"
version = "0.1.89"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "atomic-waker"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
[[package]]
name = "autocfg"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
[[package]]
name = "backtrace"
version = "0.3.75"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002"
dependencies = [
"addr2line",
"cfg-if",
"libc",
"miniz_oxide",
"object",
"rustc-demangle",
"windows-targets 0.52.6",
]
[[package]]
name = "bitflags"
version = "2.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34efbcccd345379ca2868b2b2c9d3782e9cc58ba87bc7d79d5b53d9c9ae6f25d"
[[package]]
name = "blocking"
version = "1.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21"
dependencies = [
"async-channel",
"async-task",
"futures-io",
"futures-lite",
"piper",
]
[[package]]
name = "bytemuck"
version = "1.23.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3995eaeebcdf32f91f980d360f78732ddc061097ab4e39991ae7a6ace9194677"
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "byteorder-lite"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495"
[[package]]
name = "bytes"
version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
[[package]]
name = "cfg-expr"
version = "0.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8d458d63f0f0f482c8da9b7c8b76c21bd885a02056cc94c6404d861ca2b8206"
dependencies = [
"smallvec",
"target-lexicon",
]
[[package]]
name = "cfg-if"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9"
[[package]]
name = "cfg_aliases"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]]
name = "concurrent-queue"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"
dependencies = [
"crossbeam-utils",
]
[[package]]
name = "crossbeam-deque"
version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51"
dependencies = [
"crossbeam-epoch",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-epoch"
version = "0.9.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
dependencies = [
"crossbeam-utils",
]
[[package]]
name = "crossbeam-utils"
version = "0.8.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
[[package]]
name = "crunchy"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
[[package]]
name = "either"
version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
[[package]]
name = "endi"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf"
[[package]]
name = "enumflags2"
version = "0.7.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef"
dependencies = [
"enumflags2_derive",
"serde",
]
[[package]]
name = "enumflags2_derive"
version = "0.7.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "env_filter"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0"
dependencies = [
"log",
]
[[package]]
name = "env_logger"
version = "0.11.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f"
dependencies = [
"env_filter",
"jiff",
"log",
]
[[package]]
name = "equivalent"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
[[package]]
name = "errno"
version = "0.3.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad"
dependencies = [
"libc",
"windows-sys 0.60.2",
]
[[package]]
name = "event-listener"
version = "5.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab"
dependencies = [
"concurrent-queue",
"parking",
"pin-project-lite",
]
[[package]]
name = "event-listener-strategy"
version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93"
dependencies = [
"event-listener",
"pin-project-lite",
]
[[package]]
name = "fastrand"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
[[package]]
name = "futures-channel"
version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
dependencies = [
"futures-core",
]
[[package]]
name = "futures-core"
version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
[[package]]
name = "futures-executor"
version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f"
dependencies = [
"futures-core",
"futures-task",
"futures-util",
]
[[package]]
name = "futures-io"
version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
[[package]]
name = "futures-lite"
version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad"
dependencies = [
"fastrand",
"futures-core",
"futures-io",
"parking",
"pin-project-lite",
]
[[package]]
name = "futures-macro"
version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "futures-task"
version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
[[package]]
name = "futures-util"
version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
dependencies = [
"futures-core",
"futures-macro",
"futures-task",
"pin-project-lite",
"pin-utils",
"slab",
]
[[package]]
name = "getrandom"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
dependencies = [
"cfg-if",
"libc",
"r-efi",
"wasi 0.14.3+wasi-0.2.4",
]
[[package]]
name = "gimli"
version = "0.31.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
[[package]]
name = "gio-sys"
version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a03f2234671e5a588cfe1f59c2b22c103f5772ea351be9cc824a9ce0d06d99fd"
dependencies = [
"glib-sys",
"gobject-sys",
"libc",
"system-deps",
"windows-sys 0.60.2",
]
[[package]]
name = "glib"
version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60bdc26493257b5794ba9301f7cbaf7ab0d69a570bfbefa4d7d360e781cb5205"
dependencies = [
"bitflags",
"futures-channel",
"futures-core",
"futures-executor",
"futures-task",
"futures-util",
"gio-sys",
"glib-macros",
"glib-sys",
"gobject-sys",
"libc",
"memchr",
"smallvec",
]
[[package]]
name = "glib-macros"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e772291ebea14c28eb11bb75741f62f4a4894f25e60ce80100797b6b010ef0f9"
dependencies = [
"heck",
"proc-macro-crate",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "glib-sys"
version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc7c43cff6a7dc43821e45ebf172399437acd6716fa2186b6852d2b397bf622d"
dependencies = [
"libc",
"system-deps",
]
[[package]]
name = "glycin-common"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2382f0d91d42f750486e7c8316cba4781404e574458b5f28d91daff1656e73b"
dependencies = [
"bitflags",
"gufo-common",
"half",
"memmap2",
"nix",
"paste",
"rmp-serde",
"serde",
"thiserror",
"zerocopy",
"zvariant",
]
[[package]]
name = "glycin-utils"
version = "4.0.2"
dependencies = [
"async-lock",
"bitflags",
"blocking",
"env_logger",
"futures-lite",
"futures-util",
"glib",
"glycin-common",
"gufo-common",
"half",
"image",
"libc",
"libseccomp",
"log",
"memmap2",
"nix",
"paste",
"rayon",
"serde",
"thiserror",
"tokio",
"zbus",
"zerocopy",
]
[[package]]
name = "gobject-sys"
version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e9a190eef2bce144a6aa8434e306974c6062c398e0a33a146d60238f9062d5c"
dependencies = [
"glib-sys",
"libc",
"system-deps",
]
[[package]]
name = "gufo-common"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98bebe9ba4be92d3932246ecfbe261106e3013266604f8cbf0ca9ee9df7edf99"
dependencies = [
"paste",
"serde",
"thiserror",
"zvariant",
]
[[package]]
name = "half"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9"
dependencies = [
"cfg-if",
"crunchy",
"zerocopy",
]
[[package]]
name = "hashbrown"
version = "0.15.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
[[package]]
name = "heck"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hermit-abi"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c"
[[package]]
name = "hex"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "image"
version = "0.25.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "529feb3e6769d234375c4cf1ee2ce713682b8e76538cb13f9fc23e1400a591e7"
dependencies = [
"bytemuck",
"byteorder-lite",
"moxcms",
"num-traits",
]
[[package]]
name = "indexmap"
version = "2.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9"
dependencies = [
"equivalent",
"hashbrown",
]
[[package]]
name = "io-uring"
version = "0.7.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b"
dependencies = [
"bitflags",
"cfg-if",
"libc",
]
[[package]]
name = "jiff"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49"
dependencies = [
"jiff-static",
"log",
"portable-atomic",
"portable-atomic-util",
"serde",
]
[[package]]
name = "jiff-static"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "libc"
version = "0.2.175"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543"
[[package]]
name = "libseccomp"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e5310a2c5b6ffbc094b5f70a2ca7b79ed36ad90e6f90994b166489a1bce3fcc"
dependencies = [
"bitflags",
"libc",
"libseccomp-sys",
"pkg-config",
]
[[package]]
name = "libseccomp-sys"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60276e2d41bbb68b323e566047a1bfbf952050b157d8b5cdc74c07c1bf4ca3b6"
[[package]]
name = "linux-raw-sys"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12"
[[package]]
name = "log"
version = "0.4.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
[[package]]
name = "memchr"
version = "2.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
[[package]]
name = "memmap2"
version = "0.9.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "843a98750cd611cc2965a8213b53b43e715f13c37a9e096c6408e69990961db7"
dependencies = [
"libc",
]
[[package]]
name = "memoffset"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
dependencies = [
"autocfg",
]
[[package]]
name = "miniz_oxide"
version = "0.8.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
dependencies = [
"adler2",
]
[[package]]
name = "mio"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c"
dependencies = [
"libc",
"wasi 0.11.1+wasi-snapshot-preview1",
"windows-sys 0.59.0",
]
[[package]]
name = "moxcms"
version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ddd32fa8935aeadb8a8a6b6b351e40225570a37c43de67690383d87ef170cd08"
dependencies = [
"num-traits",
"pxfm",
]
[[package]]
name = "nix"
version = "0.30.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6"
dependencies = [
"bitflags",
"cfg-if",
"cfg_aliases",
"libc",
"memoffset",
]
[[package]]
name = "num-traits"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
]
[[package]]
name = "object"
version = "0.36.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87"
dependencies = [
"memchr",
]
[[package]]
name = "once_cell"
version = "1.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
[[package]]
name = "ordered-stream"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50"
dependencies = [
"futures-core",
"pin-project-lite",
]
[[package]]
name = "parking"
version = "2.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
[[package]]
name = "paste"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
[[package]]
name = "pin-project-lite"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
[[package]]
name = "pin-utils"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "piper"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066"
dependencies = [
"atomic-waker",
"fastrand",
"futures-io",
]
[[package]]
name = "pkg-config"
version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
[[package]]
name = "polling"
version = "3.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5bd19146350fe804f7cb2669c851c03d69da628803dab0d98018142aaa5d829"
dependencies = [
"cfg-if",
"concurrent-queue",
"hermit-abi",
"pin-project-lite",
"rustix",
"windows-sys 0.60.2",
]
[[package]]
name = "portable-atomic"
version = "1.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483"
[[package]]
name = "portable-atomic-util"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507"
dependencies = [
"portable-atomic",
]
[[package]]
name = "ppv-lite86"
version = "0.2.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
dependencies = [
"zerocopy",
]
[[package]]
name = "proc-macro-crate"
version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35"
dependencies = [
"toml_edit",
]
[[package]]
name = "proc-macro2"
version = "1.0.101"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de"
dependencies = [
"unicode-ident",
]
[[package]]
name = "pxfm"
version = "0.1.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e790881194f6f6e86945f0a42a6981977323669aeb6c40e9c7ec253133b96f8"
dependencies = [
"num-traits",
]
[[package]]
name = "quote"
version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
dependencies = [
"proc-macro2",
]
[[package]]
name = "r-efi"
version = "5.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
[[package]]
name = "rand"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
dependencies = [
"rand_chacha",
"rand_core",
]
[[package]]
name = "rand_chacha"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
dependencies = [
"ppv-lite86",
"rand_core",
]
[[package]]
name = "rand_core"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
dependencies = [
"getrandom",
]
[[package]]
name = "rayon"
version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f"
dependencies = [
"either",
"rayon-core",
]
[[package]]
name = "rayon-core"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
dependencies = [
"crossbeam-deque",
"crossbeam-utils",
]
[[package]]
name = "rmp"
version = "0.8.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4"
dependencies = [
"byteorder",
"num-traits",
"paste",
]
[[package]]
name = "rmp-serde"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db"
dependencies = [
"byteorder",
"rmp",
"serde",
]
[[package]]
name = "rustc-demangle"
version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace"
[[package]]
name = "rustix"
version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8"
dependencies = [
"bitflags",
"errno",
"libc",
"linux-raw-sys",
"windows-sys 0.60.2",
]
[[package]]
name = "serde"
version = "1.0.219"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.219"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "serde_repr"
version = "0.1.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "serde_spanned"
version = "0.6.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3"
dependencies = [
"serde",
]
[[package]]
name = "signal-hook-registry"
version = "1.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b"
dependencies = [
"libc",
]
[[package]]
name = "slab"
version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
[[package]]
name = "smallvec"
version = "1.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
[[package]]
name = "socket2"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807"
dependencies = [
"libc",
"windows-sys 0.59.0",
]
[[package]]
name = "static_assertions"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
[[package]]
name = "syn"
version = "2.0.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "system-deps"
version = "7.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4be53aa0cba896d2dc615bd42bbc130acdcffa239e0a2d965ea5b3b2a86ffdb"
dependencies = [
"cfg-expr",
"heck",
"pkg-config",
"toml",
"version-compare",
]
[[package]]
name = "target-lexicon"
version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a"
[[package]]
name = "tempfile"
version = "3.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15b61f8f20e3a6f7e0649d825294eaf317edce30f82cf6026e7e4cb9222a7d1e"
dependencies = [
"fastrand",
"getrandom",
"once_cell",
"rustix",
"windows-sys 0.60.2",
]
[[package]]
name = "thiserror"
version = "2.0.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "2.0.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "tokio"
version = "1.47.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038"
dependencies = [
"backtrace",
"bytes",
"io-uring",
"libc",
"mio",
"pin-project-lite",
"signal-hook-registry",
"slab",
"socket2",
"tracing",
"windows-sys 0.59.0",
]
[[package]]
name = "toml"
version = "0.8.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362"
dependencies = [
"serde",
"serde_spanned",
"toml_datetime",
"toml_edit",
]
[[package]]
name = "toml_datetime"
version = "0.6.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c"
dependencies = [
"serde",
]
[[package]]
name = "toml_edit"
version = "0.22.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
dependencies = [
"indexmap",
"serde",
"serde_spanned",
"toml_datetime",
"winnow",
]
[[package]]
name = "tracing"
version = "0.1.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
dependencies = [
"pin-project-lite",
"tracing-attributes",
"tracing-core",
]
[[package]]
name = "tracing-attributes"
version = "0.1.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "tracing-core"
version = "0.1.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678"
dependencies = [
"once_cell",
]
[[package]]
name = "uds_windows"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9"
dependencies = [
"memoffset",
"tempfile",
"winapi",
]
[[package]]
name = "unicode-ident"
version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
[[package]]
name = "version-compare"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b"
[[package]]
name = "wasi"
version = "0.11.1+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
[[package]]
name = "wasi"
version = "0.14.3+wasi-0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a51ae83037bdd272a9e28ce236db8c07016dd0d50c27038b3f407533c030c95"
dependencies = [
"wit-bindgen",
]
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
"winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-link"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
[[package]]
name = "windows-sys"
version = "0.59.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
dependencies = [
"windows-targets 0.52.6",
]
[[package]]
name = "windows-sys"
version = "0.60.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
dependencies = [
"windows-targets 0.53.3",
]
[[package]]
name = "windows-targets"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
"windows_aarch64_gnullvm 0.52.6",
"windows_aarch64_msvc 0.52.6",
"windows_i686_gnu 0.52.6",
"windows_i686_gnullvm 0.52.6",
"windows_i686_msvc 0.52.6",
"windows_x86_64_gnu 0.52.6",
"windows_x86_64_gnullvm 0.52.6",
"windows_x86_64_msvc 0.52.6",
]
[[package]]
name = "windows-targets"
version = "0.53.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91"
dependencies = [
"windows-link",
"windows_aarch64_gnullvm 0.53.0",
"windows_aarch64_msvc 0.53.0",
"windows_i686_gnu 0.53.0",
"windows_i686_gnullvm 0.53.0",
"windows_i686_msvc 0.53.0",
"windows_x86_64_gnu 0.53.0",
"windows_x86_64_gnullvm 0.53.0",
"windows_x86_64_msvc 0.53.0",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_aarch64_msvc"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c"
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnu"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_gnullvm"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11"
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_i686_msvc"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnu"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "windows_x86_64_msvc"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486"
[[package]]
name = "winnow"
version = "0.7.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf"
dependencies = [
"memchr",
]
[[package]]
name = "wit-bindgen"
version = "0.45.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "052283831dbae3d879dc7f51f3d92703a316ca49f91540417d38591826127814"
[[package]]
name = "zbus"
version = "5.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67a073be99ace1adc48af593701c8015cd9817df372e14a1a6b0ee8f8bf043be"
dependencies = [
"async-broadcast",
"async-executor",
"async-io",
"async-lock",
"async-process",
"async-recursion",
"async-task",
"async-trait",
"blocking",
"enumflags2",
"event-listener",
"futures-core",
"futures-lite",
"hex",
"nix",
"ordered-stream",
"rand",
"serde",
"serde_repr",
"tokio",
"tracing",
"uds_windows",
"windows-sys 0.60.2",
"winnow",
"zbus_macros",
"zbus_names",
"zvariant",
]
[[package]]
name = "zbus_macros"
version = "5.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e80cd713a45a49859dcb648053f63265f4f2851b6420d47a958e5697c68b131"
dependencies = [
"proc-macro-crate",
"proc-macro2",
"quote",
"syn",
"zbus_names",
"zvariant",
"zvariant_utils",
]
[[package]]
name = "zbus_names"
version = "4.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7be68e64bf6ce8db94f63e72f0c7eb9a60d733f7e0499e628dfab0f84d6bcb97"
dependencies = [
"serde",
"static_assertions",
"winnow",
"zvariant",
]
[[package]]
name = "zerocopy"
version = "0.8.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f"
dependencies = [
"zerocopy-derive",
]
[[package]]
name = "zerocopy-derive"
version = "0.8.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "zvariant"
version = "5.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "999dd3be73c52b1fccd109a4a81e4fcd20fab1d3599c8121b38d04e1419498db"
dependencies = [
"endi",
"enumflags2",
"serde",
"winnow",
"zvariant_derive",
"zvariant_utils",
]
[[package]]
name = "zvariant_derive"
version = "5.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6643fd0b26a46d226bd90d3f07c1b5321fe9bb7f04673cb37ac6d6883885b68e"
dependencies = [
"proc-macro-crate",
"proc-macro2",
"quote",
"syn",
"zvariant_utils",
]
[[package]]
name = "zvariant_utils"
version = "3.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6949d142f89f6916deca2232cf26a8afacf2b9fdc35ce766105e104478be599"
dependencies = [
"proc-macro2",
"quote",
"serde",
"syn",
"winnow",
]
glycin-utils-4.0.2/Cargo.toml 0000644 00000005176 00000000001 0011471 0 ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.
[package]
edition = "2021"
rust-version = "1.85"
name = "glycin-utils"
version = "4.0.2"
authors = ["Sophie Herold"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Sandboxed image decoding"
homepage = "https://gitlab.gnome.org/GNOME/glycin"
readme = false
license = "MPL-2.0 OR LGPL-2.1-or-later"
repository = "https://gitlab.gnome.org/GNOME/glycin"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
"--cfg",
"docsrs",
]
[features]
async-io = ["zbus/async-io"]
default = ["async-io"]
gobject = ["glib"]
image-rs = [
"dep:image",
"loader-utils",
]
loader-utils = ["dep:futures-lite"]
tokio = [
"dep:tokio",
"zbus/tokio",
]
[lib]
name = "glycin_utils"
path = "src/lib.rs"
[dependencies.async-lock]
version = "3.3.0"
[dependencies.bitflags]
version = "2.9.0"
[dependencies.blocking]
version = "1.6.1"
[dependencies.env_logger]
version = "0.11.0"
features = ["humantime"]
default-features = false
[dependencies.futures-lite]
version = "2.1.0"
optional = true
[dependencies.futures-util]
version = "0.3.30"
[dependencies.glib]
version = "0.21.0"
features = ["v2_68"]
optional = true
[dependencies.glycin-common]
version = "1.0.0"
[dependencies.gufo-common]
version = "1.0.1"
features = [
"serde",
"serde",
"zvariant",
]
[dependencies.half]
version = "2.4.1"
[dependencies.image]
version = "0.25.7"
optional = true
default-features = false
[dependencies.libc]
version = "0.2.152"
[dependencies.libseccomp]
version = "0.4.0"
[dependencies.log]
version = "0.4.0"
[dependencies.memmap]
version = "0.9.0"
package = "memmap2"
[dependencies.nix]
version = "0.30.0"
features = [
"fs",
"resource",
"signal",
"fs",
"signal",
]
[dependencies.paste]
version = "1.0.0"
[dependencies.rayon]
version = "1.10.0"
[dependencies.serde]
version = "1.0.162"
features = ["derive"]
[dependencies.thiserror]
version = "2.0.3"
[dependencies.tokio]
version = "1.35.1"
features = [
"fs",
"rt",
"rt-multi-thread",
"time",
]
optional = true
[dependencies.zbus]
version = "5.10.0"
features = ["p2p"]
default-features = false
[dependencies.zerocopy]
version = "0.8.12"
glycin-utils-4.0.2/Cargo.toml.orig 0000644 0000000 0000000 00000002376 10461020230 0015151 0 ustar 0000000 0000000 [package]
name = "glycin-utils"
version = "4.0.2"
authors.workspace = true
description.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
async-lock.workspace = true
bitflags.workspace = true
blocking.workspace = true
env_logger.workspace = true
futures-lite = { workspace = true, optional = true }
futures-util.workspace = true
glib = { workspace = true, optional = true }
glycin-common.workspace = true
gufo-common = { workspace = true, features = ["serde", "zvariant"] }
half.workspace = true
image = { workspace = true, optional = true }
libc.workspace = true
libseccomp.workspace = true
log.workspace = true
memmap.workspace = true
nix = { workspace = true, features = ["fs", "signal"] }
paste.workspace = true
rayon.workspace = true
serde.workspace = true
thiserror.workspace = true
tokio = { workspace = true, optional = true }
zbus.workspace = true
zerocopy.workspace = true
[features]
default = ["async-io"]
async-io = ["zbus/async-io"]
tokio = ["dep:tokio", "zbus/tokio"]
image-rs = ["dep:image", "loader-utils"]
loader-utils = ["dep:futures-lite"]
gobject = ["glib"]
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
glycin-utils-4.0.2/LICENSE 0000644 0000000 0000000 00000000035 10461020230 0013255 0 ustar 0000000 0000000 MPL-2.0 OR LGPL-2.1-or-later
glycin-utils-4.0.2/LICENSE-LGPL-2.1 0000644 0000000 0000000 00000063342 10461020230 0014321 0 ustar 0000000 0000000 GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
glycin
Copyright (C) 2023 Sophie Herold
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see .
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random
Hacker.
, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
glycin-utils-4.0.2/LICENSE-MPL-2.0 0000644 0000000 0000000 00000040526 10461020230 0014211 0 ustar 0000000 0000000 Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.
glycin-utils-4.0.2/src/dbus_editor_api.rs 0000644 0000000 0000000 00000023326 10461020230 0016551 0 ustar 0000000 0000000 // Copyright (c) 2024 GNOME Foundation Inc.
use std::io::{Cursor, Seek, SeekFrom, Write};
use std::marker::PhantomData;
use std::os::fd::OwnedFd;
use std::os::unix::net::UnixStream;
use std::sync::{Arc, Mutex};
use futures_util::FutureExt;
use glycin_common::{BinaryData, Operations};
use serde::{Deserialize, Serialize};
use zbus::zvariant::{DeserializeDict, OwnedObjectPath, SerializeDict, Type};
use crate::dbus_types::{self, *};
use crate::error::*;
#[derive(DeserializeDict, SerializeDict, Type, Debug)]
#[zvariant(signature = "dict")]
#[non_exhaustive]
pub struct EditRequest {
pub operations: BinaryData,
}
impl EditRequest {
pub fn for_operations(operations: &Operations) -> Result {
let operations = operations
.to_message_pack()
.expected_error()
.map_err(|x| x.into_editor_error())?;
let operations = BinaryData::from_data(operations)
.expected_error()
.map_err(|x| x.into_editor_error())?;
Ok(Self { operations })
}
pub fn operations(&self) -> Result {
let binary_data = self
.operations
.get()
.expected_error()
.map_err(|x| x.into_editor_error())?;
let operations = Operations::from_slice(&binary_data)
.expected_error()
.map_err(|x| x.into_editor_error())?;
Ok(operations)
}
}
/// Result of a sparse editor operation
///
/// This either contains `byte_changes` or `data`, depending on whether a sparse
/// application of the operations was possible.
#[derive(DeserializeDict, SerializeDict, Type, Debug, Clone)]
#[zvariant(signature = "dict")]
#[non_exhaustive]
pub struct SparseEditorOutput {
pub byte_changes: Option,
pub data: Option,
pub info: EditorOutputInfo,
}
impl SparseEditorOutput {
pub fn byte_changes(byte_changes: ByteChanges) -> Self {
SparseEditorOutput {
byte_changes: Some(byte_changes),
data: None,
info: EditorOutputInfo { lossless: true },
}
}
}
impl From for SparseEditorOutput {
fn from(value: CompleteEditorOutput) -> Self {
Self {
byte_changes: None,
data: Some(value.data),
info: value.info,
}
}
}
#[derive(DeserializeDict, SerializeDict, Type, Debug, Clone)]
#[zvariant(signature = "dict")]
#[non_exhaustive]
pub struct ByteChanges {
pub changes: Vec,
}
#[derive(Deserialize, Serialize, Type, Debug, Clone)]
pub struct ByteChange {
pub offset: u64,
pub new_value: u8,
}
impl ByteChanges {
pub fn from_slice(changes: &[(u64, u8)]) -> Self {
ByteChanges {
changes: changes
.iter()
.map(|(offset, new_value)| ByteChange {
offset: *offset,
new_value: *new_value,
})
.collect(),
}
}
pub fn apply(&self, data: &mut [u8]) {
let mut cur = Cursor::new(data);
for change in self.changes.iter() {
cur.seek(SeekFrom::Start(change.offset)).unwrap();
cur.write_all(&[change.new_value]).unwrap();
}
}
}
#[derive(DeserializeDict, SerializeDict, Type, Debug, Clone)]
#[zvariant(signature = "dict")]
#[non_exhaustive]
pub struct CompleteEditorOutput {
pub data: BinaryData,
pub info: EditorOutputInfo,
}
impl CompleteEditorOutput {
pub fn new(data: BinaryData) -> Self {
Self {
data,
info: Default::default(),
}
}
pub fn new_lossless(data: Vec) -> Result {
let data = BinaryData::from_data(data).expected_error()?;
let info = EditorOutputInfo { lossless: true };
Ok(Self { data, info })
}
}
#[derive(DeserializeDict, SerializeDict, Type, Debug, Default, Clone)]
#[zvariant(signature = "dict")]
#[non_exhaustive]
pub struct EditorOutputInfo {
/// Operation is considered to be lossless
///
/// Operations are considered lossless when all metadata are kept, no image
/// data is lost, and no image quality is lost.
pub lossless: bool,
}
pub struct Editor {
pub editor: PhantomData,
pub image_id: Mutex,
}
/// D-Bus interface for image editors
#[zbus::interface(name = "org.gnome.glycin.Editor")]
impl Editor {
async fn create(
&self,
mime_type: String,
new_image: NewImage,
encoding_options: EncodingOptions,
) -> Result {
E::create(mime_type, new_image, encoding_options).map_err(|x| x.into_editor_error())
}
async fn edit(
&self,
init_request: InitRequest,
#[zbus(connection)] dbus_connection: &zbus::Connection,
) -> Result {
let fd = OwnedFd::from(init_request.fd);
let stream = UnixStream::from(fd);
let editor_state = E::edit(stream, init_request.mime_type, init_request.details)
.map_err(|x| x.into_loader_error())?;
let image_id = {
let lock = self.image_id.lock();
let mut image_id = match lock {
Ok(id) => id,
Err(err) => return Err(RemoteError::InternalLoaderError(err.to_string())),
};
let id = *image_id;
*image_id = id + 1;
id
};
let path =
OwnedObjectPath::try_from(format!("/org/gnome/glycin/editable_image/{image_id}"))
.internal_error()
.map_err(|x| x.into_loader_error())?;
let dbus_image = dbus_types::RemoteEditableImage::new(path.clone());
dbus_connection
.object_server()
.at(
&path,
EditableImage {
editor_implementation: Arc::new(Box::new(editor_state)),
path: path.clone(),
dropped: Default::default(),
},
)
.await
.internal_error()
.map_err(|x| x.into_loader_error())?;
Ok(dbus_image)
}
}
pub struct EditableImage {
pub editor_implementation: Arc>,
pub path: OwnedObjectPath,
dropped: async_lock::OnceCell<()>,
}
#[zbus::interface(name = "org.gnome.glycin.EditableImage")]
impl EditableImage {
async fn apply_sparse(
&self,
edit_request: EditRequest,
) -> Result {
let operations = edit_request.operations()?;
let editor_implementation = self.editor_implementation.clone();
let mut editor_output = blocking::unblock(move || {
editor_implementation
.apply_sparse(operations)
.map_err(|x| x.into_loader_error())
})
.fuse();
futures_util::select! {
result = editor_output => result,
_ = self.dropped.wait().fuse() => Err(RemoteError::Aborted),
}
}
/// Same as [`Self::apply()`] but without potential to return sparse changes
async fn apply_complete(
&self,
edit_request: EditRequest,
) -> Result {
let operations = edit_request.operations()?;
let editor_implementation = self.editor_implementation.clone();
let mut editor_output = blocking::unblock(move || {
editor_implementation
.apply_complete(operations)
.map_err(|x| x.into_loader_error())
})
.fuse();
futures_util::select! {
result = editor_output => result,
_ = self.dropped.wait().fuse() => Err(RemoteError::Aborted),
}
}
async fn done(
&self,
#[zbus(object_server)] object_server: &zbus::ObjectServer,
) -> Result<(), RemoteError> {
log::debug!("Disconnecting {}", self.path);
let removed = object_server
.remove::, _>(&self.path)
.await?;
if removed {
log::debug!("Removed {}", self.path);
} else {
log::error!("Failed to remove {}", self.path);
}
let _ = self.dropped.set(()).await;
Ok(())
}
}
/// Implement this trait to create an image editor
pub trait EditorImplementation: Send + Sync + Sized + 'static {
const USEABLE: bool = true;
fn edit(
stream: UnixStream,
mime_type: String,
details: InitializationDetails,
) -> Result;
fn create(
mime_type: String,
new_image: NewImage,
encoding_options: EncodingOptions,
) -> Result;
fn apply_sparse(&self, operations: Operations) -> Result {
let complete = Self::apply_complete(self, operations)?;
Ok(SparseEditorOutput::from(complete))
}
fn apply_complete(&self, operations: Operations) -> Result;
}
/// Give a `None` for a non-existent `EditorImplementation`
pub enum VoidEditorImplementation {}
impl EditorImplementation for VoidEditorImplementation {
const USEABLE: bool = false;
fn edit(
_stream: UnixStream,
_mime_type: String,
_details: InitializationDetails,
) -> Result {
unreachable!()
}
fn create(
_mime_type: String,
_new_image: NewImage,
_encoding_options: EncodingOptions,
) -> Result {
unreachable!()
}
fn apply_complete(
&self,
_operations: Operations,
) -> Result {
unreachable!()
}
}
glycin-utils-4.0.2/src/dbus_loader_api.rs 0000644 0000000 0000000 00000010126 10461020230 0016523 0 ustar 0000000 0000000 // Copyright (c) 2024 GNOME Foundation Inc.
use std::marker::PhantomData;
use std::os::fd::OwnedFd;
use std::os::unix::net::UnixStream;
use std::sync::{Arc, Mutex, MutexGuard};
use futures_util::FutureExt;
use zbus::zvariant::OwnedObjectPath;
use crate::dbus_types::*;
use crate::error::*;
pub trait LoaderImplementation: Send + Sync + Sized + 'static {
fn init(
stream: UnixStream,
mime_type: String,
details: InitializationDetails,
) -> Result<(Self, ImageDetails), ProcessError>;
fn frame(&mut self, frame_request: FrameRequest) -> Result;
}
pub struct Loader {
pub loader: PhantomData,
pub image_id: Mutex,
}
#[zbus::interface(name = "org.gnome.glycin.Loader")]
impl Loader {
async fn init(
&self,
init_request: InitRequest,
#[zbus(connection)] dbus_connection: &zbus::Connection,
) -> Result {
let fd = OwnedFd::from(init_request.fd);
let stream = UnixStream::from(fd);
let (loader_state, image_info) =
T::init(stream, init_request.mime_type, init_request.details)
.map_err(|x| x.into_loader_error())?;
let image_id = {
let lock = self.image_id.lock();
let mut image_id = match lock {
Ok(id) => id,
Err(err) => return Err(RemoteError::InternalLoaderError(err.to_string())),
};
let id = *image_id;
*image_id = id + 1;
id
};
let path = OwnedObjectPath::try_from(format!("/org/gnome/glycin/image/{image_id}"))
.internal_error()
.map_err(|x| x.into_loader_error())?;
let dbus_image = RemoteImage::new(image_info, path.clone());
dbus_connection
.object_server()
.at(
&path,
Image {
loader_implementation: Arc::new(Mutex::new(Box::new(loader_state))),
path: path.clone(),
dropped: Default::default(),
},
)
.await
.internal_error()
.map_err(|x| x.into_loader_error())?;
Ok(dbus_image)
}
}
pub struct Image {
pub loader_implementation: Arc>>,
pub path: OwnedObjectPath,
dropped: async_lock::OnceCell<()>,
}
impl Image {
pub fn get_loader_state(&self) -> Result>, RemoteError> {
self.loader_implementation.lock().map_err(|err| {
RemoteError::InternalLoaderError(format!(
"Failed to lock loader state for operation: {err}"
))
})
}
}
#[zbus::interface(name = "org.gnome.glycin.Image")]
impl Image {
async fn frame(&self, frame_request: FrameRequest) -> Result {
let loader_implementation = self.loader_implementation.clone();
let mut frame_request = blocking::unblock(move || {
let mut loader_implementation = loader_implementation.lock().map_err(|err| {
RemoteError::InternalLoaderError(format!(
"Failed to lock loader state for operation: {err}"
))
})?;
loader_implementation
.frame(frame_request)
.map_err(|x| x.into_loader_error())
})
.fuse();
futures_util::select! {
result = frame_request => result,
_ = self.dropped.wait().fuse() => Err(RemoteError::Aborted),
}
}
async fn done(
&self,
#[zbus(object_server)] object_server: &zbus::ObjectServer,
) -> Result<(), RemoteError> {
log::debug!("Disconnecting {}", self.path);
let removed = object_server.remove::, _>(&self.path).await?;
if removed {
log::debug!("Removed {}", self.path);
} else {
log::error!("Failed to remove {}", self.path);
}
let _ = self.dropped.set(()).await;
Ok(())
}
}
glycin-utils-4.0.2/src/dbus_types.rs 0000644 0000000 0000000 00000015053 10461020230 0015574 0 ustar 0000000 0000000 use std::collections::BTreeMap;
use std::os::fd::AsRawFd;
use std::time::Duration;
use glycin_common::{BinaryData, MemoryFormat, MemoryFormatInfo};
use gufo_common::orientation::Orientation;
use memmap::MmapMut;
use serde::{Deserialize, Serialize};
use zbus::zvariant::as_value::{self, optional};
use zbus::zvariant::{self, DeserializeDict, Optional, SerializeDict, Type};
use crate::error::DimensionTooLargerError;
use crate::safe_math::{SafeConversion, SafeMath};
use crate::ImgBuf;
#[derive(Deserialize, Serialize, Type, Debug)]
pub struct InitRequest {
/// Source from which the loader reads the image data
pub fd: zvariant::OwnedFd,
pub mime_type: String,
pub details: InitializationDetails,
}
#[derive(DeserializeDict, SerializeDict, Type, Debug, Default)]
#[zvariant(signature = "dict")]
#[non_exhaustive]
pub struct InitializationDetails {
pub base_dir: Option,
}
#[derive(Deserialize, Serialize, Type, Debug, Clone, Default)]
#[zvariant(signature = "dict")]
#[non_exhaustive]
pub struct FrameRequest {
/// Scale image to these dimensions
#[serde(with = "optional", skip_serializing_if = "Option::is_none", default)]
pub scale: Option<(u32, u32)>,
/// Instruction to only decode part of the image
#[serde(with = "optional", skip_serializing_if = "Option::is_none", default)]
pub clip: Option<(u32, u32, u32, u32)>,
/// Get first frame, if previously selected frame was the last one
#[serde(with = "as_value", skip_serializing_if = "std::ops::Not::not", default)]
pub loop_animation: bool,
}
/// Various image metadata
///
/// This is returned from the initial `InitRequest` call
#[derive(Deserialize, Serialize, Type, Debug, Clone)]
pub struct RemoteImage {
pub frame_request: zvariant::OwnedObjectPath,
pub details: ImageDetails,
}
impl RemoteImage {
pub fn new(details: ImageDetails, frame_request: zvariant::OwnedObjectPath) -> Self {
Self {
frame_request,
details,
}
}
}
#[derive(DeserializeDict, SerializeDict, Type, Debug, Clone, Default)]
#[zvariant(signature = "dict")]
#[non_exhaustive]
pub struct ImageDetails {
/// Early dimension information.
///
/// This information is often correct. However, it should only be used for
/// an early rendering estimates. For everything else, the specific frame
/// information should be used.
pub width: u32,
pub height: u32,
/// Image dimensions in inch
pub dimensions_inch: Option<(f64, f64)>,
pub info_format_name: Option,
/// Textual description of the image dimensions
pub info_dimensions_text: Option,
pub metadata_exif: Option,
pub metadata_xmp: Option,
pub metadata_key_value: Option>,
pub transformation_ignore_exif: bool,
/// Explicit orientation. If `None` check Exif or XMP.
pub transformation_orientation: Option,
}
impl ImageDetails {
pub fn new(width: u32, height: u32) -> Self {
Self {
width,
height,
dimensions_inch: None,
info_dimensions_text: None,
info_format_name: None,
metadata_exif: None,
metadata_xmp: None,
metadata_key_value: None,
transformation_ignore_exif: false,
transformation_orientation: None,
}
}
}
#[derive(Deserialize, Serialize, Type, Debug)]
pub struct Frame {
pub width: u32,
pub height: u32,
/// Line stride
pub stride: u32,
pub memory_format: MemoryFormat,
pub texture: BinaryData,
/// Duration to show frame for animations.
///
/// If the value is not set, the image is not animated.
pub delay: Optional,
pub details: FrameDetails,
}
impl Frame {
pub fn n_bytes(&self) -> Result {
self.stride.try_usize()?.smul(self.height.try_usize()?)
}
}
#[derive(DeserializeDict, SerializeDict, Type, Debug, Default, Clone)]
#[zvariant(signature = "dict")]
#[non_exhaustive]
/// More information about a frame
pub struct FrameDetails {
/// ICC color profile
pub color_icc_profile: Option,
/// Coding-independent code points (HDR information)
pub color_cicp: Option<[u8; 4]>,
/// Bit depth per channel
///
/// Only set if it can differ for the format
pub info_bit_depth: Option,
/// Image has alpha channel
///
/// Only set if it can differ for the format
pub info_alpha_channel: Option,
/// Image uses grayscale mode
///
/// Only set if it can differ for the format
pub info_grayscale: Option,
pub n_frame: Option,
}
impl Frame {
pub fn new(
width: u32,
height: u32,
memory_format: MemoryFormat,
texture: BinaryData,
) -> Result {
let stride = memory_format
.n_bytes()
.u32()
.checked_mul(width)
.ok_or(DimensionTooLargerError)?;
Ok(Self {
width,
height,
stride,
memory_format,
texture,
delay: None.into(),
details: Default::default(),
})
}
}
impl Frame {
pub fn as_img_buf(&self) -> std::io::Result {
let raw_fd = self.texture.as_raw_fd();
let original_mmap = unsafe { MmapMut::map_mut(raw_fd) }?;
Ok(ImgBuf::MMap {
mmap: original_mmap,
raw_fd,
})
}
}
/// Editable image
#[derive(Deserialize, Serialize, Type, Debug, Clone)]
pub struct RemoteEditableImage {
pub edit_request: zvariant::OwnedObjectPath,
}
impl RemoteEditableImage {
pub fn new(frame_request: zvariant::OwnedObjectPath) -> Self {
Self {
edit_request: frame_request,
}
}
}
#[derive(DeserializeDict, SerializeDict, Type, Debug)]
#[zvariant(signature = "dict")]
#[non_exhaustive]
pub struct NewImage {
pub image_info: ImageDetails,
pub frames: Vec,
}
impl NewImage {
pub fn new(image_info: ImageDetails, frames: Vec) -> Self {
Self { image_info, frames }
}
}
#[derive(DeserializeDict, SerializeDict, Type, Debug, Default)]
#[zvariant(signature = "dict")]
#[non_exhaustive]
pub struct EncodingOptions {
pub quality: Option,
pub compression: Option,
}
#[derive(DeserializeDict, SerializeDict, Type, Debug)]
#[zvariant(signature = "dict")]
#[non_exhaustive]
pub struct EncodedImage {
pub data: BinaryData,
}
impl EncodedImage {
pub fn new(data: BinaryData) -> Self {
Self { data }
}
}
glycin-utils-4.0.2/src/editing/change_memory_format.rs 0000644 0000000 0000000 00000016522 10461020230 0021225 0 ustar 0000000 0000000 use glycin_common::{ChannelType, MemoryFormatInfo, Source, Target};
use gufo_common::math::Checked;
use rayon::iter::IntoParallelIterator;
use rayon::prelude::*;
use crate::{editing, Frame, ImgBuf, MemoryFormat};
pub fn change_memory_format(
mut img_buf: ImgBuf,
mut frame: Frame,
target_format: MemoryFormat,
) -> Result<(Frame, ImgBuf), editing::Error> {
let src_format = frame.memory_format;
if src_format == target_format {
log::debug!("Same image format {src_format:?}, no need for transformation");
return Ok((frame, img_buf));
}
log::debug!("Starting to transform image format from {src_format:?} to {target_format:?}");
let start_instant = std::time::Instant::now();
let src_format = frame.memory_format;
let src_data = img_buf.as_mut_slice();
let src_pixel_n_bytes = src_format.n_bytes().usize();
let target_pixel_n_bytes = target_format.n_bytes().usize();
let new_stride = (Checked::new(frame.width) * target_format.n_bytes().u32()).check()?;
let new_total_size: usize =
(Checked::new(frame.height as usize) * new_stride as usize).check()?;
let mut new_data = vec![0; new_total_size];
// Target rows for parralel processing
let mut target_rows = Vec::new();
(0..frame.height as usize).fold(new_data.as_mut_slice(), |x, y| {
let (row, rest) = x.split_at_mut(new_stride as usize);
target_rows.push((y, row));
rest
});
if src_format.channel_type() == target_format.channel_type()
&& src_format.is_premultiplied() == target_format.is_premultiplied()
&& (!src_format.source_definition().contains(&Source::Opaque)
|| !target_format.target_definition().contains(&Target::A))
&& !target_format.target_definition().contains(&Target::RgbAvg)
{
let mut source_target_index_map = [0; 4];
for (n, target) in target_format.target_definition().iter().enumerate() {
source_target_index_map[n] = src_format.source_definition()[*target as usize] as usize;
}
let target_n_channels = target_format.n_channels();
target_rows.into_par_iter().for_each(|(y, new_row)| {
for x in 0..frame.width as usize {
let x_ = x * src_pixel_n_bytes;
// src bytes for pixel
let i0 = x_ + y * frame.stride as usize;
// target bytes for pixel
let k0 = x * target_pixel_n_bytes;
for channel_byte in 0..target_format.channel_type().size() {
for i in 0..target_n_channels as usize {
new_row[k0 + i + channel_byte] =
src_data[i0 + source_target_index_map[i] + channel_byte];
}
}
}
});
} else if src_format.channel_type() == ChannelType::U16
&& target_format.channel_type() == ChannelType::U8
&& src_format.is_premultiplied() == target_format.is_premultiplied()
&& (!src_format.source_definition().contains(&Source::Opaque)
|| !target_format.target_definition().contains(&Target::A))
&& !target_format.target_definition().contains(&Target::RgbAvg)
{
let mut source_target_index_map = [0; 4];
for (n, target) in target_format.target_definition().iter().enumerate() {
source_target_index_map[n] = src_format.source_definition()[*target as usize] as usize;
}
let target_n_channels = target_format.n_channels();
let source_channel_size = src_format.channel_type().size();
target_rows.into_par_iter().for_each(|(y, new_row)| {
for x in 0..frame.width as usize {
let x_ = x * src_pixel_n_bytes;
// src bytes for pixel
let i0 = x_ + y * frame.stride as usize;
// target bytes for pixel
let k0 = x * target_pixel_n_bytes;
for i in 0..target_n_channels as usize {
new_row[k0 + i] = (u16::from_ne_bytes([
src_data[i0 + source_target_index_map[i] * source_channel_size],
src_data[i0 + source_target_index_map[i] * source_channel_size + 1],
])
.saturating_add(128)
>> 8) as u8;
}
}
});
} else {
target_rows.into_par_iter().for_each(|(y, new_row)| {
for x in 0..frame.width as usize {
let x_ = x * src_pixel_n_bytes;
// src bytes for pixel
let i0 = x_ + y * frame.stride as usize;
let i1 = i0 + src_pixel_n_bytes;
// target bytes for pixel
let k0 = x * target_pixel_n_bytes;
let k1 = k0 + target_pixel_n_bytes;
MemoryFormat::transform(
src_format,
&src_data[i0..i1],
target_format,
&mut new_row[k0..k1],
);
}
});
}
frame.stride = new_stride;
frame.memory_format = target_format;
log::debug!(
"Transformation completed after {:?}",
start_instant.elapsed()
);
Ok((frame, ImgBuf::Vec(new_data)))
}
#[cfg(test)]
mod test {
use std::os::fd::{FromRawFd, IntoRawFd, OwnedFd};
use glycin_common::BinaryData;
use super::*;
#[test]
fn u16_to_u8() {
let (a, _) = std::os::unix::net::UnixStream::pair().unwrap();
let texture = BinaryData::from(unsafe { OwnedFd::from_raw_fd(a.into_raw_fd()) });
let img_buf = ImgBuf::Vec(if cfg!(target_endian = "little") {
vec![
127, 0, 128, 0, 127, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 127, 253, 128, 253,
255, 255,
]
} else {
vec![
0, 127, 0, 128, 2, 127, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 253, 127, 253, 128,
255, 255,
]
});
let frame = Frame::new(2, 2, crate::MemoryFormat::R16g16b16, texture).unwrap();
let x = change_memory_format(img_buf, frame, MemoryFormat::R8g8b8)
.unwrap()
.1;
assert_eq!(x.as_slice(), &[0, 1, 2, 3, 4, 5, 6, 7, 8, 253, 254, 255]);
}
#[test]
fn u8alpha_to_u8reversed() {
let (a, _) = std::os::unix::net::UnixStream::pair().unwrap();
let texture = BinaryData::from(unsafe { OwnedFd::from_raw_fd(a.into_raw_fd()) });
let img_buf = ImgBuf::Vec(vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
let frame = Frame::new(2, 2, crate::MemoryFormat::R8g8b8a8, texture).unwrap();
let x = change_memory_format(img_buf, frame, MemoryFormat::B8g8r8)
.unwrap()
.1;
assert_eq!(x.as_slice(), &[3, 2, 1, 7, 6, 5, 11, 10, 9, 15, 14, 13]);
}
#[test]
fn u8premultiplied_to_u8() {
let (a, _) = std::os::unix::net::UnixStream::pair().unwrap();
let texture = BinaryData::from(unsafe { OwnedFd::from_raw_fd(a.into_raw_fd()) });
let img_buf = ImgBuf::Vec(vec![127, 63, 0, 127, 127, 63, 0, 255]);
let frame = Frame::new(1, 2, crate::MemoryFormat::R8g8b8a8Premultiplied, texture).unwrap();
let x = change_memory_format(img_buf, frame, MemoryFormat::R8g8b8a8)
.unwrap()
.1;
assert_eq!(x.as_slice(), &[255, 126, 0, 127, 127, 63, 0, 255]);
}
}
glycin-utils-4.0.2/src/editing/clip.rs 0000644 0000000 0000000 00000002540 10461020230 0015762 0 ustar 0000000 0000000 use std::io::{Cursor, Read, Seek};
use glycin_common::MemoryFormatInfo;
use gufo_common::math::{checked, Checked};
use super::{EditingFrame, Error};
pub fn clip(
buf: Vec,
frame: &mut EditingFrame,
(x, y, width, height): (u32, u32, u32, u32),
) -> Result, Error> {
let pixel_size = frame.memory_format.n_bytes().u32();
checked![pixel_size, x, y];
let max_width = (frame.width - x).check()?;
let max_height = (frame.height - y).check()?;
let width = u32::min(width, max_width);
let height = u32::min(height, max_height);
let new_stride = (width * pixel_size).check()?;
let size = (Checked::new(height as usize) * new_stride as usize).check()?;
let mut new = Vec::with_capacity(size);
let stride = frame.stride as i64;
let x_ = (x.i64() * pixel_size.i64()).check()?;
let width_ = width as i64 * pixel_size.i64();
checked![stride];
let mut cur = Cursor::new(buf);
let mut row = vec![0; (width as usize * pixel_size.usize()).check()?];
cur.seek_relative((y.i64() * stride).check()?)?;
for _ in 0..height {
cur.seek_relative(x_)?;
cur.read_exact(&mut row)?;
new.extend_from_slice(&row);
cur.seek_relative((stride - x_ - width_).check()?)?;
}
frame.width = width;
frame.height = height;
frame.stride = new_stride;
Ok(new)
}
glycin-utils-4.0.2/src/editing/operations.rs 0000644 0000000 0000000 00000002660 10461020230 0017221 0 ustar 0000000 0000000 use glycin_common::{Operation, Operations};
use gufo_common::orientation::{Orientation, Rotation};
use super::{EditingFrame, Error};
use crate::{editing, ImgBuf};
pub fn apply_operations(
mut buf: Vec,
simple_frame: &mut EditingFrame,
operations: &Operations,
) -> Result, Error> {
for operation in operations.operations() {
match operation {
Operation::Rotate(rotation) => {
buf = editing::change_orientation(
ImgBuf::Vec(buf),
simple_frame,
Orientation::new(false, *rotation),
)
.into_vec();
}
Operation::MirrorHorizontally => {
buf = editing::change_orientation(
ImgBuf::Vec(buf),
simple_frame,
Orientation::new(true, Rotation::_0),
)
.into_vec();
}
Operation::MirrorVertically => {
buf = editing::change_orientation(
ImgBuf::Vec(buf),
simple_frame,
Orientation::new(true, Rotation::_180),
)
.into_vec();
}
Operation::Clip(clip) => {
buf = editing::clip(buf, simple_frame, *clip)?;
}
op => return Err(Error::UnknownOperation(op.id())),
}
}
Ok(buf)
}
glycin-utils-4.0.2/src/editing/orientation.rs 0000644 0000000 0000000 00000010444 10461020230 0017370 0 ustar 0000000 0000000 use glycin_common::{ExtendedMemoryFormat, MemoryFormatInfo};
use gufo_common::orientation::{Orientation, Rotation};
use super::EditingFrame;
use crate::{Frame, ImgBuf};
pub trait FrameDimensions {
fn width(&self) -> u32;
fn set_width(&mut self, width: u32);
fn height(&self) -> u32;
fn set_height(&mut self, height: u32);
fn stride(&self) -> u32;
fn set_stride(&mut self, stride: u32);
fn memory_format(&self) -> ExtendedMemoryFormat;
}
impl FrameDimensions for EditingFrame {
fn width(&self) -> u32 {
self.width
}
fn set_width(&mut self, width: u32) {
self.width = width;
}
fn height(&self) -> u32 {
self.height
}
fn set_height(&mut self, height: u32) {
self.height = height;
}
fn stride(&self) -> u32 {
self.stride
}
fn set_stride(&mut self, stride: u32) {
self.stride = stride;
}
fn memory_format(&self) -> ExtendedMemoryFormat {
self.memory_format
}
}
impl FrameDimensions for Frame {
fn width(&self) -> u32 {
self.width
}
fn set_width(&mut self, width: u32) {
self.width = width;
}
fn height(&self) -> u32 {
self.height
}
fn set_height(&mut self, height: u32) {
self.height = height;
}
fn stride(&self) -> u32 {
self.stride
}
fn set_stride(&mut self, stride: u32) {
self.stride = stride;
}
fn memory_format(&self) -> ExtendedMemoryFormat {
self.memory_format.into()
}
}
#[allow(clippy::arithmetic_side_effects, clippy::cast_possible_truncation)]
pub fn change_orientation(
mut img_buf: ImgBuf,
frame: &mut impl FrameDimensions,
transformation: Orientation,
) -> ImgBuf {
let stride = frame.stride() as usize;
let width = frame.width() as usize;
let height = frame.height() as usize;
let pixel_size = frame.memory_format().n_bytes().usize();
let n_bytes = width * height * pixel_size;
if transformation.mirror() {
for x in 0..width / 2 {
for y in 0..height {
for i in 0..pixel_size {
let p0 = x * pixel_size + y * stride + i;
let p1 = (width - 1 - x) * pixel_size + y * stride + i;
img_buf.swap(p0, p1);
}
}
}
}
match transformation.rotate() {
Rotation::_0 => img_buf,
Rotation::_270 => {
let mut v = vec![0; n_bytes];
frame.set_width(height as u32);
frame.set_height(width as u32);
frame.set_stride((height * pixel_size) as u32);
for x in 0..width {
for y in 0..height {
for i in 0..pixel_size {
let p0 = x * pixel_size + y * stride + i;
let p1 = x * height * pixel_size + (height - 1 - y) * pixel_size + i;
v[p1] = img_buf[p0];
}
}
}
ImgBuf::Vec(v)
}
Rotation::_90 => {
let mut v = vec![0; n_bytes];
frame.set_width(height as u32);
frame.set_height(width as u32);
frame.set_stride((height * pixel_size) as u32);
for x in 0..width {
for y in 0..height {
for i in 0..pixel_size {
let p0 = x * pixel_size + y * stride + i;
let p1 = (width - 1 - x) * height * pixel_size + y * pixel_size + i;
v[p1] = img_buf[p0];
}
}
}
ImgBuf::Vec(v)
}
Rotation::_180 => {
let mid_col = width / 2;
let uneven_cols = width % 2 == 1;
for x in 0..width.div_ceil(2) {
let y_max = if uneven_cols && mid_col == x {
height / 2
} else {
height
};
for y in 0..y_max {
for i in 0..pixel_size {
let p0 = x * pixel_size + y * stride + i;
let p1 = (width - 1 - x) * pixel_size + (height - 1 - y) * stride + i;
img_buf.swap(p0, p1);
}
}
}
img_buf
}
}
}
glycin-utils-4.0.2/src/editing.rs 0000644 0000000 0000000 00000002652 10461020230 0015037 0 ustar 0000000 0000000 use std::fmt::{Debug, Display};
use std::sync::Arc;
use crate::DimensionTooLargerError;
mod change_memory_format;
mod clip;
mod operations;
mod orientation;
pub use change_memory_format::change_memory_format;
pub use clip::clip;
use glycin_common::{ExtendedMemoryFormat, OperationId};
use gufo_common::math::MathError;
use gufo_common::read::ReadError;
pub use operations::apply_operations;
pub use orientation::change_orientation;
#[derive(Debug, Clone)]
pub struct EditingFrame {
pub width: u32,
pub height: u32,
/// Line stride
pub stride: u32,
pub memory_format: ExtendedMemoryFormat,
}
#[derive(Debug, thiserror::Error, Clone)]
#[non_exhaustive]
pub enum Error {
#[error("IO Error: {0}")]
Io(#[from] Arc),
#[error("Math Error: {0}")]
Math(#[from] MathError),
#[error("Read Error: {0}")]
ReadError(#[from] ReadError),
#[error("{0}")]
DimensionTooLargerError(#[from] DimensionTooLargerError),
#[error("Zerocopy: {0}")]
ZerocopyConvertError(String),
#[error("Unknown operation: {0:?}")]
UnknownOperation(OperationId),
}
impl From> for Error {
fn from(value: zerocopy::ConvertError) -> Self {
Self::ZerocopyConvertError(value.to_string())
}
}
impl From for Error {
fn from(value: std::io::Error) -> Self {
Arc::new(value).into()
}
}
glycin-utils-4.0.2/src/error.rs 0000644 0000000 0000000 00000012730 10461020230 0014543 0 ustar 0000000 0000000 use std::any::Any;
#[derive(zbus::DBusError, Debug, Clone)]
#[zbus(prefix = "org.gnome.glycin.Error")]
#[non_exhaustive]
/// Error within the remote process.
///
/// Errors that appear within the loader or editor.
pub enum RemoteError {
#[zbus(error)]
ZBus(zbus::Error),
LoadingError(String),
InternalLoaderError(String),
EditingError(String),
InternalEditorError(String),
UnsupportedImageFormat(String),
ConversionTooLargerError,
OutOfMemory(String),
Aborted,
NoMoreFrames,
}
type Location = std::panic::Location<'static>;
impl ProcessError {
pub fn into_loader_error(self) -> RemoteError {
match self {
err @ ProcessError::ExpectedError { .. } => RemoteError::LoadingError(err.to_string()),
err @ ProcessError::InternalError { .. } => {
RemoteError::InternalLoaderError(err.to_string())
}
ProcessError::UnsupportedImageFormat(msg) => RemoteError::UnsupportedImageFormat(msg),
ProcessError::ConversionTooLargerError => RemoteError::ConversionTooLargerError,
err @ ProcessError::OutOfMemory { .. } => RemoteError::OutOfMemory(err.to_string()),
ProcessError::NoMoreFrames => RemoteError::NoMoreFrames,
}
}
pub fn into_editor_error(self) -> RemoteError {
match self {
err @ ProcessError::ExpectedError { .. } => RemoteError::EditingError(err.to_string()),
err @ ProcessError::InternalError { .. } => {
RemoteError::InternalEditorError(err.to_string())
}
ProcessError::UnsupportedImageFormat(msg) => RemoteError::UnsupportedImageFormat(msg),
ProcessError::ConversionTooLargerError => RemoteError::ConversionTooLargerError,
err @ ProcessError::OutOfMemory { .. } => RemoteError::OutOfMemory(err.to_string()),
ProcessError::NoMoreFrames => RemoteError::NoMoreFrames,
}
}
}
#[derive(thiserror::Error, Debug)]
#[non_exhaustive]
pub enum ProcessError {
#[error("{location}: {err}")]
ExpectedError { err: String, location: Location },
#[error("{location}: Internal error: {err}")]
InternalError { err: String, location: Location },
#[error("Unsupported image format: {0}")]
UnsupportedImageFormat(String),
#[error("Dimension too large for system")]
ConversionTooLargerError,
#[error("{location}: Not enough memory available")]
OutOfMemory { location: Location },
#[error("No more frames available")]
NoMoreFrames,
}
impl ProcessError {
#[track_caller]
pub fn expected(err: &impl ToString) -> Self {
Self::ExpectedError {
err: err.to_string(),
location: *Location::caller(),
}
}
#[track_caller]
pub fn out_of_memory() -> Self {
Self::OutOfMemory {
location: *Location::caller(),
}
}
}
impl From for ProcessError {
fn from(err: DimensionTooLargerError) -> Self {
eprintln!("Decoding error: {err:?}");
Self::ConversionTooLargerError
}
}
pub trait GenericContexts {
fn expected_error(self) -> Result;
fn internal_error(self) -> Result;
}
impl GenericContexts for Result
where
E: std::error::Error + Any,
{
#[track_caller]
fn expected_error(self) -> Result {
match self {
Ok(x) => Ok(x),
Err(err) => Err(
if let Some(err) = ((&err) as &dyn Any).downcast_ref::() {
if matches!(err, ProcessError::OutOfMemory { .. }) {
ProcessError::out_of_memory()
} else {
ProcessError::expected(err)
}
} else if let Some(err) =
((&err) as &dyn Any).downcast_ref::()
{
if matches!(err, glycin_common::Error::OutOfMemory) {
ProcessError::out_of_memory()
} else {
ProcessError::expected(err)
}
} else {
ProcessError::expected(&err)
},
),
}
}
#[track_caller]
fn internal_error(self) -> Result {
match self {
Ok(x) => Ok(x),
Err(err) => Err(ProcessError::InternalError {
err: err.to_string(),
location: *Location::caller(),
}),
}
}
}
impl GenericContexts for Option {
#[track_caller]
fn expected_error(self) -> Result {
match self {
Some(x) => Ok(x),
None => Err(ProcessError::ExpectedError {
err: String::from("None"),
location: *Location::caller(),
}),
}
}
#[track_caller]
fn internal_error(self) -> Result {
match self {
Some(x) => Ok(x),
None => Err(ProcessError::InternalError {
err: String::from("None"),
location: *Location::caller(),
}),
}
}
}
#[derive(Debug, Clone)]
pub struct DimensionTooLargerError;
impl std::fmt::Display for DimensionTooLargerError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
f.write_str("Dimension too large for system")
}
}
impl std::error::Error for DimensionTooLargerError {}
glycin-utils-4.0.2/src/image_rs.rs 0000644 0000000 0000000 00000016661 10461020230 0015207 0 ustar 0000000 0000000 use glycin_common::shared_memory::SharedMemory;
use glycin_common::{BinaryData, ExtendedMemoryFormat, MemoryFormat, MemoryFormatInfo};
use super::Frame;
use crate::editing::EditingFrame;
use crate::{DimensionTooLargerError, FrameDetails, GenericContexts, ImageDetails, ProcessError};
#[derive(Default, Clone, Debug)]
pub struct Handler {
pub format_name: Option,
pub default_bit_depth: Option,
pub supports_two_alpha_modes: bool,
pub supports_two_grayscale_modes: bool,
}
impl Handler {
pub fn format_name(mut self, format_name: impl ToString) -> Self {
self.format_name = Some(format_name.to_string());
self
}
pub fn default_bit_depth(mut self, default_bit_depth: u8) -> Self {
self.default_bit_depth = Some(default_bit_depth);
self
}
pub fn supports_two_alpha_modes(mut self, supports_two_alpha_modes: bool) -> Self {
self.supports_two_alpha_modes = supports_two_alpha_modes;
self
}
pub fn supports_two_grayscale_modes(mut self, supports_two_grayscale_modes: bool) -> Self {
self.supports_two_grayscale_modes = supports_two_grayscale_modes;
self
}
pub fn info(&self, decoder: &mut impl image::ImageDecoder) -> ImageDetails {
let (width, height) = decoder.dimensions();
let mut info = ImageDetails::new(width, height);
info.info_format_name.clone_from(&self.format_name);
info
}
pub fn frame(&self, mut decoder: impl image::ImageDecoder) -> Result {
let simple_frame = self.editing_frame(&decoder)?;
let width = simple_frame.width;
let height = simple_frame.height;
let color_type = decoder.color_type();
let memory_format = memory_format_from_color_type(color_type);
let details = self.frame_details(&mut decoder);
let mut memory = SharedMemory::new(decoder.total_bytes()).expected_error()?;
decoder.read_image(&mut memory).expected_error()?;
let texture = memory.into_binary_data();
let mut frame = Frame::new(width, height, memory_format, texture)?;
frame.details = details.expected_error()?;
Ok(frame)
}
pub fn editing_frame(
&self,
decoder: &impl image::ImageDecoder,
) -> Result {
let color_type = decoder.color_type();
let memory_format = ExtendedMemoryFormat::from(memory_format_from_color_type(color_type));
let (width, height) = decoder.dimensions();
let stride = memory_format
.n_bytes()
.u32()
.checked_mul(width)
.ok_or(DimensionTooLargerError)?;
Ok(EditingFrame {
width,
height,
stride,
memory_format,
})
}
pub fn frame_details(
&self,
decoder: &mut impl image::ImageDecoder,
) -> Result {
let mut details = FrameDetails {
color_icc_profile: decoder
.icc_profile()
.ok()
.flatten()
.map(BinaryData::from_data)
.transpose()
.expected_error()?,
..Default::default()
};
if let Some((alpha_channel, grayscale, bits)) =
channel_details(decoder.original_color_type())
{
if self.default_bit_depth != Some(bits) {
details.info_bit_depth = Some(bits);
}
if self.supports_two_alpha_modes {
details.info_alpha_channel = Some(alpha_channel);
}
if self.supports_two_grayscale_modes {
details.info_grayscale = Some(grayscale);
}
}
Ok(details)
}
}
/*
impl ImageInfo {
pub fn from_decoder(
decoder: &mut impl image::ImageDecoder,
_format_name: impl ToString,
) -> Self {
let (width, height) = decoder.dimensions();
Self::new(width, height)
}
}
*/
pub fn memory_format_to_color_type(memory_format: &MemoryFormat) -> Option {
match memory_format {
MemoryFormat::G8 => Some(image::ColorType::L8),
MemoryFormat::G8a8 => Some(image::ColorType::La8),
MemoryFormat::R8g8b8 => Some(image::ColorType::Rgb8),
MemoryFormat::R8g8b8a8 => Some(image::ColorType::Rgba8),
MemoryFormat::G16 => Some(image::ColorType::L16),
MemoryFormat::G16a16 => Some(image::ColorType::La16),
MemoryFormat::R16g16b16 => Some(image::ColorType::Rgb16),
MemoryFormat::R16g16b16a16 => Some(image::ColorType::Rgba16),
MemoryFormat::R32g32b32Float => Some(image::ColorType::Rgb32F),
MemoryFormat::R32g32b32a32Float => Some(image::ColorType::Rgba32F),
_ => None,
}
}
pub fn extended_memory_format_to_color_type(
extended_memory_format: &ExtendedMemoryFormat,
) -> Option {
match extended_memory_format {
ExtendedMemoryFormat::Basic(basic) => memory_format_to_color_type(basic),
_ => None,
}
}
pub fn memory_format_from_color_type(color_type: image::ColorType) -> MemoryFormat {
match color_type {
image::ColorType::L8 => MemoryFormat::G8,
image::ColorType::La8 => MemoryFormat::G8a8,
image::ColorType::Rgb8 => MemoryFormat::R8g8b8,
image::ColorType::Rgba8 => MemoryFormat::R8g8b8a8,
image::ColorType::L16 => MemoryFormat::G16,
image::ColorType::La16 => MemoryFormat::G16a16,
image::ColorType::Rgb16 => MemoryFormat::R16g16b16,
image::ColorType::Rgba16 => MemoryFormat::R16g16b16a16,
image::ColorType::Rgb32F => MemoryFormat::R32g32b32Float,
image::ColorType::Rgba32F => MemoryFormat::R32g32b32a32Float,
_ => unimplemented!(),
}
}
pub fn channel_details(color_type: image::ExtendedColorType) -> Option<(bool, bool, u8)> {
Some(match color_type {
image::ExtendedColorType::A8 => (true, false, 8),
image::ExtendedColorType::L1 => (false, true, 1),
image::ExtendedColorType::La1 => (true, true, 1),
image::ExtendedColorType::Rgb1 => (false, false, 1),
image::ExtendedColorType::Rgba1 => (true, false, 1),
image::ExtendedColorType::L2 => (false, true, 2),
image::ExtendedColorType::La2 => (true, true, 2),
image::ExtendedColorType::Rgb2 => (false, false, 2),
image::ExtendedColorType::Rgba2 => (true, false, 2),
image::ExtendedColorType::L4 => (false, true, 4),
image::ExtendedColorType::La4 => (true, true, 4),
image::ExtendedColorType::Rgb4 => (false, false, 4),
image::ExtendedColorType::Rgba4 => (true, false, 4),
image::ExtendedColorType::L8 => (false, true, 8),
image::ExtendedColorType::La8 => (true, true, 8),
image::ExtendedColorType::Rgb8 => (false, false, 8),
image::ExtendedColorType::Rgba8 => (true, false, 8),
image::ExtendedColorType::L16 => (false, true, 16),
image::ExtendedColorType::La16 => (true, true, 16),
image::ExtendedColorType::Rgb16 => (false, false, 16),
image::ExtendedColorType::Rgba16 => (true, false, 16),
image::ExtendedColorType::Bgr8 => (false, false, 8),
image::ExtendedColorType::Bgra8 => (true, false, 8),
image::ExtendedColorType::Rgb32F => (false, false, 32),
image::ExtendedColorType::Rgba32F => (true, false, 32),
image::ExtendedColorType::Unknown(bits) => (false, false, bits),
_ => return None,
})
}
glycin-utils-4.0.2/src/img_buf.rs 0000644 0000000 0000000 00000004256 10461020230 0015026 0 ustar 0000000 0000000 use std::os::fd::{AsRawFd, RawFd};
use crate::{editing, DimensionTooLargerError};
pub enum ImgBuf {
MMap {
mmap: memmap::MmapMut,
raw_fd: RawFd,
},
Vec(Vec),
}
impl ImgBuf {
pub unsafe fn from_raw_fd(raw_fd: impl AsRawFd) -> std::io::Result {
let mmap = unsafe { memmap::MmapMut::map_mut(&raw_fd)? };
Ok(Self::MMap {
mmap,
raw_fd: raw_fd.as_raw_fd(),
})
}
pub fn as_slice(&self) -> &[u8] {
match self {
Self::MMap { mmap, .. } => mmap.as_ref(),
Self::Vec(v) => v.as_slice(),
}
}
pub fn as_mut_slice(&mut self) -> &mut [u8] {
match self {
Self::MMap { mmap, .. } => mmap.as_mut(),
Self::Vec(v) => v.as_mut_slice(),
}
}
pub fn into_vec(self) -> Vec {
match self {
Self::Vec(vec) => vec,
Self::MMap { .. } => self.to_vec(),
}
}
pub fn resize(self, new_len: i64) -> Result {
if self.len() == new_len as usize {
return Ok(self);
}
match self {
ImgBuf::MMap { mmap, raw_fd, .. } => {
let borrowed_fd = unsafe { std::os::fd::BorrowedFd::borrow_raw(raw_fd) };
// This mmap would have the wrong size after ftruncate
drop(mmap);
nix::unistd::ftruncate(
borrowed_fd,
libc::off_t::try_from(new_len).map_err(|_| DimensionTooLargerError)?,
)
.map_err(std::io::Error::from)?;
// Need a new mmap with correct size
let mmap = unsafe { memmap::MmapMut::map_mut(raw_fd) }?;
Ok(ImgBuf::MMap { mmap, raw_fd })
}
Self::Vec(mut vec) => {
vec.resize(new_len as usize, 0);
Ok(Self::Vec(vec))
}
}
}
}
impl std::ops::Deref for ImgBuf {
type Target = [u8];
fn deref(&self) -> &Self::Target {
self.as_slice()
}
}
impl std::ops::DerefMut for ImgBuf {
fn deref_mut(&mut self) -> &mut Self::Target {
self.as_mut_slice()
}
}
glycin-utils-4.0.2/src/instruction_handler.rs 0000644 0000000 0000000 00000014314 10461020230 0017470 0 ustar 0000000 0000000 // Copyright (c) 2024 GNOME Foundation Inc.
use std::ffi::{c_int, c_void};
use std::os::fd::FromRawFd;
use std::os::unix::net::UnixStream;
use std::sync::Mutex;
use nix::libc::{c_uint, siginfo_t};
use crate::dbus_editor_api::{Editor, EditorImplementation, VoidEditorImplementation};
use crate::dbus_loader_api::{Loader, LoaderImplementation};
pub struct DbusServer {
_dbus_connection: zbus::Connection,
}
impl DbusServer {
pub fn spawn_loader(description: String) {
futures_lite::future::block_on(async move {
let _connection = Self::connect::(description).await;
std::future::pending::<()>().await;
})
}
pub fn spawn_loader_editor(
description: String,
) {
futures_lite::future::block_on(async move {
let _connection = Self::connect::(description).await;
std::future::pending::<()>().await;
})
}
async fn connect(
description: String,
) -> Self {
env_logger::builder().format_timestamp_millis().init();
log::info!("Loader {description} startup");
let mut dbus_fd_str = None;
let mut args = std::env::args().skip(1);
while let Some(arg) = args.next() {
match arg.as_str() {
"--dbus-fd" => {
dbus_fd_str = args.next();
}
_ => {
log::warn!("Stopping command line parsing at unknown argument: {arg:?}");
break;
}
}
}
let Some(dbus_fd_str) = dbus_fd_str else {
log::error!("FD that facilitates the D-Bus connection not specified via --dbus-fd");
std::process::exit(2);
};
let Ok(dbus_fd) = dbus_fd_str.parse::() else {
log::error!("FD specified via --dbus-fd is not a valid number: {dbus_fd_str:?}",);
std::process::exit(2);
};
log::debug!("Creating zbus connection to glycin");
let unix_stream: UnixStream = unsafe { UnixStream::from_raw_fd(dbus_fd) };
#[cfg(feature = "tokio")]
let unix_stream =
tokio::net::UnixStream::from_std(unix_stream).expect("wrapping unix stream works");
let mut dbus_connection_builder = zbus::connection::Builder::unix_stream(unix_stream)
.p2p()
.auth_mechanism(zbus::AuthMechanism::Anonymous);
let loader_instruction_handler = Loader:: {
image_id: Mutex::new(1),
loader: Default::default(),
};
dbus_connection_builder = dbus_connection_builder
.serve_at("/org/gnome/glycin", loader_instruction_handler)
.expect("Failed to setup loader handler");
if E::USEABLE {
let editor_instruction_handler = Editor:: {
image_id: Mutex::new(1),
editor: Default::default(),
};
dbus_connection_builder = dbus_connection_builder
.serve_at("/org/gnome/glycin", editor_instruction_handler)
.expect("Failed to setup editor handler");
}
let dbus_connection = dbus_connection_builder
.build()
.await
.expect("Failed to create private DBus connection");
log::debug!("D-Bus connection to glycin created");
DbusServer {
_dbus_connection: dbus_connection,
}
}
}
#[allow(non_camel_case_types)]
extern "C" fn sigsys_handler(_: c_int, info: *mut siginfo_t, _: *mut c_void) {
// Reimplement siginfo_t since the libc crate doesn't support _sigsys
// information
#[repr(C)]
struct siginfo_t {
si_signo: c_int,
si_errno: c_int,
si_code: c_int,
_sifields: _sigsys,
}
#[repr(C)]
struct _sigsys {
_call_addr: *const c_void,
_syscall: c_int,
_arch: c_uint,
}
let info: *mut siginfo_t = info.cast();
let syscall = unsafe { info.as_ref().unwrap()._sifields._syscall };
let name = libseccomp::ScmpSyscall::from(syscall).get_name().ok();
libc_eprint("glycin sandbox: Blocked syscall used: ");
libc_eprint(&name.unwrap_or_else(|| String::from("Unknown Syscall")));
libc_eprint(" (");
libc_eprint(&syscall.to_string());
libc_eprint(")\n");
unsafe {
libc::exit(128 + libc::SIGSYS);
}
}
fn setup_sigsys_handler() {
let mut mask = nix::sys::signal::SigSet::empty();
mask.add(nix::sys::signal::Signal::SIGSYS);
let sigaction = nix::sys::signal::SigAction::new(
nix::sys::signal::SigHandler::SigAction(sigsys_handler),
nix::sys::signal::SaFlags::SA_SIGINFO,
mask,
);
unsafe {
if nix::sys::signal::sigaction(nix::sys::signal::Signal::SIGSYS, &sigaction).is_err() {
libc_eprint("glycin sandbox: Failed to init syscall failure signal handler");
}
};
}
#[allow(dead_code)]
pub extern "C" fn pre_main() {
setup_sigsys_handler();
}
#[macro_export]
macro_rules! init_main_loader {
($loader:path) => {
/// Init handler for SIGSYS before main() to catch
#[cfg_attr(target_os = "linux", link_section = ".ctors")]
static __CTOR: extern "C" fn() = pre_main;
fn main() {
$crate::DbusServer::spawn_loader::<$loader>(format!(
"{} v{}",
env!("CARGO_PKG_NAME"),
env!("CARGO_PKG_VERSION")
));
}
};
}
#[macro_export]
macro_rules! init_main_loader_editor {
($loader:path, $editor:path) => {
/// Init handler for SIGSYS before main() to catch
#[cfg_attr(target_os = "linux", link_section = ".ctors")]
static __CTOR: extern "C" fn() = pre_main;
fn main() {
$crate::DbusServer::spawn_loader_editor::<$loader, $editor>(format!(
"{} v{}",
env!("CARGO_PKG_NAME"),
env!("CARGO_PKG_VERSION")
));
}
};
}
fn libc_eprint(s: &str) {
unsafe {
libc::write(
libc::STDERR_FILENO,
s.as_ptr() as *const libc::c_void,
s.len(),
);
}
}
glycin-utils-4.0.2/src/lib.rs 0000644 0000000 0000000 00000002160 10461020230 0014154 0 ustar 0000000 0000000 #![deny(clippy::arithmetic_side_effects)]
#![deny(clippy::cast_possible_truncation)]
#![deny(clippy::cast_possible_wrap)]
//! Utilities for building glycin decoders
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#[cfg(all(not(feature = "async-io"), not(feature = "tokio")))]
mod error_message {
compile_error!(
"\"async-io\" (default) or \"tokio\" must be enabled to provide an async runtime for zbus."
);
}
mod dbus_editor_api;
mod dbus_loader_api;
mod dbus_types;
pub mod editing;
pub mod error;
#[cfg(feature = "image-rs")]
pub mod image_rs;
mod img_buf;
#[cfg(feature = "loader-utils")]
pub mod instruction_handler;
pub mod safe_math;
#[cfg(feature = "loader-utils")]
#[doc(no_inline)]
pub use std::os::unix::net::UnixStream;
pub use dbus_editor_api::*;
pub use dbus_loader_api::*;
pub use dbus_types::*;
pub use error::*;
pub use glycin_common::shared_memory::SharedMemory;
pub use glycin_common::{
BinaryData, ExtendedMemoryFormat, MemoryFormat, MemoryFormatInfo, MemoryFormatSelection,
Operation, Operations,
};
pub use img_buf::ImgBuf;
#[cfg(feature = "loader-utils")]
pub use instruction_handler::*;
glycin-utils-4.0.2/src/safe_math.rs 0000644 0000000 0000000 00000004732 10461020230 0015344 0 ustar 0000000 0000000 use crate::error::DimensionTooLargerError;
pub trait SafeConversion:
TryInto + TryInto + TryInto + TryInto + TryInto
{
fn try_usize(self) -> Result {
self.try_into().map_err(|_| DimensionTooLargerError)
}
fn try_i32(self) -> Result {
self.try_into().map_err(|_| DimensionTooLargerError)
}
fn try_u32(self) -> Result {
self.try_into().map_err(|_| DimensionTooLargerError)
}
fn try_i64(self) -> Result {
self.try_into().map_err(|_| DimensionTooLargerError)
}
fn try_u64(self) -> Result {
self.try_into().map_err(|_| DimensionTooLargerError)
}
}
impl SafeConversion for usize {}
impl SafeConversion for u32 {}
impl SafeConversion for i32 {}
impl SafeConversion for u64 {}
pub trait SafeMath: Sized {
fn smul(self, rhs: Self) -> Result;
fn sadd(self, rhs: Self) -> Result;
fn srem(self, rhs: Self) -> Result;
}
impl SafeMath for usize {
fn smul(self, rhs: Self) -> Result {
self.checked_mul(rhs).ok_or(DimensionTooLargerError)
}
fn sadd(self, rhs: Self) -> Result {
self.checked_add(rhs).ok_or(DimensionTooLargerError)
}
fn srem(self, rhs: Self) -> Result {
self.checked_rem(rhs).ok_or(DimensionTooLargerError)
}
}
impl SafeMath for u32 {
fn smul(self, rhs: Self) -> Result {
self.checked_mul(rhs).ok_or(DimensionTooLargerError)
}
fn sadd(self, rhs: Self) -> Result {
self.checked_add(rhs).ok_or(DimensionTooLargerError)
}
fn srem(self, rhs: Self) -> Result {
self.checked_add(rhs).ok_or(DimensionTooLargerError)
}
}
impl SafeMath for u64 {
fn smul(self, rhs: Self) -> Result {
self.checked_mul(rhs).ok_or(DimensionTooLargerError)
}
fn sadd(self, rhs: Self) -> Result {
self.checked_add(rhs).ok_or(DimensionTooLargerError)
}
fn srem(self, rhs: Self) -> Result {
self.checked_add(rhs).ok_or(DimensionTooLargerError)
}
}