gsk4-0.9.6/.cargo_vcs_info.json0000644000000001420000000000100117150ustar { "git": { "sha1": "20d14bdf598eb1a3bde54e68c32b92775b165bd4" }, "path_in_vcs": "gsk4" }gsk4-0.9.6/COPYRIGHT000064400000000000000000000012131046102023000120000ustar 00000000000000The gtk-rs Project is licensed under the MIT license, see the LICENSE file or . Copyrights in the gtk-rs Project project are retained by their contributors. No copyright assignment is required to contribute to the gtk-rs Project project. For full authorship information, see the version control history. This project provides interoperability with various GNOME libraries but doesn't distribute any parts of them. Distributing compiled libraries and executables that link to those libraries may be subject to terms of the GNU LGPL or other licenses. For more information check the license of each GNOME library. gsk4-0.9.6/Cargo.lock0000644000000363500000000000100077020ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "autocfg" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "bitflags" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "cairo-rs" version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae50b5510d86cf96ac2370e66d8dc960882f3df179d6a5a1e52bd94a1416c0f7" dependencies = [ "bitflags", "cairo-sys-rs", "glib", "libc", ] [[package]] name = "cairo-sys-rs" version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f18b6bb8e43c7eb0f2aac7976afe0c61b6f5fc2ab7bc4c139537ea56c92290df" dependencies = [ "glib-sys", "libc", "system-deps", ] [[package]] name = "cfg-expr" version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d4ba6e40bd1184518716a6e1a781bf9160e286d219ccdb8ab2612e74cfe4789" dependencies = [ "smallvec", "target-lexicon", ] [[package]] name = "equivalent" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "futures-channel" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", ] [[package]] name = "futures-core" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", "futures-util", ] [[package]] name = "futures-io" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "futures-task" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", "futures-macro", "futures-task", "pin-project-lite", "pin-utils", "slab", ] [[package]] name = "gdk-pixbuf" version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7563afd6ff0a221edfbb70a78add5075b8d9cb48e637a40a24c3ece3fea414d0" dependencies = [ "gdk-pixbuf-sys", "gio", "glib", "libc", ] [[package]] name = "gdk-pixbuf-sys" version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67f2587c9202bf997476bbba6aaed4f78a11538a2567df002a5f57f5331d0b5c" dependencies = [ "gio-sys", "glib-sys", "gobject-sys", "libc", "system-deps", ] [[package]] name = "gdk4" version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4850c9d9c1aecd1a3eb14fadc1cdb0ac0a2298037e116264c7473e1740a32d60" dependencies = [ "cairo-rs", "gdk-pixbuf", "gdk4-sys", "gio", "glib", "libc", "pango", ] [[package]] name = "gdk4-sys" version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f6eb95798e2b46f279cf59005daf297d5b69555428f185650d71974a910473a" 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.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4f00c70f8029d84ea7572dd0e1aaa79e5329667b4c17f329d79ffb1e6277487" dependencies = [ "futures-channel", "futures-core", "futures-io", "futures-util", "gio-sys", "glib", "libc", "pin-project-lite", "smallvec", ] [[package]] name = "gio-sys" version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "160eb5250a26998c3e1b54e6a3d4ea15c6c7762a6062a19a7b63eff6e2b33f9e" dependencies = [ "glib-sys", "gobject-sys", "libc", "system-deps", "windows-sys", ] [[package]] name = "gir-format-check" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a5da913a8586ce748f1164c890e1ebe75a7bbc472668f57b7f9fb893d7ac416" [[package]] name = "glib" version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707b819af8059ee5395a2de9f2317d87a53dbad8846a2f089f0bb44703f37686" dependencies = [ "bitflags", "futures-channel", "futures-core", "futures-executor", "futures-task", "futures-util", "gio-sys", "glib-macros", "glib-sys", "gobject-sys", "libc", "memchr", "smallvec", ] [[package]] name = "glib-macros" version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "715601f8f02e71baef9c1f94a657a9a77c192aea6097cf9ae7e5e177cd8cde68" dependencies = [ "heck", "proc-macro-crate", "proc-macro2", "quote", "syn", ] [[package]] name = "glib-sys" version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8928869a44cfdd1fccb17d6746e4ff82c8f82e41ce705aa026a52ca8dc3aefb" dependencies = [ "libc", "system-deps", ] [[package]] name = "gobject-sys" version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c773a3cb38a419ad9c26c81d177d96b4b08980e8bdbbf32dace883e96e96e7e3" dependencies = [ "glib-sys", "libc", "system-deps", ] [[package]] name = "graphene-rs" version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3cbc5911bfb32d68dcfa92c9510c462696c2f715548fcd7f3f1be424c739de19" dependencies = [ "glib", "graphene-sys", "libc", ] [[package]] name = "graphene-sys" version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11a68d39515bf340e879b72cecd4a25c1332557757ada6e8aba8654b4b81d23a" dependencies = [ "glib-sys", "libc", "pkg-config", "system-deps", ] [[package]] name = "gsk4" version = "0.9.6" dependencies = [ "cairo-rs", "gdk4", "gir-format-check", "glib", "graphene-rs", "gsk4-sys", "libc", "pango", ] [[package]] name = "gsk4-sys" version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "755059de55fa6f85a46bde8caf03e2184c96bfda1f6206163c72fb0ea12436dc" dependencies = [ "cairo-sys-rs", "gdk4-sys", "glib-sys", "gobject-sys", "graphene-sys", "libc", "pango-sys", "system-deps", ] [[package]] name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "indexmap" version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", "hashbrown", ] [[package]] name = "libc" version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "pango" version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b1f5dc1b8cf9bc08bfc0843a04ee0fa2e78f1e1fa4b126844a383af4f25f0ec" dependencies = [ "gio", "glib", "libc", "pango-sys", ] [[package]] name = "pango-sys" version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dbb9b751673bd8fe49eb78620547973a1e719ed431372122b20abd12445bab5" dependencies = [ "glib-sys", "gobject-sys", "libc", "system-deps", ] [[package]] name = "pin-project-lite" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "proc-macro-crate" version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ "toml_edit", ] [[package]] name = "proc-macro2" version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] [[package]] name = "quote" version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] [[package]] name = "serde" version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "serde_spanned" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" 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.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" [[package]] name = "syn" version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "system-deps" version = "7.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66d23aaf9f331227789a99e8de4c91bf46703add012bdfd45fdecdfb2975a005" dependencies = [ "cfg-expr", "heck", "pkg-config", "toml", "version-compare", ] [[package]] name = "target-lexicon" version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "toml" version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" dependencies = [ "serde", "serde_spanned", "toml_datetime", "toml_edit", ] [[package]] name = "toml_datetime" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", "winnow", ] [[package]] name = "unicode-ident" version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" [[package]] name = "version-compare" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", "windows_i686_gnullvm", "windows_i686_msvc", "windows_x86_64_gnu", "windows_x86_64_gnullvm", "windows_x86_64_msvc", ] [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59690dea168f2198d1a3b0cac23b8063efcd11012f10ae4698f284808c8ef603" dependencies = [ "memchr", ] gsk4-0.9.6/Cargo.toml0000644000000043440000000000100077230ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.70" name = "gsk4" version = "0.9.6" authors = ["The gtk-rs Project Developers"] build = false autolib = false autobins = false autoexamples = false autotests = false autobenches = false description = "Rust bindings of the GSK 4 library" homepage = "https://gtk-rs.org/gtk4-rs" documentation = "https://gtk-rs.org/gtk4-rs/stable/latest/docs/gsk4" readme = "README.md" keywords = [ "gsk", "gsk4", "gtk-rs", "gnome", "GUI", ] categories = [ "api-bindings", "gui", ] license = "MIT" repository = "https://github.com/gtk-rs/gtk4-rs" [package.metadata.docs.rs] all-features = true rustc-args = [ "--cfg", "docsrs", ] rustdoc-args = [ "--cfg", "docsrs", "--generate-link-to-definition", ] [lib] name = "gsk4" path = "src/lib.rs" [[test]] name = "check_gir" path = "tests/check_gir.rs" [dependencies.cairo-rs] version = "0.20" features = ["use_glib"] [dependencies.gdk] version = "0.9" package = "gdk4" [dependencies.glib] version = "0.20" features = ["v2_66"] [dependencies.graphene] version = "0.20" package = "graphene-rs" [dependencies.gsk4-sys] version = "0.9.4" [dependencies.libc] version = "0.2" [dependencies.pango] version = "0.20" features = ["v1_46"] [dev-dependencies.gir-format-check] version = "^0.1" [features] broadway = ["gsk4-sys/broadway"] v4_10 = [ "gsk4-sys/v4_10", "gdk/v4_10", "v4_6", ] v4_14 = [ "gsk4-sys/v4_14", "gdk/v4_14", "v4_10", ] v4_16 = [ "gsk4-sys/v4_16", "gdk/v4_16", "v4_14", ] v4_18 = [ "gsk4-sys/v4_18", "gdk/v4_18", "v4_16", ] v4_2 = [ "gsk4-sys/v4_2", "gdk/v4_2", ] v4_4 = [ "gsk4-sys/v4_4", "gdk/v4_4", "v4_2", ] v4_6 = [ "gsk4-sys/v4_6", "gdk/v4_6", "v4_4", ] vulkan = ["gsk4-sys/vulkan"] gsk4-0.9.6/Cargo.toml.orig000064400000000000000000000023201046102023000133740ustar 00000000000000[package] name = "gsk4" description = "Rust bindings of the GSK 4 library" documentation = "https://gtk-rs.org/gtk4-rs/stable/latest/docs/gsk4" keywords = ["gsk", "gsk4", "gtk-rs", "gnome", "GUI"] readme = "README.md" authors.workspace = true categories.workspace = true edition.workspace = true homepage.workspace = true license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true [lib] name = "gsk4" [features] broadway = ["gsk4-sys/broadway"] vulkan = ["gsk4-sys/vulkan"] v4_2 = ["gsk4-sys/v4_2", "gdk/v4_2"] v4_4 = ["gsk4-sys/v4_4", "gdk/v4_4", "v4_2"] v4_6 = ["gsk4-sys/v4_6", "gdk/v4_6", "v4_4"] v4_10 = ["gsk4-sys/v4_10", "gdk/v4_10", "v4_6"] v4_14 = ["gsk4-sys/v4_14", "gdk/v4_14", "v4_10"] v4_16 = ["gsk4-sys/v4_16", "gdk/v4_16", "v4_14"] v4_18 = ["gsk4-sys/v4_18", "gdk/v4_18", "v4_16"] [dependencies] gsk4-sys.workspace = true cairo-rs.workspace = true gdk.workspace = true glib.workspace = true graphene.workspace = true libc.workspace = true pango.workspace = true [dev-dependencies] gir-format-check.workspace = true [package.metadata.docs.rs] all-features = true rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] gsk4-0.9.6/Gir.toml000064400000000000000000000156431046102023000121370ustar 00000000000000[options] girs_directories = ["../gir-files"] library = "Gsk" version = "4.0" min_cfg_version = "4.0.0" target_path = "." work_mode = "normal" use_gi_docgen = true generate_safety_asserts = true single_version_file = true deprecate_by_min_version = true trust_return_value_nullability = true generate = [ "Gsk.BlendMode", "Gsk.BlendNode", "Gsk.BlurNode", "Gsk.CairoNode", "Gsk.CairoRenderer", "Gsk.ClipNode", "Gsk.ColorMatrixNode", "Gsk.ColorNode", "Gsk.ConicGradientNode", "Gsk.Corner", "Gsk.CrossFadeNode", "Gsk.DebugNode", "Gsk.FillNode", "Gsk.FillRule", "Gsk.GLRenderer", "Gsk.GLUniformType", "Gsk.InsetShadowNode", "Gsk.LinearGradientNode", "Gsk.LineCap", "Gsk.LineJoin", "Gsk.MaskMode", "Gsk.MaskNode", "Gsk.OpacityNode", "Gsk.OutsetShadowNode", "Gsk.PathDirection", "Gsk.PathForeachFlags", "Gsk.PathMeasure", "Gsk.PathOperation", "Gsk.RadialGradientNode", "Gsk.RenderNodeType", "Gsk.RepeatingLinearGradientNode", "Gsk.RepeatingRadialGradientNode", "Gsk.RepeatNode", "Gsk.RoundedClipNode", "Gsk.ScalingFilter", "Gsk.SerializationError", "Gsk.StrokeNode", "Gsk.TextureNode", "Gsk.TextureScaleNode", "Gsk.TransformCategory", "Gsk.TransformNode", ] manual = [ "cairo.Context", "cairo.Path", "cairo.Region", "cairo.Surface", "Gdk.Display", "Gdk.RGBA", "Gdk.Surface", "Gdk.Texture", "Gio.File", # docs specific "GLib.Bytes", "GLib.Error", "GLib.Quark", "GLib.String", "Graphene.Matrix", "Graphene.Point", "Graphene.Point3D", "Graphene.Rect", "Graphene.Size", "Graphene.Vec2", "Graphene.Vec3", "Graphene.Vec4", "Gsk.NglRenderer", "Gsk.ParseLocation", "Gsk.Shadow", "Gtk.Snapshot", # docs specific "Pango.Font", "Pango.GlyphString", "Pango.Layout", ] [[object]] name = "Gsk.*" status = "generate" [[object.function]] pattern = "value_(dup|get|set|take)_render_node" ignore = true # used to implement Value traits manually [[object]] name = "Gsk.BorderNode" status = "generate" [[object.function]] name = "new" manual = true [[object.function]] name = "get_widths" manual = true [[object.function]] name = "get_colors" manual = true [[object]] name = "Gsk.BroadwayRenderer" status = "generate" cfg_condition = "feature = \"broadway\"" [[object]] name = "Gsk.ColorStop" status = "manual" boxed_inline = true [[object]] name = "Gsk.ContainerNode" status = "generate" [[object.function]] name = "get_child" manual = true # assert that idx < n_children [[object]] name = "Gsk.GLShader" status = "generate" generate_builder = true [[object.function]] name = "get_arg_bool" # Retrieves the boolean value of an arg rename = "arg_bool" [[object.function]] name = "format_args_va" ignore = true # not useful for bindings [[object.function]] name = "format_args" ignore = true # TODO: fix me once varargs are supported [[object.function]] name = "get_arg_vec2" manual = true # TODO: fix me once (https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3744) is merged [[object.function]] name = "get_arg_vec3" manual = true # TODO: fix me once (https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3744) is merged [[object.function]] name = "get_arg_vec4" manual = true # TODO: fix me once (https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3744) is merged [[object]] name = "Gsk.GLShaderNode" status = "generate" [[object.function]] name = "get_child" manual = true # assert that idx < n_children [[object]] name = "Gsk.Path" status = "generate" [[object.function]] name = "to_cairo" [[object.function.parameter]] name = "cr" const = true [[object.function]] name = "parse" [object.function.return] nullable_return_is_error = "Can't parse Path" [[object.function]] name = "print" ignore = true # to_str exists [[object.function]] name = "foreach" manual = true # tries to call from_glib_borrow on an enum [[object]] name = "Gsk.PathBuilder" status = "generate" [[object.function]] name = "free_to_path" ignore = true # not useful for bindings [[object.function]] name = "add_cairo_path" manual = true # use as_ptr for cairo::Path [[object]] name = "Gsk.PathPoint" status = "generate" boxed_inline = true [[object.function]] name = "get_curvature" manual = true # handle nullable point return value [[object]] name = "Gsk.Renderer" status = "generate" trait_name = "GskRendererExt" [[object]] name = "Gsk.RenderNode" status = "generate" [[object.function]] name = "deserialize" manual = true # split between two variants [[object.function]] name = "draw" [[object.function.parameter]] name = "cr" const = true [[object]] name = "Gsk.RoundedRect" status = "manual" [[object.function]] name = "init" rename = "new" [[object.function]] name = "init_from_rect" rename = "from_rect" [[object]] name = "Gsk.ShaderArgsBuilder" status = "generate" [[object.function]] name = "free_to_args" ignore = true # C convenience functions [[object.function]] name = "to_args" [[object.function.parameter]] name = "builder" move = true [[object]] name = "Gsk.ShadowNode" status = "generate" [[object.function]] name = "get_shadow" manual = true # assert that i < n_shadows [[object]] name = "Gsk.Stroke" status = "generate" [[object.function]] name = "to_cairo" [[object.function.parameter]] name = "cr" const = true [[object.function]] pattern = "set_(dash|dash_offset|line_cap|line_join|line_width|miter_limit)" [[object.function.parameter]] name = "self" const = true [[object.function]] name = "equal" [[object.function.parameter]] name = "stroke2" nullable = false [[object]] name = "Gsk.TextNode" status = "generate" [[object.function]] name = "new" [[object.function.parameter]] name = "glyphs" const = true [[object]] name = "Gsk.Transform" status = "generate" [[object.function]] name = "equal" [[object.function.parameter]] name = "second" nullable = false [[object.function]] pattern = "(translate_3d|translate|transform|skew|scale_3d|scale|rotate_3d|rotate|invert)" manual = true # those functions return NULL in C which represents an identity transform [[object.function]] name = "print" ignore = true # Same as Transform::to_string [[object.function]] name = "parse" manual = true # bool_return_is_error doesn't seem to work for it [[object]] name = "Gsk.VulkanRenderer" status = "generate" cfg_condition = "feature = \"vulkan\"" [[object]] name = "Pango.GlyphInfo" status = "manual" boxed_inline = true gsk4-0.9.6/LICENSE000064400000000000000000000020001046102023000115050ustar 00000000000000Permission 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. gsk4-0.9.6/README.md000064400000000000000000000040721046102023000117720ustar 00000000000000# Rust GSK 4 bindings The project website is [here](https://gtk-rs.org/). Rust bindings of [GSK 4](https://docs.gtk.org/gsk4/), part of [gtk4-rs](https://github.com/gtk-rs/gtk4-rs/). GSK is an intermediate layer that isolates GTK from the details of the OpenGL or Vulkan implementation. ## Minimum supported Rust version Currently, the minimum supported Rust version is `1.70`. ## Documentation - The Rust API [Stable](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gsk4)/[Development](https://gtk-rs.org/gtk4-rs/git/docs/gsk4/) - [The C API](https://docs.gtk.org/gsk4/) - [GTK Installation instructions](https://www.gtk.org/docs/installations/) ## Using We recommend using [crates from crates.io](https://crates.io/keywords/gtk-rs), as [demonstrated here](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/index.html#library-versions). If you want to track the bleeding edge, use the git dependency instead: ```toml [dependencies] gsk = { git = "https://github.com/gtk-rs/gtk4-rs.git", package = "gsk4" } ``` Avoid mixing versioned and git crates like this: ```toml # This will not compile [dependencies] gdk = {version = "0.1", package = "gdk4"} gsk = { git = "https://github.com/gtk-rs/gtk4-rs.git", package = "gsk4" } ``` ### Features | Feature | Description | | --- | ----------- | | `vulkan` | Enable `vulkan` Renderer. Only if GTK is compiled with Vulkan support | | `broadway` | Enable `broadway` Renderer. Only if GTK is compiled with Broadway support | | `v4_18` | Enable the new APIs part of GTK 4.18 | | `v4_16` | Enable the new APIs part of GTK 4.16 | | `v4_14` | Enable the new APIs part of GTK 4.14 | | `v4_10` | Enable the new APIs part of GTK 4.10 | | `v4_6` | Enable the new APIs part of GTK 4.6 | | `v4_4` | Enable the new APIs part of GTK 4.4 | | `v4_2` | Enable the new APIs part of GTK 4.2 | ### See Also - [glib](https://crates.io/crates/glib) - [gio](https://crates.io/crates/gio) - [gdk4](https://crates.io/crates/gdk4) - [gtk4](https://crates.io/crates/gtk4) ## License The Rust bindings of __gsk4__ are available under the MIT License, please refer to it. gsk4-0.9.6/src/auto/blend_node.rs000064400000000000000000000034431046102023000147120ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, BlendMode, RenderNode}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskBlendNode")] pub struct BlendNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for BlendNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_blend_node_get_type()) } } } impl BlendNode { #[doc(alias = "gsk_blend_node_new")] pub fn new( bottom: impl AsRef, top: impl AsRef, blend_mode: BlendMode, ) -> BlendNode { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gsk_blend_node_new( bottom.as_ref().to_glib_none().0, top.as_ref().to_glib_none().0, blend_mode.into_glib(), )) } } #[doc(alias = "gsk_blend_node_get_blend_mode")] #[doc(alias = "get_blend_mode")] pub fn blend_mode(&self) -> BlendMode { unsafe { from_glib(ffi::gsk_blend_node_get_blend_mode(self.to_glib_none().0)) } } #[doc(alias = "gsk_blend_node_get_bottom_child")] #[doc(alias = "get_bottom_child")] pub fn bottom_child(&self) -> RenderNode { unsafe { from_glib_none(ffi::gsk_blend_node_get_bottom_child(self.to_glib_none().0)) } } #[doc(alias = "gsk_blend_node_get_top_child")] #[doc(alias = "get_top_child")] pub fn top_child(&self) -> RenderNode { unsafe { from_glib_none(ffi::gsk_blend_node_get_top_child(self.to_glib_none().0)) } } } gsk4-0.9.6/src/auto/blur_node.rs000064400000000000000000000025411046102023000145700ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, RenderNode}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskBlurNode")] pub struct BlurNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for BlurNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_blur_node_get_type()) } } } impl BlurNode { #[doc(alias = "gsk_blur_node_new")] pub fn new(child: impl AsRef, radius: f32) -> BlurNode { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gsk_blur_node_new( child.as_ref().to_glib_none().0, radius, )) } } #[doc(alias = "gsk_blur_node_get_child")] #[doc(alias = "get_child")] pub fn child(&self) -> RenderNode { unsafe { from_glib_none(ffi::gsk_blur_node_get_child(self.to_glib_none().0)) } } #[doc(alias = "gsk_blur_node_get_radius")] #[doc(alias = "get_radius")] pub fn radius(&self) -> f32 { unsafe { ffi::gsk_blur_node_get_radius(self.to_glib_none().0) } } } gsk4-0.9.6/src/auto/border_node.rs000064400000000000000000000015701046102023000151020ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, RoundedRect}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskBorderNode")] pub struct BorderNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for BorderNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_border_node_get_type()) } } } impl BorderNode { #[doc(alias = "gsk_border_node_get_outline")] #[doc(alias = "get_outline")] pub fn outline(&self) -> RoundedRect { unsafe { from_glib_none(ffi::gsk_border_node_get_outline(self.to_glib_none().0)) } } } gsk4-0.9.6/src/auto/broadway_renderer.rs000064400000000000000000000014521046102023000163150ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Renderer}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskBroadwayRenderer")] pub struct BroadwayRenderer(Object) @extends Renderer; match fn { type_ => || ffi::gsk_broadway_renderer_get_type(), } } impl BroadwayRenderer { #[doc(alias = "gsk_broadway_renderer_new")] pub fn new() -> BroadwayRenderer { assert_initialized_main_thread!(); unsafe { Renderer::from_glib_full(ffi::gsk_broadway_renderer_new()).unsafe_cast() } } } impl Default for BroadwayRenderer { fn default() -> Self { Self::new() } } gsk4-0.9.6/src/auto/cairo_node.rs000064400000000000000000000025001046102023000147140ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskCairoNode")] pub struct CairoNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for CairoNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_cairo_node_get_type()) } } } impl CairoNode { #[doc(alias = "gsk_cairo_node_new")] pub fn new(bounds: &graphene::Rect) -> CairoNode { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gsk_cairo_node_new(bounds.to_glib_none().0)) } } #[doc(alias = "gsk_cairo_node_get_draw_context")] #[doc(alias = "get_draw_context")] pub fn draw_context(&self) -> cairo::Context { unsafe { from_glib_full(ffi::gsk_cairo_node_get_draw_context(self.to_glib_none().0)) } } #[doc(alias = "gsk_cairo_node_get_surface")] #[doc(alias = "get_surface")] pub fn surface(&self) -> cairo::Surface { unsafe { from_glib_none(ffi::gsk_cairo_node_get_surface(self.to_glib_none().0)) } } } gsk4-0.9.6/src/auto/cairo_renderer.rs000064400000000000000000000014141046102023000156000ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Renderer}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskCairoRenderer")] pub struct CairoRenderer(Object) @extends Renderer; match fn { type_ => || ffi::gsk_cairo_renderer_get_type(), } } impl CairoRenderer { #[doc(alias = "gsk_cairo_renderer_new")] pub fn new() -> CairoRenderer { assert_initialized_main_thread!(); unsafe { Renderer::from_glib_full(ffi::gsk_cairo_renderer_new()).unsafe_cast() } } } impl Default for CairoRenderer { fn default() -> Self { Self::new() } } gsk4-0.9.6/src/auto/clip_node.rs000064400000000000000000000026151046102023000145550ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, RenderNode}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskClipNode")] pub struct ClipNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for ClipNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_clip_node_get_type()) } } } impl ClipNode { #[doc(alias = "gsk_clip_node_new")] pub fn new(child: impl AsRef, clip: &graphene::Rect) -> ClipNode { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gsk_clip_node_new( child.as_ref().to_glib_none().0, clip.to_glib_none().0, )) } } #[doc(alias = "gsk_clip_node_get_child")] #[doc(alias = "get_child")] pub fn child(&self) -> RenderNode { unsafe { from_glib_none(ffi::gsk_clip_node_get_child(self.to_glib_none().0)) } } #[doc(alias = "gsk_clip_node_get_clip")] #[doc(alias = "get_clip")] pub fn clip(&self) -> graphene::Rect { unsafe { from_glib_none(ffi::gsk_clip_node_get_clip(self.to_glib_none().0)) } } } gsk4-0.9.6/src/auto/color_matrix_node.rs000064400000000000000000000037721046102023000163350ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, RenderNode}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskColorMatrixNode")] pub struct ColorMatrixNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for ColorMatrixNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_color_matrix_node_get_type()) } } } impl ColorMatrixNode { #[doc(alias = "gsk_color_matrix_node_new")] pub fn new( child: impl AsRef, color_matrix: &graphene::Matrix, color_offset: &graphene::Vec4, ) -> ColorMatrixNode { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gsk_color_matrix_node_new( child.as_ref().to_glib_none().0, color_matrix.to_glib_none().0, color_offset.to_glib_none().0, )) } } #[doc(alias = "gsk_color_matrix_node_get_child")] #[doc(alias = "get_child")] pub fn child(&self) -> RenderNode { unsafe { from_glib_none(ffi::gsk_color_matrix_node_get_child(self.to_glib_none().0)) } } #[doc(alias = "gsk_color_matrix_node_get_color_matrix")] #[doc(alias = "get_color_matrix")] pub fn color_matrix(&self) -> graphene::Matrix { unsafe { from_glib_none(ffi::gsk_color_matrix_node_get_color_matrix( self.to_glib_none().0, )) } } #[doc(alias = "gsk_color_matrix_node_get_color_offset")] #[doc(alias = "get_color_offset")] pub fn color_offset(&self) -> graphene::Vec4 { unsafe { from_glib_none(ffi::gsk_color_matrix_node_get_color_offset( self.to_glib_none().0, )) } } } gsk4-0.9.6/src/auto/color_node.rs000064400000000000000000000022511046102023000147400ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskColorNode")] pub struct ColorNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for ColorNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_color_node_get_type()) } } } impl ColorNode { #[doc(alias = "gsk_color_node_new")] pub fn new(rgba: &gdk::RGBA, bounds: &graphene::Rect) -> ColorNode { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gsk_color_node_new( rgba.to_glib_none().0, bounds.to_glib_none().0, )) } } #[doc(alias = "gsk_color_node_get_color")] #[doc(alias = "get_color")] pub fn color(&self) -> gdk::RGBA { unsafe { from_glib_none(ffi::gsk_color_node_get_color(self.to_glib_none().0)) } } } gsk4-0.9.6/src/auto/conic_gradient_node.rs000064400000000000000000000055351046102023000166020ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, ColorStop}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskConicGradientNode")] pub struct ConicGradientNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for ConicGradientNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_conic_gradient_node_get_type()) } } } impl ConicGradientNode { #[doc(alias = "gsk_conic_gradient_node_new")] pub fn new( bounds: &graphene::Rect, center: &graphene::Point, rotation: f32, color_stops: &[ColorStop], ) -> ConicGradientNode { assert_initialized_main_thread!(); let n_color_stops = color_stops.len() as _; unsafe { from_glib_full(ffi::gsk_conic_gradient_node_new( bounds.to_glib_none().0, center.to_glib_none().0, rotation, color_stops.to_glib_none().0, n_color_stops, )) } } #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] #[doc(alias = "gsk_conic_gradient_node_get_angle")] #[doc(alias = "get_angle")] pub fn angle(&self) -> f32 { unsafe { ffi::gsk_conic_gradient_node_get_angle(self.to_glib_none().0) } } #[doc(alias = "gsk_conic_gradient_node_get_center")] #[doc(alias = "get_center")] pub fn center(&self) -> graphene::Point { unsafe { from_glib_none(ffi::gsk_conic_gradient_node_get_center( self.to_glib_none().0, )) } } #[doc(alias = "gsk_conic_gradient_node_get_color_stops")] #[doc(alias = "get_color_stops")] pub fn color_stops(&self) -> Vec { unsafe { let mut n_stops = std::mem::MaybeUninit::uninit(); let ret = FromGlibContainer::from_glib_none_num( ffi::gsk_conic_gradient_node_get_color_stops( self.to_glib_none().0, n_stops.as_mut_ptr(), ), n_stops.assume_init() as _, ); ret } } #[doc(alias = "gsk_conic_gradient_node_get_n_color_stops")] #[doc(alias = "get_n_color_stops")] pub fn n_color_stops(&self) -> usize { unsafe { ffi::gsk_conic_gradient_node_get_n_color_stops(self.to_glib_none().0) } } #[doc(alias = "gsk_conic_gradient_node_get_rotation")] #[doc(alias = "get_rotation")] pub fn rotation(&self) -> f32 { unsafe { ffi::gsk_conic_gradient_node_get_rotation(self.to_glib_none().0) } } } gsk4-0.9.6/src/auto/container_node.rs000064400000000000000000000023641046102023000156110ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, RenderNode}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskContainerNode")] pub struct ContainerNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for ContainerNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_container_node_get_type()) } } } impl ContainerNode { #[doc(alias = "gsk_container_node_new")] pub fn new(children: &[RenderNode]) -> ContainerNode { assert_initialized_main_thread!(); let n_children = children.len() as _; unsafe { from_glib_full(ffi::gsk_container_node_new( children.to_glib_none().0, n_children, )) } } #[doc(alias = "gsk_container_node_get_n_children")] #[doc(alias = "get_n_children")] pub fn n_children(&self) -> u32 { unsafe { ffi::gsk_container_node_get_n_children(self.to_glib_none().0) } } } gsk4-0.9.6/src/auto/cross_fade_node.rs000064400000000000000000000036161046102023000157400ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, RenderNode}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskCrossFadeNode")] pub struct CrossFadeNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for CrossFadeNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_cross_fade_node_get_type()) } } } impl CrossFadeNode { #[doc(alias = "gsk_cross_fade_node_new")] pub fn new( start: impl AsRef, end: impl AsRef, progress: f32, ) -> CrossFadeNode { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gsk_cross_fade_node_new( start.as_ref().to_glib_none().0, end.as_ref().to_glib_none().0, progress, )) } } #[doc(alias = "gsk_cross_fade_node_get_end_child")] #[doc(alias = "get_end_child")] pub fn end_child(&self) -> RenderNode { unsafe { from_glib_none(ffi::gsk_cross_fade_node_get_end_child( self.to_glib_none().0, )) } } #[doc(alias = "gsk_cross_fade_node_get_progress")] #[doc(alias = "get_progress")] pub fn progress(&self) -> f32 { unsafe { ffi::gsk_cross_fade_node_get_progress(self.to_glib_none().0) } } #[doc(alias = "gsk_cross_fade_node_get_start_child")] #[doc(alias = "get_start_child")] pub fn start_child(&self) -> RenderNode { unsafe { from_glib_none(ffi::gsk_cross_fade_node_get_start_child( self.to_glib_none().0, )) } } } gsk4-0.9.6/src/auto/debug_node.rs000064400000000000000000000026501046102023000147130ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, RenderNode}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskDebugNode")] pub struct DebugNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for DebugNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_debug_node_get_type()) } } } impl DebugNode { #[doc(alias = "gsk_debug_node_new")] pub fn new(child: impl AsRef, message: glib::GString) -> DebugNode { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gsk_debug_node_new( child.as_ref().to_glib_none().0, message.into_glib_ptr(), )) } } #[doc(alias = "gsk_debug_node_get_child")] #[doc(alias = "get_child")] pub fn child(&self) -> RenderNode { unsafe { from_glib_none(ffi::gsk_debug_node_get_child(self.to_glib_none().0)) } } #[doc(alias = "gsk_debug_node_get_message")] #[doc(alias = "get_message")] pub fn message(&self) -> glib::GString { unsafe { from_glib_none(ffi::gsk_debug_node_get_message(self.to_glib_none().0)) } } } gsk4-0.9.6/src/auto/enums.rs000064400000000000000000001414131046102023000137500ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::{prelude::*, translate::*}; #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GskBlendMode")] pub enum BlendMode { #[doc(alias = "GSK_BLEND_MODE_DEFAULT")] Default, #[doc(alias = "GSK_BLEND_MODE_MULTIPLY")] Multiply, #[doc(alias = "GSK_BLEND_MODE_SCREEN")] Screen, #[doc(alias = "GSK_BLEND_MODE_OVERLAY")] Overlay, #[doc(alias = "GSK_BLEND_MODE_DARKEN")] Darken, #[doc(alias = "GSK_BLEND_MODE_LIGHTEN")] Lighten, #[doc(alias = "GSK_BLEND_MODE_COLOR_DODGE")] ColorDodge, #[doc(alias = "GSK_BLEND_MODE_COLOR_BURN")] ColorBurn, #[doc(alias = "GSK_BLEND_MODE_HARD_LIGHT")] HardLight, #[doc(alias = "GSK_BLEND_MODE_SOFT_LIGHT")] SoftLight, #[doc(alias = "GSK_BLEND_MODE_DIFFERENCE")] Difference, #[doc(alias = "GSK_BLEND_MODE_EXCLUSION")] Exclusion, #[doc(alias = "GSK_BLEND_MODE_COLOR")] Color, #[doc(alias = "GSK_BLEND_MODE_HUE")] Hue, #[doc(alias = "GSK_BLEND_MODE_SATURATION")] Saturation, #[doc(alias = "GSK_BLEND_MODE_LUMINOSITY")] Luminosity, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for BlendMode { type GlibType = ffi::GskBlendMode; fn into_glib(self) -> ffi::GskBlendMode { match self { Self::Default => ffi::GSK_BLEND_MODE_DEFAULT, Self::Multiply => ffi::GSK_BLEND_MODE_MULTIPLY, Self::Screen => ffi::GSK_BLEND_MODE_SCREEN, Self::Overlay => ffi::GSK_BLEND_MODE_OVERLAY, Self::Darken => ffi::GSK_BLEND_MODE_DARKEN, Self::Lighten => ffi::GSK_BLEND_MODE_LIGHTEN, Self::ColorDodge => ffi::GSK_BLEND_MODE_COLOR_DODGE, Self::ColorBurn => ffi::GSK_BLEND_MODE_COLOR_BURN, Self::HardLight => ffi::GSK_BLEND_MODE_HARD_LIGHT, Self::SoftLight => ffi::GSK_BLEND_MODE_SOFT_LIGHT, Self::Difference => ffi::GSK_BLEND_MODE_DIFFERENCE, Self::Exclusion => ffi::GSK_BLEND_MODE_EXCLUSION, Self::Color => ffi::GSK_BLEND_MODE_COLOR, Self::Hue => ffi::GSK_BLEND_MODE_HUE, Self::Saturation => ffi::GSK_BLEND_MODE_SATURATION, Self::Luminosity => ffi::GSK_BLEND_MODE_LUMINOSITY, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for BlendMode { unsafe fn from_glib(value: ffi::GskBlendMode) -> Self { skip_assert_initialized!(); match value { ffi::GSK_BLEND_MODE_DEFAULT => Self::Default, ffi::GSK_BLEND_MODE_MULTIPLY => Self::Multiply, ffi::GSK_BLEND_MODE_SCREEN => Self::Screen, ffi::GSK_BLEND_MODE_OVERLAY => Self::Overlay, ffi::GSK_BLEND_MODE_DARKEN => Self::Darken, ffi::GSK_BLEND_MODE_LIGHTEN => Self::Lighten, ffi::GSK_BLEND_MODE_COLOR_DODGE => Self::ColorDodge, ffi::GSK_BLEND_MODE_COLOR_BURN => Self::ColorBurn, ffi::GSK_BLEND_MODE_HARD_LIGHT => Self::HardLight, ffi::GSK_BLEND_MODE_SOFT_LIGHT => Self::SoftLight, ffi::GSK_BLEND_MODE_DIFFERENCE => Self::Difference, ffi::GSK_BLEND_MODE_EXCLUSION => Self::Exclusion, ffi::GSK_BLEND_MODE_COLOR => Self::Color, ffi::GSK_BLEND_MODE_HUE => Self::Hue, ffi::GSK_BLEND_MODE_SATURATION => Self::Saturation, ffi::GSK_BLEND_MODE_LUMINOSITY => Self::Luminosity, value => Self::__Unknown(value), } } } impl StaticType for BlendMode { #[inline] #[doc(alias = "gsk_blend_mode_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_blend_mode_get_type()) } } } impl glib::HasParamSpec for BlendMode { 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 BlendMode { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for BlendMode { 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 BlendMode { #[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: BlendMode) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GskCorner")] pub enum Corner { #[doc(alias = "GSK_CORNER_TOP_LEFT")] TopLeft, #[doc(alias = "GSK_CORNER_TOP_RIGHT")] TopRight, #[doc(alias = "GSK_CORNER_BOTTOM_RIGHT")] BottomRight, #[doc(alias = "GSK_CORNER_BOTTOM_LEFT")] BottomLeft, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for Corner { type GlibType = ffi::GskCorner; #[inline] fn into_glib(self) -> ffi::GskCorner { match self { Self::TopLeft => ffi::GSK_CORNER_TOP_LEFT, Self::TopRight => ffi::GSK_CORNER_TOP_RIGHT, Self::BottomRight => ffi::GSK_CORNER_BOTTOM_RIGHT, Self::BottomLeft => ffi::GSK_CORNER_BOTTOM_LEFT, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for Corner { #[inline] unsafe fn from_glib(value: ffi::GskCorner) -> Self { skip_assert_initialized!(); match value { ffi::GSK_CORNER_TOP_LEFT => Self::TopLeft, ffi::GSK_CORNER_TOP_RIGHT => Self::TopRight, ffi::GSK_CORNER_BOTTOM_RIGHT => Self::BottomRight, ffi::GSK_CORNER_BOTTOM_LEFT => Self::BottomLeft, value => Self::__Unknown(value), } } } impl StaticType for Corner { #[inline] #[doc(alias = "gsk_corner_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_corner_get_type()) } } } impl glib::HasParamSpec for Corner { 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 Corner { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for Corner { 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 Corner { #[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: Corner) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GskFillRule")] pub enum FillRule { #[doc(alias = "GSK_FILL_RULE_WINDING")] Winding, #[doc(alias = "GSK_FILL_RULE_EVEN_ODD")] EvenOdd, #[doc(hidden)] __Unknown(i32), } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[doc(hidden)] impl IntoGlib for FillRule { type GlibType = ffi::GskFillRule; #[inline] fn into_glib(self) -> ffi::GskFillRule { match self { Self::Winding => ffi::GSK_FILL_RULE_WINDING, Self::EvenOdd => ffi::GSK_FILL_RULE_EVEN_ODD, Self::__Unknown(value) => value, } } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[doc(hidden)] impl FromGlib for FillRule { #[inline] unsafe fn from_glib(value: ffi::GskFillRule) -> Self { skip_assert_initialized!(); match value { ffi::GSK_FILL_RULE_WINDING => Self::Winding, ffi::GSK_FILL_RULE_EVEN_ODD => Self::EvenOdd, value => Self::__Unknown(value), } } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl StaticType for FillRule { #[inline] #[doc(alias = "gsk_fill_rule_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_fill_rule_get_type()) } } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl glib::HasParamSpec for FillRule { 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 } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl glib::value::ValueType for FillRule { type Type = Self; } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] unsafe impl<'a> glib::value::FromValue<'a> for FillRule { 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)) } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl ToValue for FillRule { #[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() } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl From for glib::Value { #[inline] fn from(v: FillRule) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GskGLUniformType")] pub enum GLUniformType { #[doc(alias = "GSK_GL_UNIFORM_TYPE_NONE")] None, #[doc(alias = "GSK_GL_UNIFORM_TYPE_FLOAT")] Float, #[doc(alias = "GSK_GL_UNIFORM_TYPE_INT")] Int, #[doc(alias = "GSK_GL_UNIFORM_TYPE_UINT")] Uint, #[doc(alias = "GSK_GL_UNIFORM_TYPE_BOOL")] Bool, #[doc(alias = "GSK_GL_UNIFORM_TYPE_VEC2")] Vec2, #[doc(alias = "GSK_GL_UNIFORM_TYPE_VEC3")] Vec3, #[doc(alias = "GSK_GL_UNIFORM_TYPE_VEC4")] Vec4, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for GLUniformType { type GlibType = ffi::GskGLUniformType; #[inline] fn into_glib(self) -> ffi::GskGLUniformType { match self { Self::None => ffi::GSK_GL_UNIFORM_TYPE_NONE, Self::Float => ffi::GSK_GL_UNIFORM_TYPE_FLOAT, Self::Int => ffi::GSK_GL_UNIFORM_TYPE_INT, Self::Uint => ffi::GSK_GL_UNIFORM_TYPE_UINT, Self::Bool => ffi::GSK_GL_UNIFORM_TYPE_BOOL, Self::Vec2 => ffi::GSK_GL_UNIFORM_TYPE_VEC2, Self::Vec3 => ffi::GSK_GL_UNIFORM_TYPE_VEC3, Self::Vec4 => ffi::GSK_GL_UNIFORM_TYPE_VEC4, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for GLUniformType { #[inline] unsafe fn from_glib(value: ffi::GskGLUniformType) -> Self { skip_assert_initialized!(); match value { ffi::GSK_GL_UNIFORM_TYPE_NONE => Self::None, ffi::GSK_GL_UNIFORM_TYPE_FLOAT => Self::Float, ffi::GSK_GL_UNIFORM_TYPE_INT => Self::Int, ffi::GSK_GL_UNIFORM_TYPE_UINT => Self::Uint, ffi::GSK_GL_UNIFORM_TYPE_BOOL => Self::Bool, ffi::GSK_GL_UNIFORM_TYPE_VEC2 => Self::Vec2, ffi::GSK_GL_UNIFORM_TYPE_VEC3 => Self::Vec3, ffi::GSK_GL_UNIFORM_TYPE_VEC4 => Self::Vec4, value => Self::__Unknown(value), } } } impl StaticType for GLUniformType { #[inline] #[doc(alias = "gsk_gl_uniform_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_gl_uniform_type_get_type()) } } } impl glib::HasParamSpec for GLUniformType { 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 GLUniformType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for GLUniformType { 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 GLUniformType { #[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: GLUniformType) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GskLineCap")] pub enum LineCap { #[doc(alias = "GSK_LINE_CAP_BUTT")] Butt, #[doc(alias = "GSK_LINE_CAP_ROUND")] Round, #[doc(alias = "GSK_LINE_CAP_SQUARE")] Square, #[doc(hidden)] __Unknown(i32), } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[doc(hidden)] impl IntoGlib for LineCap { type GlibType = ffi::GskLineCap; #[inline] fn into_glib(self) -> ffi::GskLineCap { match self { Self::Butt => ffi::GSK_LINE_CAP_BUTT, Self::Round => ffi::GSK_LINE_CAP_ROUND, Self::Square => ffi::GSK_LINE_CAP_SQUARE, Self::__Unknown(value) => value, } } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[doc(hidden)] impl FromGlib for LineCap { #[inline] unsafe fn from_glib(value: ffi::GskLineCap) -> Self { skip_assert_initialized!(); match value { ffi::GSK_LINE_CAP_BUTT => Self::Butt, ffi::GSK_LINE_CAP_ROUND => Self::Round, ffi::GSK_LINE_CAP_SQUARE => Self::Square, value => Self::__Unknown(value), } } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl StaticType for LineCap { #[inline] #[doc(alias = "gsk_line_cap_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_line_cap_get_type()) } } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl glib::HasParamSpec for LineCap { 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 } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl glib::value::ValueType for LineCap { type Type = Self; } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] unsafe impl<'a> glib::value::FromValue<'a> for LineCap { 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)) } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl ToValue for LineCap { #[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() } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl From for glib::Value { #[inline] fn from(v: LineCap) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GskLineJoin")] pub enum LineJoin { #[doc(alias = "GSK_LINE_JOIN_MITER")] Miter, #[doc(alias = "GSK_LINE_JOIN_ROUND")] Round, #[doc(alias = "GSK_LINE_JOIN_BEVEL")] Bevel, #[doc(hidden)] __Unknown(i32), } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[doc(hidden)] impl IntoGlib for LineJoin { type GlibType = ffi::GskLineJoin; #[inline] fn into_glib(self) -> ffi::GskLineJoin { match self { Self::Miter => ffi::GSK_LINE_JOIN_MITER, Self::Round => ffi::GSK_LINE_JOIN_ROUND, Self::Bevel => ffi::GSK_LINE_JOIN_BEVEL, Self::__Unknown(value) => value, } } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[doc(hidden)] impl FromGlib for LineJoin { #[inline] unsafe fn from_glib(value: ffi::GskLineJoin) -> Self { skip_assert_initialized!(); match value { ffi::GSK_LINE_JOIN_MITER => Self::Miter, ffi::GSK_LINE_JOIN_ROUND => Self::Round, ffi::GSK_LINE_JOIN_BEVEL => Self::Bevel, value => Self::__Unknown(value), } } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl StaticType for LineJoin { #[inline] #[doc(alias = "gsk_line_join_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_line_join_get_type()) } } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl glib::HasParamSpec for LineJoin { 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 } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl glib::value::ValueType for LineJoin { type Type = Self; } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] unsafe impl<'a> glib::value::FromValue<'a> for LineJoin { 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)) } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl ToValue for LineJoin { #[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() } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl From for glib::Value { #[inline] fn from(v: LineJoin) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GskMaskMode")] pub enum MaskMode { #[doc(alias = "GSK_MASK_MODE_ALPHA")] Alpha, #[doc(alias = "GSK_MASK_MODE_INVERTED_ALPHA")] InvertedAlpha, #[doc(alias = "GSK_MASK_MODE_LUMINANCE")] Luminance, #[doc(alias = "GSK_MASK_MODE_INVERTED_LUMINANCE")] InvertedLuminance, #[doc(hidden)] __Unknown(i32), } #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] #[doc(hidden)] impl IntoGlib for MaskMode { type GlibType = ffi::GskMaskMode; #[inline] fn into_glib(self) -> ffi::GskMaskMode { match self { Self::Alpha => ffi::GSK_MASK_MODE_ALPHA, Self::InvertedAlpha => ffi::GSK_MASK_MODE_INVERTED_ALPHA, Self::Luminance => ffi::GSK_MASK_MODE_LUMINANCE, Self::InvertedLuminance => ffi::GSK_MASK_MODE_INVERTED_LUMINANCE, Self::__Unknown(value) => value, } } } #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] #[doc(hidden)] impl FromGlib for MaskMode { #[inline] unsafe fn from_glib(value: ffi::GskMaskMode) -> Self { skip_assert_initialized!(); match value { ffi::GSK_MASK_MODE_ALPHA => Self::Alpha, ffi::GSK_MASK_MODE_INVERTED_ALPHA => Self::InvertedAlpha, ffi::GSK_MASK_MODE_LUMINANCE => Self::Luminance, ffi::GSK_MASK_MODE_INVERTED_LUMINANCE => Self::InvertedLuminance, value => Self::__Unknown(value), } } } #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] impl StaticType for MaskMode { #[inline] #[doc(alias = "gsk_mask_mode_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_mask_mode_get_type()) } } } #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] impl glib::HasParamSpec for MaskMode { 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 } } #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] impl glib::value::ValueType for MaskMode { type Type = Self; } #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] unsafe impl<'a> glib::value::FromValue<'a> for MaskMode { 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)) } } #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] impl ToValue for MaskMode { #[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() } } #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] impl From for glib::Value { #[inline] fn from(v: MaskMode) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GskPathDirection")] pub enum PathDirection { #[doc(alias = "GSK_PATH_FROM_START")] FromStart, #[doc(alias = "GSK_PATH_TO_START")] ToStart, #[doc(alias = "GSK_PATH_TO_END")] ToEnd, #[doc(alias = "GSK_PATH_FROM_END")] FromEnd, #[doc(hidden)] __Unknown(i32), } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[doc(hidden)] impl IntoGlib for PathDirection { type GlibType = ffi::GskPathDirection; #[inline] fn into_glib(self) -> ffi::GskPathDirection { match self { Self::FromStart => ffi::GSK_PATH_FROM_START, Self::ToStart => ffi::GSK_PATH_TO_START, Self::ToEnd => ffi::GSK_PATH_TO_END, Self::FromEnd => ffi::GSK_PATH_FROM_END, Self::__Unknown(value) => value, } } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[doc(hidden)] impl FromGlib for PathDirection { #[inline] unsafe fn from_glib(value: ffi::GskPathDirection) -> Self { skip_assert_initialized!(); match value { ffi::GSK_PATH_FROM_START => Self::FromStart, ffi::GSK_PATH_TO_START => Self::ToStart, ffi::GSK_PATH_TO_END => Self::ToEnd, ffi::GSK_PATH_FROM_END => Self::FromEnd, value => Self::__Unknown(value), } } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl StaticType for PathDirection { #[inline] #[doc(alias = "gsk_path_direction_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_path_direction_get_type()) } } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl glib::HasParamSpec for PathDirection { 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 } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl glib::value::ValueType for PathDirection { type Type = Self; } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] unsafe impl<'a> glib::value::FromValue<'a> for PathDirection { 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)) } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl ToValue for PathDirection { #[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() } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl From for glib::Value { #[inline] fn from(v: PathDirection) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GskPathOperation")] pub enum PathOperation { #[doc(alias = "GSK_PATH_MOVE")] Move, #[doc(alias = "GSK_PATH_CLOSE")] Close, #[doc(alias = "GSK_PATH_LINE")] Line, #[doc(alias = "GSK_PATH_QUAD")] Quad, #[doc(alias = "GSK_PATH_CUBIC")] Cubic, #[doc(alias = "GSK_PATH_CONIC")] Conic, #[doc(hidden)] __Unknown(i32), } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[doc(hidden)] impl IntoGlib for PathOperation { type GlibType = ffi::GskPathOperation; #[inline] fn into_glib(self) -> ffi::GskPathOperation { match self { Self::Move => ffi::GSK_PATH_MOVE, Self::Close => ffi::GSK_PATH_CLOSE, Self::Line => ffi::GSK_PATH_LINE, Self::Quad => ffi::GSK_PATH_QUAD, Self::Cubic => ffi::GSK_PATH_CUBIC, Self::Conic => ffi::GSK_PATH_CONIC, Self::__Unknown(value) => value, } } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[doc(hidden)] impl FromGlib for PathOperation { #[inline] unsafe fn from_glib(value: ffi::GskPathOperation) -> Self { skip_assert_initialized!(); match value { ffi::GSK_PATH_MOVE => Self::Move, ffi::GSK_PATH_CLOSE => Self::Close, ffi::GSK_PATH_LINE => Self::Line, ffi::GSK_PATH_QUAD => Self::Quad, ffi::GSK_PATH_CUBIC => Self::Cubic, ffi::GSK_PATH_CONIC => Self::Conic, value => Self::__Unknown(value), } } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl StaticType for PathOperation { #[inline] #[doc(alias = "gsk_path_operation_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_path_operation_get_type()) } } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl glib::HasParamSpec for PathOperation { 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 } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl glib::value::ValueType for PathOperation { type Type = Self; } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] unsafe impl<'a> glib::value::FromValue<'a> for PathOperation { 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)) } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl ToValue for PathOperation { #[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() } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl From for glib::Value { #[inline] fn from(v: PathOperation) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GskRenderNodeType")] pub enum RenderNodeType { #[doc(alias = "GSK_NOT_A_RENDER_NODE")] NotARenderNode, #[doc(alias = "GSK_CONTAINER_NODE")] ContainerNode, #[doc(alias = "GSK_CAIRO_NODE")] CairoNode, #[doc(alias = "GSK_COLOR_NODE")] ColorNode, #[doc(alias = "GSK_LINEAR_GRADIENT_NODE")] LinearGradientNode, #[doc(alias = "GSK_REPEATING_LINEAR_GRADIENT_NODE")] RepeatingLinearGradientNode, #[doc(alias = "GSK_RADIAL_GRADIENT_NODE")] RadialGradientNode, #[doc(alias = "GSK_REPEATING_RADIAL_GRADIENT_NODE")] RepeatingRadialGradientNode, #[doc(alias = "GSK_CONIC_GRADIENT_NODE")] ConicGradientNode, #[doc(alias = "GSK_BORDER_NODE")] BorderNode, #[doc(alias = "GSK_TEXTURE_NODE")] TextureNode, #[doc(alias = "GSK_INSET_SHADOW_NODE")] InsetShadowNode, #[doc(alias = "GSK_OUTSET_SHADOW_NODE")] OutsetShadowNode, #[doc(alias = "GSK_TRANSFORM_NODE")] TransformNode, #[doc(alias = "GSK_OPACITY_NODE")] OpacityNode, #[doc(alias = "GSK_COLOR_MATRIX_NODE")] ColorMatrixNode, #[doc(alias = "GSK_REPEAT_NODE")] RepeatNode, #[doc(alias = "GSK_CLIP_NODE")] ClipNode, #[doc(alias = "GSK_ROUNDED_CLIP_NODE")] RoundedClipNode, #[doc(alias = "GSK_SHADOW_NODE")] ShadowNode, #[doc(alias = "GSK_BLEND_NODE")] BlendNode, #[doc(alias = "GSK_CROSS_FADE_NODE")] CrossFadeNode, #[doc(alias = "GSK_TEXT_NODE")] TextNode, #[doc(alias = "GSK_BLUR_NODE")] BlurNode, #[doc(alias = "GSK_DEBUG_NODE")] DebugNode, #[doc(alias = "GSK_GL_SHADER_NODE")] GlShaderNode, #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] #[doc(alias = "GSK_TEXTURE_SCALE_NODE")] TextureScaleNode, #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] #[doc(alias = "GSK_MASK_NODE")] MaskNode, #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[doc(alias = "GSK_FILL_NODE")] FillNode, #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[doc(alias = "GSK_STROKE_NODE")] StrokeNode, #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[doc(alias = "GSK_SUBSURFACE_NODE")] SubsurfaceNode, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for RenderNodeType { type GlibType = ffi::GskRenderNodeType; fn into_glib(self) -> ffi::GskRenderNodeType { match self { Self::NotARenderNode => ffi::GSK_NOT_A_RENDER_NODE, Self::ContainerNode => ffi::GSK_CONTAINER_NODE, Self::CairoNode => ffi::GSK_CAIRO_NODE, Self::ColorNode => ffi::GSK_COLOR_NODE, Self::LinearGradientNode => ffi::GSK_LINEAR_GRADIENT_NODE, Self::RepeatingLinearGradientNode => ffi::GSK_REPEATING_LINEAR_GRADIENT_NODE, Self::RadialGradientNode => ffi::GSK_RADIAL_GRADIENT_NODE, Self::RepeatingRadialGradientNode => ffi::GSK_REPEATING_RADIAL_GRADIENT_NODE, Self::ConicGradientNode => ffi::GSK_CONIC_GRADIENT_NODE, Self::BorderNode => ffi::GSK_BORDER_NODE, Self::TextureNode => ffi::GSK_TEXTURE_NODE, Self::InsetShadowNode => ffi::GSK_INSET_SHADOW_NODE, Self::OutsetShadowNode => ffi::GSK_OUTSET_SHADOW_NODE, Self::TransformNode => ffi::GSK_TRANSFORM_NODE, Self::OpacityNode => ffi::GSK_OPACITY_NODE, Self::ColorMatrixNode => ffi::GSK_COLOR_MATRIX_NODE, Self::RepeatNode => ffi::GSK_REPEAT_NODE, Self::ClipNode => ffi::GSK_CLIP_NODE, Self::RoundedClipNode => ffi::GSK_ROUNDED_CLIP_NODE, Self::ShadowNode => ffi::GSK_SHADOW_NODE, Self::BlendNode => ffi::GSK_BLEND_NODE, Self::CrossFadeNode => ffi::GSK_CROSS_FADE_NODE, Self::TextNode => ffi::GSK_TEXT_NODE, Self::BlurNode => ffi::GSK_BLUR_NODE, Self::DebugNode => ffi::GSK_DEBUG_NODE, Self::GlShaderNode => ffi::GSK_GL_SHADER_NODE, #[cfg(feature = "v4_10")] Self::TextureScaleNode => ffi::GSK_TEXTURE_SCALE_NODE, #[cfg(feature = "v4_10")] Self::MaskNode => ffi::GSK_MASK_NODE, #[cfg(feature = "v4_14")] Self::FillNode => ffi::GSK_FILL_NODE, #[cfg(feature = "v4_14")] Self::StrokeNode => ffi::GSK_STROKE_NODE, #[cfg(feature = "v4_14")] Self::SubsurfaceNode => ffi::GSK_SUBSURFACE_NODE, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for RenderNodeType { unsafe fn from_glib(value: ffi::GskRenderNodeType) -> Self { skip_assert_initialized!(); match value { ffi::GSK_NOT_A_RENDER_NODE => Self::NotARenderNode, ffi::GSK_CONTAINER_NODE => Self::ContainerNode, ffi::GSK_CAIRO_NODE => Self::CairoNode, ffi::GSK_COLOR_NODE => Self::ColorNode, ffi::GSK_LINEAR_GRADIENT_NODE => Self::LinearGradientNode, ffi::GSK_REPEATING_LINEAR_GRADIENT_NODE => Self::RepeatingLinearGradientNode, ffi::GSK_RADIAL_GRADIENT_NODE => Self::RadialGradientNode, ffi::GSK_REPEATING_RADIAL_GRADIENT_NODE => Self::RepeatingRadialGradientNode, ffi::GSK_CONIC_GRADIENT_NODE => Self::ConicGradientNode, ffi::GSK_BORDER_NODE => Self::BorderNode, ffi::GSK_TEXTURE_NODE => Self::TextureNode, ffi::GSK_INSET_SHADOW_NODE => Self::InsetShadowNode, ffi::GSK_OUTSET_SHADOW_NODE => Self::OutsetShadowNode, ffi::GSK_TRANSFORM_NODE => Self::TransformNode, ffi::GSK_OPACITY_NODE => Self::OpacityNode, ffi::GSK_COLOR_MATRIX_NODE => Self::ColorMatrixNode, ffi::GSK_REPEAT_NODE => Self::RepeatNode, ffi::GSK_CLIP_NODE => Self::ClipNode, ffi::GSK_ROUNDED_CLIP_NODE => Self::RoundedClipNode, ffi::GSK_SHADOW_NODE => Self::ShadowNode, ffi::GSK_BLEND_NODE => Self::BlendNode, ffi::GSK_CROSS_FADE_NODE => Self::CrossFadeNode, ffi::GSK_TEXT_NODE => Self::TextNode, ffi::GSK_BLUR_NODE => Self::BlurNode, ffi::GSK_DEBUG_NODE => Self::DebugNode, ffi::GSK_GL_SHADER_NODE => Self::GlShaderNode, #[cfg(feature = "v4_10")] ffi::GSK_TEXTURE_SCALE_NODE => Self::TextureScaleNode, #[cfg(feature = "v4_10")] ffi::GSK_MASK_NODE => Self::MaskNode, #[cfg(feature = "v4_14")] ffi::GSK_FILL_NODE => Self::FillNode, #[cfg(feature = "v4_14")] ffi::GSK_STROKE_NODE => Self::StrokeNode, #[cfg(feature = "v4_14")] ffi::GSK_SUBSURFACE_NODE => Self::SubsurfaceNode, value => Self::__Unknown(value), } } } impl StaticType for RenderNodeType { #[inline] #[doc(alias = "gsk_render_node_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_render_node_type_get_type()) } } } impl glib::HasParamSpec for RenderNodeType { 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 RenderNodeType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for RenderNodeType { 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 RenderNodeType { #[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: RenderNodeType) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GskScalingFilter")] pub enum ScalingFilter { #[doc(alias = "GSK_SCALING_FILTER_LINEAR")] Linear, #[doc(alias = "GSK_SCALING_FILTER_NEAREST")] Nearest, #[doc(alias = "GSK_SCALING_FILTER_TRILINEAR")] Trilinear, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for ScalingFilter { type GlibType = ffi::GskScalingFilter; #[inline] fn into_glib(self) -> ffi::GskScalingFilter { match self { Self::Linear => ffi::GSK_SCALING_FILTER_LINEAR, Self::Nearest => ffi::GSK_SCALING_FILTER_NEAREST, Self::Trilinear => ffi::GSK_SCALING_FILTER_TRILINEAR, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for ScalingFilter { #[inline] unsafe fn from_glib(value: ffi::GskScalingFilter) -> Self { skip_assert_initialized!(); match value { ffi::GSK_SCALING_FILTER_LINEAR => Self::Linear, ffi::GSK_SCALING_FILTER_NEAREST => Self::Nearest, ffi::GSK_SCALING_FILTER_TRILINEAR => Self::Trilinear, value => Self::__Unknown(value), } } } impl StaticType for ScalingFilter { #[inline] #[doc(alias = "gsk_scaling_filter_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_scaling_filter_get_type()) } } } impl glib::HasParamSpec for ScalingFilter { 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 ScalingFilter { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for ScalingFilter { 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 ScalingFilter { #[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: ScalingFilter) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GskSerializationError")] pub enum SerializationError { #[doc(alias = "GSK_SERIALIZATION_UNSUPPORTED_FORMAT")] UnsupportedFormat, #[doc(alias = "GSK_SERIALIZATION_UNSUPPORTED_VERSION")] UnsupportedVersion, #[doc(alias = "GSK_SERIALIZATION_INVALID_DATA")] InvalidData, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for SerializationError { type GlibType = ffi::GskSerializationError; #[inline] fn into_glib(self) -> ffi::GskSerializationError { match self { Self::UnsupportedFormat => ffi::GSK_SERIALIZATION_UNSUPPORTED_FORMAT, Self::UnsupportedVersion => ffi::GSK_SERIALIZATION_UNSUPPORTED_VERSION, Self::InvalidData => ffi::GSK_SERIALIZATION_INVALID_DATA, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for SerializationError { #[inline] unsafe fn from_glib(value: ffi::GskSerializationError) -> Self { skip_assert_initialized!(); match value { ffi::GSK_SERIALIZATION_UNSUPPORTED_FORMAT => Self::UnsupportedFormat, ffi::GSK_SERIALIZATION_UNSUPPORTED_VERSION => Self::UnsupportedVersion, ffi::GSK_SERIALIZATION_INVALID_DATA => Self::InvalidData, value => Self::__Unknown(value), } } } impl glib::error::ErrorDomain for SerializationError { #[inline] fn domain() -> glib::Quark { skip_assert_initialized!(); unsafe { from_glib(ffi::gsk_serialization_error_quark()) } } #[inline] fn code(self) -> i32 { self.into_glib() } #[inline] #[allow(clippy::match_single_binding)] fn from(code: i32) -> Option { skip_assert_initialized!(); match unsafe { from_glib(code) } { value => Some(value), } } } impl StaticType for SerializationError { #[inline] #[doc(alias = "gsk_serialization_error_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_serialization_error_get_type()) } } } impl glib::HasParamSpec for SerializationError { 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 SerializationError { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for SerializationError { 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 SerializationError { #[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: SerializationError) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GskTransformCategory")] pub enum TransformCategory { #[doc(alias = "GSK_TRANSFORM_CATEGORY_UNKNOWN")] Unknown, #[doc(alias = "GSK_TRANSFORM_CATEGORY_ANY")] Any, #[doc(alias = "GSK_TRANSFORM_CATEGORY_3D")] _3d, #[doc(alias = "GSK_TRANSFORM_CATEGORY_2D")] _2d, #[doc(alias = "GSK_TRANSFORM_CATEGORY_2D_AFFINE")] _2dAffine, #[doc(alias = "GSK_TRANSFORM_CATEGORY_2D_TRANSLATE")] _2dTranslate, #[doc(alias = "GSK_TRANSFORM_CATEGORY_IDENTITY")] Identity, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for TransformCategory { type GlibType = ffi::GskTransformCategory; #[inline] fn into_glib(self) -> ffi::GskTransformCategory { match self { Self::Unknown => ffi::GSK_TRANSFORM_CATEGORY_UNKNOWN, Self::Any => ffi::GSK_TRANSFORM_CATEGORY_ANY, Self::_3d => ffi::GSK_TRANSFORM_CATEGORY_3D, Self::_2d => ffi::GSK_TRANSFORM_CATEGORY_2D, Self::_2dAffine => ffi::GSK_TRANSFORM_CATEGORY_2D_AFFINE, Self::_2dTranslate => ffi::GSK_TRANSFORM_CATEGORY_2D_TRANSLATE, Self::Identity => ffi::GSK_TRANSFORM_CATEGORY_IDENTITY, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for TransformCategory { #[inline] unsafe fn from_glib(value: ffi::GskTransformCategory) -> Self { skip_assert_initialized!(); match value { ffi::GSK_TRANSFORM_CATEGORY_UNKNOWN => Self::Unknown, ffi::GSK_TRANSFORM_CATEGORY_ANY => Self::Any, ffi::GSK_TRANSFORM_CATEGORY_3D => Self::_3d, ffi::GSK_TRANSFORM_CATEGORY_2D => Self::_2d, ffi::GSK_TRANSFORM_CATEGORY_2D_AFFINE => Self::_2dAffine, ffi::GSK_TRANSFORM_CATEGORY_2D_TRANSLATE => Self::_2dTranslate, ffi::GSK_TRANSFORM_CATEGORY_IDENTITY => Self::Identity, value => Self::__Unknown(value), } } } impl StaticType for TransformCategory { #[inline] #[doc(alias = "gsk_transform_category_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_transform_category_get_type()) } } } impl glib::HasParamSpec for TransformCategory { 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 TransformCategory { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for TransformCategory { 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 TransformCategory { #[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: TransformCategory) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } gsk4-0.9.6/src/auto/fill_node.rs000064400000000000000000000032421046102023000145510ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, FillRule, Path, RenderNode}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskFillNode")] pub struct FillNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for FillNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_fill_node_get_type()) } } } impl FillNode { #[doc(alias = "gsk_fill_node_new")] pub fn new(child: impl AsRef, path: &Path, fill_rule: FillRule) -> FillNode { skip_assert_initialized!(); unsafe { from_glib_none(ffi::gsk_fill_node_new( child.as_ref().to_glib_none().0, path.to_glib_none().0, fill_rule.into_glib(), )) } } #[doc(alias = "gsk_fill_node_get_child")] #[doc(alias = "get_child")] pub fn child(&self) -> RenderNode { unsafe { from_glib_none(ffi::gsk_fill_node_get_child(self.to_glib_none().0)) } } #[doc(alias = "gsk_fill_node_get_fill_rule")] #[doc(alias = "get_fill_rule")] pub fn fill_rule(&self) -> FillRule { unsafe { from_glib(ffi::gsk_fill_node_get_fill_rule(self.to_glib_none().0)) } } #[doc(alias = "gsk_fill_node_get_path")] #[doc(alias = "get_path")] pub fn path(&self) -> Path { unsafe { from_glib_none(ffi::gsk_fill_node_get_path(self.to_glib_none().0)) } } } gsk4-0.9.6/src/auto/flags.rs000064400000000000000000000066671046102023000137300ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] use glib::{bitflags::bitflags, prelude::*, translate::*}; #[cfg(feature = "v4_14")] bitflags! { #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "GskPathForeachFlags")] pub struct PathForeachFlags: u32 { #[doc(alias = "GSK_PATH_FOREACH_ALLOW_ONLY_LINES")] const ONLY_LINES = ffi::GSK_PATH_FOREACH_ALLOW_ONLY_LINES as _; #[doc(alias = "GSK_PATH_FOREACH_ALLOW_QUAD")] const QUAD = ffi::GSK_PATH_FOREACH_ALLOW_QUAD as _; #[doc(alias = "GSK_PATH_FOREACH_ALLOW_CUBIC")] const CUBIC = ffi::GSK_PATH_FOREACH_ALLOW_CUBIC as _; #[doc(alias = "GSK_PATH_FOREACH_ALLOW_CONIC")] const CONIC = ffi::GSK_PATH_FOREACH_ALLOW_CONIC as _; } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[doc(hidden)] impl IntoGlib for PathForeachFlags { type GlibType = ffi::GskPathForeachFlags; #[inline] fn into_glib(self) -> ffi::GskPathForeachFlags { self.bits() } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[doc(hidden)] impl FromGlib for PathForeachFlags { #[inline] unsafe fn from_glib(value: ffi::GskPathForeachFlags) -> Self { skip_assert_initialized!(); Self::from_bits_truncate(value) } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl StaticType for PathForeachFlags { #[inline] #[doc(alias = "gsk_path_foreach_flags_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_path_foreach_flags_get_type()) } } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl glib::HasParamSpec for PathForeachFlags { type ParamSpec = glib::ParamSpecFlags; type SetValue = Self; type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl glib::value::ValueType for PathForeachFlags { type Type = Self; } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] unsafe impl<'a> glib::value::FromValue<'a> for PathForeachFlags { 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_flags(value.to_glib_none().0)) } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl ToValue for PathForeachFlags { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl From for glib::Value { #[inline] fn from(v: PathForeachFlags) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } gsk4-0.9.6/src/auto/gl_renderer.rs000064400000000000000000000013561046102023000151120ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Renderer}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskGLRenderer")] pub struct GLRenderer(Object) @extends Renderer; match fn { type_ => || ffi::gsk_gl_renderer_get_type(), } } impl GLRenderer { #[doc(alias = "gsk_gl_renderer_new")] pub fn new() -> GLRenderer { assert_initialized_main_thread!(); unsafe { Renderer::from_glib_full(ffi::gsk_gl_renderer_new()).unsafe_cast() } } } impl Default for GLRenderer { fn default() -> Self { Self::new() } } gsk4-0.9.6/src/auto/gl_shader.rs000064400000000000000000000175171046102023000145600ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT #![allow(deprecated)] use crate::{ffi, GLUniformType, Renderer}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskGLShader")] pub struct GLShader(Object); match fn { type_ => || ffi::gsk_gl_shader_get_type(), } } impl GLShader { #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_new_from_bytes")] #[doc(alias = "new_from_bytes")] pub fn from_bytes(sourcecode: &glib::Bytes) -> GLShader { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gsk_gl_shader_new_from_bytes( sourcecode.to_glib_none().0, )) } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_new_from_resource")] #[doc(alias = "new_from_resource")] pub fn from_resource(resource_path: &str) -> GLShader { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gsk_gl_shader_new_from_resource( resource_path.to_glib_none().0, )) } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`GLShader`] objects. /// /// This method returns an instance of [`GLShaderBuilder`](crate::builders::GLShaderBuilder) which can be used to create [`GLShader`] objects. pub fn builder() -> GLShaderBuilder { GLShaderBuilder::new() } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_compile")] pub fn compile(&self, renderer: &impl IsA) -> Result<(), glib::Error> { unsafe { let mut error = std::ptr::null_mut(); let is_ok = ffi::gsk_gl_shader_compile( self.to_glib_none().0, renderer.as_ref().to_glib_none().0, &mut error, ); debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_find_uniform_by_name")] pub fn find_uniform_by_name(&self, name: &str) -> i32 { unsafe { ffi::gsk_gl_shader_find_uniform_by_name(self.to_glib_none().0, name.to_glib_none().0) } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_get_arg_bool")] #[doc(alias = "get_arg_bool")] pub fn arg_bool(&self, args: &glib::Bytes, idx: i32) -> bool { unsafe { from_glib(ffi::gsk_gl_shader_get_arg_bool( self.to_glib_none().0, args.to_glib_none().0, idx, )) } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_get_arg_float")] #[doc(alias = "get_arg_float")] pub fn arg_float(&self, args: &glib::Bytes, idx: i32) -> f32 { unsafe { ffi::gsk_gl_shader_get_arg_float(self.to_glib_none().0, args.to_glib_none().0, idx) } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_get_arg_int")] #[doc(alias = "get_arg_int")] pub fn arg_int(&self, args: &glib::Bytes, idx: i32) -> i32 { unsafe { ffi::gsk_gl_shader_get_arg_int(self.to_glib_none().0, args.to_glib_none().0, idx) } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_get_arg_uint")] #[doc(alias = "get_arg_uint")] pub fn arg_uint(&self, args: &glib::Bytes, idx: i32) -> u32 { unsafe { ffi::gsk_gl_shader_get_arg_uint(self.to_glib_none().0, args.to_glib_none().0, idx) } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_get_args_size")] #[doc(alias = "get_args_size")] pub fn args_size(&self) -> usize { unsafe { ffi::gsk_gl_shader_get_args_size(self.to_glib_none().0) } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_get_n_textures")] #[doc(alias = "get_n_textures")] pub fn n_textures(&self) -> i32 { unsafe { ffi::gsk_gl_shader_get_n_textures(self.to_glib_none().0) } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_get_n_uniforms")] #[doc(alias = "get_n_uniforms")] pub fn n_uniforms(&self) -> i32 { unsafe { ffi::gsk_gl_shader_get_n_uniforms(self.to_glib_none().0) } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_get_resource")] #[doc(alias = "get_resource")] pub fn resource(&self) -> Option { unsafe { from_glib_none(ffi::gsk_gl_shader_get_resource(self.to_glib_none().0)) } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_get_source")] #[doc(alias = "get_source")] pub fn source(&self) -> glib::Bytes { unsafe { from_glib_none(ffi::gsk_gl_shader_get_source(self.to_glib_none().0)) } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_get_uniform_name")] #[doc(alias = "get_uniform_name")] pub fn uniform_name(&self, idx: i32) -> glib::GString { unsafe { from_glib_none(ffi::gsk_gl_shader_get_uniform_name( self.to_glib_none().0, idx, )) } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_get_uniform_offset")] #[doc(alias = "get_uniform_offset")] pub fn uniform_offset(&self, idx: i32) -> i32 { unsafe { ffi::gsk_gl_shader_get_uniform_offset(self.to_glib_none().0, idx) } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_get_uniform_type")] #[doc(alias = "get_uniform_type")] pub fn uniform_type(&self, idx: i32) -> GLUniformType { unsafe { from_glib(ffi::gsk_gl_shader_get_uniform_type( self.to_glib_none().0, idx, )) } } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`GLShader`] 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 GLShaderBuilder { builder: glib::object::ObjectBuilder<'static, GLShader>, } impl GLShaderBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn resource(self, resource: impl Into) -> Self { Self { builder: self.builder.property("resource", resource.into()), } } pub fn source(self, source: &glib::Bytes) -> Self { Self { builder: self.builder.property("source", source.clone()), } } // rustdoc-stripper-ignore-next /// Build the [`GLShader`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> GLShader { assert_initialized_main_thread!(); self.builder.build() } } gsk4-0.9.6/src/auto/gl_shader_node.rs000064400000000000000000000042471046102023000155610ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT #![allow(deprecated)] use crate::{ffi, GLShader, RenderNode}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskGLShaderNode")] pub struct GLShaderNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for GLShaderNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_gl_shader_node_get_type()) } } } impl GLShaderNode { #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_node_new")] pub fn new( shader: &GLShader, bounds: &graphene::Rect, args: &glib::Bytes, children: &[RenderNode], ) -> GLShaderNode { skip_assert_initialized!(); let n_children = children.len() as _; unsafe { from_glib_full(ffi::gsk_gl_shader_node_new( shader.to_glib_none().0, bounds.to_glib_none().0, args.to_glib_none().0, children.to_glib_none().0, n_children, )) } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_node_get_args")] #[doc(alias = "get_args")] pub fn args(&self) -> glib::Bytes { unsafe { from_glib_none(ffi::gsk_gl_shader_node_get_args(self.to_glib_none().0)) } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_gl_shader_node_get_n_children")] #[doc(alias = "get_n_children")] pub fn n_children(&self) -> u32 { unsafe { ffi::gsk_gl_shader_node_get_n_children(self.to_glib_none().0) } } #[doc(alias = "gsk_gl_shader_node_get_shader")] #[doc(alias = "get_shader")] pub fn shader(&self) -> GLShader { unsafe { from_glib_none(ffi::gsk_gl_shader_node_get_shader(self.to_glib_none().0)) } } } gsk4-0.9.6/src/auto/inset_shadow_node.rs000064400000000000000000000050351046102023000163140ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, RoundedRect}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskInsetShadowNode")] pub struct InsetShadowNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for InsetShadowNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_inset_shadow_node_get_type()) } } } impl InsetShadowNode { #[doc(alias = "gsk_inset_shadow_node_new")] pub fn new( outline: &RoundedRect, color: &gdk::RGBA, dx: f32, dy: f32, spread: f32, blur_radius: f32, ) -> InsetShadowNode { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gsk_inset_shadow_node_new( outline.to_glib_none().0, color.to_glib_none().0, dx, dy, spread, blur_radius, )) } } #[doc(alias = "gsk_inset_shadow_node_get_blur_radius")] #[doc(alias = "get_blur_radius")] pub fn blur_radius(&self) -> f32 { unsafe { ffi::gsk_inset_shadow_node_get_blur_radius(self.to_glib_none().0) } } #[doc(alias = "gsk_inset_shadow_node_get_color")] #[doc(alias = "get_color")] pub fn color(&self) -> gdk::RGBA { unsafe { from_glib_none(ffi::gsk_inset_shadow_node_get_color(self.to_glib_none().0)) } } #[doc(alias = "gsk_inset_shadow_node_get_dx")] #[doc(alias = "get_dx")] pub fn dx(&self) -> f32 { unsafe { ffi::gsk_inset_shadow_node_get_dx(self.to_glib_none().0) } } #[doc(alias = "gsk_inset_shadow_node_get_dy")] #[doc(alias = "get_dy")] pub fn dy(&self) -> f32 { unsafe { ffi::gsk_inset_shadow_node_get_dy(self.to_glib_none().0) } } #[doc(alias = "gsk_inset_shadow_node_get_outline")] #[doc(alias = "get_outline")] pub fn outline(&self) -> RoundedRect { unsafe { from_glib_none(ffi::gsk_inset_shadow_node_get_outline( self.to_glib_none().0, )) } } #[doc(alias = "gsk_inset_shadow_node_get_spread")] #[doc(alias = "get_spread")] pub fn spread(&self) -> f32 { unsafe { ffi::gsk_inset_shadow_node_get_spread(self.to_glib_none().0) } } } gsk4-0.9.6/src/auto/linear_gradient_node.rs000064400000000000000000000051421046102023000167530ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, ColorStop}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskLinearGradientNode")] pub struct LinearGradientNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for LinearGradientNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_linear_gradient_node_get_type()) } } } impl LinearGradientNode { #[doc(alias = "gsk_linear_gradient_node_new")] pub fn new( bounds: &graphene::Rect, start: &graphene::Point, end: &graphene::Point, color_stops: &[ColorStop], ) -> LinearGradientNode { assert_initialized_main_thread!(); let n_color_stops = color_stops.len() as _; unsafe { from_glib_full(ffi::gsk_linear_gradient_node_new( bounds.to_glib_none().0, start.to_glib_none().0, end.to_glib_none().0, color_stops.to_glib_none().0, n_color_stops, )) } } #[doc(alias = "gsk_linear_gradient_node_get_color_stops")] #[doc(alias = "get_color_stops")] pub fn color_stops(&self) -> Vec { unsafe { let mut n_stops = std::mem::MaybeUninit::uninit(); let ret = FromGlibContainer::from_glib_none_num( ffi::gsk_linear_gradient_node_get_color_stops( self.to_glib_none().0, n_stops.as_mut_ptr(), ), n_stops.assume_init() as _, ); ret } } #[doc(alias = "gsk_linear_gradient_node_get_end")] #[doc(alias = "get_end")] pub fn end(&self) -> graphene::Point { unsafe { from_glib_none(ffi::gsk_linear_gradient_node_get_end(self.to_glib_none().0)) } } #[doc(alias = "gsk_linear_gradient_node_get_n_color_stops")] #[doc(alias = "get_n_color_stops")] pub fn n_color_stops(&self) -> usize { unsafe { ffi::gsk_linear_gradient_node_get_n_color_stops(self.to_glib_none().0) } } #[doc(alias = "gsk_linear_gradient_node_get_start")] #[doc(alias = "get_start")] pub fn start(&self) -> graphene::Point { unsafe { from_glib_none(ffi::gsk_linear_gradient_node_get_start( self.to_glib_none().0, )) } } } gsk4-0.9.6/src/auto/mask_node.rs000064400000000000000000000033411046102023000145560ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, MaskMode, RenderNode}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskMaskNode")] pub struct MaskNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for MaskNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_mask_node_get_type()) } } } impl MaskNode { #[doc(alias = "gsk_mask_node_new")] pub fn new( source: impl AsRef, mask: impl AsRef, mask_mode: MaskMode, ) -> MaskNode { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gsk_mask_node_new( source.as_ref().to_glib_none().0, mask.as_ref().to_glib_none().0, mask_mode.into_glib(), )) } } #[doc(alias = "gsk_mask_node_get_mask")] #[doc(alias = "get_mask")] pub fn mask(&self) -> RenderNode { unsafe { from_glib_none(ffi::gsk_mask_node_get_mask(self.to_glib_none().0)) } } #[doc(alias = "gsk_mask_node_get_mask_mode")] #[doc(alias = "get_mask_mode")] pub fn mask_mode(&self) -> MaskMode { unsafe { from_glib(ffi::gsk_mask_node_get_mask_mode(self.to_glib_none().0)) } } #[doc(alias = "gsk_mask_node_get_source")] #[doc(alias = "get_source")] pub fn source(&self) -> RenderNode { unsafe { from_glib_none(ffi::gsk_mask_node_get_source(self.to_glib_none().0)) } } } gsk4-0.9.6/src/auto/mod.rs000064400000000000000000000133561046102023000134040ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT mod blend_node; pub use self::blend_node::BlendNode; mod blur_node; pub use self::blur_node::BlurNode; mod border_node; pub use self::border_node::BorderNode; #[cfg(feature = "broadway")] #[cfg_attr(docsrs, doc(cfg(feature = "broadway")))] mod broadway_renderer; #[cfg(feature = "broadway")] #[cfg_attr(docsrs, doc(cfg(feature = "broadway")))] pub use self::broadway_renderer::BroadwayRenderer; mod cairo_node; pub use self::cairo_node::CairoNode; mod cairo_renderer; pub use self::cairo_renderer::CairoRenderer; mod clip_node; pub use self::clip_node::ClipNode; mod color_matrix_node; pub use self::color_matrix_node::ColorMatrixNode; mod color_node; pub use self::color_node::ColorNode; mod conic_gradient_node; pub use self::conic_gradient_node::ConicGradientNode; mod container_node; pub use self::container_node::ContainerNode; mod cross_fade_node; pub use self::cross_fade_node::CrossFadeNode; mod debug_node; pub use self::debug_node::DebugNode; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] mod fill_node; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] pub use self::fill_node::FillNode; #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] mod gl_renderer; #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub use self::gl_renderer::GLRenderer; mod gl_shader; pub use self::gl_shader::GLShader; mod gl_shader_node; pub use self::gl_shader_node::GLShaderNode; mod inset_shadow_node; pub use self::inset_shadow_node::InsetShadowNode; mod linear_gradient_node; pub use self::linear_gradient_node::LinearGradientNode; #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] mod mask_node; #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] pub use self::mask_node::MaskNode; mod opacity_node; pub use self::opacity_node::OpacityNode; mod outset_shadow_node; pub use self::outset_shadow_node::OutsetShadowNode; mod radial_gradient_node; pub use self::radial_gradient_node::RadialGradientNode; mod render_node; pub use self::render_node::RenderNode; mod renderer; pub use self::renderer::Renderer; mod repeat_node; pub use self::repeat_node::RepeatNode; mod repeating_linear_gradient_node; pub use self::repeating_linear_gradient_node::RepeatingLinearGradientNode; mod repeating_radial_gradient_node; pub use self::repeating_radial_gradient_node::RepeatingRadialGradientNode; mod rounded_clip_node; pub use self::rounded_clip_node::RoundedClipNode; mod shadow_node; pub use self::shadow_node::ShadowNode; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] mod stroke_node; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] pub use self::stroke_node::StrokeNode; mod text_node; pub use self::text_node::TextNode; mod texture_node; pub use self::texture_node::TextureNode; #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] mod texture_scale_node; #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] pub use self::texture_scale_node::TextureScaleNode; mod transform_node; pub use self::transform_node::TransformNode; #[cfg(feature = "vulkan")] #[cfg_attr(docsrs, doc(cfg(feature = "vulkan")))] mod vulkan_renderer; #[cfg(feature = "vulkan")] #[cfg_attr(docsrs, doc(cfg(feature = "vulkan")))] pub use self::vulkan_renderer::VulkanRenderer; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] mod path; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] pub use self::path::Path; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] mod path_builder; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] pub use self::path_builder::PathBuilder; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] mod path_measure; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] pub use self::path_measure::PathMeasure; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] mod path_point; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] pub use self::path_point::PathPoint; mod shader_args_builder; pub use self::shader_args_builder::ShaderArgsBuilder; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] mod stroke; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] pub use self::stroke::Stroke; mod transform; pub use self::transform::Transform; mod enums; pub use self::enums::BlendMode; pub use self::enums::Corner; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] pub use self::enums::FillRule; pub use self::enums::GLUniformType; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] pub use self::enums::LineCap; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] pub use self::enums::LineJoin; #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] pub use self::enums::MaskMode; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] pub use self::enums::PathDirection; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] pub use self::enums::PathOperation; pub use self::enums::RenderNodeType; pub use self::enums::ScalingFilter; pub use self::enums::SerializationError; pub use self::enums::TransformCategory; mod flags; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] pub use self::flags::PathForeachFlags; pub(crate) mod traits { pub use super::renderer::GskRendererExt; } pub(crate) mod builders { pub use super::gl_shader::GLShaderBuilder; } gsk4-0.9.6/src/auto/opacity_node.rs000064400000000000000000000026161046102023000152770ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, RenderNode}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskOpacityNode")] pub struct OpacityNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for OpacityNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_opacity_node_get_type()) } } } impl OpacityNode { #[doc(alias = "gsk_opacity_node_new")] pub fn new(child: impl AsRef, opacity: f32) -> OpacityNode { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gsk_opacity_node_new( child.as_ref().to_glib_none().0, opacity, )) } } #[doc(alias = "gsk_opacity_node_get_child")] #[doc(alias = "get_child")] pub fn child(&self) -> RenderNode { unsafe { from_glib_none(ffi::gsk_opacity_node_get_child(self.to_glib_none().0)) } } #[doc(alias = "gsk_opacity_node_get_opacity")] #[doc(alias = "get_opacity")] pub fn opacity(&self) -> f32 { unsafe { ffi::gsk_opacity_node_get_opacity(self.to_glib_none().0) } } } gsk4-0.9.6/src/auto/outset_shadow_node.rs000064400000000000000000000050621046102023000165150ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, RoundedRect}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskOutsetShadowNode")] pub struct OutsetShadowNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for OutsetShadowNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_outset_shadow_node_get_type()) } } } impl OutsetShadowNode { #[doc(alias = "gsk_outset_shadow_node_new")] pub fn new( outline: &RoundedRect, color: &gdk::RGBA, dx: f32, dy: f32, spread: f32, blur_radius: f32, ) -> OutsetShadowNode { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gsk_outset_shadow_node_new( outline.to_glib_none().0, color.to_glib_none().0, dx, dy, spread, blur_radius, )) } } #[doc(alias = "gsk_outset_shadow_node_get_blur_radius")] #[doc(alias = "get_blur_radius")] pub fn blur_radius(&self) -> f32 { unsafe { ffi::gsk_outset_shadow_node_get_blur_radius(self.to_glib_none().0) } } #[doc(alias = "gsk_outset_shadow_node_get_color")] #[doc(alias = "get_color")] pub fn color(&self) -> gdk::RGBA { unsafe { from_glib_none(ffi::gsk_outset_shadow_node_get_color(self.to_glib_none().0)) } } #[doc(alias = "gsk_outset_shadow_node_get_dx")] #[doc(alias = "get_dx")] pub fn dx(&self) -> f32 { unsafe { ffi::gsk_outset_shadow_node_get_dx(self.to_glib_none().0) } } #[doc(alias = "gsk_outset_shadow_node_get_dy")] #[doc(alias = "get_dy")] pub fn dy(&self) -> f32 { unsafe { ffi::gsk_outset_shadow_node_get_dy(self.to_glib_none().0) } } #[doc(alias = "gsk_outset_shadow_node_get_outline")] #[doc(alias = "get_outline")] pub fn outline(&self) -> RoundedRect { unsafe { from_glib_none(ffi::gsk_outset_shadow_node_get_outline( self.to_glib_none().0, )) } } #[doc(alias = "gsk_outset_shadow_node_get_spread")] #[doc(alias = "get_spread")] pub fn spread(&self) -> f32 { unsafe { ffi::gsk_outset_shadow_node_get_spread(self.to_glib_none().0) } } } gsk4-0.9.6/src/auto/path.rs000064400000000000000000000114641046102023000135570ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, FillRule, PathPoint, Stroke}; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Path(Shared); match fn { ref => |ptr| ffi::gsk_path_ref(ptr), unref => |ptr| ffi::gsk_path_unref(ptr), type_ => || ffi::gsk_path_get_type(), } } impl Path { #[doc(alias = "gsk_path_get_bounds")] #[doc(alias = "get_bounds")] pub fn bounds(&self) -> Option { unsafe { let mut bounds = graphene::Rect::uninitialized(); let ret = from_glib(ffi::gsk_path_get_bounds( self.to_glib_none().0, bounds.to_glib_none_mut().0, )); if ret { Some(bounds) } else { None } } } #[doc(alias = "gsk_path_get_closest_point")] #[doc(alias = "get_closest_point")] pub fn closest_point( &self, point: &graphene::Point, threshold: f32, ) -> Option<(PathPoint, f32)> { unsafe { let mut result = PathPoint::uninitialized(); let mut distance = std::mem::MaybeUninit::uninit(); let ret = from_glib(ffi::gsk_path_get_closest_point( self.to_glib_none().0, point.to_glib_none().0, threshold, result.to_glib_none_mut().0, distance.as_mut_ptr(), )); if ret { Some((result, distance.assume_init())) } else { None } } } #[doc(alias = "gsk_path_get_end_point")] #[doc(alias = "get_end_point")] pub fn end_point(&self) -> Option { unsafe { let mut result = PathPoint::uninitialized(); let ret = from_glib(ffi::gsk_path_get_end_point( self.to_glib_none().0, result.to_glib_none_mut().0, )); if ret { Some(result) } else { None } } } #[doc(alias = "gsk_path_get_start_point")] #[doc(alias = "get_start_point")] pub fn start_point(&self) -> Option { unsafe { let mut result = PathPoint::uninitialized(); let ret = from_glib(ffi::gsk_path_get_start_point( self.to_glib_none().0, result.to_glib_none_mut().0, )); if ret { Some(result) } else { None } } } #[doc(alias = "gsk_path_get_stroke_bounds")] #[doc(alias = "get_stroke_bounds")] pub fn stroke_bounds(&self, stroke: &Stroke) -> Option { unsafe { let mut bounds = graphene::Rect::uninitialized(); let ret = from_glib(ffi::gsk_path_get_stroke_bounds( self.to_glib_none().0, stroke.to_glib_none().0, bounds.to_glib_none_mut().0, )); if ret { Some(bounds) } else { None } } } #[doc(alias = "gsk_path_in_fill")] pub fn in_fill(&self, point: &graphene::Point, fill_rule: FillRule) -> bool { unsafe { from_glib(ffi::gsk_path_in_fill( self.to_glib_none().0, point.to_glib_none().0, fill_rule.into_glib(), )) } } #[doc(alias = "gsk_path_is_closed")] pub fn is_closed(&self) -> bool { unsafe { from_glib(ffi::gsk_path_is_closed(self.to_glib_none().0)) } } #[doc(alias = "gsk_path_is_empty")] pub fn is_empty(&self) -> bool { unsafe { from_glib(ffi::gsk_path_is_empty(self.to_glib_none().0)) } } #[doc(alias = "gsk_path_to_cairo")] pub fn to_cairo(&self, cr: &cairo::Context) { unsafe { ffi::gsk_path_to_cairo(self.to_glib_none().0, mut_override(cr.to_glib_none().0)); } } #[doc(alias = "gsk_path_to_string")] #[doc(alias = "to_string")] pub fn to_str(&self) -> glib::GString { unsafe { from_glib_full(ffi::gsk_path_to_string(self.to_glib_none().0)) } } #[doc(alias = "gsk_path_parse")] pub fn parse(string: &str) -> Result { assert_initialized_main_thread!(); unsafe { Option::<_>::from_glib_full(ffi::gsk_path_parse(string.to_glib_none().0)) .ok_or_else(|| glib::bool_error!("Can't parse Path")) } } } impl std::fmt::Display for Path { #[inline] fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.write_str(&self.to_str()) } } gsk4-0.9.6/src/auto/path_builder.rs000064400000000000000000000173151046102023000152660ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Path, PathPoint, RoundedRect}; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct PathBuilder(Shared); match fn { ref => |ptr| ffi::gsk_path_builder_ref(ptr), unref => |ptr| ffi::gsk_path_builder_unref(ptr), type_ => || ffi::gsk_path_builder_get_type(), } } impl PathBuilder { #[doc(alias = "gsk_path_builder_new")] pub fn new() -> PathBuilder { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gsk_path_builder_new()) } } #[doc(alias = "gsk_path_builder_add_circle")] pub fn add_circle(&self, center: &graphene::Point, radius: f32) { unsafe { ffi::gsk_path_builder_add_circle( self.to_glib_none().0, center.to_glib_none().0, radius, ); } } #[doc(alias = "gsk_path_builder_add_layout")] pub fn add_layout(&self, layout: &pango::Layout) { unsafe { ffi::gsk_path_builder_add_layout(self.to_glib_none().0, layout.to_glib_none().0); } } #[doc(alias = "gsk_path_builder_add_path")] pub fn add_path(&self, path: &Path) { unsafe { ffi::gsk_path_builder_add_path(self.to_glib_none().0, path.to_glib_none().0); } } #[doc(alias = "gsk_path_builder_add_rect")] pub fn add_rect(&self, rect: &graphene::Rect) { unsafe { ffi::gsk_path_builder_add_rect(self.to_glib_none().0, rect.to_glib_none().0); } } #[doc(alias = "gsk_path_builder_add_reverse_path")] pub fn add_reverse_path(&self, path: &Path) { unsafe { ffi::gsk_path_builder_add_reverse_path(self.to_glib_none().0, path.to_glib_none().0); } } #[doc(alias = "gsk_path_builder_add_rounded_rect")] pub fn add_rounded_rect(&self, rect: &RoundedRect) { unsafe { ffi::gsk_path_builder_add_rounded_rect(self.to_glib_none().0, rect.to_glib_none().0); } } #[doc(alias = "gsk_path_builder_add_segment")] pub fn add_segment(&self, path: &Path, start: &PathPoint, end: &PathPoint) { unsafe { ffi::gsk_path_builder_add_segment( self.to_glib_none().0, path.to_glib_none().0, start.to_glib_none().0, end.to_glib_none().0, ); } } #[doc(alias = "gsk_path_builder_arc_to")] pub fn arc_to(&self, x1: f32, y1: f32, x2: f32, y2: f32) { unsafe { ffi::gsk_path_builder_arc_to(self.to_glib_none().0, x1, y1, x2, y2); } } #[doc(alias = "gsk_path_builder_close")] pub fn close(&self) { unsafe { ffi::gsk_path_builder_close(self.to_glib_none().0); } } #[doc(alias = "gsk_path_builder_conic_to")] pub fn conic_to(&self, x1: f32, y1: f32, x2: f32, y2: f32, weight: f32) { unsafe { ffi::gsk_path_builder_conic_to(self.to_glib_none().0, x1, y1, x2, y2, weight); } } #[doc(alias = "gsk_path_builder_cubic_to")] pub fn cubic_to(&self, x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32) { unsafe { ffi::gsk_path_builder_cubic_to(self.to_glib_none().0, x1, y1, x2, y2, x3, y3); } } #[doc(alias = "gsk_path_builder_get_current_point")] #[doc(alias = "get_current_point")] pub fn current_point(&self) -> graphene::Point { unsafe { from_glib_none(ffi::gsk_path_builder_get_current_point( self.to_glib_none().0, )) } } #[doc(alias = "gsk_path_builder_html_arc_to")] pub fn html_arc_to(&self, x1: f32, y1: f32, x2: f32, y2: f32, radius: f32) { unsafe { ffi::gsk_path_builder_html_arc_to(self.to_glib_none().0, x1, y1, x2, y2, radius); } } #[doc(alias = "gsk_path_builder_line_to")] pub fn line_to(&self, x: f32, y: f32) { unsafe { ffi::gsk_path_builder_line_to(self.to_glib_none().0, x, y); } } #[doc(alias = "gsk_path_builder_move_to")] pub fn move_to(&self, x: f32, y: f32) { unsafe { ffi::gsk_path_builder_move_to(self.to_glib_none().0, x, y); } } #[doc(alias = "gsk_path_builder_quad_to")] pub fn quad_to(&self, x1: f32, y1: f32, x2: f32, y2: f32) { unsafe { ffi::gsk_path_builder_quad_to(self.to_glib_none().0, x1, y1, x2, y2); } } #[doc(alias = "gsk_path_builder_rel_arc_to")] pub fn rel_arc_to(&self, x1: f32, y1: f32, x2: f32, y2: f32) { unsafe { ffi::gsk_path_builder_rel_arc_to(self.to_glib_none().0, x1, y1, x2, y2); } } #[doc(alias = "gsk_path_builder_rel_conic_to")] pub fn rel_conic_to(&self, x1: f32, y1: f32, x2: f32, y2: f32, weight: f32) { unsafe { ffi::gsk_path_builder_rel_conic_to(self.to_glib_none().0, x1, y1, x2, y2, weight); } } #[doc(alias = "gsk_path_builder_rel_cubic_to")] pub fn rel_cubic_to(&self, x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32) { unsafe { ffi::gsk_path_builder_rel_cubic_to(self.to_glib_none().0, x1, y1, x2, y2, x3, y3); } } #[doc(alias = "gsk_path_builder_rel_html_arc_to")] pub fn rel_html_arc_to(&self, x1: f32, y1: f32, x2: f32, y2: f32, radius: f32) { unsafe { ffi::gsk_path_builder_rel_html_arc_to(self.to_glib_none().0, x1, y1, x2, y2, radius); } } #[doc(alias = "gsk_path_builder_rel_line_to")] pub fn rel_line_to(&self, x: f32, y: f32) { unsafe { ffi::gsk_path_builder_rel_line_to(self.to_glib_none().0, x, y); } } #[doc(alias = "gsk_path_builder_rel_move_to")] pub fn rel_move_to(&self, x: f32, y: f32) { unsafe { ffi::gsk_path_builder_rel_move_to(self.to_glib_none().0, x, y); } } #[doc(alias = "gsk_path_builder_rel_quad_to")] pub fn rel_quad_to(&self, x1: f32, y1: f32, x2: f32, y2: f32) { unsafe { ffi::gsk_path_builder_rel_quad_to(self.to_glib_none().0, x1, y1, x2, y2); } } #[doc(alias = "gsk_path_builder_rel_svg_arc_to")] pub fn rel_svg_arc_to( &self, rx: f32, ry: f32, x_axis_rotation: f32, large_arc: bool, positive_sweep: bool, x: f32, y: f32, ) { unsafe { ffi::gsk_path_builder_rel_svg_arc_to( self.to_glib_none().0, rx, ry, x_axis_rotation, large_arc.into_glib(), positive_sweep.into_glib(), x, y, ); } } #[doc(alias = "gsk_path_builder_svg_arc_to")] pub fn svg_arc_to( &self, rx: f32, ry: f32, x_axis_rotation: f32, large_arc: bool, positive_sweep: bool, x: f32, y: f32, ) { unsafe { ffi::gsk_path_builder_svg_arc_to( self.to_glib_none().0, rx, ry, x_axis_rotation, large_arc.into_glib(), positive_sweep.into_glib(), x, y, ); } } #[doc(alias = "gsk_path_builder_to_path")] pub fn to_path(&self) -> Path { unsafe { from_glib_full(ffi::gsk_path_builder_to_path(self.to_glib_none().0)) } } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] impl Default for PathBuilder { fn default() -> Self { Self::new() } } gsk4-0.9.6/src/auto/path_measure.rs000064400000000000000000000044051046102023000152750ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Path, PathPoint}; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct PathMeasure(Shared); match fn { ref => |ptr| ffi::gsk_path_measure_ref(ptr), unref => |ptr| ffi::gsk_path_measure_unref(ptr), type_ => || ffi::gsk_path_measure_get_type(), } } impl PathMeasure { #[doc(alias = "gsk_path_measure_new")] pub fn new(path: &Path) -> PathMeasure { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gsk_path_measure_new(path.to_glib_none().0)) } } #[doc(alias = "gsk_path_measure_new_with_tolerance")] #[doc(alias = "new_with_tolerance")] pub fn with_tolerance(path: &Path, tolerance: f32) -> PathMeasure { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gsk_path_measure_new_with_tolerance( path.to_glib_none().0, tolerance, )) } } #[doc(alias = "gsk_path_measure_get_length")] #[doc(alias = "get_length")] pub fn length(&self) -> f32 { unsafe { ffi::gsk_path_measure_get_length(self.to_glib_none().0) } } #[doc(alias = "gsk_path_measure_get_path")] #[doc(alias = "get_path")] pub fn path(&self) -> Path { unsafe { from_glib_none(ffi::gsk_path_measure_get_path(self.to_glib_none().0)) } } #[doc(alias = "gsk_path_measure_get_point")] #[doc(alias = "get_point")] pub fn point(&self, distance: f32) -> Option { unsafe { let mut result = PathPoint::uninitialized(); let ret = from_glib(ffi::gsk_path_measure_get_point( self.to_glib_none().0, distance, result.to_glib_none_mut().0, )); if ret { Some(result) } else { None } } } #[doc(alias = "gsk_path_measure_get_tolerance")] #[doc(alias = "get_tolerance")] pub fn tolerance(&self) -> f32 { unsafe { ffi::gsk_path_measure_get_tolerance(self.to_glib_none().0) } } } gsk4-0.9.6/src/auto/path_point.rs000064400000000000000000000056711046102023000147730ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Path, PathDirection, PathMeasure}; use glib::translate::*; glib::wrapper! { pub struct PathPoint(BoxedInline); match fn { copy => |ptr| ffi::gsk_path_point_copy(mut_override(ptr)), free => |ptr| ffi::gsk_path_point_free(ptr), type_ => || ffi::gsk_path_point_get_type(), } } impl PathPoint { #[doc(alias = "gsk_path_point_compare")] fn compare(&self, point2: &PathPoint) -> i32 { unsafe { ffi::gsk_path_point_compare(self.to_glib_none().0, point2.to_glib_none().0) } } #[doc(alias = "gsk_path_point_equal")] fn equal(&self, point2: &PathPoint) -> bool { unsafe { from_glib(ffi::gsk_path_point_equal( self.to_glib_none().0, point2.to_glib_none().0, )) } } #[doc(alias = "gsk_path_point_get_distance")] #[doc(alias = "get_distance")] pub fn distance(&self, measure: &PathMeasure) -> f32 { unsafe { ffi::gsk_path_point_get_distance(self.to_glib_none().0, measure.to_glib_none().0) } } #[doc(alias = "gsk_path_point_get_position")] #[doc(alias = "get_position")] pub fn position(&self, path: &Path) -> graphene::Point { unsafe { let mut position = graphene::Point::uninitialized(); ffi::gsk_path_point_get_position( self.to_glib_none().0, path.to_glib_none().0, position.to_glib_none_mut().0, ); position } } #[doc(alias = "gsk_path_point_get_rotation")] #[doc(alias = "get_rotation")] pub fn rotation(&self, path: &Path, direction: PathDirection) -> f32 { unsafe { ffi::gsk_path_point_get_rotation( self.to_glib_none().0, path.to_glib_none().0, direction.into_glib(), ) } } #[doc(alias = "gsk_path_point_get_tangent")] #[doc(alias = "get_tangent")] pub fn tangent(&self, path: &Path, direction: PathDirection) -> graphene::Vec2 { unsafe { let mut tangent = graphene::Vec2::uninitialized(); ffi::gsk_path_point_get_tangent( self.to_glib_none().0, path.to_glib_none().0, direction.into_glib(), tangent.to_glib_none_mut().0, ); tangent } } } impl PartialOrd for PathPoint { #[inline] fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } } impl Ord for PathPoint { #[inline] fn cmp(&self, other: &Self) -> std::cmp::Ordering { self.compare(other).cmp(&0) } } impl PartialEq for PathPoint { #[inline] fn eq(&self, other: &Self) -> bool { self.equal(other) } } impl Eq for PathPoint {} gsk4-0.9.6/src/auto/radial_gradient_node.rs000064400000000000000000000065001046102023000167340ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, ColorStop}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskRadialGradientNode")] pub struct RadialGradientNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for RadialGradientNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_radial_gradient_node_get_type()) } } } impl RadialGradientNode { #[doc(alias = "gsk_radial_gradient_node_new")] pub fn new( bounds: &graphene::Rect, center: &graphene::Point, hradius: f32, vradius: f32, start: f32, end: f32, color_stops: &[ColorStop], ) -> RadialGradientNode { assert_initialized_main_thread!(); let n_color_stops = color_stops.len() as _; unsafe { from_glib_full(ffi::gsk_radial_gradient_node_new( bounds.to_glib_none().0, center.to_glib_none().0, hradius, vradius, start, end, color_stops.to_glib_none().0, n_color_stops, )) } } #[doc(alias = "gsk_radial_gradient_node_get_center")] #[doc(alias = "get_center")] pub fn center(&self) -> graphene::Point { unsafe { from_glib_none(ffi::gsk_radial_gradient_node_get_center( self.to_glib_none().0, )) } } #[doc(alias = "gsk_radial_gradient_node_get_color_stops")] #[doc(alias = "get_color_stops")] pub fn color_stops(&self) -> Vec { unsafe { let mut n_stops = std::mem::MaybeUninit::uninit(); let ret = FromGlibContainer::from_glib_none_num( ffi::gsk_radial_gradient_node_get_color_stops( self.to_glib_none().0, n_stops.as_mut_ptr(), ), n_stops.assume_init() as _, ); ret } } #[doc(alias = "gsk_radial_gradient_node_get_end")] #[doc(alias = "get_end")] pub fn end(&self) -> f32 { unsafe { ffi::gsk_radial_gradient_node_get_end(self.to_glib_none().0) } } #[doc(alias = "gsk_radial_gradient_node_get_hradius")] #[doc(alias = "get_hradius")] pub fn hradius(&self) -> f32 { unsafe { ffi::gsk_radial_gradient_node_get_hradius(self.to_glib_none().0) } } #[doc(alias = "gsk_radial_gradient_node_get_n_color_stops")] #[doc(alias = "get_n_color_stops")] pub fn n_color_stops(&self) -> usize { unsafe { ffi::gsk_radial_gradient_node_get_n_color_stops(self.to_glib_none().0) } } #[doc(alias = "gsk_radial_gradient_node_get_start")] #[doc(alias = "get_start")] pub fn start(&self) -> f32 { unsafe { ffi::gsk_radial_gradient_node_get_start(self.to_glib_none().0) } } #[doc(alias = "gsk_radial_gradient_node_get_vradius")] #[doc(alias = "get_vradius")] pub fn vradius(&self) -> f32 { unsafe { ffi::gsk_radial_gradient_node_get_vradius(self.to_glib_none().0) } } } gsk4-0.9.6/src/auto/render_node.rs000064400000000000000000000061431046102023000151050ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, RenderNodeType}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskRenderNode")] pub struct RenderNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr), unref => |ptr| ffi::gsk_render_node_unref(ptr), } } impl StaticType for RenderNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_render_node_get_type()) } } } impl RenderNode { pub const NONE: Option<&'static RenderNode> = None; #[doc(alias = "gsk_render_node_draw")] pub fn draw(&self, cr: &cairo::Context) { unsafe { ffi::gsk_render_node_draw( self.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), ); } } #[doc(alias = "gsk_render_node_get_bounds")] #[doc(alias = "get_bounds")] pub fn bounds(&self) -> graphene::Rect { unsafe { let mut bounds = graphene::Rect::uninitialized(); ffi::gsk_render_node_get_bounds( self.as_ref().to_glib_none().0, bounds.to_glib_none_mut().0, ); bounds } } #[doc(alias = "gsk_render_node_get_node_type")] #[doc(alias = "get_node_type")] pub fn node_type(&self) -> RenderNodeType { unsafe { from_glib(ffi::gsk_render_node_get_node_type(const_override( self.as_ref().to_glib_none().0, ))) } } #[cfg(feature = "v4_16")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))] #[doc(alias = "gsk_render_node_get_opaque_rect")] #[doc(alias = "get_opaque_rect")] pub fn opaque_rect(&self) -> Option { unsafe { let mut out_opaque = graphene::Rect::uninitialized(); let ret = from_glib(ffi::gsk_render_node_get_opaque_rect( self.as_ref().to_glib_none().0, out_opaque.to_glib_none_mut().0, )); if ret { Some(out_opaque) } else { None } } } #[doc(alias = "gsk_render_node_serialize")] pub fn serialize(&self) -> glib::Bytes { unsafe { from_glib_full(ffi::gsk_render_node_serialize( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gsk_render_node_write_to_file")] pub fn write_to_file(&self, filename: impl AsRef) -> Result<(), glib::Error> { unsafe { let mut error = std::ptr::null_mut(); let is_ok = ffi::gsk_render_node_write_to_file( self.as_ref().to_glib_none().0, filename.as_ref().to_glib_none().0, &mut error, ); debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } } gsk4-0.9.6/src/auto/renderer.rs000064400000000000000000000131051046102023000144230ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, RenderNode}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::boxed::Box as Box_; glib::wrapper! { #[doc(alias = "GskRenderer")] pub struct Renderer(Object); match fn { type_ => || ffi::gsk_renderer_get_type(), } } impl Renderer { pub const NONE: Option<&'static Renderer> = None; #[doc(alias = "gsk_renderer_new_for_surface")] #[doc(alias = "new_for_surface")] pub fn for_surface(surface: &gdk::Surface) -> Option { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gsk_renderer_new_for_surface(surface.to_glib_none().0)) } } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait GskRendererExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gsk_renderer_get_surface")] #[doc(alias = "get_surface")] fn surface(&self) -> Option { unsafe { from_glib_none(ffi::gsk_renderer_get_surface( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gsk_renderer_is_realized")] #[doc(alias = "realized")] fn is_realized(&self) -> bool { unsafe { from_glib(ffi::gsk_renderer_is_realized( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gsk_renderer_realize")] fn realize(&self, surface: Option<&gdk::Surface>) -> Result<(), glib::Error> { unsafe { let mut error = std::ptr::null_mut(); let is_ok = ffi::gsk_renderer_realize( self.as_ref().to_glib_none().0, surface.to_glib_none().0, &mut error, ); debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[doc(alias = "gsk_renderer_realize_for_display")] fn realize_for_display(&self, display: &gdk::Display) -> Result<(), glib::Error> { unsafe { let mut error = std::ptr::null_mut(); let is_ok = ffi::gsk_renderer_realize_for_display( self.as_ref().to_glib_none().0, display.to_glib_none().0, &mut error, ); debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } #[doc(alias = "gsk_renderer_render")] fn render(&self, root: impl AsRef, region: Option<&cairo::Region>) { unsafe { ffi::gsk_renderer_render( self.as_ref().to_glib_none().0, root.as_ref().to_glib_none().0, region.to_glib_none().0, ); } } #[doc(alias = "gsk_renderer_render_texture")] fn render_texture( &self, root: impl AsRef, viewport: Option<&graphene::Rect>, ) -> gdk::Texture { unsafe { from_glib_full(ffi::gsk_renderer_render_texture( self.as_ref().to_glib_none().0, root.as_ref().to_glib_none().0, viewport.to_glib_none().0, )) } } #[doc(alias = "gsk_renderer_unrealize")] fn unrealize(&self) { unsafe { ffi::gsk_renderer_unrealize(self.as_ref().to_glib_none().0); } } #[doc(alias = "realized")] fn connect_realized_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_realized_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GskRenderer, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Renderer::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::realized\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_realized_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "surface")] fn connect_surface_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_surface_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GskRenderer, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Renderer::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::surface\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_surface_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> GskRendererExt for O {} gsk4-0.9.6/src/auto/repeat_node.rs000064400000000000000000000031001046102023000150740ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, RenderNode}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskRepeatNode")] pub struct RepeatNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for RepeatNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_repeat_node_get_type()) } } } impl RepeatNode { #[doc(alias = "gsk_repeat_node_new")] pub fn new( bounds: &graphene::Rect, child: impl AsRef, child_bounds: Option<&graphene::Rect>, ) -> RepeatNode { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gsk_repeat_node_new( bounds.to_glib_none().0, child.as_ref().to_glib_none().0, child_bounds.to_glib_none().0, )) } } #[doc(alias = "gsk_repeat_node_get_child")] #[doc(alias = "get_child")] pub fn child(&self) -> RenderNode { unsafe { from_glib_none(ffi::gsk_repeat_node_get_child(self.to_glib_none().0)) } } #[doc(alias = "gsk_repeat_node_get_child_bounds")] #[doc(alias = "get_child_bounds")] pub fn child_bounds(&self) -> graphene::Rect { unsafe { from_glib_none(ffi::gsk_repeat_node_get_child_bounds(self.to_glib_none().0)) } } } gsk4-0.9.6/src/auto/repeating_linear_gradient_node.rs000064400000000000000000000026211046102023000210100ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, ColorStop}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskRepeatingLinearGradientNode")] pub struct RepeatingLinearGradientNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for RepeatingLinearGradientNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_repeating_linear_gradient_node_get_type()) } } } impl RepeatingLinearGradientNode { #[doc(alias = "gsk_repeating_linear_gradient_node_new")] pub fn new( bounds: &graphene::Rect, start: &graphene::Point, end: &graphene::Point, color_stops: &[ColorStop], ) -> RepeatingLinearGradientNode { assert_initialized_main_thread!(); let n_color_stops = color_stops.len() as _; unsafe { from_glib_full(ffi::gsk_repeating_linear_gradient_node_new( bounds.to_glib_none().0, start.to_glib_none().0, end.to_glib_none().0, color_stops.to_glib_none().0, n_color_stops, )) } } } gsk4-0.9.6/src/auto/repeating_radial_gradient_node.rs000064400000000000000000000027761046102023000210050ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, ColorStop}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskRepeatingRadialGradientNode")] pub struct RepeatingRadialGradientNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for RepeatingRadialGradientNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_repeating_radial_gradient_node_get_type()) } } } impl RepeatingRadialGradientNode { #[doc(alias = "gsk_repeating_radial_gradient_node_new")] pub fn new( bounds: &graphene::Rect, center: &graphene::Point, hradius: f32, vradius: f32, start: f32, end: f32, color_stops: &[ColorStop], ) -> RepeatingRadialGradientNode { assert_initialized_main_thread!(); let n_color_stops = color_stops.len() as _; unsafe { from_glib_full(ffi::gsk_repeating_radial_gradient_node_new( bounds.to_glib_none().0, center.to_glib_none().0, hradius, vradius, start, end, color_stops.to_glib_none().0, n_color_stops, )) } } } gsk4-0.9.6/src/auto/rounded_clip_node.rs000064400000000000000000000027661046102023000163040ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, RenderNode, RoundedRect}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskRoundedClipNode")] pub struct RoundedClipNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for RoundedClipNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_rounded_clip_node_get_type()) } } } impl RoundedClipNode { #[doc(alias = "gsk_rounded_clip_node_new")] pub fn new(child: impl AsRef, clip: &RoundedRect) -> RoundedClipNode { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gsk_rounded_clip_node_new( child.as_ref().to_glib_none().0, clip.to_glib_none().0, )) } } #[doc(alias = "gsk_rounded_clip_node_get_child")] #[doc(alias = "get_child")] pub fn child(&self) -> RenderNode { unsafe { from_glib_none(ffi::gsk_rounded_clip_node_get_child(self.to_glib_none().0)) } } #[doc(alias = "gsk_rounded_clip_node_get_clip")] #[doc(alias = "get_clip")] pub fn clip(&self) -> RoundedRect { unsafe { from_glib_none(ffi::gsk_rounded_clip_node_get_clip(self.to_glib_none().0)) } } } gsk4-0.9.6/src/auto/shader_args_builder.rs000064400000000000000000000072051046102023000166110ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, GLShader}; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct ShaderArgsBuilder(Shared); match fn { ref => |ptr| ffi::gsk_shader_args_builder_ref(ptr), unref => |ptr| ffi::gsk_shader_args_builder_unref(ptr), type_ => || ffi::gsk_shader_args_builder_get_type(), } } impl ShaderArgsBuilder { #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_shader_args_builder_new")] pub fn new(shader: &GLShader, initial_values: Option<&glib::Bytes>) -> ShaderArgsBuilder { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gsk_shader_args_builder_new( shader.to_glib_none().0, initial_values.to_glib_none().0, )) } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_shader_args_builder_set_bool")] pub fn set_bool(&self, idx: i32, value: bool) { unsafe { ffi::gsk_shader_args_builder_set_bool(self.to_glib_none().0, idx, value.into_glib()); } } #[doc(alias = "gsk_shader_args_builder_set_float")] pub fn set_float(&self, idx: i32, value: f32) { unsafe { ffi::gsk_shader_args_builder_set_float(self.to_glib_none().0, idx, value); } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_shader_args_builder_set_int")] pub fn set_int(&self, idx: i32, value: i32) { unsafe { ffi::gsk_shader_args_builder_set_int(self.to_glib_none().0, idx, value); } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_shader_args_builder_set_uint")] pub fn set_uint(&self, idx: i32, value: u32) { unsafe { ffi::gsk_shader_args_builder_set_uint(self.to_glib_none().0, idx, value); } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_shader_args_builder_set_vec2")] pub fn set_vec2(&self, idx: i32, value: &graphene::Vec2) { unsafe { ffi::gsk_shader_args_builder_set_vec2( self.to_glib_none().0, idx, value.to_glib_none().0, ); } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_shader_args_builder_set_vec3")] pub fn set_vec3(&self, idx: i32, value: &graphene::Vec3) { unsafe { ffi::gsk_shader_args_builder_set_vec3( self.to_glib_none().0, idx, value.to_glib_none().0, ); } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_shader_args_builder_set_vec4")] pub fn set_vec4(&self, idx: i32, value: &graphene::Vec4) { unsafe { ffi::gsk_shader_args_builder_set_vec4( self.to_glib_none().0, idx, value.to_glib_none().0, ); } } #[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")] #[allow(deprecated)] #[doc(alias = "gsk_shader_args_builder_to_args")] pub fn to_args(self) -> glib::Bytes { unsafe { from_glib_full(ffi::gsk_shader_args_builder_to_args(self.into_glib_ptr())) } } } gsk4-0.9.6/src/auto/shadow_node.rs000064400000000000000000000027611046102023000151150ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, RenderNode, Shadow}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskShadowNode")] pub struct ShadowNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for ShadowNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_shadow_node_get_type()) } } } impl ShadowNode { #[doc(alias = "gsk_shadow_node_new")] pub fn new(child: impl AsRef, shadows: &[Shadow]) -> ShadowNode { skip_assert_initialized!(); let n_shadows = shadows.len() as _; unsafe { from_glib_full(ffi::gsk_shadow_node_new( child.as_ref().to_glib_none().0, shadows.to_glib_none().0, n_shadows, )) } } #[doc(alias = "gsk_shadow_node_get_child")] #[doc(alias = "get_child")] pub fn child(&self) -> RenderNode { unsafe { from_glib_none(ffi::gsk_shadow_node_get_child(self.to_glib_none().0)) } } #[doc(alias = "gsk_shadow_node_get_n_shadows")] #[doc(alias = "get_n_shadows")] pub fn n_shadows(&self) -> usize { unsafe { ffi::gsk_shadow_node_get_n_shadows(self.to_glib_none().0) } } } gsk4-0.9.6/src/auto/stroke.rs000064400000000000000000000106341046102023000141300ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, LineCap, LineJoin}; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialOrd, Ord, Hash)] pub struct Stroke(Boxed); match fn { copy => |ptr| ffi::gsk_stroke_copy(ptr), free => |ptr| ffi::gsk_stroke_free(ptr), type_ => || ffi::gsk_stroke_get_type(), } } impl Stroke { #[doc(alias = "gsk_stroke_new")] pub fn new(line_width: f32) -> Stroke { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gsk_stroke_new(line_width)) } } #[doc(alias = "gsk_stroke_get_dash")] #[doc(alias = "get_dash")] pub fn dash(&self) -> Vec { unsafe { let mut n_dash = std::mem::MaybeUninit::uninit(); let ret = FromGlibContainer::from_glib_none_num( ffi::gsk_stroke_get_dash(self.to_glib_none().0, n_dash.as_mut_ptr()), n_dash.assume_init() as _, ); ret } } #[doc(alias = "gsk_stroke_get_dash_offset")] #[doc(alias = "get_dash_offset")] pub fn dash_offset(&self) -> f32 { unsafe { ffi::gsk_stroke_get_dash_offset(self.to_glib_none().0) } } #[doc(alias = "gsk_stroke_get_line_cap")] #[doc(alias = "get_line_cap")] pub fn line_cap(&self) -> LineCap { unsafe { from_glib(ffi::gsk_stroke_get_line_cap(self.to_glib_none().0)) } } #[doc(alias = "gsk_stroke_get_line_join")] #[doc(alias = "get_line_join")] pub fn line_join(&self) -> LineJoin { unsafe { from_glib(ffi::gsk_stroke_get_line_join(self.to_glib_none().0)) } } #[doc(alias = "gsk_stroke_get_line_width")] #[doc(alias = "get_line_width")] pub fn line_width(&self) -> f32 { unsafe { ffi::gsk_stroke_get_line_width(self.to_glib_none().0) } } #[doc(alias = "gsk_stroke_get_miter_limit")] #[doc(alias = "get_miter_limit")] pub fn miter_limit(&self) -> f32 { unsafe { ffi::gsk_stroke_get_miter_limit(self.to_glib_none().0) } } #[doc(alias = "gsk_stroke_set_dash")] pub fn set_dash(&self, dash: &[f32]) { let n_dash = dash.len() as _; unsafe { ffi::gsk_stroke_set_dash( mut_override(self.to_glib_none().0), dash.to_glib_none().0, n_dash, ); } } #[doc(alias = "gsk_stroke_set_dash_offset")] pub fn set_dash_offset(&self, offset: f32) { unsafe { ffi::gsk_stroke_set_dash_offset(mut_override(self.to_glib_none().0), offset); } } #[doc(alias = "gsk_stroke_set_line_cap")] pub fn set_line_cap(&self, line_cap: LineCap) { unsafe { ffi::gsk_stroke_set_line_cap(mut_override(self.to_glib_none().0), line_cap.into_glib()); } } #[doc(alias = "gsk_stroke_set_line_join")] pub fn set_line_join(&self, line_join: LineJoin) { unsafe { ffi::gsk_stroke_set_line_join( mut_override(self.to_glib_none().0), line_join.into_glib(), ); } } #[doc(alias = "gsk_stroke_set_line_width")] pub fn set_line_width(&self, line_width: f32) { unsafe { ffi::gsk_stroke_set_line_width(mut_override(self.to_glib_none().0), line_width); } } #[doc(alias = "gsk_stroke_set_miter_limit")] pub fn set_miter_limit(&self, limit: f32) { unsafe { ffi::gsk_stroke_set_miter_limit(mut_override(self.to_glib_none().0), limit); } } #[doc(alias = "gsk_stroke_to_cairo")] pub fn to_cairo(&self, cr: &cairo::Context) { unsafe { ffi::gsk_stroke_to_cairo(self.to_glib_none().0, mut_override(cr.to_glib_none().0)); } } #[doc(alias = "gsk_stroke_equal")] fn equal(&self, stroke2: &Stroke) -> bool { assert_initialized_main_thread!(); unsafe { from_glib(ffi::gsk_stroke_equal( ToGlibPtr::<*const ffi::GskStroke>::to_glib_none(self).0 as glib::ffi::gconstpointer, ToGlibPtr::<*const ffi::GskStroke>::to_glib_none(stroke2).0 as glib::ffi::gconstpointer, )) } } } impl PartialEq for Stroke { #[inline] fn eq(&self, other: &Self) -> bool { self.equal(other) } } impl Eq for Stroke {} gsk4-0.9.6/src/auto/stroke_node.rs000064400000000000000000000032631046102023000151350ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Path, RenderNode, Stroke}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskStrokeNode")] pub struct StrokeNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for StrokeNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_stroke_node_get_type()) } } } impl StrokeNode { #[doc(alias = "gsk_stroke_node_new")] pub fn new(child: impl AsRef, path: &Path, stroke: &Stroke) -> StrokeNode { skip_assert_initialized!(); unsafe { from_glib_none(ffi::gsk_stroke_node_new( child.as_ref().to_glib_none().0, path.to_glib_none().0, stroke.to_glib_none().0, )) } } #[doc(alias = "gsk_stroke_node_get_child")] #[doc(alias = "get_child")] pub fn child(&self) -> RenderNode { unsafe { from_glib_none(ffi::gsk_stroke_node_get_child(self.to_glib_none().0)) } } #[doc(alias = "gsk_stroke_node_get_path")] #[doc(alias = "get_path")] pub fn path(&self) -> Path { unsafe { from_glib_none(ffi::gsk_stroke_node_get_path(self.to_glib_none().0)) } } #[doc(alias = "gsk_stroke_node_get_stroke")] #[doc(alias = "get_stroke")] pub fn stroke(&self) -> Stroke { unsafe { from_glib_none(ffi::gsk_stroke_node_get_stroke(self.to_glib_none().0)) } } } gsk4-0.9.6/src/auto/text_node.rs000064400000000000000000000053201046102023000146060ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskTextNode")] pub struct TextNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for TextNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_text_node_get_type()) } } } impl TextNode { #[doc(alias = "gsk_text_node_new")] pub fn new( font: &impl IsA, glyphs: &pango::GlyphString, color: &gdk::RGBA, offset: &graphene::Point, ) -> Option { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gsk_text_node_new( font.as_ref().to_glib_none().0, mut_override(glyphs.to_glib_none().0), color.to_glib_none().0, offset.to_glib_none().0, )) } } #[doc(alias = "gsk_text_node_get_color")] #[doc(alias = "get_color")] pub fn color(&self) -> gdk::RGBA { unsafe { from_glib_none(ffi::gsk_text_node_get_color(self.to_glib_none().0)) } } #[doc(alias = "gsk_text_node_get_font")] #[doc(alias = "get_font")] pub fn font(&self) -> pango::Font { unsafe { from_glib_none(ffi::gsk_text_node_get_font(self.to_glib_none().0)) } } #[doc(alias = "gsk_text_node_get_glyphs")] #[doc(alias = "get_glyphs")] pub fn glyphs(&self) -> Vec { unsafe { let mut n_glyphs = std::mem::MaybeUninit::uninit(); let ret = FromGlibContainer::from_glib_none_num( ffi::gsk_text_node_get_glyphs(self.to_glib_none().0, n_glyphs.as_mut_ptr()), n_glyphs.assume_init() as _, ); ret } } #[doc(alias = "gsk_text_node_get_num_glyphs")] #[doc(alias = "get_num_glyphs")] pub fn num_glyphs(&self) -> u32 { unsafe { ffi::gsk_text_node_get_num_glyphs(self.to_glib_none().0) } } #[doc(alias = "gsk_text_node_get_offset")] #[doc(alias = "get_offset")] pub fn offset(&self) -> graphene::Point { unsafe { from_glib_none(ffi::gsk_text_node_get_offset(self.to_glib_none().0)) } } #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] #[doc(alias = "gsk_text_node_has_color_glyphs")] pub fn has_color_glyphs(&self) -> bool { unsafe { from_glib(ffi::gsk_text_node_has_color_glyphs(self.to_glib_none().0)) } } } gsk4-0.9.6/src/auto/texture_node.rs000064400000000000000000000023461046102023000153270ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskTextureNode")] pub struct TextureNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for TextureNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_texture_node_get_type()) } } } impl TextureNode { #[doc(alias = "gsk_texture_node_new")] pub fn new(texture: &impl IsA, bounds: &graphene::Rect) -> TextureNode { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gsk_texture_node_new( texture.as_ref().to_glib_none().0, bounds.to_glib_none().0, )) } } #[doc(alias = "gsk_texture_node_get_texture")] #[doc(alias = "get_texture")] pub fn texture(&self) -> gdk::Texture { unsafe { from_glib_none(ffi::gsk_texture_node_get_texture(self.to_glib_none().0)) } } } gsk4-0.9.6/src/auto/texture_scale_node.rs000064400000000000000000000033331046102023000164730ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, ScalingFilter}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskTextureScaleNode")] pub struct TextureScaleNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for TextureScaleNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_texture_scale_node_get_type()) } } } impl TextureScaleNode { #[doc(alias = "gsk_texture_scale_node_new")] pub fn new( texture: &impl IsA, bounds: &graphene::Rect, filter: ScalingFilter, ) -> TextureScaleNode { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gsk_texture_scale_node_new( texture.as_ref().to_glib_none().0, bounds.to_glib_none().0, filter.into_glib(), )) } } #[doc(alias = "gsk_texture_scale_node_get_filter")] #[doc(alias = "get_filter")] pub fn filter(&self) -> ScalingFilter { unsafe { from_glib(ffi::gsk_texture_scale_node_get_filter( self.to_glib_none().0, )) } } #[doc(alias = "gsk_texture_scale_node_get_texture")] #[doc(alias = "get_texture")] pub fn texture(&self) -> gdk::Texture { unsafe { from_glib_none(ffi::gsk_texture_scale_node_get_texture( self.to_glib_none().0, )) } } } gsk4-0.9.6/src/auto/transform.rs000064400000000000000000000162421046102023000146350ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, TransformCategory}; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialOrd, Ord, Hash)] pub struct Transform(Shared); match fn { ref => |ptr| ffi::gsk_transform_ref(ptr), unref => |ptr| ffi::gsk_transform_unref(ptr), type_ => || ffi::gsk_transform_get_type(), } } impl Transform { #[doc(alias = "gsk_transform_new")] pub fn new() -> Transform { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gsk_transform_new()) } } #[doc(alias = "gsk_transform_equal")] fn equal(&self, second: &Transform) -> bool { unsafe { from_glib(ffi::gsk_transform_equal( self.to_glib_none().0, second.to_glib_none().0, )) } } #[doc(alias = "gsk_transform_get_category")] #[doc(alias = "get_category")] pub fn category(&self) -> TransformCategory { unsafe { from_glib(ffi::gsk_transform_get_category(self.to_glib_none().0)) } } #[doc(alias = "gsk_transform_matrix")] #[must_use] pub fn matrix(self, matrix: &graphene::Matrix) -> Transform { unsafe { from_glib_full(ffi::gsk_transform_matrix( self.into_glib_ptr(), matrix.to_glib_none().0, )) } } #[doc(alias = "gsk_transform_perspective")] #[must_use] pub fn perspective(self, depth: f32) -> Transform { unsafe { from_glib_full(ffi::gsk_transform_perspective(self.into_glib_ptr(), depth)) } } #[doc(alias = "gsk_transform_to_2d")] pub fn to_2d(&self) -> (f32, f32, f32, f32, f32, f32) { unsafe { let mut out_xx = std::mem::MaybeUninit::uninit(); let mut out_yx = std::mem::MaybeUninit::uninit(); let mut out_xy = std::mem::MaybeUninit::uninit(); let mut out_yy = std::mem::MaybeUninit::uninit(); let mut out_dx = std::mem::MaybeUninit::uninit(); let mut out_dy = std::mem::MaybeUninit::uninit(); ffi::gsk_transform_to_2d( self.to_glib_none().0, out_xx.as_mut_ptr(), out_yx.as_mut_ptr(), out_xy.as_mut_ptr(), out_yy.as_mut_ptr(), out_dx.as_mut_ptr(), out_dy.as_mut_ptr(), ); ( out_xx.assume_init(), out_yx.assume_init(), out_xy.assume_init(), out_yy.assume_init(), out_dx.assume_init(), out_dy.assume_init(), ) } } #[cfg(feature = "v4_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))] #[doc(alias = "gsk_transform_to_2d_components")] pub fn to_2d_components(&self) -> (f32, f32, f32, f32, f32, f32, f32) { unsafe { let mut out_skew_x = std::mem::MaybeUninit::uninit(); let mut out_skew_y = std::mem::MaybeUninit::uninit(); let mut out_scale_x = std::mem::MaybeUninit::uninit(); let mut out_scale_y = std::mem::MaybeUninit::uninit(); let mut out_angle = std::mem::MaybeUninit::uninit(); let mut out_dx = std::mem::MaybeUninit::uninit(); let mut out_dy = std::mem::MaybeUninit::uninit(); ffi::gsk_transform_to_2d_components( self.to_glib_none().0, out_skew_x.as_mut_ptr(), out_skew_y.as_mut_ptr(), out_scale_x.as_mut_ptr(), out_scale_y.as_mut_ptr(), out_angle.as_mut_ptr(), out_dx.as_mut_ptr(), out_dy.as_mut_ptr(), ); ( out_skew_x.assume_init(), out_skew_y.assume_init(), out_scale_x.assume_init(), out_scale_y.assume_init(), out_angle.assume_init(), out_dx.assume_init(), out_dy.assume_init(), ) } } #[doc(alias = "gsk_transform_to_affine")] pub fn to_affine(&self) -> (f32, f32, f32, f32) { unsafe { let mut out_scale_x = std::mem::MaybeUninit::uninit(); let mut out_scale_y = std::mem::MaybeUninit::uninit(); let mut out_dx = std::mem::MaybeUninit::uninit(); let mut out_dy = std::mem::MaybeUninit::uninit(); ffi::gsk_transform_to_affine( self.to_glib_none().0, out_scale_x.as_mut_ptr(), out_scale_y.as_mut_ptr(), out_dx.as_mut_ptr(), out_dy.as_mut_ptr(), ); ( out_scale_x.assume_init(), out_scale_y.assume_init(), out_dx.assume_init(), out_dy.assume_init(), ) } } #[doc(alias = "gsk_transform_to_matrix")] pub fn to_matrix(&self) -> graphene::Matrix { unsafe { let mut out_matrix = graphene::Matrix::uninitialized(); ffi::gsk_transform_to_matrix(self.to_glib_none().0, out_matrix.to_glib_none_mut().0); out_matrix } } #[doc(alias = "gsk_transform_to_string")] #[doc(alias = "to_string")] pub fn to_str(&self) -> glib::GString { unsafe { from_glib_full(ffi::gsk_transform_to_string(self.to_glib_none().0)) } } #[doc(alias = "gsk_transform_to_translate")] pub fn to_translate(&self) -> (f32, f32) { unsafe { let mut out_dx = std::mem::MaybeUninit::uninit(); let mut out_dy = std::mem::MaybeUninit::uninit(); ffi::gsk_transform_to_translate( self.to_glib_none().0, out_dx.as_mut_ptr(), out_dy.as_mut_ptr(), ); (out_dx.assume_init(), out_dy.assume_init()) } } #[doc(alias = "gsk_transform_transform_bounds")] pub fn transform_bounds(&self, rect: &graphene::Rect) -> graphene::Rect { unsafe { let mut out_rect = graphene::Rect::uninitialized(); ffi::gsk_transform_transform_bounds( self.to_glib_none().0, rect.to_glib_none().0, out_rect.to_glib_none_mut().0, ); out_rect } } #[doc(alias = "gsk_transform_transform_point")] pub fn transform_point(&self, point: &graphene::Point) -> graphene::Point { unsafe { let mut out_point = graphene::Point::uninitialized(); ffi::gsk_transform_transform_point( self.to_glib_none().0, point.to_glib_none().0, out_point.to_glib_none_mut().0, ); out_point } } } impl Default for Transform { fn default() -> Self { Self::new() } } impl PartialEq for Transform { #[inline] fn eq(&self, other: &Self) -> bool { self.equal(other) } } impl Eq for Transform {} impl std::fmt::Display for Transform { #[inline] fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.write_str(&self.to_str()) } } gsk4-0.9.6/src/auto/transform_node.rs000064400000000000000000000027551046102023000156460ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, RenderNode, Transform}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskTransformNode")] pub struct TransformNode(Shared); match fn { ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), } } impl StaticType for TransformNode { fn static_type() -> glib::Type { unsafe { from_glib(ffi::gsk_transform_node_get_type()) } } } impl TransformNode { #[doc(alias = "gsk_transform_node_new")] pub fn new(child: impl AsRef, transform: &Transform) -> TransformNode { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gsk_transform_node_new( child.as_ref().to_glib_none().0, transform.to_glib_none().0, )) } } #[doc(alias = "gsk_transform_node_get_child")] #[doc(alias = "get_child")] pub fn child(&self) -> RenderNode { unsafe { from_glib_none(ffi::gsk_transform_node_get_child(self.to_glib_none().0)) } } #[doc(alias = "gsk_transform_node_get_transform")] #[doc(alias = "get_transform")] pub fn transform(&self) -> Transform { unsafe { from_glib_none(ffi::gsk_transform_node_get_transform(self.to_glib_none().0)) } } } gsk4-0.9.6/src/auto/versions.txt000064400000000000000000000002041046102023000146540ustar 00000000000000Generated by gir (https://github.com/gtk-rs/gir @ 2b05eaddce95) from gir-files (https://github.com/gtk-rs/gir-files @ 5089b7ff80cd) gsk4-0.9.6/src/auto/vulkan_renderer.rs000064400000000000000000000014261046102023000160060ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Renderer}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GskVulkanRenderer")] pub struct VulkanRenderer(Object) @extends Renderer; match fn { type_ => || ffi::gsk_vulkan_renderer_get_type(), } } impl VulkanRenderer { #[doc(alias = "gsk_vulkan_renderer_new")] pub fn new() -> VulkanRenderer { assert_initialized_main_thread!(); unsafe { Renderer::from_glib_full(ffi::gsk_vulkan_renderer_new()).unsafe_cast() } } } impl Default for VulkanRenderer { fn default() -> Self { Self::new() } } gsk4-0.9.6/src/blend_node.rs000064400000000000000000000010531046102023000137350ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{BlendNode, RenderNodeType}; define_render_node!( BlendNode, crate::ffi::GskBlendNode, RenderNodeType::BlendNode ); impl std::fmt::Debug for BlendNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("BlendNode") .field("blend_mode", &self.blend_mode()) .field("bottom_child", &self.bottom_child()) .field("top_child", &self.top_child()) .finish() } } gsk4-0.9.6/src/blur_node.rs000064400000000000000000000007161046102023000136220ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{BlurNode, RenderNodeType}; define_render_node!(BlurNode, crate::ffi::GskBlurNode, RenderNodeType::BlurNode); impl std::fmt::Debug for BlurNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("BlurNode") .field("child", &self.child()) .field("radius", &self.radius()) .finish() } } gsk4-0.9.6/src/border_node.rs000064400000000000000000000027251046102023000141350ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use glib::translate::*; use crate::{ffi, BorderNode, RenderNodeType, RoundedRect}; define_render_node!(BorderNode, ffi::GskBorderNode, RenderNodeType::BorderNode); impl BorderNode { #[doc(alias = "gsk_border_node_new")] pub fn new( outline: &RoundedRect, border_width: &[f32; 4], border_color: &[gdk::RGBA; 4], ) -> Self { unsafe { from_glib_full(ffi::gsk_border_node_new( outline.to_glib_none().0, border_width.as_ptr() as *const [f32; 4], border_color.as_ptr() as *const [gdk::ffi::GdkRGBA; 4], )) } } #[doc(alias = "gsk_border_node_get_colors")] #[doc(alias = "get_colors")] pub fn colors(&self) -> &[gdk::RGBA; 4] { unsafe { &*(ffi::gsk_border_node_get_colors(self.to_glib_none().0) as *const [gdk::RGBA; 4]) } } #[doc(alias = "gsk_border_node_get_widths")] #[doc(alias = "get_widths")] pub fn widths(&self) -> &[f32; 4] { unsafe { &*ffi::gsk_border_node_get_widths(self.to_glib_none().0) } } } impl std::fmt::Debug for BorderNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("BorderNode") .field("colors", &self.colors()) .field("widths", &self.widths()) .field("outline", &self.outline()) .finish() } } gsk4-0.9.6/src/builders.rs000064400000000000000000000005231046102023000134560ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. // rustdoc-stripper-ignore-next //! Builder pattern types. #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] pub use crate::stroke::StrokeBuilder; pub use crate::{auto::builders::*, color_stop::ColorStopBuilder, ShaderArgsBuilder}; gsk4-0.9.6/src/cairo_node.rs000064400000000000000000000007621046102023000137540ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{CairoNode, RenderNodeType}; define_render_node!( CairoNode, crate::ffi::GskCairoNode, RenderNodeType::CairoNode ); impl std::fmt::Debug for CairoNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("CairoNode") .field("draw_context", &self.draw_context()) .field("surface", &self.surface()) .finish() } } gsk4-0.9.6/src/clip_node.rs000064400000000000000000000007121046102023000136010ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{ClipNode, RenderNodeType}; define_render_node!(ClipNode, crate::ffi::GskClipNode, RenderNodeType::ClipNode); impl std::fmt::Debug for ClipNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("ClipNode") .field("child", &self.child()) .field("clip", &self.clip()) .finish() } } gsk4-0.9.6/src/color_matrix_node.rs000064400000000000000000000011131046102023000153500ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{ColorMatrixNode, RenderNodeType}; define_render_node!( ColorMatrixNode, crate::ffi::GskColorMatrixNode, RenderNodeType::ColorMatrixNode ); impl std::fmt::Debug for ColorMatrixNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("ColorMatrixNode") .field("color_offset", &self.color_offset()) .field("color_matrix", &self.color_matrix()) .field("child", &self.child()) .finish() } } gsk4-0.9.6/src/color_node.rs000064400000000000000000000006651046102023000137770ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{ColorNode, RenderNodeType}; define_render_node!( ColorNode, crate::ffi::GskColorNode, RenderNodeType::ColorNode ); impl std::fmt::Debug for ColorNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("ColorNode") .field("color", &self.color()) .finish() } } gsk4-0.9.6/src/color_stop.rs000064400000000000000000000056301046102023000140340ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use std::fmt; use crate::ffi; use gdk::RGBA; use glib::translate::*; glib::wrapper! { #[doc(alias = "GskColorStop")] pub struct ColorStop(BoxedInline); } impl ColorStop { #[inline] pub fn new(offset: f32, color: RGBA) -> Self { assert_initialized_main_thread!(); unsafe { Self::unsafe_from(ffi::GskColorStop { offset, color: *color.to_glib_none().0, }) } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`ColorStop`] /// objects. /// /// This method returns an instance of /// [`ColorStopBuilder`](crate::builders::ColorStopBuilder) which can be /// used to create [`ColorStop`] objects. pub fn builder() -> ColorStopBuilder { ColorStopBuilder::default() } #[inline] pub fn offset(&self) -> f32 { self.inner.offset } #[inline] pub fn color(&self) -> &RGBA { unsafe { &*(&self.inner.color as *const gdk::ffi::GdkRGBA as *const RGBA) } } } impl fmt::Debug for ColorStop { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("ColorStop") .field("offset", &self.offset()) .field("color", &self.color()) .finish() } } #[derive(Clone, Default)] // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`ColorStop`] 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 ColorStopBuilder(Vec); impl ColorStopBuilder { // rustdoc-stripper-ignore-next /// Create a new [`ColorStopBuilder`]. pub fn new() -> Self { Self::default() } pub fn at(mut self, offset: f32, color: RGBA) -> Self { self.0.push(ColorStop::new(offset, color)); self } // rustdoc-stripper-ignore-next /// Build the [`ColorStop`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Vec { self.0 } } #[test] fn color_stop_builder() { let t1 = ColorStop::builder() .at(0.0, gdk::RGBA::RED) .at(0.333, gdk::RGBA::RED) .at(0.667, gdk::RGBA::BLUE) .at(1.0, gdk::RGBA::RED) .build(); let t2 = &[ ColorStop::new(0.0, gdk::RGBA::RED), ColorStop::new(0.333, gdk::RGBA::RED), ColorStop::new(0.667, gdk::RGBA::BLUE), ColorStop::new(1.0, gdk::RGBA::RED), ]; assert_eq!(t1.len(), t2.len(), "Arrays don't have the same length"); assert!( &t1.iter() .zip(t2.iter()) .all(|(a, b)| a.offset() == b.offset() && a.color() == b.color()), "Arrays are not equal" ); } gsk4-0.9.6/src/conic_gradient_node.rs000064400000000000000000000021521046102023000156220ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{ConicGradientNode, RenderNodeType}; define_render_node!( ConicGradientNode, crate::ffi::GskConicGradientNode, RenderNodeType::ConicGradientNode ); impl std::fmt::Debug for ConicGradientNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { #[cfg(feature = "v4_2")] { f.debug_struct("ConicGradientNode") .field("angle", &self.angle()) .field("center", &self.center()) .field("color_stops", &self.color_stops()) .field("n_color_stops", &self.n_color_stops()) .field("rotation", &self.rotation()) .finish() } #[cfg(not(feature = "v4_2"))] { f.debug_struct("ConicGradientNode") .field("center", &self.center()) .field("color_stops", &self.color_stops()) .field("n_color_stops", &self.n_color_stops()) .field("rotation", &self.rotation()) .finish() } } } gsk4-0.9.6/src/container_node.rs000064400000000000000000000015531046102023000146400ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use glib::translate::*; use crate::{ffi, ContainerNode, RenderNode, RenderNodeType}; define_render_node!( ContainerNode, ffi::GskContainerNode, RenderNodeType::ContainerNode ); impl ContainerNode { #[doc(alias = "gsk_container_node_get_child")] #[doc(alias = "get_child")] pub fn child(&self, idx: u32) -> RenderNode { assert!(idx < self.n_children()); unsafe { from_glib_none(ffi::gsk_container_node_get_child( self.to_glib_none().0, idx, )) } } } impl std::fmt::Debug for ContainerNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("ContainerNode") .field("n_children", &self.n_children()) .finish() } } gsk4-0.9.6/src/cross_fade_node.rs000064400000000000000000000010751046102023000147650ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{CrossFadeNode, RenderNodeType}; define_render_node!( CrossFadeNode, crate::ffi::GskCrossFadeNode, RenderNodeType::CrossFadeNode ); impl std::fmt::Debug for CrossFadeNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("CrossFadeNode") .field("start_child", &self.start_child()) .field("end_child", &self.end_child()) .field("progress", &self.progress()) .finish() } } gsk4-0.9.6/src/debug_node.rs000064400000000000000000000007441046102023000137450ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{DebugNode, RenderNodeType}; define_render_node!( DebugNode, crate::ffi::GskDebugNode, RenderNodeType::DebugNode ); impl std::fmt::Debug for DebugNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("DebugNode") .field("child", &self.child()) .field("message", &self.message()) .finish() } } gsk4-0.9.6/src/fill_node.rs000064400000000000000000000007751046102023000136110ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{FillNode, RenderNodeType}; define_render_node!(FillNode, crate::ffi::GskFillNode, RenderNodeType::FillNode); impl std::fmt::Debug for FillNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("FillNode") .field("child", &self.child()) .field("fill_rule", &self.fill_rule()) .field("path", &self.path()) .finish() } } gsk4-0.9.6/src/gl_shader.rs000064400000000000000000000031231046102023000135740ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use glib::translate::*; use crate::{ffi, GLShader}; impl GLShader { #[doc(alias = "gsk_gl_shader_get_arg_vec2")] #[doc(alias = "get_arg_vec2")] pub fn arg_vec2(&self, args: &glib::Bytes, idx: i32) -> graphene::Vec2 { unsafe { let mut out_value = graphene::Vec2::uninitialized(); ffi::gsk_gl_shader_get_arg_vec2( self.to_glib_none().0, args.to_glib_none().0, idx, out_value.to_glib_none_mut().0, ); out_value } } #[doc(alias = "gsk_gl_shader_get_arg_vec3")] #[doc(alias = "get_arg_vec3")] pub fn arg_vec3(&self, args: &glib::Bytes, idx: i32) -> graphene::Vec3 { unsafe { let mut out_value = graphene::Vec3::uninitialized(); ffi::gsk_gl_shader_get_arg_vec3( self.to_glib_none().0, args.to_glib_none().0, idx, out_value.to_glib_none_mut().0, ); out_value } } #[doc(alias = "gsk_gl_shader_get_arg_vec4")] #[doc(alias = "get_arg_vec4")] pub fn arg_vec4(&self, args: &glib::Bytes, idx: i32) -> graphene::Vec4 { unsafe { let mut out_value = graphene::Vec4::uninitialized(); ffi::gsk_gl_shader_get_arg_vec4( self.to_glib_none().0, args.to_glib_none().0, idx, out_value.to_glib_none_mut().0, ); out_value } } } gsk4-0.9.6/src/gl_shader_node.rs000064400000000000000000000016721046102023000146100ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use glib::translate::*; use crate::{ffi, GLShaderNode, RenderNode, RenderNodeType}; define_render_node!( GLShaderNode, ffi::GskGLShaderNode, RenderNodeType::GlShaderNode ); impl GLShaderNode { #[doc(alias = "gsk_gl_shader_node_get_child")] #[doc(alias = "get_child")] pub fn child(&self, idx: u32) -> RenderNode { assert!(idx < self.n_children()); unsafe { from_glib_none(ffi::gsk_gl_shader_node_get_child( self.to_glib_none().0, idx, )) } } } impl std::fmt::Debug for GLShaderNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("GLShaderNode") .field("args", &self.args()) .field("n_children", &self.n_children()) .field("shader", &self.shader()) .finish() } } gsk4-0.9.6/src/inset_shadow_node.rs000064400000000000000000000012661046102023000153460ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{InsetShadowNode, RenderNodeType}; define_render_node!( InsetShadowNode, crate::ffi::GskInsetShadowNode, RenderNodeType::InsetShadowNode ); impl std::fmt::Debug for InsetShadowNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("InsetShadowNode") .field("blur_radius", &self.blur_radius()) .field("color", &self.color()) .field("dx", &self.dx()) .field("dy", &self.dy()) .field("outline", &self.outline()) .field("spread", &self.spread()) .finish() } } gsk4-0.9.6/src/lib.rs000064400000000000000000000046111046102023000124150ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(deprecated)] #![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use cairo; pub use gdk; pub use glib; pub use graphene; pub use gsk4_sys as ffi; pub use pango; // GSK 4 has no runtime to initialize macro_rules! assert_initialized_main_thread { () => {}; } // No-op macro_rules! skip_assert_initialized { () => {}; } #[allow(clippy::derived_hash_with_manual_eq)] #[allow(clippy::too_many_arguments)] #[allow(unused_imports)] mod auto; pub mod builders; pub mod prelude; pub use auto::*; #[macro_use] mod render_node; mod rounded_rect; mod shadow; // Render node types mod blend_node; mod blur_node; mod border_node; mod cairo_node; mod clip_node; mod color_matrix_node; mod color_node; mod color_stop; mod conic_gradient_node; mod container_node; mod cross_fade_node; mod debug_node; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] mod fill_node; mod gl_shader; mod gl_shader_node; mod inset_shadow_node; mod linear_gradient_node; #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] mod mask_node; #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] mod ngl_renderer; mod opacity_node; mod outset_shadow_node; mod parse_location; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] mod path; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] mod path_builder; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] mod path_point; mod radial_gradient_node; mod repeat_node; mod repeating_linear_gradient_node; mod repeating_radial_gradient_node; mod rounded_clip_node; mod shadow_node; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] mod stroke; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] mod stroke_node; mod text_node; mod texture_node; #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] mod texture_scale_node; mod transform; mod transform_node; pub use color_stop::ColorStop; #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] #[cfg_attr(feature = "v4_4", deprecated = "Since 4.4")] pub use ngl_renderer::NglRenderer; pub use parse_location::ParseLocation; pub use rounded_rect::RoundedRect; pub use shadow::Shadow; gsk4-0.9.6/src/linear_gradient_node.rs000064400000000000000000000012041046102023000157760ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{LinearGradientNode, RenderNodeType}; define_render_node!( LinearGradientNode, crate::ffi::GskLinearGradientNode, RenderNodeType::LinearGradientNode ); impl std::fmt::Debug for LinearGradientNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("LinearGradientNode") .field("color_stops", &self.color_stops()) .field("end", &self.end()) .field("n_color_stops", &self.n_color_stops()) .field("start", &self.start()) .finish() } } gsk4-0.9.6/src/mask_node.rs000064400000000000000000000007771046102023000136200ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{MaskNode, RenderNodeType}; define_render_node!(MaskNode, crate::ffi::GskMaskNode, RenderNodeType::MaskNode); impl std::fmt::Debug for MaskNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("MaskNode") .field("mask", &self.mask()) .field("mask_mode", &self.mask_mode()) .field("source", &self.source()) .finish() } } gsk4-0.9.6/src/ngl_renderer.rs000064400000000000000000000014761046102023000143230ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use std::fmt; use glib::translate::*; use crate::{ffi, prelude::*, Renderer}; glib::wrapper! { #[doc(alias = "GskNglRenderer")] pub struct NglRenderer(Object) @extends Renderer; match fn { type_ => || ffi::gsk_ngl_renderer_get_type(), } } impl NglRenderer { #[doc(alias = "gsk_ngl_renderer_new")] pub fn new() -> NglRenderer { assert_initialized_main_thread!(); unsafe { Renderer::from_glib_full(ffi::gsk_ngl_renderer_new()).unsafe_cast() } } } impl Default for NglRenderer { fn default() -> Self { Self::new() } } impl fmt::Display for NglRenderer { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("NglRenderer") } } gsk4-0.9.6/src/opacity_node.rs000064400000000000000000000007601046102023000143250ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{OpacityNode, RenderNodeType}; define_render_node!( OpacityNode, crate::ffi::GskOpacityNode, RenderNodeType::OpacityNode ); impl std::fmt::Debug for OpacityNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("OpacityNode") .field("child", &self.child()) .field("opacity", &self.opacity()) .finish() } } gsk4-0.9.6/src/outset_shadow_node.rs000064400000000000000000000012741046102023000155460ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{OutsetShadowNode, RenderNodeType}; define_render_node!( OutsetShadowNode, crate::ffi::GskOutsetShadowNode, RenderNodeType::OutsetShadowNode ); impl std::fmt::Debug for OutsetShadowNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("OutsetShadowNode") .field("blur_radius", &self.blur_radius()) .field("color", &self.color()) .field("dx", &self.dx()) .field("dy", &self.dy()) .field("outline", &self.outline()) .field("spread", &self.spread()) .finish() } } gsk4-0.9.6/src/parse_location.rs000064400000000000000000000020641046102023000146510ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use std::fmt; glib::wrapper! { #[doc(alias = "GskParseLocation")] pub struct ParseLocation(BoxedInline); } impl ParseLocation { #[inline] pub fn bytes(&self) -> usize { self.inner.bytes } #[inline] pub fn chars(&self) -> usize { self.inner.chars } #[inline] pub fn lines(&self) -> usize { self.inner.lines } #[inline] pub fn line_bytes(&self) -> usize { self.inner.line_bytes } #[inline] pub fn line_chars(&self) -> usize { self.inner.line_chars } } impl fmt::Debug for ParseLocation { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("ParseLocation") .field("bytes", &self.bytes()) .field("chars", &self.chars()) .field("lines", &self.lines()) .field("line_bytes", &self.line_bytes()) .field("line_chars", &self.line_chars()) .finish() } } gsk4-0.9.6/src/path.rs000064400000000000000000000030361046102023000126030ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use glib::translate::*; use crate::{ffi, Path, PathForeachFlags, PathOperation}; impl Path { #[doc(alias = "gsk_path_foreach")] pub fn foreach glib::ControlFlow>( &self, flags: PathForeachFlags, func: P, ) -> glib::ControlFlow { let mut func_data: P = func; unsafe extern "C" fn func_func< P: FnMut(&PathOperation, &graphene::Point, usize, f32) -> glib::ControlFlow, >( op: ffi::GskPathOperation, pts: *const graphene::ffi::graphene_point_t, n_pts: libc::size_t, weight: libc::c_float, user_data: glib::ffi::gpointer, ) -> glib::ffi::gboolean { let op = from_glib(op); let pts = from_glib_borrow(pts); let callback = user_data as *mut P; (*callback)(&op, &pts, n_pts, weight).into_glib() } let func = Some(func_func::

