Back to index

lightning-sunbird  0.9+nobinonly
Classes | Typedefs | Functions
cairo-xlib-private.h File Reference
#include "cairoint.h"
#include "cairo-xlib.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  _cairo_xlib_screen_info


typedef struct _cairo_xlib_screen_info


cairo_xlib_screen_info_t * 
_cairo_xlib_screen_info_get (Display *display, Screen *screen)

Class Documentation

struct _cairo_xlib_screen_info

Definition at line 41 of file cairo-xlib-private.h.

Class Members
Display * display
cairo_font_options_t font_options
cairo_bool_t has_render
cairo_xlib_screen_info_t * next
Screen * screen

Typedef Documentation

typedef struct _cairo_xlib_screen_info

Definition at line 39 of file cairo-xlib-private.h.

Function Documentation

cairo_private cairo_xlib_screen_info_t* _cairo_xlib_screen_info_get ( Display display,
Screen *  screen 

Definition at line 304 of file cairo-xlib-screen.c.

    cairo_xlib_screen_info_t *info;
    cairo_xlib_screen_info_t **prev;
    int event_base, error_base;
    XExtCodes *codes;
    cairo_bool_t seen_display = FALSE;

    /* There is an apparent deadlock between this mutex and the
     * mutex for the display, but it's actually safe. For the
     * app to call XCloseDisplay() while any other thread is
     * inside this function would be an error in the logic
     * app, and the CloseDisplay hook is the only other place we
     * acquire this mutex.
    CAIRO_MUTEX_LOCK (_xlib_screen_mutex);

    for (prev = &_cairo_xlib_screen_list; (info = *prev); prev = &(*prev)->next)
       if (info->display == dpy) {
           seen_display = TRUE;
           if (info->screen == screen)
               * MRU the list
              if (prev != &_cairo_xlib_screen_list)
                  *prev = info->next;
                  info->next = _cairo_xlib_screen_list;
                  _cairo_xlib_screen_list = info;

    if (info)
       goto out;

    info = malloc (sizeof (cairo_xlib_screen_info_t));
    if (!info)
       goto out;

    if (!seen_display) {
       codes = XAddExtension (dpy);
       if (!codes) {
           free (info);
           info = NULL;
           goto out;
       XESetCloseDisplay (dpy, codes->extension, _cairo_xlib_close_display);

    info->display = dpy;
    info->screen = screen;
    info->has_render = (XRenderQueryExtension (dpy, &event_base, &error_base) &&
                     (XRenderFindVisualFormat (dpy, DefaultVisual (dpy, DefaultScreen (dpy))) != 0));
    _cairo_xlib_init_screen_font_options (info);
    info->next = _cairo_xlib_screen_list;
    _cairo_xlib_screen_list = info;

    CAIRO_MUTEX_UNLOCK (_xlib_screen_mutex);
    return info;

Here is the call graph for this function:

Here is the caller graph for this function: