| Flutter Linux Embedder |

Classes | Enumerations | Functions
fl_windowing_channel.h File Reference
`#include "flutter/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h"`
`#include "flutter/shell/platform/linux/public/flutter_linux/fl_method_response.h"`

Go to the source code of this file.

## Classes
struct | FlWindowingSize
struct | FlWindowingChannelVTable

## Enumerations
enum | FlWindowState { FL_WINDOW_STATE_UNDEFINED , FL_WINDOW_STATE_RESTORED , FL_WINDOW_STATE_MAXIMIZED , FL_WINDOW_STATE_MINIMIZED }

## Functions
G_BEGIN_DECLS | G_DECLARE_FINAL_TYPE (FlWindowingChannel, fl_windowing_channel, FL, WINDOWING_CHANNEL, GObject)
FlWindowingChannel * | fl_windowing_channel_new (FlBinaryMessenger *messenger, FlWindowingChannelVTable *vtable, gpointer user_data)
FlMethodResponse * | fl_windowing_channel_make_create_regular_response (int64_t view_id, FlWindowingSize *size, FlWindowState state)
FlMethodResponse * | fl_windowing_channel_make_modify_regular_response ()
FlMethodResponse * | fl_windowing_channel_make_destroy_window_response ()

## Enumeration Type Documentation

## ◆ FlWindowState

enum FlWindowState

Enumerator
FL_WINDOW_STATE_UNDEFINED |
FL_WINDOW_STATE_RESTORED |
FL_WINDOW_STATE_MAXIMIZED |
FL_WINDOW_STATE_MINIMIZED |

Definition at line 20 of file fl_windowing_channel.h.

20 {
21 FL_WINDOW_STATE_UNDEFINED,
22 FL_WINDOW_STATE_RESTORED,
23 FL_WINDOW_STATE_MAXIMIZED,
24 FL_WINDOW_STATE_MINIMIZED
25 } FlWindowState;
FlWindowState
FlWindowState
Definition: fl_windowing_channel.h:20
FL_WINDOW_STATE_UNDEFINED
@ FL_WINDOW_STATE_UNDEFINED
Definition: fl_windowing_channel.h:21
FL_WINDOW_STATE_MINIMIZED
@ FL_WINDOW_STATE_MINIMIZED
Definition: fl_windowing_channel.h:24
FL_WINDOW_STATE_MAXIMIZED
@ FL_WINDOW_STATE_MAXIMIZED
Definition: fl_windowing_channel.h:23
FL_WINDOW_STATE_RESTORED
@ FL_WINDOW_STATE_RESTORED
Definition: fl_windowing_channel.h:22

## Function Documentation

## ◆ fl_windowing_channel_make_create_regular_response()

FlMethodResponse* fl_windowing_channel_make_create_regular_response | ( | int64_t | view_id,
|  | FlWindowingSize * | size,
|  | FlWindowState | state
| ) |  |

Definition at line 275 of file fl_windowing_channel.cc.

