<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<!--ENTITY index-Objects-Grouped SYSTEM "objects_grouped.sgml"-->
<refentry id="GtkColorSelection">
<refmeta>
<refentrytitle role="top_of_page" id="GtkColorSelection.top_of_page">GtkColorSelection</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GtkColorSelection</refname>
<refpurpose>A widget used to select a color</refpurpose>
</refnamediv>

<refsynopsisdiv id="GtkColorSelection.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

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

                    <link linkend="GtkColorSelection-struct">GtkColorSelection</link>;
<link linkend="GtkWidget">GtkWidget</link> *         <link linkend="gtk-color-selection-new">gtk_color_selection_new</link>             (void);
<link linkend="void">void</link>                <link linkend="gtk-color-selection-set-update-policy">gtk_color_selection_set_update_policy</link>
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         <link linkend="GtkUpdateType">GtkUpdateType</link> policy);
<link linkend="void">void</link>                <link linkend="gtk-color-selection-set-has-opacity-control">gtk_color_selection_set_has_opacity_control</link>
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         <link linkend="gboolean">gboolean</link> has_opacity);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-color-selection-get-has-opacity-control">gtk_color_selection_get_has_opacity_control</link>
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel);
<link linkend="void">void</link>                <link linkend="gtk-color-selection-set-has-palette">gtk_color_selection_set_has_palette</link> (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         <link linkend="gboolean">gboolean</link> has_palette);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-color-selection-get-has-palette">gtk_color_selection_get_has_palette</link> (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel);
<link linkend="guint16">guint16</link>             <link linkend="gtk-color-selection-get-current-alpha">gtk_color_selection_get_current_alpha</link>
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel);
<link linkend="void">void</link>                <link linkend="gtk-color-selection-set-current-alpha">gtk_color_selection_set_current_alpha</link>
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         <link linkend="guint16">guint16</link> alpha);
<link linkend="void">void</link>                <link linkend="gtk-color-selection-get-current-color">gtk_color_selection_get_current_color</link>
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         <link linkend="GdkColor">GdkColor</link> *color);
<link linkend="void">void</link>                <link linkend="gtk-color-selection-set-current-color">gtk_color_selection_set_current_color</link>
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         const <link linkend="GdkColor">GdkColor</link> *color);
<link linkend="guint16">guint16</link>             <link linkend="gtk-color-selection-get-previous-alpha">gtk_color_selection_get_previous_alpha</link>
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel);
<link linkend="void">void</link>                <link linkend="gtk-color-selection-set-previous-alpha">gtk_color_selection_set_previous_alpha</link>
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         <link linkend="guint16">guint16</link> alpha);
<link linkend="void">void</link>                <link linkend="gtk-color-selection-get-previous-color">gtk_color_selection_get_previous_color</link>
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         <link linkend="GdkColor">GdkColor</link> *color);
<link linkend="void">void</link>                <link linkend="gtk-color-selection-set-previous-color">gtk_color_selection_set_previous_color</link>
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         const <link linkend="GdkColor">GdkColor</link> *color);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-color-selection-is-adjusting">gtk_color_selection_is_adjusting</link>    (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-color-selection-palette-from-string">gtk_color_selection_palette_from_string</link>
                                                        (const <link linkend="gchar">gchar</link> *str,
                                                         <link linkend="GdkColor">GdkColor</link> **colors,
                                                         <link linkend="gint">gint</link> *n_colors);
<link linkend="gchar">gchar</link>*              <link linkend="gtk-color-selection-palette-to-string">gtk_color_selection_palette_to_string</link>
                                                        (const <link linkend="GdkColor">GdkColor</link> *colors,
                                                         <link linkend="gint">gint</link> n_colors);
<link linkend="GtkColorSelectionChangePaletteFunc">GtkColorSelectionChangePaletteFunc</link>  <link linkend="gtk-color-selection-set-change-palette-hook">gtk_color_selection_set_change_palette_hook</link>
                                                        (<link linkend="GtkColorSelectionChangePaletteFunc">GtkColorSelectionChangePaletteFunc</link> func);
