1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>gnomeprint.Context</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Python Gnomeprint Reference Manual"><link rel="up" href="gnomeprint-class-reference.html" title="The Gnomeprint Class Reference"><link rel="prev" href="gnomeprint-class-reference.html" title="The Gnomeprint Class Reference"><link rel="next" href="class-gnomeprintconfig.html" title="gnomeprint.Config"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gnomeprint.Context</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="gnomeprint-class-reference.html">Prev</a> </td><th width="60%" align="center">The Gnomeprint Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gnomeprintconfig.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gnomeprint.Context"><a name="class-gnomeprintcontext"></a><div class="titlepage"></div><div class="refnamediv"><h2>gnomeprint.Context</h2><p>gnomeprint.Context — Main object of GnomePrint</p></div><div class="refsect1" title="Synopsis"><a name="id2584785"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gnomeprint.Context</span></span>(<span class="ooclass"><span class="classname">gobject.GObject</span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#constructor-gnomeprintcontext" title="Constructor">gnomeprint.Context</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>config</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--newpath" title="gnomeprint.Context.newpath">newpath</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--moveto" title="gnomeprint.Context.moveto">moveto</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--lineto" title="gnomeprint.Context.lineto">lineto</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--curveto" title="gnomeprint.Context.curveto">curveto</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x1</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y1</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x2</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y2</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x3</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y3</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--closepath" title="gnomeprint.Context.closepath">closepath</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--strokepath" title="gnomeprint.Context.strokepath">strokepath</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--bpath" title="gnomeprint.Context.bpath">bpath</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>bpath</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>append</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--vpath" title="gnomeprint.Context.vpath">vpath</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>vpath</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>append</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--arcto" title="gnomeprint.Context.arcto">arcto</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>radius</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>angle1</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>angle2</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>direction</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--setrgbcolor" title="gnomeprint.Context.setrgbcolor">setrgbcolor</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>r</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>g</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>b</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--setopacity" title="gnomeprint.Context.setopacity">setopacity</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>opacity</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--setlinewidth" title="gnomeprint.Context.setlinewidth">setlinewidth</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--setmiterlimit" title="gnomeprint.Context.setmiterlimit">setmiterlimit</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>limit</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--setlinejoin" title="gnomeprint.Context.setlinejoin">setlinejoin</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>join_type</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--setlinecap" title="gnomeprint.Context.setlinecap">setlinecap</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>cap_type</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--setdash" title="gnomeprint.Context.setdash">setdash</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>n_values</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>values</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--setfont" title="gnomeprint.Context.setfont">setfont</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>font</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--clip" title="gnomeprint.Context.clip">clip</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--eoclip" title="gnomeprint.Context.eoclip">eoclip</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--concat" title="gnomeprint.Context.concat">concat</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>matrix</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--scale" title="gnomeprint.Context.scale">scale</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>sx</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>sy</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--rotate" title="gnomeprint.Context.rotate">rotate</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>theta</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--translate" title="gnomeprint.Context.translate">translate</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--gsave" title="gnomeprint.Context.gsave">gsave</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--grestore" title="gnomeprint.Context.grestore">grestore</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--fill" title="gnomeprint.Context.fill">fill</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--eofill" title="gnomeprint.Context.eofill">eofill</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--stroke" title="gnomeprint.Context.stroke">stroke</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--show" title="gnomeprint.Context.show">show</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>text</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--show_sized" title="gnomeprint.Context.show_sized">show_sized</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>text</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>bytes</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--glyphlist" title="gnomeprint.Context.glyphlist">glyphlist</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>glyphlist</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--grayimage" title="gnomeprint.Context.grayimage">grayimage</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>data</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>height</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>rowstride</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--rgbimage" title="gnomeprint.Context.rgbimage">rgbimage</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>data</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>height</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>rowstride</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--rgbaimage" title="gnomeprint.Context.rgbaimage">rgbaimage</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>data</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>height</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>rowstride</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--beginpage" title="gnomeprint.Context.beginpage">beginpage</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--showpage" title="gnomeprint.Context.showpage">showpage</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--line_stroked" title="gnomeprint.Context.line_stroked">line_stroked</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x0</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y0</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x1</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y1</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--rect_stroked" title="gnomeprint.Context.rect_stroked">rect_stroked</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>height</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--rect_filled" title="gnomeprint.Context.rect_filled">rect_filled</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>height</code></strong></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id2576495"></a><h2>Ancestry</h2><pre class="synopsis">+-- gobject.GObject
+-- <a class="link" href="class-gnomeprintcontext.html" title="gnomeprint.Context">gnomeprint.Context</a>
</pre></div><div class="refsect1" title="Description"><a name="description-gnomeprintcontext"></a><h2>Description</h2><p>
</p></div><div class="refsect1" title="Constructor"><a name="constructor-gnomeprintcontext"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gnomeprint.Context</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>config</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>config</code></strong> :</span></p></td><td> a <a class="link" href="class-gnomeprintconfig.html" title="gnomeprint.Config"><code class="classname">gnomeprint.Config</code></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="class-gnomeprintcontext.html" title="gnomeprint.Context"><code class="classname">gnomeprint.Context</code></a>.
</td></tr></tbody></table><p>
Creates a new <a class="link" href="class-gnomeprintcontext.html" title="gnomeprint.Context"><code class="classname">gnomeprint.Context</code></a> object.
</p></div><div class="refsect1" title="Methods"><a name="id2576663"></a><h2>Methods</h2><div class="refsect2" title="gnomeprint.Context.newpath"><a name="method-gnomeprintcontext--newpath"></a><h3>gnomeprint.Context.newpath</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">newpath</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>config</code></strong> :</span></p></td><td> a <a class="link" href="class-gnomeprintconfig.html" title="gnomeprint.Config"><code class="classname">gnomeprint.Config</code></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">newpath</code>() method resets currentpath to empty path. As currentpoint is defined as the last point of open path segment, is
also erases currentpoint.
</p></div><div class="refsect2" title="gnomeprint.Context.moveto"><a name="method-gnomeprintcontext--moveto"></a><h3>gnomeprint.Context.moveto</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">moveto</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>x</code></strong> :</span></p></td><td> X position in user coordinates.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y</code></strong> :</span></p></td><td> Y position in user coordinates.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">moveto</code>() method starts new subpath in currentpath with coordinates x,y. Moves currentpoint to x,y.
</p></div><div class="refsect2" title="gnomeprint.Context.lineto"><a name="method-gnomeprintcontext--lineto"></a><h3>gnomeprint.Context.lineto</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">lineto</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>x</code></strong> :</span></p></td><td> X position in user coordinates.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y</code></strong> :</span></p></td><td> Y position in user coordinates.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">moveto</code>() method adds new straight line segment from currentpoint to x,y to currentpath. Moves currentpoint to x,y. If
currentpoint is not defined, returns GNOME_PRINT_ERROR_NOCURRENTPOINT.
</p></div><div class="refsect2" title="gnomeprint.Context.curveto"><a name="method-gnomeprintcontext--curveto"></a><h3>gnomeprint.Context.curveto</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">curveto</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x1</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y1</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x2</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y2</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x3</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y3</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>x1</code></strong> :</span></p></td><td> X position of first control point in user coordinates.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y1</code></strong> :</span></p></td><td> Y position of first control point in user coordinates.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>x2</code></strong> :</span></p></td><td> X position of second control point in user coordinates.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y2</code></strong> :</span></p></td><td> Y position of second control point in user coordinates.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>x3</code></strong> :</span></p></td><td> X position of third control point in user coordinates.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y3</code></strong> :</span></p></td><td> Y position of third control point in user coordinates.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">curveto</code>() method adds new cubig bezier segment with control points x1,y1 and x2,y2 and endpoint x3,y3 to currentpath. Moves
currentpoint to x3,y3. If currentpoint is not defined, returns GNOME_PRINT_ERROR_NOCURRENTPOINT.
</p></div><div class="refsect2" title="gnomeprint.Context.closepath"><a name="method-gnomeprintcontext--closepath"></a><h3>gnomeprint.Context.closepath</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">closepath</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">closepath</code>() method closes the last segment of currentpath, optionally drawing straight line segment from its endpoint to
starting point. Erases currentpoint. If currentpath is empty, returns GNOME_PRINT_ERROR_NOCURRENTPATH.
</p></div><div class="refsect2" title="gnomeprint.Context.strokepath"><a name="method-gnomeprintcontext--strokepath"></a><h3>gnomeprint.Context.strokepath</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">strokepath</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">strokepath</code>() method converts currentpath to new path, that is identical to area painted by gnome_print_stroke function, using
currentpath. I.e. strokepath followed by fill giver result identical to stroke. If currentpath is empty, returns GNOME_PRINT_ERROR_NOCURRENTPATH.
Stroked path is always closed, so currentpoint is erased.
</p></div><div class="refsect2" title="gnomeprint.Context.bpath"><a name="method-gnomeprintcontext--bpath"></a><h3>gnomeprint.Context.bpath</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">bpath</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>bpath</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>append</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>bpath</code></strong> :</span></p></td><td> a list of ArtBpath segments</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>append</code></strong> :</span></p></td><td> whether to append to currentpath</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">bpath</code>() method adds all bpath segments up to ART_END to currentpath. If append is false, currentpath is cleared first,
otherwise segments are appended to existing path. This is identical to adding all segments by hand, so the final state of currentpoint depends on
segments processed.
</p></div><div class="refsect2" title="gnomeprint.Context.vpath"><a name="method-gnomeprintcontext--vpath"></a><h3>gnomeprint.Context.vpath</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">vpath</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>vpath</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>append</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>vpath</code></strong> :</span></p></td><td> a list of ArtVpath segments</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>append</code></strong> :</span></p></td><td> whether to append to currentpath</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">vpath</code>() method adds all vpath line segments up to ART_END to currentpath. If append is false, currentpath is cleared first,
otherwise segments are appended to existing path. This is identical to adding all segments by hand, so the final state of currentpoint depends on
segments processed.
</p></div><div class="refsect2" title="gnomeprint.Context.arcto"><a name="method-gnomeprintcontext--arcto"></a><h3>gnomeprint.Context.arcto</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">arcto</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>radius</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>angle1</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>angle2</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>direction</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>x</code></strong> :</span></p></td><td> X position of control point in user coordinates.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y</code></strong> :</span></p></td><td> Y position of control point in user coordinates.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>radius</code></strong> :</span></p></td><td> the radius of the arc.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>angle1</code></strong> :</span></p></td><td> start angle in degrees.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>angle2</code></strong> :</span></p></td><td> end angle in degrees.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>direction</code></strong> :</span></p></td><td> direction of movement, 0 counterclockwise 1 clockwise.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">arcto</code>() method adds an arc with control points x and y with a radius radius and from angle1 to andgle2 in degrees.
direction 1 is clockwise 0 counterclockwise
</p></div><div class="refsect2" title="gnomeprint.Context.setrgbcolor"><a name="method-gnomeprintcontext--setrgbcolor"></a><h3>gnomeprint.Context.setrgbcolor</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">setrgbcolor</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>r</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>g</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>b</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>r</code></strong> :</span></p></td><td> Red channel value.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>g</code></strong> :</span></p></td><td> Green channel value.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>b</code></strong> :</span></p></td><td> Blue channel value.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">setrgbcolor</code>() method sets color in graphic state to RGB triplet. This does not imply anything about which colorspace is
used internally. Channel values are clamped to 0.0 - 1.0 region, 0.0 meaning minimum.
</p></div><div class="refsect2" title="gnomeprint.Context.setopacity"><a name="method-gnomeprintcontext--setopacity"></a><h3>gnomeprint.Context.setopacity</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">setopacity</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>opacity</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>opacity</code></strong> :</span></p></td><td> opacity value.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">setopacity</code>() method sets painting opacity in graphic state to given value. Value is clamped to 0.0 - 1.0 region, 0.0
meaning full transparency and 1.0 completely opaque paint.
</p></div><div class="refsect2" title="gnomeprint.Context.setlinewidth"><a name="method-gnomeprintcontext--setlinewidth"></a><h3>gnomeprint.Context.setlinewidth</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">setlinewidth</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>width</code></strong> :</span></p></td><td> line width in user coordinates.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">setlinewidth</code>() method sets line width in graphic state to given value. Value is given in user coordinates, so effective
line width depends on CTM at the moment of <a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--stroke" title="gnomeprint.Context.stroke">stroke</a> or
<a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--strokepath" title="gnomeprint.Context.strokepath">strokepath</a>. Line width is always uniform in all directions, regardless of stretch factor of
CTM. Default line width is 1.0 in user coordinates.
</p></div><div class="refsect2" title="gnomeprint.Context.setmiterlimit"><a name="method-gnomeprintcontext--setmiterlimit"></a><h3>gnomeprint.Context.setmiterlimit</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">setmiterlimit</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>limit</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>limit</code></strong> :</span></p></td><td> miter limit in degrees.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">setmiterlimit</code>() method sets minimum angle between two lines, in which case miter join is used. For smaller angles, join is
beveled. Default miter limit is 4 degrees.
</p></div><div class="refsect2" title="gnomeprint.Context.setlinejoin"><a name="method-gnomeprintcontext--setlinejoin"></a><h3>gnomeprint.Context.setlinejoin</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">setlinejoin</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>join_type</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>join_type</code></strong> :</span></p></td><td> integer indicating join type.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">setlinejoin</code>() method sets join type for non-colinear line segments. 0 - miter 1 - round 2 - bevel Default join type is
miter.
</p></div><div class="refsect2" title="gnomeprint.Context.setlinecap"><a name="method-gnomeprintcontext--setlinecap"></a><h3>gnomeprint.Context.setlinecap</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">setlinecap</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>cap_type</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>cap_type</code></strong> :</span></p></td><td> integer indicating cap type.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">setlinecap</code>() method sets cap type for line endpoints. 0 - butt 1 - round 2 - square Default cap type is butt.
</p></div><div class="refsect2" title="gnomeprint.Context.setdash"><a name="method-gnomeprintcontext--setdash"></a><h3>gnomeprint.Context.setdash</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">setdash</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>n_values</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>values</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>n_values</code></strong> :</span></p></td><td> number of dash segment lengths.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>values</code></strong> :</span></p></td><td> nrray of dash segment lengths.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>offset</code></strong> :</span></p></td><td> line starting offset in dash.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">setdash</code>() method sets line dashing to given pattern. If n_dash is odd, the result is, as if actual number of segments is 2
times bigger, and 2 copies of dash arrays concatenated. If n_values is 0, line is set solid. Dash segment lengths are given in user coordinates, so the
actual dash lengths depend on CTM at the time of <a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--stroke" title="gnomeprint.Context.stroke">stroke</a> or
<a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--strokepath" title="gnomeprint.Context.strokepath">strokepath</a>. Dashing is always uniform in all directions, regardless of the stretching factor
of CTM. Default is solid line.
</p></div><div class="refsect2" title="gnomeprint.Context.setfont"><a name="method-gnomeprintcontext--setfont"></a><h3>gnomeprint.Context.setfont</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">setfont</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>font</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>font</code></strong> :</span></p></td><td> GnomeFont to use for text.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">setfont</code>() method sets font in graphic state. Font is referenced by gnome print, so caller may discard it immediately
afterwards. Default font is system dependent.
</p></div><div class="refsect2" title="gnomeprint.Context.clip"><a name="method-gnomeprintcontext--clip"></a><h3>gnomeprint.Context.clip</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">clip</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">clip</code>() method defines drawing region as inside area of currentpath. If path is self-intersecting or consists of several
overlapping subpaths, nonzero rule is used to define the inside orea of path. All open subpaths of currentpath are closed. If currentpath is empty,
GNOME_PRINT_ERROR_NOCURRENTPATH is returned. Currentpath is emptied by this function.
</p></div><div class="refsect2" title="gnomeprint.Context.eoclip"><a name="method-gnomeprintcontext--eoclip"></a><h3>gnomeprint.Context.eoclip</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">eoclip</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">erclip</code>() method defines drawing region as inside area of currentpath. If path is self-intersecting or consists of several
overlapping subpaths, even-odd rule is used to define the inside area of path. All open subpaths of currentpath are closed. If currentpath is empty,
GNOME_PRINT_ERROR_NOCURRENTPATH is returned. Currentpath is emptied by this function.
</p></div><div class="refsect2" title="gnomeprint.Context.concat"><a name="method-gnomeprintcontext--concat"></a><h3>gnomeprint.Context.concat</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">concat</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>matrix</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>matrix</code></strong> :</span></p></td><td> 3x2 affine transformation matrix.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">concat</code>() method appends matrix to current transformation matrix (CTM). The resulting transformation from user coordinates
to page coordinates is, as if coordinates would first be transformed by matrix, and the results by CTM. Matrix is given in column order, i.e. X' = X *
m[0] + Y * m[2] + m[4] Y' = X * m[1] + Y * m[3] + m[5]
</p></div><div class="refsect2" title="gnomeprint.Context.scale"><a name="method-gnomeprintcontext--scale"></a><h3>gnomeprint.Context.scale</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">scale</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>sx</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>sy</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>sx</code></strong> :</span></p></td><td> X scale.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>sy</code></strong> :</span></p></td><td> Y scale.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">scale</code>() method scales user coordinate system by given X and Y values.
</p></div><div class="refsect2" title="gnomeprint.Context.rotate"><a name="method-gnomeprintcontext--rotate"></a><h3>gnomeprint.Context.rotate</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">rotate</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>theta</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>theta</code></strong> :</span></p></td><td> angle in degrees.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">scale</code>() method rotates user coordinate system theta degrees counterclockwise.
</p></div><div class="refsect2" title="gnomeprint.Context.translate"><a name="method-gnomeprintcontext--translate"></a><h3>gnomeprint.Context.translate</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">translate</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>x</code></strong> :</span></p></td><td> new starting X.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y</code></strong> :</span></p></td><td> new starting Y.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">translate</code>() method move the starting point of user coordinate system to given point.
</p></div><div class="refsect2" title="gnomeprint.Context.gsave"><a name="method-gnomeprintcontext--gsave"></a><h3>gnomeprint.Context.gsave</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gsave</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">gsave</code>() method saves current graphic state (transformation, color, line properties, font) into stack (push). Values itself
remain unchanged. You can later restore saved values, using <a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--grestore" title="gnomeprint.Context.grestore">grestore</a>, but not over page
boundaries. Graphic state stack has to be cleared for each <a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--showpage" title="gnomeprint.Context.showpage">showpage</a>, i.e. the number of
<a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--gsave" title="gnomeprint.Context.gsave">gsave</a> has to match the number of
<a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--grestore" title="gnomeprint.Context.grestore">grestore</a> for each page.
</p></div><div class="refsect2" title="gnomeprint.Context.grestore"><a name="method-gnomeprintcontext--grestore"></a><h3>gnomeprint.Context.grestore</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">grestore</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">grestore</code>() method retrieves last saved graphic state from stack (pop). Stack has to be at least the size of one.
</p></div><div class="refsect2" title="gnomeprint.Context.fill"><a name="method-gnomeprintcontext--fill"></a><h3>gnomeprint.Context.fill</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">fill</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">fill</code>() method fills the inside area of currentpath, using current graphic state. If path is self-intersecting or consists
of several overlapping subpaths, nonzero rule is used to define the inside area of path. All open subpaths of currentpath are closed. If currentpath is
empty, GNOME_PRINT_ERROR_NOCURRENTPATH is returned. Currentpath is emptied by this function.
</p></div><div class="refsect2" title="gnomeprint.Context.eofill"><a name="method-gnomeprintcontext--eofill"></a><h3>gnomeprint.Context.eofill</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">eofill</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">eofill</code>() method fills the inside area of currentpath, using current graphic state. If path is self-intersecting or
consists of several overlapping subpaths, even-odd rule is used to define the inside area of path. All open subpaths of currentpath are closed. If
currentpath is empty, GNOME_PRINT_ERROR_NOCURRENTPATH is returned. Currentpath is emptied by this function.
</p></div><div class="refsect2" title="gnomeprint.Context.stroke"><a name="method-gnomeprintcontext--stroke"></a><h3>gnomeprint.Context.stroke</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">stroke</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">stroke</code>() method strokes currentpath, i.e. draws line along it, with style, defined by current graphic state values. If
currentpath is empty, GNOME_PRINT_ERROR_NOCURRENTPATH is returned. Currentpath is emptied by this function.
</p></div><div class="refsect2" title="gnomeprint.Context.show"><a name="method-gnomeprintcontext--show"></a><h3>gnomeprint.Context.show</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">show</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>text</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>text</code></strong> :</span></p></td><td> Null-terminated UTF-8 string.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">show</code>() method draws UTF-8 text at currentpoint, using current font from graphic state. Input text is validated, and
GNOME_PRINT_ERROR_BADVALUE returned, if it is not valid UTF-8. Both currentpath and currentpoint are erased.
</p></div><div class="refsect2" title="gnomeprint.Context.show_sized"><a name="method-gnomeprintcontext--show_sized"></a><h3>gnomeprint.Context.show_sized</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">show_sized</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>text</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>bytes</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>text</code></strong> :</span></p></td><td> UTF-8 text string.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>bytes</code></strong> :</span></p></td><td> number of bytes to use from string.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">show_sized</code>() method draws UTF-8 text at currentpoint, using current font from graphic state. Input text is validated, and
GNOME_PRINT_ERROR_BADVALUE returned, if it is not valid UTF-8. Both currentpath and currentpoint are erased.
</p></div><div class="refsect2" title="gnomeprint.Context.glyphlist"><a name="method-gnomeprintcontext--glyphlist"></a><h3>gnomeprint.Context.glyphlist</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">glyphlist</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>text</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>glyphlist</code></strong> :</span></p></td><td> GnomeGlyphList text object.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">glyphlist</code>() method draws text, using GnomeGlyphList rich text format. Glyphlist is rendered in user coordinates, starting
from currentpoint. Both currentpath and currentpoint are erased.
</p></div><div class="refsect2" title="gnomeprint.Context.grayimage"><a name="method-gnomeprintcontext--grayimage"></a><h3>gnomeprint.Context.grayimage</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">grayimage</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>data</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>height</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>rowstride</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>data</code></strong> :</span></p></td><td> pointer to image pixel buffer.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>width</code></strong> :</span></p></td><td> image buffer width.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>height</code></strong> :</span></p></td><td> image buffer height.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>rowstride</code></strong> :</span></p></td><td> image buffer rowstride.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">grayimage</code>() method draws grayscale image into unit square (0,0 - 1,1) in current coordinate system. Image buffer has to be
1 byte per pixel, with value 255 marking white and 0 black.
</p></div><div class="refsect2" title="gnomeprint.Context.rgbimage"><a name="method-gnomeprintcontext--rgbimage"></a><h3>gnomeprint.Context.rgbimage</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">rgbimage</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>data</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>height</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>rowstride</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>data</code></strong> :</span></p></td><td> pointer to image pixel buffer.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>width</code></strong> :</span></p></td><td> image buffer width.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>height</code></strong> :</span></p></td><td> image buffer height.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>rowstride</code></strong> :</span></p></td><td> image buffer rowstride.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">rgbimage</code>() method draws RGB color image into unit square (0,0 - 1,1) in current coordinate system. Image buffer has to be
3 bytes per pixel, order RGB, with value 255 marking maximum and 0 minimum value.
</p></div><div class="refsect2" title="gnomeprint.Context.rgbaimage"><a name="method-gnomeprintcontext--rgbaimage"></a><h3>gnomeprint.Context.rgbaimage</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">rgbaimage</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>data</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>height</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>rowstride</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>data</code></strong> :</span></p></td><td> pointer to image pixel buffer.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>width</code></strong> :</span></p></td><td> image buffer width.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>height</code></strong> :</span></p></td><td> image buffer height.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>rowstride</code></strong> :</span></p></td><td> image buffer rowstride.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">rgbaimage</code>() method draws RGB color image with transparency channel image into unit square (0,0 - 1,1) in current
coordinate system. Image buffer has to be 4 bytes per pixel, order RGBA, with value 255 marking maximum and 0 minimum value. Alpha value 255 means full
opacity, 0 full transparency.
</p></div><div class="refsect2" title="gnomeprint.Context.beginpage"><a name="method-gnomeprintcontext--beginpage"></a><h3>gnomeprint.Context.beginpage</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">beginpage</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>name</code></strong> :</span></p></td><td> name of the page, NULL if you just want to use the page number of the page.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">glyphlist</code>() method starts new output page with name. Naming is used for interactive contexts like GnomePrintPreview and
Document Structuring Convention conformant PostScript output. This function has to be called before any drawing methods and immediately after each
<a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--showpage" title="gnomeprint.Context.showpage">showpage</a> albeit the last one. It also resets graphic state values (transformation, color,
line properties, font), so one has to define these again at the beginning of each page.
</p></div><div class="refsect2" title="gnomeprint.Context.showpage"><a name="method-gnomeprintcontext--showpage"></a><h3>gnomeprint.Context.showpage</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">showpage</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">showpage</code>() method finishes rendering of current page, and marks it as shown. All subsequent drawing methods will fail,
until new page is started with newpage. Printing contexts may process drawing methods
differently - some do rendering immediately (like GnomePrintPreview), some accumulate all operators to internal stack, and only after
<a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--showpage" title="gnomeprint.Context.showpage">showpage</a> is any output produced.
</p></div><div class="refsect2" title="gnomeprint.Context.line_stroked"><a name="method-gnomeprintcontext--line_stroked"></a><h3>gnomeprint.Context.line_stroked</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">line_stroked</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x0</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y0</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x1</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y1</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>x0</code></strong> :</span></p></td><td> X position of start point in user coordinates.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y0</code></strong> :</span></p></td><td> Y position of start point in user coordinates.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>x1</code></strong> :</span></p></td><td> X position of end point in user coordinates.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y1</code></strong> :</span></p></td><td> Y position of end point in user coordinates.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">line_stroked</code>() method is a convenience function to draw a line. Uses
<a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--stroke" title="gnomeprint.Context.stroke">stroke</a> to do the actual work.
</p></div><div class="refsect2" title="gnomeprint.Context.rect_stroked"><a name="method-gnomeprintcontext--rect_stroked"></a><h3>gnomeprint.Context.rect_stroked</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">rect_stroked</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>height</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>x</code></strong> :</span></p></td><td> X position of origin of rectangle in user coordinates.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y</code></strong> :</span></p></td><td> Y position of origin of rectangle in user coordinates.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>width</code></strong> :</span></p></td><td> width of the rectangle.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>height</code></strong> :</span></p></td><td> height of the rectangle.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">rect_stroked</code>() method is a convenience function to draw a rectangle. Uses
<a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--stroke" title="gnomeprint.Context.stroke">stroke</a> to do the actual work.
</p></div><div class="refsect2" title="gnomeprint.Context.rect_filled"><a name="method-gnomeprintcontext--rect_filled"></a><h3>gnomeprint.Context.rect_filled</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">rect_filled</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>height</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>x</code></strong> :</span></p></td><td> X position of origin of rectangle in user coordinates.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y</code></strong> :</span></p></td><td> Y position of origin of rectangle in user coordinates.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>width</code></strong> :</span></p></td><td> width of the rectangle.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>height</code></strong> :</span></p></td><td> height of the rectangle.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> GNOME_PRINT_OK or positive value on success, negative error code on failure.</td></tr></tbody></table><p>
The <code class="methodname">rect_filled</code>() method is a convenience function to draw a filled rectangle. Uses
<a class="link" href="class-gnomeprintcontext.html#method-gnomeprintcontext--stroke" title="gnomeprint.Context.stroke">stroke</a> to do the actual work.
</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="gnomeprint-class-reference.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gnomeprint-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-gnomeprintconfig.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The Gnomeprint Class Reference </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gnomeprint.Config</td></tr></table></div></body></html>
|