OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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/SkSize.h" |
| 12 |
| 13 namespace remoting { |
| 14 |
| 15 // Filtering InputStub implementation which scales mouse events based on the |
| 16 // supplied input and output dimensions, and clamps their coordinates to the |
| 17 // output dimensions, before passing events on to |input_stub|. |
| 18 class MouseInputFilter : public protocol::InputStub { |
| 19 public: |
| 20 MouseInputFilter(protocol::InputStub* input_stub); |
| 21 virtual ~MouseInputFilter(); |
| 22 |
| 23 // Specify the input dimensions for mouse events. |
| 24 void set_input_size(const SkISize& size); |
| 25 |
| 26 // Specify the output dimensions. |
| 27 void set_output_size(const SkISize& size); |
| 28 |
| 29 // InputStub interface. |
| 30 virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE; |
| 31 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE; |
| 32 |
| 33 private: |
| 34 protocol::InputStub* input_stub_; |
| 35 |
| 36 SkISize input_size_; |
| 37 SkISize output_size_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(MouseInputFilter); |
| 40 }; |
| 41 |
| 42 } // namespace remoting |
| 43 |
| 44 #endif // REMOTING_CLIENT_MOUSE_INPUT_FILTER_H_ |
OLD | NEW |