| Flutter macOS Embedder |

Classes | Functions
FlutterWindowController.mm File Reference
`#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterWindowController.h"`
`#include <Foundation/Foundation.h>`
`#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterChannels.h"`
`#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterCodecs.h"`
`#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterEngine_Internal.h"`
`#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterViewController_Internal.h"`
`#include "flutter/shell/platform/common/isolate_scope.h"`

Go to the source code of this file.

## Classes
class | FlutterWindowOwner
category | NSWindow(FlutterWindowSizing)

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

## Function Documentation

## ◆ InternalFlutter_Window_Activate()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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().