Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
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 */
9 #ifndef SkOSWindow_MacCocoa_DEFINED
10 #define SkOSWindow_MacCocoa_DEFINED
12 #include "SkWindow.h"
14 class SkOSWindow : public SkWindow {
15 public:
16 SkOSWindow(void* hwnd);
17 ~SkOSWindow();
18 void* getHWND() const { return fHWND; }
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 };
29 struct AttachmentInfo {
30 int fSampleCount;
31 int fStencilBits;
32 };
34 void detach();
35 bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*);
36 void present();
38 protected:
39 // overrides from SkEventSink
40 virtual bool onEvent(const SkEvent& evt);
41 // overrides from SkWindow
42 virtual void onHandleInval(const SkIRect&);
43 // overrides from SkView
44 virtual void onAddMenu(const SkOSMenu*);
45 virtual void onUpdateMenu(const SkOSMenu*);
46 virtual void onSetTitle(const char[]);
48 private:
49 void* fHWND;
50 bool fInvalEventIsPending;
51 void* fNotifier;
52 #if SK_SUPPORT_GPU
53 void* fGLContext;
54 #endif
55 typedef SkWindow INHERITED;
56 };
58 #endif