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 16 matching lines...) Loading... |
27 class Size; | 27 class Size; |
28 } | 28 } |
29 | 29 |
30 namespace x11_util { | 30 namespace x11_util { |
31 | 31 |
32 // These functions use the GDK default display and this /must/ be called from | 32 // These functions use the GDK default display and this /must/ be called from |
33 // the UI thread. Thus, they don't support multiple displays. | 33 // the UI thread. Thus, they don't support multiple displays. |
34 | 34 |
35 // These functions cache their results. | 35 // These functions cache their results. |
36 | 36 |
| 37 // Check if there's an open connection to an X server. |
| 38 bool XDisplayExists(); |
37 // Return an X11 connection for the current, primary display. | 39 // Return an X11 connection for the current, primary display. |
38 Display* GetXDisplay(); | 40 Display* GetXDisplay(); |
39 // Return true iff the connection supports X shared memory | 41 // Return true iff the connection supports X shared memory |
40 bool QuerySharedMemorySupport(Display* dpy); | 42 bool QuerySharedMemorySupport(Display* dpy); |
41 // Return true iff the display supports Xrender | 43 // Return true iff the display supports Xrender |
42 bool QueryRenderSupport(Display* dpy); | 44 bool QueryRenderSupport(Display* dpy); |
43 // Return the default screen number for the display | 45 // Return the default screen number for the display |
44 int GetDefaultScreen(Display* display); | 46 int GetDefaultScreen(Display* display); |
45 | 47 |
46 // These functions do not cache their results | 48 // These functions do not cache their results |
(...skipping 62 matching lines...) Loading... |
109 | 111 |
110 // Find the immediate parent of an X window. | 112 // Find the immediate parent of an X window. |
111 // | 113 // |
112 // parent_window: (output) the parent window of |window|, or 0. | 114 // parent_window: (output) the parent window of |window|, or 0. |
113 // 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. |
114 bool GetWindowParent(XID* parent_window, bool* parent_is_root, XID window); | 116 bool GetWindowParent(XID* parent_window, bool* parent_is_root, XID window); |
115 | 117 |
116 } // namespace x11_util | 118 } // namespace x11_util |
117 | 119 |
118 #endif // CHROME_COMMON_X11_UTIL_H_ | 120 #endif // CHROME_COMMON_X11_UTIL_H_ |
OLD | NEW |