OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_CLIENT_X11_VIEW_H_ | 5 #ifndef REMOTING_CLIENT_X11_VIEW_H_ |
6 #define REMOTING_CLIENT_X11_VIEW_H_ | 6 #define REMOTING_CLIENT_X11_VIEW_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
11 #include "remoting/client/decoder.h" | 11 #include "remoting/client/decoder.h" |
12 #include "remoting/client/chromoting_view.h" | 12 #include "remoting/client/chromoting_view.h" |
13 | 13 |
14 typedef unsigned long XID; | 14 typedef unsigned long XID; |
15 typedef struct _XDisplay Display; | 15 typedef struct _XDisplay Display; |
16 | 16 |
17 namespace remoting { | 17 namespace remoting { |
18 | 18 |
19 // A ChromotingView implemented using X11 and XRender. | 19 // A ChromotingView implemented using X11 and XRender. |
20 class X11View : public ChromotingView { | 20 class X11View : public ChromotingView { |
21 public: | 21 public: |
| 22 X11View(); // Delete this. |
22 X11View(Display* display, XID window, int width, int height); | 23 X11View(Display* display, XID window, int width, int height); |
23 | 24 |
24 virtual ~X11View(); | 25 virtual ~X11View(); |
25 | 26 |
26 // ChromotingView implementations. | 27 // ChromotingView implementations. |
| 28 virtual bool Initialize(); |
| 29 virtual void TearDown(); |
27 virtual void Paint(); | 30 virtual void Paint(); |
28 virtual void SetSolidFill(uint32 color); | 31 virtual void SetSolidFill(uint32 color); |
29 virtual void UnsetSolidFill(); | 32 virtual void UnsetSolidFill(); |
30 virtual void SetViewport(int x, int y, int width, int height); | 33 virtual void SetViewport(int x, int y, int width, int height); |
31 virtual void SetBackingStoreSize(int width, int height); | 34 virtual void SetHostScreenSize(int width, int height); |
32 virtual void HandleBeginUpdateStream(HostMessage* msg); | 35 virtual void HandleBeginUpdateStream(HostMessage* msg); |
33 virtual void HandleUpdateStreamPacket(HostMessage* msg); | 36 virtual void HandleUpdateStreamPacket(HostMessage* msg); |
34 virtual void HandleEndUpdateStream(HostMessage* msg) ; | 37 virtual void HandleEndUpdateStream(HostMessage* msg) ; |
35 | 38 |
| 39 Display* display() { return display_; } |
| 40 |
36 private: | 41 private: |
37 void InitPaintTarget(); | 42 void InitPaintTarget(); |
38 void OnPartialDecodeDone(); | 43 void OnPartialDecodeDone(); |
39 void OnDecodeDone(); | 44 void OnDecodeDone(); |
40 | 45 |
41 Display* display_; | 46 Display* display_; |
42 XID window_; | 47 XID window_; |
43 int width_; | 48 int width_; |
44 int height_; | 49 int height_; |
45 | 50 |
46 // A picture created in the X server that represents drawing area of the | 51 // A picture created in the X server that represents drawing area of the |
47 // window. | 52 // window. |
48 XID picture_; | 53 XID picture_; |
49 | 54 |
50 scoped_refptr<media::VideoFrame> frame_; | 55 scoped_refptr<media::VideoFrame> frame_; |
51 UpdatedRects update_rects_; | 56 UpdatedRects update_rects_; |
52 UpdatedRects all_update_rects_; | 57 UpdatedRects all_update_rects_; |
53 | 58 |
54 scoped_ptr<Decoder> decoder_; | 59 scoped_ptr<Decoder> decoder_; |
55 | 60 |
56 DISALLOW_COPY_AND_ASSIGN(X11View); | 61 DISALLOW_COPY_AND_ASSIGN(X11View); |
57 }; | 62 }; |
58 | 63 |
59 } // namespace remoting | 64 } // namespace remoting |
60 | 65 |
61 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::X11View); | 66 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::X11View); |
62 | 67 |
63 #endif // REMOTING_CLIENT_X11_VIEW_H_ | 68 #endif // REMOTING_CLIENT_X11_VIEW_H_ |
OLD | NEW |