From 3a4e781aa4ec052b819a33ba27e2f6a5b78696ff Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 27 Mar 2025 19:44:46 +0100 Subject: adw: add more dialog functions --- adw/include/turns/adw/breakpoint.hpp | 3 ++- adw/include/turns/adw/dialog.hpp | 12 ++++++++++-- adw/include/turns/adw/helpers/gobj_mixin.hpp | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) (limited to 'adw/include') diff --git a/adw/include/turns/adw/breakpoint.hpp b/adw/include/turns/adw/breakpoint.hpp index b274bbb..e5dabe3 100644 --- a/adw/include/turns/adw/breakpoint.hpp +++ b/adw/include/turns/adw/breakpoint.hpp @@ -84,19 +84,20 @@ namespace turns::adw using helpers::gobj_mixin::gobj; using helpers::gobj_mixin::gobj_copy; - explicit Breakpoint(BreakpointCondition & condition); Breakpoint(Breakpoint const & other) = delete; Breakpoint(Breakpoint && other) noexcept = default; auto operator=(Breakpoint const & other) noexcept -> Breakpoint & = delete; auto operator=(Breakpoint && other) noexcept -> Breakpoint & = default; + auto static create(BreakpointCondition & condition) -> Glib::RefPtr; auto static get_type() -> GType; auto static get_base_type() -> GType; auto property_condition() -> Glib::PropertyProxy; protected: + explicit Breakpoint(BreakpointCondition & condition); explicit Breakpoint(Glib::ConstructParams const & params); explicit Breakpoint(BaseObjectType * gobj); }; diff --git a/adw/include/turns/adw/dialog.hpp b/adw/include/turns/adw/dialog.hpp index 316a218..3536dfa 100644 --- a/adw/include/turns/adw/dialog.hpp +++ b/adw/include/turns/adw/dialog.hpp @@ -55,8 +55,16 @@ namespace turns::adw auto static get_type() -> GType; auto static get_base_type() -> GType; - auto add_breakpoint(adw::Breakpoint && breakpoint) -> void; + auto add_breakpoint(Glib::RefPtr const & breakpoint) -> void; auto close() -> void; + auto force_close() -> void; + auto get_can_close() const -> bool; + auto get_child() const -> Gtk::Widget *; + auto get_content_height() const -> int; + auto get_content_width() const -> int; + auto get_current_breakpoint() const -> Glib::RefPtr; + auto get_default_widget() const -> Gtk::Widget *; + auto get_focus() const -> Gtk::Widget *; auto present(Gtk::Widget * parent) -> void; auto set_title(Glib::ustring const & str) -> void; @@ -68,7 +76,7 @@ namespace turns::adw namespace Glib { - auto wrap(AdwDialog * object, bool copy = false) -> Glib::RefPtr; + auto wrap(AdwDialog * object, bool copy = false) -> turns::adw::Dialog *; } // namespace Glib #endif \ No newline at end of file diff --git a/adw/include/turns/adw/helpers/gobj_mixin.hpp b/adw/include/turns/adw/helpers/gobj_mixin.hpp index d9e5097..67600cf 100644 --- a/adw/include/turns/adw/helpers/gobj_mixin.hpp +++ b/adw/include/turns/adw/helpers/gobj_mixin.hpp @@ -28,7 +28,7 @@ namespace turns::adw::helpers using gobj_type = std::conditional_t, std::add_const_t, Glib::Object>; static_cast(self).reference(); - return self.gobj(); + return const_cast(self.gobj()); } }; -- cgit v1.2.3