| Flutter Linux Embedder |

fl_windowing_channel.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_SHELL_PLATFORM_LINUX_FL_WINDOWING_CHANNEL_H_
6 #define FLUTTER_SHELL_PLATFORM_LINUX_FL_WINDOWING_CHANNEL_H_
7
8 #include "flutter/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h"
9 #include "flutter/shell/platform/linux/public/flutter_linux/fl_method_response.h"
10
11 G_BEGIN_DECLS
12
13 G_DECLARE_FINAL_TYPE(FlWindowingChannel,
14 fl_windowing_channel,
15 FL,
16 WINDOWING_CHANNEL,
17 GObject);
18
19 // States that a window can be in.
20 typedef enum {
21 FL_WINDOW_STATE_UNDEFINED,
22 FL_WINDOW_STATE_RESTORED,
23 FL_WINDOW_STATE_MAXIMIZED,
24 FL_WINDOW_STATE_MINIMIZED
25 } FlWindowState;
26
27 // Size dimensions used in windowing channel.
28 typedef struct {
29 double width;
30 double height;
31 } FlWindowingSize;
32
33 /**
34 * FlWindowingChannel:
35 *
36 * #FlWindowingChannel is a channel that implements the shell side
37 * of SystemChannels.windowing from the Flutter services library.
38 */
39
40 typedef struct {
41 FlMethodResponse* (*create_regular)(FlWindowingSize* size,
42 FlWindowingSize* min_size,
43 FlWindowingSize* max_size,
44 const gchar* title,
45 FlWindowState state,
46 gpointer user_data);
47 FlMethodResponse* (*modify_regular)(int64_t view_id,
48 FlWindowingSize* size,
49 const gchar* title,
50 FlWindowState state,
51 gpointer user_data);
52 FlMethodResponse* (*destroy_window)(int64_t view_id, gpointer user_data);
53 } FlWindowingChannelVTable;
54
55 /**
56 * fl_windowing_channel_new:
57 * @messenger: an #FlBinaryMessenger
58 * @vtable: callbacks for incoming method calls.
59 * @user_data: data to pass in callbacks.
60 *
61 * Creates a new channel that sends handled windowing requests from the
62 * platform.
63 *
64 * Returns: a new #FlWindowingChannel
65 */
66 FlWindowingChannel* fl_windowing_channel_new(FlBinaryMessenger* messenger,
67 FlWindowingChannelVTable* vtable,
68 gpointer user_data);
69
70 FlMethodResponse* fl_windowing_channel_make_create_regular_response(
71 int64_t view_id,
72 FlWindowingSize* size,
73 FlWindowState state);
74
75 FlMethodResponse* fl_windowing_channel_make_modify_regular_response();
76
77 FlMethodResponse* fl_windowing_channel_make_destroy_window_response();
78
79 G_END_DECLS
80
81 #endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_WINDOWING_CHANNEL_H_
FL
FL
Definition: fl_binary_messenger.cc:27
fl_binary_messenger.h
user_data
G_BEGIN_DECLS G_MODULE_EXPORT FlValue gpointer user_data
Definition: fl_event_channel.h:90
fl_method_response.h
view_id
G_BEGIN_DECLS FlutterViewId view_id
Definition: fl_view_accessible.h:49
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
fl_windowing_channel_make_modify_regular_response
FlMethodResponse * fl_windowing_channel_make_modify_regular_response()
Definition: fl_windowing_channel.cc:290
fl_windowing_channel_make_create_regular_response
FlMethodResponse * fl_windowing_channel_make_create_regular_response(int64_t view_id, FlWindowingSize *size, FlWindowState state)
Definition: fl_windowing_channel.cc:275
fl_windowing_channel_new
FlWindowingChannel * fl_windowing_channel_new(FlBinaryMessenger *messenger, FlWindowingChannelVTable *vtable, gpointer user_data)
Definition: fl_windowing_channel.cc:257
G_DECLARE_FINAL_TYPE
G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(FlWindowingChannel, fl_windowing_channel, FL, WINDOWING_CHANNEL, GObject)
fl_windowing_channel_make_destroy_window_response
FlMethodResponse * fl_windowing_channel_make_destroy_window_response()
Definition: fl_windowing_channel.cc:294
FlWindowingChannelVTable
Definition: fl_windowing_channel.h:40
FlWindowingSize
Definition: fl_windowing_channel.h:28
FlWindowingSize::height
double height
Definition: fl_windowing_channel.h:30
FlWindowingSize::width
double width
Definition: fl_windowing_channel.h:29