blob: b340b884292ffc54b6e40c372a44028c171baea0 [file] [log] [blame]
henrike@webrtc.orgf0488722014-05-13 18:00:26 +00001/*
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>.
19struct _XDisplay;
20typedef unsigned long Window;
21
22namespace rtc {
23
24class XWindowEnumerator;
25
henrike@webrtc.orgfb1eb432014-08-15 14:44:13 +000026class X11WindowPicker : public WindowPicker {
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000027 public:
henrike@webrtc.orgfb1eb432014-08-15 14:44:13 +000028 X11WindowPicker();
kwiberg@webrtc.org67186fe2015-03-09 22:21:53 +000029 ~X11WindowPicker() override;
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000030
31 static bool IsDesktopElement(_XDisplay* display, Window window);
32
kwiberg@webrtc.org67186fe2015-03-09 22:21:53 +000033 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.orgf0488722014-05-13 18:00:26 +000041 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_