Commit 21fea37d authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

modules/cdisplay_gamma.c added object properties for configurable values.

2004-07-04  Sven Neumann  <sven@gimp.org>

	* modules/cdisplay_gamma.c
	* modules/cdisplay_highcontrast.c: added object properties for
	configurable values.

	* app/widgets/gimpcolordisplayeditor.c
	* libgimpwidgets/gimpcolordisplaystack.c
	* modules/cdisplay_colorblind.c
	* modules/cdisplay_proof.c: cosmetic changes.
parent 23f6a194
2004-07-04 Sven Neumann <sven@gimp.org>
* modules/cdisplay_gamma.c
* modules/cdisplay_highcontrast.c: added object properties for
configurable values.
* app/widgets/gimpcolordisplayeditor.c
* libgimpwidgets/gimpcolordisplaystack.c
* modules/cdisplay_colorblind.c
* modules/cdisplay_proof.c: cosmetic changes.
2004-07-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpcontext.[ch]: added context->serialize_props mask
......
......@@ -129,9 +129,7 @@ gimp_color_display_editor_get_type (void)
static void
gimp_color_display_editor_class_init (GimpColorDisplayEditorClass *klass)
{
GtkObjectClass *object_class;
object_class = GTK_OBJECT_CLASS (klass);
GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
......@@ -723,9 +721,7 @@ gimp_color_display_editor_enabled (GimpColorDisplay *display,
if (display == display2)
{
gboolean enabled;
enabled = gimp_color_display_get_enabled (display);
gboolean enabled = gimp_color_display_get_enabled (display);
gtk_list_store_set (editor->dest, &iter,
DEST_COLUMN_ENABLED, enabled,
......@@ -741,11 +737,9 @@ gimp_color_display_editor_enable_toggled (GtkCellRendererToggle *toggle,
const gchar *path_str,
GimpColorDisplayEditor *editor)
{
GtkTreePath *path;
GtkTreePath *path = gtk_tree_path_new_from_string (path_str);
GtkTreeIter iter;
path = gtk_tree_path_new_from_string (path_str);
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (editor->dest), &iter, path))
{
GimpColorDisplay *display;
......@@ -774,11 +768,8 @@ gimp_color_display_editor_update_buttons (GimpColorDisplayEditor *editor)
if (gtk_tree_selection_get_selected (editor->dest_sel, &model, &iter))
{
GtkTreePath *path;
gint *indices;
path = gtk_tree_model_get_path (model, &iter);
indices = gtk_tree_path_get_indices (path);
GtkTreePath *path = gtk_tree_model_get_path (model, &iter);
gint *indices = gtk_tree_path_get_indices (path);
up_sensitive = indices[0] > 0;
down_sensitive = indices[0] < (g_list_length (editor->stack->filters) - 1);
......
......@@ -91,9 +91,7 @@ gimp_color_display_stack_get_type (void)
static void
gimp_color_display_stack_class_init (GimpColorDisplayStackClass *klass)
{
GObjectClass *object_class;
object_class = G_OBJECT_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
......@@ -170,11 +168,7 @@ gimp_color_display_stack_finalize (GObject *object)
GimpColorDisplayStack *
gimp_color_display_stack_new (void)
{
GimpColorDisplayStack *stack;
stack = g_object_new (GIMP_TYPE_COLOR_DISPLAY_STACK, NULL);
return stack;
return g_object_new (GIMP_TYPE_COLOR_DISPLAY_STACK, NULL);
}
GimpColorDisplayStack *
......
......@@ -97,7 +97,7 @@ static GType cdisplay_colorblind_get_type (GTypeModule *module);
static void cdisplay_colorblind_class_init (CdisplayColorblindClass *klass);
static void cdisplay_colorblind_init (CdisplayColorblind *colorblind);
static void cdisplay_colorblind_finalize (GObject *object);
static void cdisplay_colorblind_dispose (GObject *object);
static GimpColorDisplay * cdisplay_colorblind_clone (GimpColorDisplay *display);
static void cdisplay_colorblind_convert (GimpColorDisplay *display,
......@@ -177,15 +177,12 @@ cdisplay_colorblind_get_type (GTypeModule *module)
static void
cdisplay_colorblind_class_init (CdisplayColorblindClass *klass)
{
GObjectClass *object_class;
GimpColorDisplayClass *display_class;
object_class = G_OBJECT_CLASS (klass);
display_class = GIMP_COLOR_DISPLAY_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpColorDisplayClass *display_class = GIMP_COLOR_DISPLAY_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = cdisplay_colorblind_finalize;
object_class->dispose = cdisplay_colorblind_dispose;
display_class->name = _("Color Deficient Vision");
display_class->help_id = "gimp-colordisplay-colorblind";
......@@ -255,14 +252,14 @@ cdisplay_colorblind_init (CdisplayColorblind *colorblind)
}
static void
cdisplay_colorblind_finalize (GObject *object)
cdisplay_colorblind_dispose (GObject *object)
{
CdisplayColorblind *colorblind = CDISPLAY_COLORBLIND (object);
if (colorblind->hbox)
gtk_widget_destroy (colorblind->hbox);
G_OBJECT_CLASS (parent_class)->finalize (object);
G_OBJECT_CLASS (parent_class)->dispose (object);
}
......@@ -287,7 +284,7 @@ cdisplay_colorblind_convert (GimpColorDisplay *display,
gint bpp,
gint bpl)
{
CdisplayColorblind *colorblind;
CdisplayColorblind *colorblind = CDISPLAY_COLORBLIND (display);
guchar *b;
gfloat rgb2lms[9],lms2rgb[9];
gfloat a1, b1, c1, a2, b2, c2;
......@@ -299,8 +296,6 @@ cdisplay_colorblind_convert (GimpColorDisplay *display,
if (bpp != 3)
return;
colorblind = CDISPLAY_COLORBLIND (display);
/* to improve readability, copy the parameters into local variables */
memcpy (rgb2lms, colorblind->rgb2lms, sizeof (rgb2lms));
memcpy (lms2rgb, colorblind->lms2rgb, sizeof (lms2rgb));
......
......@@ -48,7 +48,7 @@ struct _CdisplayGamma
GimpColorDisplay parent_instance;
gdouble gamma;
guchar *lookup;
guchar lookup[256];
GtkWidget *hbox;
GtkObject *adjustment;
......@@ -60,11 +60,25 @@ struct _CdisplayGammaClass
};
static GType cdisplay_gamma_get_type (GTypeModule *module);
static void cdisplay_gamma_class_init (CdisplayGammaClass *klass);
static void cdisplay_gamma_init (CdisplayGamma *gamma);
enum
{
PROP_0,
PROP_GAMMA
};
static GType cdisplay_gamma_get_type (GTypeModule *module);
static void cdisplay_gamma_class_init (CdisplayGammaClass *klass);
static void cdisplay_gamma_finalize (GObject *object);
static void cdisplay_gamma_dispose (GObject *object);
static void cdisplay_gamma_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void cdisplay_gamma_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static GimpColorDisplay * cdisplay_gamma_clone (GimpColorDisplay *display);
static void cdisplay_gamma_convert (GimpColorDisplay *display,
......@@ -79,8 +93,9 @@ static GimpParasite * cdisplay_gamma_save_state (GimpColorDisplay *display);
static GtkWidget * cdisplay_gamma_configure (GimpColorDisplay *display);
static void cdisplay_gamma_configure_reset (GimpColorDisplay *display);
static void gamma_create_lookup_table (CdisplayGamma *gamma);
static void gamma_configure_adj_callback (GtkAdjustment *adj,
static void cdisplay_gamma_set_gamma (CdisplayGamma *gamma,
gdouble value);
static void cdisplay_gamma_adj_callback (GtkAdjustment *adj,
CdisplayGamma *gamma);
......@@ -120,14 +135,14 @@ cdisplay_gamma_get_type (GTypeModule *module)
static const GTypeInfo display_info =
{
sizeof (CdisplayGammaClass),
(GBaseInitFunc) NULL,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) cdisplay_gamma_class_init,
(GClassInitFunc) cdisplay_gamma_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (CdisplayGamma),
0, /* n_preallocs */
(GInstanceInitFunc) cdisplay_gamma_init,
NULL /* instance_init */
};
cdisplay_gamma_type =
......@@ -143,15 +158,21 @@ cdisplay_gamma_get_type (GTypeModule *module)
static void
cdisplay_gamma_class_init (CdisplayGammaClass *klass)
{
GObjectClass *object_class;
GimpColorDisplayClass *display_class;
object_class = G_OBJECT_CLASS (klass);
display_class = GIMP_COLOR_DISPLAY_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpColorDisplayClass *display_class = GIMP_COLOR_DISPLAY_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = cdisplay_gamma_finalize;
object_class->dispose = cdisplay_gamma_dispose;
object_class->get_property = cdisplay_gamma_get_property;
object_class->set_property = cdisplay_gamma_set_property;
g_object_class_install_property (object_class, PROP_GAMMA,
g_param_spec_double ("gamma", NULL, NULL,
0.01, 10.0,
DEFAULT_GAMMA,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
display_class->name = _("Gamma");
display_class->help_id = "gimp-colordisplay-gamma";
......@@ -164,34 +185,53 @@ cdisplay_gamma_class_init (CdisplayGammaClass *klass)
}
static void
cdisplay_gamma_init (CdisplayGamma *gamma)
cdisplay_gamma_dispose (GObject *object)
{
gint i;
CdisplayGamma *gamma = CDISPLAY_GAMMA (object);
gamma->gamma = DEFAULT_GAMMA;
gamma->lookup = g_new (guchar, 256);
if (gamma->hbox)
gtk_widget_destroy (gamma->hbox);
for (i = 0; i < 256; i++)
gamma->lookup[i] = i;
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
cdisplay_gamma_finalize (GObject *object)
cdisplay_gamma_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
CdisplayGamma *gamma = CDISPLAY_GAMMA (object);
if (gamma->hbox)
gtk_widget_destroy (gamma->hbox);
if (gamma->lookup)
switch (property_id)
{
g_free (gamma->lookup);
gamma->lookup = NULL;
case PROP_GAMMA:
g_value_set_double (value, gamma->gamma);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
cdisplay_gamma_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
CdisplayGamma *gamma = CDISPLAY_GAMMA (object);
switch (property_id)
{
case PROP_GAMMA:
cdisplay_gamma_set_gamma (gamma, g_value_get_double (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static GimpColorDisplay *
cdisplay_gamma_clone (GimpColorDisplay *display)
......@@ -249,10 +289,10 @@ static void
cdisplay_gamma_load_state (GimpColorDisplay *display,
GimpParasite *state)
{
CdisplayGamma *gamma = CDISPLAY_GAMMA (display);
gdouble value;
#if G_BYTE_ORDER == G_BIG_ENDIAN
memcpy (&gamma->gamma, gimp_parasite_data (state), sizeof (gdouble));
memcpy (&value, gimp_parasite_data (state), sizeof (gdouble));
#else
{
guint32 buf[2];
......@@ -263,11 +303,11 @@ cdisplay_gamma_load_state (GimpColorDisplay *display,
buf[0] = g_ntohl (data[1]);
buf[1] = g_ntohl (data[0]);
memcpy (&gamma->gamma, buf, sizeof (gdouble));
memcpy (&value, buf, sizeof (gdouble));
}
#endif
gamma_create_lookup_table (gamma);
cdisplay_gamma_set_gamma (CDISPLAY_GAMMA (display), value);
}
static GimpParasite *
......@@ -321,7 +361,7 @@ cdisplay_gamma_configure (GimpColorDisplay *display)
gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinbutton);
g_signal_connect (gamma->adjustment, "value_changed",
G_CALLBACK (gamma_configure_adj_callback),
G_CALLBACK (cdisplay_gamma_adj_callback),
gamma);
return gamma->hbox;
......@@ -333,35 +373,39 @@ cdisplay_gamma_configure_reset (GimpColorDisplay *display)
CdisplayGamma *gamma = CDISPLAY_GAMMA (display);
if (gamma->adjustment)
gtk_adjustment_set_value (GTK_ADJUSTMENT (gamma->adjustment), DEFAULT_GAMMA);
gtk_adjustment_set_value (GTK_ADJUSTMENT (gamma->adjustment),
DEFAULT_GAMMA);
}
static void
gamma_create_lookup_table (CdisplayGamma *gamma)
cdisplay_gamma_set_gamma (CdisplayGamma *gamma,
gdouble value)
{
gdouble one_over_gamma;
gdouble ind;
gint i;
if (value <= 0.0)
value = 1.0;
if (gamma->gamma == 0.0)
gamma->gamma = 1.0;
if (value != gamma->gamma)
{
gdouble one_over_gamma = 1.0 / value;
gint i;
one_over_gamma = 1.0 / gamma->gamma;
gamma->gamma = value;
for (i = 0; i < 256; i++)
{
ind = (gdouble) i / 255.0;
gamma->lookup[i] = (guchar) (gint) (255 * pow (ind, one_over_gamma));
for (i = 0; i < 256; i++)
{
gdouble ind = (gdouble) i / 255.0;
gamma->lookup[i] = (guchar) (gint) (255 * pow (ind, one_over_gamma));
}
g_object_notify (G_OBJECT (gamma), "gamma");
gimp_color_display_changed (GIMP_COLOR_DISPLAY (gamma));
}
}
static void
gamma_configure_adj_callback (GtkAdjustment *adj,
CdisplayGamma *gamma)
cdisplay_gamma_adj_callback (GtkAdjustment *adj,
CdisplayGamma *gamma)
{
gamma->gamma = adj->value;
gamma_create_lookup_table (gamma);
gimp_color_display_changed (GIMP_COLOR_DISPLAY (gamma));
cdisplay_gamma_set_gamma (gamma, adj->value);
}
......@@ -30,7 +30,7 @@
#include "libgimp/libgimp-intl.h"
#define DEFAULT_CONTRAST 4.0
#define DEFAULT_CONTRAST 1.0
#define CDISPLAY_TYPE_CONTRAST (cdisplay_contrast_type)
......@@ -48,7 +48,7 @@ struct _CdisplayContrast
GimpColorDisplay parent_instance;
gdouble contrast;
guchar *lookup;
guchar lookup[256];
GtkWidget *hbox;
GtkObject *adjustment;
......@@ -60,28 +60,43 @@ struct _CdisplayContrastClass
};
static GType cdisplay_contrast_get_type (GTypeModule *module);
static void cdisplay_contrast_class_init (CdisplayContrastClass *klass);
static void cdisplay_contrast_init (CdisplayContrast *contrast);
enum
{
PROP_0,
PROP_CONTRAST
};
static GType cdisplay_contrast_get_type (GTypeModule *module);
static void cdisplay_contrast_class_init (CdisplayContrastClass *klass);
static void cdisplay_contrast_finalize (GObject *object);
static void cdisplay_contrast_dispose (GObject *object);
static void cdisplay_contrast_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void cdisplay_contrast_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static GimpColorDisplay * cdisplay_contrast_clone (GimpColorDisplay *display);
static void cdisplay_contrast_convert (GimpColorDisplay *display,
guchar *buf,
gint w,
gint h,
gint bpp,
gint bpl);
guchar *buf,
gint w,
gint h,
gint bpp,
gint bpl);
static void cdisplay_contrast_load_state (GimpColorDisplay *display,
GimpParasite *state);
GimpParasite *state);
static GimpParasite * cdisplay_contrast_save_state (GimpColorDisplay *display);
static GtkWidget * cdisplay_contrast_configure (GimpColorDisplay *display);
static void cdisplay_contrast_configure_reset (GimpColorDisplay *display);
static void contrast_create_lookup_table (CdisplayContrast *contrast);
static void contrast_configure_adj_callback (GtkAdjustment *adj,
CdisplayContrast *contrast);
static void cdisplay_contrast_set_contrast (CdisplayContrast *contrast,
gdouble value);
static void cdisplay_contrast_adj_callback (GtkAdjustment *adj,
CdisplayContrast *contrast);
static const GimpModuleInfo cdisplay_contrast_info =
......@@ -127,7 +142,7 @@ cdisplay_contrast_get_type (GTypeModule *module)
NULL, /* class_data */
sizeof (CdisplayContrast),
0, /* n_preallocs */
(GInstanceInitFunc) cdisplay_contrast_init,
NULL /* instance_init */
};
cdisplay_contrast_type =
......@@ -143,15 +158,21 @@ cdisplay_contrast_get_type (GTypeModule *module)
static void
cdisplay_contrast_class_init (CdisplayContrastClass *klass)
{
GObjectClass *object_class;
GimpColorDisplayClass *display_class;
object_class = G_OBJECT_CLASS (klass);
display_class = GIMP_COLOR_DISPLAY_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpColorDisplayClass *display_class = GIMP_COLOR_DISPLAY_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = cdisplay_contrast_finalize;
object_class->dispose = cdisplay_contrast_dispose;
object_class->get_property = cdisplay_contrast_get_property;
object_class->set_property = cdisplay_contrast_set_property;
g_object_class_install_property (object_class, PROP_CONTRAST,
g_param_spec_double ("contrast", NULL, NULL,
0.01, 10.0,
DEFAULT_CONTRAST,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
display_class->name = _("Contrast");
display_class->help_id = "gimp-colordisplay-contrast";
......@@ -164,31 +185,53 @@ cdisplay_contrast_class_init (CdisplayContrastClass *klass)
}
static void
cdisplay_contrast_init (CdisplayContrast *contrast)
cdisplay_contrast_dispose (GObject *object)
{
contrast->contrast = DEFAULT_CONTRAST;
contrast->lookup = g_new (guchar, 256);
CdisplayContrast *contrast = CDISPLAY_CONTRAST (object);
contrast_create_lookup_table (contrast);
if (contrast->hbox)
gtk_widget_destroy (contrast->hbox);
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
cdisplay_contrast_finalize (GObject *object)
cdisplay_contrast_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
CdisplayContrast *contrast = CDISPLAY_CONTRAST (object);
if (contrast->hbox)
gtk_widget_destroy (contrast->hbox);
if (contrast->lookup)
switch (property_id)
{
g_free (contrast->lookup);
contrast->lookup = NULL;
case PROP_CONTRAST:
g_value_set_double (value, contrast->contrast);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
cdisplay_contrast_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
CdisplayContrast *contrast = CDISPLAY_CONTRAST (object);
switch (property_id)
{
case PROP_CONTRAST:
cdisplay_contrast_set_contrast (contrast, g_value_get_double (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static GimpColorDisplay *
cdisplay_contrast_clone (GimpColorDisplay *display)
......@@ -246,10 +289,10 @@ static void
cdisplay_contrast_load_state (GimpColorDisplay *display,
GimpParasite *state)
{
CdisplayContrast *contrast = CDISPLAY_CONTRAST (display);
gdouble value;
#if G_BYTE_ORDER == G_BIG_ENDIAN
memcpy (&contrast->contrast, gimp_parasite_data (state), sizeof (gdouble));
memcpy (&value, gimp_parasite_data (state), sizeof (gdouble));
#else
{
guint32 buf[2];
......@@ -260,11 +303,11 @@ cdisplay_contrast_load_state (GimpColorDisplay *display,
buf[0] = g_ntohl (data[1]);
buf[1] = g_ntohl (data[0]);
memcpy (&contrast->contrast, buf, sizeof (gdouble));
memcpy (&value, buf, sizeof (gdouble));
}
#endif
contrast_create_lookup_table (contrast);
cdisplay_contrast_set_contrast (CDISPLAY_CONTRAST (display), value);
}
static GimpParasite *
......@@ -319,7 +362,7 @@ cdisplay_contrast_configure (GimpColorDisplay *display)
gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinbutton);
g_signal_connect (contrast->adjustment, "value_changed",
G_CALLBACK (contrast_configure_adj_callback),
G_CALLBACK (cdisplay_contrast_adj_callback),
contrast);
return contrast->hbox;
......@@ -328,9 +371,7 @@ cdisplay_contrast_configure (GimpColorDisplay *display)
static void
cdisplay_contrast_configure_reset (GimpColorDisplay *display)
{
CdisplayContrast *contrast;
contrast = CDISPLAY_CONTRAST (display);
CdisplayContrast *contrast = CDISPLAY_CONTRAST (display);
if (contrast->adjustment)
gtk_adjustment_set_value (GTK_ADJUSTMENT (contrast->adjustment),
......@@ -338,27 +379,32 @@ cdisplay_contrast_configure_reset (GimpColorDisplay *display)
}
static void
contrast_create_lookup_table (CdisplayContrast *contrast)
cdisplay_contrast_set_contrast (CdisplayContrast *contrast,
gdouble value)
{
gint i;
if (contrast->contrast == 0.0)
contrast->contrast = 1.0;
if (value <= 0.0)
value = 1.0;
for (i = 0; i < 256; i++)
if (value != contrast->contrast)
{
contrast->lookup[i] = (guchar) (gint)
(255 * .5 * (1 + sin (contrast->contrast * 2 * G_PI * i / 255.0)));
gint i;
contrast->contrast = value;
for (i = 0; i < 256; i++)
{
contrast->lookup[i] = (guchar) (gint)
(255 * .5 * (1 + sin (value * 2 * G_PI * i / 255.0)));
}
g_object_notify (G_OBJECT (contrast), "contrast");
gimp_color_display_changed (GIMP_COLOR_DISPLAY (contrast));
}
}
static void
contrast_configure_adj_callback (GtkAdjustment *adj,
CdisplayContrast *contrast)
cdisplay_contrast_adj_callback (GtkAdjustment *adj,
CdisplayContrast *contrast)
{
contrast->contrast = adj->value;
contrast_create_lookup_table (contrast);
gimp_color_display_changed (GIMP_COLOR_DISPLAY (contrast));
cdisplay_contrast_set_contrast (contrast, adj->value);
}
......@@ -71,6 +71,7 @@ static GType cdisplay_proof_get_type (GTypeModule *module);
static void cdisplay_proof_class_init (CdisplayProofClass *klass);
static void cdisplay_proof_init (CdisplayProof *proof);
static void cdisplay_proof_dispose (GObject *object);
static void cdisplay_proof_finalize (GObject *object);
static GimpColorDisplay * cdisplay_proof_clone (GimpColorDisplay *display);
......@@ -153,15 +154,13 @@ cdisplay_proof_get_type (GTypeModule *module)
static void
cdisplay_proof_class_init (CdisplayProofClass *klass)
{
GObjectClass *object_class;
GimpColorDisplayClass *display_class;
object_class = G_OBJECT_CLASS (klass);
display_class = GIMP_COLOR_DISPLAY_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpColorDisplayClass *display_class = GIMP_COLOR_DISPLAY_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = cdisplay_proof_finalize;
object_class->dispose = cdisplay_proof_dispose;
object_class->finalize = cdisplay_proof_finalize;
display_class->name = _("Color Proof");
display_class->help_id = "gimp-colordisplay-proof";
......@@ -189,13 +188,21 @@ cdisplay_proof_init (CdisplayProof *proof)
}
static void
cdisplay_proof_finalize (GObject *object)
cdisplay_proof_dispose (GObject *object)
{
CdisplayProof *proof = CDISPLAY_PROOF (object);
if (proof->table)
gtk_widget_destroy (proof->table);
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
cdisplay_proof_finalize (GObject *object)
{
CdisplayProof *proof = CDISPLAY_PROOF (object);
if (proof->filename)
{
g_free (proof->filename);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment