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