|
Flutter Linux Embedder
|
|
Go to the documentation of this file.
9 #include "flutter/shell/platform/embedder/embedder.h"
30 G_DEFINE_TYPE(FlSettingsPlugin, fl_settings_plugin, G_TYPE_OBJECT)
33 switch (color_scheme) {
39 g_return_val_if_reached(
nullptr);
61 if (self->engine !=
nullptr) {
64 flags |= kFlutterAccessibilityFeatureDisableAnimations;
67 flags |= kFlutterAccessibilityFeatureHighContrast;
74 FlSettingsPlugin*
self = FL_SETTINGS_PLUGIN(
object);
76 g_clear_object(&self->channel);
77 g_clear_object(&self->settings);
79 if (self->engine !=
nullptr) {
80 g_object_remove_weak_pointer(G_OBJECT(
self),
81 reinterpret_cast<gpointer*
>(&(self->engine)));
82 self->engine =
nullptr;
85 G_OBJECT_CLASS(fl_settings_plugin_parent_class)->dispose(
object);
95 g_return_val_if_fail(FL_IS_ENGINE(engine),
nullptr);
97 FlSettingsPlugin*
self =
98 FL_SETTINGS_PLUGIN(g_object_new(fl_settings_plugin_get_type(),
nullptr));
100 self->engine = engine;
101 g_object_add_weak_pointer(G_OBJECT(
self),
102 reinterpret_cast<gpointer*
>(&(self->engine)));
107 FL_MESSAGE_CODEC(codec));
113 g_return_if_fail(FL_IS_SETTINGS_PLUGIN(
self));
114 g_return_if_fail(FL_IS_SETTINGS(settings));
116 self->settings = FL_SETTINGS(g_object_ref(settings));
117 g_signal_connect_object(settings,
"changed", G_CALLBACK(
update_settings),
118 self, G_CONNECT_SWAPPED);
void fl_engine_update_accessibility_features(FlEngine *self, int32_t flags)
FlColorScheme fl_settings_get_color_scheme(FlSettings *self)
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
G_MODULE_EXPORT void fl_basic_message_channel_send(FlBasicMessageChannel *self, FlValue *message, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
static const gchar * to_platform_brightness(FlColorScheme color_scheme)
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
typedefG_BEGIN_DECLS struct _FlValue FlValue
G_MODULE_EXPORT FlJsonMessageCodec * fl_json_message_codec_new()
gboolean fl_settings_get_enable_animations(FlSettings *self)
FlutterSemanticsFlag flags
static void update_settings(FlSettingsPlugin *self)
G_MODULE_EXPORT FlBinaryMessenger * fl_engine_get_binary_messenger(FlEngine *self)
static constexpr char kChannelName[]
void fl_settings_plugin_start(FlSettingsPlugin *self, FlSettings *settings)
static constexpr char kPlatformBrightnessLight[]
static constexpr char kPlatformBrightnessDark[]
static void fl_settings_plugin_dispose(GObject *object)
G_MODULE_EXPORT FlValue * fl_value_new_map()
gboolean fl_settings_get_high_contrast(FlSettings *self)
static constexpr char kPlatformBrightnessKey[]
static void fl_settings_plugin_class_init(FlSettingsPluginClass *klass)
FlBasicMessageChannel * channel
G_DEFINE_TYPE(FlBasicMessageChannelResponseHandle, fl_basic_message_channel_response_handle, G_TYPE_OBJECT) static void fl_basic_message_channel_response_handle_dispose(GObject *object)
gdouble fl_settings_get_text_scaling_factor(FlSettings *self)
static constexpr char kTextScaleFactorKey[]
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
G_MODULE_EXPORT FlBasicMessageChannel * fl_basic_message_channel_new(FlBinaryMessenger *messenger, const gchar *name, FlMessageCodec *codec)
static constexpr char kAlwaysUse24HourFormatKey[]
static void fl_settings_plugin_init(FlSettingsPlugin *self)
FlClockFormat fl_settings_get_clock_format(FlSettings *self)
FlSettingsPlugin * fl_settings_plugin_new(FlEngine *engine)
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)