OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_BASE_X_X11_UTIL_H_ | 5 #ifndef UI_BASE_X_X11_UTIL_H_ |
6 #define UI_BASE_X_X11_UTIL_H_ | 6 #define UI_BASE_X_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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // |last_event|. | 87 // |last_event|. |
88 UI_BASE_EXPORT int CoalescePendingMotionEvents(const XEvent* xev, | 88 UI_BASE_EXPORT int CoalescePendingMotionEvents(const XEvent* xev, |
89 XEvent* last_event); | 89 XEvent* last_event); |
90 | 90 |
91 // Hides the host cursor. | 91 // Hides the host cursor. |
92 UI_BASE_EXPORT void HideHostCursor(); | 92 UI_BASE_EXPORT void HideHostCursor(); |
93 | 93 |
94 // Returns an invisible cursor. | 94 // Returns an invisible cursor. |
95 UI_BASE_EXPORT ::Cursor CreateInvisibleCursor(); | 95 UI_BASE_EXPORT ::Cursor CreateInvisibleCursor(); |
96 | 96 |
| 97 // Sets whether |window| should use the OS window frame. |
| 98 UI_BASE_EXPORT void SetUseOSWindowFrame(XID window, bool use_os_borders); |
| 99 |
97 // These functions do not cache their results -------------------------- | 100 // These functions do not cache their results -------------------------- |
98 | 101 |
| 102 // Returns true if the shape extension is supported. |
| 103 UI_BASE_EXPORT bool IsShapeExtensionAvailable(); |
| 104 |
99 // Get the X window id for the default root window | 105 // Get the X window id for the default root window |
100 UI_BASE_EXPORT XID GetX11RootWindow(); | 106 UI_BASE_EXPORT XID GetX11RootWindow(); |
101 | 107 |
102 // Returns the user's current desktop. | 108 // Returns the user's current desktop. |
103 bool GetCurrentDesktop(int* desktop); | 109 bool GetCurrentDesktop(int* desktop); |
104 | 110 |
105 enum HideTitlebarWhenMaximized { | 111 enum HideTitlebarWhenMaximized { |
106 SHOW_TITLEBAR_WHEN_MAXIMIZED = 0, | 112 SHOW_TITLEBAR_WHEN_MAXIMIZED = 0, |
107 HIDE_TITLEBAR_WHEN_MAXIMIZED = 1, | 113 HIDE_TITLEBAR_WHEN_MAXIMIZED = 1, |
108 }; | 114 }; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 166 |
161 // These setters all make round trips. | 167 // These setters all make round trips. |
162 UI_BASE_EXPORT bool SetIntProperty(XID window, | 168 UI_BASE_EXPORT bool SetIntProperty(XID window, |
163 const std::string& name, | 169 const std::string& name, |
164 const std::string& type, | 170 const std::string& type, |
165 int value); | 171 int value); |
166 UI_BASE_EXPORT bool SetIntArrayProperty(XID window, | 172 UI_BASE_EXPORT bool SetIntArrayProperty(XID window, |
167 const std::string& name, | 173 const std::string& name, |
168 const std::string& type, | 174 const std::string& type, |
169 const std::vector<int>& value); | 175 const std::vector<int>& value); |
| 176 UI_BASE_EXPORT bool SetAtomProperty(XID window, |
| 177 const std::string& name, |
| 178 const std::string& type, |
| 179 Atom value); |
170 UI_BASE_EXPORT bool SetAtomArrayProperty(XID window, | 180 UI_BASE_EXPORT bool SetAtomArrayProperty(XID window, |
171 const std::string& name, | 181 const std::string& name, |
172 const std::string& type, | 182 const std::string& type, |
173 const std::vector<Atom>& value); | 183 const std::vector<Atom>& value); |
174 UI_BASE_EXPORT bool SetStringProperty(XID window, | 184 UI_BASE_EXPORT bool SetStringProperty(XID window, |
175 Atom property, | 185 Atom property, |
176 Atom type, | 186 Atom type, |
177 const std::string& value); | 187 const std::string& value); |
178 | 188 |
179 // Gets the X atom for default display corresponding to atom_name. | 189 // Gets the X atom for default display corresponding to atom_name. |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 private: | 342 private: |
333 ::Cursor cursor_; | 343 ::Cursor cursor_; |
334 XDisplay* display_; | 344 XDisplay* display_; |
335 | 345 |
336 DISALLOW_COPY_AND_ASSIGN(XScopedCursor); | 346 DISALLOW_COPY_AND_ASSIGN(XScopedCursor); |
337 }; | 347 }; |
338 | 348 |
339 } // namespace ui | 349 } // namespace ui |
340 | 350 |
341 #endif // UI_BASE_X_X11_UTIL_H_ | 351 #endif // UI_BASE_X_X11_UTIL_H_ |
OLD | NEW |