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 19 matching lines...) Expand all Loading... |
30 namespace gfx { | 30 namespace gfx { |
31 class Canvas; | 31 class Canvas; |
32 class Insets; | 32 class Insets; |
33 class Point; | 33 class Point; |
34 class Rect; | 34 class Rect; |
35 } | 35 } |
36 class SkBitmap; | 36 class SkBitmap; |
37 | 37 |
38 namespace ui { | 38 namespace ui { |
39 | 39 |
| 40 // These constants are defined in the EWMH spec for _NET_WM_MOVERESIZE. |
| 41 enum class NetWmMoveResize { |
| 42 SIZE_TOPLEFT = 0, |
| 43 SIZE_TOP = 1, |
| 44 SIZE_TOPRIGHT = 2, |
| 45 SIZE_RIGHT = 3, |
| 46 SIZE_BOTTOMRIGHT = 4, |
| 47 SIZE_BOTTOM = 5, |
| 48 SIZE_BOTTOMLEFT = 6, |
| 49 SIZE_LEFT = 7, |
| 50 MOVE = 8, // movement only |
| 51 SIZE_KEYBOARD = 9, // size via keyboard |
| 52 MOVE_KEYBOARD = 10, // move via keyboard |
| 53 CANCEL = 11, // cancel operation |
| 54 }; |
| 55 |
40 // These functions use the default display and this /must/ be called from | 56 // These functions use the default display and this /must/ be called from |
41 // the UI thread. Thus, they don't support multiple displays. | 57 // the UI thread. Thus, they don't support multiple displays. |
42 | 58 |
43 // These functions cache their results --------------------------------- | 59 // These functions cache their results --------------------------------- |
44 | 60 |
45 // Returns true if the system supports XINPUT2. | 61 // Returns true if the system supports XINPUT2. |
46 UI_BASE_X_EXPORT bool IsXInput2Available(); | 62 UI_BASE_X_EXPORT bool IsXInput2Available(); |
47 | 63 |
48 // Return true iff the display supports Xrender | 64 // Return true iff the display supports Xrender |
49 UI_BASE_X_EXPORT bool QueryRenderSupport(XDisplay* dpy); | 65 UI_BASE_X_EXPORT bool QueryRenderSupport(XDisplay* dpy); |
(...skipping 27 matching lines...) Expand all Loading... |
77 | 93 |
78 // Hides the host cursor. | 94 // Hides the host cursor. |
79 UI_BASE_X_EXPORT void HideHostCursor(); | 95 UI_BASE_X_EXPORT void HideHostCursor(); |
80 | 96 |
81 // Returns an invisible cursor. | 97 // Returns an invisible cursor. |
82 UI_BASE_X_EXPORT::Cursor CreateInvisibleCursor(); | 98 UI_BASE_X_EXPORT::Cursor CreateInvisibleCursor(); |
83 | 99 |
84 // Sets whether |window| should use the OS window frame. | 100 // Sets whether |window| should use the OS window frame. |
85 UI_BASE_X_EXPORT void SetUseOSWindowFrame(XID window, bool use_os_window_frame); | 101 UI_BASE_X_EXPORT void SetUseOSWindowFrame(XID window, bool use_os_window_frame); |
86 | 102 |
| 103 // Requests the window manager move or resize the window on behalf of Chromium. |
| 104 // Clients MUST release all grabs prior to calling. Callers must check that the |
| 105 // WM supports the _NET_WM_MOVERESIZE protocol. |
| 106 UI_BASE_X_EXPORT void MoveResizeManagedWindow(XID window, |
| 107 gfx::Point root_location, |
| 108 NetWmMoveResize mode); |
| 109 |
87 // These functions do not cache their results -------------------------- | 110 // These functions do not cache their results -------------------------- |
88 | 111 |
89 // Returns true if the shape extension is supported. | 112 // Returns true if the shape extension is supported. |
90 UI_BASE_X_EXPORT bool IsShapeExtensionAvailable(); | 113 UI_BASE_X_EXPORT bool IsShapeExtensionAvailable(); |
91 | 114 |
92 // Get the X window id for the default root window | 115 // Get the X window id for the default root window |
93 UI_BASE_X_EXPORT XID GetX11RootWindow(); | 116 UI_BASE_X_EXPORT XID GetX11RootWindow(); |
94 | 117 |
95 // Returns the user's current desktop. | 118 // Returns the user's current desktop. |
96 UI_BASE_X_EXPORT bool GetCurrentDesktop(int* desktop); | 119 UI_BASE_X_EXPORT bool GetCurrentDesktop(int* desktop); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 UI_BASE_X_EXPORT void ResetXCursorCache(); | 352 UI_BASE_X_EXPORT void ResetXCursorCache(); |
330 | 353 |
331 // Returns the cached XcursorImage for |cursor|. | 354 // Returns the cached XcursorImage for |cursor|. |
332 UI_BASE_X_EXPORT const XcursorImage* GetCachedXcursorImage(::Cursor cursor); | 355 UI_BASE_X_EXPORT const XcursorImage* GetCachedXcursorImage(::Cursor cursor); |
333 | 356 |
334 } // namespace test | 357 } // namespace test |
335 | 358 |
336 } // namespace ui | 359 } // namespace ui |
337 | 360 |
338 #endif // UI_BASE_X_X11_UTIL_H_ | 361 #endif // UI_BASE_X_X11_UTIL_H_ |
OLD | NEW |