henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2010 The WebRTC Project Authors. All rights reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef WEBRTC_BASE_LINUXWINDOWPICKER_H_ |
| 12 | #define WEBRTC_BASE_LINUXWINDOWPICKER_H_ |
| 13 | |
| 14 | #include "webrtc/base/basictypes.h" |
| 15 | #include "webrtc/base/scoped_ptr.h" |
| 16 | #include "webrtc/base/windowpicker.h" |
| 17 | |
| 18 | // Avoid include <X11/Xlib.h>. |
| 19 | struct _XDisplay; |
| 20 | typedef unsigned long Window; |
| 21 | |
| 22 | namespace rtc { |
| 23 | |
| 24 | class XWindowEnumerator; |
| 25 | |
henrike@webrtc.org | fb1eb43 | 2014-08-15 14:44:13 +0000 | [diff] [blame] | 26 | class X11WindowPicker : public WindowPicker { |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 +0000 | [diff] [blame] | 27 | public: |
henrike@webrtc.org | fb1eb43 | 2014-08-15 14:44:13 +0000 | [diff] [blame] | 28 | X11WindowPicker(); |
kwiberg@webrtc.org | 67186fe | 2015-03-09 22:21:53 +0000 | [diff] [blame^] | 29 | ~X11WindowPicker() override; |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 +0000 | [diff] [blame] | 30 | |
| 31 | static bool IsDesktopElement(_XDisplay* display, Window window); |
| 32 | |
kwiberg@webrtc.org | 67186fe | 2015-03-09 22:21:53 +0000 | [diff] [blame^] | 33 | bool Init() override; |
| 34 | bool IsVisible(const WindowId& id) override; |
| 35 | bool MoveToFront(const WindowId& id) override; |
| 36 | bool GetWindowList(WindowDescriptionList* descriptions) override; |
| 37 | bool GetDesktopList(DesktopDescriptionList* descriptions) override; |
| 38 | bool GetDesktopDimensions(const DesktopId& id, |
| 39 | int* width, |
| 40 | int* height) override; |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 +0000 | [diff] [blame] | 41 | uint8* GetWindowIcon(const WindowId& id, int* width, int* height); |
| 42 | uint8* GetWindowThumbnail(const WindowId& id, int width, int height); |
| 43 | int GetNumDesktops(); |
| 44 | uint8* GetDesktopThumbnail(const DesktopId& id, int width, int height); |
| 45 | |
| 46 | private: |
| 47 | scoped_ptr<XWindowEnumerator> enumerator_; |
| 48 | }; |
| 49 | |
| 50 | } // namespace rtc |
| 51 | |
| 52 | #endif // WEBRTC_BASE_LINUXWINDOWPICKER_H_ |