/* window.rs * * Copyright 2023 Unknown * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * SPDX-License-Identifier: GPL-3.0-or-later */ use gtk::prelude::*; use adw::subclass::prelude::*; use gtk::{gio, glib}; mod imp { use super::*; #[derive(Debug, Default, gtk::CompositeTemplate)] #[template(resource = "/de/johrpan/musicus/window.ui")] pub struct MusicusWindow { // Template widgets #[template_child] pub header_bar: TemplateChild, #[template_child] pub label: TemplateChild, } #[glib::object_subclass] impl ObjectSubclass for MusicusWindow { const NAME: &'static str = "MusicusWindow"; type Type = super::MusicusWindow; type ParentType = adw::ApplicationWindow; fn class_init(klass: &mut Self::Class) { klass.bind_template(); } fn instance_init(obj: &glib::subclass::InitializingObject) { obj.init_template(); } } impl ObjectImpl for MusicusWindow {} impl WidgetImpl for MusicusWindow {} impl WindowImpl for MusicusWindow {} impl ApplicationWindowImpl for MusicusWindow {} impl AdwApplicationWindowImpl for MusicusWindow {} } glib::wrapper! { pub struct MusicusWindow(ObjectSubclass) @extends gtk::Widget, gtk::Window, gtk::ApplicationWindow, adw::ApplicationWindow, @implements gio::ActionGroup, gio::ActionMap; } impl MusicusWindow { pub fn new>(application: &P) -> Self { glib::Object::builder() .property("application", application) .build() } }