Color Dialog

Color Dialog — The GPE Colour selection dialog

Synopsis




#define     COL_STR_LEN
#define     COLOR_F_TO_U                    (v)
#define     RGBA32_U_COMPOSE                (r,g,b,a)
#define     RGBA32_F_COMPOSE                (r,g,b,a)
GtkWidget*  gpe_color_dialog_new            (GtkWindow *parent,
                                             GtkDialogFlags flags,
                                             const gchar *initcolor);
const gchar* gpe_color_dialog_get_color_str (GpeColorDialog *color_dialog);
void        gpe_color_dialog_set_color_str  (GpeColorDialog *color_dialog,
                                             const gchar *colordesc);
const GdkColor* gpe_color_dialog_get_color_gdk
                                            (GpeColorDialog *color_dialog);
void        gpe_color_dialog_set_color_gdk  (GpeColorDialog *color_dialog,
                                             const GdkColor *new_color);

Description

The GPE Colour selection dialog is a smal and fast dialog to select free defineable RGB colour values. In contrast to GtkColorDialog it is much faster and simpler to fit the needs of mobile devices.

Details

COL_STR_LEN

#define COL_STR_LEN  8

Maximum length of the colour description string.


COLOR_F_TO_U()

#define COLOR_F_TO_U(v) ((unsigned int) ((v) * 255.9999))

v :

RGBA32_U_COMPOSE()

#define RGBA32_U_COMPOSE(r,g,b,a) ((((r) & 0xff) << 24) | (((g) & 0xff) << 16) | (((b) & 0xff) << 8) | ((a) & 0xff))

r :
g :
b :
a :

RGBA32_F_COMPOSE()

#define RGBA32_F_COMPOSE(r,g,b,a) RGBA32_U_COMPOSE (COLOR_F_TO_U (r), COLOR_F_TO_U (g), COLOR_F_TO_U (b), COLOR_F_TO_U (a))

r :
g :
b :
a :

gpe_color_dialog_new ()

GtkWidget*  gpe_color_dialog_new            (GtkWindow *parent,
                                             GtkDialogFlags flags,
                                             const gchar *initcolor);

Creates a small colour selection dialog suitable for use on small screens. When the user clicks a button a "response" signal is emitted with response IDs from GtkResponseType. See GtkDialog for more details.

Returns:

parent : The transient parent, or NULL for none.
flags : A GtkDialogFlags mask for the dialog window.
initcolor : initial colour
Returns : a new GpeColorDialog

Since 0.111


gpe_color_dialog_get_color_str ()

const gchar* gpe_color_dialog_get_color_str (GpeColorDialog *color_dialog);

Get a pointer to the string GRB representation of the currently selected colour. The description has the form rrggbb.

color_dialog : a GpeColorDialog
Returns : Colour string, the value must not be altered or freed.

Since 0.111


gpe_color_dialog_set_color_str ()

void        gpe_color_dialog_set_color_str  (GpeColorDialog *color_dialog,
                                             const gchar *colordesc);

Set the selection dialog to the given colour defined by a string value. This may be any string description XParseColor is able to interpret. e.g. HTML-like values rrggbb or any definition from rgb.txt.

color_dialog : a GpeColorDialog
colordesc : String description of the new colour.

Since 0.111


gpe_color_dialog_get_color_gdk ()

const GdkColor* gpe_color_dialog_get_color_gdk
                                            (GpeColorDialog *color_dialog);

Get a pointer to the currently selected and allocated colour GdkColor value. The value must not be altered or freed.

Returns:

color_dialog : a GpeColorDialog
Returns : A pointer to a GdkColor struct.

Since 0.111


gpe_color_dialog_set_color_gdk ()

void        gpe_color_dialog_set_color_gdk  (GpeColorDialog *color_dialog,
                                             const GdkColor *new_color);

Set the selection dialog to the given colour defined by a GdkColor value.

color_dialog : a GpeColorDialog
new_color : new colour

Since 0.111