<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-gdkdrawable">
  <refnamediv>
    <refname>gtk.gdk.Drawable</refname>
    <refpurpose>a base class for drawing methods</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.gdk.Drawable</classname></ooclass>
      <ooclass><classname><link
linkend="class-gobject">gobject.GObject</link></classname></ooclass>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--get-size">get_size</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--set-colormap">set_colormap</link></methodname>
	<methodparam><parameter
		       role="keyword">colormap</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--get-colormap">get_colormap</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--get-visual">get_visual</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--get-depth">get_depth</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gdkdrawable--get-screen">get_screen</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gdkdrawable--get-display">get_display</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--draw-point">draw_point</link></methodname>
	<methodparam><parameter role="keyword">gc</parameter></methodparam>
	<methodparam><parameter role="keyword">x</parameter></methodparam>
	<methodparam><parameter role="keyword">y</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--draw-line">draw_line</link></methodname>
	<methodparam><parameter role="keyword">gc</parameter></methodparam>
	<methodparam><parameter role="keyword">x1</parameter></methodparam>
	<methodparam><parameter role="keyword">y1</parameter></methodparam>
	<methodparam><parameter role="keyword">x2</parameter></methodparam>
	<methodparam><parameter role="keyword">y2</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--draw-rectangle">draw_rectangle</link></methodname>
	<methodparam><parameter role="keyword">gc</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">filled</parameter></methodparam>
	<methodparam><parameter role="keyword">x</parameter></methodparam>
	<methodparam><parameter role="keyword">y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--draw-arc">draw_arc</link></methodname>
	<methodparam><parameter role="keyword">gc</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">filled</parameter></methodparam>
	<methodparam><parameter role="keyword">x</parameter></methodparam>
	<methodparam><parameter role="keyword">y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">angle1</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">angle2</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--draw-polygon">draw_polygon</link></methodname>
	<methodparam><parameter role="keyword">gc</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">filled</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">points</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--draw-drawable">draw_drawable</link></methodname>
	<methodparam><parameter role="keyword">gc</parameter></methodparam>
	<methodparam><parameter role="keyword">src</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">xsrc</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">ysrc</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">xdest</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">ydest</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--draw-image">draw_image</link></methodname>
	<methodparam><parameter role="keyword">gc</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">image</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">xsrc</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">ysrc</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">xdest</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">ydest</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--draw-points">draw_points</link></methodname>
	<methodparam><parameter role="keyword">gc</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">points</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--draw-segments">draw_segments</link></methodname>
	<methodparam><parameter role="keyword">gc</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">segs</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--draw-lines">draw_lines</link></methodname>
	<methodparam><parameter role="keyword">gc</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">points</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gdkdrawable--draw-pixbuf">draw_pixbuf</link></methodname>
	<methodparam><parameter
		       role="keyword">gc</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">pixbuf</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">src_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">src_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter><initializer>-1</initializer></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter><initializer>-1</initializer></methodparam>
	<methodparam><parameter
		       role="keyword">dither</parameter><initializer>gtk.gdk.RGB_DITHER_NORMAL</initializer></methodparam>
	<methodparam><parameter
		       role="keyword">x_dither</parameter><initializer>0</initializer></methodparam>
	<methodparam><parameter
		       role="keyword">y_dither</parameter><initializer>0</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--draw-glyphs">draw_glyphs</link></methodname>
	<methodparam><parameter role="keyword">gc</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">font</parameter></methodparam>
	<methodparam><parameter role="keyword">x</parameter></methodparam>
	<methodparam><parameter role="keyword">y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">glyphs</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gdkdrawable--draw-layout-line">draw_layout_line</link></methodname>
        <methodparam><parameter role="keyword">gc</parameter></methodparam>
        <methodparam><parameter role="keyword">x</parameter></methodparam>
        <methodparam><parameter role="keyword">y</parameter></methodparam>
        <methodparam><parameter role="keyword">line</parameter></methodparam>
        <methodparam><parameter
                         role="keyword">layout</parameter></methodparam>
        <methodparam><parameter role="keyword">foreground</parameter>
        <initializer>None</initializer></methodparam>
        <methodparam><parameter role="keyword">background</parameter>
        <initializer>None</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--draw-layout">draw_layout</link></methodname>
	<methodparam><parameter role="keyword">gc</parameter></methodparam>
	<methodparam><parameter role="keyword">x</parameter></methodparam>
	<methodparam><parameter role="keyword">y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">layout</parameter></methodparam>
	<methodparam><parameter role="keyword">foreground</parameter>
	  <initializer>None</initializer></methodparam>
	<methodparam><parameter role="keyword">background</parameter>
	  <initializer>None</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--get-image">get_image</link></methodname>
	<methodparam><parameter role="keyword">x</parameter></methodparam>
	<methodparam><parameter role="keyword">y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--get-clip-region">get_clip_region</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--get-visible-region">get_visible_region</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--new-gc">new_gc</link></methodname>
	<methodparam><parameter
		       role="keyword">foreground</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">background</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">font</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">function</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">fill</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">tile</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">stipple</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">clip_mask</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">subwindow_mode</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">ts_x_origin</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">ts_y_origin</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">clip_x_origin</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">clip_y_origin</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">graphics_exposures</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">line_width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">line_style</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">cap_style</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">join_style</parameter>></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--draw-rgb-image">draw_rgb_image</link></methodname>
	<methodparam><parameter role="keyword">gc</parameter></methodparam>
	<methodparam><parameter role="keyword">x</parameter></methodparam>
	<methodparam><parameter role="keyword">y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dith</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">rgb_buf</parameter></methodparam>
	<methodparam><parameter role="keyword">rowstride</parameter>
	  <initializer>-1</initializer></methodparam>
	<methodparam><parameter role="keyword">xdith</parameter>
	  <initializer>0</initializer></methodparam>
	<methodparam><parameter role="keyword">ydith</parameter>
	  <initializer>0</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--draw-rgb-32-image">draw_rgb_32_image</link></methodname>
	<methodparam><parameter role="keyword">gc</parameter></methodparam>
	<methodparam><parameter role="keyword">x</parameter></methodparam>
	<methodparam><parameter role="keyword">y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dith</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">rgb_buf</parameter></methodparam>
	<methodparam><parameter role="keyword">rowstride</parameter>
	  <initializer>-1</initializer></methodparam>
	<methodparam><parameter role="keyword">xdith</parameter>
	  <initializer>0</initializer></methodparam>
	<methodparam><parameter role="keyword">ydith</parameter>
	  <initializer>0</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--draw-gray-image">draw_gray_image</link></methodname>
	<methodparam><parameter role="keyword">gc</parameter></methodparam>
	<methodparam><parameter role="keyword">x</parameter></methodparam>
	<methodparam><parameter role="keyword">y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dith</parameter></methodparam>
	<methodparam><parameter role="keyword">buf</parameter></methodparam>
	<methodparam><parameter role="keyword">rowstride</parameter>
	  <initializer>-1</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gdkdrawable--draw-indexed-image">draw_indexed_image</link></methodname>
        <methodparam><parameter role="keyword">gc</parameter></methodparam>
        <methodparam><parameter role="keyword">x</parameter></methodparam>
        <methodparam><parameter role="keyword">y</parameter></methodparam>
        <methodparam><parameter role="keyword">width</parameter></methodparam>
        <methodparam><parameter role="keyword">height</parameter></methodparam>
        <methodparam><parameter role="keyword">dith</parameter></methodparam>
        <methodparam><parameter role="keyword">buf</parameter></methodparam>
        <methodparam><parameter role="keyword">rowstride</parameter></methodparam>
        <methodparam><parameter role="keyword">cmap</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkdrawable--cairo-create">cairo_create</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gdkdrawable">gtk.gdk.Drawable</link>
