Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 {
14};
@ kSignalChanged
@ kSignalLastSignal

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 */
26 g_signal_new("changed", G_TYPE_FROM_INTERFACE(iface), G_SIGNAL_RUN_LAST,
27 0, NULL, NULL, NULL, G_TYPE_NONE, 0);
28}
static guint signals[kSignalLastSignal]

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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}
FlSettings * fl_gnome_settings_new()
const uint8_t uint32_t uint32_t GError ** error
gboolean fl_settings_portal_start(FlSettingsPortal *self, GError **error)
FlSettingsPortal * fl_settings_portal_new()

Variable Documentation

◆ signals

guint signals[kSignalLastSignal]
static

Definition at line 16 of file fl_settings.cc.