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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 bool GetStringProperty( | 67 bool GetStringProperty( |
68 XID window, const std::string& property_name, std::string* value); | 68 XID window, const std::string& property_name, std::string* value); |
69 | 69 |
70 // Implementers of this interface receive a notification for every X window of | 70 // Implementers of this interface receive a notification for every X window of |
71 // the main display. | 71 // the main display. |
72 class EnumerateWindowsDelegate { | 72 class EnumerateWindowsDelegate { |
73 public: | 73 public: |
74 // |xid| is the X Window ID of the enumerated window. Return true to stop | 74 // |xid| is the X Window ID of the enumerated window. Return true to stop |
75 // further iteration. | 75 // further iteration. |
76 virtual bool ShouldStopIterating(XID xid) = 0; | 76 virtual bool ShouldStopIterating(XID xid) = 0; |
77 | |
78 protected: | |
79 ~EnumerateWindowsDelegate() {} | |
80 }; | 77 }; |
81 | 78 |
82 // Enumerates all windows in the current display. Will recurse into child | 79 // Enumerates all windows in the current display. Will recurse into child |
83 // windows up to a depth of |max_depth|. | 80 // windows up to a depth of |max_depth|. |
84 bool EnumerateAllWindows(EnumerateWindowsDelegate* delegate, int max_depth); | 81 bool EnumerateAllWindows(EnumerateWindowsDelegate* delegate, int max_depth); |
85 | 82 |
86 // Return a handle to a server side pixmap. |shared_memory_key| is a SysV | 83 // Return a handle to a server side pixmap. |shared_memory_key| is a SysV |
87 // IPC key. The shared memory region must contain 32-bit pixels. | 84 // IPC key. The shared memory region must contain 32-bit pixels. |
88 XID AttachSharedMemory(Display* display, int shared_memory_support); | 85 XID AttachSharedMemory(Display* display, int shared_memory_support); |
89 void DetachSharedMemory(Display* display, XID shmseg); | 86 void DetachSharedMemory(Display* display, XID shmseg); |
(...skipping 24 matching lines...) Expand all Loading... |
114 | 111 |
115 // Find the immediate parent of an X window. | 112 // Find the immediate parent of an X window. |
116 // | 113 // |
117 // parent_window: (output) the parent window of |window|, or 0. | 114 // parent_window: (output) the parent window of |window|, or 0. |
118 // parent_is_root: (output) true iff the parent of |window| is the root window. | 115 // parent_is_root: (output) true iff the parent of |window| is the root window. |
119 bool GetWindowParent(XID* parent_window, bool* parent_is_root, XID window); | 116 bool GetWindowParent(XID* parent_window, bool* parent_is_root, XID window); |
120 | 117 |
121 } // namespace x11_util | 118 } // namespace x11_util |
122 | 119 |
123 #endif // CHROME_COMMON_X11_UTIL_H_ | 120 #endif // CHROME_COMMON_X11_UTIL_H_ |
OLD | NEW |