From 71d1c678cd4c7aa9a465354af7f6566ac2631803 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 27 Jun 2006 20:00:03 +0000 Subject: [PATCH] use the GimpColorRenderingIntent enum from libgimpconfig instead of 2006-06-27 Sven Neumann * modules/cdisplay_proof.c: use the GimpColorRenderingIntent enum from libgimpconfig instead of duplicating it. --- ChangeLog | 19 ++++++++++ libgimpbase/gimpbaseenums.c | 4 +-- libgimpbase/gimpbaseenums.h | 10 +++--- libgimpbase/gimputils.c | 14 +++++--- libgimpconfig/gimpcolorconfig-enums.c | 2 +- libgimpconfig/gimpcolorconfig-enums.h | 2 +- modules/cdisplay_proof.c | 52 +++------------------------ 7 files changed, 41 insertions(+), 62 deletions(-) diff --git a/ChangeLog b/ChangeLog index 49226b43c6..da958d1084 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2006-06-27 Sven Neumann + + * modules/cdisplay_proof.c: use the GimpColorRenderingIntent enum + from libgimpconfig instead of duplicating it. + +2006-06-27 Sven Neumann + + Changes based on a patch from Zbigniew Chyla (bug #345982): + + * libgimpbase/gimputils.c: strip translation context from enum + descriptions. + + * libgimpbase/gimpbaseenums.h + * libgimpconfig/gimpcolorconfig-enums.h: added translation context + to some enums. + + * libgimpbase/gimpbaseenums.c + * libgimpconfig/gimpcolorconfig-enums.c: regenerated. + 2006-06-27 Sven Neumann * app/core/gimpunit.c: applied patch from Zbigniew Chyla that adds diff --git a/libgimpbase/gimpbaseenums.c b/libgimpbase/gimpbaseenums.c index 1c015f350b..79b9cfddd3 100644 --- a/libgimpbase/gimpbaseenums.c +++ b/libgimpbase/gimpbaseenums.c @@ -385,7 +385,7 @@ gimp_gradient_type_get_type (void) static const GimpEnumDesc descs[] = { - { GIMP_GRADIENT_LINEAR, N_("Linear"), NULL }, + { GIMP_GRADIENT_LINEAR, N_("gradient|Linear"), NULL }, { GIMP_GRADIENT_BILINEAR, N_("Bi-linear"), NULL }, { GIMP_GRADIENT_RADIAL, N_("Radial"), NULL }, { GIMP_GRADIENT_SQUARE, N_("Square"), NULL }, @@ -560,7 +560,7 @@ gimp_interpolation_type_get_type (void) static const GimpEnumDesc descs[] = { { GIMP_INTERPOLATION_NONE, N_("None (Fastest)"), NULL }, - { GIMP_INTERPOLATION_LINEAR, N_("Linear"), NULL }, + { GIMP_INTERPOLATION_LINEAR, N_("interpolation|Linear"), NULL }, { GIMP_INTERPOLATION_CUBIC, N_("Cubic"), NULL }, { GIMP_INTERPOLATION_LANCZOS, N_("Lanczos (Best)"), NULL }, { 0, NULL, NULL } diff --git a/libgimpbase/gimpbaseenums.h b/libgimpbase/gimpbaseenums.h index 279e84bf2c..d900af785b 100644 --- a/libgimpbase/gimpbaseenums.h +++ b/libgimpbase/gimpbaseenums.h @@ -172,7 +172,7 @@ GType gimp_gradient_type_get_type (void) G_GNUC_CONST; typedef enum { - GIMP_GRADIENT_LINEAR, /*< desc="Linear" >*/ + GIMP_GRADIENT_LINEAR, /*< desc="gradient|Linear" >*/ GIMP_GRADIENT_BILINEAR, /*< desc="Bi-linear" >*/ GIMP_GRADIENT_RADIAL, /*< desc="Radial" >*/ GIMP_GRADIENT_SQUARE, /*< desc="Square" >*/ @@ -245,10 +245,10 @@ GType gimp_interpolation_type_get_type (void) G_GNUC_CONST; typedef enum { - GIMP_INTERPOLATION_NONE, /*< desc="None (Fastest)" >*/ - GIMP_INTERPOLATION_LINEAR, /*< desc="Linear" >*/ - GIMP_INTERPOLATION_CUBIC, /*< desc="Cubic" >*/ - GIMP_INTERPOLATION_LANCZOS /*< desc="Lanczos (Best)" >*/ + GIMP_INTERPOLATION_NONE, /*< desc="None (Fastest)" >*/ + GIMP_INTERPOLATION_LINEAR, /*< desc="interpolation|Linear" >*/ + GIMP_INTERPOLATION_CUBIC, /*< desc="Cubic" >*/ + GIMP_INTERPOLATION_LANCZOS /*< desc="Lanczos (Best)" >*/ } GimpInterpolationType; diff --git a/libgimpbase/gimputils.c b/libgimpbase/gimputils.c index 84b17c0fd8..7b81a8937a 100644 --- a/libgimpbase/gimputils.c +++ b/libgimpbase/gimputils.c @@ -23,6 +23,7 @@ #include "config.h" #include +#include #include @@ -458,11 +459,13 @@ gimp_enum_get_value (GType enum_type, enum_desc = gimp_enum_get_desc (enum_class, value); - if (value_desc) + if (value_desc) { *value_desc = ((enum_desc && enum_desc->value_desc) ? - dgettext (gimp_type_get_translation_domain (enum_type), - enum_desc->value_desc) : + g_strip_context (enum_desc->value_desc, + dgettext (gimp_type_get_translation_domain (enum_type), + enum_desc->value_desc)) : NULL); + } if (value_help) *value_help = ((enum_desc && enum_desc->value_desc) ? @@ -500,8 +503,9 @@ gimp_enum_value_get_desc (GEnumClass *enum_class, enum_desc = gimp_enum_get_desc (enum_class, enum_value->value); if (enum_desc && enum_desc->value_desc) - return dgettext (gimp_type_get_translation_domain (type), - enum_desc->value_desc); + return g_strip_context (enum_desc->value_desc, + dgettext (gimp_type_get_translation_domain (type), + enum_desc->value_desc)); return enum_value->value_name; } diff --git a/libgimpconfig/gimpcolorconfig-enums.c b/libgimpconfig/gimpcolorconfig-enums.c index af03ba5b45..21fe033a18 100644 --- a/libgimpconfig/gimpcolorconfig-enums.c +++ b/libgimpconfig/gimpcolorconfig-enums.c @@ -55,7 +55,7 @@ gimp_color_rendering_intent_get_type (void) { { GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL, N_("Perceptual"), NULL }, { GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC, N_("Relative colorimetric"), NULL }, - { GIMP_COLOR_RENDERING_INTENT_SATURATION, N_("Saturation"), NULL }, + { GIMP_COLOR_RENDERING_INTENT_SATURATION, N_("intent|Saturation"), NULL }, { GIMP_COLOR_RENDERING_INTENT_ABSOLUTE_COLORIMETRIC, N_("Absolute colorimetric"), NULL }, { 0, NULL, NULL } }; diff --git a/libgimpconfig/gimpcolorconfig-enums.h b/libgimpconfig/gimpcolorconfig-enums.h index e21800727f..90d80fc255 100644 --- a/libgimpconfig/gimpcolorconfig-enums.h +++ b/libgimpconfig/gimpcolorconfig-enums.h @@ -45,7 +45,7 @@ typedef enum { GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL, /*< desc="Perceptual" >*/ GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC, /*< desc="Relative colorimetric" >*/ - GIMP_COLOR_RENDERING_INTENT_SATURATION, /*< desc="Saturation" >*/ + GIMP_COLOR_RENDERING_INTENT_SATURATION, /*< desc="intent|Saturation" >*/ GIMP_COLOR_RENDERING_INTENT_ABSOLUTE_COLORIMETRIC /*< desc="Absolute colorimetric" >*/ } GimpColorRenderingIntent; diff --git a/modules/cdisplay_proof.c b/modules/cdisplay_proof.c index f8ef2d0410..5be5048eb3 100644 --- a/modules/cdisplay_proof.c +++ b/modules/cdisplay_proof.c @@ -35,33 +35,6 @@ #include "libgimp/libgimp-intl.h" - -#define CDISPLAY_TYPE_PROOF_INTENT (cdisplay_proof_intent_type) -static GType cdisplay_proof_intent_get_type (GTypeModule *module); - -static const GEnumValue enum_values[] = -{ - { INTENT_PERCEPTUAL, - "INTENT_PERCEPTUAL", "perceptual" }, - { INTENT_RELATIVE_COLORIMETRIC, - "INTENT_RELATIVE_COLORIMETRIC", "relative-colorimetric" }, - { INTENT_SATURATION, - "INTENT_SATURATION", "saturation" }, - { INTENT_ABSOLUTE_COLORIMETRIC, - "INTENT_ABSOLUTE_COLORIMETRIC" "absolute-colorimetric" }, - { 0, NULL, NULL } -}; - -static const GimpEnumDesc enum_descs[] = -{ - { INTENT_PERCEPTUAL, N_("Perceptual"), NULL }, - { INTENT_RELATIVE_COLORIMETRIC, N_("Relative colorimetric"), NULL }, - { INTENT_SATURATION, N_("Saturation"), NULL }, - { INTENT_ABSOLUTE_COLORIMETRIC, N_("Absolute colorimetric"), NULL }, - { 0, NULL, NULL } -}; - - #define CDISPLAY_TYPE_PROOF (cdisplay_proof_type) #define CDISPLAY_PROOF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CDISPLAY_TYPE_PROOF, CdisplayProof)) #define CDISPLAY_PROOF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CDISPLAY_TYPE_PROOF, CdisplayProofClass)) @@ -133,9 +106,8 @@ static const GimpModuleInfo cdisplay_proof_info = "November 14, 2003" }; -static GType cdisplay_proof_type = 0; -static GType cdisplay_proof_intent_type = 0; -static GimpColorDisplayClass *parent_class = NULL; +static GType cdisplay_proof_type = 0; +static GimpColorDisplayClass *parent_class = NULL; G_MODULE_EXPORT const GimpModuleInfo * @@ -148,7 +120,6 @@ G_MODULE_EXPORT gboolean gimp_module_register (GTypeModule *module) { cdisplay_proof_get_type (module); - cdisplay_proof_intent_get_type (module); return TRUE; } @@ -179,22 +150,6 @@ cdisplay_proof_get_type (GTypeModule *module) return cdisplay_proof_type; } -static GType -cdisplay_proof_intent_get_type (GTypeModule *module) -{ - if (! cdisplay_proof_intent_type) - { - cdisplay_proof_intent_type = - g_type_module_register_enum (module, "CDisplayProofIntent", - enum_values); - - gimp_enum_set_value_descriptions (cdisplay_proof_intent_type, - enum_descs); - } - - return cdisplay_proof_intent_type; -} - static void cdisplay_proof_class_init (CdisplayProofClass *klass) { @@ -209,7 +164,8 @@ cdisplay_proof_class_init (CdisplayProofClass *klass) GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_INTENT, "intent", NULL, - CDISPLAY_TYPE_PROOF_INTENT, INTENT_PERCEPTUAL, + GIMP_TYPE_COLOR_RENDERING_INTENT, + GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL, 0); GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_BPC, "black-point-compensation", NULL,