blob: 071d6db18cf66bc233c763bf04498b9375bdf462 [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
24 void detach();
bsalomon@google.com64cc8102013-03-05 20:06:05 +000025 bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*);
robertphillips@google.comb442a6d2012-04-02 19:24:21 +000026 void present();
yangsu@google.com1a2b4c12011-06-24 17:20:50 +000027
bsalomon85ab5512015-06-16 12:47:25 -070028 bool makeFullscreen() { return true; }
29 void closeWindow() { /* Not impl yet */ }
30 void setVsync(bool) { /* Can't turn off vsync? */ }
31
yangsu@google.com1a2b4c12011-06-24 17:20:50 +000032protected:
33 // overrides from SkEventSink
34 virtual bool onEvent(const SkEvent& evt);
35 // overrides from SkWindow
36 virtual void onHandleInval(const SkIRect&);
37 // overrides from SkView
38 virtual void onAddMenu(const SkOSMenu*);
caryclark@google.com867cbd82012-09-20 15:45:41 +000039 virtual void onUpdateMenu(SkOSMenu*);
yangsu@google.com1a2b4c12011-06-24 17:20:50 +000040 virtual void onSetTitle(const char[]);
rmistry@google.comfbfcd562012-08-23 18:09:54 +000041
yangsu@google.com1a2b4c12011-06-24 17:20:50 +000042private:
43 void* fHWND;
44 bool fInvalEventIsPending;
45 void* fNotifier;
46 typedef SkWindow INHERITED;
47};
48
49#endif