2011-07-28 14:26:00 +00:00
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
/*
|
2011-07-28 14:26:00 +00:00
|
|
|
* Copyright 2006 The Android Open Source Project
|
2008-12-17 15:59:43 +00:00
|
|
|
*
|
2011-07-28 14:26:00 +00:00
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
2008-12-17 15:59:43 +00:00
|
|
|
*/
|
|
|
|
|
2011-08-30 14:40:49 +00:00
|
|
|
#ifndef SkOSWindow_MacCocoa_DEFINED
|
|
|
|
#define SkOSWindow_MacCocoa_DEFINED
|
2011-07-28 14:26:00 +00:00
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
#include "SkWindow.h"
|
|
|
|
|
|
|
|
class SkOSWindow : public SkWindow {
|
|
|
|
public:
|
|
|
|
SkOSWindow(void* hwnd);
|
2011-08-30 14:40:49 +00:00
|
|
|
~SkOSWindow();
|
2008-12-17 15:59:43 +00:00
|
|
|
void* getHWND() const { return fHWND; }
|
2012-04-03 18:03:03 +00:00
|
|
|
|
2011-08-30 14:40:49 +00:00
|
|
|
virtual bool onDispatchClick(int x, int y, Click::State state,
|
|
|
|
void* owner);
|
2012-04-02 19:24:21 +00:00
|
|
|
enum SkBackEndTypes {
|
|
|
|
kNone_BackEndType,
|
|
|
|
kNativeGL_BackEndType,
|
|
|
|
};
|
|
|
|
|
|
|
|
void detach();
|
2012-04-03 18:03:03 +00:00
|
|
|
bool attach(SkBackEndTypes attachType, int msaaSampleCount);
|
2012-04-02 19:24:21 +00:00
|
|
|
void present();
|
2012-04-03 18:03:03 +00:00
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
protected:
|
2008-12-19 18:24:35 +00:00
|
|
|
// overrides from SkEventSink
|
|
|
|
virtual bool onEvent(const SkEvent& evt);
|
2008-12-17 15:59:43 +00:00
|
|
|
// overrides from SkWindow
|
|
|
|
virtual void onHandleInval(const SkIRect&);
|
|
|
|
// overrides from SkView
|
|
|
|
virtual void onAddMenu(const SkOSMenu*);
|
2011-08-30 14:40:49 +00:00
|
|
|
virtual void onUpdateMenu(const SkOSMenu*);
|
2008-12-17 15:59:43 +00:00
|
|
|
virtual void onSetTitle(const char[]);
|
2010-12-20 18:26:13 +00:00
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
private:
|
|
|
|
void* fHWND;
|
2011-08-30 14:40:49 +00:00
|
|
|
bool fInvalEventIsPending;
|
|
|
|
void* fNotifier;
|
|
|
|
void* fGLContext;
|
2008-12-17 15:59:43 +00:00
|
|
|
typedef SkWindow INHERITED;
|
|
|
|
};
|
|
|
|
|
2011-11-23 14:54:19 +00:00
|
|
|
#endif
|