diff options
author | Benjamin Otte <otte@redhat.com> | 2012-03-07 03:07:02 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-03-07 03:11:05 +0100 |
commit | 4d6a6be89795b7905f650a93b8e80beb1dc46747 (patch) | |
tree | 988ec04412450abcad965204948e35c6c214271f | |
parent | b83dcc26ad8079c621c7212359599a956807f96d (diff) | |
download | gtk+-4d6a6be89795b7905f650a93b8e80beb1dc46747.tar.gz |
API: colorchooser: Use GtkOrientation for orientation
Unfortunately, this swaps the values from the previous state.
But it's definitely a nicer API.
-rw-r--r-- | gtk/gtkcolorbutton.c | 4 | ||||
-rw-r--r-- | gtk/gtkcolorchooser.c | 8 | ||||
-rw-r--r-- | gtk/gtkcolorchooser.h | 4 | ||||
-rw-r--r-- | gtk/gtkcolorchooserdialog.c | 4 | ||||
-rw-r--r-- | gtk/gtkcolorchooserwidget.c | 8 | ||||
-rw-r--r-- | tests/testcolorchooser.c | 4 |
6 files changed, 16 insertions, 16 deletions
diff --git a/gtk/gtkcolorbutton.c b/gtk/gtkcolorbutton.c index 194ece80b2..ab2821fa41 100644 --- a/gtk/gtkcolorbutton.c +++ b/gtk/gtkcolorbutton.c @@ -962,7 +962,7 @@ gtk_color_button_get_property (GObject *object, static void gtk_color_button_add_palette (GtkColorChooser *chooser, - gboolean horizontal, + GtkOrientation orientation, gint colors_per_line, gint n_colors, GdkRGBA *colors) @@ -971,7 +971,7 @@ gtk_color_button_add_palette (GtkColorChooser *chooser, if (button->priv->cs_dialog) gtk_color_chooser_add_palette (GTK_COLOR_CHOOSER (button->priv->cs_dialog), - horizontal, colors_per_line, n_colors, colors); + orientation, colors_per_line, n_colors, colors); } typedef void (* get_rgba) (GtkColorChooser *, GdkRGBA *); diff --git a/gtk/gtkcolorchooser.c b/gtk/gtkcolorchooser.c index 869f73bc0f..532fcd3618 100644 --- a/gtk/gtkcolorchooser.c +++ b/gtk/gtkcolorchooser.c @@ -201,8 +201,8 @@ gtk_color_chooser_set_use_alpha (GtkColorChooser *chooser, /** * gtk_color_chooser_add_palette: * @chooser: a #GtkColorChooser - * @horizontal: %TRUE if the palette should be displayed in rows, - * %FALSE for columns + * @orientation: %GTK_ORIENTATION_HORIZONTAL if the palette should + * be displayed in rows, %GTK_ORIENTATION_VERTICAL for columns * @colors_per_line: the number of colors to show in each row/column * @n_colors: the total number of elements in @colors * @colors: (allow-none) (array length=n_colors): the colors of the palette, or %NULL @@ -229,7 +229,7 @@ gtk_color_chooser_set_use_alpha (GtkColorChooser *chooser, */ void gtk_color_chooser_add_palette (GtkColorChooser *chooser, - gboolean horizontal, + GtkOrientation orientation, gint colors_per_line, gint n_colors, GdkRGBA *colors) @@ -237,7 +237,7 @@ gtk_color_chooser_add_palette (GtkColorChooser *chooser, g_return_if_fail (GTK_IS_COLOR_CHOOSER (chooser)); if (GTK_COLOR_CHOOSER_GET_IFACE (chooser)->add_palette) - GTK_COLOR_CHOOSER_GET_IFACE (chooser)->add_palette (chooser, horizontal, colors_per_line, n_colors, colors); + GTK_COLOR_CHOOSER_GET_IFACE (chooser)->add_palette (chooser, orientation, colors_per_line, n_colors, colors); } cairo_pattern_t * diff --git a/gtk/gtkcolorchooser.h b/gtk/gtkcolorchooser.h index f64d4fe399..6d3a891c56 100644 --- a/gtk/gtkcolorchooser.h +++ b/gtk/gtkcolorchooser.h @@ -46,7 +46,7 @@ struct _GtkColorChooserInterface const GdkRGBA *color); void (* add_palette) (GtkColorChooser *chooser, - gboolean horizontal, + GtkOrientation orientation, gint colors_per_line, gint n_colors, GdkRGBA *colors); @@ -77,7 +77,7 @@ void gtk_color_chooser_set_use_alpha (GtkColorChooser *chooser, GDK_AVAILABLE_IN_3_4 void gtk_color_chooser_add_palette (GtkColorChooser *chooser, - gboolean horizontal, + GtkOrientation orientation, gint colors_per_line, gint n_colors, GdkRGBA *colors); diff --git a/gtk/gtkcolorchooserdialog.c b/gtk/gtkcolorchooserdialog.c index 4b0b1c2e90..7877225bcd 100644 --- a/gtk/gtkcolorchooserdialog.c +++ b/gtk/gtkcolorchooserdialog.c @@ -256,7 +256,7 @@ gtk_color_chooser_dialog_set_rgba (GtkColorChooser *chooser, static void gtk_color_chooser_dialog_add_palette (GtkColorChooser *chooser, - gboolean horizontal, + GtkOrientation orientation, gint colors_per_line, gint n_colors, GdkRGBA *colors) @@ -264,7 +264,7 @@ gtk_color_chooser_dialog_add_palette (GtkColorChooser *chooser, GtkColorChooserDialog *cc = GTK_COLOR_CHOOSER_DIALOG (chooser); gtk_color_chooser_add_palette (GTK_COLOR_CHOOSER (cc->priv->chooser), - horizontal, colors_per_line, n_colors, colors); + orientation, colors_per_line, n_colors, colors); } static void diff --git a/gtk/gtkcolorchooserwidget.c b/gtk/gtkcolorchooserwidget.c index ff51d73448..92f293f843 100644 --- a/gtk/gtkcolorchooserwidget.c +++ b/gtk/gtkcolorchooserwidget.c @@ -309,7 +309,7 @@ remove_palette (GtkColorChooserWidget *cc) static void add_palette (GtkColorChooserWidget *cc, - gboolean horizontal, + GtkOrientation orientation, gint colors_per_line, gint n_colors, GdkRGBA *colors, @@ -368,7 +368,7 @@ add_palette (GtkColorChooserWidget *cc, line = i / colors_per_line; pos = i % colors_per_line; - if (horizontal) + if (orientation == GTK_ORIENTATION_HORIZONTAL) { if (pos == left) gtk_style_context_add_class (gtk_widget_get_style_context (p), GTK_STYLE_CLASS_LEFT); @@ -773,7 +773,7 @@ gtk_color_chooser_widget_set_rgba (GtkColorChooser *chooser, static void gtk_color_chooser_widget_add_palette (GtkColorChooser *chooser, - gboolean horizontal, + GtkOrientation orientation, gint colors_per_line, gint n_colors, GdkRGBA *colors) @@ -781,7 +781,7 @@ gtk_color_chooser_widget_add_palette (GtkColorChooser *chooser, GtkColorChooserWidget *cc = GTK_COLOR_CHOOSER_WIDGET (chooser); remove_default_palette (cc); - add_palette (cc, horizontal, colors_per_line, n_colors, colors, NULL); + add_palette (cc, orientation, colors_per_line, n_colors, colors, NULL); } static void diff --git a/tests/testcolorchooser.c b/tests/testcolorchooser.c index da6633b599..4fb6354055 100644 --- a/tests/testcolorchooser.c +++ b/tests/testcolorchooser.c @@ -80,14 +80,14 @@ main (int argc, char *argv[]) } } gtk_color_chooser_add_palette (GTK_COLOR_CHOOSER (dialog), - FALSE, + GTK_ORIENTATION_VERTICAL, 9, 9*9, colors); } else if (g_strcmp0 (argv[i], "--no-palette") == 0) { gtk_color_chooser_add_palette (GTK_COLOR_CHOOSER (dialog), - FALSE, 0, 0, NULL); + GTK_ORIENTATION_VERTICAL, 0, 0, NULL); } } |