OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef Window_DEFINED | 8 #ifndef Window_DEFINED |
9 #define Window_DEFINED | 9 #define Window_DEFINED |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 virtual ~Window() {}; | 25 virtual ~Window() {}; |
26 | 26 |
27 virtual void setTitle(const char*) = 0; | 27 virtual void setTitle(const char*) = 0; |
28 virtual void show() = 0; | 28 virtual void show() = 0; |
29 virtual void inval() = 0; | 29 virtual void inval() = 0; |
30 | 30 |
31 virtual bool scaleContentToFit() const { return false; } | 31 virtual bool scaleContentToFit() const { return false; } |
32 virtual bool supportsContentRect() const { return false; } | 32 virtual bool supportsContentRect() const { return false; } |
33 virtual SkRect getContentRect() { return SkRect::MakeEmpty(); } | 33 virtual SkRect getContentRect() { return SkRect::MakeEmpty(); } |
34 | 34 |
35 enum BackendType { | 35 enum BackEndType { |
36 kNativeGL_BackendType, | 36 kNativeGL_BackendType, |
37 kVulkan_BackendType, | 37 kVulkan_BackendType |
38 | |
39 kLast_BackendType = kVulkan_BackendType | |
40 }; | |
41 enum { | |
42 kBackendTypeCount = kLast_BackendType + 1 | |
43 }; | 38 }; |
44 | 39 |
45 virtual bool attach(BackendType attachType, const DisplayParams& params) =
0; | 40 virtual bool attach(BackEndType attachType, const DisplayParams& params) =
0; |
46 void detach(); | 41 void detach(); |
47 | 42 |
48 // input handling | 43 // input handling |
49 enum class Key { | 44 enum class Key { |
50 kNONE, //corresponds to android's UNKNOWN | 45 kNONE, //corresponds to android's UNKNOWN |
51 | 46 |
52 kLeftSoftKey, | 47 kLeftSoftKey, |
53 kRightSoftKey, | 48 kRightSoftKey, |
54 | 49 |
55 kHome, //!< the home key - added to match android | 50 kHome, //!< the home key - added to match android |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 OnMouseFunc fMouseFunc; | 146 OnMouseFunc fMouseFunc; |
152 void* fMouseUserData; | 147 void* fMouseUserData; |
153 OnPaintFunc fPaintFunc; | 148 OnPaintFunc fPaintFunc; |
154 void* fPaintUserData; | 149 void* fPaintUserData; |
155 | 150 |
156 WindowContext* fWindowContext; | 151 WindowContext* fWindowContext; |
157 }; | 152 }; |
158 | 153 |
159 } // namespace sk_app | 154 } // namespace sk_app |
160 #endif | 155 #endif |
OLD | NEW |