<link linkend="void">void</link>                (<link linkend="GtkColorSelectionChangePaletteFunc">*GtkColorSelectionChangePaletteFunc</link>)
                                                        (const <link linkend="GdkColor">GdkColor</link> *colors,
                                                         <link linkend="gint">gint</link> n_colors);
<link linkend="GtkColorSelectionChangePaletteWithScreenFunc">GtkColorSelectionChangePaletteWithScreenFunc</link>  <link linkend="gtk-color-selection-set-change-palette-with-screen-hook">gtk_color_selection_set_change_palette_with_screen_hook</link>
                                                        (<link linkend="GtkColorSelectionChangePaletteWithScreenFunc">GtkColorSelectionChangePaletteWithScreenFunc</link> func);
<link linkend="void">void</link>                (<link linkend="GtkColorSelectionChangePaletteWithScreenFunc">*GtkColorSelectionChangePaletteWithScreenFunc</link>)
                                                        (<link linkend="GdkScreen">GdkScreen</link> *screen,
                                                         const <link linkend="GdkColor">GdkColor</link> *colors,
                                                         <link linkend="gint">gint</link> n_colors);
<link linkend="void">void</link>                <link linkend="gtk-color-selection-set-color">gtk_color_selection_set_color</link>       (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         <link linkend="gdouble">gdouble</link> *color);
<link linkend="void">void</link>                <link linkend="gtk-color-selection-get-color">gtk_color_selection_get_color</link>       (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         <link linkend="gdouble">gdouble</link> *color);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GtkColorSelection.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----<link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
         +----<link linkend="GtkObject">GtkObject</link>
               +----<link linkend="GtkWidget">GtkWidget</link>
                     +----<link linkend="GtkContainer">GtkContainer</link>
                           +----<link linkend="GtkBox">GtkBox</link>
                                 +----<link linkend="GtkVBox">GtkVBox</link>
                                       +----GtkColorSelection
</synopsis>
</refsect1>



<refsect1 id="GtkColorSelection.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkColorSelection implements
 <link linkend="AtkImplementorIface">AtkImplementorIface</link>,  <link linkend="GtkBuildable">GtkBuildable</link> and  <link linkend="GtkOrientable">GtkOrientable</link>.</para>
</refsect1>


<refsect1 id="GtkColorSelection.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GtkColorSelection--current-alpha">current-alpha</link>&quot;            <link linkend="guint">guint</link>                 : Read / Write
  &quot;<link linkend="GtkColorSelection--current-color">current-color</link>&quot;            <link linkend="GdkColor">GdkColor</link>*             : Read / Write
  &quot;<link linkend="GtkColorSelection--has-opacity-control">has-opacity-control</link>&quot;      <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GtkColorSelection--has-palette">has-palette</link>&quot;              <link linkend="gboolean">gboolean</link>              : Read / Write
</synopsis>
</refsect1>

<refsect1 id="GtkColorSelection.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
  &quot;<link linkend="GtkColorSelection-color-changed">color-changed</link>&quot;                                  : Run First
</synopsis>
</refsect1>


<refsect1 id="GtkColorSelection.description" role="desc">
<title role="desc.title">Description</title>
<para>
The <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link> is a widget that is used to select
a color.  It consists of a color wheel and number of sliders
and entry boxes for color parameters such as hue, saturation,
value, red, green, blue, and opacity.  It is found on the standard
color selection dialog box <link linkend="GtkColorSelectionDialog"><type>GtkColorSelectionDialog</type></link>.
</para>
</refsect1>

