diff options
author | 2011-08-08 18:38:58 +0000 | |
---|---|---|
committer | 2011-08-08 18:38:58 +0000 | |
commit | 42fd1e94bbc43ddb28df39c64efaf1883e303c4e (patch) | |
tree | e77d70a28da7454c30f9f8aa4b53410b398e6247 /experimental | |
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 'experimental')
-rw-r--r-- | experimental/CocoaSampleApp/SkOSWindow_Mac.h | 36 | ||||
-rw-r--r-- | experimental/CocoaSampleApp/SkOSWindow_Mac.mm | 66 |
2 files changed, 0 insertions, 102 deletions
diff --git a/experimental/CocoaSampleApp/SkOSWindow_Mac.h b/experimental/CocoaSampleApp/SkOSWindow_Mac.h deleted file mode 100644 index 612edc3e48..0000000000 --- a/experimental/CocoaSampleApp/SkOSWindow_Mac.h +++ /dev/null @@ -1,36 +0,0 @@ -#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/experimental/CocoaSampleApp/SkOSWindow_Mac.mm b/experimental/CocoaSampleApp/SkOSWindow_Mac.mm deleted file mode 100644 index dd94ea3995..0000000000 --- a/experimental/CocoaSampleApp/SkOSWindow_Mac.mm +++ /dev/null @@ -1,66 +0,0 @@ -#import <Cocoa/Cocoa.h> -#include "SkOSWindow_Mac.h" -#include "SkOSMenu.h" -#include "SkTypes.h" -#include "SkWindow.h" -#import "SkNSView.h" -#import "SkEventNotifier.h" -#define kINVAL_NSVIEW_EventType "inval-nsview" - -SkOSWindow::SkOSWindow(void* hWnd) : fHWND(hWnd) { - fInvalEventIsPending = false; - fGLContext = NULL; - fNotifier = [[SkEventNotifier alloc] init]; -} -SkOSWindow::~SkOSWindow() { - [(SkEventNotifier*)fNotifier release]; -} - -void SkOSWindow::onHandleInval(const SkIRect& r) { - if (!fInvalEventIsPending) { - fInvalEventIsPending = true; - (new SkEvent(kINVAL_NSVIEW_EventType, this->getSinkID()))->post(); - } -} - -bool SkOSWindow::onEvent(const SkEvent& evt) { - if (evt.isType(kINVAL_NSVIEW_EventType)) { - fInvalEventIsPending = false; - const SkIRect& r = this->getDirtyBounds(); - [(SkNSView*)fHWND postInvalWithRect:&r]; - [(NSOpenGLContext*)fGLContext update]; - return true; - } - if ([(SkNSView*)fHWND onHandleEvent:evt]) { - return true; - } - return this->INHERITED::onEvent(evt); -} - -bool SkOSWindow::onDispatchClick(int x, int y, Click::State state, void* owner) { - return this->INHERITED::onDispatchClick(x, y, state, owner); -} - -void SkOSWindow::onSetTitle(const char title[]) { - [(SkNSView*)fHWND setSkTitle:title]; -} - -void SkOSWindow::onAddMenu(const SkOSMenu* menu) { - [(SkNSView*)fHWND onAddMenu:menu]; -} - -void SkOSWindow::onUpdateMenu(const SkOSMenu* menu) { - [(SkNSView*)fHWND onUpdateMenu:menu]; -} - -bool SkOSWindow::attachGL() { - [(SkNSView*)fHWND attachGL]; -} - -void SkOSWindow::detachGL() { - [(SkNSView*)fHWND detachGL]; -} - -void SkOSWindow::presentGL() { - [(SkNSView*)fHWND presentGL]; -}
\ No newline at end of file |