| Flutter macOS Embedder |

Classes | Functions
FlutterWindowController.h File Reference
`#import <Cocoa/Cocoa.h>`
`#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"`
`#import "flutter/shell/platform/darwin/macos/framework/Headers/FlutterViewController.h"`

Go to the source code of this file.

## Classes
class | FlutterWindowController
category | FlutterWindowController(Testing)
struct | FlutterWindowSizing
struct | FlutterWindowCreationRequest
struct | FlutterWindowSize

## Functions
FLUTTER_DARWIN_EXPORT int64_t | InternalFlutter_WindowController_CreateRegularWindow (int64_t engine_id, const FlutterWindowCreationRequest *request)
FLUTTER_DARWIN_EXPORT void | InternalFlutter_Window_Destroy (int64_t engine_id, void *window)
FLUTTER_DARWIN_EXPORT void * | InternalFlutter_Window_GetHandle (int64_t engine_id, FlutterViewIdentifier view_id)
FLUTTER_DARWIN_EXPORT FlutterWindowSize | InternalFlutter_Window_GetContentSize (void *window)
FLUTTER_DARWIN_EXPORT void | InternalFlutter_Window_SetContentSize (void *window, const FlutterWindowSizing *size)
FLUTTER_DARWIN_EXPORT void | InternalFlutter_Window_SetTitle (void *window, const char *title)
FLUTTER_DARWIN_EXPORT void | InternalFlutter_Window_SetMaximized (void *window, bool maximized)
FLUTTER_DARWIN_EXPORT bool | InternalFlutter_Window_IsMaximized (void *window)
FLUTTER_DARWIN_EXPORT void | InternalFlutter_Window_Minimize (void *window)
FLUTTER_DARWIN_EXPORT void | InternalFlutter_Window_Unminimize (void *window)
FLUTTER_DARWIN_EXPORT bool | InternalFlutter_Window_IsMinimized (void *window)
FLUTTER_DARWIN_EXPORT void | InternalFlutter_Window_SetFullScreen (void *window, bool fullScreen)
FLUTTER_DARWIN_EXPORT bool | InternalFlutter_Window_IsFullScreen (void *window)
FLUTTER_DARWIN_EXPORT void | InternalFlutter_Window_Activate (void *window)

## Function Documentation

## ◆ InternalFlutter_Window_Activate()

FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Activate | ( | void * | window | ) |

Definition at line 263 of file FlutterWindowController.mm.

263 {
264 NSWindow* w = (__bridge NSWindow*)window;
265 [NSApplication.sharedApplication activateIgnoringOtherApps:YES];
266 [w makeKeyAndOrderFront:nil];
267 }

## ◆ InternalFlutter_Window_Destroy()

FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Destroy | ( | int64_t | engine_id,
|  | void * | window
| ) |  |

Definition at line 189 of file FlutterWindowController.mm.

189 {
190 NSWindow* w = (__bridge NSWindow*)window;
191 FlutterEngine* engine = [FlutterEngine engineForIdentifier:engine_id];
192 [engine.windowController destroyWindow:w];
193 }
FlutterEngine
Definition: FlutterEngine.h:32

References FlutterWindowController::engine.

Referenced by flutter::testing::TEST_F().

## ◆ InternalFlutter_Window_GetContentSize()

FLUTTER_DARWIN_EXPORT FlutterWindowSize InternalFlutter_Window_GetContentSize | ( | void * | window | ) |

Definition at line 201 of file FlutterWindowController.mm.

201 {
202 NSWindow* w = (__bridge NSWindow*)window;
203 return {
204 .width = w.frame.size.width,
205 .height = w.frame.size.height,
206 };
207 }

## ◆ InternalFlutter_Window_GetHandle()

FLUTTER_DARWIN_EXPORT void* InternalFlutter_Window_GetHandle | ( | int64_t | engine_id,
|  | FlutterViewIdentifier | view_id
| ) |  |

Definition at line 195 of file FlutterWindowController.mm.

195 {
196 FlutterEngine* engine = [FlutterEngine engineForIdentifier:engine_id];
197 FlutterViewController* controller = [engine viewControllerForIdentifier:view_id];
198 return (__bridge void*)controller.view.window;
199 }
FlutterViewController
Definition: FlutterViewController.h:73

