| 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 int64_t parent_view_id;
45 void (*on_should_close)();
46 void (*on_will_close)();
47 void (*notify_listeners)();
48 };
49
50 extern "C" {
51
52 // NOLINTBEGIN(google-objc-function-naming)
53
54 FLUTTER_DARWIN_EXPORT
55 int64_t InternalFlutter_WindowController_CreateRegularWindow(
56 int64_t engine_id,
57 const FlutterWindowCreationRequest* request);
58
59 FLUTTER_DARWIN_EXPORT
60 int64_t InternalFlutter_WindowController_CreateDialogWindow(
61 int64_t engine_id,
62 const FlutterWindowCreationRequest* request);
63
64 FLUTTER_DARWIN_EXPORT
65 void InternalFlutter_Window_Destroy(int64_t engine_id, void* window);
66
67 FLUTTER_DARWIN_EXPORT
68 void* InternalFlutter_Window_GetHandle(int64_t engine_id, FlutterViewIdentifier view_id);
69
70 FLUTTER_DARWIN_EXPORT
71 FlutterWindowSize InternalFlutter_Window_GetContentSize(void* window);
72
73 FLUTTER_DARWIN_EXPORT
74 void InternalFlutter_Window_SetContentSize(void* window, const FlutterWindowSize* size);
75
76 FLUTTER_DARWIN_EXPORT
77 void InternalFlutter_Window_SetConstraints(void* window,
78 const FlutterWindowConstraints* constraints);
79
80 FLUTTER_DARWIN_EXPORT
81 void InternalFlutter_Window_SetTitle(void* window, const char* title);
82
83 FLUTTER_DARWIN_EXPORT
84 void InternalFlutter_Window_SetMaximized(void* window, bool maximized);
85
86 FLUTTER_DARWIN_EXPORT
87 bool InternalFlutter_Window_IsMaximized(void* window);
88
89 FLUTTER_DARWIN_EXPORT
90 void InternalFlutter_Window_Minimize(void* window);
91
92 FLUTTER_DARWIN_EXPORT
93 void InternalFlutter_Window_Unminimize(void* window);
94
95 FLUTTER_DARWIN_EXPORT
96 bool InternalFlutter_Window_IsMinimized(void* window);
97
98 FLUTTER_DARWIN_EXPORT
99 void InternalFlutter_Window_SetFullScreen(void* window, bool fullScreen);
100
101 FLUTTER_DARWIN_EXPORT
102 bool InternalFlutter_Window_IsFullScreen(void* window);
103
104 FLUTTER_DARWIN_EXPORT
105 void InternalFlutter_Window_Activate(void* window);
106
107 FLUTTER_DARWIN_EXPORT
108 char* InternalFlutter_Window_GetTitle(void* window);
109
110 FLUTTER_DARWIN_EXPORT
111 bool InternalFlutter_Window_IsActivated(void* window);
112
113 // NOLINTEND(google-objc-function-naming)
114 }
115
116 #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:272
InternalFlutter_Window_GetContentSize
FLUTTER_DARWIN_EXPORT FlutterWindowSize InternalFlutter_Window_GetContentSize(void *window)
Definition: FlutterWindowController.mm:300
InternalFlutter_Window_SetMaximized
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetMaximized(void *window, bool maximized)
Definition: FlutterWindowController.mm:326
InternalFlutter_Window_SetConstraints
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetConstraints(void *window, const FlutterWindowConstraints *constraints)
Definition: FlutterWindowController.mm:315
InternalFlutter_Window_Destroy
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Destroy(int64_t engine_id, void *window)
Definition: FlutterWindowController.mm:288
InternalFlutter_Window_Unminimize
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Unminimize(void *window)
Definition: FlutterWindowController.mm:345
InternalFlutter_Window_SetContentSize
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetContentSize(void *window, const FlutterWindowSize *size)
Definition: FlutterWindowController.mm:309
InternalFlutter_Window_SetFullScreen
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetFullScreen(void *window, bool fullScreen)
Definition: FlutterWindowController.mm:355
InternalFlutter_Window_IsMaximized
FLUTTER_DARWIN_EXPORT bool InternalFlutter_Window_IsMaximized(void *window)
Definition: FlutterWindowController.mm:335
InternalFlutter_Window_IsMinimized
FLUTTER_DARWIN_EXPORT bool InternalFlutter_Window_IsMinimized(void *window)
Definition: FlutterWindowController.mm:350
InternalFlutter_Window_GetTitle
FLUTTER_DARWIN_EXPORT char * InternalFlutter_Window_GetTitle(void *window)
Definition: FlutterWindowController.mm:376
InternalFlutter_WindowController_CreateDialogWindow
FLUTTER_DARWIN_EXPORT int64_t InternalFlutter_WindowController_CreateDialogWindow(int64_t engine_id, const FlutterWindowCreationRequest *request)
Definition: FlutterWindowController.mm:280
InternalFlutter_Window_SetTitle
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetTitle(void *window, const char *title)
Definition: FlutterWindowController.mm:321
InternalFlutter_Window_Activate
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Activate(void *window)
Definition: FlutterWindowController.mm:370
InternalFlutter_Window_GetHandle
FLUTTER_DARWIN_EXPORT void * InternalFlutter_Window_GetHandle(int64_t engine_id, FlutterViewIdentifier view_id)
Definition: FlutterWindowController.mm:294
InternalFlutter_Window_IsFullScreen
FLUTTER_DARWIN_EXPORT bool InternalFlutter_Window_IsFullScreen(void *window)
Definition: FlutterWindowController.mm:365
InternalFlutter_Window_IsActivated
FLUTTER_DARWIN_EXPORT bool InternalFlutter_Window_IsActivated(void *window)
Definition: FlutterWindowController.mm:381
InternalFlutter_Window_Minimize
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Minimize(void *window)
Definition: FlutterWindowController.mm:340
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
FlutterWindowCreationRequest::parent_view_id
int64_t parent_view_id
Definition: FlutterWindowController.h:44
FlutterWindowSize
Definition: FlutterWindowController.h:27
FlutterWindowSize::height
double height
Definition: FlutterWindowController.h:29
FlutterWindowSize::width
double width
Definition: FlutterWindowController.h:28