blob: e27e7562f0133e910da0e7771a0936fd239eddae [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
reed@android.com8a1c16f2008-12-17 15:59:43 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * Copyright 2006 The Android Open Source Project
reed@android.com8a1c16f2008-12-17 15:59:43 +00004 *
epoger@google.comec3ed6a2011-07-28 14:26:00 +00005 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
reed@android.com8a1c16f2008-12-17 15:59:43 +00007 */
8
yangsu@google.coma8540412011-08-30 14:40:49 +00009#ifndef SkOSWindow_MacCocoa_DEFINED
10#define SkOSWindow_MacCocoa_DEFINED
epoger@google.comec3ed6a2011-07-28 14:26:00 +000011
reed@android.com8a1c16f2008-12-17 15:59:43 +000012#include "SkWindow.h"
13
14class SkOSWindow : public SkWindow {
15public:
16 SkOSWindow(void* hwnd);
yangsu@google.coma8540412011-08-30 14:40:49 +000017 ~SkOSWindow();
reed@android.com8a1c16f2008-12-17 15:59:43 +000018 void* getHWND() const { return fHWND; }
yangsu@google.coma8540412011-08-30 14:40:49 +000019
20 virtual bool onDispatchClick(int x, int y, Click::State state,
21 void* owner);
22 void detachGL();
23 bool attachGL();
24 void presentGL();
25
reed@android.com8a1c16f2008-12-17 15:59:43 +000026protected:
reed@android.com6efdc472008-12-19 18:24:35 +000027 // overrides from SkEventSink
28 virtual bool onEvent(const SkEvent& evt);
reed@android.com8a1c16f2008-12-17 15:59:43 +000029 // overrides from SkWindow
30 virtual void onHandleInval(const SkIRect&);
31 // overrides from SkView
32 virtual void onAddMenu(const SkOSMenu*);
yangsu@google.coma8540412011-08-30 14:40:49 +000033 virtual void onUpdateMenu(const SkOSMenu*);
reed@android.com8a1c16f2008-12-17 15:59:43 +000034 virtual void onSetTitle(const char[]);
reed@android.comf2b98d62010-12-20 18:26:13 +000035
reed@android.com8a1c16f2008-12-17 15:59:43 +000036private:
37 void* fHWND;
yangsu@google.coma8540412011-08-30 14:40:49 +000038 bool fInvalEventIsPending;
39 void* fNotifier;
40 void* fGLContext;
reed@android.com8a1c16f2008-12-17 15:59:43 +000041 typedef SkWindow INHERITED;
42};
43
yangsu@google.coma8540412011-08-30 14:40:49 +000044#endif