Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
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
12
13@class FlutterEngine;
14
15@interface FlutterWindowController : NSObject
16
17@property(nonatomic, weak) FlutterEngine* engine;
18
19- (void)closeAllWindows;
20
22
23@end
24
26 double left;
27 double top;
28 double width;
29 double height;
30
31 static FlutterWindowRect fromNSRect(const NSRect& rect) {
32 return {
33 rect.origin.x,
34 rect.origin.y,
35 rect.size.width,
36 rect.size.height,
37 };
38 }
39
40 NSRect toNSRect() const { return NSMakeRect(left, top, width, height); }
41};
42
44 double width;
45 double height;
46
47 static FlutterWindowSize fromNSSize(const NSSize& size) {
48 return {
49 size.width,
50 size.height,
51 };
52 }
53};
54
56 double x;
57 double y;
58
59 static FlutterWindowOffset fromNSPoint(const NSPoint& point) {
60 return {
61 point.x,
62 point.y,
63 };
64 }
65};
66
73
76 struct FlutterWindowSize size;
78 struct FlutterWindowConstraints constraints;
80 void (*on_should_close)();
81 void (*on_will_close)();
82 void (*notify_listeners)();
83 // For sized to content windows with positioner returns the desired window position for given
84 // configuration. All coordinates are in logical space.
85 FlutterWindowRect* (*on_get_window_position)(const FlutterWindowSize& child_size,
86 const FlutterWindowRect& parent_rect,
87 const FlutterWindowRect& output_rect);
88};
89
90extern "C" {
91
92// NOLINTBEGIN(google-objc-function-naming)
93
96 int64_t engine_id,
97 const FlutterWindowCreationRequest* request);
98
101 int64_t engine_id,
102 const FlutterWindowCreationRequest* request);
103
106 int64_t engine_id,
107 const FlutterWindowCreationRequest* request);
108
111 int64_t engine_id,
112 const FlutterWindowCreationRequest* request);
113
115void InternalFlutter_Window_Destroy(int64_t engine_id, void* window);
116
119
122
125
128 const FlutterWindowConstraints* constraints);
129
131void InternalFlutter_Window_SetTitle(void* window, const char* title);
132
134void InternalFlutter_Window_SetMaximized(void* window, bool maximized);
135
138
141
144
147
149void InternalFlutter_Window_SetFullScreen(void* window, bool fullScreen);
150
153
156
159
162
165
168
169// NOLINTEND(google-objc-function-naming)
170}
171
172#endif // FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERWINDOWCONTROLLER_H_
#define FLUTTER_DARWIN_EXPORT
FLUTTER_DARWIN_EXPORT int64_t InternalFlutter_WindowController_CreateRegularWindow(int64_t engine_id, const FlutterWindowCreationRequest *request)
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_UpdatePosition(void *window)
FLUTTER_DARWIN_EXPORT FlutterWindowSize InternalFlutter_Window_GetContentSize(void *window)
FLUTTER_DARWIN_EXPORT void * InternalFlutter_Window_GetHandle(int64_t engine_id, FlutterViewIdentifier view_id)
FLUTTER_DARWIN_EXPORT FlutterWindowOffset InternalFlutter_Window_GetOffsetInParent(void *window)
FLUTTER_DARWIN_EXPORT int64_t InternalFlutter_WindowController_CreateTooltipWindow(int64_t engine_id, const FlutterWindowCreationRequest *request)
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetMaximized(void *window, bool maximized)
FLUTTER_DARWIN_EXPORT int64_t InternalFlutter_WindowController_CreatePopupWindow(int64_t engine_id, const FlutterWindowCreationRequest *request)
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetConstraints(void *window, const FlutterWindowConstraints *constraints)
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Destroy(int64_t engine_id, void *window)
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Unminimize(void *window)
FLUTTER_DARWIN_EXPORT char * InternalFlutter_Window_GetTitle(void *window)
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetContentSize(void *window, const FlutterWindowSize *size)
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetFullScreen(void *window, bool fullScreen)
FLUTTER_DARWIN_EXPORT bool InternalFlutter_Window_IsMaximized(void *window)
FLUTTER_DARWIN_EXPORT bool InternalFlutter_Window_IsMinimized(void *window)
FLUTTER_DARWIN_EXPORT int64_t InternalFlutter_WindowController_CreateDialogWindow(int64_t engine_id, const FlutterWindowCreationRequest *request)
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetTitle(void *window, const char *title)
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Activate(void *window)
FLUTTER_DARWIN_EXPORT bool InternalFlutter_Window_IsFullScreen(void *window)
FLUTTER_DARWIN_EXPORT bool InternalFlutter_Window_IsActivated(void *window)
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Minimize(void *window)
GLFWwindow * window
Definition main.cc:60
G_BEGIN_DECLS FlutterViewId view_id
int64_t FlutterViewIdentifier
int32_t height
int32_t width
static FlutterWindowOffset fromNSPoint(const NSPoint &point)
static FlutterWindowRect fromNSRect(const NSRect &rect)
static FlutterWindowSize fromNSSize(const NSSize &size)