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

295 {
296 NSWindow* w = (__bridge NSWindow*)window;
297 [NSApplication.sharedApplication activateIgnoringOtherApps:YES];
298 [w makeKeyAndOrderFront:nil];
299 }

## ◆ InternalFlutter_Window_Destroy()

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

Definition at line 213 of file FlutterWindowController.mm.

213 {
214 NSWindow* w = (__bridge NSWindow*)window;
215 FlutterEngine* engine = [FlutterEngine engineForIdentifier:engine_id];
216 [engine.windowController destroyWindow:w];
217 }
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 225 of file FlutterWindowController.mm.

225 {
226 NSWindow* w = (__bridge NSWindow*)window;
227 NSRect contentRect = [w contentRectForFrameRect:w.frame];
228 return {
229 .width = contentRect.size.width,
230 .height = contentRect.size.height,
231 };
232 }

References FlutterWindowSize::width.

## ◆ InternalFlutter_Window_GetHandle()

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

Definition at line 219 of file FlutterWindowController.mm.

219 {
220 FlutterEngine* engine = [FlutterEngine engineForIdentifier:engine_id];
221 FlutterViewController* controller = [engine viewControllerForIdentifier:view_id];
222 return (__bridge void*)controller.view.window;
223 }
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 301 of file FlutterWindowController.mm.

301 {
302 NSWindow* w = (__bridge NSWindow*)window;
303 return strdup(w.title.UTF8String);
304 }

## ◆ InternalFlutter_Window_IsActivated()

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

Definition at line 306 of file FlutterWindowController.mm.

306 {
307 NSWindow* w = (__bridge NSWindow*)window;
308 return w.isKeyWindow;
309 }

## ◆ InternalFlutter_Window_IsFullScreen()

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

Definition at line 290 of file FlutterWindowController.mm.

290 {
291 NSWindow* w = (__bridge NSWindow*)window;
292 return (w.styleMask & NSWindowStyleMaskFullScreen) != 0;
293 }

## ◆ InternalFlutter_Window_IsMaximized()

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

Definition at line 260 of file FlutterWindowController.mm.

260 {
261 NSWindow* w = (__bridge NSWindow*)window;
262 return w.isZoomed;
263 }

## ◆ InternalFlutter_Window_IsMinimized()

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

Definition at line 275 of file FlutterWindowController.mm.

275 {
276 NSWindow* w = (__bridge NSWindow*)window;
277 return w.isMiniaturized;
278 }

## ◆ InternalFlutter_Window_Minimize()

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

Definition at line 265 of file FlutterWindowController.mm.

265 {
266 NSWindow* w = (__bridge NSWindow*)window;
267 [w miniaturize:nil];
268 }

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

## ◆ InternalFlutter_Window_SetConstraints()

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

Definition at line 240 of file FlutterWindowController.mm.

241 {
242 NSWindow* w = (__bridge NSWindow*)window;
243 [w flutterSetConstraints:*constraints];
244 }

## ◆ InternalFlutter_Window_SetContentSize()

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

Definition at line 234 of file FlutterWindowController.mm.

234 {
235 NSWindow* w = (__bridge NSWindow*)window;
236 [w flutterSetContentSize:*size];
237 }

## ◆ InternalFlutter_Window_SetFullScreen()

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

Definition at line 280 of file FlutterWindowController.mm.

280 {
281 NSWindow* w = (__bridge NSWindow*)window;
282 bool isFullScreen = (w.styleMask & NSWindowStyleMaskFullScreen) != 0;
283 if (fullScreen && !isFullScreen) {
284 [w toggleFullScreen:nil];
285 } else if (!fullScreen && isFullScreen) {
286 [w toggleFullScreen:nil];
287 }
288 }

## ◆ InternalFlutter_Window_SetMaximized()

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

Definition at line 251 of file FlutterWindowController.mm.

251 {
252 NSWindow* w = (__bridge NSWindow*)window;
253 if (maximized & !w.isZoomed) {
254 [w zoom:nil];
255 } else if (!maximized && w.isZoomed) {
256 [w zoom:nil];
257 }
258 }

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

## ◆ InternalFlutter_Window_SetTitle()

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

Definition at line 246 of file FlutterWindowController.mm.

246 {
247 NSWindow* w = (__bridge NSWindow*)window;
248 w.title = [NSString stringWithUTF8String:title];
249 }

## ◆ InternalFlutter_Window_Unminimize()

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

Definition at line 270 of file FlutterWindowController.mm.

270 {
271 NSWindow* w = (__bridge NSWindow*)window;
272 [w deminiaturize:nil];
273 }

## ◆ InternalFlutter_WindowController_CreateRegularWindow()

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

Definition at line 205 of file FlutterWindowController.mm.

207 {
208 FlutterEngine* engine = [FlutterEngine engineForIdentifier:engine_id];
209 [engine enableMultiView];
210 return [engine.windowController createRegularWindow:request];
211 }

References FlutterWindowController::engine.

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