mirror of https://github.com/GNOME/gimp.git
libgimpconfig/Makefile.am libgimpconfig/gimpcolorconfig-enums.[ch] added a
2005-02-06 Sven Neumann <sven@gimp.org> * libgimpconfig/Makefile.am * libgimpconfig/gimpcolorconfig-enums.[ch] * libgimpconfig/gimpcolorconfig.[ch]: added a first draft of a color management configuration object. Not yet installed nor used by anything. This is based on an older patch by Stefan Döhla.
This commit is contained in:
parent
5e807eabaa
commit
2eeefb13d2
|
@ -1,3 +1,11 @@
|
||||||
|
2005-02-06 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* libgimpconfig/Makefile.am
|
||||||
|
* libgimpconfig/gimpcolorconfig-enums.[ch]
|
||||||
|
* libgimpconfig/gimpcolorconfig.[ch]: added a first draft of a
|
||||||
|
color management configuration object. Not yet installed nor used
|
||||||
|
by anything. This is based on an older patch by Stefan Döhla.
|
||||||
|
|
||||||
2005-02-06 Bill Skaggs <weskaggs@primate.ucdavis.edu>
|
2005-02-06 Bill Skaggs <weskaggs@primate.ucdavis.edu>
|
||||||
|
|
||||||
* plug-ins/common/unsharp.c: apply speedup proposed
|
* plug-ins/common/unsharp.c: apply speedup proposed
|
||||||
|
|
|
@ -72,17 +72,21 @@ libgimpconfig_sources = \
|
||||||
gimpconfig-path.h \
|
gimpconfig-path.h \
|
||||||
gimpconfig-serialize.c \
|
gimpconfig-serialize.c \
|
||||||
gimpconfig-serialize.h \
|
gimpconfig-serialize.h \
|
||||||
|
gimpconfig-utils.c \
|
||||||
|
gimpconfig-utils.h \
|
||||||
gimpconfigwriter.c \
|
gimpconfigwriter.c \
|
||||||
gimpconfigwriter.h \
|
gimpconfigwriter.h \
|
||||||
gimpscanner.c \
|
gimpscanner.c \
|
||||||
gimpscanner.h \
|
gimpscanner.h \
|
||||||
gimpconfig-utils.c \
|
gimpcolorconfig.c \
|
||||||
gimpconfig-utils.h
|
gimpcolorconfig.h \
|
||||||
|
gimpcolorconfig-enums.h
|
||||||
|
|
||||||
|
libgimpconfig_built_sources = \
|
||||||
|
gimpcolorconfig-enums.c
|
||||||
|
|
||||||
libgimpconfig_built_sources =
|
libgimpconfig_2_0_la_SOURCES = \
|
||||||
|
$(libgimpconfig_sources) $(libgimpconfig_built_sources)
|
||||||
libgimpconfig_2_0_la_SOURCES = $(libgimpconfig_sources) $(libgimpconfig_built_sources)
|
|
||||||
|
|
||||||
|
|
||||||
libgimpconfiginclude_HEADERS = \
|
libgimpconfiginclude_HEADERS = \
|
||||||
|
@ -94,9 +98,9 @@ libgimpconfiginclude_HEADERS = \
|
||||||
gimpconfig-params.h \
|
gimpconfig-params.h \
|
||||||
gimpconfig-path.h \
|
gimpconfig-path.h \
|
||||||
gimpconfig-serialize.h \
|
gimpconfig-serialize.h \
|
||||||
|
gimpconfig-utils.h \
|
||||||
gimpconfigwriter.h \
|
gimpconfigwriter.h \
|
||||||
gimpscanner.h \
|
gimpscanner.h
|
||||||
gimpconfig-utils.h
|
|
||||||
|
|
||||||
|
|
||||||
libgimpconfig_2_0_la_LDFLAGS = \
|
libgimpconfig_2_0_la_LDFLAGS = \
|
||||||
|
@ -122,6 +126,19 @@ uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
|
||||||
# rules to generate built sources
|
# rules to generate built sources
|
||||||
#
|
#
|
||||||
|
|
||||||
gen_sources = xgen-bec
|
gen_sources = xgen-cec
|
||||||
CLEANFILES = $(gen_sources)
|
CLEANFILES = $(gen_sources)
|
||||||
|
|
||||||
|
$(srcdir)/gimpcolorconfig-enums.c: $(srcdir)/gimpcolorconfig-enums.h $(GIMP_MKENUMS)
|
||||||
|
$(GIMP_MKENUMS) \
|
||||||
|
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"libgimpbase/gimpbasetypes.h\"\n#include \"gimpcolorconfig-enums.h\"\n#include \"libgimp/libgimp-intl.h\"" \
|
||||||
|
--fprod "\n/* enumerations from \"@filename@\" */" \
|
||||||
|
--vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \
|
||||||
|
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
|
||||||
|
--vtail " { 0, NULL, NULL }\n };\n" \
|
||||||
|
--dhead " static const Gimp@Type@Desc descs[] =\n {" \
|
||||||
|
--dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \
|
||||||
|
--dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (! type)\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_type_set_translation_domain (type, GETTEXT_PACKAGE \"-libgimp\");\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
|
||||||
|
$(srcdir)/gimpcolorconfig-enums.h > xgen-cec \
|
||||||
|
&& cp xgen-cec $(@F) \
|
||||||
|
&& rm -f xgen-cec
|
||||||
|
|
|
@ -0,0 +1,108 @@
|
||||||
|
|
||||||
|
/* Generated data (by gimp-mkenums) */
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include "libgimpbase/gimpbasetypes.h"
|
||||||
|
#include "gimpcolorconfig-enums.h"
|
||||||
|
#include "libgimp/libgimp-intl.h"
|
||||||
|
|
||||||
|
/* enumerations from "./gimpcolorconfig-enums.h" */
|
||||||
|
GType
|
||||||
|
gimp_color_management_mode_get_type (void)
|
||||||
|
{
|
||||||
|
static const GEnumValue values[] =
|
||||||
|
{
|
||||||
|
{ GIMP_COLOR_MANAGEMENT_OFF, "GIMP_COLOR_MANAGEMENT_OFF", "off" },
|
||||||
|
{ GIMP_COLOR_MANAGEMENT_DISPLAY, "GIMP_COLOR_MANAGEMENT_DISPLAY", "display" },
|
||||||
|
{ GIMP_COLOR_MANAGEMENT_SOFTPROOF, "GIMP_COLOR_MANAGEMENT_SOFTPROOF", "softproof" },
|
||||||
|
{ 0, NULL, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
static const GimpEnumDesc descs[] =
|
||||||
|
{
|
||||||
|
{ GIMP_COLOR_MANAGEMENT_OFF, N_("No color management"), NULL },
|
||||||
|
{ GIMP_COLOR_MANAGEMENT_DISPLAY, N_("Color managed display"), NULL },
|
||||||
|
{ GIMP_COLOR_MANAGEMENT_SOFTPROOF, N_("Print simulation"), NULL },
|
||||||
|
{ 0, NULL, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
static GType type = 0;
|
||||||
|
|
||||||
|
if (! type)
|
||||||
|
{
|
||||||
|
type = g_enum_register_static ("GimpColorManagementMode", values);
|
||||||
|
gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");
|
||||||
|
gimp_enum_set_value_descriptions (type, descs);
|
||||||
|
}
|
||||||
|
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
gimp_color_rendering_intent_get_type (void)
|
||||||
|
{
|
||||||
|
static const GEnumValue values[] =
|
||||||
|
{
|
||||||
|
{ GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL, "GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL", "perceptual" },
|
||||||
|
{ GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC, "GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC", "relative-colorimetric" },
|
||||||
|
{ GIMP_COLOR_RENDERING_INTENT_SATURATION, "GIMP_COLOR_RENDERING_INTENT_SATURATION", "saturation" },
|
||||||
|
{ GIMP_COLOR_RENDERING_INTENT_ABSOLUTE_COLORIMETRIC, "GIMP_COLOR_RENDERING_INTENT_ABSOLUTE_COLORIMETRIC", "absolute-colorimetric" },
|
||||||
|
{ 0, NULL, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
static const GimpEnumDesc descs[] =
|
||||||
|
{
|
||||||
|
{ GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL, "GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL", NULL },
|
||||||
|
{ GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC, "GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC", NULL },
|
||||||
|
{ GIMP_COLOR_RENDERING_INTENT_SATURATION, "GIMP_COLOR_RENDERING_INTENT_SATURATION", NULL },
|
||||||
|
{ GIMP_COLOR_RENDERING_INTENT_ABSOLUTE_COLORIMETRIC, "GIMP_COLOR_RENDERING_INTENT_ABSOLUTE_COLORIMETRIC", NULL },
|
||||||
|
{ 0, NULL, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
static GType type = 0;
|
||||||
|
|
||||||
|
if (! type)
|
||||||
|
{
|
||||||
|
type = g_enum_register_static ("GimpColorRenderingIntent", values);
|
||||||
|
gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");
|
||||||
|
gimp_enum_set_value_descriptions (type, descs);
|
||||||
|
}
|
||||||
|
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
gimp_color_file_open_behaviour_get_type (void)
|
||||||
|
{
|
||||||
|
static const GEnumValue values[] =
|
||||||
|
{
|
||||||
|
{ GIMP_COLOR_FILE_OPEN_ASK, "GIMP_COLOR_FILE_OPEN_ASK", "ask" },
|
||||||
|
{ GIMP_COLOR_FILE_OPEN_LEAVE, "GIMP_COLOR_FILE_OPEN_LEAVE", "leave" },
|
||||||
|
{ GIMP_COLOR_FILE_OPEN_CONVERT_RGB, "GIMP_COLOR_FILE_OPEN_CONVERT_RGB", "convert-rgb" },
|
||||||
|
{ 0, NULL, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
static const GimpEnumDesc descs[] =
|
||||||
|
{
|
||||||
|
{ GIMP_COLOR_FILE_OPEN_ASK, N_("Ask"), NULL },
|
||||||
|
{ GIMP_COLOR_FILE_OPEN_LEAVE, N_("Use embedded profile"), NULL },
|
||||||
|
{ GIMP_COLOR_FILE_OPEN_CONVERT_RGB, N_("Convert to RGB workspace"), NULL },
|
||||||
|
{ 0, NULL, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
static GType type = 0;
|
||||||
|
|
||||||
|
if (! type)
|
||||||
|
{
|
||||||
|
type = g_enum_register_static ("GimpColorFileOpenBehaviour", values);
|
||||||
|
gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");
|
||||||
|
gimp_enum_set_value_descriptions (type, descs);
|
||||||
|
}
|
||||||
|
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Generated data ends here */
|
||||||
|
|
|
@ -0,0 +1,70 @@
|
||||||
|
/* LIBGIMP - The GIMP Library
|
||||||
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
|
*
|
||||||
|
* GimpColorConfig enums
|
||||||
|
* Copyright (C) 2004 Stefan Döhla <stefan@doehla.de>
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the
|
||||||
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
* Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __GIMP_COLOR_CONFIG_ENUMS_H__
|
||||||
|
#define __GIMP_COLOR_CONFIG_ENUMS_H__
|
||||||
|
|
||||||
|
|
||||||
|
#define GIMP_TYPE_COLOR_MANAGEMENT_MODE (gimp_color_management_mode_get_type ())
|
||||||
|
|
||||||
|
GType gimp_color_management_mode_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
GIMP_COLOR_MANAGEMENT_OFF, /*< desc="No color management" >*/
|
||||||
|
GIMP_COLOR_MANAGEMENT_DISPLAY, /*< desc="Color managed display" >*/
|
||||||
|
GIMP_COLOR_MANAGEMENT_SOFTPROOF /*< desc="Print simulation" >*/
|
||||||
|
} GimpColorManagementMode;
|
||||||
|
|
||||||
|
|
||||||
|
#define GIMP_TYPE_COLOR_RENDERING_INTENT \
|
||||||
|
(gimp_color_rendering_intent_get_type ())
|
||||||
|
|
||||||
|
GType gimp_color_rendering_intent_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
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_ABSOLUTE_COLORIMETRIC
|
||||||
|
/*< desc="Absolute Colorimetric" >*/
|
||||||
|
} GimpColorRenderingIntent;
|
||||||
|
|
||||||
|
|
||||||
|
#define GIMP_TYPE_COLOR_FILE_OPEN_BEHAVIOUR \
|
||||||
|
(gimp_color_file_open_behaviour_get_type ())
|
||||||
|
|
||||||
|
GType gimp_color_file_open_behaviour_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
GIMP_COLOR_FILE_OPEN_ASK, /*< desc="Ask" >*/
|
||||||
|
GIMP_COLOR_FILE_OPEN_LEAVE, /*< desc="Use embedded profile" >*/
|
||||||
|
GIMP_COLOR_FILE_OPEN_CONVERT_RGB /*< desc="Convert to RGB workspace" >*/
|
||||||
|
} GimpColorFileOpenBehaviour;
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* GIMP_COLOR_CONFIG_ENUMS_H__ */
|
|
@ -0,0 +1,321 @@
|
||||||
|
/* LIBGIMP - The GIMP Library
|
||||||
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
|
*
|
||||||
|
* GimpColorConfig class
|
||||||
|
* Copyright (C) 2004 Stefan Döhla <stefan@doehla.de>
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the
|
||||||
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
* Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
#include "gimpconfigtypes.h"
|
||||||
|
|
||||||
|
#include "gimpcolorconfig-enums.h"
|
||||||
|
|
||||||
|
#include "gimpcolorconfig.h"
|
||||||
|
#include "gimpconfig-iface.h"
|
||||||
|
#include "gimpconfig-params.h"
|
||||||
|
#include "gimpconfig-path.h"
|
||||||
|
|
||||||
|
#include "libgimp/libgimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define DEFAULT_PROFILE_PATH "/usr/share/color/icc"
|
||||||
|
|
||||||
|
|
||||||
|
#define COLOR_MANAGEMENT_MODE_BLURB \
|
||||||
|
N_("Mode of operation for color management.")
|
||||||
|
#define PROFILE_PATH_BLURB \
|
||||||
|
N_("Default folder where ICC profiles are located.")
|
||||||
|
#define DISPLAY_PROFILE_BLURB \
|
||||||
|
N_("Sets the display color profile.")
|
||||||
|
#define RGB_PROFILE_BLURB \
|
||||||
|
N_("Sets default RGB workspace color profile.")
|
||||||
|
#define CMYK_PROFILE_BLURB \
|
||||||
|
N_("Sets the CMYK color profile used to convert between RGB and CMYK.")
|
||||||
|
#define PRINTER_PROFILE_BLURB \
|
||||||
|
N_("Sets the color profile used when printing.")
|
||||||
|
#define DISPLAY_RENDERING_INTENT_BLURB \
|
||||||
|
N_("Sets how colors are mapped for your display.")
|
||||||
|
#define SIMULATION_RENDERING_INTENT_BLURB \
|
||||||
|
N_("Sets how colors from workspace to simulation device are converted.")
|
||||||
|
#define OPEN_BEHAVIOUR_NO_PROFILE_BLURB \
|
||||||
|
N_("Defines what will be done if no color profile is available.")
|
||||||
|
#define OPEN_BEHAVIOUR_RGB_PROFILE_BLURB \
|
||||||
|
N_("Defines what will be done if an RGB profile is available.")
|
||||||
|
#define OPEN_BEHAVIOUR_CMYK_PROFILE_BLURB \
|
||||||
|
N_("Defines what will be done if a CMYK profile is available.")
|
||||||
|
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
PROP_0,
|
||||||
|
PROP_MODE,
|
||||||
|
PROP_PROFILE_PATH,
|
||||||
|
PROP_RGB_PROFILE,
|
||||||
|
PROP_CMYK_PROFILE,
|
||||||
|
PROP_DISPLAY_PROFILE,
|
||||||
|
PROP_PRINTER_PROFILE,
|
||||||
|
PROP_DISPLAY_RENDERING_INTENT,
|
||||||
|
PROP_SIMULATION_RENDERING_INTENT,
|
||||||
|
PROP_OPEN_BEHAVIOUR_NO_PROFILE,
|
||||||
|
PROP_OPEN_BEHAVIOUR_RGB_PROFILE,
|
||||||
|
PROP_OPEN_BEHAVIOUR_CMYK_PROFILE
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static void gimp_color_config_class_init (GimpColorConfigClass *klass);
|
||||||
|
static void gimp_color_config_finalize (GObject *object);
|
||||||
|
static void gimp_color_config_set_property (GObject *object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue *value,
|
||||||
|
GParamSpec *pspec);
|
||||||
|
static void gimp_color_config_get_property (GObject *object,
|
||||||
|
guint property_id,
|
||||||
|
GValue *value,
|
||||||
|
GParamSpec *pspec);
|
||||||
|
|
||||||
|
|
||||||
|
static GObjectClass *parent_class = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
GType
|
||||||
|
gimp_color_config_get_type (void)
|
||||||
|
{
|
||||||
|
static GType config_type = 0;
|
||||||
|
|
||||||
|
if (! config_type)
|
||||||
|
{
|
||||||
|
static const GTypeInfo config_info =
|
||||||
|
{
|
||||||
|
sizeof (GimpColorConfigClass),
|
||||||
|
NULL, /* base_init */
|
||||||
|
NULL, /* base_finalize */
|
||||||
|
(GClassInitFunc) gimp_color_config_class_init,
|
||||||
|
NULL, /* class_finalize */
|
||||||
|
NULL, /* class_data */
|
||||||
|
sizeof (GimpColorConfig),
|
||||||
|
0, /* n_preallocs */
|
||||||
|
NULL /* instance_init */
|
||||||
|
};
|
||||||
|
|
||||||
|
static const GInterfaceInfo config_iface_info =
|
||||||
|
{
|
||||||
|
NULL, /* iface_init */
|
||||||
|
NULL, /* iface_finalize */
|
||||||
|
NULL /* iface_data */
|
||||||
|
};
|
||||||
|
|
||||||
|
config_type = g_type_register_static (G_TYPE_OBJECT,
|
||||||
|
"GimpColorConfig",
|
||||||
|
&config_info, 0);
|
||||||
|
|
||||||
|
g_type_add_interface_static (config_type,
|
||||||
|
GIMP_TYPE_CONFIG, &config_iface_info);
|
||||||
|
}
|
||||||
|
|
||||||
|
return config_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_color_config_class_init (GimpColorConfigClass *klass)
|
||||||
|
{
|
||||||
|
GObjectClass *object_class;
|
||||||
|
|
||||||
|
parent_class = g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
|
object_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
|
object_class->finalize = gimp_color_config_finalize;
|
||||||
|
object_class->set_property = gimp_color_config_set_property;
|
||||||
|
object_class->get_property = gimp_color_config_get_property;
|
||||||
|
|
||||||
|
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_MODE,
|
||||||
|
"mode", COLOR_MANAGEMENT_MODE_BLURB,
|
||||||
|
GIMP_TYPE_COLOR_MANAGEMENT_MODE,
|
||||||
|
GIMP_COLOR_MANAGEMENT_DISPLAY,
|
||||||
|
0);
|
||||||
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PROFILE_PATH,
|
||||||
|
"profile-path", PROFILE_PATH_BLURB,
|
||||||
|
GIMP_CONFIG_PATH_DIR, DEFAULT_PROFILE_PATH,
|
||||||
|
0);
|
||||||
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_RGB_PROFILE,
|
||||||
|
"rgb-profile", RGB_PROFILE_BLURB,
|
||||||
|
GIMP_CONFIG_PATH_FILE, NULL,
|
||||||
|
0);
|
||||||
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_CMYK_PROFILE,
|
||||||
|
"cmyk-profile", CMYK_PROFILE_BLURB,
|
||||||
|
GIMP_CONFIG_PATH_FILE, NULL,
|
||||||
|
0);
|
||||||
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_DISPLAY_PROFILE,
|
||||||
|
"display-profile", DISPLAY_PROFILE_BLURB,
|
||||||
|
GIMP_CONFIG_PATH_FILE, NULL,
|
||||||
|
0);
|
||||||
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PRINTER_PROFILE,
|
||||||
|
"printer-profile", PRINTER_PROFILE_BLURB,
|
||||||
|
GIMP_CONFIG_PATH_FILE, NULL,
|
||||||
|
0);
|
||||||
|
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_DISPLAY_RENDERING_INTENT,
|
||||||
|
"display-rendering-intent",
|
||||||
|
DISPLAY_RENDERING_INTENT_BLURB,
|
||||||
|
GIMP_TYPE_COLOR_RENDERING_INTENT,
|
||||||
|
GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
|
||||||
|
0);
|
||||||
|
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_SIMULATION_RENDERING_INTENT,
|
||||||
|
"simulation-rendering-intent",
|
||||||
|
SIMULATION_RENDERING_INTENT_BLURB,
|
||||||
|
GIMP_TYPE_COLOR_RENDERING_INTENT,
|
||||||
|
GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
|
||||||
|
0);
|
||||||
|
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_OPEN_BEHAVIOUR_NO_PROFILE,
|
||||||
|
"open-behaviour-no-profile",
|
||||||
|
OPEN_BEHAVIOUR_NO_PROFILE_BLURB,
|
||||||
|
GIMP_TYPE_COLOR_FILE_OPEN_BEHAVIOUR,
|
||||||
|
GIMP_COLOR_FILE_OPEN_ASK,
|
||||||
|
0);
|
||||||
|
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_OPEN_BEHAVIOUR_RGB_PROFILE,
|
||||||
|
"open-behaviour-rgb-profile",
|
||||||
|
OPEN_BEHAVIOUR_RGB_PROFILE_BLURB,
|
||||||
|
GIMP_TYPE_COLOR_FILE_OPEN_BEHAVIOUR,
|
||||||
|
GIMP_COLOR_FILE_OPEN_ASK,
|
||||||
|
0);
|
||||||
|
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_OPEN_BEHAVIOUR_CMYK_PROFILE,
|
||||||
|
"open-behaviour-cmyk-profile",
|
||||||
|
OPEN_BEHAVIOUR_CMYK_PROFILE_BLURB,
|
||||||
|
GIMP_TYPE_COLOR_FILE_OPEN_BEHAVIOUR,
|
||||||
|
GIMP_COLOR_FILE_OPEN_ASK,
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_color_config_finalize (GObject *object)
|
||||||
|
{
|
||||||
|
GimpColorConfig *color_config = GIMP_COLOR_CONFIG (object);
|
||||||
|
|
||||||
|
g_free (color_config->profile_path);
|
||||||
|
g_free (color_config->rgb_profile);
|
||||||
|
g_free (color_config->cmyk_profile);
|
||||||
|
g_free (color_config->display_profile);
|
||||||
|
g_free (color_config->printer_profile);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_color_config_set_property (GObject *object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue *value,
|
||||||
|
GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
GimpColorConfig *color_config = GIMP_COLOR_CONFIG (object);
|
||||||
|
|
||||||
|
switch (property_id)
|
||||||
|
{
|
||||||
|
case PROP_MODE:
|
||||||
|
color_config->mode = g_value_get_enum (value);
|
||||||
|
break;
|
||||||
|
case PROP_PROFILE_PATH:
|
||||||
|
g_free (color_config->profile_path);
|
||||||
|
color_config->profile_path = g_value_dup_string (value);
|
||||||
|
break;
|
||||||
|
case PROP_RGB_PROFILE:
|
||||||
|
g_free (color_config->rgb_profile);
|
||||||
|
color_config->rgb_profile = g_value_dup_string (value);
|
||||||
|
break;
|
||||||
|
case PROP_CMYK_PROFILE:
|
||||||
|
g_free (color_config->cmyk_profile);
|
||||||
|
color_config->cmyk_profile = g_value_dup_string (value);
|
||||||
|
break;
|
||||||
|
case PROP_DISPLAY_PROFILE:
|
||||||
|
g_free (color_config->display_profile);
|
||||||
|
color_config->display_profile = g_value_dup_string (value);
|
||||||
|
break;
|
||||||
|
case PROP_PRINTER_PROFILE:
|
||||||
|
g_free (color_config->printer_profile);
|
||||||
|
color_config->printer_profile = g_value_dup_string (value);
|
||||||
|
break;
|
||||||
|
case PROP_DISPLAY_RENDERING_INTENT:
|
||||||
|
color_config->display_rendering_intent = g_value_get_enum (value);
|
||||||
|
break;
|
||||||
|
case PROP_SIMULATION_RENDERING_INTENT:
|
||||||
|
color_config->simulation_rendering_intent = g_value_get_enum (value);
|
||||||
|
break;
|
||||||
|
case PROP_OPEN_BEHAVIOUR_NO_PROFILE:
|
||||||
|
color_config->open_behaviour_no_profile = g_value_get_enum (value);
|
||||||
|
break;
|
||||||
|
case PROP_OPEN_BEHAVIOUR_RGB_PROFILE:
|
||||||
|
color_config->open_behaviour_rgb_profile = g_value_get_enum (value);
|
||||||
|
break;
|
||||||
|
case PROP_OPEN_BEHAVIOUR_CMYK_PROFILE:
|
||||||
|
color_config->open_behaviour_cmyk_profile = g_value_get_enum (value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_color_config_get_property (GObject *object,
|
||||||
|
guint property_id,
|
||||||
|
GValue *value,
|
||||||
|
GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
GimpColorConfig *color_config = GIMP_COLOR_CONFIG (object);
|
||||||
|
|
||||||
|
switch (property_id)
|
||||||
|
{
|
||||||
|
case PROP_MODE:
|
||||||
|
g_value_set_enum (value, color_config->mode);
|
||||||
|
break;
|
||||||
|
case PROP_PROFILE_PATH:
|
||||||
|
g_value_set_string (value, color_config->profile_path);
|
||||||
|
break;
|
||||||
|
case PROP_RGB_PROFILE:
|
||||||
|
g_value_set_string (value, color_config->rgb_profile);
|
||||||
|
break;
|
||||||
|
case PROP_CMYK_PROFILE:
|
||||||
|
g_value_set_string (value, color_config->cmyk_profile);
|
||||||
|
break;
|
||||||
|
case PROP_DISPLAY_PROFILE:
|
||||||
|
g_value_set_string (value, color_config->display_profile);
|
||||||
|
break;
|
||||||
|
case PROP_PRINTER_PROFILE:
|
||||||
|
g_value_set_string (value, color_config->printer_profile);
|
||||||
|
break;
|
||||||
|
case PROP_DISPLAY_RENDERING_INTENT:
|
||||||
|
g_value_set_enum (value, color_config->display_rendering_intent);
|
||||||
|
break;
|
||||||
|
case PROP_SIMULATION_RENDERING_INTENT:
|
||||||
|
g_value_set_enum (value, color_config->simulation_rendering_intent);
|
||||||
|
break;
|
||||||
|
case PROP_OPEN_BEHAVIOUR_NO_PROFILE:
|
||||||
|
g_value_set_enum (value, color_config->open_behaviour_no_profile);
|
||||||
|
break;
|
||||||
|
case PROP_OPEN_BEHAVIOUR_RGB_PROFILE:
|
||||||
|
g_value_set_enum (value, color_config->open_behaviour_rgb_profile);
|
||||||
|
break;
|
||||||
|
case PROP_OPEN_BEHAVIOUR_CMYK_PROFILE:
|
||||||
|
g_value_set_enum (value, color_config->open_behaviour_cmyk_profile);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
/* LIBGIMP - The GIMP Library
|
||||||
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
|
*
|
||||||
|
* GimpColorConfig class
|
||||||
|
* Copyright (C) 2004 Stefan Döhla <stefan@doehla.de>
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the
|
||||||
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
* Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __GIMP_COLOR_CONFIG_H__
|
||||||
|
#define __GIMP_COLOR_CONFIG_H__
|
||||||
|
|
||||||
|
|
||||||
|
#define GIMP_TYPE_COLOR_CONFIG (gimp_color_config_get_type ())
|
||||||
|
#define GIMP_COLOR_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_COLOR_CONFIG, GimpColorConfig))
|
||||||
|
#define GIMP_COLOR_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_COLOR_CONFIG, GimpColorConfigClass))
|
||||||
|
#define GIMP_IS_COLOR_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_COLOR_CONFIG))
|
||||||
|
#define GIMP_IS_COLOR_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_COLOR_CONFIG))
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _GimpColorConfigClass GimpColorConfigClass;
|
||||||
|
typedef struct _GimpColorConfig GimpColorConfig;
|
||||||
|
|
||||||
|
struct _GimpColorConfig
|
||||||
|
{
|
||||||
|
GObject parent_instance;
|
||||||
|
|
||||||
|
GimpColorManagementMode mode;
|
||||||
|
gchar *profile_path;
|
||||||
|
gchar *rgb_profile;
|
||||||
|
gchar *cmyk_profile;
|
||||||
|
gchar *display_profile;
|
||||||
|
gchar *printer_profile;
|
||||||
|
GimpColorRenderingIntent display_rendering_intent;
|
||||||
|
GimpColorRenderingIntent simulation_rendering_intent;
|
||||||
|
GimpColorFileOpenBehaviour open_behaviour_no_profile;
|
||||||
|
GimpColorFileOpenBehaviour open_behaviour_rgb_profile;
|
||||||
|
GimpColorFileOpenBehaviour open_behaviour_cmyk_profile;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _GimpColorConfigClass
|
||||||
|
{
|
||||||
|
GObjectClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
GType gimp_color_config_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* GIMP_COLOR_CONFIG_H__ */
|
Loading…
Reference in New Issue