Files
gimp/devel-docs/libgimpwidgets/html/libgimpwidgets-GimpWidgetsUtils.html
2018-04-19 11:58:35 -04:00

358 lines
19 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GimpWidgetsUtils: GIMP Widgets Library Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="GIMP Widgets Library Reference Manual">
<link rel="up" href="libgimpwidgets-utils.html" title="Part VI. GIMP Widgets Utilities">
<link rel="prev" href="libgimpwidgets-GimpWidgets.html" title="GimpWidgets">
<link rel="next" href="libgimpwidgets-deprecated.html" title="Part VII. Deprecated API">
<meta name="generator" content="GTK-Doc V1.28 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
<a href="#libgimpwidgets-GimpWidgetsUtils.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="libgimpwidgets-utils.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="libgimpwidgets-GimpWidgets.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="libgimpwidgets-deprecated.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libgimpwidgets-GimpWidgetsUtils"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libgimpwidgets-GimpWidgetsUtils.top_of_page"></a>GimpWidgetsUtils</span></h2>
<p>GimpWidgetsUtils — A collection of helper functions.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libgimpwidgets-GimpWidgetsUtils.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a href="../gtk2/GtkWidget.html#GtkWidget-struct"><span class="returnvalue">GtkWidget</span></a> *
</td>
<td class="function_name">
<a class="link" href="libgimpwidgets-GimpWidgetsUtils.html#gimp-table-attach-aligned" title="gimp_table_attach_aligned ()">gimp_table_attach_aligned</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libgimpwidgets-GimpWidgetsUtils.html#gimp-label-set-attributes" title="gimp_label_set_attributes ()">gimp_label_set_attributes</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="libgimpwidgets-GimpWidgetsUtils.html#gimp-widget-get-monitor" title="gimp_widget_get_monitor ()">gimp_widget_get_monitor</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="libgimpwidgets-GimpWidgetsUtils.html#gimp-get-monitor-at-pointer" title="gimp_get_monitor_at_pointer ()">gimp_get_monitor_at_pointer</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libgimpwidgets-GimpWidgetsUtils.html#gimp-widget-track-monitor" title="gimp_widget_track_monitor ()">gimp_widget_track_monitor</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GimpColorProfile</span> *
</td>
<td class="function_name">
<a class="link" href="libgimpwidgets-GimpWidgetsUtils.html#gimp-screen-get-color-profile" title="gimp_screen_get_color_profile ()">gimp_screen_get_color_profile</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GimpColorProfile</span> *
</td>
<td class="function_name">
<a class="link" href="libgimpwidgets-GimpWidgetsUtils.html#gimp-widget-get-color-profile" title="gimp_widget_get_color_profile ()">gimp_widget_get_color_profile</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GimpColorTransform</span> *
</td>
<td class="function_name">
<a class="link" href="libgimpwidgets-GimpWidgetsUtils.html#gimp-widget-get-color-transform" title="gimp_widget_get_color_transform ()">gimp_widget_get_color_transform</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libgimpwidgets-GimpWidgetsUtils.description"></a><h2>Description</h2>
<p>A collection of helper functions.</p>
</div>
<div class="refsect1">
<a name="libgimpwidgets-GimpWidgetsUtils.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gimp-table-attach-aligned"></a><h3>gimp_table_attach_aligned ()</h3>
<pre class="programlisting"><a href="../gtk2/GtkWidget.html#GtkWidget-struct"><span class="returnvalue">GtkWidget</span></a> *
gimp_table_attach_aligned (<em class="parameter"><code><a href="../gtk2/GtkTable.html#GtkTable-struct"><span class="type">GtkTable</span></a> *table</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> column</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> row</code></em>,
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label_text</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a> xalign</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a> yalign</code></em>,
<em class="parameter"><code><a href="../gtk2/GtkWidget.html#GtkWidget-struct"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> colspan</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> left_align</code></em>);</pre>
<p>Note that the <em class="parameter"><code>label_text</code></em>
can be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> and that the widget will be
attached starting at (<em class="parameter"><code>column</code></em>
+ 1) in this case, too.</p>
<div class="refsect3">
<a name="gimp-table-attach-aligned.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>table</p></td>
<td class="parameter_description"><p>The <a href="../gtk2/GtkTable.html#GtkTable-struct"><span class="type">GtkTable</span></a> the widgets will be attached to.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>column</p></td>
<td class="parameter_description"><p>The column to start with.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>row</p></td>
<td class="parameter_description"><p>The row to attach the widgets.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>label_text</p></td>
<td class="parameter_description"><p>The text for the <a href="../gtk2/GtkLabel.html#GtkLabel-struct"><span class="type">GtkLabel</span></a> which will be attached left of
the widget.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>xalign</p></td>
<td class="parameter_description"><p>The horizontal alignment of the <a href="../gtk2/GtkLabel.html#GtkLabel-struct"><span class="type">GtkLabel</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>yalign</p></td>
<td class="parameter_description"><p>The vertical alignment of the <a href="../gtk2/GtkLabel.html#GtkLabel-struct"><span class="type">GtkLabel</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>The <a href="../gtk2/GtkWidget.html#GtkWidget-struct"><span class="type">GtkWidget</span></a> to attach right of the label.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>colspan</p></td>
<td class="parameter_description"><p>The number of columns the widget will use.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>left_align</p></td>
<td class="parameter_description"><p><a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the widget should be left-aligned.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gimp-table-attach-aligned.returns"></a><h4>Returns</h4>
<p> The created <a href="../gtk2/GtkLabel.html#GtkLabel-struct"><span class="type">GtkLabel</span></a>.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-label-set-attributes"></a><h3>gimp_label_set_attributes ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gimp_label_set_attributes (<em class="parameter"><code><a href="../gtk2/GtkLabel.html#GtkLabel-struct"><span class="type">GtkLabel</span></a> *label</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>Sets Pango attributes on a <a href="../gtk2/GtkLabel.html#GtkLabel-struct"><span class="type">GtkLabel</span></a> in a more convenient way than
<a href="../gtk2/GtkLabel.html#gtk-label-set-attributes"><code class="function">gtk_label_set_attributes()</code></a>.</p>
<p>This function is useful if you want to change the font attributes
of a <a href="../gtk2/GtkLabel.html#GtkLabel-struct"><span class="type">GtkLabel</span></a>. This is an alternative to using PangoMarkup which
is slow to parse and awkward to handle in an i18n-friendly way.</p>
<p>The attributes are set on the complete label, from start to end. If
you need to set attributes on part of the label, you will have to
use the PangoAttributes API directly.</p>
<div class="refsect3">
<a name="gimp-label-set-attributes.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>label</p></td>
<td class="parameter_description"><p>a <a href="../gtk2/GtkLabel.html#GtkLabel-struct"><span class="type">GtkLabel</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p>a list of PangoAttrType and value pairs terminated by -1.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gimp-widget-get-monitor"></a><h3>gimp_widget_get_monitor ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
gimp_widget_get_monitor (<em class="parameter"><code><a href="../gtk2/GtkWidget.html#GtkWidget-struct"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="gimp-get-monitor-at-pointer"></a><h3>gimp_get_monitor_at_pointer ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
gimp_get_monitor_at_pointer (<em class="parameter"><code><a href="../gdk2/GdkScreen.html#GdkScreen-struct"><span class="type">GdkScreen</span></a> **screen</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="gimp-widget-track-monitor"></a><h3>gimp_widget_track_monitor ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gimp_widget_track_monitor (<em class="parameter"><code><a href="../gtk2/GtkWidget.html#GtkWidget-struct"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code><a href="../gobject/gobject-Closures.html#GCallback"><span class="type">GCallback</span></a> monitor_changed_callback</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>This function behaves as if <a href="../gtk2/GtkWidget.html#GtkWidget-struct"><span class="type">GtkWidget</span></a> had a signal</p>
<p>GtkWidget::monitor_changed(GtkWidget *widget, gpointer user_data)</p>
<p>That is emitted whenever <em class="parameter"><code>widget</code></em>
's toplevel window is moved from
one monitor to another. This function automatically connects to
the right toplevel <a href="../gtk2/GtkWindow.html#GtkWindow-struct"><span class="type">GtkWindow</span></a>, even across moving <em class="parameter"><code>widget</code></em>
between
toplevel windows.</p>
<p>Note that this function tracks the toplevel, not <em class="parameter"><code>widget</code></em>
itself, so
all a window's widgets are always considered to be on the same
monitor. This is because this function is mainly used for fetching
the new monitor's color profile, and it makes little sense to use
different profiles for the widgets of one window.</p>
<div class="refsect3">
<a name="gimp-widget-track-monitor.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a href="../gtk2/GtkWidget.html#GtkWidget-struct"><span class="type">GtkWidget</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>monitor_changed_callback</p></td>
<td class="parameter_description"><p>the callback when <em class="parameter"><code>widget</code></em>
's monitor changes</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>data passed to <em class="parameter"><code>monitor_changed_callback</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-2-10.html#api-index-2.10">2.10</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gimp-screen-get-color-profile"></a><h3>gimp_screen_get_color_profile ()</h3>
<pre class="programlisting"><span class="returnvalue">GimpColorProfile</span> *
gimp_screen_get_color_profile (<em class="parameter"><code><a href="../gdk2/GdkScreen.html#GdkScreen-struct"><span class="type">GdkScreen</span></a> *screen</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> monitor</code></em>);</pre>
<p>This function returns the <span class="type">GimpColorProfile</span> of monitor number <em class="parameter"><code>monitor</code></em>
of <em class="parameter"><code>screen</code></em>
, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if there is no profile configured.</p>
<div class="refsect3">
<a name="gimp-screen-get-color-profile.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>screen</p></td>
<td class="parameter_description"><p>a <a href="../gdk2/GdkScreen.html#GdkScreen-struct"><span class="type">GdkScreen</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>monitor</p></td>
<td class="parameter_description"><p>the monitor number</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gimp-screen-get-color-profile.returns"></a><h4>Returns</h4>
<p> the monitor's <span class="type">GimpColorProfile</span>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-10.html#api-index-2.10">2.10</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gimp-widget-get-color-profile"></a><h3>gimp_widget_get_color_profile ()</h3>
<pre class="programlisting"><span class="returnvalue">GimpColorProfile</span> *
gimp_widget_get_color_profile (<em class="parameter"><code><a href="../gtk2/GtkWidget.html#GtkWidget-struct"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="gimp-widget-get-color-transform"></a><h3>gimp_widget_get_color_transform ()</h3>
<pre class="programlisting"><span class="returnvalue">GimpColorTransform</span> *
gimp_widget_get_color_transform (<em class="parameter"><code><a href="../gtk2/GtkWidget.html#GtkWidget-struct"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code><span class="type">GimpColorConfig</span> *config</code></em>,
<em class="parameter"><code><span class="type">GimpColorProfile</span> *src_profile</code></em>,
<em class="parameter"><code>const <span class="type">Babl</span> *src_format</code></em>,
<em class="parameter"><code>const <span class="type">Babl</span> *dest_format</code></em>);</pre>
</div>
</div>
<div class="refsect1">
<a name="libgimpwidgets-GimpWidgetsUtils.other_details"></a><h2>Types and Values</h2>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.28</div>
</body>
</html>