| 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 FlutterWindowSizing {
28 bool has_size;
29 double width;
30 double height;
31 bool has_constraints;
32 double min_width;
33 double min_height;
34 double max_width;
35 double max_height;
36 };
37
38 struct FlutterWindowCreationRequest {
39 FlutterWindowSizing contentSize;
40 void (*on_close)();
41 void (*on_size_change)();
42 };
43
44 struct FlutterWindowSize {
45 double width;
46 double height;
47 };
48
49 extern "C" {
50
51 // NOLINTBEGIN(google-objc-function-naming)
52
53 FLUTTER_DARWIN_EXPORT
54 int64_t InternalFlutter_WindowController_CreateRegularWindow(
55 int64_t engine_id,
56 const FlutterWindowCreationRequest* request);
57
58 FLUTTER_DARWIN_EXPORT
59 void InternalFlutter_Window_Destroy(int64_t engine_id, void* window);
60
61 FLUTTER_DARWIN_EXPORT
62 void* InternalFlutter_Window_GetHandle(int64_t engine_id, FlutterViewIdentifier view_id);
63
64 FLUTTER_DARWIN_EXPORT
65 FlutterWindowSize InternalFlutter_Window_GetContentSize(void* window);
66
67 FLUTTER_DARWIN_EXPORT
68 void InternalFlutter_Window_SetContentSize(void* window, const FlutterWindowSizing* size);
69
70 FLUTTER_DARWIN_EXPORT
71 void InternalFlutter_Window_SetTitle(void* window, const char* title);
72
73 FLUTTER_DARWIN_EXPORT
74 void InternalFlutter_Window_SetMaximized(void* window, bool maximized);
75
76 FLUTTER_DARWIN_EXPORT
77 bool InternalFlutter_Window_IsMaximized(void* window);
78
79 FLUTTER_DARWIN_EXPORT
80 void InternalFlutter_Window_Minimize(void* window);
81
82 FLUTTER_DARWIN_EXPORT
83 void InternalFlutter_Window_Unminimize(void* window);
84
85 FLUTTER_DARWIN_EXPORT
86 bool InternalFlutter_Window_IsMinimized(void* window);
87
88 FLUTTER_DARWIN_EXPORT
89 void InternalFlutter_Window_SetFullScreen(void* window, bool fullScreen);
90
91 FLUTTER_DARWIN_EXPORT
92 bool InternalFlutter_Window_IsFullScreen(void* window);
93
94 FLUTTER_DARWIN_EXPORT
95 void InternalFlutter_Window_Activate(void* window);
96
97 // NOLINTEND(google-objc-function-naming)
98 }
99
100 #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:181
InternalFlutter_Window_GetContentSize
FLUTTER_DARWIN_EXPORT FlutterWindowSize InternalFlutter_Window_GetContentSize(void *window)
Definition: FlutterWindowController.mm:201
InternalFlutter_Window_SetMaximized
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetMaximized(void *window, bool maximized)
Definition: FlutterWindowController.mm:219
InternalFlutter_Window_Destroy
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Destroy(int64_t engine_id, void *window)
Definition: FlutterWindowController.mm:189
InternalFlutter_Window_Unminimize
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Unminimize(void *window)
Definition: FlutterWindowController.mm:238
InternalFlutter_Window_SetFullScreen
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetFullScreen(void *window, bool fullScreen)
Definition: FlutterWindowController.mm:248
InternalFlutter_Window_IsMaximized
FLUTTER_DARWIN_EXPORT bool InternalFlutter_Window_IsMaximized(void *window)
Definition: FlutterWindowController.mm:228
InternalFlutter_Window_IsMinimized
FLUTTER_DARWIN_EXPORT bool InternalFlutter_Window_IsMinimized(void *window)
Definition: FlutterWindowController.mm:243
InternalFlutter_Window_SetContentSize
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetContentSize(void *window, const FlutterWindowSizing *size)
Definition: FlutterWindowController.mm:209
InternalFlutter_Window_SetTitle
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetTitle(void *window, const char *title)
Definition: FlutterWindowController.mm:214
InternalFlutter_Window_Activate
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Activate(void *window)
Definition: FlutterWindowController.mm:263
InternalFlutter_Window_GetHandle
FLUTTER_DARWIN_EXPORT void * InternalFlutter_Window_GetHandle(int64_t engine_id, FlutterViewIdentifier view_id)
Definition: FlutterWindowController.mm:195
InternalFlutter_Window_IsFullScreen
FLUTTER_DARWIN_EXPORT bool InternalFlutter_Window_IsFullScreen(void *window)
Definition: FlutterWindowController.mm:258
InternalFlutter_Window_Minimize
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Minimize(void *window)
Definition: FlutterWindowController.mm:233
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
FlutterWindowCreationRequest
Definition: FlutterWindowController.h:38
FlutterWindowCreationRequest::contentSize
FlutterWindowSizing contentSize
Definition: FlutterWindowController.h:39
FlutterWindowSize
Definition: FlutterWindowController.h:44
FlutterWindowSize::height
double height
Definition: FlutterWindowController.h:46
FlutterWindowSize::width
double width
Definition: FlutterWindowController.h:45
FlutterWindowSizing
Definition: FlutterWindowController.h:27
FlutterWindowSizing::has_constraints
bool has_constraints
Definition: FlutterWindowController.h:31
FlutterWindowSizing::height
double height
Definition: FlutterWindowController.h:30
FlutterWindowSizing::max_height
double max_height
Definition: FlutterWindowController.h:35
FlutterWindowSizing::min_width
double min_width
Definition: FlutterWindowController.h:32
FlutterWindowSizing::min_height
double min_height
Definition: FlutterWindowController.h:33
FlutterWindowSizing::max_width
double max_width
Definition: FlutterWindowController.h:34
FlutterWindowSizing::width
double width
Definition: FlutterWindowController.h:29
FlutterWindowSizing::has_size
bool has_size
Definition: FlutterWindowController.h:28