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 | |
yangsu@google.com | 6eece45 | 2011-07-07 19:45:39 +0000 | [diff] [blame] | 19 | virtual bool onDispatchClick(int x, int y, Click::State state, |
| 20 | void* owner); |
yangsu@google.com | 1a2b4c1 | 2011-06-24 17:20:50 +0000 | [diff] [blame] | 21 | void detachGL(); |
| 22 | bool attachGL(); |
| 23 | void presentGL(); |
| 24 | |
| 25 | protected: |
| 26 | // overrides from SkEventSink |
| 27 | virtual bool onEvent(const SkEvent& evt); |
| 28 | // overrides from SkWindow |
| 29 | virtual void onHandleInval(const SkIRect&); |
| 30 | // overrides from SkView |
| 31 | virtual void onAddMenu(const SkOSMenu*); |
yangsu@google.com | e938b19 | 2011-08-02 13:23:15 +0000 | [diff] [blame^] | 32 | virtual void onUpdateMenu(const SkOSMenu*); |
yangsu@google.com | 1a2b4c1 | 2011-06-24 17:20:50 +0000 | [diff] [blame] | 33 | virtual void onSetTitle(const char[]); |
| 34 | |
| 35 | private: |
| 36 | void* fHWND; |
| 37 | bool fInvalEventIsPending; |
| 38 | void* fNotifier; |
| 39 | typedef SkWindow INHERITED; |
| 40 | }; |
| 41 | |
| 42 | #endif |
| 43 | |