Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
FlutterWindowController.mm File Reference

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}
GLFWwindow * window
Definition main.cc:60

References window.

◆ 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 engine
Definition main.cc:84

References engine, and window.

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, and window.

◆ 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}
G_BEGIN_DECLS FlutterViewId view_id

References 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}
char * strdup(const char *str1)

References window.

◆ 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}

References window.

◆ 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}

References window.

◆ 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}

References window.

◆ 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}

References window.

◆ 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}

References window.

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}

References window.

◆ 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}
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size

References window.

◆ 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}

References window.

◆ 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}

References window.

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}

References window.

◆ 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}

References window.

◆ 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}

References window.

◆ 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 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 engine.

Referenced by flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and 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 engine.

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