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

References window.

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

References window.

◆ 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}
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 376 of file FlutterWindowController.mm.

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

References window.

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

References window.

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

References window.

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

References window.

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

References window.

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

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 315 of file FlutterWindowController.mm.

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

References window.

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

References window.

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

References window.

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}

References window.

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

References window.

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

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