OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_AURA_WINDOW_TREE_HOST_H_ | 5 #ifndef UI_AURA_WINDOW_TREE_HOST_H_ |
6 #define UI_AURA_WINDOW_TREE_HOST_H_ | 6 #define UI_AURA_WINDOW_TREE_HOST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/event_types.h" | 10 #include "base/event_types.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "ui/aura/aura_export.h" | 12 #include "ui/aura/aura_export.h" |
| 13 #include "ui/aura/touch_ctm.h" |
13 #include "ui/base/cursor/cursor.h" | 14 #include "ui/base/cursor/cursor.h" |
14 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
15 | 16 |
16 namespace gfx { | 17 namespace gfx { |
17 class Insets; | 18 class Insets; |
18 class Point; | 19 class Point; |
19 class Rect; | 20 class Rect; |
20 class Size; | 21 class Size; |
21 class Transform; | 22 class Transform; |
22 } | 23 } |
(...skipping 27 matching lines...) Expand all Loading... |
50 | 51 |
51 ui::Compositor* compositor() { return compositor_.get(); } | 52 ui::Compositor* compositor() { return compositor_.get(); } |
52 | 53 |
53 void SetRootWindowTransformer(scoped_ptr<RootWindowTransformer> transformer); | 54 void SetRootWindowTransformer(scoped_ptr<RootWindowTransformer> transformer); |
54 gfx::Transform GetRootTransform() const; | 55 gfx::Transform GetRootTransform() const; |
55 | 56 |
56 void SetTransform(const gfx::Transform& transform); | 57 void SetTransform(const gfx::Transform& transform); |
57 | 58 |
58 gfx::Transform GetInverseRootTransform() const; | 59 gfx::Transform GetInverseRootTransform() const; |
59 | 60 |
| 61 void SetTouchCTM(int touch_device_id, const TouchCTM& ctm) { |
| 62 touch_ctm_map_[touch_device_id] = ctm; |
| 63 } |
| 64 void ClearTouchCTM() { touch_ctm_map_.clear(); } |
| 65 |
| 66 std::map<int, TouchCTM>* GetTouchCTMMap() { |
| 67 return &touch_ctm_map_; |
| 68 } |
| 69 |
60 // Updates the root window's size using |host_size|, current | 70 // Updates the root window's size using |host_size|, current |
61 // transform and insets. | 71 // transform and insets. |
62 void UpdateRootWindowSize(const gfx::Size& host_size); | 72 void UpdateRootWindowSize(const gfx::Size& host_size); |
63 | 73 |
64 // Returns the actual size of the screen. | 74 // Returns the actual size of the screen. |
65 // (gfx::Screen only reports on the virtual desktop exposed by Aura.) | 75 // (gfx::Screen only reports on the virtual desktop exposed by Aura.) |
66 static gfx::Size GetNativeScreenSize(); | 76 static gfx::Size GetNativeScreenSize(); |
67 | 77 |
68 void set_delegate(WindowTreeHostDelegate* delegate) { | 78 void set_delegate(WindowTreeHostDelegate* delegate) { |
69 delegate_ = delegate; | 79 delegate_ = delegate; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 virtual void SetCursorNative(gfx::NativeCursor cursor) = 0; | 183 virtual void SetCursorNative(gfx::NativeCursor cursor) = 0; |
174 | 184 |
175 // Moves the cursor to the specified location relative to the root window. | 185 // Moves the cursor to the specified location relative to the root window. |
176 virtual void MoveCursorToNative(const gfx::Point& location) = 0; | 186 virtual void MoveCursorToNative(const gfx::Point& location) = 0; |
177 | 187 |
178 // kCalled when the cursor visibility has changed. | 188 // kCalled when the cursor visibility has changed. |
179 virtual void OnCursorVisibilityChangedNative(bool show) = 0; | 189 virtual void OnCursorVisibilityChangedNative(bool show) = 0; |
180 | 190 |
181 WindowTreeHostDelegate* delegate_; | 191 WindowTreeHostDelegate* delegate_; |
182 | 192 |
| 193 // TouchCTM indexed by touch device id. |
| 194 std::map<int, TouchCTM> touch_ctm_map_; |
| 195 |
183 private: | 196 private: |
184 // Moves the cursor to the specified location. This method is internally used | 197 // Moves the cursor to the specified location. This method is internally used |
185 // by MoveCursorTo() and MoveCursorToHostLocation(). | 198 // by MoveCursorTo() and MoveCursorToHostLocation(). |
186 void MoveCursorToInternal(const gfx::Point& root_location, | 199 void MoveCursorToInternal(const gfx::Point& root_location, |
187 const gfx::Point& host_location); | 200 const gfx::Point& host_location); |
188 | 201 |
189 scoped_ptr<ui::Compositor> compositor_; | 202 scoped_ptr<ui::Compositor> compositor_; |
190 | 203 |
191 scoped_ptr<RootWindowTransformer> transformer_; | 204 scoped_ptr<RootWindowTransformer> transformer_; |
192 | 205 |
193 // Last cursor set. Used for testing. | 206 // Last cursor set. Used for testing. |
194 gfx::NativeCursor last_cursor_; | 207 gfx::NativeCursor last_cursor_; |
195 | 208 |
196 DISALLOW_COPY_AND_ASSIGN(WindowTreeHost); | 209 DISALLOW_COPY_AND_ASSIGN(WindowTreeHost); |
197 }; | 210 }; |
198 | 211 |
199 } // namespace aura | 212 } // namespace aura |
200 | 213 |
201 #endif // UI_AURA_WINDOW_TREE_HOST_H_ | 214 #endif // UI_AURA_WINDOW_TREE_HOST_H_ |
OLD | NEW |