<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>GdkDrawingContext: GDK 3 Reference Manual</title> <meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"> <link rel="home" href="index.html" title="GDK 3 Reference Manual"> <link rel="up" href="reference.html" title="API Reference"> <link rel="prev" href="gdk3-GdkFrameTimings.html" title="Frame timings"> <link rel="next" href="GdkGLContext.html" title="GdkGLContext"> <meta name="generator" content="GTK-Doc V1.25.1 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> </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="5"><tr valign="middle"> <td width="100%" align="left" class="shortcuts"> <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> <a href="#GdkDrawingContext.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> <a href="#GdkDrawingContext.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties"> <span class="dim">|</span> <a href="#GdkDrawingContext.properties" class="shortcut">Properties</a></span> </td> <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> <td><a accesskey="u" href="reference.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> <td><a accesskey="p" href="gdk3-GdkFrameTimings.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> <td><a accesskey="n" href="GdkGLContext.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> </tr></table> <div class="refentry"> <a name="GdkDrawingContext"></a><div class="titlepage"></div> <div class="refnamediv"><table width="100%"><tr> <td valign="top"> <h2><span class="refentrytitle"><a name="GdkDrawingContext.top_of_page"></a>GdkDrawingContext</span></h2> <p>GdkDrawingContext — Drawing context for GDK windows</p> </td> <td class="gallery_image" valign="top" align="right"></td> </tr></table></div> <div class="refsect1"> <a name="GdkDrawingContext.functions"></a><h2>Functions</h2> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="functions_return"> <col class="functions_name"> </colgroup> <tbody> <tr> <td class="function_type"> <a class="link" href="gdk3-Windows.html#GdkWindow"><span class="returnvalue">GdkWindow</span></a> * </td> <td class="function_name"> <a class="link" href="GdkDrawingContext.html#gdk-drawing-context-get-window" title="gdk_drawing_context_get_window ()">gdk_drawing_context_get_window</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">cairo_region_t</span> * </td> <td class="function_name"> <a class="link" href="GdkDrawingContext.html#gdk-drawing-context-get-clip" title="gdk_drawing_context_get_clip ()">gdk_drawing_context_get_clip</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">cairo_t</span> * </td> <td class="function_name"> <a class="link" href="GdkDrawingContext.html#gdk-drawing-context-get-cairo-context" title="gdk_drawing_context_get_cairo_context ()">gdk_drawing_context_get_cairo_context</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> </td> <td class="function_name"> <a class="link" href="GdkDrawingContext.html#gdk-drawing-context-is-valid" title="gdk_drawing_context_is_valid ()">gdk_drawing_context_is_valid</a> <span class="c_punctuation">()</span> </td> </tr> </tbody> </table></div> </div> <div class="refsect1"> <a name="GdkDrawingContext.properties"></a><h2>Properties</h2> <div class="informaltable"><table class="informaltable" border="0"> <colgroup> <col width="150px" class="properties_type"> <col width="300px" class="properties_name"> <col width="200px" class="properties_flags"> </colgroup> <tbody> <tr> <td class="property_type"> <span class="type">CairoRegion</span> *</td> <td class="property_name"><a class="link" href="GdkDrawingContext.html#GdkDrawingContext--clip" title="The “clip” property">clip</a></td> <td class="property_flags">Read / Write / Construct Only</td> </tr> <tr> <td class="property_type"> <a class="link" href="gdk3-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *</td> <td class="property_name"><a class="link" href="GdkDrawingContext.html#GdkDrawingContext--window" title="The “window” property">window</a></td> <td class="property_flags">Read / Write / Construct Only</td> </tr> </tbody> </table></div> </div> <div class="refsect1"> <a name="GdkDrawingContext.other"></a><h2>Types and Values</h2> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="name"> <col class="description"> </colgroup> <tbody><tr> <td class="datatype_keyword"> </td> <td class="function_name"><a class="link" href="GdkDrawingContext.html#GdkDrawingContext-struct" title="GdkDrawingContext">GdkDrawingContext</a></td> </tr></tbody> </table></div> </div> <div class="refsect1"> <a name="GdkDrawingContext.object-hierarchy"></a><h2>Object Hierarchy</h2> <pre class="screen"> <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a> <span class="lineart">╰──</span> GdkDrawingContext </pre> </div> <div class="refsect1"> <a name="GdkDrawingContext.includes"></a><h2>Includes</h2> <pre class="synopsis">#include <gdk/gdk.h> </pre> </div> <div class="refsect1"> <a name="GdkDrawingContext.description"></a><h2>Description</h2> <p><a class="link" href="GdkDrawingContext.html" title="GdkDrawingContext"><span class="type">GdkDrawingContext</span></a> is an object that represents the current drawing state of a <a class="link" href="gdk3-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>.</p> <p>It's possible to use a <a class="link" href="GdkDrawingContext.html" title="GdkDrawingContext"><span class="type">GdkDrawingContext</span></a> to draw on a <a class="link" href="gdk3-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> via rendering API like Cairo or OpenGL.</p> <p>A <a class="link" href="GdkDrawingContext.html" title="GdkDrawingContext"><span class="type">GdkDrawingContext</span></a> can only be created by calling <a class="link" href="gdk3-Windows.html#gdk-window-begin-draw-frame" title="gdk_window_begin_draw_frame ()"><code class="function">gdk_window_begin_draw_frame()</code></a> and will be valid until a call to <a class="link" href="gdk3-Windows.html#gdk-window-end-draw-frame" title="gdk_window_end_draw_frame ()"><code class="function">gdk_window_end_draw_frame()</code></a>.</p> <p><a class="link" href="GdkDrawingContext.html" title="GdkDrawingContext"><span class="type">GdkDrawingContext</span></a> is available since GDK 3.22</p> </div> <div class="refsect1"> <a name="GdkDrawingContext.functions_details"></a><h2>Functions</h2> <div class="refsect2"> <a name="gdk-drawing-context-get-window"></a><h3>gdk_drawing_context_get_window ()</h3> <pre class="programlisting"><a class="link" href="gdk3-Windows.html#GdkWindow"><span class="returnvalue">GdkWindow</span></a> * gdk_drawing_context_get_window (<em class="parameter"><code><a class="link" href="GdkDrawingContext.html" title="GdkDrawingContext"><span class="type">GdkDrawingContext</span></a> *context</code></em>);</pre> <p>Retrieves the window that created the drawing <em class="parameter"><code>context</code></em> .</p> <div class="refsect3"> <a name="gdk-drawing-context-get-window.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>context</p></td> <td class="parameter_description"><p>a <a class="link" href="GdkDrawingContext.html" title="GdkDrawingContext"><span class="type">GdkDrawingContext</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-drawing-context-get-window.returns"></a><h4>Returns</h4> <p> a <a class="link" href="gdk3-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>. </p> <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p> </div> <hr> <div class="refsect2"> <a name="gdk-drawing-context-get-clip"></a><h3>gdk_drawing_context_get_clip ()</h3> <pre class="programlisting"><span class="returnvalue">cairo_region_t</span> * gdk_drawing_context_get_clip (<em class="parameter"><code><a class="link" href="GdkDrawingContext.html" title="GdkDrawingContext"><span class="type">GdkDrawingContext</span></a> *context</code></em>);</pre> <p>Retrieves a copy of the clip region used when creating the <em class="parameter"><code>context</code></em> .</p> <div class="refsect3"> <a name="gdk-drawing-context-get-clip.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>context</p></td> <td class="parameter_description"><p>a <a class="link" href="GdkDrawingContext.html" title="GdkDrawingContext"><span class="type">GdkDrawingContext</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-drawing-context-get-clip.returns"></a><h4>Returns</h4> <p> a Cairo region. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p> </div> <hr> <div class="refsect2"> <a name="gdk-drawing-context-get-cairo-context"></a><h3>gdk_drawing_context_get_cairo_context ()</h3> <pre class="programlisting"><span class="returnvalue">cairo_t</span> * gdk_drawing_context_get_cairo_context (<em class="parameter"><code><a class="link" href="GdkDrawingContext.html" title="GdkDrawingContext"><span class="type">GdkDrawingContext</span></a> *context</code></em>);</pre> <p>Retrieves a Cairo context to be used to draw on the <a class="link" href="gdk3-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> that created the <a class="link" href="GdkDrawingContext.html" title="GdkDrawingContext"><span class="type">GdkDrawingContext</span></a>.</p> <p>The returned context is guaranteed to be valid as long as the <a class="link" href="GdkDrawingContext.html" title="GdkDrawingContext"><span class="type">GdkDrawingContext</span></a> is valid, that is between a call to <a class="link" href="gdk3-Windows.html#gdk-window-begin-draw-frame" title="gdk_window_begin_draw_frame ()"><code class="function">gdk_window_begin_draw_frame()</code></a> and <a class="link" href="gdk3-Windows.html#gdk-window-end-draw-frame" title="gdk_window_end_draw_frame ()"><code class="function">gdk_window_end_draw_frame()</code></a>.</p> <div class="refsect3"> <a name="gdk-drawing-context-get-cairo-context.returns"></a><h4>Returns</h4> <p> a Cairo context to be used to draw the contents of the <a class="link" href="gdk3-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>. The context is owned by the <a class="link" href="GdkDrawingContext.html" title="GdkDrawingContext"><span class="type">GdkDrawingContext</span></a> and should not be destroyed. </p> <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p> </div> <hr> <div class="refsect2"> <a name="gdk-drawing-context-is-valid"></a><h3>gdk_drawing_context_is_valid ()</h3> <pre class="programlisting"><a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gdk_drawing_context_is_valid (<em class="parameter"><code><a class="link" href="GdkDrawingContext.html" title="GdkDrawingContext"><span class="type">GdkDrawingContext</span></a> *context</code></em>);</pre> <p>Checks whether the given <a class="link" href="GdkDrawingContext.html" title="GdkDrawingContext"><span class="type">GdkDrawingContext</span></a> is valid.</p> <div class="refsect3"> <a name="gdk-drawing-context-is-valid.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>context</p></td> <td class="parameter_description"><p>a <a class="link" href="GdkDrawingContext.html" title="GdkDrawingContext"><span class="type">GdkDrawingContext</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-drawing-context-is-valid.returns"></a><h4>Returns</h4> <p> <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the context is valid</p> </div> <p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p> </div> </div> <div class="refsect1"> <a name="GdkDrawingContext.other_details"></a><h2>Types and Values</h2> <div class="refsect2"> <a name="GdkDrawingContext-struct"></a><h3>GdkDrawingContext</h3> <pre class="programlisting">typedef struct _GdkDrawingContext GdkDrawingContext;</pre> </div> </div> <div class="refsect1"> <a name="GdkDrawingContext.property-details"></a><h2>Property Details</h2> <div class="refsect2"> <a name="GdkDrawingContext--clip"></a><h3>The <code class="literal">“clip”</code> property</h3> <pre class="programlisting"> “clip” <span class="type">CairoRegion</span> *</pre> <p>The clip region applied to the drawing context.</p> <p>Flags: Read / Write / Construct Only</p> <p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p> </div> <hr> <div class="refsect2"> <a name="GdkDrawingContext--window"></a><h3>The <code class="literal">“window”</code> property</h3> <pre class="programlisting"> “window” <a class="link" href="gdk3-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *</pre> <p>The <a class="link" href="gdk3-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> that created the drawing context.</p> <p>Flags: Read / Write / Construct Only</p> <p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p> </div> </div> </div> <div class="footer"> <hr>Generated by GTK-Doc V1.25.1</div> </body> </html>