gtk4-layer-shell-sys-0.4.0/.cargo_vcs_info.json0000644000000001620000000000100147400ustar { "git": { "sha1": "851ed637de60ccb90b9166b871887729ab26f915" }, "path_in_vcs": "gtk4-layer-shell-sys" }gtk4-layer-shell-sys-0.4.0/Cargo.lock0000644000000324220000000000100127170ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "bitflags" version = "2.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34efbcccd345379ca2868b2b2c9d3782e9cc58ba87bc7d79d5b53d9c9ae6f25d" [[package]] name = "cairo-sys-rs" version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b963177900ec8e783927e5ed99e16c0ec1b723f1f125dff8992db28ef35c62c3" dependencies = [ "libc", "system-deps", ] [[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 = "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", ] [[package]] name = "fastrand" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "gdk-pixbuf-sys" version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e25899cc931dc28cba912ebec793b730f53d2d419f90a562fcb29b53bd10aa82" dependencies = [ "gio-sys", "glib-sys", "gobject-sys", "libc", "system-deps", ] [[package]] name = "gdk4-sys" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2edbda0d879eb85317bdb49a3da591ed70a804a10776e358ef416be38c6db2c5" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", "gio-sys", "glib-sys", "gobject-sys", "libc", "pango-sys", "pkg-config", "system-deps", ] [[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", ] [[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", ] [[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 = "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 = "graphene-sys" version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf8205bb19b7a041cf059be3c94d6b23b3f2c6c96362c44311dcf184e4a9422a" dependencies = [ "glib-sys", "libc", "pkg-config", "system-deps", ] [[package]] name = "gsk4-sys" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d76011d55dd19fde16ffdedee08877ae6ec942818cfa7bc08a91259bc0b9fc9" dependencies = [ "cairo-sys-rs", "gdk4-sys", "glib-sys", "gobject-sys", "graphene-sys", "libc", "pango-sys", "system-deps", ] [[package]] name = "gtk4-layer-shell-sys" version = "0.4.0" dependencies = [ "gdk4-sys", "glib-sys", "gtk4-sys", "libc", "shell-words", "system-deps", "tempfile", ] [[package]] name = "gtk4-sys" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a923bdcf00e46723801162de24432cbce38a6810e0178a2d0b6dd4ecc26a1c74" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", "gdk4-sys", "gio-sys", "glib-sys", "gobject-sys", "graphene-sys", "gsk4-sys", "libc", "pango-sys", "system-deps", ] [[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 = "indexmap" version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9" dependencies = [ "equivalent", "hashbrown", ] [[package]] name = "libc" version = "0.2.175" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" [[package]] name = "linux-raw-sys" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "memchr" version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "once_cell" version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "pango-sys" version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f855bccb447644e149fae79086e1f81514c30fe5e9b8bd257d9d3c941116c86" dependencies = [ "glib-sys", "gobject-sys", "libc", "system-deps", ] [[package]] name = "pkg-config" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[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 = "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 = "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", ] [[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_spanned" version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" dependencies = [ "serde", ] [[package]] name = "shell-words" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" [[package]] name = "smallvec" version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[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", ] [[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 = "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.14.3+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a51ae83037bdd272a9e28ce236db8c07016dd0d50c27038b3f407533c030c95" dependencies = [ "wit-bindgen", ] [[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.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ "windows-targets", ] [[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", "windows_aarch64_msvc", "windows_i686_gnu", "windows_i686_gnullvm", "windows_i686_msvc", "windows_x86_64_gnu", "windows_x86_64_gnullvm", "windows_x86_64_msvc", ] [[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.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" [[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.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" [[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.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" [[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.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" gtk4-layer-shell-sys-0.4.0/Cargo.toml0000644000000034350000000000100127440ustar # 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.70" name = "gtk4-layer-shell-sys" version = "0.4.0" authors = ["pentamassiv "] build = "build.rs" autolib = false autobins = false autoexamples = false autotests = false autobenches = false description = "Unsafe gir-generated FFI bindings for gtk4-layer-shell" documentation = "https://docs.rs/gtk4-layer-shell-sys/" readme = "README.md" keywords = [ "gtk4", "gtk4-layer-shell", "wayland", "FFI", "unsafe", ] categories = [ "external-ffi-bindings", "gui", ] license = "MIT" repository = "https://github.com/pentamassiv/gtk4-layer-shell-gir/tree/main/gtk4-layer-shell-sys" [package.metadata.system-deps.gtk4_layer_shell_0] name = "gtk4-layer-shell-0" version = "1" [package.metadata.docs.rs] all-features = true rustc-args = [ "--cfg", "docsrs", ] rustdoc-args = [ "--cfg", "docsrs", "--generate-link-to-definition", ] [features] [lib] name = "gtk4_layer_shell_sys" path = "src/lib.rs" [[test]] name = "abi" path = "tests/abi.rs" [dependencies.gdk4-sys] version = "0.10" [dependencies.glib-sys] version = "0.21" [dependencies.gtk4-sys] version = "0.10" [dependencies.libc] version = "0.2" [dev-dependencies.shell-words] version = "1.0.0" [dev-dependencies.tempfile] version = "3" [build-dependencies.system-deps] version = "7" gtk4-layer-shell-sys-0.4.0/Cargo.toml.orig000064400000000000000000000021241046102023000164170ustar 00000000000000[package] name = "gtk4-layer-shell-sys" version = "0.4.0" description = "Unsafe gir-generated FFI bindings for gtk4-layer-shell" repository = "https://github.com/pentamassiv/gtk4-layer-shell-gir/tree/main/gtk4-layer-shell-sys" documentation = "https://docs.rs/gtk4-layer-shell-sys/" keywords = ["gtk4", "gtk4-layer-shell", "wayland", "FFI", "unsafe"] categories = ["external-ffi-bindings", "gui"] build = "build.rs" [package.authors] workspace = true [package.rust-version] workspace = true [package.edition] workspace = true [package.license] workspace = true [package.metadata.system-deps.gtk4_layer_shell_0] name = "gtk4-layer-shell-0" version = "1" [package.metadata.docs.rs] all-features = true rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] [lib] name = "gtk4_layer_shell_sys" [dependencies] libc = "0.2" [dependencies.glib-sys] workspace = true [dependencies.gdk4-sys] workspace = true [dependencies.gtk4-sys] workspace = true [build-dependencies] system-deps = "7" [dev-dependencies] shell-words = "1.0.0" tempfile = "3" [features] gtk4-layer-shell-sys-0.4.0/Gir.toml000064400000000000000000000004051046102023000151460ustar 00000000000000[options] library = "Gtk4LayerShell" version = "1.0" target_path = "." min_cfg_version = "1.0" work_mode = "sys" girs_directories = ["../gir-files", ".."] single_version_file = true external_libraries = ["GLib"] [external_libraries] gdk4 = "Gdk" gtk4 = "Gtk" gtk4-layer-shell-sys-0.4.0/README.md000064400000000000000000000061311046102023000150110ustar 00000000000000[![Crate](https://img.shields.io/crates/v/gtk4-layer-shell-sys.svg)](https://crates.io/crates/gtk4-layer-shell-sys) [![docs.rs](https://docs.rs/gtk4-layer-shell-sys/badge.svg)](https://docs.rs/gtk4-layer-shell-sys) [![dependency status](https://deps.rs/crate/gtk4-layer-shell-sys/0.4.0/status.svg)](https://deps.rs/crate/gtk4-layer-shell-sys/0.4.0) [![maintenance-status: passively-maintained (as of 2022-10-01)](https://img.shields.io/badge/maintenance--status-passively--maintained_%28as_of_2022--10--01%29-forestgreen)](https://gist.github.com/rusty-snake/574a91f1df9f97ec77ca308d6d731e29) ![dependabot status](https://img.shields.io/badge/dependabot-enabled-025e8c?logo=Dependabot) [![Build](https://img.shields.io/github/actions/workflow/status/pentamassiv/gtk4-layer-shell-gir/build.yaml?branch=main)](https://github.com/pentamassiv/gtk4-layer-shell-gir/actions/workflows/build.yaml) # gtk4-layer-shell-sys These are the unsafe FFI bindings for [gtk4-layer-shell](https://github.com/pentamassiv/gtk4-layer-shell-gir/tree/main/gtk4-layer-shell). You likely want to use that crate instead. It allows building desktop shell components such as panels, notifications and wallpapers with GTK4. It can be used to anchor your windows to a corner or edge of the output, or stretch them across the entire output. To do that, it uses the [Layer Shell](https://wayland.app/protocols/wlr-layer-shell-unstable-v1) Wayland protocol. A list of supported compositors can be found [here](https://wayland.app/protocols/wlr-layer-shell-unstable-v1#compositor-support). ## Dependencies You need to have `gtk4` and `gtk4-layer-shell` (the C library) installed on your system. `gtk4-layer-shell` version 1.1.0 or higher is needed to use `gtk4-session-lock`. If you want to use [gtk4-layer-shell](https://github.com/pentamassiv/gtk4-layer-shell-gir/tree/main/gtk4-layer-shell) and [gtk4-session-lock](https://github.com/pentamassiv/gtk4-layer-shell-gir/tree/main/gtk4-session-lock) together in a project, make sure to use the same .so file of `gtk4-layer-shell` for both. If your distribution does not provide a current enough version of `gtk4-layer-shell`, you can [build it from source](https://github.com/wmww/gtk4-layer-shell#building-from-source). If you did that, you might also have to set the following two environment variables: ```bash export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig export LD_LIBRARY_PATH=/usr/local/lib ``` ## Generating the bindings Generating the bindings yourself is not necessary to be able to use them. You can just use the version published on crates.io. If you want to do it anyways, you can find a description [here](https://github.com/pentamassiv/gtk4-layer-shell-gir/tree/main/generate_bindings.md). ## Maintenance status This crate is just an unsafe wrapper for the C library so the bindings are feature complete and not actively worked on. The C library is actively developed and I keep the bindings up-to-date with it. If you encounter any problems, feel free to open a PR. ## Contributing Pull requests are very welcome but please keep the maintenance status in mind. ## License [MIT](https://choosealicense.com/licenses/mit/) gtk4-layer-shell-sys-0.4.0/build.rs000064400000000000000000000006241046102023000152000ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from .. // from ../gir-files // DO NOT EDIT #[cfg(not(docsrs))] use std::process; #[cfg(docsrs)] fn main() {} // prevent linking libraries to avoid documentation failure #[cfg(not(docsrs))] fn main() { if let Err(s) = system_deps::Config::new().probe() { println!("cargo:warning={s}"); process::exit(1); } } gtk4-layer-shell-sys-0.4.0/src/auto/versions.txt000064400000000000000000000001751046102023000177040ustar 00000000000000Generated by gir (https://github.com/gtk-rs/gir @ 5ce24253f28c) from .. (@ 1ecf663bd4c6+) from ../gir-files (@ 07aa7d177618) gtk4-layer-shell-sys-0.4.0/src/lib.rs000064400000000000000000000100521046102023000154320ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from .. // from ../gir-files // DO NOT EDIT #![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] #![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal, clippy::upper_case_acronyms)] #![cfg_attr(docsrs, feature(doc_cfg))] use glib_sys as glib; use gdk4_sys as gdk; use gtk4_sys as gtk; mod manual; pub use manual::*; #[allow(unused_imports)] use std::ffi::{c_int, c_char, c_uchar, c_float, c_uint, c_double, c_short, c_ushort, c_long, c_ulong, c_void}; #[allow(unused_imports)] use libc::{size_t, ssize_t, time_t, off_t, intptr_t, uintptr_t, FILE}; #[cfg(unix)] #[allow(unused_imports)] use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t}; #[allow(unused_imports)] use glib::{gboolean, gconstpointer, gpointer, GType}; // Enums pub type GtkLayerShellEdge = c_int; pub const GTK_LAYER_SHELL_EDGE_LEFT: GtkLayerShellEdge = 0; pub const GTK_LAYER_SHELL_EDGE_RIGHT: GtkLayerShellEdge = 1; pub const GTK_LAYER_SHELL_EDGE_TOP: GtkLayerShellEdge = 2; pub const GTK_LAYER_SHELL_EDGE_BOTTOM: GtkLayerShellEdge = 3; pub const GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER: GtkLayerShellEdge = 4; pub type GtkLayerShellKeyboardMode = c_int; pub const GTK_LAYER_SHELL_KEYBOARD_MODE_NONE: GtkLayerShellKeyboardMode = 0; pub const GTK_LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE: GtkLayerShellKeyboardMode = 1; pub const GTK_LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND: GtkLayerShellKeyboardMode = 2; pub const GTK_LAYER_SHELL_KEYBOARD_MODE_ENTRY_NUMBER: GtkLayerShellKeyboardMode = 3; pub type GtkLayerShellLayer = c_int; pub const GTK_LAYER_SHELL_LAYER_BACKGROUND: GtkLayerShellLayer = 0; pub const GTK_LAYER_SHELL_LAYER_BOTTOM: GtkLayerShellLayer = 1; pub const GTK_LAYER_SHELL_LAYER_TOP: GtkLayerShellLayer = 2; pub const GTK_LAYER_SHELL_LAYER_OVERLAY: GtkLayerShellLayer = 3; pub const GTK_LAYER_SHELL_LAYER_ENTRY_NUMBER: GtkLayerShellLayer = 4; extern "C" { //========================================================================= // Other functions //========================================================================= pub fn gtk_layer_auto_exclusive_zone_enable(window: *mut gtk::GtkWindow); pub fn gtk_layer_auto_exclusive_zone_is_enabled(window: *mut gtk::GtkWindow) -> gboolean; pub fn gtk_layer_get_anchor(window: *mut gtk::GtkWindow, edge: GtkLayerShellEdge) -> gboolean; pub fn gtk_layer_get_exclusive_zone(window: *mut gtk::GtkWindow) -> c_int; pub fn gtk_layer_get_keyboard_mode(window: *mut gtk::GtkWindow) -> GtkLayerShellKeyboardMode; pub fn gtk_layer_get_layer(window: *mut gtk::GtkWindow) -> GtkLayerShellLayer; pub fn gtk_layer_get_major_version() -> c_uint; pub fn gtk_layer_get_margin(window: *mut gtk::GtkWindow, edge: GtkLayerShellEdge) -> c_int; pub fn gtk_layer_get_micro_version() -> c_uint; pub fn gtk_layer_get_minor_version() -> c_uint; pub fn gtk_layer_get_monitor(window: *mut gtk::GtkWindow) -> *mut gdk::GdkMonitor; pub fn gtk_layer_get_namespace(window: *mut gtk::GtkWindow) -> *const c_char; pub fn gtk_layer_get_protocol_version() -> c_uint; pub fn gtk_layer_get_zwlr_layer_surface_v1(window: *mut gtk::GtkWindow) -> *mut zwlr_layer_surface_v1; pub fn gtk_layer_init_for_window(window: *mut gtk::GtkWindow); pub fn gtk_layer_is_layer_window(window: *mut gtk::GtkWindow) -> gboolean; pub fn gtk_layer_is_supported() -> gboolean; pub fn gtk_layer_set_anchor(window: *mut gtk::GtkWindow, edge: GtkLayerShellEdge, anchor_to_edge: gboolean); pub fn gtk_layer_set_exclusive_zone(window: *mut gtk::GtkWindow, exclusive_zone: c_int); pub fn gtk_layer_set_keyboard_mode(window: *mut gtk::GtkWindow, mode: GtkLayerShellKeyboardMode); pub fn gtk_layer_set_layer(window: *mut gtk::GtkWindow, layer: GtkLayerShellLayer); pub fn gtk_layer_set_margin(window: *mut gtk::GtkWindow, edge: GtkLayerShellEdge, margin_size: c_int); pub fn gtk_layer_set_monitor(window: *mut gtk::GtkWindow, monitor: *mut gdk::GdkMonitor); pub fn gtk_layer_set_namespace(window: *mut gtk::GtkWindow, name_space: *const c_char); } gtk4-layer-shell-sys-0.4.0/src/manual.rs000064400000000000000000000001041046102023000161360ustar 00000000000000use glib_sys::gpointer; pub type zwlr_layer_surface_v1 = gpointer; gtk4-layer-shell-sys-0.4.0/tests/abi.rs000064400000000000000000000163711046102023000160040ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from .. // from ../gir-files // DO NOT EDIT #![cfg(unix)] use gtk4_layer_shell_sys::*; use std::mem::{align_of, size_of}; use std::env; use std::error::Error; use std::ffi::OsString; use std::path::Path; use std::process::{Command, Stdio}; use std::str; use tempfile::Builder; static PACKAGES: &[&str] = &["gtk4-layer-shell-0"]; #[derive(Clone, Debug)] struct Compiler { pub args: Vec, } impl Compiler { pub fn new() -> Result> { let mut args = get_var("CC", "cc")?; args.push("-Wno-deprecated-declarations".to_owned()); // For _Generic args.push("-std=c11".to_owned()); // For %z support in printf when using MinGW. args.push("-D__USE_MINGW_ANSI_STDIO".to_owned()); args.extend(get_var("CFLAGS", "")?); args.extend(get_var("CPPFLAGS", "")?); args.extend(pkg_config_cflags(PACKAGES)?); Ok(Self { args }) } pub fn compile(&self, src: &Path, out: &Path) -> Result<(), Box> { let mut cmd = self.to_command(); cmd.arg(src); cmd.arg("-o"); cmd.arg(out); let status = cmd.spawn()?.wait()?; if !status.success() { return Err(format!("compilation command {cmd:?} failed, {status}").into()); } Ok(()) } fn to_command(&self) -> Command { let mut cmd = Command::new(&self.args[0]); cmd.args(&self.args[1..]); cmd } } fn get_var(name: &str, default: &str) -> Result, Box> { match env::var(name) { Ok(value) => Ok(shell_words::split(&value)?), Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?), Err(err) => Err(format!("{name} {err}").into()), } } fn pkg_config_cflags(packages: &[&str]) -> Result, Box> { if packages.is_empty() { return Ok(Vec::new()); } let pkg_config = env::var_os("PKG_CONFIG") .unwrap_or_else(|| OsString::from("pkg-config")); let mut cmd = Command::new(pkg_config); cmd.arg("--cflags"); cmd.args(packages); cmd.stderr(Stdio::inherit()); let out = cmd.output()?; if !out.status.success() { let (status, stdout) = (out.status, String::from_utf8_lossy(&out.stdout)); return Err(format!("command {cmd:?} failed, {status:?}\nstdout: {stdout}").into()); } let stdout = str::from_utf8(&out.stdout)?; Ok(shell_words::split(stdout.trim())?) } #[derive(Copy, Clone, Debug, Eq, PartialEq)] struct Layout { size: usize, alignment: usize, } #[derive(Copy, Clone, Debug, Default, Eq, PartialEq)] struct Results { /// Number of successfully completed tests. passed: usize, /// Total number of failed tests (including those that failed to compile). failed: usize, } impl Results { fn record_passed(&mut self) { self.passed += 1; } fn record_failed(&mut self) { self.failed += 1; } fn summary(&self) -> String { format!("{} passed; {} failed", self.passed, self.failed) } fn expect_total_success(&self) { if self.failed == 0 { println!("OK: {}", self.summary()); } else { panic!("FAILED: {}", self.summary()); }; } } #[test] fn cross_validate_constants_with_c() { let mut c_constants: Vec<(String, String)> = Vec::new(); for l in get_c_output("constant").unwrap().lines() { let (name, value) = l.split_once(';').expect("Missing ';' separator"); c_constants.push((name.to_owned(), value.to_owned())); } let mut results = Results::default(); for ((rust_name, rust_value), (c_name, c_value)) in RUST_CONSTANTS.iter().zip(c_constants.iter()) { if rust_name != c_name { results.record_failed(); eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}"); continue; } if rust_value != c_value { results.record_failed(); eprintln!( "Constant value mismatch for {rust_name}\nRust: {rust_value:?}\nC: {c_value:?}", ); continue; } results.record_passed(); } results.expect_total_success(); } #[test] fn cross_validate_layout_with_c() { let mut c_layouts = Vec::new(); for l in get_c_output("layout").unwrap().lines() { let (name, value) = l.split_once(';').expect("Missing first ';' separator"); let (size, alignment) = value.split_once(';').expect("Missing second ';' separator"); let size = size.parse().expect("Failed to parse size"); let alignment = alignment.parse().expect("Failed to parse alignment"); c_layouts.push((name.to_owned(), Layout { size, alignment })); } let mut results = Results::default(); for ((rust_name, rust_layout), (c_name, c_layout)) in RUST_LAYOUTS.iter().zip(c_layouts.iter()) { if rust_name != c_name { results.record_failed(); eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}"); continue; } if rust_layout != c_layout { results.record_failed(); eprintln!( "Layout mismatch for {rust_name}\nRust: {rust_layout:?}\nC: {c_layout:?}", ); continue; } results.record_passed(); } results.expect_total_success(); } fn get_c_output(name: &str) -> Result> { let tmpdir = Builder::new().prefix("abi").tempdir()?; let exe = tmpdir.path().join(name); let c_file = Path::new("tests").join(name).with_extension("c"); let cc = Compiler::new().expect("configured compiler"); cc.compile(&c_file, &exe)?; let mut cmd = Command::new(exe); cmd.stderr(Stdio::inherit()); let out = cmd.output()?; if !out.status.success() { let (status, stdout) = (out.status, String::from_utf8_lossy(&out.stdout)); return Err(format!("command {cmd:?} failed, {status:?}\nstdout: {stdout}").into()); } Ok(String::from_utf8(out.stdout)?) } const RUST_LAYOUTS: &[(&str, Layout)] = &[ ("GtkLayerShellEdge", Layout {size: size_of::(), alignment: align_of::()}), ("GtkLayerShellKeyboardMode", Layout {size: size_of::(), alignment: align_of::()}), ("GtkLayerShellLayer", Layout {size: size_of::(), alignment: align_of::()}), ]; const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) GTK_LAYER_SHELL_EDGE_BOTTOM", "3"), ("(gint) GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER", "4"), ("(gint) GTK_LAYER_SHELL_EDGE_LEFT", "0"), ("(gint) GTK_LAYER_SHELL_EDGE_RIGHT", "1"), ("(gint) GTK_LAYER_SHELL_EDGE_TOP", "2"), ("(gint) GTK_LAYER_SHELL_KEYBOARD_MODE_ENTRY_NUMBER", "3"), ("(gint) GTK_LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE", "1"), ("(gint) GTK_LAYER_SHELL_KEYBOARD_MODE_NONE", "0"), ("(gint) GTK_LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND", "2"), ("(gint) GTK_LAYER_SHELL_LAYER_BACKGROUND", "0"), ("(gint) GTK_LAYER_SHELL_LAYER_BOTTOM", "1"), ("(gint) GTK_LAYER_SHELL_LAYER_ENTRY_NUMBER", "4"), ("(gint) GTK_LAYER_SHELL_LAYER_OVERLAY", "3"), ("(gint) GTK_LAYER_SHELL_LAYER_TOP", "2"), ]; gtk4-layer-shell-sys-0.4.0/tests/constant.c000064400000000000000000000034561046102023000167000ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from .. // from ../gir-files // DO NOT EDIT #include "manual.h" #include #define PRINT_CONSTANT(CONSTANT_NAME) \ printf("%s;", #CONSTANT_NAME); \ printf(_Generic((CONSTANT_NAME), \ char *: "%s", \ const char *: "%s", \ char: "%c", \ signed char: "%hhd", \ unsigned char: "%hhu", \ short int: "%hd", \ unsigned short int: "%hu", \ int: "%d", \ unsigned int: "%u", \ long: "%ld", \ unsigned long: "%lu", \ long long: "%lld", \ unsigned long long: "%llu", \ float: "%f", \ double: "%f", \ long double: "%ld"), \ CONSTANT_NAME); \ printf("\n"); int main() { PRINT_CONSTANT((gint) GTK_LAYER_SHELL_EDGE_BOTTOM); PRINT_CONSTANT((gint) GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER); PRINT_CONSTANT((gint) GTK_LAYER_SHELL_EDGE_LEFT); PRINT_CONSTANT((gint) GTK_LAYER_SHELL_EDGE_RIGHT); PRINT_CONSTANT((gint) GTK_LAYER_SHELL_EDGE_TOP); PRINT_CONSTANT((gint) GTK_LAYER_SHELL_KEYBOARD_MODE_ENTRY_NUMBER); PRINT_CONSTANT((gint) GTK_LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE); PRINT_CONSTANT((gint) GTK_LAYER_SHELL_KEYBOARD_MODE_NONE); PRINT_CONSTANT((gint) GTK_LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND); PRINT_CONSTANT((gint) GTK_LAYER_SHELL_LAYER_BACKGROUND); PRINT_CONSTANT((gint) GTK_LAYER_SHELL_LAYER_BOTTOM); PRINT_CONSTANT((gint) GTK_LAYER_SHELL_LAYER_ENTRY_NUMBER); PRINT_CONSTANT((gint) GTK_LAYER_SHELL_LAYER_OVERLAY); PRINT_CONSTANT((gint) GTK_LAYER_SHELL_LAYER_TOP); return 0; } gtk4-layer-shell-sys-0.4.0/tests/layout.c000064400000000000000000000010401046102023000163470ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from .. // from ../gir-files // DO NOT EDIT #include "manual.h" #include #include int main() { printf("%s;%zu;%zu\n", "GtkLayerShellEdge", sizeof(GtkLayerShellEdge), alignof(GtkLayerShellEdge)); printf("%s;%zu;%zu\n", "GtkLayerShellKeyboardMode", sizeof(GtkLayerShellKeyboardMode), alignof(GtkLayerShellKeyboardMode)); printf("%s;%zu;%zu\n", "GtkLayerShellLayer", sizeof(GtkLayerShellLayer), alignof(GtkLayerShellLayer)); return 0; } gtk4-layer-shell-sys-0.4.0/tests/manual.h000064400000000000000000000001701046102023000163170ustar 00000000000000// Feel free to edit this file, it won't be regenerated by gir generator unless removed. #include