Skip to content

Commit

Permalink
chore(libhelium): sync GIR
Browse files Browse the repository at this point in the history
  • Loading branch information
lleyton committed Sep 4, 2024
1 parent bd4178f commit 1d0b3e4
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 122 deletions.
65 changes: 19 additions & 46 deletions He-1.gir
Original file line number Diff line number Diff line change
Expand Up @@ -6374,33 +6374,6 @@ Since: 1.0</doc>
</parameter>
</parameters>
</method>
<property name="viewtitle-label" writable="1">
<doc xml:whitespace="preserve">&lt;para&gt;The title to the left on the AppBar.&lt;/para&gt;</doc>
<type name="utf8" c:type="gchar*"/>
</property>
<method name="get_viewtitle_label" c:identifier="he_app_bar_get_viewtitle_label">
<return-value transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="He.AppBar" c:type="HeAppBar*"/>
</instance-parameter>
</parameters>
</method>
<method name="set_viewtitle_label" c:identifier="he_app_bar_set_viewtitle_label">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="He.AppBar" c:type="HeAppBar*"/>
</instance-parameter>
<parameter name="value" transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
</method>
<property name="viewtitle-widget" writable="1">
<doc xml:whitespace="preserve">&lt;para&gt;The title widget to the left on the AppBar. If this is set, the other title &amp;lpar;not subtitle&amp;rpar; props won&amp;apos;t work, and the mini title
on collapsed state won&amp;apos;t show.&lt;/para&gt;</doc>
Expand Down Expand Up @@ -10910,23 +10883,23 @@ Since: 1.0</doc>
<type name="He.SideBar" c:type="HeSideBar*"/>
</return-value>
<parameters>
<parameter name="title" transfer-ownership="none">
<parameter name="title" transfer-ownership="none" nullable="1">
<doc xml:whitespace="preserve">&lt;para&gt;The title of the SideBar. &lt;/para&gt;</doc>
<type name="utf8" c:type="const gchar*"/>
<type name="Gtk.Widget" c:type="GtkWidget*"/>
</parameter>
<parameter name="subtitle" transfer-ownership="none">
<parameter name="subtitle" transfer-ownership="none" nullable="1">
<doc xml:whitespace="preserve">&lt;para&gt;The subtitle of the SideBar. &lt;/para&gt;</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
</constructor>
<property name="title" writable="1">
<doc xml:whitespace="preserve">&lt;para&gt;The title of the sidebar.&lt;/para&gt;</doc>
<type name="utf8" c:type="gchar*"/>
<type name="Gtk.Widget" c:type="GtkWidget*"/>
</property>
<method name="get_title" c:identifier="he_side_bar_get_title">
<return-value transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
<return-value transfer-ownership="none" nullable="1">
<type name="Gtk.Widget" c:type="GtkWidget*"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
Expand All @@ -10942,8 +10915,8 @@ Since: 1.0</doc>
<instance-parameter name="self" transfer-ownership="none">
<type name="He.SideBar" c:type="HeSideBar*"/>
</instance-parameter>
<parameter name="value" transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
<parameter name="value" transfer-ownership="none" nullable="1">
<type name="Gtk.Widget" c:type="GtkWidget*"/>
</parameter>
</parameters>
</method>
Expand Down Expand Up @@ -13119,11 +13092,11 @@ Since: 1.0</doc>
<type name="He.ViewMono" c:type="HeViewMono*"/>
</return-value>
<parameters>
<parameter name="title" transfer-ownership="none">
<parameter name="title" transfer-ownership="none" nullable="1">
<doc xml:whitespace="preserve">&lt;para&gt;The title of the ViewMono. &lt;/para&gt;</doc>
<type name="utf8" c:type="const gchar*"/>
<type name="Gtk.Widget" c:type="GtkWidget*"/>
</parameter>
<parameter name="subtitle" transfer-ownership="none">
<parameter name="subtitle" transfer-ownership="none" nullable="1">
<doc xml:whitespace="preserve">&lt;para&gt;The subtitle of the ViewMono. &lt;/para&gt;</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
Expand Down Expand Up @@ -13194,12 +13167,12 @@ Since: 1.0</doc>
</parameters>
</method>
<property name="title" writable="1">
<doc xml:whitespace="preserve">&lt;para&gt;The title of the sidebar.&lt;/para&gt;</doc>
<type name="utf8" c:type="gchar*"/>
<doc xml:whitespace="preserve">&lt;para&gt;The title of the view.&lt;/para&gt;</doc>
<type name="Gtk.Widget" c:type="GtkWidget*"/>
</property>
<method name="get_title" c:identifier="he_view_mono_get_title">
<return-value transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
<return-value transfer-ownership="none" nullable="1">
<type name="Gtk.Widget" c:type="GtkWidget*"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
Expand All @@ -13215,13 +13188,13 @@ Since: 1.0</doc>
<instance-parameter name="self" transfer-ownership="none">
<type name="He.ViewMono" c:type="HeViewMono*"/>
</instance-parameter>
<parameter name="value" transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
<parameter name="value" transfer-ownership="none" nullable="1">
<type name="Gtk.Widget" c:type="GtkWidget*"/>
</parameter>
</parameters>
</method>
<property name="titlewidget" writable="1">
<doc xml:whitespace="preserve">&lt;para&gt;The title widget of the sidebar.&lt;/para&gt;</doc>
<doc xml:whitespace="preserve">&lt;para&gt;The title widget of the view.&lt;/para&gt;</doc>
<type name="Gtk.Widget" c:type="GtkWidget*"/>
</property>
<method name="get_titlewidget" c:identifier="he_view_mono_get_titlewidget">
Expand All @@ -13248,7 +13221,7 @@ Since: 1.0</doc>
</parameters>
</method>
<property name="subtitle" writable="1">
<doc xml:whitespace="preserve">&lt;para&gt;The title of the sidebar.&lt;/para&gt;</doc>
<doc xml:whitespace="preserve">&lt;para&gt;The subtitle of the view.&lt;/para&gt;</doc>
<type name="utf8" c:type="gchar*"/>
</property>
<method name="get_subtitle" c:identifier="he_view_mono_get_subtitle">
Expand Down
54 changes: 0 additions & 54 deletions libhelium/src/auto/app_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,6 @@ impl AppBarBuilder {
}
}

