| Flutter macOS Embedder |

FlutterWindowController.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_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERWINDOWCONTROLLER_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERWINDOWCONTROLLER_H_
7
8 #import <Cocoa/Cocoa.h>
9
10 #import "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
11 #import "flutter/shell/platform/darwin/macos/framework/Headers/FlutterViewController.h"
12
13 @class FlutterEngine;
14
15 @interface FlutterWindowController : NSObject
16
17 @property(nonatomic, weak) FlutterEngine* engine;
18
19 @end
20
21 @interface FlutterWindowController (Testing)
22
23 - (void)closeAllWindows;
24
25 @end
26
27 struct FlutterWindowSize {
28 double width;
29 double height;
30 };
31
32 struct FlutterWindowConstraints {
33 double min_width;
34 double min_height;
35 double max_width;
36 double max_height;
37 };
38
39 struct FlutterWindowCreationRequest {
40 bool has_size;
41 struct FlutterWindowSize size;
42 bool has_constraints;
43 struct FlutterWindowConstraints constraints;
44 void (*on_close)();
45 void (*notify_listeners)();
46 };
47
48 extern "C" {
49
50 // NOLINTBEGIN(google-objc-function-naming)
51
52 FLUTTER_DARWIN_EXPORT
53 int64_t InternalFlutter_WindowController_CreateRegularWindow(
54 int64_t engine_id,
55 const FlutterWindowCreationRequest* request);
56
57 FLUTTER_DARWIN_EXPORT
58 void InternalFlutter_Window_Destroy(int64_t engine_id, void* window);
59
60 FLUTTER_DARWIN_EXPORT
61 void* InternalFlutter_Window_GetHandle(int64_t engine_id, FlutterViewIdentifier view_id);
62
63 FLUTTER_DARWIN_EXPORT
64 FlutterWindowSize InternalFlutter_Window_GetContentSize(void* window);
65
66 FLUTTER_DARWIN_EXPORT
67 void InternalFlutter_Window_SetContentSize(void* window, const FlutterWindowSize* size);
68
69 FLUTTER_DARWIN_EXPORT
70 void InternalFlutter_Window_SetConstraints(void* window,
71 const FlutterWindowConstraints* constraints);
72
73 FLUTTER_DARWIN_EXPORT
74 void InternalFlutter_Window_SetTitle(void* window, const char* title);
75
76 FLUTTER_DARWIN_EXPORT
77 void InternalFlutter_Window_SetMaximized(void* window, bool maximized);
78
79 FLUTTER_DARWIN_EXPORT
80 bool InternalFlutter_Window_IsMaximized(void* window);
81
82 FLUTTER_DARWIN_EXPORT
83 void InternalFlutter_Window_Minimize(void* window);
84
85 FLUTTER_DARWIN_EXPORT
86 void InternalFlutter_Window_Unminimize(void* window);
87
88 FLUTTER_DARWIN_EXPORT
89 bool InternalFlutter_Window_IsMinimized(void* window);
90
91 FLUTTER_DARWIN_EXPORT
92 void InternalFlutter_Window_SetFullScreen(void* window, bool fullScreen);
93
94 FLUTTER_DARWIN_EXPORT
95 bool InternalFlutter_Window_IsFullScreen(void* window);
96
97 FLUTTER_DARWIN_EXPORT
98 void InternalFlutter_Window_Activate(void* window);
99
100 FLUTTER_DARWIN_EXPORT
101 char* InternalFlutter_Window_GetTitle(void* window);
102
103 FLUTTER_DARWIN_EXPORT
104 bool InternalFlutter_Window_IsActivated(void* window);
105
106 // NOLINTEND(google-objc-function-naming)
107 }
108
109 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERWINDOWCONTROLLER_H_
FlutterMacros.h
FLUTTER_DARWIN_EXPORT
#define FLUTTER_DARWIN_EXPORT
Definition: FlutterMacros.h:14
FlutterViewController.h
FlutterViewIdentifier
int64_t FlutterViewIdentifier
Definition: FlutterViewController.h:21
InternalFlutter_WindowController_CreateRegularWindow
FLUTTER_DARWIN_EXPORT int64_t InternalFlutter_WindowController_CreateRegularWindow(int64_t engine_id, const FlutterWindowCreationRequest *request)
Definition: FlutterWindowController.mm:205
InternalFlutter_Window_GetContentSize
FLUTTER_DARWIN_EXPORT FlutterWindowSize InternalFlutter_Window_GetContentSize(void *window)
Definition: FlutterWindowController.mm:225
InternalFlutter_Window_SetMaximized
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetMaximized(void *window, bool maximized)
Definition: FlutterWindowController.mm:251
InternalFlutter_Window_SetConstraints
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetConstraints(void *window, const FlutterWindowConstraints *constraints)
Definition: FlutterWindowController.mm:240
InternalFlutter_Window_Destroy
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Destroy(int64_t engine_id, void *window)
Definition: FlutterWindowController.mm:213
InternalFlutter_Window_Unminimize
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Unminimize(void *window)
Definition: FlutterWindowController.mm:270
InternalFlutter_Window_SetContentSize
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetContentSize(void *window, const FlutterWindowSize *size)
Definition: FlutterWindowController.mm:234
InternalFlutter_Window_SetFullScreen
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetFullScreen(void *window, bool fullScreen)
Definition: FlutterWindowController.mm:280
InternalFlutter_Window_IsMaximized
FLUTTER_DARWIN_EXPORT bool InternalFlutter_Window_IsMaximized(void *window)
Definition: FlutterWindowController.mm:260
InternalFlutter_Window_IsMinimized
FLUTTER_DARWIN_EXPORT bool InternalFlutter_Window_IsMinimized(void *window)
Definition: FlutterWindowController.mm:275
InternalFlutter_Window_GetTitle
FLUTTER_DARWIN_EXPORT char * InternalFlutter_Window_GetTitle(void *window)
Definition: FlutterWindowController.mm:301
InternalFlutter_Window_SetTitle
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetTitle(void *window, const char *title)
Definition: FlutterWindowController.mm:246
InternalFlutter_Window_Activate
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Activate(void *window)
Definition: FlutterWindowController.mm:295
InternalFlutter_Window_GetHandle
FLUTTER_DARWIN_EXPORT void * InternalFlutter_Window_GetHandle(int64_t engine_id, FlutterViewIdentifier view_id)
Definition: FlutterWindowController.mm:219
InternalFlutter_Window_IsFullScreen
FLUTTER_DARWIN_EXPORT bool InternalFlutter_Window_IsFullScreen(void *window)
Definition: FlutterWindowController.mm:290
InternalFlutter_Window_IsActivated
FLUTTER_DARWIN_EXPORT bool InternalFlutter_Window_IsActivated(void *window)
Definition: FlutterWindowController.mm:306
InternalFlutter_Window_Minimize
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Minimize(void *window)
Definition: FlutterWindowController.mm:265
FlutterWindowController(Testing)
Definition: FlutterWindowController.h:21
-[FlutterWindowController(Testing) closeAllWindows]
void closeAllWindows()
FlutterEngine
Definition: FlutterEngine.h:32
FlutterWindowController
Definition: FlutterWindowController.h:16
FlutterWindowController::engine
FlutterEngine * engine
Definition: FlutterWindowController.h:17
FlutterWindowConstraints
Definition: FlutterWindowController.h:32
FlutterWindowConstraints::max_width
double max_width
Definition: FlutterWindowController.h:35
FlutterWindowConstraints::min_height
double min_height
Definition: FlutterWindowController.h:34
FlutterWindowConstraints::max_height
double max_height
Definition: FlutterWindowController.h:36
FlutterWindowConstraints::min_width
double min_width
Definition: FlutterWindowController.h:33
FlutterWindowCreationRequest
Definition: FlutterWindowController.h:39
FlutterWindowCreationRequest::has_size
bool has_size
Definition: FlutterWindowController.h:40
FlutterWindowSize
Definition: FlutterWindowController.h:27
FlutterWindowSize::height
double height
Definition: FlutterWindowController.h:29
FlutterWindowSize::width
double width
Definition: FlutterWindowController.h:28