</synopsis>

  </refsect1>

  <refsect1>
    <title>Attributes</title>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
	<tgroup cols="3">
	<?dbhtml cellpadding="5"?>
	  <colspec column="1" colwidth="1in"/>
	  <colspec column="2" colwidth="1in"/>
	  <colspec column="3" colwidth="4in"/>
	  <tbody>

	    <row valign="top">
	      <entry>"handle"</entry>
	      <entry>Read</entry>
	      <entry>The handle of the MS Windows window associated with
the drawable. Not supported on X11.</entry>
	    </row>

	    <row valign="top">
	      <entry>"xid"</entry>
	      <entry>Read</entry>
	      <entry>The id of the X window available with the
drawable. Not supported on MS Windows</entry>
	    </row>

	</tbody>
      </tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>A <link
linkend="class-gdkdrawable"><classname>gtk.gdk.Drawable</classname></link>
is a base class providing drawing primitives for its subclasses: <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link> and
<link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link>.</para>

    <para>These methods 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="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> or
<link linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link>
objects.</para>

    <para>Many of the drawing operations take a <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link> argument,
which represents a graphics context. This <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></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="class-gdkgc"><classname>Graphics
Contexts</classname></link> section for more information.</para>

    <para>Some of the drawing operations take Pango objects like <link
linkend="class-pangocontext"><classname>pango.Context</classname></link> or
<link linkend="class-pangolayout"><classname>pango.Layout</classname></link>
as arguments. Use the <link
linkend="method-gtkwidget--create-pango-context"><methodname>gtk.Widget.create_pango_context</methodname>()</link>
or <link
linkend="method-gtkwidget--create-pango-layout"><methodname>gtk.Widget.create_pango_layout</methodname>()</link>
methods to obtain these objects.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-gdkdrawable--get-size">
      <title>gtk.gdk.Drawable.get_size</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_size</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a tuple containing the drawable's width and
height</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_size</methodname>() method returns a tuple
containing the width and height of the drawable.</para>

      <para>On the X11 platform, if the drawable is a <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></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>

    </refsect2>

    <refsect2 id="method-gdkdrawable--set-colormap">
      <title>gtk.gdk.Drawable.set_colormap</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_colormap</methodname>
	  <methodparam><parameter
			 role="keyword">colormap</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">colormap</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkcolormap"><classname>gtk.gdk.Colormap</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_colormap</methodname>() method sets the
<link
linkend="class-gdkcolormap"><classname>gtk.gdk.Colormap</classname></link>
associated with the drawable to the value specified by
<parameter>colormap</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="class-gdkgc"><classname>gtk.gdk.GC</classname></link> to draw to a
drawable, or copying one drawable to another, the colormaps should
match.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--get-colormap">
      <title>gtk.gdk.Drawable.get_colormap</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_colormap</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the colormap, or
<literal>None</literal></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_colormap</methodname>() method returns the
<link
linkend="class-gdkcolormap"><classname>gtk.gdk.Colormap</classname></link>
for the drawable or <literal>None</literal> if no colormap is set.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--get-visual">
      <title>gtk.gdk.Drawable.get_visual</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_visual</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_visual</methodname>() method returns the
<link linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link>
describing the pixel format of the drawable.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--get-depth">
      <title>gtk.gdk.Drawable.get_depth</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_depth</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the number of bits per
pixel</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_depth</methodname>() method returns 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>

    </refsect2>

    <refsect2 id="method-gdkdrawable--get-screen">
      <title>gtk.gdk.Drawable.get_screen</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_screen</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the <link
	  linkend="class-gdkscreen"><classname>gtk.gdk.Screen</classname></link>
	  associated with the drawable</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.2 and above.</para>
      </note>

      <para>The <methodname>get_screen</methodname>() method returns the
<link linkend="class-gdkscreen"><classname>gtk.gdk.Screen</classname></link>
associated with the drawable.</para>

    </refsect2>


    <refsect2 id="method-gdkdrawable--get-display">
      <title>gtk.gdk.Drawable.get_display</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_display</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the <link
	  linkend="class-gdkdisplay"><classname>gtk.gdk.Display</classname></link>
	  associated with the drawable</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.2 and above.</para>
      </note>

      <para>The <methodname>get_display</methodname>() method returns the
<link
linkend="class-gdkdisplay"><classname>gtk.gdk.Display</classname></link>
associated with the drawable.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--draw-point">
      <title>gtk.gdk.Drawable.draw_point</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>draw_point</methodname>
	  <methodparam><parameter
			 role="keyword">gc</parameter></methodparam>
	  <methodparam><parameter role="keyword">x</parameter></methodparam>
	  <methodparam><parameter role="keyword">y</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
	  <listitem><simpara>a graphics context</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate of the point in drawable
coordinates</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate of the point in drawable
coordinates</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>draw_point</methodname>() method draws a point
at the location specified by <parameter>x</parameter> and
<parameter>y</parameter> in the drawable using the <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link> graphics
context specified by <parameter>gc</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--draw-line">
      <title>gtk.gdk.Drawable.draw_line</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>draw_line</methodname>
	  <methodparam><parameter
			 role="keyword">gc</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">x1</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">y1</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">x2</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">y2</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
	  <listitem><simpara>a graphics context</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">x1</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate of the first
point</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y1</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate of the first
point</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">x2</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate of the second
point</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y2</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate of the second
point</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>draw_line</methodname>() method draws a line
between the two points specified by (<parameter>x1</parameter>,
<parameter>y1</parameter>) and (<parameter>x2</parameter>,
<parameter>y2</parameter>) using the <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link> graphics
context specified by <parameter>gc</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--draw-rectangle">
      <title>gtk.gdk.Drawable.draw_rectangle</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>draw_rectangle</methodname>
	  <methodparam><parameter
			 role="keyword">gc</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">filled</parameter></methodparam>
	  <methodparam><parameter role="keyword">x</parameter></methodparam>
	  <methodparam><parameter role="keyword">y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">height</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
	  <listitem><simpara>a graphics context</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">filled</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> the rectangle will
be filled with the foreground color</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate of the top left
corner</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate of the top left
corner</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">width</parameter>&nbsp;:</term>
	  <listitem><simpara>the width of the rectangle</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">height</parameter>&nbsp;:</term>
	  <listitem><simpara>the height of the
rectangle</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>draw_rectangle</methodname>() method draws a
rectangle of the specified <parameter>width</parameter> and
<parameter>height</parameter> with its top left corner at the location
specified by (<parameter>x</parameter>, <parameter>y</parameter>) using the
<link linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link>
graphics context specified by <parameter>gc</parameter>. If
<parameter>filled</parameter> is <literal>True</literal> the rectangle will
be filled with the foreground color.</para>

      <note>
	<para>A rectangle drawn filled is 1 pixel smaller in both dimensions
than a rectangle outlined. Calling:</para>

	<programlisting>
  window.draw_rectangle(gc, True, 0, 0, 20, 20)
</programlisting>

	<para>results in a filled rectangle 20 pixels wide and 20 pixels
high. Calling:</para>

	<programlisting>
  window.draw_rectangle(gc, False, 0, 0, 20, 20)
 </programlisting>

	<para>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>

    </refsect2>

    <refsect2 id="method-gdkdrawable--draw-arc">
      <title>gtk.gdk.Drawable.draw_arc</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>draw_arc</methodname>
	  <methodparam><parameter
			 role="keyword">gc</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">filled</parameter></methodparam>
	  <methodparam><parameter role="keyword">x</parameter></methodparam>
	  <methodparam><parameter role="keyword">y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">height</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">angle1</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">angle2</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
	  <listitem><simpara>a graphics context</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">filled</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> the arc will be
filled with the foreground color creating a "pie slice"</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate of the left edge of the
bounding rectangle.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate of the top edge of the
bounding rectangle. </simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">width</parameter>&nbsp;:</term>
	  <listitem><simpara>the width of the bounding
rectangle.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">height</parameter>&nbsp;:</term>
	  <listitem><simpara>the height of the bounding
rectangle.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">angle1</parameter>&nbsp;:</term>
	  <listitem><simpara>the start angle of the arc, relative to the 3
o'clock position, counter-clockwise, in 1/64ths of a
degree.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">angle2</parameter>&nbsp;:</term>
	  <listitem><simpara>the end angle of the arc, relative to angle1,
counter-clockwise, in 1/64ths of a degree.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>draw_arc</methodname>() method draws an arc or a
filled 'pie slice' if <parameter>filled</parameter> is
<literal>True</literal>. The arc is defined by the bounding rectangle of the
entire ellipse (specified by <parameter>x</parameter>,
<parameter>y</parameter>, <parameter>width</parameter> and
<parameter>height</parameter>), and the start and end angles of the part of
the ellipse to be drawn (specified by <parameter>angle1</parameter> and
<parameter>angle2</parameter>). The <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link> graphics
context specified by <parameter>gc</parameter> is used to determine the
drawing attributes.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--draw-polygon">
      <title>gtk.gdk.Drawable.draw_polygon</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>draw_polygon</methodname>
	  <methodparam><parameter
			 role="keyword">gc</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">filled</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">points</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
	  <listitem><simpara>a graphics context</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">filled</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> the polygon will be
filled with the foreground color</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">points</parameter>&nbsp;:</term>
	  <listitem><simpara>a sequence of 2-tuples</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>draw_polygon</methodname>() method draws an
outlined or filled polygon using the points specified by
<parameter>points</parameter>. <parameter>points</parameter> is a sequence
of 2-tuples that each contain an x and y coordinate of a point. The points
are connected in the order that they are specified and the last point is
automatically connected to the first point. The <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link> graphics
context specified by <parameter>gc</parameter> is used to determine the
drawing attributes.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--draw-drawable">
      <title>gtk.gdk.Drawable.draw_drawable</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>draw_drawable</methodname>
	  <methodparam><parameter
			 role="keyword">gc</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">src</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">xsrc</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">ysrc</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">xdest</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">ydest</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">height</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link> sharing the
drawable's visual and colormap</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">src</parameter>&nbsp;:</term>
	  <listitem><simpara>another <link
linkend="class-gdkdrawable"><classname>gtk.gdk.Drawable</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">xsrc</parameter>&nbsp;:</term>
	  <listitem><simpara>the X position in <parameter>src</parameter> of
rectangle to draw</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">ysrc</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y position in <parameter>src</parameter> of
rectangle to draw</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">xdest</parameter>&nbsp;:</term>
	  <listitem><simpara>the X position in the drawable where the
rectangle should be drawn</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">ydest</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y position in the drawable where the
rectangle should be drawn</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">width</parameter>&nbsp;:</term>
	  <listitem><simpara>the width of rectangle to draw, or -1 for
