Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Commit 8e14d40

Browse files
Merge pull request #659 from vhdirk/applicationwindow
let applicationwindow accept anything implementing Application
2 parents c07927b + a1f75bd commit 8e14d40

File tree

4 files changed

+27
-12
lines changed

4 files changed

+27
-12
lines changed

Gir.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ generate = [
1818
"Gtk.AppChooserButton",
1919
"Gtk.AppChooserWidget",
2020
"Gtk.ApplicationInhibitFlags",
21-
"Gtk.ApplicationWindow",
2221
"Gtk.Arrow",
2322
"Gtk.ArrowType",
2423
"Gtk.AspectFrame",
@@ -421,6 +420,13 @@ trait_name = "GtkApplicationExt"
421420
name = "new"
422421
ignore = true
423422

423+
[[object]]
424+
name = "Gtk.ApplicationWindow"
425+
status = "generate"
426+
[[object.function]]
427+
name = "new"
428+
ignore = true
429+
424430
[[object]]
425431
name = "Gtk.Builder"
426432
status = "generate"
@@ -1483,7 +1489,7 @@ status = "generate"
14831489
[[object.signal]]
14841490
name = "insert-emoji"
14851491
#actually Since 3.22.27
1486-
version = "3.22.26"
1492+
version = "3.22.26"
14871493

14881494
[[object]]
14891495
name = "Gtk.TextViewLayer"

src/application_window.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
use ApplicationWindow;
2+
use Application;
3+
use Widget;
4+
5+
use ffi;
6+
use glib::object::Downcast;
7+
use glib::object::IsA;
8+
use glib::translate::*;
9+
10+
11+
impl ApplicationWindow {
12+
pub fn new<P: IsA<Application>>(application: &P) -> ApplicationWindow {
13+
skip_assert_initialized!();
14+
unsafe {
15+
Widget::from_glib_none(ffi::gtk_application_window_new(application.to_glib_none().0)).downcast_unchecked()
16+
}
17+
}
18+
}

src/auto/application_window.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// from gir-files (https://github.com/gtk-rs/gir-files)
33
// DO NOT EDIT
44

5-
use Application;
65
use Bin;
76
use Buildable;
87
use Container;
@@ -42,15 +41,6 @@ glib_wrapper! {
4241
}
4342
}
4443

45-
impl ApplicationWindow {
46-
pub fn new(application: &Application) -> ApplicationWindow {
47-
skip_assert_initialized!();
48-
unsafe {
49-
Widget::from_glib_none(ffi::gtk_application_window_new(application.to_glib_none().0)).downcast_unchecked()
50-
}
51-
}
52-
}
53-
5444
pub trait ApplicationWindowExt {
5545
#[cfg(any(feature = "v3_20", feature = "dox"))]
5646
fn get_help_overlay(&self) -> Option<ShortcutsWindow>;

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ mod auto;
209209

210210
mod app_chooser;
211211
mod application;
212+
mod application_window;
212213
mod assistant;
213214
mod buildable;
214215
mod builder;

0 commit comments

Comments
 (0)