Skip to content

Commit

Permalink
libhelium: sync with latest GIR
Browse files Browse the repository at this point in the history
  • Loading branch information
lleyton committed Sep 2, 2024
1 parent 41fb0c6 commit 0c94048
Show file tree
Hide file tree
Showing 78 changed files with 23,938 additions and 10,488 deletions.
2,711 changes: 2,519 additions & 192 deletions He-1.gir

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion libhelium/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ manual = [
"GLib.Regex",
"Gtk.Grid",
"Gtk.DropDown",
"Pango.EllipsizeMode",
"Pango.EllipsizeMode"
]

[[object]]
Expand Down
953 changes: 663 additions & 290 deletions libhelium/src/auto/about_window.rs

Large diffs are not rendered by default.

128 changes: 87 additions & 41 deletions libhelium/src/auto/animation.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,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")]
Expand All @@ -17,8 +21,7 @@ glib::wrapper! {
}

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

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

mod sealed {
Expand Down Expand Up @@ -64,24 +67,18 @@ pub trait AnimationExt: IsA<Animation> + 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")]
Expand All @@ -94,39 +91,39 @@ pub trait AnimationExt: IsA<Animation> + 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<AnimationTarget>) {
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<gtk::Widget>) {
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")]
Expand All @@ -138,66 +135,115 @@ pub trait AnimationExt: IsA<Animation> + sealed::Sealed + 'static {

#[doc(alias = "done")]
fn connect_done<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn done_trampoline<P: IsA<Animation>, F: Fn(&P) + 'static>(this: *mut ffi::HeAnimation, f: glib::ffi::gpointer) {
unsafe extern "C" fn done_trampoline<P: IsA<Animation>, 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_<F> = 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::<Self, F> 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}

#[doc(alias = "state")]
fn connect_state_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_state_trampoline<P: IsA<Animation>, F: Fn(&P) + 'static>(this: *mut ffi::HeAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
unsafe extern "C" fn notify_state_trampoline<P: IsA<Animation>, 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_<F> = 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::<Self, F> 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}

#[doc(alias = "target")]
fn connect_target_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_target_trampoline<P: IsA<Animation>, F: Fn(&P) + 'static>(this: *mut ffi::HeAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
unsafe extern "C" fn notify_target_trampoline<P: IsA<Animation>, 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_<F> = 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::<Self, F> 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}

#[doc(alias = "widget")]
fn connect_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_widget_trampoline<P: IsA<Animation>, F: Fn(&P) + 'static>(this: *mut ffi::HeAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
unsafe extern "C" fn notify_widget_trampoline<P: IsA<Animation>, 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_<F> = 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::<Self, F> 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}

#[doc(alias = "avalue")]
fn connect_avalue_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_avalue_trampoline<P: IsA<Animation>, F: Fn(&P) + 'static>(this: *mut ffi::HeAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
unsafe extern "C" fn notify_avalue_trampoline<P: IsA<Animation>, 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_<F> = 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::<Self, F> 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}
Expand Down
9 changes: 4 additions & 5 deletions libhelium/src/auto/animation_target.rs
Original file line number Diff line number Diff line change
@@ -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")]
Expand All @@ -16,8 +16,7 @@ glib::wrapper! {
}

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

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

mod sealed {
Expand Down
Loading

0 comments on commit 0c94048

Please sign in to comment.