<?xml version='1.0' encoding='UTF-8'?> 
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
                "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="cairo-XLib/Xrender-Backend">
<refmeta>
<refentrytitle role="top_of_page">XLib/XRender Backend</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>CAIRO Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>XLib/XRender Backend</refname>
<refpurpose>X Window System rendering using XLib and the X Render extension</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

<refsynopsisdiv role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>



#define             <link linkend="CAIRO-HAS-XLIB-XRENDER-SURFACE:CAPS">CAIRO_HAS_XLIB_XRENDER_SURFACE</link>
<link linkend="cairo-surface-t">cairo_surface_t</link>*    <link linkend="cairo-xlib-surface-create-with-xrender-format">cairo_xlib_surface_create_with_xrender_format</link>
                                                        (<link linkend="Display">Display</link> *dpy,
                                                         <link linkend="Drawable">Drawable</link> drawable,
                                                         <link linkend="Screen">Screen</link> *screen,
                                                         <link linkend="XRenderPictFormat">XRenderPictFormat</link> *format,
                                                         <link linkend="int">int</link> width,
                                                         <link linkend="int">int</link> height);
<link linkend="XRenderPictFormat">XRenderPictFormat</link>*  <link linkend="cairo-xlib-surface-get-xrender-format">cairo_xlib_surface_get_xrender_format</link>
                                                        (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);
</synopsis>
</refsynopsisdiv>









<refsect1 role="desc">
<title role="desc.title">Description</title>
<para>
The XLib surface is used to render cairo graphics to X Window System
windows and pixmaps using the XLib and Xrender libraries.
</para>
<para>
Note that the XLib surface automatically takes advantage of X Render extension
if it is available.
</para>
</refsect1>

<refsect1 role="details">
<title role="details.title">Details</title>
<refsect2>
<title><anchor id="CAIRO-HAS-XLIB-XRENDER-SURFACE:CAPS" role="macro"/>CAIRO_HAS_XLIB_XRENDER_SURFACE</title>
<indexterm><primary>CAIRO_HAS_XLIB_XRENDER_SURFACE</primary></indexterm><programlisting>#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1
</programlisting>
<para>
Defined if the XLib/XRender surface functions are available.
This macro can be used to conditionally compile backend-specific code.
</para></refsect2>
<refsect2>
<title><anchor id="cairo-xlib-surface-create-with-xrender-format" role="function"/>cairo_xlib_surface_create_with_xrender_format ()</title>
<indexterm><primary>cairo_xlib_surface_create_with_xrender_format</primary></indexterm><programlisting><link linkend="cairo-surface-t">cairo_surface_t</link>*    cairo_xlib_surface_create_with_xrender_format
                                                        (<link linkend="Display">Display</link> *dpy,
                                                         <link linkend="Drawable">Drawable</link> drawable,
                                                         <link linkend="Screen">Screen</link> *screen,
                                                         <link linkend="XRenderPictFormat">XRenderPictFormat</link> *format,
                                                         <link linkend="int">int</link> width,
                                                         <link linkend="int">int</link> height);</programlisting>
<para>
Creates an Xlib surface that draws to the given drawable.
The way that colors are represented in the drawable is specified
by the provided picture format.
</para>
<para>
Note: If <parameter>drawable</parameter> is a Window, then the function
cairo_xlib_surface_set_size must be called whenever the size of the
window changes.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>dpy</parameter>&nbsp;:</term>
<listitem><simpara> an X Display
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>drawable</parameter>&nbsp;:</term>
<listitem><simpara> an X Drawable, (a Pixmap or a Window)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>screen</parameter>&nbsp;:</term>
<listitem><simpara> the X Screen associated with <parameter>drawable</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&nbsp;:</term>
<listitem><simpara> the picture format to use for drawing to <parameter>drawable</parameter>. The depth
         of <parameter>format</parameter> must match the depth of the drawable.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
<listitem><simpara> the current width of <parameter>drawable</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&nbsp;:</term>
<listitem><simpara> the current height of <parameter>drawable</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the newly created surface
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="cairo-xlib-surface-get-xrender-format" role="function" condition="since:1.6"/>cairo_xlib_surface_get_xrender_format ()</title>
<indexterm role="1.6"><primary>cairo_xlib_surface_get_xrender_format</primary></indexterm><programlisting><link linkend="XRenderPictFormat">XRenderPictFormat</link>*  cairo_xlib_surface_get_xrender_format
                                                        (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);</programlisting>
<para>
Gets the X Render picture format that <parameter>surface</parameter> uses for rendering with the
X Render extension. If the surface was created by
<link linkend="cairo-xlib-surface-create-with-xrender-format"><function>cairo_xlib_surface_create_with_xrender_format()</function></link> originally, the return
value is the format passed to that constructor.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>surface</parameter>&nbsp;:</term>
<listitem><simpara> an xlib surface
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the XRenderPictFormat* associated with <parameter>surface</parameter>,
or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the surface is not an xlib surface
or if the X Render extension is not available.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.6
</para></refsect2>

</refsect1>



<refsect1>
<title>See Also</title>
<para>
<itemizedlist>
<listitem><link linkend="cairo-surface-t"><type>cairo_surface_t</type></link></listitem>
</itemizedlist>
</para>
</refsect1>


<refsect1><refsect2 /><refsect2 /></refsect1>
</refentry>