<refsect1 id="GtkColorSelection.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GtkColorSelection-struct" role="struct">
<title>GtkColorSelection</title>
<indexterm zone="GtkColorSelection-struct"><primary sortas="ColorSelection">GtkColorSelection</primary></indexterm><programlisting>typedef struct _GtkColorSelection GtkColorSelection;</programlisting>
<para>
The <link linkend="GtkColorSelection-struct"><type>GtkColorSelection</type></link> struct contains private data only,
and should be accessed using the functions below.
</para></refsect2>
<refsect2 id="gtk-color-selection-new" role="function">
<title>gtk_color_selection_new ()</title>
<indexterm zone="gtk-color-selection-new"><primary sortas="color_selection_new">gtk_color_selection_new</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link> *         gtk_color_selection_new             (void);</programlisting>
<para>
Creates a new GtkColorSelection.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-set-update-policy" role="function" condition="deprecated:">
<title>gtk_color_selection_set_update_policy ()</title>
<indexterm zone="gtk-color-selection-set-update-policy" role="deprecated"><primary sortas="color_selection_set_update_policy">gtk_color_selection_set_update_policy</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_color_selection_set_update_policy
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         <link linkend="GtkUpdateType">GtkUpdateType</link> policy);</programlisting>
<warning><para><literal>gtk_color_selection_set_update_policy</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Sets the policy controlling when the color_changed signals are emitted.
The available policies are:
<itemizedlist>
<listitem>
<para>
<link linkend="GTK-UPDATE-CONTINUOUS--CAPS"><literal>GTK_UPDATE_CONTINUOUS</literal></link> - signals are sent continuously as the color
selection changes.
</para>
</listitem>
<listitem>
<para>
<link linkend="GTK-UPDATE-DISCONTINUOUS--CAPS"><literal>GTK_UPDATE_DISCONTINUOUS</literal></link> - signals are sent only when the mouse
button is released.
</para>
</listitem>
<listitem>
<para>
<link linkend="GTK-UPDATE-DELAYED--CAPS"><literal>GTK_UPDATE_DELAYED</literal></link> - signals are sent when the mouse button is
released or when the mouse has been motionless for a period of
time.
</para>
</listitem>
</itemizedlist>
</para><variablelist role="params">
<varlistentry><term><parameter>colorsel</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>policy</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GtkUpdateType"><type>GtkUpdateType</type></link> value indicating the desired policy.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-set-has-opacity-control" role="function">
<title>gtk_color_selection_set_has_opacity_control ()</title>
<indexterm zone="gtk-color-selection-set-has-opacity-control"><primary sortas="color_selection_set_has_opacity_control">gtk_color_selection_set_has_opacity_control</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_color_selection_set_has_opacity_control
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         <link linkend="gboolean">gboolean</link> has_opacity);</programlisting>
<para>
Sets the <parameter>colorsel</parameter> to use or not use opacity.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>colorsel</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>has_opacity</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if <parameter>colorsel</parameter> can set the opacity, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-get-has-opacity-control" role="function">
<title>gtk_color_selection_get_has_opacity_control ()</title>
<indexterm zone="gtk-color-selection-get-has-opacity-control"><primary sortas="color_selection_get_has_opacity_control">gtk_color_selection_get_has_opacity_control</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_color_selection_get_has_opacity_control
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel);</programlisting>
<para>
Determines whether the colorsel has an opacity control.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>colorsel</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <parameter>colorsel</parameter> has an opacity control.  <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> if it does't.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-set-has-palette" role="function">
<title>gtk_color_selection_set_has_palette ()</title>
<indexterm zone="gtk-color-selection-set-has-palette"><primary sortas="color_selection_set_has_palette">gtk_color_selection_set_has_palette</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_color_selection_set_has_palette (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         <link linkend="gboolean">gboolean</link> has_palette);</programlisting>
<para>
Shows and hides the palette based upon the value of <parameter>has_palette</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>colorsel</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>has_palette</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if palette is to be visible, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-get-has-palette" role="function">
<title>gtk_color_selection_get_has_palette ()</title>
<indexterm zone="gtk-color-selection-get-has-palette"><primary sortas="color_selection_get_has_palette">gtk_color_selection_get_has_palette</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_color_selection_get_has_palette (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel);</programlisting>
<para>
Determines whether the color selector has a color palette.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>colorsel</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the selector has a palette.  <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> if it hasn't.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-get-current-alpha" role="function">
<title>gtk_color_selection_get_current_alpha ()</title>
<indexterm zone="gtk-color-selection-get-current-alpha"><primary sortas="color_selection_get_current_alpha">gtk_color_selection_get_current_alpha</primary></indexterm><programlisting><link linkend="guint16">guint16</link>             gtk_color_selection_get_current_alpha
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel);</programlisting>
<para>
Returns the current alpha value.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>colorsel</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> an integer between 0 and 65535.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-set-current-alpha" role="function">
<title>gtk_color_selection_set_current_alpha ()</title>
<indexterm zone="gtk-color-selection-set-current-alpha"><primary sortas="color_selection_set_current_alpha">gtk_color_selection_set_current_alpha</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_color_selection_set_current_alpha
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         <link linkend="guint16">guint16</link> alpha);</programlisting>
<para>
Sets the current opacity to be <parameter>alpha</parameter>.  The first time this is called, it will
also set the original opacity to be <parameter>alpha</parameter> too.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>colorsel</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>alpha</parameter>&#160;:</term>
<listitem><simpara> an integer between 0 and 65535.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-get-current-color" role="function">
<title>gtk_color_selection_get_current_color ()</title>
<indexterm zone="gtk-color-selection-get-current-color"><primary sortas="color_selection_get_current_color">gtk_color_selection_get_current_color</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_color_selection_get_current_color
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         <link linkend="GdkColor">GdkColor</link> *color);</programlisting>
<para>
Sets <parameter>color</parameter> to be the current color in the GtkColorSelection widget.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>colorsel</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>color</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkColor"><type>GdkColor</type></link> to fill in with the current color.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-set-current-color" role="function">
<title>gtk_color_selection_set_current_color ()</title>
<indexterm zone="gtk-color-selection-set-current-color"><primary sortas="color_selection_set_current_color">gtk_color_selection_set_current_color</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_color_selection_set_current_color
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         const <link linkend="GdkColor">GdkColor</link> *color);</programlisting>
<para>
Sets the current color to be <parameter>color</parameter>.  The first time this is called, it will
also set the original color to be <parameter>color</parameter> too.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>colorsel</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>color</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="GdkColor"><type>GdkColor</type></link> to set the current color with.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-get-previous-alpha" role="function">
<title>gtk_color_selection_get_previous_alpha ()</title>
<indexterm zone="gtk-color-selection-get-previous-alpha"><primary sortas="color_selection_get_previous_alpha">gtk_color_selection_get_previous_alpha</primary></indexterm><programlisting><link linkend="guint16">guint16</link>             gtk_color_selection_get_previous_alpha
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel);</programlisting>
<para>
Returns the previous alpha value.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>colorsel</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> an integer between 0 and 65535.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-set-previous-alpha" role="function">
<title>gtk_color_selection_set_previous_alpha ()</title>
<indexterm zone="gtk-color-selection-set-previous-alpha"><primary sortas="color_selection_set_previous_alpha">gtk_color_selection_set_previous_alpha</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_color_selection_set_previous_alpha
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         <link linkend="guint16">guint16</link> alpha);</programlisting>
<para>
Sets the 'previous' alpha to be <parameter>alpha</parameter>.  This function should be called with
some hesitations, as it might seem confusing to have that alpha change.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>colorsel</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>alpha</parameter>&#160;:</term>
<listitem><simpara> an integer between 0 and 65535.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-get-previous-color" role="function">
<title>gtk_color_selection_get_previous_color ()</title>
<indexterm zone="gtk-color-selection-get-previous-color"><primary sortas="color_selection_get_previous_color">gtk_color_selection_get_previous_color</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_color_selection_get_previous_color
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         <link linkend="GdkColor">GdkColor</link> *color);</programlisting>
<para>
Fills <parameter>color</parameter> in with the original color value.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>colorsel</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>color</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkColor"><type>GdkColor</type></link> to fill in with the original color value.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-set-previous-color" role="function">
<title>gtk_color_selection_set_previous_color ()</title>
<indexterm zone="gtk-color-selection-set-previous-color"><primary sortas="color_selection_set_previous_color">gtk_color_selection_set_previous_color</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_color_selection_set_previous_color
                                                        (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         const <link linkend="GdkColor">GdkColor</link> *color);</programlisting>
