[gimp] libgimpwidgets: add GimpColorSelectorClass::icon_name
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimpwidgets: add GimpColorSelectorClass::icon_name
- Date: Sat, 10 May 2014 06:37:36 +0000 (UTC)
commit 1ec64abb8b49de03b118fe3594b6386533caaa35
Author: Michael Natterer <mitch gimp org>
Date: Sat May 10 08:33:29 2014 +0200
libgimpwidgets: add GimpColorSelectorClass::icon_name
and deprecate its stock_id.
app/widgets/gimpcoloreditor.c | 2 +-
app/widgets/gimpcolorselectorpalette.c | 2 +-
libgimpwidgets/gimpcolornotebook.c | 7 ++++---
libgimpwidgets/gimpcolorscales.c | 2 +-
libgimpwidgets/gimpcolorselect.c | 2 +-
libgimpwidgets/gimpcolorselector.c | 2 +-
libgimpwidgets/gimpcolorselector.h | 8 +++++++-
modules/color-selector-cmyk.c | 2 +-
modules/color-selector-water.c | 6 +++---
modules/color-selector-wheel.c | 2 +-
10 files changed, 21 insertions(+), 14 deletions(-)
---
diff --git a/app/widgets/gimpcoloreditor.c b/app/widgets/gimpcoloreditor.c
index c91c866..1f503a3 100644
--- a/app/widgets/gimpcoloreditor.c
+++ b/app/widgets/gimpcoloreditor.c
@@ -212,7 +212,7 @@ gimp_color_editor_init (GimpColorEditor *editor)
gtk_box_pack_start (GTK_BOX (editor->hbox), button, TRUE, TRUE, 0);
gtk_widget_show (button);
- image = gtk_image_new_from_icon_name (selector_class->stock_id,
+ image = gtk_image_new_from_icon_name (selector_class->icon_name,
GTK_ICON_SIZE_BUTTON);
gtk_container_add (GTK_CONTAINER (button), image);
gtk_widget_show (image);
diff --git a/app/widgets/gimpcolorselectorpalette.c b/app/widgets/gimpcolorselectorpalette.c
index c869fdd..68302c6 100644
--- a/app/widgets/gimpcolorselectorpalette.c
+++ b/app/widgets/gimpcolorselectorpalette.c
@@ -58,7 +58,7 @@ gimp_color_selector_palette_class_init (GimpColorSelectorPaletteClass *klass)
selector_class->name = _("Palette");
selector_class->help_id = "gimp-colorselector-palette";
- selector_class->stock_id = GIMP_STOCK_PALETTE;
+ selector_class->icon_name = GIMP_STOCK_PALETTE;
selector_class->set_color = gimp_color_selector_palette_set_color;
selector_class->set_config = gimp_color_selector_palette_set_config;
}
diff --git a/libgimpwidgets/gimpcolornotebook.c b/libgimpwidgets/gimpcolornotebook.c
index 7a7580f..ea653c1 100644
--- a/libgimpwidgets/gimpcolornotebook.c
+++ b/libgimpwidgets/gimpcolornotebook.c
@@ -203,7 +203,8 @@ gimp_color_notebook_style_set (GtkWidget *widget,
selector_class = GIMP_COLOR_SELECTOR_GET_CLASS (list->data);
- image = gtk_image_new_from_icon_name (selector_class->stock_id, icon_size);
+ image = gtk_image_new_from_icon_name (selector_class->icon_name,
+ icon_size);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook->notebook),
GTK_WIDGET (list->data),
@@ -392,7 +393,7 @@ gimp_color_notebook_add_page (GimpColorNotebook *notebook,
menu_widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
- image = gtk_image_new_from_icon_name (selector_class->stock_id,
+ image = gtk_image_new_from_icon_name (selector_class->icon_name,
GTK_ICON_SIZE_MENU);
gtk_box_pack_start (GTK_BOX (menu_widget), image, FALSE, FALSE, 0);
gtk_widget_show (image);
@@ -401,7 +402,7 @@ gimp_color_notebook_add_page (GimpColorNotebook *notebook,
gtk_box_pack_start (GTK_BOX (menu_widget), label, FALSE, FALSE, 0);
gtk_widget_show (label);
- image = gtk_image_new_from_icon_name (selector_class->stock_id,
+ image = gtk_image_new_from_icon_name (selector_class->icon_name,
DEFAULT_TAB_ICON_SIZE);
gtk_notebook_append_page_menu (GTK_NOTEBOOK (notebook->notebook),
diff --git a/libgimpwidgets/gimpcolorscales.c b/libgimpwidgets/gimpcolorscales.c
index d477c25..aa41f89 100644
--- a/libgimpwidgets/gimpcolorscales.c
+++ b/libgimpwidgets/gimpcolorscales.c
@@ -108,7 +108,7 @@ gimp_color_scales_class_init (GimpColorScalesClass *klass)
selector_class->name = _("Scales");
selector_class->help_id = "gimp-colorselector-scales";
- selector_class->stock_id = GIMP_STOCK_TOOL_OPTIONS;
+ selector_class->icon_name = GIMP_STOCK_TOOL_OPTIONS;
selector_class->set_toggles_visible = gimp_color_scales_togg_visible;
selector_class->set_toggles_sensitive = gimp_color_scales_togg_sensitive;
selector_class->set_show_alpha = gimp_color_scales_set_show_alpha;
diff --git a/libgimpwidgets/gimpcolorselect.c b/libgimpwidgets/gimpcolorselect.c
index 72baf6d..922186d 100644
--- a/libgimpwidgets/gimpcolorselect.c
+++ b/libgimpwidgets/gimpcolorselect.c
@@ -238,7 +238,7 @@ gimp_color_select_class_init (GimpColorSelectClass *klass)
selector_class->name = "GIMP";
selector_class->help_id = "gimp-colorselector-gimp";
- selector_class->stock_id = GIMP_STOCK_WILBER;
+ selector_class->icon_name = GIMP_STOCK_WILBER;
selector_class->set_toggles_visible = gimp_color_select_togg_visible;
selector_class->set_toggles_sensitive = gimp_color_select_togg_sensitive;
selector_class->set_color = gimp_color_select_set_color;
diff --git a/libgimpwidgets/gimpcolorselector.c b/libgimpwidgets/gimpcolorselector.c
index a74215f..b801594 100644
--- a/libgimpwidgets/gimpcolorselector.c
+++ b/libgimpwidgets/gimpcolorselector.c
@@ -96,7 +96,7 @@ gimp_color_selector_class_init (GimpColorSelectorClass *klass)
klass->name = "Unnamed";
klass->help_id = NULL;
- klass->stock_id = GTK_STOCK_SELECT_COLOR;
+ klass->icon_name = GTK_STOCK_SELECT_COLOR;
klass->set_toggles_visible = NULL;
klass->set_toggles_sensitive = NULL;
diff --git a/libgimpwidgets/gimpcolorselector.h b/libgimpwidgets/gimpcolorselector.h
index 48cdd14..c0a8f6a 100644
--- a/libgimpwidgets/gimpcolorselector.h
+++ b/libgimpwidgets/gimpcolorselector.h
@@ -82,7 +82,11 @@ struct _GimpColorSelectorClass
const gchar *name;
const gchar *help_id;
+#ifdef GIMP_DISABLE_DEPRECATED
+ gpointer deprecated_stock_id;
+#else
const gchar *stock_id;
+#endif
/* virtual functions */
void (* set_toggles_visible) (GimpColorSelector *selector,
@@ -108,8 +112,10 @@ struct _GimpColorSelectorClass
void (* set_config) (GimpColorSelector *selector,
GimpColorConfig *config);
+ /* icon name */
+ const gchar *icon_name;
+
/* Padding for future expansion */
- void (* _gimp_reserved2) (void);
void (* _gimp_reserved3) (void);
void (* _gimp_reserved4) (void);
};
diff --git a/modules/color-selector-cmyk.c b/modules/color-selector-cmyk.c
index b064d52..3608f41 100644
--- a/modules/color-selector-cmyk.c
+++ b/modules/color-selector-cmyk.c
@@ -117,7 +117,7 @@ colorsel_cmyk_class_init (ColorselCmykClass *klass)
selector_class->name = _("CMYK");
selector_class->help_id = "gimp-colorselector-cmyk";
- selector_class->stock_id = GTK_STOCK_PRINT; /* FIXME */
+ selector_class->icon_name = GTK_STOCK_PRINT; /* FIXME */
selector_class->set_color = colorsel_cmyk_set_color;
selector_class->set_config = colorsel_cmyk_set_config;
}
diff --git a/modules/color-selector-water.c b/modules/color-selector-water.c
index 2589d41..99d9bb2 100644
--- a/modules/color-selector-water.c
+++ b/modules/color-selector-water.c
@@ -115,9 +115,9 @@ colorsel_water_class_init (ColorselWaterClass *klass)
{
GimpColorSelectorClass *selector_class = GIMP_COLOR_SELECTOR_CLASS (klass);
- selector_class->name = _("Watercolor");
- selector_class->help_id = "gimp-colorselector-watercolor";
- selector_class->stock_id = GIMP_STOCK_TOOL_PAINTBRUSH;
+ selector_class->name = _("Watercolor");
+ selector_class->help_id = "gimp-colorselector-watercolor";
+ selector_class->icon_name = GIMP_STOCK_TOOL_PAINTBRUSH;
}
static void
diff --git a/modules/color-selector-wheel.c b/modules/color-selector-wheel.c
index eecdf9b..9af8d39 100644
--- a/modules/color-selector-wheel.c
+++ b/modules/color-selector-wheel.c
@@ -101,7 +101,7 @@ colorsel_wheel_class_init (ColorselWheelClass *klass)
selector_class->name = _("Wheel");
selector_class->help_id = "gimp-colorselector-triangle";
- selector_class->stock_id = GIMP_STOCK_COLOR_TRIANGLE;
+ selector_class->icon_name = GIMP_STOCK_COLOR_TRIANGLE;
selector_class->set_color = colorsel_wheel_set_color;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]