libphosh-0.0.6/.cargo_vcs_info.json0000644000000001460000000000100126500ustar { "git": { "sha1": "9d0df197f1f0cce5435b38af14cff9b6f1f37b60" }, "path_in_vcs": "libphosh" }libphosh-0.0.6/Cargo.lock0000644000000443140000000000100106300ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 4 [[package]] name = "atk" version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "241b621213072e993be4f6f3a9e4b45f65b7e6faad43001be957184b7bb1824b" dependencies = [ "atk-sys", "glib", "libc", ] [[package]] name = "atk-sys" version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5e48b684b0ca77d2bbadeef17424c2ea3c897d44d566a1617e7e8f30614d086" dependencies = [ "glib-sys", "gobject-sys", "libc", "system-deps", ] [[package]] name = "autocfg" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "bitflags" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "cairo-rs" version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" dependencies = [ "bitflags", "cairo-sys-rs", "glib", "libc", "once_cell", "thiserror", ] [[package]] name = "cairo-sys-rs" version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" dependencies = [ "glib-sys", "libc", "system-deps", ] [[package]] name = "cfg-expr" version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" dependencies = [ "smallvec", "target-lexicon", ] [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "field-offset" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" dependencies = [ "memoffset", "rustc_version", ] [[package]] name = "futures-channel" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", ] [[package]] name = "futures-core" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", "futures-util", ] [[package]] name = "futures-io" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", "syn 2.0.61", ] [[package]] name = "futures-task" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-core", "futures-macro", "futures-task", "pin-project-lite", "pin-utils", "slab", ] [[package]] name = "gdk" version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9f245958c627ac99d8e529166f9823fb3b838d1d41fd2b297af3075093c2691" dependencies = [ "cairo-rs", "gdk-pixbuf", "gdk-sys", "gio", "glib", "libc", "pango", ] [[package]] name = "gdk-pixbuf" version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" dependencies = [ "gdk-pixbuf-sys", "gio", "glib", "libc", "once_cell", ] [[package]] name = "gdk-pixbuf-sys" version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" dependencies = [ "gio-sys", "glib-sys", "gobject-sys", "libc", "system-deps", ] [[package]] name = "gdk-sys" version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c2d13f38594ac1e66619e188c6d5a1adb98d11b2fcf7894fc416ad76aa2f3f7" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", "gio-sys", "glib-sys", "gobject-sys", "libc", "pango-sys", "pkg-config", "system-deps", ] [[package]] name = "gio" version = "0.18.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" dependencies = [ "futures-channel", "futures-core", "futures-io", "futures-util", "gio-sys", "glib", "libc", "once_cell", "pin-project-lite", "smallvec", "thiserror", ] [[package]] name = "gio-sys" version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" dependencies = [ "glib-sys", "gobject-sys", "libc", "system-deps", "winapi", ] [[package]] name = "glib" version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" dependencies = [ "bitflags", "futures-channel", "futures-core", "futures-executor", "futures-task", "futures-util", "gio-sys", "glib-macros", "glib-sys", "gobject-sys", "libc", "memchr", "once_cell", "smallvec", "thiserror", ] [[package]] name = "glib-macros" version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" dependencies = [ "heck 0.4.1", "proc-macro-crate 2.0.2", "proc-macro-error", "proc-macro2", "quote", "syn 2.0.61", ] [[package]] name = "glib-sys" version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" dependencies = [ "libc", "system-deps", ] [[package]] name = "gobject-sys" version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" dependencies = [ "glib-sys", "libc", "system-deps", ] [[package]] name = "gtk" version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd56fb197bfc42bd5d2751f4f017d44ff59fbb58140c6b49f9b3b2bdab08506a" dependencies = [ "atk", "cairo-rs", "field-offset", "futures-channel", "gdk", "gdk-pixbuf", "gio", "glib", "gtk-sys", "gtk3-macros", "libc", "pango", "pkg-config", ] [[package]] name = "gtk-sys" version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f29a1c21c59553eb7dd40e918be54dccd60c52b049b75119d5d96ce6b624414" dependencies = [ "atk-sys", "cairo-sys-rs", "gdk-pixbuf-sys", "gdk-sys", "gio-sys", "glib-sys", "gobject-sys", "libc", "pango-sys", "system-deps", ] [[package]] name = "gtk3-macros" version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52ff3c5b21f14f0736fed6dcfc0bfb4225ebf5725f3c0209edeec181e4d73e9d" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro-error", "proc-macro2", "quote", "syn 2.0.61", ] [[package]] name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "indexmap" version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown", ] [[package]] name = "libc" version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] name = "libhandy-sys" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d814ea1e409715aef1dd9885994cb6801f52129ba2898bfe74591b9547b998ad" dependencies = [ "gdk-pixbuf-sys", "gdk-sys", "gio-sys", "glib-sys", "gobject-sys", "gtk-sys", "libc", "pango-sys", "pkg-config", "system-deps", ] [[package]] name = "libphosh" version = "0.0.6" dependencies = [ "gdk", "gio", "glib", "gtk", "libc", "libphosh-sys", ] [[package]] name = "libphosh-sys" version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38c25c00ea3180e94245ce3550ab29cee352ae767f740ef57ed7f954bec9288e" dependencies = [ "gdk-pixbuf-sys", "gdk-sys", "gio-sys", "glib-sys", "gobject-sys", "gtk-sys", "libc", "libhandy-sys", "pango-sys", "system-deps", ] [[package]] name = "memchr" version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memoffset" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] [[package]] name = "once_cell" version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "pango" version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" dependencies = [ "gio", "glib", "libc", "once_cell", "pango-sys", ] [[package]] name = "pango-sys" version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" dependencies = [ "glib-sys", "gobject-sys", "libc", "system-deps", ] [[package]] name = "pin-project-lite" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "proc-macro-crate" version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", "toml_edit 0.19.15", ] [[package]] name = "proc-macro-crate" version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" dependencies = [ "toml_datetime", "toml_edit 0.20.2", ] [[package]] name = "proc-macro-error" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", "syn 1.0.109", "version_check", ] [[package]] name = "proc-macro-error-attr" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2", "quote", "version_check", ] [[package]] name = "proc-macro2" version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" dependencies = [ "unicode-ident", ] [[package]] name = "quote" version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ "semver", ] [[package]] name = "semver" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" dependencies = [ "proc-macro2", "quote", "syn 2.0.61", ] [[package]] name = "serde_spanned" version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] [[package]] name = "slab" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "syn" version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "unicode-ident", ] [[package]] name = "syn" version = "2.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "system-deps" version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" dependencies = [ "cfg-expr", "heck 0.5.0", "pkg-config", "toml", "version-compare", ] [[package]] name = "target-lexicon" version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "thiserror" version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" dependencies = [ "proc-macro2", "quote", "syn 2.0.61", ] [[package]] name = "toml" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" dependencies = [ "serde", "serde_spanned", "toml_datetime", "toml_edit 0.20.2", ] [[package]] name = "toml_datetime" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ "serde", ] [[package]] name = "toml_edit" version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap", "toml_datetime", "winnow", ] [[package]] name = "toml_edit" version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", "winnow", ] [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "version-compare" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[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 = "winnow" version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] libphosh-0.0.6/Cargo.toml0000644000000036500000000000100106510ustar # 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" name = "libphosh" version = "0.0.6" authors = ["Guido Günther "] build = false autolib = false autobins = false autoexamples = false autotests = false autobenches = false description = "Rust bindings for libphosh" homepage = "https://gitlab.gnome.org/guidog/libphosh-rs" readme = "README.md" keywords = [ "phosh", "gnome", ] categories = ["api-bindings"] license = "MIT" repository = "https://gitlab.gnome.org/guidog/libphosh-rs.git" [package.metadata.docs.rs] all-features = true rustc-args = [ "--cfg", "docsrs", ] rustdoc-args = [ "--cfg", "docsrs", ] [lib] name = "libphosh" path = "src/lib.rs" [[example]] name = "custom-shell-and-lockscreen" path = "examples/custom-shell-and-lockscreen.rs" [[example]] name = "hello-world" path = "examples/hello-world.rs" [dependencies.ffi] version = "0.0.6" package = "libphosh-sys" [dependencies.gdk] version = "0.18" [dependencies.gio] version = "0.18" features = ["v2_70"] [dependencies.glib] version = "0.18" features = ["v2_66"] [dependencies.gtk] version = "0.18" features = ["v3_24"] [dependencies.libc] version = "0.2" [features] default = ["gtk_v3_20"] gtk_v2_10 = ["gtk_v2_6"] gtk_v2_12 = ["gtk_v2_10"] gtk_v2_18 = ["gtk_v2_12"] gtk_v2_20 = ["gtk_v2_18"] gtk_v2_4 = [] gtk_v2_6 = ["gtk_v2_4"] gtk_v3 = ["gtk_v2_20"] gtk_v3_12 = ["gtk_v3_8"] gtk_v3_14 = ["gtk_v3_12"] gtk_v3_20 = ["gtk_v3_14"] gtk_v3_4 = ["gtk_v3"] gtk_v3_8 = ["gtk_v3_4"] v3_12 = [] v3_14 = [] libphosh-0.0.6/Cargo.toml.orig000064400000000000000000000022361046102023000143310ustar 00000000000000[package] name = "libphosh" version = "0.0.6" authors = ["Guido Günther "] edition = "2021" readme = "../README.md" homepage = "https://gitlab.gnome.org/guidog/libphosh-rs" description = "Rust bindings for libphosh" license = "MIT" repository = "https://gitlab.gnome.org/guidog/libphosh-rs.git" categories = ["api-bindings"] keywords = ["phosh", "gnome"] [lib] name = "libphosh" [features] default = ["gtk_v3_20"] gtk_v2_4 = [] gtk_v2_6 = ["gtk_v2_4"] gtk_v2_10 = ["gtk_v2_6"] gtk_v2_12 = ["gtk_v2_10"] gtk_v2_18 = ["gtk_v2_12"] gtk_v2_20 = ["gtk_v2_18"] gtk_v3 = ["gtk_v2_20"] gtk_v3_4 = ["gtk_v3"] gtk_v3_8 = ["gtk_v3_4"] gtk_v3_12 = ["gtk_v3_8"] gtk_v3_14 = ["gtk_v3_12"] gtk_v3_20 = ["gtk_v3_14"] v3_12 = [] v3_14 = [] [package.metadata.docs.rs] all-features = true rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs"] [dependencies] libc = '0.2' [dependencies.gdk] version = "0.18" [dependencies.gio] version = "0.18" features = [ "v2_70" ] [dependencies.glib] version = "0.18" features = [ "v2_66" ] [dependencies.gtk] version = "0.18" features = ["v3_24"] [dependencies.ffi] package = "libphosh-sys" path = './sys' version = "0.0.6" libphosh-0.0.6/Gir.toml000064400000000000000000000020271046102023000130560ustar 00000000000000[external_libraries] Gio = {min_version = "2.66"} [options] girs_directories = ["../gir-files", "../"] library = "Phosh" version = "0" min_cfg_version = "1" target_path = "." use_gi_docgen = true work_mode = "normal" generate_safety_asserts = true deprecate_by_min_version = true # with this option enabled, versions for gir and gir-files saved only to one file to minimize noise single_version_file = true generate_builder = true trust_return_value_nullability = true external_libraries = [ "Gdk", "Gio", "GLib", "GObject", ] generate = [ "Phosh.Lockscreen", "Phosh.LockscreenManager", "Phosh.LockscreenPage", "Phosh.QuickSetting", "Phosh.ScreenshotManager", "Phosh.Shell", "Phosh.StatusIcon", "Phosh.StatusPage", "Phosh.WallClock", ] manual = [ "Gdk.Rectangle", "Gio.AsyncReadyCallback", "Gio.AsyncResult", "Gio.Cancellable", "GLib.Error", "Gtk.Bin", "Gtk.Button", "Gtk.Container", "Gtk.Widget", "Gtk.Window", ] ignore = [ "Phosh.DBusScreenshotProxy", "Phosh.DBusScreenshotSkeleton", ] libphosh-0.0.6/LICENSE000064400000000000000000000020651046102023000124470ustar 00000000000000MIT License Copyright (c) 2024 The Phosh Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. libphosh-0.0.6/README.md000064400000000000000000000027731046102023000127270ustar 00000000000000# libphosh-rs The Rust bindings of [phosh][phosh] ## Development You will need the following installed: * Rust * `xmlstarlet` * Meson * All [Phosh][phosh-deps] build dependencies ### Updating the introspection XML If the upstream libphosh introspection `Phosh-0.gir` XML has changed, then run the following: ``` make Phosh-0.gir ``` The `main` branch of [Phosh][phosh] will be fetched as a Meson subproject, the introspection XML will be regenerated, and the result will be copied to `./Phosh-0.gir`. You should commit the changes to this repo. ### Updating the bindings If you've updated the introspection XML, or made changes to the `Gir.toml` files, then run: ``` make ``` Note that you should *not* commit the changes that were made to `NM-1.0.gir` or `Phosh-0.gir`. ### Examples There's two examples demoing the libphosh-rs usage: - [hello-world.rs](./libphosh/examples/hello-world.rs) has the minimum code to spawn a shell and can be run like ```sh WLR_BACKENDS=wayland phoc -E target/debug/examples/hello-world ``` - [custom-shell-and-lockscreen.rs](./libphosh/examples/custom-shell-and-lockscreen.rs) shows how to override the shell and lockscreen classes and can be run like ```sh WLR_BACKENDS=wayland phoc -E target/debug/examples/custom-shell-and-lockscreen ``` ### Documentation API documentation is at [phosh]: https://gitlab.gnome.org/World/Phosh/phosh [phosh-deps]: https://gitlab.gnome.org/World/Phosh/phosh#dependencies libphosh-0.0.6/examples/custom-shell-and-lockscreen.rs000064400000000000000000000070701046102023000211340ustar 00000000000000use gtk; use libphosh as phosh; use libphosh::prelude::*; fn main() { gtk::init().unwrap(); let clock = phosh::WallClock::new(); clock.set_default(); let shell = custom_shell::CustomShell::new(); shell.set_default(); shell.set_locked(true); shell.connect_ready(|_| { glib::g_message!("example", "Custom Rusty shell ready"); }); gtk::main(); } mod custom_shell { use glib::Object; use gtk::glib; glib::wrapper! { pub struct CustomShell(ObjectSubclass) @extends libphosh::Shell; } impl CustomShell { pub fn new() -> Self { Object::builder().build() } } impl Default for CustomShell { fn default() -> Self { Self::new() } } mod imp { use gtk::glib; use gtk::glib::Type; use gtk::prelude::StaticType; use gtk::subclass::prelude::{ObjectImpl, ObjectSubclass}; use libphosh::subclass::shell::ShellImpl; use crate::custom_lockscreen::CustomLockscreen; #[derive(Default)] pub struct CustomShell; #[glib::object_subclass] impl ObjectSubclass for CustomShell { const NAME: &'static str = "CustomShell"; type Type = super::CustomShell; type ParentType = libphosh::Shell; } impl ObjectImpl for CustomShell {} impl ShellImpl for CustomShell { fn get_lockscreen_type(&self) -> Type { CustomLockscreen::static_type() } } } } mod custom_lockscreen { use glib::Object; glib::wrapper! { pub struct CustomLockscreen(ObjectSubclass) @extends libphosh::Lockscreen; } impl CustomLockscreen { pub fn new() -> Self { Object::builder().build() } } impl Default for CustomLockscreen { fn default() -> Self { Self::new() } } mod imp { use gtk::subclass::prelude::*; use gtk::{glib, Image}; use gtk::prelude::WidgetExt; use libphosh::Lockscreen; use libphosh::prelude::LockscreenExt; use libphosh::subclass::lockscreen::LockscreenImpl; #[derive(Default)] pub struct CustomLockscreen {} #[glib::object_subclass] impl ObjectSubclass for CustomLockscreen { const NAME: &'static str = "CustomLockscreen"; type Type = super::CustomLockscreen; type ParentType = Lockscreen; } impl ObjectImpl for CustomLockscreen { fn constructed(&self) { self.parent_constructed(); glib::g_message!("example", "Constructed custom Lockscreen"); let hi = Image::builder() .icon_name("face-kiss") .pixel_size(100) .build(); self.obj().add_extra_page(&hi); hi.set_visible(true); self.obj().connect_lockscreen_unlock(|_| { glib::g_message!("example", "Custom Lockscreen was unlocked."); }); self.obj().connect_page_notify(|me| { glib::g_message!("example", "Lockscreen page changed to {:?}", me.page()); }); } } impl WidgetImpl for CustomLockscreen {} impl ContainerImpl for CustomLockscreen {} impl BinImpl for CustomLockscreen {} impl WindowImpl for CustomLockscreen {} impl LockscreenImpl for CustomLockscreen {} } } libphosh-0.0.6/examples/hello-world.rs000064400000000000000000000012201046102023000160460ustar 00000000000000use glib; use gtk; use libphosh as phosh; use libphosh::prelude::*; fn main() { gtk::init().unwrap(); let clock = phosh::WallClock::new(); clock.set_default(); let shell = phosh::Shell::new(); shell.set_default(); shell.connect_ready(move |s| { glib::g_message!("example", "Rusty shell ready"); let screenshot_manager = s.screenshot_manager(); let take_screenshot = glib::clone!(@weak screenshot_manager as sm => move || { sm.take_screenshot(None, Some("hello-world"), false, false); }); glib::timeout_add_seconds_local_once(2, take_screenshot); }); gtk::main(); } libphosh-0.0.6/src/auto/enums.rs000064400000000000000000000056431046102023000147030ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from .. // from ../gir-files // DO NOT EDIT use glib::{prelude::*,translate::*}; #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] #[non_exhaustive] #[doc(alias = "PhoshLockscreenPage")] pub enum LockscreenPage { #[doc(alias = "PHOSH_LOCKSCREEN_PAGE_INFO")] Info, #[doc(alias = "PHOSH_LOCKSCREEN_PAGE_EXTRA")] Extra, #[doc(alias = "PHOSH_LOCKSCREEN_PAGE_UNLOCK")] Unlock, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for LockscreenPage { type GlibType = ffi::PhoshLockscreenPage; #[inline] fn into_glib(self) -> ffi::PhoshLockscreenPage { match self { Self::Info => ffi::PHOSH_LOCKSCREEN_PAGE_INFO, Self::Extra => ffi::PHOSH_LOCKSCREEN_PAGE_EXTRA, Self::Unlock => ffi::PHOSH_LOCKSCREEN_PAGE_UNLOCK, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for LockscreenPage { #[inline] unsafe fn from_glib(value: ffi::PhoshLockscreenPage) -> Self { skip_assert_initialized!(); match value { ffi::PHOSH_LOCKSCREEN_PAGE_INFO => Self::Info, ffi::PHOSH_LOCKSCREEN_PAGE_EXTRA => Self::Extra, ffi::PHOSH_LOCKSCREEN_PAGE_UNLOCK => Self::Unlock, value => Self::__Unknown(value), } } } impl StaticType for LockscreenPage { #[inline] #[doc(alias = "phosh_lockscreen_page_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::phosh_lockscreen_page_get_type()) } } } impl glib::HasParamSpec for LockscreenPage { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for LockscreenPage { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for LockscreenPage { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for LockscreenPage { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: LockscreenPage) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } libphosh-0.0.6/src/auto/lockscreen.rs000064400000000000000000000611721046102023000157030ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from .. // from ../gir-files // DO NOT EDIT use crate::{LockscreenPage}; use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "PhoshLockscreen")] pub struct Lockscreen(Object) @extends gtk::Window, gtk::Bin, gtk::Container, gtk::Widget; match fn { type_ => || ffi::phosh_lockscreen_get_type(), } } impl Lockscreen { pub const NONE: Option<&'static Lockscreen> = None; // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`Lockscreen`] objects. /// /// This method returns an instance of [`LockscreenBuilder`](crate::builders::LockscreenBuilder) which can be used to create [`Lockscreen`] objects. pub fn builder() -> LockscreenBuilder { LockscreenBuilder::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`Lockscreen`] objects. /// /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html #[must_use = "The builder must be built to be used"] pub struct LockscreenBuilder { builder: glib::object::ObjectBuilder<'static, Lockscreen>, } impl LockscreenBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder() } } pub fn require_unlock(self, require_unlock: bool) -> Self { Self { builder: self.builder.property("require-unlock", require_unlock), } } #[cfg(feature = "gtk_v2_4")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_4")))] pub fn accept_focus(self, accept_focus: bool) -> Self { Self { builder: self.builder.property("accept-focus", accept_focus), } } // #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] //pub fn application(self, application: &impl IsA) -> Self { // Self { builder: self.builder.property("application", application.clone().upcast()), } //} #[cfg(feature = "gtk_v3_4")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3_4")))] pub fn attached_to(self, attached_to: &impl IsA) -> Self { Self { builder: self.builder.property("attached-to", attached_to.clone().upcast()), } } #[cfg(feature = "gtk_v2_4")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_4")))] pub fn decorated(self, decorated: bool) -> Self { Self { builder: self.builder.property("decorated", decorated), } } pub fn default_height(self, default_height: i32) -> Self { Self { builder: self.builder.property("default-height", default_height), } } pub fn default_width(self, default_width: i32) -> Self { Self { builder: self.builder.property("default-width", default_width), } } #[cfg(feature = "gtk_v2_10")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_10")))] pub fn deletable(self, deletable: bool) -> Self { Self { builder: self.builder.property("deletable", deletable), } } pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self { Self { builder: self.builder.property("destroy-with-parent", destroy_with_parent), } } #[cfg(feature = "gtk_v2_6")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_6")))] pub fn focus_on_map(self, focus_on_map: bool) -> Self { Self { builder: self.builder.property("focus-on-map", focus_on_map), } } #[cfg(feature = "gtk_v2_20")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_20")))] pub fn focus_visible(self, focus_visible: bool) -> Self { Self { builder: self.builder.property("focus-visible", focus_visible), } } // #[cfg(feature = "gtk_v2_4")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_4")))] //pub fn gravity(self, gravity: /*Ignored*/gdk::Gravity) -> Self { // Self { builder: self.builder.property("gravity", gravity), } //} #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] #[cfg_attr(feature = "v3_14", deprecated = "Since 3.14")] pub fn has_resize_grip(self, has_resize_grip: bool) -> Self { Self { builder: self.builder.property("has-resize-grip", has_resize_grip), } } #[cfg(feature = "gtk_v3_4")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3_4")))] pub fn hide_titlebar_when_maximized(self, hide_titlebar_when_maximized: bool) -> Self { Self { builder: self.builder.property("hide-titlebar-when-maximized", hide_titlebar_when_maximized), } } //pub fn icon(self, icon: /*Ignored*/&gdk_pixbuf::Pixbuf) -> Self { // Self { builder: self.builder.property("icon", icon), } //} #[cfg(feature = "gtk_v2_6")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_6")))] pub fn icon_name(self, icon_name: impl Into) -> Self { Self { builder: self.builder.property("icon-name", icon_name.into()), } } #[cfg(feature = "gtk_v2_20")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_20")))] pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self { Self { builder: self.builder.property("mnemonics-visible", mnemonics_visible), } } pub fn modal(self, modal: bool) -> Self { Self { builder: self.builder.property("modal", modal), } } pub fn resizable(self, resizable: bool) -> Self { Self { builder: self.builder.property("resizable", resizable), } } pub fn role(self, role: impl Into) -> Self { Self { builder: self.builder.property("role", role.into()), } } //pub fn screen(self, screen: /*Ignored*/&gdk::Screen) -> Self { // Self { builder: self.builder.property("screen", screen), } //} pub fn skip_pager_hint(self, skip_pager_hint: bool) -> Self { Self { builder: self.builder.property("skip-pager-hint", skip_pager_hint), } } pub fn skip_taskbar_hint(self, skip_taskbar_hint: bool) -> Self { Self { builder: self.builder.property("skip-taskbar-hint", skip_taskbar_hint), } } #[cfg(feature = "gtk_v2_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_12")))] pub fn startup_id(self, startup_id: impl Into) -> Self { Self { builder: self.builder.property("startup-id", startup_id.into()), } } pub fn title(self, title: impl Into) -> Self { Self { builder: self.builder.property("title", title.into()), } } #[cfg(feature = "gtk_v2_10")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_10")))] pub fn transient_for(self, transient_for: &impl IsA) -> Self { Self { builder: self.builder.property("transient-for", transient_for.clone().upcast()), } } //pub fn type_(self, type_: /*Ignored*/gtk::WindowType) -> Self { // Self { builder: self.builder.property("type", type_), } //} //pub fn type_hint(self, type_hint: /*Ignored*/gdk::WindowTypeHint) -> Self { // Self { builder: self.builder.property("type-hint", type_hint), } //} pub fn urgency_hint(self, urgency_hint: bool) -> Self { Self { builder: self.builder.property("urgency-hint", urgency_hint), } } //pub fn window_position(self, window_position: /*Ignored*/gtk::WindowPosition) -> Self { // Self { builder: self.builder.property("window-position", window_position), } //} pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } //pub fn resize_mode(self, resize_mode: /*Ignored*/gtk::ResizeMode) -> Self { // Self { builder: self.builder.property("resize-mode", resize_mode), } //} pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } #[cfg(feature = "gtk_v2_18")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_18")))] #[cfg_attr(feature = "v3_14", deprecated = "Since 3.14")] pub fn double_buffered(self, double_buffered: bool) -> Self { Self { builder: self.builder.property("double-buffered", double_buffered), } } //pub fn events(self, events: /*Ignored*/gdk::EventMask) -> Self { // Self { builder: self.builder.property("events", events), } //} #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } #[cfg(feature = "gtk_v3_20")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3_20")))] pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } // #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { // Self { builder: self.builder.property("halign", halign), } //} pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } #[cfg(feature = "gtk_v2_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_12")))] pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } #[cfg(feature = "gtk_v3_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3_12")))] pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] #[cfg_attr(feature = "v3_12", deprecated = "Since 3.12")] pub fn margin_left(self, margin_left: i32) -> Self { Self { builder: self.builder.property("margin-left", margin_left), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] #[cfg_attr(feature = "v3_12", deprecated = "Since 3.12")] pub fn margin_right(self, margin_right: i32) -> Self { Self { builder: self.builder.property("margin-right", margin_right), } } #[cfg(feature = "gtk_v3_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3_12")))] pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } #[cfg(feature = "gtk_v3_8")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3_8")))] pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} #[cfg(feature = "gtk_v2_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_12")))] pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } } #[cfg(feature = "gtk_v2_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_12")))] pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } // #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { // Self { builder: self.builder.property("valign", valign), } //} #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`Lockscreen`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Lockscreen { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait LockscreenExt: IsA + sealed::Sealed + 'static { #[doc(alias = "phosh_lockscreen_add_extra_page")] fn add_extra_page(&self, widget: &impl IsA) { unsafe { ffi::phosh_lockscreen_add_extra_page(self.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0); } } #[doc(alias = "phosh_lockscreen_clear_pin_entry")] fn clear_pin_entry(&self) { unsafe { ffi::phosh_lockscreen_clear_pin_entry(self.as_ref().to_glib_none().0); } } #[doc(alias = "phosh_lockscreen_get_page")] #[doc(alias = "get_page")] fn page(&self) -> LockscreenPage { unsafe { from_glib(ffi::phosh_lockscreen_get_page(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_lockscreen_get_pin_entry")] #[doc(alias = "get_pin_entry")] fn pin_entry(&self) -> glib::GString { unsafe { from_glib_none(ffi::phosh_lockscreen_get_pin_entry(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_lockscreen_set_default_page")] fn set_default_page(&self, page: LockscreenPage) { unsafe { ffi::phosh_lockscreen_set_default_page(self.as_ref().to_glib_none().0, page.into_glib()); } } #[doc(alias = "phosh_lockscreen_set_page")] fn set_page(&self, page: LockscreenPage) { unsafe { ffi::phosh_lockscreen_set_page(self.as_ref().to_glib_none().0, page.into_glib()); } } #[doc(alias = "phosh_lockscreen_set_unlock_status")] fn set_unlock_status(&self, status: &str) { unsafe { ffi::phosh_lockscreen_set_unlock_status(self.as_ref().to_glib_none().0, status.to_glib_none().0); } } #[doc(alias = "phosh_lockscreen_shake_pin_entry")] fn shake_pin_entry(&self) { unsafe { ffi::phosh_lockscreen_shake_pin_entry(self.as_ref().to_glib_none().0); } } #[doc(alias = "require-unlock")] fn requires_unlock(&self) -> bool { ObjectExt::property(self.as_ref(), "require-unlock") } #[doc(alias = "require-unlock")] fn set_require_unlock(&self, require_unlock: bool) { ObjectExt::set_property(self.as_ref(),"require-unlock", require_unlock) } #[doc(alias = "lockscreen-unlock")] fn connect_lockscreen_unlock(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn lockscreen_unlock_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshLockscreen, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Lockscreen::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"lockscreen-unlock\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(lockscreen_unlock_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "wakeup-output")] fn connect_wakeup_output(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn wakeup_output_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshLockscreen, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Lockscreen::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"wakeup-output\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(wakeup_output_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "page")] fn connect_page_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_page_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshLockscreen, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Lockscreen::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::page\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_page_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "require-unlock")] fn connect_require_unlock_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_require_unlock_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshLockscreen, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Lockscreen::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::require-unlock\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_require_unlock_trampoline:: as *const ())), Box_::into_raw(f)) } } } impl> LockscreenExt for O {} libphosh-0.0.6/src/auto/lockscreen_manager.rs000064400000000000000000000114761046102023000173770ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from .. // from ../gir-files // DO NOT EDIT use crate::{Lockscreen,LockscreenPage}; use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "PhoshLockscreenManager")] pub struct LockscreenManager(Object); match fn { type_ => || ffi::phosh_lockscreen_manager_get_type(), } } impl LockscreenManager { // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`LockscreenManager`] objects. /// /// This method returns an instance of [`LockscreenManagerBuilder`](crate::builders::LockscreenManagerBuilder) which can be used to create [`LockscreenManager`] objects. pub fn builder() -> LockscreenManagerBuilder { LockscreenManagerBuilder::new() } #[doc(alias = "phosh_lockscreen_manager_get_active_time")] #[doc(alias = "get_active_time")] pub fn active_time(&self) -> i64 { unsafe { ffi::phosh_lockscreen_manager_get_active_time(self.to_glib_none().0) } } #[doc(alias = "phosh_lockscreen_manager_get_locked")] #[doc(alias = "get_locked")] pub fn is_locked(&self) -> bool { unsafe { from_glib(ffi::phosh_lockscreen_manager_get_locked(self.to_glib_none().0)) } } #[doc(alias = "phosh_lockscreen_manager_get_lockscreen")] #[doc(alias = "get_lockscreen")] pub fn lockscreen(&self) -> Option { unsafe { from_glib_none(ffi::phosh_lockscreen_manager_get_lockscreen(self.to_glib_none().0)) } } #[doc(alias = "phosh_lockscreen_manager_get_page")] #[doc(alias = "get_page")] pub fn page(&self) -> LockscreenPage { unsafe { from_glib(ffi::phosh_lockscreen_manager_get_page(self.to_glib_none().0)) } } #[doc(alias = "phosh_lockscreen_manager_set_locked")] pub fn set_locked(&self, state: bool) { unsafe { ffi::phosh_lockscreen_manager_set_locked(self.to_glib_none().0, state.into_glib()); } } #[doc(alias = "phosh_lockscreen_manager_set_page")] pub fn set_page(&self, page: LockscreenPage) -> bool { unsafe { from_glib(ffi::phosh_lockscreen_manager_set_page(self.to_glib_none().0, page.into_glib())) } } #[doc(alias = "wakeup-outputs")] pub fn connect_wakeup_outputs(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn wakeup_outputs_trampoline(this: *mut ffi::PhoshLockscreenManager, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"wakeup-outputs\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(wakeup_outputs_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "locked")] pub fn connect_locked_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_locked_trampoline(this: *mut ffi::PhoshLockscreenManager, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::locked\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_locked_trampoline:: as *const ())), Box_::into_raw(f)) } } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`LockscreenManager`] objects. /// /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html #[must_use = "The builder must be built to be used"] pub struct LockscreenManagerBuilder { builder: glib::object::ObjectBuilder<'static, LockscreenManager>, } impl LockscreenManagerBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder() } } pub fn locked(self, locked: bool) -> Self { Self { builder: self.builder.property("locked", locked), } } // rustdoc-stripper-ignore-next /// Build the [`LockscreenManager`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> LockscreenManager { self.builder.build() } } libphosh-0.0.6/src/auto/mod.rs000064400000000000000000000024031046102023000143220ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from .. // from ../gir-files // DO NOT EDIT mod lockscreen; pub use self::lockscreen::Lockscreen; mod lockscreen_manager; pub use self::lockscreen_manager::LockscreenManager; mod quick_setting; pub use self::quick_setting::QuickSetting; mod screenshot_manager; pub use self::screenshot_manager::ScreenshotManager; mod shell; pub use self::shell::Shell; mod status_icon; pub use self::status_icon::StatusIcon; mod status_page; pub use self::status_page::StatusPage; mod wall_clock; pub use self::wall_clock::WallClock; mod enums; pub use self::enums::LockscreenPage; pub(crate) mod traits { pub use super::lockscreen::LockscreenExt; pub use super::quick_setting::QuickSettingExt; pub use super::shell::ShellExt; pub use super::status_icon::StatusIconExt; pub use super::status_page::StatusPageExt; pub use super::wall_clock::WallClockExt; } pub(crate) mod builders { pub use super::lockscreen::LockscreenBuilder; pub use super::lockscreen_manager::LockscreenManagerBuilder; pub use super::quick_setting::QuickSettingBuilder; pub use super::shell::ShellBuilder; pub use super::status_icon::StatusIconBuilder; pub use super::status_page::StatusPageBuilder; } libphosh-0.0.6/src/auto/quick_setting.rs000064400000000000000000000605471046102023000164310ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from .. // from ../gir-files // DO NOT EDIT use crate::{StatusPage}; use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "PhoshQuickSetting")] pub struct QuickSetting(Object) @extends gtk::Container, gtk::Widget; match fn { type_ => || ffi::phosh_quick_setting_get_type(), } } impl QuickSetting { pub const NONE: Option<&'static QuickSetting> = None; #[doc(alias = "phosh_quick_setting_new")] pub fn new(status_page: &impl IsA) -> QuickSetting { skip_assert_initialized!(); unsafe { gtk::Widget::from_glib_none(ffi::phosh_quick_setting_new(status_page.as_ref().to_glib_none().0)).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`QuickSetting`] objects. /// /// This method returns an instance of [`QuickSettingBuilder`](crate::builders::QuickSettingBuilder) which can be used to create [`QuickSetting`] objects. pub fn builder() -> QuickSettingBuilder { QuickSettingBuilder::new() } } impl Default for QuickSetting { fn default() -> Self { glib::object::Object::new::() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`QuickSetting`] objects. /// /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html #[must_use = "The builder must be built to be used"] pub struct QuickSettingBuilder { builder: glib::object::ObjectBuilder<'static, QuickSetting>, } impl QuickSettingBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder() } } pub fn active(self, active: bool) -> Self { Self { builder: self.builder.property("active", active), } } pub fn can_show_status(self, can_show_status: bool) -> Self { Self { builder: self.builder.property("can-show-status", can_show_status), } } pub fn long_press_action_name(self, long_press_action_name: impl Into) -> Self { Self { builder: self.builder.property("long-press-action-name", long_press_action_name.into()), } } pub fn long_press_action_target(self, long_press_action_target: impl Into) -> Self { Self { builder: self.builder.property("long-press-action-target", long_press_action_target.into()), } } pub fn showing_status(self, showing_status: bool) -> Self { Self { builder: self.builder.property("showing-status", showing_status), } } pub fn status_page(self, status_page: &impl IsA) -> Self { Self { builder: self.builder.property("status-page", status_page.clone().upcast()), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } //pub fn resize_mode(self, resize_mode: /*Ignored*/gtk::ResizeMode) -> Self { // Self { builder: self.builder.property("resize-mode", resize_mode), } //} pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } #[cfg(feature = "gtk_v2_18")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_18")))] #[cfg_attr(feature = "v3_14", deprecated = "Since 3.14")] pub fn double_buffered(self, double_buffered: bool) -> Self { Self { builder: self.builder.property("double-buffered", double_buffered), } } //pub fn events(self, events: /*Ignored*/gdk::EventMask) -> Self { // Self { builder: self.builder.property("events", events), } //} #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } #[cfg(feature = "gtk_v3_20")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3_20")))] pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } // #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { // Self { builder: self.builder.property("halign", halign), } //} pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } #[cfg(feature = "gtk_v2_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_12")))] pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } #[cfg(feature = "gtk_v3_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3_12")))] pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] #[cfg_attr(feature = "v3_12", deprecated = "Since 3.12")] pub fn margin_left(self, margin_left: i32) -> Self { Self { builder: self.builder.property("margin-left", margin_left), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] #[cfg_attr(feature = "v3_12", deprecated = "Since 3.12")] pub fn margin_right(self, margin_right: i32) -> Self { Self { builder: self.builder.property("margin-right", margin_right), } } #[cfg(feature = "gtk_v3_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3_12")))] pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } #[cfg(feature = "gtk_v3_8")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3_8")))] pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} #[cfg(feature = "gtk_v2_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_12")))] pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } } #[cfg(feature = "gtk_v2_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_12")))] pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } // #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { // Self { builder: self.builder.property("valign", valign), } //} #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`QuickSetting`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> QuickSetting { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait QuickSettingExt: IsA + sealed::Sealed + 'static { #[doc(alias = "phosh_quick_setting_get_active")] #[doc(alias = "get_active")] fn is_active(&self) -> bool { unsafe { from_glib(ffi::phosh_quick_setting_get_active(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_quick_setting_get_can_show_status")] #[doc(alias = "get_can_show_status")] fn can_show_status(&self) -> bool { unsafe { from_glib(ffi::phosh_quick_setting_get_can_show_status(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_quick_setting_get_long_press_action_name")] #[doc(alias = "get_long_press_action_name")] fn long_press_action_name(&self) -> glib::GString { unsafe { from_glib_none(ffi::phosh_quick_setting_get_long_press_action_name(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_quick_setting_get_long_press_action_target")] #[doc(alias = "get_long_press_action_target")] fn long_press_action_target(&self) -> glib::GString { unsafe { from_glib_none(ffi::phosh_quick_setting_get_long_press_action_target(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_quick_setting_get_showing_status")] #[doc(alias = "get_showing_status")] fn is_showing_status(&self) -> bool { unsafe { from_glib(ffi::phosh_quick_setting_get_showing_status(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_quick_setting_get_status_page")] #[doc(alias = "get_status_page")] fn status_page(&self) -> StatusPage { unsafe { from_glib_none(ffi::phosh_quick_setting_get_status_page(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_quick_setting_set_active")] fn set_active(&self, active: bool) { unsafe { ffi::phosh_quick_setting_set_active(self.as_ref().to_glib_none().0, active.into_glib()); } } #[doc(alias = "phosh_quick_setting_set_can_show_status")] fn set_can_show_status(&self, can_show_status: bool) { unsafe { ffi::phosh_quick_setting_set_can_show_status(self.as_ref().to_glib_none().0, can_show_status.into_glib()); } } #[doc(alias = "phosh_quick_setting_set_long_press_action_name")] fn set_long_press_action_name(&self, action_name: &str) { unsafe { ffi::phosh_quick_setting_set_long_press_action_name(self.as_ref().to_glib_none().0, action_name.to_glib_none().0); } } #[doc(alias = "phosh_quick_setting_set_long_press_action_target")] fn set_long_press_action_target(&self, action_target: &str) { unsafe { ffi::phosh_quick_setting_set_long_press_action_target(self.as_ref().to_glib_none().0, action_target.to_glib_none().0); } } #[doc(alias = "phosh_quick_setting_set_showing_status")] fn set_showing_status(&self, showing_status: bool) { unsafe { ffi::phosh_quick_setting_set_showing_status(self.as_ref().to_glib_none().0, showing_status.into_glib()); } } #[doc(alias = "phosh_quick_setting_set_status_page")] fn set_status_page(&self, status_page: &impl IsA) { unsafe { ffi::phosh_quick_setting_set_status_page(self.as_ref().to_glib_none().0, status_page.as_ref().to_glib_none().0); } } #[doc(alias = "clicked")] fn connect_clicked(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn clicked_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshQuickSetting, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(QuickSetting::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"clicked\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(clicked_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "hide-status")] fn connect_hide_status(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn hide_status_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshQuickSetting, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(QuickSetting::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"hide-status\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(hide_status_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "long-pressed")] fn connect_long_pressed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn long_pressed_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshQuickSetting, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(QuickSetting::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"long-pressed\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(long_pressed_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "show-status")] fn connect_show_status(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn show_status_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshQuickSetting, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(QuickSetting::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"show-status\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(show_status_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "active")] fn connect_active_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_active_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshQuickSetting, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(QuickSetting::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::active\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_active_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "can-show-status")] fn connect_can_show_status_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_can_show_status_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshQuickSetting, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(QuickSetting::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::can-show-status\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_can_show_status_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "long-press-action-name")] fn connect_long_press_action_name_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_long_press_action_name_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshQuickSetting, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(QuickSetting::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::long-press-action-name\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_long_press_action_name_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "long-press-action-target")] fn connect_long_press_action_target_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_long_press_action_target_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshQuickSetting, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(QuickSetting::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::long-press-action-target\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_long_press_action_target_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "showing-status")] fn connect_showing_status_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_showing_status_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshQuickSetting, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(QuickSetting::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::showing-status\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_showing_status_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "status-page")] fn connect_status_page_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_status_page_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshQuickSetting, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(QuickSetting::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::status-page\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_status_page_trampoline:: as *const ())), Box_::into_raw(f)) } } } impl> QuickSettingExt for O {} libphosh-0.0.6/src/auto/screenshot_manager.rs000064400000000000000000000023521046102023000174150ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from .. // from ../gir-files // DO NOT EDIT use glib::{translate::*}; glib::wrapper! { #[doc(alias = "PhoshScreenshotManager")] pub struct ScreenshotManager(Object); match fn { type_ => || ffi::phosh_screenshot_manager_get_type(), } } impl ScreenshotManager { #[doc(alias = "phosh_screenshot_manager_new")] pub fn new() -> ScreenshotManager { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::phosh_screenshot_manager_new()) } } #[doc(alias = "phosh_screenshot_manager_take_screenshot")] pub fn take_screenshot(&self, area: Option<&gdk::Rectangle>, filename: Option<&str>, copy_to_clipboard: bool, include_cursor: bool) -> bool { unsafe { from_glib(ffi::phosh_screenshot_manager_take_screenshot(self.to_glib_none().0, area.to_glib_none().0, filename.to_glib_none().0, copy_to_clipboard.into_glib(), include_cursor.into_glib())) } } } impl Default for ScreenshotManager { fn default() -> Self { Self::new() } } libphosh-0.0.6/src/auto/shell.rs000064400000000000000000000210571046102023000146600ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from .. // from ../gir-files // DO NOT EDIT use crate::{LockscreenManager,ScreenshotManager}; use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "PhoshShell")] pub struct Shell(Object); match fn { type_ => || ffi::phosh_shell_get_type(), } } impl Shell { pub const NONE: Option<&'static Shell> = None; #[doc(alias = "phosh_shell_new")] pub fn new() -> Shell { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::phosh_shell_new()) } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`Shell`] objects. /// /// This method returns an instance of [`ShellBuilder`](crate::builders::ShellBuilder) which can be used to create [`Shell`] objects. pub fn builder() -> ShellBuilder { ShellBuilder::new() } #[doc(alias = "phosh_shell_get_default")] #[doc(alias = "get_default")] #[allow(clippy::should_implement_trait)] pub fn default() -> Shell { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::phosh_shell_get_default()) } } } impl Default for Shell { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`Shell`] objects. /// /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html #[must_use = "The builder must be built to be used"] pub struct ShellBuilder { builder: glib::object::ObjectBuilder<'static, Shell>, } impl ShellBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder() } } pub fn docked(self, docked: bool) -> Self { Self { builder: self.builder.property("docked", docked), } } pub fn locked(self, locked: bool) -> Self { Self { builder: self.builder.property("locked", locked), } } pub fn overview_visible(self, overview_visible: bool) -> Self { Self { builder: self.builder.property("overview-visible", overview_visible), } } // rustdoc-stripper-ignore-next /// Build the [`Shell`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Shell { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait ShellExt: IsA + sealed::Sealed + 'static { #[doc(alias = "phosh_shell_fade_out")] fn fade_out(&self, timeout: u32) { unsafe { ffi::phosh_shell_fade_out(self.as_ref().to_glib_none().0, timeout); } } #[doc(alias = "phosh_shell_get_locked")] #[doc(alias = "get_locked")] fn is_locked(&self) -> bool { unsafe { from_glib(ffi::phosh_shell_get_locked(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_shell_get_lockscreen_manager")] #[doc(alias = "get_lockscreen_manager")] fn lockscreen_manager(&self) -> LockscreenManager { unsafe { from_glib_none(ffi::phosh_shell_get_lockscreen_manager(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_shell_get_lockscreen_type")] #[doc(alias = "get_lockscreen_type")] fn lockscreen_type(&self) -> glib::types::Type { unsafe { from_glib(ffi::phosh_shell_get_lockscreen_type(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_shell_get_screenshot_manager")] #[doc(alias = "get_screenshot_manager")] fn screenshot_manager(&self) -> ScreenshotManager { unsafe { from_glib_none(ffi::phosh_shell_get_screenshot_manager(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_shell_get_usable_area")] #[doc(alias = "get_usable_area")] fn usable_area(&self) -> (i32, i32, i32, i32) { unsafe { let mut x = std::mem::MaybeUninit::uninit(); let mut y = std::mem::MaybeUninit::uninit(); let mut width = std::mem::MaybeUninit::uninit(); let mut height = std::mem::MaybeUninit::uninit(); ffi::phosh_shell_get_usable_area(self.as_ref().to_glib_none().0, x.as_mut_ptr(), y.as_mut_ptr(), width.as_mut_ptr(), height.as_mut_ptr()); (x.assume_init(), y.assume_init(), width.assume_init(), height.assume_init()) } } #[doc(alias = "phosh_shell_set_default")] fn set_default(&self) { unsafe { ffi::phosh_shell_set_default(self.as_ref().to_glib_none().0); } } fn is_docked(&self) -> bool { ObjectExt::property(self.as_ref(), "docked") } fn set_docked(&self, docked: bool) { ObjectExt::set_property(self.as_ref(),"docked", docked) } fn set_locked(&self, locked: bool) { ObjectExt::set_property(self.as_ref(),"locked", locked) } #[doc(alias = "overview-visible")] fn is_overview_visible(&self) -> bool { ObjectExt::property(self.as_ref(), "overview-visible") } #[doc(alias = "overview-visible")] fn set_overview_visible(&self, overview_visible: bool) { ObjectExt::set_property(self.as_ref(),"overview-visible", overview_visible) } #[doc(alias = "ready")] fn connect_ready(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn ready_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshShell, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Shell::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"ready\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(ready_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "docked")] fn connect_docked_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_docked_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshShell, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Shell::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::docked\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_docked_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "locked")] fn connect_locked_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_locked_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshShell, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Shell::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::locked\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_locked_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "overview-visible")] fn connect_overview_visible_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_overview_visible_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshShell, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Shell::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::overview-visible\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_overview_visible_trampoline:: as *const ())), Box_::into_raw(f)) } } } impl> ShellExt for O {} libphosh-0.0.6/src/auto/status_icon.rs000064400000000000000000000445771046102023000161200ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from .. // from ../gir-files // DO NOT EDIT use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "PhoshStatusIcon")] pub struct StatusIcon(Object) @extends gtk::Bin, gtk::Container, gtk::Widget; match fn { type_ => || ffi::phosh_status_icon_get_type(), } } impl StatusIcon { pub const NONE: Option<&'static StatusIcon> = None; #[doc(alias = "phosh_status_icon_new")] pub fn new() -> StatusIcon { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::phosh_status_icon_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`StatusIcon`] objects. /// /// This method returns an instance of [`StatusIconBuilder`](crate::builders::StatusIconBuilder) which can be used to create [`StatusIcon`] objects. pub fn builder() -> StatusIconBuilder { StatusIconBuilder::new() } } impl Default for StatusIcon { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`StatusIcon`] objects. /// /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html #[must_use = "The builder must be built to be used"] pub struct StatusIconBuilder { builder: glib::object::ObjectBuilder<'static, StatusIcon>, } impl StatusIconBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder() } } pub fn extra_widget(self, extra_widget: &impl IsA) -> Self { Self { builder: self.builder.property("extra-widget", extra_widget.clone().upcast()), } } pub fn icon_name(self, icon_name: impl Into) -> Self { Self { builder: self.builder.property("icon-name", icon_name.into()), } } //pub fn icon_size(self, icon_size: /*Ignored*/gtk::IconSize) -> Self { // Self { builder: self.builder.property("icon-size", icon_size), } //} pub fn info(self, info: impl Into) -> Self { Self { builder: self.builder.property("info", info.into()), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } //pub fn resize_mode(self, resize_mode: /*Ignored*/gtk::ResizeMode) -> Self { // Self { builder: self.builder.property("resize-mode", resize_mode), } //} pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } #[cfg(feature = "gtk_v2_18")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_18")))] #[cfg_attr(feature = "v3_14", deprecated = "Since 3.14")] pub fn double_buffered(self, double_buffered: bool) -> Self { Self { builder: self.builder.property("double-buffered", double_buffered), } } //pub fn events(self, events: /*Ignored*/gdk::EventMask) -> Self { // Self { builder: self.builder.property("events", events), } //} #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } #[cfg(feature = "gtk_v3_20")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3_20")))] pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } // #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { // Self { builder: self.builder.property("halign", halign), } //} pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } #[cfg(feature = "gtk_v2_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_12")))] pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } #[cfg(feature = "gtk_v3_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3_12")))] pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] #[cfg_attr(feature = "v3_12", deprecated = "Since 3.12")] pub fn margin_left(self, margin_left: i32) -> Self { Self { builder: self.builder.property("margin-left", margin_left), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] #[cfg_attr(feature = "v3_12", deprecated = "Since 3.12")] pub fn margin_right(self, margin_right: i32) -> Self { Self { builder: self.builder.property("margin-right", margin_right), } } #[cfg(feature = "gtk_v3_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3_12")))] pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } #[cfg(feature = "gtk_v3_8")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3_8")))] pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} #[cfg(feature = "gtk_v2_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_12")))] pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } } #[cfg(feature = "gtk_v2_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_12")))] pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } // #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { // Self { builder: self.builder.property("valign", valign), } //} #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`StatusIcon`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> StatusIcon { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait StatusIconExt: IsA + sealed::Sealed + 'static { #[doc(alias = "phosh_status_icon_get_extra_widget")] #[doc(alias = "get_extra_widget")] fn extra_widget(&self) -> Option { unsafe { from_glib_none(ffi::phosh_status_icon_get_extra_widget(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_status_icon_get_icon_name")] #[doc(alias = "get_icon_name")] fn icon_name(&self) -> glib::GString { unsafe { from_glib_full(ffi::phosh_status_icon_get_icon_name(self.as_ref().to_glib_none().0)) } } //#[doc(alias = "phosh_status_icon_get_icon_size")] //#[doc(alias = "get_icon_size")] //fn icon_size(&self) -> /*Ignored*/gtk::IconSize { // unsafe { TODO: call ffi:phosh_status_icon_get_icon_size() } //} #[doc(alias = "phosh_status_icon_get_info")] #[doc(alias = "get_info")] fn info(&self) -> glib::GString { unsafe { from_glib_full(ffi::phosh_status_icon_get_info(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_status_icon_get_show_always")] #[doc(alias = "get_show_always")] fn shows_always(&self) -> bool { unsafe { from_glib(ffi::phosh_status_icon_get_show_always(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_status_icon_set_extra_widget")] fn set_extra_widget(&self, widget: &impl IsA) { unsafe { ffi::phosh_status_icon_set_extra_widget(self.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0); } } #[doc(alias = "phosh_status_icon_set_icon_name")] fn set_icon_name(&self, icon_name: &str) { unsafe { ffi::phosh_status_icon_set_icon_name(self.as_ref().to_glib_none().0, icon_name.to_glib_none().0); } } //#[doc(alias = "phosh_status_icon_set_icon_size")] //fn set_icon_size(&self, size: /*Ignored*/gtk::IconSize) { // unsafe { TODO: call ffi:phosh_status_icon_set_icon_size() } //} #[doc(alias = "phosh_status_icon_set_info")] fn set_info(&self, info: &str) { unsafe { ffi::phosh_status_icon_set_info(self.as_ref().to_glib_none().0, info.to_glib_none().0); } } #[doc(alias = "phosh_status_icon_set_show_always")] fn set_show_always(&self, show_always: bool) { unsafe { ffi::phosh_status_icon_set_show_always(self.as_ref().to_glib_none().0, show_always.into_glib()); } } #[doc(alias = "extra-widget")] fn connect_extra_widget_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_extra_widget_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshStatusIcon, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(StatusIcon::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::extra-widget\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_extra_widget_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "icon-name")] fn connect_icon_name_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_icon_name_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshStatusIcon, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(StatusIcon::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::icon-name\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_icon_name_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "icon-size")] fn connect_icon_size_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_icon_size_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshStatusIcon, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(StatusIcon::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::icon-size\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_icon_size_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "info")] fn connect_info_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_info_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshStatusIcon, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(StatusIcon::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::info\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_info_trampoline:: as *const ())), Box_::into_raw(f)) } } } impl> StatusIconExt for O {} libphosh-0.0.6/src/auto/status_page.rs000064400000000000000000000420301046102023000160620ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from .. // from ../gir-files // DO NOT EDIT use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "PhoshStatusPage")] pub struct StatusPage(Object) @extends gtk::Bin, gtk::Container, gtk::Widget; match fn { type_ => || ffi::phosh_status_page_get_type(), } } impl StatusPage { pub const NONE: Option<&'static StatusPage> = None; #[doc(alias = "phosh_status_page_new")] pub fn new() -> StatusPage { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::phosh_status_page_new()) } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`StatusPage`] objects. /// /// This method returns an instance of [`StatusPageBuilder`](crate::builders::StatusPageBuilder) which can be used to create [`StatusPage`] objects. pub fn builder() -> StatusPageBuilder { StatusPageBuilder::new() } } impl Default for StatusPage { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`StatusPage`] objects. /// /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html #[must_use = "The builder must be built to be used"] pub struct StatusPageBuilder { builder: glib::object::ObjectBuilder<'static, StatusPage>, } impl StatusPageBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder() } } pub fn footer(self, footer: &impl IsA) -> Self { Self { builder: self.builder.property("footer", footer.clone().upcast()), } } pub fn header(self, header: &impl IsA) -> Self { Self { builder: self.builder.property("header", header.clone().upcast()), } } pub fn title(self, title: impl Into) -> Self { Self { builder: self.builder.property("title", title.into()), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } //pub fn resize_mode(self, resize_mode: /*Ignored*/gtk::ResizeMode) -> Self { // Self { builder: self.builder.property("resize-mode", resize_mode), } //} pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } #[cfg(feature = "gtk_v2_18")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_18")))] #[cfg_attr(feature = "v3_14", deprecated = "Since 3.14")] pub fn double_buffered(self, double_buffered: bool) -> Self { Self { builder: self.builder.property("double-buffered", double_buffered), } } //pub fn events(self, events: /*Ignored*/gdk::EventMask) -> Self { // Self { builder: self.builder.property("events", events), } //} #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } #[cfg(feature = "gtk_v3_20")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3_20")))] pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } // #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { // Self { builder: self.builder.property("halign", halign), } //} pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } #[cfg(feature = "gtk_v2_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_12")))] pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } #[cfg(feature = "gtk_v3_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3_12")))] pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] #[cfg_attr(feature = "v3_12", deprecated = "Since 3.12")] pub fn margin_left(self, margin_left: i32) -> Self { Self { builder: self.builder.property("margin-left", margin_left), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] #[cfg_attr(feature = "v3_12", deprecated = "Since 3.12")] pub fn margin_right(self, margin_right: i32) -> Self { Self { builder: self.builder.property("margin-right", margin_right), } } #[cfg(feature = "gtk_v3_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3_12")))] pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } #[cfg(feature = "gtk_v3_8")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3_8")))] pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} #[cfg(feature = "gtk_v2_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_12")))] pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } } #[cfg(feature = "gtk_v2_12")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v2_12")))] pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } // #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { // Self { builder: self.builder.property("valign", valign), } //} #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } #[cfg(feature = "gtk_v3")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v3")))] pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`StatusPage`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> StatusPage { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait StatusPageExt: IsA + sealed::Sealed + 'static { #[doc(alias = "phosh_status_page_get_footer")] #[doc(alias = "get_footer")] fn footer(&self) -> gtk::Widget { unsafe { from_glib_none(ffi::phosh_status_page_get_footer(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_status_page_get_header")] #[doc(alias = "get_header")] fn header(&self) -> gtk::Widget { unsafe { from_glib_none(ffi::phosh_status_page_get_header(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_status_page_get_title")] #[doc(alias = "get_title")] fn title(&self) -> glib::GString { unsafe { from_glib_none(ffi::phosh_status_page_get_title(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_status_page_set_footer")] fn set_footer(&self, footer: &impl IsA) { unsafe { ffi::phosh_status_page_set_footer(self.as_ref().to_glib_none().0, footer.as_ref().to_glib_none().0); } } #[doc(alias = "phosh_status_page_set_header")] fn set_header(&self, header: &impl IsA) { unsafe { ffi::phosh_status_page_set_header(self.as_ref().to_glib_none().0, header.as_ref().to_glib_none().0); } } #[doc(alias = "phosh_status_page_set_title")] fn set_title(&self, title: &str) { unsafe { ffi::phosh_status_page_set_title(self.as_ref().to_glib_none().0, title.to_glib_none().0); } } #[doc(alias = "done")] fn connect_done(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn done_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshStatusPage, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(StatusPage::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"done\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(done_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "footer")] fn connect_footer_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_footer_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshStatusPage, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(StatusPage::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::footer\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_footer_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "header")] fn connect_header_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_header_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshStatusPage, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(StatusPage::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::header\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_header_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "title")] fn connect_title_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_title_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshStatusPage, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(StatusPage::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::title\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_title_trampoline:: as *const ())), Box_::into_raw(f)) } } } impl> StatusPageExt for O {} libphosh-0.0.6/src/auto/versions.txt000064400000000000000000000001751046102023000156120ustar 00000000000000Generated by gir (https://github.com/gtk-rs/gir @ 5223ce91b97a) from .. (@ eb5ea3018a51+) from ../gir-files (@ 6cd7b656acd6) libphosh-0.0.6/src/auto/wall_clock.rs000064400000000000000000000100431046102023000156540ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from .. // from ../gir-files // DO NOT EDIT use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "PhoshWallClock")] pub struct WallClock(Object); match fn { type_ => || ffi::phosh_wall_clock_get_type(), } } impl WallClock { pub const NONE: Option<&'static WallClock> = None; #[doc(alias = "phosh_wall_clock_new")] pub fn new() -> WallClock { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::phosh_wall_clock_new()) } } #[doc(alias = "phosh_wall_clock_get_default")] #[doc(alias = "get_default")] #[allow(clippy::should_implement_trait)] pub fn default() -> WallClock { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::phosh_wall_clock_get_default()) } } } impl Default for WallClock { fn default() -> Self { Self::new() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait WallClockExt: IsA + sealed::Sealed + 'static { #[doc(alias = "phosh_wall_clock_get_clock")] #[doc(alias = "get_clock")] fn clock(&self, time_only: bool) -> glib::GString { unsafe { from_glib_none(ffi::phosh_wall_clock_get_clock(self.as_ref().to_glib_none().0, time_only.into_glib())) } } #[doc(alias = "phosh_wall_clock_local_date")] fn local_date(&self) -> glib::GString { unsafe { from_glib_full(ffi::phosh_wall_clock_local_date(self.as_ref().to_glib_none().0)) } } #[doc(alias = "phosh_wall_clock_set_default")] fn set_default(&self) { unsafe { ffi::phosh_wall_clock_set_default(self.as_ref().to_glib_none().0); } } //#[doc(alias = "phosh_wall_clock_string_for_datetime")] //fn string_for_datetime(&self, datetime: /*Ignored*/&glib::DateTime, clock_format: /*Ignored*/gdesktop_enums::ClockFormat, show_full_date: bool) -> glib::GString { // unsafe { TODO: call ffi:phosh_wall_clock_string_for_datetime() } //} #[doc(alias = "date-time")] fn date_time(&self) -> Option { ObjectExt::property(self.as_ref(), "date-time") } fn time(&self) -> Option { ObjectExt::property(self.as_ref(), "time") } #[doc(alias = "date-time")] fn connect_date_time_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_date_time_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshWallClock, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(WallClock::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::date-time\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_date_time_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "time")] fn connect_time_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_time_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::PhoshWallClock, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(WallClock::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::time\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>(notify_time_trampoline:: as *const ())), Box_::into_raw(f)) } } } impl> WallClockExt for O {} libphosh-0.0.6/src/lib.rs000064400000000000000000000004101046102023000133350ustar 00000000000000#![cfg_attr(docsrs, feature(doc_cfg))] // TODO macro_rules! assert_initialized_main_thread { () => {}; } // No-op macro_rules! skip_assert_initialized { () => {}; } pub use auto::*; #[allow(unused_imports)] mod auto; pub mod subclass; pub mod prelude; libphosh-0.0.6/src/prelude.rs000064400000000000000000000000731046102023000142340ustar 00000000000000pub use crate::auto::traits::*; pub use glib::prelude::*; libphosh-0.0.6/src/subclass/lockscreen.rs000064400000000000000000000024431046102023000165460ustar 00000000000000use glib::{Cast, Class, subclass::prelude::*}; use glib::translate::ToGlibPtr; use gtk::subclass::prelude::*; use crate::Lockscreen; pub trait LockscreenImpl: LockscreenImplExt + ObjectImpl + WindowImpl { fn unlock_submit(&self) { self.parent_unlock_submit(); } } mod sealed { pub trait Sealed {} impl Sealed for T {} } pub trait LockscreenImplExt: sealed::Sealed + ObjectSubclass { fn parent_unlock_submit(&self) { unsafe { let data = Self::type_data(); let parent_class = data.as_ref().parent_class() as *mut ffi::PhoshLockscreenClass; if let Some(f) = (*parent_class).unlock_submit { f(self.obj().unsafe_cast_ref::().to_glib_none().0); } } } } impl LockscreenImplExt for T {} unsafe impl IsSubclassable for Lockscreen { fn class_init(class: &mut Class) { Self::parent_class_init::(class); let klass = class.as_mut(); klass.unlock_submit = Some(crate::subclass::lockscreen::unlock_submit::); } } unsafe extern "C" fn unlock_submit(ptr: *mut ffi::PhoshLockscreen) { let instance = &*(ptr as *mut T::Instance); instance.imp().unlock_submit(); } libphosh-0.0.6/src/subclass/mod.rs000064400000000000000000000000721046102023000151710ustar 00000000000000pub mod lockscreen; pub mod quick_setting; pub mod shell; libphosh-0.0.6/src/subclass/quick_setting.rs000064400000000000000000000010741046102023000172660ustar 00000000000000use glib::{Class, subclass::prelude::*}; use gtk::subclass::prelude::ButtonImpl; use crate::QuickSetting; pub trait QuickSettingImpl: QuickSettingImplExt + ObjectImpl + ButtonImpl { } mod sealed { pub trait Sealed {} impl Sealed for T {} } pub trait QuickSettingImplExt: sealed::Sealed + ObjectSubclass {} impl QuickSettingImplExt for T {} unsafe impl IsSubclassable for QuickSetting { fn class_init(class: &mut Class) { Self::parent_class_init::(class); } } libphosh-0.0.6/src/subclass/shell.rs000064400000000000000000000025111046102023000155210ustar 00000000000000use glib::{Class, prelude::*, subclass::prelude::*, Type}; use glib::ffi::GType; use glib::translate::*; use crate::Shell; pub trait ShellImpl: ShellImplExt + ObjectImpl { fn get_lockscreen_type(&self) -> Type { self.parent_get_lockscreen_type() } } mod sealed { pub trait Sealed {} impl Sealed for T {} } pub trait ShellImplExt: sealed::Sealed + ObjectSubclass { fn parent_get_lockscreen_type(&self) -> Type { unsafe { let data = Self::type_data(); let parent_class = data.as_ref().parent_class() as *mut ffi::PhoshShellClass; if let Some(f) = (*parent_class).get_lockscreen_type { return from_glib(f(self.obj().unsafe_cast_ref::().to_glib_none().0)); } return Type::UNIT; } } } impl ShellImplExt for T {} unsafe impl IsSubclassable for Shell { fn class_init(class: &mut Class) { Self::parent_class_init::(class); let klass = class.as_mut(); klass.get_lockscreen_type = Some(get_lockscreen_type::) } } unsafe extern "C" fn get_lockscreen_type(ptr: *mut ffi::PhoshShell) -> GType { let instance = &*(ptr as *mut T::Instance); let imp = instance.imp(); imp.get_lockscreen_type().into_glib() }