| Flutter Linux Embedder |

Functions
fl_settings_handler.h File Reference
`#include "flutter/shell/platform/linux/fl_settings.h"`
`#include "flutter/shell/platform/linux/public/flutter_linux/fl_engine.h"`

Go to the source code of this file.

## Functions
G_BEGIN_DECLS | G_DECLARE_FINAL_TYPE (FlSettingsHandler, fl_settings_handler, FL, SETTINGS_HANDLER, GObject)
FlSettingsHandler * | fl_settings_handler_new (FlEngine *engine)
void | fl_settings_handler_start (FlSettingsHandler *handler, FlSettings *settings)

## Function Documentation

## ◆ fl_settings_handler_new()

FlSettingsHandler* fl_settings_handler_new | ( | FlEngine * | engine | ) |

FlSettingsHandler:

#FlSettingsHandler is a handler that implements the Flutter user settings channel. fl_settings_handler_new: @messenger: an #FlEngine

Creates a new handler that sends user settings to the Flutter engine.

Returns: a new #FlSettingsHandler

Definition at line 74 of file fl_settings_handler.cc.

74 {
75 g_return_val_if_fail(FL_IS_ENGINE(engine), nullptr);
76
77 FlSettingsHandler* self = FL_SETTINGS_HANDLER(
78 g_object_new(fl_settings_handler_get_type(), nullptr));
79
80 g_weak_ref_init(&self->engine, engine);
81
82 FlBinaryMessenger* messenger = fl_engine_get_binary_messenger(engine);
83 self->channel = fl_settings_channel_new(messenger);
84
85 return self;
86 }
fl_engine_get_binary_messenger
G_MODULE_EXPORT FlBinaryMessenger * fl_engine_get_binary_messenger(FlEngine *self)
Definition: fl_engine.cc:1203
fl_settings_channel_new
FlSettingsChannel * fl_settings_channel_new(FlBinaryMessenger *messenger)
Definition: fl_settings_channel.cc:39

References fl_engine_get_binary_messenger(), and fl_settings_channel_new().

Referenced by fl_engine_start(), and TEST().

## ◆ fl_settings_handler_start()

void fl_settings_handler_start | ( | FlSettingsHandler * | handler,
|  | FlSettings * | settings
| ) |  |

fl_settings_handler_start: @handler: an #FlSettingsHandler.

Sends the current settings to the engine and updates when they change.

Definition at line 88 of file fl_settings_handler.cc.

88 {
89 g_return_if_fail(FL_IS_SETTINGS_HANDLER(self));
90 g_return_if_fail(FL_IS_SETTINGS(settings));
91
92 self->settings = FL_SETTINGS(g_object_ref(settings));
93 g_signal_connect_object(settings, "changed", G_CALLBACK(update_settings),
94 self, G_CONNECT_SWAPPED);
95
96 update_settings(self);
97 }
update_settings
static void update_settings(FlSettingsHandler *self)
Definition: fl_settings_handler.cc:36

References update_settings().

Referenced by fl_engine_start(), and TEST().

## ◆ G_DECLARE_FINAL_TYPE()

G_BEGIN_DECLS G_DECLARE_FINAL_TYPE | ( | FlSettingsHandler | ,
|  | fl_settings_handler | ,
|  | FL | ,
|  | SETTINGS_HANDLER | ,
|  | GObject |
| ) |  |