Flutter Engine
flutter_messenger.h File Reference
#include <stddef.h>
#include <stdint.h>
#include "flutter_export.h"

Go to the source code of this file.

Classes

struct  FlutterDesktopMessage
 

Typedefs

typedef struct FlutterDesktopMessengerFlutterDesktopMessengerRef
 
typedef struct _FlutterPlatformMessageResponseHandle FlutterDesktopMessageResponseHandle
 
typedef void(* FlutterDesktopBinaryReply) (const uint8_t *data, size_t data_size, void *user_data)
 
typedef void(* FlutterDesktopMessageCallback) (FlutterDesktopMessengerRef, const FlutterDesktopMessage *, void *)
 

Functions

FLUTTER_EXPORT bool FlutterDesktopMessengerSend (FlutterDesktopMessengerRef messenger, const char *channel, const uint8_t *message, const size_t message_size)
 
FLUTTER_EXPORT bool FlutterDesktopMessengerSendWithReply (FlutterDesktopMessengerRef messenger, const char *channel, const uint8_t *message, const size_t message_size, const FlutterDesktopBinaryReply reply, void *user_data)
 
FLUTTER_EXPORT void FlutterDesktopMessengerSendResponse (FlutterDesktopMessengerRef messenger, const FlutterDesktopMessageResponseHandle *handle, const uint8_t *data, size_t data_length)
 
FLUTTER_EXPORT void FlutterDesktopMessengerSetCallback (FlutterDesktopMessengerRef messenger, const char *channel, FlutterDesktopMessageCallback callback, void *user_data)
 

Typedef Documentation

◆ FlutterDesktopBinaryReply

typedef void(* FlutterDesktopBinaryReply) (const uint8_t *data, size_t data_size, void *user_data)

Definition at line 25 of file flutter_messenger.h.

◆ FlutterDesktopMessageCallback

typedef void(* FlutterDesktopMessageCallback) (FlutterDesktopMessengerRef, const FlutterDesktopMessage *, void *)

Definition at line 48 of file flutter_messenger.h.

◆ FlutterDesktopMessageResponseHandle

◆ FlutterDesktopMessengerRef

Definition at line 18 of file flutter_messenger.h.

Function Documentation

◆ FlutterDesktopMessengerSend()

FLUTTER_EXPORT bool FlutterDesktopMessengerSend ( FlutterDesktopMessengerRef  messenger,
const char *  channel,
const uint8_t *  message,
const size_t  message_size 
)

Definition at line 51 of file stub_flutter_api.cc.

References FlutterDesktopMessengerSendWithReply(), and flutter::testing::StubFlutterApi::MessengerSend().

Referenced by flutter::BinaryMessengerImpl::Send().

54  {
55  bool result = false;
57  result =
58  s_stub_implementation->MessengerSend(channel, message, message_size);
59  }
60  return result;
61 }
virtual bool MessengerSend(const char *channel, const uint8_t *message, const size_t message_size)
static flutter::testing::StubFlutterApi * s_stub_implementation

◆ FlutterDesktopMessengerSendResponse()

FLUTTER_EXPORT void FlutterDesktopMessengerSendResponse ( FlutterDesktopMessengerRef  messenger,
const FlutterDesktopMessageResponseHandle handle,
const uint8_t *  data,
size_t  data_length 
)

Definition at line 77 of file stub_flutter_api.cc.

References FlutterDesktopMessenger::engine, FlutterEngineSendPlatformMessageResponse(), and flutter::testing::StubFlutterApi::MessengerSendResponse().

Referenced by flutter::IncomingMessageDispatcher::HandleMessage().

81  {
83  s_stub_implementation->MessengerSendResponse(handle, data, data_length);
84  }
85 }
static flutter::testing::StubFlutterApi * s_stub_implementation
virtual void MessengerSendResponse(const FlutterDesktopMessageResponseHandle *handle, const uint8_t *data, size_t data_length)

◆ FlutterDesktopMessengerSendWithReply()

FLUTTER_EXPORT bool FlutterDesktopMessengerSendWithReply ( FlutterDesktopMessengerRef  messenger,
const char *  channel,
const uint8_t *  message,
const size_t  message_size,
const FlutterDesktopBinaryReply  reply,
void *  user_data 
)

Definition at line 63 of file stub_flutter_api.cc.

References FlutterDesktopMessenger::engine, FlutterEngineSendPlatformMessage(), FlutterPlatformMessageCreateResponseHandle(), FlutterPlatformMessageReleaseResponseHandle(), kSuccess, flutter::testing::StubFlutterApi::MessengerSendWithReply(), and user_data.

Referenced by FlutterDesktopMessengerSend(), and flutter::BinaryMessengerImpl::Send().

68  {
69  bool result = false;
72  channel, message, message_size, reply, user_data);
73  }
74  return result;
75 }
virtual bool MessengerSendWithReply(const char *channel, const uint8_t *message, const size_t message_size, const FlutterDesktopBinaryReply reply, void *user_data)
G_BEGIN_DECLS FlMethodCall gpointer user_data
static flutter::testing::StubFlutterApi * s_stub_implementation

◆ FlutterDesktopMessengerSetCallback()

FLUTTER_EXPORT void FlutterDesktopMessengerSetCallback ( FlutterDesktopMessengerRef  messenger,
const char *  channel,
FlutterDesktopMessageCallback  callback,
void *  user_data 
)

Definition at line 87 of file stub_flutter_api.cc.

References FlutterDesktopMessenger::engine, FlutterDesktopEngineState::message_dispatcher, and flutter::testing::StubFlutterApi::MessengerSetCallback().

Referenced by flutter::BinaryMessengerImpl::SetMessageHandler().

90  {
93  }
94 }
G_BEGIN_DECLS FlMethodCall gpointer user_data
static flutter::testing::StubFlutterApi * s_stub_implementation
virtual void MessengerSetCallback(const char *channel, FlutterDesktopMessageCallback callback, void *user_data)