Files
gimp/devel-docs/libgimpwidgets/html/GimpRatioEntry.html
2010-08-11 01:21:39 -04:00

443 lines
19 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>GimpRatioEntry</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
<link rel="start" href="index.html" title="GIMP Widgets Library Reference Manual">
<link rel="up" href="libgimpwidgets-widgets.html" title="Part&#160;I.&#160;GIMP Widgets">
<link rel="prev" href="GimpPreview.html" title="GimpPreview">
<link rel="next" href="GimpScrolledPreview.html" title="GimpScrolledPreview">
<meta name="generator" content="GTK-Doc V1.8 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="part" href="libgimpwidgets-widgets.html" title="Part&#160;I.&#160;GIMP Widgets">
<link rel="chapter" href="libgimpwidgets-hierarchy.html" title="Object Hierarchy">
<link rel="chapter" href="libgimpwidgets-gallery.html" title="Widget Gallery">
<link rel="chapter" href="libgimpwidgets-cell-renderers.html" title="Cell Renderers for GtkTreeView">
<link rel="part" href="libgimpwidgets-colordisplay.html" title="Part&#160;II.&#160;GIMP Display Filters">
<link rel="part" href="libgimpwidgets-colorselector.html" title="Part&#160;III.&#160;GIMP Color Selectors">
<link rel="part" href="libgimpwidgets-controller.html" title="Part&#160;IV.&#160;GIMP Controllers">
<link rel="part" href="libgimpwidgets-utils.html" title="Part&#160;V.&#160;GIMP Widgets Utilities">
<link rel="part" href="libgimpwidgets-deprecated.html" title="Part&#160;VI.&#160;Deprecated API">
<link rel="index" href="libgimpwidgets-index.html" title="Index">
<link rel="index" href="libgimpwidgets-index-new-in-2-2.html" title="Index of new symbols in GIMP 2.2">
<link rel="index" href="libgimpwidgets-index-new-in-2-4.html" title="Index of new symbols in GIMP 2.4">
<link rel="index" href="libgimpwidgets-index-deprecated.html" title="Index of deprecated symbols">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="GimpPreview.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="libgimpwidgets-widgets.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GIMP Widgets Library Reference Manual</th>
<td><a accesskey="n" href="GimpScrolledPreview.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2587987" class="shortcut">Top</a>
&#160;|&#160;
<a href="#id2626953" class="shortcut">Description</a>
&#160;|&#160;
<a href="#id2623943" class="shortcut">Object Hierarchy</a>
&#160;|&#160;
<a href="#id2623992" class="shortcut">Implemented Interfaces</a>
&#160;|&#160;
<a href="#id2624025" class="shortcut">Properties</a>
&#160;|&#160;
<a href="#id2624089" class="shortcut">Signals</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="GimpRatioEntry"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2587987"></a><span class="refentrytitle">GimpRatioEntry</span>
</h2>
<p>GimpRatioEntry</p>
</td>
<td valign="top" align="right"><img src="gimp-ratio-entry.png"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
<a href="GimpRatioEntry.html#GimpRatioEntry-struct">GimpRatioEntry</a>;
enum <a href="GimpRatioEntry.html#GimpAspectType">GimpAspectType</a>;
GtkWidget* <a href="GimpRatioEntry.html#gimp-ratio-entry-new">gimp_ratio_entry_new</a> (void);
void <a href="GimpRatioEntry.html#gimp-ratio-entry-set-fraction">gimp_ratio_entry_set_fraction</a> (<a href="GimpRatioEntry.html" title="GimpRatioEntry">GimpRatioEntry</a> *entry,
gdouble numerator,
gdouble denominator);
void <a href="GimpRatioEntry.html#gimp-ratio-entry-get-fraction">gimp_ratio_entry_get_fraction</a> (<a href="GimpRatioEntry.html" title="GimpRatioEntry">GimpRatioEntry</a> *entry,
gdouble *numerator,
gdouble *denominator);
void <a href="GimpRatioEntry.html#gimp-ratio-entry-set-ratio">gimp_ratio_entry_set_ratio</a> (<a href="GimpRatioEntry.html" title="GimpRatioEntry">GimpRatioEntry</a> *entry,
gdouble ratio);
gdouble <a href="GimpRatioEntry.html#gimp-ratio-entry-get-ratio">gimp_ratio_entry_get_ratio</a> (<a href="GimpRatioEntry.html" title="GimpRatioEntry">GimpRatioEntry</a> *entry);
void <a href="GimpRatioEntry.html#gimp-ratio-entry-set-aspect">gimp_ratio_entry_set_aspect</a> (<a href="GimpRatioEntry.html" title="GimpRatioEntry">GimpRatioEntry</a> *entry,
<a href="GimpRatioEntry.html#GimpAspectType">GimpAspectType</a> aspect);
<a href="GimpRatioEntry.html#GimpAspectType">GimpAspectType</a> <a href="GimpRatioEntry.html#gimp-ratio-entry-get-aspect">gimp_ratio_entry_get_aspect</a> (<a href="GimpRatioEntry.html" title="GimpRatioEntry">GimpRatioEntry</a> *entry);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2623943"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
GObject
+----GInitiallyUnowned
+----GtkObject
+----GtkWidget
+----GtkEntry
+----GimpRatioEntry
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2623992"></a><h2>Implemented Interfaces</h2>
<p>
GimpRatioEntry implements
AtkImplementorIface, GtkEditable and GtkCellEditable.</p>
</div>
<div class="refsect1" lang="en">
<a name="id2624025"></a><h2>Properties</h2>
<pre class="synopsis">
"<a href="GimpRatioEntry.html#GimpRatioEntry--aspect">aspect</a>" <a href="GimpRatioEntry.html#GimpAspectType">GimpAspectType</a> : Read / Write
"<a href="GimpRatioEntry.html#GimpRatioEntry--denominator">denominator</a>" gdouble : Read / Write
"<a href="GimpRatioEntry.html#GimpRatioEntry--numerator">numerator</a>" gdouble : Read / Write
"<a href="GimpRatioEntry.html#GimpRatioEntry--ratio">ratio</a>" gdouble : Read / Write
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2624089"></a><h2>Signals</h2>
<pre class="synopsis">
"<a href="GimpRatioEntry.html#GimpRatioEntry-ratio-changed">ratio-changed</a>" : Run First
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2626953"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2626969"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2626980"></a><h3>
<a name="GimpRatioEntry-struct"></a>GimpRatioEntry</h3>
<a class="indexterm" name="id2626992"></a><pre class="programlisting">typedef struct _GimpRatioEntry GimpRatioEntry;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627008"></a><h3>
<a name="GimpAspectType"></a>enum GimpAspectType</h3>
<a class="indexterm" name="id2627020"></a><pre class="programlisting">typedef enum
{
GIMP_ASPECT_SQUARE, /*&lt; desc="Square" &gt;*/
GIMP_ASPECT_PORTRAIT, /*&lt; desc="Portrait" &gt;*/
GIMP_ASPECT_LANDSCAPE /*&lt; desc="Landscape" &gt;*/
} GimpAspectType;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627039"></a><h3>
<a name="gimp-ratio-entry-new"></a>gimp_ratio_entry_new ()</h3>
<a class="indexterm" name="id2627053"></a><pre class="programlisting">GtkWidget* gimp_ratio_entry_new (void);</pre>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a new <a href="GimpRatioEntry.html" title="GimpRatioEntry"><span class="type">GimpRatioEntry</span></a> widget
</td>
</tr></tbody>
</table></div>
<p class="since">Since GIMP 2.4
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627107"></a><h3>
<a name="gimp-ratio-entry-set-fraction"></a>gimp_ratio_entry_set_fraction ()</h3>
<a class="indexterm" name="id2627120"></a><pre class="programlisting">void gimp_ratio_entry_set_fraction (<a href="GimpRatioEntry.html" title="GimpRatioEntry">GimpRatioEntry</a> *entry,
gdouble numerator,
gdouble denominator);</pre>
<p>
Sets the fraction displayed by a <a href="GimpRatioEntry.html" title="GimpRatioEntry"><span class="type">GimpRatioEntry</span></a>. If the resulting
ratio is different to the previously set ratio, the "ratio-changed"
signal is emitted.
</p>
<p>
If the denominator is zero, the <a href="GimpRatioEntry.html" title="GimpRatioEntry"><span class="type">GimpRatioEntry</span></a> will silently
convert it to 1.0.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>entry</code></em>&#160;:</span></td>
<td> a <a href="GimpRatioEntry.html" title="GimpRatioEntry"><span class="type">GimpRatioEntry</span></a> widget
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>numerator</code></em>&#160;:</span></td>
<td> numerator of the fraction to set in the widget
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>denominator</code></em>&#160;:</span></td>
<td> denominator of the fraction to set in the widget
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since GIMP 2.4
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2626638"></a><h3>
<a name="gimp-ratio-entry-get-fraction"></a>gimp_ratio_entry_get_fraction ()</h3>
<a class="indexterm" name="id2626652"></a><pre class="programlisting">void gimp_ratio_entry_get_fraction (<a href="GimpRatioEntry.html" title="GimpRatioEntry">GimpRatioEntry</a> *entry,
gdouble *numerator,
gdouble *denominator);</pre>
<p>
Gets the fraction displayed by a <a href="GimpRatioEntry.html" title="GimpRatioEntry"><span class="type">GimpRatioEntry</span></a>.
</p>
<p>
The denominator may be zero if the <a href="GimpRatioEntry.html" title="GimpRatioEntry"><span class="type">GimpRatioEntry</span></a> shows just a single
value. You can use <a href="GimpRatioEntry.html#gimp-ratio-entry-get-ratio"><span class="type">gimp_ratio_entry_get_ratio</span></a> to retrieve the ratio
as a single decimal value.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>entry</code></em>&#160;:</span></td>
<td> a <a href="GimpRatioEntry.html" title="GimpRatioEntry"><span class="type">GimpRatioEntry</span></a> widget
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>numerator</code></em>&#160;:</span></td>
<td> pointer to store the numerator of the fraction
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>denominator</code></em>&#160;:</span></td>
<td> pointer to store the denominator of the fraction
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since GIMP 2.4
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2623578"></a><h3>
<a name="gimp-ratio-entry-set-ratio"></a>gimp_ratio_entry_set_ratio ()</h3>
<a class="indexterm" name="id2623591"></a><pre class="programlisting">void gimp_ratio_entry_set_ratio (<a href="GimpRatioEntry.html" title="GimpRatioEntry">GimpRatioEntry</a> *entry,
gdouble ratio);</pre>
<p>
Sets the ratio displayed by a <a href="GimpRatioEntry.html" title="GimpRatioEntry"><span class="type">GimpRatioEntry</span></a>. If the new ratio is
different than the previous ratio, the "ratio-changed" signal is
emitted.
</p>
<p>
An attempt is made to convert the decimal number into a fraction with
numerator and denominator &lt; 1000.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>entry</code></em>&#160;:</span></td>
<td> a <a href="GimpRatioEntry.html" title="GimpRatioEntry"><span class="type">GimpRatioEntry</span></a> widget
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>ratio</code></em>&#160;:</span></td>
<td> ratio to set in the widget
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since GIMP 2.4
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2623691"></a><h3>
<a name="gimp-ratio-entry-get-ratio"></a>gimp_ratio_entry_get_ratio ()</h3>
<a class="indexterm" name="id2623705"></a><pre class="programlisting">gdouble gimp_ratio_entry_get_ratio (<a href="GimpRatioEntry.html" title="GimpRatioEntry">GimpRatioEntry</a> *entry);</pre>
<p>
Retrieves the ratio value displayed by a <a href="GimpRatioEntry.html" title="GimpRatioEntry"><span class="type">GimpRatioEntry</span></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>entry</code></em>&#160;:</span></td>
<td> a <a href="GimpRatioEntry.html" title="GimpRatioEntry"><span class="type">GimpRatioEntry</span></a> widget
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> The ratio value.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since GIMP 2.4
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2623787"></a><h3>
<a name="gimp-ratio-entry-set-aspect"></a>gimp_ratio_entry_set_aspect ()</h3>
<a class="indexterm" name="id2623801"></a><pre class="programlisting">void gimp_ratio_entry_set_aspect (<a href="GimpRatioEntry.html" title="GimpRatioEntry">GimpRatioEntry</a> *entry,
<a href="GimpRatioEntry.html#GimpAspectType">GimpAspectType</a> aspect);</pre>
<p>
Sets the aspect of the ratio by swapping the numerator and denominator
(or setting them to 1.0 in case that <em class="parameter"><code>aspect</code></em> is <code class="literal">GIMP_ASPECT_SQUARE</code>).</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>entry</code></em>&#160;:</span></td>
<td> a <a href="GimpRatioEntry.html" title="GimpRatioEntry"><span class="type">GimpRatioEntry</span></a> widget
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>aspect</code></em>&#160;:</span></td>
<td> the new aspect
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since GIMP 2.4
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2618025"></a><h3>
<a name="gimp-ratio-entry-get-aspect"></a>gimp_ratio_entry_get_aspect ()</h3>
<a class="indexterm" name="id2618039"></a><pre class="programlisting"><a href="GimpRatioEntry.html#GimpAspectType">GimpAspectType</a> gimp_ratio_entry_get_aspect (<a href="GimpRatioEntry.html" title="GimpRatioEntry">GimpRatioEntry</a> *entry);</pre>
<p>
Gets the aspect of the ratio displayed by a <a href="GimpRatioEntry.html" title="GimpRatioEntry"><span class="type">GimpRatioEntry</span></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>entry</code></em>&#160;:</span></td>
<td> a <a href="GimpRatioEntry.html" title="GimpRatioEntry"><span class="type">GimpRatioEntry</span></a> widget
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> The entry's current aspect.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since GIMP 2.4
</p>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id2618123"></a><h2>Property Details</h2>
<div class="refsect2" lang="en">
<a name="id2618134"></a><h3>
<a name="GimpRatioEntry--aspect"></a>The "<code class="literal">aspect</code>" property</h3>
<a class="indexterm" name="id2618148"></a><pre class="programlisting"> "aspect" <a href="GimpRatioEntry.html#GimpAspectType">GimpAspectType</a> : Read / Write</pre>
<p></p>
<p>Default value: GIMP_ASPECT_SQUARE</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2618172"></a><h3>
<a name="GimpRatioEntry--denominator"></a>The "<code class="literal">denominator</code>" property</h3>
<a class="indexterm" name="id2618186"></a><pre class="programlisting"> "denominator" gdouble : Read / Write</pre>
<p></p>
<p>Allowed values: &gt;= G_MINDOUBLE</p>
<p>Default value: 1</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2618215"></a><h3>
<a name="GimpRatioEntry--numerator"></a>The "<code class="literal">numerator</code>" property</h3>
<a class="indexterm" name="id2618229"></a><pre class="programlisting"> "numerator" gdouble : Read / Write</pre>
<p></p>
<p>Allowed values: &gt;= G_MINDOUBLE</p>
<p>Default value: 1</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2618258"></a><h3>
<a name="GimpRatioEntry--ratio"></a>The "<code class="literal">ratio</code>" property</h3>
<a class="indexterm" name="id2618271"></a><pre class="programlisting"> "ratio" gdouble : Read / Write</pre>
<p></p>
<p>Allowed values: &gt;= G_MINDOUBLE</p>
<p>Default value: 1</p>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id2618302"></a><h2>Signal Details</h2>
<div class="refsect2" lang="en">
<a name="id2618312"></a><h3>
<a name="GimpRatioEntry-ratio-changed"></a>The "ratio-changed" signal</h3>
<a class="indexterm" name="id2618322"></a><pre class="programlisting">void user_function (<a href="GimpRatioEntry.html" title="GimpRatioEntry">GimpRatioEntry</a> *gimpratioentry,
gpointer user_data) : Run First</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>gimpratioentry</code></em>&#160;:</span></td>
<td>the object which received the signal.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</body>
</html>