entire <parameter>src</parameter> width</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">height</parameter>&nbsp;:</term>
	  <listitem><simpara>the height of rectangle to draw, or -1 for
entire <parameter>src</parameter> height</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The draw_drawable() method copies the specified
<parameter>width</parameter> x <parameter>height</parameter> area of the
drawable specified by <parameter>src</parameter> at the specified
coordinates (<parameter>xsrc</parameter>, <parameter>ysrc</parameter>) to
the specified coordinates (<parameter>xdest</parameter>,
<parameter>ydest</parameter>) in the drawable. <parameter>width</parameter>
and <parameter>height</parameter> may be given as -1, to copy the entire
<parameter>src</parameter> drawable. Most fields in the <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link> specified by
<parameter>gc</parameter> are not used for this operation, but 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 and
colormap results in a <literal>BadMatch</literal> 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="class-gdkgc"><classname>gtk.gdk.GC</classname></link>,
then use the <link
linkend="method-gdkdrawable--draw-rectangle"><methodname>draw_rectangle</methodname>()</link> 
method to draw a rectangle clipped to the bitmap.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--draw-image">
      <title>gtk.gdk.Drawable.draw_image</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>draw_image</methodname>
	  <methodparam><parameter
			 role="keyword">gc</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">image</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">xsrc</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">ysrc</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">xdest</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">ydest</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">height</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
	  <listitem><simpara>a graphics context</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">image</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkimage"><classname>gtk.gdk.Image</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">xsrc</parameter>&nbsp;:</term>
	  <listitem><simpara>the left edge of the source rectangle within
<parameter>image</parameter>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">ysrc</parameter>&nbsp;:</term>
	  <listitem><simpara>the top edge of the source rectangle within
<parameter>image</parameter>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">xdest</parameter>&nbsp;:</term>
	  <listitem><simpara>the left edge of the destination within
drawable.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">ydest</parameter>&nbsp;:</term>
	  <listitem><simpara>the top edge of the destination within
drawable.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">width</parameter>&nbsp;:</term>
	  <listitem><simpara>the width of the area to be copied, or -1 to
make the area extend to the right edge of
<parameter>image</parameter>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">height</parameter>&nbsp;:</term>
	  <listitem><simpara>the height of the area to be copied, or -1 to
make the area extend to the bottom edge of
<parameter>image</parameter>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>draw_image</methodname>() method draws the
portion of the <link
linkend="class-gdkimage"><classname>gtk.gdk.Image</classname></link>
specified by the rectangle (<parameter>xsrc</parameter>,
<parameter>ysrc</parameter>, <parameter>width</parameter> and
<parameter>height</parameter>) onto the drawable at the location specified
by <parameter>xdest</parameter> and <parameter>ydest</parameter>. The depth
of the <link
linkend="class-gdkimage"><classname>gtk.gdk.Image</classname></link> must
match the depth of the <link
linkend="class-gdkdrawable"><classname>gtk.gdk.Drawable</classname></link>.
The <link linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link>
graphics context specified by <parameter>gc</parameter> is used to determine
the drawing attributes.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--draw-points">
      <title>gtk.gdk.Drawable.draw_points</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>draw_points</methodname>
	  <methodparam><parameter
			 role="keyword">gc</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">points</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
	  <listitem><simpara>a graphics context</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">points</parameter>&nbsp;:</term>
	  <listitem><simpara>a sequence of 2-tuples</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>draw_points</methodname>() method draws the set
of points specified by <parameter>points</parameter> on the drawable using
the <link linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link>
graphics context specified by <parameter>gc</parameter>.
<parameter>points</parameter> is a sequence of 2-tuples each containing a
pair of x and y coordinates of a point location in the drawable.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--draw-segments">
      <title>gtk.gdk.Drawable.draw_segments</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>draw_segments</methodname>
	  <methodparam><parameter
			 role="keyword">gc</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">segs</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
	  <listitem><simpara>a graphics context</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">segs</parameter>&nbsp;:</term>
	  <listitem><simpara>a sequence of 4-tuples</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>draw_segments</methodname>() method draws a set
of line segments specified by <parameter>segs</parameter> on the drawable
using the <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link> graphics
context specified by <parameter>gc</parameter> to specify the drawing
attributes. <parameter>segs</parameter> is a sequence of 4-tuples each
containing the coordinates of the start and end points of the line segment
in the format (x1, y1, x2, y2).</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--draw-lines">
      <title>gtk.gdk.Drawable.draw_lines</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>draw_lines</methodname>
	  <methodparam><parameter
			 role="keyword">gc</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">points</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
	  <listitem><simpara>a graphics context</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">points</parameter>&nbsp;:</term>
	  <listitem><simpara>a sequence of 2-tuples</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>draw_lines</methodname>() method draws a series
