#include "flutter/shell/platform/linux/fl_settings_plugin.h"
#include <gmodule.h>
#include "flutter/shell/platform/embedder/embedder.h"
#include "flutter/shell/platform/linux/fl_engine_private.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_basic_message_channel.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_json_message_codec.h"
Go to the source code of this file.
◆ fl_settings_plugin_class_init()
static void fl_settings_plugin_class_init |
( |
FlSettingsPluginClass * |
klass | ) |
|
|
static |
Definition at line 88 of file fl_settings_plugin.cc.
88 {
90}
static void fl_settings_plugin_dispose(GObject *object)
◆ fl_settings_plugin_dispose()
static void fl_settings_plugin_dispose |
( |
GObject * |
object | ) |
|
|
static |
Definition at line 73 of file fl_settings_plugin.cc.
73 {
74 FlSettingsPlugin*
self = FL_SETTINGS_PLUGIN(
object);
75
76 g_clear_object(&
self->channel);
77 g_clear_object(&
self->settings);
78
79 if (
self->engine !=
nullptr) {
80 g_object_remove_weak_pointer(G_OBJECT(
self),
81 reinterpret_cast<gpointer*
>(&(
self->engine)));
82 self->engine =
nullptr;
83 }
84
85 G_OBJECT_CLASS(fl_settings_plugin_parent_class)->dispose(object);
86}
◆ fl_settings_plugin_init()
static void fl_settings_plugin_init |
( |
FlSettingsPlugin * |
self | ) |
|
|
static |
◆ fl_settings_plugin_new()
FlSettingsPlugin * fl_settings_plugin_new |
( |
FlEngine * |
engine | ) |
|
FlSettingsPlugin:
#FlSettingsPlugin is a plugin that implements the Flutter user settings channel. fl_settings_plugin_new: @messenger: an #FlEngine
Creates a new plugin that sends user settings to the Flutter engine.
Returns: a new #FlSettingsPlugin
Definition at line 94 of file fl_settings_plugin.cc.
94 {
95 g_return_val_if_fail(FL_IS_ENGINE(
engine),
nullptr);
96
97 FlSettingsPlugin*
self =
98 FL_SETTINGS_PLUGIN(g_object_new(fl_settings_plugin_get_type(), nullptr));
99
101 g_object_add_weak_pointer(G_OBJECT(
self),
102 reinterpret_cast<gpointer*
>(&(
self->engine)));
103
107 FL_MESSAGE_CODEC(codec));
108
110}
G_MODULE_EXPORT FlBasicMessageChannel * fl_basic_message_channel_new(FlBinaryMessenger *messenger, const gchar *name, FlMessageCodec *codec)
G_MODULE_EXPORT FlBinaryMessenger * fl_engine_get_binary_messenger(FlEngine *self)
G_MODULE_EXPORT FlJsonMessageCodec * fl_json_message_codec_new()
static constexpr char kChannelName[]
◆ fl_settings_plugin_start()
void fl_settings_plugin_start |
( |
FlSettingsPlugin * |
plugin, |
|
|
FlSettings * |
settings |
|
) |
| |
fl_settings_plugin_start: @self: an #FlSettingsPlugin.
Sends the current settings to the engine and updates when they change.
Definition at line 112 of file fl_settings_plugin.cc.
112 {
113 g_return_if_fail(FL_IS_SETTINGS_PLUGIN(
self));
114 g_return_if_fail(FL_IS_SETTINGS(
settings));
115
118 self, G_CONNECT_SWAPPED);
119
121}
static void update_settings(FlSettingsPlugin *self)
◆ to_platform_brightness()
static const gchar * to_platform_brightness |
( |
FlColorScheme |
color_scheme | ) |
|
|
static |
Definition at line 32 of file fl_settings_plugin.cc.
32 {
33 switch (color_scheme) {
38 default:
39 g_return_val_if_reached(nullptr);
40 }
41}
static constexpr char kPlatformBrightnessLight[]
static constexpr char kPlatformBrightnessDark[]
◆ update_settings()
static void update_settings |
( |
FlSettingsPlugin * |
self | ) |
|
|
static |
Definition at line 44 of file fl_settings_plugin.cc.
44 {
48
59 nullptr);
60
61 if (
self->engine !=
nullptr) {
65 }
68 }
70 }
71}
@ kFlutterAccessibilityFeatureHighContrast
Request that UI be rendered with darker colors.
@ kFlutterAccessibilityFeatureDisableAnimations
Request that animations be disabled or simplified.
FlutterSemanticsFlag flags
G_MODULE_EXPORT void fl_basic_message_channel_send(FlBasicMessageChannel *self, FlValue *message, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
void fl_engine_update_accessibility_features(FlEngine *self, int32_t flags)
gboolean fl_settings_get_high_contrast(FlSettings *self)
gdouble fl_settings_get_text_scaling_factor(FlSettings *self)
gboolean fl_settings_get_enable_animations(FlSettings *self)
FlColorScheme fl_settings_get_color_scheme(FlSettings *self)
FlClockFormat fl_settings_get_clock_format(FlSettings *self)
static constexpr char kTextScaleFactorKey[]
static constexpr char kPlatformBrightnessKey[]
static constexpr char kAlwaysUse24HourFormatKey[]
static const gchar * to_platform_brightness(FlColorScheme color_scheme)
G_MODULE_EXPORT FlValue * fl_value_new_map()
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
typedefG_BEGIN_DECLS struct _FlValue FlValue
◆ kAlwaysUse24HourFormatKey
constexpr char kAlwaysUse24HourFormatKey[] = "alwaysUse24HourFormat" |
|
staticconstexpr |
◆ kChannelName
constexpr char kChannelName[] = "flutter/settings" |
|
staticconstexpr |
◆ kPlatformBrightnessDark
constexpr char kPlatformBrightnessDark[] = "dark" |
|
staticconstexpr |
◆ kPlatformBrightnessKey
constexpr char kPlatformBrightnessKey[] = "platformBrightness" |
|
staticconstexpr |
◆ kPlatformBrightnessLight
constexpr char kPlatformBrightnessLight[] = "light" |
|
staticconstexpr |
◆ kTextScaleFactorKey
constexpr char kTextScaleFactorKey[] = "textScaleFactor" |
|
staticconstexpr |