2003-11-19 07:44:35 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
2002-10-20 18:14:17 +08:00
|
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
|
|
|
*
|
|
|
|
* gimpcolordisplay.c
|
|
|
|
* Copyright (C) 2002 Michael Natterer <mitch@gimp.org>
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
2003-11-23 21:28:15 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2002-10-20 18:14:17 +08:00
|
|
|
*
|
2003-11-23 21:28:15 +08:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
2002-10-20 18:14:17 +08:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2003-11-23 21:28:15 +08:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2002-10-20 18:14:17 +08:00
|
|
|
*
|
2003-11-23 21:28:15 +08:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
2002-10-20 18:14:17 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2005-02-06 05:51:47 +08:00
|
|
|
#include <string.h>
|
|
|
|
|
2002-10-20 18:14:17 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2005-02-06 05:51:47 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2002-10-20 18:14:17 +08:00
|
|
|
#include "libgimpcolor/gimpcolor.h"
|
2005-02-06 05:16:22 +08:00
|
|
|
#include "libgimpconfig/gimpconfig.h"
|
2002-10-20 18:14:17 +08:00
|
|
|
|
|
|
|
#include "gimpwidgetstypes.h"
|
|
|
|
|
2006-10-02 01:31:42 +08:00
|
|
|
#include "gimpstock.h"
|
2002-10-20 18:14:17 +08:00
|
|
|
|
2007-08-07 06:10:09 +08:00
|
|
|
#undef GIMP_DISABLE_DEPRECATED
|
|
|
|
#include "gimpcolordisplay.h"
|
|
|
|
|
2002-10-20 18:14:17 +08:00
|
|
|
|
2003-11-23 21:08:56 +08:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
2007-08-07 06:10:09 +08:00
|
|
|
PROP_ENABLED,
|
|
|
|
PROP_COLOR_CONFIG,
|
|
|
|
PROP_COLOR_MANAGED
|
2003-11-23 21:08:56 +08:00
|
|
|
};
|
|
|
|
|
2002-10-23 22:55:07 +08:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
CHANGED,
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2007-08-07 06:10:09 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GimpColorConfig *config;
|
|
|
|
GimpColorManaged *managed;
|
|
|
|
} GimpColorDisplayPrivate;
|
|
|
|
|
|
|
|
#define GIMP_COLOR_DISPLAY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GIMP_TYPE_COLOR_DISPLAY, GimpColorDisplayPrivate))
|
|
|
|
|
|
|
|
static GObject * gimp_color_display_constructor (GType type,
|
|
|
|
guint n_params,
|
|
|
|
GObjectConstructParam *params);
|
2007-08-08 20:27:11 +08:00
|
|
|
static void gimp_color_display_dispose (GObject *object);
|
2007-08-07 06:10:09 +08:00
|
|
|
static void gimp_color_display_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gimp_color_display_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
|
|
|
|
static void gimp_color_display_set_color_config (GimpColorDisplay *display,
|
|
|
|
GimpColorConfig *config);
|
|
|
|
static void gimp_color_display_set_color_managed (GimpColorDisplay *display,
|
|
|
|
GimpColorManaged *managed);
|
2002-10-20 18:14:17 +08:00
|
|
|
|
|
|
|
|
2005-12-21 04:35:23 +08:00
|
|
|
G_DEFINE_TYPE_WITH_CODE (GimpColorDisplay, gimp_color_display, G_TYPE_OBJECT,
|
2006-05-15 17:46:31 +08:00
|
|
|
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG, NULL))
|
2002-10-20 18:14:17 +08:00
|
|
|
|
2005-12-21 04:35:23 +08:00
|
|
|
#define parent_class gimp_color_display_parent_class
|
2002-10-23 22:55:07 +08:00
|
|
|
|
2005-12-21 04:35:23 +08:00
|
|
|
static guint display_signals[LAST_SIGNAL] = { 0 };
|
2002-10-20 18:14:17 +08:00
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_color_display_class_init (GimpColorDisplayClass *klass)
|
|
|
|
{
|
2003-11-23 21:08:56 +08:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
|
2007-08-07 06:10:09 +08:00
|
|
|
object_class->constructor = gimp_color_display_constructor;
|
2007-08-08 20:27:11 +08:00
|
|
|
object_class->dispose = gimp_color_display_dispose;
|
2003-11-23 21:08:56 +08:00
|
|
|
object_class->set_property = gimp_color_display_set_property;
|
|
|
|
object_class->get_property = gimp_color_display_get_property;
|
|
|
|
|
2007-08-07 06:10:09 +08:00
|
|
|
g_type_class_add_private (object_class, sizeof (GimpColorDisplayPrivate));
|
|
|
|
|
2003-11-23 21:08:56 +08:00
|
|
|
g_object_class_install_property (object_class, PROP_ENABLED,
|
|
|
|
g_param_spec_boolean ("enabled", NULL, NULL,
|
|
|
|
TRUE,
|
2006-01-31 00:10:56 +08:00
|
|
|
GIMP_PARAM_READWRITE |
|
2003-11-23 21:08:56 +08:00
|
|
|
G_PARAM_CONSTRUCT));
|
2007-08-07 06:10:09 +08:00
|
|
|
g_object_class_install_property (object_class, PROP_COLOR_CONFIG,
|
|
|
|
g_param_spec_object ("color-config",
|
|
|
|
NULL, NULL,
|
|
|
|
GIMP_TYPE_COLOR_CONFIG,
|
|
|
|
GIMP_PARAM_READWRITE |
|
|
|
|
G_PARAM_CONSTRUCT_ONLY));
|
|
|
|
g_object_class_install_property (object_class, PROP_COLOR_MANAGED,
|
|
|
|
g_param_spec_object ("color-managed",
|
|
|
|
NULL, NULL,
|
|
|
|
GIMP_TYPE_COLOR_MANAGED,
|
|
|
|
GIMP_PARAM_READWRITE |
|
|
|
|
G_PARAM_CONSTRUCT_ONLY));
|
2002-10-23 22:55:07 +08:00
|
|
|
display_signals[CHANGED] =
|
|
|
|
g_signal_new ("changed",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpColorDisplayClass, changed),
|
|
|
|
NULL, NULL,
|
|
|
|
g_cclosure_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
2003-11-19 07:44:35 +08:00
|
|
|
klass->name = "Unnamed";
|
|
|
|
klass->help_id = NULL;
|
2006-10-02 01:31:42 +08:00
|
|
|
klass->stock_id = GIMP_STOCK_DISPLAY_FILTER;
|
2002-12-19 20:04:39 +08:00
|
|
|
|
2002-10-23 22:55:07 +08:00
|
|
|
klass->clone = NULL;
|
|
|
|
klass->convert = NULL;
|
|
|
|
klass->load_state = NULL;
|
|
|
|
klass->save_state = NULL;
|
|
|
|
klass->configure = NULL;
|
|
|
|
klass->configure_reset = NULL;
|
2002-12-19 20:04:39 +08:00
|
|
|
klass->changed = NULL;
|
2002-10-20 18:14:17 +08:00
|
|
|
}
|
|
|
|
|
2005-12-21 04:35:23 +08:00
|
|
|
static void
|
|
|
|
gimp_color_display_init (GimpColorDisplay *display)
|
|
|
|
{
|
2007-08-07 06:10:09 +08:00
|
|
|
display->enabled = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GObject *
|
|
|
|
gimp_color_display_constructor (GType type,
|
|
|
|
guint n_params,
|
|
|
|
GObjectConstructParam *params)
|
|
|
|
{
|
|
|
|
GObject *object;
|
|
|
|
|
|
|
|
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
|
|
|
|
|
|
|
|
/* emit an initial "changed" signal after all construct properties are set */
|
|
|
|
gimp_color_display_changed (GIMP_COLOR_DISPLAY (object));
|
|
|
|
|
|
|
|
return object;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2007-08-08 20:27:11 +08:00
|
|
|
gimp_color_display_dispose (GObject *object)
|
2007-08-07 06:10:09 +08:00
|
|
|
{
|
|
|
|
GimpColorDisplayPrivate *private = GIMP_COLOR_DISPLAY_GET_PRIVATE (object);
|
|
|
|
|
|
|
|
if (private->config)
|
|
|
|
{
|
|
|
|
g_signal_handlers_disconnect_by_func (private->config,
|
|
|
|
gimp_color_display_changed,
|
|
|
|
object);
|
|
|
|
g_object_unref (private->config);
|
|
|
|
private->config = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (private->managed)
|
|
|
|
{
|
|
|
|
g_signal_handlers_disconnect_by_func (private->managed,
|
|
|
|
gimp_color_display_changed,
|
|
|
|
object);
|
|
|
|
g_object_unref (private->managed);
|
|
|
|
private->managed = NULL;
|
|
|
|
}
|
|
|
|
|
2007-08-08 20:27:11 +08:00
|
|
|
G_OBJECT_CLASS (parent_class)->dispose (object);
|
2005-12-21 04:35:23 +08:00
|
|
|
}
|
|
|
|
|
2002-10-20 18:14:17 +08:00
|
|
|
static void
|
2003-11-23 21:08:56 +08:00
|
|
|
gimp_color_display_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GimpColorDisplay *display = GIMP_COLOR_DISPLAY (object);
|
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
|
|
|
case PROP_ENABLED:
|
|
|
|
display->enabled = g_value_get_boolean (value);
|
|
|
|
break;
|
2007-08-07 06:10:09 +08:00
|
|
|
|
|
|
|
case PROP_COLOR_CONFIG:
|
|
|
|
gimp_color_display_set_color_config (display,
|
|
|
|
g_value_get_object (value));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_COLOR_MANAGED:
|
|
|
|
gimp_color_display_set_color_managed (display,
|
|
|
|
g_value_get_object (value));
|
|
|
|
break;
|
|
|
|
|
2003-11-23 21:08:56 +08:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_color_display_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
2002-10-20 18:14:17 +08:00
|
|
|
{
|
2003-11-23 21:08:56 +08:00
|
|
|
GimpColorDisplay *display = GIMP_COLOR_DISPLAY (object);
|
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
|
|
|
case PROP_ENABLED:
|
|
|
|
g_value_set_boolean (value, display->enabled);
|
|
|
|
break;
|
2007-08-07 06:10:09 +08:00
|
|
|
|
|
|
|
case PROP_COLOR_CONFIG:
|
|
|
|
g_value_set_object (value,
|
|
|
|
GIMP_COLOR_DISPLAY_GET_PRIVATE (display)->config);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_COLOR_MANAGED:
|
|
|
|
g_value_set_object (value,
|
|
|
|
GIMP_COLOR_DISPLAY_GET_PRIVATE (display)->managed);
|
|
|
|
break;
|
|
|
|
|
2003-11-23 21:08:56 +08:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
2002-10-20 18:14:17 +08:00
|
|
|
}
|
|
|
|
|
2007-08-07 06:10:09 +08:00
|
|
|
static void
|
|
|
|
gimp_color_display_set_color_config (GimpColorDisplay *display,
|
|
|
|
GimpColorConfig *config)
|
|
|
|
{
|
|
|
|
GimpColorDisplayPrivate *private = GIMP_COLOR_DISPLAY_GET_PRIVATE (display);
|
|
|
|
|
|
|
|
g_return_if_fail (private->config == NULL);
|
|
|
|
|
|
|
|
if (config)
|
|
|
|
{
|
|
|
|
private->config = g_object_ref (config);
|
|
|
|
|
|
|
|
g_signal_connect_swapped (private->config, "notify",
|
|
|
|
G_CALLBACK (gimp_color_display_changed),
|
|
|
|
display);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_color_display_set_color_managed (GimpColorDisplay *display,
|
|
|
|
GimpColorManaged *managed)
|
|
|
|
{
|
|
|
|
GimpColorDisplayPrivate *private = GIMP_COLOR_DISPLAY_GET_PRIVATE (display);
|
|
|
|
|
|
|
|
g_return_if_fail (private->managed == NULL);
|
|
|
|
|
|
|
|
if (managed)
|
|
|
|
{
|
|
|
|
private->managed = g_object_ref (managed);
|
|
|
|
|
|
|
|
g_signal_connect_swapped (private->managed, "profile-changed",
|
|
|
|
G_CALLBACK (gimp_color_display_changed),
|
|
|
|
display);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_color_display_new:
|
|
|
|
* @display_type: the GType of the GimpColorDisplay to instantiate.
|
|
|
|
*
|
|
|
|
* This function is deprecated. Please use g_object_new() directly.
|
|
|
|
*
|
|
|
|
* Return value: a new %GimpColorDisplay object.
|
|
|
|
**/
|
2002-10-20 18:14:17 +08:00
|
|
|
GimpColorDisplay *
|
|
|
|
gimp_color_display_new (GType display_type)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (g_type_is_a (display_type, GIMP_TYPE_COLOR_DISPLAY),
|
|
|
|
NULL);
|
|
|
|
|
2007-08-07 06:10:09 +08:00
|
|
|
return g_object_new (display_type, NULL);
|
2002-10-20 18:14:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GimpColorDisplay *
|
|
|
|
gimp_color_display_clone (GimpColorDisplay *display)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_COLOR_DISPLAY (display), NULL);
|
|
|
|
|
2005-02-06 05:51:47 +08:00
|
|
|
/* implementing the clone method is deprecated
|
|
|
|
*/
|
2002-10-20 18:14:17 +08:00
|
|
|
if (GIMP_COLOR_DISPLAY_GET_CLASS (display)->clone)
|
2003-11-23 09:56:59 +08:00
|
|
|
{
|
2007-08-07 06:10:09 +08:00
|
|
|
GimpColorDisplay *clone;
|
2003-11-23 09:56:59 +08:00
|
|
|
|
|
|
|
clone = GIMP_COLOR_DISPLAY_GET_CLASS (display)->clone (display);
|
|
|
|
|
|
|
|
if (clone)
|
2007-08-07 06:10:09 +08:00
|
|
|
{
|
|
|
|
GimpColorDisplayPrivate *private;
|
|
|
|
|
|
|
|
private = GIMP_COLOR_DISPLAY_GET_PRIVATE (display);
|
|
|
|
|
|
|
|
g_object_set (clone,
|
|
|
|
"enabled", display->enabled,
|
|
|
|
"color-managed", private->managed,
|
|
|
|
NULL);
|
|
|
|
}
|
2003-11-23 09:56:59 +08:00
|
|
|
|
|
|
|
return clone;
|
|
|
|
}
|
2002-10-20 18:14:17 +08:00
|
|
|
|
2005-02-06 05:51:47 +08:00
|
|
|
return GIMP_COLOR_DISPLAY (gimp_config_duplicate (GIMP_CONFIG (display)));
|
2002-10-20 18:14:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_color_display_convert (GimpColorDisplay *display,
|
|
|
|
guchar *buf,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gint bpp,
|
|
|
|
gint bpl)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_COLOR_DISPLAY (display));
|
|
|
|
|
2003-11-23 07:53:48 +08:00
|
|
|
if (display->enabled && GIMP_COLOR_DISPLAY_GET_CLASS (display)->convert)
|
2002-10-20 18:14:17 +08:00
|
|
|
GIMP_COLOR_DISPLAY_GET_CLASS (display)->convert (display, buf,
|
|
|
|
width, height,
|
|
|
|
bpp, bpl);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_color_display_load_state (GimpColorDisplay *display,
|
|
|
|
GimpParasite *state)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_COLOR_DISPLAY (display));
|
|
|
|
g_return_if_fail (state != NULL);
|
|
|
|
|
2005-02-06 05:51:47 +08:00
|
|
|
/* implementing the load_state method is deprecated
|
|
|
|
*/
|
2002-10-20 18:14:17 +08:00
|
|
|
if (GIMP_COLOR_DISPLAY_GET_CLASS (display)->load_state)
|
2005-02-06 05:51:47 +08:00
|
|
|
{
|
|
|
|
GIMP_COLOR_DISPLAY_GET_CLASS (display)->load_state (display, state);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gimp_config_deserialize_string (GIMP_CONFIG (display),
|
|
|
|
gimp_parasite_data (state),
|
|
|
|
gimp_parasite_data_size (state),
|
|
|
|
NULL, NULL);
|
|
|
|
}
|
2002-10-20 18:14:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GimpParasite *
|
|
|
|
gimp_color_display_save_state (GimpColorDisplay *display)
|
|
|
|
{
|
2005-02-06 05:51:47 +08:00
|
|
|
GimpParasite *parasite;
|
|
|
|
gchar *str;
|
|
|
|
|
2002-10-20 18:14:17 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_COLOR_DISPLAY (display), NULL);
|
|
|
|
|
2005-02-06 05:51:47 +08:00
|
|
|
/* implementing the save_state method is deprecated
|
|
|
|
*/
|
2002-10-20 18:14:17 +08:00
|
|
|
if (GIMP_COLOR_DISPLAY_GET_CLASS (display)->save_state)
|
2005-02-06 05:51:47 +08:00
|
|
|
{
|
|
|
|
return GIMP_COLOR_DISPLAY_GET_CLASS (display)->save_state (display);
|
|
|
|
}
|
2002-10-20 18:14:17 +08:00
|
|
|
|
2005-02-06 05:51:47 +08:00
|
|
|
str = gimp_config_serialize_to_string (GIMP_CONFIG (display), NULL);
|
|
|
|
|
|
|
|
parasite = gimp_parasite_new ("Display/Proof",
|
|
|
|
GIMP_PARASITE_PERSISTENT,
|
|
|
|
strlen (str) + 1, str);
|
|
|
|
g_free (str);
|
|
|
|
|
|
|
|
return parasite;
|
2002-10-20 18:14:17 +08:00
|
|
|
}
|
|
|
|
|
2002-10-23 22:55:07 +08:00
|
|
|
GtkWidget *
|
|
|
|
gimp_color_display_configure (GimpColorDisplay *display)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_COLOR_DISPLAY (display), NULL);
|
|
|
|
|
|
|
|
if (GIMP_COLOR_DISPLAY_GET_CLASS (display)->configure)
|
|
|
|
return GIMP_COLOR_DISPLAY_GET_CLASS (display)->configure (display);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2002-10-20 18:14:17 +08:00
|
|
|
void
|
2002-10-23 22:55:07 +08:00
|
|
|
gimp_color_display_configure_reset (GimpColorDisplay *display)
|
2002-10-20 18:14:17 +08:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_COLOR_DISPLAY (display));
|
|
|
|
|
2005-02-06 05:51:47 +08:00
|
|
|
/* implementing the configure_reset method is deprecated
|
|
|
|
*/
|
2002-10-23 22:55:07 +08:00
|
|
|
if (GIMP_COLOR_DISPLAY_GET_CLASS (display)->configure_reset)
|
2005-02-06 05:51:47 +08:00
|
|
|
{
|
|
|
|
GIMP_COLOR_DISPLAY_GET_CLASS (display)->configure_reset (display);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gimp_config_reset (GIMP_CONFIG (display));
|
|
|
|
}
|
2002-10-20 18:14:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-10-23 22:55:07 +08:00
|
|
|
gimp_color_display_changed (GimpColorDisplay *display)
|
2002-10-20 18:14:17 +08:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_COLOR_DISPLAY (display));
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_emit (display, display_signals[CHANGED], 0);
|
2002-10-20 18:14:17 +08:00
|
|
|
}
|
2003-11-23 20:08:21 +08:00
|
|
|
|
|
|
|
void
|
|
|
|
gimp_color_display_set_enabled (GimpColorDisplay *display,
|
|
|
|
gboolean enabled)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_COLOR_DISPLAY (display));
|
|
|
|
|
|
|
|
if (enabled != display->enabled)
|
|
|
|
{
|
2003-11-23 21:08:56 +08:00
|
|
|
g_object_set (display,
|
|
|
|
"enabled", enabled,
|
|
|
|
NULL);
|
2003-11-23 20:08:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gimp_color_display_get_enabled (GimpColorDisplay *display)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_COLOR_DISPLAY (display), FALSE);
|
|
|
|
|
|
|
|
return display->enabled;
|
|
|
|
}
|
|
|
|
|
2007-08-07 06:10:09 +08:00
|
|
|
/**
|
|
|
|
* gimp_color_display_get_config:
|
|
|
|
* @display:
|
|
|
|
*
|
|
|
|
* Return value: a pointer to the #GimpColorConfig object or %NULL.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
|
|
|
**/
|
|
|
|
GimpColorConfig *
|
|
|
|
gimp_color_display_get_config (GimpColorDisplay *display)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_COLOR_DISPLAY (display), NULL);
|
|
|
|
|
|
|
|
return GIMP_COLOR_DISPLAY_GET_PRIVATE (display)->config;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_color_display_get_managed:
|
|
|
|
* @display:
|
|
|
|
*
|
|
|
|
* Return value: a pointer to the #GimpColorManaged object or %NULL.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
|
|
|
**/
|
|
|
|
GimpColorManaged *
|
|
|
|
gimp_color_display_get_managed (GimpColorDisplay *display)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_COLOR_DISPLAY (display), NULL);
|
|
|
|
|
|
|
|
return GIMP_COLOR_DISPLAY_GET_PRIVATE (display)->managed;
|
|
|
|
}
|