pub fn viewtitle_label(self, viewtitle_label: impl Into<glib::GString>) -> Self {
Self {
builder: self
.builder
.property("viewtitle-label", viewtitle_label.into()),
}
}

pub fn viewtitle_widget(self, viewtitle_widget: &impl IsA<gtk::Widget>) -> Self {
Self {
builder: self
Expand Down Expand Up @@ -409,26 +401,6 @@ pub trait AppBarExt: IsA<AppBar> + sealed::Sealed + 'static {
}
}

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

#[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,
);
}
}

#[doc(alias = "he_app_bar_get_viewtitle_widget")]
#[doc(alias = "get_viewtitle_widget")]
fn viewtitle_widget(&self) -> Option<gtk::Widget> {
Expand Down Expand Up @@ -615,32 +587,6 @@ pub trait AppBarExt: IsA<AppBar> + sealed::Sealed + 'static {
}
}

#[doc(alias = "viewtitle-label")]
fn connect_viewtitle_label_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_viewtitle_label_trampoline<
P: IsA<AppBar>,
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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}

#[doc(alias = "viewtitle-widget")]
fn connect_viewtitle_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_viewtitle_widget_trampoline<
Expand Down
17 changes: 10 additions & 7 deletions libhelium/src/auto/side_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ impl SideBar {
pub const NONE: Option<&'static SideBar> = None;

#[doc(alias = "he_side_bar_new")]
pub fn new(title: &str, subtitle: &str) -> SideBar {
pub fn new(title: Option<&impl IsA<gtk::Widget>>, subtitle: Option<&str>) -> SideBar {
assert_initialized_main_thread!();
unsafe {
from_glib_none(ffi::he_side_bar_new(
title.to_glib_none().0,
title.map(|p| p.as_ref()).to_glib_none().0,
subtitle.to_glib_none().0,
))
}
Expand Down Expand Up @@ -65,9 +65,9 @@ impl SideBarBuilder {
}
}

pub fn title(self, title: impl Into<glib::GString>) -> Self {
pub fn title(self, title: &impl IsA<gtk::Widget>) -> Self {
Self {
builder: self.builder.property("title", title.into()),
builder: self.builder.property("title", title.clone().upcast()),
}
}

Expand Down Expand Up @@ -321,14 +321,17 @@ mod sealed {
pub trait SideBarExt: IsA<SideBar> + sealed::Sealed + 'static {
#[doc(alias = "he_side_bar_get_title")]
#[doc(alias = "get_title")]
fn title(&self) -> glib::GString {
fn title(&self) -> Option<gtk::Widget> {
unsafe { from_glib_none(ffi::he_side_bar_get_title(self.as_ref().to_glib_none().0)) }
}

#[doc(alias = "he_side_bar_set_title")]
fn set_title(&self, value: &str) {
fn set_title(&self, value: Option<&impl IsA<gtk::Widget>>) {
unsafe {
ffi::he_side_bar_set_title(self.as_ref().to_glib_none().0, value.to_glib_none().0);
ffi::he_side_bar_set_title(
self.as_ref().to_glib_none().0,
value.map(|p| p.as_ref()).to_glib_none().0,
);
}
}

Expand Down
17 changes: 10 additions & 7 deletions libhelium/src/auto/view_mono.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ impl ViewMono {
pub const NONE: Option<&'static ViewMono> = None;

#[doc(alias = "he_view_mono_new")]
pub fn new(title: &str, subtitle: &str) -> ViewMono {
pub fn new(title: Option<&impl IsA<gtk::Widget>>, subtitle: Option<&str>) -> ViewMono {
assert_initialized_main_thread!();
unsafe {
from_glib_none(ffi::he_view_mono_new(
title.to_glib_none().0,
title.map(|p| p.as_ref()).to_glib_none().0,
subtitle.to_glib_none().0,
))
}
Expand Down Expand Up @@ -65,9 +65,9 @@ impl ViewMonoBuilder {
}
}

pub fn title(self, title: impl Into<glib::GString>) -> Self {
pub fn title(self, title: &impl IsA<gtk::Widget>) -> Self {
Self {
builder: self.builder.property("title", title.into()),
builder: self.builder.property("title", title.clone().upcast()),
}
}

Expand Down Expand Up @@ -356,14 +356,17 @@ pub trait ViewMonoExt: IsA<ViewMono> + sealed::Sealed + 'static {

#[doc(alias = "he_view_mono_get_title")]
#[doc(alias = "get_title")]
fn title(&self) -> glib::GString {
fn title(&self) -> Option<gtk::Widget> {
unsafe { from_glib_none(ffi::he_view_mono_get_title(self.as_ref().to_glib_none().0)) }
}

#[doc(alias = "he_view_mono_set_title")]
fn set_title(&self, value: &str) {
fn set_title(&self, value: Option<&impl IsA<gtk::Widget>>) {
unsafe {
ffi::he_view_mono_set_title(self.as_ref().to_glib_none().0, value.to_glib_none().0);
ffi::he_view_mono_set_title(
self.as_ref().to_glib_none().0,
value.map(|p| p.as_ref()).to_glib_none().0,
);
}
}

Expand Down
15 changes: 7 additions & 8 deletions libhelium/sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3813,8 +3813,6 @@ extern "C" {
pub fn he_app_bar_set_scroller(self_: *mut HeAppBar, value: *mut gtk::GtkScrolledWindow);
pub fn he_app_bar_get_is_compact(self_: *mut HeAppBar) -> gboolean;
pub fn he_app_bar_set_is_compact(self_: *mut HeAppBar, value: gboolean);
pub fn he_app_bar_get_viewtitle_label(self_: *mut HeAppBar) -> *const c_char;
pub fn he_app_bar_set_viewtitle_label(self_: *mut HeAppBar, value: *const c_char);
pub fn he_app_bar_get_viewtitle_widget(self_: *mut HeAppBar) -> *mut gtk::GtkWidget;
pub fn he_app_bar_set_viewtitle_widget(self_: *mut HeAppBar, value: *mut gtk::GtkWidget);
pub fn he_app_bar_get_viewsubtitle_label(self_: *mut HeAppBar) -> *const c_char;
Expand Down Expand Up @@ -4835,9 +4833,9 @@ extern "C" {
// HeSideBar
//=========================================================================
pub fn he_side_bar_get_type() -> GType;
pub fn he_side_bar_new(title: *const c_char, subtitle: *const c_char) -> *mut HeSideBar;
pub fn he_side_bar_get_title(self_: *mut HeSideBar) -> *const c_char;
pub fn he_side_bar_set_title(self_: *mut HeSideBar, value: *const c_char);
pub fn he_side_bar_new(title: *mut gtk::GtkWidget, subtitle: *const c_char) -> *mut HeSideBar;
pub fn he_side_bar_get_title(self_: *mut HeSideBar) -> *mut gtk::GtkWidget;
pub fn he_side_bar_set_title(self_: *mut HeSideBar, value: *mut gtk::GtkWidget);
pub fn he_side_bar_get_titlewidget(self_: *mut HeSideBar) -> *mut gtk::GtkWidget;
pub fn he_side_bar_set_titlewidget(self_: *mut HeSideBar, value: *mut gtk::GtkWidget);
pub fn he_side_bar_get_subtitle(self_: *mut HeSideBar) -> *const c_char;
Expand Down Expand Up @@ -5294,16 +5292,17 @@ extern "C" {
// HeViewMono
//=========================================================================
pub fn he_view_mono_get_type() -> GType;
pub fn he_view_mono_new(title: *const c_char, subtitle: *const c_char) -> *mut HeViewMono;
pub fn he_view_mono_new(title: *mut gtk::GtkWidget, subtitle: *const c_char)
-> *mut HeViewMono;
pub fn he_view_mono_add_titlebar_button(self_: *mut HeViewMono, child: *mut gtk::GtkButton);
pub fn he_view_mono_add_titlebar_menu(self_: *mut HeViewMono, child: *mut gtk::GtkMenuButton);
pub fn he_view_mono_add_titlebar_toggle(
self_: *mut HeViewMono,
child: *mut gtk::GtkToggleButton,
);
pub fn he_view_mono_append(self_: *mut HeViewMono, child: *mut gtk::GtkWidget);
pub fn he_view_mono_get_title(self_: *mut HeViewMono) -> *const c_char;
pub fn he_view_mono_set_title(self_: *mut HeViewMono, value: *const c_char);
pub fn he_view_mono_get_title(self_: *mut HeViewMono) -> *mut gtk::GtkWidget;
pub fn he_view_mono_set_title(self_: *mut HeViewMono, value: *mut gtk::GtkWidget);
pub fn he_view_mono_get_titlewidget(self_: *mut HeViewMono) -> *mut gtk::GtkWidget;
pub fn he_view_mono_set_titlewidget(self_: *mut HeViewMono, value: *mut gtk::GtkWidget);
pub fn he_view_mono_get_subtitle(self_: *mut HeViewMono) -> *const c_char;
Expand Down

0 comments on commit 1d0b3e4

Please sign in to comment.