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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // 2) SHM putimage, | 51 // 2) SHM putimage, |
52 // 3) SHM pixmaps + putimage. | 52 // 3) SHM pixmaps + putimage. |
53 enum SharedMemorySupport { | 53 enum SharedMemorySupport { |
54 SHARED_MEMORY_NONE, | 54 SHARED_MEMORY_NONE, |
55 SHARED_MEMORY_PUTIMAGE, | 55 SHARED_MEMORY_PUTIMAGE, |
56 SHARED_MEMORY_PIXMAP | 56 SHARED_MEMORY_PIXMAP |
57 }; | 57 }; |
58 // Return the shared memory type of our X connection. | 58 // Return the shared memory type of our X connection. |
59 UI_BASE_EXPORT SharedMemorySupport QuerySharedMemorySupport(XDisplay* dpy); | 59 UI_BASE_EXPORT SharedMemorySupport QuerySharedMemorySupport(XDisplay* dpy); |
60 | 60 |
61 // Return true iff the display supports Xrender | |
62 UI_BASE_EXPORT bool QueryRenderSupport(XDisplay* dpy); | |
63 | |
64 // Returns an X11 Cursor, sharable across the process. | 61 // Returns an X11 Cursor, sharable across the process. |
65 // |cursor_shape| is an X font cursor shape, see XCreateFontCursor(). | 62 // |cursor_shape| is an X font cursor shape, see XCreateFontCursor(). |
66 UI_BASE_EXPORT ::Cursor GetXCursor(int cursor_shape); | 63 UI_BASE_EXPORT ::Cursor GetXCursor(int cursor_shape); |
67 | 64 |
68 // Resets the cache used by GetXCursor(). Only useful for tests that may delete | 65 // Resets the cache used by GetXCursor(). Only useful for tests that may delete |
69 // the display. | 66 // the display. |
70 UI_BASE_EXPORT void ResetXCursorCache(); | 67 UI_BASE_EXPORT void ResetXCursorCache(); |
71 | 68 |
72 // Creates a custom X cursor from the image. This takes ownership of image. The | 69 // Creates a custom X cursor from the image. This takes ownership of image. The |
73 // caller must not free/modify the image. The refcount of the newly created | 70 // caller must not free/modify the image. The refcount of the newly created |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 private: | 332 private: |
336 ::Cursor cursor_; | 333 ::Cursor cursor_; |
337 XDisplay* display_; | 334 XDisplay* display_; |
338 | 335 |
339 DISALLOW_COPY_AND_ASSIGN(XScopedCursor); | 336 DISALLOW_COPY_AND_ASSIGN(XScopedCursor); |
340 }; | 337 }; |
341 | 338 |
342 } // namespace ui | 339 } // namespace ui |
343 | 340 |
344 #endif // UI_BASE_X_X11_UTIL_H_ | 341 #endif // UI_BASE_X_X11_UTIL_H_ |
OLD | NEW |