• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
26 class X11WindowPicker : public WindowPicker {
27  public:
28   X11WindowPicker();
29   ~X11WindowPicker();
30 
31   static bool IsDesktopElement(_XDisplay* display, Window window);
32 
33   virtual bool Init();
34   virtual bool IsVisible(const WindowId& id);
35   virtual bool MoveToFront(const WindowId& id);
36   virtual bool GetWindowList(WindowDescriptionList* descriptions);
37   virtual bool GetDesktopList(DesktopDescriptionList* descriptions);
38   virtual bool GetDesktopDimensions(const DesktopId& id, int* width,
39                                     int* height);
40   uint8* GetWindowIcon(const WindowId& id, int* width, int* height);
41   uint8* GetWindowThumbnail(const WindowId& id, int width, int height);
42   int GetNumDesktops();
43   uint8* GetDesktopThumbnail(const DesktopId& id, int width, int height);
44 
45  private:
46   scoped_ptr<XWindowEnumerator> enumerator_;
47 };
48 
49 }  // namespace rtc
50 
51 #endif  // WEBRTC_BASE_LINUXWINDOWPICKER_H_
52