modules/cdisplay_colorblind.c modules/cdisplay_gamma.c

2008-01-09  Michael Natterer  <mitch@gimp.org>

	* modules/cdisplay_colorblind.c
	* modules/cdisplay_gamma.c
	* modules/cdisplay_highcontrast.c
	* modules/cdisplay_lcms.c
	* modules/cdisplay_proof.c
	* modules/colorsel_cmyk.c
	* modules/colorsel_triangle.c
	* modules/colorsel_water.c
	* modules/controller_dx_dinput.c
	* modules/controller_linux_input.c
	* modules/controller_midi.c: use G_DEFINE_DYNAMIC_TYPE() instead
	of boilerplate code.


svn path=/trunk/; revision=24582
This commit is contained in:
Michael Natterer 2008-01-09 22:22:10 +00:00 committed by Michael Natterer
parent 51eca41a8d
commit 24bd2b130b
12 changed files with 248 additions and 506 deletions

View File

@ -1,3 +1,18 @@
2008-01-09 Michael Natterer <mitch@gimp.org>
* modules/cdisplay_colorblind.c
* modules/cdisplay_gamma.c
* modules/cdisplay_highcontrast.c
* modules/cdisplay_lcms.c
* modules/cdisplay_proof.c
* modules/colorsel_cmyk.c
* modules/colorsel_triangle.c
* modules/colorsel_water.c
* modules/controller_dx_dinput.c
* modules/controller_linux_input.c
* modules/controller_midi.c: use G_DEFINE_DYNAMIC_TYPE() instead
of boilerplate code.
2008-01-09 Sven Neumann <sven@gimp.org>
* modules/colorsel_cmyk_lcms.c (colorsel_cmyk_class_init): don't

View File

