From 62a51daeb39397a81881e8624ff2bb064efd4ca9 Mon Sep 17 00:00:00 2001 From: Lleyton Gray Date: Sat, 31 Aug 2024 14:49:29 -0700 Subject: [PATCH 1/2] update bindings against gir nightly --- Cargo.lock | 302 ++-- fusebox/Cargo.toml | 12 +- fusebox/src/auto/enums.rs | 54 +- fusebox/src/auto/fuse.rs | 68 +- fusebox/src/auto/fuses_manager.rs | 54 +- fusebox/src/auto/mod.rs | 2 +- fusebox/src/auto/versions.txt | 4 +- fusebox/src/lib.rs | 2 +- fusebox/sys/Cargo.toml | 12 +- fusebox/sys/build.rs | 6 +- fusebox/sys/src/lib.rs | 73 +- fusebox/sys/tests/abi.rs | 61 +- fusebox/sys/tests/constant.c | 4 +- fusebox/sys/tests/layout.c | 4 +- gir | 2 +- gir-files | 2 +- libbismuth/Cargo.toml | 12 +- libbismuth/src/auto/album.rs | 766 +++------ libbismuth/src/auto/album_page.rs | 116 +- libbismuth/src/auto/animation.rs | 99 +- libbismuth/src/auto/animation_target.rs | 7 +- libbismuth/src/auto/bin.rs | 330 ++-- .../src/auto/callback_animation_target.rs | 20 +- libbismuth/src/auto/carousel.rs | 605 +++---- .../src/auto/carousel_indicator_dots.rs | 333 ++-- .../src/auto/carousel_indicator_lines.rs | 331 ++-- libbismuth/src/auto/enum_list_item.rs | 72 +- libbismuth/src/auto/enum_list_model.rs | 70 +- libbismuth/src/auto/enums.rs | 383 ++--- libbismuth/src/auto/hugger.rs | 618 +++---- libbismuth/src/auto/hugger_page.rs | 88 +- libbismuth/src/auto/lapel.rs | 760 +++------ libbismuth/src/auto/latch.rs | 396 ++--- libbismuth/src/auto/latch_layout.rs | 136 +- libbismuth/src/auto/latch_scrollable.rs | 427 ++--- libbismuth/src/auto/mod.rs | 4 +- .../src/auto/property_animation_target.rs | 91 +- libbismuth/src/auto/spring_animation.rs | 313 ++-- libbismuth/src/auto/spring_params.rs | 30 +- libbismuth/src/auto/swipe_tracker.rs | 280 +--- libbismuth/src/auto/swipeable.rs | 42 +- libbismuth/src/auto/timed_animation.rs | 285 ++-- libbismuth/src/auto/versions.txt | 4 +- libbismuth/src/lib.rs | 2 +- libbismuth/sys/Cargo.toml | 12 +- libbismuth/sys/build.rs | 6 +- libbismuth/sys/src/lib.rs | 411 ++--- libbismuth/sys/tests/abi.rs | 229 +-- libbismuth/sys/tests/constant.c | 4 +- libbismuth/sys/tests/layout.c | 4 +- libhelium/Cargo.toml | 12 +- libhelium/src/auto/about_window.rs | 953 ++++------- libhelium/src/auto/animation.rs | 128 +- libhelium/src/auto/animation_target.rs | 9 +- libhelium/src/auto/app_bar.rs | 675 +++----- libhelium/src/auto/application.rs | 299 +--- libhelium/src/auto/application_window.rs | 573 +++---- libhelium/src/auto/avatar.rs | 407 ++--- libhelium/src/auto/badge.rs | 342 ++-- libhelium/src/auto/banner.rs | 400 ++--- libhelium/src/auto/bin.rs | 344 ++-- libhelium/src/auto/bottom_bar.rs | 494 ++---- libhelium/src/auto/bottom_sheet.rs | 534 ++----- libhelium/src/auto/button.rs | 647 +++----- libhelium/src/auto/button_content.rs | 358 ++--- .../src/auto/callback_animation_target.rs | 23 +- libhelium/src/auto/cam16_color.rs | 4 +- libhelium/src/auto/chip.rs | 407 ++--- libhelium/src/auto/chip_group.rs | 374 ++--- libhelium/src/auto/content_block.rs | 514 ++---- libhelium/src/auto/content_block_image.rs | 403 ++--- .../src/auto/content_block_image_cluster.rs | 436 ++--- libhelium/src/auto/content_list.rs | 379 ++--- libhelium/src/auto/date_picker.rs | 733 +++------ libhelium/src/auto/desktop.rs | 230 +-- libhelium/src/auto/dialog.rs | 676 +++----- libhelium/src/auto/divider.rs | 361 ++--- libhelium/src/auto/dropdown.rs | 475 +++--- libhelium/src/auto/empty_page.rs | 449 ++---- libhelium/src/auto/enums.rs | 618 +++---- libhelium/src/auto/hct_color.rs | 4 +- libhelium/src/auto/lab_color.rs | 10 +- libhelium/src/auto/lch_color.rs | 4 +- libhelium/src/auto/mini_content_block.rs | 529 ++---- libhelium/src/auto/mod.rs | 2 +- libhelium/src/auto/modifier_badge.rs | 428 ++--- libhelium/src/auto/navigation_rail.rs | 377 ++--- libhelium/src/auto/navigation_section.rs | 377 ++--- libhelium/src/auto/overlay_button.rs | 706 +++----- libhelium/src/auto/progress_bar.rs | 376 ++--- .../src/auto/property_animation_target.rs | 126 +- libhelium/src/auto/rgb_color.rs | 4 +- libhelium/src/auto/segmented_button.rs | 343 ++-- libhelium/src/auto/settings_list.rs | 379 ++--- libhelium/src/auto/settings_page.rs | 338 ++-- libhelium/src/auto/settings_row.rs | 602 +++---- libhelium/src/auto/settings_window.rs | 521 +++--- libhelium/src/auto/side_bar.rs | 595 +++---- libhelium/src/auto/slider.rs | 404 ++--- libhelium/src/auto/spring_animation.rs | 364 ++--- libhelium/src/auto/spring_params.rs | 188 +-- libhelium/src/auto/switch.rs | 361 ++--- libhelium/src/auto/switch_bar.rs | 414 ++--- libhelium/src/auto/tab.rs | 517 +++--- libhelium/src/auto/tab_page.rs | 338 ++-- libhelium/src/auto/tab_switcher.rs | 824 +++------- libhelium/src/auto/text_field.rs | 785 +++------ libhelium/src/auto/time_picker.rs | 761 ++++----- libhelium/src/auto/timed_animation.rs | 329 ++-- libhelium/src/auto/tip.rs | 185 +-- libhelium/src/auto/toast.rs | 401 ++--- libhelium/src/auto/versions.txt | 4 +- libhelium/src/auto/view.rs | 114 +- libhelium/src/auto/view_aux.rs | 357 ++--- libhelium/src/auto/view_chooser.rs | 333 ++-- libhelium/src/auto/view_dual.rs | 433 ++--- libhelium/src/auto/view_mono.rs | 323 ++-- libhelium/src/auto/view_sub_title.rs | 338 ++-- libhelium/src/auto/view_switcher.rs | 333 ++-- libhelium/src/auto/view_title.rs | 333 ++-- libhelium/src/auto/welcome_screen.rs | 392 ++--- libhelium/src/auto/window.rs | 585 +++---- libhelium/src/auto/xyz_color.rs | 4 +- libhelium/sys/Cargo.toml | 12 +- libhelium/sys/build.rs | 6 +- libhelium/sys/src/lib.rs | 1239 ++++++-------- libhelium/sys/tests/abi.rs | 1417 +++-------------- libhelium/sys/tests/constant.c | 4 +- libhelium/sys/tests/layout.c | 4 +- 129 files changed, 13242 insertions(+), 24786 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4bffeea..37b2e9b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,31 +16,30 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "cairo-rs" -version = "0.20.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#bb9b2e8787d11ecf3b570fdc483a480156046035" +version = "0.21.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#7c3e879d85c8abb9f288ef30c31a260c33ff7e42" dependencies = [ "bitflags", "cairo-sys-rs", "glib", "libc", - "thiserror", ] [[package]] name = "cairo-sys-rs" -version = "0.20.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#bb9b2e8787d11ecf3b570fdc483a480156046035" +version = "0.21.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#7c3e879d85c8abb9f288ef30c31a260c33ff7e42" dependencies = [ "glib-sys", "libc", - "system-deps 7.0.1", + "system-deps", ] [[package]] name = "cfg-expr" -version = "0.15.8" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +checksum = "345c78335be0624ed29012dc10c49102196c6882c12dde65d9f35b02da2aada8" dependencies = [ "smallvec", "target-lexicon", @@ -65,14 +64,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "field-offset" @@ -113,7 +112,7 @@ dependencies = [ "libc", "pango-sys", "shell-words", - "system-deps 7.0.1", + "system-deps", "tempfile", ] @@ -182,8 +181,8 @@ dependencies = [ [[package]] name = "gdk-pixbuf" -version = "0.20.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#bb9b2e8787d11ecf3b570fdc483a480156046035" +version = "0.21.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#7c3e879d85c8abb9f288ef30c31a260c33ff7e42" dependencies = [ "gdk-pixbuf-sys", "gio", @@ -193,20 +192,20 @@ dependencies = [ [[package]] name = "gdk-pixbuf-sys" -version = "0.20.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#bb9b2e8787d11ecf3b570fdc483a480156046035" +version = "0.21.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#7c3e879d85c8abb9f288ef30c31a260c33ff7e42" dependencies = [ "gio-sys", "glib-sys", "gobject-sys", "libc", - "system-deps 7.0.1", + "system-deps", ] [[package]] name = "gdk4" -version = "0.9.0" -source = "git+https://github.com/gtk-rs/gtk4-rs?branch=master#f0e1d9e1f44fc71403bae0de88f55296a93cc09a" +version = "0.10.0" +source = "git+https://github.com/gtk-rs/gtk4-rs?branch=master#3b1387a3ba9951a6dcebf62dfe685010b42287d0" dependencies = [ "cairo-rs", "gdk-pixbuf", @@ -219,8 +218,8 @@ dependencies = [ [[package]] name = "gdk4-sys" -version = "0.9.0" -source = "git+https://github.com/gtk-rs/gtk4-rs?branch=master#f0e1d9e1f44fc71403bae0de88f55296a93cc09a" +version = "0.10.0" +source = "git+https://github.com/gtk-rs/gtk4-rs?branch=master#3b1387a3ba9951a6dcebf62dfe685010b42287d0" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", @@ -230,13 +229,13 @@ dependencies = [ "libc", "pango-sys", "pkg-config", - "system-deps 6.2.2", + "system-deps", ] [[package]] name = "gio" -version = "0.20.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#bb9b2e8787d11ecf3b570fdc483a480156046035" +version = "0.21.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#7c3e879d85c8abb9f288ef30c31a260c33ff7e42" dependencies = [ "futures-channel", "futures-core", @@ -247,25 +246,24 @@ dependencies = [ "libc", "pin-project-lite", "smallvec", - "thiserror", ] [[package]] name = "gio-sys" -version = "0.20.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#bb9b2e8787d11ecf3b570fdc483a480156046035" +version = "0.21.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#7c3e879d85c8abb9f288ef30c31a260c33ff7e42" dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 7.0.1", - "windows-sys", + "system-deps", + "windows-sys 0.59.0", ] [[package]] name = "glib" -version = "0.20.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#bb9b2e8787d11ecf3b570fdc483a480156046035" +version = "0.21.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#7c3e879d85c8abb9f288ef30c31a260c33ff7e42" dependencies = [ "bitflags", "futures-channel", @@ -280,13 +278,12 @@ dependencies = [ "libc", "memchr", "smallvec", - "thiserror", ] [[package]] name = "glib-macros" -version = "0.20.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#bb9b2e8787d11ecf3b570fdc483a480156046035" +version = "0.21.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#7c3e879d85c8abb9f288ef30c31a260c33ff7e42" dependencies = [ "heck", "proc-macro-crate", @@ -297,27 +294,27 @@ dependencies = [ [[package]] name = "glib-sys" -version = "0.20.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#bb9b2e8787d11ecf3b570fdc483a480156046035" +version = "0.21.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#7c3e879d85c8abb9f288ef30c31a260c33ff7e42" dependencies = [ "libc", - "system-deps 7.0.1", + "system-deps", ] [[package]] name = "gobject-sys" -version = "0.20.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#bb9b2e8787d11ecf3b570fdc483a480156046035" +version = "0.21.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#7c3e879d85c8abb9f288ef30c31a260c33ff7e42" dependencies = [ "glib-sys", "libc", - "system-deps 7.0.1", + "system-deps", ] [[package]] name = "graphene-rs" -version = "0.20.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#bb9b2e8787d11ecf3b570fdc483a480156046035" +version = "0.21.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#7c3e879d85c8abb9f288ef30c31a260c33ff7e42" dependencies = [ "glib", "graphene-sys", @@ -326,19 +323,19 @@ dependencies = [ [[package]] name = "graphene-sys" -version = "0.20.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#bb9b2e8787d11ecf3b570fdc483a480156046035" +version = "0.21.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#7c3e879d85c8abb9f288ef30c31a260c33ff7e42" dependencies = [ "glib-sys", "libc", "pkg-config", - "system-deps 7.0.1", + "system-deps", ] [[package]] name = "gsk4" -version = "0.9.0" -source = "git+https://github.com/gtk-rs/gtk4-rs?branch=master#f0e1d9e1f44fc71403bae0de88f55296a93cc09a" +version = "0.10.0" +source = "git+https://github.com/gtk-rs/gtk4-rs?branch=master#3b1387a3ba9951a6dcebf62dfe685010b42287d0" dependencies = [ "cairo-rs", "gdk4", @@ -351,8 +348,8 @@ dependencies = [ [[package]] name = "gsk4-sys" -version = "0.9.0" -source = "git+https://github.com/gtk-rs/gtk4-rs?branch=master#f0e1d9e1f44fc71403bae0de88f55296a93cc09a" +version = "0.10.0" +source = "git+https://github.com/gtk-rs/gtk4-rs?branch=master#3b1387a3ba9951a6dcebf62dfe685010b42287d0" dependencies = [ "cairo-sys-rs", "gdk4-sys", @@ -361,13 +358,13 @@ dependencies = [ "graphene-sys", "libc", "pango-sys", - "system-deps 6.2.2", + "system-deps", ] [[package]] name = "gtk4" -version = "0.9.0" -source = "git+https://github.com/gtk-rs/gtk4-rs?branch=master#f0e1d9e1f44fc71403bae0de88f55296a93cc09a" +version = "0.10.0" +source = "git+https://github.com/gtk-rs/gtk4-rs?branch=master#3b1387a3ba9951a6dcebf62dfe685010b42287d0" dependencies = [ "cairo-rs", "field-offset", @@ -386,8 +383,8 @@ dependencies = [ [[package]] name = "gtk4-macros" -version = "0.9.0" -source = "git+https://github.com/gtk-rs/gtk4-rs?branch=master#f0e1d9e1f44fc71403bae0de88f55296a93cc09a" +version = "0.10.0" +source = "git+https://github.com/gtk-rs/gtk4-rs?branch=master#3b1387a3ba9951a6dcebf62dfe685010b42287d0" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -397,8 +394,8 @@ dependencies = [ [[package]] name = "gtk4-sys" -version = "0.9.0" -source = "git+https://github.com/gtk-rs/gtk4-rs?branch=master#f0e1d9e1f44fc71403bae0de88f55296a93cc09a" +version = "0.10.0" +source = "git+https://github.com/gtk-rs/gtk4-rs?branch=master#3b1387a3ba9951a6dcebf62dfe685010b42287d0" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", @@ -410,7 +407,7 @@ dependencies = [ "gsk4-sys", "libc", "pango-sys", - "system-deps 6.2.2", + "system-deps", ] [[package]] @@ -427,9 +424,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "indexmap" -version = "2.2.6" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown", @@ -464,15 +461,15 @@ dependencies = [ "libc", "pango-sys", "shell-words", - "system-deps 7.0.1", + "system-deps", "tempfile", ] [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libhelium" @@ -503,7 +500,7 @@ dependencies = [ "libc", "pango-sys", "shell-words", - "system-deps 7.0.1", + "system-deps", "tempfile", ] @@ -536,8 +533,8 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "pango" -version = "0.20.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#bb9b2e8787d11ecf3b570fdc483a480156046035" +version = "0.21.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#7c3e879d85c8abb9f288ef30c31a260c33ff7e42" dependencies = [ "gio", "glib", @@ -547,13 +544,13 @@ dependencies = [ [[package]] name = "pango-sys" -version = "0.20.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#bb9b2e8787d11ecf3b570fdc483a480156046035" +version = "0.21.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#7c3e879d85c8abb9f288ef30c31a260c33ff7e42" dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 7.0.1", + "system-deps", ] [[package]] @@ -576,11 +573,11 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.21.1", + "toml_edit", ] [[package]] @@ -594,33 +591,33 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -631,18 +628,18 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.203" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", @@ -651,9 +648,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] @@ -681,9 +678,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "syn" -version = "2.0.68" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -692,22 +689,9 @@ dependencies = [ [[package]] name = "system-deps" -version = "6.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" -dependencies = [ - "cfg-expr", - "heck", - "pkg-config", - "toml", - "version-compare", -] - -[[package]] -name = "system-deps" -version = "7.0.1" +version = "7.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c81f13d9a334a6c242465140bd262fae382b752ff2011c4f7419919a9c97922" +checksum = "070a0a5e7da2d24be457809c4b3baa57a835fd2829ad8b86f9a049052fe71031" dependencies = [ "cfg-expr", "heck", @@ -718,85 +702,55 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.14" +version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", + "windows-sys 0.59.0", ] [[package]] name = "toml" -version = "0.8.14" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.14", + "toml_edit", ] [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.22.14" +version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.13", + "winnow", ] [[package]] @@ -820,11 +774,20 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -838,66 +801,57 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" - -[[package]] -name = "winnow" -version = "0.5.40" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.13" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] diff --git a/fusebox/Cargo.toml b/fusebox/Cargo.toml index f120908..fceca3b 100644 --- a/fusebox/Cargo.toml +++ b/fusebox/Cargo.toml @@ -36,34 +36,34 @@ futures-channel = "0.3" [dependencies.glib] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [dependencies.gio] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [dependencies.gdk-pixbuf] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [dependencies.pango] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [dependencies.gdk] package = "gdk4" git = "https://github.com/gtk-rs/gtk4-rs" -version = "0.9" +version = "0.10" branch = "master" [dependencies.gtk] package = "gtk4" git = "https://github.com/gtk-rs/gtk4-rs" -version = "0.9" +version = "0.10" branch = "master" [dependencies.ffi] diff --git a/fusebox/src/auto/enums.rs b/fusebox/src/auto/enums.rs index e530476..c857e55 100644 --- a/fusebox/src/auto/enums.rs +++ b/fusebox/src/auto/enums.rs @@ -1,12 +1,13 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::ffi; -use glib::{prelude::*, translate::*}; +use crate::{ffi}; +use glib::{prelude::*,translate::*}; -#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] #[non_exhaustive] #[doc(alias = "FuseboxFuseCategory")] pub enum FuseCategory { @@ -18,7 +19,7 @@ pub enum FuseCategory { System, #[doc(alias = "FUSEBOX_FUSE_CATEGORY_CUSTOM")] Custom, - #[doc(hidden)] +#[doc(hidden)] __Unknown(i32), } @@ -27,49 +28,49 @@ impl IntoGlib for FuseCategory { type GlibType = ffi::FuseboxFuseCategory; #[inline] - fn into_glib(self) -> ffi::FuseboxFuseCategory { - match self { +fn into_glib(self) -> ffi::FuseboxFuseCategory { +match self { Self::Network => ffi::FUSEBOX_FUSE_CATEGORY_NETWORK, Self::Personal => ffi::FUSEBOX_FUSE_CATEGORY_PERSONAL, Self::System => ffi::FUSEBOX_FUSE_CATEGORY_SYSTEM, Self::Custom => ffi::FUSEBOX_FUSE_CATEGORY_CUSTOM, Self::__Unknown(value) => value, - } - } +} +} } #[doc(hidden)] impl FromGlib for FuseCategory { #[inline] - unsafe fn from_glib(value: ffi::FuseboxFuseCategory) -> Self { +unsafe fn from_glib(value: ffi::FuseboxFuseCategory) -> Self { skip_assert_initialized!(); - - match value { + +match value { ffi::FUSEBOX_FUSE_CATEGORY_NETWORK => Self::Network, ffi::FUSEBOX_FUSE_CATEGORY_PERSONAL => Self::Personal, ffi::FUSEBOX_FUSE_CATEGORY_SYSTEM => Self::System, ffi::FUSEBOX_FUSE_CATEGORY_CUSTOM => Self::Custom, value => Self::__Unknown(value), - } - } +} +} } impl StaticType for FuseCategory { - #[inline] + #[inline] #[doc(alias = "fusebox_fuse_category_get_type")] - fn static_type() -> glib::Type { - unsafe { from_glib(ffi::fusebox_fuse_category_get_type()) } - } -} + fn static_type() -> glib::Type { + unsafe { from_glib(ffi::fusebox_fuse_category_get_type()) } + } + } impl glib::HasParamSpec for FuseCategory { - 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 - } + 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 FuseCategory { @@ -109,3 +110,4 @@ impl From for glib::Value { ToValue::to_value(&v) } } + diff --git a/fusebox/src/auto/fuse.rs b/fusebox/src/auto/fuse.rs index 0f6bfe3..85ba871 100644 --- a/fusebox/src/auto/fuse.rs +++ b/fusebox/src/auto/fuse.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, FuseCategory}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,FuseCategory}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "FuseboxFuse")] @@ -21,7 +17,8 @@ glib::wrapper! { } impl Fuse { - pub const NONE: Option<&'static Fuse> = None; + pub const NONE: Option<&'static Fuse> = None; + } mod sealed { @@ -33,7 +30,9 @@ pub trait FuseExt: IsA + sealed::Sealed + 'static { #[doc(alias = "fusebox_fuse_get_widget")] #[doc(alias = "get_widget")] fn widget(&self) -> gtk::Widget { - unsafe { from_glib_full(ffi::fusebox_fuse_get_widget(self.as_ref().to_glib_none().0)) } + unsafe { + from_glib_full(ffi::fusebox_fuse_get_widget(self.as_ref().to_glib_none().0)) + } } #[doc(alias = "fusebox_fuse_shown")] @@ -58,10 +57,7 @@ pub trait FuseExt: IsA + sealed::Sealed + 'static { #[doc(alias = "fusebox_fuse_search_callback")] fn search_callback(&self, location: &str) { unsafe { - ffi::fusebox_fuse_search_callback( - self.as_ref().to_glib_none().0, - location.to_glib_none().0, - ); + ffi::fusebox_fuse_search_callback(self.as_ref().to_glib_none().0, location.to_glib_none().0); } } @@ -69,25 +65,23 @@ pub trait FuseExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_category")] fn category(&self) -> FuseCategory { unsafe { - from_glib(ffi::fusebox_fuse_get_category( - self.as_ref().to_glib_none().0, - )) + from_glib(ffi::fusebox_fuse_get_category(self.as_ref().to_glib_none().0)) } } #[doc(alias = "fusebox_fuse_get_index")] #[doc(alias = "get_index")] fn index(&self) -> i32 { - unsafe { ffi::fusebox_fuse_get_index(self.as_ref().to_glib_none().0) } + unsafe { + ffi::fusebox_fuse_get_index(self.as_ref().to_glib_none().0) + } } #[doc(alias = "fusebox_fuse_get_code_name")] #[doc(alias = "get_code_name")] fn code_name(&self) -> glib::GString { unsafe { - from_glib_none(ffi::fusebox_fuse_get_code_name( - self.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::fusebox_fuse_get_code_name(self.as_ref().to_glib_none().0)) } } @@ -95,9 +89,7 @@ pub trait FuseExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_display_name")] fn display_name(&self) -> glib::GString { unsafe { - from_glib_none(ffi::fusebox_fuse_get_display_name( - self.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::fusebox_fuse_get_display_name(self.as_ref().to_glib_none().0)) } } @@ -105,16 +97,16 @@ pub trait FuseExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_description")] fn description(&self) -> glib::GString { unsafe { - from_glib_none(ffi::fusebox_fuse_get_description( - self.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::fusebox_fuse_get_description(self.as_ref().to_glib_none().0)) } } #[doc(alias = "fusebox_fuse_get_icon")] #[doc(alias = "get_icon")] fn icon(&self) -> glib::GString { - unsafe { from_glib_none(ffi::fusebox_fuse_get_icon(self.as_ref().to_glib_none().0)) } + unsafe { + from_glib_none(ffi::fusebox_fuse_get_icon(self.as_ref().to_glib_none().0)) + } } //#[doc(alias = "fusebox_fuse_get_supported_settings")] @@ -127,9 +119,7 @@ pub trait FuseExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_can_show")] fn can_show(&self) -> bool { unsafe { - from_glib(ffi::fusebox_fuse_get_can_show( - self.as_ref().to_glib_none().0, - )) + from_glib(ffi::fusebox_fuse_get_can_show(self.as_ref().to_glib_none().0)) } } @@ -142,24 +132,14 @@ pub trait FuseExt: IsA + sealed::Sealed + 'static { #[doc(alias = "can-show")] fn connect_can_show_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_can_show_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::FuseboxFuse, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_can_show_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::FuseboxFuse, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Fuse::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::can-show\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_can_show_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::can-show\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_can_show_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/fusebox/src/auto/fuses_manager.rs b/fusebox/src/auto/fuses_manager.rs index 4ff62d9..e3d9644 100644 --- a/fusebox/src/auto/fuses_manager.rs +++ b/fusebox/src/auto/fuses_manager.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, Fuse}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,Fuse}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "FuseboxFusesManager")] @@ -21,14 +17,16 @@ glib::wrapper! { } impl FusesManager { - pub const NONE: Option<&'static FusesManager> = None; + pub const NONE: Option<&'static FusesManager> = None; + #[doc(alias = "fusebox_fuses_manager_get_default")] #[doc(alias = "get_default")] - #[allow(clippy::should_implement_trait)] - pub fn default() -> FusesManager { + #[allow(clippy::should_implement_trait)] pub fn default() -> FusesManager { assert_initialized_main_thread!(); - unsafe { from_glib_full(ffi::fusebox_fuses_manager_get_default()) } + unsafe { + from_glib_full(ffi::fusebox_fuses_manager_get_default()) + } } } @@ -41,9 +39,7 @@ pub trait FusesManagerExt: IsA + sealed::Sealed + 'static { #[doc(alias = "fusebox_fuses_manager_has_fuses")] fn has_fuses(&self) -> bool { unsafe { - from_glib(ffi::fusebox_fuses_manager_has_fuses( - self.as_ref().to_glib_none().0, - )) + from_glib(ffi::fusebox_fuses_manager_has_fuses(self.as_ref().to_glib_none().0)) } } @@ -51,38 +47,20 @@ pub trait FusesManagerExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_fuses")] fn fuses(&self) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_none(ffi::fusebox_fuses_manager_get_fuses( - self.as_ref().to_glib_none().0, - )) + FromGlibPtrContainer::from_glib_none(ffi::fusebox_fuses_manager_get_fuses(self.as_ref().to_glib_none().0)) } } #[doc(alias = "fuse-added")] fn connect_fuse_added(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn fuse_added_trampoline< - P: IsA, - F: Fn(&P, &Fuse) + 'static, - >( - this: *mut ffi::FuseboxFusesManager, - fuse: *mut ffi::FuseboxFuse, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn fuse_added_trampoline, F: Fn(&P, &Fuse) + 'static>(this: *mut ffi::FuseboxFusesManager, fuse: *mut ffi::FuseboxFuse, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); - f( - FusesManager::from_glib_borrow(this).unsafe_cast_ref(), - &from_glib_borrow(fuse), - ) + f(FusesManager::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(fuse)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"fuse-added\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - fuse_added_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"fuse-added\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(fuse_added_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/fusebox/src/auto/mod.rs b/fusebox/src/auto/mod.rs index e0aa86e..b56471f 100644 --- a/fusebox/src/auto/mod.rs +++ b/fusebox/src/auto/mod.rs @@ -1,5 +1,5 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT diff --git a/fusebox/src/auto/versions.txt b/fusebox/src/auto/versions.txt index 895a2c7..2a3a168 100644 --- a/fusebox/src/auto/versions.txt +++ b/fusebox/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ cec418b457aa) +Generated by gir (https://github.com/gtk-rs/gir @ 5c4134d75fd1) from -from gir-files (https://github.com/gtk-rs/gir-files.git @ 4d1189172a70) +from gir-files (https://github.com/gtk-rs/gir-files.git @ fa73af2178bc) diff --git a/fusebox/src/lib.rs b/fusebox/src/lib.rs index 84e1658..62cd22d 100644 --- a/fusebox/src/lib.rs +++ b/fusebox/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::needless_doctest_main)] // Re-export the -sys bindings diff --git a/fusebox/sys/Cargo.toml b/fusebox/sys/Cargo.toml index ea512f7..c3c1b89 100644 --- a/fusebox/sys/Cargo.toml +++ b/fusebox/sys/Cargo.toml @@ -30,34 +30,34 @@ libc = "0.2" [dependencies.gio-sys] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [dependencies.glib-sys] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [dependencies.gobject-sys] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [dependencies.gtk-sys] package = "gtk4-sys" git = "https://github.com/gtk-rs/gtk4-rs" -version = "0.9" +version = "0.10" branch = "master" [dependencies.gdk-sys] package = "gdk4-sys" git = "https://github.com/gtk-rs/gtk4-rs" -version = "0.9" +version = "0.10" branch = "master" [dependencies.pango-sys] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [build-dependencies] diff --git a/fusebox/sys/build.rs b/fusebox/sys/build.rs index 76b9be3..e39f6b9 100644 --- a/fusebox/sys/build.rs +++ b/fusebox/sys/build.rs @@ -1,6 +1,6 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ cec418b457aa) -// from -// from gir-files (https://github.com/gtk-rs/gir-files.git @ 4d1189172a70) +// Generated by gir (https://github.com/gtk-rs/gir @ 5c4134d75fd1) +// from +// from gir-files (https://github.com/gtk-rs/gir-files.git @ fa73af2178bc) // DO NOT EDIT #[cfg(not(docsrs))] diff --git a/fusebox/sys/src/lib.rs b/fusebox/sys/src/lib.rs index f10188b..aabc242 100644 --- a/fusebox/sys/src/lib.rs +++ b/fusebox/sys/src/lib.rs @@ -1,29 +1,23 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ cec418b457aa) -// from -// from gir-files (https://github.com/gtk-rs/gir-files.git @ 4d1189172a70) +// Generated by gir (https://github.com/gtk-rs/gir @ 5c4134d75fd1) +// from +// from gir-files (https://github.com/gtk-rs/gir-files.git @ fa73af2178bc) // DO NOT EDIT #![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] -#![allow( - clippy::approx_constant, - clippy::type_complexity, - clippy::unreadable_literal, - clippy::upper_case_acronyms -)] +#![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal, clippy::upper_case_acronyms)] #![cfg_attr(docsrs, feature(doc_cfg))] -use gdk_sys as gdk; -use gio_sys as gio; use glib_sys as glib; use gobject_sys as gobject; +use gdk_sys as gdk; +use gio_sys as gio; use gtk_sys as gtk; use pango_sys as pango; #[allow(unused_imports)] -use libc::{ - c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, - intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE, -}; +use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, + c_short, c_ushort, c_long, c_ulong, + c_void, size_t, ssize_t, time_t, off_t, intptr_t, uintptr_t, FILE}; #[cfg(unix)] #[allow(unused_imports)] use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t}; @@ -46,34 +40,26 @@ pub struct FuseboxFuseClass { pub get_widget: Option *mut gtk::GtkWidget>, pub shown: Option, pub hidden: Option, - pub search: Option< - unsafe extern "C" fn( - *mut FuseboxFuse, - *const c_char, - gio::GAsyncReadyCallback, - *mut c_void, - ), - >, - pub search_finish: Option< - unsafe extern "C" fn(*mut FuseboxFuse, *mut gio::GAsyncResult) -> *mut glib::GHashTable, - >, + pub search: Option, + pub search_finish: Option *mut glib::GHashTable>, pub search_callback: Option, } impl ::std::fmt::Debug for FuseboxFuseClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("FuseboxFuseClass @ {self:p}")) - .field("get_widget", &self.get_widget) - .field("shown", &self.shown) - .field("hidden", &self.hidden) - .field("search", &self.search) - .field("search_finish", &self.search_finish) - .field("search_callback", &self.search_callback) - .finish() + .field("get_widget", &self.get_widget) + .field("shown", &self.shown) + .field("hidden", &self.hidden) + .field("search", &self.search) + .field("search_finish", &self.search_finish) + .field("search_callback", &self.search_callback) + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct _FuseboxFusePrivate { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -90,11 +76,12 @@ pub struct FuseboxFusesManagerClass { impl ::std::fmt::Debug for FuseboxFusesManagerClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("FuseboxFusesManagerClass @ {self:p}")) - .finish() + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct _FuseboxFusesManagerPrivate { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -114,8 +101,8 @@ pub struct FuseboxFuse { impl ::std::fmt::Debug for FuseboxFuse { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("FuseboxFuse @ {self:p}")) - .field("SEP", &self.SEP) - .finish() + .field("SEP", &self.SEP) + .finish() } } @@ -129,7 +116,7 @@ pub struct FuseboxFusesManager { impl ::std::fmt::Debug for FuseboxFusesManager { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("FuseboxFusesManager @ {self:p}")) - .finish() + .finish() } } @@ -148,16 +135,8 @@ extern "C" { pub fn fusebox_fuse_get_widget(self_: *mut FuseboxFuse) -> *mut gtk::GtkWidget; pub fn fusebox_fuse_shown(self_: *mut FuseboxFuse); pub fn fusebox_fuse_hidden(self_: *mut FuseboxFuse); - pub fn fusebox_fuse_search( - self_: *mut FuseboxFuse, - search: *const c_char, - _callback_: gio::GAsyncReadyCallback, - _callback__target: *mut c_void, - ); - pub fn fusebox_fuse_search_finish( - self_: *mut FuseboxFuse, - _res_: *mut gio::GAsyncResult, - ) -> *mut glib::GHashTable; + pub fn fusebox_fuse_search(self_: *mut FuseboxFuse, search: *const c_char, _callback_: gio::GAsyncReadyCallback, _callback__target: *mut c_void); + pub fn fusebox_fuse_search_finish(self_: *mut FuseboxFuse, _res_: *mut gio::GAsyncResult) -> *mut glib::GHashTable; pub fn fusebox_fuse_search_callback(self_: *mut FuseboxFuse, location: *const c_char); pub fn fusebox_fuse_get_category(self_: *mut FuseboxFuse) -> FuseboxFuseCategory; pub fn fusebox_fuse_get_index(self_: *mut FuseboxFuse) -> c_int; diff --git a/fusebox/sys/tests/abi.rs b/fusebox/sys/tests/abi.rs index 04d2985..73c3717 100644 --- a/fusebox/sys/tests/abi.rs +++ b/fusebox/sys/tests/abi.rs @@ -1,15 +1,15 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ cec418b457aa) -// from -// from gir-files (https://github.com/gtk-rs/gir-files.git @ 4d1189172a70) +// Generated by gir (https://github.com/gtk-rs/gir @ 5c4134d75fd1) +// from +// from gir-files (https://github.com/gtk-rs/gir-files.git @ fa73af2178bc) // DO NOT EDIT #![cfg(unix)] use fusebox_sys::*; +use std::mem::{align_of, size_of}; use std::env; use std::error::Error; use std::ffi::OsString; -use std::mem::{align_of, size_of}; use std::path::Path; use std::process::{Command, Stdio}; use std::str; @@ -67,7 +67,8 @@ fn pkg_config_cflags(packages: &[&str]) -> Result, Box> { if packages.is_empty() { return Ok(Vec::new()); } - let pkg_config = env::var_os("PKG_CONFIG").unwrap_or_else(|| OsString::from("pkg-config")); + let pkg_config = env::var_os("PKG_CONFIG") + .unwrap_or_else(|| OsString::from("pkg-config")); let mut cmd = Command::new(pkg_config); cmd.arg("--cflags"); cmd.args(packages); @@ -81,6 +82,7 @@ fn pkg_config_cflags(packages: &[&str]) -> Result, Box> { Ok(shell_words::split(stdout.trim())?) } + #[derive(Copy, Clone, Debug, Eq, PartialEq)] struct Layout { size: usize, @@ -162,7 +164,8 @@ fn cross_validate_layout_with_c() { let mut results = Results::default(); - for ((rust_name, rust_layout), (c_name, c_layout)) in RUST_LAYOUTS.iter().zip(c_layouts.iter()) + for ((rust_name, rust_layout), (c_name, c_layout)) in + RUST_LAYOUTS.iter().zip(c_layouts.iter()) { if rust_name != c_name { results.record_failed(); @@ -172,7 +175,9 @@ fn cross_validate_layout_with_c() { if rust_layout != c_layout { results.record_failed(); - eprintln!("Layout mismatch for {rust_name}\nRust: {rust_layout:?}\nC: {c_layout:?}",); + eprintln!( + "Layout mismatch for {rust_name}\nRust: {rust_layout:?}\nC: {c_layout:?}", + ); continue; } @@ -202,41 +207,11 @@ fn get_c_output(name: &str) -> Result> { } const RUST_LAYOUTS: &[(&str, Layout)] = &[ - ( - "FuseboxFuse", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "FuseboxFuseCategory", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "FuseboxFuseClass", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "FuseboxFusesManager", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "FuseboxFusesManagerClass", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), + ("FuseboxFuse", Layout {size: size_of::(), alignment: align_of::()}), + ("FuseboxFuseCategory", Layout {size: size_of::(), alignment: align_of::()}), + ("FuseboxFuseClass", Layout {size: size_of::(), alignment: align_of::()}), + ("FuseboxFusesManager", Layout {size: size_of::(), alignment: align_of::()}), + ("FuseboxFusesManagerClass", Layout {size: size_of::(), alignment: align_of::()}), ]; const RUST_CONSTANTS: &[(&str, &str)] = &[ @@ -245,3 +220,5 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) FUSEBOX_FUSE_CATEGORY_PERSONAL", "1"), ("(gint) FUSEBOX_FUSE_CATEGORY_SYSTEM", "2"), ]; + + diff --git a/fusebox/sys/tests/constant.c b/fusebox/sys/tests/constant.c index 0bac001..db1e7c8 100644 --- a/fusebox/sys/tests/constant.c +++ b/fusebox/sys/tests/constant.c @@ -1,6 +1,6 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ cec418b457aa) +// Generated by gir (https://github.com/gtk-rs/gir @ 5c4134d75fd1) // from -// from gir-files (https://github.com/gtk-rs/gir-files.git @ 4d1189172a70) +// from gir-files (https://github.com/gtk-rs/gir-files.git @ fa73af2178bc) // DO NOT EDIT #include "manual.h" diff --git a/fusebox/sys/tests/layout.c b/fusebox/sys/tests/layout.c index 15c1521..45f26cb 100644 --- a/fusebox/sys/tests/layout.c +++ b/fusebox/sys/tests/layout.c @@ -1,6 +1,6 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ cec418b457aa) +// Generated by gir (https://github.com/gtk-rs/gir @ 5c4134d75fd1) // from -// from gir-files (https://github.com/gtk-rs/gir-files.git @ 4d1189172a70) +// from gir-files (https://github.com/gtk-rs/gir-files.git @ fa73af2178bc) // DO NOT EDIT #include "manual.h" diff --git a/gir b/gir index cec418b..5c4134d 160000 --- a/gir +++ b/gir @@ -1 +1 @@ -Subproject commit cec418b457aa81ccaf6a8a2cf1b5cbd494a8fa55 +Subproject commit 5c4134d75fd123ab8698ce9e32ffe3b0a983a6e6 diff --git a/gir-files b/gir-files index 4d11891..fa73af2 160000 --- a/gir-files +++ b/gir-files @@ -1 +1 @@ -Subproject commit 4d1189172a70c6cd6cd8db4954d7cfed2af3983b +Subproject commit fa73af2178bc7c8295488e54f7fff0fc7df131b7 diff --git a/libbismuth/Cargo.toml b/libbismuth/Cargo.toml index c7faccc..f14ad7c 100644 --- a/libbismuth/Cargo.toml +++ b/libbismuth/Cargo.toml @@ -36,34 +36,34 @@ futures-channel = "0.3" [dependencies.glib] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [dependencies.gio] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [dependencies.gdk-pixbuf] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [dependencies.pango] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [dependencies.gdk] package = "gdk4" git = "https://github.com/gtk-rs/gtk4-rs" -version = "0.9" +version = "0.10" branch = "master" [dependencies.gtk] package = "gtk4" git = "https://github.com/gtk-rs/gtk4-rs" -version = "0.9" +version = "0.10" branch = "master" [dependencies.ffi] diff --git a/libbismuth/src/auto/album.rs b/libbismuth/src/auto/album.rs index fdbedcd..baa9a54 100644 --- a/libbismuth/src/auto/album.rs +++ b/libbismuth/src/auto/album.rs @@ -1,18 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ - ffi, AlbumPage, AlbumTransitionType, FoldThresholdPolicy, NavigationDirection, SpringParams, - Swipeable, -}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,AlbumPage,AlbumTransitionType,FoldThresholdPolicy,NavigationDirection,SpringParams,Swipeable}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "BisAlbum")] @@ -27,24 +20,24 @@ impl Album { #[doc(alias = "bis_album_new")] pub fn new() -> Album { assert_initialized_main_thread!(); - unsafe { gtk::Widget::from_glib_none(ffi::bis_album_new()).unsafe_cast() } + unsafe { + gtk::Widget::from_glib_none(ffi::bis_album_new()).unsafe_cast() + } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`Album`] objects. - /// - /// This method returns an instance of [`AlbumBuilder`](crate::builders::AlbumBuilder) which can be used to create [`Album`] objects. - pub fn builder() -> AlbumBuilder { - AlbumBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`Album`] objects. + /// + /// This method returns an instance of [`AlbumBuilder`](crate::builders::AlbumBuilder) which can be used to create [`Album`] objects. + pub fn builder() -> AlbumBuilder { + AlbumBuilder::new() + } + #[doc(alias = "bis_album_append")] pub fn append(&self, child: &impl IsA) -> AlbumPage { unsafe { - from_glib_none(ffi::bis_album_append( - self.to_glib_none().0, - child.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::bis_album_append(self.to_glib_none().0, child.as_ref().to_glib_none().0)) } } @@ -52,10 +45,7 @@ impl Album { #[doc(alias = "get_adjacent_child")] pub fn adjacent_child(&self, direction: NavigationDirection) -> Option { unsafe { - from_glib_none(ffi::bis_album_get_adjacent_child( - self.to_glib_none().0, - direction.into_glib(), - )) + from_glib_none(ffi::bis_album_get_adjacent_child(self.to_glib_none().0, direction.into_glib())) } } @@ -63,7 +53,9 @@ impl Album { #[doc(alias = "get_can_navigate_back")] #[doc(alias = "can-navigate-back")] pub fn can_navigate_back(&self) -> bool { - unsafe { from_glib(ffi::bis_album_get_can_navigate_back(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_album_get_can_navigate_back(self.to_glib_none().0)) + } } #[doc(alias = "bis_album_get_can_navigate_forward")] @@ -71,9 +63,7 @@ impl Album { #[doc(alias = "can-navigate-forward")] pub fn can_navigate_forward(&self) -> bool { unsafe { - from_glib(ffi::bis_album_get_can_navigate_forward( - self.to_glib_none().0, - )) + from_glib(ffi::bis_album_get_can_navigate_forward(self.to_glib_none().0)) } } @@ -81,17 +71,16 @@ impl Album { #[doc(alias = "get_can_unfold")] #[doc(alias = "can-unfold")] pub fn can_unfold(&self) -> bool { - unsafe { from_glib(ffi::bis_album_get_can_unfold(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_album_get_can_unfold(self.to_glib_none().0)) + } } #[doc(alias = "bis_album_get_child_by_name")] #[doc(alias = "get_child_by_name")] pub fn child_by_name(&self, name: &str) -> Option { unsafe { - from_glib_none(ffi::bis_album_get_child_by_name( - self.to_glib_none().0, - name.to_glib_none().0, - )) + from_glib_none(ffi::bis_album_get_child_by_name(self.to_glib_none().0, name.to_glib_none().0)) } } @@ -100,9 +89,7 @@ impl Album { #[doc(alias = "child-transition-params")] pub fn child_transition_params(&self) -> SpringParams { unsafe { - from_glib_full(ffi::bis_album_get_child_transition_params( - self.to_glib_none().0, - )) + from_glib_full(ffi::bis_album_get_child_transition_params(self.to_glib_none().0)) } } @@ -111,9 +98,7 @@ impl Album { #[doc(alias = "child-transition-running")] pub fn is_child_transition_running(&self) -> bool { unsafe { - from_glib(ffi::bis_album_get_child_transition_running( - self.to_glib_none().0, - )) + from_glib(ffi::bis_album_get_child_transition_running(self.to_glib_none().0)) } } @@ -122,9 +107,7 @@ impl Album { #[doc(alias = "fold-threshold-policy")] pub fn fold_threshold_policy(&self) -> FoldThresholdPolicy { unsafe { - from_glib(ffi::bis_album_get_fold_threshold_policy( - self.to_glib_none().0, - )) + from_glib(ffi::bis_album_get_fold_threshold_policy(self.to_glib_none().0)) } } @@ -132,93 +115,90 @@ impl Album { #[doc(alias = "get_folded")] #[doc(alias = "folded")] pub fn is_folded(&self) -> bool { - unsafe { from_glib(ffi::bis_album_get_folded(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_album_get_folded(self.to_glib_none().0)) + } } #[doc(alias = "bis_album_get_homogeneous")] #[doc(alias = "get_homogeneous")] #[doc(alias = "homogeneous")] pub fn is_homogeneous(&self) -> bool { - unsafe { from_glib(ffi::bis_album_get_homogeneous(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_album_get_homogeneous(self.to_glib_none().0)) + } } #[doc(alias = "bis_album_get_mode_transition_duration")] #[doc(alias = "get_mode_transition_duration")] #[doc(alias = "mode-transition-duration")] pub fn mode_transition_duration(&self) -> u32 { - unsafe { ffi::bis_album_get_mode_transition_duration(self.to_glib_none().0) } + unsafe { + ffi::bis_album_get_mode_transition_duration(self.to_glib_none().0) + } } #[doc(alias = "bis_album_get_page")] #[doc(alias = "get_page")] pub fn page(&self, child: &impl IsA) -> AlbumPage { unsafe { - from_glib_none(ffi::bis_album_get_page( - self.to_glib_none().0, - child.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::bis_album_get_page(self.to_glib_none().0, child.as_ref().to_glib_none().0)) } } #[doc(alias = "bis_album_get_pages")] #[doc(alias = "get_pages")] pub fn pages(&self) -> gtk::SelectionModel { - unsafe { from_glib_full(ffi::bis_album_get_pages(self.to_glib_none().0)) } + unsafe { + from_glib_full(ffi::bis_album_get_pages(self.to_glib_none().0)) + } } #[doc(alias = "bis_album_get_transition_type")] #[doc(alias = "get_transition_type")] #[doc(alias = "transition-type")] pub fn transition_type(&self) -> AlbumTransitionType { - unsafe { from_glib(ffi::bis_album_get_transition_type(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_album_get_transition_type(self.to_glib_none().0)) + } } #[doc(alias = "bis_album_get_visible_child")] #[doc(alias = "get_visible_child")] #[doc(alias = "visible-child")] pub fn visible_child(&self) -> Option { - unsafe { from_glib_none(ffi::bis_album_get_visible_child(self.to_glib_none().0)) } + unsafe { + from_glib_none(ffi::bis_album_get_visible_child(self.to_glib_none().0)) + } } #[doc(alias = "bis_album_get_visible_child_name")] #[doc(alias = "get_visible_child_name")] #[doc(alias = "visible-child-name")] pub fn visible_child_name(&self) -> Option { - unsafe { from_glib_none(ffi::bis_album_get_visible_child_name(self.to_glib_none().0)) } + unsafe { + from_glib_none(ffi::bis_album_get_visible_child_name(self.to_glib_none().0)) + } } #[doc(alias = "bis_album_insert_child_after")] - pub fn insert_child_after( - &self, - child: &impl IsA, - sibling: Option<&impl IsA>, - ) -> AlbumPage { + pub fn insert_child_after(&self, child: &impl IsA, sibling: Option<&impl IsA>) -> AlbumPage { unsafe { - from_glib_none(ffi::bis_album_insert_child_after( - self.to_glib_none().0, - child.as_ref().to_glib_none().0, - sibling.map(|p| p.as_ref()).to_glib_none().0, - )) + from_glib_none(ffi::bis_album_insert_child_after(self.to_glib_none().0, child.as_ref().to_glib_none().0, sibling.map(|p| p.as_ref()).to_glib_none().0)) } } #[doc(alias = "bis_album_navigate")] pub fn navigate(&self, direction: NavigationDirection) -> bool { unsafe { - from_glib(ffi::bis_album_navigate( - self.to_glib_none().0, - direction.into_glib(), - )) + from_glib(ffi::bis_album_navigate(self.to_glib_none().0, direction.into_glib())) } } #[doc(alias = "bis_album_prepend")] pub fn prepend(&self, child: &impl IsA) -> AlbumPage { unsafe { - from_glib_none(ffi::bis_album_prepend( - self.to_glib_none().0, - child.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::bis_album_prepend(self.to_glib_none().0, child.as_ref().to_glib_none().0)) } } @@ -230,17 +210,9 @@ impl Album { } #[doc(alias = "bis_album_reorder_child_after")] - pub fn reorder_child_after( - &self, - child: &impl IsA, - sibling: Option<&impl IsA>, - ) { + pub fn reorder_child_after(&self, child: &impl IsA, sibling: Option<&impl IsA>) { unsafe { - ffi::bis_album_reorder_child_after( - self.to_glib_none().0, - child.as_ref().to_glib_none().0, - sibling.map(|p| p.as_ref()).to_glib_none().0, - ); + ffi::bis_album_reorder_child_after(self.to_glib_none().0, child.as_ref().to_glib_none().0, sibling.map(|p| p.as_ref()).to_glib_none().0); } } @@ -248,10 +220,7 @@ impl Album { #[doc(alias = "can-navigate-back")] pub fn set_can_navigate_back(&self, can_navigate_back: bool) { unsafe { - ffi::bis_album_set_can_navigate_back( - self.to_glib_none().0, - can_navigate_back.into_glib(), - ); + ffi::bis_album_set_can_navigate_back(self.to_glib_none().0, can_navigate_back.into_glib()); } } @@ -259,10 +228,7 @@ impl Album { #[doc(alias = "can-navigate-forward")] pub fn set_can_navigate_forward(&self, can_navigate_forward: bool) { unsafe { - ffi::bis_album_set_can_navigate_forward( - self.to_glib_none().0, - can_navigate_forward.into_glib(), - ); + ffi::bis_album_set_can_navigate_forward(self.to_glib_none().0, can_navigate_forward.into_glib()); } } @@ -278,10 +244,7 @@ impl Album { #[doc(alias = "child-transition-params")] pub fn set_child_transition_params(&self, params: &SpringParams) { unsafe { - ffi::bis_album_set_child_transition_params( - self.to_glib_none().0, - params.to_glib_none().0, - ); + ffi::bis_album_set_child_transition_params(self.to_glib_none().0, params.to_glib_none().0); } } @@ -321,10 +284,7 @@ impl Album { #[doc(alias = "visible-child")] pub fn set_visible_child(&self, visible_child: &impl IsA) { unsafe { - ffi::bis_album_set_visible_child( - self.to_glib_none().0, - visible_child.as_ref().to_glib_none().0, - ); + ffi::bis_album_set_visible_child(self.to_glib_none().0, visible_child.as_ref().to_glib_none().0); } } @@ -337,604 +297,362 @@ impl Album { } #[doc(alias = "can-navigate-back")] - pub fn connect_can_navigate_back_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_can_navigate_back_trampoline( - this: *mut ffi::BisAlbum, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + pub fn connect_can_navigate_back_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_can_navigate_back_trampoline(this: *mut ffi::BisAlbum, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::can-navigate-back\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_can_navigate_back_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::can-navigate-back\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_can_navigate_back_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "can-navigate-forward")] - pub fn connect_can_navigate_forward_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_can_navigate_forward_trampoline( - this: *mut ffi::BisAlbum, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + pub fn connect_can_navigate_forward_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_can_navigate_forward_trampoline(this: *mut ffi::BisAlbum, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::can-navigate-forward\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_can_navigate_forward_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::can-navigate-forward\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_can_navigate_forward_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "can-unfold")] pub fn connect_can_unfold_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_can_unfold_trampoline( - this: *mut ffi::BisAlbum, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_can_unfold_trampoline(this: *mut ffi::BisAlbum, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::can-unfold\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_can_unfold_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::can-unfold\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_can_unfold_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "child-transition-params")] - pub fn connect_child_transition_params_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_child_transition_params_trampoline( - this: *mut ffi::BisAlbum, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + pub fn connect_child_transition_params_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_child_transition_params_trampoline(this: *mut ffi::BisAlbum, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::child-transition-params\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_child_transition_params_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::child-transition-params\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_child_transition_params_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "child-transition-running")] - pub fn connect_child_transition_running_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_child_transition_running_trampoline( - this: *mut ffi::BisAlbum, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + pub fn connect_child_transition_running_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_child_transition_running_trampoline(this: *mut ffi::BisAlbum, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::child-transition-running\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_child_transition_running_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::child-transition-running\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_child_transition_running_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "fold-threshold-policy")] - pub fn connect_fold_threshold_policy_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_fold_threshold_policy_trampoline( - this: *mut ffi::BisAlbum, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + pub fn connect_fold_threshold_policy_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_fold_threshold_policy_trampoline(this: *mut ffi::BisAlbum, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::fold-threshold-policy\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_fold_threshold_policy_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::fold-threshold-policy\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_fold_threshold_policy_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "folded")] pub fn connect_folded_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_folded_trampoline( - this: *mut ffi::BisAlbum, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_folded_trampoline(this: *mut ffi::BisAlbum, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::folded\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_folded_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::folded\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_folded_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "homogeneous")] pub fn connect_homogeneous_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_homogeneous_trampoline( - this: *mut ffi::BisAlbum, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_homogeneous_trampoline(this: *mut ffi::BisAlbum, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::homogeneous\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_homogeneous_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::homogeneous\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_homogeneous_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "mode-transition-duration")] - pub fn connect_mode_transition_duration_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_mode_transition_duration_trampoline( - this: *mut ffi::BisAlbum, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + pub fn connect_mode_transition_duration_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_mode_transition_duration_trampoline(this: *mut ffi::BisAlbum, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::mode-transition-duration\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_mode_transition_duration_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::mode-transition-duration\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_mode_transition_duration_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "pages")] pub fn connect_pages_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_pages_trampoline( - this: *mut ffi::BisAlbum, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_pages_trampoline(this: *mut ffi::BisAlbum, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::pages\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_pages_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::pages\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_pages_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "transition-type")] pub fn connect_transition_type_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_transition_type_trampoline( - this: *mut ffi::BisAlbum, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_transition_type_trampoline(this: *mut ffi::BisAlbum, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::transition-type\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_transition_type_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::transition-type\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_transition_type_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "visible-child")] pub fn connect_visible_child_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_visible_child_trampoline( - this: *mut ffi::BisAlbum, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_visible_child_trampoline(this: *mut ffi::BisAlbum, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::visible-child\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_visible_child_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::visible-child\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_visible_child_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "visible-child-name")] - pub fn connect_visible_child_name_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_visible_child_name_trampoline( - this: *mut ffi::BisAlbum, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + pub fn connect_visible_child_name_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_visible_child_name_trampoline(this: *mut ffi::BisAlbum, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::visible-child-name\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_visible_child_name_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::visible-child-name\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_visible_child_name_trampoline:: as *const ())), Box_::into_raw(f)) } } } impl Default for Album { - fn default() -> Self { - Self::new() - } -} + fn default() -> Self { + Self::new() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`Album`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`Album`] 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 AlbumBuilder { - builder: glib::object::ObjectBuilder<'static, Album>, -} - -impl AlbumBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, Album>, } - } - pub fn can_navigate_back(self, can_navigate_back: bool) -> Self { - Self { - builder: self - .builder - .property("can-navigate-back", can_navigate_back), + impl AlbumBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn can_navigate_forward(self, can_navigate_forward: bool) -> Self { - Self { - builder: self - .builder - .property("can-navigate-forward", can_navigate_forward), - } - } + pub fn can_navigate_back(self, can_navigate_back: bool) -> Self { + Self { builder: self.builder.property("can-navigate-back", can_navigate_back), } + } - pub fn can_unfold(self, can_unfold: bool) -> Self { - Self { - builder: self.builder.property("can-unfold", can_unfold), - } - } + pub fn can_navigate_forward(self, can_navigate_forward: bool) -> Self { + Self { builder: self.builder.property("can-navigate-forward", can_navigate_forward), } + } - pub fn child_transition_params(self, child_transition_params: &SpringParams) -> Self { - Self { - builder: self - .builder - .property("child-transition-params", child_transition_params.clone()), - } - } + pub fn can_unfold(self, can_unfold: bool) -> Self { + Self { builder: self.builder.property("can-unfold", can_unfold), } + } - pub fn fold_threshold_policy(self, fold_threshold_policy: FoldThresholdPolicy) -> Self { - Self { - builder: self - .builder - .property("fold-threshold-policy", fold_threshold_policy), - } - } + pub fn child_transition_params(self, child_transition_params: &SpringParams) -> Self { + Self { builder: self.builder.property("child-transition-params", child_transition_params.clone()), } + } - pub fn homogeneous(self, homogeneous: bool) -> Self { - Self { - builder: self.builder.property("homogeneous", homogeneous), - } - } + pub fn fold_threshold_policy(self, fold_threshold_policy: FoldThresholdPolicy) -> Self { + Self { builder: self.builder.property("fold-threshold-policy", fold_threshold_policy), } + } - pub fn mode_transition_duration(self, mode_transition_duration: u32) -> Self { - Self { - builder: self - .builder - .property("mode-transition-duration", mode_transition_duration), - } - } + pub fn homogeneous(self, homogeneous: bool) -> Self { + Self { builder: self.builder.property("homogeneous", homogeneous), } + } - pub fn transition_type(self, transition_type: AlbumTransitionType) -> Self { - Self { - builder: self.builder.property("transition-type", transition_type), - } - } + pub fn mode_transition_duration(self, mode_transition_duration: u32) -> Self { + Self { builder: self.builder.property("mode-transition-duration", mode_transition_duration), } + } - pub fn visible_child(self, visible_child: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("visible-child", visible_child.clone().upcast()), - } - } + pub fn transition_type(self, transition_type: AlbumTransitionType) -> Self { + Self { builder: self.builder.property("transition-type", transition_type), } + } - pub fn visible_child_name(self, visible_child_name: impl Into) -> Self { - Self { - builder: self - .builder - .property("visible-child-name", visible_child_name.into()), - } - } + pub fn visible_child(self, visible_child: &impl IsA) -> Self { + Self { builder: self.builder.property("visible-child", visible_child.clone().upcast()), } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { - builder: self.builder.property("can-focus", can_focus), - } - } + pub fn visible_child_name(self, visible_child_name: impl Into) -> Self { + Self { builder: self.builder.property("visible-child-name", visible_child_name.into()), } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { - builder: self.builder.property("can-target", can_target), - } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { builder: self.builder.property("can-focus", can_focus), } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { - builder: self.builder.property("css-classes", css_classes.into()), - } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { builder: self.builder.property("can-target", can_target), } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { - builder: self.builder.property("css-name", css_name.into()), - } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { builder: self.builder.property("css-classes", css_classes.into()), } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + pub fn css_name(self, css_name: impl Into) -> Self { + Self { builder: self.builder.property("css-name", css_name.into()), } + } - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { - builder: self.builder.property("focus-on-click", focus_on_click), - } - } + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focusable(self, focusable: bool) -> Self { - Self { - builder: self.builder.property("focusable", focusable), - } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { builder: self.builder.property("focus-on-click", focus_on_click), } + } - //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { - // Self { builder: self.builder.property("halign", halign), } - //} + pub fn focusable(self, focusable: bool) -> Self { + Self { builder: self.builder.property("focusable", focusable), } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { - builder: self.builder.property("has-tooltip", has_tooltip), - } - } + //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { + // Self { builder: self.builder.property("halign", halign), } + //} - pub fn height_request(self, height_request: i32) -> Self { - Self { - builder: self.builder.property("height-request", height_request), - } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { builder: self.builder.property("has-tooltip", has_tooltip), } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { - builder: self.builder.property("hexpand", hexpand), - } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { builder: self.builder.property("height-request", height_request), } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { - builder: self.builder.property("hexpand-set", hexpand_set), - } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { builder: self.builder.property("hexpand", hexpand), } + } - pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("layout-manager", layout_manager.clone().upcast()), - } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { builder: self.builder.property("hexpand-set", hexpand_set), } + } - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { - builder: self.builder.property("margin-bottom", margin_bottom), - } - } + pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { - builder: self.builder.property("margin-end", margin_end), - } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { builder: self.builder.property("margin-bottom", margin_bottom), } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { - builder: self.builder.property("margin-start", margin_start), - } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { builder: self.builder.property("margin-end", margin_end), } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { - builder: self.builder.property("margin-top", margin_top), - } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { builder: self.builder.property("margin-start", margin_start), } + } - pub fn name(self, name: impl Into) -> Self { - Self { - builder: self.builder.property("name", name.into()), - } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { builder: self.builder.property("margin-top", margin_top), } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { - builder: self.builder.property("opacity", opacity), - } - } + pub fn name(self, name: impl Into) -> Self { + Self { builder: self.builder.property("name", name.into()), } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + pub fn opacity(self, opacity: f64) -> Self { + Self { builder: self.builder.property("opacity", opacity), } + } - pub fn receives_default(self, receives_default: bool) -> Self { - Self { - builder: self.builder.property("receives-default", receives_default), - } - } + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn sensitive(self, sensitive: bool) -> Self { - Self { - builder: self.builder.property("sensitive", sensitive), - } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { builder: self.builder.property("receives-default", receives_default), } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { - builder: self - .builder - .property("tooltip-markup", tooltip_markup.into()), - } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { builder: self.builder.property("sensitive", sensitive), } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { - builder: self.builder.property("tooltip-text", tooltip_text.into()), - } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } + } - //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { - // Self { builder: self.builder.property("valign", valign), } - //} + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { - builder: self.builder.property("vexpand", vexpand), - } - } + //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { + // Self { builder: self.builder.property("valign", valign), } + //} - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { - builder: self.builder.property("vexpand-set", vexpand_set), - } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { builder: self.builder.property("vexpand", vexpand), } + } - pub fn visible(self, visible: bool) -> Self { - Self { - builder: self.builder.property("visible", visible), - } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { builder: self.builder.property("vexpand-set", vexpand_set), } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { - builder: self.builder.property("width-request", width_request), - } - } + pub fn visible(self, visible: bool) -> Self { + Self { builder: self.builder.property("visible", visible), } + } + + pub fn width_request(self, width_request: i32) -> Self { + Self { builder: self.builder.property("width-request", width_request), } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} - //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { - // Self { builder: self.builder.property("orientation", orientation), } - //} + //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { + // Self { builder: self.builder.property("orientation", orientation), } + //} // rustdoc-stripper-ignore-next /// Build the [`Album`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Album { - self.builder.build() - } + self.builder.build() } } diff --git a/libbismuth/src/auto/album_page.rs b/libbismuth/src/auto/album_page.rs index a6e52ac..1feff63 100644 --- a/libbismuth/src/auto/album_page.rs +++ b/libbismuth/src/auto/album_page.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::ffi; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "BisAlbumPage")] @@ -21,31 +17,38 @@ glib::wrapper! { } impl AlbumPage { - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`AlbumPage`] objects. - /// - /// This method returns an instance of [`AlbumPageBuilder`](crate::builders::AlbumPageBuilder) which can be used to create [`AlbumPage`] objects. - pub fn builder() -> AlbumPageBuilder { - AlbumPageBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`AlbumPage`] objects. + /// + /// This method returns an instance of [`AlbumPageBuilder`](crate::builders::AlbumPageBuilder) which can be used to create [`AlbumPage`] objects. + pub fn builder() -> AlbumPageBuilder { + AlbumPageBuilder::new() + } + #[doc(alias = "bis_album_page_get_child")] #[doc(alias = "get_child")] pub fn child(&self) -> gtk::Widget { - unsafe { from_glib_none(ffi::bis_album_page_get_child(self.to_glib_none().0)) } + unsafe { + from_glib_none(ffi::bis_album_page_get_child(self.to_glib_none().0)) + } } #[doc(alias = "bis_album_page_get_name")] #[doc(alias = "get_name")] pub fn name(&self) -> Option { - unsafe { from_glib_none(ffi::bis_album_page_get_name(self.to_glib_none().0)) } + unsafe { + from_glib_none(ffi::bis_album_page_get_name(self.to_glib_none().0)) + } } #[doc(alias = "bis_album_page_get_navigatable")] #[doc(alias = "get_navigatable")] #[doc(alias = "navigatable")] pub fn is_navigatable(&self) -> bool { - unsafe { from_glib(ffi::bis_album_page_get_navigatable(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_album_page_get_navigatable(self.to_glib_none().0)) + } } #[doc(alias = "bis_album_page_set_name")] @@ -66,89 +69,60 @@ impl AlbumPage { #[doc(alias = "name")] pub fn connect_name_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_name_trampoline( - this: *mut ffi::BisAlbumPage, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_name_trampoline(this: *mut ffi::BisAlbumPage, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::name\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_name_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::name\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_name_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "navigatable")] pub fn connect_navigatable_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_navigatable_trampoline( - this: *mut ffi::BisAlbumPage, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_navigatable_trampoline(this: *mut ffi::BisAlbumPage, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::navigatable\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_navigatable_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::navigatable\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_navigatable_trampoline:: as *const ())), Box_::into_raw(f)) } } } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`AlbumPage`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`AlbumPage`] 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 AlbumPageBuilder { - builder: glib::object::ObjectBuilder<'static, AlbumPage>, -} - -impl AlbumPageBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, AlbumPage>, } - } - pub fn child(self, child: &impl IsA) -> Self { - Self { - builder: self.builder.property("child", child.clone().upcast()), + impl AlbumPageBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn name(self, name: impl Into) -> Self { - Self { - builder: self.builder.property("name", name.into()), - } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { builder: self.builder.property("child", child.clone().upcast()), } + } - pub fn navigatable(self, navigatable: bool) -> Self { - Self { - builder: self.builder.property("navigatable", navigatable), - } - } + pub fn name(self, name: impl Into) -> Self { + Self { builder: self.builder.property("name", name.into()), } + } + + pub fn navigatable(self, navigatable: bool) -> Self { + Self { builder: self.builder.property("navigatable", navigatable), } + } // rustdoc-stripper-ignore-next /// Build the [`AlbumPage`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> AlbumPage { - self.builder.build() - } + self.builder.build() } } diff --git a/libbismuth/src/auto/animation.rs b/libbismuth/src/auto/animation.rs index 1695c67..e6e39cf 100644 --- a/libbismuth/src/auto/animation.rs +++ b/libbismuth/src/auto/animation.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, AnimationState, AnimationTarget}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,AnimationState,AnimationTarget}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "BisAnimation")] @@ -21,7 +17,8 @@ glib::wrapper! { } impl Animation { - pub const NONE: Option<&'static Animation> = None; + pub const NONE: Option<&'static Animation> = None; + } mod sealed { @@ -33,32 +30,32 @@ pub trait AnimationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "bis_animation_get_state")] #[doc(alias = "get_state")] fn state(&self) -> AnimationState { - unsafe { from_glib(ffi::bis_animation_get_state(self.as_ref().to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_animation_get_state(self.as_ref().to_glib_none().0)) + } } #[doc(alias = "bis_animation_get_target")] #[doc(alias = "get_target")] fn target(&self) -> AnimationTarget { unsafe { - from_glib_none(ffi::bis_animation_get_target( - self.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::bis_animation_get_target(self.as_ref().to_glib_none().0)) } } #[doc(alias = "bis_animation_get_value")] #[doc(alias = "get_value")] fn value(&self) -> f64 { - unsafe { ffi::bis_animation_get_value(self.as_ref().to_glib_none().0) } + unsafe { + ffi::bis_animation_get_value(self.as_ref().to_glib_none().0) + } } #[doc(alias = "bis_animation_get_widget")] #[doc(alias = "get_widget")] fn widget(&self) -> gtk::Widget { unsafe { - from_glib_none(ffi::bis_animation_get_widget( - self.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::bis_animation_get_widget(self.as_ref().to_glib_none().0)) } } @@ -94,10 +91,7 @@ pub trait AnimationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "target")] fn set_target(&self, target: &impl IsA) { unsafe { - ffi::bis_animation_set_target( - self.as_ref().to_glib_none().0, - target.as_ref().to_glib_none().0, - ); + ffi::bis_animation_set_target(self.as_ref().to_glib_none().0, target.as_ref().to_glib_none().0); } } @@ -110,92 +104,53 @@ pub trait AnimationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "done")] fn connect_done(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn done_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::BisAnimation, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn done_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::BisAnimation, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Animation::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"done\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - done_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"done\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(done_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "state")] fn connect_state_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_state_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::BisAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_state_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::BisAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Animation::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::state\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_state_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::state\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_state_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "target")] fn connect_target_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_target_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::BisAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_target_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::BisAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Animation::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::target\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_target_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::target\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_target_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "value")] fn connect_value_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_value_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::BisAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_value_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::BisAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Animation::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::value\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_value_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::value\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_value_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/libbismuth/src/auto/animation_target.rs b/libbismuth/src/auto/animation_target.rs index 3da64f4..3a79b05 100644 --- a/libbismuth/src/auto/animation_target.rs +++ b/libbismuth/src/auto/animation_target.rs @@ -1,9 +1,9 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::ffi; +use crate::{ffi}; glib::wrapper! { #[doc(alias = "BisAnimationTarget")] @@ -15,5 +15,6 @@ glib::wrapper! { } impl AnimationTarget { - pub const NONE: Option<&'static AnimationTarget> = None; + pub const NONE: Option<&'static AnimationTarget> = None; + } diff --git a/libbismuth/src/auto/bin.rs b/libbismuth/src/auto/bin.rs index 9078c3a..ea1e5ae 100644 --- a/libbismuth/src/auto/bin.rs +++ b/libbismuth/src/auto/bin.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::ffi; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "BisBin")] @@ -21,231 +17,176 @@ glib::wrapper! { } impl Bin { - pub const NONE: Option<&'static Bin> = None; + pub const NONE: Option<&'static Bin> = None; + #[doc(alias = "bis_bin_new")] pub fn new() -> Bin { assert_initialized_main_thread!(); - unsafe { gtk::Widget::from_glib_none(ffi::bis_bin_new()).unsafe_cast() } + unsafe { + gtk::Widget::from_glib_none(ffi::bis_bin_new()).unsafe_cast() + } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`Bin`] objects. - /// - /// This method returns an instance of [`BinBuilder`](crate::builders::BinBuilder) which can be used to create [`Bin`] objects. - pub fn builder() -> BinBuilder { - BinBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`Bin`] objects. + /// + /// This method returns an instance of [`BinBuilder`](crate::builders::BinBuilder) which can be used to create [`Bin`] objects. + pub fn builder() -> BinBuilder { + BinBuilder::new() + } + } impl Default for Bin { - fn default() -> Self { - Self::new() - } -} + fn default() -> Self { + Self::new() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`Bin`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`Bin`] 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 BinBuilder { - builder: glib::object::ObjectBuilder<'static, Bin>, -} - -impl BinBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, Bin>, } - } - pub fn child(self, child: &impl IsA) -> Self { - Self { - builder: self.builder.property("child", child.clone().upcast()), + impl BinBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { - builder: self.builder.property("can-focus", can_focus), - } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { builder: self.builder.property("child", child.clone().upcast()), } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { - builder: self.builder.property("can-target", can_target), - } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { builder: self.builder.property("can-focus", can_focus), } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { - builder: self.builder.property("css-classes", css_classes.into()), - } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { builder: self.builder.property("can-target", can_target), } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { - builder: self.builder.property("css-name", css_name.into()), - } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { builder: self.builder.property("css-classes", css_classes.into()), } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + pub fn css_name(self, css_name: impl Into) -> Self { + Self { builder: self.builder.property("css-name", css_name.into()), } + } - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { - builder: self.builder.property("focus-on-click", focus_on_click), - } - } + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focusable(self, focusable: bool) -> Self { - Self { - builder: self.builder.property("focusable", focusable), - } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { builder: self.builder.property("focus-on-click", focus_on_click), } + } - //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { - // Self { builder: self.builder.property("halign", halign), } - //} + pub fn focusable(self, focusable: bool) -> Self { + Self { builder: self.builder.property("focusable", focusable), } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { - builder: self.builder.property("has-tooltip", has_tooltip), - } - } + //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { + // Self { builder: self.builder.property("halign", halign), } + //} - pub fn height_request(self, height_request: i32) -> Self { - Self { - builder: self.builder.property("height-request", height_request), - } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { builder: self.builder.property("has-tooltip", has_tooltip), } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { - builder: self.builder.property("hexpand", hexpand), - } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { builder: self.builder.property("height-request", height_request), } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { - builder: self.builder.property("hexpand-set", hexpand_set), - } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { builder: self.builder.property("hexpand", hexpand), } + } - pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("layout-manager", layout_manager.clone().upcast()), - } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { builder: self.builder.property("hexpand-set", hexpand_set), } + } - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { - builder: self.builder.property("margin-bottom", margin_bottom), - } - } + pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { - builder: self.builder.property("margin-end", margin_end), - } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { builder: self.builder.property("margin-bottom", margin_bottom), } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { - builder: self.builder.property("margin-start", margin_start), - } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { builder: self.builder.property("margin-end", margin_end), } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { - builder: self.builder.property("margin-top", margin_top), - } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { builder: self.builder.property("margin-start", margin_start), } + } - pub fn name(self, name: impl Into) -> Self { - Self { - builder: self.builder.property("name", name.into()), - } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { builder: self.builder.property("margin-top", margin_top), } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { - builder: self.builder.property("opacity", opacity), - } - } + pub fn name(self, name: impl Into) -> Self { + Self { builder: self.builder.property("name", name.into()), } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + pub fn opacity(self, opacity: f64) -> Self { + Self { builder: self.builder.property("opacity", opacity), } + } - pub fn receives_default(self, receives_default: bool) -> Self { - Self { - builder: self.builder.property("receives-default", receives_default), - } - } + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn sensitive(self, sensitive: bool) -> Self { - Self { - builder: self.builder.property("sensitive", sensitive), - } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { builder: self.builder.property("receives-default", receives_default), } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { - builder: self - .builder - .property("tooltip-markup", tooltip_markup.into()), - } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { builder: self.builder.property("sensitive", sensitive), } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { - builder: self.builder.property("tooltip-text", tooltip_text.into()), - } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } + } - //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { - // Self { builder: self.builder.property("valign", valign), } - //} + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { - builder: self.builder.property("vexpand", vexpand), - } - } + //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { + // Self { builder: self.builder.property("valign", valign), } + //} - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { - builder: self.builder.property("vexpand-set", vexpand_set), - } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { builder: self.builder.property("vexpand", vexpand), } + } - pub fn visible(self, visible: bool) -> Self { - Self { - builder: self.builder.property("visible", visible), - } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { builder: self.builder.property("vexpand-set", vexpand_set), } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { - builder: self.builder.property("width-request", width_request), - } - } + pub fn visible(self, visible: bool) -> Self { + Self { builder: self.builder.property("visible", visible), } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + pub fn width_request(self, width_request: i32) -> Self { + Self { builder: self.builder.property("width-request", width_request), } + } + + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} // rustdoc-stripper-ignore-next /// Build the [`Bin`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Bin { - self.builder.build() - } + self.builder.build() } } mod sealed { @@ -257,40 +198,29 @@ pub trait BinExt: IsA + sealed::Sealed + 'static { #[doc(alias = "bis_bin_get_child")] #[doc(alias = "get_child")] fn child(&self) -> Option { - unsafe { from_glib_none(ffi::bis_bin_get_child(self.as_ref().to_glib_none().0)) } + unsafe { + from_glib_none(ffi::bis_bin_get_child(self.as_ref().to_glib_none().0)) + } } #[doc(alias = "bis_bin_set_child")] #[doc(alias = "child")] fn set_child(&self, child: Option<&impl IsA>) { unsafe { - ffi::bis_bin_set_child( - self.as_ref().to_glib_none().0, - child.map(|p| p.as_ref()).to_glib_none().0, - ); + ffi::bis_bin_set_child(self.as_ref().to_glib_none().0, child.map(|p| p.as_ref()).to_glib_none().0); } } #[doc(alias = "child")] fn connect_child_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_child_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::BisBin, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_child_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::BisBin, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Bin::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::child\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_child_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::child\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_child_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/libbismuth/src/auto/callback_animation_target.rs b/libbismuth/src/auto/callback_animation_target.rs index f8116de..4664588 100644 --- a/libbismuth/src/auto/callback_animation_target.rs +++ b/libbismuth/src/auto/callback_animation_target.rs @@ -1,11 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, AnimationTarget}; -use glib::{prelude::*, translate::*}; -use std::boxed::Box as Box_; +use crate::{ffi,AnimationTarget}; +use glib::{prelude::*,translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "BisCallbackAnimationTarget")] @@ -21,10 +21,7 @@ impl CallbackAnimationTarget { pub fn new(callback: P) -> CallbackAnimationTarget { assert_initialized_main_thread!(); let callback_data: Box_

= Box_::new(callback); - unsafe extern "C" fn callback_func( - value: libc::c_double, - user_data: glib::ffi::gpointer, - ) { + unsafe extern "C" fn callback_func(value: libc::c_double, user_data: glib::ffi::gpointer) { let callback = &*(user_data as *mut P); (*callback)(value) } @@ -35,12 +32,7 @@ impl CallbackAnimationTarget { let destroy_call2 = Some(destroy_func::

as _); let super_callback0: Box_

= callback_data; unsafe { - AnimationTarget::from_glib_full(ffi::bis_callback_animation_target_new( - callback, - Box_::into_raw(super_callback0) as *mut _, - destroy_call2, - )) - .unsafe_cast() + AnimationTarget::from_glib_full(ffi::bis_callback_animation_target_new(callback, Box_::into_raw(super_callback0) as *mut _, destroy_call2)).unsafe_cast() } } } diff --git a/libbismuth/src/auto/carousel.rs b/libbismuth/src/auto/carousel.rs index 9515a5b..f0b8fda 100644 --- a/libbismuth/src/auto/carousel.rs +++ b/libbismuth/src/auto/carousel.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, SpringParams, Swipeable}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,SpringParams,Swipeable}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "BisCarousel")] @@ -24,16 +20,19 @@ impl Carousel { #[doc(alias = "bis_carousel_new")] pub fn new() -> Carousel { assert_initialized_main_thread!(); - unsafe { gtk::Widget::from_glib_none(ffi::bis_carousel_new()).unsafe_cast() } + unsafe { + gtk::Widget::from_glib_none(ffi::bis_carousel_new()).unsafe_cast() + } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`Carousel`] objects. - /// - /// This method returns an instance of [`CarouselBuilder`](crate::builders::CarouselBuilder) which can be used to create [`Carousel`] objects. - pub fn builder() -> CarouselBuilder { - CarouselBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`Carousel`] objects. + /// + /// This method returns an instance of [`CarouselBuilder`](crate::builders::CarouselBuilder) which can be used to create [`Carousel`] objects. + pub fn builder() -> CarouselBuilder { + CarouselBuilder::new() + } + #[doc(alias = "bis_carousel_append")] pub fn append(&self, child: &impl IsA) { @@ -47,9 +46,7 @@ impl Carousel { #[doc(alias = "allow-long-swipes")] pub fn allows_long_swipes(&self) -> bool { unsafe { - from_glib(ffi::bis_carousel_get_allow_long_swipes( - self.to_glib_none().0, - )) + from_glib(ffi::bis_carousel_get_allow_long_swipes(self.to_glib_none().0)) } } @@ -58,9 +55,7 @@ impl Carousel { #[doc(alias = "allow-mouse-drag")] pub fn allows_mouse_drag(&self) -> bool { unsafe { - from_glib(ffi::bis_carousel_get_allow_mouse_drag( - self.to_glib_none().0, - )) + from_glib(ffi::bis_carousel_get_allow_mouse_drag(self.to_glib_none().0)) } } @@ -69,9 +64,7 @@ impl Carousel { #[doc(alias = "allow-scroll-wheel")] pub fn allows_scroll_wheel(&self) -> bool { unsafe { - from_glib(ffi::bis_carousel_get_allow_scroll_wheel( - self.to_glib_none().0, - )) + from_glib(ffi::bis_carousel_get_allow_scroll_wheel(self.to_glib_none().0)) } } @@ -79,56 +72,66 @@ impl Carousel { #[doc(alias = "get_interactive")] #[doc(alias = "interactive")] pub fn is_interactive(&self) -> bool { - unsafe { from_glib(ffi::bis_carousel_get_interactive(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_carousel_get_interactive(self.to_glib_none().0)) + } } #[doc(alias = "bis_carousel_get_n_pages")] #[doc(alias = "get_n_pages")] #[doc(alias = "n-pages")] pub fn n_pages(&self) -> u32 { - unsafe { ffi::bis_carousel_get_n_pages(self.to_glib_none().0) } + unsafe { + ffi::bis_carousel_get_n_pages(self.to_glib_none().0) + } } #[doc(alias = "bis_carousel_get_nth_page")] #[doc(alias = "get_nth_page")] pub fn nth_page(&self, n: u32) -> gtk::Widget { - unsafe { from_glib_none(ffi::bis_carousel_get_nth_page(self.to_glib_none().0, n)) } + unsafe { + from_glib_none(ffi::bis_carousel_get_nth_page(self.to_glib_none().0, n)) + } } #[doc(alias = "bis_carousel_get_position")] #[doc(alias = "get_position")] pub fn position(&self) -> f64 { - unsafe { ffi::bis_carousel_get_position(self.to_glib_none().0) } + unsafe { + ffi::bis_carousel_get_position(self.to_glib_none().0) + } } #[doc(alias = "bis_carousel_get_reveal_duration")] #[doc(alias = "get_reveal_duration")] #[doc(alias = "reveal-duration")] pub fn reveal_duration(&self) -> u32 { - unsafe { ffi::bis_carousel_get_reveal_duration(self.to_glib_none().0) } + unsafe { + ffi::bis_carousel_get_reveal_duration(self.to_glib_none().0) + } } #[doc(alias = "bis_carousel_get_scroll_params")] #[doc(alias = "get_scroll_params")] #[doc(alias = "scroll-params")] pub fn scroll_params(&self) -> SpringParams { - unsafe { from_glib_full(ffi::bis_carousel_get_scroll_params(self.to_glib_none().0)) } + unsafe { + from_glib_full(ffi::bis_carousel_get_scroll_params(self.to_glib_none().0)) + } } #[doc(alias = "bis_carousel_get_spacing")] #[doc(alias = "get_spacing")] pub fn spacing(&self) -> u32 { - unsafe { ffi::bis_carousel_get_spacing(self.to_glib_none().0) } + unsafe { + ffi::bis_carousel_get_spacing(self.to_glib_none().0) + } } #[doc(alias = "bis_carousel_insert")] pub fn insert(&self, child: &impl IsA, position: i32) { unsafe { - ffi::bis_carousel_insert( - self.to_glib_none().0, - child.as_ref().to_glib_none().0, - position, - ); + ffi::bis_carousel_insert(self.to_glib_none().0, child.as_ref().to_glib_none().0, position); } } @@ -149,22 +152,14 @@ impl Carousel { #[doc(alias = "bis_carousel_reorder")] pub fn reorder(&self, child: &impl IsA, position: i32) { unsafe { - ffi::bis_carousel_reorder( - self.to_glib_none().0, - child.as_ref().to_glib_none().0, - position, - ); + ffi::bis_carousel_reorder(self.to_glib_none().0, child.as_ref().to_glib_none().0, position); } } #[doc(alias = "bis_carousel_scroll_to")] pub fn scroll_to(&self, widget: &impl IsA, animate: bool) { unsafe { - ffi::bis_carousel_scroll_to( - self.to_glib_none().0, - widget.as_ref().to_glib_none().0, - animate.into_glib(), - ); + ffi::bis_carousel_scroll_to(self.to_glib_none().0, widget.as_ref().to_glib_none().0, animate.into_glib()); } } @@ -172,10 +167,7 @@ impl Carousel { #[doc(alias = "allow-long-swipes")] pub fn set_allow_long_swipes(&self, allow_long_swipes: bool) { unsafe { - ffi::bis_carousel_set_allow_long_swipes( - self.to_glib_none().0, - allow_long_swipes.into_glib(), - ); + ffi::bis_carousel_set_allow_long_swipes(self.to_glib_none().0, allow_long_swipes.into_glib()); } } @@ -183,10 +175,7 @@ impl Carousel { #[doc(alias = "allow-mouse-drag")] pub fn set_allow_mouse_drag(&self, allow_mouse_drag: bool) { unsafe { - ffi::bis_carousel_set_allow_mouse_drag( - self.to_glib_none().0, - allow_mouse_drag.into_glib(), - ); + ffi::bis_carousel_set_allow_mouse_drag(self.to_glib_none().0, allow_mouse_drag.into_glib()); } } @@ -194,10 +183,7 @@ impl Carousel { #[doc(alias = "allow-scroll-wheel")] pub fn set_allow_scroll_wheel(&self, allow_scroll_wheel: bool) { unsafe { - ffi::bis_carousel_set_allow_scroll_wheel( - self.to_glib_none().0, - allow_scroll_wheel.into_glib(), - ); + ffi::bis_carousel_set_allow_scroll_wheel(self.to_glib_none().0, allow_scroll_wheel.into_glib()); } } @@ -235,493 +221,310 @@ impl Carousel { #[doc(alias = "page-changed")] pub fn connect_page_changed(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn page_changed_trampoline( - this: *mut ffi::BisCarousel, - index: libc::c_uint, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn page_changed_trampoline(this: *mut ffi::BisCarousel, index: libc::c_uint, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), index) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"page-changed\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - page_changed_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"page-changed\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(page_changed_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "allow-long-swipes")] - pub fn connect_allow_long_swipes_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_allow_long_swipes_trampoline( - this: *mut ffi::BisCarousel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + pub fn connect_allow_long_swipes_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_allow_long_swipes_trampoline(this: *mut ffi::BisCarousel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::allow-long-swipes\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_allow_long_swipes_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::allow-long-swipes\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_allow_long_swipes_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "allow-mouse-drag")] pub fn connect_allow_mouse_drag_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_allow_mouse_drag_trampoline( - this: *mut ffi::BisCarousel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_allow_mouse_drag_trampoline(this: *mut ffi::BisCarousel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::allow-mouse-drag\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_allow_mouse_drag_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::allow-mouse-drag\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_allow_mouse_drag_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "allow-scroll-wheel")] - pub fn connect_allow_scroll_wheel_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_allow_scroll_wheel_trampoline( - this: *mut ffi::BisCarousel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + pub fn connect_allow_scroll_wheel_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_allow_scroll_wheel_trampoline(this: *mut ffi::BisCarousel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::allow-scroll-wheel\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_allow_scroll_wheel_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::allow-scroll-wheel\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_allow_scroll_wheel_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "interactive")] pub fn connect_interactive_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_interactive_trampoline( - this: *mut ffi::BisCarousel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_interactive_trampoline(this: *mut ffi::BisCarousel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::interactive\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_interactive_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::interactive\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_interactive_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "n-pages")] pub fn connect_n_pages_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_n_pages_trampoline( - this: *mut ffi::BisCarousel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_n_pages_trampoline(this: *mut ffi::BisCarousel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::n-pages\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_n_pages_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::n-pages\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_n_pages_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "position")] pub fn connect_position_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_position_trampoline( - this: *mut ffi::BisCarousel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_position_trampoline(this: *mut ffi::BisCarousel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::position\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_position_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::position\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_position_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "reveal-duration")] pub fn connect_reveal_duration_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_reveal_duration_trampoline( - this: *mut ffi::BisCarousel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_reveal_duration_trampoline(this: *mut ffi::BisCarousel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::reveal-duration\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_reveal_duration_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::reveal-duration\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_reveal_duration_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "scroll-params")] pub fn connect_scroll_params_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_scroll_params_trampoline( - this: *mut ffi::BisCarousel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_scroll_params_trampoline(this: *mut ffi::BisCarousel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::scroll-params\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_scroll_params_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::scroll-params\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_scroll_params_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "spacing")] pub fn connect_spacing_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_spacing_trampoline( - this: *mut ffi::BisCarousel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_spacing_trampoline(this: *mut ffi::BisCarousel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::spacing\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_spacing_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::spacing\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_spacing_trampoline:: as *const ())), Box_::into_raw(f)) } } } impl Default for Carousel { - fn default() -> Self { - Self::new() - } -} + fn default() -> Self { + Self::new() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`Carousel`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`Carousel`] 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 CarouselBuilder { - builder: glib::object::ObjectBuilder<'static, Carousel>, -} - -impl CarouselBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, Carousel>, } - } - pub fn allow_long_swipes(self, allow_long_swipes: bool) -> Self { - Self { - builder: self - .builder - .property("allow-long-swipes", allow_long_swipes), + impl CarouselBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn allow_mouse_drag(self, allow_mouse_drag: bool) -> Self { - Self { - builder: self.builder.property("allow-mouse-drag", allow_mouse_drag), - } - } + pub fn allow_long_swipes(self, allow_long_swipes: bool) -> Self { + Self { builder: self.builder.property("allow-long-swipes", allow_long_swipes), } + } - pub fn allow_scroll_wheel(self, allow_scroll_wheel: bool) -> Self { - Self { - builder: self - .builder - .property("allow-scroll-wheel", allow_scroll_wheel), - } - } + pub fn allow_mouse_drag(self, allow_mouse_drag: bool) -> Self { + Self { builder: self.builder.property("allow-mouse-drag", allow_mouse_drag), } + } - pub fn interactive(self, interactive: bool) -> Self { - Self { - builder: self.builder.property("interactive", interactive), - } - } + pub fn allow_scroll_wheel(self, allow_scroll_wheel: bool) -> Self { + Self { builder: self.builder.property("allow-scroll-wheel", allow_scroll_wheel), } + } - pub fn reveal_duration(self, reveal_duration: u32) -> Self { - Self { - builder: self.builder.property("reveal-duration", reveal_duration), - } - } + pub fn interactive(self, interactive: bool) -> Self { + Self { builder: self.builder.property("interactive", interactive), } + } - pub fn scroll_params(self, scroll_params: &SpringParams) -> Self { - Self { - builder: self - .builder - .property("scroll-params", scroll_params.clone()), - } - } + pub fn reveal_duration(self, reveal_duration: u32) -> Self { + Self { builder: self.builder.property("reveal-duration", reveal_duration), } + } - pub fn spacing(self, spacing: u32) -> Self { - Self { - builder: self.builder.property("spacing", spacing), - } - } + pub fn scroll_params(self, scroll_params: &SpringParams) -> Self { + Self { builder: self.builder.property("scroll-params", scroll_params.clone()), } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { - builder: self.builder.property("can-focus", can_focus), - } - } + pub fn spacing(self, spacing: u32) -> Self { + Self { builder: self.builder.property("spacing", spacing), } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { - builder: self.builder.property("can-target", can_target), - } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { builder: self.builder.property("can-focus", can_focus), } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { - builder: self.builder.property("css-classes", css_classes.into()), - } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { builder: self.builder.property("can-target", can_target), } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { - builder: self.builder.property("css-name", css_name.into()), - } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { builder: self.builder.property("css-classes", css_classes.into()), } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + pub fn css_name(self, css_name: impl Into) -> Self { + Self { builder: self.builder.property("css-name", css_name.into()), } + } - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { - builder: self.builder.property("focus-on-click", focus_on_click), - } - } + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focusable(self, focusable: bool) -> Self { - Self { - builder: self.builder.property("focusable", focusable), - } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { builder: self.builder.property("focus-on-click", focus_on_click), } + } - //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { - // Self { builder: self.builder.property("halign", halign), } - //} + pub fn focusable(self, focusable: bool) -> Self { + Self { builder: self.builder.property("focusable", focusable), } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { - builder: self.builder.property("has-tooltip", has_tooltip), - } - } + //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { + // Self { builder: self.builder.property("halign", halign), } + //} - pub fn height_request(self, height_request: i32) -> Self { - Self { - builder: self.builder.property("height-request", height_request), - } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { builder: self.builder.property("has-tooltip", has_tooltip), } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { - builder: self.builder.property("hexpand", hexpand), - } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { builder: self.builder.property("height-request", height_request), } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { - builder: self.builder.property("hexpand-set", hexpand_set), - } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { builder: self.builder.property("hexpand", hexpand), } + } - pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("layout-manager", layout_manager.clone().upcast()), - } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { builder: self.builder.property("hexpand-set", hexpand_set), } + } - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { - builder: self.builder.property("margin-bottom", margin_bottom), - } - } + pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { - builder: self.builder.property("margin-end", margin_end), - } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { builder: self.builder.property("margin-bottom", margin_bottom), } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { - builder: self.builder.property("margin-start", margin_start), - } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { builder: self.builder.property("margin-end", margin_end), } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { - builder: self.builder.property("margin-top", margin_top), - } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { builder: self.builder.property("margin-start", margin_start), } + } - pub fn name(self, name: impl Into) -> Self { - Self { - builder: self.builder.property("name", name.into()), - } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { builder: self.builder.property("margin-top", margin_top), } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { - builder: self.builder.property("opacity", opacity), - } - } + pub fn name(self, name: impl Into) -> Self { + Self { builder: self.builder.property("name", name.into()), } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + pub fn opacity(self, opacity: f64) -> Self { + Self { builder: self.builder.property("opacity", opacity), } + } - pub fn receives_default(self, receives_default: bool) -> Self { - Self { - builder: self.builder.property("receives-default", receives_default), - } - } + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn sensitive(self, sensitive: bool) -> Self { - Self { - builder: self.builder.property("sensitive", sensitive), - } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { builder: self.builder.property("receives-default", receives_default), } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { - builder: self - .builder - .property("tooltip-markup", tooltip_markup.into()), - } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { builder: self.builder.property("sensitive", sensitive), } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { - builder: self.builder.property("tooltip-text", tooltip_text.into()), - } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } + } - //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { - // Self { builder: self.builder.property("valign", valign), } - //} + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { - builder: self.builder.property("vexpand", vexpand), - } - } + //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { + // Self { builder: self.builder.property("valign", valign), } + //} - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { - builder: self.builder.property("vexpand-set", vexpand_set), - } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { builder: self.builder.property("vexpand", vexpand), } + } - pub fn visible(self, visible: bool) -> Self { - Self { - builder: self.builder.property("visible", visible), - } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { builder: self.builder.property("vexpand-set", vexpand_set), } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { - builder: self.builder.property("width-request", width_request), - } - } + pub fn visible(self, visible: bool) -> Self { + Self { builder: self.builder.property("visible", visible), } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + pub fn width_request(self, width_request: i32) -> Self { + Self { builder: self.builder.property("width-request", width_request), } + } - //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { - // Self { builder: self.builder.property("orientation", orientation), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} + + //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { + // Self { builder: self.builder.property("orientation", orientation), } + //} // rustdoc-stripper-ignore-next /// Build the [`Carousel`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Carousel { - self.builder.build() - } + self.builder.build() } } diff --git a/libbismuth/src/auto/carousel_indicator_dots.rs b/libbismuth/src/auto/carousel_indicator_dots.rs index 7c8faba..1a2483f 100644 --- a/libbismuth/src/auto/carousel_indicator_dots.rs +++ b/libbismuth/src/auto/carousel_indicator_dots.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, Carousel}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,Carousel}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "BisCarouselIndicatorDots")] @@ -24,24 +20,25 @@ impl CarouselIndicatorDots { #[doc(alias = "bis_carousel_indicator_dots_new")] pub fn new() -> CarouselIndicatorDots { assert_initialized_main_thread!(); - unsafe { gtk::Widget::from_glib_none(ffi::bis_carousel_indicator_dots_new()).unsafe_cast() } + unsafe { + gtk::Widget::from_glib_none(ffi::bis_carousel_indicator_dots_new()).unsafe_cast() + } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`CarouselIndicatorDots`] objects. - /// - /// This method returns an instance of [`CarouselIndicatorDotsBuilder`](crate::builders::CarouselIndicatorDotsBuilder) which can be used to create [`CarouselIndicatorDots`] objects. - pub fn builder() -> CarouselIndicatorDotsBuilder { - CarouselIndicatorDotsBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`CarouselIndicatorDots`] objects. + /// + /// This method returns an instance of [`CarouselIndicatorDotsBuilder`](crate::builders::CarouselIndicatorDotsBuilder) which can be used to create [`CarouselIndicatorDots`] objects. + pub fn builder() -> CarouselIndicatorDotsBuilder { + CarouselIndicatorDotsBuilder::new() + } + #[doc(alias = "bis_carousel_indicator_dots_get_carousel")] #[doc(alias = "get_carousel")] pub fn carousel(&self) -> Option { unsafe { - from_glib_none(ffi::bis_carousel_indicator_dots_get_carousel( - self.to_glib_none().0, - )) + from_glib_none(ffi::bis_carousel_indicator_dots_get_carousel(self.to_glib_none().0)) } } @@ -49,247 +46,175 @@ impl CarouselIndicatorDots { #[doc(alias = "carousel")] pub fn set_carousel(&self, carousel: Option<&Carousel>) { unsafe { - ffi::bis_carousel_indicator_dots_set_carousel( - self.to_glib_none().0, - carousel.to_glib_none().0, - ); + ffi::bis_carousel_indicator_dots_set_carousel(self.to_glib_none().0, carousel.to_glib_none().0); } } #[doc(alias = "carousel")] pub fn connect_carousel_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_carousel_trampoline( - this: *mut ffi::BisCarouselIndicatorDots, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_carousel_trampoline(this: *mut ffi::BisCarouselIndicatorDots, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::carousel\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_carousel_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::carousel\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_carousel_trampoline:: as *const ())), Box_::into_raw(f)) } } } impl Default for CarouselIndicatorDots { - fn default() -> Self { - Self::new() - } -} + fn default() -> Self { + Self::new() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`CarouselIndicatorDots`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`CarouselIndicatorDots`] 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 CarouselIndicatorDotsBuilder { - builder: glib::object::ObjectBuilder<'static, CarouselIndicatorDots>, -} - -impl CarouselIndicatorDotsBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, CarouselIndicatorDots>, } - } - pub fn carousel(self, carousel: &Carousel) -> Self { - Self { - builder: self.builder.property("carousel", carousel.clone()), + impl CarouselIndicatorDotsBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { - builder: self.builder.property("can-focus", can_focus), - } - } + pub fn carousel(self, carousel: &Carousel) -> Self { + Self { builder: self.builder.property("carousel", carousel.clone()), } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { - builder: self.builder.property("can-target", can_target), - } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { builder: self.builder.property("can-focus", can_focus), } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { - builder: self.builder.property("css-classes", css_classes.into()), - } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { builder: self.builder.property("can-target", can_target), } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { - builder: self.builder.property("css-name", css_name.into()), - } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { builder: self.builder.property("css-classes", css_classes.into()), } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + pub fn css_name(self, css_name: impl Into) -> Self { + Self { builder: self.builder.property("css-name", css_name.into()), } + } - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { - builder: self.builder.property("focus-on-click", focus_on_click), - } - } + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focusable(self, focusable: bool) -> Self { - Self { - builder: self.builder.property("focusable", focusable), - } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { builder: self.builder.property("focus-on-click", focus_on_click), } + } - //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { - // Self { builder: self.builder.property("halign", halign), } - //} + pub fn focusable(self, focusable: bool) -> Self { + Self { builder: self.builder.property("focusable", focusable), } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { - builder: self.builder.property("has-tooltip", has_tooltip), - } - } + //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { + // Self { builder: self.builder.property("halign", halign), } + //} - pub fn height_request(self, height_request: i32) -> Self { - Self { - builder: self.builder.property("height-request", height_request), - } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { builder: self.builder.property("has-tooltip", has_tooltip), } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { - builder: self.builder.property("hexpand", hexpand), - } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { builder: self.builder.property("height-request", height_request), } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { - builder: self.builder.property("hexpand-set", hexpand_set), - } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { builder: self.builder.property("hexpand", hexpand), } + } - pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("layout-manager", layout_manager.clone().upcast()), - } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { builder: self.builder.property("hexpand-set", hexpand_set), } + } - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { - builder: self.builder.property("margin-bottom", margin_bottom), - } - } + pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { - builder: self.builder.property("margin-end", margin_end), - } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { builder: self.builder.property("margin-bottom", margin_bottom), } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { - builder: self.builder.property("margin-start", margin_start), - } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { builder: self.builder.property("margin-end", margin_end), } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { - builder: self.builder.property("margin-top", margin_top), - } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { builder: self.builder.property("margin-start", margin_start), } + } - pub fn name(self, name: impl Into) -> Self { - Self { - builder: self.builder.property("name", name.into()), - } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { builder: self.builder.property("margin-top", margin_top), } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { - builder: self.builder.property("opacity", opacity), - } - } + pub fn name(self, name: impl Into) -> Self { + Self { builder: self.builder.property("name", name.into()), } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + pub fn opacity(self, opacity: f64) -> Self { + Self { builder: self.builder.property("opacity", opacity), } + } - pub fn receives_default(self, receives_default: bool) -> Self { - Self { - builder: self.builder.property("receives-default", receives_default), - } - } + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn sensitive(self, sensitive: bool) -> Self { - Self { - builder: self.builder.property("sensitive", sensitive), - } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { builder: self.builder.property("receives-default", receives_default), } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { - builder: self - .builder - .property("tooltip-markup", tooltip_markup.into()), - } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { builder: self.builder.property("sensitive", sensitive), } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { - builder: self.builder.property("tooltip-text", tooltip_text.into()), - } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } + } - //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { - // Self { builder: self.builder.property("valign", valign), } - //} + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { - builder: self.builder.property("vexpand", vexpand), - } - } + //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { + // Self { builder: self.builder.property("valign", valign), } + //} - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { - builder: self.builder.property("vexpand-set", vexpand_set), - } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { builder: self.builder.property("vexpand", vexpand), } + } - pub fn visible(self, visible: bool) -> Self { - Self { - builder: self.builder.property("visible", visible), - } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { builder: self.builder.property("vexpand-set", vexpand_set), } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { - builder: self.builder.property("width-request", width_request), - } - } + pub fn visible(self, visible: bool) -> Self { + Self { builder: self.builder.property("visible", visible), } + } + + pub fn width_request(self, width_request: i32) -> Self { + Self { builder: self.builder.property("width-request", width_request), } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} - //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { - // Self { builder: self.builder.property("orientation", orientation), } - //} + //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { + // Self { builder: self.builder.property("orientation", orientation), } + //} // rustdoc-stripper-ignore-next /// Build the [`CarouselIndicatorDots`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> CarouselIndicatorDots { - self.builder.build() - } + self.builder.build() } } diff --git a/libbismuth/src/auto/carousel_indicator_lines.rs b/libbismuth/src/auto/carousel_indicator_lines.rs index a3e8a44..b3fe020 100644 --- a/libbismuth/src/auto/carousel_indicator_lines.rs +++ b/libbismuth/src/auto/carousel_indicator_lines.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, Carousel}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,Carousel}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "BisCarouselIndicatorLines")] @@ -29,21 +25,20 @@ impl CarouselIndicatorLines { } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`CarouselIndicatorLines`] objects. - /// - /// This method returns an instance of [`CarouselIndicatorLinesBuilder`](crate::builders::CarouselIndicatorLinesBuilder) which can be used to create [`CarouselIndicatorLines`] objects. - pub fn builder() -> CarouselIndicatorLinesBuilder { - CarouselIndicatorLinesBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`CarouselIndicatorLines`] objects. + /// + /// This method returns an instance of [`CarouselIndicatorLinesBuilder`](crate::builders::CarouselIndicatorLinesBuilder) which can be used to create [`CarouselIndicatorLines`] objects. + pub fn builder() -> CarouselIndicatorLinesBuilder { + CarouselIndicatorLinesBuilder::new() + } + #[doc(alias = "bis_carousel_indicator_lines_get_carousel")] #[doc(alias = "get_carousel")] pub fn carousel(&self) -> Option { unsafe { - from_glib_none(ffi::bis_carousel_indicator_lines_get_carousel( - self.to_glib_none().0, - )) + from_glib_none(ffi::bis_carousel_indicator_lines_get_carousel(self.to_glib_none().0)) } } @@ -51,249 +46,175 @@ impl CarouselIndicatorLines { #[doc(alias = "carousel")] pub fn set_carousel(&self, carousel: Option<&Carousel>) { unsafe { - ffi::bis_carousel_indicator_lines_set_carousel( - self.to_glib_none().0, - carousel.to_glib_none().0, - ); + ffi::bis_carousel_indicator_lines_set_carousel(self.to_glib_none().0, carousel.to_glib_none().0); } } #[doc(alias = "carousel")] pub fn connect_carousel_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_carousel_trampoline< - F: Fn(&CarouselIndicatorLines) + 'static, - >( - this: *mut ffi::BisCarouselIndicatorLines, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_carousel_trampoline(this: *mut ffi::BisCarouselIndicatorLines, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::carousel\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_carousel_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::carousel\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_carousel_trampoline:: as *const ())), Box_::into_raw(f)) } } } impl Default for CarouselIndicatorLines { - fn default() -> Self { - Self::new() - } -} + fn default() -> Self { + Self::new() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`CarouselIndicatorLines`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`CarouselIndicatorLines`] 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 CarouselIndicatorLinesBuilder { - builder: glib::object::ObjectBuilder<'static, CarouselIndicatorLines>, -} - -impl CarouselIndicatorLinesBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, CarouselIndicatorLines>, } - } - pub fn carousel(self, carousel: &Carousel) -> Self { - Self { - builder: self.builder.property("carousel", carousel.clone()), + impl CarouselIndicatorLinesBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { - builder: self.builder.property("can-focus", can_focus), - } - } + pub fn carousel(self, carousel: &Carousel) -> Self { + Self { builder: self.builder.property("carousel", carousel.clone()), } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { - builder: self.builder.property("can-target", can_target), - } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { builder: self.builder.property("can-focus", can_focus), } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { - builder: self.builder.property("css-classes", css_classes.into()), - } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { builder: self.builder.property("can-target", can_target), } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { - builder: self.builder.property("css-name", css_name.into()), - } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { builder: self.builder.property("css-classes", css_classes.into()), } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + pub fn css_name(self, css_name: impl Into) -> Self { + Self { builder: self.builder.property("css-name", css_name.into()), } + } - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { - builder: self.builder.property("focus-on-click", focus_on_click), - } - } + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focusable(self, focusable: bool) -> Self { - Self { - builder: self.builder.property("focusable", focusable), - } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { builder: self.builder.property("focus-on-click", focus_on_click), } + } - //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { - // Self { builder: self.builder.property("halign", halign), } - //} + pub fn focusable(self, focusable: bool) -> Self { + Self { builder: self.builder.property("focusable", focusable), } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { - builder: self.builder.property("has-tooltip", has_tooltip), - } - } + //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { + // Self { builder: self.builder.property("halign", halign), } + //} - pub fn height_request(self, height_request: i32) -> Self { - Self { - builder: self.builder.property("height-request", height_request), - } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { builder: self.builder.property("has-tooltip", has_tooltip), } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { - builder: self.builder.property("hexpand", hexpand), - } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { builder: self.builder.property("height-request", height_request), } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { - builder: self.builder.property("hexpand-set", hexpand_set), - } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { builder: self.builder.property("hexpand", hexpand), } + } - pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("layout-manager", layout_manager.clone().upcast()), - } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { builder: self.builder.property("hexpand-set", hexpand_set), } + } - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { - builder: self.builder.property("margin-bottom", margin_bottom), - } - } + pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { - builder: self.builder.property("margin-end", margin_end), - } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { builder: self.builder.property("margin-bottom", margin_bottom), } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { - builder: self.builder.property("margin-start", margin_start), - } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { builder: self.builder.property("margin-end", margin_end), } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { - builder: self.builder.property("margin-top", margin_top), - } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { builder: self.builder.property("margin-start", margin_start), } + } - pub fn name(self, name: impl Into) -> Self { - Self { - builder: self.builder.property("name", name.into()), - } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { builder: self.builder.property("margin-top", margin_top), } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { - builder: self.builder.property("opacity", opacity), - } - } + pub fn name(self, name: impl Into) -> Self { + Self { builder: self.builder.property("name", name.into()), } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + pub fn opacity(self, opacity: f64) -> Self { + Self { builder: self.builder.property("opacity", opacity), } + } - pub fn receives_default(self, receives_default: bool) -> Self { - Self { - builder: self.builder.property("receives-default", receives_default), - } - } + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn sensitive(self, sensitive: bool) -> Self { - Self { - builder: self.builder.property("sensitive", sensitive), - } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { builder: self.builder.property("receives-default", receives_default), } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { - builder: self - .builder - .property("tooltip-markup", tooltip_markup.into()), - } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { builder: self.builder.property("sensitive", sensitive), } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { - builder: self.builder.property("tooltip-text", tooltip_text.into()), - } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } + } - //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { - // Self { builder: self.builder.property("valign", valign), } - //} + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { - builder: self.builder.property("vexpand", vexpand), - } - } + //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { + // Self { builder: self.builder.property("valign", valign), } + //} - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { - builder: self.builder.property("vexpand-set", vexpand_set), - } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { builder: self.builder.property("vexpand", vexpand), } + } - pub fn visible(self, visible: bool) -> Self { - Self { - builder: self.builder.property("visible", visible), - } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { builder: self.builder.property("vexpand-set", vexpand_set), } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { - builder: self.builder.property("width-request", width_request), - } - } + pub fn visible(self, visible: bool) -> Self { + Self { builder: self.builder.property("visible", visible), } + } + + pub fn width_request(self, width_request: i32) -> Self { + Self { builder: self.builder.property("width-request", width_request), } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} - //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { - // Self { builder: self.builder.property("orientation", orientation), } - //} + //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { + // Self { builder: self.builder.property("orientation", orientation), } + //} // rustdoc-stripper-ignore-next /// Build the [`CarouselIndicatorLines`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> CarouselIndicatorLines { - self.builder.build() - } + self.builder.build() } } diff --git a/libbismuth/src/auto/enum_list_item.rs b/libbismuth/src/auto/enum_list_item.rs index 971c289..8ddce6c 100644 --- a/libbismuth/src/auto/enum_list_item.rs +++ b/libbismuth/src/auto/enum_list_item.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::ffi; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "BisEnumListItem")] @@ -24,87 +20,63 @@ impl EnumListItem { #[doc(alias = "bis_enum_list_item_get_name")] #[doc(alias = "get_name")] pub fn name(&self) -> glib::GString { - unsafe { from_glib_none(ffi::bis_enum_list_item_get_name(self.to_glib_none().0)) } + unsafe { + from_glib_none(ffi::bis_enum_list_item_get_name(self.to_glib_none().0)) + } } #[doc(alias = "bis_enum_list_item_get_nick")] #[doc(alias = "get_nick")] pub fn nick(&self) -> glib::GString { - unsafe { from_glib_none(ffi::bis_enum_list_item_get_nick(self.to_glib_none().0)) } + unsafe { + from_glib_none(ffi::bis_enum_list_item_get_nick(self.to_glib_none().0)) + } } #[doc(alias = "bis_enum_list_item_get_value")] #[doc(alias = "get_value")] pub fn value(&self) -> i32 { - unsafe { ffi::bis_enum_list_item_get_value(self.to_glib_none().0) } + unsafe { + ffi::bis_enum_list_item_get_value(self.to_glib_none().0) + } } #[doc(alias = "name")] pub fn connect_name_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_name_trampoline( - this: *mut ffi::BisEnumListItem, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_name_trampoline(this: *mut ffi::BisEnumListItem, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::name\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_name_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::name\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_name_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "nick")] pub fn connect_nick_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_nick_trampoline( - this: *mut ffi::BisEnumListItem, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_nick_trampoline(this: *mut ffi::BisEnumListItem, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::nick\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_nick_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::nick\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_nick_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "value")] pub fn connect_value_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_value_trampoline( - this: *mut ffi::BisEnumListItem, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_value_trampoline(this: *mut ffi::BisEnumListItem, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::value\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_value_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::value\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_value_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/libbismuth/src/auto/enum_list_model.rs b/libbismuth/src/auto/enum_list_model.rs index 7be2676..257dc3e 100644 --- a/libbismuth/src/auto/enum_list_model.rs +++ b/libbismuth/src/auto/enum_list_model.rs @@ -1,10 +1,10 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::ffi; -use glib::{prelude::*, translate::*}; +use crate::{ffi}; +use glib::{prelude::*,translate::*}; glib::wrapper! { #[doc(alias = "BisEnumListModel")] @@ -19,20 +19,25 @@ impl EnumListModel { #[doc(alias = "bis_enum_list_model_new")] pub fn new(enum_type: glib::types::Type) -> EnumListModel { assert_initialized_main_thread!(); - unsafe { from_glib_full(ffi::bis_enum_list_model_new(enum_type.into_glib())) } + unsafe { + from_glib_full(ffi::bis_enum_list_model_new(enum_type.into_glib())) + } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`EnumListModel`] objects. - /// - /// This method returns an instance of [`EnumListModelBuilder`](crate::builders::EnumListModelBuilder) which can be used to create [`EnumListModel`] objects. - pub fn builder() -> EnumListModelBuilder { - EnumListModelBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`EnumListModel`] objects. + /// + /// This method returns an instance of [`EnumListModelBuilder`](crate::builders::EnumListModelBuilder) which can be used to create [`EnumListModel`] objects. + pub fn builder() -> EnumListModelBuilder { + EnumListModelBuilder::new() + } + #[doc(alias = "bis_enum_list_model_find_position")] pub fn find_position(&self, value: i32) -> u32 { - unsafe { ffi::bis_enum_list_model_find_position(self.to_glib_none().0, value) } + unsafe { + ffi::bis_enum_list_model_find_position(self.to_glib_none().0, value) + } } #[doc(alias = "bis_enum_list_model_get_enum_type")] @@ -40,45 +45,38 @@ impl EnumListModel { #[doc(alias = "enum-type")] pub fn enum_type(&self) -> glib::types::Type { unsafe { - from_glib(ffi::bis_enum_list_model_get_enum_type( - self.to_glib_none().0, - )) + from_glib(ffi::bis_enum_list_model_get_enum_type(self.to_glib_none().0)) } } } impl Default for EnumListModel { - fn default() -> Self { - glib::object::Object::new::() - } -} + fn default() -> Self { + glib::object::Object::new::() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`EnumListModel`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`EnumListModel`] 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 EnumListModelBuilder { - builder: glib::object::ObjectBuilder<'static, EnumListModel>, -} - -impl EnumListModelBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, EnumListModel>, } - } - pub fn enum_type(self, enum_type: glib::types::Type) -> Self { - Self { - builder: self.builder.property("enum-type", enum_type), + impl EnumListModelBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } + + pub fn enum_type(self, enum_type: glib::types::Type) -> Self { + Self { builder: self.builder.property("enum-type", enum_type), } + } // rustdoc-stripper-ignore-next /// Build the [`EnumListModel`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> EnumListModel { - self.builder.build() - } + self.builder.build() } } diff --git a/libbismuth/src/auto/enums.rs b/libbismuth/src/auto/enums.rs index 42d6ca8..ad46058 100644 --- a/libbismuth/src/auto/enums.rs +++ b/libbismuth/src/auto/enums.rs @@ -1,12 +1,13 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::ffi; -use glib::{prelude::*, translate::*}; +use crate::{ffi}; +use glib::{prelude::*,translate::*}; -#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] #[non_exhaustive] #[doc(alias = "BisAlbumTransitionType")] pub enum AlbumTransitionType { @@ -16,7 +17,7 @@ pub enum AlbumTransitionType { Under, #[doc(alias = "BIS_ALBUM_TRANSITION_TYPE_SLIDE")] Slide, - #[doc(hidden)] +#[doc(hidden)] __Unknown(i32), } @@ -25,47 +26,47 @@ impl IntoGlib for AlbumTransitionType { type GlibType = ffi::BisAlbumTransitionType; #[inline] - fn into_glib(self) -> ffi::BisAlbumTransitionType { - match self { +fn into_glib(self) -> ffi::BisAlbumTransitionType { +match self { Self::Over => ffi::BIS_ALBUM_TRANSITION_TYPE_OVER, Self::Under => ffi::BIS_ALBUM_TRANSITION_TYPE_UNDER, Self::Slide => ffi::BIS_ALBUM_TRANSITION_TYPE_SLIDE, Self::__Unknown(value) => value, - } - } +} +} } #[doc(hidden)] impl FromGlib for AlbumTransitionType { #[inline] - unsafe fn from_glib(value: ffi::BisAlbumTransitionType) -> Self { +unsafe fn from_glib(value: ffi::BisAlbumTransitionType) -> Self { skip_assert_initialized!(); - - match value { + +match value { ffi::BIS_ALBUM_TRANSITION_TYPE_OVER => Self::Over, ffi::BIS_ALBUM_TRANSITION_TYPE_UNDER => Self::Under, ffi::BIS_ALBUM_TRANSITION_TYPE_SLIDE => Self::Slide, value => Self::__Unknown(value), - } - } +} +} } impl StaticType for AlbumTransitionType { - #[inline] + #[inline] #[doc(alias = "bis_album_transition_type_get_type")] - fn static_type() -> glib::Type { - unsafe { from_glib(ffi::bis_album_transition_type_get_type()) } - } -} + fn static_type() -> glib::Type { + unsafe { from_glib(ffi::bis_album_transition_type_get_type()) } + } + } impl glib::HasParamSpec for AlbumTransitionType { - 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 - } + 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 AlbumTransitionType { @@ -106,7 +107,8 @@ impl From for glib::Value { } } -#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] #[non_exhaustive] #[doc(alias = "BisAnimationState")] pub enum AnimationState { @@ -118,7 +120,7 @@ pub enum AnimationState { Playing, #[doc(alias = "BIS_ANIMATION_FINISHED")] Finished, - #[doc(hidden)] +#[doc(hidden)] __Unknown(i32), } @@ -127,49 +129,49 @@ impl IntoGlib for AnimationState { type GlibType = ffi::BisAnimationState; #[inline] - fn into_glib(self) -> ffi::BisAnimationState { - match self { +fn into_glib(self) -> ffi::BisAnimationState { +match self { Self::Idle => ffi::BIS_ANIMATION_IDLE, Self::Paused => ffi::BIS_ANIMATION_PAUSED, Self::Playing => ffi::BIS_ANIMATION_PLAYING, Self::Finished => ffi::BIS_ANIMATION_FINISHED, Self::__Unknown(value) => value, - } - } +} +} } #[doc(hidden)] impl FromGlib for AnimationState { #[inline] - unsafe fn from_glib(value: ffi::BisAnimationState) -> Self { +unsafe fn from_glib(value: ffi::BisAnimationState) -> Self { skip_assert_initialized!(); - - match value { + +match value { ffi::BIS_ANIMATION_IDLE => Self::Idle, ffi::BIS_ANIMATION_PAUSED => Self::Paused, ffi::BIS_ANIMATION_PLAYING => Self::Playing, ffi::BIS_ANIMATION_FINISHED => Self::Finished, value => Self::__Unknown(value), - } - } +} +} } impl StaticType for AnimationState { - #[inline] + #[inline] #[doc(alias = "bis_animation_state_get_type")] - fn static_type() -> glib::Type { - unsafe { from_glib(ffi::bis_animation_state_get_type()) } - } -} + fn static_type() -> glib::Type { + unsafe { from_glib(ffi::bis_animation_state_get_type()) } + } + } impl glib::HasParamSpec for AnimationState { - 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 - } + 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 AnimationState { @@ -210,7 +212,8 @@ impl From for glib::Value { } } -#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] #[non_exhaustive] #[doc(alias = "BisEasing")] pub enum Easing { @@ -276,7 +279,7 @@ pub enum Easing { EaseOutBounce, #[doc(alias = "BIS_EASE_IN_OUT_BOUNCE")] EaseInOutBounce, - #[doc(hidden)] +#[doc(hidden)] __Unknown(i32), } @@ -284,7 +287,9 @@ impl Easing { #[doc(alias = "bis_easing_ease")] pub fn ease(self, value: f64) -> f64 { assert_initialized_main_thread!(); - unsafe { ffi::bis_easing_ease(self.into_glib(), value) } + unsafe { + ffi::bis_easing_ease(self.into_glib(), value) + } } } @@ -293,7 +298,7 @@ impl IntoGlib for Easing { type GlibType = ffi::BisEasing; fn into_glib(self) -> ffi::BisEasing { - match self { +match self { Self::Linear => ffi::BIS_LINEAR, Self::EaseInQuad => ffi::BIS_EASE_IN_QUAD, Self::EaseOutQuad => ffi::BIS_EASE_OUT_QUAD, @@ -326,16 +331,16 @@ impl IntoGlib for Easing { Self::EaseOutBounce => ffi::BIS_EASE_OUT_BOUNCE, Self::EaseInOutBounce => ffi::BIS_EASE_IN_OUT_BOUNCE, Self::__Unknown(value) => value, - } - } +} +} } #[doc(hidden)] impl FromGlib for Easing { unsafe fn from_glib(value: ffi::BisEasing) -> Self { skip_assert_initialized!(); - - match value { + +match value { ffi::BIS_LINEAR => Self::Linear, ffi::BIS_EASE_IN_QUAD => Self::EaseInQuad, ffi::BIS_EASE_OUT_QUAD => Self::EaseOutQuad, @@ -368,26 +373,26 @@ impl FromGlib for Easing { ffi::BIS_EASE_OUT_BOUNCE => Self::EaseOutBounce, ffi::BIS_EASE_IN_OUT_BOUNCE => Self::EaseInOutBounce, value => Self::__Unknown(value), - } - } +} +} } impl StaticType for Easing { - #[inline] + #[inline] #[doc(alias = "bis_easing_get_type")] - fn static_type() -> glib::Type { - unsafe { from_glib(ffi::bis_easing_get_type()) } - } -} + fn static_type() -> glib::Type { + unsafe { from_glib(ffi::bis_easing_get_type()) } + } + } impl glib::HasParamSpec for Easing { - 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 - } + 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 Easing { @@ -428,7 +433,8 @@ impl From for glib::Value { } } -#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] #[non_exhaustive] #[doc(alias = "BisFoldThresholdPolicy")] pub enum FoldThresholdPolicy { @@ -436,7 +442,7 @@ pub enum FoldThresholdPolicy { Minimum, #[doc(alias = "BIS_FOLD_THRESHOLD_POLICY_NATURAL")] Natural, - #[doc(hidden)] +#[doc(hidden)] __Unknown(i32), } @@ -445,45 +451,45 @@ impl IntoGlib for FoldThresholdPolicy { type GlibType = ffi::BisFoldThresholdPolicy; #[inline] - fn into_glib(self) -> ffi::BisFoldThresholdPolicy { - match self { +fn into_glib(self) -> ffi::BisFoldThresholdPolicy { +match self { Self::Minimum => ffi::BIS_FOLD_THRESHOLD_POLICY_MINIMUM, Self::Natural => ffi::BIS_FOLD_THRESHOLD_POLICY_NATURAL, Self::__Unknown(value) => value, - } - } +} +} } #[doc(hidden)] impl FromGlib for FoldThresholdPolicy { #[inline] - unsafe fn from_glib(value: ffi::BisFoldThresholdPolicy) -> Self { +unsafe fn from_glib(value: ffi::BisFoldThresholdPolicy) -> Self { skip_assert_initialized!(); - - match value { + +match value { ffi::BIS_FOLD_THRESHOLD_POLICY_MINIMUM => Self::Minimum, ffi::BIS_FOLD_THRESHOLD_POLICY_NATURAL => Self::Natural, value => Self::__Unknown(value), - } - } +} +} } impl StaticType for FoldThresholdPolicy { - #[inline] + #[inline] #[doc(alias = "bis_fold_threshold_policy_get_type")] - fn static_type() -> glib::Type { - unsafe { from_glib(ffi::bis_fold_threshold_policy_get_type()) } - } -} + fn static_type() -> glib::Type { + unsafe { from_glib(ffi::bis_fold_threshold_policy_get_type()) } + } + } impl glib::HasParamSpec for FoldThresholdPolicy { - 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 - } + 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 FoldThresholdPolicy { @@ -524,7 +530,8 @@ impl From for glib::Value { } } -#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] #[non_exhaustive] #[doc(alias = "BisHuggerTransitionType")] pub enum HuggerTransitionType { @@ -532,7 +539,7 @@ pub enum HuggerTransitionType { None, #[doc(alias = "BIS_HUGGER_TRANSITION_TYPE_CROSSFADE")] Crossfade, - #[doc(hidden)] +#[doc(hidden)] __Unknown(i32), } @@ -541,45 +548,45 @@ impl IntoGlib for HuggerTransitionType { type GlibType = ffi::BisHuggerTransitionType; #[inline] - fn into_glib(self) -> ffi::BisHuggerTransitionType { - match self { +fn into_glib(self) -> ffi::BisHuggerTransitionType { +match self { Self::None => ffi::BIS_HUGGER_TRANSITION_TYPE_NONE, Self::Crossfade => ffi::BIS_HUGGER_TRANSITION_TYPE_CROSSFADE, Self::__Unknown(value) => value, - } - } +} +} } #[doc(hidden)] impl FromGlib for HuggerTransitionType { #[inline] - unsafe fn from_glib(value: ffi::BisHuggerTransitionType) -> Self { +unsafe fn from_glib(value: ffi::BisHuggerTransitionType) -> Self { skip_assert_initialized!(); - - match value { + +match value { ffi::BIS_HUGGER_TRANSITION_TYPE_NONE => Self::None, ffi::BIS_HUGGER_TRANSITION_TYPE_CROSSFADE => Self::Crossfade, value => Self::__Unknown(value), - } - } +} +} } impl StaticType for HuggerTransitionType { - #[inline] + #[inline] #[doc(alias = "bis_hugger_transition_type_get_type")] - fn static_type() -> glib::Type { - unsafe { from_glib(ffi::bis_hugger_transition_type_get_type()) } - } -} + fn static_type() -> glib::Type { + unsafe { from_glib(ffi::bis_hugger_transition_type_get_type()) } + } + } impl glib::HasParamSpec for HuggerTransitionType { - 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 - } + 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 HuggerTransitionType { @@ -620,7 +627,8 @@ impl From for glib::Value { } } -#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] #[non_exhaustive] #[doc(alias = "BisLapelFoldPolicy")] pub enum LapelFoldPolicy { @@ -630,7 +638,7 @@ pub enum LapelFoldPolicy { Always, #[doc(alias = "BIS_LAPEL_FOLD_POLICY_AUTO")] Auto, - #[doc(hidden)] +#[doc(hidden)] __Unknown(i32), } @@ -639,47 +647,47 @@ impl IntoGlib for LapelFoldPolicy { type GlibType = ffi::BisLapelFoldPolicy; #[inline] - fn into_glib(self) -> ffi::BisLapelFoldPolicy { - match self { +fn into_glib(self) -> ffi::BisLapelFoldPolicy { +match self { Self::Never => ffi::BIS_LAPEL_FOLD_POLICY_NEVER, Self::Always => ffi::BIS_LAPEL_FOLD_POLICY_ALWAYS, Self::Auto => ffi::BIS_LAPEL_FOLD_POLICY_AUTO, Self::__Unknown(value) => value, - } - } +} +} } #[doc(hidden)] impl FromGlib for LapelFoldPolicy { #[inline] - unsafe fn from_glib(value: ffi::BisLapelFoldPolicy) -> Self { +unsafe fn from_glib(value: ffi::BisLapelFoldPolicy) -> Self { skip_assert_initialized!(); - - match value { + +match value { ffi::BIS_LAPEL_FOLD_POLICY_NEVER => Self::Never, ffi::BIS_LAPEL_FOLD_POLICY_ALWAYS => Self::Always, ffi::BIS_LAPEL_FOLD_POLICY_AUTO => Self::Auto, value => Self::__Unknown(value), - } - } +} +} } impl StaticType for LapelFoldPolicy { - #[inline] + #[inline] #[doc(alias = "bis_lapel_fold_policy_get_type")] - fn static_type() -> glib::Type { - unsafe { from_glib(ffi::bis_lapel_fold_policy_get_type()) } - } -} + fn static_type() -> glib::Type { + unsafe { from_glib(ffi::bis_lapel_fold_policy_get_type()) } + } + } impl glib::HasParamSpec for LapelFoldPolicy { - 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 - } + 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 LapelFoldPolicy { @@ -720,7 +728,8 @@ impl From for glib::Value { } } -#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] #[non_exhaustive] #[doc(alias = "BisLapelTransitionType")] pub enum LapelTransitionType { @@ -730,7 +739,7 @@ pub enum LapelTransitionType { Under, #[doc(alias = "BIS_LAPEL_TRANSITION_TYPE_SLIDE")] Slide, - #[doc(hidden)] +#[doc(hidden)] __Unknown(i32), } @@ -739,47 +748,47 @@ impl IntoGlib for LapelTransitionType { type GlibType = ffi::BisLapelTransitionType; #[inline] - fn into_glib(self) -> ffi::BisLapelTransitionType { - match self { +fn into_glib(self) -> ffi::BisLapelTransitionType { +match self { Self::Over => ffi::BIS_LAPEL_TRANSITION_TYPE_OVER, Self::Under => ffi::BIS_LAPEL_TRANSITION_TYPE_UNDER, Self::Slide => ffi::BIS_LAPEL_TRANSITION_TYPE_SLIDE, Self::__Unknown(value) => value, - } - } +} +} } #[doc(hidden)] impl FromGlib for LapelTransitionType { #[inline] - unsafe fn from_glib(value: ffi::BisLapelTransitionType) -> Self { +unsafe fn from_glib(value: ffi::BisLapelTransitionType) -> Self { skip_assert_initialized!(); - - match value { + +match value { ffi::BIS_LAPEL_TRANSITION_TYPE_OVER => Self::Over, ffi::BIS_LAPEL_TRANSITION_TYPE_UNDER => Self::Under, ffi::BIS_LAPEL_TRANSITION_TYPE_SLIDE => Self::Slide, value => Self::__Unknown(value), - } - } +} +} } impl StaticType for LapelTransitionType { - #[inline] + #[inline] #[doc(alias = "bis_lapel_transition_type_get_type")] - fn static_type() -> glib::Type { - unsafe { from_glib(ffi::bis_lapel_transition_type_get_type()) } - } -} + fn static_type() -> glib::Type { + unsafe { from_glib(ffi::bis_lapel_transition_type_get_type()) } + } + } impl glib::HasParamSpec for LapelTransitionType { - 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 - } + 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 LapelTransitionType { @@ -820,7 +829,8 @@ impl From for glib::Value { } } -#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] #[non_exhaustive] #[doc(alias = "BisNavigationDirection")] pub enum NavigationDirection { @@ -828,7 +838,7 @@ pub enum NavigationDirection { Back, #[doc(alias = "BIS_NAVIGATION_DIRECTION_FORWARD")] Forward, - #[doc(hidden)] +#[doc(hidden)] __Unknown(i32), } @@ -837,45 +847,45 @@ impl IntoGlib for NavigationDirection { type GlibType = ffi::BisNavigationDirection; #[inline] - fn into_glib(self) -> ffi::BisNavigationDirection { - match self { +fn into_glib(self) -> ffi::BisNavigationDirection { +match self { Self::Back => ffi::BIS_NAVIGATION_DIRECTION_BACK, Self::Forward => ffi::BIS_NAVIGATION_DIRECTION_FORWARD, Self::__Unknown(value) => value, - } - } +} +} } #[doc(hidden)] impl FromGlib for NavigationDirection { #[inline] - unsafe fn from_glib(value: ffi::BisNavigationDirection) -> Self { +unsafe fn from_glib(value: ffi::BisNavigationDirection) -> Self { skip_assert_initialized!(); - - match value { + +match value { ffi::BIS_NAVIGATION_DIRECTION_BACK => Self::Back, ffi::BIS_NAVIGATION_DIRECTION_FORWARD => Self::Forward, value => Self::__Unknown(value), - } - } +} +} } impl StaticType for NavigationDirection { - #[inline] + #[inline] #[doc(alias = "bis_navigation_direction_get_type")] - fn static_type() -> glib::Type { - unsafe { from_glib(ffi::bis_navigation_direction_get_type()) } - } -} + fn static_type() -> glib::Type { + unsafe { from_glib(ffi::bis_navigation_direction_get_type()) } + } + } impl glib::HasParamSpec for NavigationDirection { - 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 - } + 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 NavigationDirection { @@ -915,3 +925,4 @@ impl From for glib::Value { ToValue::to_value(&v) } } + diff --git a/libbismuth/src/auto/hugger.rs b/libbismuth/src/auto/hugger.rs index 0d1d733..018aa7a 100644 --- a/libbismuth/src/auto/hugger.rs +++ b/libbismuth/src/auto/hugger.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, FoldThresholdPolicy, HuggerPage, HuggerTransitionType}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,FoldThresholdPolicy,HuggerPage,HuggerTransitionType}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "BisHugger")] @@ -24,24 +20,24 @@ impl Hugger { #[doc(alias = "bis_hugger_new")] pub fn new() -> Hugger { assert_initialized_main_thread!(); - unsafe { gtk::Widget::from_glib_none(ffi::bis_hugger_new()).unsafe_cast() } + unsafe { + gtk::Widget::from_glib_none(ffi::bis_hugger_new()).unsafe_cast() + } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`Hugger`] objects. - /// - /// This method returns an instance of [`HuggerBuilder`](crate::builders::HuggerBuilder) which can be used to create [`Hugger`] objects. - pub fn builder() -> HuggerBuilder { - HuggerBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`Hugger`] objects. + /// + /// This method returns an instance of [`HuggerBuilder`](crate::builders::HuggerBuilder) which can be used to create [`Hugger`] objects. + pub fn builder() -> HuggerBuilder { + HuggerBuilder::new() + } + #[doc(alias = "bis_hugger_add")] pub fn add(&self, child: &impl IsA) -> HuggerPage { unsafe { - from_glib_none(ffi::bis_hugger_add( - self.to_glib_none().0, - child.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::bis_hugger_add(self.to_glib_none().0, child.as_ref().to_glib_none().0)) } } @@ -49,38 +45,43 @@ impl Hugger { #[doc(alias = "get_allow_none")] #[doc(alias = "allow-none")] pub fn allows_none(&self) -> bool { - unsafe { from_glib(ffi::bis_hugger_get_allow_none(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_hugger_get_allow_none(self.to_glib_none().0)) + } } #[doc(alias = "bis_hugger_get_homogeneous")] #[doc(alias = "get_homogeneous")] #[doc(alias = "homogeneous")] pub fn is_homogeneous(&self) -> bool { - unsafe { from_glib(ffi::bis_hugger_get_homogeneous(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_hugger_get_homogeneous(self.to_glib_none().0)) + } } #[doc(alias = "bis_hugger_get_interpolate_size")] #[doc(alias = "get_interpolate_size")] #[doc(alias = "interpolate-size")] pub fn is_interpolate_size(&self) -> bool { - unsafe { from_glib(ffi::bis_hugger_get_interpolate_size(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_hugger_get_interpolate_size(self.to_glib_none().0)) + } } #[doc(alias = "bis_hugger_get_page")] #[doc(alias = "get_page")] pub fn page(&self, child: &impl IsA) -> HuggerPage { unsafe { - from_glib_none(ffi::bis_hugger_get_page( - self.to_glib_none().0, - child.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::bis_hugger_get_page(self.to_glib_none().0, child.as_ref().to_glib_none().0)) } } #[doc(alias = "bis_hugger_get_pages")] #[doc(alias = "get_pages")] pub fn pages(&self) -> gtk::SelectionModel { - unsafe { from_glib_full(ffi::bis_hugger_get_pages(self.to_glib_none().0)) } + unsafe { + from_glib_full(ffi::bis_hugger_get_pages(self.to_glib_none().0)) + } } #[doc(alias = "bis_hugger_get_switch_threshold_policy")] @@ -88,9 +89,7 @@ impl Hugger { #[doc(alias = "switch-threshold-policy")] pub fn switch_threshold_policy(&self) -> FoldThresholdPolicy { unsafe { - from_glib(ffi::bis_hugger_get_switch_threshold_policy( - self.to_glib_none().0, - )) + from_glib(ffi::bis_hugger_get_switch_threshold_policy(self.to_glib_none().0)) } } @@ -98,7 +97,9 @@ impl Hugger { #[doc(alias = "get_transition_duration")] #[doc(alias = "transition-duration")] pub fn transition_duration(&self) -> u32 { - unsafe { ffi::bis_hugger_get_transition_duration(self.to_glib_none().0) } + unsafe { + ffi::bis_hugger_get_transition_duration(self.to_glib_none().0) + } } #[doc(alias = "bis_hugger_get_transition_running")] @@ -106,9 +107,7 @@ impl Hugger { #[doc(alias = "transition-running")] pub fn is_transition_running(&self) -> bool { unsafe { - from_glib(ffi::bis_hugger_get_transition_running( - self.to_glib_none().0, - )) + from_glib(ffi::bis_hugger_get_transition_running(self.to_glib_none().0)) } } @@ -116,26 +115,34 @@ impl Hugger { #[doc(alias = "get_transition_type")] #[doc(alias = "transition-type")] pub fn transition_type(&self) -> HuggerTransitionType { - unsafe { from_glib(ffi::bis_hugger_get_transition_type(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_hugger_get_transition_type(self.to_glib_none().0)) + } } #[doc(alias = "bis_hugger_get_visible_child")] #[doc(alias = "get_visible_child")] #[doc(alias = "visible-child")] pub fn visible_child(&self) -> Option { - unsafe { from_glib_none(ffi::bis_hugger_get_visible_child(self.to_glib_none().0)) } + unsafe { + from_glib_none(ffi::bis_hugger_get_visible_child(self.to_glib_none().0)) + } } #[doc(alias = "bis_hugger_get_xalign")] #[doc(alias = "get_xalign")] pub fn xalign(&self) -> f32 { - unsafe { ffi::bis_hugger_get_xalign(self.to_glib_none().0) } + unsafe { + ffi::bis_hugger_get_xalign(self.to_glib_none().0) + } } #[doc(alias = "bis_hugger_get_yalign")] #[doc(alias = "get_yalign")] pub fn yalign(&self) -> f32 { - unsafe { ffi::bis_hugger_get_yalign(self.to_glib_none().0) } + unsafe { + ffi::bis_hugger_get_yalign(self.to_glib_none().0) + } } #[doc(alias = "bis_hugger_remove")] @@ -165,10 +172,7 @@ impl Hugger { #[doc(alias = "interpolate-size")] pub fn set_interpolate_size(&self, interpolate_size: bool) { unsafe { - ffi::bis_hugger_set_interpolate_size( - self.to_glib_none().0, - interpolate_size.into_glib(), - ); + ffi::bis_hugger_set_interpolate_size(self.to_glib_none().0, interpolate_size.into_glib()); } } @@ -214,523 +218,327 @@ impl Hugger { #[doc(alias = "allow-none")] pub fn connect_allow_none_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_allow_none_trampoline( - this: *mut ffi::BisHugger, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_allow_none_trampoline(this: *mut ffi::BisHugger, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::allow-none\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_allow_none_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::allow-none\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_allow_none_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "homogeneous")] pub fn connect_homogeneous_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_homogeneous_trampoline( - this: *mut ffi::BisHugger, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_homogeneous_trampoline(this: *mut ffi::BisHugger, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::homogeneous\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_homogeneous_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::homogeneous\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_homogeneous_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "interpolate-size")] pub fn connect_interpolate_size_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_interpolate_size_trampoline( - this: *mut ffi::BisHugger, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_interpolate_size_trampoline(this: *mut ffi::BisHugger, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::interpolate-size\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_interpolate_size_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::interpolate-size\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_interpolate_size_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "pages")] pub fn connect_pages_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_pages_trampoline( - this: *mut ffi::BisHugger, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_pages_trampoline(this: *mut ffi::BisHugger, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::pages\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_pages_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::pages\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_pages_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "switch-threshold-policy")] - pub fn connect_switch_threshold_policy_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_switch_threshold_policy_trampoline( - this: *mut ffi::BisHugger, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + pub fn connect_switch_threshold_policy_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_switch_threshold_policy_trampoline(this: *mut ffi::BisHugger, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::switch-threshold-policy\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_switch_threshold_policy_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::switch-threshold-policy\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_switch_threshold_policy_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "transition-duration")] - pub fn connect_transition_duration_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_transition_duration_trampoline( - this: *mut ffi::BisHugger, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + pub fn connect_transition_duration_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_transition_duration_trampoline(this: *mut ffi::BisHugger, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::transition-duration\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_transition_duration_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::transition-duration\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_transition_duration_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "transition-running")] - pub fn connect_transition_running_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_transition_running_trampoline( - this: *mut ffi::BisHugger, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + pub fn connect_transition_running_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_transition_running_trampoline(this: *mut ffi::BisHugger, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::transition-running\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_transition_running_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::transition-running\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_transition_running_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "transition-type")] pub fn connect_transition_type_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_transition_type_trampoline( - this: *mut ffi::BisHugger, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_transition_type_trampoline(this: *mut ffi::BisHugger, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::transition-type\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_transition_type_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::transition-type\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_transition_type_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "visible-child")] pub fn connect_visible_child_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_visible_child_trampoline( - this: *mut ffi::BisHugger, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_visible_child_trampoline(this: *mut ffi::BisHugger, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::visible-child\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_visible_child_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::visible-child\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_visible_child_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "xalign")] pub fn connect_xalign_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_xalign_trampoline( - this: *mut ffi::BisHugger, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_xalign_trampoline(this: *mut ffi::BisHugger, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::xalign\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_xalign_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::xalign\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_xalign_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "yalign")] pub fn connect_yalign_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_yalign_trampoline( - this: *mut ffi::BisHugger, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_yalign_trampoline(this: *mut ffi::BisHugger, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::yalign\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_yalign_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::yalign\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_yalign_trampoline:: as *const ())), Box_::into_raw(f)) } } } impl Default for Hugger { - fn default() -> Self { - Self::new() - } -} + fn default() -> Self { + Self::new() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`Hugger`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`Hugger`] 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 HuggerBuilder { - builder: glib::object::ObjectBuilder<'static, Hugger>, -} - -impl HuggerBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, Hugger>, } - } - pub fn allow_none(self, allow_none: bool) -> Self { - Self { - builder: self.builder.property("allow-none", allow_none), + impl HuggerBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn homogeneous(self, homogeneous: bool) -> Self { - Self { - builder: self.builder.property("homogeneous", homogeneous), - } - } + pub fn allow_none(self, allow_none: bool) -> Self { + Self { builder: self.builder.property("allow-none", allow_none), } + } - pub fn interpolate_size(self, interpolate_size: bool) -> Self { - Self { - builder: self.builder.property("interpolate-size", interpolate_size), - } - } + pub fn homogeneous(self, homogeneous: bool) -> Self { + Self { builder: self.builder.property("homogeneous", homogeneous), } + } - pub fn switch_threshold_policy(self, switch_threshold_policy: FoldThresholdPolicy) -> Self { - Self { - builder: self - .builder - .property("switch-threshold-policy", switch_threshold_policy), - } - } + pub fn interpolate_size(self, interpolate_size: bool) -> Self { + Self { builder: self.builder.property("interpolate-size", interpolate_size), } + } - pub fn transition_duration(self, transition_duration: u32) -> Self { - Self { - builder: self - .builder - .property("transition-duration", transition_duration), - } - } + pub fn switch_threshold_policy(self, switch_threshold_policy: FoldThresholdPolicy) -> Self { + Self { builder: self.builder.property("switch-threshold-policy", switch_threshold_policy), } + } - pub fn transition_type(self, transition_type: HuggerTransitionType) -> Self { - Self { - builder: self.builder.property("transition-type", transition_type), - } - } + pub fn transition_duration(self, transition_duration: u32) -> Self { + Self { builder: self.builder.property("transition-duration", transition_duration), } + } - pub fn xalign(self, xalign: f32) -> Self { - Self { - builder: self.builder.property("xalign", xalign), - } - } + pub fn transition_type(self, transition_type: HuggerTransitionType) -> Self { + Self { builder: self.builder.property("transition-type", transition_type), } + } - pub fn yalign(self, yalign: f32) -> Self { - Self { - builder: self.builder.property("yalign", yalign), - } - } + pub fn xalign(self, xalign: f32) -> Self { + Self { builder: self.builder.property("xalign", xalign), } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { - builder: self.builder.property("can-focus", can_focus), - } - } + pub fn yalign(self, yalign: f32) -> Self { + Self { builder: self.builder.property("yalign", yalign), } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { - builder: self.builder.property("can-target", can_target), - } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { builder: self.builder.property("can-focus", can_focus), } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { - builder: self.builder.property("css-classes", css_classes.into()), - } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { builder: self.builder.property("can-target", can_target), } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { - builder: self.builder.property("css-name", css_name.into()), - } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { builder: self.builder.property("css-classes", css_classes.into()), } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + pub fn css_name(self, css_name: impl Into) -> Self { + Self { builder: self.builder.property("css-name", css_name.into()), } + } - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { - builder: self.builder.property("focus-on-click", focus_on_click), - } - } + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focusable(self, focusable: bool) -> Self { - Self { - builder: self.builder.property("focusable", focusable), - } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { builder: self.builder.property("focus-on-click", focus_on_click), } + } - //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { - // Self { builder: self.builder.property("halign", halign), } - //} + pub fn focusable(self, focusable: bool) -> Self { + Self { builder: self.builder.property("focusable", focusable), } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { - builder: self.builder.property("has-tooltip", has_tooltip), - } - } + //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { + // Self { builder: self.builder.property("halign", halign), } + //} - pub fn height_request(self, height_request: i32) -> Self { - Self { - builder: self.builder.property("height-request", height_request), - } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { builder: self.builder.property("has-tooltip", has_tooltip), } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { - builder: self.builder.property("hexpand", hexpand), - } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { builder: self.builder.property("height-request", height_request), } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { - builder: self.builder.property("hexpand-set", hexpand_set), - } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { builder: self.builder.property("hexpand", hexpand), } + } - pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("layout-manager", layout_manager.clone().upcast()), - } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { builder: self.builder.property("hexpand-set", hexpand_set), } + } - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { - builder: self.builder.property("margin-bottom", margin_bottom), - } - } + pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { - builder: self.builder.property("margin-end", margin_end), - } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { builder: self.builder.property("margin-bottom", margin_bottom), } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { - builder: self.builder.property("margin-start", margin_start), - } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { builder: self.builder.property("margin-end", margin_end), } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { - builder: self.builder.property("margin-top", margin_top), - } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { builder: self.builder.property("margin-start", margin_start), } + } - pub fn name(self, name: impl Into) -> Self { - Self { - builder: self.builder.property("name", name.into()), - } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { builder: self.builder.property("margin-top", margin_top), } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { - builder: self.builder.property("opacity", opacity), - } - } + pub fn name(self, name: impl Into) -> Self { + Self { builder: self.builder.property("name", name.into()), } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + pub fn opacity(self, opacity: f64) -> Self { + Self { builder: self.builder.property("opacity", opacity), } + } - pub fn receives_default(self, receives_default: bool) -> Self { - Self { - builder: self.builder.property("receives-default", receives_default), - } - } + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn sensitive(self, sensitive: bool) -> Self { - Self { - builder: self.builder.property("sensitive", sensitive), - } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { builder: self.builder.property("receives-default", receives_default), } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { - builder: self - .builder - .property("tooltip-markup", tooltip_markup.into()), - } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { builder: self.builder.property("sensitive", sensitive), } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { - builder: self.builder.property("tooltip-text", tooltip_text.into()), - } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } + } - //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { - // Self { builder: self.builder.property("valign", valign), } - //} + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { - builder: self.builder.property("vexpand", vexpand), - } - } + //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { + // Self { builder: self.builder.property("valign", valign), } + //} - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { - builder: self.builder.property("vexpand-set", vexpand_set), - } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { builder: self.builder.property("vexpand", vexpand), } + } - pub fn visible(self, visible: bool) -> Self { - Self { - builder: self.builder.property("visible", visible), - } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { builder: self.builder.property("vexpand-set", vexpand_set), } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { - builder: self.builder.property("width-request", width_request), - } - } + pub fn visible(self, visible: bool) -> Self { + Self { builder: self.builder.property("visible", visible), } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + pub fn width_request(self, width_request: i32) -> Self { + Self { builder: self.builder.property("width-request", width_request), } + } - //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { - // Self { builder: self.builder.property("orientation", orientation), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} + + //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { + // Self { builder: self.builder.property("orientation", orientation), } + //} // rustdoc-stripper-ignore-next /// Build the [`Hugger`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Hugger { - self.builder.build() - } + self.builder.build() } } diff --git a/libbismuth/src/auto/hugger_page.rs b/libbismuth/src/auto/hugger_page.rs index ef3376e..193932a 100644 --- a/libbismuth/src/auto/hugger_page.rs +++ b/libbismuth/src/auto/hugger_page.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::ffi; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "BisHuggerPage")] @@ -21,25 +17,30 @@ glib::wrapper! { } impl HuggerPage { - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`HuggerPage`] objects. - /// - /// This method returns an instance of [`HuggerPageBuilder`](crate::builders::HuggerPageBuilder) which can be used to create [`HuggerPage`] objects. - pub fn builder() -> HuggerPageBuilder { - HuggerPageBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`HuggerPage`] objects. + /// + /// This method returns an instance of [`HuggerPageBuilder`](crate::builders::HuggerPageBuilder) which can be used to create [`HuggerPage`] objects. + pub fn builder() -> HuggerPageBuilder { + HuggerPageBuilder::new() + } + #[doc(alias = "bis_hugger_page_get_child")] #[doc(alias = "get_child")] pub fn child(&self) -> gtk::Widget { - unsafe { from_glib_none(ffi::bis_hugger_page_get_child(self.to_glib_none().0)) } + unsafe { + from_glib_none(ffi::bis_hugger_page_get_child(self.to_glib_none().0)) + } } #[doc(alias = "bis_hugger_page_get_enabled")] #[doc(alias = "get_enabled")] #[doc(alias = "enabled")] pub fn is_enabled(&self) -> bool { - unsafe { from_glib(ffi::bis_hugger_page_get_enabled(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_hugger_page_get_enabled(self.to_glib_none().0)) + } } #[doc(alias = "bis_hugger_page_set_enabled")] @@ -52,60 +53,43 @@ impl HuggerPage { #[doc(alias = "enabled")] pub fn connect_enabled_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_enabled_trampoline( - this: *mut ffi::BisHuggerPage, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_enabled_trampoline(this: *mut ffi::BisHuggerPage, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::enabled\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_enabled_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::enabled\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_enabled_trampoline:: as *const ())), Box_::into_raw(f)) } } } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`HuggerPage`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`HuggerPage`] 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 HuggerPageBuilder { - builder: glib::object::ObjectBuilder<'static, HuggerPage>, -} - -impl HuggerPageBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, HuggerPage>, } - } - pub fn child(self, child: &impl IsA) -> Self { - Self { - builder: self.builder.property("child", child.clone().upcast()), + impl HuggerPageBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn enabled(self, enabled: bool) -> Self { - Self { - builder: self.builder.property("enabled", enabled), - } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { builder: self.builder.property("child", child.clone().upcast()), } + } + + pub fn enabled(self, enabled: bool) -> Self { + Self { builder: self.builder.property("enabled", enabled), } + } // rustdoc-stripper-ignore-next /// Build the [`HuggerPage`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> HuggerPage { - self.builder.build() - } + self.builder.build() } } diff --git a/libbismuth/src/auto/lapel.rs b/libbismuth/src/auto/lapel.rs index 9436771..22e499d 100644 --- a/libbismuth/src/auto/lapel.rs +++ b/libbismuth/src/auto/lapel.rs @@ -1,17 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ - ffi, FoldThresholdPolicy, LapelFoldPolicy, LapelTransitionType, SpringParams, Swipeable, -}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,FoldThresholdPolicy,LapelFoldPolicy,LapelTransitionType,SpringParams,Swipeable}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "BisLapel")] @@ -26,35 +20,44 @@ impl Lapel { #[doc(alias = "bis_lapel_new")] pub fn new() -> Lapel { assert_initialized_main_thread!(); - unsafe { gtk::Widget::from_glib_none(ffi::bis_lapel_new()).unsafe_cast() } + unsafe { + gtk::Widget::from_glib_none(ffi::bis_lapel_new()).unsafe_cast() + } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`Lapel`] objects. - /// - /// This method returns an instance of [`LapelBuilder`](crate::builders::LapelBuilder) which can be used to create [`Lapel`] objects. - pub fn builder() -> LapelBuilder { - LapelBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`Lapel`] objects. + /// + /// This method returns an instance of [`LapelBuilder`](crate::builders::LapelBuilder) which can be used to create [`Lapel`] objects. + pub fn builder() -> LapelBuilder { + LapelBuilder::new() + } + #[doc(alias = "bis_lapel_get_content")] #[doc(alias = "get_content")] pub fn content(&self) -> Option { - unsafe { from_glib_none(ffi::bis_lapel_get_content(self.to_glib_none().0)) } + unsafe { + from_glib_none(ffi::bis_lapel_get_content(self.to_glib_none().0)) + } } #[doc(alias = "bis_lapel_get_fold_duration")] #[doc(alias = "get_fold_duration")] #[doc(alias = "fold-duration")] pub fn fold_duration(&self) -> u32 { - unsafe { ffi::bis_lapel_get_fold_duration(self.to_glib_none().0) } + unsafe { + ffi::bis_lapel_get_fold_duration(self.to_glib_none().0) + } } #[doc(alias = "bis_lapel_get_fold_policy")] #[doc(alias = "get_fold_policy")] #[doc(alias = "fold-policy")] pub fn fold_policy(&self) -> LapelFoldPolicy { - unsafe { from_glib(ffi::bis_lapel_get_fold_policy(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_lapel_get_fold_policy(self.to_glib_none().0)) + } } #[doc(alias = "bis_lapel_get_fold_threshold_policy")] @@ -62,9 +65,7 @@ impl Lapel { #[doc(alias = "fold-threshold-policy")] pub fn fold_threshold_policy(&self) -> FoldThresholdPolicy { unsafe { - from_glib(ffi::bis_lapel_get_fold_threshold_policy( - self.to_glib_none().0, - )) + from_glib(ffi::bis_lapel_get_fold_threshold_policy(self.to_glib_none().0)) } } @@ -72,92 +73,113 @@ impl Lapel { #[doc(alias = "get_folded")] #[doc(alias = "folded")] pub fn is_folded(&self) -> bool { - unsafe { from_glib(ffi::bis_lapel_get_folded(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_lapel_get_folded(self.to_glib_none().0)) + } } #[doc(alias = "bis_lapel_get_lapel")] #[doc(alias = "get_lapel")] pub fn lapel(&self) -> Option { - unsafe { from_glib_none(ffi::bis_lapel_get_lapel(self.to_glib_none().0)) } + unsafe { + from_glib_none(ffi::bis_lapel_get_lapel(self.to_glib_none().0)) + } } #[doc(alias = "bis_lapel_get_lapel_position")] #[doc(alias = "get_lapel_position")] #[doc(alias = "lapel-position")] pub fn lapel_position(&self) -> gtk::PackType { - unsafe { from_glib(ffi::bis_lapel_get_lapel_position(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_lapel_get_lapel_position(self.to_glib_none().0)) + } } #[doc(alias = "bis_lapel_get_locked")] #[doc(alias = "get_locked")] #[doc(alias = "locked")] pub fn is_locked(&self) -> bool { - unsafe { from_glib(ffi::bis_lapel_get_locked(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_lapel_get_locked(self.to_glib_none().0)) + } } #[doc(alias = "bis_lapel_get_modal")] #[doc(alias = "get_modal")] #[doc(alias = "modal")] pub fn is_modal(&self) -> bool { - unsafe { from_glib(ffi::bis_lapel_get_modal(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_lapel_get_modal(self.to_glib_none().0)) + } } #[doc(alias = "bis_lapel_get_reveal_lapel")] #[doc(alias = "get_reveal_lapel")] #[doc(alias = "reveal-lapel")] pub fn reveals_lapel(&self) -> bool { - unsafe { from_glib(ffi::bis_lapel_get_reveal_lapel(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_lapel_get_reveal_lapel(self.to_glib_none().0)) + } } #[doc(alias = "bis_lapel_get_reveal_params")] #[doc(alias = "get_reveal_params")] #[doc(alias = "reveal-params")] pub fn reveal_params(&self) -> SpringParams { - unsafe { from_glib_full(ffi::bis_lapel_get_reveal_params(self.to_glib_none().0)) } + unsafe { + from_glib_full(ffi::bis_lapel_get_reveal_params(self.to_glib_none().0)) + } } #[doc(alias = "bis_lapel_get_reveal_progress")] #[doc(alias = "get_reveal_progress")] #[doc(alias = "reveal-progress")] pub fn reveal_progress(&self) -> f64 { - unsafe { ffi::bis_lapel_get_reveal_progress(self.to_glib_none().0) } + unsafe { + ffi::bis_lapel_get_reveal_progress(self.to_glib_none().0) + } } #[doc(alias = "bis_lapel_get_separator")] #[doc(alias = "get_separator")] pub fn separator(&self) -> Option { - unsafe { from_glib_none(ffi::bis_lapel_get_separator(self.to_glib_none().0)) } + unsafe { + from_glib_none(ffi::bis_lapel_get_separator(self.to_glib_none().0)) + } } #[doc(alias = "bis_lapel_get_swipe_to_close")] #[doc(alias = "get_swipe_to_close")] #[doc(alias = "swipe-to-close")] pub fn is_swipe_to_close(&self) -> bool { - unsafe { from_glib(ffi::bis_lapel_get_swipe_to_close(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_lapel_get_swipe_to_close(self.to_glib_none().0)) + } } #[doc(alias = "bis_lapel_get_swipe_to_open")] #[doc(alias = "get_swipe_to_open")] #[doc(alias = "swipe-to-open")] pub fn is_swipe_to_open(&self) -> bool { - unsafe { from_glib(ffi::bis_lapel_get_swipe_to_open(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_lapel_get_swipe_to_open(self.to_glib_none().0)) + } } #[doc(alias = "bis_lapel_get_transition_type")] #[doc(alias = "get_transition_type")] #[doc(alias = "transition-type")] pub fn transition_type(&self) -> LapelTransitionType { - unsafe { from_glib(ffi::bis_lapel_get_transition_type(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_lapel_get_transition_type(self.to_glib_none().0)) + } } #[doc(alias = "bis_lapel_set_content")] #[doc(alias = "content")] pub fn set_content(&self, content: Option<&impl IsA>) { unsafe { - ffi::bis_lapel_set_content( - self.to_glib_none().0, - content.map(|p| p.as_ref()).to_glib_none().0, - ); + ffi::bis_lapel_set_content(self.to_glib_none().0, content.map(|p| p.as_ref()).to_glib_none().0); } } @@ -189,10 +211,7 @@ impl Lapel { #[doc(alias = "lapel")] pub fn set_lapel(&self, lapel: Option<&impl IsA>) { unsafe { - ffi::bis_lapel_set_lapel( - self.to_glib_none().0, - lapel.map(|p| p.as_ref()).to_glib_none().0, - ); + ffi::bis_lapel_set_lapel(self.to_glib_none().0, lapel.map(|p| p.as_ref()).to_glib_none().0); } } @@ -240,10 +259,7 @@ impl Lapel { #[doc(alias = "separator")] pub fn set_separator(&self, separator: Option<&impl IsA>) { unsafe { - ffi::bis_lapel_set_separator( - self.to_glib_none().0, - separator.map(|p| p.as_ref()).to_glib_none().0, - ); + ffi::bis_lapel_set_separator(self.to_glib_none().0, separator.map(|p| p.as_ref()).to_glib_none().0); } } @@ -273,670 +289,416 @@ impl Lapel { #[doc(alias = "content")] pub fn connect_content_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_content_trampoline( - this: *mut ffi::BisLapel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_content_trampoline(this: *mut ffi::BisLapel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::content\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_content_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::content\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_content_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "fold-duration")] pub fn connect_fold_duration_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_fold_duration_trampoline( - this: *mut ffi::BisLapel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_fold_duration_trampoline(this: *mut ffi::BisLapel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::fold-duration\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_fold_duration_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::fold-duration\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_fold_duration_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "fold-policy")] pub fn connect_fold_policy_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_fold_policy_trampoline( - this: *mut ffi::BisLapel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_fold_policy_trampoline(this: *mut ffi::BisLapel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::fold-policy\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_fold_policy_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::fold-policy\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_fold_policy_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "fold-threshold-policy")] - pub fn connect_fold_threshold_policy_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_fold_threshold_policy_trampoline( - this: *mut ffi::BisLapel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + pub fn connect_fold_threshold_policy_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_fold_threshold_policy_trampoline(this: *mut ffi::BisLapel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::fold-threshold-policy\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_fold_threshold_policy_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::fold-threshold-policy\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_fold_threshold_policy_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "folded")] pub fn connect_folded_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_folded_trampoline( - this: *mut ffi::BisLapel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_folded_trampoline(this: *mut ffi::BisLapel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::folded\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_folded_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::folded\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_folded_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "lapel")] pub fn connect_lapel_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_lapel_trampoline( - this: *mut ffi::BisLapel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_lapel_trampoline(this: *mut ffi::BisLapel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::lapel\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_lapel_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::lapel\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_lapel_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "lapel-position")] pub fn connect_lapel_position_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_lapel_position_trampoline( - this: *mut ffi::BisLapel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_lapel_position_trampoline(this: *mut ffi::BisLapel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::lapel-position\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_lapel_position_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::lapel-position\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_lapel_position_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "locked")] pub fn connect_locked_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_locked_trampoline( - this: *mut ffi::BisLapel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_locked_trampoline(this: *mut ffi::BisLapel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::locked\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_locked_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::locked\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_locked_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "modal")] pub fn connect_modal_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_modal_trampoline( - this: *mut ffi::BisLapel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_modal_trampoline(this: *mut ffi::BisLapel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::modal\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_modal_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::modal\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_modal_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "reveal-lapel")] pub fn connect_reveal_lapel_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_reveal_lapel_trampoline( - this: *mut ffi::BisLapel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_reveal_lapel_trampoline(this: *mut ffi::BisLapel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::reveal-lapel\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_reveal_lapel_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::reveal-lapel\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_reveal_lapel_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "reveal-params")] pub fn connect_reveal_params_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_reveal_params_trampoline( - this: *mut ffi::BisLapel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_reveal_params_trampoline(this: *mut ffi::BisLapel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::reveal-params\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_reveal_params_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::reveal-params\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_reveal_params_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "reveal-progress")] pub fn connect_reveal_progress_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_reveal_progress_trampoline( - this: *mut ffi::BisLapel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_reveal_progress_trampoline(this: *mut ffi::BisLapel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::reveal-progress\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_reveal_progress_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::reveal-progress\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_reveal_progress_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "separator")] pub fn connect_separator_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_separator_trampoline( - this: *mut ffi::BisLapel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_separator_trampoline(this: *mut ffi::BisLapel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::separator\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_separator_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::separator\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_separator_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "swipe-to-close")] pub fn connect_swipe_to_close_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_swipe_to_close_trampoline( - this: *mut ffi::BisLapel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_swipe_to_close_trampoline(this: *mut ffi::BisLapel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::swipe-to-close\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_swipe_to_close_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::swipe-to-close\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_swipe_to_close_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "swipe-to-open")] pub fn connect_swipe_to_open_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_swipe_to_open_trampoline( - this: *mut ffi::BisLapel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_swipe_to_open_trampoline(this: *mut ffi::BisLapel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::swipe-to-open\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_swipe_to_open_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::swipe-to-open\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_swipe_to_open_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "transition-type")] pub fn connect_transition_type_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_transition_type_trampoline( - this: *mut ffi::BisLapel, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_transition_type_trampoline(this: *mut ffi::BisLapel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::transition-type\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_transition_type_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::transition-type\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_transition_type_trampoline:: as *const ())), Box_::into_raw(f)) } } } impl Default for Lapel { - fn default() -> Self { - Self::new() - } -} + fn default() -> Self { + Self::new() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`Lapel`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`Lapel`] 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 LapelBuilder { - builder: glib::object::ObjectBuilder<'static, Lapel>, -} - -impl LapelBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, Lapel>, } - } - pub fn content(self, content: &impl IsA) -> Self { - Self { - builder: self.builder.property("content", content.clone().upcast()), + impl LapelBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn fold_duration(self, fold_duration: u32) -> Self { - Self { - builder: self.builder.property("fold-duration", fold_duration), - } - } + pub fn content(self, content: &impl IsA) -> Self { + Self { builder: self.builder.property("content", content.clone().upcast()), } + } - pub fn fold_policy(self, fold_policy: LapelFoldPolicy) -> Self { - Self { - builder: self.builder.property("fold-policy", fold_policy), - } - } + pub fn fold_duration(self, fold_duration: u32) -> Self { + Self { builder: self.builder.property("fold-duration", fold_duration), } + } - pub fn fold_threshold_policy(self, fold_threshold_policy: FoldThresholdPolicy) -> Self { - Self { - builder: self - .builder - .property("fold-threshold-policy", fold_threshold_policy), - } - } + pub fn fold_policy(self, fold_policy: LapelFoldPolicy) -> Self { + Self { builder: self.builder.property("fold-policy", fold_policy), } + } - pub fn lapel(self, lapel: &impl IsA) -> Self { - Self { - builder: self.builder.property("lapel", lapel.clone().upcast()), - } - } + pub fn fold_threshold_policy(self, fold_threshold_policy: FoldThresholdPolicy) -> Self { + Self { builder: self.builder.property("fold-threshold-policy", fold_threshold_policy), } + } - pub fn lapel_position(self, lapel_position: gtk::PackType) -> Self { - Self { - builder: self.builder.property("lapel-position", lapel_position), - } - } + pub fn lapel(self, lapel: &impl IsA) -> Self { + Self { builder: self.builder.property("lapel", lapel.clone().upcast()), } + } - pub fn locked(self, locked: bool) -> Self { - Self { - builder: self.builder.property("locked", locked), - } - } + pub fn lapel_position(self, lapel_position: gtk::PackType) -> Self { + Self { builder: self.builder.property("lapel-position", lapel_position), } + } - pub fn modal(self, modal: bool) -> Self { - Self { - builder: self.builder.property("modal", modal), - } - } + pub fn locked(self, locked: bool) -> Self { + Self { builder: self.builder.property("locked", locked), } + } - pub fn reveal_lapel(self, reveal_lapel: bool) -> Self { - Self { - builder: self.builder.property("reveal-lapel", reveal_lapel), - } - } + pub fn modal(self, modal: bool) -> Self { + Self { builder: self.builder.property("modal", modal), } + } - pub fn reveal_params(self, reveal_params: &SpringParams) -> Self { - Self { - builder: self - .builder - .property("reveal-params", reveal_params.clone()), - } - } + pub fn reveal_lapel(self, reveal_lapel: bool) -> Self { + Self { builder: self.builder.property("reveal-lapel", reveal_lapel), } + } - pub fn separator(self, separator: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("separator", separator.clone().upcast()), - } - } + pub fn reveal_params(self, reveal_params: &SpringParams) -> Self { + Self { builder: self.builder.property("reveal-params", reveal_params.clone()), } + } - pub fn swipe_to_close(self, swipe_to_close: bool) -> Self { - Self { - builder: self.builder.property("swipe-to-close", swipe_to_close), - } - } + pub fn separator(self, separator: &impl IsA) -> Self { + Self { builder: self.builder.property("separator", separator.clone().upcast()), } + } - pub fn swipe_to_open(self, swipe_to_open: bool) -> Self { - Self { - builder: self.builder.property("swipe-to-open", swipe_to_open), - } - } + pub fn swipe_to_close(self, swipe_to_close: bool) -> Self { + Self { builder: self.builder.property("swipe-to-close", swipe_to_close), } + } - pub fn transition_type(self, transition_type: LapelTransitionType) -> Self { - Self { - builder: self.builder.property("transition-type", transition_type), - } - } + pub fn swipe_to_open(self, swipe_to_open: bool) -> Self { + Self { builder: self.builder.property("swipe-to-open", swipe_to_open), } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { - builder: self.builder.property("can-focus", can_focus), - } - } + pub fn transition_type(self, transition_type: LapelTransitionType) -> Self { + Self { builder: self.builder.property("transition-type", transition_type), } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { - builder: self.builder.property("can-target", can_target), - } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { builder: self.builder.property("can-focus", can_focus), } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { - builder: self.builder.property("css-classes", css_classes.into()), - } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { builder: self.builder.property("can-target", can_target), } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { - builder: self.builder.property("css-name", css_name.into()), - } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { builder: self.builder.property("css-classes", css_classes.into()), } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + pub fn css_name(self, css_name: impl Into) -> Self { + Self { builder: self.builder.property("css-name", css_name.into()), } + } - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { - builder: self.builder.property("focus-on-click", focus_on_click), - } - } + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focusable(self, focusable: bool) -> Self { - Self { - builder: self.builder.property("focusable", focusable), - } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { builder: self.builder.property("focus-on-click", focus_on_click), } + } - //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { - // Self { builder: self.builder.property("halign", halign), } - //} + pub fn focusable(self, focusable: bool) -> Self { + Self { builder: self.builder.property("focusable", focusable), } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { - builder: self.builder.property("has-tooltip", has_tooltip), - } - } + //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { + // Self { builder: self.builder.property("halign", halign), } + //} - pub fn height_request(self, height_request: i32) -> Self { - Self { - builder: self.builder.property("height-request", height_request), - } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { builder: self.builder.property("has-tooltip", has_tooltip), } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { - builder: self.builder.property("hexpand", hexpand), - } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { builder: self.builder.property("height-request", height_request), } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { - builder: self.builder.property("hexpand-set", hexpand_set), - } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { builder: self.builder.property("hexpand", hexpand), } + } - pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("layout-manager", layout_manager.clone().upcast()), - } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { builder: self.builder.property("hexpand-set", hexpand_set), } + } - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { - builder: self.builder.property("margin-bottom", margin_bottom), - } - } + pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { - builder: self.builder.property("margin-end", margin_end), - } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { builder: self.builder.property("margin-bottom", margin_bottom), } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { - builder: self.builder.property("margin-start", margin_start), - } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { builder: self.builder.property("margin-end", margin_end), } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { - builder: self.builder.property("margin-top", margin_top), - } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { builder: self.builder.property("margin-start", margin_start), } + } - pub fn name(self, name: impl Into) -> Self { - Self { - builder: self.builder.property("name", name.into()), - } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { builder: self.builder.property("margin-top", margin_top), } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { - builder: self.builder.property("opacity", opacity), - } - } + pub fn name(self, name: impl Into) -> Self { + Self { builder: self.builder.property("name", name.into()), } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + pub fn opacity(self, opacity: f64) -> Self { + Self { builder: self.builder.property("opacity", opacity), } + } - pub fn receives_default(self, receives_default: bool) -> Self { - Self { - builder: self.builder.property("receives-default", receives_default), - } - } + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn sensitive(self, sensitive: bool) -> Self { - Self { - builder: self.builder.property("sensitive", sensitive), - } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { builder: self.builder.property("receives-default", receives_default), } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { - builder: self - .builder - .property("tooltip-markup", tooltip_markup.into()), - } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { builder: self.builder.property("sensitive", sensitive), } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { - builder: self.builder.property("tooltip-text", tooltip_text.into()), - } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } + } - //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { - // Self { builder: self.builder.property("valign", valign), } - //} + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { - builder: self.builder.property("vexpand", vexpand), - } - } + //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { + // Self { builder: self.builder.property("valign", valign), } + //} - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { - builder: self.builder.property("vexpand-set", vexpand_set), - } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { builder: self.builder.property("vexpand", vexpand), } + } - pub fn visible(self, visible: bool) -> Self { - Self { - builder: self.builder.property("visible", visible), - } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { builder: self.builder.property("vexpand-set", vexpand_set), } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { - builder: self.builder.property("width-request", width_request), - } - } + pub fn visible(self, visible: bool) -> Self { + Self { builder: self.builder.property("visible", visible), } + } + + pub fn width_request(self, width_request: i32) -> Self { + Self { builder: self.builder.property("width-request", width_request), } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} - //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { - // Self { builder: self.builder.property("orientation", orientation), } - //} + //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { + // Self { builder: self.builder.property("orientation", orientation), } + //} // rustdoc-stripper-ignore-next /// Build the [`Lapel`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Lapel { - self.builder.build() - } + self.builder.build() } } diff --git a/libbismuth/src/auto/latch.rs b/libbismuth/src/auto/latch.rs index c398130..bacb361 100644 --- a/libbismuth/src/auto/latch.rs +++ b/libbismuth/src/auto/latch.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::ffi; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "BisLatch")] @@ -24,45 +20,51 @@ impl Latch { #[doc(alias = "bis_latch_new")] pub fn new() -> Latch { assert_initialized_main_thread!(); - unsafe { gtk::Widget::from_glib_none(ffi::bis_latch_new()).unsafe_cast() } + unsafe { + gtk::Widget::from_glib_none(ffi::bis_latch_new()).unsafe_cast() + } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`Latch`] objects. - /// - /// This method returns an instance of [`LatchBuilder`](crate::builders::LatchBuilder) which can be used to create [`Latch`] objects. - pub fn builder() -> LatchBuilder { - LatchBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`Latch`] objects. + /// + /// This method returns an instance of [`LatchBuilder`](crate::builders::LatchBuilder) which can be used to create [`Latch`] objects. + pub fn builder() -> LatchBuilder { + LatchBuilder::new() + } + #[doc(alias = "bis_latch_get_child")] #[doc(alias = "get_child")] pub fn child(&self) -> Option { - unsafe { from_glib_none(ffi::bis_latch_get_child(self.to_glib_none().0)) } + unsafe { + from_glib_none(ffi::bis_latch_get_child(self.to_glib_none().0)) + } } #[doc(alias = "bis_latch_get_maximum_size")] #[doc(alias = "get_maximum_size")] #[doc(alias = "maximum-size")] pub fn maximum_size(&self) -> i32 { - unsafe { ffi::bis_latch_get_maximum_size(self.to_glib_none().0) } + unsafe { + ffi::bis_latch_get_maximum_size(self.to_glib_none().0) + } } #[doc(alias = "bis_latch_get_tightening_threshold")] #[doc(alias = "get_tightening_threshold")] #[doc(alias = "tightening-threshold")] pub fn tightening_threshold(&self) -> i32 { - unsafe { ffi::bis_latch_get_tightening_threshold(self.to_glib_none().0) } + unsafe { + ffi::bis_latch_get_tightening_threshold(self.to_glib_none().0) + } } #[doc(alias = "bis_latch_set_child")] #[doc(alias = "child")] pub fn set_child(&self, child: Option<&impl IsA>) { unsafe { - ffi::bis_latch_set_child( - self.to_glib_none().0, - child.map(|p| p.as_ref()).to_glib_none().0, - ); + ffi::bis_latch_set_child(self.to_glib_none().0, child.map(|p| p.as_ref()).to_glib_none().0); } } @@ -84,301 +86,203 @@ impl Latch { #[doc(alias = "child")] pub fn connect_child_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_child_trampoline( - this: *mut ffi::BisLatch, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_child_trampoline(this: *mut ffi::BisLatch, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::child\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_child_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::child\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_child_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "maximum-size")] pub fn connect_maximum_size_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_maximum_size_trampoline( - this: *mut ffi::BisLatch, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_maximum_size_trampoline(this: *mut ffi::BisLatch, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::maximum-size\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_maximum_size_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::maximum-size\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_maximum_size_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "tightening-threshold")] - pub fn connect_tightening_threshold_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_tightening_threshold_trampoline( - this: *mut ffi::BisLatch, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + pub fn connect_tightening_threshold_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_tightening_threshold_trampoline(this: *mut ffi::BisLatch, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::tightening-threshold\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_tightening_threshold_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::tightening-threshold\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_tightening_threshold_trampoline:: as *const ())), Box_::into_raw(f)) } } } impl Default for Latch { - fn default() -> Self { - Self::new() - } -} + fn default() -> Self { + Self::new() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`Latch`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`Latch`] 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 LatchBuilder { - builder: glib::object::ObjectBuilder<'static, Latch>, -} - -impl LatchBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, Latch>, } - } - pub fn child(self, child: &impl IsA) -> Self { - Self { - builder: self.builder.property("child", child.clone().upcast()), + impl LatchBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn maximum_size(self, maximum_size: i32) -> Self { - Self { - builder: self.builder.property("maximum-size", maximum_size), - } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { builder: self.builder.property("child", child.clone().upcast()), } + } - pub fn tightening_threshold(self, tightening_threshold: i32) -> Self { - Self { - builder: self - .builder - .property("tightening-threshold", tightening_threshold), - } - } + pub fn maximum_size(self, maximum_size: i32) -> Self { + Self { builder: self.builder.property("maximum-size", maximum_size), } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { - builder: self.builder.property("can-focus", can_focus), - } - } + pub fn tightening_threshold(self, tightening_threshold: i32) -> Self { + Self { builder: self.builder.property("tightening-threshold", tightening_threshold), } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { - builder: self.builder.property("can-target", can_target), - } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { builder: self.builder.property("can-focus", can_focus), } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { - builder: self.builder.property("css-classes", css_classes.into()), - } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { builder: self.builder.property("can-target", can_target), } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { - builder: self.builder.property("css-name", css_name.into()), - } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { builder: self.builder.property("css-classes", css_classes.into()), } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + pub fn css_name(self, css_name: impl Into) -> Self { + Self { builder: self.builder.property("css-name", css_name.into()), } + } - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { - builder: self.builder.property("focus-on-click", focus_on_click), - } - } + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focusable(self, focusable: bool) -> Self { - Self { - builder: self.builder.property("focusable", focusable), - } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { builder: self.builder.property("focus-on-click", focus_on_click), } + } - //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { - // Self { builder: self.builder.property("halign", halign), } - //} + pub fn focusable(self, focusable: bool) -> Self { + Self { builder: self.builder.property("focusable", focusable), } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { - builder: self.builder.property("has-tooltip", has_tooltip), - } - } + //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { + // Self { builder: self.builder.property("halign", halign), } + //} - pub fn height_request(self, height_request: i32) -> Self { - Self { - builder: self.builder.property("height-request", height_request), - } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { builder: self.builder.property("has-tooltip", has_tooltip), } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { - builder: self.builder.property("hexpand", hexpand), - } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { builder: self.builder.property("height-request", height_request), } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { - builder: self.builder.property("hexpand-set", hexpand_set), - } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { builder: self.builder.property("hexpand", hexpand), } + } - pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("layout-manager", layout_manager.clone().upcast()), - } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { builder: self.builder.property("hexpand-set", hexpand_set), } + } - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { - builder: self.builder.property("margin-bottom", margin_bottom), - } - } + pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { - builder: self.builder.property("margin-end", margin_end), - } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { builder: self.builder.property("margin-bottom", margin_bottom), } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { - builder: self.builder.property("margin-start", margin_start), - } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { builder: self.builder.property("margin-end", margin_end), } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { - builder: self.builder.property("margin-top", margin_top), - } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { builder: self.builder.property("margin-start", margin_start), } + } - pub fn name(self, name: impl Into) -> Self { - Self { - builder: self.builder.property("name", name.into()), - } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { builder: self.builder.property("margin-top", margin_top), } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { - builder: self.builder.property("opacity", opacity), - } - } + pub fn name(self, name: impl Into) -> Self { + Self { builder: self.builder.property("name", name.into()), } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + pub fn opacity(self, opacity: f64) -> Self { + Self { builder: self.builder.property("opacity", opacity), } + } - pub fn receives_default(self, receives_default: bool) -> Self { - Self { - builder: self.builder.property("receives-default", receives_default), - } - } + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn sensitive(self, sensitive: bool) -> Self { - Self { - builder: self.builder.property("sensitive", sensitive), - } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { builder: self.builder.property("receives-default", receives_default), } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { - builder: self - .builder - .property("tooltip-markup", tooltip_markup.into()), - } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { builder: self.builder.property("sensitive", sensitive), } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { - builder: self.builder.property("tooltip-text", tooltip_text.into()), - } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } + } - //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { - // Self { builder: self.builder.property("valign", valign), } - //} + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { - builder: self.builder.property("vexpand", vexpand), - } - } + //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { + // Self { builder: self.builder.property("valign", valign), } + //} - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { - builder: self.builder.property("vexpand-set", vexpand_set), - } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { builder: self.builder.property("vexpand", vexpand), } + } - pub fn visible(self, visible: bool) -> Self { - Self { - builder: self.builder.property("visible", visible), - } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { builder: self.builder.property("vexpand-set", vexpand_set), } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { - builder: self.builder.property("width-request", width_request), - } - } + pub fn visible(self, visible: bool) -> Self { + Self { builder: self.builder.property("visible", visible), } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + pub fn width_request(self, width_request: i32) -> Self { + Self { builder: self.builder.property("width-request", width_request), } + } - //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { - // Self { builder: self.builder.property("orientation", orientation), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} + + //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { + // Self { builder: self.builder.property("orientation", orientation), } + //} // rustdoc-stripper-ignore-next /// Build the [`Latch`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Latch { - self.builder.build() - } + self.builder.build() } } diff --git a/libbismuth/src/auto/latch_layout.rs b/libbismuth/src/auto/latch_layout.rs index 49d2312..e4205c0 100644 --- a/libbismuth/src/auto/latch_layout.rs +++ b/libbismuth/src/auto/latch_layout.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::ffi; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "BisLatchLayout")] @@ -24,29 +20,36 @@ impl LatchLayout { #[doc(alias = "bis_latch_layout_new")] pub fn new() -> LatchLayout { assert_initialized_main_thread!(); - unsafe { gtk::LayoutManager::from_glib_full(ffi::bis_latch_layout_new()).unsafe_cast() } + unsafe { + gtk::LayoutManager::from_glib_full(ffi::bis_latch_layout_new()).unsafe_cast() + } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`LatchLayout`] objects. - /// - /// This method returns an instance of [`LatchLayoutBuilder`](crate::builders::LatchLayoutBuilder) which can be used to create [`LatchLayout`] objects. - pub fn builder() -> LatchLayoutBuilder { - LatchLayoutBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`LatchLayout`] objects. + /// + /// This method returns an instance of [`LatchLayoutBuilder`](crate::builders::LatchLayoutBuilder) which can be used to create [`LatchLayout`] objects. + pub fn builder() -> LatchLayoutBuilder { + LatchLayoutBuilder::new() + } + #[doc(alias = "bis_latch_layout_get_maximum_size")] #[doc(alias = "get_maximum_size")] #[doc(alias = "maximum-size")] pub fn maximum_size(&self) -> i32 { - unsafe { ffi::bis_latch_layout_get_maximum_size(self.to_glib_none().0) } + unsafe { + ffi::bis_latch_layout_get_maximum_size(self.to_glib_none().0) + } } #[doc(alias = "bis_latch_layout_get_tightening_threshold")] #[doc(alias = "get_tightening_threshold")] #[doc(alias = "tightening-threshold")] pub fn tightening_threshold(&self) -> i32 { - unsafe { ffi::bis_latch_layout_get_tightening_threshold(self.to_glib_none().0) } + unsafe { + ffi::bis_latch_layout_get_tightening_threshold(self.to_glib_none().0) + } } #[doc(alias = "bis_latch_layout_set_maximum_size")] @@ -61,109 +64,72 @@ impl LatchLayout { #[doc(alias = "tightening-threshold")] pub fn set_tightening_threshold(&self, tightening_threshold: i32) { unsafe { - ffi::bis_latch_layout_set_tightening_threshold( - self.to_glib_none().0, - tightening_threshold, - ); + ffi::bis_latch_layout_set_tightening_threshold(self.to_glib_none().0, tightening_threshold); } } #[doc(alias = "maximum-size")] pub fn connect_maximum_size_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_maximum_size_trampoline( - this: *mut ffi::BisLatchLayout, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_maximum_size_trampoline(this: *mut ffi::BisLatchLayout, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::maximum-size\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_maximum_size_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::maximum-size\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_maximum_size_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "tightening-threshold")] - pub fn connect_tightening_threshold_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_tightening_threshold_trampoline< - F: Fn(&LatchLayout) + 'static, - >( - this: *mut ffi::BisLatchLayout, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + pub fn connect_tightening_threshold_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_tightening_threshold_trampoline(this: *mut ffi::BisLatchLayout, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::tightening-threshold\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_tightening_threshold_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::tightening-threshold\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_tightening_threshold_trampoline:: as *const ())), Box_::into_raw(f)) } } } impl Default for LatchLayout { - fn default() -> Self { - Self::new() - } -} + fn default() -> Self { + Self::new() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`LatchLayout`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`LatchLayout`] 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 LatchLayoutBuilder { - builder: glib::object::ObjectBuilder<'static, LatchLayout>, -} - -impl LatchLayoutBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, LatchLayout>, } - } - pub fn maximum_size(self, maximum_size: i32) -> Self { - Self { - builder: self.builder.property("maximum-size", maximum_size), + impl LatchLayoutBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn tightening_threshold(self, tightening_threshold: i32) -> Self { - Self { - builder: self - .builder - .property("tightening-threshold", tightening_threshold), - } - } + pub fn maximum_size(self, maximum_size: i32) -> Self { + Self { builder: self.builder.property("maximum-size", maximum_size), } + } - //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { - // Self { builder: self.builder.property("orientation", orientation), } - //} + pub fn tightening_threshold(self, tightening_threshold: i32) -> Self { + Self { builder: self.builder.property("tightening-threshold", tightening_threshold), } + } + + //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { + // Self { builder: self.builder.property("orientation", orientation), } + //} // rustdoc-stripper-ignore-next /// Build the [`LatchLayout`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> LatchLayout { - self.builder.build() - } + self.builder.build() } } diff --git a/libbismuth/src/auto/latch_scrollable.rs b/libbismuth/src/auto/latch_scrollable.rs index b5b6c59..f76d95a 100644 --- a/libbismuth/src/auto/latch_scrollable.rs +++ b/libbismuth/src/auto/latch_scrollable.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::ffi; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "BisLatchScrollable")] @@ -24,45 +20,51 @@ impl LatchScrollable { #[doc(alias = "bis_latch_scrollable_new")] pub fn new() -> LatchScrollable { assert_initialized_main_thread!(); - unsafe { gtk::Widget::from_glib_none(ffi::bis_latch_scrollable_new()).unsafe_cast() } + unsafe { + gtk::Widget::from_glib_none(ffi::bis_latch_scrollable_new()).unsafe_cast() + } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`LatchScrollable`] objects. - /// - /// This method returns an instance of [`LatchScrollableBuilder`](crate::builders::LatchScrollableBuilder) which can be used to create [`LatchScrollable`] objects. - pub fn builder() -> LatchScrollableBuilder { - LatchScrollableBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`LatchScrollable`] objects. + /// + /// This method returns an instance of [`LatchScrollableBuilder`](crate::builders::LatchScrollableBuilder) which can be used to create [`LatchScrollable`] objects. + pub fn builder() -> LatchScrollableBuilder { + LatchScrollableBuilder::new() + } + #[doc(alias = "bis_latch_scrollable_get_child")] #[doc(alias = "get_child")] pub fn child(&self) -> Option { - unsafe { from_glib_none(ffi::bis_latch_scrollable_get_child(self.to_glib_none().0)) } + unsafe { + from_glib_none(ffi::bis_latch_scrollable_get_child(self.to_glib_none().0)) + } } #[doc(alias = "bis_latch_scrollable_get_maximum_size")] #[doc(alias = "get_maximum_size")] #[doc(alias = "maximum-size")] pub fn maximum_size(&self) -> i32 { - unsafe { ffi::bis_latch_scrollable_get_maximum_size(self.to_glib_none().0) } + unsafe { + ffi::bis_latch_scrollable_get_maximum_size(self.to_glib_none().0) + } } #[doc(alias = "bis_latch_scrollable_get_tightening_threshold")] #[doc(alias = "get_tightening_threshold")] #[doc(alias = "tightening-threshold")] pub fn tightening_threshold(&self) -> i32 { - unsafe { ffi::bis_latch_scrollable_get_tightening_threshold(self.to_glib_none().0) } + unsafe { + ffi::bis_latch_scrollable_get_tightening_threshold(self.to_glib_none().0) + } } #[doc(alias = "bis_latch_scrollable_set_child")] #[doc(alias = "child")] pub fn set_child(&self, child: Option<&impl IsA>) { unsafe { - ffi::bis_latch_scrollable_set_child( - self.to_glib_none().0, - child.map(|p| p.as_ref()).to_glib_none().0, - ); + ffi::bis_latch_scrollable_set_child(self.to_glib_none().0, child.map(|p| p.as_ref()).to_glib_none().0); } } @@ -78,328 +80,225 @@ impl LatchScrollable { #[doc(alias = "tightening-threshold")] pub fn set_tightening_threshold(&self, tightening_threshold: i32) { unsafe { - ffi::bis_latch_scrollable_set_tightening_threshold( - self.to_glib_none().0, - tightening_threshold, - ); + ffi::bis_latch_scrollable_set_tightening_threshold(self.to_glib_none().0, tightening_threshold); } } #[doc(alias = "child")] pub fn connect_child_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_child_trampoline( - this: *mut ffi::BisLatchScrollable, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_child_trampoline(this: *mut ffi::BisLatchScrollable, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::child\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_child_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::child\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_child_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "maximum-size")] pub fn connect_maximum_size_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_maximum_size_trampoline( - this: *mut ffi::BisLatchScrollable, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_maximum_size_trampoline(this: *mut ffi::BisLatchScrollable, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::maximum-size\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_maximum_size_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::maximum-size\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_maximum_size_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "tightening-threshold")] - pub fn connect_tightening_threshold_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_tightening_threshold_trampoline< - F: Fn(&LatchScrollable) + 'static, - >( - this: *mut ffi::BisLatchScrollable, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + pub fn connect_tightening_threshold_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_tightening_threshold_trampoline(this: *mut ffi::BisLatchScrollable, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::tightening-threshold\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_tightening_threshold_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::tightening-threshold\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_tightening_threshold_trampoline:: as *const ())), Box_::into_raw(f)) } } } impl Default for LatchScrollable { - fn default() -> Self { - Self::new() - } -} + fn default() -> Self { + Self::new() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`LatchScrollable`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`LatchScrollable`] 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 LatchScrollableBuilder { - builder: glib::object::ObjectBuilder<'static, LatchScrollable>, -} - -impl LatchScrollableBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, LatchScrollable>, } - } - pub fn child(self, child: &impl IsA) -> Self { - Self { - builder: self.builder.property("child", child.clone().upcast()), + impl LatchScrollableBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn maximum_size(self, maximum_size: i32) -> Self { - Self { - builder: self.builder.property("maximum-size", maximum_size), - } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { builder: self.builder.property("child", child.clone().upcast()), } + } - pub fn tightening_threshold(self, tightening_threshold: i32) -> Self { - Self { - builder: self - .builder - .property("tightening-threshold", tightening_threshold), - } - } + pub fn maximum_size(self, maximum_size: i32) -> Self { + Self { builder: self.builder.property("maximum-size", maximum_size), } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { - builder: self.builder.property("can-focus", can_focus), - } - } + pub fn tightening_threshold(self, tightening_threshold: i32) -> Self { + Self { builder: self.builder.property("tightening-threshold", tightening_threshold), } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { - builder: self.builder.property("can-target", can_target), - } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { builder: self.builder.property("can-focus", can_focus), } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { - builder: self.builder.property("css-classes", css_classes.into()), - } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { builder: self.builder.property("can-target", can_target), } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { - builder: self.builder.property("css-name", css_name.into()), - } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { builder: self.builder.property("css-classes", css_classes.into()), } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + pub fn css_name(self, css_name: impl Into) -> Self { + Self { builder: self.builder.property("css-name", css_name.into()), } + } - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { - builder: self.builder.property("focus-on-click", focus_on_click), - } - } + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focusable(self, focusable: bool) -> Self { - Self { - builder: self.builder.property("focusable", focusable), - } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { builder: self.builder.property("focus-on-click", focus_on_click), } + } - //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { - // Self { builder: self.builder.property("halign", halign), } - //} + pub fn focusable(self, focusable: bool) -> Self { + Self { builder: self.builder.property("focusable", focusable), } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { - builder: self.builder.property("has-tooltip", has_tooltip), - } - } + //pub fn halign(self, halign: /*Ignored*/gtk::Align) -> Self { + // Self { builder: self.builder.property("halign", halign), } + //} - pub fn height_request(self, height_request: i32) -> Self { - Self { - builder: self.builder.property("height-request", height_request), - } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { builder: self.builder.property("has-tooltip", has_tooltip), } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { - builder: self.builder.property("hexpand", hexpand), - } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { builder: self.builder.property("height-request", height_request), } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { - builder: self.builder.property("hexpand-set", hexpand_set), - } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { builder: self.builder.property("hexpand", hexpand), } + } - pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("layout-manager", layout_manager.clone().upcast()), - } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { builder: self.builder.property("hexpand-set", hexpand_set), } + } - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { - builder: self.builder.property("margin-bottom", margin_bottom), - } - } + pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { - builder: self.builder.property("margin-end", margin_end), - } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { builder: self.builder.property("margin-bottom", margin_bottom), } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { - builder: self.builder.property("margin-start", margin_start), - } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { builder: self.builder.property("margin-end", margin_end), } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { - builder: self.builder.property("margin-top", margin_top), - } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { builder: self.builder.property("margin-start", margin_start), } + } - pub fn name(self, name: impl Into) -> Self { - Self { - builder: self.builder.property("name", name.into()), - } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { builder: self.builder.property("margin-top", margin_top), } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { - builder: self.builder.property("opacity", opacity), - } - } + pub fn name(self, name: impl Into) -> Self { + Self { builder: self.builder.property("name", name.into()), } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + pub fn opacity(self, opacity: f64) -> Self { + Self { builder: self.builder.property("opacity", opacity), } + } - pub fn receives_default(self, receives_default: bool) -> Self { - Self { - builder: self.builder.property("receives-default", receives_default), - } - } + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn sensitive(self, sensitive: bool) -> Self { - Self { - builder: self.builder.property("sensitive", sensitive), - } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { builder: self.builder.property("receives-default", receives_default), } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { - builder: self - .builder - .property("tooltip-markup", tooltip_markup.into()), - } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { builder: self.builder.property("sensitive", sensitive), } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { - builder: self.builder.property("tooltip-text", tooltip_text.into()), - } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } + } - //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { - // Self { builder: self.builder.property("valign", valign), } - //} + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { - builder: self.builder.property("vexpand", vexpand), - } - } + //pub fn valign(self, valign: /*Ignored*/gtk::Align) -> Self { + // Self { builder: self.builder.property("valign", valign), } + //} - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { - builder: self.builder.property("vexpand-set", vexpand_set), - } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { builder: self.builder.property("vexpand", vexpand), } + } - pub fn visible(self, visible: bool) -> Self { - Self { - builder: self.builder.property("visible", visible), - } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { builder: self.builder.property("vexpand-set", vexpand_set), } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { - builder: self.builder.property("width-request", width_request), - } - } + pub fn visible(self, visible: bool) -> Self { + Self { builder: self.builder.property("visible", visible), } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + pub fn width_request(self, width_request: i32) -> Self { + Self { builder: self.builder.property("width-request", width_request), } + } - //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { - // Self { builder: self.builder.property("orientation", orientation), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} - //pub fn hadjustment(self, hadjustment: &impl IsA) -> Self { - // Self { builder: self.builder.property("hadjustment", hadjustment.clone().upcast()), } - //} + //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { + // Self { builder: self.builder.property("orientation", orientation), } + //} - //pub fn hscroll_policy(self, hscroll_policy: /*Ignored*/gtk::ScrollablePolicy) -> Self { - // Self { builder: self.builder.property("hscroll-policy", hscroll_policy), } - //} + //pub fn hadjustment(self, hadjustment: &impl IsA) -> Self { + // Self { builder: self.builder.property("hadjustment", hadjustment.clone().upcast()), } + //} - //pub fn vadjustment(self, vadjustment: &impl IsA) -> Self { - // Self { builder: self.builder.property("vadjustment", vadjustment.clone().upcast()), } - //} + //pub fn hscroll_policy(self, hscroll_policy: /*Ignored*/gtk::ScrollablePolicy) -> Self { + // Self { builder: self.builder.property("hscroll-policy", hscroll_policy), } + //} - //pub fn vscroll_policy(self, vscroll_policy: /*Ignored*/gtk::ScrollablePolicy) -> Self { - // Self { builder: self.builder.property("vscroll-policy", vscroll_policy), } - //} + //pub fn vadjustment(self, vadjustment: &impl IsA) -> Self { + // Self { builder: self.builder.property("vadjustment", vadjustment.clone().upcast()), } + //} + + //pub fn vscroll_policy(self, vscroll_policy: /*Ignored*/gtk::ScrollablePolicy) -> Self { + // Self { builder: self.builder.property("vscroll-policy", vscroll_policy), } + //} // rustdoc-stripper-ignore-next /// Build the [`LatchScrollable`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> LatchScrollable { - self.builder.build() - } + self.builder.build() } } diff --git a/libbismuth/src/auto/mod.rs b/libbismuth/src/auto/mod.rs index edac6a3..2fad8f8 100644 --- a/libbismuth/src/auto/mod.rs +++ b/libbismuth/src/auto/mod.rs @@ -1,5 +1,5 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT @@ -106,7 +106,7 @@ pub(crate) mod builders { pub use super::latch_layout::LatchLayoutBuilder; pub use super::latch_scrollable::LatchScrollableBuilder; #[cfg(feature = "v1_2")] - #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] +#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub use super::property_animation_target::PropertyAnimationTargetBuilder; pub use super::spring_animation::SpringAnimationBuilder; pub use super::swipe_tracker::SwipeTrackerBuilder; diff --git a/libbismuth/src/auto/property_animation_target.rs b/libbismuth/src/auto/property_animation_target.rs index f677a80..561a1ba 100644 --- a/libbismuth/src/auto/property_animation_target.rs +++ b/libbismuth/src/auto/property_animation_target.rs @@ -1,10 +1,10 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, AnimationTarget}; -use glib::{prelude::*, translate::*}; +use crate::{ffi,AnimationTarget}; +use glib::{prelude::*,translate::*}; glib::wrapper! { #[doc(alias = "BisPropertyAnimationTarget")] @@ -20,45 +20,33 @@ impl PropertyAnimationTarget { pub fn new(object: &impl IsA, property_name: &str) -> PropertyAnimationTarget { assert_initialized_main_thread!(); unsafe { - AnimationTarget::from_glib_full(ffi::bis_property_animation_target_new( - object.as_ref().to_glib_none().0, - property_name.to_glib_none().0, - )) - .unsafe_cast() + AnimationTarget::from_glib_full(ffi::bis_property_animation_target_new(object.as_ref().to_glib_none().0, property_name.to_glib_none().0)).unsafe_cast() } } #[doc(alias = "bis_property_animation_target_new_for_pspec")] #[doc(alias = "new_for_pspec")] - pub fn for_pspec( - object: &impl IsA, - pspec: impl AsRef, - ) -> PropertyAnimationTarget { + pub fn for_pspec(object: &impl IsA, pspec: impl AsRef) -> PropertyAnimationTarget { assert_initialized_main_thread!(); unsafe { - AnimationTarget::from_glib_full(ffi::bis_property_animation_target_new_for_pspec( - object.as_ref().to_glib_none().0, - pspec.as_ref().to_glib_none().0, - )) - .unsafe_cast() + AnimationTarget::from_glib_full(ffi::bis_property_animation_target_new_for_pspec(object.as_ref().to_glib_none().0, pspec.as_ref().to_glib_none().0)).unsafe_cast() } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`PropertyAnimationTarget`] objects. - /// - /// This method returns an instance of [`PropertyAnimationTargetBuilder`](crate::builders::PropertyAnimationTargetBuilder) which can be used to create [`PropertyAnimationTarget`] objects. - pub fn builder() -> PropertyAnimationTargetBuilder { - PropertyAnimationTargetBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`PropertyAnimationTarget`] objects. + /// + /// This method returns an instance of [`PropertyAnimationTargetBuilder`](crate::builders::PropertyAnimationTargetBuilder) which can be used to create [`PropertyAnimationTarget`] objects. + pub fn builder() -> PropertyAnimationTargetBuilder { + PropertyAnimationTargetBuilder::new() + } + #[doc(alias = "bis_property_animation_target_get_object")] #[doc(alias = "get_object")] pub fn object(&self) -> glib::Object { unsafe { - from_glib_none(ffi::bis_property_animation_target_get_object( - self.to_glib_none().0, - )) + from_glib_none(ffi::bis_property_animation_target_get_object(self.to_glib_none().0)) } } @@ -66,9 +54,7 @@ impl PropertyAnimationTarget { #[doc(alias = "get_pspec")] pub fn pspec(&self) -> glib::ParamSpec { unsafe { - from_glib_none(ffi::bis_property_animation_target_get_pspec( - self.to_glib_none().0, - )) + from_glib_none(ffi::bis_property_animation_target_get_pspec(self.to_glib_none().0)) } } } @@ -76,47 +62,40 @@ impl PropertyAnimationTarget { #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] impl Default for PropertyAnimationTarget { - fn default() -> Self { - glib::object::Object::new::() - } -} + fn default() -> Self { + glib::object::Object::new::() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`PropertyAnimationTarget`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`PropertyAnimationTarget`] 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 PropertyAnimationTargetBuilder { - builder: glib::object::ObjectBuilder<'static, PropertyAnimationTarget>, -} + builder: glib::object::ObjectBuilder<'static, PropertyAnimationTarget>, + } -impl PropertyAnimationTargetBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + impl PropertyAnimationTargetBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - #[cfg(feature = "v1_2")] + #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn object(self, object: &impl IsA) -> Self { - Self { - builder: self.builder.property("object", object.clone().upcast()), - } - } + Self { builder: self.builder.property("object", object.clone().upcast()), } + } - #[cfg(feature = "v1_2")] + #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn pspec(self, pspec: impl AsRef) -> Self { - Self { - builder: self.builder.property("pspec", pspec.as_ref().clone()), - } - } + Self { builder: self.builder.property("pspec", pspec.as_ref().clone()), } + } // rustdoc-stripper-ignore-next /// Build the [`PropertyAnimationTarget`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> PropertyAnimationTarget { - self.builder.build() - } + self.builder.build() } } diff --git a/libbismuth/src/auto/spring_animation.rs b/libbismuth/src/auto/spring_animation.rs index c2f503c..2a6f9b7 100644 --- a/libbismuth/src/auto/spring_animation.rs +++ b/libbismuth/src/auto/spring_animation.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, Animation, AnimationTarget, SpringParams}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,Animation,AnimationTarget,SpringParams}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "BisSpringAnimation")] @@ -22,59 +18,55 @@ glib::wrapper! { impl SpringAnimation { #[doc(alias = "bis_spring_animation_new")] - pub fn new( - widget: &impl IsA, - from: f64, - to: f64, - spring_params: SpringParams, - target: impl IsA, - ) -> SpringAnimation { + pub fn new(widget: &impl IsA, from: f64, to: f64, spring_params: SpringParams, target: impl IsA) -> SpringAnimation { skip_assert_initialized!(); unsafe { - Animation::from_glib_none(ffi::bis_spring_animation_new( - widget.as_ref().to_glib_none().0, - from, - to, - spring_params.into_glib_ptr(), - target.upcast().into_glib_ptr(), - )) - .unsafe_cast() + Animation::from_glib_none(ffi::bis_spring_animation_new(widget.as_ref().to_glib_none().0, from, to, spring_params.into_glib_ptr(), target.upcast().into_glib_ptr())).unsafe_cast() } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`SpringAnimation`] objects. - /// - /// This method returns an instance of [`SpringAnimationBuilder`](crate::builders::SpringAnimationBuilder) which can be used to create [`SpringAnimation`] objects. - pub fn builder() -> SpringAnimationBuilder { - SpringAnimationBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`SpringAnimation`] objects. + /// + /// This method returns an instance of [`SpringAnimationBuilder`](crate::builders::SpringAnimationBuilder) which can be used to create [`SpringAnimation`] objects. + pub fn builder() -> SpringAnimationBuilder { + SpringAnimationBuilder::new() + } + #[doc(alias = "bis_spring_animation_get_epsilon")] #[doc(alias = "get_epsilon")] pub fn epsilon(&self) -> f64 { - unsafe { ffi::bis_spring_animation_get_epsilon(self.to_glib_none().0) } + unsafe { + ffi::bis_spring_animation_get_epsilon(self.to_glib_none().0) + } } #[doc(alias = "bis_spring_animation_get_estimated_duration")] #[doc(alias = "get_estimated_duration")] #[doc(alias = "estimated-duration")] pub fn estimated_duration(&self) -> u32 { - unsafe { ffi::bis_spring_animation_get_estimated_duration(self.to_glib_none().0) } + unsafe { + ffi::bis_spring_animation_get_estimated_duration(self.to_glib_none().0) + } } #[doc(alias = "bis_spring_animation_get_initial_velocity")] #[doc(alias = "get_initial_velocity")] #[doc(alias = "initial-velocity")] pub fn initial_velocity(&self) -> f64 { - unsafe { ffi::bis_spring_animation_get_initial_velocity(self.to_glib_none().0) } + unsafe { + ffi::bis_spring_animation_get_initial_velocity(self.to_glib_none().0) + } } #[doc(alias = "bis_spring_animation_get_latch")] #[doc(alias = "get_latch")] #[doc(alias = "latch")] pub fn is_latch(&self) -> bool { - unsafe { from_glib(ffi::bis_spring_animation_get_latch(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_spring_animation_get_latch(self.to_glib_none().0)) + } } #[doc(alias = "bis_spring_animation_get_spring_params")] @@ -82,9 +74,7 @@ impl SpringAnimation { #[doc(alias = "spring-params")] pub fn spring_params(&self) -> SpringParams { unsafe { - from_glib_none(ffi::bis_spring_animation_get_spring_params( - self.to_glib_none().0, - )) + from_glib_none(ffi::bis_spring_animation_get_spring_params(self.to_glib_none().0)) } } @@ -92,20 +82,26 @@ impl SpringAnimation { #[doc(alias = "get_value_from")] #[doc(alias = "value-from")] pub fn value_from(&self) -> f64 { - unsafe { ffi::bis_spring_animation_get_value_from(self.to_glib_none().0) } + unsafe { + ffi::bis_spring_animation_get_value_from(self.to_glib_none().0) + } } #[doc(alias = "bis_spring_animation_get_value_to")] #[doc(alias = "get_value_to")] #[doc(alias = "value-to")] pub fn value_to(&self) -> f64 { - unsafe { ffi::bis_spring_animation_get_value_to(self.to_glib_none().0) } + unsafe { + ffi::bis_spring_animation_get_value_to(self.to_glib_none().0) + } } #[doc(alias = "bis_spring_animation_get_velocity")] #[doc(alias = "get_velocity")] pub fn velocity(&self) -> f64 { - unsafe { ffi::bis_spring_animation_get_velocity(self.to_glib_none().0) } + unsafe { + ffi::bis_spring_animation_get_velocity(self.to_glib_none().0) + } } #[doc(alias = "bis_spring_animation_set_epsilon")] @@ -136,10 +132,7 @@ impl SpringAnimation { #[doc(alias = "spring-params")] pub fn set_spring_params(&self, spring_params: &SpringParams) { unsafe { - ffi::bis_spring_animation_set_spring_params( - self.to_glib_none().0, - spring_params.to_glib_none().0, - ); + ffi::bis_spring_animation_set_spring_params(self.to_glib_none().0, spring_params.to_glib_none().0); } } @@ -161,272 +154,164 @@ impl SpringAnimation { #[doc(alias = "epsilon")] pub fn connect_epsilon_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_epsilon_trampoline( - this: *mut ffi::BisSpringAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_epsilon_trampoline(this: *mut ffi::BisSpringAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::epsilon\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_epsilon_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::epsilon\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_epsilon_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "estimated-duration")] - pub fn connect_estimated_duration_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_estimated_duration_trampoline< - F: Fn(&SpringAnimation) + 'static, - >( - this: *mut ffi::BisSpringAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + pub fn connect_estimated_duration_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_estimated_duration_trampoline(this: *mut ffi::BisSpringAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::estimated-duration\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_estimated_duration_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::estimated-duration\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_estimated_duration_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "initial-velocity")] pub fn connect_initial_velocity_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_initial_velocity_trampoline< - F: Fn(&SpringAnimation) + 'static, - >( - this: *mut ffi::BisSpringAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_initial_velocity_trampoline(this: *mut ffi::BisSpringAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::initial-velocity\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_initial_velocity_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::initial-velocity\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_initial_velocity_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "latch")] pub fn connect_latch_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_latch_trampoline( - this: *mut ffi::BisSpringAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_latch_trampoline(this: *mut ffi::BisSpringAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::latch\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_latch_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::latch\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_latch_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "spring-params")] pub fn connect_spring_params_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_spring_params_trampoline( - this: *mut ffi::BisSpringAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_spring_params_trampoline(this: *mut ffi::BisSpringAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::spring-params\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_spring_params_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::spring-params\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_spring_params_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "value-from")] pub fn connect_value_from_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_value_from_trampoline( - this: *mut ffi::BisSpringAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_value_from_trampoline(this: *mut ffi::BisSpringAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::value-from\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_value_from_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::value-from\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_value_from_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "value-to")] pub fn connect_value_to_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_value_to_trampoline( - this: *mut ffi::BisSpringAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_value_to_trampoline(this: *mut ffi::BisSpringAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::value-to\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_value_to_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::value-to\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_value_to_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "velocity")] pub fn connect_velocity_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_velocity_trampoline( - this: *mut ffi::BisSpringAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_velocity_trampoline(this: *mut ffi::BisSpringAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::velocity\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_velocity_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::velocity\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_velocity_trampoline:: as *const ())), Box_::into_raw(f)) } } } impl Default for SpringAnimation { - fn default() -> Self { - glib::object::Object::new::() - } -} + fn default() -> Self { + glib::object::Object::new::() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`SpringAnimation`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`SpringAnimation`] 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 SpringAnimationBuilder { - builder: glib::object::ObjectBuilder<'static, SpringAnimation>, -} - -impl SpringAnimationBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, SpringAnimation>, } - } - pub fn epsilon(self, epsilon: f64) -> Self { - Self { - builder: self.builder.property("epsilon", epsilon), + impl SpringAnimationBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn initial_velocity(self, initial_velocity: f64) -> Self { - Self { - builder: self.builder.property("initial-velocity", initial_velocity), - } - } + pub fn epsilon(self, epsilon: f64) -> Self { + Self { builder: self.builder.property("epsilon", epsilon), } + } - pub fn latch(self, latch: bool) -> Self { - Self { - builder: self.builder.property("latch", latch), - } - } + pub fn initial_velocity(self, initial_velocity: f64) -> Self { + Self { builder: self.builder.property("initial-velocity", initial_velocity), } + } - pub fn spring_params(self, spring_params: &SpringParams) -> Self { - Self { - builder: self - .builder - .property("spring-params", spring_params.clone()), - } - } + pub fn latch(self, latch: bool) -> Self { + Self { builder: self.builder.property("latch", latch), } + } - pub fn value_from(self, value_from: f64) -> Self { - Self { - builder: self.builder.property("value-from", value_from), - } - } + pub fn spring_params(self, spring_params: &SpringParams) -> Self { + Self { builder: self.builder.property("spring-params", spring_params.clone()), } + } - pub fn value_to(self, value_to: f64) -> Self { - Self { - builder: self.builder.property("value-to", value_to), - } - } + pub fn value_from(self, value_from: f64) -> Self { + Self { builder: self.builder.property("value-from", value_from), } + } - pub fn target(self, target: &impl IsA) -> Self { - Self { - builder: self.builder.property("target", target.clone().upcast()), - } - } + pub fn value_to(self, value_to: f64) -> Self { + Self { builder: self.builder.property("value-to", value_to), } + } - pub fn widget(self, widget: &impl IsA) -> Self { - Self { - builder: self.builder.property("widget", widget.clone().upcast()), - } - } + pub fn target(self, target: &impl IsA) -> Self { + Self { builder: self.builder.property("target", target.clone().upcast()), } + } + + pub fn widget(self, widget: &impl IsA) -> Self { + Self { builder: self.builder.property("widget", widget.clone().upcast()), } + } // rustdoc-stripper-ignore-next /// Build the [`SpringAnimation`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> SpringAnimation { - self.builder.build() - } + self.builder.build() } } diff --git a/libbismuth/src/auto/spring_params.rs b/libbismuth/src/auto/spring_params.rs index 5537856..8edf463 100644 --- a/libbismuth/src/auto/spring_params.rs +++ b/libbismuth/src/auto/spring_params.rs @@ -1,10 +1,10 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::ffi; -use glib::translate::*; +use crate::{ffi}; +use glib::{translate::*}; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] @@ -21,36 +21,48 @@ impl SpringParams { #[doc(alias = "bis_spring_params_new")] pub fn new(damping_ratio: f64, mass: f64, stiffness: f64) -> SpringParams { assert_initialized_main_thread!(); - unsafe { from_glib_full(ffi::bis_spring_params_new(damping_ratio, mass, stiffness)) } + unsafe { + from_glib_full(ffi::bis_spring_params_new(damping_ratio, mass, stiffness)) + } } #[doc(alias = "bis_spring_params_new_full")] pub fn new_full(damping: f64, mass: f64, stiffness: f64) -> SpringParams { assert_initialized_main_thread!(); - unsafe { from_glib_full(ffi::bis_spring_params_new_full(damping, mass, stiffness)) } + unsafe { + from_glib_full(ffi::bis_spring_params_new_full(damping, mass, stiffness)) + } } #[doc(alias = "bis_spring_params_get_damping")] #[doc(alias = "get_damping")] pub fn damping(&self) -> f64 { - unsafe { ffi::bis_spring_params_get_damping(self.to_glib_none().0) } + unsafe { + ffi::bis_spring_params_get_damping(self.to_glib_none().0) + } } #[doc(alias = "bis_spring_params_get_damping_ratio")] #[doc(alias = "get_damping_ratio")] pub fn damping_ratio(&self) -> f64 { - unsafe { ffi::bis_spring_params_get_damping_ratio(self.to_glib_none().0) } + unsafe { + ffi::bis_spring_params_get_damping_ratio(self.to_glib_none().0) + } } #[doc(alias = "bis_spring_params_get_mass")] #[doc(alias = "get_mass")] pub fn mass(&self) -> f64 { - unsafe { ffi::bis_spring_params_get_mass(self.to_glib_none().0) } + unsafe { + ffi::bis_spring_params_get_mass(self.to_glib_none().0) + } } #[doc(alias = "bis_spring_params_get_stiffness")] #[doc(alias = "get_stiffness")] pub fn stiffness(&self) -> f64 { - unsafe { ffi::bis_spring_params_get_stiffness(self.to_glib_none().0) } + unsafe { + ffi::bis_spring_params_get_stiffness(self.to_glib_none().0) + } } } diff --git a/libbismuth/src/auto/swipe_tracker.rs b/libbismuth/src/auto/swipe_tracker.rs index 67ddb36..b4b3720 100644 --- a/libbismuth/src/auto/swipe_tracker.rs +++ b/libbismuth/src/auto/swipe_tracker.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, NavigationDirection, Swipeable}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,NavigationDirection,Swipeable}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "BisSwipeTracker")] @@ -25,28 +21,25 @@ impl SwipeTracker { pub fn new(swipeable: &impl IsA) -> SwipeTracker { skip_assert_initialized!(); unsafe { - from_glib_full(ffi::bis_swipe_tracker_new( - swipeable.as_ref().to_glib_none().0, - )) + from_glib_full(ffi::bis_swipe_tracker_new(swipeable.as_ref().to_glib_none().0)) } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`SwipeTracker`] objects. - /// - /// This method returns an instance of [`SwipeTrackerBuilder`](crate::builders::SwipeTrackerBuilder) which can be used to create [`SwipeTracker`] objects. - pub fn builder() -> SwipeTrackerBuilder { - SwipeTrackerBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`SwipeTracker`] objects. + /// + /// This method returns an instance of [`SwipeTrackerBuilder`](crate::builders::SwipeTrackerBuilder) which can be used to create [`SwipeTracker`] objects. + pub fn builder() -> SwipeTrackerBuilder { + SwipeTrackerBuilder::new() + } + #[doc(alias = "bis_swipe_tracker_get_allow_long_swipes")] #[doc(alias = "get_allow_long_swipes")] #[doc(alias = "allow-long-swipes")] pub fn allows_long_swipes(&self) -> bool { unsafe { - from_glib(ffi::bis_swipe_tracker_get_allow_long_swipes( - self.to_glib_none().0, - )) + from_glib(ffi::bis_swipe_tracker_get_allow_long_swipes(self.to_glib_none().0)) } } @@ -55,9 +48,7 @@ impl SwipeTracker { #[doc(alias = "allow-mouse-drag")] pub fn allows_mouse_drag(&self) -> bool { unsafe { - from_glib(ffi::bis_swipe_tracker_get_allow_mouse_drag( - self.to_glib_none().0, - )) + from_glib(ffi::bis_swipe_tracker_get_allow_mouse_drag(self.to_glib_none().0)) } } @@ -65,30 +56,33 @@ impl SwipeTracker { #[doc(alias = "get_enabled")] #[doc(alias = "enabled")] pub fn is_enabled(&self) -> bool { - unsafe { from_glib(ffi::bis_swipe_tracker_get_enabled(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_swipe_tracker_get_enabled(self.to_glib_none().0)) + } } #[doc(alias = "bis_swipe_tracker_get_reversed")] #[doc(alias = "get_reversed")] #[doc(alias = "reversed")] pub fn is_reversed(&self) -> bool { - unsafe { from_glib(ffi::bis_swipe_tracker_get_reversed(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_swipe_tracker_get_reversed(self.to_glib_none().0)) + } } #[doc(alias = "bis_swipe_tracker_get_swipeable")] #[doc(alias = "get_swipeable")] pub fn swipeable(&self) -> Swipeable { - unsafe { from_glib_none(ffi::bis_swipe_tracker_get_swipeable(self.to_glib_none().0)) } + unsafe { + from_glib_none(ffi::bis_swipe_tracker_get_swipeable(self.to_glib_none().0)) + } } #[doc(alias = "bis_swipe_tracker_set_allow_long_swipes")] #[doc(alias = "allow-long-swipes")] pub fn set_allow_long_swipes(&self, allow_long_swipes: bool) { unsafe { - ffi::bis_swipe_tracker_set_allow_long_swipes( - self.to_glib_none().0, - allow_long_swipes.into_glib(), - ); + ffi::bis_swipe_tracker_set_allow_long_swipes(self.to_glib_none().0, allow_long_swipes.into_glib()); } } @@ -96,10 +90,7 @@ impl SwipeTracker { #[doc(alias = "allow-mouse-drag")] pub fn set_allow_mouse_drag(&self, allow_mouse_drag: bool) { unsafe { - ffi::bis_swipe_tracker_set_allow_mouse_drag( - self.to_glib_none().0, - allow_mouse_drag.into_glib(), - ); + ffi::bis_swipe_tracker_set_allow_mouse_drag(self.to_glib_none().0, allow_mouse_drag.into_glib()); } } @@ -128,261 +119,156 @@ impl SwipeTracker { #[doc(alias = "begin-swipe")] pub fn connect_begin_swipe(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn begin_swipe_trampoline( - this: *mut ffi::BisSwipeTracker, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn begin_swipe_trampoline(this: *mut ffi::BisSwipeTracker, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"begin-swipe\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - begin_swipe_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"begin-swipe\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(begin_swipe_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "end-swipe")] pub fn connect_end_swipe(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn end_swipe_trampoline( - this: *mut ffi::BisSwipeTracker, - velocity: libc::c_double, - to: libc::c_double, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn end_swipe_trampoline(this: *mut ffi::BisSwipeTracker, velocity: libc::c_double, to: libc::c_double, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), velocity, to) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"end-swipe\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - end_swipe_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"end-swipe\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(end_swipe_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "prepare")] - pub fn connect_prepare( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn prepare_trampoline< - F: Fn(&SwipeTracker, NavigationDirection) + 'static, - >( - this: *mut ffi::BisSwipeTracker, - direction: ffi::BisNavigationDirection, - f: glib::ffi::gpointer, - ) { + pub fn connect_prepare(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn prepare_trampoline(this: *mut ffi::BisSwipeTracker, direction: ffi::BisNavigationDirection, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), from_glib(direction)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"prepare\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - prepare_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"prepare\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(prepare_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "update-swipe")] pub fn connect_update_swipe(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn update_swipe_trampoline( - this: *mut ffi::BisSwipeTracker, - progress: libc::c_double, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn update_swipe_trampoline(this: *mut ffi::BisSwipeTracker, progress: libc::c_double, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), progress) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"update-swipe\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - update_swipe_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"update-swipe\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(update_swipe_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "allow-long-swipes")] - pub fn connect_allow_long_swipes_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_allow_long_swipes_trampoline( - this: *mut ffi::BisSwipeTracker, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + pub fn connect_allow_long_swipes_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_allow_long_swipes_trampoline(this: *mut ffi::BisSwipeTracker, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::allow-long-swipes\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_allow_long_swipes_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::allow-long-swipes\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_allow_long_swipes_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "allow-mouse-drag")] pub fn connect_allow_mouse_drag_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_allow_mouse_drag_trampoline( - this: *mut ffi::BisSwipeTracker, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_allow_mouse_drag_trampoline(this: *mut ffi::BisSwipeTracker, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::allow-mouse-drag\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_allow_mouse_drag_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::allow-mouse-drag\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_allow_mouse_drag_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "enabled")] pub fn connect_enabled_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_enabled_trampoline( - this: *mut ffi::BisSwipeTracker, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_enabled_trampoline(this: *mut ffi::BisSwipeTracker, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::enabled\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_enabled_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::enabled\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_enabled_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "reversed")] pub fn connect_reversed_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_reversed_trampoline( - this: *mut ffi::BisSwipeTracker, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_reversed_trampoline(this: *mut ffi::BisSwipeTracker, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::reversed\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_reversed_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::reversed\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_reversed_trampoline:: as *const ())), Box_::into_raw(f)) } } } impl Default for SwipeTracker { - fn default() -> Self { - glib::object::Object::new::() - } -} + fn default() -> Self { + glib::object::Object::new::() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`SwipeTracker`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`SwipeTracker`] 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 SwipeTrackerBuilder { - builder: glib::object::ObjectBuilder<'static, SwipeTracker>, -} - -impl SwipeTrackerBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, SwipeTracker>, } - } - pub fn allow_long_swipes(self, allow_long_swipes: bool) -> Self { - Self { - builder: self - .builder - .property("allow-long-swipes", allow_long_swipes), + impl SwipeTrackerBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn allow_mouse_drag(self, allow_mouse_drag: bool) -> Self { - Self { - builder: self.builder.property("allow-mouse-drag", allow_mouse_drag), - } - } + pub fn allow_long_swipes(self, allow_long_swipes: bool) -> Self { + Self { builder: self.builder.property("allow-long-swipes", allow_long_swipes), } + } - pub fn enabled(self, enabled: bool) -> Self { - Self { - builder: self.builder.property("enabled", enabled), - } - } + pub fn allow_mouse_drag(self, allow_mouse_drag: bool) -> Self { + Self { builder: self.builder.property("allow-mouse-drag", allow_mouse_drag), } + } - pub fn reversed(self, reversed: bool) -> Self { - Self { - builder: self.builder.property("reversed", reversed), - } - } + pub fn enabled(self, enabled: bool) -> Self { + Self { builder: self.builder.property("enabled", enabled), } + } - pub fn swipeable(self, swipeable: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("swipeable", swipeable.clone().upcast()), - } - } + pub fn reversed(self, reversed: bool) -> Self { + Self { builder: self.builder.property("reversed", reversed), } + } + + pub fn swipeable(self, swipeable: &impl IsA) -> Self { + Self { builder: self.builder.property("swipeable", swipeable.clone().upcast()), } + } - //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { - // Self { builder: self.builder.property("orientation", orientation), } - //} + //pub fn orientation(self, orientation: /*Ignored*/gtk::Orientation) -> Self { + // Self { builder: self.builder.property("orientation", orientation), } + //} // rustdoc-stripper-ignore-next /// Build the [`SwipeTracker`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> SwipeTracker { - self.builder.build() - } + self.builder.build() } } diff --git a/libbismuth/src/auto/swipeable.rs b/libbismuth/src/auto/swipeable.rs index 4b23f35..3189477 100644 --- a/libbismuth/src/auto/swipeable.rs +++ b/libbismuth/src/auto/swipeable.rs @@ -1,10 +1,10 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, NavigationDirection}; -use glib::{prelude::*, translate::*}; +use crate::{ffi,NavigationDirection}; +use glib::{prelude::*,translate::*}; glib::wrapper! { #[doc(alias = "BisSwipeable")] @@ -16,7 +16,8 @@ glib::wrapper! { } impl Swipeable { - pub const NONE: Option<&'static Swipeable> = None; + pub const NONE: Option<&'static Swipeable> = None; + } mod sealed { @@ -28,19 +29,25 @@ pub trait SwipeableExt: IsA + sealed::Sealed + 'static { #[doc(alias = "bis_swipeable_get_cancel_progress")] #[doc(alias = "get_cancel_progress")] fn cancel_progress(&self) -> f64 { - unsafe { ffi::bis_swipeable_get_cancel_progress(self.as_ref().to_glib_none().0) } + unsafe { + ffi::bis_swipeable_get_cancel_progress(self.as_ref().to_glib_none().0) + } } #[doc(alias = "bis_swipeable_get_distance")] #[doc(alias = "get_distance")] fn distance(&self) -> f64 { - unsafe { ffi::bis_swipeable_get_distance(self.as_ref().to_glib_none().0) } + unsafe { + ffi::bis_swipeable_get_distance(self.as_ref().to_glib_none().0) + } } #[doc(alias = "bis_swipeable_get_progress")] #[doc(alias = "get_progress")] fn progress(&self) -> f64 { - unsafe { ffi::bis_swipeable_get_progress(self.as_ref().to_glib_none().0) } + unsafe { + ffi::bis_swipeable_get_progress(self.as_ref().to_glib_none().0) + } } #[doc(alias = "bis_swipeable_get_snap_points")] @@ -48,32 +55,17 @@ pub trait SwipeableExt: IsA + sealed::Sealed + 'static { fn snap_points(&self) -> Vec { unsafe { let mut n_snap_points = std::mem::MaybeUninit::uninit(); - let ret = FromGlibContainer::from_glib_full_num( - ffi::bis_swipeable_get_snap_points( - self.as_ref().to_glib_none().0, - n_snap_points.as_mut_ptr(), - ), - n_snap_points.assume_init() as _, - ); + let ret = FromGlibContainer::from_glib_full_num(ffi::bis_swipeable_get_snap_points(self.as_ref().to_glib_none().0, n_snap_points.as_mut_ptr()), n_snap_points.assume_init() as _); ret } } #[doc(alias = "bis_swipeable_get_swipe_area")] #[doc(alias = "get_swipe_area")] - fn swipe_area( - &self, - navigation_direction: NavigationDirection, - is_drag: bool, - ) -> gdk::Rectangle { + fn swipe_area(&self, navigation_direction: NavigationDirection, is_drag: bool) -> gdk::Rectangle { unsafe { let mut rect = gdk::Rectangle::uninitialized(); - ffi::bis_swipeable_get_swipe_area( - self.as_ref().to_glib_none().0, - navigation_direction.into_glib(), - is_drag.into_glib(), - rect.to_glib_none_mut().0, - ); + ffi::bis_swipeable_get_swipe_area(self.as_ref().to_glib_none().0, navigation_direction.into_glib(), is_drag.into_glib(), rect.to_glib_none_mut().0); rect } } diff --git a/libbismuth/src/auto/timed_animation.rs b/libbismuth/src/auto/timed_animation.rs index d3f4cf0..d27d78c 100644 --- a/libbismuth/src/auto/timed_animation.rs +++ b/libbismuth/src/auto/timed_animation.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, Animation, AnimationTarget, Easing}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,Animation,AnimationTarget,Easing}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "BisTimedAnimation")] @@ -22,83 +18,81 @@ glib::wrapper! { impl TimedAnimation { #[doc(alias = "bis_timed_animation_new")] - pub fn new( - widget: &impl IsA, - from: f64, - to: f64, - duration: u32, - target: impl IsA, - ) -> TimedAnimation { + pub fn new(widget: &impl IsA, from: f64, to: f64, duration: u32, target: impl IsA) -> TimedAnimation { skip_assert_initialized!(); unsafe { - Animation::from_glib_none(ffi::bis_timed_animation_new( - widget.as_ref().to_glib_none().0, - from, - to, - duration, - target.upcast().into_glib_ptr(), - )) - .unsafe_cast() + Animation::from_glib_none(ffi::bis_timed_animation_new(widget.as_ref().to_glib_none().0, from, to, duration, target.upcast().into_glib_ptr())).unsafe_cast() } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`TimedAnimation`] objects. - /// - /// This method returns an instance of [`TimedAnimationBuilder`](crate::builders::TimedAnimationBuilder) which can be used to create [`TimedAnimation`] objects. - pub fn builder() -> TimedAnimationBuilder { - TimedAnimationBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`TimedAnimation`] objects. + /// + /// This method returns an instance of [`TimedAnimationBuilder`](crate::builders::TimedAnimationBuilder) which can be used to create [`TimedAnimation`] objects. + pub fn builder() -> TimedAnimationBuilder { + TimedAnimationBuilder::new() + } + #[doc(alias = "bis_timed_animation_get_alternate")] #[doc(alias = "get_alternate")] #[doc(alias = "alternate")] pub fn is_alternate(&self) -> bool { unsafe { - from_glib(ffi::bis_timed_animation_get_alternate( - self.to_glib_none().0, - )) + from_glib(ffi::bis_timed_animation_get_alternate(self.to_glib_none().0)) } } #[doc(alias = "bis_timed_animation_get_duration")] #[doc(alias = "get_duration")] pub fn duration(&self) -> u32 { - unsafe { ffi::bis_timed_animation_get_duration(self.to_glib_none().0) } + unsafe { + ffi::bis_timed_animation_get_duration(self.to_glib_none().0) + } } #[doc(alias = "bis_timed_animation_get_easing")] #[doc(alias = "get_easing")] pub fn easing(&self) -> Easing { - unsafe { from_glib(ffi::bis_timed_animation_get_easing(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_timed_animation_get_easing(self.to_glib_none().0)) + } } #[doc(alias = "bis_timed_animation_get_repeat_count")] #[doc(alias = "get_repeat_count")] #[doc(alias = "repeat-count")] pub fn repeat_count(&self) -> u32 { - unsafe { ffi::bis_timed_animation_get_repeat_count(self.to_glib_none().0) } + unsafe { + ffi::bis_timed_animation_get_repeat_count(self.to_glib_none().0) + } } #[doc(alias = "bis_timed_animation_get_reverse")] #[doc(alias = "get_reverse")] #[doc(alias = "reverse")] pub fn is_reverse(&self) -> bool { - unsafe { from_glib(ffi::bis_timed_animation_get_reverse(self.to_glib_none().0)) } + unsafe { + from_glib(ffi::bis_timed_animation_get_reverse(self.to_glib_none().0)) + } } #[doc(alias = "bis_timed_animation_get_value_from")] #[doc(alias = "get_value_from")] #[doc(alias = "value-from")] pub fn value_from(&self) -> f64 { - unsafe { ffi::bis_timed_animation_get_value_from(self.to_glib_none().0) } + unsafe { + ffi::bis_timed_animation_get_value_from(self.to_glib_none().0) + } } #[doc(alias = "bis_timed_animation_get_value_to")] #[doc(alias = "get_value_to")] #[doc(alias = "value-to")] pub fn value_to(&self) -> f64 { - unsafe { ffi::bis_timed_animation_get_value_to(self.to_glib_none().0) } + unsafe { + ffi::bis_timed_animation_get_value_to(self.to_glib_none().0) + } } #[doc(alias = "bis_timed_animation_set_alternate")] @@ -159,246 +153,155 @@ impl TimedAnimation { #[doc(alias = "alternate")] pub fn connect_alternate_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_alternate_trampoline( - this: *mut ffi::BisTimedAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_alternate_trampoline(this: *mut ffi::BisTimedAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::alternate\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_alternate_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::alternate\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_alternate_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "duration")] pub fn connect_duration_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_duration_trampoline( - this: *mut ffi::BisTimedAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_duration_trampoline(this: *mut ffi::BisTimedAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::duration\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_duration_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_duration_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "easing")] pub fn connect_easing_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_easing_trampoline( - this: *mut ffi::BisTimedAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_easing_trampoline(this: *mut ffi::BisTimedAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::easing\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_easing_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::easing\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_easing_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "repeat-count")] pub fn connect_repeat_count_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_repeat_count_trampoline( - this: *mut ffi::BisTimedAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_repeat_count_trampoline(this: *mut ffi::BisTimedAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::repeat-count\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_repeat_count_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::repeat-count\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_repeat_count_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "reverse")] pub fn connect_reverse_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_reverse_trampoline( - this: *mut ffi::BisTimedAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_reverse_trampoline(this: *mut ffi::BisTimedAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::reverse\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_reverse_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::reverse\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_reverse_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "value-from")] pub fn connect_value_from_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_value_from_trampoline( - this: *mut ffi::BisTimedAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_value_from_trampoline(this: *mut ffi::BisTimedAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::value-from\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_value_from_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::value-from\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_value_from_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "value-to")] pub fn connect_value_to_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_value_to_trampoline( - this: *mut ffi::BisTimedAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_value_to_trampoline(this: *mut ffi::BisTimedAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::value-to\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_value_to_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::value-to\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_value_to_trampoline:: as *const ())), Box_::into_raw(f)) } } } impl Default for TimedAnimation { - fn default() -> Self { - glib::object::Object::new::() - } -} + fn default() -> Self { + glib::object::Object::new::() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`TimedAnimation`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`TimedAnimation`] 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 TimedAnimationBuilder { - builder: glib::object::ObjectBuilder<'static, TimedAnimation>, -} - -impl TimedAnimationBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, TimedAnimation>, } - } - pub fn alternate(self, alternate: bool) -> Self { - Self { - builder: self.builder.property("alternate", alternate), + impl TimedAnimationBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn duration(self, duration: u32) -> Self { - Self { - builder: self.builder.property("duration", duration), - } - } + pub fn alternate(self, alternate: bool) -> Self { + Self { builder: self.builder.property("alternate", alternate), } + } - pub fn easing(self, easing: Easing) -> Self { - Self { - builder: self.builder.property("easing", easing), - } - } + pub fn duration(self, duration: u32) -> Self { + Self { builder: self.builder.property("duration", duration), } + } - pub fn repeat_count(self, repeat_count: u32) -> Self { - Self { - builder: self.builder.property("repeat-count", repeat_count), - } - } + pub fn easing(self, easing: Easing) -> Self { + Self { builder: self.builder.property("easing", easing), } + } - pub fn reverse(self, reverse: bool) -> Self { - Self { - builder: self.builder.property("reverse", reverse), - } - } + pub fn repeat_count(self, repeat_count: u32) -> Self { + Self { builder: self.builder.property("repeat-count", repeat_count), } + } - pub fn value_from(self, value_from: f64) -> Self { - Self { - builder: self.builder.property("value-from", value_from), - } - } + pub fn reverse(self, reverse: bool) -> Self { + Self { builder: self.builder.property("reverse", reverse), } + } - pub fn value_to(self, value_to: f64) -> Self { - Self { - builder: self.builder.property("value-to", value_to), - } - } + pub fn value_from(self, value_from: f64) -> Self { + Self { builder: self.builder.property("value-from", value_from), } + } - pub fn target(self, target: &impl IsA) -> Self { - Self { - builder: self.builder.property("target", target.clone().upcast()), - } - } + pub fn value_to(self, value_to: f64) -> Self { + Self { builder: self.builder.property("value-to", value_to), } + } - pub fn widget(self, widget: &impl IsA) -> Self { - Self { - builder: self.builder.property("widget", widget.clone().upcast()), - } - } + pub fn target(self, target: &impl IsA) -> Self { + Self { builder: self.builder.property("target", target.clone().upcast()), } + } + + pub fn widget(self, widget: &impl IsA) -> Self { + Self { builder: self.builder.property("widget", widget.clone().upcast()), } + } // rustdoc-stripper-ignore-next /// Build the [`TimedAnimation`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> TimedAnimation { - self.builder.build() - } + self.builder.build() } } diff --git a/libbismuth/src/auto/versions.txt b/libbismuth/src/auto/versions.txt index 895a2c7..2a3a168 100644 --- a/libbismuth/src/auto/versions.txt +++ b/libbismuth/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ cec418b457aa) +Generated by gir (https://github.com/gtk-rs/gir @ 5c4134d75fd1) from -from gir-files (https://github.com/gtk-rs/gir-files.git @ 4d1189172a70) +from gir-files (https://github.com/gtk-rs/gir-files.git @ fa73af2178bc) diff --git a/libbismuth/src/lib.rs b/libbismuth/src/lib.rs index ad9d5e6..cd70fd0 100644 --- a/libbismuth/src/lib.rs +++ b/libbismuth/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::needless_doctest_main)] #![doc( html_logo_url = "https://raw.githubusercontent.com/tau-OS/libbismuth/main/assets/Bismuth.svg", diff --git a/libbismuth/sys/Cargo.toml b/libbismuth/sys/Cargo.toml index 5df1553..2810b97 100644 --- a/libbismuth/sys/Cargo.toml +++ b/libbismuth/sys/Cargo.toml @@ -33,34 +33,34 @@ libc = "0.2" [dependencies.gio-sys] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [dependencies.glib-sys] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [dependencies.gobject-sys] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [dependencies.gtk-sys] package = "gtk4-sys" git = "https://github.com/gtk-rs/gtk4-rs" -version = "0.9" +version = "0.10" branch = "master" [dependencies.gdk-sys] package = "gdk4-sys" git = "https://github.com/gtk-rs/gtk4-rs" -version = "0.9" +version = "0.10" branch = "master" [dependencies.pango-sys] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [build-dependencies] diff --git a/libbismuth/sys/build.rs b/libbismuth/sys/build.rs index 76b9be3..e39f6b9 100644 --- a/libbismuth/sys/build.rs +++ b/libbismuth/sys/build.rs @@ -1,6 +1,6 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ cec418b457aa) -// from -// from gir-files (https://github.com/gtk-rs/gir-files.git @ 4d1189172a70) +// Generated by gir (https://github.com/gtk-rs/gir @ 5c4134d75fd1) +// from +// from gir-files (https://github.com/gtk-rs/gir-files.git @ fa73af2178bc) // DO NOT EDIT #[cfg(not(docsrs))] diff --git a/libbismuth/sys/src/lib.rs b/libbismuth/sys/src/lib.rs index e12a4b2..35fe43b 100644 --- a/libbismuth/sys/src/lib.rs +++ b/libbismuth/sys/src/lib.rs @@ -1,29 +1,23 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ cec418b457aa) -// from -// from gir-files (https://github.com/gtk-rs/gir-files.git @ 4d1189172a70) +// Generated by gir (https://github.com/gtk-rs/gir @ 5c4134d75fd1) +// from +// from gir-files (https://github.com/gtk-rs/gir-files.git @ fa73af2178bc) // DO NOT EDIT #![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] -#![allow( - clippy::approx_constant, - clippy::type_complexity, - clippy::unreadable_literal, - clippy::upper_case_acronyms -)] +#![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal, clippy::upper_case_acronyms)] #![cfg_attr(docsrs, feature(doc_cfg))] -use gdk_sys as gdk; -use gio_sys as gio; use glib_sys as glib; use gobject_sys as gobject; +use gdk_sys as gdk; +use gio_sys as gio; use gtk_sys as gtk; use pango_sys as pango; #[allow(unused_imports)] -use libc::{ - c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, - intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE, -}; +use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, + c_short, c_ushort, c_long, c_ulong, + c_void, size_t, ssize_t, time_t, off_t, intptr_t, uintptr_t, FILE}; #[cfg(unix)] #[allow(unused_imports)] use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t}; @@ -118,8 +112,8 @@ pub struct BisAlbumClass { impl ::std::fmt::Debug for BisAlbumClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisAlbumClass @ {self:p}")) - .field("parent_class", &self.parent_class) - .finish() + .field("parent_class", &self.parent_class) + .finish() } } @@ -132,12 +126,13 @@ pub struct BisAlbumPageClass { impl ::std::fmt::Debug for BisAlbumPageClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisAlbumPageClass @ {self:p}")) - .field("parent_class", &self.parent_class) - .finish() + .field("parent_class", &self.parent_class) + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct _BisAnimationClass { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -146,6 +141,7 @@ pub struct _BisAnimationClass { pub type BisAnimationClass = _BisAnimationClass; #[repr(C)] +#[allow(dead_code)] pub struct _BisAnimationTargetClass { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -162,12 +158,13 @@ pub struct BisBinClass { impl ::std::fmt::Debug for BisBinClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisBinClass @ {self:p}")) - .field("parent_class", &self.parent_class) - .finish() + .field("parent_class", &self.parent_class) + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct _BisCallbackAnimationTargetClass { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -184,8 +181,8 @@ pub struct BisCarouselClass { impl ::std::fmt::Debug for BisCarouselClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisCarouselClass @ {self:p}")) - .field("parent_class", &self.parent_class) - .finish() + .field("parent_class", &self.parent_class) + .finish() } } @@ -198,8 +195,8 @@ pub struct BisCarouselIndicatorDotsClass { impl ::std::fmt::Debug for BisCarouselIndicatorDotsClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisCarouselIndicatorDotsClass @ {self:p}")) - .field("parent_class", &self.parent_class) - .finish() + .field("parent_class", &self.parent_class) + .finish() } } @@ -212,8 +209,8 @@ pub struct BisCarouselIndicatorLinesClass { impl ::std::fmt::Debug for BisCarouselIndicatorLinesClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisCarouselIndicatorLinesClass @ {self:p}")) - .field("parent_class", &self.parent_class) - .finish() + .field("parent_class", &self.parent_class) + .finish() } } @@ -226,8 +223,8 @@ pub struct BisEnumListItemClass { impl ::std::fmt::Debug for BisEnumListItemClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisEnumListItemClass @ {self:p}")) - .field("parent_class", &self.parent_class) - .finish() + .field("parent_class", &self.parent_class) + .finish() } } @@ -240,8 +237,8 @@ pub struct BisEnumListModelClass { impl ::std::fmt::Debug for BisEnumListModelClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisEnumListModelClass @ {self:p}")) - .field("parent_class", &self.parent_class) - .finish() + .field("parent_class", &self.parent_class) + .finish() } } @@ -254,8 +251,8 @@ pub struct BisHuggerClass { impl ::std::fmt::Debug for BisHuggerClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisHuggerClass @ {self:p}")) - .field("parent_class", &self.parent_class) - .finish() + .field("parent_class", &self.parent_class) + .finish() } } @@ -268,8 +265,8 @@ pub struct BisHuggerPageClass { impl ::std::fmt::Debug for BisHuggerPageClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisHuggerPageClass @ {self:p}")) - .field("parent_class", &self.parent_class) - .finish() + .field("parent_class", &self.parent_class) + .finish() } } @@ -282,8 +279,8 @@ pub struct BisLapelClass { impl ::std::fmt::Debug for BisLapelClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisLapelClass @ {self:p}")) - .field("parent_class", &self.parent_class) - .finish() + .field("parent_class", &self.parent_class) + .finish() } } @@ -296,8 +293,8 @@ pub struct BisLatchClass { impl ::std::fmt::Debug for BisLatchClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisLatchClass @ {self:p}")) - .field("parent_class", &self.parent_class) - .finish() + .field("parent_class", &self.parent_class) + .finish() } } @@ -310,8 +307,8 @@ pub struct BisLatchLayoutClass { impl ::std::fmt::Debug for BisLatchLayoutClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisLatchLayoutClass @ {self:p}")) - .field("parent_class", &self.parent_class) - .finish() + .field("parent_class", &self.parent_class) + .finish() } } @@ -324,12 +321,13 @@ pub struct BisLatchScrollableClass { impl ::std::fmt::Debug for BisLatchScrollableClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisLatchScrollableClass @ {self:p}")) - .field("parent_class", &self.parent_class) - .finish() + .field("parent_class", &self.parent_class) + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct _BisPropertyAnimationTargetClass { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -338,6 +336,7 @@ pub struct _BisPropertyAnimationTargetClass { pub type BisPropertyAnimationTargetClass = _BisPropertyAnimationTargetClass; #[repr(C)] +#[allow(dead_code)] pub struct _BisSpringAnimationClass { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -346,6 +345,7 @@ pub struct _BisSpringAnimationClass { pub type BisSpringAnimationClass = _BisSpringAnimationClass; #[repr(C)] +#[allow(dead_code)] pub struct BisSpringParams { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -354,7 +354,7 @@ pub struct BisSpringParams { impl ::std::fmt::Debug for BisSpringParams { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisSpringParams @ {self:p}")) - .finish() + .finish() } } @@ -367,8 +367,8 @@ pub struct BisSwipeTrackerClass { impl ::std::fmt::Debug for BisSwipeTrackerClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisSwipeTrackerClass @ {self:p}")) - .field("parent_class", &self.parent_class) - .finish() + .field("parent_class", &self.parent_class) + .finish() } } @@ -377,35 +377,28 @@ impl ::std::fmt::Debug for BisSwipeTrackerClass { pub struct BisSwipeableInterface { pub parent: gobject::GTypeInterface, pub get_distance: Option c_double>, - pub get_snap_points: - Option *mut c_double>, + pub get_snap_points: Option *mut c_double>, pub get_progress: Option c_double>, pub get_cancel_progress: Option c_double>, - pub get_swipe_area: Option< - unsafe extern "C" fn( - *mut BisSwipeable, - BisNavigationDirection, - gboolean, - *mut gdk::GdkRectangle, - ), - >, + pub get_swipe_area: Option, pub padding: [gpointer; 4], } impl ::std::fmt::Debug for BisSwipeableInterface { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisSwipeableInterface @ {self:p}")) - .field("parent", &self.parent) - .field("get_distance", &self.get_distance) - .field("get_snap_points", &self.get_snap_points) - .field("get_progress", &self.get_progress) - .field("get_cancel_progress", &self.get_cancel_progress) - .field("get_swipe_area", &self.get_swipe_area) - .finish() + .field("parent", &self.parent) + .field("get_distance", &self.get_distance) + .field("get_snap_points", &self.get_snap_points) + .field("get_progress", &self.get_progress) + .field("get_cancel_progress", &self.get_cancel_progress) + .field("get_swipe_area", &self.get_swipe_area) + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct _BisTimedAnimationClass { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -415,6 +408,7 @@ pub type BisTimedAnimationClass = _BisTimedAnimationClass; // Classes #[repr(C)] +#[allow(dead_code)] pub struct BisAlbum { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -422,11 +416,13 @@ pub struct BisAlbum { impl ::std::fmt::Debug for BisAlbum { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("BisAlbum @ {self:p}")).finish() + f.debug_struct(&format!("BisAlbum @ {self:p}")) + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct BisAlbumPage { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -434,7 +430,8 @@ pub struct BisAlbumPage { impl ::std::fmt::Debug for BisAlbumPage { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("BisAlbumPage @ {self:p}")).finish() + f.debug_struct(&format!("BisAlbumPage @ {self:p}")) + .finish() } } @@ -447,12 +444,13 @@ pub struct BisAnimation { impl ::std::fmt::Debug for BisAnimation { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisAnimation @ {self:p}")) - .field("parent_instance", &self.parent_instance) - .finish() + .field("parent_instance", &self.parent_instance) + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct BisAnimationTarget { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -461,7 +459,7 @@ pub struct BisAnimationTarget { impl ::std::fmt::Debug for BisAnimationTarget { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisAnimationTarget @ {self:p}")) - .finish() + .finish() } } @@ -474,12 +472,13 @@ pub struct BisBin { impl ::std::fmt::Debug for BisBin { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisBin @ {self:p}")) - .field("parent_instance", &self.parent_instance) - .finish() + .field("parent_instance", &self.parent_instance) + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct BisCallbackAnimationTarget { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -488,11 +487,12 @@ pub struct BisCallbackAnimationTarget { impl ::std::fmt::Debug for BisCallbackAnimationTarget { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisCallbackAnimationTarget @ {self:p}")) - .finish() + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct BisCarousel { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -500,11 +500,13 @@ pub struct BisCarousel { impl ::std::fmt::Debug for BisCarousel { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("BisCarousel @ {self:p}")).finish() + f.debug_struct(&format!("BisCarousel @ {self:p}")) + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct BisCarouselIndicatorDots { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -513,11 +515,12 @@ pub struct BisCarouselIndicatorDots { impl ::std::fmt::Debug for BisCarouselIndicatorDots { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisCarouselIndicatorDots @ {self:p}")) - .finish() + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct BisCarouselIndicatorLines { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -526,11 +529,12 @@ pub struct BisCarouselIndicatorLines { impl ::std::fmt::Debug for BisCarouselIndicatorLines { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisCarouselIndicatorLines @ {self:p}")) - .finish() + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct BisEnumListItem { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -539,11 +543,12 @@ pub struct BisEnumListItem { impl ::std::fmt::Debug for BisEnumListItem { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisEnumListItem @ {self:p}")) - .finish() + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct BisEnumListModel { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -552,11 +557,12 @@ pub struct BisEnumListModel { impl ::std::fmt::Debug for BisEnumListModel { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisEnumListModel @ {self:p}")) - .finish() + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct BisHugger { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -564,11 +570,13 @@ pub struct BisHugger { impl ::std::fmt::Debug for BisHugger { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("BisHugger @ {self:p}")).finish() + f.debug_struct(&format!("BisHugger @ {self:p}")) + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct BisHuggerPage { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -577,11 +585,12 @@ pub struct BisHuggerPage { impl ::std::fmt::Debug for BisHuggerPage { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisHuggerPage @ {self:p}")) - .finish() + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct BisLapel { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -589,11 +598,13 @@ pub struct BisLapel { impl ::std::fmt::Debug for BisLapel { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("BisLapel @ {self:p}")).finish() + f.debug_struct(&format!("BisLapel @ {self:p}")) + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct BisLatch { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -601,11 +612,13 @@ pub struct BisLatch { impl ::std::fmt::Debug for BisLatch { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("BisLatch @ {self:p}")).finish() + f.debug_struct(&format!("BisLatch @ {self:p}")) + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct BisLatchLayout { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -614,11 +627,12 @@ pub struct BisLatchLayout { impl ::std::fmt::Debug for BisLatchLayout { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisLatchLayout @ {self:p}")) - .finish() + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct BisLatchScrollable { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -627,11 +641,12 @@ pub struct BisLatchScrollable { impl ::std::fmt::Debug for BisLatchScrollable { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisLatchScrollable @ {self:p}")) - .finish() + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct BisPropertyAnimationTarget { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -640,11 +655,12 @@ pub struct BisPropertyAnimationTarget { impl ::std::fmt::Debug for BisPropertyAnimationTarget { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisPropertyAnimationTarget @ {self:p}")) - .finish() + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct BisSpringAnimation { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -653,11 +669,12 @@ pub struct BisSpringAnimation { impl ::std::fmt::Debug for BisSpringAnimation { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisSpringAnimation @ {self:p}")) - .finish() + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct BisSwipeTracker { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -666,11 +683,12 @@ pub struct BisSwipeTracker { impl ::std::fmt::Debug for BisSwipeTracker { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisSwipeTracker @ {self:p}")) - .finish() + .finish() } } #[repr(C)] +#[allow(dead_code)] pub struct BisTimedAnimation { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -679,12 +697,13 @@ pub struct BisTimedAnimation { impl ::std::fmt::Debug for BisTimedAnimation { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("BisTimedAnimation @ {self:p}")) - .finish() + .finish() } } // Interfaces #[repr(C)] +#[allow(dead_code)] pub struct BisSwipeable { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, @@ -696,6 +715,7 @@ impl ::std::fmt::Debug for BisSwipeable { } } + #[link(name = "bismuth-1")] extern "C" { @@ -744,16 +764,8 @@ extern "C" { // BisSpringParams //========================================================================= pub fn bis_spring_params_get_type() -> GType; - pub fn bis_spring_params_new( - damping_ratio: c_double, - mass: c_double, - stiffness: c_double, - ) -> *mut BisSpringParams; - pub fn bis_spring_params_new_full( - damping: c_double, - mass: c_double, - stiffness: c_double, - ) -> *mut BisSpringParams; + pub fn bis_spring_params_new(damping_ratio: c_double, mass: c_double, stiffness: c_double) -> *mut BisSpringParams; + pub fn bis_spring_params_new_full(damping: c_double, mass: c_double, stiffness: c_double) -> *mut BisSpringParams; pub fn bis_spring_params_get_damping(self_: *mut BisSpringParams) -> c_double; pub fn bis_spring_params_get_damping_ratio(self_: *mut BisSpringParams) -> c_double; pub fn bis_spring_params_get_mass(self_: *mut BisSpringParams) -> c_double; @@ -767,56 +779,32 @@ extern "C" { pub fn bis_album_get_type() -> GType; pub fn bis_album_new() -> *mut gtk::GtkWidget; pub fn bis_album_append(self_: *mut BisAlbum, child: *mut gtk::GtkWidget) -> *mut BisAlbumPage; - pub fn bis_album_get_adjacent_child( - self_: *mut BisAlbum, - direction: BisNavigationDirection, - ) -> *mut gtk::GtkWidget; + pub fn bis_album_get_adjacent_child(self_: *mut BisAlbum, direction: BisNavigationDirection) -> *mut gtk::GtkWidget; pub fn bis_album_get_can_navigate_back(self_: *mut BisAlbum) -> gboolean; pub fn bis_album_get_can_navigate_forward(self_: *mut BisAlbum) -> gboolean; pub fn bis_album_get_can_unfold(self_: *mut BisAlbum) -> gboolean; - pub fn bis_album_get_child_by_name( - self_: *mut BisAlbum, - name: *const c_char, - ) -> *mut gtk::GtkWidget; + pub fn bis_album_get_child_by_name(self_: *mut BisAlbum, name: *const c_char) -> *mut gtk::GtkWidget; pub fn bis_album_get_child_transition_params(self_: *mut BisAlbum) -> *mut BisSpringParams; pub fn bis_album_get_child_transition_running(self_: *mut BisAlbum) -> gboolean; pub fn bis_album_get_fold_threshold_policy(self_: *mut BisAlbum) -> BisFoldThresholdPolicy; pub fn bis_album_get_folded(self_: *mut BisAlbum) -> gboolean; pub fn bis_album_get_homogeneous(self_: *mut BisAlbum) -> gboolean; pub fn bis_album_get_mode_transition_duration(self_: *mut BisAlbum) -> c_uint; - pub fn bis_album_get_page( - self_: *mut BisAlbum, - child: *mut gtk::GtkWidget, - ) -> *mut BisAlbumPage; + pub fn bis_album_get_page(self_: *mut BisAlbum, child: *mut gtk::GtkWidget) -> *mut BisAlbumPage; pub fn bis_album_get_pages(self_: *mut BisAlbum) -> *mut gtk::GtkSelectionModel; pub fn bis_album_get_transition_type(self_: *mut BisAlbum) -> BisAlbumTransitionType; pub fn bis_album_get_visible_child(self_: *mut BisAlbum) -> *mut gtk::GtkWidget; pub fn bis_album_get_visible_child_name(self_: *mut BisAlbum) -> *const c_char; - pub fn bis_album_insert_child_after( - self_: *mut BisAlbum, - child: *mut gtk::GtkWidget, - sibling: *mut gtk::GtkWidget, - ) -> *mut BisAlbumPage; + pub fn bis_album_insert_child_after(self_: *mut BisAlbum, child: *mut gtk::GtkWidget, sibling: *mut gtk::GtkWidget) -> *mut BisAlbumPage; pub fn bis_album_navigate(self_: *mut BisAlbum, direction: BisNavigationDirection) -> gboolean; - pub fn bis_album_prepend(self_: *mut BisAlbum, child: *mut gtk::GtkWidget) - -> *mut BisAlbumPage; + pub fn bis_album_prepend(self_: *mut BisAlbum, child: *mut gtk::GtkWidget) -> *mut BisAlbumPage; pub fn bis_album_remove(self_: *mut BisAlbum, child: *mut gtk::GtkWidget); - pub fn bis_album_reorder_child_after( - self_: *mut BisAlbum, - child: *mut gtk::GtkWidget, - sibling: *mut gtk::GtkWidget, - ); + pub fn bis_album_reorder_child_after(self_: *mut BisAlbum, child: *mut gtk::GtkWidget, sibling: *mut gtk::GtkWidget); pub fn bis_album_set_can_navigate_back(self_: *mut BisAlbum, can_navigate_back: gboolean); pub fn bis_album_set_can_navigate_forward(self_: *mut BisAlbum, can_navigate_forward: gboolean); pub fn bis_album_set_can_unfold(self_: *mut BisAlbum, can_unfold: gboolean); - pub fn bis_album_set_child_transition_params( - self_: *mut BisAlbum, - params: *mut BisSpringParams, - ); - pub fn bis_album_set_fold_threshold_policy( - self_: *mut BisAlbum, - policy: BisFoldThresholdPolicy, - ); + pub fn bis_album_set_child_transition_params(self_: *mut BisAlbum, params: *mut BisSpringParams); + pub fn bis_album_set_fold_threshold_policy(self_: *mut BisAlbum, policy: BisFoldThresholdPolicy); pub fn bis_album_set_homogeneous(self_: *mut BisAlbum, homogeneous: gboolean); pub fn bis_album_set_mode_transition_duration(self_: *mut BisAlbum, duration: c_uint); pub fn bis_album_set_transition_type(self_: *mut BisAlbum, transition: BisAlbumTransitionType); @@ -865,11 +853,7 @@ extern "C" { // BisCallbackAnimationTarget //========================================================================= pub fn bis_callback_animation_target_get_type() -> GType; - pub fn bis_callback_animation_target_new( - callback: BisAnimationTargetFunc, - user_data: gpointer, - destroy: glib::GDestroyNotify, - ) -> *mut BisAnimationTarget; + pub fn bis_callback_animation_target_new(callback: BisAnimationTargetFunc, user_data: gpointer, destroy: glib::GDestroyNotify) -> *mut BisAnimationTarget; //========================================================================= // BisCarousel @@ -887,29 +871,14 @@ extern "C" { pub fn bis_carousel_get_reveal_duration(self_: *mut BisCarousel) -> c_uint; pub fn bis_carousel_get_scroll_params(self_: *mut BisCarousel) -> *mut BisSpringParams; pub fn bis_carousel_get_spacing(self_: *mut BisCarousel) -> c_uint; - pub fn bis_carousel_insert( - self_: *mut BisCarousel, - child: *mut gtk::GtkWidget, - position: c_int, - ); + pub fn bis_carousel_insert(self_: *mut BisCarousel, child: *mut gtk::GtkWidget, position: c_int); pub fn bis_carousel_prepend(self_: *mut BisCarousel, child: *mut gtk::GtkWidget); pub fn bis_carousel_remove(self_: *mut BisCarousel, child: *mut gtk::GtkWidget); - pub fn bis_carousel_reorder( - self_: *mut BisCarousel, - child: *mut gtk::GtkWidget, - position: c_int, - ); - pub fn bis_carousel_scroll_to( - self_: *mut BisCarousel, - widget: *mut gtk::GtkWidget, - animate: gboolean, - ); + pub fn bis_carousel_reorder(self_: *mut BisCarousel, child: *mut gtk::GtkWidget, position: c_int); + pub fn bis_carousel_scroll_to(self_: *mut BisCarousel, widget: *mut gtk::GtkWidget, animate: gboolean); pub fn bis_carousel_set_allow_long_swipes(self_: *mut BisCarousel, allow_long_swipes: gboolean); pub fn bis_carousel_set_allow_mouse_drag(self_: *mut BisCarousel, allow_mouse_drag: gboolean); - pub fn bis_carousel_set_allow_scroll_wheel( - self_: *mut BisCarousel, - allow_scroll_wheel: gboolean, - ); + pub fn bis_carousel_set_allow_scroll_wheel(self_: *mut BisCarousel, allow_scroll_wheel: gboolean); pub fn bis_carousel_set_interactive(self_: *mut BisCarousel, interactive: gboolean); pub fn bis_carousel_set_reveal_duration(self_: *mut BisCarousel, reveal_duration: c_uint); pub fn bis_carousel_set_scroll_params(self_: *mut BisCarousel, params: *mut BisSpringParams); @@ -920,26 +889,16 @@ extern "C" { //========================================================================= pub fn bis_carousel_indicator_dots_get_type() -> GType; pub fn bis_carousel_indicator_dots_new() -> *mut gtk::GtkWidget; - pub fn bis_carousel_indicator_dots_get_carousel( - self_: *mut BisCarouselIndicatorDots, - ) -> *mut BisCarousel; - pub fn bis_carousel_indicator_dots_set_carousel( - self_: *mut BisCarouselIndicatorDots, - carousel: *mut BisCarousel, - ); + pub fn bis_carousel_indicator_dots_get_carousel(self_: *mut BisCarouselIndicatorDots) -> *mut BisCarousel; + pub fn bis_carousel_indicator_dots_set_carousel(self_: *mut BisCarouselIndicatorDots, carousel: *mut BisCarousel); //========================================================================= // BisCarouselIndicatorLines //========================================================================= pub fn bis_carousel_indicator_lines_get_type() -> GType; pub fn bis_carousel_indicator_lines_new() -> *mut gtk::GtkWidget; - pub fn bis_carousel_indicator_lines_get_carousel( - self_: *mut BisCarouselIndicatorLines, - ) -> *mut BisCarousel; - pub fn bis_carousel_indicator_lines_set_carousel( - self_: *mut BisCarouselIndicatorLines, - carousel: *mut BisCarousel, - ); + pub fn bis_carousel_indicator_lines_get_carousel(self_: *mut BisCarouselIndicatorLines) -> *mut BisCarousel; + pub fn bis_carousel_indicator_lines_set_carousel(self_: *mut BisCarouselIndicatorLines, carousel: *mut BisCarousel); //========================================================================= // BisEnumListItem @@ -966,10 +925,7 @@ extern "C" { pub fn bis_hugger_get_allow_none(self_: *mut BisHugger) -> gboolean; pub fn bis_hugger_get_homogeneous(self_: *mut BisHugger) -> gboolean; pub fn bis_hugger_get_interpolate_size(self_: *mut BisHugger) -> gboolean; - pub fn bis_hugger_get_page( - self_: *mut BisHugger, - child: *mut gtk::GtkWidget, - ) -> *mut BisHuggerPage; + pub fn bis_hugger_get_page(self_: *mut BisHugger, child: *mut gtk::GtkWidget) -> *mut BisHuggerPage; pub fn bis_hugger_get_pages(self_: *mut BisHugger) -> *mut gtk::GtkSelectionModel; pub fn bis_hugger_get_switch_threshold_policy(self_: *mut BisHugger) -> BisFoldThresholdPolicy; pub fn bis_hugger_get_transition_duration(self_: *mut BisHugger) -> c_uint; @@ -982,15 +938,9 @@ extern "C" { pub fn bis_hugger_set_allow_none(self_: *mut BisHugger, allow_none: gboolean); pub fn bis_hugger_set_homogeneous(self_: *mut BisHugger, homogeneous: gboolean); pub fn bis_hugger_set_interpolate_size(self_: *mut BisHugger, interpolate_size: gboolean); - pub fn bis_hugger_set_switch_threshold_policy( - self_: *mut BisHugger, - policy: BisFoldThresholdPolicy, - ); + pub fn bis_hugger_set_switch_threshold_policy(self_: *mut BisHugger, policy: BisFoldThresholdPolicy); pub fn bis_hugger_set_transition_duration(self_: *mut BisHugger, duration: c_uint); - pub fn bis_hugger_set_transition_type( - self_: *mut BisHugger, - transition: BisHuggerTransitionType, - ); + pub fn bis_hugger_set_transition_type(self_: *mut BisHugger, transition: BisHuggerTransitionType); pub fn bis_hugger_set_xalign(self_: *mut BisHugger, xalign: c_float); pub fn bis_hugger_set_yalign(self_: *mut BisHugger, yalign: c_float); @@ -1026,10 +976,7 @@ extern "C" { pub fn bis_lapel_set_content(self_: *mut BisLapel, content: *mut gtk::GtkWidget); pub fn bis_lapel_set_fold_duration(self_: *mut BisLapel, duration: c_uint); pub fn bis_lapel_set_fold_policy(self_: *mut BisLapel, policy: BisLapelFoldPolicy); - pub fn bis_lapel_set_fold_threshold_policy( - self_: *mut BisLapel, - policy: BisFoldThresholdPolicy, - ); + pub fn bis_lapel_set_fold_threshold_policy(self_: *mut BisLapel, policy: BisFoldThresholdPolicy); pub fn bis_lapel_set_lapel(self_: *mut BisLapel, lapel: *mut gtk::GtkWidget); pub fn bis_lapel_set_lapel_position(self_: *mut BisLapel, position: gtk::GtkPackType); pub fn bis_lapel_set_locked(self_: *mut BisLapel, locked: gboolean); @@ -1039,10 +986,7 @@ extern "C" { pub fn bis_lapel_set_separator(self_: *mut BisLapel, separator: *mut gtk::GtkWidget); pub fn bis_lapel_set_swipe_to_close(self_: *mut BisLapel, swipe_to_close: gboolean); pub fn bis_lapel_set_swipe_to_open(self_: *mut BisLapel, swipe_to_open: gboolean); - pub fn bis_lapel_set_transition_type( - self_: *mut BisLapel, - transition_type: BisLapelTransitionType, - ); + pub fn bis_lapel_set_transition_type(self_: *mut BisLapel, transition_type: BisLapelTransitionType); //========================================================================= // BisLatch @@ -1064,10 +1008,7 @@ extern "C" { pub fn bis_latch_layout_get_maximum_size(self_: *mut BisLatchLayout) -> c_int; pub fn bis_latch_layout_get_tightening_threshold(self_: *mut BisLatchLayout) -> c_int; pub fn bis_latch_layout_set_maximum_size(self_: *mut BisLatchLayout, maximum_size: c_int); - pub fn bis_latch_layout_set_tightening_threshold( - self_: *mut BisLatchLayout, - tightening_threshold: c_int, - ); + pub fn bis_latch_layout_set_tightening_threshold(self_: *mut BisLatchLayout, tightening_threshold: c_int); //========================================================================= // BisLatchScrollable @@ -1077,18 +1018,9 @@ extern "C" { pub fn bis_latch_scrollable_get_child(self_: *mut BisLatchScrollable) -> *mut gtk::GtkWidget; pub fn bis_latch_scrollable_get_maximum_size(self_: *mut BisLatchScrollable) -> c_int; pub fn bis_latch_scrollable_get_tightening_threshold(self_: *mut BisLatchScrollable) -> c_int; - pub fn bis_latch_scrollable_set_child( - self_: *mut BisLatchScrollable, - child: *mut gtk::GtkWidget, - ); - pub fn bis_latch_scrollable_set_maximum_size( - self_: *mut BisLatchScrollable, - maximum_size: c_int, - ); - pub fn bis_latch_scrollable_set_tightening_threshold( - self_: *mut BisLatchScrollable, - tightening_threshold: c_int, - ); + pub fn bis_latch_scrollable_set_child(self_: *mut BisLatchScrollable, child: *mut gtk::GtkWidget); + pub fn bis_latch_scrollable_set_maximum_size(self_: *mut BisLatchScrollable, maximum_size: c_int); + pub fn bis_latch_scrollable_set_tightening_threshold(self_: *mut BisLatchScrollable, tightening_threshold: c_int); //========================================================================= // BisPropertyAnimationTarget @@ -1098,58 +1030,34 @@ extern "C" { pub fn bis_property_animation_target_get_type() -> GType; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] - pub fn bis_property_animation_target_new( - object: *mut gobject::GObject, - property_name: *const c_char, - ) -> *mut BisAnimationTarget; + pub fn bis_property_animation_target_new(object: *mut gobject::GObject, property_name: *const c_char) -> *mut BisAnimationTarget; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] - pub fn bis_property_animation_target_new_for_pspec( - object: *mut gobject::GObject, - pspec: *mut gobject::GParamSpec, - ) -> *mut BisAnimationTarget; + pub fn bis_property_animation_target_new_for_pspec(object: *mut gobject::GObject, pspec: *mut gobject::GParamSpec) -> *mut BisAnimationTarget; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] - pub fn bis_property_animation_target_get_object( - self_: *mut BisPropertyAnimationTarget, - ) -> *mut gobject::GObject; + pub fn bis_property_animation_target_get_object(self_: *mut BisPropertyAnimationTarget) -> *mut gobject::GObject; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] - pub fn bis_property_animation_target_get_pspec( - self_: *mut BisPropertyAnimationTarget, - ) -> *mut gobject::GParamSpec; + pub fn bis_property_animation_target_get_pspec(self_: *mut BisPropertyAnimationTarget) -> *mut gobject::GParamSpec; //========================================================================= // BisSpringAnimation //========================================================================= pub fn bis_spring_animation_get_type() -> GType; - pub fn bis_spring_animation_new( - widget: *mut gtk::GtkWidget, - from: c_double, - to: c_double, - spring_params: *mut BisSpringParams, - target: *mut BisAnimationTarget, - ) -> *mut BisAnimation; + pub fn bis_spring_animation_new(widget: *mut gtk::GtkWidget, from: c_double, to: c_double, spring_params: *mut BisSpringParams, target: *mut BisAnimationTarget) -> *mut BisAnimation; pub fn bis_spring_animation_get_epsilon(self_: *mut BisSpringAnimation) -> c_double; pub fn bis_spring_animation_get_estimated_duration(self_: *mut BisSpringAnimation) -> c_uint; pub fn bis_spring_animation_get_initial_velocity(self_: *mut BisSpringAnimation) -> c_double; pub fn bis_spring_animation_get_latch(self_: *mut BisSpringAnimation) -> gboolean; - pub fn bis_spring_animation_get_spring_params( - self_: *mut BisSpringAnimation, - ) -> *mut BisSpringParams; + pub fn bis_spring_animation_get_spring_params(self_: *mut BisSpringAnimation) -> *mut BisSpringParams; pub fn bis_spring_animation_get_value_from(self_: *mut BisSpringAnimation) -> c_double; pub fn bis_spring_animation_get_value_to(self_: *mut BisSpringAnimation) -> c_double; pub fn bis_spring_animation_get_velocity(self_: *mut BisSpringAnimation) -> c_double; pub fn bis_spring_animation_set_epsilon(self_: *mut BisSpringAnimation, epsilon: c_double); - pub fn bis_spring_animation_set_initial_velocity( - self_: *mut BisSpringAnimation, - velocity: c_double, - ); + pub fn bis_spring_animation_set_initial_velocity(self_: *mut BisSpringAnimation, velocity: c_double); pub fn bis_spring_animation_set_latch(self_: *mut BisSpringAnimation, latch: gboolean); - pub fn bis_spring_animation_set_spring_params( - self_: *mut BisSpringAnimation, - spring_params: *mut BisSpringParams, - ); + pub fn bis_spring_animation_set_spring_params(self_: *mut BisSpringAnimation, spring_params: *mut BisSpringParams); pub fn bis_spring_animation_set_value_from(self_: *mut BisSpringAnimation, value: c_double); pub fn bis_spring_animation_set_value_to(self_: *mut BisSpringAnimation, value: c_double); @@ -1163,14 +1071,8 @@ extern "C" { pub fn bis_swipe_tracker_get_enabled(self_: *mut BisSwipeTracker) -> gboolean; pub fn bis_swipe_tracker_get_reversed(self_: *mut BisSwipeTracker) -> gboolean; pub fn bis_swipe_tracker_get_swipeable(self_: *mut BisSwipeTracker) -> *mut BisSwipeable; - pub fn bis_swipe_tracker_set_allow_long_swipes( - self_: *mut BisSwipeTracker, - allow_long_swipes: gboolean, - ); - pub fn bis_swipe_tracker_set_allow_mouse_drag( - self_: *mut BisSwipeTracker, - allow_mouse_drag: gboolean, - ); + pub fn bis_swipe_tracker_set_allow_long_swipes(self_: *mut BisSwipeTracker, allow_long_swipes: gboolean); + pub fn bis_swipe_tracker_set_allow_mouse_drag(self_: *mut BisSwipeTracker, allow_mouse_drag: gboolean); pub fn bis_swipe_tracker_set_enabled(self_: *mut BisSwipeTracker, enabled: gboolean); pub fn bis_swipe_tracker_set_reversed(self_: *mut BisSwipeTracker, reversed: gboolean); pub fn bis_swipe_tracker_shift_position(self_: *mut BisSwipeTracker, delta: c_double); @@ -1179,13 +1081,7 @@ extern "C" { // BisTimedAnimation //========================================================================= pub fn bis_timed_animation_get_type() -> GType; - pub fn bis_timed_animation_new( - widget: *mut gtk::GtkWidget, - from: c_double, - to: c_double, - duration: c_uint, - target: *mut BisAnimationTarget, - ) -> *mut BisAnimation; + pub fn bis_timed_animation_new(widget: *mut gtk::GtkWidget, from: c_double, to: c_double, duration: c_uint, target: *mut BisAnimationTarget) -> *mut BisAnimation; pub fn bis_timed_animation_get_alternate(self_: *mut BisTimedAnimation) -> gboolean; pub fn bis_timed_animation_get_duration(self_: *mut BisTimedAnimation) -> c_uint; pub fn bis_timed_animation_get_easing(self_: *mut BisTimedAnimation) -> BisEasing; @@ -1196,10 +1092,7 @@ extern "C" { pub fn bis_timed_animation_set_alternate(self_: *mut BisTimedAnimation, alternate: gboolean); pub fn bis_timed_animation_set_duration(self_: *mut BisTimedAnimation, duration: c_uint); pub fn bis_timed_animation_set_easing(self_: *mut BisTimedAnimation, easing: BisEasing); - pub fn bis_timed_animation_set_repeat_count( - self_: *mut BisTimedAnimation, - repeat_count: c_uint, - ); + pub fn bis_timed_animation_set_repeat_count(self_: *mut BisTimedAnimation, repeat_count: c_uint); pub fn bis_timed_animation_set_reverse(self_: *mut BisTimedAnimation, reverse: gboolean); pub fn bis_timed_animation_set_value_from(self_: *mut BisTimedAnimation, value: c_double); pub fn bis_timed_animation_set_value_to(self_: *mut BisTimedAnimation, value: c_double); @@ -1211,16 +1104,8 @@ extern "C" { pub fn bis_swipeable_get_cancel_progress(self_: *mut BisSwipeable) -> c_double; pub fn bis_swipeable_get_distance(self_: *mut BisSwipeable) -> c_double; pub fn bis_swipeable_get_progress(self_: *mut BisSwipeable) -> c_double; - pub fn bis_swipeable_get_snap_points( - self_: *mut BisSwipeable, - n_snap_points: *mut c_int, - ) -> *mut c_double; - pub fn bis_swipeable_get_swipe_area( - self_: *mut BisSwipeable, - navigation_direction: BisNavigationDirection, - is_drag: gboolean, - rect: *mut gdk::GdkRectangle, - ); + pub fn bis_swipeable_get_snap_points(self_: *mut BisSwipeable, n_snap_points: *mut c_int) -> *mut c_double; + pub fn bis_swipeable_get_swipe_area(self_: *mut BisSwipeable, navigation_direction: BisNavigationDirection, is_drag: gboolean, rect: *mut gdk::GdkRectangle); //========================================================================= // Other functions diff --git a/libbismuth/sys/tests/abi.rs b/libbismuth/sys/tests/abi.rs index b1b5f19..6ccf44f 100644 --- a/libbismuth/sys/tests/abi.rs +++ b/libbismuth/sys/tests/abi.rs @@ -1,15 +1,15 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ cec418b457aa) -// from -// from gir-files (https://github.com/gtk-rs/gir-files.git @ 4d1189172a70) +// Generated by gir (https://github.com/gtk-rs/gir @ 5c4134d75fd1) +// from +// from gir-files (https://github.com/gtk-rs/gir-files.git @ fa73af2178bc) // DO NOT EDIT #![cfg(unix)] use libbismuth_sys::*; +use std::mem::{align_of, size_of}; use std::env; use std::error::Error; use std::ffi::OsString; -use std::mem::{align_of, size_of}; use std::path::Path; use std::process::{Command, Stdio}; use std::str; @@ -67,7 +67,8 @@ fn pkg_config_cflags(packages: &[&str]) -> Result, Box> { if packages.is_empty() { return Ok(Vec::new()); } - let pkg_config = env::var_os("PKG_CONFIG").unwrap_or_else(|| OsString::from("pkg-config")); + let pkg_config = env::var_os("PKG_CONFIG") + .unwrap_or_else(|| OsString::from("pkg-config")); let mut cmd = Command::new(pkg_config); cmd.arg("--cflags"); cmd.args(packages); @@ -81,6 +82,7 @@ fn pkg_config_cflags(packages: &[&str]) -> Result, Box> { Ok(shell_words::split(stdout.trim())?) } + #[derive(Copy, Clone, Debug, Eq, PartialEq)] struct Layout { size: usize, @@ -162,7 +164,8 @@ fn cross_validate_layout_with_c() { let mut results = Results::default(); - for ((rust_name, rust_layout), (c_name, c_layout)) in RUST_LAYOUTS.iter().zip(c_layouts.iter()) + for ((rust_name, rust_layout), (c_name, c_layout)) in + RUST_LAYOUTS.iter().zip(c_layouts.iter()) { if rust_name != c_name { results.record_failed(); @@ -172,7 +175,9 @@ fn cross_validate_layout_with_c() { if rust_layout != c_layout { results.record_failed(); - eprintln!("Layout mismatch for {rust_name}\nRust: {rust_layout:?}\nC: {c_layout:?}",); + eprintln!( + "Layout mismatch for {rust_name}\nRust: {rust_layout:?}\nC: {c_layout:?}", + ); continue; } @@ -202,188 +207,32 @@ fn get_c_output(name: &str) -> Result> { } const RUST_LAYOUTS: &[(&str, Layout)] = &[ - ( - "BisAlbumClass", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisAlbumPageClass", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisAlbumTransitionType", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisAnimation", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisAnimationState", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisBin", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisBinClass", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisCarouselClass", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisCarouselIndicatorDotsClass", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisCarouselIndicatorLinesClass", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisEasing", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisEnumListItemClass", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisEnumListModelClass", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisFoldThresholdPolicy", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisHuggerClass", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisHuggerPageClass", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisHuggerTransitionType", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisLapelClass", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisLapelFoldPolicy", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisLapelTransitionType", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisLatchClass", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisLatchLayoutClass", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisLatchScrollableClass", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisNavigationDirection", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisSwipeTrackerClass", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), - ( - "BisSwipeableInterface", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), + ("BisAlbumClass", Layout {size: size_of::(), alignment: align_of::()}), + ("BisAlbumPageClass", Layout {size: size_of::(), alignment: align_of::()}), + ("BisAlbumTransitionType", Layout {size: size_of::(), alignment: align_of::()}), + ("BisAnimation", Layout {size: size_of::(), alignment: align_of::()}), + ("BisAnimationState", Layout {size: size_of::(), alignment: align_of::()}), + ("BisBin", Layout {size: size_of::(), alignment: align_of::()}), + ("BisBinClass", Layout {size: size_of::(), alignment: align_of::()}), + ("BisCarouselClass", Layout {size: size_of::(), alignment: align_of::()}), + ("BisCarouselIndicatorDotsClass", Layout {size: size_of::(), alignment: align_of::()}), + ("BisCarouselIndicatorLinesClass", Layout {size: size_of::(), alignment: align_of::()}), + ("BisEasing", Layout {size: size_of::(), alignment: align_of::()}), + ("BisEnumListItemClass", Layout {size: size_of::(), alignment: align_of::()}), + ("BisEnumListModelClass", Layout {size: size_of::(), alignment: align_of::()}), + ("BisFoldThresholdPolicy", Layout {size: size_of::(), alignment: align_of::()}), + ("BisHuggerClass", Layout {size: size_of::(), alignment: align_of::()}), + ("BisHuggerPageClass", Layout {size: size_of::(), alignment: align_of::()}), + ("BisHuggerTransitionType", Layout {size: size_of::(), alignment: align_of::()}), + ("BisLapelClass", Layout {size: size_of::(), alignment: align_of::()}), + ("BisLapelFoldPolicy", Layout {size: size_of::(), alignment: align_of::()}), + ("BisLapelTransitionType", Layout {size: size_of::(), alignment: align_of::()}), + ("BisLatchClass", Layout {size: size_of::(), alignment: align_of::()}), + ("BisLatchLayoutClass", Layout {size: size_of::(), alignment: align_of::()}), + ("BisLatchScrollableClass", Layout {size: size_of::(), alignment: align_of::()}), + ("BisNavigationDirection", Layout {size: size_of::(), alignment: align_of::()}), + ("BisSwipeTrackerClass", Layout {size: size_of::(), alignment: align_of::()}), + ("BisSwipeableInterface", Layout {size: size_of::(), alignment: align_of::()}), ]; const RUST_CONSTANTS: &[(&str, &str)] = &[ @@ -443,3 +292,5 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) BIS_NAVIGATION_DIRECTION_FORWARD", "1"), ("BIS_VERSION_S", "1.0.0"), ]; + + diff --git a/libbismuth/sys/tests/constant.c b/libbismuth/sys/tests/constant.c index 46ad1b7..522a2e2 100644 --- a/libbismuth/sys/tests/constant.c +++ b/libbismuth/sys/tests/constant.c @@ -1,6 +1,6 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ cec418b457aa) +// Generated by gir (https://github.com/gtk-rs/gir @ 5c4134d75fd1) // from -// from gir-files (https://github.com/gtk-rs/gir-files.git @ 4d1189172a70) +// from gir-files (https://github.com/gtk-rs/gir-files.git @ fa73af2178bc) // DO NOT EDIT #include "manual.h" diff --git a/libbismuth/sys/tests/layout.c b/libbismuth/sys/tests/layout.c index effd90b..9e1c15a 100644 --- a/libbismuth/sys/tests/layout.c +++ b/libbismuth/sys/tests/layout.c @@ -1,6 +1,6 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ cec418b457aa) +// Generated by gir (https://github.com/gtk-rs/gir @ 5c4134d75fd1) // from -// from gir-files (https://github.com/gtk-rs/gir-files.git @ 4d1189172a70) +// from gir-files (https://github.com/gtk-rs/gir-files.git @ fa73af2178bc) // DO NOT EDIT #include "manual.h" diff --git a/libhelium/Cargo.toml b/libhelium/Cargo.toml index b2394b1..83c3d36 100644 --- a/libhelium/Cargo.toml +++ b/libhelium/Cargo.toml @@ -44,34 +44,34 @@ futures-channel = "0.3" [dependencies.glib] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [dependencies.gio] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [dependencies.gdk-pixbuf] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [dependencies.pango] git = "https://github.com/gtk-rs/gtk-rs-core" -version = "0.20" +version = "0.21" branch = "master" [dependencies.gdk] package = "gdk4" git = "https://github.com/gtk-rs/gtk4-rs" -version = "0.9" +version = "0.10" branch = "master" [dependencies.gtk] package = "gtk4" git = "https://github.com/gtk-rs/gtk4-rs" -version = "0.9" +version = "0.10" branch = "master" [dependencies.ffi] diff --git a/libhelium/src/auto/about_window.rs b/libhelium/src/auto/about_window.rs index 335575e..73dc88c 100644 --- a/libhelium/src/auto/about_window.rs +++ b/libhelium/src/auto/about_window.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, AboutWindowLicenses, Colors, Window}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,AboutWindowLicenses,Colors,Window}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "HeAboutWindow")] @@ -21,507 +17,330 @@ glib::wrapper! { } impl AboutWindow { - pub const NONE: Option<&'static AboutWindow> = None; + pub const NONE: Option<&'static AboutWindow> = None; + #[doc(alias = "he_about_window_new")] - pub fn new( - parent: &impl IsA, - app_name: &str, - app_id: &str, - version: &str, - icon: &str, - translate_url: Option<&str>, - issue_url: Option<&str>, - more_info_url: Option<&str>, - translators: &[&str], - developers: &[&str], - copyright_year: i32, - license: AboutWindowLicenses, - color: Colors, - ) -> AboutWindow { + pub fn new(parent: &impl IsA, app_name: &str, app_id: &str, version: &str, icon: &str, translate_url: Option<&str>, issue_url: Option<&str>, more_info_url: Option<&str>, translators: &[&str], developers: &[&str], copyright_year: i32, license: AboutWindowLicenses, color: Colors) -> AboutWindow { assert_initialized_main_thread!(); let translators_length1 = translators.len() as _; let developers_length1 = developers.len() as _; unsafe { - from_glib_none(ffi::he_about_window_new( - parent.as_ref().to_glib_none().0, - app_name.to_glib_none().0, - app_id.to_glib_none().0, - version.to_glib_none().0, - icon.to_glib_none().0, - translate_url.to_glib_none().0, - issue_url.to_glib_none().0, - more_info_url.to_glib_none().0, - translators.to_glib_none().0, - translators_length1, - developers.to_glib_none().0, - developers_length1, - copyright_year, - license.into_glib(), - color.into_glib(), - )) + from_glib_none(ffi::he_about_window_new(parent.as_ref().to_glib_none().0, app_name.to_glib_none().0, app_id.to_glib_none().0, version.to_glib_none().0, icon.to_glib_none().0, translate_url.to_glib_none().0, issue_url.to_glib_none().0, more_info_url.to_glib_none().0, translators.to_glib_none().0, translators_length1, developers.to_glib_none().0, developers_length1, copyright_year, license.into_glib(), color.into_glib())) } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`AboutWindow`] objects. - /// - /// This method returns an instance of [`AboutWindowBuilder`](crate::builders::AboutWindowBuilder) which can be used to create [`AboutWindow`] objects. - pub fn builder() -> AboutWindowBuilder { - AboutWindowBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`AboutWindow`] objects. + /// + /// This method returns an instance of [`AboutWindowBuilder`](crate::builders::AboutWindowBuilder) which can be used to create [`AboutWindow`] objects. + pub fn builder() -> AboutWindowBuilder { + AboutWindowBuilder::new() + } + } impl Default for AboutWindow { - fn default() -> Self { - glib::object::Object::new::() - } -} + fn default() -> Self { + glib::object::Object::new::() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`AboutWindow`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`AboutWindow`] 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 AboutWindowBuilder { - builder: glib::object::ObjectBuilder<'static, AboutWindow>, -} - -impl AboutWindowBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, AboutWindow>, } - } - pub fn color(self, color: Colors) -> Self { - Self { - builder: self.builder.property("color", color), + impl AboutWindowBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn license(self, license: AboutWindowLicenses) -> Self { - Self { - builder: self.builder.property("license", license), - } - } + pub fn color(self, color: Colors) -> Self { + Self { builder: self.builder.property("color", color), } + } - pub fn version(self, version: impl Into) -> Self { - Self { - builder: self.builder.property("version", version.into()), - } - } + pub fn license(self, license: AboutWindowLicenses) -> Self { + Self { builder: self.builder.property("license", license), } + } - pub fn app_name(self, app_name: impl Into) -> Self { - Self { - builder: self.builder.property("app-name", app_name.into()), - } - } + pub fn version(self, version: impl Into) -> Self { + Self { builder: self.builder.property("version", version.into()), } + } - pub fn icon(self, icon: impl Into) -> Self { - Self { - builder: self.builder.property("icon", icon.into()), - } - } + pub fn app_name(self, app_name: impl Into) -> Self { + Self { builder: self.builder.property("app-name", app_name.into()), } + } - pub fn translator_names(self, translator_names: impl Into) -> Self { - Self { - builder: self - .builder - .property("translator-names", translator_names.into()), - } - } + pub fn icon(self, icon: impl Into) -> Self { + Self { builder: self.builder.property("icon", icon.into()), } + } - pub fn developer_names(self, developer_names: impl Into) -> Self { - Self { - builder: self - .builder - .property("developer-names", developer_names.into()), - } - } + pub fn translator_names(self, translator_names: impl Into) -> Self { + Self { builder: self.builder.property("translator-names", translator_names.into()), } + } - pub fn copyright_year(self, copyright_year: i32) -> Self { - Self { - builder: self.builder.property("copyright-year", copyright_year), - } - } + pub fn developer_names(self, developer_names: impl Into) -> Self { + Self { builder: self.builder.property("developer-names", developer_names.into()), } + } - pub fn app_id(self, app_id: impl Into) -> Self { - Self { - builder: self.builder.property("app-id", app_id.into()), - } - } + pub fn copyright_year(self, copyright_year: i32) -> Self { + Self { builder: self.builder.property("copyright-year", copyright_year), } + } - pub fn translate_url(self, translate_url: impl Into) -> Self { - Self { - builder: self.builder.property("translate-url", translate_url.into()), - } - } + pub fn app_id(self, app_id: impl Into) -> Self { + Self { builder: self.builder.property("app-id", app_id.into()), } + } - pub fn issue_url(self, issue_url: impl Into) -> Self { - Self { - builder: self.builder.property("issue-url", issue_url.into()), - } - } + pub fn translate_url(self, translate_url: impl Into) -> Self { + Self { builder: self.builder.property("translate-url", translate_url.into()), } + } - pub fn more_info_url(self, more_info_url: impl Into) -> Self { - Self { - builder: self.builder.property("more-info-url", more_info_url.into()), - } - } + pub fn issue_url(self, issue_url: impl Into) -> Self { + Self { builder: self.builder.property("issue-url", issue_url.into()), } + } - pub fn parent(self, parent: &impl IsA) -> Self { - Self { - builder: self.builder.property("parent", parent.clone().upcast()), - } - } + pub fn more_info_url(self, more_info_url: impl Into) -> Self { + Self { builder: self.builder.property("more-info-url", more_info_url.into()), } + } - pub fn has_title(self, has_title: bool) -> Self { - Self { - builder: self.builder.property("has-title", has_title), - } - } + pub fn parent(self, parent: &impl IsA) -> Self { + Self { builder: self.builder.property("parent", parent.clone().upcast()), } + } - pub fn has_back_button(self, has_back_button: bool) -> Self { - Self { - builder: self.builder.property("has-back-button", has_back_button), - } - } + pub fn has_title(self, has_title: bool) -> Self { + Self { builder: self.builder.property("has-title", has_title), } + } - pub fn application(self, application: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("application", application.clone().upcast()), - } - } + pub fn has_back_button(self, has_back_button: bool) -> Self { + Self { builder: self.builder.property("has-back-button", has_back_button), } + } - pub fn child(self, child: &impl IsA) -> Self { - Self { - builder: self.builder.property("child", child.clone().upcast()), - } - } + pub fn application(self, application: &impl IsA) -> Self { + Self { builder: self.builder.property("application", application.clone().upcast()), } + } - pub fn decorated(self, decorated: bool) -> Self { - Self { - builder: self.builder.property("decorated", decorated), - } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { builder: self.builder.property("child", child.clone().upcast()), } + } - pub fn default_height(self, default_height: i32) -> Self { - Self { - builder: self.builder.property("default-height", default_height), - } - } + pub fn decorated(self, decorated: bool) -> Self { + Self { builder: self.builder.property("decorated", decorated), } + } - pub fn default_widget(self, default_widget: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("default-widget", default_widget.clone().upcast()), - } - } + pub fn default_height(self, default_height: i32) -> Self { + Self { builder: self.builder.property("default-height", default_height), } + } - pub fn default_width(self, default_width: i32) -> Self { - Self { - builder: self.builder.property("default-width", default_width), - } - } + pub fn default_widget(self, default_widget: &impl IsA) -> Self { + Self { builder: self.builder.property("default-widget", default_widget.clone().upcast()), } + } - pub fn deletable(self, deletable: bool) -> Self { - Self { - builder: self.builder.property("deletable", deletable), - } - } + pub fn default_width(self, default_width: i32) -> Self { + Self { builder: self.builder.property("default-width", default_width), } + } - pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self { - Self { - builder: self - .builder - .property("destroy-with-parent", destroy_with_parent), - } - } + pub fn deletable(self, deletable: bool) -> Self { + Self { builder: self.builder.property("deletable", deletable), } + } - //pub fn display(self, display: /*Ignored*/&gdk::Display) -> Self { - // Self { builder: self.builder.property("display", display), } - //} + pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self { + Self { builder: self.builder.property("destroy-with-parent", destroy_with_parent), } + } - pub fn focus_visible(self, focus_visible: bool) -> Self { - Self { - builder: self.builder.property("focus-visible", focus_visible), - } - } + //pub fn display(self, display: /*Ignored*/&gdk::Display) -> Self { + // Self { builder: self.builder.property("display", display), } + //} - pub fn focus_widget(self, focus_widget: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("focus-widget", focus_widget.clone().upcast()), - } - } + pub fn focus_visible(self, focus_visible: bool) -> Self { + Self { builder: self.builder.property("focus-visible", focus_visible), } + } - pub fn fullscreened(self, fullscreened: bool) -> Self { - Self { - builder: self.builder.property("fullscreened", fullscreened), - } - } + pub fn focus_widget(self, focus_widget: &impl IsA) -> Self { + Self { builder: self.builder.property("focus-widget", focus_widget.clone().upcast()), } + } - #[cfg(feature = "gtk_v4_2")] + pub fn fullscreened(self, fullscreened: bool) -> Self { + Self { builder: self.builder.property("fullscreened", fullscreened), } + } + + #[cfg(feature = "gtk_v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { - Self { - builder: self - .builder - .property("handle-menubar-accel", handle_menubar_accel), - } - } + Self { builder: self.builder.property("handle-menubar-accel", handle_menubar_accel), } + } - pub fn hide_on_close(self, hide_on_close: bool) -> Self { - Self { - builder: self.builder.property("hide-on-close", hide_on_close), - } - } + pub fn hide_on_close(self, hide_on_close: bool) -> Self { + Self { builder: self.builder.property("hide-on-close", hide_on_close), } + } - pub fn icon_name(self, icon_name: impl Into) -> Self { - Self { - builder: self.builder.property("icon-name", icon_name.into()), - } - } + pub fn icon_name(self, icon_name: impl Into) -> Self { + Self { builder: self.builder.property("icon-name", icon_name.into()), } + } - pub fn maximized(self, maximized: bool) -> Self { - Self { - builder: self.builder.property("maximized", maximized), - } - } + pub fn maximized(self, maximized: bool) -> Self { + Self { builder: self.builder.property("maximized", maximized), } + } - pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self { - Self { - builder: self - .builder - .property("mnemonics-visible", mnemonics_visible), - } - } + pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self { + Self { builder: self.builder.property("mnemonics-visible", mnemonics_visible), } + } - pub fn modal(self, modal: bool) -> Self { - Self { - builder: self.builder.property("modal", modal), - } - } + pub fn modal(self, modal: bool) -> Self { + Self { builder: self.builder.property("modal", modal), } + } - pub fn resizable(self, resizable: bool) -> Self { - Self { - builder: self.builder.property("resizable", resizable), - } - } + pub fn resizable(self, resizable: bool) -> Self { + Self { builder: self.builder.property("resizable", resizable), } + } - pub fn startup_id(self, startup_id: impl Into) -> Self { - Self { - builder: self.builder.property("startup-id", startup_id.into()), - } - } + pub fn startup_id(self, startup_id: impl Into) -> Self { + Self { builder: self.builder.property("startup-id", startup_id.into()), } + } - pub fn title(self, title: impl Into) -> Self { - Self { - builder: self.builder.property("title", title.into()), - } - } + pub fn title(self, title: impl Into) -> Self { + Self { builder: self.builder.property("title", title.into()), } + } - #[cfg(feature = "gtk_v4_6")] + #[cfg(feature = "gtk_v4_6")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_6")))] pub fn titlebar(self, titlebar: &impl IsA) -> Self { - Self { - builder: self.builder.property("titlebar", titlebar.clone().upcast()), - } - } + Self { builder: self.builder.property("titlebar", titlebar.clone().upcast()), } + } - pub fn transient_for(self, transient_for: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("transient-for", transient_for.clone().upcast()), - } - } + pub fn transient_for(self, transient_for: &impl IsA) -> Self { + Self { builder: self.builder.property("transient-for", transient_for.clone().upcast()), } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { - builder: self.builder.property("can-focus", can_focus), - } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { builder: self.builder.property("can-focus", can_focus), } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { - builder: self.builder.property("can-target", can_target), - } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { builder: self.builder.property("can-target", can_target), } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { - builder: self.builder.property("css-classes", css_classes.into()), - } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { builder: self.builder.property("css-classes", css_classes.into()), } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { - builder: self.builder.property("css-name", css_name.into()), - } - } + pub fn css_name(self, css_name: impl Into) -> Self { + Self { builder: self.builder.property("css-name", css_name.into()), } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { - builder: self.builder.property("focus-on-click", focus_on_click), - } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { builder: self.builder.property("focus-on-click", focus_on_click), } + } - pub fn focusable(self, focusable: bool) -> Self { - Self { - builder: self.builder.property("focusable", focusable), - } - } + pub fn focusable(self, focusable: bool) -> Self { + Self { builder: self.builder.property("focusable", focusable), } + } - pub fn halign(self, halign: gtk::Align) -> Self { - Self { - builder: self.builder.property("halign", halign), - } - } + pub fn halign(self, halign: gtk::Align) -> Self { + Self { builder: self.builder.property("halign", halign), } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { - builder: self.builder.property("has-tooltip", has_tooltip), - } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { builder: self.builder.property("has-tooltip", has_tooltip), } + } - pub fn height_request(self, height_request: i32) -> Self { - Self { - builder: self.builder.property("height-request", height_request), - } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { builder: self.builder.property("height-request", height_request), } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { - builder: self.builder.property("hexpand", hexpand), - } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { builder: self.builder.property("hexpand", hexpand), } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { - builder: self.builder.property("hexpand-set", hexpand_set), - } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { builder: self.builder.property("hexpand-set", hexpand_set), } + } - //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } - //} + //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + //} - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { - builder: self.builder.property("margin-bottom", margin_bottom), - } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { builder: self.builder.property("margin-bottom", margin_bottom), } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { - builder: self.builder.property("margin-end", margin_end), - } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { builder: self.builder.property("margin-end", margin_end), } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { - builder: self.builder.property("margin-start", margin_start), - } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { builder: self.builder.property("margin-start", margin_start), } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { - builder: self.builder.property("margin-top", margin_top), - } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { builder: self.builder.property("margin-top", margin_top), } + } - pub fn name(self, name: impl Into) -> Self { - Self { - builder: self.builder.property("name", name.into()), - } - } + pub fn name(self, name: impl Into) -> Self { + Self { builder: self.builder.property("name", name.into()), } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { - builder: self.builder.property("opacity", opacity), - } - } + pub fn opacity(self, opacity: f64) -> Self { + Self { builder: self.builder.property("opacity", opacity), } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn receives_default(self, receives_default: bool) -> Self { - Self { - builder: self.builder.property("receives-default", receives_default), - } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { builder: self.builder.property("receives-default", receives_default), } + } - pub fn sensitive(self, sensitive: bool) -> Self { - Self { - builder: self.builder.property("sensitive", sensitive), - } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { builder: self.builder.property("sensitive", sensitive), } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { - builder: self - .builder - .property("tooltip-markup", tooltip_markup.into()), - } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { - builder: self.builder.property("tooltip-text", tooltip_text.into()), - } - } + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } + } - pub fn valign(self, valign: gtk::Align) -> Self { - Self { - builder: self.builder.property("valign", valign), - } - } + pub fn valign(self, valign: gtk::Align) -> Self { + Self { builder: self.builder.property("valign", valign), } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { - builder: self.builder.property("vexpand", vexpand), - } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { builder: self.builder.property("vexpand", vexpand), } + } - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { - builder: self.builder.property("vexpand-set", vexpand_set), - } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { builder: self.builder.property("vexpand-set", vexpand_set), } + } - pub fn visible(self, visible: bool) -> Self { - Self { - builder: self.builder.property("visible", visible), - } - } + pub fn visible(self, visible: bool) -> Self { + Self { builder: self.builder.property("visible", visible), } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { - builder: self.builder.property("width-request", width_request), - } - } + pub fn width_request(self, width_request: i32) -> Self { + Self { builder: self.builder.property("width-request", width_request), } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} // rustdoc-stripper-ignore-next /// Build the [`AboutWindow`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> AboutWindow { - self.builder.build() - } + self.builder.build() } } mod sealed { @@ -534,9 +353,7 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_color")] fn color(&self) -> Colors { unsafe { - from_glib(ffi::he_about_window_get_color( - self.as_ref().to_glib_none().0, - )) + from_glib(ffi::he_about_window_get_color(self.as_ref().to_glib_none().0)) } } @@ -551,9 +368,7 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_license")] fn license(&self) -> AboutWindowLicenses { unsafe { - from_glib(ffi::he_about_window_get_license( - self.as_ref().to_glib_none().0, - )) + from_glib(ffi::he_about_window_get_license(self.as_ref().to_glib_none().0)) } } @@ -568,19 +383,14 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_version")] fn version(&self) -> glib::GString { unsafe { - from_glib_none(ffi::he_about_window_get_version( - self.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::he_about_window_get_version(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_about_window_set_version")] fn set_version(&self, value: &str) { unsafe { - ffi::he_about_window_set_version( - self.as_ref().to_glib_none().0, - value.to_glib_none().0, - ); + ffi::he_about_window_set_version(self.as_ref().to_glib_none().0, value.to_glib_none().0); } } @@ -588,19 +398,14 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_app_name")] fn app_name(&self) -> glib::GString { unsafe { - from_glib_none(ffi::he_about_window_get_app_name( - self.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::he_about_window_get_app_name(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_about_window_set_app_name")] fn set_app_name(&self, value: &str) { unsafe { - ffi::he_about_window_set_app_name( - self.as_ref().to_glib_none().0, - value.to_glib_none().0, - ); + ffi::he_about_window_set_app_name(self.as_ref().to_glib_none().0, value.to_glib_none().0); } } @@ -608,9 +413,7 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_icon")] fn icon(&self) -> glib::GString { unsafe { - from_glib_none(ffi::he_about_window_get_icon( - self.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::he_about_window_get_icon(self.as_ref().to_glib_none().0)) } } @@ -626,13 +429,7 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { fn translator_names(&self) -> Vec { unsafe { let mut result_length1 = std::mem::MaybeUninit::uninit(); - let ret = FromGlibContainer::from_glib_none_num( - ffi::he_about_window_get_translator_names( - self.as_ref().to_glib_none().0, - result_length1.as_mut_ptr(), - ), - result_length1.assume_init() as _, - ); + let ret = FromGlibContainer::from_glib_none_num(ffi::he_about_window_get_translator_names(self.as_ref().to_glib_none().0, result_length1.as_mut_ptr()), result_length1.assume_init() as _); ret } } @@ -641,11 +438,7 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { fn set_translator_names(&self, value: &[&str]) { let value_length1 = value.len() as _; unsafe { - ffi::he_about_window_set_translator_names( - self.as_ref().to_glib_none().0, - value.to_glib_none().0, - value_length1, - ); + ffi::he_about_window_set_translator_names(self.as_ref().to_glib_none().0, value.to_glib_none().0, value_length1); } } @@ -654,13 +447,7 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { fn developer_names(&self) -> Vec { unsafe { let mut result_length1 = std::mem::MaybeUninit::uninit(); - let ret = FromGlibContainer::from_glib_none_num( - ffi::he_about_window_get_developer_names( - self.as_ref().to_glib_none().0, - result_length1.as_mut_ptr(), - ), - result_length1.assume_init() as _, - ); + let ret = FromGlibContainer::from_glib_none_num(ffi::he_about_window_get_developer_names(self.as_ref().to_glib_none().0, result_length1.as_mut_ptr()), result_length1.assume_init() as _); ret } } @@ -669,18 +456,16 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { fn set_developer_names(&self, value: &[&str]) { let value_length1 = value.len() as _; unsafe { - ffi::he_about_window_set_developer_names( - self.as_ref().to_glib_none().0, - value.to_glib_none().0, - value_length1, - ); + ffi::he_about_window_set_developer_names(self.as_ref().to_glib_none().0, value.to_glib_none().0, value_length1); } } #[doc(alias = "he_about_window_get_copyright_year")] #[doc(alias = "get_copyright_year")] fn copyright_year(&self) -> i32 { - unsafe { ffi::he_about_window_get_copyright_year(self.as_ref().to_glib_none().0) } + unsafe { + ffi::he_about_window_get_copyright_year(self.as_ref().to_glib_none().0) + } } #[doc(alias = "he_about_window_set_copyright_year")] @@ -694,9 +479,7 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_app_id")] fn app_id(&self) -> glib::GString { unsafe { - from_glib_none(ffi::he_about_window_get_app_id( - self.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::he_about_window_get_app_id(self.as_ref().to_glib_none().0)) } } @@ -711,19 +494,14 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_translate_url")] fn translate_url(&self) -> Option { unsafe { - from_glib_none(ffi::he_about_window_get_translate_url( - self.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::he_about_window_get_translate_url(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_about_window_set_translate_url")] fn set_translate_url(&self, value: Option<&str>) { unsafe { - ffi::he_about_window_set_translate_url( - self.as_ref().to_glib_none().0, - value.to_glib_none().0, - ); + ffi::he_about_window_set_translate_url(self.as_ref().to_glib_none().0, value.to_glib_none().0); } } @@ -731,19 +509,14 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_issue_url")] fn issue_url(&self) -> Option { unsafe { - from_glib_none(ffi::he_about_window_get_issue_url( - self.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::he_about_window_get_issue_url(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_about_window_set_issue_url")] fn set_issue_url(&self, value: Option<&str>) { unsafe { - ffi::he_about_window_set_issue_url( - self.as_ref().to_glib_none().0, - value.to_glib_none().0, - ); + ffi::he_about_window_set_issue_url(self.as_ref().to_glib_none().0, value.to_glib_none().0); } } @@ -751,316 +524,170 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_more_info_url")] fn more_info_url(&self) -> Option { unsafe { - from_glib_none(ffi::he_about_window_get_more_info_url( - self.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::he_about_window_get_more_info_url(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_about_window_set_more_info_url")] fn set_more_info_url(&self, value: Option<&str>) { unsafe { - ffi::he_about_window_set_more_info_url( - self.as_ref().to_glib_none().0, - value.to_glib_none().0, - ); + ffi::he_about_window_set_more_info_url(self.as_ref().to_glib_none().0, value.to_glib_none().0); } } #[doc(alias = "color")] fn connect_color_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_color_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeAboutWindow, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_color_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::color\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_color_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::color\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_color_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "license")] fn connect_license_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_license_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeAboutWindow, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_license_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::license\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_license_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::license\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_license_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "version")] fn connect_version_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_version_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeAboutWindow, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_version_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::version\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_version_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::version\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_version_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "app-name")] fn connect_app_name_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_app_name_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeAboutWindow, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_app_name_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::app-name\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_app_name_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::app-name\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_app_name_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "icon")] fn connect_icon_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_icon_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeAboutWindow, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_icon_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::icon\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_icon_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::icon\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_icon_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "translator-names")] fn connect_translator_names_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_translator_names_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeAboutWindow, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_translator_names_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::translator-names\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_translator_names_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::translator-names\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_translator_names_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "developer-names")] fn connect_developer_names_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_developer_names_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeAboutWindow, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_developer_names_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::developer-names\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_developer_names_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::developer-names\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_developer_names_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "copyright-year")] fn connect_copyright_year_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_copyright_year_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeAboutWindow, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_copyright_year_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::copyright-year\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_copyright_year_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::copyright-year\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_copyright_year_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "app-id")] fn connect_app_id_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_app_id_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeAboutWindow, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_app_id_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::app-id\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_app_id_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::app-id\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_app_id_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "translate-url")] fn connect_translate_url_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_translate_url_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeAboutWindow, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_translate_url_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::translate-url\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_translate_url_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::translate-url\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_translate_url_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "issue-url")] fn connect_issue_url_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_issue_url_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeAboutWindow, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_issue_url_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::issue-url\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_issue_url_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::issue-url\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_issue_url_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "more-info-url")] fn connect_more_info_url_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_more_info_url_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeAboutWindow, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_more_info_url_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::more-info-url\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_more_info_url_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::more-info-url\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_more_info_url_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/libhelium/src/auto/animation.rs b/libhelium/src/auto/animation.rs index f64190c..07ea87e 100644 --- a/libhelium/src/auto/animation.rs +++ b/libhelium/src/auto/animation.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, AnimationState, AnimationTarget}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,AnimationState,AnimationTarget}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "HeAnimation")] @@ -21,7 +17,8 @@ glib::wrapper! { } impl Animation { - pub const NONE: Option<&'static Animation> = None; + pub const NONE: Option<&'static Animation> = None; + } mod sealed { @@ -67,18 +64,24 @@ pub trait AnimationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_animation_estimate_duration")] fn estimate_duration(&self) -> u32 { - unsafe { ffi::he_animation_estimate_duration(self.as_ref().to_glib_none().0) } + unsafe { + ffi::he_animation_estimate_duration(self.as_ref().to_glib_none().0) + } } #[doc(alias = "he_animation_calculate_value")] fn calculate_value(&self, t: u32) -> f64 { - unsafe { ffi::he_animation_calculate_value(self.as_ref().to_glib_none().0, t) } + unsafe { + ffi::he_animation_calculate_value(self.as_ref().to_glib_none().0, t) + } } #[doc(alias = "he_animation_get_state")] #[doc(alias = "get_state")] fn state(&self) -> AnimationState { - unsafe { from_glib(ffi::he_animation_get_state(self.as_ref().to_glib_none().0)) } + unsafe { + from_glib(ffi::he_animation_get_state(self.as_ref().to_glib_none().0)) + } } #[doc(alias = "he_animation_set_state")] @@ -91,39 +94,39 @@ pub trait AnimationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_animation_get_target")] #[doc(alias = "get_target")] fn target(&self) -> AnimationTarget { - unsafe { from_glib_none(ffi::he_animation_get_target(self.as_ref().to_glib_none().0)) } + unsafe { + from_glib_none(ffi::he_animation_get_target(self.as_ref().to_glib_none().0)) + } } #[doc(alias = "he_animation_set_target")] fn set_target(&self, value: &impl IsA) { unsafe { - ffi::he_animation_set_target( - self.as_ref().to_glib_none().0, - value.as_ref().to_glib_none().0, - ); + ffi::he_animation_set_target(self.as_ref().to_glib_none().0, value.as_ref().to_glib_none().0); } } #[doc(alias = "he_animation_get_widget")] #[doc(alias = "get_widget")] fn widget(&self) -> gtk::Widget { - unsafe { from_glib_none(ffi::he_animation_get_widget(self.as_ref().to_glib_none().0)) } + unsafe { + from_glib_none(ffi::he_animation_get_widget(self.as_ref().to_glib_none().0)) + } } #[doc(alias = "he_animation_set_widget")] fn set_widget(&self, value: &impl IsA) { unsafe { - ffi::he_animation_set_widget( - self.as_ref().to_glib_none().0, - value.as_ref().to_glib_none().0, - ); + ffi::he_animation_set_widget(self.as_ref().to_glib_none().0, value.as_ref().to_glib_none().0); } } #[doc(alias = "he_animation_get_avalue")] #[doc(alias = "get_avalue")] fn avalue(&self) -> f64 { - unsafe { ffi::he_animation_get_avalue(self.as_ref().to_glib_none().0) } + unsafe { + ffi::he_animation_get_avalue(self.as_ref().to_glib_none().0) + } } #[doc(alias = "he_animation_set_avalue")] @@ -135,115 +138,66 @@ pub trait AnimationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "done")] fn connect_done(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn done_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeAnimation, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn done_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAnimation, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Animation::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"done\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - done_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"done\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(done_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "state")] fn connect_state_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_state_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_state_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Animation::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::state\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_state_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::state\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_state_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "target")] fn connect_target_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_target_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_target_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Animation::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::target\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_target_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::target\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_target_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "widget")] fn connect_widget_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_widget_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_widget_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Animation::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::widget\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_widget_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::widget\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_widget_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "avalue")] fn connect_avalue_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_avalue_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeAnimation, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_avalue_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Animation::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::avalue\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_avalue_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::avalue\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_avalue_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/libhelium/src/auto/animation_target.rs b/libhelium/src/auto/animation_target.rs index a743c8b..4274d4a 100644 --- a/libhelium/src/auto/animation_target.rs +++ b/libhelium/src/auto/animation_target.rs @@ -1,10 +1,10 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::ffi; -use glib::{prelude::*, translate::*}; +use crate::{ffi}; +use glib::{prelude::*,translate::*}; glib::wrapper! { #[doc(alias = "HeAnimationTarget")] @@ -16,7 +16,8 @@ glib::wrapper! { } impl AnimationTarget { - pub const NONE: Option<&'static AnimationTarget> = None; + pub const NONE: Option<&'static AnimationTarget> = None; + } mod sealed { diff --git a/libhelium/src/auto/app_bar.rs b/libhelium/src/auto/app_bar.rs index 6112e62..b49ba7a 100644 --- a/libhelium/src/auto/app_bar.rs +++ b/libhelium/src/auto/app_bar.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, Bin}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,Bin}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "HeAppBar")] @@ -21,303 +17,216 @@ glib::wrapper! { } impl AppBar { - pub const NONE: Option<&'static AppBar> = None; + pub const NONE: Option<&'static AppBar> = None; + #[doc(alias = "he_app_bar_new")] pub fn new() -> AppBar { assert_initialized_main_thread!(); - unsafe { from_glib_none(ffi::he_app_bar_new()) } + unsafe { + from_glib_none(ffi::he_app_bar_new()) + } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`AppBar`] objects. - /// - /// This method returns an instance of [`AppBarBuilder`](crate::builders::AppBarBuilder) which can be used to create [`AppBar`] objects. - pub fn builder() -> AppBarBuilder { - AppBarBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`AppBar`] objects. + /// + /// This method returns an instance of [`AppBarBuilder`](crate::builders::AppBarBuilder) which can be used to create [`AppBar`] objects. + pub fn builder() -> AppBarBuilder { + AppBarBuilder::new() + } + } impl Default for AppBar { - fn default() -> Self { - Self::new() - } -} + fn default() -> Self { + Self::new() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`AppBar`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`AppBar`] 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 AppBarBuilder { - builder: glib::object::ObjectBuilder<'static, AppBar>, -} - -impl AppBarBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, AppBar>, } - } - pub fn stack(self, stack: >k::Stack) -> Self { - Self { - builder: self.builder.property("stack", stack.clone()), + impl AppBarBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn scroller(self, scroller: >k::ScrolledWindow) -> Self { - Self { - builder: self.builder.property("scroller", scroller.clone()), - } - } + pub fn stack(self, stack: >k::Stack) -> Self { + Self { builder: self.builder.property("stack", stack.clone()), } + } - pub fn is_compact(self, is_compact: bool) -> Self { - Self { - builder: self.builder.property("is-compact", is_compact), - } - } + pub fn scroller(self, scroller: >k::ScrolledWindow) -> Self { + Self { builder: self.builder.property("scroller", scroller.clone()), } + } - pub fn viewtitle_label(self, viewtitle_label: impl Into) -> Self { - Self { - builder: self - .builder - .property("viewtitle-label", viewtitle_label.into()), - } - } + pub fn is_compact(self, is_compact: bool) -> Self { + Self { builder: self.builder.property("is-compact", is_compact), } + } - pub fn viewtitle_widget(self, viewtitle_widget: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("viewtitle-widget", viewtitle_widget.clone().upcast()), - } - } + pub fn viewtitle_label(self, viewtitle_label: impl Into) -> Self { + Self { builder: self.builder.property("viewtitle-label", viewtitle_label.into()), } + } - pub fn viewsubtitle_label(self, viewsubtitle_label: impl Into) -> Self { - Self { - builder: self - .builder - .property("viewsubtitle-label", viewsubtitle_label.into()), - } - } + pub fn viewtitle_widget(self, viewtitle_widget: &impl IsA) -> Self { + Self { builder: self.builder.property("viewtitle-widget", viewtitle_widget.clone().upcast()), } + } - pub fn show_left_title_buttons(self, show_left_title_buttons: bool) -> Self { - Self { - builder: self - .builder - .property("show-left-title-buttons", show_left_title_buttons), - } - } + pub fn viewsubtitle_label(self, viewsubtitle_label: impl Into) -> Self { + Self { builder: self.builder.property("viewsubtitle-label", viewsubtitle_label.into()), } + } - pub fn show_right_title_buttons(self, show_right_title_buttons: bool) -> Self { - Self { - builder: self - .builder - .property("show-right-title-buttons", show_right_title_buttons), - } - } + pub fn show_left_title_buttons(self, show_left_title_buttons: bool) -> Self { + Self { builder: self.builder.property("show-left-title-buttons", show_left_title_buttons), } + } - pub fn decoration_layout(self, decoration_layout: impl Into) -> Self { - Self { - builder: self - .builder - .property("decoration-layout", decoration_layout.into()), - } - } + pub fn show_right_title_buttons(self, show_right_title_buttons: bool) -> Self { + Self { builder: self.builder.property("show-right-title-buttons", show_right_title_buttons), } + } - pub fn show_back(self, show_back: bool) -> Self { - Self { - builder: self.builder.property("show-back", show_back), - } - } + pub fn decoration_layout(self, decoration_layout: impl Into) -> Self { + Self { builder: self.builder.property("decoration-layout", decoration_layout.into()), } + } - pub fn child(self, child: &impl IsA) -> Self { - Self { - builder: self.builder.property("child", child.clone().upcast()), - } - } + pub fn show_back(self, show_back: bool) -> Self { + Self { builder: self.builder.property("show-back", show_back), } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { - builder: self.builder.property("can-focus", can_focus), - } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { builder: self.builder.property("child", child.clone().upcast()), } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { - builder: self.builder.property("can-target", can_target), - } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { builder: self.builder.property("can-focus", can_focus), } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { - builder: self.builder.property("css-classes", css_classes.into()), - } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { builder: self.builder.property("can-target", can_target), } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { - builder: self.builder.property("css-name", css_name.into()), - } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { builder: self.builder.property("css-classes", css_classes.into()), } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + pub fn css_name(self, css_name: impl Into) -> Self { + Self { builder: self.builder.property("css-name", css_name.into()), } + } - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { - builder: self.builder.property("focus-on-click", focus_on_click), - } - } + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focusable(self, focusable: bool) -> Self { - Self { - builder: self.builder.property("focusable", focusable), - } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { builder: self.builder.property("focus-on-click", focus_on_click), } + } - pub fn halign(self, halign: gtk::Align) -> Self { - Self { - builder: self.builder.property("halign", halign), - } - } + pub fn focusable(self, focusable: bool) -> Self { + Self { builder: self.builder.property("focusable", focusable), } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { - builder: self.builder.property("has-tooltip", has_tooltip), - } - } + pub fn halign(self, halign: gtk::Align) -> Self { + Self { builder: self.builder.property("halign", halign), } + } - pub fn height_request(self, height_request: i32) -> Self { - Self { - builder: self.builder.property("height-request", height_request), - } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { builder: self.builder.property("has-tooltip", has_tooltip), } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { - builder: self.builder.property("hexpand", hexpand), - } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { builder: self.builder.property("height-request", height_request), } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { - builder: self.builder.property("hexpand-set", hexpand_set), - } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { builder: self.builder.property("hexpand", hexpand), } + } - //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } - //} + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { builder: self.builder.property("hexpand-set", hexpand_set), } + } - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { - builder: self.builder.property("margin-bottom", margin_bottom), - } - } + //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + //} - pub fn margin_end(self, margin_end: i32) -> Self { - Self { - builder: self.builder.property("margin-end", margin_end), - } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { builder: self.builder.property("margin-bottom", margin_bottom), } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { - builder: self.builder.property("margin-start", margin_start), - } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { builder: self.builder.property("margin-end", margin_end), } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { - builder: self.builder.property("margin-top", margin_top), - } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { builder: self.builder.property("margin-start", margin_start), } + } - pub fn name(self, name: impl Into) -> Self { - Self { - builder: self.builder.property("name", name.into()), - } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { builder: self.builder.property("margin-top", margin_top), } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { - builder: self.builder.property("opacity", opacity), - } - } + pub fn name(self, name: impl Into) -> Self { + Self { builder: self.builder.property("name", name.into()), } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + pub fn opacity(self, opacity: f64) -> Self { + Self { builder: self.builder.property("opacity", opacity), } + } - pub fn receives_default(self, receives_default: bool) -> Self { - Self { - builder: self.builder.property("receives-default", receives_default), - } - } + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn sensitive(self, sensitive: bool) -> Self { - Self { - builder: self.builder.property("sensitive", sensitive), - } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { builder: self.builder.property("receives-default", receives_default), } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { - builder: self - .builder - .property("tooltip-markup", tooltip_markup.into()), - } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { builder: self.builder.property("sensitive", sensitive), } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { - builder: self.builder.property("tooltip-text", tooltip_text.into()), - } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } + } - pub fn valign(self, valign: gtk::Align) -> Self { - Self { - builder: self.builder.property("valign", valign), - } - } + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { - builder: self.builder.property("vexpand", vexpand), - } - } + pub fn valign(self, valign: gtk::Align) -> Self { + Self { builder: self.builder.property("valign", valign), } + } - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { - builder: self.builder.property("vexpand-set", vexpand_set), - } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { builder: self.builder.property("vexpand", vexpand), } + } - pub fn visible(self, visible: bool) -> Self { - Self { - builder: self.builder.property("visible", visible), - } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { builder: self.builder.property("vexpand-set", vexpand_set), } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { - builder: self.builder.property("width-request", width_request), - } - } + pub fn visible(self, visible: bool) -> Self { + Self { builder: self.builder.property("visible", visible), } + } + + pub fn width_request(self, width_request: i32) -> Self { + Self { builder: self.builder.property("width-request", width_request), } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} // rustdoc-stripper-ignore-next /// Build the [`AppBar`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> AppBar { - self.builder.build() - } + self.builder.build() } } mod sealed { @@ -329,47 +238,37 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_app_bar_append")] fn append(&self, child: &impl IsA) { unsafe { - ffi::he_app_bar_append( - self.as_ref().to_glib_none().0, - child.as_ref().to_glib_none().0, - ); + ffi::he_app_bar_append(self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0); } } #[doc(alias = "he_app_bar_append_toggle")] fn append_toggle(&self, child: &impl IsA) { unsafe { - ffi::he_app_bar_append_toggle( - self.as_ref().to_glib_none().0, - child.as_ref().to_glib_none().0, - ); + ffi::he_app_bar_append_toggle(self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0); } } #[doc(alias = "he_app_bar_append_menu")] fn append_menu(&self, child: &impl IsA) { unsafe { - ffi::he_app_bar_append_menu( - self.as_ref().to_glib_none().0, - child.as_ref().to_glib_none().0, - ); + ffi::he_app_bar_append_menu(self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0); } } #[doc(alias = "he_app_bar_remove")] fn remove(&self, child: &impl IsA) { unsafe { - ffi::he_app_bar_remove( - self.as_ref().to_glib_none().0, - child.as_ref().to_glib_none().0, - ); + ffi::he_app_bar_remove(self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0); } } #[doc(alias = "he_app_bar_get_stack")] #[doc(alias = "get_stack")] fn stack(&self) -> gtk::Stack { - unsafe { from_glib_none(ffi::he_app_bar_get_stack(self.as_ref().to_glib_none().0)) } + unsafe { + from_glib_none(ffi::he_app_bar_get_stack(self.as_ref().to_glib_none().0)) + } } #[doc(alias = "he_app_bar_set_stack")] @@ -382,7 +281,9 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_app_bar_get_scroller")] #[doc(alias = "get_scroller")] fn scroller(&self) -> gtk::ScrolledWindow { - unsafe { from_glib_none(ffi::he_app_bar_get_scroller(self.as_ref().to_glib_none().0)) } + unsafe { + from_glib_none(ffi::he_app_bar_get_scroller(self.as_ref().to_glib_none().0)) + } } #[doc(alias = "he_app_bar_set_scroller")] @@ -396,9 +297,7 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_is_compact")] fn is_compact(&self) -> bool { unsafe { - from_glib(ffi::he_app_bar_get_is_compact( - self.as_ref().to_glib_none().0, - )) + from_glib(ffi::he_app_bar_get_is_compact(self.as_ref().to_glib_none().0)) } } @@ -413,19 +312,14 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_viewtitle_label")] fn viewtitle_label(&self) -> glib::GString { unsafe { - from_glib_none(ffi::he_app_bar_get_viewtitle_label( - self.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::he_app_bar_get_viewtitle_label(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_app_bar_set_viewtitle_label")] fn set_viewtitle_label(&self, value: &str) { unsafe { - ffi::he_app_bar_set_viewtitle_label( - self.as_ref().to_glib_none().0, - value.to_glib_none().0, - ); + ffi::he_app_bar_set_viewtitle_label(self.as_ref().to_glib_none().0, value.to_glib_none().0); } } @@ -433,19 +327,14 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_viewtitle_widget")] fn viewtitle_widget(&self) -> Option { unsafe { - from_glib_none(ffi::he_app_bar_get_viewtitle_widget( - self.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::he_app_bar_get_viewtitle_widget(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_app_bar_set_viewtitle_widget")] fn set_viewtitle_widget(&self, value: Option<&impl IsA>) { unsafe { - ffi::he_app_bar_set_viewtitle_widget( - self.as_ref().to_glib_none().0, - value.map(|p| p.as_ref()).to_glib_none().0, - ); + ffi::he_app_bar_set_viewtitle_widget(self.as_ref().to_glib_none().0, value.map(|p| p.as_ref()).to_glib_none().0); } } @@ -453,19 +342,14 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_viewsubtitle_label")] fn viewsubtitle_label(&self) -> glib::GString { unsafe { - from_glib_none(ffi::he_app_bar_get_viewsubtitle_label( - self.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::he_app_bar_get_viewsubtitle_label(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_app_bar_set_viewsubtitle_label")] fn set_viewsubtitle_label(&self, value: &str) { unsafe { - ffi::he_app_bar_set_viewsubtitle_label( - self.as_ref().to_glib_none().0, - value.to_glib_none().0, - ); + ffi::he_app_bar_set_viewsubtitle_label(self.as_ref().to_glib_none().0, value.to_glib_none().0); } } @@ -473,19 +357,14 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_show_left_title_buttons")] fn shows_left_title_buttons(&self) -> bool { unsafe { - from_glib(ffi::he_app_bar_get_show_left_title_buttons( - self.as_ref().to_glib_none().0, - )) + from_glib(ffi::he_app_bar_get_show_left_title_buttons(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_app_bar_set_show_left_title_buttons")] fn set_show_left_title_buttons(&self, value: bool) { unsafe { - ffi::he_app_bar_set_show_left_title_buttons( - self.as_ref().to_glib_none().0, - value.into_glib(), - ); + ffi::he_app_bar_set_show_left_title_buttons(self.as_ref().to_glib_none().0, value.into_glib()); } } @@ -493,19 +372,14 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_show_right_title_buttons")] fn shows_right_title_buttons(&self) -> bool { unsafe { - from_glib(ffi::he_app_bar_get_show_right_title_buttons( - self.as_ref().to_glib_none().0, - )) + from_glib(ffi::he_app_bar_get_show_right_title_buttons(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_app_bar_set_show_right_title_buttons")] fn set_show_right_title_buttons(&self, value: bool) { unsafe { - ffi::he_app_bar_set_show_right_title_buttons( - self.as_ref().to_glib_none().0, - value.into_glib(), - ); + ffi::he_app_bar_set_show_right_title_buttons(self.as_ref().to_glib_none().0, value.into_glib()); } } @@ -513,19 +387,14 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_decoration_layout")] fn decoration_layout(&self) -> glib::GString { unsafe { - from_glib_none(ffi::he_app_bar_get_decoration_layout( - self.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::he_app_bar_get_decoration_layout(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_app_bar_set_decoration_layout")] fn set_decoration_layout(&self, value: &str) { unsafe { - ffi::he_app_bar_set_decoration_layout( - self.as_ref().to_glib_none().0, - value.to_glib_none().0, - ); + ffi::he_app_bar_set_decoration_layout(self.as_ref().to_glib_none().0, value.to_glib_none().0); } } @@ -533,9 +402,7 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_show_back")] fn shows_back(&self) -> bool { unsafe { - from_glib(ffi::he_app_bar_get_show_back( - self.as_ref().to_glib_none().0, - )) + from_glib(ffi::he_app_bar_get_show_back(self.as_ref().to_glib_none().0)) } } @@ -548,255 +415,131 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "stack")] fn connect_stack_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_stack_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeAppBar, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_stack_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AppBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::stack\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_stack_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::stack\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_stack_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "scroller")] fn connect_scroller_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_scroller_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeAppBar, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_scroller_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AppBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::scroller\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_scroller_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::scroller\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_scroller_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "is-compact")] fn connect_is_compact_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_is_compact_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeAppBar, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_is_compact_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AppBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::is-compact\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_is_compact_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::is-compact\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_is_compact_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "viewtitle-label")] fn connect_viewtitle_label_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_viewtitle_label_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeAppBar, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_viewtitle_label_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AppBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::viewtitle-label\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_viewtitle_label_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::viewtitle-label\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_viewtitle_label_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "viewtitle-widget")] fn connect_viewtitle_widget_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_viewtitle_widget_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeAppBar, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_viewtitle_widget_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AppBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::viewtitle-widget\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_viewtitle_widget_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::viewtitle-widget\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_viewtitle_widget_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "viewsubtitle-label")] fn connect_viewsubtitle_label_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_viewsubtitle_label_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeAppBar, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_viewsubtitle_label_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AppBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::viewsubtitle-label\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_viewsubtitle_label_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::viewsubtitle-label\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_viewsubtitle_label_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "show-left-title-buttons")] - fn connect_show_left_title_buttons_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_show_left_title_buttons_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeAppBar, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + fn connect_show_left_title_buttons_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_show_left_title_buttons_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AppBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::show-left-title-buttons\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_show_left_title_buttons_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::show-left-title-buttons\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_show_left_title_buttons_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "show-right-title-buttons")] - fn connect_show_right_title_buttons_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_show_right_title_buttons_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeAppBar, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + fn connect_show_right_title_buttons_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_show_right_title_buttons_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AppBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::show-right-title-buttons\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_show_right_title_buttons_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::show-right-title-buttons\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_show_right_title_buttons_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "decoration-layout")] fn connect_decoration_layout_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_decoration_layout_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeAppBar, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_decoration_layout_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AppBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::decoration-layout\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_decoration_layout_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::decoration-layout\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_decoration_layout_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "show-back")] fn connect_show_back_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_show_back_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeAppBar, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_show_back_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(AppBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::show-back\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_show_back_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::show-back\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_show_back_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/libhelium/src/auto/application.rs b/libhelium/src/auto/application.rs index 99099bc..7e277e1 100644 --- a/libhelium/src/auto/application.rs +++ b/libhelium/src/auto/application.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, RGBColor}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,RGBColor}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "HeApplication")] @@ -21,130 +17,92 @@ glib::wrapper! { } impl Application { - pub const NONE: Option<&'static Application> = None; - - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`Application`] objects. - /// - /// This method returns an instance of [`ApplicationBuilder`](crate::builders::ApplicationBuilder) which can be used to create [`Application`] objects. - pub fn builder() -> ApplicationBuilder { - ApplicationBuilder::new() - } + pub const NONE: Option<&'static Application> = None; + + + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`Application`] objects. + /// + /// This method returns an instance of [`ApplicationBuilder`](crate::builders::ApplicationBuilder) which can be used to create [`Application`] objects. + pub fn builder() -> ApplicationBuilder { + ApplicationBuilder::new() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`Application`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`Application`] 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 ApplicationBuilder { - builder: glib::object::ObjectBuilder<'static, Application>, -} - -impl ApplicationBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, Application>, } - } - pub fn default_accent_color(self, default_accent_color: &RGBColor) -> Self { - Self { - builder: self - .builder - .property("default-accent-color", default_accent_color), + impl ApplicationBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn override_accent_color(self, override_accent_color: bool) -> Self { - Self { - builder: self - .builder - .property("override-accent-color", override_accent_color), - } - } + pub fn default_accent_color(self, default_accent_color: &RGBColor) -> Self { + Self { builder: self.builder.property("default-accent-color", default_accent_color), } + } - pub fn override_dark_style(self, override_dark_style: bool) -> Self { - Self { - builder: self - .builder - .property("override-dark-style", override_dark_style), - } - } + pub fn override_accent_color(self, override_accent_color: bool) -> Self { + Self { builder: self.builder.property("override-accent-color", override_accent_color), } + } - pub fn override_contrast(self, override_contrast: bool) -> Self { - Self { - builder: self - .builder - .property("override-contrast", override_contrast), - } - } + pub fn override_dark_style(self, override_dark_style: bool) -> Self { + Self { builder: self.builder.property("override-dark-style", override_dark_style), } + } - pub fn default_contrast(self, default_contrast: f64) -> Self { - Self { - builder: self.builder.property("default-contrast", default_contrast), - } - } + pub fn override_contrast(self, override_contrast: bool) -> Self { + Self { builder: self.builder.property("override-contrast", override_contrast), } + } - pub fn menubar(self, menubar: &impl IsA) -> Self { - Self { - builder: self.builder.property("menubar", menubar.clone().upcast()), - } - } + pub fn default_contrast(self, default_contrast: f64) -> Self { + Self { builder: self.builder.property("default-contrast", default_contrast), } + } - pub fn register_session(self, register_session: bool) -> Self { - Self { - builder: self.builder.property("register-session", register_session), - } - } + pub fn menubar(self, menubar: &impl IsA) -> Self { + Self { builder: self.builder.property("menubar", menubar.clone().upcast()), } + } - pub fn application_id(self, application_id: impl Into) -> Self { - Self { - builder: self - .builder - .property("application-id", application_id.into()), - } - } + pub fn register_session(self, register_session: bool) -> Self { + Self { builder: self.builder.property("register-session", register_session), } + } - pub fn flags(self, flags: gio::ApplicationFlags) -> Self { - Self { - builder: self.builder.property("flags", flags), - } - } + pub fn application_id(self, application_id: impl Into) -> Self { + Self { builder: self.builder.property("application-id", application_id.into()), } + } - pub fn inactivity_timeout(self, inactivity_timeout: u32) -> Self { - Self { - builder: self - .builder - .property("inactivity-timeout", inactivity_timeout), - } - } + pub fn flags(self, flags: gio::ApplicationFlags) -> Self { + Self { builder: self.builder.property("flags", flags), } + } - pub fn resource_base_path(self, resource_base_path: impl Into) -> Self { - Self { - builder: self - .builder - .property("resource-base-path", resource_base_path.into()), - } - } + pub fn inactivity_timeout(self, inactivity_timeout: u32) -> Self { + Self { builder: self.builder.property("inactivity-timeout", inactivity_timeout), } + } + + pub fn resource_base_path(self, resource_base_path: impl Into) -> Self { + Self { builder: self.builder.property("resource-base-path", resource_base_path.into()), } + } - #[cfg(feature = "gio_v2_80")] + #[cfg(feature = "gio_v2_80")] #[cfg_attr(docsrs, doc(cfg(feature = "gio_v2_80")))] pub fn version(self, version: impl Into) -> Self { - Self { - builder: self.builder.property("version", version.into()), - } - } + Self { builder: self.builder.property("version", version.into()), } + } // rustdoc-stripper-ignore-next /// Build the [`Application`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Application { - let ret = self.builder.build(); + let ret = self.builder.build(); { Application::register_startup_hook(&ret); } - ret + ret } } @@ -158,9 +116,7 @@ pub trait HeApplicationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_default_accent_color")] fn default_accent_color(&self) -> Option { unsafe { - from_glib_none(ffi::he_application_get_default_accent_color( - self.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::he_application_get_default_accent_color(self.as_ref().to_glib_none().0)) } } @@ -168,19 +124,14 @@ pub trait HeApplicationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_override_accent_color")] fn is_override_accent_color(&self) -> bool { unsafe { - from_glib(ffi::he_application_get_override_accent_color( - self.as_ref().to_glib_none().0, - )) + from_glib(ffi::he_application_get_override_accent_color(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_application_set_override_accent_color")] fn set_override_accent_color(&self, value: bool) { unsafe { - ffi::he_application_set_override_accent_color( - self.as_ref().to_glib_none().0, - value.into_glib(), - ); + ffi::he_application_set_override_accent_color(self.as_ref().to_glib_none().0, value.into_glib()); } } @@ -188,19 +139,14 @@ pub trait HeApplicationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_override_dark_style")] fn is_override_dark_style(&self) -> bool { unsafe { - from_glib(ffi::he_application_get_override_dark_style( - self.as_ref().to_glib_none().0, - )) + from_glib(ffi::he_application_get_override_dark_style(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_application_set_override_dark_style")] fn set_override_dark_style(&self, value: bool) { unsafe { - ffi::he_application_set_override_dark_style( - self.as_ref().to_glib_none().0, - value.into_glib(), - ); + ffi::he_application_set_override_dark_style(self.as_ref().to_glib_none().0, value.into_glib()); } } @@ -208,26 +154,23 @@ pub trait HeApplicationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_override_contrast")] fn is_override_contrast(&self) -> bool { unsafe { - from_glib(ffi::he_application_get_override_contrast( - self.as_ref().to_glib_none().0, - )) + from_glib(ffi::he_application_get_override_contrast(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_application_set_override_contrast")] fn set_override_contrast(&self, value: bool) { unsafe { - ffi::he_application_set_override_contrast( - self.as_ref().to_glib_none().0, - value.into_glib(), - ); + ffi::he_application_set_override_contrast(self.as_ref().to_glib_none().0, value.into_glib()); } } #[doc(alias = "he_application_get_default_contrast")] #[doc(alias = "get_default_contrast")] fn default_contrast(&self) -> f64 { - unsafe { ffi::he_application_get_default_contrast(self.as_ref().to_glib_none().0) } + unsafe { + ffi::he_application_get_default_contrast(self.as_ref().to_glib_none().0) + } } #[doc(alias = "he_application_set_default_contrast")] @@ -250,134 +193,66 @@ pub trait HeApplicationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "default-accent-color")] fn connect_default_accent_color_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_default_accent_color_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeApplication, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_default_accent_color_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeApplication, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Application::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::default-accent-color\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_default_accent_color_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::default-accent-color\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_default_accent_color_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "override-accent-color")] - fn connect_override_accent_color_notify( - &self, - f: F, - ) -> SignalHandlerId { - unsafe extern "C" fn notify_override_accent_color_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeApplication, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + fn connect_override_accent_color_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_override_accent_color_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeApplication, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Application::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::override-accent-color\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_override_accent_color_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::override-accent-color\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_override_accent_color_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "override-dark-style")] fn connect_override_dark_style_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_override_dark_style_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeApplication, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_override_dark_style_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeApplication, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Application::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::override-dark-style\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_override_dark_style_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::override-dark-style\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_override_dark_style_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "override-contrast")] fn connect_override_contrast_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_override_contrast_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeApplication, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_override_contrast_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeApplication, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Application::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::override-contrast\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_override_contrast_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::override-contrast\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_override_contrast_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "default-contrast")] fn connect_default_contrast_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_default_contrast_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeApplication, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_default_contrast_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeApplication, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Application::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::default-contrast\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_default_contrast_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::default-contrast\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_default_contrast_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/libhelium/src/auto/application_window.rs b/libhelium/src/auto/application_window.rs index c8319f7..b2eb9b8 100644 --- a/libhelium/src/auto/application_window.rs +++ b/libhelium/src/auto/application_window.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, Application}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,Application}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "HeApplicationWindow")] @@ -21,401 +17,280 @@ glib::wrapper! { } impl ApplicationWindow { - pub const NONE: Option<&'static ApplicationWindow> = None; + pub const NONE: Option<&'static ApplicationWindow> = None; + #[doc(alias = "he_application_window_new")] pub fn new(app: &impl IsA) -> ApplicationWindow { skip_assert_initialized!(); unsafe { - from_glib_none(ffi::he_application_window_new( - app.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::he_application_window_new(app.as_ref().to_glib_none().0)) } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`ApplicationWindow`] objects. - /// - /// This method returns an instance of [`ApplicationWindowBuilder`](crate::builders::ApplicationWindowBuilder) which can be used to create [`ApplicationWindow`] objects. - pub fn builder() -> ApplicationWindowBuilder { - ApplicationWindowBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`ApplicationWindow`] objects. + /// + /// This method returns an instance of [`ApplicationWindowBuilder`](crate::builders::ApplicationWindowBuilder) which can be used to create [`ApplicationWindow`] objects. + pub fn builder() -> ApplicationWindowBuilder { + ApplicationWindowBuilder::new() + } + } impl Default for ApplicationWindow { - fn default() -> Self { - glib::object::Object::new::() - } -} + fn default() -> Self { + glib::object::Object::new::() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`ApplicationWindow`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`ApplicationWindow`] 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 ApplicationWindowBuilder { - builder: glib::object::ObjectBuilder<'static, ApplicationWindow>, -} - -impl ApplicationWindowBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, ApplicationWindow>, } - } - pub fn has_title(self, has_title: bool) -> Self { - Self { - builder: self.builder.property("has-title", has_title), + impl ApplicationWindowBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn has_back_button(self, has_back_button: bool) -> Self { - Self { - builder: self.builder.property("has-back-button", has_back_button), - } - } + pub fn has_title(self, has_title: bool) -> Self { + Self { builder: self.builder.property("has-title", has_title), } + } - pub fn show_menubar(self, show_menubar: bool) -> Self { - Self { - builder: self.builder.property("show-menubar", show_menubar), - } - } + pub fn has_back_button(self, has_back_button: bool) -> Self { + Self { builder: self.builder.property("has-back-button", has_back_button), } + } - pub fn application(self, application: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("application", application.clone().upcast()), - } - } + pub fn show_menubar(self, show_menubar: bool) -> Self { + Self { builder: self.builder.property("show-menubar", show_menubar), } + } - pub fn child(self, child: &impl IsA) -> Self { - Self { - builder: self.builder.property("child", child.clone().upcast()), - } - } + pub fn application(self, application: &impl IsA) -> Self { + Self { builder: self.builder.property("application", application.clone().upcast()), } + } - pub fn decorated(self, decorated: bool) -> Self { - Self { - builder: self.builder.property("decorated", decorated), - } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { builder: self.builder.property("child", child.clone().upcast()), } + } - pub fn default_height(self, default_height: i32) -> Self { - Self { - builder: self.builder.property("default-height", default_height), - } - } + pub fn decorated(self, decorated: bool) -> Self { + Self { builder: self.builder.property("decorated", decorated), } + } - pub fn default_widget(self, default_widget: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("default-widget", default_widget.clone().upcast()), - } - } + pub fn default_height(self, default_height: i32) -> Self { + Self { builder: self.builder.property("default-height", default_height), } + } - pub fn default_width(self, default_width: i32) -> Self { - Self { - builder: self.builder.property("default-width", default_width), - } - } + pub fn default_widget(self, default_widget: &impl IsA) -> Self { + Self { builder: self.builder.property("default-widget", default_widget.clone().upcast()), } + } - pub fn deletable(self, deletable: bool) -> Self { - Self { - builder: self.builder.property("deletable", deletable), - } - } + pub fn default_width(self, default_width: i32) -> Self { + Self { builder: self.builder.property("default-width", default_width), } + } - pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self { - Self { - builder: self - .builder - .property("destroy-with-parent", destroy_with_parent), - } - } + pub fn deletable(self, deletable: bool) -> Self { + Self { builder: self.builder.property("deletable", deletable), } + } - //pub fn display(self, display: /*Ignored*/&gdk::Display) -> Self { - // Self { builder: self.builder.property("display", display), } - //} + pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self { + Self { builder: self.builder.property("destroy-with-parent", destroy_with_parent), } + } - pub fn focus_visible(self, focus_visible: bool) -> Self { - Self { - builder: self.builder.property("focus-visible", focus_visible), - } - } + //pub fn display(self, display: /*Ignored*/&gdk::Display) -> Self { + // Self { builder: self.builder.property("display", display), } + //} - pub fn focus_widget(self, focus_widget: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("focus-widget", focus_widget.clone().upcast()), - } - } + pub fn focus_visible(self, focus_visible: bool) -> Self { + Self { builder: self.builder.property("focus-visible", focus_visible), } + } - pub fn fullscreened(self, fullscreened: bool) -> Self { - Self { - builder: self.builder.property("fullscreened", fullscreened), - } - } + pub fn focus_widget(self, focus_widget: &impl IsA) -> Self { + Self { builder: self.builder.property("focus-widget", focus_widget.clone().upcast()), } + } + + pub fn fullscreened(self, fullscreened: bool) -> Self { + Self { builder: self.builder.property("fullscreened", fullscreened), } + } - #[cfg(feature = "gtk_v4_2")] + #[cfg(feature = "gtk_v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { - Self { - builder: self - .builder - .property("handle-menubar-accel", handle_menubar_accel), - } - } + Self { builder: self.builder.property("handle-menubar-accel", handle_menubar_accel), } + } - pub fn hide_on_close(self, hide_on_close: bool) -> Self { - Self { - builder: self.builder.property("hide-on-close", hide_on_close), - } - } + pub fn hide_on_close(self, hide_on_close: bool) -> Self { + Self { builder: self.builder.property("hide-on-close", hide_on_close), } + } - pub fn icon_name(self, icon_name: impl Into) -> Self { - Self { - builder: self.builder.property("icon-name", icon_name.into()), - } - } + pub fn icon_name(self, icon_name: impl Into) -> Self { + Self { builder: self.builder.property("icon-name", icon_name.into()), } + } - pub fn maximized(self, maximized: bool) -> Self { - Self { - builder: self.builder.property("maximized", maximized), - } - } + pub fn maximized(self, maximized: bool) -> Self { + Self { builder: self.builder.property("maximized", maximized), } + } - pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self { - Self { - builder: self - .builder - .property("mnemonics-visible", mnemonics_visible), - } - } + pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self { + Self { builder: self.builder.property("mnemonics-visible", mnemonics_visible), } + } - pub fn modal(self, modal: bool) -> Self { - Self { - builder: self.builder.property("modal", modal), - } - } + pub fn modal(self, modal: bool) -> Self { + Self { builder: self.builder.property("modal", modal), } + } - pub fn resizable(self, resizable: bool) -> Self { - Self { - builder: self.builder.property("resizable", resizable), - } - } + pub fn resizable(self, resizable: bool) -> Self { + Self { builder: self.builder.property("resizable", resizable), } + } - pub fn startup_id(self, startup_id: impl Into) -> Self { - Self { - builder: self.builder.property("startup-id", startup_id.into()), - } - } + pub fn startup_id(self, startup_id: impl Into) -> Self { + Self { builder: self.builder.property("startup-id", startup_id.into()), } + } - pub fn title(self, title: impl Into) -> Self { - Self { - builder: self.builder.property("title", title.into()), - } - } + pub fn title(self, title: impl Into) -> Self { + Self { builder: self.builder.property("title", title.into()), } + } - #[cfg(feature = "gtk_v4_6")] + #[cfg(feature = "gtk_v4_6")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_6")))] pub fn titlebar(self, titlebar: &impl IsA) -> Self { - Self { - builder: self.builder.property("titlebar", titlebar.clone().upcast()), - } - } + Self { builder: self.builder.property("titlebar", titlebar.clone().upcast()), } + } - pub fn transient_for(self, transient_for: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("transient-for", transient_for.clone().upcast()), - } - } + pub fn transient_for(self, transient_for: &impl IsA) -> Self { + Self { builder: self.builder.property("transient-for", transient_for.clone().upcast()), } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { - builder: self.builder.property("can-focus", can_focus), - } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { builder: self.builder.property("can-focus", can_focus), } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { - builder: self.builder.property("can-target", can_target), - } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { builder: self.builder.property("can-target", can_target), } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { - builder: self.builder.property("css-classes", css_classes.into()), - } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { builder: self.builder.property("css-classes", css_classes.into()), } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { - builder: self.builder.property("css-name", css_name.into()), - } - } + pub fn css_name(self, css_name: impl Into) -> Self { + Self { builder: self.builder.property("css-name", css_name.into()), } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { - builder: self.builder.property("focus-on-click", focus_on_click), - } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { builder: self.builder.property("focus-on-click", focus_on_click), } + } - pub fn focusable(self, focusable: bool) -> Self { - Self { - builder: self.builder.property("focusable", focusable), - } - } + pub fn focusable(self, focusable: bool) -> Self { + Self { builder: self.builder.property("focusable", focusable), } + } - pub fn halign(self, halign: gtk::Align) -> Self { - Self { - builder: self.builder.property("halign", halign), - } - } + pub fn halign(self, halign: gtk::Align) -> Self { + Self { builder: self.builder.property("halign", halign), } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { - builder: self.builder.property("has-tooltip", has_tooltip), - } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { builder: self.builder.property("has-tooltip", has_tooltip), } + } - pub fn height_request(self, height_request: i32) -> Self { - Self { - builder: self.builder.property("height-request", height_request), - } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { builder: self.builder.property("height-request", height_request), } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { - builder: self.builder.property("hexpand", hexpand), - } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { builder: self.builder.property("hexpand", hexpand), } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { - builder: self.builder.property("hexpand-set", hexpand_set), - } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { builder: self.builder.property("hexpand-set", hexpand_set), } + } - //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } - //} + //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + //} - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { - builder: self.builder.property("margin-bottom", margin_bottom), - } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { builder: self.builder.property("margin-bottom", margin_bottom), } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { - builder: self.builder.property("margin-end", margin_end), - } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { builder: self.builder.property("margin-end", margin_end), } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { - builder: self.builder.property("margin-start", margin_start), - } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { builder: self.builder.property("margin-start", margin_start), } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { - builder: self.builder.property("margin-top", margin_top), - } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { builder: self.builder.property("margin-top", margin_top), } + } - pub fn name(self, name: impl Into) -> Self { - Self { - builder: self.builder.property("name", name.into()), - } - } + pub fn name(self, name: impl Into) -> Self { + Self { builder: self.builder.property("name", name.into()), } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { - builder: self.builder.property("opacity", opacity), - } - } + pub fn opacity(self, opacity: f64) -> Self { + Self { builder: self.builder.property("opacity", opacity), } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn receives_default(self, receives_default: bool) -> Self { - Self { - builder: self.builder.property("receives-default", receives_default), - } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { builder: self.builder.property("receives-default", receives_default), } + } - pub fn sensitive(self, sensitive: bool) -> Self { - Self { - builder: self.builder.property("sensitive", sensitive), - } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { builder: self.builder.property("sensitive", sensitive), } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { - builder: self - .builder - .property("tooltip-markup", tooltip_markup.into()), - } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { - builder: self.builder.property("tooltip-text", tooltip_text.into()), - } - } + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } + } - pub fn valign(self, valign: gtk::Align) -> Self { - Self { - builder: self.builder.property("valign", valign), - } - } + pub fn valign(self, valign: gtk::Align) -> Self { + Self { builder: self.builder.property("valign", valign), } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { - builder: self.builder.property("vexpand", vexpand), - } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { builder: self.builder.property("vexpand", vexpand), } + } - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { - builder: self.builder.property("vexpand-set", vexpand_set), - } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { builder: self.builder.property("vexpand-set", vexpand_set), } + } - pub fn visible(self, visible: bool) -> Self { - Self { - builder: self.builder.property("visible", visible), - } - } + pub fn visible(self, visible: bool) -> Self { + Self { builder: self.builder.property("visible", visible), } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { - builder: self.builder.property("width-request", width_request), - } - } + pub fn width_request(self, width_request: i32) -> Self { + Self { builder: self.builder.property("width-request", width_request), } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} // rustdoc-stripper-ignore-next /// Build the [`ApplicationWindow`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> ApplicationWindow { - self.builder.build() - } + self.builder.build() } } mod sealed { @@ -428,19 +303,14 @@ pub trait ApplicationWindowExt: IsA + sealed::Sealed + 'stati #[doc(alias = "get_has_title")] fn has_title(&self) -> bool { unsafe { - from_glib(ffi::he_application_window_get_has_title( - self.as_ref().to_glib_none().0, - )) + from_glib(ffi::he_application_window_get_has_title(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_application_window_set_has_title")] fn set_has_title(&self, value: bool) { unsafe { - ffi::he_application_window_set_has_title( - self.as_ref().to_glib_none().0, - value.into_glib(), - ); + ffi::he_application_window_set_has_title(self.as_ref().to_glib_none().0, value.into_glib()); } } @@ -448,71 +318,40 @@ pub trait ApplicationWindowExt: IsA + sealed::Sealed + 'stati #[doc(alias = "get_has_back_button")] fn has_back_button(&self) -> bool { unsafe { - from_glib(ffi::he_application_window_get_has_back_button( - self.as_ref().to_glib_none().0, - )) + from_glib(ffi::he_application_window_get_has_back_button(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_application_window_set_has_back_button")] fn set_has_back_button(&self, value: bool) { unsafe { - ffi::he_application_window_set_has_back_button( - self.as_ref().to_glib_none().0, - value.into_glib(), - ); + ffi::he_application_window_set_has_back_button(self.as_ref().to_glib_none().0, value.into_glib()); } } #[doc(alias = "has-title")] fn connect_has_title_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_has_title_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeApplicationWindow, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_has_title_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeApplicationWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(ApplicationWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::has-title\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_has_title_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::has-title\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_has_title_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "has-back-button")] fn connect_has_back_button_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_has_back_button_trampoline< - P: IsA, - F: Fn(&P) + 'static, - >( - this: *mut ffi::HeApplicationWindow, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_has_back_button_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeApplicationWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(ApplicationWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::has-back-button\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_has_back_button_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::has-back-button\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_has_back_button_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/libhelium/src/auto/avatar.rs b/libhelium/src/auto/avatar.rs index 366bb0d..d5602fa 100644 --- a/libhelium/src/auto/avatar.rs +++ b/libhelium/src/auto/avatar.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, Bin}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,Bin}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "HeAvatar")] @@ -21,243 +17,178 @@ glib::wrapper! { } impl Avatar { - pub const NONE: Option<&'static Avatar> = None; - - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`Avatar`] objects. - /// - /// This method returns an instance of [`AvatarBuilder`](crate::builders::AvatarBuilder) which can be used to create [`Avatar`] objects. - pub fn builder() -> AvatarBuilder { - AvatarBuilder::new() - } + pub const NONE: Option<&'static Avatar> = None; + + + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`Avatar`] objects. + /// + /// This method returns an instance of [`AvatarBuilder`](crate::builders::AvatarBuilder) which can be used to create [`Avatar`] objects. + pub fn builder() -> AvatarBuilder { + AvatarBuilder::new() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`Avatar`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`Avatar`] 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 AvatarBuilder { - builder: glib::object::ObjectBuilder<'static, Avatar>, -} - -impl AvatarBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, Avatar>, } - } - pub fn size(self, size: i32) -> Self { - Self { - builder: self.builder.property("size", size), + impl AvatarBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn text(self, text: impl Into) -> Self { - Self { - builder: self.builder.property("text", text.into()), - } - } + pub fn size(self, size: i32) -> Self { + Self { builder: self.builder.property("size", size), } + } - pub fn status(self, status: bool) -> Self { - Self { - builder: self.builder.property("status", status), - } - } + pub fn text(self, text: impl Into) -> Self { + Self { builder: self.builder.property("text", text.into()), } + } - pub fn image(self, image: impl Into) -> Self { - Self { - builder: self.builder.property("image", image.into()), - } - } + pub fn status(self, status: bool) -> Self { + Self { builder: self.builder.property("status", status), } + } - pub fn child(self, child: &impl IsA) -> Self { - Self { - builder: self.builder.property("child", child.clone().upcast()), - } - } + pub fn image(self, image: impl Into) -> Self { + Self { builder: self.builder.property("image", image.into()), } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { - builder: self.builder.property("can-focus", can_focus), - } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { builder: self.builder.property("child", child.clone().upcast()), } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { - builder: self.builder.property("can-target", can_target), - } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { builder: self.builder.property("can-focus", can_focus), } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { - builder: self.builder.property("css-classes", css_classes.into()), - } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { builder: self.builder.property("can-target", can_target), } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { - builder: self.builder.property("css-name", css_name.into()), - } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { builder: self.builder.property("css-classes", css_classes.into()), } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + pub fn css_name(self, css_name: impl Into) -> Self { + Self { builder: self.builder.property("css-name", css_name.into()), } + } - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { - builder: self.builder.property("focus-on-click", focus_on_click), - } - } + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focusable(self, focusable: bool) -> Self { - Self { - builder: self.builder.property("focusable", focusable), - } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { builder: self.builder.property("focus-on-click", focus_on_click), } + } - pub fn halign(self, halign: gtk::Align) -> Self { - Self { - builder: self.builder.property("halign", halign), - } - } + pub fn focusable(self, focusable: bool) -> Self { + Self { builder: self.builder.property("focusable", focusable), } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { - builder: self.builder.property("has-tooltip", has_tooltip), - } - } + pub fn halign(self, halign: gtk::Align) -> Self { + Self { builder: self.builder.property("halign", halign), } + } - pub fn height_request(self, height_request: i32) -> Self { - Self { - builder: self.builder.property("height-request", height_request), - } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { builder: self.builder.property("has-tooltip", has_tooltip), } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { - builder: self.builder.property("hexpand", hexpand), - } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { builder: self.builder.property("height-request", height_request), } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { - builder: self.builder.property("hexpand-set", hexpand_set), - } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { builder: self.builder.property("hexpand", hexpand), } + } - //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } - //} + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { builder: self.builder.property("hexpand-set", hexpand_set), } + } - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { - builder: self.builder.property("margin-bottom", margin_bottom), - } - } + //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + //} - pub fn margin_end(self, margin_end: i32) -> Self { - Self { - builder: self.builder.property("margin-end", margin_end), - } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { builder: self.builder.property("margin-bottom", margin_bottom), } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { - builder: self.builder.property("margin-start", margin_start), - } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { builder: self.builder.property("margin-end", margin_end), } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { - builder: self.builder.property("margin-top", margin_top), - } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { builder: self.builder.property("margin-start", margin_start), } + } - pub fn name(self, name: impl Into) -> Self { - Self { - builder: self.builder.property("name", name.into()), - } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { builder: self.builder.property("margin-top", margin_top), } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { - builder: self.builder.property("opacity", opacity), - } - } + pub fn name(self, name: impl Into) -> Self { + Self { builder: self.builder.property("name", name.into()), } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + pub fn opacity(self, opacity: f64) -> Self { + Self { builder: self.builder.property("opacity", opacity), } + } - pub fn receives_default(self, receives_default: bool) -> Self { - Self { - builder: self.builder.property("receives-default", receives_default), - } - } + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn sensitive(self, sensitive: bool) -> Self { - Self { - builder: self.builder.property("sensitive", sensitive), - } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { builder: self.builder.property("receives-default", receives_default), } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { - builder: self - .builder - .property("tooltip-markup", tooltip_markup.into()), - } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { builder: self.builder.property("sensitive", sensitive), } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { - builder: self.builder.property("tooltip-text", tooltip_text.into()), - } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } + } - pub fn valign(self, valign: gtk::Align) -> Self { - Self { - builder: self.builder.property("valign", valign), - } - } + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { - builder: self.builder.property("vexpand", vexpand), - } - } + pub fn valign(self, valign: gtk::Align) -> Self { + Self { builder: self.builder.property("valign", valign), } + } - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { - builder: self.builder.property("vexpand-set", vexpand_set), - } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { builder: self.builder.property("vexpand", vexpand), } + } - pub fn visible(self, visible: bool) -> Self { - Self { - builder: self.builder.property("visible", visible), - } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { builder: self.builder.property("vexpand-set", vexpand_set), } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { - builder: self.builder.property("width-request", width_request), - } - } + pub fn visible(self, visible: bool) -> Self { + Self { builder: self.builder.property("visible", visible), } + } + + pub fn width_request(self, width_request: i32) -> Self { + Self { builder: self.builder.property("width-request", width_request), } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} // rustdoc-stripper-ignore-next /// Build the [`Avatar`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Avatar { - self.builder.build() - } + self.builder.build() } } mod sealed { @@ -269,7 +200,9 @@ pub trait AvatarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_avatar_get_size")] #[doc(alias = "get_size")] fn size(&self) -> i32 { - unsafe { ffi::he_avatar_get_size(self.as_ref().to_glib_none().0) } + unsafe { + ffi::he_avatar_get_size(self.as_ref().to_glib_none().0) + } } #[doc(alias = "he_avatar_set_size")] @@ -282,7 +215,9 @@ pub trait AvatarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_avatar_get_text")] #[doc(alias = "get_text")] fn text(&self) -> Option { - unsafe { from_glib_none(ffi::he_avatar_get_text(self.as_ref().to_glib_none().0)) } + unsafe { + from_glib_none(ffi::he_avatar_get_text(self.as_ref().to_glib_none().0)) + } } #[doc(alias = "he_avatar_set_text")] @@ -295,7 +230,9 @@ pub trait AvatarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_avatar_get_status")] #[doc(alias = "get_status")] fn is_status(&self) -> bool { - unsafe { from_glib(ffi::he_avatar_get_status(self.as_ref().to_glib_none().0)) } + unsafe { + from_glib(ffi::he_avatar_get_status(self.as_ref().to_glib_none().0)) + } } #[doc(alias = "he_avatar_set_status")] @@ -308,7 +245,9 @@ pub trait AvatarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_avatar_get_image")] #[doc(alias = "get_image")] fn image(&self) -> Option { - unsafe { from_glib_none(ffi::he_avatar_get_image(self.as_ref().to_glib_none().0)) } + unsafe { + from_glib_none(ffi::he_avatar_get_image(self.as_ref().to_glib_none().0)) + } } #[doc(alias = "he_avatar_set_image")] @@ -320,93 +259,53 @@ pub trait AvatarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "size")] fn connect_size_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_size_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeAvatar, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_size_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAvatar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Avatar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::size\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_size_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::size\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_size_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "text")] fn connect_text_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_text_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeAvatar, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_text_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAvatar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Avatar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::text\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_text_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::text\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_text_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "status")] fn connect_status_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_status_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeAvatar, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_status_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAvatar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Avatar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::status\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_status_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::status\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_status_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "image")] fn connect_image_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_image_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeAvatar, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_image_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAvatar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Avatar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::image\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_image_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::image\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_image_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/libhelium/src/auto/badge.rs b/libhelium/src/auto/badge.rs index be06ecf..1bbcbd5 100644 --- a/libhelium/src/auto/badge.rs +++ b/libhelium/src/auto/badge.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, Bin}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,Bin}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "HeBadge")] @@ -21,237 +17,180 @@ glib::wrapper! { } impl Badge { - pub const NONE: Option<&'static Badge> = None; + pub const NONE: Option<&'static Badge> = None; + #[doc(alias = "he_badge_new")] pub fn new() -> Badge { assert_initialized_main_thread!(); - unsafe { from_glib_none(ffi::he_badge_new()) } + unsafe { + from_glib_none(ffi::he_badge_new()) + } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`Badge`] objects. - /// - /// This method returns an instance of [`BadgeBuilder`](crate::builders::BadgeBuilder) which can be used to create [`Badge`] objects. - pub fn builder() -> BadgeBuilder { - BadgeBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`Badge`] objects. + /// + /// This method returns an instance of [`BadgeBuilder`](crate::builders::BadgeBuilder) which can be used to create [`Badge`] objects. + pub fn builder() -> BadgeBuilder { + BadgeBuilder::new() + } + } impl Default for Badge { - fn default() -> Self { - Self::new() - } -} + fn default() -> Self { + Self::new() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`Badge`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`Badge`] 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 BadgeBuilder { - builder: glib::object::ObjectBuilder<'static, Badge>, -} - -impl BadgeBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, Badge>, } - } - pub fn child(self, child: &impl IsA) -> Self { - Self { - builder: self.builder.property("child", child.clone().upcast()), + impl BadgeBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn label(self, label: impl Into) -> Self { - Self { - builder: self.builder.property("label", label.into()), - } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { builder: self.builder.property("child", child.clone().upcast()), } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { - builder: self.builder.property("can-focus", can_focus), - } - } + pub fn label(self, label: impl Into) -> Self { + Self { builder: self.builder.property("label", label.into()), } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { - builder: self.builder.property("can-target", can_target), - } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { builder: self.builder.property("can-focus", can_focus), } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { - builder: self.builder.property("css-classes", css_classes.into()), - } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { builder: self.builder.property("can-target", can_target), } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { - builder: self.builder.property("css-name", css_name.into()), - } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { builder: self.builder.property("css-classes", css_classes.into()), } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + pub fn css_name(self, css_name: impl Into) -> Self { + Self { builder: self.builder.property("css-name", css_name.into()), } + } - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { - builder: self.builder.property("focus-on-click", focus_on_click), - } - } + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focusable(self, focusable: bool) -> Self { - Self { - builder: self.builder.property("focusable", focusable), - } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { builder: self.builder.property("focus-on-click", focus_on_click), } + } - pub fn halign(self, halign: gtk::Align) -> Self { - Self { - builder: self.builder.property("halign", halign), - } - } + pub fn focusable(self, focusable: bool) -> Self { + Self { builder: self.builder.property("focusable", focusable), } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { - builder: self.builder.property("has-tooltip", has_tooltip), - } - } + pub fn halign(self, halign: gtk::Align) -> Self { + Self { builder: self.builder.property("halign", halign), } + } - pub fn height_request(self, height_request: i32) -> Self { - Self { - builder: self.builder.property("height-request", height_request), - } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { builder: self.builder.property("has-tooltip", has_tooltip), } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { - builder: self.builder.property("hexpand", hexpand), - } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { builder: self.builder.property("height-request", height_request), } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { - builder: self.builder.property("hexpand-set", hexpand_set), - } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { builder: self.builder.property("hexpand", hexpand), } + } - //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } - //} + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { builder: self.builder.property("hexpand-set", hexpand_set), } + } - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { - builder: self.builder.property("margin-bottom", margin_bottom), - } - } + //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + //} - pub fn margin_end(self, margin_end: i32) -> Self { - Self { - builder: self.builder.property("margin-end", margin_end), - } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { builder: self.builder.property("margin-bottom", margin_bottom), } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { - builder: self.builder.property("margin-start", margin_start), - } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { builder: self.builder.property("margin-end", margin_end), } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { - builder: self.builder.property("margin-top", margin_top), - } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { builder: self.builder.property("margin-start", margin_start), } + } - pub fn name(self, name: impl Into) -> Self { - Self { - builder: self.builder.property("name", name.into()), - } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { builder: self.builder.property("margin-top", margin_top), } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { - builder: self.builder.property("opacity", opacity), - } - } + pub fn name(self, name: impl Into) -> Self { + Self { builder: self.builder.property("name", name.into()), } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + pub fn opacity(self, opacity: f64) -> Self { + Self { builder: self.builder.property("opacity", opacity), } + } - pub fn receives_default(self, receives_default: bool) -> Self { - Self { - builder: self.builder.property("receives-default", receives_default), - } - } + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn sensitive(self, sensitive: bool) -> Self { - Self { - builder: self.builder.property("sensitive", sensitive), - } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { builder: self.builder.property("receives-default", receives_default), } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { - builder: self - .builder - .property("tooltip-markup", tooltip_markup.into()), - } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { builder: self.builder.property("sensitive", sensitive), } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { - builder: self.builder.property("tooltip-text", tooltip_text.into()), - } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } + } - pub fn valign(self, valign: gtk::Align) -> Self { - Self { - builder: self.builder.property("valign", valign), - } - } + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { - builder: self.builder.property("vexpand", vexpand), - } - } + pub fn valign(self, valign: gtk::Align) -> Self { + Self { builder: self.builder.property("valign", valign), } + } - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { - builder: self.builder.property("vexpand-set", vexpand_set), - } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { builder: self.builder.property("vexpand", vexpand), } + } - pub fn visible(self, visible: bool) -> Self { - Self { - builder: self.builder.property("visible", visible), - } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { builder: self.builder.property("vexpand-set", vexpand_set), } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { - builder: self.builder.property("width-request", width_request), - } - } + pub fn visible(self, visible: bool) -> Self { + Self { builder: self.builder.property("visible", visible), } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + pub fn width_request(self, width_request: i32) -> Self { + Self { builder: self.builder.property("width-request", width_request), } + } + + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} // rustdoc-stripper-ignore-next /// Build the [`Badge`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Badge { - self.builder.build() - } + self.builder.build() } } mod sealed { @@ -263,23 +202,24 @@ pub trait BadgeExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_badge_get_child")] #[doc(alias = "get_child")] fn child(&self) -> Option { - unsafe { from_glib_none(ffi::he_badge_get_child(self.as_ref().to_glib_none().0)) } + unsafe { + from_glib_none(ffi::he_badge_get_child(self.as_ref().to_glib_none().0)) + } } #[doc(alias = "he_badge_set_child")] fn set_child(&self, value: Option<&impl IsA>) { unsafe { - ffi::he_badge_set_child( - self.as_ref().to_glib_none().0, - value.map(|p| p.as_ref()).to_glib_none().0, - ); + ffi::he_badge_set_child(self.as_ref().to_glib_none().0, value.map(|p| p.as_ref()).to_glib_none().0); } } #[doc(alias = "he_badge_get_label")] #[doc(alias = "get_label")] fn label(&self) -> Option { - unsafe { from_glib_none(ffi::he_badge_get_label(self.as_ref().to_glib_none().0)) } + unsafe { + from_glib_none(ffi::he_badge_get_label(self.as_ref().to_glib_none().0)) + } } #[doc(alias = "he_badge_set_label")] @@ -291,24 +231,14 @@ pub trait BadgeExt: IsA + sealed::Sealed + 'static { #[doc(alias = "label")] fn connect_label_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_label_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeBadge, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_label_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeBadge, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Badge::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::label\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_label_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::label\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_label_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/libhelium/src/auto/banner.rs b/libhelium/src/auto/banner.rs index d889b49..94a2830 100644 --- a/libhelium/src/auto/banner.rs +++ b/libhelium/src/auto/banner.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, BannerStyle, Bin}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,BannerStyle,Bin}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "HeBanner")] @@ -21,254 +17,188 @@ glib::wrapper! { } impl Banner { - pub const NONE: Option<&'static Banner> = None; + pub const NONE: Option<&'static Banner> = None; + #[doc(alias = "he_banner_new")] pub fn new(title: &str, description: &str) -> Banner { assert_initialized_main_thread!(); unsafe { - from_glib_none(ffi::he_banner_new( - title.to_glib_none().0, - description.to_glib_none().0, - )) + from_glib_none(ffi::he_banner_new(title.to_glib_none().0, description.to_glib_none().0)) } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`Banner`] objects. - /// - /// This method returns an instance of [`BannerBuilder`](crate::builders::BannerBuilder) which can be used to create [`Banner`] objects. - pub fn builder() -> BannerBuilder { - BannerBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`Banner`] objects. + /// + /// This method returns an instance of [`BannerBuilder`](crate::builders::BannerBuilder) which can be used to create [`Banner`] objects. + pub fn builder() -> BannerBuilder { + BannerBuilder::new() + } + } impl Default for Banner { - fn default() -> Self { - glib::object::Object::new::() - } -} + fn default() -> Self { + glib::object::Object::new::() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`Banner`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`Banner`] 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 BannerBuilder { - builder: glib::object::ObjectBuilder<'static, Banner>, -} - -impl BannerBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, Banner>, } - } - pub fn title(self, title: impl Into) -> Self { - Self { - builder: self.builder.property("title", title.into()), + impl BannerBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn description(self, description: impl Into) -> Self { - Self { - builder: self.builder.property("description", description.into()), - } - } + pub fn title(self, title: impl Into) -> Self { + Self { builder: self.builder.property("title", title.into()), } + } - pub fn style(self, style: BannerStyle) -> Self { - Self { - builder: self.builder.property("style", style), - } - } + pub fn description(self, description: impl Into) -> Self { + Self { builder: self.builder.property("description", description.into()), } + } - pub fn child(self, child: &impl IsA) -> Self { - Self { - builder: self.builder.property("child", child.clone().upcast()), - } - } + pub fn style(self, style: BannerStyle) -> Self { + Self { builder: self.builder.property("style", style), } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { - builder: self.builder.property("can-focus", can_focus), - } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { builder: self.builder.property("child", child.clone().upcast()), } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { - builder: self.builder.property("can-target", can_target), - } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { builder: self.builder.property("can-focus", can_focus), } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { - builder: self.builder.property("css-classes", css_classes.into()), - } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { builder: self.builder.property("can-target", can_target), } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { - builder: self.builder.property("css-name", css_name.into()), - } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { builder: self.builder.property("css-classes", css_classes.into()), } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + pub fn css_name(self, css_name: impl Into) -> Self { + Self { builder: self.builder.property("css-name", css_name.into()), } + } - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { - builder: self.builder.property("focus-on-click", focus_on_click), - } - } + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focusable(self, focusable: bool) -> Self { - Self { - builder: self.builder.property("focusable", focusable), - } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { builder: self.builder.property("focus-on-click", focus_on_click), } + } - pub fn halign(self, halign: gtk::Align) -> Self { - Self { - builder: self.builder.property("halign", halign), - } - } + pub fn focusable(self, focusable: bool) -> Self { + Self { builder: self.builder.property("focusable", focusable), } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { - builder: self.builder.property("has-tooltip", has_tooltip), - } - } + pub fn halign(self, halign: gtk::Align) -> Self { + Self { builder: self.builder.property("halign", halign), } + } - pub fn height_request(self, height_request: i32) -> Self { - Self { - builder: self.builder.property("height-request", height_request), - } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { builder: self.builder.property("has-tooltip", has_tooltip), } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { - builder: self.builder.property("hexpand", hexpand), - } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { builder: self.builder.property("height-request", height_request), } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { - builder: self.builder.property("hexpand-set", hexpand_set), - } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { builder: self.builder.property("hexpand", hexpand), } + } - //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } - //} + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { builder: self.builder.property("hexpand-set", hexpand_set), } + } - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { - builder: self.builder.property("margin-bottom", margin_bottom), - } - } + //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + //} - pub fn margin_end(self, margin_end: i32) -> Self { - Self { - builder: self.builder.property("margin-end", margin_end), - } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { builder: self.builder.property("margin-bottom", margin_bottom), } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { - builder: self.builder.property("margin-start", margin_start), - } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { builder: self.builder.property("margin-end", margin_end), } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { - builder: self.builder.property("margin-top", margin_top), - } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { builder: self.builder.property("margin-start", margin_start), } + } - pub fn name(self, name: impl Into) -> Self { - Self { - builder: self.builder.property("name", name.into()), - } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { builder: self.builder.property("margin-top", margin_top), } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { - builder: self.builder.property("opacity", opacity), - } - } + pub fn name(self, name: impl Into) -> Self { + Self { builder: self.builder.property("name", name.into()), } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + pub fn opacity(self, opacity: f64) -> Self { + Self { builder: self.builder.property("opacity", opacity), } + } - pub fn receives_default(self, receives_default: bool) -> Self { - Self { - builder: self.builder.property("receives-default", receives_default), - } - } + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn sensitive(self, sensitive: bool) -> Self { - Self { - builder: self.builder.property("sensitive", sensitive), - } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { builder: self.builder.property("receives-default", receives_default), } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { - builder: self - .builder - .property("tooltip-markup", tooltip_markup.into()), - } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { builder: self.builder.property("sensitive", sensitive), } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { - builder: self.builder.property("tooltip-text", tooltip_text.into()), - } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } + } - pub fn valign(self, valign: gtk::Align) -> Self { - Self { - builder: self.builder.property("valign", valign), - } - } + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { - builder: self.builder.property("vexpand", vexpand), - } - } + pub fn valign(self, valign: gtk::Align) -> Self { + Self { builder: self.builder.property("valign", valign), } + } - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { - builder: self.builder.property("vexpand-set", vexpand_set), - } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { builder: self.builder.property("vexpand", vexpand), } + } - pub fn visible(self, visible: bool) -> Self { - Self { - builder: self.builder.property("visible", visible), - } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { builder: self.builder.property("vexpand-set", vexpand_set), } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { - builder: self.builder.property("width-request", width_request), - } - } + pub fn visible(self, visible: bool) -> Self { + Self { builder: self.builder.property("visible", visible), } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + pub fn width_request(self, width_request: i32) -> Self { + Self { builder: self.builder.property("width-request", width_request), } + } + + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} // rustdoc-stripper-ignore-next /// Build the [`Banner`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Banner { - self.builder.build() - } + self.builder.build() } } mod sealed { @@ -280,20 +210,14 @@ pub trait BannerExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_banner_add_action_button")] fn add_action_button(&self, widget: &impl IsA) { unsafe { - ffi::he_banner_add_action_button( - self.as_ref().to_glib_none().0, - widget.as_ref().to_glib_none().0, - ); + ffi::he_banner_add_action_button(self.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0); } } #[doc(alias = "he_banner_remove_action")] fn remove_action(&self, widget: &impl IsA) { unsafe { - ffi::he_banner_remove_action( - self.as_ref().to_glib_none().0, - widget.as_ref().to_glib_none().0, - ); + ffi::he_banner_remove_action(self.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0); } } @@ -307,7 +231,9 @@ pub trait BannerExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_banner_get_title")] #[doc(alias = "get_title")] fn title(&self) -> glib::GString { - unsafe { from_glib_none(ffi::he_banner_get_title(self.as_ref().to_glib_none().0)) } + unsafe { + from_glib_none(ffi::he_banner_get_title(self.as_ref().to_glib_none().0)) + } } #[doc(alias = "he_banner_set_title")] @@ -321,9 +247,7 @@ pub trait BannerExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_description")] fn description(&self) -> glib::GString { unsafe { - from_glib_none(ffi::he_banner_get_description( - self.as_ref().to_glib_none().0, - )) + from_glib_none(ffi::he_banner_get_description(self.as_ref().to_glib_none().0)) } } @@ -337,7 +261,9 @@ pub trait BannerExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_banner_get_style")] #[doc(alias = "get_style")] fn style(&self) -> BannerStyle { - unsafe { from_glib(ffi::he_banner_get_style(self.as_ref().to_glib_none().0)) } + unsafe { + from_glib(ffi::he_banner_get_style(self.as_ref().to_glib_none().0)) + } } #[doc(alias = "he_banner_set_style")] @@ -349,70 +275,40 @@ pub trait BannerExt: IsA + sealed::Sealed + 'static { #[doc(alias = "title")] fn connect_title_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_title_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeBanner, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_title_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeBanner, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Banner::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::title\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_title_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::title\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_title_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "description")] fn connect_description_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_description_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeBanner, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_description_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeBanner, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Banner::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::description\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_description_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::description\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_description_trampoline:: as *const ())), Box_::into_raw(f)) } } #[doc(alias = "style")] fn connect_style_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_style_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeBanner, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_style_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeBanner, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Banner::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::style\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_style_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::style\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_style_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/libhelium/src/auto/bin.rs b/libhelium/src/auto/bin.rs index c60ff7b..203bb43 100644 --- a/libhelium/src/auto/bin.rs +++ b/libhelium/src/auto/bin.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::ffi; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "HeBin")] @@ -21,231 +17,176 @@ glib::wrapper! { } impl Bin { - pub const NONE: Option<&'static Bin> = None; + pub const NONE: Option<&'static Bin> = None; + #[doc(alias = "he_bin_new")] pub fn new() -> Bin { assert_initialized_main_thread!(); - unsafe { from_glib_none(ffi::he_bin_new()) } + unsafe { + from_glib_none(ffi::he_bin_new()) + } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`Bin`] objects. - /// - /// This method returns an instance of [`BinBuilder`](crate::builders::BinBuilder) which can be used to create [`Bin`] objects. - pub fn builder() -> BinBuilder { - BinBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`Bin`] objects. + /// + /// This method returns an instance of [`BinBuilder`](crate::builders::BinBuilder) which can be used to create [`Bin`] objects. + pub fn builder() -> BinBuilder { + BinBuilder::new() + } + } impl Default for Bin { - fn default() -> Self { - Self::new() - } -} + fn default() -> Self { + Self::new() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`Bin`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`Bin`] 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 BinBuilder { - builder: glib::object::ObjectBuilder<'static, Bin>, -} - -impl BinBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, Bin>, } - } - pub fn child(self, child: &impl IsA) -> Self { - Self { - builder: self.builder.property("child", child.clone().upcast()), + impl BinBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { - builder: self.builder.property("can-focus", can_focus), - } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { builder: self.builder.property("child", child.clone().upcast()), } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { - builder: self.builder.property("can-target", can_target), - } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { builder: self.builder.property("can-focus", can_focus), } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { - builder: self.builder.property("css-classes", css_classes.into()), - } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { builder: self.builder.property("can-target", can_target), } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { - builder: self.builder.property("css-name", css_name.into()), - } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { builder: self.builder.property("css-classes", css_classes.into()), } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + pub fn css_name(self, css_name: impl Into) -> Self { + Self { builder: self.builder.property("css-name", css_name.into()), } + } - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { - builder: self.builder.property("focus-on-click", focus_on_click), - } - } + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focusable(self, focusable: bool) -> Self { - Self { - builder: self.builder.property("focusable", focusable), - } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { builder: self.builder.property("focus-on-click", focus_on_click), } + } - pub fn halign(self, halign: gtk::Align) -> Self { - Self { - builder: self.builder.property("halign", halign), - } - } + pub fn focusable(self, focusable: bool) -> Self { + Self { builder: self.builder.property("focusable", focusable), } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { - builder: self.builder.property("has-tooltip", has_tooltip), - } - } + pub fn halign(self, halign: gtk::Align) -> Self { + Self { builder: self.builder.property("halign", halign), } + } - pub fn height_request(self, height_request: i32) -> Self { - Self { - builder: self.builder.property("height-request", height_request), - } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { builder: self.builder.property("has-tooltip", has_tooltip), } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { - builder: self.builder.property("hexpand", hexpand), - } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { builder: self.builder.property("height-request", height_request), } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { - builder: self.builder.property("hexpand-set", hexpand_set), - } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { builder: self.builder.property("hexpand", hexpand), } + } - //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } - //} + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { builder: self.builder.property("hexpand-set", hexpand_set), } + } - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { - builder: self.builder.property("margin-bottom", margin_bottom), - } - } + //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + //} - pub fn margin_end(self, margin_end: i32) -> Self { - Self { - builder: self.builder.property("margin-end", margin_end), - } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { builder: self.builder.property("margin-bottom", margin_bottom), } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { - builder: self.builder.property("margin-start", margin_start), - } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { builder: self.builder.property("margin-end", margin_end), } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { - builder: self.builder.property("margin-top", margin_top), - } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { builder: self.builder.property("margin-start", margin_start), } + } - pub fn name(self, name: impl Into) -> Self { - Self { - builder: self.builder.property("name", name.into()), - } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { builder: self.builder.property("margin-top", margin_top), } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { - builder: self.builder.property("opacity", opacity), - } - } + pub fn name(self, name: impl Into) -> Self { + Self { builder: self.builder.property("name", name.into()), } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + pub fn opacity(self, opacity: f64) -> Self { + Self { builder: self.builder.property("opacity", opacity), } + } - pub fn receives_default(self, receives_default: bool) -> Self { - Self { - builder: self.builder.property("receives-default", receives_default), - } - } + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn sensitive(self, sensitive: bool) -> Self { - Self { - builder: self.builder.property("sensitive", sensitive), - } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { builder: self.builder.property("receives-default", receives_default), } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { - builder: self - .builder - .property("tooltip-markup", tooltip_markup.into()), - } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { builder: self.builder.property("sensitive", sensitive), } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { - builder: self.builder.property("tooltip-text", tooltip_text.into()), - } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } + } - pub fn valign(self, valign: gtk::Align) -> Self { - Self { - builder: self.builder.property("valign", valign), - } - } + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { - builder: self.builder.property("vexpand", vexpand), - } - } + pub fn valign(self, valign: gtk::Align) -> Self { + Self { builder: self.builder.property("valign", valign), } + } - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { - builder: self.builder.property("vexpand-set", vexpand_set), - } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { builder: self.builder.property("vexpand", vexpand), } + } - pub fn visible(self, visible: bool) -> Self { - Self { - builder: self.builder.property("visible", visible), - } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { builder: self.builder.property("vexpand-set", vexpand_set), } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { - builder: self.builder.property("width-request", width_request), - } - } + pub fn visible(self, visible: bool) -> Self { + Self { builder: self.builder.property("visible", visible), } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + pub fn width_request(self, width_request: i32) -> Self { + Self { builder: self.builder.property("width-request", width_request), } + } + + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} // rustdoc-stripper-ignore-next /// Build the [`Bin`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Bin { - self.builder.build() - } + self.builder.build() } } mod sealed { @@ -255,58 +196,37 @@ mod sealed { pub trait BinExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_bin_add_child")] - fn add_child( - &self, - builder: >k::Builder, - child: &impl IsA, - type_: Option<&str>, - ) { + fn add_child(&self, builder: >k::Builder, child: &impl IsA, type_: Option<&str>) { unsafe { - ffi::he_bin_add_child( - self.as_ref().to_glib_none().0, - builder.to_glib_none().0, - child.as_ref().to_glib_none().0, - type_.to_glib_none().0, - ); + ffi::he_bin_add_child(self.as_ref().to_glib_none().0, builder.to_glib_none().0, child.as_ref().to_glib_none().0, type_.to_glib_none().0); } } #[doc(alias = "he_bin_get_child")] #[doc(alias = "get_child")] fn child(&self) -> gtk::Widget { - unsafe { from_glib_none(ffi::he_bin_get_child(self.as_ref().to_glib_none().0)) } + unsafe { + from_glib_none(ffi::he_bin_get_child(self.as_ref().to_glib_none().0)) + } } #[doc(alias = "he_bin_set_child")] fn set_child(&self, value: &impl IsA) { unsafe { - ffi::he_bin_set_child( - self.as_ref().to_glib_none().0, - value.as_ref().to_glib_none().0, - ); + ffi::he_bin_set_child(self.as_ref().to_glib_none().0, value.as_ref().to_glib_none().0); } } #[doc(alias = "child")] fn connect_child_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_child_trampoline, F: Fn(&P) + 'static>( - this: *mut ffi::HeBin, - _param_spec: glib::ffi::gpointer, - f: glib::ffi::gpointer, - ) { + unsafe extern "C" fn notify_child_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeBin, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { let f: &F = &*(f as *const F); f(Bin::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw( - self.as_ptr() as *mut _, - b"notify::child\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_child_trampoline:: as *const (), - )), - Box_::into_raw(f), - ) + connect_raw(self.as_ptr() as *mut _, b"notify::child\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_child_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/libhelium/src/auto/bottom_bar.rs b/libhelium/src/auto/bottom_bar.rs index c798688..0b0fbe1 100644 --- a/libhelium/src/auto/bottom_bar.rs +++ b/libhelium/src/auto/bottom_bar.rs @@ -1,15 +1,11 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, Bin, BottomBarPosition, Button}; -use glib::{ - prelude::*, - signal::{connect_raw, SignalHandlerId}, - translate::*, -}; -use std::boxed::Box as Box_; +use crate::{ffi,Bin,BottomBarPosition,Button}; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "HeBottomBar")] @@ -21,268 +17,200 @@ glib::wrapper! { } impl BottomBar { - pub const NONE: Option<&'static BottomBar> = None; + pub const NONE: Option<&'static BottomBar> = None; + #[doc(alias = "he_bottom_bar_new_with_details")] pub fn with_details(title: &str, description: &str) -> BottomBar { assert_initialized_main_thread!(); unsafe { - from_glib_none(ffi::he_bottom_bar_new_with_details( - title.to_glib_none().0, - description.to_glib_none().0, - )) + from_glib_none(ffi::he_bottom_bar_new_with_details(title.to_glib_none().0, description.to_glib_none().0)) } } #[doc(alias = "he_bottom_bar_new")] pub fn new() -> BottomBar { assert_initialized_main_thread!(); - unsafe { from_glib_none(ffi::he_bottom_bar_new()) } + unsafe { + from_glib_none(ffi::he_bottom_bar_new()) + } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`BottomBar`] objects. - /// - /// This method returns an instance of [`BottomBarBuilder`](crate::builders::BottomBarBuilder) which can be used to create [`BottomBar`] objects. - pub fn builder() -> BottomBarBuilder { - BottomBarBuilder::new() - } + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`BottomBar`] objects. + /// + /// This method returns an instance of [`BottomBarBuilder`](crate::builders::BottomBarBuilder) which can be used to create [`BottomBar`] objects. + pub fn builder() -> BottomBarBuilder { + BottomBarBuilder::new() + } + } impl Default for BottomBar { - fn default() -> Self { - Self::new() - } -} + fn default() -> Self { + Self::new() + } + } // rustdoc-stripper-ignore-next -/// A [builder-pattern] type to construct [`BottomBar`] objects. -/// -/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html + /// A [builder-pattern] type to construct [`BottomBar`] 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 BottomBarBuilder { - builder: glib::object::ObjectBuilder<'static, BottomBar>, -} - -impl BottomBarBuilder { - fn new() -> Self { - Self { - builder: glib::object::Object::builder(), + builder: glib::object::ObjectBuilder<'static, BottomBar>, } - } - pub fn title(self, title: impl Into) -> Self { - Self { - builder: self.builder.property("title", title.into()), + impl BottomBarBuilder { + fn new() -> Self { + Self { builder: glib::object::Object::builder() } } - } - pub fn description(self, description: impl Into) -> Self { - Self { - builder: self.builder.property("description", description.into()), - } - } + pub fn title(self, title: impl Into) -> Self { + Self { builder: self.builder.property("title", title.into()), } + } - pub fn menu_model(self, menu_model: &impl IsA) -> Self { - Self { - builder: self - .builder - .property("menu-model", menu_model.clone().upcast()), - } - } + pub fn description(self, description: impl Into) -> Self { + Self { builder: self.builder.property("description", description.into()), } + } - pub fn collapse_actions(self, collapse_actions: bool) -> Self { - Self { - builder: self.builder.property("collapse-actions", collapse_actions), - } - } + pub fn menu_model(self, menu_model: &impl IsA) -> Self { + Self { builder: self.builder.property("menu-model", menu_model.clone().upcast()), } + } - pub fn child(self, child: &impl IsA) -> Self { - Self { - builder: self.builder.property("child", child.clone().upcast()), - } - } + pub fn collapse_actions(self, collapse_actions: bool) -> Self { + Self { builder: self.builder.property("collapse-actions", collapse_actions), } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { - builder: self.builder.property("can-focus", can_focus), - } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { builder: self.builder.property("child", child.clone().upcast()), } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { - builder: self.builder.property("can-target", can_target), - } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { builder: self.builder.property("can-focus", can_focus), } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { - builder: self.builder.property("css-classes", css_classes.into()), - } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { builder: self.builder.property("can-target", can_target), } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { - builder: self.builder.property("css-name", css_name.into()), - } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { builder: self.builder.property("css-classes", css_classes.into()), } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + pub fn css_name(self, css_name: impl Into) -> Self { + Self { builder: self.builder.property("css-name", css_name.into()), } + } - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { - builder: self.builder.property("focus-on-click", focus_on_click), - } - } + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focusable(self, focusable: bool) -> Self { - Self { - builder: self.builder.property("focusable", focusable), - } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { builder: self.builder.property("focus-on-click", focus_on_click), } + } - pub fn halign(self, halign: gtk::Align) -> Self { - Self { - builder: self.builder.property("halign", halign), - } - } + pub fn focusable(self, focusable: bool) -> Self { + Self { builder: self.builder.property("focusable", focusable), } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { - builder: self.builder.property("has-tooltip", has_tooltip), - } - } + pub fn halign(self, halign: gtk::Align) -> Self { + Self { builder: self.builder.property("halign", halign), } + } - pub fn height_request(self, height_request: i32) -> Self { - Self { - builder: self.builder.property("height-request", height_request), - } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { builder: self.builder.property("has-tooltip", has_tooltip), } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { - builder: self.builder.property("hexpand", hexpand), - } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { builder: self.builder.property("height-request", height_request), } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { - builder: self.builder.property("hexpand-set", hexpand_set), - } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { builder: self.builder.property("hexpand", hexpand), } + } - //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } - //} + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { builder: self.builder.property("hexpand-set", hexpand_set), } + } - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { - builder: self.builder.property("margin-bottom", margin_bottom), - } - } + //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + //} - pub fn margin_end(self, margin_end: i32) -> Self { - Self { - builder: self.builder.property("margin-end", margin_end), - } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { builder: self.builder.property("margin-bottom", margin_bottom), } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { - builder: self.builder.property("margin-start", margin_start), - } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { builder: self.builder.property("margin-end", margin_end), } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { - builder: self.builder.property("margin-top", margin_top), - } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { builder: self.builder.property("margin-start", margin_start), } + } - pub fn name(self, name: impl Into) -> Self { - Self { - builder: self.builder.property("name", name.into()), - } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { builder: self.builder.property("margin-top", margin_top), } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { - builder: self.builder.property("opacity", opacity), - } - } + pub fn name(self, name: impl Into) -> Self { + Self { builder: self.builder.property("name", name.into()), } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + pub fn opacity(self, opacity: f64) -> Self { + Self { builder: self.builder.property("opacity", opacity), } + } - pub fn receives_default(self, receives_default: bool) -> Self { - Self { - builder: self.builder.property("receives-default", receives_default), - } - } + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn sensitive(self, sensitive: bool) -> Self { - Self { - builder: self.builder.property("sensitive", sensitive), - } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { builder: self.builder.property("receives-default", receives_default), } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { - builder: self - .builder - .property("tooltip-markup", tooltip_markup.into()), - } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { builder: self.builder.property("sensitive", sensitive), } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { - builder: self.builder.property("tooltip-text", tooltip_text.into()), - } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } + } - pub fn valign(self, valign: gtk::Align) -> Self { - Self { - builder: self.builder.property("valign", valign), - } - } + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { - builder: self.builder.property("vexpand", vexpand), - } - } + pub fn valign(self, valign: gtk::Align) -> Self { + Self { builder: self.builder.property("valign", valign), } + } - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { - builder: self.builder.property("vexpand-set", vexpand_set), - } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { builder: self.builder.property("vexpand", vexpand), } + } - pub fn visible(self, visible: bool) -> Self { - Self { - builder: self.builder.property("visible", visible), - } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { builder: self.builder.property("vexpand-set", vexpand_set), } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { - builder: self.builder.property("width-request", width_request), - } - } + pub fn visible(self, visible: bool) -> Self { + Self { builder: self.builder.property("visible", visible), } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + pub fn width_request(self, width_request: i32) -> Self { + Self { builder: self.builder.property("width-request", width_request), } + } + + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} // rustdoc-stripper-ignore-next /// Build the [`BottomBar`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> BottomBar { - self.builder.build() - } + self.builder.build() } } mod sealed { @@ -294,74 +222,44 @@ pub trait BottomBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_bottom_bar_append_button")] fn append_button(&self, icon: &impl IsA