7571f9e490
Mechanically updated via Xcode "Replace Regular Expression": typedef (.*) INHERITED; --> using INHERITED = $1; The ClangTidy approach generated an even larger CL which would have required a significant amount of hand-tweaking to be usable. Change-Id: I671dc9d9efdf6d60151325c8d4d13fad7e10a15b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314999 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
61 lines
1.1 KiB
Objective-C
61 lines
1.1 KiB
Objective-C
/*
|
|
* Copyright 2016 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#ifndef Window_mac_DEFINED
|
|
#define Window_mac_DEFINED
|
|
|
|
#include "src/core/SkTDynamicHash.h"
|
|
#include "tools/sk_app/Window.h"
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
namespace sk_app {
|
|
|
|
class Window_mac : public Window {
|
|
public:
|
|
Window_mac()
|
|
: INHERITED()
|
|
, fWindow(nil) {}
|
|
~Window_mac() override {
|
|
this->closeWindow();
|
|
}
|
|
|
|
bool initWindow();
|
|
|
|
void setTitle(const char*) override;
|
|
void show() override;
|
|
|
|
bool attach(BackendType) override;
|
|
|
|
void onInval() override {}
|
|
|
|
static void PaintWindows();
|
|
|
|
static const NSInteger& GetKey(const Window_mac& w) {
|
|
return w.fWindowNumber;
|
|
}
|
|
|
|
static uint32_t Hash(const NSInteger& windowNumber) {
|
|
return windowNumber;
|
|
}
|
|
|
|
NSWindow* window() { return fWindow; }
|
|
void closeWindow();
|
|
|
|
private:
|
|
NSWindow* fWindow;
|
|
NSInteger fWindowNumber;
|
|
|
|
static SkTDynamicHash<Window_mac, NSInteger> gWindowMap;
|
|
|
|
using INHERITED = Window;
|
|
};
|
|
|
|
} // namespace sk_app
|
|
|
|
#endif
|