| 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 | FlutterWindowSize
struct | FlutterWindowConstraints
struct | FlutterWindowCreationRequest

## Functions
FLUTTER_DARWIN_EXPORT int64_t | InternalFlutter_WindowController_CreateRegularWindow (int64_t engine_id, const FlutterWindowCreationRequest *request)
FLUTTER_DARWIN_EXPORT int64_t | InternalFlutter_WindowController_CreateDialogWindow (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 FlutterWindowSize *size)
FLUTTER_DARWIN_EXPORT void | InternalFlutter_Window_SetConstraints (void *window, const FlutterWindowConstraints *constraints)
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)
FLUTTER_DARWIN_EXPORT char * | InternalFlutter_Window_GetTitle (void *window)
FLUTTER_DARWIN_EXPORT bool | InternalFlutter_Window_IsActivated (void *window)

## Function Documentation

## ◆ InternalFlutter_Window_Activate()

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

Definition at line 370 of file FlutterWindowController.mm.

370 {
371 NSWindow* w = (__bridge NSWindow*)window;
372 [NSApplication.sharedApplication activateIgnoringOtherApps:YES];
373 [w makeKeyAndOrderFront:nil];
374 }

## ◆ InternalFlutter_Window_Destroy()

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

Definition at line 288 of file FlutterWindowController.mm.

288 {
289 NSWindow* w = (__bridge NSWindow*)window;
290 FlutterEngine* engine = [FlutterEngine engineForIdentifier:engine_id];
291 [engine.windowController destroyWindow:w];
292 }
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 300 of file FlutterWindowController.mm.

300 {
301 NSWindow* w = (__bridge NSWindow*)window;
302 NSRect contentRect = [w contentRectForFrameRect:w.frame];
303 return {
304 .width = contentRect.size.width,
305 .height = contentRect.size.height,
306 };
307 }

## ◆ InternalFlutter_Window_GetHandle()

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

Definition at line 294 of file FlutterWindowController.mm.

294 {
295 FlutterEngine* engine = [FlutterEngine engineForIdentifier:engine_id];
296 FlutterViewController* controller = [engine viewControllerForIdentifier:view_id];
297 return (__bridge void*)controller.view.window;
298 }
FlutterViewController
Definition: FlutterViewController.h:73

References FlutterWindowController::engine.

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

## ◆ InternalFlutter_Window_GetTitle()

FLUTTER_DARWIN_EXPORT char* InternalFlutter_Window_GetTitle | ( | void * | window | ) |

Definition at line 376 of file FlutterWindowController.mm.

376 {
377 NSWindow* w = (__bridge NSWindow*)window;
378 return strdup(w.title.UTF8String);
379 }

## ◆ InternalFlutter_Window_IsActivated()

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

Definition at line 381 of file FlutterWindowController.mm.

381 {
382 NSWindow* w = (__bridge NSWindow*)window;
383 return w.isKeyWindow;
384 }

## ◆ InternalFlutter_Window_IsFullScreen()

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

Definition at line 365 of file FlutterWindowController.mm.

365 {
366 NSWindow* w = (__bridge NSWindow*)window;
367 return (w.styleMask & NSWindowStyleMaskFullScreen) != 0;
368 }

## ◆ InternalFlutter_Window_IsMaximized()

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

Definition at line 335 of file FlutterWindowController.mm.

335 {
336 NSWindow* w = (__bridge NSWindow*)window;
337 return w.isZoomed;
338 }

## ◆ InternalFlutter_Window_IsMinimized()

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

Definition at line 350 of file FlutterWindowController.mm.

350 {
351 NSWindow* w = (__bridge NSWindow*)window;
352 return w.isMiniaturized;
353 }

## ◆ InternalFlutter_Window_Minimize()

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

Definition at line 340 of file FlutterWindowController.mm.

340 {
341 NSWindow* w = (__bridge NSWindow*)window;
342 [w miniaturize:nil];
343 }

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

## ◆ InternalFlutter_Window_SetConstraints()

FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetConstraints | ( | void * | window,
|  | const FlutterWindowConstraints * | constraints
| ) |  |

Definition at line 315 of file FlutterWindowController.mm.

316 {
317 NSWindow* w = (__bridge NSWindow*)window;
318 [w flutterSetConstraints:*constraints];
319 }

## ◆ InternalFlutter_Window_SetContentSize()

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

Definition at line 309 of file FlutterWindowController.mm.

309 {
310 NSWindow* w = (__bridge NSWindow*)window;
311 [w flutterSetContentSize:*size];
312 }

## ◆ InternalFlutter_Window_SetFullScreen()

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

Definition at line 355 of file FlutterWindowController.mm.

355 {
356 NSWindow* w = (__bridge NSWindow*)window;
357 bool isFullScreen = (w.styleMask & NSWindowStyleMaskFullScreen) != 0;
358 if (fullScreen && !isFullScreen) {
359 [w toggleFullScreen:nil];
360 } else if (!fullScreen && isFullScreen) {
361 [w toggleFullScreen:nil];
362 }
363 }

## ◆ InternalFlutter_Window_SetMaximized()

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

Definition at line 326 of file FlutterWindowController.mm.

326 {
327 NSWindow* w = (__bridge NSWindow*)window;
328 if (maximized & !w.isZoomed) {
329 [w zoom:nil];
330 } else if (!maximized && w.isZoomed) {
331 [w zoom:nil];
332 }
333 }

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

## ◆ InternalFlutter_Window_SetTitle()

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

Definition at line 321 of file FlutterWindowController.mm.

321 {
322 NSWindow* w = (__bridge NSWindow*)window;
323 w.title = [NSString stringWithUTF8String:title];
324 }

## ◆ InternalFlutter_Window_Unminimize()

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

Definition at line 345 of file FlutterWindowController.mm.

345 {
346 NSWindow* w = (__bridge NSWindow*)window;
347 [w deminiaturize:nil];
348 }

## ◆ InternalFlutter_WindowController_CreateDialogWindow()

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

Definition at line 280 of file FlutterWindowController.mm.

282 {
283 FlutterEngine* engine = [FlutterEngine engineForIdentifier:engine_id];
284 [engine enableMultiView];
285 return [engine.windowController createDialogWindow:request];
286 }

References FlutterWindowController::engine.

## ◆ InternalFlutter_WindowController_CreateRegularWindow()

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

Definition at line 272 of file FlutterWindowController.mm.

274 {
275 FlutterEngine* engine = [FlutterEngine engineForIdentifier:engine_id];
276 [engine enableMultiView];
277 return [engine.windowController createRegularWindow:request];
278 }

References FlutterWindowController::engine.

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