forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfl_settings.h
137 lines (121 loc) · 3.43 KB
/
fl_settings.h
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
132
133
134
135
136
137
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_SHELL_PLATFORM_LINUX_FL_SETTINGS_H_
#define FLUTTER_SHELL_PLATFORM_LINUX_FL_SETTINGS_H_
#include <glib-object.h>
G_BEGIN_DECLS
G_DECLARE_INTERFACE(FlSettings, fl_settings, FL, SETTINGS, GObject)
/**
* FlClockFormat:
* @FL_CLOCK_FORMAT_12H: 12-hour clock format.
* @FL_CLOCK_FORMAT_24H: 24-hour clock format.
*
* Available clock formats.
*/
typedef enum {
// NOLINTBEGIN(readability-identifier-naming)
FL_CLOCK_FORMAT_12H,
FL_CLOCK_FORMAT_24H,
// NOLINTEND(readability-identifier-naming)
} FlClockFormat;
/**
* FlColorScheme:
* @FL_COLOR_SCHEME_LIGHT: Prefer light theme.
* @FL_COLOR_SCHEME_DARK: Prefer dark theme.
*
* Available color schemes.
*/
typedef enum {
// NOLINTBEGIN(readability-identifier-naming)
FL_COLOR_SCHEME_LIGHT,
FL_COLOR_SCHEME_DARK,
// NOLINTEND(readability-identifier-naming)
} FlColorScheme;
/**
* FlSettings:
* #FlSettings is and object that provides desktop settings.
*/
struct _FlSettingsInterface {
GTypeInterface parent;
FlClockFormat (*get_clock_format)(FlSettings* settings);
FlColorScheme (*get_color_scheme)(FlSettings* settings);
gboolean (*get_enable_animations)(FlSettings* settings);
gboolean (*get_high_contrast)(FlSettings* settings);
gdouble (*get_text_scaling_factor)(FlSettings* settings);
};
/**
* fl_settings_new:
*
* Creates a new settings instance.
*
* Returns: a new #FlSettings.
*/
FlSettings* fl_settings_new();
/**
* fl_settings_get_clock_format:
* @settings: an #FlSettings.
*
* Whether the clock displays in 24-hour or 12-hour format.
*
* This corresponds to `org.gnome.desktop.interface.clock-format` in GNOME.
*
* Returns: an #FlClockFormat.
*/
FlClockFormat fl_settings_get_clock_format(FlSettings* settings);
/**
* fl_settings_get_color_scheme:
* @settings: an #FlSettings.
*
* The preferred color scheme for the user interface.
*
* This corresponds to `org.gnome.desktop.interface.color-scheme` in GNOME.
*
* Returns: an #FlColorScheme.
*/
FlColorScheme fl_settings_get_color_scheme(FlSettings* settings);
/**
* fl_settings_get_enable_animations:
* @settings: an #FlSettings.
*
* Whether animations should be enabled.
*
* This corresponds to `org.gnome.desktop.interface.enable-animations` in GNOME.
*
* Returns: %TRUE if animations are enabled.
*/
gboolean fl_settings_get_enable_animations(FlSettings* settings);
/**
* fl_settings_get_high_contrast:
* @settings: an #FlSettings.
*
* Whether to use high contrast theme.
*
* This corresponds to `org.gnome.desktop.a11y.interface.high-contrast` in
* GNOME.
*
* Returns: %TRUE if high contrast is used.
*/
gboolean fl_settings_get_high_contrast(FlSettings* settings);
/**
* fl_settings_get_text_scaling_factor:
* @settings: an #FlSettings.
*
* Factor used to enlarge or reduce text display, without changing font size.
*
* This corresponds to `org.gnome.desktop.interface.text-scaling-factor` in
* GNOME.
*
* Returns: a floating point number.
*/
gdouble fl_settings_get_text_scaling_factor(FlSettings* settings);
/**
* fl_settings_emit_changed:
* @settings: an #FlSettings.
*
* Emits the "changed" signal. Used by FlSettings implementations to notify when
* the desktop settings have changed.
*/
void fl_settings_emit_changed(FlSettings* settings);
G_END_DECLS
#endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_SETTINGS_H_