|
Flutter Linux Embedder
|
|
Go to the documentation of this file.
9 #include "flutter/shell/platform/embedder/embedder.h"
30 G_DEFINE_TYPE(FlSettingsHandler, fl_settings_handler, 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 FlSettingsHandler*
self = FL_SETTINGS_HANDLER(
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_handler_parent_class)->dispose(
object);
95 g_return_val_if_fail(FL_IS_ENGINE(engine),
nullptr);
97 FlSettingsHandler*
self = FL_SETTINGS_HANDLER(
98 g_object_new(fl_settings_handler_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_HANDLER(
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);
FlSettingsHandler * fl_settings_handler_new(FlEngine *engine)
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)
static constexpr char kPlatformBrightnessDark[]
static void fl_settings_handler_class_init(FlSettingsHandlerClass *klass)
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 constexpr char kPlatformBrightnessKey[]
static constexpr char kPlatformBrightnessLight[]
static constexpr char kTextScaleFactorKey[]
G_MODULE_EXPORT FlBinaryMessenger * fl_engine_get_binary_messenger(FlEngine *self)
G_MODULE_EXPORT FlValue * fl_value_new_map()
static void fl_settings_handler_init(FlSettingsHandler *self)
gboolean fl_settings_get_high_contrast(FlSettings *self)
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 kAlwaysUse24HourFormatKey[]
void fl_settings_handler_start(FlSettingsHandler *self, FlSettings *settings)
FlBasicMessageChannel * channel
static void fl_settings_handler_dispose(GObject *object)
static constexpr char kChannelName[]
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
static void update_settings(FlSettingsHandler *self)
G_MODULE_EXPORT FlBasicMessageChannel * fl_basic_message_channel_new(FlBinaryMessenger *messenger, const gchar *name, FlMessageCodec *codec)
FlClockFormat fl_settings_get_clock_format(FlSettings *self)
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)