GtkColorSelection



Hi,

Suggest revamping the API, as appended. The API being revamped was
added post-1.2 so there are no backward compat issues, except for
gtk_color_selection_set_color() which I've marked deprecated.

The other changes:

 - rename set_use_opacity() to set_has_opacity_control()
 - rename set_use_palette() to set_has_palette()
 - provide set_current_color() and set_current_alpha() to replace
   set_color(), in order to get rid of the odd array of doubles 
   API (that among other things doesn't work as an object property,
   GUI builders can't understand it)
 - rename set_old_color() to set_previous_color(), and 
   use GdkColor not array of doubles as with set_current_color()
 - add get_palette_size() so you don't have to open the widget,
   look at the size, and hardcode said size in your app
 - address palette cells by index, not by x/y coordinate, so we can 
   rearrange them and leave the API making sense
 - remove the is_adjusting() function, because I don't see what it's
   for, though I'm willing to be convinced

Have a look at current CVS for compare-and-contrast. Please comment on
the changes... I'm merging a modified version of Lee's property
patches for the color sel while I'm doing this, so that will be part
of the patch.

Havoc

gboolean    gtk_color_selection_get_has_opacity_control
(GtkColorSelection *colorsel);
void        gtk_color_selection_set_has_opacity_control
(GtkColorSelection *colorsel,
                                                         gboolean
has_opacity_control);
gboolean    gtk_color_selection_get_has_palette   (GtkColorSelection
*colorsel);
void        gtk_color_selection_set_has_palette   (GtkColorSelection
*colorsel,
                                                   gboolean
has_palette);

void    gtk_color_selection_set_current_color  (GtkColorSelection
*colorsel,
                                                GdkColor
*color);
void    gtk_color_selection_set_current_alpha  (GtkColorSelection
*colorsel,
                                                guint16
alpha);
void    gtk_color_selection_get_current_color  (GtkColorSelection
*colorsel,
                                                GdkColor
*color);
guint16 gtk_color_selection_get_current_alpha  (GtkColorSelection
*colorsel);

void    gtk_color_selection_set_previous_color (GtkColorSelection
*colorsel,
                                                GdkColor
*color);
void    gtk_color_selection_set_previous_alpha (GtkColorSelection
*colorsel,
                                                guint16
alpha);
void    gtk_color_selection_get_previous_color (GtkColorSelection
*colorsel,
                                                GdkColor
*color);
guint16 gtk_color_selection_get_previous_alpha (GtkColorSelection
*colorsel);


void gtk_color_selection_get_palette_size    (GtkColorSelection
*colorsel);
void gtk_color_selection_get_palette_color   (GtkColorSelection
*colorsel,
                                              gint
index,
                                              GdkColor
*color);
void gtk_color_selection_set_palette_color   (GtkColorSelection
*colorsel,
                                              gint
index,
                                              GdkColor
*color);
void gtk_color_selection_unset_palette_color (GtkColorSelection
*colorsel,
                                              gint
index);





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]