| 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 struct _XDisplay Display; | 15 typedef struct _XDisplay Display; |
| 15 | 16 |
| 16 namespace remoting { | 17 namespace remoting { |
| 17 | 18 |
| 18 // A ChromotingView implemented using X11 and XRender. | 19 // A ChromotingView implemented using X11 and XRender. |
| 19 class X11View : public ChromotingView { | 20 class X11View : public ChromotingView { |
| 20 public: | 21 public: |
| 21 X11View(Display* display, int window, int width, int height); | 22 X11View(Display* display, XID window, int width, int height); |
| 22 | 23 |
| 23 virtual ~X11View(); | 24 virtual ~X11View(); |
| 24 | 25 |
| 25 // ChromotingView implementations. | 26 // ChromotingView implementations. |
| 26 virtual void Paint(); | 27 virtual void Paint(); |
| 27 virtual void HandleBeginUpdateStream(HostMessage* msg); | 28 virtual void HandleBeginUpdateStream(HostMessage* msg); |
| 28 virtual void HandleUpdateStreamPacket(HostMessage* msg); | 29 virtual void HandleUpdateStreamPacket(HostMessage* msg); |
| 29 virtual void HandleEndUpdateStream(HostMessage* msg) ; | 30 virtual void HandleEndUpdateStream(HostMessage* msg) ; |
| 30 | 31 |
| 31 private: | 32 private: |
| 32 void InitPaintTarget(); | 33 void InitPaintTarget(); |
| 33 void OnPartialDecodeDone(); | 34 void OnPartialDecodeDone(); |
| 34 void OnDecodeDone(); | 35 void OnDecodeDone(); |
| 35 | 36 |
| 36 Display* display_; | 37 Display* display_; |
| 37 int window_; | 38 XID window_; |
| 38 int width_; | 39 int width_; |
| 39 int height_; | 40 int height_; |
| 40 | 41 |
| 41 // A picture created in the X server that represents drawing area of the | 42 // A picture created in the X server that represents drawing area of the |
| 42 // window. | 43 // window. |
| 43 int picture_; | 44 XID picture_; |
| 44 | 45 |
| 45 scoped_refptr<media::VideoFrame> frame_; | 46 scoped_refptr<media::VideoFrame> frame_; |
| 46 UpdatedRects update_rects_; | 47 UpdatedRects update_rects_; |
| 47 UpdatedRects all_update_rects_; | 48 UpdatedRects all_update_rects_; |
| 48 | 49 |
| 49 scoped_ptr<Decoder> decoder_; | 50 scoped_ptr<Decoder> decoder_; |
| 50 | 51 |
| 51 DISALLOW_COPY_AND_ASSIGN(X11View); | 52 DISALLOW_COPY_AND_ASSIGN(X11View); |
| 52 }; | 53 }; |
| 53 | 54 |
| 54 } // namespace remoting | 55 } // namespace remoting |
| 55 | 56 |
| 56 #endif // REMOTING_CLIENT_X11_VIEW_H_ | 57 #endif // REMOTING_CLIENT_X11_VIEW_H_ |
| OLD | NEW |