blob: a1c4956be9be5ef92fa3a228073cd94c76f5d205 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
2/*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
yangsu@google.com1a2b4c12011-06-24 17:20:50 +00008#ifndef SkOSWindow_iOS_DEFINED
9#define SkOSWindow_iOS_DEFINED
10
11#include "SkWindow.h"
yangsu@google.come938b192011-08-02 13:23:15 +000012
yangsu@google.com1a2b4c12011-06-24 17:20:50 +000013class SkOSWindow : public SkWindow {
14public:
15 SkOSWindow(void* hwnd);
16 ~SkOSWindow();
17 void* getHWND() const { return fHWND; }
18
rmistry@google.comfbfcd562012-08-23 18:09:54 +000019 virtual bool onDispatchClick(int x, int y, Click::State state,
yangsu@google.com6eece452011-07-07 19:45:39 +000020 void* owner);
robertphillips@google.comb442a6d2012-04-02 19:24:21 +000021
22 enum SkBackEndTypes {
23 kNone_BackEndType,
24 kNativeGL_BackEndType,
25 };
26
27 void detach();
bsalomon@google.com11959252012-04-06 20:13:38 +000028 bool attach(SkBackEndTypes attachType, int msaaSampleCount);
robertphillips@google.comb442a6d2012-04-02 19:24:21 +000029 void present();
yangsu@google.com1a2b4c12011-06-24 17:20:50 +000030
31protected:
32 // overrides from SkEventSink
33 virtual bool onEvent(const SkEvent& evt);
34 // overrides from SkWindow
35 virtual void onHandleInval(const SkIRect&);
36 // overrides from SkView
37 virtual void onAddMenu(const SkOSMenu*);
yangsu@google.come938b192011-08-02 13:23:15 +000038 virtual void onUpdateMenu(const SkOSMenu*);
yangsu@google.com1a2b4c12011-06-24 17:20:50 +000039 virtual void onSetTitle(const char[]);
rmistry@google.comfbfcd562012-08-23 18:09:54 +000040
yangsu@google.com1a2b4c12011-06-24 17:20:50 +000041private:
42 void* fHWND;
43 bool fInvalEventIsPending;
44 void* fNotifier;
45 typedef SkWindow INHERITED;
46};
47
48#endif
49