epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
| 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.com | 1a2b4c1 | 2011-06-24 17:20:50 +0000 | [diff] [blame] | 8 | #ifndef SkOSWindow_iOS_DEFINED |
| 9 | #define SkOSWindow_iOS_DEFINED |
| 10 | |
| 11 | #include "SkWindow.h" |
yangsu@google.com | e938b19 | 2011-08-02 13:23:15 +0000 | [diff] [blame] | 12 | |
yangsu@google.com | 1a2b4c1 | 2011-06-24 17:20:50 +0000 | [diff] [blame] | 13 | class SkOSWindow : public SkWindow { |
| 14 | public: |
| 15 | SkOSWindow(void* hwnd); |
| 16 | ~SkOSWindow(); |
| 17 | void* getHWND() const { return fHWND; } |
| 18 | |
robertphillips@google.com | b442a6d | 2012-04-02 19:24:21 +0000 | [diff] [blame] | 19 | enum SkBackEndTypes { |
| 20 | kNone_BackEndType, |
| 21 | kNativeGL_BackEndType, |
| 22 | }; |
| 23 | |
bsalomon@google.com | 64cc810 | 2013-03-05 20:06:05 +0000 | [diff] [blame] | 24 | struct AttachmentInfo { |
| 25 | int fSampleCount; |
| 26 | int fStencilBits; |
| 27 | }; |
| 28 | |
robertphillips@google.com | b442a6d | 2012-04-02 19:24:21 +0000 | [diff] [blame] | 29 | void detach(); |
bsalomon@google.com | 64cc810 | 2013-03-05 20:06:05 +0000 | [diff] [blame] | 30 | bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*); |
robertphillips@google.com | b442a6d | 2012-04-02 19:24:21 +0000 | [diff] [blame] | 31 | void present(); |
yangsu@google.com | 1a2b4c1 | 2011-06-24 17:20:50 +0000 | [diff] [blame] | 32 | |
| 33 | protected: |
| 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*); |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 40 | virtual void onUpdateMenu(SkOSMenu*); |
yangsu@google.com | 1a2b4c1 | 2011-06-24 17:20:50 +0000 | [diff] [blame] | 41 | virtual void onSetTitle(const char[]); |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 42 | |
yangsu@google.com | 1a2b4c1 | 2011-06-24 17:20:50 +0000 | [diff] [blame] | 43 | private: |
| 44 | void* fHWND; |
| 45 | bool fInvalEventIsPending; |
| 46 | void* fNotifier; |
| 47 | typedef SkWindow INHERITED; |
| 48 | }; |
| 49 | |
| 50 | #endif |