#include "flutter/shell/platform/linux/fl_gnome_settings.h"
#include <gio/gio.h>
#include <glib.h>
Go to the source code of this file.
◆ anonymous enum
◆ create_settings()
static GSettings * create_settings |
( |
const gchar * |
schema_id | ) |
|
|
static |
Definition at line 151 of file fl_gnome_settings.cc.
151 {
153 GSettingsSchemaSource*
source = g_settings_schema_source_get_default();
155 g_autoptr(GSettingsSchema) schema =
156 g_settings_schema_source_lookup(
source, schema_id,
TRUE);
157 if (schema != nullptr) {
158 settings = g_settings_new_full(schema,
nullptr,
nullptr);
159 }
160 }
162}
◆ fl_gnome_settings_class_init()
static void fl_gnome_settings_class_init |
( |
FlGnomeSettingsClass * |
klass | ) |
|
|
static |
Definition at line 127 of file fl_gnome_settings.cc.
127 {
128 GObjectClass* object_class = G_OBJECT_CLASS(klass);
131
132 g_object_class_install_property(
134 g_param_spec_object(
136 g_settings_get_type(),
137 static_cast<GParamFlags>(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY |
138 G_PARAM_STATIC_STRINGS)));
139}
static constexpr char kDesktopInterfaceSchema[]
static void fl_gnome_settings_dispose(GObject *object)
static void fl_gnome_settings_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
static constexpr char kInterfaceSettings[]
◆ fl_gnome_settings_dispose()
static void fl_gnome_settings_dispose |
( |
GObject * |
object | ) |
|
|
static |
Definition at line 119 of file fl_gnome_settings.cc.
119 {
120 FlGnomeSettings*
self = FL_GNOME_SETTINGS(
object);
121
122 g_clear_object(&
self->interface_settings);
123
124 G_OBJECT_CLASS(fl_gnome_settings_parent_class)->dispose(object);
125}
◆ fl_gnome_settings_get_color_scheme()
static FlColorScheme fl_gnome_settings_get_color_scheme |
( |
FlSettings * |
settings | ) |
|
|
static |
Definition at line 50 of file fl_gnome_settings.cc.
50 {
52
54
55 if (
self->interface_settings !=
nullptr) {
56
57 g_autofree gchar*
value =
61 }
62 }
63 return color_scheme;
64}
static constexpr char kDesktopGtkThemeKey[]
static constexpr char kGtkThemeDarkSuffix[]
◆ fl_gnome_settings_get_enable_animations()
static gboolean fl_gnome_settings_get_enable_animations |
( |
FlSettings * |
settings | ) |
|
|
static |
◆ fl_gnome_settings_get_high_contrast()
static gboolean fl_gnome_settings_get_high_contrast |
( |
FlSettings * |
settings | ) |
|
|
static |
◆ fl_gnome_settings_get_text_scaling_factor()
static gdouble fl_gnome_settings_get_text_scaling_factor |
( |
FlSettings * |
settings | ) |
|
|
static |
Definition at line 74 of file fl_gnome_settings.cc.
74 {
76
77 gdouble scaling_factor = 1.0;
78
79 if (
self->interface_settings !=
nullptr) {
80 scaling_factor = g_settings_get_double(
self->interface_settings,
82 }
83 return scaling_factor;
84}
static constexpr char kDesktopTextScalingFactorKey[]
◆ fl_gnome_settings_iface_init()
static void fl_gnome_settings_iface_init |
( |
FlSettingsInterface * |
iface | ) |
|
|
static |
Definition at line 141 of file fl_gnome_settings.cc.
141 {
142 iface->get_clock_format = fl_gnome_settings_get_clock_format;
147}
static gboolean fl_gnome_settings_get_high_contrast(FlSettings *settings)
static FlColorScheme fl_gnome_settings_get_color_scheme(FlSettings *settings)
static gboolean fl_gnome_settings_get_enable_animations(FlSettings *settings)
static gdouble fl_gnome_settings_get_text_scaling_factor(FlSettings *settings)
◆ fl_gnome_settings_init()
static void fl_gnome_settings_init |
( |
FlGnomeSettings * |
self | ) |
|
|
static |
◆ fl_gnome_settings_new()
FlSettings * fl_gnome_settings_new |
( |
| ) |
|
fl_gnome_settings_new:
Creates a new settings instance for GNOME.
Returns: a new #FlSettings.
Definition at line 164 of file fl_gnome_settings.cc.
164 {
165 g_autoptr(GSettings) interface_settings =
167 return FL_SETTINGS(g_object_new(fl_gnome_settings_get_type(),
169 nullptr));
170}
static GSettings * create_settings(const gchar *schema_id)
◆ fl_gnome_settings_set_interface_settings()
static void fl_gnome_settings_set_interface_settings |
( |
FlGnomeSettings * |
self, |
|
|
GSettings * |
settings |
|
) |
| |
|
static |
Definition at line 86 of file fl_gnome_settings.cc.
87 {
88 g_return_if_fail(G_IS_SETTINGS(
settings));
89
90 g_signal_connect_object(
settings,
"changed::clock-format",
92 G_CONNECT_SWAPPED);
93 g_signal_connect_object(
settings,
"changed::gtk-theme",
95 G_CONNECT_SWAPPED);
96 g_signal_connect_object(
settings,
"changed::text-scaling-factor",
98 G_CONNECT_SWAPPED);
99
100 self->interface_settings = G_SETTINGS(g_object_ref(
settings));
101}
void fl_settings_emit_changed(FlSettings *self)
◆ fl_gnome_settings_set_property()
static void fl_gnome_settings_set_property |
( |
GObject * |
object, |
|
|
guint |
prop_id, |
|
|
const GValue * |
value, |
|
|
GParamSpec * |
pspec |
|
) |
| |
|
static |
Definition at line 103 of file fl_gnome_settings.cc.
106 {
107 FlGnomeSettings*
self = FL_GNOME_SETTINGS(
object);
111 self, G_SETTINGS(g_value_get_object(
value)));
112 break;
113 default:
114 G_OBJECT_WARN_INVALID_PROPERTY_ID(
object,
prop_id,
pspec);
115 break;
116 }
117}
static void fl_gnome_settings_set_interface_settings(FlGnomeSettings *self, GSettings *settings)
guint const GValue GParamSpec * pspec
◆ G_DEFINE_TYPE_WITH_CODE()
G_DEFINE_TYPE_WITH_CODE |
( |
FlGnomeSettings |
, |
|
|
fl_gnome_settings |
, |
|
|
G_TYPE_OBJECT |
, |
|
|
G_IMPLEMENT_INTERFACE(fl_settings_get_type(), fl_gnome_settings_iface_init) |
|
|
) |
| |
Definition at line 29 of file fl_gnome_settings.cc.
35 {
37
39
40 if (
self->interface_settings !=
nullptr) {
41 g_autofree gchar*
value =
45 }
46 }
47 return clock_format;
48}
static constexpr char kClockFormat12Hour[]
static constexpr char kDesktopClockFormatKey[]
◆ kClockFormat12Hour
constexpr char kClockFormat12Hour[] = "12h" |
|
staticconstexpr |
◆ kDesktopClockFormatKey
constexpr char kDesktopClockFormatKey[] = "clock-format" |
|
staticconstexpr |
◆ kDesktopGtkThemeKey
constexpr char kDesktopGtkThemeKey[] = "gtk-theme" |
|
staticconstexpr |
◆ kDesktopInterfaceSchema
constexpr char kDesktopInterfaceSchema[] = "org.gnome.desktop.interface" |
|
staticconstexpr |
◆ kDesktopTextScalingFactorKey
constexpr char kDesktopTextScalingFactorKey[] = "text-scaling-factor" |
|
staticconstexpr |
◆ kGtkThemeDarkSuffix
constexpr char kGtkThemeDarkSuffix[] = "-dark" |
|
staticconstexpr |
◆ kInterfaceSettings
constexpr char kInterfaceSettings[] = "interface-settings" |
|
staticconstexpr |