| Flutter Linux Embedder |

Functions
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: @engine: 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 406 of file fl_binary_messenger.cc.

406 {
407 g_return_val_if_fail(FL_IS_ENGINE(engine), nullptr);
408
409 FlBinaryMessengerImpl* self = FL_BINARY_MESSENGER_IMPL(
410 g_object_new(fl_binary_messenger_impl_get_type(), nullptr));
411
412 // Added to stop compiler complaining about an unused function.
413 FL_IS_BINARY_MESSENGER_IMPL(self);
414
415 g_weak_ref_init(&self->engine, G_OBJECT(engine));
416 g_object_weak_ref(G_OBJECT(engine), engine_weak_notify_cb, self);
417
418 fl_engine_set_platform_message_handler(
419 engine, fl_binary_messenger_platform_message_cb, self, NULL);
420
421 return FL_BINARY_MESSENGER(self);
422 }

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

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

fl_engine_set_platform_message_handler
void fl_engine_set_platform_message_handler(FlEngine *self, FlEnginePlatformMessageHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
Definition: fl_engine.cc:594
fl_binary_messenger_platform_message_cb
static gboolean fl_binary_messenger_platform_message_cb(FlEngine *engine, const gchar *channel, GBytes *message, const FlutterPlatformMessageResponseHandle *response_handle, void *user_data)
Definition: fl_binary_messenger.cc:164
self
GdkEvent FlView * self
Definition: fl_view.cc:100
engine_weak_notify_cb
static void engine_weak_notify_cb(gpointer user_data, GObject *where_the_object_was)
Definition: fl_binary_messenger.cc:152
engine
FlEngine * engine
Definition: fl_view_accessible.cc:29