blob: c79bcbcb57c346ebdcf50935eac83e22c73ac609 (
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
/**
* @author Felix Morgner (felix.morgner@gmail.com)
* @copyright Copyright (c) 2025
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "adwaitamm/stylemanager.hpp"
#include "adwaitamm/enums.hpp"
#include "adwaitamm/private/stylemanager_p.hpp"
#include <glibmm/object.h>
#include <glibmm/objectbase.h>
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
#include <glibmm/wrap.h>
#include <gdkmm/display.h>
#include <gdkmm/rgba.h>
#include <adwaita.h>
#include <glib-object.h>
namespace Adwaita
{
namespace
{
auto constinit _class = StyleManager_Class{};
} // namespace
auto StyleManager::get_default() -> StyleManager *
{
return Glib::wrap(adw_style_manager_get_default());
}
auto StyleManager::for_display(Gdk::Display & display) -> StyleManager *
{
return Glib::wrap(adw_style_manager_get_for_display(Glib::unwrap(&display)));
}
auto StyleManager::get_type() -> GType
{
return _class.init().get_type();
}
auto StyleManager::get_base_type() -> GType
{
return adw_style_manager_get_type();
}
StyleManager::StyleManager(Glib::ConstructParams const & params)
: Glib::Object{params}
{
}
StyleManager::StyleManager(BaseObjectType * gobj)
: Glib::Object(G_OBJECT(gobj))
{
}
StyleManager::StyleManager()
: Glib::ObjectBase{nullptr}
, Glib::Object{Glib::ConstructParams{_class.init()}}
{
adw_init();
}
auto StyleManager::get_accent_color() const -> AccentColor
{
return static_cast<AccentColor>(adw_style_manager_get_accent_color(const_cast<BaseObjectType *>(unwrap(this))));
}
auto StyleManager::get_accent_color_rgba() const -> Gdk::RGBA
{
return Glib::wrap(adw_style_manager_get_accent_color_rgba(const_cast<BaseObjectType *>(unwrap(this))));
}
auto StyleManager::get_color_scheme() const -> ColorScheme
{
return static_cast<ColorScheme>(adw_style_manager_get_color_scheme(const_cast<BaseObjectType *>(unwrap(this))));
}
auto StyleManager::get_dark() const -> bool
{
return adw_style_manager_get_dark(const_cast<BaseObjectType *>(unwrap(this)));
}
auto StyleManager::get_display() const -> Glib::RefPtr<Gdk::Display>
{
return Glib::wrap(adw_style_manager_get_display(const_cast<BaseObjectType *>(unwrap(this))));
}
auto StyleManager::get_document_font_name() const -> Glib::ustring
{
return adw_style_manager_get_document_font_name(const_cast<BaseObjectType *>(unwrap(this)));
}
auto StyleManager::get_high_contrast() const -> bool
{
return adw_style_manager_get_high_contrast(const_cast<BaseObjectType *>(unwrap(this)));
}
auto StyleManager::get_monospace_font_name() const -> Glib::ustring
{
return adw_style_manager_get_monospace_font_name(const_cast<BaseObjectType *>(unwrap(this)));
}
auto StyleManager::get_system_supports_accent_colors() const -> bool
{
return adw_style_manager_get_system_supports_accent_colors(const_cast<BaseObjectType *>(unwrap(this)));
}
auto StyleManager::get_system_supports_color_schemes() const -> bool
{
return adw_style_manager_get_system_supports_color_schemes(const_cast<BaseObjectType *>(unwrap(this)));
}
auto StyleManager::set_color_scheme(ColorScheme value) -> void
{
adw_style_manager_set_color_scheme(unwrap(this), static_cast<AdwColorScheme>(value));
}
} // namespace Adwaita
namespace Glib
{
auto wrap(AdwStyleManager * object) -> Adwaita::StyleManager *
{
return dynamic_cast<Adwaita::StyleManager *>(Glib::wrap_auto(G_OBJECT(object)));
}
} // namespace Glib
|