|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/21585/root/usr/share/gtk-doc/html/gdk/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Cairo Interaction</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="GDK Reference Manual">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="gdk-Pango-Interaction.html" title="Pango Interaction">
<link rel="next" href="gdk-X-Window-System-Interaction.html" title="X Window System Interaction">
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="reference" href="reference.html" title="API Reference">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gdk-Pango-Interaction.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GDK Reference Manual</th>
<td><a accesskey="n" href="gdk-X-Window-System-Interaction.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3135911" class="shortcut">Top</a>
 | 
<a href="#id3136128" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="gdk-Cairo-Interaction"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id3135911"></a><span class="refentrytitle">Cairo Interaction</span>
</h2>
<p>Cairo Interaction — Functions to support using Cairo</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
#include <gdk/gdk.h>
<a
href="../cairo/cairo-cairo-t.html#cairo-t"
>cairo_t</a>* <a href="gdk-Cairo-Interaction.html#gdk-cairo-create">gdk_cairo_create</a> (<a href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable);
void <a href="gdk-Cairo-Interaction.html#gdk-cairo-set-source-color">gdk_cairo_set_source_color</a> (<a
href="../cairo/cairo-cairo-t.html#cairo-t"
>cairo_t</a> *cr,
<a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);
void <a href="gdk-Cairo-Interaction.html#gdk-cairo-set-source-pixbuf">gdk_cairo_set_source_pixbuf</a> (<a
href="../cairo/cairo-cairo-t.html#cairo-t"
>cairo_t</a> *cr,
<a
href="../gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"
>GdkPixbuf</a> *pixbuf,
double pixbuf_x,
double pixbuf_y);
void <a href="gdk-Cairo-Interaction.html#gdk-cairo-set-source-pixmap">gdk_cairo_set_source_pixmap</a> (<a
href="../cairo/cairo-cairo-t.html#cairo-t"
>cairo_t</a> *cr,
<a href="gdk-Bitmaps-and-Pixmaps.html#GdkPixmap">GdkPixmap</a> *pixmap,
double pixmap_x,
double pixmap_y);
void <a href="gdk-Cairo-Interaction.html#gdk-cairo-rectangle">gdk_cairo_rectangle</a> (<a
href="../cairo/cairo-cairo-t.html#cairo-t"
>cairo_t</a> *cr,
<a href="gdk-Points-Rectangles-and-Regions.html#GdkRectangle">GdkRectangle</a> *rectangle);
void <a href="gdk-Cairo-Interaction.html#gdk-cairo-region">gdk_cairo_region</a> (<a
href="../cairo/cairo-cairo-t.html#cairo-t"
>cairo_t</a> *cr,
<a href="gdk-Points-Rectangles-and-Regions.html#GdkRegion">GdkRegion</a> *region);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3136128"></a><h2>Description</h2>
<p>
Cairo is a graphics
library that supports vector graphics and image compositing that
can be used with GDK. Since 2.8, GTK+ does most of its drawing
using Cairo.
</p>
<p>
GDK does not wrap the Cairo API, instead it allows to create Cairo
contexts which can be used to draw on GDK drawables. Additional
functions allow to convert GDK's rectangles and regions into
Cairo paths and to use pixbufs as sources for drawing operations.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id3136159"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id3136169"></a><h3>
<a name="gdk-cairo-create"></a>gdk_cairo_create ()</h3>
<a class="indexterm" name="id3136184"></a><pre class="programlisting"><a
href="../cairo/cairo-cairo-t.html#cairo-t"
>cairo_t</a>* gdk_cairo_create (<a href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable);</pre>
<p>
Creates a Cairo context for drawing to <em class="parameter"><code>drawable</code></em>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>drawable</code></em> :</span></td>
<td> a <a href="gdk-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> A newly created Cairo context. Free with
<code class="function">cairo_destroy()</code> when you are done drawing.
</td>
</tr>
</tbody>
</table></div>
<p>Since 2.8
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3136276"></a><h3>
<a name="gdk-cairo-set-source-color"></a>gdk_cairo_set_source_color ()</h3>
<a class="indexterm" name="id3136292"></a><pre class="programlisting">void gdk_cairo_set_source_color (<a
href="../cairo/cairo-cairo-t.html#cairo-t"
>cairo_t</a> *cr,
<a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);</pre>
<p>
Sets the specified <a href="gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a> as the source color of <em class="parameter"><code>cr</code></em>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>cr</code></em> :</span></td>
<td> a <a
href="../cairo/cairo-cairo-t.html#cairo-t"
><span class="type">cairo_t</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>color</code></em> :</span></td>
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a>
</td>
</tr>
</tbody>
</table></div>
<p>Since 2.8
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3136396"></a><h3>
<a name="gdk-cairo-set-source-pixbuf"></a>gdk_cairo_set_source_pixbuf ()</h3>
<a class="indexterm" name="id3136412"></a><pre class="programlisting">void gdk_cairo_set_source_pixbuf (<a
href="../cairo/cairo-cairo-t.html#cairo-t"
>cairo_t</a> *cr,
<a
href="../gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"
>GdkPixbuf</a> *pixbuf,
double pixbuf_x,
double pixbuf_y);</pre>
<p>
Sets the given pixbuf as the source pattern for the Cairo context.
The pattern has an extend mode of <a
href="../cairo/cairo-Patterns.html#CAIRO-EXTEND-NONE:CAPS"
><code class="literal">CAIRO_EXTEND_NONE</code></a> and is aligned
so that the origin of <em class="parameter"><code>pixbuf</code></em> is <em class="parameter"><code>pixbuf_x</code></em>, <em class="parameter"><code>pixbuf_y</code></em></p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>cr</code></em> :</span></td>
<td> a <span class="type">Cairo</span> context
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>pixbuf</code></em> :</span></td>
<td> a <a
href="../gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"
><span class="type">GdkPixbuf</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>pixbuf_x</code></em> :</span></td>
<td> X coordinate of location to place upper left corner of <em class="parameter"><code>pixbuf</code></em>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>pixbuf_y</code></em> :</span></td>
<td> Y coordinate of location to place upper left corner of <em class="parameter"><code>pixbuf</code></em>
</td>
</tr>
</tbody>
</table></div>
<p>Since 2.8
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3136590"></a><h3>
<a name="gdk-cairo-set-source-pixmap"></a>gdk_cairo_set_source_pixmap ()</h3>
<a class="indexterm" name="id3136606"></a><pre class="programlisting">void gdk_cairo_set_source_pixmap (<a
href="../cairo/cairo-cairo-t.html#cairo-t"
>cairo_t</a> *cr,
<a href="gdk-Bitmaps-and-Pixmaps.html#GdkPixmap">GdkPixmap</a> *pixmap,
double pixmap_x,
double pixmap_y);</pre>
<p>
Sets the given pixmap as the source pattern for the Cairo context.
The pattern has an extend mode of <a
href="../cairo/cairo-Patterns.html#CAIRO-EXTEND-NONE:CAPS"
><code class="literal">CAIRO_EXTEND_NONE</code></a> and is aligned
so that the origin of <em class="parameter"><code>pixbuf</code></em> is <em class="parameter"><code>pixbuf_x</code></em>, <em class="parameter"><code>pixbuf_y</code></em></p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>cr</code></em> :</span></td>
<td> a <span class="type">Cairo</span> context
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>pixmap</code></em> :</span></td>
<td> a <a href="gdk-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="type">GdkPixmap</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>pixmap_x</code></em> :</span></td>
<td> X coordinate of location to place upper left corner of <em class="parameter"><code>pixmap</code></em>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>pixmap_y</code></em> :</span></td>
<td> Y coordinate of location to place upper left corner of <em class="parameter"><code>pixmap</code></em>
</td>
</tr>
</tbody>
</table></div>
<p>Since 2.10
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3136782"></a><h3>
<a name="gdk-cairo-rectangle"></a>gdk_cairo_rectangle ()</h3>
<a class="indexterm" name="id3136797"></a><pre class="programlisting">void gdk_cairo_rectangle (<a
href="../cairo/cairo-cairo-t.html#cairo-t"
>cairo_t</a> *cr,
<a href="gdk-Points-Rectangles-and-Regions.html#GdkRectangle">GdkRectangle</a> *rectangle);</pre>
<p>
Adds the given rectangle to the current path of <em class="parameter"><code>cr</code></em>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>cr</code></em> :</span></td>
<td> a <a
href="../cairo/cairo-cairo-t.html#cairo-t"
><span class="type">cairo_t</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>rectangle</code></em> :</span></td>
<td> a <a href="gdk-Points-Rectangles-and-Regions.html#GdkRectangle"><span class="type">GdkRectangle</span></a>
</td>
</tr>
</tbody>
</table></div>
<p>Since 2.8
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3136894"></a><h3>
<a name="gdk-cairo-region"></a>gdk_cairo_region ()</h3>
<a class="indexterm" name="id3136909"></a><pre class="programlisting">void gdk_cairo_region (<a
href="../cairo/cairo-cairo-t.html#cairo-t"
>cairo_t</a> *cr,
<a href="gdk-Points-Rectangles-and-Regions.html#GdkRegion">GdkRegion</a> *region);</pre>
<p>
Adds the given region to the current path of <em class="parameter"><code>cr</code></em>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>cr</code></em> :</span></td>
<td> a <a
href="../cairo/cairo-cairo-t.html#cairo-t"
><span class="type">cairo_t</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>region</code></em> :</span></td>
<td> a <a href="gdk-Points-Rectangles-and-Regions.html#GdkRegion"><span class="type">GdkRegion</span></a>
</td>
</tr>
</tbody>
</table></div>
<p>Since 2.8
</p>
</div>
</div>
</div>
</body>
</html>