Flutter Engine
The Flutter Engine
|
#include "flutter/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h"
#include "flutter/shell/platform/linux/fl_binary_messenger_private.h"
#include "flutter/fml/logging.h"
#include "flutter/shell/platform/linux/fl_engine_private.h"
#include "flutter/shell/platform/linux/fl_method_codec_private.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_engine.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_method_channel.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_method_codec.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_standard_method_codec.h"
#include <gmodule.h>
Go to the source code of this file.
Classes | |
struct | _FlBinaryMessengerResponseHandleImpl |
struct | PlatformMessageHandler |
Functions | |
G_DEFINE_QUARK (fl_binary_messenger_codec_error_quark, fl_binary_messenger_codec_error) G_DECLARE_FINAL_TYPE(FlBinaryMessengerImpl | |
GObject | G_DECLARE_FINAL_TYPE (FlBinaryMessengerResponseHandleImpl, fl_binary_messenger_response_handle_impl, FL, BINARY_MESSENGER_RESPONSE_HANDLE_IMPL, FlBinaryMessengerResponseHandle) struct _FlBinaryMessengerImpl |
static void | fl_binary_messenger_impl_iface_init (FlBinaryMessengerInterface *iface) |
G_DEFINE_TYPE_WITH_CODE (FlBinaryMessengerImpl, fl_binary_messenger_impl, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE(fl_binary_messenger_get_type(), fl_binary_messenger_impl_iface_init)) static void fl_binary_messenger_response_handle_class_init(FlBinaryMessengerResponseHandleClass *klass) | |
G_DEFINE_TYPE (FlBinaryMessengerResponseHandle, fl_binary_messenger_response_handle, G_TYPE_OBJECT) static void fl_binary_messenger_response_handle_init(FlBinaryMessengerResponseHandle *self) | |
G_DEFINE_TYPE (FlBinaryMessengerResponseHandleImpl, fl_binary_messenger_response_handle_impl, fl_binary_messenger_response_handle_get_type()) static void fl_binary_messenger_default_init(FlBinaryMessengerInterface *iface) | |
static void | fl_binary_messenger_response_handle_impl_dispose (GObject *object) |
static void | fl_binary_messenger_response_handle_impl_class_init (FlBinaryMessengerResponseHandleImplClass *klass) |
static void | fl_binary_messenger_response_handle_impl_init (FlBinaryMessengerResponseHandleImpl *self) |
static FlBinaryMessengerResponseHandleImpl * | fl_binary_messenger_response_handle_impl_new (FlBinaryMessengerImpl *messenger, const FlutterPlatformMessageResponseHandle *response_handle) |
static PlatformMessageHandler * | platform_message_handler_new (FlBinaryMessengerMessageHandler handler, gpointer user_data, GDestroyNotify destroy_notify) |
static void | platform_message_handler_free (gpointer data) |
static void | engine_weak_notify_cb (gpointer user_data, GObject *where_the_object_was) |
static gboolean | fl_binary_messenger_platform_message_cb (FlEngine *engine, const gchar *channel, GBytes *message, const FlutterPlatformMessageResponseHandle *response_handle, void *user_data) |
static void | fl_binary_messenger_impl_dispose (GObject *object) |
static void | set_message_handler_on_channel (FlBinaryMessenger *messenger, const gchar *channel, FlBinaryMessengerMessageHandler handler, gpointer user_data, GDestroyNotify destroy_notify) |
static gboolean | do_unref (gpointer value) |
static gboolean | send_response (FlBinaryMessenger *messenger, FlBinaryMessengerResponseHandle *response_handle_, GBytes *response, GError **error) |
static void | platform_message_ready_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
static void | send_on_channel (FlBinaryMessenger *messenger, const gchar *channel, GBytes *message, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) |
static GBytes * | send_on_channel_finish (FlBinaryMessenger *messenger, GAsyncResult *result, GError **error) |
static gboolean | finish_method (GObject *object, GAsyncResult *result, GError **error) |
static void | resize_channel_response_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
static void | resize_channel (FlBinaryMessenger *messenger, const gchar *channel, int64_t new_size) |
static void | set_warns_on_channel_overflow_response_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
static void | set_warns_on_channel_overflow (FlBinaryMessenger *messenger, const gchar *channel, bool warns) |
static void | fl_binary_messenger_impl_class_init (FlBinaryMessengerImplClass *klass) |
static void | fl_binary_messenger_impl_init (FlBinaryMessengerImpl *self) |
FlBinaryMessenger * | fl_binary_messenger_new (FlEngine *engine) |
G_MODULE_EXPORT void | fl_binary_messenger_set_message_handler_on_channel (FlBinaryMessenger *self, const gchar *channel, FlBinaryMessengerMessageHandler handler, gpointer user_data, GDestroyNotify destroy_notify) |
G_MODULE_EXPORT gboolean | fl_binary_messenger_send_response (FlBinaryMessenger *self, FlBinaryMessengerResponseHandle *response_handle, GBytes *response, GError **error) |
G_MODULE_EXPORT void | fl_binary_messenger_send_on_channel (FlBinaryMessenger *self, const gchar *channel, GBytes *message, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) |
G_MODULE_EXPORT GBytes * | fl_binary_messenger_send_on_channel_finish (FlBinaryMessenger *self, GAsyncResult *result, GError **error) |
G_MODULE_EXPORT void | fl_binary_messenger_resize_channel (FlBinaryMessenger *self, const gchar *channel, int64_t new_size) |
G_MODULE_EXPORT void | fl_binary_messenger_set_warns_on_channel_overflow (FlBinaryMessenger *self, const gchar *channel, bool warns) |
Variables | |
static constexpr char | kControlChannelName [] = "dev.flutter/channel-buffers" |
static constexpr char | kResizeMethod [] = "resize" |
static constexpr char | kOverflowMethod [] = "overflow" |
fl_binary_messenger_impl | |
FL | |
BINARY_MESSENGER_IMPL | |
|
static |
Definition at line 235 of file fl_binary_messenger.cc.
|
static |
Definition at line 152 of file fl_binary_messenger.cc.
|
static |
Definition at line 324 of file fl_binary_messenger.cc.
|
static |
Definition at line 386 of file fl_binary_messenger.cc.
|
static |
Definition at line 187 of file fl_binary_messenger.cc.
|
static |
Definition at line 391 of file fl_binary_messenger.cc.
|
static |
Definition at line 401 of file fl_binary_messenger.cc.
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.
|
static |
Definition at line 164 of file fl_binary_messenger.cc.
G_MODULE_EXPORT void fl_binary_messenger_resize_channel | ( | FlBinaryMessenger * | messenger, |
const gchar * | channel, | ||
int64_t | new_size | ||
) |
fl_binary_messenger_resize_channel: @binary_messenger: an #FlBinaryMessenger. @channel: channel to be resize. @new_size: the new size for the channel buffer.
Sends a message to the control channel asking to resize a channel buffer.
Definition at line 475 of file fl_binary_messenger.cc.
|
static |
Definition at line 103 of file fl_binary_messenger.cc.
|
static |
Definition at line 86 of file fl_binary_messenger.cc.
|
static |
Definition at line 109 of file fl_binary_messenger.cc.
|
static |
Definition at line 113 of file fl_binary_messenger.cc.
G_MODULE_EXPORT void fl_binary_messenger_send_on_channel | ( | FlBinaryMessenger * | messenger, |
const gchar * | channel, | ||
GBytes * | message, | ||
GCancellable * | cancellable, | ||
GAsyncReadyCallback | callback, | ||
gpointer | user_data | ||
) |
fl_binary_messenger_send_on_channel: @binary_messenger: an #FlBinaryMessenger. @channel: channel to send to. @message: (allow-none): message buffer to send or NULL for an empty message. @cancellable: (allow-none): a #GCancellable or NULL. @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied. @user_data: (closure): user data to pass to @callback.
Asynchronously sends a platform message.
Definition at line 451 of file fl_binary_messenger.cc.
G_MODULE_EXPORT GBytes * fl_binary_messenger_send_on_channel_finish | ( | FlBinaryMessenger * | messenger, |
GAsyncResult * | result, | ||
GError ** | error | ||
) |
fl_binary_messenger_send_on_channel_finish: @messenger: an #FlBinaryMessenger.
Completes request started with fl_binary_messenger_send_on_channel().
Returns: (transfer full): message response on success or NULL on error.
Definition at line 465 of file fl_binary_messenger.cc.
G_MODULE_EXPORT gboolean fl_binary_messenger_send_response | ( | FlBinaryMessenger * | messenger, |
FlBinaryMessengerResponseHandle * | response_handle, | ||
GBytes * | response, | ||
GError ** | error | ||
) |
fl_binary_messenger_send_response: @binary_messenger: an #FlBinaryMessenger. @response_handle: handle that was provided in a FlBinaryMessengerMessageHandler. @response: (allow-none): response to send or NULL for an empty response. @error: (allow-none): #GError location to store the error occurring, or NULL to ignore.
Responds to a platform message. This function is thread-safe.
Returns: TRUE on success.
Definition at line 438 of file fl_binary_messenger.cc.
G_MODULE_EXPORT void fl_binary_messenger_set_message_handler_on_channel | ( | FlBinaryMessenger * | messenger, |
const gchar * | channel, | ||
FlBinaryMessengerMessageHandler | handler, | ||
gpointer | user_data, | ||
GDestroyNotify | destroy_notify | ||
) |
FlBinaryMessenger:
#FlBinaryMessenger is an object that allows sending and receiving of platform messages with an #FlEngine. FlBinaryMessengerResponseHandle:
#FlBinaryMessengerResponseHandle is an object used to send responses with. fl_binary_messenger_set_platform_message_handler: @binary_messenger: an #FlBinaryMessenger. @channel: channel to listen on. @handler: (allow-none): function to call when a message is received on this channel or NULL to disable a handler @user_data: (closure): user data to pass to @handler. @destroy_notify: (allow-none): a function which gets called to free @user_data, or NULL.
Sets the function called when a platform message is received on the given channel. See FlBinaryMessengerMessageHandler for details on how to respond to messages.
The handler is removed if the channel is closed or is replaced by another handler, set @destroy_notify if you want to detect this.
Definition at line 424 of file fl_binary_messenger.cc.
G_MODULE_EXPORT void fl_binary_messenger_set_warns_on_channel_overflow | ( | FlBinaryMessenger * | messenger, |
const gchar * | channel, | ||
bool | warns | ||
) |
fl_binary_messenger_set_warns_on_channel_overflow: @messenger: an #FlBinaryMessenger. @channel: channel to be allowed to overflow silently. @warns: when false, the channel is expected to overflow and warning messages will not be shown.
Sends a message to the control channel asking to allow or disallow a channel to overflow silently.
Definition at line 484 of file fl_binary_messenger.cc.
GObject G_DECLARE_FINAL_TYPE | ( | FlBinaryMessengerResponseHandleImpl | , |
fl_binary_messenger_response_handle_impl | , | ||
FL | , | ||
BINARY_MESSENGER_RESPONSE_HANDLE_IMPL | , | ||
FlBinaryMessengerResponseHandle | |||
) |
Definition at line 31 of file fl_binary_messenger.cc.
G_DEFINE_QUARK | ( | fl_binary_messenger_codec_error_quark | , |
fl_binary_messenger_codec_error | |||
) |
G_DEFINE_TYPE | ( | FlBinaryMessengerResponseHandle | , |
fl_binary_messenger_response_handle | , | ||
G_TYPE_OBJECT | |||
) |
Definition at line 61 of file fl_binary_messenger.cc.
G_DEFINE_TYPE | ( | FlBinaryMessengerResponseHandleImpl | , |
fl_binary_messenger_response_handle_impl | , | ||
fl_binary_messenger_response_handle_get_type() | |||
) |
Definition at line 79 of file fl_binary_messenger.cc.
G_DEFINE_TYPE_WITH_CODE | ( | FlBinaryMessengerImpl | , |
fl_binary_messenger_impl | , | ||
G_TYPE_OBJECT | , | ||
G_IMPLEMENT_INTERFACE(fl_binary_messenger_get_type(), fl_binary_messenger_impl_iface_init) | |||
) |
Definition at line 51 of file fl_binary_messenger.cc.
|
static |
Definition at line 144 of file fl_binary_messenger.cc.
|
static |
Definition at line 132 of file fl_binary_messenger.cc.
|
static |
Definition at line 279 of file fl_binary_messenger.cc.
|
static |
Definition at line 347 of file fl_binary_messenger.cc.
|
static |
Definition at line 338 of file fl_binary_messenger.cc.
|
static |
Definition at line 286 of file fl_binary_messenger.cc.
|
static |
Definition at line 306 of file fl_binary_messenger.cc.
|
static |
Definition at line 241 of file fl_binary_messenger.cc.
|
static |
Definition at line 204 of file fl_binary_messenger.cc.
|
static |
Definition at line 372 of file fl_binary_messenger.cc.
|
static |
Definition at line 363 of file fl_binary_messenger.cc.
BINARY_MESSENGER_IMPL |
Definition at line 28 of file fl_binary_messenger.cc.
FL |
Definition at line 27 of file fl_binary_messenger.cc.
fl_binary_messenger_impl |
Definition at line 26 of file fl_binary_messenger.cc.
|
staticconstexpr |
Definition at line 18 of file fl_binary_messenger.cc.
|
staticconstexpr |
Definition at line 20 of file fl_binary_messenger.cc.
|
staticconstexpr |
Definition at line 19 of file fl_binary_messenger.cc.