| 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 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 enum BackEndType { | 35 enum BackEndType { |
| 36 kNativeGL_BackendType, | 36 kNativeGL_BackendType, |
| 37 kVulkan_BackendType | 37 kVulkan_BackendType |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 virtual bool attach(BackEndType attachType, const DisplayParams& params) =
0; | 40 virtual bool attach(BackEndType attachType, const DisplayParams& params) =
0; |
| 41 void detach(); | 41 void detach(); |
| 42 | 42 |
| 43 // input handling | 43 // input handling |
| 44 enum Key { | 44 enum class Key { |
| 45 kNONE_Key, //corresponds to android's UNKNOWN | 45 kNONE, //corresponds to android's UNKNOWN |
| 46 | 46 |
| 47 kLeftSoftKey_Key, | 47 kLeftSoftKey, |
| 48 kRightSoftKey_Key, | 48 kRightSoftKey, |
| 49 | 49 |
| 50 kHome_Key, //!< the home key - added to match android | 50 kHome, //!< the home key - added to match android |
| 51 kBack_Key, //!< (CLR) | 51 kBack, //!< (CLR) |
| 52 kSend_Key, //!< the green (talk) key | 52 kSend, //!< the green (talk) key |
| 53 kEnd_Key, //!< the red key | 53 kEnd, //!< the red key |
| 54 | 54 |
| 55 k0_Key, | 55 k0, |
| 56 k1_Key, | 56 k1, |
| 57 k2_Key, | 57 k2, |
| 58 k3_Key, | 58 k3, |
| 59 k4_Key, | 59 k4, |
| 60 k5_Key, | 60 k5, |
| 61 k6_Key, | 61 k6, |
| 62 k7_Key, | 62 k7, |
| 63 k8_Key, | 63 k8, |
| 64 k9_Key, | 64 k9, |
| 65 kStar_Key, //!< the * key | 65 kStar, //!< the * key |
| 66 kHash_Key, //!< the # key | 66 kHash, //!< the # key |
| 67 | 67 |
| 68 kUp_Key, | 68 kUp, |
| 69 kDown_Key, | 69 kDown, |
| 70 kLeft_Key, | 70 kLeft, |
| 71 kRight_Key, | 71 kRight, |
| 72 | 72 |
| 73 kOK_Key, //!< the center key | 73 kOK, //!< the center key |
| 74 | 74 |
| 75 kVolUp_Key, //!< volume up - match android | 75 kVolUp, //!< volume up - match android |
| 76 kVolDown_Key, //!< volume down - same | 76 kVolDown, //!< volume down - same |
| 77 kPower_Key, //!< power button - same | 77 kPower, //!< power button - same |
| 78 kCamera_Key, //!< camera - same | 78 kCamera, //!< camera - same |
| 79 | 79 |
| 80 kLast_Key = kCamera_Key | 80 kLast = kCamera |
| 81 }; | 81 }; |
| 82 static const int kKeyCount = kLast_Key + 1; | 82 static const int kKeyCount = static_cast<int>(Key::kLast) + 1; |
| 83 | 83 |
| 84 enum ModifierKeys { | 84 enum ModifierKeys { |
| 85 kShift_ModifierKey = 1 << 0, | 85 kShift_ModifierKey = 1 << 0, |
| 86 kControl_ModifierKey = 1 << 1, | 86 kControl_ModifierKey = 1 << 1, |
| 87 kOption_ModifierKey = 1 << 2, // same as ALT | 87 kOption_ModifierKey = 1 << 2, // same as ALT |
| 88 kCommand_ModifierKey = 1 << 3, | 88 kCommand_ModifierKey = 1 << 3, |
| 89 kFirstPress_ModifierKey = 1 << 4, | 89 kFirstPress_ModifierKey = 1 << 4, |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 enum InputState { | 92 enum InputState { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 OnMouseFunc fMouseFunc; | 146 OnMouseFunc fMouseFunc; |
| 147 void* fMouseUserData; | 147 void* fMouseUserData; |
| 148 OnPaintFunc fPaintFunc; | 148 OnPaintFunc fPaintFunc; |
| 149 void* fPaintUserData; | 149 void* fPaintUserData; |
| 150 | 150 |
| 151 WindowContext* fWindowContext; | 151 WindowContext* fWindowContext; |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 } // namespace sk_app | 154 } // namespace sk_app |
| 155 #endif | 155 #endif |
| OLD | NEW |