OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef REMOTING_CLIENT_MOUSE_INPUT_FILTER_H_ | |
6 #define REMOTING_CLIENT_MOUSE_INPUT_FILTER_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/compiler_specific.h" | |
10 #include "remoting/protocol/input_stub.h" | |
11 #include "third_party/skia/include/core/SkTypes.h" | |
12 #include "third_party/skia/include/core/SkSize.h" | |
13 | |
14 namespace remoting { | |
15 | |
16 // Filtering InputStub implementation which scales mouse events based on the | |
17 // supplied input and output dimensions, and clamps their coordinates to the | |
18 // output dimensions, before passing events on to |input_stub|. | |
19 class MouseInputFilter : public protocol::InputStub { | |
20 public: | |
21 explicit MouseInputFilter(protocol::InputStub* input_stub); | |
22 virtual ~MouseInputFilter(); | |
23 | |
24 // Specify the input dimensions for mouse events. | |
25 void set_input_size(const SkISize& size); | |
26 | |
27 // Specify the output dimensions. | |
28 void set_output_size(const SkISize& size); | |
29 | |
30 // InputStub interface. | |
31 virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE; | |
32 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE; | |
33 | |
34 private: | |
35 protocol::InputStub* input_stub_; | |
36 | |
37 SkISize input_max_; | |
38 SkISize output_max_; | |
39 | |
40 DISALLOW_COPY_AND_ASSIGN(MouseInputFilter); | |
41 }; | |
42 | |
43 } // namespace remoting | |
44 | |
45 #endif // REMOTING_CLIENT_MOUSE_INPUT_FILTER_H_ | |
OLD | NEW |