<refentry id="gdk-Drawing-Primitives">
<refmeta>
<refentrytitle>Drawing Primitives</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Drawing Primitives</refname><refpurpose>functions for drawing points, lines, arcs, and text.</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>
<synopsis>

#include &lt;gdk/gdk.h&gt;


struct      <link linkend="GdkDrawable">GdkDrawable</link>;
<link linkend="GdkDrawable">GdkDrawable</link>* <link linkend="gdk-drawable-ref">gdk_drawable_ref</link>               (<link linkend="GdkDrawable">GdkDrawable</link> *drawable);
void        <link linkend="gdk-drawable-unref">gdk_drawable_unref</link>              (<link linkend="GdkDrawable">GdkDrawable</link> *drawable);
void        <link linkend="gdk-drawable-set-data">gdk_drawable_set_data</link>           (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             const <link linkend="gchar">gchar</link> *key,
                                             <link linkend="gpointer">gpointer</link> data,
                                             <link linkend="GDestroyNotify">GDestroyNotify</link> destroy_func);
<link linkend="gpointer">gpointer</link>    <link linkend="gdk-drawable-get-data">gdk_drawable_get_data</link>           (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             const <link linkend="gchar">gchar</link> *key);
<link linkend="GdkVisual">GdkVisual</link>*  <link linkend="gdk-drawable-get-visual">gdk_drawable_get_visual</link>         (<link linkend="GdkDrawable">GdkDrawable</link> *drawable);
void        <link linkend="gdk-drawable-set-colormap">gdk_drawable_set_colormap</link>       (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkColormap">GdkColormap</link> *colormap);
<link linkend="GdkColormap">GdkColormap</link>* <link linkend="gdk-drawable-get-colormap">gdk_drawable_get_colormap</link>      (<link linkend="GdkDrawable">GdkDrawable</link> *drawable);
<link linkend="gint">gint</link>        <link linkend="gdk-drawable-get-depth">gdk_drawable_get_depth</link>          (<link linkend="GdkDrawable">GdkDrawable</link> *drawable);
void        <link linkend="gdk-drawable-get-size">gdk_drawable_get_size</link>           (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="gint">gint</link> *width,
                                             <link linkend="gint">gint</link> *height);
<link linkend="GdkRegion">GdkRegion</link>*  <link linkend="gdk-drawable-get-clip-region">gdk_drawable_get_clip_region</link>    (<link linkend="GdkDrawable">GdkDrawable</link> *drawable);
<link linkend="GdkRegion">GdkRegion</link>*  <link linkend="gdk-drawable-get-visible-region">gdk_drawable_get_visible_region</link> (<link linkend="GdkDrawable">GdkDrawable</link> *drawable);

void        <link linkend="gdk-draw-point">gdk_draw_point</link>                  (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y);
void        <link linkend="gdk-draw-points">gdk_draw_points</link>                 (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkPoint">GdkPoint</link> *points,
                                             <link linkend="gint">gint</link> npoints);
void        <link linkend="gdk-draw-line">gdk_draw_line</link>                   (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x1,
                                             <link linkend="gint">gint</link> y1,
                                             <link linkend="gint">gint</link> x2,
                                             <link linkend="gint">gint</link> y2);
void        <link linkend="gdk-draw-lines">gdk_draw_lines</link>                  (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkPoint">GdkPoint</link> *points,
                                             <link linkend="gint">gint</link> npoints);
void        <link linkend="gdk-draw-segments">gdk_draw_segments</link>               (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkSegment">GdkSegment</link> *segs,
                                             <link linkend="gint">gint</link> nsegs);
struct      <link linkend="GdkSegment">GdkSegment</link>;
void        <link linkend="gdk-draw-rectangle">gdk_draw_rectangle</link>              (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> filled,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height);
void        <link linkend="gdk-draw-arc">gdk_draw_arc</link>                    (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> filled,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height,
                                             <link linkend="gint">gint</link> angle1,
                                             <link linkend="gint">gint</link> angle2);
void        <link linkend="gdk-draw-polygon">gdk_draw_polygon</link>                (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> filled,
                                             <link linkend="GdkPoint">GdkPoint</link> *points,
                                             <link linkend="gint">gint</link> npoints);
void        <link linkend="gdk-draw-glyphs">gdk_draw_glyphs</link>                 (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="PangoFont">PangoFont</link> *font,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs);
void        <link linkend="gdk-draw-layout-line">gdk_draw_layout_line</link>            (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="PangoLayoutLine">PangoLayoutLine</link> *line);
void        <link linkend="gdk-draw-layout-line-with-colors">gdk_draw_layout_line_with_colors</link>
                                            (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="PangoLayoutLine">PangoLayoutLine</link> *line,
                                             <link linkend="GdkColor">GdkColor</link> *foreground,
                                             <link linkend="GdkColor">GdkColor</link> *background);
void        <link linkend="gdk-draw-layout">gdk_draw_layout</link>                 (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="PangoLayout">PangoLayout</link> *layout);
void        <link linkend="gdk-draw-layout-with-colors">gdk_draw_layout_with_colors</link>     (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="PangoLayout">PangoLayout</link> *layout,
                                             <link linkend="GdkColor">GdkColor</link> *foreground,
                                             <link linkend="GdkColor">GdkColor</link> *background);

void        <link linkend="gdk-draw-string">gdk_draw_string</link>                 (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkFont">GdkFont</link> *font,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             const <link linkend="gchar">gchar</link> *string);
void        <link linkend="gdk-draw-text">gdk_draw_text</link>                   (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkFont">GdkFont</link> *font,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> text_length);
void        <link linkend="gdk-draw-text-wc">gdk_draw_text_wc</link>                (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkFont">GdkFont</link> *font,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             const <link linkend="GdkWChar">GdkWChar</link> *text,
                                             <link linkend="gint">gint</link> text_length);

#define     <link linkend="gdk-draw-pixmap">gdk_draw_pixmap</link>
void        <link linkend="gdk-draw-drawable">gdk_draw_drawable</link>               (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkDrawable">GdkDrawable</link> *src,
                                             <link linkend="gint">gint</link> xsrc,
                                             <link linkend="gint">gint</link> ysrc,
                                             <link linkend="gint">gint</link> xdest,
                                             <link linkend="gint">gint</link> ydest,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height);
void        <link linkend="gdk-draw-image">gdk_draw_image</link>                  (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkImage">GdkImage</link> *image,
                                             <link linkend="gint">gint</link> xsrc,
                                             <link linkend="gint">gint</link> ysrc,
                                             <link linkend="gint">gint</link> xdest,
                                             <link linkend="gint">gint</link> ydest,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height);
<link linkend="GdkImage">GdkImage</link>*   <link linkend="gdk-drawable-get-image">gdk_drawable_get_image</link>          (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height);


</synopsis>
</refsynopsisdiv>





<refsect1>
<title>Description</title>
<para>
These functions provide support for drawing points, lines, arcs and text
onto what are called 'drawables'. Drawables, as the name suggests, are things
which support drawing onto them, and are either <link linkend="GdkWindow">GdkWindow</link> or <link linkend="GdkPixmap">GdkPixmap</link>
objects.
</para>
<para>
Many of the drawing operations take a <link linkend="GdkGC">GdkGC</link> argument, which represents a
graphics context. This <link linkend="GdkGC">GdkGC</link> contains a number of drawing attributes such
as foreground color, background color and line width, and is used to reduce
the number of arguments needed for each drawing operation. See the
<link linkend="gdk-Graphics-Contexts">Graphics Contexts</link> section for
more information.
</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="GdkDrawable">struct GdkDrawable</title>
<programlisting>struct GdkDrawable
{
  gpointer user_data;
};
</programlisting>
<para>
An opaque structure representing an object that can be
drawn onto. This can be a <link linkend="GdkPixmap">GdkPixmap</link>, a <link linkend="GdkBitmap">GdkBitmap</link>,
or a <link linkend="GdkWindow">GdkWindow</link>.
</para></refsect2>
<refsect2>
<title><anchor id="gdk-drawable-ref">gdk_drawable_ref ()</title>
<programlisting><link linkend="GdkDrawable">GdkDrawable</link>* gdk_drawable_ref               (<link linkend="GdkDrawable">GdkDrawable</link> *drawable);</programlisting>
<warning>
<para>
<literal>gdk_drawable_ref</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
Deprecated equivalent of calling <link linkend="g-object-ref">g_object_ref</link>() on <parameter>drawable</parameter>.
(Drawables were not objects in previous versions of GDK.)</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkDrawable">GdkDrawable</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the same <parameter>drawable</parameter> passed in
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-drawable-unref">gdk_drawable_unref ()</title>
<programlisting>void        gdk_drawable_unref              (<link linkend="GdkDrawable">GdkDrawable</link> *drawable);</programlisting>
<warning>
<para>
<literal>gdk_drawable_unref</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
Deprecated equivalent of calling <link linkend="g-object-unref">g_object_unref</link>() on <parameter>drawable</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkDrawable">GdkDrawable</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-drawable-set-data">gdk_drawable_set_data ()</title>
<programlisting>void        gdk_drawable_set_data           (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             const <link linkend="gchar">gchar</link> *key,
                                             <link linkend="gpointer">gpointer</link> data,
                                             <link linkend="GDestroyNotify">GDestroyNotify</link> destroy_func);</programlisting>
<warning>
<para>
<literal>gdk_drawable_set_data</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
This function is equivalent to <link linkend="g-object-set-data">g_object_set_data</link>(),
the <link linkend="GObject">GObject</link> variant should be used instead.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkDrawable">GdkDrawable</link>
</entry></row>
<row><entry align="right"><parameter>key</parameter>&nbsp;:</entry>
<entry> name to store the data under
</entry></row>
<row><entry align="right"><parameter>data</parameter>&nbsp;:</entry>
<entry> arbitrary data
</entry></row>
<row><entry align="right"><parameter>destroy_func</parameter>&nbsp;:</entry>
<entry> function to free <parameter>data</parameter>, or <literal>NULL</literal>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-drawable-get-data">gdk_drawable_get_data ()</title>
<programlisting><link linkend="gpointer">gpointer</link>    gdk_drawable_get_data           (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             const <link linkend="gchar">gchar</link> *key);</programlisting>
<warning>
<para>
<literal>gdk_drawable_get_data</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
Equivalent to <link linkend="g-object-get-data">g_object_get_data</link>(); the <link linkend="GObject">GObject</link> variant should be
used instead.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkDrawable">GdkDrawable</link>
</entry></row>
<row><entry align="right"><parameter>key</parameter>&nbsp;:</entry>
<entry> name the data was stored under
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the data stored at <parameter>key</parameter>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-drawable-get-visual">gdk_drawable_get_visual ()</title>
<programlisting><link linkend="GdkVisual">GdkVisual</link>*  gdk_drawable_get_visual         (<link linkend="GdkDrawable">GdkDrawable</link> *drawable);</programlisting>
<para>
Gets the <link linkend="GdkVisual">GdkVisual</link> describing the pixel format of <parameter>drawable</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkDrawable">GdkDrawable</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a <link linkend="GdkVisual">GdkVisual</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-drawable-set-colormap">gdk_drawable_set_colormap ()</title>
<programlisting>void        gdk_drawable_set_colormap       (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkColormap">GdkColormap</link> *colormap);</programlisting>
<para>
Sets the colormap associated with <parameter>drawable</parameter>. Normally this will
happen automatically when the drawable is created; you only need to
use this function if the drawable-creating function did not have a
way to determine the colormap, and you then use drawable operations
that require a colormap. The colormap for all drawables and
graphics contexts you intend to use together should match. i.e.
when using a <link linkend="GdkGC">GdkGC</link> to draw to a drawable, or copying one drawable
to another, the colormaps should match.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkDrawable">GdkDrawable</link>
</entry></row>
<row><entry align="right"><parameter>colormap</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkColormap">GdkColormap</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-drawable-get-colormap">gdk_drawable_get_colormap ()</title>
<programlisting><link linkend="GdkColormap">GdkColormap</link>* gdk_drawable_get_colormap      (<link linkend="GdkDrawable">GdkDrawable</link> *drawable);</programlisting>
<para>
Gets the colormap for <parameter>drawable</parameter>, if one is set; returns
<literal>NULL</literal> otherwise.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkDrawable">GdkDrawable</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the colormap, or <literal>NULL</literal>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-drawable-get-depth">gdk_drawable_get_depth ()</title>
<programlisting><link linkend="gint">gint</link>        gdk_drawable_get_depth          (<link linkend="GdkDrawable">GdkDrawable</link> *drawable);</programlisting>
<para>
Obtains the bit depth of the drawable, that is, the number of bits
that make up a pixel in the drawable's visual. Examples are 8 bits
per pixel, 24 bits per pixel, etc.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkDrawable">GdkDrawable</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> number of bits per pixel
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-drawable-get-size">gdk_drawable_get_size ()</title>
<programlisting>void        gdk_drawable_get_size           (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="gint">gint</link> *width,
                                             <link linkend="gint">gint</link> *height);</programlisting>
<para>
Fills *<parameter>width</parameter> and *<parameter>height</parameter> with the size of <parameter>drawable</parameter>.
<parameter>width</parameter> or <parameter>height</parameter> can be <literal>NULL</literal> if you only want the other one.
</para>
<para>
On the X11 platform, if <parameter>drawable</parameter> is a <link linkend="GdkWindow">GdkWindow</link>, the returned
size is the size reported in the most-recently-processed configure
event, rather than the current size on the X server.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkDrawable">GdkDrawable</link>
</entry></row>
<row><entry align="right"><parameter>width</parameter>&nbsp;:</entry>
<entry> location to store drawable's width, or <literal>NULL</literal>
</entry></row>
<row><entry align="right"><parameter>height</parameter>&nbsp;:</entry>
<entry> location to store drawable's height, or <literal>NULL</literal>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-drawable-get-clip-region">gdk_drawable_get_clip_region ()</title>
<programlisting><link linkend="GdkRegion">GdkRegion</link>*  gdk_drawable_get_clip_region    (<link linkend="GdkDrawable">GdkDrawable</link> *drawable);</programlisting>
<para>
Computes the region of a drawable that potentially can be written
to by drawing primitives. This region will not take into account
the clip region for the GC, and may also not take into account
other factors such as if the window is obscured by other windows,
but no area outside of this region will be affected by drawing
primitives.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkDrawable">GdkDrawable</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a <link linkend="GdkRegion">GdkRegion</link>. This must be freed with <link linkend="gdk-region-destroy">gdk_region_destroy</link>()
              when you are done.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-drawable-get-visible-region">gdk_drawable_get_visible_region ()</title>
<programlisting><link linkend="GdkRegion">GdkRegion</link>*  gdk_drawable_get_visible_region (<link linkend="GdkDrawable">GdkDrawable</link> *drawable);</programlisting>
<para>
Computes the region of a drawable that is potentially visible.
This does not necessarily take into account if the window is
obscured by other windows, but no area outside of this region
is visible.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry> 
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a <link linkend="GdkRegion">GdkRegion</link>. This must be freed with <link linkend="gdk-region-destroy">gdk_region_destroy</link>()
              when you are done.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-draw-point">gdk_draw_point ()</title>
<programlisting>void        gdk_draw_point                  (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y);</programlisting>
<para>
Draws a point, using the foreground color and other attributes of the <link linkend="GdkGC">GdkGC</link>.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDrawable">GdkDrawable</link> (a <link linkend="GdkWindow">GdkWindow</link> or a <link linkend="GdkPixmap">GdkPixmap</link>).
</entry></row>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
<entry>the x coordinate of the point.
</entry></row>
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
<entry>the y coordinate of the point.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-draw-points">gdk_draw_points ()</title>
<programlisting>void        gdk_draw_points                 (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkPoint">GdkPoint</link> *points,
                                             <link linkend="gint">gint</link> npoints);</programlisting>
<para>
Draws a number of points, using the foreground color and other attributes of
the <link linkend="GdkGC">GdkGC</link>.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDrawable">GdkDrawable</link> (a <link linkend="GdkWindow">GdkWindow</link> or a <link linkend="GdkPixmap">GdkPixmap</link>).
</entry></row>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>points</parameter>&nbsp;:</entry>
<entry>an array of <link linkend="GdkPoint">GdkPoint</link> structures.
</entry></row>
<row><entry align="right"><parameter>npoints</parameter>&nbsp;:</entry>
<entry>the number of points to be drawn.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-draw-line">gdk_draw_line ()</title>
<programlisting>void        gdk_draw_line                   (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x1,
                                             <link linkend="gint">gint</link> y1,
                                             <link linkend="gint">gint</link> x2,
                                             <link linkend="gint">gint</link> y2);</programlisting>
<para>
Draws a line, using the foreground color and other attributes of the <link linkend="GdkGC">GdkGC</link>.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDrawable">GdkDrawable</link> (a <link linkend="GdkWindow">GdkWindow</link> or a <link linkend="GdkPixmap">GdkPixmap</link>).
</entry></row>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>x1</parameter>&nbsp;:</entry>
<entry>the x coordinate of the start point.
</entry></row>
<row><entry align="right"><parameter>y1</parameter>&nbsp;:</entry>
<entry>the y coordinate of the start point.
</entry></row>
<row><entry align="right"><parameter>x2</parameter>&nbsp;:</entry>
<entry>the x coordinate of the end point.
</entry></row>
<row><entry align="right"><parameter>y2</parameter>&nbsp;:</entry>
<entry>the y coordinate of the end point.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-draw-lines">gdk_draw_lines ()</title>
<programlisting>void        gdk_draw_lines                  (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkPoint">GdkPoint</link> *points,
                                             <link linkend="gint">gint</link> npoints);</programlisting>
<para>
Draws a series of lines connecting the given points.
The way in which joins between lines are draw is determined by the
<link linkend="GdkCapStyle">GdkCapStyle</link> value in the <link linkend="GdkGC">GdkGC</link>. This can be set with
<link linkend="gdk-gc-set-line-attributes">gdk_gc_set_line_attributes</link>().
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDrawable">GdkDrawable</link> (a <link linkend="GdkWindow">GdkWindow</link> or a <link linkend="GdkPixmap">GdkPixmap</link>).
</entry></row>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>points</parameter>&nbsp;:</entry>
<entry>an array of <link linkend="GdkPoint">GdkPoint</link> structures specifying the endpoints of the
lines.
</entry></row>
<row><entry align="right"><parameter>npoints</parameter>&nbsp;:</entry>
<entry>the size of the <parameter>points</parameter> array.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-draw-segments">gdk_draw_segments ()</title>
<programlisting>void        gdk_draw_segments               (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkSegment">GdkSegment</link> *segs,
                                             <link linkend="gint">gint</link> nsegs);</programlisting>
<para>
Draws a number of unconnected lines.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDrawable">GdkDrawable</link> (a <link linkend="GdkWindow">GdkWindow</link> or a <link linkend="GdkPixmap">GdkPixmap</link>).
</entry></row>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>segs</parameter>&nbsp;:</entry>
<entry>an array of <link linkend="GdkSegment">GdkSegment</link> structures specifying the start and end points
of the lines to be drawn,
</entry></row>
<row><entry align="right"><parameter>nsegs</parameter>&nbsp;:</entry>
<entry>the number of line segments to draw, i.e. the size of the <parameter>segs</parameter> array.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GdkSegment">struct GdkSegment</title>
<programlisting>struct GdkSegment
{
  gint x1;
  gint y1;
  gint x2;
  gint y2;
};
</programlisting>
<para>
Specifies the start and end point of a line for use by the <link linkend="gdk-draw-segments">gdk_draw_segments</link>()
function.
</para><informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><link linkend="gint">gint</link> <structfield>x1</structfield></entry>
<entry>the x coordinate of the start point.
</entry>
</row>
<row>
<entry><link linkend="gint">gint</link> <structfield>y1</structfield></entry>
<entry>the y coordinate of the start point.
</entry>
</row>
<row>
<entry><link linkend="gint">gint</link> <structfield>x2</structfield></entry>
<entry>the x coordinate of the end point.
</entry>
</row>
<row>
<entry><link linkend="gint">gint</link> <structfield>y2</structfield></entry>
<entry>the y coordinate of the end point.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-draw-rectangle">gdk_draw_rectangle ()</title>
<programlisting>void        gdk_draw_rectangle              (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> filled,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height);</programlisting>
<para>
Draws a rectangular outline or filled rectangle, using the foreground color
and other attributes of the <link linkend="GdkGC">GdkGC</link>.
</para>
<note>
<para>
A rectangle drawn filled is 1 pixel smaller in both dimensions than a rectangle
outlined. Calling <literal>gdk_draw_rectangle (window, gc, TRUE, 0, 0, 20, 20)</literal> results
in a filled rectangle 20 pixels wide and 20 pixels high. Calling
<literal>gdk_draw_rectangle (window, gc, FALSE, 0, 0, 20, 20)</literal> results in an outlined
rectangle with corners at (0, 0), (0, 20), (20, 20), and (20, 0), which
makes it 21 pixels wide and 21 pixels high.
</para>
</note><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDrawable">GdkDrawable</link> (a <link linkend="GdkWindow">GdkWindow</link> or a <link linkend="GdkPixmap">GdkPixmap</link>).
</entry></row>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>filled</parameter>&nbsp;:</entry>
<entry><literal>TRUE</literal> if the rectangle should be filled.
</entry></row>
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
<entry>the x coordinate of the left edge of the rectangle.
</entry></row>
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
<entry>the y coordinate of the top edge of the rectangle.
</entry></row>
<row><entry align="right"><parameter>width</parameter>&nbsp;:</entry>
<entry>the width of the rectangle.
</entry></row>
<row><entry align="right"><parameter>height</parameter>&nbsp;:</entry>
<entry>the height of the rectangle.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-draw-arc">gdk_draw_arc ()</title>
<programlisting>void        gdk_draw_arc                    (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> filled,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height,
                                             <link linkend="gint">gint</link> angle1,
                                             <link linkend="gint">gint</link> angle2);</programlisting>
<para>
Draws an arc or a filled 'pie slice'. The arc is defined by the bounding
rectangle of the entire ellipse, and the start and end angles of the part of
the ellipse to be drawn.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDrawable">GdkDrawable</link> (a <link linkend="GdkWindow">GdkWindow</link> or a <link linkend="GdkPixmap">GdkPixmap</link>).
</entry></row>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>filled</parameter>&nbsp;:</entry>
<entry><literal>TRUE</literal> if the arc should be filled, producing a 'pie slice'.
</entry></row>
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
<entry>the x coordinate of the left edge of the bounding rectangle.
</entry></row>
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
<entry>the y coordinate of the top edge of the bounding rectangle.
</entry></row>
<row><entry align="right"><parameter>width</parameter>&nbsp;:</entry>
<entry>the width of the bounding rectangle.
</entry></row>
<row><entry align="right"><parameter>height</parameter>&nbsp;:</entry>
<entry>the height of the bounding rectangle.
</entry></row>
<row><entry align="right"><parameter>angle1</parameter>&nbsp;:</entry>
<entry>the start angle of the arc, relative to the 3 o'clock position,
counter-clockwise, in 1/64ths of a degree.
</entry></row>
<row><entry align="right"><parameter>angle2</parameter>&nbsp;:</entry>
<entry>the end angle of the arc, relative to <parameter>angle1</parameter>, in 1/64ths of a degree.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-draw-polygon">gdk_draw_polygon ()</title>
<programlisting>void        gdk_draw_polygon                (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> filled,
                                             <link linkend="GdkPoint">GdkPoint</link> *points,
                                             <link linkend="gint">gint</link> npoints);</programlisting>
<para>
Draws an outlined or filled polygon.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDrawable">GdkDrawable</link> (a <link linkend="GdkWindow">GdkWindow</link> or a <link linkend="GdkPixmap">GdkPixmap</link>).
</entry></row>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>filled</parameter>&nbsp;:</entry>
<entry><literal>TRUE</literal> if the polygon should be filled. The polygon is closed
automatically, connecting the last point to the first point if necessary.
</entry></row>
<row><entry align="right"><parameter>points</parameter>&nbsp;:</entry>
<entry>an array of <link linkend="GdkPoint">GdkPoint</link> structures specifying the points making up the
polygon.
</entry></row>
<row><entry align="right"><parameter>npoints</parameter>&nbsp;:</entry>
<entry>the number of points.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-draw-glyphs">gdk_draw_glyphs ()</title>
<programlisting>void        gdk_draw_glyphs                 (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="PangoFont">PangoFont</link> *font,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs);</programlisting>
<para>
This is a low-level function; 99% of text rendering should be done
using <link linkend="gdk-draw-layout">gdk_draw_layout</link>() instead.
</para>
<para>
A glyph is a character in a font. This function draws a sequence of
glyphs.  To obtain a sequence of glyphs you have to understand a
lot about internationalized text handling, which you don't want to
understand; thus, use <link linkend="gdk-draw-layout">gdk_draw_layout</link>() instead of this function,
<link linkend="gdk-draw-layout">gdk_draw_layout</link>() handles the details.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkDrawable">GdkDrawable</link>
</entry></row>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkGC">GdkGC</link>
</entry></row>
<row><entry align="right"><parameter>font</parameter>&nbsp;:</entry>
<entry> font to be used
</entry></row>
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
<entry> X coordinate of baseline origin
</entry></row>
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
<entry> Y coordinate of baseline origin
</entry></row>
<row><entry align="right"><parameter>glyphs</parameter>&nbsp;:</entry>
<entry> glyphs to render
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-draw-layout-line">gdk_draw_layout_line ()</title>
<programlisting>void        gdk_draw_layout_line            (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="PangoLayoutLine">PangoLayoutLine</link> *line);</programlisting>
<para>
Render a <link linkend="PangoLayoutLine">PangoLayoutLine</link> onto an GDK drawable</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry>  the drawable on which to draw the line
</entry></row>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>        base graphics to use
</entry></row>
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
<entry>         the x position of start of string (in pixels)
</entry></row>
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
<entry>         the y position of baseline (in pixels)
</entry></row>
<row><entry align="right"><parameter>line</parameter>&nbsp;:</entry>
<entry>      a <link linkend="PangoLayoutLine">PangoLayoutLine</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-draw-layout-line-with-colors">gdk_draw_layout_line_with_colors ()</title>
<programlisting>void        gdk_draw_layout_line_with_colors
                                            (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="PangoLayoutLine">PangoLayoutLine</link> *line,
                                             <link linkend="GdkColor">GdkColor</link> *foreground,
                                             <link linkend="GdkColor">GdkColor</link> *background);</programlisting>
<para>
Render a <link linkend="PangoLayoutLine">PangoLayoutLine</link> onto a <link linkend="GdkDrawable">GdkDrawable</link>, overriding the
layout's normal colors with <parameter>foreground</parameter> and/or <parameter>background</parameter>.
<parameter>foreground</parameter> and <parameter>background</parameter> need not be allocated.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry>  the drawable on which to draw the line
</entry></row>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>        base graphics to use
</entry></row>
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
<entry>         the x position of start of string (in pixels)
</entry></row>
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
<entry>         the y position of baseline (in pixels)
</entry></row>
<row><entry align="right"><parameter>line</parameter>&nbsp;:</entry>
<entry>      a <link linkend="PangoLayoutLine">PangoLayoutLine</link>
</entry></row>
<row><entry align="right"><parameter>foreground</parameter>&nbsp;:</entry>
<entry> foreground override color, or <literal>NULL</literal> for none
</entry></row>
<row><entry align="right"><parameter>background</parameter>&nbsp;:</entry>
<entry> background override color, or <literal>NULL</literal> for none
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-draw-layout">gdk_draw_layout ()</title>
<programlisting>void        gdk_draw_layout                 (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Render a <link linkend="PangoLayout">PangoLayout</link> onto a GDK drawable</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry>  the drawable on which to draw string
</entry></row>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>        base graphics context to use
</entry></row>
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
<entry>         the X position of the left of the layout (in pixels)
</entry></row>
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
<entry>         the Y position of the top of the layout (in pixels)
</entry></row>
<row><entry align="right"><parameter>layout</parameter>&nbsp;:</entry>
<entry>    a <link linkend="PangoLayout">PangoLayout</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-draw-layout-with-colors">gdk_draw_layout_with_colors ()</title>
<programlisting>void        gdk_draw_layout_with_colors     (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="PangoLayout">PangoLayout</link> *layout,
                                             <link linkend="GdkColor">GdkColor</link> *foreground,
                                             <link linkend="GdkColor">GdkColor</link> *background);</programlisting>
<para>
Render a <link linkend="PangoLayout">PangoLayout</link> onto a <link linkend="GdkDrawable">GdkDrawable</link>, overriding the
layout's normal colors with <parameter>foreground</parameter> and/or <parameter>background</parameter>.
<parameter>foreground</parameter> and <parameter>background</parameter> need not be allocated.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry>  the drawable on which to draw string
</entry></row>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>        base graphics context to use
</entry></row>
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
<entry>         the X position of the left of the layout (in pixels)
</entry></row>
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
<entry>         the Y position of the top of the layout (in pixels)
</entry></row>
<row><entry align="right"><parameter>layout</parameter>&nbsp;:</entry>
<entry>    a <link linkend="PangoLayout">PangoLayout</link>
</entry></row>
<row><entry align="right"><parameter>foreground</parameter>&nbsp;:</entry>
<entry> foreground override color, or <literal>NULL</literal> for none
</entry></row>
<row><entry align="right"><parameter>background</parameter>&nbsp;:</entry>
<entry> background override color, or <literal>NULL</literal> for none
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-draw-string">gdk_draw_string ()</title>
<programlisting>void        gdk_draw_string                 (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkFont">GdkFont</link> *font,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             const <link linkend="gchar">gchar</link> *string);</programlisting>
<warning>
<para>
<literal>gdk_draw_string</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
Draws a string of characters in the given font or fontset.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDrawable">GdkDrawable</link> (a <link linkend="GdkWindow">GdkWindow</link> or a <link linkend="GdkPixmap">GdkPixmap</link>).
</entry></row>
<row><entry align="right"><parameter>font</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkFont">GdkFont</link>.
</entry></row>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
<entry>the x coordinate of the left edge of the text.
</entry></row>
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
<entry>the y coordinate of the baseline of the text.
</entry></row>
<row><entry align="right"><parameter>string</parameter>&nbsp;:</entry>
<entry>the string of characters to draw.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-draw-text">gdk_draw_text ()</title>
<programlisting>void        gdk_draw_text                   (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkFont">GdkFont</link> *font,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> text_length);</programlisting>
<warning>
<para>
<literal>gdk_draw_text</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
Draws a number of characters in the given font or fontset.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDrawable">GdkDrawable</link> (a <link linkend="GdkWindow">GdkWindow</link> or a <link linkend="GdkPixmap">GdkPixmap</link>).
</entry></row>
<row><entry align="right"><parameter>font</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkFont">GdkFont</link>.
</entry></row>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
<entry>the x coordinate of the left edge of the text.
</entry></row>
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
<entry>the y coordinate of the baseline of the text.
</entry></row>
<row><entry align="right"><parameter>text</parameter>&nbsp;:</entry>
<entry>the characters to draw.
</entry></row>
<row><entry align="right"><parameter>text_length</parameter>&nbsp;:</entry>
<entry>the number of characters of <parameter>text</parameter> to draw.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-draw-text-wc">gdk_draw_text_wc ()</title>
<programlisting>void        gdk_draw_text_wc                (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkFont">GdkFont</link> *font,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             const <link linkend="GdkWChar">GdkWChar</link> *text,
                                             <link linkend="gint">gint</link> text_length);</programlisting>
<warning>
<para>
<literal>gdk_draw_text_wc</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
Draws a number of wide characters using the given font of fontset.
If the font is a 1-byte font, the string is converted into 1-byte characters
(discarding the high bytes) before output.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDrawable">GdkDrawable</link> (a <link linkend="GdkWindow">GdkWindow</link> or a <link linkend="GdkPixmap">GdkPixmap</link>).
</entry></row>
<row><entry align="right"><parameter>font</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkFont">GdkFont</link>.
</entry></row>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
<entry>the x coordinate of the left edge of the text.
</entry></row>
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
<entry>the y coordinate of the baseline of the text.
</entry></row>
<row><entry align="right"><parameter>text</parameter>&nbsp;:</entry>
<entry>the wide characters to draw.
</entry></row>
<row><entry align="right"><parameter>text_length</parameter>&nbsp;:</entry>
<entry>the number of characters to draw.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-draw-pixmap">gdk_draw_pixmap</title>
<programlisting>#define gdk_draw_pixmap                gdk_draw_drawable
</programlisting>
<warning>
<para>
<literal>gdk_draw_pixmap</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
Draws a pixmap, or a part of a pixmap, onto another drawable.
</para></refsect2>
<refsect2>
<title><anchor id="gdk-draw-drawable">gdk_draw_drawable ()</title>
<programlisting>void        gdk_draw_drawable               (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkDrawable">GdkDrawable</link> *src,
                                             <link linkend="gint">gint</link> xsrc,
                                             <link linkend="gint">gint</link> ysrc,
                                             <link linkend="gint">gint</link> xdest,
                                             <link linkend="gint">gint</link> ydest,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height);</programlisting>
<para>
Copies the <parameter>width</parameter> x <parameter>height</parameter> region of <parameter>src</parameter> at coordinates (<parameter>xsrc</parameter>,
<parameter>ysrc</parameter>) to coordinates (<parameter>xdest</parameter>, <parameter>ydest</parameter>) in <parameter>drawable</parameter>.
<parameter>width</parameter> and/or <parameter>height</parameter> may be given as -1, in which case the entire
<parameter>src</parameter> drawable will be copied.
</para>
<para>
Most fields in <parameter>gc</parameter> are not used for this operation, but notably the
clip mask or clip region will be honored.
</para>
<para>
The source and destination drawables must have the same visual and
colormap, or errors will result. (On X11, failure to match
visual/colormap results in a BadMatch error from the X server.)
A common cause of this problem is an attempt to draw a bitmap to
a color drawable. The way to draw a bitmap is to set the
bitmap as a clip mask on your <link linkend="GdkGC">GdkGC</link>, then use <link linkend="gdk-draw-rectangle">gdk_draw_rectangle</link>()
to draw a rectangle clipped to the bitmap.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkDrawable">GdkDrawable</link>
</entry></row>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkGC">GdkGC</link> sharing the drawable's visual and colormap
</entry></row>
<row><entry align="right"><parameter>src</parameter>&nbsp;:</entry>
<entry> another <link linkend="GdkDrawable">GdkDrawable</link>
</entry></row>
<row><entry align="right"><parameter>xsrc</parameter>&nbsp;:</entry>
<entry> X position in <parameter>src</parameter> of rectangle to draw
</entry></row>
<row><entry align="right"><parameter>ysrc</parameter>&nbsp;:</entry>
<entry> Y position in <parameter>src</parameter> of rectangle to draw
</entry></row>
<row><entry align="right"><parameter>xdest</parameter>&nbsp;:</entry>
<entry> X position in <parameter>drawable</parameter> where the rectangle should be drawn
</entry></row>
<row><entry align="right"><parameter>ydest</parameter>&nbsp;:</entry>
<entry> Y position in <parameter>drawable</parameter> where the rectangle should be drawn
</entry></row>
<row><entry align="right"><parameter>width</parameter>&nbsp;:</entry>
<entry> width of rectangle to draw, or -1 for entire <parameter>src</parameter> width
</entry></row>
<row><entry align="right"><parameter>height</parameter>&nbsp;:</entry>
<entry> height of rectangle to draw, or -1 for entire <parameter>src</parameter> height
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-draw-image">gdk_draw_image ()</title>
<programlisting>void        gdk_draw_image                  (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="GdkGC">GdkGC</link> *gc,
                                             <link linkend="GdkImage">GdkImage</link> *image,
                                             <link linkend="gint">gint</link> xsrc,
                                             <link linkend="gint">gint</link> ysrc,
                                             <link linkend="gint">gint</link> xdest,
                                             <link linkend="gint">gint</link> ydest,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height);</programlisting>
<para>
Draws a <link linkend="GdkImage">GdkImage</link> onto a drawable.
The depth of the <link linkend="GdkImage">GdkImage</link> must match the depth of the <link linkend="GdkDrawable">GdkDrawable</link>.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDrawable">GdkDrawable</link> (a <link linkend="GdkWindow">GdkWindow</link> or a <link linkend="GdkPixmap">GdkPixmap</link>).
</entry></row>
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkGC">GdkGC</link>.
</entry></row>
<row><entry align="right"><parameter>image</parameter>&nbsp;:</entry>
<entry>the <link linkend="GdkImage">GdkImage</link> to draw.
</entry></row>
<row><entry align="right"><parameter>xsrc</parameter>&nbsp;:</entry>
<entry>the left edge of the source rectangle within <parameter>image</parameter>.
</entry></row>
<row><entry align="right"><parameter>ysrc</parameter>&nbsp;:</entry>
<entry>the top of the source rectangle within <parameter>image</parameter>.
</entry></row>
<row><entry align="right"><parameter>xdest</parameter>&nbsp;:</entry>
<entry>the x coordinate of the destination within <parameter>drawable</parameter>.
</entry></row>
<row><entry align="right"><parameter>ydest</parameter>&nbsp;:</entry>
<entry>the y coordinate of the destination within <parameter>drawable</parameter>.
</entry></row>
<row><entry align="right"><parameter>width</parameter>&nbsp;:</entry>
<entry>the width of the area to be copied, or -1 to make the area extend to
the right edge of <parameter>image</parameter>.
</entry></row>
<row><entry align="right"><parameter>height</parameter>&nbsp;:</entry>
<entry>the height of the area to be copied, or -1 to make the area extend
to the bottom edge of <parameter>image</parameter>.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-drawable-get-image">gdk_drawable_get_image ()</title>
<programlisting><link linkend="GdkImage">GdkImage</link>*   gdk_drawable_get_image          (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height);</programlisting>
<para>
A <link linkend="GdkImage">GdkImage</link> stores client-side image data (pixels). In contrast,
<link linkend="GdkPixmap">GdkPixmap</link> and <link linkend="GdkWindow">GdkWindow</link> are server-side
objects. <link linkend="gdk-drawable-get-image">gdk_drawable_get_image</link>() obtains the pixels from a
server-side drawable as a client-side <link linkend="GdkImage">GdkImage</link>.  The format of a
<link linkend="GdkImage">GdkImage</link> depends on the <link linkend="GdkVisual">GdkVisual</link> of the current display, which
makes manipulating <link linkend="GdkImage">GdkImage</link> extremely difficult; therefore, in
most cases you should use <link linkend="gdk-pixbuf-get-from-drawable">gdk_pixbuf_get_from_drawable</link>() instead of
this lower-level function. A <link linkend="GdkPixbuf">GdkPixbuf</link> contains image data in a
canonicalized RGB format, rather than a display-dependent format.
Of course, there's a convenience vs. speed tradeoff here, so you'll
want to think about what makes sense for your application.
</para>
<para>
<parameter>x</parameter>, <parameter>y</parameter>, <parameter>width</parameter>, and <parameter>height</parameter> define the region of <parameter>drawable</parameter> to
obtain as an image.
</para>
<para>
You would usually copy image data to the client side if you intend
to examine the values of individual pixels, for example to darken
an image or add a red tint. It would be prohibitively slow to
make a round-trip request to the windowing system for each pixel,
so instead you get all of them at once, modify them, then copy
them all back at once.
</para>
<para>
If the X server or other windowing system backend is on the local
machine, this function may use shared memory to avoid copying
the image data.
</para>
<para>
If the source drawable is a <link linkend="GdkWindow">GdkWindow</link> and partially offscreen
or obscured, then the obscured portions of the returned image
will contain undefined data.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkDrawable">GdkDrawable</link>
</entry></row>
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
<entry> x coordinate on <parameter>drawable</parameter>
</entry></row>
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
<entry> y coordinate on <parameter>drawable</parameter>
</entry></row>
<row><entry align="right"><parameter>width</parameter>&nbsp;:</entry>
<entry> width of region to get
</entry></row>
<row><entry align="right"><parameter>height</parameter>&nbsp;:</entry>
<entry> height or region to get
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a <link linkend="GdkImage">GdkImage</link> containing the contents of <parameter>drawable</parameter>
</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>




</refentry>