<para>
Sets the 'previous' color to be <parameter>color</parameter>.  This function should be called with
some hesitations, as it might seem confusing to have that color change.
Calling <link linkend="gtk-color-selection-set-current-color"><function>gtk_color_selection_set_current_color()</function></link> will also set this color the first
time it is called.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>colorsel</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>color</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkColor"><type>GdkColor</type></link> to set the previous color with.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-is-adjusting" role="function">
<title>gtk_color_selection_is_adjusting ()</title>
<indexterm zone="gtk-color-selection-is-adjusting"><primary sortas="color_selection_is_adjusting">gtk_color_selection_is_adjusting</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_color_selection_is_adjusting    (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel);</programlisting>
<para>
Gets the current state of the <parameter>colorsel</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>colorsel</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the user is currently dragging a color around, and <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>
if the selection has stopped.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-palette-from-string" role="function">
<title>gtk_color_selection_palette_from_string ()</title>
<indexterm zone="gtk-color-selection-palette-from-string"><primary sortas="color_selection_palette_from_string">gtk_color_selection_palette_from_string</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_color_selection_palette_from_string
                                                        (const <link linkend="gchar">gchar</link> *str,
                                                         <link linkend="GdkColor">GdkColor</link> **colors,
                                                         <link linkend="gint">gint</link> *n_colors);</programlisting>
