| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_COMMON_X11_UTIL_H_ | 5 #ifndef CHROME_COMMON_X11_UTIL_H_ |
| 6 #define CHROME_COMMON_X11_UTIL_H_ | 6 #define CHROME_COMMON_X11_UTIL_H_ |
| 7 | 7 |
| 8 // This file declares utility functions for X11 (Linux only). | 8 // This file declares utility functions for X11 (Linux only). |
| 9 // | 9 // |
| 10 // These functions do not require the Xlib headers to be included (which is why | 10 // These functions do not require the Xlib headers to be included (which is why |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 // Implementers of this interface receive a notification for every X window of | 63 // Implementers of this interface receive a notification for every X window of |
| 64 // the main display. | 64 // the main display. |
| 65 class EnumerateWindowsDelegate { | 65 class EnumerateWindowsDelegate { |
| 66 public: | 66 public: |
| 67 // |xid| is the X Window ID of the enumerated window. Return true to stop | 67 // |xid| is the X Window ID of the enumerated window. Return true to stop |
| 68 // further iteration. | 68 // further iteration. |
| 69 virtual bool ShouldStopIterating(XID xid) = 0; | 69 virtual bool ShouldStopIterating(XID xid) = 0; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 // Enumerates all windows in the current display | 72 // Enumerates all windows in the current display. Will recurse into child |
| 73 bool EnumerateAllWindows(EnumerateWindowsDelegate* delegate); | 73 // windows up to a depth of |max_depth|. |
| 74 bool EnumerateAllWindows(EnumerateWindowsDelegate* delegate, int max_depth); |
| 74 | 75 |
| 75 // Return a handle to a server side pixmap. |shared_memory_key| is a SysV | 76 // Return a handle to a server side pixmap. |shared_memory_key| is a SysV |
| 76 // IPC key. The shared memory region must contain 32-bit pixels. | 77 // IPC key. The shared memory region must contain 32-bit pixels. |
| 77 XID AttachSharedMemory(Display* display, int shared_memory_support); | 78 XID AttachSharedMemory(Display* display, int shared_memory_support); |
| 78 void DetachSharedMemory(Display* display, XID shmseg); | 79 void DetachSharedMemory(Display* display, XID shmseg); |
| 79 | 80 |
| 80 // Return a handle to an XRender picture where |pixmap| is a handle to a | 81 // Return a handle to an XRender picture where |pixmap| is a handle to a |
| 81 // pixmap containing Skia ARGB data. | 82 // pixmap containing Skia ARGB data. |
| 82 XID CreatePictureFromSkiaPixmap(Display* display, XID pixmap); | 83 XID CreatePictureFromSkiaPixmap(Display* display, XID pixmap); |
| 83 | 84 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 103 | 104 |
| 104 // Find the immediate parent of an X window. | 105 // Find the immediate parent of an X window. |
| 105 // | 106 // |
| 106 // parent_window: (output) the parent window of |window|, or 0. | 107 // parent_window: (output) the parent window of |window|, or 0. |
| 107 // parent_is_root: (output) true iff the parent of |window| is the root window. | 108 // parent_is_root: (output) true iff the parent of |window| is the root window. |
| 108 bool GetWindowParent(XID* parent_window, bool* parent_is_root, XID window); | 109 bool GetWindowParent(XID* parent_window, bool* parent_is_root, XID window); |
| 109 | 110 |
| 110 } // namespace x11_util | 111 } // namespace x11_util |
| 111 | 112 |
| 112 #endif // CHROME_COMMON_X11_UTIL_H_ | 113 #endif // CHROME_COMMON_X11_UTIL_H_ |
| OLD | NEW |