| 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 FlutterWindowSizing *size)
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)

## Function Documentation

## ◆ InternalFlutter_Window_Activate()

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

Definition at line 263 of file FlutterWindowController.mm.

263 {
264 NSWindow* w = (__bridge NSWindow*)window;
265 [NSApplication.sharedApplication activateIgnoringOtherApps:YES];
266 [w makeKeyAndOrderFront:nil];
267 }

## ◆ InternalFlutter_Window_Destroy()

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

Definition at line 189 of file FlutterWindowController.mm.

189 {
190 NSWindow* w = (__bridge NSWindow*)window;
191 FlutterEngine* engine = [FlutterEngine engineForIdentifier:engine_id];
192 [engine.windowController destroyWindow:w];
193 }
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 201 of file FlutterWindowController.mm.

201 {
202 NSWindow* w = (__bridge NSWindow*)window;
203 return {
204 .width = w.frame.size.width,
205 .height = w.frame.size.height,
206 };
207 }

## ◆ InternalFlutter_Window_GetHandle()

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

Definition at line 195 of file FlutterWindowController.mm.

195 {
196 FlutterEngine* engine = [FlutterEngine engineForIdentifier:engine_id];
197 FlutterViewController* controller = [engine viewControllerForIdentifier:view_id];
198 return (__bridge void*)controller.view.window;
199 }
FlutterViewController
Definition: FlutterViewController.h:73

References FlutterWindowController::engine.

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

## ◆ InternalFlutter_Window_IsFullScreen()

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

Definition at line 258 of file FlutterWindowController.mm.

258 {
259 NSWindow* w = (__bridge NSWindow*)window;
260 return (w.styleMask & NSWindowStyleMaskFullScreen) != 0;
261 }

## ◆ InternalFlutter_Window_IsMaximized()

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

Definition at line 228 of file FlutterWindowController.mm.

228 {
229 NSWindow* w = (__bridge NSWindow*)window;
230 return w.isZoomed;
231 }

## ◆ InternalFlutter_Window_IsMinimized()

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

Definition at line 243 of file FlutterWindowController.mm.

243 {
244 NSWindow* w = (__bridge NSWindow*)window;
245 return w.isMiniaturized;
246 }

## ◆ InternalFlutter_Window_Minimize()

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

Definition at line 233 of file FlutterWindowController.mm.

233 {
234 NSWindow* w = (__bridge NSWindow*)window;
235 [w miniaturize:nil];
236 }

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

## ◆ InternalFlutter_Window_SetContentSize()

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

Definition at line 209 of file FlutterWindowController.mm.

209 {
210 NSWindow* w = (__bridge NSWindow*)window;
211 [w flutterSetContentSize:*size];
212 }

## ◆ InternalFlutter_Window_SetFullScreen()

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

Definition at line 248 of file FlutterWindowController.mm.

248 {
249 NSWindow* w = (__bridge NSWindow*)window;
250 bool isFullScreen = (w.styleMask & NSWindowStyleMaskFullScreen) != 0;
251 if (fullScreen && !isFullScreen) {
252 [w toggleFullScreen:nil];
253 } else if (!fullScreen && isFullScreen) {
254 [w toggleFullScreen:nil];
255 }
256 }

## ◆ InternalFlutter_Window_SetMaximized()

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

Definition at line 219 of file FlutterWindowController.mm.

219 {
220 NSWindow* w = (__bridge NSWindow*)window;
221 if (maximized & !w.isZoomed) {
222 [w zoom:nil];
223 } else if (!maximized && w.isZoomed) {
224 [w zoom:nil];
225 }
226 }

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

## ◆ InternalFlutter_Window_SetTitle()

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

Definition at line 214 of file FlutterWindowController.mm.

214 {
215 NSWindow* w = (__bridge NSWindow*)window;
216 w.title = [NSString stringWithUTF8String:title];
217 }

## ◆ InternalFlutter_Window_Unminimize()

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

Definition at line 238 of file FlutterWindowController.mm.

238 {
239 NSWindow* w = (__bridge NSWindow*)window;
240 [w deminiaturize:nil];
241 }

## ◆ InternalFlutter_WindowController_CreateRegularWindow()

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

Definition at line 181 of file FlutterWindowController.mm.

183 {
184 FlutterEngine* engine = [FlutterEngine engineForIdentifier:engine_id];
185 [engine enableMultiView];
186 return [engine.windowController createRegularWindow:request];
187 }

References FlutterWindowController::engine.

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