Go to the source code of this file.
Classes | |
struct | FlSetting |
struct | _FlSettingsPortal |
Enumerations | |
enum | ColorScheme { kDefault, kPreferDark, kPreferLight } |
Functions | |
static void | fl_settings_portal_iface_init (FlSettingsInterface *iface) |
G_DEFINE_TYPE_WITH_CODE (FlSettingsPortal, fl_settings_portal, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE(fl_settings_get_type(), fl_settings_portal_iface_init)) static gchar *format_key(const FlSetting *setting) | |
static gboolean | get_value (FlSettingsPortal *portal, const FlSetting *setting, GVariant **value) |
static void | set_value (FlSettingsPortal *portal, const FlSetting *setting, GVariant *value) |
static gboolean | settings_portal_read (GDBusProxy *proxy, const gchar *ns, const gchar *key, GVariant **out) |
static void | settings_portal_changed_cb (GDBusProxy *proxy, const char *sender_name, const char *signal_name, GVariant *parameters, gpointer user_data) |
static FlClockFormat | fl_settings_portal_get_clock_format (FlSettings *settings) |
static FlColorScheme | fl_settings_portal_get_color_scheme (FlSettings *settings) |
static gboolean | fl_settings_portal_get_enable_animations (FlSettings *settings) |
static gboolean | fl_settings_portal_get_high_contrast (FlSettings *settings) |
static gdouble | fl_settings_portal_get_text_scaling_factor (FlSettings *settings) |
static void | fl_settings_portal_dispose (GObject *object) |
static void | fl_settings_portal_class_init (FlSettingsPortalClass *klass) |
static void | fl_settings_portal_init (FlSettingsPortal *self) |
FlSettingsPortal * | fl_settings_portal_new () |
FlSettingsPortal * | fl_settings_portal_new_with_values (GVariantDict *values) |
gboolean | fl_settings_portal_start (FlSettingsPortal *self, GError **error) |
Variables | |
static constexpr char | kPortalName [] = "org.freedesktop.portal.Desktop" |
static constexpr char | kPortalPath [] = "/org/freedesktop/portal/desktop" |
static constexpr char | kPortalSettings [] = "org.freedesktop.portal.Settings" |
static constexpr char | kXdgAppearance [] = "org.freedesktop.appearance" |
static const FlSetting | kColorScheme |
static constexpr char | kGnomeA11yInterface [] |
static const FlSetting | kHighContrast |
static constexpr char | kGnomeDesktopInterface [] = "org.gnome.desktop.interface" |
static const FlSetting | kClockFormat |
static const FlSetting | kEnableAnimations |
static const FlSetting | kGtkTheme |
static const FlSetting | kTextScalingFactor |
static const FlSetting | kAllSettings [] |
static constexpr char | kClockFormat12Hour [] = "12h" |
static constexpr char | kGtkThemeDarkSuffix [] = "-dark" |
enum ColorScheme |
|
static |
|
static |
Definition at line 239 of file fl_settings_portal.cc.
Referenced by fl_settings_portal_class_init().
|
static |
Definition at line 163 of file fl_settings_portal.cc.
References FL_CLOCK_FORMAT_12H, FL_CLOCK_FORMAT_24H, get_value(), kClockFormat, kClockFormat12Hour, and value.
Referenced by fl_settings_portal_iface_init().
|
static |
Definition at line 179 of file fl_settings_portal.cc.
References FL_COLOR_SCHEME_DARK, FL_COLOR_SCHEME_LIGHT, get_value(), kColorScheme, kGtkTheme, kGtkThemeDarkSuffix, kPreferDark, and value.
Referenced by fl_settings_portal_iface_init().
|
static |
Definition at line 199 of file fl_settings_portal.cc.
References get_value(), kEnableAnimations, and value.
Referenced by fl_settings_portal_iface_init().
|
static |
Definition at line 212 of file fl_settings_portal.cc.
References get_value(), kHighContrast, and value.
Referenced by fl_settings_portal_iface_init().
|
static |
Definition at line 225 of file fl_settings_portal.cc.
References get_value(), kTextScalingFactor, and value.
Referenced by fl_settings_portal_iface_init().
|
static |
|
static |
Definition at line 261 of file fl_settings_portal.cc.
FlSettingsPortal* fl_settings_portal_new | ( | ) |
FlSettingsPortal: #FlSettingsPortal reads settings from the XDG desktop portal. fl_settings_portal_new:
Creates a new settings portal instance.
Returns: a new #FlSettingsPortal.
Definition at line 263 of file fl_settings_portal.cc.
References fl_settings_portal_new_with_values().
Referenced by fl_settings_new().
FlSettingsPortal* fl_settings_portal_new_with_values | ( | GVariantDict * | values | ) |
fl_settings_portal_new_with_values: @values: (nullable): a #GVariantDict.
Creates a new settings portal instance with initial values for testing.
Returns: a new #FlSettingsPortal.
Definition at line 268 of file fl_settings_portal.cc.
Referenced by fl_settings_portal_new(), and TEST().
gboolean fl_settings_portal_start | ( | FlSettingsPortal * | portal, |
GError ** | error | ||
) |
fl_settings_portal_start: @portal: an #FlSettingsPortal. @error: (allow-none): #GError location to store the error occurring, or NULL
Reads the current settings and starts monitoring for changes in the desktop portal settings.
Returns: TRUE on success, or FALSE if the portal is not available.
Definition at line 276 of file fl_settings_portal.cc.
References error, kAllSettings, kPortalName, kPortalPath, kPortalSettings, set_value(), settings_portal_changed_cb(), settings_portal_read(), and value.
Referenced by fl_settings_new().
G_DEFINE_TYPE_WITH_CODE | ( | FlSettingsPortal | , |
fl_settings_portal | , | ||
G_TYPE_OBJECT | , | ||
G_IMPLEMENT_INTERFACE(fl_settings_get_type(), fl_settings_portal_iface_init) | |||
) | const |
Definition at line 76 of file fl_settings_portal.cc.
References FlSetting::key, and FlSetting::ns.
|
static |
Definition at line 86 of file fl_settings_portal.cc.
References FlSetting::type, and value.
Referenced by fl_settings_portal_get_clock_format(), fl_settings_portal_get_color_scheme(), fl_settings_portal_get_enable_animations(), fl_settings_portal_get_high_contrast(), and fl_settings_portal_get_text_scaling_factor().
|
static |
Definition at line 94 of file fl_settings_portal.cc.
References fl_settings_emit_changed(), and value.
Referenced by fl_settings_portal_start(), and settings_portal_changed_cb().
|
static |
Definition at line 147 of file fl_settings_portal.cc.
References FlSetting::key, FlSetting::ns, set_value(), user_data, and value.
Referenced by fl_settings_portal_start().
|
static |
Definition at line 113 of file fl_settings_portal.cc.
References error, TRUE, and value.
Referenced by fl_settings_portal_start().
|
static |
Definition at line 57 of file fl_settings_portal.cc.
Referenced by fl_settings_portal_start().
|
static |
Definition at line 36 of file fl_settings_portal.cc.
Referenced by fl_settings_portal_get_clock_format().
|
staticconstexpr |
Definition at line 62 of file fl_settings_portal.cc.
Referenced by fl_settings_portal_get_clock_format().
|
static |
Definition at line 21 of file fl_settings_portal.cc.
Referenced by fl_settings_portal_get_color_scheme().
|
static |
Definition at line 41 of file fl_settings_portal.cc.
Referenced by fl_settings_portal_get_enable_animations().
|
staticconstexpr |
Definition at line 27 of file fl_settings_portal.cc.
|
staticconstexpr |
Definition at line 35 of file fl_settings_portal.cc.
|
static |
Definition at line 46 of file fl_settings_portal.cc.
Referenced by fl_settings_portal_get_color_scheme().
|
staticconstexpr |
Definition at line 63 of file fl_settings_portal.cc.
Referenced by fl_settings_portal_get_color_scheme().
|
static |
Definition at line 29 of file fl_settings_portal.cc.
Referenced by fl_settings_portal_get_high_contrast().
|
staticconstexpr |
Definition at line 10 of file fl_settings_portal.cc.
Referenced by fl_settings_portal_start().
|
staticconstexpr |
Definition at line 11 of file fl_settings_portal.cc.
Referenced by fl_settings_portal_start().
|
staticconstexpr |
Definition at line 12 of file fl_settings_portal.cc.
Referenced by fl_settings_portal_start().
|
static |
Definition at line 51 of file fl_settings_portal.cc.
Referenced by fl_settings_portal_get_text_scaling_factor().
|
staticconstexpr |
Definition at line 20 of file fl_settings_portal.cc.