diff options
Diffstat (limited to 'include/turns/adw/breakpoint.hpp')
| -rw-r--r-- | include/turns/adw/breakpoint.hpp | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/include/turns/adw/breakpoint.hpp b/include/turns/adw/breakpoint.hpp deleted file mode 100644 index e5dabe3..0000000 --- a/include/turns/adw/breakpoint.hpp +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef TURNS_ADW_BREAKPOINT_HPP -#define TURNS_ADW_BREAKPOINT_HPP - -#include "turns/adw/helpers/gobj_mixin.hpp" - -#include <glibmm/object.h> -#include <glibmm/objectbase.h> -#include <glibmm/propertyproxy.h> -#include <glibmm/refptr.h> -#include <glibmm/ustring.h> - -#include <gtkmm/buildable.h> - -#include <glib-object.h> - -#include <optional> - -#define _ADWAITA_INSIDE -#include <adw-breakpoint.h> -#undef _ADWAITA_INSIDE - -namespace turns::adw -{ - struct BreakpointCondition - { - enum struct LengthType : int - { - min_width, - max_width, - min_height, - max_height, - }; - - enum struct RatioType : int - { - min_aspect_ratio, - max_aspect_ratio - }; - - BreakpointCondition(BreakpointCondition const & other); - BreakpointCondition(BreakpointCondition && other); - BreakpointCondition(LengthType type, double value, int unit); // FIXME: replace unit type with actual enum. - BreakpointCondition(RatioType type, int width, int height); - - ~BreakpointCondition() noexcept; - - auto operator&&(BreakpointCondition & rhs) & -> BreakpointCondition; - auto operator||(BreakpointCondition & lhs) & -> BreakpointCondition; - - explicit operator Glib::ustring() const; - - auto static parse(Glib::ustring str) -> std::optional<BreakpointCondition>; - - private: - friend struct Breakpoint; - - explicit BreakpointCondition(AdwBreakpointCondition * object); - - AdwBreakpointCondition * m_object{nullptr}; - }; - - struct Breakpoint final : Glib::Object, - Gtk::Buildable, - helpers::gobj_mixin<Breakpoint, AdwBreakpoint> - { - struct Class : Glib::Class - { - using BaseClassParent = GObjectClass; - using BaseClassType = AdwBreakpointClass; - using BaseObjectType = AdwBreakpoint; - using CppClassParent = struct Glib::Object_Class; - using CppObjectType = Breakpoint; - - auto init() -> Glib::Class const &; - auto static class_init_function(void * gclass, void * data) -> void; - auto static wrap_new(GObject * object) -> Glib::ObjectBase *; - }; - - using BaseObjectType = Class::BaseObjectType; - using BaseClassType = Class::BaseClassType; - using CppObjectType = Class::CppObjectType; - using CppClassType = Class; - - using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj; - using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj_copy; - - 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<Breakpoint>; - auto static get_type() -> GType; - auto static get_base_type() -> GType; - - auto property_condition() -> Glib::PropertyProxy<BreakpointCondition *>; - - protected: - explicit Breakpoint(BreakpointCondition & condition); - explicit Breakpoint(Glib::ConstructParams const & params); - explicit Breakpoint(BaseObjectType * gobj); - }; - -} // namespace turns::adw - -namespace Glib -{ - auto wrap(AdwBreakpoint * object, bool copy = false) -> Glib::RefPtr<turns::adw::Breakpoint>; -} // namespace Glib - - -#endif
\ No newline at end of file |
