Skip to content

Commit

Permalink
update bindings against gir nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
lleyton committed Aug 31, 2024
1 parent d8f197f commit 62a51da
Show file tree
Hide file tree
Showing 129 changed files with 13,242 additions and 24,786 deletions.
302 changes: 128 additions & 174 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions fusebox/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
54 changes: 28 additions & 26 deletions fusebox/src/auto/enums.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -18,7 +19,7 @@ pub enum FuseCategory {
System,
#[doc(alias = "FUSEBOX_FUSE_CATEGORY_CUSTOM")]
Custom,
#[doc(hidden)]
#[doc(hidden)]
__Unknown(i32),
}

Expand All @@ -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<ffi::FuseboxFuseCategory> 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<Self>;

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<Self>;
fn param_spec_builder() -> Self::BuilderFn {
Self::ParamSpec::builder_with_default
}
}

impl glib::value::ValueType for FuseCategory {
Expand Down Expand Up @@ -109,3 +110,4 @@ impl From<FuseCategory> for glib::Value {
ToValue::to_value(&v)
}
}

68 changes: 24 additions & 44 deletions fusebox/src/auto/fuse.rs
Original file line number Diff line number Diff line change
@@ -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")]
Expand All @@ -21,7 +17,8 @@ glib::wrapper! {
}

impl Fuse {
pub const NONE: Option<&'static Fuse> = None;
pub const NONE: Option<&'static Fuse> = None;

}

mod sealed {
Expand All @@ -33,7 +30,9 @@ pub trait FuseExt: IsA<Fuse> + 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")]
Expand All @@ -58,63 +57,56 @@ pub trait FuseExt: IsA<Fuse> + 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);
}
}

#[doc(alias = "fusebox_fuse_get_category")]
#[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))
}
}

#[doc(alias = "fusebox_fuse_get_display_name")]
#[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))
}
}

#[doc(alias = "fusebox_fuse_get_description")]
#[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")]
Expand All @@ -127,9 +119,7 @@ pub trait FuseExt: IsA<Fuse> + 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))
}
}

Expand All @@ -142,24 +132,14 @@ pub trait FuseExt: IsA<Fuse> + sealed::Sealed + 'static {

#[doc(alias = "can-show")]
fn connect_can_show_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_can_show_trampoline<P: IsA<Fuse>, 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<P: IsA<Fuse>, 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_<F> = 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::<Self, F> 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::<Self, F> as *const ())), Box_::into_raw(f))
}
}
}
Expand Down
54 changes: 16 additions & 38 deletions fusebox/src/auto/fuses_manager.rs
Original file line number Diff line number Diff line change
@@ -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")]
Expand All @@ -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())
}
}
}

Expand All @@ -41,48 +39,28 @@ pub trait FusesManagerExt: IsA<FusesManager> + 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))
}
}

#[doc(alias = "fusebox_fuses_manager_get_fuses")]
#[doc(alias = "get_fuses")]
fn fuses(&self) -> Vec<Fuse> {
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<F: Fn(&Self, &Fuse) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn fuse_added_trampoline<
P: IsA<FusesManager>,
F: Fn(&P, &Fuse) + 'static,
>(
this: *mut ffi::FuseboxFusesManager,
fuse: *mut ffi::FuseboxFuse,
f: glib::ffi::gpointer,
) {
unsafe extern "C" fn fuse_added_trampoline<P: IsA<FusesManager>, 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_<F> = 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::<Self, F> 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::<Self, F> as *const ())), Box_::into_raw(f))
}
}
}
Expand Down
Loading

0 comments on commit 62a51da

Please sign in to comment.