Commit 0d4a10fe authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/config/*.c app/core/*.c app/display/*.c app/text/*.c port to

2005-12-10  Michael Natterer  <mitch@gimp.org>

	* app/config/*.c
	* app/core/*.c
	* app/display/*.c
	* app/text/*.c
	* app/vectors/*.c: port to G_DEFINE_TYPE() and friends. Some related
	core reordering and cleanup.
parent 51d76ae2
2005-12-10 Michael Natterer <mitch@gimp.org>
* app/config/*.c
* app/core/*.c
* app/display/*.c
* app/text/*.c
* app/vectors/*.c: port to G_DEFINE_TYPE() and friends. Some related
core reordering and cleanup.
2005-12-07 Michael Natterer <mitch@gimp.org>
* app/paint/gimpclone.c (gimp_clone_motion): In fixed mode, paint
......
......@@ -36,18 +36,6 @@
#include "gimp-intl.h"
static void gimp_base_config_class_init (GimpBaseConfigClass *klass);
static void gimp_base_config_finalize (GObject *object);
static void gimp_base_config_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_base_config_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
enum
{
PROP_0,
......@@ -58,45 +46,27 @@ enum
PROP_TILE_CACHE_SIZE
};
static GObjectClass *parent_class = NULL;
static void gimp_base_config_finalize (GObject *object);
static void gimp_base_config_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_base_config_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
GType
gimp_base_config_get_type (void)
{
static GType config_type = 0;
if (! config_type)
{
static const GTypeInfo config_info =
{
sizeof (GimpBaseConfigClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gimp_base_config_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpBaseConfig),
0, /* n_preallocs */
NULL /* instance_init */
};
config_type = g_type_register_static (G_TYPE_OBJECT,
"GimpBaseConfig",
&config_info, 0);
}
G_DEFINE_TYPE (GimpBaseConfig, gimp_base_config, G_TYPE_OBJECT);
#define parent_class gimp_base_config_parent_class
return config_type;
}
static void
gimp_base_config_class_init (GimpBaseConfigClass *klass)
{
GObjectClass *object_class;
parent_class = g_type_class_peek_parent (klass);
object_class = G_OBJECT_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gimp_base_config_finalize;
object_class->set_property = gimp_base_config_set_property;
......@@ -127,6 +97,11 @@ gimp_base_config_class_init (GimpBaseConfigClass *klass)
GIMP_CONFIG_PARAM_CONFIRM);
}
static void
gimp_base_config_init (GimpBaseConfig *config)
{
}
static void
gimp_base_config_finalize (GObject *object)
{
......
......@@ -38,28 +38,6 @@
#include "gimp-intl.h"
static void gimp_core_config_class_init (GimpCoreConfigClass *klass);
static void gimp_core_config_init (GimpCoreConfig *config);
static void gimp_core_config_finalize (GObject *object);
static void gimp_core_config_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_core_config_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_core_config_default_image_notify (GObject *object,
GParamSpec *pspec,
gpointer data);
static void gimp_core_config_default_grid_notify (GObject *object,
GParamSpec *pspec,
gpointer data);
static void gimp_core_config_color_management_notify (GObject *object,
GParamSpec *pspec,
gpointer data);
#define DEFAULT_BRUSH "Circle (11)"
#define DEFAULT_PATTERN "Pine"
#define DEFAULT_PALETTE "Default"
......@@ -67,6 +45,7 @@ static void gimp_core_config_color_management_notify (GObject *object,
#define DEFAULT_FONT "Sans"
#define DEFAULT_COMMENT "Created with GIMP"
enum
{
PROP_0,
......@@ -111,47 +90,38 @@ enum
PROP_SAVE_DOCUMENT_HISTORY
};
static GObjectClass *parent_class = NULL;
static void gimp_core_config_finalize (GObject *object);
static void gimp_core_config_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_core_config_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_core_config_default_image_notify (GObject *object,
GParamSpec *pspec,
gpointer data);
static void gimp_core_config_default_grid_notify (GObject *object,
GParamSpec *pspec,
gpointer data);
static void gimp_core_config_color_management_notify (GObject *object,
GParamSpec *pspec,
gpointer data);
GType
gimp_core_config_get_type (void)
{
static GType config_type = 0;
G_DEFINE_TYPE (GimpCoreConfig, gimp_core_config, GIMP_TYPE_BASE_CONFIG);
if (! config_type)
{
static const GTypeInfo config_info =
{
sizeof (GimpCoreConfigClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gimp_core_config_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpCoreConfig),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_core_config_init
};
config_type = g_type_register_static (GIMP_TYPE_BASE_CONFIG,
"GimpCoreConfig",
&config_info, 0);
}
#define parent_class gimp_core_config_parent_class
return config_type;
}
static void
gimp_core_config_class_init (GimpCoreConfigClass *klass)
{
GObjectClass *object_class;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
gchar *path;
parent_class = g_type_class_peek_parent (klass);
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gimp_core_config_finalize;
object_class->set_property = gimp_core_config_set_property;
object_class->get_property = gimp_core_config_get_property;
......
......@@ -38,27 +38,7 @@
#include "gimp-intl.h"
static void gimp_display_config_class_init (GimpDisplayConfigClass *klass);
static void gimp_display_config_init (GimpDisplayConfig *config);
static void gimp_display_config_finalize (GObject *object);
static void gimp_display_config_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_display_config_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_display_config_view_notify (GObject *object,
GParamSpec *pspec,
gpointer data);
static void gimp_display_config_fullscreen_notify (GObject *object,
GParamSpec *pspec,
gpointer data);
#define DEFAULT_ACTIVATE_ON_FOCUS TRUE
#define DEFAULT_ACTIVATE_ON_FOCUS TRUE
enum
......@@ -89,48 +69,37 @@ enum
PROP_ACTIVATE_ON_FOCUS
};
static GObjectClass *parent_class = NULL;
static void gimp_display_config_finalize (GObject *object);
static void gimp_display_config_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_display_config_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
GType
gimp_display_config_get_type (void)
{
static GType config_type = 0;
static void gimp_display_config_view_notify (GObject *object,
GParamSpec *pspec,
gpointer data);
static void gimp_display_config_fullscreen_notify (GObject *object,
GParamSpec *pspec,
gpointer data);
if (! config_type)
{
static const GTypeInfo config_info =
{
sizeof (GimpDisplayConfigClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gimp_display_config_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpDisplayConfig),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_display_config_init
};
config_type = g_type_register_static (GIMP_TYPE_CORE_CONFIG,
"GimpDisplayConfig",
&config_info, 0);
}
return config_type;
}
G_DEFINE_TYPE (GimpDisplayConfig, gimp_display_config, GIMP_TYPE_CORE_CONFIG);
#define parent_class gimp_display_config_parent_class
static void
gimp_display_config_class_init (GimpDisplayConfigClass *klass)
{
GObjectClass *object_class;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpRGB white;
GimpRGB black;
parent_class = g_type_class_peek_parent (klass);
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gimp_display_config_finalize;
object_class->set_property = gimp_display_config_set_property;
object_class->get_property = gimp_display_config_get_property;
......
......@@ -34,18 +34,6 @@
#include "gimp-intl.h"
static void gimp_gui_config_class_init (GimpGuiConfigClass *klass);
static void gimp_gui_config_finalize (GObject *object);
static void gimp_gui_config_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_gui_config_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
#define DEFAULT_THEME "Default"
#ifdef G_OS_WIN32
......@@ -56,6 +44,7 @@ static void gimp_gui_config_get_property (GObject *object,
# define DEFAULT_WEB_BROWSER "mozilla-firefox %s"
#endif
enum
{
PROP_0,
......@@ -92,47 +81,29 @@ enum
PROP_CURSOR_FORMAT
};
static GObjectClass *parent_class = NULL;
static void gimp_gui_config_finalize (GObject *object);
static void gimp_gui_config_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_gui_config_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
GType
gimp_gui_config_get_type (void)
{
static GType config_type = 0;
if (! config_type)
{
static const GTypeInfo config_info =
{
sizeof (GimpGuiConfigClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gimp_gui_config_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpGuiConfig),
0, /* n_preallocs */
NULL /* instance_init */
};
G_DEFINE_TYPE (GimpGuiConfig, gimp_gui_config, GIMP_TYPE_DISPLAY_CONFIG);
config_type = g_type_register_static (GIMP_TYPE_DISPLAY_CONFIG,
"GimpGuiConfig",
&config_info, 0);
}
#define parent_class gimp_gui_config_parent_class
return config_type;
}
static void
gimp_gui_config_class_init (GimpGuiConfigClass *klass)
{
GObjectClass *object_class;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
gchar *path;
parent_class = g_type_class_peek_parent (klass);
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gimp_gui_config_finalize;
object_class->set_property = gimp_gui_config_set_property;
object_class->get_property = gimp_gui_config_get_property;
......@@ -282,6 +253,11 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
0);
}
static void
gimp_gui_config_init (GimpGuiConfig *config)
{
}
static void
gimp_gui_config_finalize (GObject *object)
{
......
......@@ -32,17 +32,6 @@
#include "gimppluginconfig.h"
static void gimp_plugin_config_class_init (GimpPluginConfigClass *klass);
static void gimp_plugin_config_finalize (GObject *object);
static void gimp_plugin_config_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_plugin_config_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
enum
{
PROP_0,
......@@ -53,47 +42,29 @@ enum
PROP_SCRIPT_FU_PATH
};
static GObjectClass *parent_class = NULL;
static void gimp_plugin_config_finalize (GObject *object);
static void gimp_plugin_config_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_plugin_config_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
GType
gimp_plugin_config_get_type (void)
{
static GType config_type = 0;
if (! config_type)
{
static const GTypeInfo config_info =
{
sizeof (GimpPluginConfigClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gimp_plugin_config_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpPluginConfig),
0, /* n_preallocs */
NULL /* instance_init */
};
config_type = g_type_register_static (GIMP_TYPE_GUI_CONFIG,
"GimpPluginConfig",
&config_info, 0);
}
G_DEFINE_TYPE (GimpPluginConfig, gimp_plugin_config, GIMP_TYPE_GUI_CONFIG);
#define parent_class gimp_plugin_config_parent_class
return config_type;
}
static void
gimp_plugin_config_class_init (GimpPluginConfigClass *klass)
{
GObjectClass *object_class;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
gchar *path;
parent_class = g_type_class_peek_parent (klass);
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gimp_plugin_config_finalize;
object_class->set_property = gimp_plugin_config_set_property;
object_class->get_property = gimp_plugin_config_get_property;
......@@ -106,6 +77,7 @@ gimp_plugin_config_class_init (GimpPluginConfigClass *klass)
GIMP_CONFIG_PATH_DIR_LIST, path,
0);
g_free (path);
path = gimp_config_build_data_path ("gfig");
GIMP_CONFIG_INSTALL_PROP_PATH (object_class,
PROP_GFIG_PATH,
......@@ -113,6 +85,7 @@ gimp_plugin_config_class_init (GimpPluginConfigClass *klass)
GIMP_CONFIG_PATH_DIR_LIST, path,
0);
g_free (path);
path = gimp_config_build_data_path ("gflare");
GIMP_CONFIG_INSTALL_PROP_PATH (object_class,
PROP_GFLARE_PATH,
......@@ -120,6 +93,7 @@ gimp_plugin_config_class_init (GimpPluginConfigClass *klass)
GIMP_CONFIG_PATH_DIR_LIST, path,
0);
g_free (path);
path = gimp_config_build_data_path ("gimpressionist");
GIMP_CONFIG_INSTALL_PROP_PATH (object_class,
PROP_GIMPRESSIONIST_PATH,
......@@ -128,6 +102,7 @@ gimp_plugin_config_class_init (GimpPluginConfigClass *klass)
GIMP_CONFIG_PATH_DIR_LIST, path,
0);
g_free (path);
path = gimp_config_build_data_path ("scripts");
GIMP_CONFIG_INSTALL_PROP_PATH (object_class,
PROP_SCRIPT_FU_PATH,
......@@ -138,6 +113,11 @@ gimp_plugin_config_class_init (GimpPluginConfigClass *klass)
g_free (path);
}
static void
gimp_plugin_config_init (GimpPluginConfig *config)
{
}
static void
gimp_plugin_config_finalize (GObject *object)
{
......
......@@ -48,74 +48,38 @@ enum
};
static void gimp_rc_class_init (GimpRcClass *klass);
static void gimp_rc_config_iface_init (gpointer iface,
gpointer iface_data);
static void gimp_rc_init (GimpRc *rc);
static void gimp_rc_dispose (GObject *object);
static void gimp_rc_finalize (GObject *object);
static void gimp_rc_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_rc_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static GimpConfig * gimp_rc_duplicate (GimpConfig *object);
static void gimp_rc_load (GimpRc *rc);
static gboolean gimp_rc_idle_save (GimpRc *rc);
static void gimp_rc_notify (GimpRc *rc,
GParamSpec *param,
gpointer data);
static GObjectClass *parent_class = NULL;
GType
gimp_rc_get_type (void)
{
static GType rc_type = 0;
static void gimp_rc_config_iface_init (GimpConfigInterface *iface);
if (! rc_type)
{
static const GTypeInfo rc_info =
{
sizeof (GimpRcClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gimp_rc_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpRc),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_rc_init
};
static const GInterfaceInfo rc_iface_info =
{
gimp_rc_config_iface_init,
NULL, /* iface_finalize */
NULL /* iface_data */
};
static void gimp_rc_dispose (GObject *object);
static void gimp_rc_finalize (GObject *object);
static void gimp_rc_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_rc_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
rc_type = g_type_register_static (GIMP_TYPE_PLUGIN_CONFIG,
"GimpRc", &rc_info, 0);
static GimpConfig * gimp_rc_duplicate (GimpConfig *object);
static void gimp_rc_load (GimpRc *rc);
static gboolean gimp_rc_idle_save (GimpRc *rc);
static void gimp_rc_notify (GimpRc *rc,
GParamSpec *param,
gpointer data);
g_type_add_interface_static (rc_type, GIMP_TYPE_CONFIG, &rc_iface_info);
}
return rc_type;
}
G_DEFINE_TYPE_WITH_CODE (GimpRc, gimp_rc, GIMP_TYPE_PLUGIN_CONFIG,
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
gimp_rc_config_iface_init));
#define parent_class gimp_rc_parent_class
static void
gimp_rc_class_init (GimpRcClass *klass)
{
GObjectClass *object_class;
parent_class = g_type_class_peek_parent (klass);
object_class = G_OBJECT_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = gimp_rc_dispose;
object_class->finalize = gimp_rc_finalize;
......@@ -128,12 +92,14 @@ gimp_rc_class_init (GimpRcClass *klass)
FALSE,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class, PROP_SYSTEM_GIMPRC,
g_param_spec_string ("system-gimprc",
NULL, NULL,
NULL,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class, PROP_USER_GIMPRC,
g_param_spec_string ("user-gimprc",
NULL, NULL,
......@@ -254,14 +220,11 @@ gimp_rc_get_property (GObject *object,
}
static void
gimp_rc_config_iface_init (gpointer iface,
gpointer iface_data)
gimp_rc_config_iface_init (GimpConfigInterface *iface)
{
GimpConfigInterface *config_iface = (GimpConfigInterface *) iface;
config_iface->serialize = gimp_rc_serialize;
config_iface->deserialize = gimp_rc_deserialize;
config_iface->duplicate = gimp_rc_duplicate;
iface->serialize = gimp_rc_serialize;
iface->deserialize = gimp_rc_deserialize;
iface->duplicate = gimp_rc_duplicate;
}
static void
......
......@@ -84,9 +84,6 @@ enum
};
static void gimp_class_init (GimpClass *klass);
static void gimp_init (Gimp *gimp);
static void gimp_dispose (GObject *object);
static void gimp_finalize (GObject *object);
......@@ -108,38 +105,12 @@ static void gimp_edit_config_notify (GObject *edit_config,
GObject *global_config);
static GimpObjectClass *parent_class = NULL;
static guint gimp_signals[LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE (Gimp, gimp, GIMP_TYPE_OBJECT);
#define parent_class gimp_parent_class
GType
gimp_get_type (void)
{
static GType object_type = 0;
if (! object_type)
{
static const GTypeInfo object_info =
{
sizeof (GimpClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (Gimp),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_init,
};
object_type = g_type_register_static (GIMP_TYPE_OBJECT,
"Gimp",
&object_info, 0);
}
static guint gimp_signals[LAST_SIGNAL] = { 0, };
return object_type;
}
static void
gimp_class_init (GimpClass *klass)
......@@ -147,8 +118,6 @@ gimp_class_init (GimpClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
gimp_signals[INITIALIZE] =
g_signal_new ("initialize",
G_TYPE_FROM_CLASS (klass),
......
......@@ -42,64 +42,35 @@ enum
};