as _); let super_callback0: &mut P = &mut func_data; unsafe { from_glib(ffi::gsk_path_foreach( self.to_glib_none().0, flags.into_glib(), func, super_callback0 as *mut _ as *mut _, )) } } } impl std::str::FromStr for Path { type Err = glib::BoolError; fn from_str(s: &str) -> Result { assert_initialized_main_thread!(); Path::parse(s) } } gsk4-0.9.6/src/path_builder.rs000064400000000000000000000006051046102023000143100ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use glib::translate::*; use crate::PathBuilder; impl PathBuilder { #[doc(alias = "gsk_path_builder_add_cairo_path")] pub fn add_cairo_path(&self, path: &cairo::Path) { unsafe { crate::ffi::gsk_path_builder_add_cairo_path(self.to_glib_none().0, path.as_ptr()); } } } gsk4-0.9.6/src/path_point.rs000064400000000000000000000015271046102023000140170ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use glib::translate::*; use crate::{ffi, Path, PathDirection, PathPoint}; impl PathPoint { #[doc(alias = "gsk_path_point_get_curvature")] #[doc(alias = "get_curvature")] pub fn curvature( &self, path: &Path, direction: PathDirection, ) -> (f32, Option) { unsafe { let mut center = graphene::Point::uninitialized(); let ret = ffi::gsk_path_point_get_curvature( self.to_glib_none().0, path.to_glib_none().0, direction.into_glib(), center.to_glib_none_mut().0, ); if ret == 0.0 { (ret, None) } else { (ret, Some(center)) } } } } gsk4-0.9.6/src/prelude.rs000064400000000000000000000004011046102023000133000ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. // rustdoc-stripper-ignore-next //! Traits intended for blanket imports. #[doc(hidden)] pub use gdk::prelude::*; pub use crate::{auto::traits::*, render_node::IsRenderNode}; gsk4-0.9.6/src/radial_gradient_node.rs000064400000000000000000000014171046102023000157660ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{RadialGradientNode, RenderNodeType}; define_render_node!( RadialGradientNode, crate::ffi::GskRadialGradientNode, RenderNodeType::RadialGradientNode ); impl std::fmt::Debug for RadialGradientNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("RadialGradientNode") .field("center", &self.center()) .field("color_stops", &self.color_stops()) .field("end", &self.end()) .field("hradius", &self.hradius()) .field("n_color_stops", &self.n_color_stops()) .field("start", &self.start()) .field("vradius", &self.vradius()) .finish() } } gsk4-0.9.6/src/render_node.rs000064400000000000000000000160651046102023000141410ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use glib::translate::*; use crate::{ffi, prelude::*, ParseLocation, RenderNode, RenderNodeType}; impl RenderNode { #[inline] pub fn is(&self) -> bool { T::NODE_TYPE == self.node_type() } #[inline] pub fn type_(&self) -> glib::Type { unsafe { let ptr = self.as_ptr(); from_glib((*(*(ptr as *mut glib::gobject_ffi::GTypeInstance)).g_class).g_type) } } #[doc(alias = "gsk_render_node_deserialize")] pub fn deserialize(bytes: &glib::Bytes) -> Option { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gsk_render_node_deserialize( bytes.to_glib_none().0, None, std::ptr::null_mut(), )) } } #[doc(alias = "gsk_render_node_deserialize")] pub fn deserialize_with_error_func( bytes: &glib::Bytes, error_func: P, ) -> Option { assert_initialized_main_thread!(); let mut error_func_data: P = error_func; unsafe extern "C" fn error_func_func< P: FnMut(&ParseLocation, &ParseLocation, &glib::Error), >( start: *const ffi::GskParseLocation, end: *const ffi::GskParseLocation, error: *const glib::ffi::GError, user_data: glib::ffi::gpointer, ) { let start = from_glib_borrow(start); let end = from_glib_borrow(end); let error = from_glib_borrow(error); let callback = user_data as *mut P; (*callback)(&start, &end, &error); } let error_func = Some(error_func_func::

as _); let super_callback0: &mut P = &mut error_func_data; unsafe { from_glib_full(ffi::gsk_render_node_deserialize( bytes.to_glib_none().0, error_func, super_callback0 as *mut _ as *mut _, )) } } #[inline] pub fn downcast(self) -> Result { unsafe { if self.is::() { Ok(from_glib_full(self.into_glib_ptr())) } else { Err(self) } } } #[inline] pub fn downcast_ref(&self) -> Option<&T> { unsafe { if self.is::() { Some(&*(self as *const RenderNode as *const T)) } else { None } } } } impl std::fmt::Debug for RenderNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("RenderNode") .field("bounds", &self.bounds()) .field("node_type", &self.node_type()) .finish() } } // rustdoc-stripper-ignore-next /// A common trait implemented by the various [`RenderNode`](crate::RenderNode) /// types. /// /// # Safety /// /// The user is not supposed to implement this trait. pub unsafe trait IsRenderNode: StaticType + FromGlibPtrFull<*mut ffi::GskRenderNode> + std::convert::AsRef + 'static { const NODE_TYPE: RenderNodeType; fn upcast(self) -> RenderNode; fn upcast_ref(&self) -> &RenderNode; } #[doc(hidden)] impl AsRef for RenderNode { #[inline] fn as_ref(&self) -> &Self { self } } macro_rules! define_render_node { ($rust_type:ident, $ffi_type:path, $node_type:path) => { impl std::convert::AsRef for $rust_type { #[inline] fn as_ref(&self) -> &crate::RenderNode { self } } impl std::ops::Deref for $rust_type { type Target = crate::RenderNode; #[inline] fn deref(&self) -> &Self::Target { unsafe { &*(self as *const $rust_type as *const crate::RenderNode) } } } unsafe impl crate::render_node::IsRenderNode for $rust_type { const NODE_TYPE: RenderNodeType = $node_type; #[inline] fn upcast(self) -> crate::RenderNode { unsafe { glib::translate::from_glib_full( glib::translate::IntoGlibPtr::<*mut $ffi_type>::into_glib_ptr(self) as *mut crate::ffi::GskRenderNode, ) } } #[inline] fn upcast_ref(&self) -> &crate::RenderNode { self } } #[doc(hidden)] impl glib::translate::FromGlibPtrFull<*mut crate::ffi::GskRenderNode> for $rust_type { #[inline] unsafe fn from_glib_full(ptr: *mut crate::ffi::GskRenderNode) -> Self { glib::translate::from_glib_full(ptr as *mut $ffi_type) } } #[cfg(feature = "v4_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))] impl glib::value::ValueType for $rust_type { type Type = Self; } #[cfg(feature = "v4_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))] unsafe impl<'a> glib::value::FromValue<'a> for $rust_type { type Checker = glib::value::GenericValueTypeOrNoneChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); glib::translate::from_glib_full(crate::ffi::gsk_value_dup_render_node( glib::translate::ToGlibPtr::to_glib_none(value).0, )) } } #[cfg(feature = "v4_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))] impl glib::value::ToValue for $rust_type { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { crate::ffi::gsk_value_set_render_node( glib::translate::ToGlibPtrMut::to_glib_none_mut(&mut value).0, self.as_ptr() as *mut _, ) } value } #[inline] fn value_type(&self) -> glib::Type { use glib::prelude::StaticType; Self::static_type() } } #[cfg(feature = "v4_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))] impl glib::value::ToValueOptional for $rust_type { #[inline] fn to_value_optional(s: Option<&Self>) -> glib::Value { skip_assert_initialized!(); let mut value = glib::Value::for_value_type::(); unsafe { crate::ffi::gsk_value_set_render_node( glib::translate::ToGlibPtrMut::to_glib_none_mut(&mut value).0, s.map(|s| s.as_ptr()).unwrap_or(std::ptr::null_mut()) as *mut _, ) } value } } }; } gsk4-0.9.6/src/repeat_node.rs000064400000000000000000000007641046102023000141410ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{RenderNodeType, RepeatNode}; define_render_node!( RepeatNode, crate::ffi::GskRepeatNode, RenderNodeType::RepeatNode ); impl std::fmt::Debug for RepeatNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("RepeatNode") .field("child_bounds", &self.child_bounds()) .field("child", &self.child()) .finish() } } gsk4-0.9.6/src/repeating_linear_gradient_node.rs000064400000000000000000000007511046102023000200420ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{RenderNodeType, RepeatingLinearGradientNode}; define_render_node!( RepeatingLinearGradientNode, crate::ffi::GskRepeatingLinearGradientNode, RenderNodeType::RepeatingLinearGradientNode ); impl std::fmt::Debug for RepeatingLinearGradientNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("RepeatingLinearGradientNode").finish() } } gsk4-0.9.6/src/repeating_radial_gradient_node.rs000064400000000000000000000007511046102023000200240ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{RenderNodeType, RepeatingRadialGradientNode}; define_render_node!( RepeatingRadialGradientNode, crate::ffi::GskRepeatingRadialGradientNode, RenderNodeType::RepeatingRadialGradientNode ); impl std::fmt::Debug for RepeatingRadialGradientNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("RepeatingRadialGradientNode").finish() } } gsk4-0.9.6/src/rounded_clip_node.rs000064400000000000000000000010021046102023000153120ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{RenderNodeType, RoundedClipNode}; define_render_node!( RoundedClipNode, crate::ffi::GskRoundedClipNode, RenderNodeType::RoundedClipNode ); impl std::fmt::Debug for RoundedClipNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("RoundedClipNode") .field("clip", &self.clip()) .field("child", &self.child()) .finish() } } gsk4-0.9.6/src/rounded_rect.rs000064400000000000000000000075711046102023000143340ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use std::mem; use crate::ffi; use glib::translate::*; use graphene::{Point, Rect, Size}; glib::wrapper! { #[doc(alias = "GskRoundedRect")] pub struct RoundedRect(BoxedInline); } impl RoundedRect { #[doc(alias = "gsk_rounded_rect_init")] pub fn new( bounds: Rect, top_left: Size, top_right: Size, bottom_right: Size, bottom_left: Size, ) -> Self { assert_initialized_main_thread!(); unsafe { let mut rounded_rect = mem::MaybeUninit::uninit(); ffi::gsk_rounded_rect_init( rounded_rect.as_mut_ptr(), bounds.to_glib_none().0, top_left.to_glib_none().0, top_right.to_glib_none().0, bottom_right.to_glib_none().0, bottom_left.to_glib_none().0, ); Self::unsafe_from(rounded_rect.assume_init()) } } #[doc(alias = "gsk_rounded_rect_init_from_rect")] #[doc(alias = "init_from_rect")] pub fn from_rect(bounds: Rect, radius: f32) -> Self { assert_initialized_main_thread!(); unsafe { let mut rounded_rect = mem::MaybeUninit::uninit(); ffi::gsk_rounded_rect_init_from_rect( rounded_rect.as_mut_ptr(), bounds.to_glib_none().0, radius, ); Self::unsafe_from(rounded_rect.assume_init()) } } #[doc(alias = "gsk_rounded_rect_normalize")] pub fn normalize(&mut self) { unsafe { ffi::gsk_rounded_rect_normalize(&mut self.inner); } } #[doc(alias = "gsk_rounded_rect_offset")] pub fn offset(&mut self, dx: f32, dy: f32) { unsafe { ffi::gsk_rounded_rect_offset(&mut self.inner, dx, dy); } } #[doc(alias = "gsk_rounded_rect_shrink")] pub fn shrink(&mut self, top: f32, right: f32, bottom: f32, left: f32) { unsafe { ffi::gsk_rounded_rect_shrink(&mut self.inner, top, right, bottom, left); } } #[doc(alias = "gsk_rounded_rect_is_rectilinear")] pub fn is_rectilinear(&self) -> bool { unsafe { from_glib(ffi::gsk_rounded_rect_is_rectilinear(&self.inner)) } } #[doc(alias = "gsk_rounded_rect_contains_point")] pub fn contains_point(&self, point: Point) -> bool { unsafe { from_glib(ffi::gsk_rounded_rect_contains_point( &self.inner, point.to_glib_none().0, )) } } #[doc(alias = "gsk_rounded_rect_contains_rect")] pub fn contains_rect(&self, rect: Rect) -> bool { unsafe { from_glib(ffi::gsk_rounded_rect_contains_rect( &self.inner, rect.to_glib_none().0, )) } } #[doc(alias = "gsk_rounded_rect_intersects_rect")] pub fn intersects_rect(&self, rect: Rect) -> bool { unsafe { from_glib(ffi::gsk_rounded_rect_intersects_rect( &self.inner, rect.to_glib_none().0, )) } } #[inline] pub fn bounds(&self) -> &graphene::Rect { unsafe { &*(&self.inner.bounds as *const graphene::ffi::graphene_rect_t as *const graphene::Rect) } } #[inline] pub fn corner(&self) -> &[graphene::Size; 4] { unsafe { &*(&self.inner.corner as *const [graphene::ffi::graphene_size_t; 4] as *const [graphene::Size; 4]) } } } impl std::fmt::Debug for RoundedRect { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("RoundedRect") .field("is_rectilinear", &self.is_rectilinear()) .field("bounds", &self.bounds()) .field("corner", &self.corner()) .finish() } } gsk4-0.9.6/src/shadow.rs000064400000000000000000000024061046102023000131340ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use std::fmt; use crate::ffi; use gdk::RGBA; use glib::translate::*; glib::wrapper! { #[doc(alias = "GskShadow")] pub struct Shadow(BoxedInline); } impl Shadow { #[inline] pub fn new(color: RGBA, dx: f32, dy: f32, radius: f32) -> Self { assert_initialized_main_thread!(); unsafe { Self::unsafe_from(ffi::GskShadow { color: *color.to_glib_none().0, dx, dy, radius, }) } } #[inline] pub fn color(&self) -> &RGBA { unsafe { &*(&self.inner.color as *const gdk::ffi::GdkRGBA as *const RGBA) } } #[inline] pub fn dx(&self) -> f32 { self.inner.dx } #[inline] pub fn dy(&self) -> f32 { self.inner.dy } #[inline] pub fn radius(&self) -> f32 { self.inner.radius } } impl fmt::Debug for Shadow { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Shadow") .field("color", &self.color()) .field("dx", &self.dx()) .field("dy", &self.dy()) .field("radius", &self.radius()) .finish() } } gsk4-0.9.6/src/shadow_node.rs000064400000000000000000000014371046102023000141440ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use glib::translate::*; use crate::{ffi, RenderNodeType, Shadow, ShadowNode}; define_render_node!(ShadowNode, ffi::GskShadowNode, RenderNodeType::ShadowNode); impl ShadowNode { #[doc(alias = "gsk_shadow_node_get_shadow")] #[doc(alias = "get_shadow")] pub fn shadow(&self, i: usize) -> Shadow { assert!(i < self.n_shadows()); unsafe { from_glib_none(ffi::gsk_shadow_node_get_shadow(self.to_glib_none().0, i)) } } } impl std::fmt::Debug for ShadowNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("ShadowNode") .field("n_shadows", &self.n_shadows()) .field("child", &self.child()) .finish() } } gsk4-0.9.6/src/stroke.rs000064400000000000000000000032051046102023000131540ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{LineCap, LineJoin, Stroke}; impl Stroke { // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct a [`Stroke`]. /// /// This method returns an instance of /// [`StrokeBuilder`](crate::builders::StrokeBuilder) which can be used to /// create a [`Stroke`]. pub fn builder(line_width: f32) -> StrokeBuilder { assert_initialized_main_thread!(); StrokeBuilder(Stroke::new(line_width)) } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct a [`Stroke`]. /// /// [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 StrokeBuilder(Stroke); impl StrokeBuilder { pub fn dash(self, dash: &[f32]) -> Self { self.0.set_dash(dash); self } pub fn dash_offset(self, dash_offset: f32) -> Self { self.0.set_dash_offset(dash_offset); self } pub fn line_cap(self, line_cap: LineCap) -> Self { self.0.set_line_cap(line_cap); self } pub fn line_join(self, line_join: LineJoin) -> Self { self.0.set_line_join(line_join); self } pub fn miter_limit(self, miter_limit: f32) -> Self { self.0.set_miter_limit(miter_limit); self } // rustdoc-stripper-ignore-next /// Build the [`Stroke`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Stroke { self.0 } } gsk4-0.9.6/src/stroke_node.rs000064400000000000000000000010211046102023000141530ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{RenderNodeType, StrokeNode}; define_render_node!( StrokeNode, crate::ffi::GskStrokeNode, RenderNodeType::StrokeNode ); impl std::fmt::Debug for StrokeNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("StrokeNode") .field("child", &self.child()) .field("stroke", &self.stroke()) .field("path", &self.path()) .finish() } } gsk4-0.9.6/src/text_node.rs000064400000000000000000000021411046102023000136340ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{RenderNodeType, TextNode}; define_render_node!(TextNode, crate::ffi::GskTextNode, RenderNodeType::TextNode); impl std::fmt::Debug for TextNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { #[cfg(feature = "v4_2")] { f.debug_struct("TextNode") .field("color", &self.color()) .field("glyphs", &self.glyphs()) .field("num_glyphs", &self.num_glyphs()) .field("font", &self.font()) .field("offset", &self.offset()) .field("has_color_glyphs", &self.has_color_glyphs()) .finish() } #[cfg(not(feature = "v4_2"))] { f.debug_struct("TextNode") .field("color", &self.color()) .field("glyphs", &self.glyphs()) .field("num_glyphs", &self.num_glyphs()) .field("font", &self.font()) .field("offset", &self.offset()) .finish() } } } gsk4-0.9.6/src/texture_node.rs000064400000000000000000000007051046102023000143540ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{RenderNodeType, TextureNode}; define_render_node!( TextureNode, crate::ffi::GskTextureNode, RenderNodeType::TextureNode ); impl std::fmt::Debug for TextureNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("TextureNode") .field("texture", &self.texture()) .finish() } } gsk4-0.9.6/src/texture_scale_node.rs000064400000000000000000000010201046102023000155120ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{RenderNodeType, TextureScaleNode}; define_render_node!( TextureScaleNode, crate::ffi::GskTextureScaleNode, RenderNodeType::TextureScaleNode ); impl std::fmt::Debug for TextureScaleNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("TextureScaleNode") .field("texture", &self.texture()) .field("filter", &self.filter()) .finish() } } gsk4-0.9.6/src/transform.rs000064400000000000000000000111501046102023000136560ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use glib::translate::*; use crate::{ffi, Transform}; impl Transform { #[doc(alias = "gsk_transform_parse")] pub fn parse(string: impl IntoGStr) -> Result { assert_initialized_main_thread!(); unsafe { string.run_with_gstr(|string| { let mut out_transform = std::ptr::null_mut(); let ret = from_glib(ffi::gsk_transform_parse( string.as_ptr(), &mut out_transform, )); if ret { Ok(from_glib_full(out_transform)) } else { Err(glib::bool_error!("Can't parse Transform")) } }) } } #[doc(alias = "gsk_transform_invert")] pub fn invert(self) -> Result { unsafe { let matrix = self.to_matrix(); if matrix == graphene::Matrix::new_identity() { return Ok(self); } let res: Option = from_glib_full(ffi::gsk_transform_invert(self.into_glib_ptr())); res.ok_or_else(|| glib::bool_error!("Failed to invert the transform")) } } #[doc(alias = "gsk_transform_rotate")] #[must_use] pub fn rotate(self, angle: f32) -> Self { unsafe { let res: Option = from_glib_full(ffi::gsk_transform_rotate(self.into_glib_ptr(), angle)); res.unwrap_or_default() } } #[doc(alias = "gsk_transform_rotate_3d")] #[must_use] pub fn rotate_3d(self, angle: f32, axis: &graphene::Vec3) -> Self { unsafe { let res: Option = from_glib_full(ffi::gsk_transform_rotate_3d( self.into_glib_ptr(), angle, axis.to_glib_none().0, )); res.unwrap_or_default() } } #[doc(alias = "gsk_transform_scale")] #[must_use] pub fn scale(self, factor_x: f32, factor_y: f32) -> Self { unsafe { let res: Option = from_glib_full(ffi::gsk_transform_scale( self.into_glib_ptr(), factor_x, factor_y, )); res.unwrap_or_default() } } #[doc(alias = "gsk_transform_scale_3d")] #[must_use] pub fn scale_3d(self, factor_x: f32, factor_y: f32, factor_z: f32) -> Self { unsafe { let res: Option = from_glib_full(ffi::gsk_transform_scale_3d( self.into_glib_ptr(), factor_x, factor_y, factor_z, )); res.unwrap_or_default() } } #[cfg(feature = "v4_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))] #[doc(alias = "gsk_transform_skew")] #[must_use] pub fn skew(self, skew_x: f32, skew_y: f32) -> Self { unsafe { let res: Option = from_glib_full(ffi::gsk_transform_skew( self.into_glib_ptr(), skew_x, skew_y, )); res.unwrap_or_default() } } #[doc(alias = "gsk_transform_transform")] #[must_use] pub fn transform(self, other: Option<&Self>) -> Self { unsafe { let res: Option = from_glib_full(ffi::gsk_transform_transform( self.into_glib_ptr(), other.to_glib_none().0, )); res.unwrap_or_default() } } #[doc(alias = "gsk_transform_translate")] #[must_use] pub fn translate(self, point: &graphene::Point) -> Self { unsafe { let res: Option = from_glib_full(ffi::gsk_transform_translate( self.into_glib_ptr(), point.to_glib_none().0, )); res.unwrap_or_default() } } #[doc(alias = "gsk_transform_translate_3d")] #[must_use] pub fn translate_3d(self, point: &graphene::Point3D) -> Self { unsafe { let res: Option = from_glib_full(ffi::gsk_transform_translate_3d( self.into_glib_ptr(), point.to_glib_none().0, )); res.unwrap_or_default() } } } impl std::str::FromStr for Transform { type Err = glib::BoolError; fn from_str(s: &str) -> Result { skip_assert_initialized!(); Self::parse(s) } } #[test] fn invert_identity_is_identity() { let transform = Transform::new(); let output = transform.clone().invert(); assert_eq!(output.unwrap(), transform); } gsk4-0.9.6/src/transform_node.rs000064400000000000000000000010001046102023000146540ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::{RenderNodeType, TransformNode}; define_render_node!( TransformNode, crate::ffi::GskTransformNode, RenderNodeType::TransformNode ); impl std::fmt::Debug for TransformNode { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("TransformNode") .field("child", &self.child()) .field("transform", &self.transform()) .finish() } } gsk4-0.9.6/tests/check_gir.rs000064400000000000000000000003461046102023000141410ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. #[test] fn check_gir_file() { let res = gir_format_check::check_gir_file("Gir.toml"); println!("{res}"); assert_eq!(res.nb_errors, 0); }