blob: 3b540cff3f15c5af49a9e3e5f9bf07905dc887fa [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
2/*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
yangsu@google.com1a2b4c12011-06-24 17:20:50 +00008#ifndef SkOSWindow_iOS_DEFINED
9#define SkOSWindow_iOS_DEFINED
10
11#include "SkWindow.h"
yangsu@google.come938b192011-08-02 13:23:15 +000012
yangsu@google.com1a2b4c12011-06-24 17:20:50 +000013class SkOSWindow : public SkWindow {
14public:
15 SkOSWindow(void* hwnd);
16 ~SkOSWindow();
17 void* getHWND() const { return fHWND; }
18
robertphillips@google.comb442a6d2012-04-02 19:24:21 +000019 enum SkBackEndTypes {
20 kNone_BackEndType,
21 kNativeGL_BackEndType,
22 };
23
mtklein18300a32016-03-16 13:53:35 -070024 void release();
brianosman2d1ee792016-05-05 12:24:31 -070025 bool attach(SkBackEndTypes attachType, int msaaSampleCount, bool deepColor,
26 AttachmentInfo*);
robertphillips@google.comb442a6d2012-04-02 19:24:21 +000027 void present();
yangsu@google.com1a2b4c12011-06-24 17:20:50 +000028
bsalomon85ab5512015-06-16 12:47:25 -070029 bool makeFullscreen() { return true; }
30 void closeWindow() { /* Not impl yet */ }
31 void setVsync(bool) { /* Can't turn off vsync? */ }
32
yangsu@google.com1a2b4c12011-06-24 17:20:50 +000033protected:
34 // overrides from SkEventSink
35 virtual bool onEvent(const SkEvent& evt);
36 // overrides from SkWindow
37 virtual void onHandleInval(const SkIRect&);
38 // overrides from SkView
39 virtual void onAddMenu(const SkOSMenu*);
Mike Klein7d302882016-11-03 14:06:31 -040040 virtual void onUpdateMenu(const SkOSMenu*);
yangsu@google.com1a2b4c12011-06-24 17:20:50 +000041 virtual void onSetTitle(const char[]);
rmistry@google.comfbfcd562012-08-23 18:09:54 +000042
yangsu@google.com1a2b4c12011-06-24 17:20:50 +000043private:
44 void* fHWND;
45 bool fInvalEventIsPending;
46 void* fNotifier;
47 typedef SkWindow INHERITED;
48};
49
50#endif