2017-09-01 15:01:51 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2017 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef Window_ios_DEFINED
|
|
|
|
#define Window_ios_DEFINED
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/private/SkChecksum.h"
|
|
|
|
#include "src/core/SkTDynamicHash.h"
|
|
|
|
#include "tools/sk_app/Window.h"
|
2017-09-01 15:01:51 +00:00
|
|
|
|
2019-08-29 18:59:17 +00:00
|
|
|
#import <UIKit/UIKit.h>
|
2017-09-01 15:01:51 +00:00
|
|
|
|
|
|
|
namespace sk_app {
|
|
|
|
|
|
|
|
class Window_ios : public Window {
|
|
|
|
public:
|
2018-02-15 20:25:11 +00:00
|
|
|
Window_ios()
|
|
|
|
: INHERITED()
|
2019-08-29 18:59:17 +00:00
|
|
|
, fWindow(nil) {}
|
2017-09-01 15:01:51 +00:00
|
|
|
~Window_ios() override { this->closeWindow(); }
|
|
|
|
|
|
|
|
bool initWindow();
|
|
|
|
|
2019-08-29 18:59:17 +00:00
|
|
|
void setTitle(const char*) override {}
|
|
|
|
void show() override {}
|
2017-09-01 15:01:51 +00:00
|
|
|
|
|
|
|
bool attach(BackendType) override;
|
|
|
|
|
|
|
|
void onInval() override;
|
|
|
|
|
2019-08-29 18:59:17 +00:00
|
|
|
static void PaintWindow();
|
2017-09-01 15:01:51 +00:00
|
|
|
|
2019-08-29 18:59:17 +00:00
|
|
|
UIWindow* uiWindow() { return fWindow; }
|
2017-09-01 15:01:51 +00:00
|
|
|
|
2019-08-29 18:59:17 +00:00
|
|
|
static Window_ios* MainWindow() { return gWindow; }
|
2017-09-01 15:01:51 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void closeWindow();
|
|
|
|
|
2019-08-29 18:59:17 +00:00
|
|
|
UIWindow* fWindow;
|
2017-09-01 15:01:51 +00:00
|
|
|
|
2019-08-29 18:59:17 +00:00
|
|
|
static Window_ios* gWindow; // there should be only one
|
2017-09-01 15:01:51 +00:00
|
|
|
|
|
|
|
typedef Window INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace sk_app
|
|
|
|
|
2019-08-29 18:59:17 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
@interface MainView : UIView
|
|
|
|
|
|
|
|
- (MainView*)initWithWindow:(sk_app::Window_ios*)initWindow;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2017-09-01 15:01:51 +00:00
|
|
|
#endif
|