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 | |
56 // These functions use the default display and this /must/ be called from | 40 // These functions use the default display and this /must/ be called from |
57 // the UI thread. Thus, they don't support multiple displays. | 41 // the UI thread. Thus, they don't support multiple displays. |
58 | 42 |
59 // These functions cache their results --------------------------------- | 43 // These functions cache their results --------------------------------- |
60 | 44 |
61 // Returns true if the system supports XINPUT2. | 45 // Returns true if the system supports XINPUT2. |
62 UI_BASE_X_EXPORT bool IsXInput2Available(); | 46 UI_BASE_X_EXPORT bool IsXInput2Available(); |
63 | 47 |
64 // Return true iff the display supports Xrender | 48 // Return true iff the display supports Xrender |
65 UI_BASE_X_EXPORT bool QueryRenderSupport(XDisplay* dpy); | 49 UI_BASE_X_EXPORT bool QueryRenderSupport(XDisplay* dpy); |
(...skipping 27 matching lines...) Expand all Loading... |
93 | 77 |
94 // Hides the host cursor. | 78 // Hides the host cursor. |
95 UI_BASE_X_EXPORT void HideHostCursor(); | 79 UI_BASE_X_EXPORT void HideHostCursor(); |
96 | 80 |
97 // Returns an invisible cursor. | 81 // Returns an invisible cursor. |
98 UI_BASE_X_EXPORT::Cursor CreateInvisibleCursor(); | 82 UI_BASE_X_EXPORT::Cursor CreateInvisibleCursor(); |
99 | 83 |
100 // Sets whether |window| should use the OS window frame. | 84 // Sets whether |window| should use the OS window frame. |
101 UI_BASE_X_EXPORT void SetUseOSWindowFrame(XID window, bool use_os_window_frame); | 85 UI_BASE_X_EXPORT void SetUseOSWindowFrame(XID window, bool use_os_window_frame); |
102 | 86 |
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 | |
110 // These functions do not cache their results -------------------------- | 87 // These functions do not cache their results -------------------------- |
111 | 88 |
112 // Returns true if the shape extension is supported. | 89 // Returns true if the shape extension is supported. |
113 UI_BASE_X_EXPORT bool IsShapeExtensionAvailable(); | 90 UI_BASE_X_EXPORT bool IsShapeExtensionAvailable(); |
114 | 91 |
115 // Get the X window id for the default root window | 92 // Get the X window id for the default root window |
116 UI_BASE_X_EXPORT XID GetX11RootWindow(); | 93 UI_BASE_X_EXPORT XID GetX11RootWindow(); |
117 | 94 |
118 // Returns the user's current desktop. | 95 // Returns the user's current desktop. |
119 UI_BASE_X_EXPORT bool GetCurrentDesktop(int* desktop); | 96 UI_BASE_X_EXPORT bool GetCurrentDesktop(int* desktop); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 UI_BASE_X_EXPORT void ResetXCursorCache(); | 329 UI_BASE_X_EXPORT void ResetXCursorCache(); |
353 | 330 |
354 // Returns the cached XcursorImage for |cursor|. | 331 // Returns the cached XcursorImage for |cursor|. |
355 UI_BASE_X_EXPORT const XcursorImage* GetCachedXcursorImage(::Cursor cursor); | 332 UI_BASE_X_EXPORT const XcursorImage* GetCachedXcursorImage(::Cursor cursor); |
356 | 333 |
357 } // namespace test | 334 } // namespace test |
358 | 335 |
359 } // namespace ui | 336 } // namespace ui |
360 | 337 |
361 #endif // UI_BASE_X_X11_UTIL_H_ | 338 #endif // UI_BASE_X_X11_UTIL_H_ |
OLD | NEW |