Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync stable #6

Merged
merged 2 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
314 changes: 134 additions & 180 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions fusebox/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fusebox"
version = "0.4.0"
version = "0.5.0"
authors = ["Lleyton Gray <[email protected]>"]
edition = "2021"
readme = "../README.md"
Expand Down Expand Up @@ -36,37 +36,37 @@ 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]
package = "fusebox-sys"
path = './sys'
version = "0.4.0"
version = "0.5.0"
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
Loading