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 // This file implements a X11 chromoting client. | 5 // This file implements a X11 chromoting client. |
6 | 6 |
7 #include <iostream> | 7 #include <iostream> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/stl_util-inl.h" | 11 #include "base/stl_util-inl.h" |
12 #include "remoting/client/host_connection.h" | 12 #include "remoting/client/host_connection.h" |
13 #include "remoting/client/client_util.h" | 13 #include "remoting/client/client_util.h" |
14 | 14 |
15 // Include Xlib at the end because it clashes with ClientMessage defined in | 15 // Include Xlib at the end because it clashes with ClientMessage defined in |
16 // the protocol buffer. | 16 // the protocol buffer. |
17 // x11_view.h also includes Xlib.h so put it behind all other headers but | 17 // x11_view.h also includes Xlib.h so put it behind all other headers but |
18 // before Xlib.h | 18 // before Xlib.h |
19 #include "remoting/client/x11_view.h" | 19 #include "remoting/client/x11_view.h" |
| 20 |
| 21 // Cursor defined in Quickdraw.h on mac conflicts with X.h. |
| 22 #if defined(OS_MAC) |
| 23 #define Cursor X11_Cursor |
| 24 #endif |
20 #include <X11/Xlib.h> | 25 #include <X11/Xlib.h> |
| 26 #if defined(OS_MAC) |
| 27 #undef Cursor |
| 28 #endif |
21 | 29 |
22 namespace remoting { | 30 namespace remoting { |
23 | 31 |
24 class X11Client : public base::RefCountedThreadSafe<X11Client>, | 32 class X11Client : public base::RefCountedThreadSafe<X11Client>, |
25 public HostConnection::EventHandler { | 33 public HostConnection::EventHandler { |
26 public: | 34 public: |
27 X11Client(std::string host_jid, std::string username, std::string auth_token) | 35 X11Client(std::string host_jid, std::string username, std::string auth_token) |
28 : display_(NULL), | 36 : display_(NULL), |
29 window_(0), | 37 window_(0), |
30 width_(0), | 38 width_(0), |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 261 |
254 if (!remoting::GetLoginInfo(host_jid, username, auth_token)) { | 262 if (!remoting::GetLoginInfo(host_jid, username, auth_token)) { |
255 std::cout << "Cannot obtain login info" << std::endl; | 263 std::cout << "Cannot obtain login info" << std::endl; |
256 return 1; | 264 return 1; |
257 } | 265 } |
258 | 266 |
259 scoped_refptr<remoting::X11Client> client = | 267 scoped_refptr<remoting::X11Client> client = |
260 new remoting::X11Client(host_jid, username, auth_token); | 268 new remoting::X11Client(host_jid, username, auth_token); |
261 client->Run(); | 269 client->Run(); |
262 } | 270 } |
OLD | NEW |