37 lines
865 B
Rust
37 lines
865 B
Rust
|
use gtk::{glib, gio};
|
||
|
|
||
|
pub mod ffi {
|
||
|
#[repr(C)]
|
||
|
pub struct AudreyApplication {
|
||
|
pub parent_instance: adw::ffi::AdwApplication,
|
||
|
}
|
||
|
|
||
|
#[repr(C)]
|
||
|
pub struct AudreyApplicationClass {
|
||
|
pub parent_class: adw::ffi::AdwApplicationClass,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
extern "C" {
|
||
|
fn audrey_application_get_type() -> glib::ffi::GType;
|
||
|
fn audrey_application_new() -> *mut ffi::AudreyApplication;
|
||
|
}
|
||
|
|
||
|
glib::wrapper! {
|
||
|
pub struct Application(Object<ffi::AudreyApplication, ffi::AudreyApplicationClass>)
|
||
|
@extends adw::Application, gtk::Application, gio::Application,
|
||
|
@implements gio::ActionGroup, gio::ActionMap;
|
||
|
|
||
|
match fn {
|
||
|
type_ => || audrey_application_get_type(),
|
||
|
}
|
||
|
}
|
||
|
|
||
|
impl Application {
|
||
|
pub fn new() -> Self {
|
||
|
unsafe {
|
||
|
glib::translate::from_glib_full(audrey_application_new())
|
||
|
}
|
||
|
}
|
||
|
}
|