diff options
author | yangsu@google.com <yangsu@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-08 18:38:58 +0000 |
---|---|---|
committer | yangsu@google.com <yangsu@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-08 18:38:58 +0000 |
commit | 42fd1e94bbc43ddb28df39c64efaf1883e303c4e (patch) | |
tree | e77d70a28da7454c30f9f8aa4b53410b398e6247 /include/views | |
parent | c71174da7aa45de5efc60cf8fb26789f2d690f3e (diff) |
CocoaSampleApp no longer depends on SkOSWindow_Mac.h
./gyp_skia now builds CocoaSampleApp on Mac
http://codereview.appspot.com/4810084/
git-svn-id: http://skia.googlecode.com/svn/trunk@2063 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/views')
-rw-r--r-- | include/views/SkOSWindow_Mac_Cocoa.h | 36 | ||||
-rw-r--r-- | include/views/SkWindow.h | 4 |
2 files changed, 40 insertions, 0 deletions
diff --git a/include/views/SkOSWindow_Mac_Cocoa.h b/include/views/SkOSWindow_Mac_Cocoa.h new file mode 100644 index 0000000000..612edc3e48 --- /dev/null +++ b/include/views/SkOSWindow_Mac_Cocoa.h @@ -0,0 +1,36 @@ +#ifndef SkOSWindow_MacCocoa_DEFINED +#define SkOSWindow_MacCocoa_DEFINED + +#include "SkWindow.h" + +class SkOSWindow : public SkWindow { +public: + SkOSWindow(void* hwnd); + ~SkOSWindow(); + void* getHWND() const { return fHWND; } + + virtual bool onDispatchClick(int x, int y, Click::State state, + void* owner); + void detachGL(); + bool attachGL(); + void presentGL(); + +protected: + // overrides from SkEventSink + virtual bool onEvent(const SkEvent& evt); + // overrides from SkWindow + virtual void onHandleInval(const SkIRect&); + // overrides from SkView + virtual void onAddMenu(const SkOSMenu*); + virtual void onUpdateMenu(const SkOSMenu*); + virtual void onSetTitle(const char[]); + +private: + void* fHWND; + bool fInvalEventIsPending; + void* fNotifier; + void* fGLContext; + typedef SkWindow INHERITED; +}; + +#endif
\ No newline at end of file diff --git a/include/views/SkWindow.h b/include/views/SkWindow.h index eda928c948..6fc72cb912 100644 --- a/include/views/SkWindow.h +++ b/include/views/SkWindow.h @@ -105,7 +105,11 @@ private: #ifdef SK_USE_WXWIDGETS #include "SkOSWindow_wxwidgets.h" #elif defined(SK_BUILD_FOR_MAC) +#ifdef Sk_MAC_COCOA + #include "SkOSWindow_Mac_Cocoa.h" +#else #include "SkOSWindow_Mac.h" +#endif #elif defined(SK_BUILD_FOR_WIN) #include "SkOSWindow_Win.h" #elif defined(ANDROID) |