Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 8 additions & 1 deletion gtk4/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ generate = [
"Gtk.EditableProperties",
"Gtk.EmojiChooser",
"Gtk.EntryIconPosition",
"Gtk.EventController",
"Gtk.EventControllerFocus",
"Gtk.EventControllerMotion",
"Gtk.EventControllerScrollFlags",
Expand Down Expand Up @@ -1174,6 +1173,14 @@ status = "generate"
rename = "entry"
manual = true # upcast to Entry

[[object]]
name = "Gtk.EventController"
status = "generate"
manual_traits = ["EventControllerExtManual"]
[[object.function]]
name = "set_static_name"
manual = true # to make use of a static lifetimed string

[[object]]
name = "Gtk.EventControllerKey"
status = "generate"
Expand Down
12 changes: 0 additions & 12 deletions gtk4/src/auto/event_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,6 @@ pub trait EventControllerExt: IsA<EventController> + 'static {
}
}

#[cfg(feature = "v4_8")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
#[doc(alias = "gtk_event_controller_set_static_name")]
fn set_static_name(&self, name: Option<&str>) {
unsafe {
ffi::gtk_event_controller_set_static_name(
self.as_ref().to_glib_none().0,
name.to_glib_none().0,
);
}
}

#[doc(alias = "name")]
fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_name_trampoline<
Expand Down
24 changes: 24 additions & 0 deletions gtk4/src/event_controller.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Take a look at the license at the top of the repository in the LICENSE file.

#[cfg(feature = "v4_8")]
use glib::translate::*;

#[cfg(feature = "v4_8")]
use crate::ffi;
use crate::{prelude::*, EventController};

pub trait EventControllerExtManual: IsA<EventController> + 'static {
#[cfg(feature = "v4_8")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
#[doc(alias = "gtk_event_controller_set_static_name")]
fn set_static_name(&self, name: Option<&'static str>) {
unsafe {
ffi::gtk_event_controller_set_static_name(
self.as_ref().to_glib_none().0,
name.to_glib_none().0,
);
}
}
}

impl<O: IsA<EventController>> EventControllerExtManual for O {}
1 change: 1 addition & 0 deletions gtk4/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ mod entry;
mod entry_buffer;
mod entry_completion;
mod enums;
mod event_controller;
mod event_controller_key;
mod expression_watch;
mod file_chooser;
Expand Down
1 change: 1 addition & 0 deletions gtk4/src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub use crate::{
editable::EditableExtManual,
entry::EntryExtManual,
entry_buffer::EntryBufferExtManual,
event_controller::EventControllerExtManual,
expression::{GObjectPropertyExpressionExt, IsExpression},
file_chooser::FileChooserExtManual,
font_chooser::FontChooserExtManual,
Expand Down
Loading