| 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)
int64_t | InternalFlutter_WindowController_CreateTooltipWindow (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)
void | InternalFlutter_Window_UpdatePosition (void *window)

## Function Documentation

## ◆ InternalFlutter_Window_Activate()

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

Definition at line 561 of file FlutterWindowController.mm.

561 {
562 NSWindow* w = (__bridge NSWindow*)window;
563 [NSApplication.sharedApplication activateIgnoringOtherApps:YES];
564 [w makeKeyAndOrderFront:nil];
565 }

## ◆ InternalFlutter_Window_Destroy()

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

Definition at line 478 of file FlutterWindowController.mm.

478 {
479 NSWindow* w = (__bridge NSWindow*)window;
480 FlutterEngine* engine = [FlutterEngine engineForIdentifier:engine_id];
481 [engine.windowController destroyWindow:w];
482 }
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 490 of file FlutterWindowController.mm.

490 {
491 NSWindow* w = (__bridge NSWindow*)window;
492 NSRect contentRect = [w contentRectForFrameRect:w.frame];
493 return {
494 .width = contentRect.size.width,
495 .height = contentRect.size.height,
496 };
497 }

References FlutterWindowSize::width.

## ◆ InternalFlutter_Window_GetHandle()

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

Definition at line 484 of file FlutterWindowController.mm.

484 {
485 FlutterEngine* engine = [FlutterEngine engineForIdentifier:engine_id];
486 FlutterViewController* controller = [engine viewControllerForIdentifier:view_id];
487 return (__bridge void*)controller.view.window;
488 }
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 567 of file FlutterWindowController.mm.

567 {
568 NSWindow* w = (__bridge NSWindow*)window;
569 return strdup(w.title.UTF8String);
570 }

## ◆ InternalFlutter_Window_IsActivated()

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

Definition at line 572 of file FlutterWindowController.mm.

572 {
573 NSWindow* w = (__bridge NSWindow*)window;
574 return w.isKeyWindow;
575 }

## ◆ InternalFlutter_Window_IsFullScreen()

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

Definition at line 556 of file FlutterWindowController.mm.

556 {
557 NSWindow* w = (__bridge NSWindow*)window;
558 return (w.styleMask & NSWindowStyleMaskFullScreen) != 0;
559 }

## ◆ InternalFlutter_Window_IsMaximized()

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

Definition at line 526 of file FlutterWindowController.mm.

526 {
527 NSWindow* w = (__bridge NSWindow*)window;
528 return w.isZoomed;
529 }

## ◆ InternalFlutter_Window_IsMinimized()

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

Definition at line 541 of file FlutterWindowController.mm.

541 {
542 NSWindow* w = (__bridge NSWindow*)window;
543 return w.isMiniaturized;
544 }

## ◆ InternalFlutter_Window_Minimize()

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

Definition at line 531 of file FlutterWindowController.mm.

531 {
532 NSWindow* w = (__bridge NSWindow*)window;
533 [w miniaturize:nil];
534 }

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

## ◆ InternalFlutter_Window_SetConstraints()

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

Definition at line 505 of file FlutterWindowController.mm.

506 {
507 NSWindow* w = (__bridge NSWindow*)window;
508 FlutterWindowOwner* owner = (FlutterWindowOwner*)w.delegate;
509 [owner setConstraints:*constraints];
510 }
FlutterWindowOwner
Definition: FlutterWindowController.mm:16

## ◆ InternalFlutter_Window_SetContentSize()

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

Definition at line 499 of file FlutterWindowController.mm.

499 {
500 NSWindow* w = (__bridge NSWindow*)window;
501 [w flutterSetContentSize:*size];
502 }

## ◆ InternalFlutter_Window_SetFullScreen()

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

Definition at line 546 of file FlutterWindowController.mm.

546 {
547 NSWindow* w = (__bridge NSWindow*)window;
548 bool isFullScreen = (w.styleMask & NSWindowStyleMaskFullScreen) != 0;
549 if (fullScreen && !isFullScreen) {
550 [w toggleFullScreen:nil];
551 } else if (!fullScreen && isFullScreen) {
552 [w toggleFullScreen:nil];
553 }
554 }

## ◆ InternalFlutter_Window_SetMaximized()

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

Definition at line 517 of file FlutterWindowController.mm.

517 {
518 NSWindow* w = (__bridge NSWindow*)window;
519 if (maximized & !w.isZoomed) {
520 [w zoom:nil];
521 } else if (!maximized && w.isZoomed) {
522 [w zoom:nil];
523 }
524 }

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

## ◆ InternalFlutter_Window_SetTitle()

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

Definition at line 512 of file FlutterWindowController.mm.

512 {
513 NSWindow* w = (__bridge NSWindow*)window;
514 w.title = [NSString stringWithUTF8String:title];
515 }

## ◆ InternalFlutter_Window_Unminimize()

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

Definition at line 536 of file FlutterWindowController.mm.

536 {
537 NSWindow* w = (__bridge NSWindow*)window;
538 [w deminiaturize:nil];
539 }

## ◆ InternalFlutter_Window_UpdatePosition()

void InternalFlutter_Window_UpdatePosition | ( | void * | window | ) |

Definition at line 577 of file FlutterWindowController.mm.

577 {
578 NSWindow* w = (__bridge NSWindow*)window;
579 FlutterWindowOwner* owner = (FlutterWindowOwner*)w.delegate;
580 [owner updatePosition];
581 }

## ◆ InternalFlutter_WindowController_CreateDialogWindow()

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

Definition at line 462 of file FlutterWindowController.mm.

464 {
465 FlutterEngine* engine = [FlutterEngine engineForIdentifier:engine_id];
466 [engine enableMultiView];
467 return [engine.windowController createDialogWindow:request];
468 }

References FlutterWindowController::engine.

## ◆ InternalFlutter_WindowController_CreateRegularWindow()

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

Definition at line 454 of file FlutterWindowController.mm.

456 {
457 FlutterEngine* engine = [FlutterEngine engineForIdentifier:engine_id];
458 [engine enableMultiView];
459 return [engine.windowController createRegularWindow:request];
460 }

References FlutterWindowController::engine.

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

## ◆ InternalFlutter_WindowController_CreateTooltipWindow()

int64_t InternalFlutter_WindowController_CreateTooltipWindow | ( | int64_t | engine_id,
|  | const FlutterWindowCreationRequest * | request
| ) |  |

Definition at line 470 of file FlutterWindowController.mm.

472 {
473 FlutterEngine* engine = [FlutterEngine engineForIdentifier:engine_id];
474 [engine enableMultiView];
475 return [engine.windowController createTooltipWindow:request];
476 }

References FlutterWindowController::engine.

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