Flutter Engine
fl_binary_messenger_private.h File Reference
#include <glib-object.h>
#include "flutter/shell/platform/linux/public/flutter_linux/fl_engine.h"

Go to the source code of this file.

Functions

G_BEGIN_DECLS FlBinaryMessenger * fl_binary_messenger_new (FlEngine *engine)
 

Function Documentation

◆ fl_binary_messenger_new()

G_BEGIN_DECLS FlBinaryMessenger* fl_binary_messenger_new ( FlEngine *  engine)

fl_binary_messenger_new: : The #FlEngine to communicate with.

Creates a new #FlBinaryMessenger. The binary messenger will take control of the engines platform message handler.

Returns: a new #FlBinaryMessenger.

Definition at line 155 of file fl_binary_messenger.cc.

References engine, engine_weak_notify_cb(), fl_binary_messenger_platform_message_cb(), and fl_engine_set_platform_message_handler().

Referenced by fl_engine_init(), TEST(), and test_lock_event().

155  {
156  g_return_val_if_fail(FL_IS_ENGINE(engine), nullptr);
157 
158  FlBinaryMessenger* self = FL_BINARY_MESSENGER(
159  g_object_new(fl_binary_messenger_get_type(), nullptr));
160 
161  self->engine = engine;
162  g_object_weak_ref(G_OBJECT(engine), engine_weak_notify_cb, self);
163 
166 
167  return self;
168 }
static gboolean fl_binary_messenger_platform_message_cb(FlEngine *engine, const gchar *channel, GBytes *message, const FlutterPlatformMessageResponseHandle *response_handle, void *user_data)
void fl_engine_set_platform_message_handler(FlEngine *self, FlEnginePlatformMessageHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
Definition: fl_engine.cc:433
static void engine_weak_notify_cb(gpointer user_data, GObject *object)