Flutter Engine
The Flutter Engine
Window_mac.h
Go to the documentation of this file.
1/*
2* Copyright 2016 Google Inc.
3*
4* Use of this source code is governed by a BSD-style license that can be
5* found in the LICENSE file.
6*/
7
8#ifndef Window_mac_DEFINED
9#define Window_mac_DEFINED
10
12#include "tools/sk_app/Window.h"
13
14#import <Cocoa/Cocoa.h>
15
16namespace sk_app {
17
18class Window_mac : public Window {
19public:
21 : Window()
22 , fWindow(nil) {}
23 ~Window_mac() override {
24 this->closeWindow();
25 }
26
27 bool initWindow();
28
29 void setTitle(const char*) override;
30 void show() override;
31
32 bool attach(BackendType) override;
33
34 void onInval() override {}
35
36 float scaleFactor() const override;
37
38 static void PaintWindows();
39
40 static const NSInteger& GetKey(const Window_mac& w) {
41 return w.fWindowNumber;
42 }
43
44 static uint32_t Hash(const NSInteger& windowNumber) {
45 return windowNumber;
46 }
47
48 NSWindow* window() { return fWindow; }
49 void closeWindow();
50
51private:
52 NSWindow* fWindow;
53 NSInteger fWindowNumber;
54
56};
57
58} // namespace sk_app
59
60#endif
static uint32_t Hash(const NSInteger &windowNumber)
Definition: Window_mac.h:44
void setTitle(const char *) override
Definition: Window_mac.mm:106
float scaleFactor() const override
Definition: Window_mac.mm:173
NSWindow * window()
Definition: Window_mac.h:48
void show() override
Definition: Window_mac.mm:112
static const NSInteger & GetKey(const Window_mac &w)
Definition: Window_mac.h:40
~Window_mac() override
Definition: Window_mac.h:23
void onInval() override
Definition: Window_mac.h:34
static void PaintWindows()
Definition: Window_mac.mm:177
bool attach(BackendType) override
Definition: Window_mac.mm:119
SkScalar w