OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2010 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } | 66 } |
67 PropertyType* data() { | 67 PropertyType* data() { |
68 return reinterpret_cast<PropertyType*>(data_); | 68 return reinterpret_cast<PropertyType*>(data_); |
69 } | 69 } |
70 | 70 |
71 private: | 71 private: |
72 bool succeeded_; | 72 bool succeeded_; |
73 unsigned long size_; // NOLINT: type required by XGetWindowProperty | 73 unsigned long size_; // NOLINT: type required by XGetWindowProperty |
74 unsigned char* data_; | 74 unsigned char* data_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(XWindowProperty); | 76 RTC_DISALLOW_COPY_AND_ASSIGN(XWindowProperty); |
77 }; | 77 }; |
78 | 78 |
79 // Stupid X11. It seems none of the synchronous returns codes from X11 calls | 79 // Stupid X11. It seems none of the synchronous returns codes from X11 calls |
80 // are meaningful unless an asynchronous error handler is configured. This | 80 // are meaningful unless an asynchronous error handler is configured. This |
81 // RAII class registers and unregisters an X11 error handler. | 81 // RAII class registers and unregisters an X11 error handler. |
82 class XErrorSuppressor { | 82 class XErrorSuppressor { |
83 public: | 83 public: |
84 explicit XErrorSuppressor(Display* display) | 84 explicit XErrorSuppressor(Display* display) |
85 : display_(display), original_error_handler_(NULL) { | 85 : display_(display), original_error_handler_(NULL) { |
86 SuppressX11Errors(); | 86 SuppressX11Errors(); |
(...skipping 24 matching lines...) Expand all Loading... |
111 if (handler != &ErrorHandler) { | 111 if (handler != &ErrorHandler) { |
112 LOG(LS_WARNING) << "Unbalanced XSetErrorHandler() calls detected. " | 112 LOG(LS_WARNING) << "Unbalanced XSetErrorHandler() calls detected. " |
113 << "Final error handler may not be what you expect!"; | 113 << "Final error handler may not be what you expect!"; |
114 } | 114 } |
115 original_error_handler_ = NULL; | 115 original_error_handler_ = NULL; |
116 } | 116 } |
117 | 117 |
118 Display* display_; | 118 Display* display_; |
119 XErrorHandler original_error_handler_; | 119 XErrorHandler original_error_handler_; |
120 | 120 |
121 DISALLOW_COPY_AND_ASSIGN(XErrorSuppressor); | 121 RTC_DISALLOW_COPY_AND_ASSIGN(XErrorSuppressor); |
122 }; | 122 }; |
123 | 123 |
124 // Hiding all X11 specifics inside its own class. This to avoid | 124 // Hiding all X11 specifics inside its own class. This to avoid |
125 // conflicts between talk and X11 header declarations. | 125 // conflicts between talk and X11 header declarations. |
126 class XWindowEnumerator { | 126 class XWindowEnumerator { |
127 public: | 127 public: |
128 XWindowEnumerator() | 128 XWindowEnumerator() |
129 : display_(NULL), | 129 : display_(NULL), |
130 has_composite_extension_(false), | 130 has_composite_extension_(false), |
131 has_render_extension_(false) { | 131 has_render_extension_(false) { |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 int height) { | 809 int height) { |
810 return enumerator_->GetDesktopThumbnail(id, width, height); | 810 return enumerator_->GetDesktopThumbnail(id, width, height); |
811 } | 811 } |
812 | 812 |
813 bool X11WindowPicker::GetDesktopDimensions(const DesktopId& id, int* width, | 813 bool X11WindowPicker::GetDesktopDimensions(const DesktopId& id, int* width, |
814 int* height) { | 814 int* height) { |
815 return enumerator_->GetDesktopDimensions(id, width, height); | 815 return enumerator_->GetDesktopDimensions(id, width, height); |
816 } | 816 } |
817 | 817 |
818 } // namespace rtc | 818 } // namespace rtc |
OLD | NEW |