OLD | NEW |
| (Empty) |
1 // Copyright 2014 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_PLUGIN_EMPTY_CURSOR_FILTER_H_ | |
6 #define REMOTING_CLIENT_PLUGIN_EMPTY_CURSOR_FILTER_H_ | |
7 | |
8 #include "remoting/protocol/cursor_shape_stub.h" | |
9 | |
10 namespace remoting { | |
11 | |
12 // Returns an empty cursor. | |
13 protocol::CursorShapeInfo EmptyCursorShape(); | |
14 | |
15 // Returns true of the supplied cursor is empty, i.e. width and/or height <= 0. | |
16 bool IsCursorShapeEmpty(const protocol::CursorShapeInfo& cursor_shape); | |
17 | |
18 // Helper that checks whether a cursor has any visible pixels, and resizes | |
19 // it down to (0x0) if not. | |
20 // TODO(wez): Turn this into a general-purpose cropping filter that both | |
21 // client and host can use. | |
22 class EmptyCursorFilter : public protocol::CursorShapeStub { | |
23 public: | |
24 explicit EmptyCursorFilter(protocol::CursorShapeStub* cursor_stub); | |
25 ~EmptyCursorFilter() override; | |
26 | |
27 // protocol::CursorShapeStub interface. | |
28 void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) override; | |
29 | |
30 // Replaces the stub to which cursor shapes will be passed-on. | |
31 void set_cursor_stub(protocol::CursorShapeStub* cursor_stub) { | |
32 cursor_stub_ = cursor_stub; | |
33 } | |
34 | |
35 private: | |
36 protocol::CursorShapeStub* cursor_stub_; | |
37 | |
38 DISALLOW_COPY_AND_ASSIGN(EmptyCursorFilter); | |
39 }; | |
40 | |
41 } // namespace remoting | |
42 | |
43 #endif // REMOTING_CLIENT_PLUGIN_EMPTY_CURSOR_FILTER_H_ | |
OLD | NEW |