![]() |
Flutter Engine
The Flutter Engine
|
#include "flutter/shell/platform/linux/public/flutter_linux/fl_event_channel.h"
#include <gmodule.h>
#include "flutter/shell/platform/linux/fl_method_codec_private.h"
Go to the source code of this file.
Classes | |
struct | _FlEventChannel |
struct | _FlEventChannelResponseHandle |
Functions | |
static FlMethodErrorResponse * | handle_method_call (FlEventChannel *self, const gchar *name, FlValue *args) |
static void | message_cb (FlBinaryMessenger *messenger, const gchar *channel, GBytes *message, FlBinaryMessengerResponseHandle *response_handle, gpointer user_data) |
static void | remove_handlers (FlEventChannel *self) |
static void | channel_closed_cb (gpointer user_data) |
static void | fl_event_channel_dispose (GObject *object) |
static void | fl_event_channel_class_init (FlEventChannelClass *klass) |
static void | fl_event_channel_init (FlEventChannel *self) |
G_MODULE_EXPORT FlEventChannel * | fl_event_channel_new (FlBinaryMessenger *messenger, const gchar *name, FlMethodCodec *codec) |
G_MODULE_EXPORT void | fl_event_channel_set_stream_handlers (FlEventChannel *self, FlEventChannelHandler listen_handler, FlEventChannelHandler cancel_handler, gpointer user_data, GDestroyNotify destroy_notify) |
G_MODULE_EXPORT gboolean | fl_event_channel_send (FlEventChannel *self, FlValue *event, GCancellable *cancellable, GError **error) |
G_MODULE_EXPORT gboolean | fl_event_channel_send_error (FlEventChannel *self, const gchar *code, const gchar *message, FlValue *details, GCancellable *cancellable, GError **error) |
G_MODULE_EXPORT gboolean | fl_event_channel_send_end_of_stream (FlEventChannel *self, GCancellable *cancellable, GError **error) |
Variables | |
static constexpr char | kListenMethod [] = "listen" |
static constexpr char | kCancelMethod [] = "cancel" |
static constexpr char | kEventRequestError [] = "error" |
|
static |
Definition at line 130 of file fl_event_channel.cc.
|
static |
Definition at line 153 of file fl_event_channel.cc.
|
static |
Definition at line 136 of file fl_event_channel.cc.
|
static |
Definition at line 157 of file fl_event_channel.cc.
G_MODULE_EXPORT FlEventChannel * fl_event_channel_new | ( | FlBinaryMessenger * | messenger, |
const gchar * | name, | ||
FlMethodCodec * | codec | ||
) |
Definition at line 159 of file fl_event_channel.cc.
G_MODULE_EXPORT gboolean fl_event_channel_send | ( | FlEventChannel * | channel, |
FlValue * | event, | ||
GCancellable * | cancellable, | ||
GError ** | error | ||
) |
fl_event_channel_send: @channel: an #FlEventChannel. @event: event to send, must match what the #FlMethodCodec supports. @cancellable: (allow-none): a #GCancellable or NULL. @error: (allow-none): #GError location to store the error occurring, or NULL to ignore.
Sends an event on the channel. Events should only be sent once the channel is being listened to.
Returns: TRUE if successful.
Definition at line 196 of file fl_event_channel.cc.
G_MODULE_EXPORT gboolean fl_event_channel_send_end_of_stream | ( | FlEventChannel * | self, |
GCancellable * | cancellable, | ||
GError ** | error | ||
) |
Definition at line 237 of file fl_event_channel.cc.
G_MODULE_EXPORT gboolean fl_event_channel_send_error | ( | FlEventChannel * | self, |
const gchar * | code, | ||
const gchar * | message, | ||
FlValue * | details, | ||
GCancellable * | cancellable, | ||
GError ** | error | ||
) |
Definition at line 215 of file fl_event_channel.cc.
G_MODULE_EXPORT void fl_event_channel_set_stream_handlers | ( | FlEventChannel * | channel, |
FlEventChannelHandler | listen_handler, | ||
FlEventChannelHandler | cancel_handler, | ||
gpointer | user_data, | ||
GDestroyNotify | destroy_notify | ||
) |
fl_event_channel_set_stream_handlers: @channel: an #FlEventChannel. @listen_handler: (allow-none): function to call when the Dart side of the channel starts listening to the stream. @cancel_handler: (allow-none): function to call when the Dart side of the channel cancels their subscription to the stream. @user_data: (closure): user data to pass to @listen_handler and @cancel_handler. @destroy_notify: (allow-none): a function which gets called to free @user_data, or NULL.
Sets the functions called when the Dart side requests the stream to start and finish.
The handlers are removed if the channel is closed or is replaced by another handler, set @destroy_notify if you want to detect this.
Definition at line 181 of file fl_event_channel.cc.
|
static |
Definition at line 46 of file fl_event_channel.cc.
|
static |
Definition at line 69 of file fl_event_channel.cc.
|
static |
Definition at line 119 of file fl_event_channel.cc.
|
staticconstexpr |
Definition at line 12 of file fl_event_channel.cc.
|
staticconstexpr |
Definition at line 13 of file fl_event_channel.cc.
|
staticconstexpr |
Definition at line 11 of file fl_event_channel.cc.