<para>
Parses a color palette string; the string is a colon-separated
list of color names readable by <link linkend="gdk-color-parse"><function>gdk_color_parse()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>str</parameter>&#160;:</term>
<listitem><simpara> a string encoding a color palette.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>colors</parameter>&#160;:</term>
<listitem><simpara> return location for allocated array of <link linkend="GdkColor"><type>GdkColor</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_colors</parameter>&#160;:</term>
<listitem><simpara> return location for length of array.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if a palette was successfully parsed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-palette-to-string" role="function">
<title>gtk_color_selection_palette_to_string ()</title>
<indexterm zone="gtk-color-selection-palette-to-string"><primary sortas="color_selection_palette_to_string">gtk_color_selection_palette_to_string</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*              gtk_color_selection_palette_to_string
                                                        (const <link linkend="GdkColor">GdkColor</link> *colors,
                                                         <link linkend="gint">gint</link> n_colors);</programlisting>
<para>
Encodes a palette as a string, useful for persistent storage.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>colors</parameter>&#160;:</term>
<listitem><simpara> an array of colors.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_colors</parameter>&#160;:</term>
<listitem><simpara> length of the array.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> allocated string encoding the palette.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-set-change-palette-hook" role="function" condition="deprecated">
<title>gtk_color_selection_set_change_palette_hook ()</title>
<indexterm zone="gtk-color-selection-set-change-palette-hook" role="deprecated"><primary sortas="color_selection_set_change_palette_hook">gtk_color_selection_set_change_palette_hook</primary></indexterm><programlisting><link linkend="GtkColorSelectionChangePaletteFunc">GtkColorSelectionChangePaletteFunc</link>  gtk_color_selection_set_change_palette_hook
                                                        (<link linkend="GtkColorSelectionChangePaletteFunc">GtkColorSelectionChangePaletteFunc</link> func);</programlisting>
