| Flutter Linux Embedder |

fl_settings.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_SHELL_PLATFORM_LINUX_FL_SETTINGS_H_
6 #define FLUTTER_SHELL_PLATFORM_LINUX_FL_SETTINGS_H_
7
8 #include <glib-object.h>
9
10 G_BEGIN_DECLS
11
12 G_DECLARE_INTERFACE(FlSettings, fl_settings, FL, SETTINGS, GObject)
13
14 /**
15 * FlClockFormat:
16 * @FL_CLOCK_FORMAT_12H: 12-hour clock format.
17 * @FL_CLOCK_FORMAT_24H: 24-hour clock format.
18 *
19 * Available clock formats.
20 */
21 typedef enum {
22 // NOLINTBEGIN(readability-identifier-naming)
23 FL_CLOCK_FORMAT_12H,
24 FL_CLOCK_FORMAT_24H,
25 // NOLINTEND(readability-identifier-naming)
26 } FlClockFormat;
27
28 /**
29 * FlColorScheme:
30 * @FL_COLOR_SCHEME_LIGHT: Prefer light theme.
31 * @FL_COLOR_SCHEME_DARK: Prefer dark theme.
32 *
33 * Available color schemes.
34 */
35 typedef enum {
36 // NOLINTBEGIN(readability-identifier-naming)
37 FL_COLOR_SCHEME_LIGHT,
38 FL_COLOR_SCHEME_DARK,
39 // NOLINTEND(readability-identifier-naming)
40 } FlColorScheme;
41
42 /**
43 * FlSettings:
44 * #FlSettings is and object that provides desktop settings.
45 */
46 struct _FlSettingsInterface {
47 GTypeInterface parent;
48 FlClockFormat (*get_clock_format)(FlSettings* settings);
49 FlColorScheme (*get_color_scheme)(FlSettings* settings);
50 gboolean (*get_enable_animations)(FlSettings* settings);
51 gboolean (*get_high_contrast)(FlSettings* settings);
52 gdouble (*get_text_scaling_factor)(FlSettings* settings);
53 };
54
55 /**
56 * fl_settings_new:
57 *
58 * Creates a new settings instance.
59 *
60 * Returns: a new #FlSettings.
61 */
62 FlSettings* fl_settings_new();
63
64 /**
65 * fl_settings_get_clock_format:
66 * @settings: an #FlSettings.
67 *
68 * Whether the clock displays in 24-hour or 12-hour format.
69 *
70 * This corresponds to `org.gnome.desktop.interface.clock-format` in GNOME.
71 *
72 * Returns: an #FlClockFormat.
73 */
74 FlClockFormat fl_settings_get_clock_format(FlSettings* settings);
75
76 /**
77 * fl_settings_get_color_scheme:
78 * @settings: an #FlSettings.
79 *
80 * The preferred color scheme for the user interface.
81 *
82 * This corresponds to `org.gnome.desktop.interface.color-scheme` in GNOME.
83 *
84 * Returns: an #FlColorScheme.
85 */
86 FlColorScheme fl_settings_get_color_scheme(FlSettings* settings);
87
88 /**
89 * fl_settings_get_enable_animations:
90 * @settings: an #FlSettings.
91 *
92 * Whether animations should be enabled.
93 *
94 * This corresponds to `org.gnome.desktop.interface.enable-animations` in GNOME.
95 *
96 * Returns: %TRUE if animations are enabled.
97 */
98 gboolean fl_settings_get_enable_animations(FlSettings* settings);
99
100 /**
101 * fl_settings_get_high_contrast:
102 * @settings: an #FlSettings.
103 *
104 * Whether to use high contrast theme.
105 *
106 * This corresponds to `org.gnome.desktop.a11y.interface.high-contrast` in
107 * GNOME.
108 *
109 * Returns: %TRUE if high contrast is used.
110 */
111 gboolean fl_settings_get_high_contrast(FlSettings* settings);
112
113 /**
114 * fl_settings_get_text_scaling_factor:
115 * @settings: an #FlSettings.
116 *
117 * Factor used to enlarge or reduce text display, without changing font size.
118 *
119 * This corresponds to `org.gnome.desktop.interface.text-scaling-factor` in
120 * GNOME.
121 *
122 * Returns: a floating point number.
123 */
124 gdouble fl_settings_get_text_scaling_factor(FlSettings* settings);
125
126 /**
127 * fl_settings_emit_changed:
128 * @settings: an #FlSettings.
129 *
130 * Emits the "changed" signal. Used by FlSettings implementations to notify when
131 * the desktop settings have changed.
132 */
133 void fl_settings_emit_changed(FlSettings* settings);
134
135 G_END_DECLS
136
137 #endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_SETTINGS_H_
_FlSettingsInterface::parent
GTypeInterface parent
Definition: fl_settings.h:47
fl_settings_get_color_scheme
FlColorScheme fl_settings_get_color_scheme(FlSettings *settings)
Definition: fl_settings.cc:34
FL_CLOCK_FORMAT_12H
@ FL_CLOCK_FORMAT_12H
Definition: fl_settings.h:23
FL_CLOCK_FORMAT_24H
@ FL_CLOCK_FORMAT_24H
Definition: fl_settings.h:24
G_DECLARE_INTERFACE
G_DECLARE_INTERFACE(FlKeyResponder, fl_key_responder, FL, KEY_RESPONDER, GObject)
fl_settings_get_text_scaling_factor
gdouble fl_settings_get_text_scaling_factor(FlSettings *settings)
Definition: fl_settings.cc:46
fl_settings_get_enable_animations
gboolean fl_settings_get_enable_animations(FlSettings *settings)
Definition: fl_settings.cc:38
FlColorScheme
FlColorScheme
Definition: fl_settings.h:35
_FlSettingsInterface::get_high_contrast
gboolean(* get_high_contrast)(FlSettings *settings)
Definition: fl_settings.h:51
fl_settings_get_high_contrast
gboolean fl_settings_get_high_contrast(FlSettings *settings)
Definition: fl_settings.cc:42
fl_settings_new
FlSettings * fl_settings_new()
Definition: fl_settings.cc:55
FL
FL
Definition: fl_binary_messenger.cc:27
_FlSettingsInterface::get_enable_animations
gboolean(* get_enable_animations)(FlSettings *settings)
Definition: fl_settings.h:50
fl_settings_emit_changed
void fl_settings_emit_changed(FlSettings *settings)
Definition: fl_settings.cc:50
FL_COLOR_SCHEME_LIGHT
@ FL_COLOR_SCHEME_LIGHT
Definition: fl_settings.h:37
_FlSettingsInterface::get_color_scheme
FlColorScheme(* get_color_scheme)(FlSettings *settings)
Definition: fl_settings.h:49
_FlSettingsInterface::get_text_scaling_factor
gdouble(* get_text_scaling_factor)(FlSettings *settings)
Definition: fl_settings.h:52
_FlSettingsInterface::get_clock_format
FlClockFormat(* get_clock_format)(FlSettings *settings)
Definition: fl_settings.h:48
FL_COLOR_SCHEME_DARK
@ FL_COLOR_SCHEME_DARK
Definition: fl_settings.h:38
fl_settings_get_clock_format
FlClockFormat fl_settings_get_clock_format(FlSettings *settings)
Definition: fl_settings.cc:30
_FlSettingsInterface
Definition: fl_settings.h:46
FlClockFormat
FlClockFormat
Definition: fl_settings.h:21