of lines connecting the points specified by <parameter>points</parameter>.
<parameter>points</parameter> is a sequence of 2-tuples each containing the
x and y coordinates of a point location. The <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link> graphics
context specified by <parameter>gc</parameter> is used to determine the
drawing attributes.The style of joins between lines is determined by the cap
style attribute in the <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link>. This can be
set with the <link
linkend="method-gdkgc--set-line-attributes"><methodname>gtk.gdk.GC.set_line_attributes</methodname>()</link> 
method.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--draw-pixbuf">
      <title>gtk.gdk.Drawable.draw_pixbuf</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>draw_pixbuf</methodname>
	  <methodparam><parameter role="keyword">gc</parameter></methodparam>
	  <methodparam><parameter role="keyword">pixbuf</parameter></methodparam>
	  <methodparam><parameter role="keyword">src_x</parameter></methodparam>
	  <methodparam><parameter role="keyword">src_y</parameter></methodparam>
	  <methodparam><parameter role="keyword">dest_x</parameter></methodparam>
	  <methodparam><parameter role="keyword">dest_y</parameter></methodparam>
	  <methodparam><parameter role="keyword">width</parameter><initializer>-1</initializer></methodparam>
	  <methodparam><parameter role="keyword">height</parameter><initializer>-1</initializer></methodparam>
	  <methodparam><parameter role="keyword">dither</parameter><initializer>gtk.gdk.RGB_DITHER_NORMAL</initializer></methodparam>
	  <methodparam><parameter role="keyword">x_dither</parameter><initializer>0</initializer></methodparam>
	  <methodparam><parameter role="keyword">y_dither</parameter><initializer>0</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
	  linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link>,
	  used for clipping, or <literal>None</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">pixbuf</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
	  linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">src_x</parameter>&nbsp;:</term>
	  <listitem><simpara>Source X coordinate within
	  pixbuf.</simpara></listitem> </varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">src_y</parameter>&nbsp;:</term>
	  <listitem><simpara>Source Y coordinate within
	  pixbuf.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dest_x</parameter>&nbsp;:</term>
	  <listitem><simpara>Destination X coordinate within
	  drawable.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dest_y</parameter>&nbsp;:</term>
	  <listitem><simpara>Destination Y coordinate within
	  drawable.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">width</parameter>&nbsp;:</term>
	  <listitem><simpara>Width of region to render, in pixels, or -1 to
	  use pixbuf width. Must be specified in PyGTK
	  2.2.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">height</parameter>&nbsp;:</term>
	  <listitem><simpara>Height of region to render, in pixels, or -1 to
	  use pixbuf height. Must be specified in PyGTK
	  2.2</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dither</parameter>&nbsp;:</term>
	  <listitem><simpara>Dithering mode for
	  <literal>GdkRGB</literal>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">x_dither</parameter>&nbsp;:</term>
	  <listitem><simpara>X offset for dither.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y_dither</parameter>&nbsp;:</term>
	  <listitem><simpara>Y offset for dither.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.2 and above.</para>
      </note>

      <para>The <methodname>draw_pixbuf</methodname>() method renders a
rectangular portion of a <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>
specified by <parameter>pixbuf</parameter> to the drawable using the <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link> specified by
<parameter>gc</parameter>. The portion of <parameter>pixbuf</parameter> that
is rendered is specified by the origin point (<parameter>src_x</parameter>
<parameter>src_y</parameter>) and the <parameter>width</parameter> and
<parameter>height</parameter> arguments. <parameter>pixbuf</parameter> is
rendered to the location in the drawable specified by
(<parameter>dest_x</parameter>
<parameter>dest_y</parameter>). <parameter>dither</parameter> specifies the
dithering mode as one of:</para>

      <variablelist>
	<varlistentry>
	  <term><literal>gtk.gdk.RGB_DITHER_NONE</literal></term>
	  <listitem>
	    <simpara>Never use dithering.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.RGB_DITHER_NORMAL</literal></term>
	  <listitem>
	    <simpara>Use dithering in 8 bits per pixel (and below)
	    only.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.RGB_DITHER_MAX</literal></term>
	  <listitem>
	    <simpara>Use dithering in 16 bits per pixel and below.</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para>The destination drawable must have a colormap. All windows have a
colormap, however, pixmaps only have colormap by default if they were
created with a non-<literal>None</literal> window argument. Otherwise a
colormap must be set on them with the <link
linkend="method-gdkdrawable--set-colormap"><methodname>gtk.gdk.Drawable.set_colormap()</methodname></link>
method.</para>

      <para>On older X servers, rendering pixbufs with an alpha channel
involves round trips to the X server, and may be somewhat slow. The clip
mask of <parameter>gc</parameter> is ignored, but clip rectangles and clip
regions work fine.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--draw-glyphs">
      <title>gtk.gdk.Drawable.draw_glyphs</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>draw_glyphs</methodname>
	  <methodparam><parameter
			 role="keyword">gc</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">font</parameter></methodparam>
	  <methodparam><parameter role="keyword">x</parameter></methodparam>
	  <methodparam><parameter role="keyword">y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">glyphs</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">font</parameter>&nbsp;:</term>
	  <listitem><simpara>the font to be used</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate of baseline
origin</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate of baseline
origin</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">glyphs</parameter>&nbsp;:</term>
	  <listitem><simpara>the glyphs to render</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>draw_glyphs</methodname>() method draws the
sequence of glyphs (characters in  a font) specified by
<parameter>glyphs</parameter> at the location specified by
<parameter>x</parameter> and <parameter>y</parameter> using the font
specified by <parameter>font</parameter>. Instead of using this method 99%
of text rendering should be done using the <link
linkend="method-gdkdrawable--draw-layout"><methodname>draw_layout</methodname>()</link> 
method.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--draw-layout-line">
      <title>gtk.gdk.Drawable.draw_layout_line</title>

      <programlisting><methodsynopsis language="python">
        <methodname>draw_layout_line</methodname>
        <methodparam><parameter role="keyword">gc</parameter></methodparam>
        <methodparam><parameter role="keyword">x</parameter></methodparam>
        <methodparam><parameter role="keyword">y</parameter></methodparam>
        <methodparam><parameter role="keyword">line</parameter></methodparam>
        <methodparam><parameter role="keyword">foreground</parameter>
        <initializer>None</initializer></methodparam>
        <methodparam><parameter role="keyword">background</parameter>
        <initializer>None</initializer></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
          <listitem><simpara>base graphics to use</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">x</parameter>&nbsp;:</term>
          <listitem><simpara>the x position of start of string (in pixels)</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">y</parameter>&nbsp;:</term>
          <listitem><simpara>the y position of baseline (in pixels)</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">line</parameter>&nbsp;:</term>
          <listitem><simpara>a <link linkend="class-pangolayoutline"><classname>pango.LayoutLine</classname></link></simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter
                    role="keyword">foreground</parameter>&nbsp;:</term>
          <listitem><simpara>a <link
          linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link>
          to override the foreground color or
          <literal>None</literal></simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter
                    role="keyword">background</parameter>&nbsp;:</term>
          <listitem><simpara>a <link
          linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link>
          to override the background color or
          <literal>None</literal></simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <parameter>draw_layout_line</parameter>() method renders the
      <link
      linkend="class-pangolayoutline"><classname>pango.LayoutLine</classname></link>
      specified by <parameter>line</parameter> onto the drawable at the
      position specified by (<parameter>x</parameter>,
      <parameter>y</parameter>). The <link
      linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link>
      specified by <parameter>gc</parameter> is used as the graphics context
      but the layout's normal colors may be overriden with the <link
      linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link>s
      specified by <parameter>foreground</parameter> and/or
      <parameter>background</parameter>. <parameter>foreground</parameter>
      and <parameter>background</parameter> are optional and default to
      <literal>None</literal>.</para>

      <para>If the layout's <link
      linkend="class-pangocontext"><classname>pango.Context</classname></link>
      has a transformation matrix set, then <parameter>x</parameter> and
      <parameter>y</parameter> specify the position of the left edge of the
      baseline (left is in before-tranform user coordinates) in
      after-transform device coordinates.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--draw-layout">
      <title>gtk.gdk.Drawable.draw_layout</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>draw_layout</methodname>
	  <methodparam><parameter
			 role="keyword">gc</parameter></methodparam>
	  <methodparam><parameter role="keyword">x</parameter></methodparam>
	  <methodparam><parameter role="keyword">y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">layout</parameter></methodparam>
	  <methodparam><parameter role="keyword">foreground</parameter>
	    <initializer>None</initializer></methodparam>
	  <methodparam><parameter role="keyword">background</parameter>
	    <initializer>None</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
	  <listitem><simpara>base graphics context to