<warning><para><literal>gtk_color_selection_set_change_palette_hook</literal> has been deprecated since version 2.4 and should not be used in newly-written code. This function does not work in multihead environments.
    Use <link linkend="gtk-color-selection-set-change-palette-with-screen-hook"><function>gtk_color_selection_set_change_palette_with_screen_hook()</function></link> instead.</para></warning>
<para>
Installs a global function to be called whenever the user tries to
modify the palette in a color selection. This function should save
the new palette contents, and update the GtkSettings property
"gtk-color-palette" so all GtkColorSelection widgets will be modified.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>func</parameter>&#160;:</term>
<listitem><simpara> a function to call when the custom palette needs saving.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the previous change palette hook (that was replaced).

</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GtkColorSelectionChangePaletteFunc" role="function">
<title>GtkColorSelectionChangePaletteFunc ()</title>
<indexterm zone="GtkColorSelectionChangePaletteFunc"><primary sortas="ColorSelectionChangePaletteFunc">GtkColorSelectionChangePaletteFunc</primary></indexterm><programlisting><link linkend="void">void</link>                (*GtkColorSelectionChangePaletteFunc)
                                                        (const <link linkend="GdkColor">GdkColor</link> *colors,
                                                         <link linkend="gint">gint</link> n_colors);</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>colors</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_colors</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-set-change-palette-with-screen-hook" role="function" condition="since:2.2">
<title>gtk_color_selection_set_change_palette_with_screen_hook ()</title>
<indexterm zone="gtk-color-selection-set-change-palette-with-screen-hook" role="2.2"><primary sortas="color_selection_set_change_palette_with_screen_hook">gtk_color_selection_set_change_palette_with_screen_hook</primary></indexterm><programlisting><link linkend="GtkColorSelectionChangePaletteWithScreenFunc">GtkColorSelectionChangePaletteWithScreenFunc</link>  gtk_color_selection_set_change_palette_with_screen_hook
                                                        (<link linkend="GtkColorSelectionChangePaletteWithScreenFunc">GtkColorSelectionChangePaletteWithScreenFunc</link> func);</programlisting>
<para>
Installs a global function to be called whenever the user tries to
modify the palette in a color selection. This function should save
the new palette contents, and update the GtkSettings property
"gtk-color-palette" so all GtkColorSelection widgets will be modified.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>func</parameter>&#160;:</term>
<listitem><simpara> a function to call when the custom palette needs saving.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the previous change palette hook (that was replaced).

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="GtkColorSelectionChangePaletteWithScreenFunc" role="function" condition="since:2.2">
<title>GtkColorSelectionChangePaletteWithScreenFunc ()</title>
<indexterm zone="GtkColorSelectionChangePaletteWithScreenFunc" role="2.2"><primary sortas="ColorSelectionChangePaletteWithScreenFunc">GtkColorSelectionChangePaletteWithScreenFunc</primary></indexterm><programlisting><link linkend="void">void</link>                (*GtkColorSelectionChangePaletteWithScreenFunc)
                                                        (<link linkend="GdkScreen">GdkScreen</link> *screen,
                                                         const <link linkend="GdkColor">GdkColor</link> *colors,
                                                         <link linkend="gint">gint</link> n_colors);</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>screen</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>colors</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_colors</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-color-selection-set-color" role="function" condition="deprecated:2.0: Use gtk_color_selection_set_current_color() instead.">
<title>gtk_color_selection_set_color ()</title>
<indexterm zone="gtk-color-selection-set-color" role="deprecated"><primary sortas="color_selection_set_color">gtk_color_selection_set_color</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_color_selection_set_color       (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         <link linkend="gdouble">gdouble</link> *color);</programlisting>
<warning><para><literal>gtk_color_selection_set_color</literal> has been deprecated since version 2.0 and should not be used in newly-written code. Use <link linkend="gtk-color-selection-set-current-color"><function>gtk_color_selection_set_current_color()</function></link> instead.</para></warning>
<para>
Sets the current color to be <parameter>color</parameter>.  The first time this is called, it will
also set the original color to be <parameter>color</parameter> too.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>colorsel</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>color</parameter>&#160;:</term>
<listitem><simpara> an array of 4 doubles specifying the red, green, blue and opacity 
  to set the current color to.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-color-selection-get-color" role="function" condition="deprecated:Use gtk_color_selection_get_current_color() instead.">