References FlutterWindowController::engine.

Referenced by flutter::testing::TEST_F().

## ◆ InternalFlutter_Window_IsFullScreen()

FLUTTER_DARWIN_EXPORT bool InternalFlutter_Window_IsFullScreen | ( | void * | window | ) |

Definition at line 258 of file FlutterWindowController.mm.

258 {
259 NSWindow* w = (__bridge NSWindow*)window;
260 return (w.styleMask & NSWindowStyleMaskFullScreen) != 0;
261 }

## ◆ InternalFlutter_Window_IsMaximized()

FLUTTER_DARWIN_EXPORT bool InternalFlutter_Window_IsMaximized | ( | void * | window | ) |

Definition at line 228 of file FlutterWindowController.mm.

228 {
229 NSWindow* w = (__bridge NSWindow*)window;
230 return w.isZoomed;
231 }

## ◆ InternalFlutter_Window_IsMinimized()

FLUTTER_DARWIN_EXPORT bool InternalFlutter_Window_IsMinimized | ( | void * | window | ) |

Definition at line 243 of file FlutterWindowController.mm.

243 {
244 NSWindow* w = (__bridge NSWindow*)window;
245 return w.isMiniaturized;
246 }

## ◆ InternalFlutter_Window_Minimize()

FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Minimize | ( | void * | window | ) |

Definition at line 233 of file FlutterWindowController.mm.

233 {
234 NSWindow* w = (__bridge NSWindow*)window;
235 [w miniaturize:nil];
236 }

Referenced by flutter::testing::TEST_F().

## ◆ InternalFlutter_Window_SetContentSize()

FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetContentSize | ( | void * | window,
|  | const FlutterWindowSizing * | size
| ) |  |

Definition at line 209 of file FlutterWindowController.mm.

209 {
210 NSWindow* w = (__bridge NSWindow*)window;
211 [w flutterSetContentSize:*size];
212 }

## ◆ InternalFlutter_Window_SetFullScreen()

FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetFullScreen | ( | void * | window,
|  | bool | fullScreen
| ) |  |

Definition at line 248 of file FlutterWindowController.mm.

248 {
249 NSWindow* w = (__bridge NSWindow*)window;
250 bool isFullScreen = (w.styleMask & NSWindowStyleMaskFullScreen) != 0;
251 if (fullScreen && !isFullScreen) {
252 [w toggleFullScreen:nil];
253 } else if (!fullScreen && isFullScreen) {
254 [w toggleFullScreen:nil];
255 }
256 }

## ◆ InternalFlutter_Window_SetMaximized()

FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetMaximized | ( | void * | window,
|  | bool | maximized
| ) |  |

Definition at line 219 of file FlutterWindowController.mm.

219 {
220 NSWindow* w = (__bridge NSWindow*)window;
221 if (maximized & !w.isZoomed) {
222 [w zoom:nil];
223 } else if (!maximized && w.isZoomed) {
224 [w zoom:nil];
225 }
226 }

Referenced by flutter::testing::TEST_F().

## ◆ InternalFlutter_Window_SetTitle()

FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetTitle | ( | void * | window,
|  | const char * | title
| ) |  |

Definition at line 214 of file FlutterWindowController.mm.

214 {
215 NSWindow* w = (__bridge NSWindow*)window;
216 w.title = [NSString stringWithUTF8String:title];
217 }

## ◆ InternalFlutter_Window_Unminimize()

FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Unminimize | ( | void * | window | ) |

Definition at line 238 of file FlutterWindowController.mm.

238 {
239 NSWindow* w = (__bridge NSWindow*)window;
240 [w deminiaturize:nil];
241 }

## ◆ InternalFlutter_WindowController_CreateRegularWindow()

FLUTTER_DARWIN_EXPORT int64_t InternalFlutter_WindowController_CreateRegularWindow | ( | int64_t | engine_id,
|  | const FlutterWindowCreationRequest * | request
| ) |  |

Definition at line 181 of file FlutterWindowController.mm.

183 {
184 FlutterEngine* engine = [FlutterEngine engineForIdentifier:engine_id];
185 [engine enableMultiView];
186 return [engine.windowController createRegularWindow:request];
187 }

References FlutterWindowController::engine.

Referenced by flutter::testing::TEST_F().