OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_ |
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 bool IsVisible() const; | 97 bool IsVisible() const; |
98 | 98 |
99 // Indicates whether the element should be tested for cursor input. | 99 // Indicates whether the element should be tested for cursor input. |
100 bool IsHitTestable() const; | 100 bool IsHitTestable() const; |
101 | 101 |
102 virtual void Render(VrShellRenderer* renderer, | 102 virtual void Render(VrShellRenderer* renderer, |
103 vr::Mat4f view_proj_matrix) const; | 103 vr::Mat4f view_proj_matrix) const; |
104 | 104 |
105 virtual void Initialize(); | 105 virtual void Initialize(); |
106 | 106 |
| 107 // Controller interaction methods. |
| 108 virtual void OnHoverEnter(); |
| 109 virtual void OnHoverLeave(); |
| 110 virtual void OnButtonDown(); |
| 111 virtual void OnButtonUp(); |
| 112 |
107 // Valid IDs are non-negative. | 113 // Valid IDs are non-negative. |
108 int id = -1; | 114 int id = -1; |
109 | 115 |
110 // Name string for debugging and testing purposes. | 116 // Name string for debugging and testing purposes. |
111 std::string name; | 117 std::string name; |
112 | 118 |
113 // If a non-negative parent ID is specified, applicable transformations | 119 // If a non-negative parent ID is specified, applicable transformations |
114 // are applied relative to the parent, rather than absolutely. | 120 // are applied relative to the parent, rather than absolutely. |
115 int parent_id = -1; | 121 int parent_id = -1; |
116 | 122 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // A flag usable during transformation calculates to avoid duplicate work. | 176 // A flag usable during transformation calculates to avoid duplicate work. |
171 bool dirty; | 177 bool dirty; |
172 | 178 |
173 private: | 179 private: |
174 DISALLOW_COPY_AND_ASSIGN(UiElement); | 180 DISALLOW_COPY_AND_ASSIGN(UiElement); |
175 }; | 181 }; |
176 | 182 |
177 } // namespace vr_shell | 183 } // namespace vr_shell |
178 | 184 |
179 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_ | 185 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_ |
OLD | NEW |