1 
2 /*
3  * Copyright 2006 The Android Open Source Project
4  *
5  * Use of this source code is governed by a BSD-style license that can be
6  * found in the LICENSE file.
7  */
8 
9 #ifndef SkOSWindow_MacCocoa_DEFINED
10 #define SkOSWindow_MacCocoa_DEFINED
11 
12 #include "SkWindow.h"
13 
14 class SkOSWindow : public SkWindow {
15 public:
16     SkOSWindow(void* hwnd);
17     ~SkOSWindow();
getHWND()18     void*   getHWND() const { return fHWND; }
19 
20     virtual bool onDispatchClick(int x, int y, Click::State state,
21                                  void* owner, unsigned modi);
22     enum SkBackEndTypes {
23         kNone_BackEndType,
24 #if SK_SUPPORT_GPU
25         kNativeGL_BackEndType,
26 #endif
27     };
28 
29     void    detach();
30     bool    attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*);
31     void    present();
32 
33 protected:
34     // overrides from SkEventSink
35     virtual bool onEvent(const SkEvent& evt);
36     // overrides from SkWindow
37     virtual void onHandleInval(const SkIRect&);
38     // overrides from SkView
39     virtual void onAddMenu(const SkOSMenu*);
40     virtual void onUpdateMenu(const SkOSMenu*);
41     virtual void onSetTitle(const char[]);
42 
43 private:
44     void*   fHWND;
45     bool    fInvalEventIsPending;
46     void*   fNotifier;
47 #if SK_SUPPORT_GPU
48     void*   fGLContext;
49 #endif
50     typedef SkWindow INHERITED;
51 };
52 
53 #endif
54