278 {
279 g_autoptr(FlValue) result = fl_value_new_map();
280 fl_value_set_string_take(result, kViewIdKey, fl_value_new_int(view_id));
281 g_autoptr(FlValue) size_value = fl_value_new_list();
282 fl_value_append_take(size_value, fl_value_new_float(size->width));
283 fl_value_append_take(size_value, fl_value_new_float(size->height));
284 fl_value_set_string(result, kSizeKey, size_value);
285 fl_value_set_string_take(result, kStateKey,
286 fl_value_new_string(window_state_to_string(state)));
287 return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
288 }
g_autoptr
g_autoptr(GMutexLocker) locker
fl_method_success_response_new
G_MODULE_EXPORT FlMethodSuccessResponse * fl_method_success_response_new(FlValue *result)
Definition: fl_method_response.cc:126
fl_value_set_string
G_MODULE_EXPORT void fl_value_set_string(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:639
fl_value_new_float
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
Definition: fl_value.cc:269
fl_value_set_string_take
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:650
fl_value_new_string
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:276
fl_value_new_list
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:349
fl_value_append_take
G_MODULE_EXPORT void fl_value_append_take(FlValue *self, FlValue *value)
Definition: fl_value.cc:600
fl_value_new_int
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:262
fl_value_new_map
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:366
FlValue
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:42
view_id
G_BEGIN_DECLS FlutterViewId view_id
Definition: fl_view_accessible.h:49
kStateKey
static constexpr char kStateKey[]
Definition: fl_windowing_channel.cc:21
kViewIdKey
static constexpr char kViewIdKey[]
Definition: fl_windowing_channel.cc:22
kSizeKey
static constexpr char kSizeKey[]
Definition: fl_windowing_channel.cc:17
window_state_to_string
static const gchar * window_state_to_string(FlWindowState state)
Definition: fl_windowing_channel.cc:77
FlWindowingSize::height
double height
Definition: fl_windowing_channel.h:30
FlWindowingSize::width
double width
Definition: fl_windowing_channel.h:29

References fl_method_success_response_new(), fl_value_append_take(), fl_value_new_float(), fl_value_new_int(), fl_value_new_list(), fl_value_new_map(), fl_value_new_string(), fl_value_set_string(), fl_value_set_string_take(), g_autoptr(), FlWindowingSize::height, kSizeKey, kStateKey, kViewIdKey, view_id, FlWindowingSize::width, and window_state_to_string().

Referenced by create_regular().

## ◆ fl_windowing_channel_make_destroy_window_response()

FlMethodResponse* fl_windowing_channel_make_destroy_window_response | ( |  | ) |

Definition at line 294 of file fl_windowing_channel.cc.

294 {
295 return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
296 }

References fl_method_success_response_new().

Referenced by destroy_window().

## ◆ fl_windowing_channel_make_modify_regular_response()

FlMethodResponse* fl_windowing_channel_make_modify_regular_response | ( |  | ) |

Definition at line 290 of file fl_windowing_channel.cc.

290 {
291 return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
292 }

References fl_method_success_response_new().

Referenced by modify_regular().

## ◆ fl_windowing_channel_new()

FlWindowingChannel* fl_windowing_channel_new | ( | FlBinaryMessenger * | messenger,
|  | FlWindowingChannelVTable * | vtable,
|  | gpointer | user_data
| ) |  |

fl_windowing_channel_new: @messenger: an #FlBinaryMessenger @vtable: callbacks for incoming method calls. @user_data: data to pass in callbacks.

Creates a new channel that sends handled windowing requests from the platform.

Returns: a new #FlWindowingChannel

Definition at line 257 of file fl_windowing_channel.cc.

259 {
260 FlWindowingChannel* self = FL_WINDOWING_CHANNEL(
261 g_object_new(fl_windowing_channel_get_type(), nullptr));
262
263 self->vtable = vtable;
264 self->user_data = user_data;
265
266 g_autoptr(FlStandardMethodCodec) codec = fl_standard_method_codec_new();
267 self->channel =
268 fl_method_channel_new(messenger, kChannelName, FL_METHOD_CODEC(codec));
269 fl_method_channel_set_method_call_handler(self->channel, method_call_cb, self,
270 nullptr);
271
272 return self;
273 }
self
g_cond_signal & self
Definition: fl_compositor_software.cc:67
user_data
G_BEGIN_DECLS G_MODULE_EXPORT FlValue gpointer user_data
Definition: fl_event_channel.h:90
fl_method_channel_new
G_MODULE_EXPORT FlMethodChannel * fl_method_channel_new(FlBinaryMessenger *messenger, const gchar *name, FlMethodCodec *codec)
Definition: fl_method_channel.cc:112
fl_method_channel_set_method_call_handler
G_MODULE_EXPORT void fl_method_channel_set_method_call_handler(FlMethodChannel *self, FlMethodChannelMethodCallHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
Definition: fl_method_channel.cc:134
fl_standard_method_codec_new
G_MODULE_EXPORT FlStandardMethodCodec * fl_standard_method_codec_new()
Definition: fl_standard_method_codec.cc:291
method_call_cb
static void method_call_cb(FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data)
Definition: fl_windowing_channel.cc:216
kChannelName
static constexpr char kChannelName[]
Definition: fl_windowing_channel.cc:10

References fl_method_channel_new(), fl_method_channel_set_method_call_handler(), fl_standard_method_codec_new(), g_autoptr(), kChannelName, method_call_cb(), self, and user_data.

Referenced by fl_windowing_handler_new().

## ◆ G_DECLARE_FINAL_TYPE()

G_BEGIN_DECLS G_DECLARE_FINAL_TYPE | ( | FlWindowingChannel | ,
|  | fl_windowing_channel | ,
|  | FL | ,
|  | WINDOWING_CHANNEL | ,
|  | GObject |
| ) |  |