blob: 4b40574e7f8c0214e5e0c2f5a6ee8611784d15c0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
/**
* @author Felix Morgner (felix.morgner@gmail.com)
* @copyright Copyright (c) 2025
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef LIBADWAITAMM_BREAKPOINT_HPP
#define LIBADWAITAMM_BREAKPOINT_HPP
#include "adwaitamm/helpers/gobj_mixin.hpp"
#include <glibmm/object.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 Adwaita
{
enum struct LengthType;
enum struct RatioType;
struct BreakpointCondition
{
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>
{
using BaseObjectType = AdwBreakpoint;
using BaseClassType = AdwBreakpointClass;
using CppObjectType = Breakpoint;
using CppClassType = struct Breakpoint_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 *>;
auto property_condition() const -> Glib::PropertyProxy_ReadOnly<BreakpointCondition *>;
protected:
friend Breakpoint_Class;
explicit Breakpoint(BreakpointCondition & condition);
explicit Breakpoint(Glib::ConstructParams const & params);
explicit Breakpoint(BaseObjectType * gobj);
};
} // namespace Adwaita
namespace Glib
{
auto wrap(AdwBreakpoint * object, bool copy = false) -> Glib::RefPtr<Adwaita::Breakpoint>;
} // namespace Glib
#endif
|