use</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X position of the left of the layout (in
pixels)</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y position of the top of the layout (in
pixels)</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">layout</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-pangolayout"><classname>pango.Layout</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">foreground</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link> to
override the foreground color or
<literal>None</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">background</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link> to
override the background color or
<literal>None</literal></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>draw_layout</methodname>() method renders the
<link linkend="class-pangolayout"><classname>pango.Layout</classname></link>
specified by <parameter>layout</parameter> onto the drawable at the location
specified by <parameter>x</parameter> and <parameter>y</parameter>. If
<parameter>foreground</parameter> or <parameter>background</parameter> has a
value other than <literal>None</literal> it is used to override the
corresponding attribute specified by <parameter>gc</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--get-image">
      <title>gtk.gdk.Drawable.get_image</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_image</methodname>
	  <methodparam><parameter role="keyword">x</parameter></methodparam>
	  <methodparam><parameter role="keyword">y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">height</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate on the
drawable</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate on the
drawable</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">width</parameter>&nbsp;:</term>
	  <listitem><simpara>the width of region to get</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">height</parameter>&nbsp;:</term>
	  <listitem><simpara>the height or region to
get</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkimage"><classname>gtk.gdk.Image</classname></link>
containing the contents of the drawable</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_image</methodname>() method returns a <link
linkend="class-gdkimage"><classname>gtk.gdk.Image</classname></link> 
object containing a copy of the region in the drawable specified by
<parameter>x</parameter>, <parameter>y</parameter>,
<parameter>width</parameter> and <parameter>height</parameter>. A <link
linkend="class-gdkimage"><classname>gtk.gdk.Image</classname></link> stores
client-side image data (pixels). In contrast, a <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link> and
<link linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link>
are server-side objects. The <methodname>get_image</methodname>() method
retrieves the pixels from a server-side drawable as a client-side <link
linkend="class-gdkimage"><classname>gtk.gdk.Image</classname></link>. The
format of a <link
linkend="class-gdkimage"><classname>gtk.gdk.Image</classname></link> depends
on the <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link> of
the current display, which makes manipulating <link
linkend="class-gdkimage"><classname>gtk.gdk.Image</classname></link>
extremely difficult; therefore, in most cases you should use the <link
linkend="method-gdkpixbuf--get-from-drawable"><methodname>gtk.gdk.Pixbuf.get_from_drawable</methodname>()</link> 
method instead of this lower-level function. A <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></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>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. 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. If the source drawable is
a <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> and
partially off screen or obscured, then the obscured portions of the returned
image will contain undefined data.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--get-clip-region">
      <title>gtk.gdk.Drawable.get_clip_region</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_clip_region</methodname>
      <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a <link
          linkend="class-gdkregion"><classname>gtk.gdk.Region</classname></link>.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>
      
      <para>The <methodname>get_clip_region</methodname>() method computes
      and returns the <link
      linkend="class-gdkregion"><classname>gtk.gdk.Region</classname></link>
      of the drawable that potentially can be written to by drawing
      primitives. This region will not take into account the clip region for
      the <link
      linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link>, 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>

    </refsect2>


    <refsect2 id="method-gdkdrawable--get-visible-region">
      <title>gtk.gdk.Drawable.get_visible_region</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_visible_region</methodname>
      <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a <link linkend="class-gdkregion"><classname>gtk.gdk.Region</classname></link>. This must be freed with <function>gdk_region_destroy()</function>
          when you are done.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>
      
      <para>The <methodname>get_visible_region</methodname>() method
      computes and returns the <link
      linkend="class-gdkregion"><classname>gtk.gdk.Region</classname></link>
      of the 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>

    </refsect2>

    <refsect2 id="method-gdkdrawable--new-gc">
      <title>gtk.gdk.Drawable.new_gc</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>new_gc</methodname>
	  <methodparam><parameter
			 role="keyword">foreground</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">background</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">font</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">function</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">fill</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">tile</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">stipple</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">clip_mask</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">subwindow_mode</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">ts_x_origin</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">ts_y_origin</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">clip_x_origin</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">clip_y_origin</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">graphics_exposures</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">line_width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">line_style</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">cap_style</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">join_style</parameter>></methodparam> 
</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">foreground</parameter>&nbsp;:</term>
	  <listitem><simpara>the foreground <link
linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">background</parameter>&nbsp;:</term>
	  <listitem><simpara>the background <link
linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">font</parameter>&nbsp;:</term>
	  <listitem><simpara>a font (deprecated and
ignored)</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">function</parameter>&nbsp;:</term>
	  <listitem><simpara>the bitwise operator used to combine the
existing pixel value and a new pixel value - usually one of:
<literal>gtk.gdk.COPY</literal>, <literal>gtk.gdk.XOR</literal> or
<literal>gtk.gdk.INVERT</literal>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">fill</parameter>&nbsp;:</term>
	  <listitem><simpara>the fill style - one of:
<literal>gtk.gdk.SOLID</literal>, <literal>gtk.gdk.TILED</literal>,
<literal>gtk.gdk.STIPPLED</literal>,
<literal>gtk.gdk.OPAQUE_STIPPLED</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">tile</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link> used
for tiling the background</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">stipple</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link> used
for stippling the background</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">clip_mask</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link> of
depth 1 used to mask pixels to be drawn</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">subwindow_mode</parameter>&nbsp;:</term>
	  <listitem><simpara>the mode of drawing on subwindows in a
<link linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> - one of: <literal>gtk.gdk.CLIP_BY_CHILDREN</literal> or
<literal>gtk.gdk.INCLUDE_INFERIORS</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">ts_x_origin</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate of the origin of
<parameter>tile</parameter> or
<parameter>stipple</parameter></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">ts_y_origin</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate of the origin of
<parameter>tile</parameter> or
<parameter>stipple</parameter></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">clip_x_origin</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate of the origin of
<parameter>clip_mask</parameter></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">clip_y_origin</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate of the origin of
<parameter>clip_mask</parameter></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">graphics_exposures</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> graphics exposures
are enabled for calls to the <link
linkend="method-gdkdrawable--draw-drawable"><methodname>draw_drawable</methodname>()</link> 
method.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">line_width</parameter>&nbsp;:</term>
	  <listitem><simpara>the line width in pixels</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">line_style</parameter>&nbsp;:</term>
	  <listitem><simpara>the line style - one of:
<literal>gtk.gdk.LINE_SOLID</literal>,
<literal>gtk.gdk.LINE_ON_OFF_DASH</literal>,
<literal>gtk.gdk.LINE_DOUBLE_DASH</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">cap_style</parameter>&nbsp;:</term>
	  <listitem><simpara>the style of line ends - one of:
<literal>gtk.gdk.CAP_NOT_LAST</literal>,
<literal>gtk.gdk.CAP_BUTT</literal>, <literal>gtk.gdk.CAP_ROUND</literal>,
<literal>gtk.gdk.CAP_PROJECTING</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">join_style</parameter>&nbsp;:</term>
	  <listitem><simpara>the style of line joins - one of:
<literal>gtk.gdk.JOIN_MITER</literal>,
<literal>gtk.gdk.JOIN_ROUND</literal>,
<literal>gtk.gdk.JOIN_BEVEL</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a graphics context</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>new_gc</methodname>() method creates a new <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link> object with
the attributes as specified by the arguments. Since there are a large number
of parameters it's probably best to specify the attributes using keywords.
Any attributes not specified will use a default value.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--draw-rgb-image">
      <title>gtk.gdk.Drawable.draw_rgb_image</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>draw_rgb_image_dithalign</methodname>
	  <methodparam><parameter
			 role="keyword">gc</parameter></methodparam>
	  <methodparam><parameter role="keyword">x</parameter></methodparam>
	  <methodparam><parameter role="keyword">y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">height</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dith</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">rgb_buf</parameter></methodparam>
	  <methodparam><parameter role="keyword">rowstride</parameter>
	    <initializer>-1</initializer></methodparam>
	  <methodparam><parameter role="keyword">xdith</parameter>
	    <initializer>0</initializer></methodparam>
	  <methodparam><parameter role="keyword">ydith</parameter>
	    <initializer>0</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
	  <listitem><simpara>a graphics context</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate of the top-left corner in the
drawable.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate of the top-left corner in the
drawable.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">width</parameter>&nbsp;:</term>
	  <listitem><simpara>the width of the image to be
drawn.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">height</parameter>&nbsp;:</term>
	  <listitem><simpara>the height of the image to be
drawn.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dith</parameter>&nbsp;:</term>
	  <listitem><simpara>a dither value - one of:
<literal>gtk.gdk.RGB_DITHER_NONE</literal>,
<literal>gtk.gdk.RGB_DITHER_NORMAL</literal>,
<literal>gtk.gdk.RGB_DITHER_MAX</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">rgb_buf</parameter>&nbsp;:</term>
	  <listitem><simpara>the pixel data, represented as packed 24-bit
data.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">rowstride</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of bytes from the start of one row
in <parameter>rgb_buf</parameter> to the start of the next or -1 to
calculate the number of bytes.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">xdith</parameter>&nbsp;:</term>
	  <listitem><simpara>an X offset for dither
alignment.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">ydith</parameter>&nbsp;:</term>
	  <listitem><simpara>a Y offset for dither
alignment.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>draw_rgb_image</methodname>() method draws an
RGB image in the drawable, with an adjustment for dither alignment. This
method is useful when drawing dithered images into a window that may be
scrolled. Pixel (x, y) will be drawn dithered as if its actual location is
(x + xdith, y + ydith). Thus, if you draw an image into a window using zero
dither alignment, then scroll up one pixel, subsequent draws to the window
should have ydith = 1. Setting the dither alignment correctly allows
updating of small parts of the screen while avoiding visible "seams" between
the different dither textures.</para>

    </refsect2>

    <refsect2 id="method-gdkdrawable--draw-rgb-32-image">
      <title>gtk.gdk.Drawable.draw_rgb_32_image</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>draw_rgb_32_image</methodname>
	  <methodparam><parameter
			 role="keyword">gc</parameter></methodparam>
	  <methodparam><parameter role="keyword">x</parameter></methodparam>
	  <methodparam><parameter role="keyword">y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">height</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dith</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">rgb_buf</parameter></methodparam>
	  <methodparam><parameter role="keyword">rowstride</parameter>
	    <initializer>-1</initializer></methodparam>
	  <methodparam><parameter role="keyword">xdith</parameter>
	    <initializer>0</initializer></methodparam>
	  <methodparam><parameter role="keyword">ydith</parameter>
	    <initializer>0</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
	  <listitem><simpara>a graphics context</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate of the top-left corner in the
drawable.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate of the top-left corner in the
drawable.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">width</parameter>&nbsp;:</term>
	  <listitem><simpara>the width of the image to be
drawn.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">height</parameter>&nbsp;:</term>
	  <listitem><simpara>the height of the image to be
drawn.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dith</parameter>&nbsp;:</term>
	  <listitem><simpara>a dither value - one of:
<literal>gtk.gdk.RGB_DITHER_NONE</literal>,
<literal>gtk.gdk.RGB_DITHER_NORMAL</literal>,
<literal>gtk.gdk.RGB_DITHER_MAX</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">buf</parameter>&nbsp;:</term>
	  <listitem><simpara>the pixel data, represented as padded 32-bit
