diff options
Diffstat (limited to 'adw/src/dialog.cpp')
| -rw-r--r-- | adw/src/dialog.cpp | 338 |
1 files changed, 0 insertions, 338 deletions
diff --git a/adw/src/dialog.cpp b/adw/src/dialog.cpp deleted file mode 100644 index 65da6a2..0000000 --- a/adw/src/dialog.cpp +++ /dev/null @@ -1,338 +0,0 @@ -/** - * @author Felix Morgner (felix.morgner@gmail.com) - * @copyright Copyright (c) 2025 - * SPDX-License-Identifier: LGPL-2.1-or-later - */ - -#include "adwaitamm/dialog.hpp" - -#include "adwaitamm/breakpoint.hpp" -#include "adwaitamm/enums.hpp" -#include "adwaitamm/private/dialog_p.hpp" - -#include <glibmm/object.h> -#include <glibmm/objectbase.h> -#include <glibmm/propertyproxy.h> -#include <glibmm/refptr.h> -#include <glibmm/signalproxy.h> -#include <glibmm/ustring.h> -#include <glibmm/utility.h> -#include <glibmm/wrap.h> - -#include <gtkmm/widget.h> - -#include <glib-object.h> -#include <glib.h> -#include <gtk/gtk.h> - -namespace Adwaita -{ - - namespace - { - auto constinit _class = Dialog_Class{}; - - namespace property_name - { - auto constexpr can_close = "can-close"; - auto constexpr child = "child"; - auto constexpr content_height = "content-height"; - auto constexpr content_width = "content-width"; - auto constexpr current_breakpoint = "current-breakpoint"; - auto constexpr default_widget = "default-widget"; - auto constexpr focus_widget = "focus-widget"; - auto constexpr follows_content_size = "follows_content_size"; - auto constexpr presentation_mode = "presentation_mode"; - auto constexpr title = "title"; - } // namespace property_name - - namespace signal_info - { - auto const close_attempt = Glib::SignalProxyInfo{ - "close-attempt", - reinterpret_cast<GCallback>(&Glib::SignalProxyNormal::slot0_void_callback), - reinterpret_cast<GCallback>(&Glib::SignalProxyNormal::slot0_void_callback), - }; - - auto const closed = Glib::SignalProxyInfo{ - "closed", - reinterpret_cast<GCallback>(&Glib::SignalProxyNormal::slot0_void_callback), - reinterpret_cast<GCallback>(&Glib::SignalProxyNormal::slot0_void_callback), - }; - } // namespace signal_info - } // namespace - - auto Dialog::get_type() -> GType - { - return _class.init().get_type(); - } - - auto Dialog::get_base_type() -> GType - { - return adw_dialog_get_type(); - } - - Dialog::Dialog(Glib::ConstructParams const & params) - : Gtk::Widget{params} - { - } - - Dialog::Dialog(AdwDialog * gobj) - : Gtk::Widget(GTK_WIDGET(gobj)) - { - } - - Dialog::Dialog() - : Glib::ObjectBase{nullptr} - , Gtk::Widget{Glib::ConstructParams{_class.init()}} - { - } - - auto Dialog::add_breakpoint(Glib::RefPtr<Breakpoint> const & breakpoint) -> void - { - // Take a copy because the dialog will take ownership of the breakpoint. - adw_dialog_add_breakpoint(unwrap(this), Glib::unwrap_copy(breakpoint)); - } - - auto Dialog::close() -> void - { - adw_dialog_close(unwrap(this)); - } - - auto Dialog::force_close() -> void - { - adw_dialog_force_close(unwrap(this)); - } - - auto Dialog::present(Gtk::Widget * parent) -> void - { - adw_dialog_present(unwrap(this), Glib::unwrap(parent)); - } - - auto Dialog::get_can_close() const -> bool - { - return adw_dialog_get_can_close(const_cast<BaseObjectType *>(unwrap(this))); - } - - auto Dialog::get_child() const -> Gtk::Widget * - { - return Glib::wrap(adw_dialog_get_child(const_cast<BaseObjectType *>(unwrap(this))), true); - } - - auto Dialog::get_content_height() const -> int - { - return adw_dialog_get_content_height(const_cast<BaseObjectType *>(unwrap(this))); - } - - auto Dialog::get_content_width() const -> int - { - return adw_dialog_get_content_width(const_cast<BaseObjectType *>(unwrap(this))); - } - - auto Dialog::get_current_breakpoint() const -> Glib::RefPtr<Breakpoint> - { - return Glib::wrap(adw_dialog_get_current_breakpoint(const_cast<BaseObjectType *>(unwrap(this))), true); - } - - auto Dialog::get_default_widget() const -> Gtk::Widget * - { - return Glib::wrap(adw_dialog_get_default_widget(const_cast<BaseObjectType *>(unwrap(this)))); - } - - auto Dialog::get_focus() const -> Gtk::Widget * - { - return Glib::wrap(adw_dialog_get_focus(const_cast<BaseObjectType *>(unwrap(this)))); - } - - auto Dialog::get_follows_content_size() const -> bool - { - return adw_dialog_get_follows_content_size(const_cast<BaseObjectType *>(unwrap(this))); - } - - auto Dialog::get_presentation_mode() const -> PresentationMode - { - return static_cast<PresentationMode>(adw_dialog_get_presentation_mode(const_cast<BaseObjectType *>(unwrap(this)))); - } - - auto Dialog::get_title() const -> Glib::ustring - { - return adw_dialog_get_title(const_cast<BaseObjectType *>(unwrap(this))); - } - - auto Dialog::set_can_close(bool value) -> void - { - return adw_dialog_set_can_close(unwrap(this), static_cast<gboolean>(value)); - } - - auto Dialog::set_child(Gtk::Widget & value) -> void - { - return adw_dialog_set_child(unwrap(this), unwrap(&value)); - } - - auto Dialog::set_content_height(int value) -> void - { - return adw_dialog_set_content_height(unwrap(this), value); - } - - auto Dialog::set_content_width(int value) -> void - { - return adw_dialog_set_content_width(unwrap(this), value); - } - - auto Dialog::set_default_widget(Gtk::Widget & value) -> void - { - return adw_dialog_set_default_widget(unwrap(this), unwrap(&value)); - } - - auto Dialog::set_focus(Gtk::Widget & value) -> void - { - return adw_dialog_set_focus(unwrap(this), unwrap(&value)); - } - - auto Dialog::set_follows_content_size(bool value) -> void - { - return adw_dialog_set_follows_content_size(unwrap(this), value); - } - - auto Dialog::set_presentation_mode(PresentationMode value) -> void - { - return adw_dialog_set_presentation_mode(unwrap(this), static_cast<AdwDialogPresentationMode>(value)); - } - - auto Dialog::set_title(Glib::ustring const & str) -> void - { - return adw_dialog_set_title(unwrap(this), Glib::c_str_or_nullptr(str)); - } - - auto Dialog::property_can_close() -> Glib::PropertyProxy<bool> - { - return {this, property_name::can_close}; - } - - auto Dialog::property_can_close() const -> Glib::PropertyProxy_ReadOnly<bool> - { - return {this, property_name::can_close}; - } - - auto Dialog::property_child() -> Glib::PropertyProxy<Gtk::Widget *> - { - return {this, property_name::child}; - } - - auto Dialog::property_child() const -> Glib::PropertyProxy_ReadOnly<Gtk::Widget *> - { - return {this, property_name::child}; - } - - auto Dialog::property_content_height() -> Glib::PropertyProxy<int> - { - return {this, property_name::content_height}; - } - - auto Dialog::property_content_height() const -> Glib::PropertyProxy_ReadOnly<int> - { - return {this, property_name::content_height}; - } - - auto Dialog::property_content_width() -> Glib::PropertyProxy<int> - { - return {this, property_name::content_width}; - } - - auto Dialog::property_content_width() const -> Glib::PropertyProxy_ReadOnly<int> - { - return {this, property_name::content_width}; - } - - auto Dialog::property_current_breakpoint() const -> Glib::PropertyProxy_ReadOnly<Glib::RefPtr<Breakpoint>> - { - return {this, property_name::current_breakpoint}; - } - - auto Dialog::property_default_widget() -> Glib::PropertyProxy<Gtk::Widget *> - { - return {this, property_name::default_widget}; - } - - auto Dialog::property_default_widget() const -> Glib::PropertyProxy_ReadOnly<Gtk::Widget *> - { - return {this, property_name::default_widget}; - } - - auto Dialog::property_focus_widget() -> Glib::PropertyProxy<Gtk::Widget *> - { - return {this, property_name::focus_widget}; - } - - auto Dialog::property_focus_widget() const -> Glib::PropertyProxy_ReadOnly<Gtk::Widget *> - { - return {this, property_name::focus_widget}; - } - - auto Dialog::property_follows_content_size() -> Glib::PropertyProxy<bool> - { - return {this, property_name::follows_content_size}; - } - - auto Dialog::property_follows_content_size() const -> Glib::PropertyProxy_ReadOnly<bool> - { - return {this, property_name::follows_content_size}; - } - - auto Dialog::property_presentation_mode() -> Glib::PropertyProxy<PresentationMode> - { - return {this, property_name::presentation_mode}; - } - - auto Dialog::property_presentation_mode() const -> Glib::PropertyProxy_ReadOnly<PresentationMode> - { - return {this, property_name::presentation_mode}; - } - - auto Dialog::property_title() -> Glib::PropertyProxy<Glib::ustring> - { - return {this, property_name::title}; - } - - auto Dialog::property_title() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring> - { - return {this, property_name::title}; - } - - auto Dialog::signal_close_attempt() -> Glib::SignalProxy<void()> - { - return {this, &signal_info::close_attempt}; - } - - auto Dialog::signal_closed() -> Glib::SignalProxy<void()> - { - return {this, &signal_info::closed}; - } - - auto Dialog::on_close_attempt() -> void - { - auto base_class = static_cast<BaseClassType *>(g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_))); - if (base_class && base_class->close_attempt) - { - return (base_class->close_attempt)(unwrap(this)); - } - } - - auto Dialog::on_closed() -> void - { - auto base_class = static_cast<BaseClassType *>(g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_))); - if (base_class && base_class->closed) - { - return (base_class->closed)(unwrap(this)); - } - } - -} // namespace Adwaita - -namespace Glib -{ - auto wrap(AdwDialog * object, bool copy) -> Adwaita::Dialog * - { - return dynamic_cast<Adwaita::Dialog *>(Glib::wrap_auto(G_OBJECT(object), copy)); - } -} // namespace Glib
\ No newline at end of file |