<title>gtk_color_selection_get_color ()</title>
<indexterm zone="gtk-color-selection-get-color" role="deprecated"><primary sortas="color_selection_get_color">gtk_color_selection_get_color</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_color_selection_get_color       (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorsel,
                                                         <link linkend="gdouble">gdouble</link> *color);</programlisting>
<warning><para><literal>gtk_color_selection_get_color</literal> is deprecated and should not be used in newly-written code. Use <link linkend="gtk-color-selection-get-current-color"><function>gtk_color_selection_get_current_color()</function></link> instead.</para></warning>
<para>
Sets <parameter>color</parameter> to be the current color in the GtkColorSelection widget.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>colorsel</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>color</parameter>&#160;:</term>
<listitem><simpara> an array of 4 <link linkend="gdouble"><type>gdouble</type></link> to fill in with the current color.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>
<refsect1 id="GtkColorSelection.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkColorSelection--current-alpha" role="property"><title>The <literal>&quot;current-alpha&quot;</literal> property</title>
<indexterm zone="GtkColorSelection--current-alpha"><primary sortas="ColorSelection:current-alpha">GtkColorSelection:current-alpha</primary></indexterm><programlisting>  &quot;current-alpha&quot;            <link linkend="guint">guint</link>                 : Read / Write</programlisting>
<para>The current opacity value (0 fully transparent, 65535 fully opaque).</para><para>Allowed values: &lt;= 65535</para>
<para>Default value: 65535</para>
</refsect2>
<refsect2 id="GtkColorSelection--current-color" role="property"><title>The <literal>&quot;current-color&quot;</literal> property</title>
<indexterm zone="GtkColorSelection--current-color"><primary sortas="ColorSelection:current-color">GtkColorSelection:current-color</primary></indexterm><programlisting>  &quot;current-color&quot;            <link linkend="GdkColor">GdkColor</link>*             : Read / Write</programlisting>
<para>The current color.</para></refsect2>
<refsect2 id="GtkColorSelection--has-opacity-control" role="property"><title>The <literal>&quot;has-opacity-control&quot;</literal> property</title>
<indexterm zone="GtkColorSelection--has-opacity-control"><primary sortas="ColorSelection:has-opacity-control">GtkColorSelection:has-opacity-control</primary></indexterm><programlisting>  &quot;has-opacity-control&quot;      <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>Whether the color selector should allow setting opacity.</para><para>Default value: FALSE</para>
</refsect2>
<refsect2 id="GtkColorSelection--has-palette" role="property"><title>The <literal>&quot;has-palette&quot;</literal> property</title>
<indexterm zone="GtkColorSelection--has-palette"><primary sortas="ColorSelection:has-palette">GtkColorSelection:has-palette</primary></indexterm><programlisting>  &quot;has-palette&quot;              <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>Whether a palette should be used.</para><para>Default value: FALSE</para>
</refsect2>
</refsect1>

<refsect1 id="GtkColorSelection.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkColorSelection-color-changed" role="signal"><title>The <literal>&quot;color-changed&quot;</literal> signal</title>
<indexterm zone="GtkColorSelection-color-changed"><primary sortas="ColorSelection::color-changed">GtkColorSelection::color-changed</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkColorSelection">GtkColorSelection</link> *colorselection,
                                                        <link linkend="gpointer">gpointer</link>           user_data)           : Run First</programlisting>
<para>
This signal is emitted when the color changes in the <link linkend="GtkColorSelection"><type>GtkColorSelection</type></link>
according to its update policy.
</para><variablelist role="params">
<varlistentry><term><parameter>colorselection</parameter>&#160;:</term>
<listitem><simpara>the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>



</refentry>
