| Flutter Linux Embedder |

Enumerations | Functions | Variables
fl_settings.cc File Reference
`#include "flutter/shell/platform/linux/fl_settings.h"`
`#include "flutter/shell/platform/linux/fl_gnome_settings.h"`
`#include "flutter/shell/platform/linux/fl_settings_portal.h"`

Go to the source code of this file.

## Enumerations
enum | { kSignalChanged, kSignalLastSignal }

## Functions
static void | fl_settings_default_init (FlSettingsInterface *iface)
FlClockFormat | fl_settings_get_clock_format (FlSettings *self)
FlColorScheme | fl_settings_get_color_scheme (FlSettings *self)
gboolean | fl_settings_get_enable_animations (FlSettings *self)
gboolean | fl_settings_get_high_contrast (FlSettings *self)
gdouble | fl_settings_get_text_scaling_factor (FlSettings *self)
void | fl_settings_emit_changed (FlSettings *self)
FlSettings * | fl_settings_new ()

## Variables
static guint | signals [kSignalLastSignal]

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
kSignalChanged |
kSignalLastSignal |

Definition at line 11 of file fl_settings.cc.

11 {
12 kSignalChanged,
13 kSignalLastSignal,
14 };

## Function Documentation

## ◆ fl_settings_default_init()

static void fl_settings_default_init | ( | FlSettingsInterface * | iface | ) |
| static

FlSettings::changed: @settings: an #FlSettings

This signal is emitted after the settings have been changed.

Definition at line 18 of file fl_settings.cc.

18 {
19 /**
20 * FlSettings::changed:
21 * @settings: an #FlSettings
22 *
23 * This signal is emitted after the settings have been changed.
24 */
25 signals[kSignalChanged] =
26 g_signal_new("changed", G_TYPE_FROM_INTERFACE(iface), G_SIGNAL_RUN_LAST,
27 0, NULL, NULL, NULL, G_TYPE_NONE, 0);
28 }

References kSignalChanged, and signals.

## ◆ 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[kSignalChanged], 0);
53 }

References kSignalChanged, 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 }

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

Referenced by fl_engine_start().

## Variable Documentation

## ◆ signals

guint signals[kSignalLastSignal]
| static

Definition at line 16 of file fl_settings.cc.

Referenced by fl_settings_default_init(), and fl_settings_emit_changed().

signals
static guint signals[kSignalLastSignal]
Definition: fl_settings.cc:16
kSignalLastSignal
@ kSignalLastSignal
Definition: fl_settings.cc:13
fl_settings_portal_start
gboolean fl_settings_portal_start(FlSettingsPortal *self, GError **error)
Definition: fl_settings_portal.cc:276
fl_gnome_settings_new
FlSettings * fl_gnome_settings_new()
Definition: fl_gnome_settings.cc:164
kSignalChanged
@ kSignalChanged
Definition: fl_settings.cc:12
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:263