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
3 // found in the LICENSE file.
5 #ifndef UI_BASE_X_X11_UTIL_INTERNAL_H_
6 #define UI_BASE_X_X11_UTIL_INTERNAL_H_
8 // This file declares utility functions for X11 (Linux only).
10 // These functions require the inclusion of the Xlib headers. Since the Xlib
11 // headers pollute so much of the namespace, this should only be included
15 #include <X11/extensions/Xrender.h>
16 #include <X11/extensions/XShm.h>
17 #include <X11/Xatom.h>
21 #include "ui/base/ui_base_export.h"
25 // --------------------------------------------------------------------------
26 // NOTE: these functions cache the results and must be called from the UI
28 // Get the XRENDER format id for ARGB32 (Skia's format).
30 // NOTE:Currently this don't support multiple screens/displays.
31 UI_BASE_EXPORT XRenderPictFormat
* GetRenderARGB32Format(Display
* dpy
);
33 // --------------------------------------------------------------------------
34 // X11 error handling.
35 // Sets the X Error Handlers. Passing NULL for either will enable the default
36 // error handler, which if called will log the error and abort the process.
37 UI_BASE_EXPORT
void SetX11ErrorHandlers(XErrorHandler error_handler
,
38 XIOErrorHandler io_error_handler
);
40 // NOTE: This function should not be called directly from the
41 // X11 Error handler because it queries the server to decode the
42 // error message, which may trigger other errors. A suitable workaround
43 // is to post a task in the error handler to call this function.
44 UI_BASE_EXPORT
void LogErrorEventDescription(Display
* dpy
,
45 const XErrorEvent
& error_event
);
49 #endif // UI_BASE_X_X11_UTIL_INTERNAL_H_