Skip to content

Commit

Permalink
Merge pull request #4 from tau-OS/main
Browse files Browse the repository at this point in the history
fix: rename ButtonExt -> HeButtonExt
  • Loading branch information
lleyton authored Aug 8, 2024
2 parents 87a254d + ca5363e commit c767391
Show file tree
Hide file tree
Showing 109 changed files with 24,697 additions and 13,019 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 26 additions & 28 deletions fusebox/src/auto/enums.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// 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)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "FuseboxFuseCategory")]
pub enum FuseCategory {
Expand All @@ -19,7 +18,7 @@ pub enum FuseCategory {
System,
#[doc(alias = "FUSEBOX_FUSE_CATEGORY_CUSTOM")]
Custom,
#[doc(hidden)]
#[doc(hidden)]
__Unknown(i32),
}

Expand All @@ -28,49 +27,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 @@ -110,4 +109,3 @@ impl From<FuseCategory> for glib::Value {
ToValue::to_value(&v)
}
}

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

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

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

mod sealed {
Expand All @@ -30,9 +33,7 @@ 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 @@ -57,56 +58,63 @@ 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 @@ -119,7 +127,9 @@ 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 @@ -132,14 +142,24 @@ 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: 38 additions & 16 deletions fusebox/src/auto/fuses_manager.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
// 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 @@ -17,16 +21,14 @@ 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 @@ -39,28 +41,48 @@ 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
2 changes: 1 addition & 1 deletion fusebox/src/auto/mod.rs
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion fusebox/sys/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated by gir (https://github.com/gtk-rs/gir @ cec418b457aa)
// from
// from
// from gir-files (https://github.com/gtk-rs/gir-files.git @ 4d1189172a70)
// DO NOT EDIT

Expand Down
Loading

0 comments on commit c767391

Please sign in to comment.