| Flutter Linux Embedder |

Classes | Enumerations | Functions
fl_settings.h File Reference
`#include <glib-object.h>`

Go to the source code of this file.

## Classes
struct | _FlSettingsInterface

## Enumerations
enum | FlClockFormat { FL_CLOCK_FORMAT_12H , FL_CLOCK_FORMAT_24H }
enum | FlColorScheme { FL_COLOR_SCHEME_LIGHT , FL_COLOR_SCHEME_DARK }

## Functions
FlSettings * | fl_settings_new ()
FlClockFormat | fl_settings_get_clock_format (FlSettings *settings)
FlColorScheme | fl_settings_get_color_scheme (FlSettings *settings)
gboolean | fl_settings_get_enable_animations (FlSettings *settings)
gboolean | fl_settings_get_high_contrast (FlSettings *settings)
gdouble | fl_settings_get_text_scaling_factor (FlSettings *settings)
void | fl_settings_emit_changed (FlSettings *settings)

## Enumeration Type Documentation

## ◆ FlClockFormat

enum FlClockFormat

FlClockFormat: @FL_CLOCK_FORMAT_12H: 12-hour clock format. @FL_CLOCK_FORMAT_24H: 24-hour clock format.

Available clock formats.

Enumerator
FL_CLOCK_FORMAT_12H |
FL_CLOCK_FORMAT_24H |

Definition at line 21 of file fl_settings.h.

21 {
22 FL_CLOCK_FORMAT_12H,
23 FL_CLOCK_FORMAT_24H,
24 } FlClockFormat;
FlClockFormat
FlClockFormat
Definition: fl_settings.h:21
FL_CLOCK_FORMAT_12H
@ FL_CLOCK_FORMAT_12H
Definition: fl_settings.h:22
FL_CLOCK_FORMAT_24H
@ FL_CLOCK_FORMAT_24H
Definition: fl_settings.h:23

## ◆ FlColorScheme

enum FlColorScheme

FlColorScheme: @FL_COLOR_SCHEME_LIGHT: Prefer light theme. @FL_COLOR_SCHEME_DARK: Prefer dark theme.

Available color schemes.

Enumerator
FL_COLOR_SCHEME_LIGHT |
FL_COLOR_SCHEME_DARK |

Definition at line 33 of file fl_settings.h.

33 {
34 FL_COLOR_SCHEME_LIGHT,
35 FL_COLOR_SCHEME_DARK,
36 } FlColorScheme;
FlColorScheme
FlColorScheme
Definition: fl_settings.h:33
FL_COLOR_SCHEME_DARK
@ FL_COLOR_SCHEME_DARK
Definition: fl_settings.h:35
FL_COLOR_SCHEME_LIGHT
@ FL_COLOR_SCHEME_LIGHT
Definition: fl_settings.h:34

## Function Documentation

## ◆ fl_settings_emit_changed()

void fl_settings_emit_changed | ( | 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.

Definition at line 50 of file fl_settings.cc.

50 {
51 g_return_if_fail(FL_IS_SETTINGS(self));
52 g_signal_emit(self, signals[SIGNAL_CHANGED], 0);
53 }
g_signal_emit
g_signal_emit(self, fl_application_signals[SIGNAL_CREATE_WINDOW], 0, view, &window)
signals
static guint signals[LAST_SIGNAL]
Definition: fl_settings.cc:16
SIGNAL_CHANGED
@ SIGNAL_CHANGED
Definition: fl_settings.cc:12

References g_signal_emit(), SIGNAL_CHANGED, and signals.

Referenced by fl_gnome_settings_set_interface_settings(), set_value(), and TEST().

## ◆ fl_settings_get_clock_format()

FlClockFormat fl_settings_get_clock_format | ( | FlSettings * | settings | ) |

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.

Definition at line 30 of file fl_settings.cc.

30 {
31 return FL_SETTINGS_GET_IFACE(self)->get_clock_format(self);
32 }

Referenced by TEST(), TEST_F(), and update_settings().

## ◆ fl_settings_get_color_scheme()

FlColorScheme fl_settings_get_color_scheme | ( | 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.

Definition at line 34 of file fl_settings.cc.

34 {
35 return FL_SETTINGS_GET_IFACE(self)->get_color_scheme(self);
36 }

Referenced by TEST(), TEST_F(), and update_settings().

## ◆ fl_settings_get_enable_animations()

gboolean fl_settings_get_enable_animations | ( | 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.

Definition at line 38 of file fl_settings.cc.

38 {
39 return FL_SETTINGS_GET_IFACE(self)->get_enable_animations(self);
40 }

Referenced by TEST(), TEST_F(), and update_settings().

## ◆ fl_settings_get_high_contrast()

gboolean fl_settings_get_high_contrast | ( | 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.

Definition at line 42 of file fl_settings.cc.

42 {
43 return FL_SETTINGS_GET_IFACE(self)->get_high_contrast(self);
44 }

Referenced by TEST(), TEST_F(), and update_settings().

## ◆ fl_settings_get_text_scaling_factor()

gdouble fl_settings_get_text_scaling_factor | ( | 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.

Definition at line 46 of file fl_settings.cc.

46 {
47 return FL_SETTINGS_GET_IFACE(self)->get_text_scaling_factor(self);
48 }

Referenced by TEST(), TEST_F(), and update_settings().

## ◆ fl_settings_new()

FlSettings* fl_settings_new | ( |  | ) |

fl_settings_new:

Creates a new settings instance.

Returns: a new #FlSettings.

Definition at line 55 of file fl_settings.cc.

55 {
56 g_autoptr(FlSettingsPortal) portal = fl_settings_portal_new();
57
58 g_autoptr(GError) error = nullptr;
59 if (!fl_settings_portal_start(portal, &error)) {
60 g_debug("XDG desktop portal settings unavailable: %s", error->message);
61 return fl_gnome_settings_new();
62 }
63
64 return FL_SETTINGS(g_object_ref(portal));
65 }
g_autoptr
g_autoptr(GMutexLocker) locker
fl_gnome_settings_new
FlSettings * fl_gnome_settings_new()
Definition: fl_gnome_settings.cc:164
error
const uint8_t uint32_t uint32_t GError ** error
Definition: fl_pixel_buffer_texture_test.cc:40
fl_settings_portal_new
FlSettingsPortal * fl_settings_portal_new()
Definition: fl_settings_portal.cc:267
fl_settings_portal_start
gboolean fl_settings_portal_start(FlSettingsPortal *self, GError **error)
Definition: fl_settings_portal.cc:280

References error, fl_gnome_settings_new(), fl_settings_portal_new(), fl_settings_portal_start(), and g_autoptr().

Referenced by fl_engine_start().