@ -48,7 +48,7 @@ typedef enum
} ColorblindDeficiency;
#define CDISPLAY_TYPE_COLORBLIND_DEFICIENCY (cdisplay_colorblind_deficiency_type)
static GType cdisplay_colorblind_deficiency_get_type (GTypeModule *module);
static GType cdisplay_colorblind_deficiency_register_type (GTypeModule *module);
static const GEnumValue enum_values[] =
{
@ -76,7 +76,7 @@ static const GimpEnumDesc enum_descs[] =
#define COLOR_CACHE_SIZE 1021
#define CDISPLAY_TYPE_COLORBLIND (cdisplay_colorblind_type)
#define CDISPLAY_TYPE_COLORBLIND (cdisplay_colorblind_get_type ())
#define CDISPLAY_COLORBLIND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CDISPLAY_TYPE_COLORBLIND, CdisplayColorblind))
#define CDISPLAY_COLORBLIND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CDISPLAY_TYPE_COLORBLIND, CdisplayColorblindClass))
#define CDISPLAY_IS_COLORBLIND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CDISPLAY_TYPE_COLORBLIND))
@ -113,9 +113,7 @@ enum
};
static GType cdisplay_colorblind_get_type (GTypeModule *module);
static void cdisplay_colorblind_class_init (CdisplayColorblindClass *klass);
static void cdisplay_colorblind_init (CdisplayColorblind *colorblind);
GType cdisplay_colorblind_get_type (void);
static void cdisplay_colorblind_set_property (GObject *object,
guint property_id,
@ -205,9 +203,11 @@ static const GimpModuleInfo cdisplay_colorblind_info =
"January 22, 2003"
};
static GType cdisplay_colorblind_type = 0;
static GType cdisplay_colorblind_deficiency_type = 0;
static GimpColorDisplayClass *parent_class = NULL;
G_DEFINE_DYNAMIC_TYPE (CdisplayColorblind, cdisplay_colorblind,
GIMP_TYPE_COLOR_DISPLAY)
static GType cdisplay_colorblind_deficiency_type = 0;
G_MODULE_EXPORT const GimpModuleInfo *
@ -219,43 +219,14 @@ gimp_module_query (GTypeModule *module)
G_MODULE_EXPORT gboolean
gimp_module_register (GTypeModule *module)
{
cdisplay_colorblind_get_type (module);
cdisplay_colorblind_deficiency_get_type (module);
cdisplay_colorblind_register_type (module);
cdisplay_colorblind_deficiency_register_type (module);
return TRUE;
}
static GType
cdisplay_colorblind_get_type (GTypeModule *module)
{
if (! cdisplay_colorblind_type)
{
const GTypeInfo display_info =
{
sizeof (CdisplayColorblindClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) cdisplay_colorblind_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (CdisplayColorblind),
0, /* n_preallocs */
(GInstanceInitFunc) cdisplay_colorblind_init,
};
cdisplay_colorblind_type =
g_type_module_register_type (module,
GIMP_TYPE_COLOR_DISPLAY,
"CdisplayColorblind",
&display_info, 0);
}
return cdisplay_colorblind_type;
}
static GType
cdisplay_colorblind_deficiency_get_type (GTypeModule *module)
cdisplay_colorblind_deficiency_register_type (GTypeModule *module)
{
if (! cdisplay_colorblind_deficiency_type)
{
@ -278,8 +249,6 @@ cdisplay_colorblind_class_init (CdisplayColorblindClass *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->get_property = cdisplay_colorblind_get_property;
object_class->set_property = cdisplay_colorblind_set_property;
@ -298,6 +267,11 @@ cdisplay_colorblind_class_init (CdisplayColorblindClass *klass)
display_class->changed = cdisplay_colorblind_changed;
}
static void
cdisplay_colorblind_class_finalize (CdisplayColorblindClass *klass)
{
}
static void
cdisplay_colorblind_init (CdisplayColorblind *colorblind)
{
@ -320,6 +294,7 @@ cdisplay_colorblind_get_property (GObject *object,
case PROP_DEFICIENCY:
g_value_set_enum (value, colorblind->deficiency);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@ -340,6 +315,7 @@ cdisplay_colorblind_set_property (GObject *object,
cdisplay_colorblind_set_deficiency (colorblind,
g_value_get_enum (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;

View File

@ -31,7 +31,7 @@
#define DEFAULT_GAMMA 1.0
#define CDISPLAY_TYPE_GAMMA (cdisplay_gamma_type)
#define CDISPLAY_TYPE_GAMMA (cdisplay_gamma_get_type ())
#define CDISPLAY_GAMMA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CDISPLAY_TYPE_GAMMA, CdisplayGamma))
#define CDISPLAY_GAMMA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CDISPLAY_TYPE_GAMMA, CdisplayGammaClass))
#define CDISPLAY_IS_GAMMA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CDISPLAY_TYPE_GAMMA))
@ -62,8 +62,7 @@ enum
};
static GType cdisplay_gamma_get_type (GTypeModule *module);
static void cdisplay_gamma_class_init (CdisplayGammaClass *klass);
GType cdisplay_gamma_get_type (void);
static void cdisplay_gamma_set_property (GObject *object,
guint property_id,
@ -95,8 +94,8 @@ static const GimpModuleInfo cdisplay_gamma_info =
"October 14, 2000"
};
static GType cdisplay_gamma_type = 0;
static GimpColorDisplayClass *parent_class = NULL;
G_DEFINE_DYNAMIC_TYPE (CdisplayGamma, cdisplay_gamma,
GIMP_TYPE_COLOR_DISPLAY)
G_MODULE_EXPORT const GimpModuleInfo *
@ -108,47 +107,17 @@ gimp_module_query (GTypeModule *module)
G_MODULE_EXPORT gboolean
gimp_module_register (GTypeModule *module)
{
cdisplay_gamma_get_type (module);
cdisplay_gamma_register_type (module);
return TRUE;
}
static GType
cdisplay_gamma_get_type (GTypeModule *module)
{
if (! cdisplay_gamma_type)
{
const GTypeInfo display_info =
{
sizeof (CdisplayGammaClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) cdisplay_gamma_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (CdisplayGamma),
0, /* n_preallocs */
NULL /* instance_init */
};
cdisplay_gamma_type =
g_type_module_register_type (module,
GIMP_TYPE_COLOR_DISPLAY,
"CdisplayGamma",
&display_info, 0);
}
return cdisplay_gamma_type;
}
static void
cdisplay_gamma_class_init (CdisplayGammaClass *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->get_property = cdisplay_gamma_get_property;
object_class->set_property = cdisplay_gamma_set_property;
@ -165,6 +134,16 @@ cdisplay_gamma_class_init (CdisplayGammaClass *klass)
display_class->configure = cdisplay_gamma_configure;
}
static void
cdisplay_gamma_class_finalize (CdisplayGammaClass *klass)
{
}
static void
cdisplay_gamma_init (CdisplayGamma *gamma)
{
}
static void
cdisplay_gamma_get_property (GObject *object,
guint property_id,

View File

@ -31,7 +31,7 @@
#define DEFAULT_CONTRAST 1.0
#define CDISPLAY_TYPE_CONTRAST (cdisplay_contrast_type)
#define CDISPLAY_TYPE_CONTRAST (cdisplay_contrast_get_type ())
#define CDISPLAY_CONTRAST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CDISPLAY_TYPE_CONTRAST, CdisplayContrast))
#define CDISPLAY_CONTRAST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CDISPLAY_TYPE_CONTRAST, CdisplayContrastClass))
#define CDISPLAY_IS_CONTRAST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CDISPLAY_TYPE_CONTRAST))
@ -62,8 +62,7 @@ enum
};
static GType cdisplay_contrast_get_type (GTypeModule *module);
static void cdisplay_contrast_class_init (CdisplayContrastClass *klass);
GType cdisplay_contrast_get_type (void);
static void cdisplay_contrast_set_property (GObject *object,
guint property_id,
@ -95,8 +94,8 @@ static const GimpModuleInfo cdisplay_contrast_info =
"October 14, 2000"
};
static GType cdisplay_contrast_type = 0;
static GimpColorDisplayClass *parent_class = NULL;
G_DEFINE_DYNAMIC_TYPE (CdisplayContrast, cdisplay_contrast,
GIMP_TYPE_COLOR_DISPLAY)
G_MODULE_EXPORT const GimpModuleInfo *
@ -108,47 +107,17 @@ gimp_module_query (GTypeModule *module)
G_MODULE_EXPORT gboolean
gimp_module_register (GTypeModule *module)
{
cdisplay_contrast_get_type (module);
cdisplay_contrast_register_type (module);
return TRUE;
}
static GType
cdisplay_contrast_get_type (GTypeModule *module)
{
if (! cdisplay_contrast_type)
{
const GTypeInfo display_info =
{
sizeof (CdisplayContrastClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) cdisplay_contrast_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (CdisplayContrast),
0, /* n_preallocs */
NULL /* instance_init */
};
cdisplay_contrast_type =
g_type_module_register_type (module,
GIMP_TYPE_COLOR_DISPLAY,
"CdisplayContrast",
&display_info, 0);
}
return cdisplay_contrast_type;
}
static void
cdisplay_contrast_class_init (CdisplayContrastClass *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->get_property = cdisplay_contrast_get_property;
object_class->set_property = cdisplay_contrast_set_property;
@ -165,6 +134,16 @@ cdisplay_contrast_class_init (CdisplayContrastClass *klass)
display_class->configure = cdisplay_contrast_configure;
}
static void
cdisplay_contrast_class_finalize (CdisplayContrastClass *klass)
{
}
static void
cdisplay_contrast_init (CdisplayContrast *contrast)
{
}
static void
cdisplay_contrast_get_property (GObject *object,
guint property_id,

View File

@ -49,7 +49,7 @@
#include "libgimp/libgimp-intl.h"
#define CDISPLAY_TYPE_LCMS (cdisplay_lcms_type)
#define CDISPLAY_TYPE_LCMS (cdisplay_lcms_get_type ())
#define CDISPLAY_LCMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CDISPLAY_TYPE_LCMS, CdisplayLcms))
#define CDISPLAY_LCMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CDISPLAY_TYPE_LCMS, CdisplayLcmsClass))
#define CDISPLAY_IS_LCMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CDISPLAY_TYPE_LCMS))
@ -72,9 +72,8 @@ struct _CdisplayLcmsClass
};
static GType cdisplay_lcms_get_type (GTypeModule *module);
static void cdisplay_lcms_class_init (CdisplayLcmsClass *klass);
static void cdisplay_lcms_init (CdisplayLcms *lcms);
GType cdisplay_lcms_get_type (void);
static void cdisplay_lcms_finalize (GObject *object);
static GtkWidget * cdisplay_lcms_configure (GimpColorDisplay *display);
@ -111,9 +110,8 @@ static const GimpModuleInfo cdisplay_lcms_info =
"2005 - 2007"
};
static GType cdisplay_lcms_type = 0;
static GimpColorDisplayClass *parent_class = NULL;
G_DEFINE_DYNAMIC_TYPE (CdisplayLcms, cdisplay_lcms,
GIMP_TYPE_COLOR_DISPLAY)
G_MODULE_EXPORT const GimpModuleInfo *
gimp_module_query (GTypeModule *module)
@ -124,45 +122,17 @@ gimp_module_query (GTypeModule *module)
G_MODULE_EXPORT gboolean
gimp_module_register (GTypeModule *module)
{
cdisplay_lcms_get_type (module);
cdisplay_lcms_register_type (module);
return TRUE;
}
static GType
cdisplay_lcms_get_type (GTypeModule *module)
{
if (! cdisplay_lcms_type)
{
const GTypeInfo display_info =
{
sizeof (CdisplayLcmsClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) cdisplay_lcms_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (CdisplayLcms),
0, /* n_preallocs */
(GInstanceInitFunc) cdisplay_lcms_init,
};
cdisplay_lcms_type =
g_type_module_register_type (module, GIMP_TYPE_COLOR_DISPLAY,
"CdisplayLcms", &display_info, 0);
}
return cdisplay_lcms_type;
}
static void
cdisplay_lcms_class_init (CdisplayLcmsClass *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_lcms_finalize;
display_class->name = _("Color Management");
@ -176,6 +146,11 @@ cdisplay_lcms_class_init (CdisplayLcmsClass *klass)
cmsErrorAction (LCMS_ERROR_IGNORE);
}
static void
cdisplay_lcms_class_finalize (CdisplayLcmsClass *klass)
{
}
static void
cdisplay_lcms_init (CdisplayLcms *lcms)
{
@ -193,7 +168,7 @@ cdisplay_lcms_finalize (GObject *object)
lcms->transform = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
G_OBJECT_CLASS (cdisplay_lcms_parent_class)->finalize (object);
}
static void

View File

@ -36,7 +36,7 @@
#include "libgimp/libgimp-intl.h"
#define CDISPLAY_TYPE_PROOF (cdisplay_proof_type)
#define CDISPLAY_TYPE_PROOF (cdisplay_proof_get_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))
#define CDISPLAY_IS_PROOF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CDISPLAY_TYPE_PROOF))
@ -72,9 +72,7 @@ enum
};
static GType cdisplay_proof_get_type (GTypeModule *module);
static void cdisplay_proof_class_init (CdisplayProofClass *klass);
static void cdisplay_proof_init (CdisplayProof *proof);
GType cdisplay_proof_get_type (void);
static void cdisplay_proof_finalize (GObject *object);
static void cdisplay_proof_get_property (GObject *object,
@ -107,9 +105,8 @@ static const GimpModuleInfo cdisplay_proof_info =
"November 14, 2003"
};
static GType cdisplay_proof_type = 0;
static GimpColorDisplayClass *parent_class = NULL;
G_DEFINE_DYNAMIC_TYPE (CdisplayProof, cdisplay_proof,
GIMP_TYPE_COLOR_DISPLAY)
G_MODULE_EXPORT const GimpModuleInfo *
gimp_module_query (GTypeModule *module)
@ -120,45 +117,17 @@ gimp_module_query (GTypeModule *module)
G_MODULE_EXPORT gboolean
gimp_module_register (GTypeModule *module)
{
cdisplay_proof_get_type (module);
cdisplay_proof_register_type (module);
return TRUE;
}
static GType
cdisplay_proof_get_type (GTypeModule *module)
{
if (! cdisplay_proof_type)
{
const GTypeInfo display_info =
{
sizeof (CdisplayProofClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) cdisplay_proof_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (CdisplayProof),
0, /* n_preallocs */
(GInstanceInitFunc) cdisplay_proof_init,
};
cdisplay_proof_type =
g_type_module_register_type (module, GIMP_TYPE_COLOR_DISPLAY,
"CdisplayProof", &display_info, 0);
}
return cdisplay_proof_type;
}
static void
cdisplay_proof_class_init (CdisplayProofClass *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->get_property = cdisplay_proof_get_property;
object_class->set_property = cdisplay_proof_set_property;
@ -188,6 +157,11 @@ cdisplay_proof_class_init (CdisplayProofClass *klass)
cmsErrorAction (LCMS_ERROR_IGNORE);
}
static void
cdisplay_proof_class_finalize (CdisplayProofClass *klass)
{
}
static void
cdisplay_proof_init (CdisplayProof *proof)
{
@ -205,13 +179,14 @@ cdisplay_proof_finalize (GObject *object)
g_free (proof->profile);
proof->profile = NULL;
}
if (proof->transform)
{
cmsDeleteTransform (proof->transform);
proof->transform = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
G_OBJECT_CLASS (cdisplay_proof_parent_class)->finalize (object);
}
static void

View File

@ -29,7 +29,7 @@
/* definitions and variables */
#define COLORSEL_TYPE_CMYK (colorsel_cmyk_type)
#define COLORSEL_TYPE_CMYK (colorsel_cmyk_get_type ())
#define COLORSEL_CMYK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COLORSEL_TYPE_CMYK, ColorselCmyk))
#define COLORSEL_CMYK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), COLORSEL_TYPE_CMYK, ColorselCmykClass))
#define COLORSEL_IS_CMYK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COLORSEL_TYPE_CMYK))
@ -54,9 +54,7 @@ struct _ColorselCmykClass
};
static GType colorsel_cmyk_get_type (GTypeModule *module);
static void colorsel_cmyk_class_init (ColorselCmykClass *klass);
static void colorsel_cmyk_init (ColorselCmyk *cmyk);
GType colorsel_cmyk_get_type (void);
static void colorsel_cmyk_set_color (GimpColorSelector *selector,
const GimpRGB *rgb,
@ -77,7 +75,9 @@ static const GimpModuleInfo colorsel_cmyk_info =
"July 2003"
};
static GType colorsel_cmyk_type = 0;
G_DEFINE_DYNAMIC_TYPE (ColorselCmyk, colorsel_cmyk,
GIMP_TYPE_COLOR_SELECTOR)
G_MODULE_EXPORT const GimpModuleInfo *
@ -89,39 +89,11 @@ gimp_module_query (GTypeModule *module)
G_MODULE_EXPORT gboolean
gimp_module_register (GTypeModule *module)
{
colorsel_cmyk_get_type (module);
colorsel_cmyk_register_type (module);
return TRUE;
}
static GType
colorsel_cmyk_get_type (GTypeModule *module)
{
if (! colorsel_cmyk_type)
{
const GTypeInfo select_info =
{
sizeof (ColorselCmykClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) colorsel_cmyk_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (ColorselCmyk),
0, /* n_preallocs */
(GInstanceInitFunc) colorsel_cmyk_init,
};
colorsel_cmyk_type =
g_type_module_register_type (module,
GIMP_TYPE_COLOR_SELECTOR,
"ColorselCmyk",
&select_info, 0);
}
return colorsel_cmyk_type;
}
static void
colorsel_cmyk_class_init (ColorselCmykClass *klass)
{
@ -133,6 +105,11 @@ colorsel_cmyk_class_init (ColorselCmykClass *klass)
selector_class->set_color = colorsel_cmyk_set_color;
}
static void
colorsel_cmyk_class_finalize (ColorselCmykClass *klass)
{
}
static void
colorsel_cmyk_init (ColorselCmyk *module)
{

View File

@ -42,7 +42,7 @@
GDK_BUTTON_MOTION_MASK )
#define COLORSEL_TYPE_TRIANGLE (colorsel_triangle_type)
#define COLORSEL_TYPE_TRIANGLE (colorsel_triangle_get_type ())
#define COLORSEL_TRIANGLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COLORSEL_TYPE_TRIANGLE, ColorselTriangle))
#define COLORSEL_TRIANGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), COLORSEL_TYPE_TRIANGLE, ColorselTriangleClass))
#define COLORSEL_IS_TRIANGLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COLORSEL_TYPE_TRIANGLE))
@ -70,15 +70,13 @@ struct _ColorselTriangleClass
};
static GType colorsel_triangle_get_type (GTypeModule *module);
static void colorsel_triangle_class_init (ColorselTriangleClass *klass);
static void colorsel_triangle_init (ColorselTriangle *triangle);
GType colorsel_triangle_get_type (void);
static void colorsel_triangle_set_color (GimpColorSelector *selector,
static void colorsel_triangle_set_color (GimpColorSelector *selector,
const GimpRGB *rgb,
const GimpHSV *hsv);
static void colorsel_xy_to_triangle_buf (gint x,
static void colorsel_xy_to_triangle_buf (gint x,
gint y,
gdouble hue,
guchar *buf,
@ -89,12 +87,12 @@ static void colorsel_xy_to_triangle_buf (gint x,
gint hx,
gint hy);
static GtkWidget *colorsel_triangle_create_preview (ColorselTriangle *triangle);
static void colorsel_triangle_update_preview (ColorselTriangle *triangle);
static void colorsel_triangle_size_allocate (GtkWidget *widget,
static GtkWidget * colorsel_triangle_create_preview (ColorselTriangle *triangle);
static void colorsel_triangle_update_preview (ColorselTriangle *triangle);
static void colorsel_triangle_size_allocate (GtkWidget *widget,
GtkAllocation *allocation,
ColorselTriangle *triangle);
static gboolean colorsel_triangle_event (GtkWidget *widget,
static gboolean colorsel_triangle_event (GtkWidget *widget,
GdkEvent *event,
ColorselTriangle *triangle);
@ -114,8 +112,8 @@ static const GtkTargetEntry targets[] =
};
static GType colorsel_triangle_type = 0;
static GimpColorSelectorClass *parent_class = NULL;
G_DEFINE_DYNAMIC_TYPE (ColorselTriangle, colorsel_triangle,
GIMP_TYPE_COLOR_SELECTOR)
G_MODULE_EXPORT const GimpModuleInfo *
@ -127,52 +125,27 @@ gimp_module_query (GTypeModule *module)
G_MODULE_EXPORT gboolean
gimp_module_register (GTypeModule *module)
{
colorsel_triangle_get_type (module);
colorsel_triangle_register_type (module);
return TRUE;
}
static GType
colorsel_triangle_get_type (GTypeModule *module)
{
if (! colorsel_triangle_type)
{
const GTypeInfo select_info =
{
sizeof (ColorselTriangleClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) colorsel_triangle_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (ColorselTriangle),
0, /* n_preallocs */
(GInstanceInitFunc) colorsel_triangle_init,
};
colorsel_triangle_type =
g_type_module_register_type (module,
GIMP_TYPE_COLOR_SELECTOR,
"ColorselTriangle",
&select_info, 0);
}
return colorsel_triangle_type;
}
static void
colorsel_triangle_class_init (ColorselTriangleClass *klass)
{
GimpColorSelectorClass *selector_class = GIMP_COLOR_SELECTOR_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
selector_class->name = _("Triangle");
selector_class->help_id = "gimp-colorselector-triangle";
selector_class->stock_id = GIMP_STOCK_COLOR_TRIANGLE;
selector_class->set_color = colorsel_triangle_set_color;
}
static void
colorsel_triangle_class_finalize (ColorselTriangleClass *klass)
{
}
static void
colorsel_triangle_init (ColorselTriangle *triangle)
{

View File

@ -32,7 +32,7 @@
#include "libgimp/libgimp-intl.h"
#define COLORSEL_TYPE_WATER (colorsel_water_type)
#define COLORSEL_TYPE_WATER (colorsel_water_get_type ())
#define COLORSEL_WATER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COLORSEL_TYPE_WATER, ColorselWater))
#define COLORSEL_WATER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), COLORSEL_TYPE_WATER, ColorselWaterClass))
#define COLORSEL_IS_WATER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COLORSEL_TYPE_WATER))
@ -59,23 +59,21 @@ struct _ColorselWaterClass
};
static GType colorsel_water_get_type (GTypeModule *module);
static void colorsel_water_class_init (ColorselWaterClass *klass);
static void colorsel_water_init (ColorselWater *water);
GType colorsel_water_get_type (void);
static void select_area_expose (GtkWidget *widget,
GdkEventExpose *event);
static gboolean button_press_event (GtkWidget *widget,
GdkEventButton *event,
ColorselWater *water);
static gboolean motion_notify_event (GtkWidget *widget,
GdkEventMotion *event,
ColorselWater *water);
static gboolean proximity_out_event (GtkWidget *widget,
GdkEventProximity *event,
ColorselWater *water);
static void pressure_adjust_update (GtkAdjustment *adj,
ColorselWater *water);
static void select_area_expose (GtkWidget *widget,
GdkEventExpose *event);
static gboolean button_press_event (GtkWidget *widget,
GdkEventButton *event,
ColorselWater *water);
static gboolean motion_notify_event (GtkWidget *widget,
GdkEventMotion *event,
ColorselWater *water);
static gboolean proximity_out_event (GtkWidget *widget,
GdkEventProximity *event,
ColorselWater *water);
static void pressure_adjust_update (GtkAdjustment *adj,
ColorselWater *water);
static const GimpModuleInfo colorsel_water_info =
@ -94,8 +92,8 @@ static const GtkTargetEntry targets[] =
};
static GType colorsel_water_type = 0;
static GimpColorSelectorClass *parent_class = NULL;
G_DEFINE_DYNAMIC_TYPE (ColorselWater, colorsel_water,
GIMP_TYPE_COLOR_SELECTOR)
G_MODULE_EXPORT const GimpModuleInfo *
@ -107,49 +105,24 @@ gimp_module_query (GTypeModule *module)
G_MODULE_EXPORT gboolean
gimp_module_register (GTypeModule *module)
{
colorsel_water_get_type (module);
colorsel_water_register_type (module);
return TRUE;
}
static GType
colorsel_water_get_type (GTypeModule *module)
{
if (! colorsel_water_type)
{
const GTypeInfo select_info =
{
sizeof (ColorselWaterClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) colorsel_water_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (ColorselWater),
0, /* n_preallocs */
(GInstanceInitFunc) colorsel_water_init,
};
colorsel_water_type =
g_type_module_register_type (module,
GIMP_TYPE_COLOR_SELECTOR,
"ColorselWater",
&select_info, 0);
}
return colorsel_water_type;
}
static void
colorsel_water_class_init (ColorselWaterClass *klass)
{
GimpColorSelectorClass *selector_class = GIMP_COLOR_SELECTOR_CLASS (klass);
parent_class = g_type_class_peek_parent (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->stock_id = GIMP_STOCK_TOOL_PAINTBRUSH;
static void
colorsel_water_class_finalize (ColorselWaterClass *klass)
{
}
static void

View File

@ -34,7 +34,7 @@
#include <string.h>
#include <math.h>
#define _WIN32_WINNT 0x0501
#define _WIN32_WINNT 0x0501
#include <windows.h>
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
@ -64,7 +64,7 @@ enum
#define NUM_EVENTS_PER_SLIDER 2 /* Slider decrease and increase */
#define NUM_EVENTS_PER_POV 3 /* POV view vector X and Y view and return */
#define CONTROLLER_TYPE_DX_DINPUT (controller_type)
#define CONTROLLER_TYPE_DX_DINPUT (controller_dx_input_get_type ())
#define CONTROLLER_DX_DINPUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTROLLER_TYPE_DX_DINPUT, ControllerDXDInput))
#define CONTROLLER_DX_DINPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTROLLER_TYPE_DX_DINPUT, ControllerDXDInputClass))
#define CONTROLLER_IS_DX_DINPUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTROLLER_TYPE_DX_DINPUT))
@ -79,7 +79,7 @@ struct _DXDInputSource
GSource source;
ControllerDXDInput *controller;
};
struct _ControllerDXDInput
{
GimpController parent_instance;
@ -103,7 +103,7 @@ struct _ControllerDXDInput
gint num_povs;
gint num_pov_events;
gint num_events;
gchar **event_names;
gchar **event_blurbs;
@ -125,19 +125,18 @@ struct _ControllerDXDInputClass
};
GType dx_dinput_get_type (GTypeModule *module);
static void dx_dinput_class_init (ControllerDXDInputClass *klass);
static void dx_dinput_init (ControllerDXDInput *controller);
static void dx_dinput_dispose (GObject *object);
static void dx_dinput_finalize (GObject *object);
static void dx_dinput_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void dx_dinput_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
GType controller_dx_dinput_get_type (void);
static void dx_dinput_dispose (GObject *object);
static void dx_dinput_finalize (GObject *object);
static void dx_dinput_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void dx_dinput_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static gint dx_dinput_get_n_events (GimpController *controller);
static const gchar * dx_dinput_get_event_name (GimpController *controller,
@ -162,8 +161,8 @@ static const GimpModuleInfo dx_dinput_info =
};
static GType controller_type = 0;
static GimpControllerClass *parent_class = NULL;
G_DEFINE_DYNAMIC_TYPE (ControllerDXInput, controller_dx_input,
GIMP_TYPE_CONTROLLER)
G_MODULE_EXPORT const GimpModuleInfo *
@ -176,47 +175,17 @@ G_MODULE_EXPORT gboolean
gimp_module_register (GTypeModule *module)
{
gimp_input_device_store_get_type (module);
dx_dinput_get_type (module);
controller_dx_dinput_register_type (module);
return TRUE;
}
GType
dx_dinput_get_type (GTypeModule *module)
{
if (! controller_type)
{
const GTypeInfo controller_info =
{
sizeof (ControllerDXDInputClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) dx_dinput_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (ControllerDXDInput),
0, /* n_preallocs */
(GInstanceInitFunc) dx_dinput_init
};
controller_type = g_type_module_register_type (module,
GIMP_TYPE_CONTROLLER,
"ControllerDXDInput",
&controller_info, 0);
}
return controller_type;
}
static void
dx_dinput_class_init (ControllerDXDInputClass *klass)
controller_dx_dinput_class_init (ControllerDXDInputClass *klass)
{
GimpControllerClass *controller_class = GIMP_CONTROLLER_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->dispose = dx_dinput_dispose;
object_class->finalize = dx_dinput_finalize;
object_class->get_property = dx_dinput_get_property;
@ -244,7 +213,12 @@ dx_dinput_class_init (ControllerDXDInputClass *klass)
}
static void
dx_dinput_init (ControllerDXDInput *controller)
controller_dx_dinput_class_finalize (ControllerDXDInputClass *klass)
{
}
static void
controller_dx_dinput_init (ControllerDXDInput *controller)
{
controller->store = gimp_input_device_store_new ();
@ -266,7 +240,7 @@ dx_dinput_dispose (GObject *object)
dx_dinput_set_device (controller, NULL);
G_OBJECT_CLASS (parent_class)->dispose (object);
G_OBJECT_CLASS (controller_dx_input_parent_class)->dispose (object);
}
static void
@ -306,7 +280,7 @@ dx_dinput_finalize (GObject *object)
controller->store = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
G_OBJECT_CLASS (controller_dx_input_parent_class)->finalize (object);
}
static void
@ -354,7 +328,7 @@ static gint
dx_dinput_get_n_events (GimpController *controller)
{
ControllerDXDInput *cdxdi = (ControllerDXDInput *) controller;
return cdxdi->num_events;
}
@ -367,7 +341,7 @@ dx_dinput_get_event_name
if (event_id < 0 || event_id >= cdxdi->num_events)
return NULL;
return cdxdi->event_names[event_id];
}
@ -379,7 +353,7 @@ dx_dinput_get_event_blurb (GimpController *controller,
if (event_id < 0 || event_id >= cdxdi->num_events)
return NULL;
return cdxdi->event_blurbs[event_id];
}
@ -565,7 +539,7 @@ dx_dinput_get_device_info (ControllerDXDInput *controller,
controller->num_axes =
controller->num_sliders =
controller->num_povs = 0;
if (FAILED ((hresult = IDirectInputDevice8_EnumObjects (controller->didevice8,
count_objects,
controller,
@ -679,7 +653,7 @@ dx_dinput_event_dispatch (GSource *source,
guchar *data;
gint i;
GimpControllerEvent cevent = { 0, };
data = g_malloc (format->dwDataSize);
if (FAILED ((hresult = IDirectInputDevice8_GetDeviceState (input->didevice8,
@ -749,7 +723,7 @@ dx_dinput_event_dispatch (GSource *source,
*curr = *prev;
rgodf++;
}
for (i = 0; i < input->num_sliders; i++)
{
LONG *prev = (LONG *)(input->prevdata+rgodf->dwOfs);
@ -780,7 +754,7 @@ dx_dinput_event_dispatch (GSource *source,
*curr = *prev;
rgodf++;
}
for (i = 0; i < input->num_povs; i++)
{
LONG prev = *((LONG *)(input->prevdata+rgodf->dwOfs));
@ -834,7 +808,7 @@ dx_dinput_event_dispatch (GSource *source,
}
rgodf++;
}
g_assert (rgodf == format->rgodf + format->dwNumObjs);
memmove (input->prevdata, data, format->dwDataSize);
@ -875,7 +849,7 @@ dump_data_format (const DIDATAFORMAT *format)
{
const DIOBJECTDATAFORMAT *oformat = (DIOBJECTDATAFORMAT *) (((char *) format->rgodf) + i*format->dwObjSize);
unsigned char *guid;
g_print ("Object %d:\n", i);
if (oformat->pguid == NULL)
g_print (" pguid: NULL\n");
@ -968,7 +942,7 @@ dx_dinput_setup_events (ControllerDXDInput *controller,
g_win32_error_message (hresult));
goto fail0;
}
controller->format->dwFlags = dword.dwData + 1;
controller->format->dwNumObjs =
@ -993,7 +967,7 @@ dx_dinput_setup_events (ControllerDXDInput *controller,
}
controller->format->dwDataSize = 4*((controller->format->dwDataSize + 3)/4);
for (i = 0; i < controller->num_axes; i++)
{
controller->format->rgodf[k].pguid = NULL;
@ -1003,7 +977,7 @@ dx_dinput_setup_events (ControllerDXDInput *controller,
controller->format->dwDataSize += 4;
k++;
}
for (i = 0; i < controller->num_sliders; i++)
{
controller->format->rgodf[k].pguid = NULL;
@ -1056,7 +1030,7 @@ dx_dinput_setup_events (ControllerDXDInput *controller,
g_win32_error_message (hresult));
goto fail2;
}
if (FAILED ((hresult = IDirectInputDevice8_GetDeviceState (controller->didevice8,
controller->format->dwDataSize,
controller->prevdata))))

View File

@ -118,7 +118,7 @@ enum
};
#define CONTROLLER_TYPE_LINUX_INPUT (controller_type)
#define CONTROLLER_TYPE_LINUX_INPUT (controller_linux_input_get_type ())
#define CONTROLLER_LINUX_INPUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTROLLER_TYPE_LINUX_INPUT, ControllerLinuxInput))
#define CONTROLLER_LINUX_INPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTROLLER_TYPE_LINUX_INPUT, ControllerLinuxInputClass))
#define CONTROLLER_IS_LINUX_INPUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTROLLER_TYPE_LINUX_INPUT))
@ -144,19 +144,18 @@ struct _ControllerLinuxInputClass
};
GType linux_input_get_type (GTypeModule *module);
static void linux_input_class_init (ControllerLinuxInputClass *klass);
static void linux_input_init (ControllerLinuxInput *controller);
static void linux_input_dispose (GObject *object);
static void linux_input_finalize (GObject *object);
static void linux_input_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void linux_input_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
GType controller_linux_input_get_type (void);
static void linux_input_dispose (GObject *object);
static void linux_input_finalize (GObject *object);
static void linux_input_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void linux_input_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static gint linux_input_get_n_events (GimpController *controller);
static const gchar * linux_input_get_event_name (GimpController *controller,
@ -184,8 +183,8 @@ static const GimpModuleInfo linux_input_info =
};
static GType controller_type = 0;
static GimpControllerClass *parent_class = NULL;
G_DEFINE_DYNAMIC_TYPE (ControllerLinuxInput, controller_linux_input,
GIMP_TYPE_CONTROLLER)
G_MODULE_EXPORT const GimpModuleInfo *
@ -198,47 +197,17 @@ G_MODULE_EXPORT gboolean
gimp_module_register (GTypeModule *module)
{
gimp_input_device_store_get_type (module);
linux_input_get_type (module);
controller_linux_input_register_type (module);
return TRUE;
}
GType
linux_input_get_type (GTypeModule *module)
{
if (! controller_type)
{
const GTypeInfo controller_info =
{
sizeof (ControllerLinuxInputClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) linux_input_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (ControllerLinuxInput),
0, /* n_preallocs */
(GInstanceInitFunc) linux_input_init
};
controller_type = g_type_module_register_type (module,
GIMP_TYPE_CONTROLLER,
"ControllerLinuxInput",
&controller_info, 0);
}
return controller_type;
}
static void
linux_input_class_init (ControllerLinuxInputClass *klass)
controller_linux_input_class_init (ControllerLinuxInputClass *klass)
{
GimpControllerClass *controller_class = GIMP_CONTROLLER_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->dispose = linux_input_dispose;
object_class->finalize = linux_input_finalize;
object_class->get_property = linux_input_get_property;
@ -268,7 +237,12 @@ linux_input_class_init (ControllerLinuxInputClass *klass)
}
static void
linux_input_init (ControllerLinuxInput *controller)
controller_linux_input_class_finalize (ControllerLinuxInputClass *klass)
{
}
static void
controller_linux_input_init (ControllerLinuxInput *controller)
{
controller->store = gimp_input_device_store_new ();
@ -290,7 +264,7 @@ linux_input_dispose (GObject *object)
linux_input_set_device (controller, NULL);
G_OBJECT_CLASS (parent_class)->dispose (object);
G_OBJECT_CLASS (controller_linux_input_parent_class)->dispose (object);
}
static void
@ -304,7 +278,7 @@ linux_input_finalize (GObject *object)
controller->store = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
G_OBJECT_CLASS (controller_linux_input_parent_class)->finalize (object);
}
static void

View File

@ -63,7 +63,7 @@ enum
};
#define CONTROLLER_TYPE_MIDI (controller_type)
#define CONTROLLER_TYPE_MIDI (controller_midi_get_type ())
#define CONTROLLER_MIDI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTROLLER_TYPE_MIDI, ControllerMidi))
#define CONTROLLER_MIDI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTROLLER_TYPE_MIDI, ControllerMidiClass))
#define CONTROLLER_IS_MIDI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTROLLER_TYPE_MIDI))
@ -104,45 +104,42 @@ struct _ControllerMidiClass
};
GType midi_get_type (GTypeModule *module);
GType controller_midi_get_type (void);
static void midi_class_init (ControllerMidiClass *klass);
static void midi_init (ControllerMidi *midi);
static void midi_dispose (GObject *object);
static void midi_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void midi_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void midi_dispose (GObject *object);
static void midi_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void midi_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static gint midi_get_n_events (GimpController *controller);
static const gchar * midi_get_event_name (GimpController *controller,
gint event_id);
static const gchar * midi_get_event_blurb (GimpController *controller,
gint event_id);
static gint midi_get_n_events (GimpController *controller);
static const gchar * midi_get_event_name (GimpController *controller,
gint event_id);
static const gchar * midi_get_event_blurb (GimpController *controller,
gint event_id);
static gboolean midi_set_device (ControllerMidi *controller,
const gchar *device);
static void midi_event (ControllerMidi *midi,
gint channel,
gint event_id,
gdouble value);
static gboolean midi_set_device (ControllerMidi *controller,
const gchar *device);
static void midi_event (ControllerMidi *midi,
gint channel,
gint event_id,
gdouble value);
static gboolean midi_read_event (GIOChannel *io,
GIOCondition cond,
gpointer data);
static gboolean midi_read_event (GIOChannel *io,
GIOCondition cond,
gpointer data);
#ifdef HAVE_ALSA
static gboolean midi_alsa_prepare (GSource *source,
gint *timeout);
static gboolean midi_alsa_check (GSource *source);
static gboolean midi_alsa_dispatch (GSource *source,
GSourceFunc callback,
gpointer user_data);
static gboolean midi_alsa_prepare (GSource *source,
gint *timeout);
static gboolean midi_alsa_check (GSource *source);
static gboolean midi_alsa_dispatch (GSource *source,
GSourceFunc callback,
gpointer user_data);
static GSourceFuncs alsa_source_funcs =
{
@ -172,10 +169,10 @@ static const GimpModuleInfo midi_info =
};
static GType controller_type = 0;
static GimpControllerClass *parent_class = NULL;
G_DEFINE_DYNAMIC_TYPE (ControllerMidi, controller_midi,
GIMP_TYPE_CONTROLLER)
static MidiEvent midi_events[128 + 128 + 128];
static MidiEvent midi_events[128 + 128 + 128];
G_MODULE_EXPORT const GimpModuleInfo *
@ -187,48 +184,18 @@ gimp_module_query (GTypeModule *module)
G_MODULE_EXPORT gboolean
gimp_module_register (GTypeModule *module)
{
midi_get_type (module);
controller_midi_register_type (module);
return TRUE;
}
GType
midi_get_type (GTypeModule *module)
{
if (! controller_type)
{
const GTypeInfo controller_info =
{
sizeof (ControllerMidiClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) midi_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (ControllerMidi),
0, /* n_preallocs */
(GInstanceInitFunc) midi_init
};
controller_type = g_type_module_register_type (module,
GIMP_TYPE_CONTROLLER,
"ControllerMidi",
&controller_info, 0);
}
return controller_type;
}
static void
midi_class_init (ControllerMidiClass *klass)
controller_midi_class_init (ControllerMidiClass *klass)
{
GimpControllerClass *controller_class = GIMP_CONTROLLER_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
gchar *blurb;
parent_class = g_type_class_peek_parent (klass);
object_class->dispose = midi_dispose;
object_class->get_property = midi_get_property;
object_class->set_property = midi_set_property;
@ -266,7 +233,12 @@ midi_class_init (ControllerMidiClass *klass)
}
static void
midi_init (ControllerMidi *midi)
controller_midi_class_finalize (ControllerMidiClass *klass)
{
}
static void
controller_midi_init (ControllerMidi *midi)
{
midi->device = NULL;
midi->midi_channel = -1;
@ -293,7 +265,7 @@ midi_dispose (GObject *object)
midi_set_device (midi, NULL);
G_OBJECT_CLASS (parent_class)->dispose (object);
G_OBJECT_CLASS (controller_midi_parent_class)->dispose (object);
}
static void