data.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">rowstride</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of bytes from the start of one row
in <parameter>buf</parameter> to the start of the next or -1 to calculate
the number of bytes.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">xdith</parameter>&nbsp;:</term>
	  <listitem><simpara>an X offset for dither
alignment.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">ydith</parameter>&nbsp;:</term>
	  <listitem><simpara>a Y offset for dither
alignment.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>draw_rgb_32_image</methodname>() method draws a
padded RGB image in the drawable. The image is stored as one pixel per
32-bit word. It is laid out as a red byte, a green byte, a blue byte, and a
padding byte. Otherwise this method works the same as the <link
linkend="method-gdkdrawable--draw-rgb-image"><methodname>draw_rgb_image</methodname>()</link> 
method.</para>

    </refsect2>

  <refsect2 id="method-gdkdrawable--draw-gray-image">
      <title>gtk.gdk.Drawable.draw_gray_image</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>draw_gray_image</methodname>
	  <methodparam><parameter
			 role="keyword">gc</parameter></methodparam>
	  <methodparam><parameter role="keyword">x</parameter></methodparam>
	  <methodparam><parameter role="keyword">y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">height</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dith</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">buf</parameter></methodparam>
	  <methodparam><parameter role="keyword">rowstride</parameter>
	    <initializer>-1</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
	  <listitem><simpara>a graphics context</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate of the top-left corner in the
drawable.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate of the top-left corner in the
drawable.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">width</parameter>&nbsp;:</term>
	  <listitem><simpara>the width of the image to be
drawn.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">height</parameter>&nbsp;:</term>
	  <listitem><simpara>the height of the image to be
drawn.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dith</parameter>&nbsp;:</term>
	  <listitem><simpara>a dither value - one of:
<literal>gtk.gdk.RGB_DITHER_NONE</literal>,
<literal>gtk.gdk.RGB_DITHER_NORMAL</literal>,
<literal>gtk.gdk.RGB_DITHER_MAX</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">buf</parameter>&nbsp;:</term>
	  <listitem><simpara>the pixel data, represented as 8-bit gray
values.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">rowstride</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of bytes from the start of one row
in <parameter>buf</parameter> to the start of the next or -1 to calculate
the number of bytes.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>draw_gray_image</methodname>() method draws a
grayscale image on the drawable at the location specified by
<parameter>x</parameter> and <parameter>y</parameter> with the image data in
<parameter>buf</parameter>.</para>

    </refsect2>

  <refsect2 id="method-gdkdrawable--draw-indexed-image">
    <title>gtk.gdk.Drawable.draw_indexed_image</title>

    <programlisting><methodsynopsis language="python">
      <methodname>draw_indexed_image</methodname>
      <methodparam><parameter role="keyword">gc</parameter></methodparam>
      <methodparam><parameter role="keyword">x</parameter></methodparam>
      <methodparam><parameter role="keyword">y</parameter></methodparam>
      <methodparam><parameter role="keyword">width</parameter></methodparam>
      <methodparam><parameter role="keyword">height</parameter></methodparam>
      <methodparam><parameter role="keyword">dith</parameter></methodparam>
      <methodparam><parameter role="keyword">buf</parameter></methodparam>
      <methodparam><parameter role="keyword">rowstride</parameter></methodparam>
      <methodparam><parameter role="keyword">colors</parameter></methodparam>
    </methodsynopsis></programlisting>
    <variablelist>
      <varlistentry>
        <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
        <listitem><simpara>a graphics context</simpara></listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter role="keyword">x</parameter>&nbsp;:</term>
        <listitem><simpara>The x coordinate of the top-left corner in the
        drawable.</simpara></listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter role="keyword">y</parameter>&nbsp;:</term>
        <listitem><simpara>the y coordinate of the top-left corner in the
        drawable.</simpara></listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter role="keyword">width</parameter>&nbsp;:</term>
        <listitem><simpara>the width of the rectangle to be
        drawn.</simpara></listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter role="keyword">height</parameter>&nbsp;:</term>
        <listitem><simpara>the height of the rectangle to be
        drawn.</simpara></listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter role="keyword">dith</parameter>&nbsp;:</term>
        <listitem><simpara>a GdkRgbDither value, selecting the desired
        dither mode.</simpara></listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter role="keyword">buf</parameter>&nbsp;:</term>
        <listitem><simpara>the pixel data, represented as 8-bit color
        indices.</simpara></listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter role="keyword">rowstride</parameter>&nbsp;:</term>
        <listitem><simpara>the number of bytes from the start of one row in
        <parameter>buf</parameter> to the start of the
        next.</simpara></listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter role="keyword">colors</parameter>&nbsp;:</term>
        <listitem><simpara>a list of colors represented as 0xRRGGBB integer
        values.</simpara></listitem>
      </varlistentry>
    </variablelist>

    <note>
      <para>This method is available in PyGTK 2.10 and above.</para>
    </note>

    <para>The <methodname>draw_indexed_image</methodname>() method draws an
    indexed image in the drawable, using the list of colors specified
    by <parameter>colors</parameter> to assign actual colors to the image's
    color indices.</para>

  </refsect2>

  <refsect2 id="method-gdkdrawable--cairo-create">
    <title>gtk.gdk.Drawable.cairo_create</title>

    <programlisting><methodsynopsis language="python">
      <methodname>cairo_create</methodname>
      <methodparam></methodparam>
    </methodsynopsis></programlisting>
    <variablelist>
      <varlistentry>
        <term><emphasis>Returns</emphasis>&nbsp;:</term>
        <listitem><simpara>a <link
        linkend="class-gdkcairocontext"><classname>gtk.gdk.CairoContext</classname></link></simpara></listitem>
      </varlistentry>
    </variablelist>

    <note>
      <para>This method is available in PyGTK 2.8 and above.</para>
    </note>

    <para>The <methodname>cairo_create</methodname>() method returns a
    <link
        linkend="class-gdkcairocontext"><classname>gtk.gdk.CairoContext</classname></link>
    object to be used for drawing on the drawable using Cairo drawing
    operations.</para>

  </refsect2>

  </refsect1>

</refentry>
