Go to the source code of this file.
Classes | |
struct | _FlBinaryMessengerInterface |
struct | _FlBinaryMessengerResponseHandleClass |
Macros | |
#define | FL_BINARY_MESSENGER_ERROR fl_binary_messenger_codec_error_quark() |
Enumerations | |
enum | FlBinaryMessengerError { FL_BINARY_MESSENGER_ERROR_ALREADY_RESPONDED } |
Functions | |
G_MODULE_EXPORT GQuark | fl_binary_messenger_codec_error_quark (void) G_GNUC_CONST |
G_MODULE_EXPORT | G_DECLARE_INTERFACE (FlBinaryMessenger, fl_binary_messenger, FL, BINARY_MESSENGER, GObject) G_MODULE_EXPORT G_DECLARE_DERIVABLE_TYPE(FlBinaryMessengerResponseHandle |
void | fl_binary_messenger_set_message_handler_on_channel (FlBinaryMessenger *messenger, const gchar *channel, FlBinaryMessengerMessageHandler handler, gpointer user_data, GDestroyNotify destroy_notify) |
gboolean | fl_binary_messenger_send_response (FlBinaryMessenger *messenger, FlBinaryMessengerResponseHandle *response_handle, GBytes *response, GError **error) |
void | fl_binary_messenger_send_on_channel (FlBinaryMessenger *messenger, const gchar *channel, GBytes *message, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) |
GBytes * | fl_binary_messenger_send_on_channel_finish (FlBinaryMessenger *messenger, GAsyncResult *result, GError **error) |
void | fl_binary_messenger_resize_channel (FlBinaryMessenger *messenger, const gchar *channel, int64_t new_size) |
void | fl_binary_messenger_set_warns_on_channel_overflow (FlBinaryMessenger *messenger, const gchar *channel, bool warns) |
Variables | |
G_MODULE_EXPORT GObject typedef void(* | FlBinaryMessengerMessageHandler )(FlBinaryMessenger *messenger, const gchar *channel, GBytes *message, FlBinaryMessengerResponseHandle *response_handle, gpointer user_data) |
G_MODULE_EXPORT | fl_binary_messenger_response_handle |
G_MODULE_EXPORT | FL |
G_MODULE_EXPORT | BINARY_MESSENGER_RESPONSE_HANDLE |
#define FL_BINARY_MESSENGER_ERROR fl_binary_messenger_codec_error_quark() |
FlBinaryMessengerError: @FL_BINARY_MESSENGER_ERROR_ALREADY_RESPONDED: unable to send response, this message has already been responded to.
Errors for #FlBinaryMessenger objects to set on failures.
Definition at line 27 of file fl_binary_messenger.h.
Enumerator | |
---|---|
FL_BINARY_MESSENGER_ERROR_ALREADY_RESPONDED |
Definition at line 29 of file fl_binary_messenger.h.
G_MODULE_EXPORT GQuark fl_binary_messenger_codec_error_quark | ( | void | ) |
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 467 of file fl_binary_messenger.cc.
Referenced by TEST().
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 443 of file fl_binary_messenger.cc.
References callback, and user_data.
Referenced by fl_basic_message_channel_send(), fl_event_channel_send(), fl_event_channel_send_end_of_stream(), fl_event_channel_send_error(), fl_method_channel_invoke_method(), resize_channel(), set_app_lifecycle_state(), set_warns_on_channel_overflow(), and TEST().
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 457 of file fl_binary_messenger.cc.
Referenced by echo_response_cb(), failure_response_cb(), fake_response_cb(), finish_method(), fl_basic_message_channel_send_finish(), fl_method_channel_invoke_method_finish(), and nullptr_response_cb().
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 430 of file fl_binary_messenger.cc.
References error.
Referenced by cancel_exception_response_cb(), fake_message_cb(), fl_basic_message_channel_respond(), fl_method_channel_respond(), fl_test_application_activate(), listen_exception_response_cb(), message_cb(), method_call_error_response_cb(), method_call_not_implemented_response_cb(), method_call_success_response_cb(), response_cb(), response_from_thread_main(), send_events_events_cb(), and TEST().
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 416 of file fl_binary_messenger.cc.
References user_data.
Referenced by fl_basic_message_channel_dispose(), fl_basic_message_channel_new(), fl_event_channel_dispose(), fl_event_channel_new(), fl_method_channel_new(), and TEST().
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 476 of file fl_binary_messenger.cc.
Referenced by TEST().
G_MODULE_EXPORT G_DECLARE_INTERFACE | ( | FlBinaryMessenger | , |
fl_binary_messenger | , | ||
FL | , | ||
BINARY_MESSENGER | , | ||
GObject | |||
) |
G_MODULE_EXPORT BINARY_MESSENGER_RESPONSE_HANDLE |
Definition at line 49 of file fl_binary_messenger.h.
G_MODULE_EXPORT FL |
Definition at line 48 of file fl_binary_messenger.h.
G_MODULE_EXPORT fl_binary_messenger_response_handle |
Definition at line 47 of file fl_binary_messenger.h.
G_MODULE_EXPORT GObject typedef void(* FlBinaryMessengerMessageHandler) (FlBinaryMessenger *messenger, const gchar *channel, GBytes *message, FlBinaryMessengerResponseHandle *response_handle, gpointer user_data) |
FlBinaryMessengerMessageHandler: @messenger: an #FlBinaryMessenger. @channel: channel message received on. @message: message content received from Dart. @response_handle: a handle to respond to the message with. @user_data: (closure): data provided when registering this handler.
Function called when platform messages are received. Call fl_binary_messenger_send_response() to respond to this message. If the response is not occurring in this callback take a reference to @response_handle and release that once it has been responded to. Failing to respond before the last reference to @response_handle is dropped is a programming error.
Definition at line 67 of file fl_binary_messenger.h.
Referenced by G_DECLARE_FINAL_TYPE().