Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: tools/viewer/sk_app/Window.h

Issue 1955293002: Add flexible keybinding/command system to sk_app (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Extract keybinding system as CommandSet. Add grouping and two help modes. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 {
bsalomon 2016/05/09 20:25:53 When we use enum class we drop the _<Type> suffix
45 kNONE_Key, //corresponds to android's UNKNOWN 45 kNONE_Key, //corresponds to android's UNKNOWN
46 46
47 kLeftSoftKey_Key, 47 kLeftSoftKey_Key,
48 kRightSoftKey_Key, 48 kRightSoftKey_Key,
49 49
50 kHome_Key, //!< the home key - added to match android 50 kHome_Key, //!< the home key - added to match android
51 kBack_Key, //!< (CLR) 51 kBack_Key, //!< (CLR)
52 kSend_Key, //!< the green (talk) key 52 kSend_Key, //!< the green (talk) key
53 kEnd_Key, //!< the red key 53 kEnd_Key, //!< the red key
54 54
(...skipping 17 matching lines...) Expand all
72 72
73 kOK_Key, //!< the center key 73 kOK_Key, //!< the center key
74 74
75 kVolUp_Key, //!< volume up - match android 75 kVolUp_Key, //!< volume up - match android
76 kVolDown_Key, //!< volume down - same 76 kVolDown_Key, //!< volume down - same
77 kPower_Key, //!< power button - same 77 kPower_Key, //!< power button - same
78 kCamera_Key, //!< camera - same 78 kCamera_Key, //!< camera - same
79 79
80 kLast_Key = kCamera_Key 80 kLast_Key = kCamera_Key
81 }; 81 };
82 static const int kKeyCount = kLast_Key + 1; 82 static const int kKeyCount = static_cast<int>(Key::kLast_Key) + 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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698