OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_INTERNAL_H_ | 5 #ifndef UI_BASE_X_X11_UTIL_INTERNAL_H_ |
6 #define UI_BASE_X_X11_UTIL_INTERNAL_H_ | 6 #define UI_BASE_X_X11_UTIL_INTERNAL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 // This file declares utility functions for X11 (Linux only). | 9 // This file declares utility functions for X11 (Linux only). |
10 // | 10 // |
11 // These functions require the inclusion of the Xlib headers. Since the Xlib | 11 // These functions require the inclusion of the Xlib headers. Since the Xlib |
12 // headers pollute so much of the namespace, this should only be included | 12 // headers pollute so much of the namespace, this should only be included |
13 // when needed. | 13 // when needed. |
14 | 14 |
15 extern "C" { | 15 extern "C" { |
16 #include <X11/Xatom.h> | 16 #include <X11/Xatom.h> |
17 #include <X11/Xlib.h> | 17 #include <X11/Xlib.h> |
18 #include <X11/extensions/XShm.h> | 18 #include <X11/extensions/XShm.h> |
19 #include <X11/extensions/Xrender.h> | 19 #include <X11/extensions/Xrender.h> |
20 } | 20 } |
21 | 21 |
22 #include "ui/ui_api.h" | 22 #include "ui/base/ui_export.h" |
23 | 23 |
24 namespace ui { | 24 namespace ui { |
25 | 25 |
26 // -------------------------------------------------------------------------- | 26 // -------------------------------------------------------------------------- |
27 // NOTE: these functions cache the results and must be called from the UI | 27 // NOTE: these functions cache the results and must be called from the UI |
28 // thread. | 28 // thread. |
29 // Get the XRENDER format id for ARGB32 (Skia's format). | 29 // Get the XRENDER format id for ARGB32 (Skia's format). |
30 // | 30 // |
31 // NOTE:Currently this don't support multiple screens/displays. | 31 // NOTE:Currently this don't support multiple screens/displays. |
32 XRenderPictFormat* GetRenderARGB32Format(Display* dpy); | 32 XRenderPictFormat* GetRenderARGB32Format(Display* dpy); |
33 | 33 |
34 // Get the XRENDER format id for the default visual on the first screen. This | 34 // Get the XRENDER format id for the default visual on the first screen. This |
35 // is the format which our GTK window will have. | 35 // is the format which our GTK window will have. |
36 UI_API XRenderPictFormat* GetRenderVisualFormat(Display* dpy, Visual* visual); | 36 UI_EXPORT XRenderPictFormat* GetRenderVisualFormat(Display* dpy, |
| 37 Visual* visual); |
37 | 38 |
38 // -------------------------------------------------------------------------- | 39 // -------------------------------------------------------------------------- |
39 // X11 error handling. | 40 // X11 error handling. |
40 // Sets the X Error Handlers. Passing NULL for either will enable the default | 41 // Sets the X Error Handlers. Passing NULL for either will enable the default |
41 // error handler, which if called will log the error and abort the process. | 42 // error handler, which if called will log the error and abort the process. |
42 UI_API void SetX11ErrorHandlers(XErrorHandler error_handler, | 43 UI_EXPORT void SetX11ErrorHandlers(XErrorHandler error_handler, |
43 XIOErrorHandler io_error_handler); | 44 XIOErrorHandler io_error_handler); |
44 | 45 |
45 // NOTE: This function should not be called directly from the | 46 // NOTE: This function should not be called directly from the |
46 // X11 Error handler because it queries the server to decode the | 47 // X11 Error handler because it queries the server to decode the |
47 // error message, which may trigger other errors. A suitable workaround | 48 // error message, which may trigger other errors. A suitable workaround |
48 // is to post a task in the error handler to call this function. | 49 // is to post a task in the error handler to call this function. |
49 UI_API void LogErrorEventDescription(Display* dpy, | 50 UI_EXPORT void LogErrorEventDescription(Display* dpy, |
50 const XErrorEvent& error_event); | 51 const XErrorEvent& error_event); |
51 | 52 |
52 } // namespace ui | 53 } // namespace ui |
53 | 54 |
54 #endif // UI_BASE_X_X11_UTIL_INTERNAL_H_ | 55 #endif // UI_BASE_X_X11_UTIL_INTERNAL_H_ |
OLD | NEW |