#include "flutter/shell/platform/linux/public/flutter_linux/fl_basic_message_channel.h"
#include <gmodule.h>
Go to the source code of this file.
Classes | |
struct | _FlBasicMessageChannel |
struct | _FlBasicMessageChannelResponseHandle |
Functions | |
G_DEFINE_TYPE (FlBasicMessageChannelResponseHandle, fl_basic_message_channel_response_handle, G_TYPE_OBJECT) static void fl_basic_message_channel_response_handle_dispose(GObject *object) | |
static void | fl_basic_message_channel_response_handle_class_init (FlBasicMessageChannelResponseHandleClass *klass) |
static void | fl_basic_message_channel_response_handle_init (FlBasicMessageChannelResponseHandle *self) |
static FlBasicMessageChannelResponseHandle * | fl_basic_message_channel_response_handle_new (FlBinaryMessengerResponseHandle *response_handle) |
static void | message_cb (FlBinaryMessenger *messenger, const gchar *channel, GBytes *message, FlBinaryMessengerResponseHandle *response_handle, gpointer user_data) |
static void | message_response_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
static void | channel_closed_cb (gpointer user_data) |
static void | fl_basic_message_channel_dispose (GObject *object) |
static void | fl_basic_message_channel_class_init (FlBasicMessageChannelClass *klass) |
static void | fl_basic_message_channel_init (FlBasicMessageChannel *self) |
G_MODULE_EXPORT FlBasicMessageChannel * | fl_basic_message_channel_new (FlBinaryMessenger *messenger, const gchar *name, FlMessageCodec *codec) |
G_MODULE_EXPORT void | fl_basic_message_channel_set_message_handler (FlBasicMessageChannel *self, FlBasicMessageChannelMessageHandler handler, gpointer user_data, GDestroyNotify destroy_notify) |
G_MODULE_EXPORT gboolean | fl_basic_message_channel_respond (FlBasicMessageChannel *self, FlBasicMessageChannelResponseHandle *response_handle, FlValue *message, GError **error) |
G_MODULE_EXPORT void | fl_basic_message_channel_send (FlBasicMessageChannel *self, FlValue *message, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) |
G_MODULE_EXPORT FlValue * | fl_basic_message_channel_send_finish (FlBasicMessageChannel *self, GAsyncResult *result, GError **error) |
|
static |
Definition at line 111 of file fl_basic_message_channel.cc.
References TRUE, and user_data.
Referenced by fl_basic_message_channel_new().
|
static |
Definition at line 147 of file fl_basic_message_channel.cc.
References fl_basic_message_channel_dispose().
|
static |
Definition at line 125 of file fl_basic_message_channel.cc.
References fl_binary_messenger_set_message_handler_on_channel().
Referenced by fl_basic_message_channel_class_init().
|
static |
Definition at line 152 of file fl_basic_message_channel.cc.
G_MODULE_EXPORT FlBasicMessageChannel* fl_basic_message_channel_new | ( | FlBinaryMessenger * | messenger, |
const gchar * | name, | ||
FlMessageCodec * | codec | ||
) |
Definition at line 154 of file fl_basic_message_channel.cc.
References channel_closed_cb(), fl_binary_messenger_set_message_handler_on_channel(), and message_cb().
Referenced by fl_key_channel_responder_new(), fl_settings_handler_new(), and TEST().
G_MODULE_EXPORT gboolean fl_basic_message_channel_respond | ( | FlBasicMessageChannel * | channel, |
FlBasicMessageChannelResponseHandle * | response_handle, | ||
FlValue * | message, | ||
GError ** | error | ||
) |
fl_basic_message_channel_respond: @channel: an #FlBasicMessageChannel. @response_handle: handle that was provided in a FlBasicMessageChannelMessageHandler. @message: (allow-none): message 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 message.
Returns: TRUE on success.
Definition at line 204 of file fl_basic_message_channel.cc.
References error, fl_binary_messenger_send_response(), fl_message_codec_encode_message(), and result.
Referenced by message_cb(), and response_cb().
|
static |
Definition at line 51 of file fl_basic_message_channel.cc.
|
static |
Definition at line 57 of file fl_basic_message_channel.cc.
|
static |
G_MODULE_EXPORT void fl_basic_message_channel_send | ( | FlBasicMessageChannel * | channel, |
FlValue * | message, | ||
GCancellable * | cancellable, | ||
GAsyncReadyCallback | callback, | ||
gpointer | user_data | ||
) |
fl_basic_message_channel_send: @channel: an #FlBasicMessageChannel. @message: (allow-none): message to send, must match what the #FlMessageCodec supports. @cancellable: (allow-none): a #GCancellable or NULL. @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when the request is satisfied or NULL to ignore the response. @user_data: (closure): user data to pass to @callback.
Asynchronously sends a message.
Definition at line 226 of file fl_basic_message_channel.cc.
References callback, error, fl_binary_messenger_send_on_channel(), fl_message_codec_encode_message(), message_response_cb(), and user_data.
Referenced by fl_key_channel_responder_handle_event(), TEST(), and update_settings().
G_MODULE_EXPORT FlValue* fl_basic_message_channel_send_finish | ( | FlBasicMessageChannel * | channel, |
GAsyncResult * | result, | ||
GError ** | error | ||
) |
fl_basic_message_channel_send_finish: @channel: an #FlBasicMessageChannel.
Completes request started with fl_basic_message_channel_send().
Returns: message response on success or NULL on error.
Definition at line 253 of file fl_basic_message_channel.cc.
References error, fl_binary_messenger_send_on_channel_finish(), fl_message_codec_decode_message(), and result.
Referenced by echo_response_cb(), failure_response_cb(), handle_response(), and null_message_response_cb().
G_MODULE_EXPORT void fl_basic_message_channel_set_message_handler | ( | FlBasicMessageChannel * | channel, |
FlBasicMessageChannelMessageHandler | handler, | ||
gpointer | user_data, | ||
GDestroyNotify | destroy_notify | ||
) |
fl_basic_message_channel_set_message_handler: @channel: an #FlBasicMessageChannel. @handler: (allow-none): function to call when a message is received on this channel or NULL to disable the 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 message is received from the Dart side of the channel. See FlBasicMessageChannelMessageHandler 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 176 of file fl_basic_message_channel.cc.
References user_data.
Referenced by TEST().
G_DEFINE_TYPE | ( | FlBasicMessageChannelResponseHandle | , |
fl_basic_message_channel_response_handle | , | ||
G_TYPE_OBJECT | |||
) |
Definition at line 37 of file fl_basic_message_channel.cc.
|
static |
Definition at line 74 of file fl_basic_message_channel.cc.
References error, fl_basic_message_channel_response_handle_new(), fl_binary_messenger_send_response(), fl_message_codec_decode_message(), and user_data.
Referenced by fl_basic_message_channel_new().
|
static |
Definition at line 103 of file fl_basic_message_channel.cc.
References result, and user_data.
Referenced by fl_basic_message_channel_send().