Commit d414139f authored by Juan Pablo Ugarte's avatar Juan Pablo Ugarte

Convert every object to use G_DEFINE_TYPE_WITH_CODE() or G_ADD_PRIVATE() macros

Fixed function prototype identation and spacing.
parent 6c347e17
...@@ -53,9 +53,6 @@ ...@@ -53,9 +53,6 @@
#define GLADE_CONFIG_FILENAME "glade.conf" #define GLADE_CONFIG_FILENAME "glade.conf"
#define GLADE_APP_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), \
GLADE_TYPE_APP, \
GladeAppPrivate))
enum enum
{ {
DOC_SEARCH, DOC_SEARCH,
...@@ -91,7 +88,7 @@ static gchar *lib_dir = NULL; ...@@ -91,7 +88,7 @@ static gchar *lib_dir = NULL;
static GladeApp *singleton_app = NULL; static GladeApp *singleton_app = NULL;
static gboolean check_initialised = FALSE; static gboolean check_initialised = FALSE;
G_DEFINE_TYPE (GladeApp, glade_app, G_TYPE_OBJECT); G_DEFINE_TYPE_WITH_PRIVATE (GladeApp, glade_app, G_TYPE_OBJECT);
/***************************************************************** /*****************************************************************
* GObjectClass * * GObjectClass *
...@@ -99,7 +96,7 @@ G_DEFINE_TYPE (GladeApp, glade_app, G_TYPE_OBJECT); ...@@ -99,7 +96,7 @@ G_DEFINE_TYPE (GladeApp, glade_app, G_TYPE_OBJECT);
static GObject * static GObject *
glade_app_constructor (GType type, glade_app_constructor (GType type,
guint n_construct_properties, guint n_construct_properties,
GObjectConstructParam * construct_properties) GObjectConstructParam *construct_properties)
{ {
GObject *object; GObject *object;
...@@ -122,7 +119,7 @@ glade_app_constructor (GType type, ...@@ -122,7 +119,7 @@ glade_app_constructor (GType type,
static void static void
glade_app_dispose (GObject * app) glade_app_dispose (GObject *app)
{ {
GladeAppPrivate *priv = GLADE_APP (app)->priv; GladeAppPrivate *priv = GLADE_APP (app)->priv;
...@@ -143,7 +140,7 @@ glade_app_dispose (GObject * app) ...@@ -143,7 +140,7 @@ glade_app_dispose (GObject * app)
} }
static void static void
glade_app_finalize (GObject * app) glade_app_finalize (GObject *app)
{ {
g_free (catalogs_dir); g_free (catalogs_dir);
g_free (modules_dir); g_free (modules_dir);
...@@ -370,7 +367,7 @@ static void ...@@ -370,7 +367,7 @@ static void
glade_app_init (GladeApp *app) glade_app_init (GladeApp *app)
{ {
static gboolean initialized = FALSE; static gboolean initialized = FALSE;
GladeAppPrivate *priv = app->priv = GLADE_APP_GET_PRIVATE (app); GladeAppPrivate *priv = app->priv = glade_app_get_instance_private (app);
singleton_app = app; singleton_app = app;
...@@ -407,7 +404,7 @@ glade_app_event_handler (GdkEvent *event, gpointer data) ...@@ -407,7 +404,7 @@ glade_app_event_handler (GdkEvent *event, gpointer data)
} }
static void static void
glade_app_class_init (GladeAppClass * klass) glade_app_class_init (GladeAppClass *klass)
{ {
GObjectClass *object_class; GObjectClass *object_class;
...@@ -467,8 +464,6 @@ glade_app_class_init (GladeAppClass * klass) ...@@ -467,8 +464,6 @@ glade_app_class_init (GladeAppClass * klass)
_glade_marshal_VOID__OBJECT, _glade_marshal_VOID__OBJECT,
G_TYPE_NONE, 1, G_TYPE_OBJECT); G_TYPE_NONE, 1, G_TYPE_OBJECT);
g_type_class_add_private (klass, sizeof (GladeAppPrivate));
gdk_event_handler_set (glade_app_event_handler, NULL, NULL); gdk_event_handler_set (glade_app_event_handler, NULL, NULL);
} }
...@@ -633,7 +628,7 @@ glade_app_get (void) ...@@ -633,7 +628,7 @@ glade_app_get (void)
} }
void void
glade_app_set_window (GtkWidget * window) glade_app_set_window (GtkWidget *window)
{ {
GladeApp *app = glade_app_get (); GladeApp *app = glade_app_get ();
...@@ -641,7 +636,7 @@ glade_app_set_window (GtkWidget * window) ...@@ -641,7 +636,7 @@ glade_app_set_window (GtkWidget * window)
} }
GladeCatalog * GladeCatalog *
glade_app_get_catalog (const gchar * name) glade_app_get_catalog (const gchar *name)
{ {
GladeApp *app = glade_app_get (); GladeApp *app = glade_app_get ();
GList *list; GList *list;
...@@ -659,7 +654,7 @@ glade_app_get_catalog (const gchar * name) ...@@ -659,7 +654,7 @@ glade_app_get_catalog (const gchar * name)
} }
gboolean gboolean
glade_app_get_catalog_version (const gchar * name, gint * major, gint * minor) glade_app_get_catalog_version (const gchar *name, gint *major, gint *minor)
{ {
GladeCatalog *catalog = glade_app_get_catalog (name); GladeCatalog *catalog = glade_app_get_catalog (name);
...@@ -725,7 +720,7 @@ glade_app_get_config (void) ...@@ -725,7 +720,7 @@ glade_app_get_config (void)
} }
gboolean gboolean
glade_app_is_project_loaded (const gchar * project_path) glade_app_is_project_loaded (const gchar *project_path)
{ {
GladeApp *app; GladeApp *app;
GList *list; GList *list;
...@@ -757,7 +752,7 @@ glade_app_is_project_loaded (const gchar * project_path) ...@@ -757,7 +752,7 @@ glade_app_is_project_loaded (const gchar * project_path)
* Returns: A #GladeProject, or NULL if no such open project was found * Returns: A #GladeProject, or NULL if no such open project was found
*/ */
GladeProject * GladeProject *
glade_app_get_project_by_path (const gchar * project_path) glade_app_get_project_by_path (const gchar *project_path)
{ {
GladeApp *app; GladeApp *app;
GList *l; GList *l;
...@@ -788,7 +783,7 @@ glade_app_get_project_by_path (const gchar * project_path) ...@@ -788,7 +783,7 @@ glade_app_get_project_by_path (const gchar * project_path)
} }
void void
glade_app_add_project (GladeProject * project) glade_app_add_project (GladeProject *project)
{ {
GladeApp *app; GladeApp *app;
...@@ -805,7 +800,7 @@ glade_app_add_project (GladeProject * project) ...@@ -805,7 +800,7 @@ glade_app_add_project (GladeProject * project)
} }
void void
glade_app_remove_project (GladeProject * project) glade_app_remove_project (GladeProject *project)
{ {
GladeApp *app; GladeApp *app;
g_return_if_fail (GLADE_IS_PROJECT (project)); g_return_if_fail (GLADE_IS_PROJECT (project));
......
...@@ -114,7 +114,7 @@ enum ...@@ -114,7 +114,7 @@ enum
N_PROPERTIES N_PROPERTIES
}; };
G_DEFINE_TYPE (GladeBaseEditor, glade_base_editor, GTK_TYPE_BOX) G_DEFINE_TYPE_WITH_PRIVATE (GladeBaseEditor, glade_base_editor, GTK_TYPE_BOX)
static GParamSpec *properties[N_PROPERTIES]; static GParamSpec *properties[N_PROPERTIES];
static guint glade_base_editor_signals[LAST_SIGNAL] = { 0 }; static guint glade_base_editor_signals[LAST_SIGNAL] = { 0 };
...@@ -200,7 +200,8 @@ get_children_model_for_child_type (GladeBaseEditor *editor, GType type) ...@@ -200,7 +200,8 @@ get_children_model_for_child_type (GladeBaseEditor *editor, GType type)
static gboolean static gboolean
glade_base_editor_get_type_info (GladeBaseEditor *e, glade_base_editor_get_type_info (GladeBaseEditor *e,
GtkTreeIter *retiter, GtkTreeIter *retiter,
GType child_type, ...) GType child_type,
...)
{ {
GtkTreeModel *model; GtkTreeModel *model;
GtkTreeIter iter; GtkTreeIter iter;
...@@ -1184,7 +1185,7 @@ glade_base_editor_project_changed (GladeProject *project, ...@@ -1184,7 +1185,7 @@ glade_base_editor_project_changed (GladeProject *project,
static void static void
glade_base_editor_project_disconnect (GladeBaseEditor * editor) glade_base_editor_project_disconnect (GladeBaseEditor *editor)
{ {
GladeBaseEditorPrivate *e = editor->priv; GladeBaseEditorPrivate *e = editor->priv;
...@@ -1274,16 +1275,6 @@ glade_base_editor_set_container (GladeBaseEditor *editor, GObject *container) ...@@ -1274,16 +1275,6 @@ glade_base_editor_set_container (GladeBaseEditor *editor, GObject *container)
} }
/*************************** GladeBaseEditor Class ****************************/ /*************************** GladeBaseEditor Class ****************************/
static void
glade_base_editor_finalize (GObject *object)
{
GladeBaseEditor *cobj = GLADE_BASE_EDITOR (object);
g_free (cobj->priv);
G_OBJECT_CLASS (glade_base_editor_parent_class)->finalize (object);
}
static void static void
glade_base_editor_dispose (GObject *object) glade_base_editor_dispose (GObject *object)
{ {
...@@ -1480,7 +1471,6 @@ glade_base_editor_class_init (GladeBaseEditorClass *klass) ...@@ -1480,7 +1471,6 @@ glade_base_editor_class_init (GladeBaseEditorClass *klass)
glade_base_editor_parent_class = g_type_class_peek_parent (klass); glade_base_editor_parent_class = g_type_class_peek_parent (klass);
object_class->finalize = glade_base_editor_finalize;
object_class->dispose = glade_base_editor_dispose; object_class->dispose = glade_base_editor_dispose;
object_class->set_property = glade_base_editor_set_property; object_class->set_property = glade_base_editor_set_property;
object_class->get_property = glade_base_editor_get_property; object_class->get_property = glade_base_editor_get_property;
...@@ -1707,7 +1697,7 @@ glade_base_editor_init (GladeBaseEditor *editor) ...@@ -1707,7 +1697,7 @@ glade_base_editor_init (GladeBaseEditor *editor)
GTK_ORIENTATION_VERTICAL); GTK_ORIENTATION_VERTICAL);
gtk_box_set_spacing (GTK_BOX (editor), 8); gtk_box_set_spacing (GTK_BOX (editor), 8);
e = editor->priv = g_new0 (GladeBaseEditorPrivate, 1); e = editor->priv = glade_base_editor_get_instance_private (editor);
/* Paned */ /* Paned */
e->paned = paned = gtk_paned_new (GTK_ORIENTATION_VERTICAL); e->paned = paned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
...@@ -2077,7 +2067,8 @@ glade_base_editor_add_default_properties (GladeBaseEditor *editor, ...@@ -2077,7 +2067,8 @@ glade_base_editor_add_default_properties (GladeBaseEditor *editor,
void void
glade_base_editor_add_properties (GladeBaseEditor *editor, glade_base_editor_add_properties (GladeBaseEditor *editor,
GladeWidget *gchild, GladeWidget *gchild,
gboolean packing, ...) gboolean packing,
...)
{ {
GladeEditorProperty *eprop; GladeEditorProperty *eprop;
va_list args; va_list args;
...@@ -2183,8 +2174,7 @@ glade_base_editor_add_label (GladeBaseEditor *editor, gchar *str) ...@@ -2183,8 +2174,7 @@ glade_base_editor_add_label (GladeBaseEditor *editor, gchar *str)
* Shows/hide @editor 's signal editor * Shows/hide @editor 's signal editor
*/ */
void void
glade_base_editor_set_show_signal_editor (GladeBaseEditor *editor, glade_base_editor_set_show_signal_editor (GladeBaseEditor *editor, gboolean val)
gboolean val)
{ {
g_return_if_fail (GLADE_IS_BASE_EDITOR (editor)); g_return_if_fail (GLADE_IS_BASE_EDITOR (editor));
......
...@@ -23,22 +23,20 @@ ...@@ -23,22 +23,20 @@
#include "glade-cell-renderer-icon.h" #include "glade-cell-renderer-icon.h"
#include "glade-marshallers.h" #include "glade-marshallers.h"
static void glade_cell_renderer_icon_get_property (GObject * object, static void glade_cell_renderer_icon_get_property (GObject *object,
guint param_id, guint param_id,
GValue * value, GValue *value,
GParamSpec * pspec); GParamSpec *pspec);
static void glade_cell_renderer_icon_set_property (GObject * object, static void glade_cell_renderer_icon_set_property (GObject *object,
guint param_id, guint param_id,
const GValue * value, const GValue *value,
GParamSpec * pspec); GParamSpec *pspec);
static gboolean glade_cell_renderer_icon_activate (GtkCellRenderer * cell, static gboolean glade_cell_renderer_icon_activate (GtkCellRenderer *cell,
GdkEvent * event, GdkEvent *event,
GtkWidget * widget, GtkWidget *widget,
const gchar * path, const gchar *path,
const GdkRectangle * const GdkRectangle *background_area,
background_area, const GdkRectangle *cell_area,
const GdkRectangle *
cell_area,
GtkCellRendererState flags); GtkCellRendererState flags);
struct _GladeCellRendererIconPrivate struct _GladeCellRendererIconPrivate
...@@ -65,15 +63,13 @@ static GParamSpec *properties[N_PROPERTIES]; ...@@ -65,15 +63,13 @@ static GParamSpec *properties[N_PROPERTIES];
static guint icon_cell_signals[LAST_SIGNAL] = { 0 }; static guint icon_cell_signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (GladeCellRendererIcon, glade_cell_renderer_icon, G_DEFINE_TYPE_WITH_PRIVATE (GladeCellRendererIcon,
glade_cell_renderer_icon,
GTK_TYPE_CELL_RENDERER_PIXBUF) GTK_TYPE_CELL_RENDERER_PIXBUF)
static void glade_cell_renderer_icon_init (GladeCellRendererIcon *cellicon) static void glade_cell_renderer_icon_init (GladeCellRendererIcon *cellicon)
{ {
cellicon->priv = cellicon->priv = glade_cell_renderer_icon_get_instance_private (cellicon);
G_TYPE_INSTANCE_GET_PRIVATE ((cellicon),
GLADE_TYPE_CELL_RENDERER_ICON,
GladeCellRendererIconPrivate);
cellicon->priv->activatable = TRUE; cellicon->priv->activatable = TRUE;
cellicon->priv->active = FALSE; cellicon->priv->active = FALSE;
...@@ -83,7 +79,7 @@ static void glade_cell_renderer_icon_init (GladeCellRendererIcon *cellicon) ...@@ -83,7 +79,7 @@ static void glade_cell_renderer_icon_init (GladeCellRendererIcon *cellicon)
} }
static void static void
glade_cell_renderer_icon_class_init (GladeCellRendererIconClass * class) glade_cell_renderer_icon_class_init (GladeCellRendererIconClass *class)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (class); GObjectClass *object_class = G_OBJECT_CLASS (class);
GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (class); GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (class);
...@@ -116,14 +112,13 @@ glade_cell_renderer_icon_class_init (GladeCellRendererIconClass * class) ...@@ -116,14 +112,13 @@ glade_cell_renderer_icon_class_init (GladeCellRendererIconClass * class)
G_STRUCT_OFFSET (GladeCellRendererIconClass, activate), G_STRUCT_OFFSET (GladeCellRendererIconClass, activate),
NULL, NULL, NULL, NULL,
_glade_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); _glade_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
g_type_class_add_private (class, sizeof (GladeCellRendererIconPrivate));
} }
static void static void
glade_cell_renderer_icon_get_property (GObject * object, glade_cell_renderer_icon_get_property (GObject *object,
guint param_id, guint param_id,
GValue * value, GParamSpec * pspec) GValue *value,
GParamSpec *pspec)
{ {
GladeCellRendererIcon *cellicon = GLADE_CELL_RENDERER_ICON (object); GladeCellRendererIcon *cellicon = GLADE_CELL_RENDERER_ICON (object);
...@@ -143,9 +138,10 @@ glade_cell_renderer_icon_get_property (GObject * object, ...@@ -143,9 +138,10 @@ glade_cell_renderer_icon_get_property (GObject * object,
static void static void
glade_cell_renderer_icon_set_property (GObject * object, glade_cell_renderer_icon_set_property (GObject *object,
guint param_id, guint param_id,
const GValue * value, GParamSpec * pspec) const GValue *value,
GParamSpec *pspec)
{ {
GladeCellRendererIcon *cellicon = GLADE_CELL_RENDERER_ICON (object); GladeCellRendererIcon *cellicon = GLADE_CELL_RENDERER_ICON (object);
...@@ -170,12 +166,12 @@ glade_cell_renderer_icon_new (void) ...@@ -170,12 +166,12 @@ glade_cell_renderer_icon_new (void)
} }
static gint static gint
glade_cell_renderer_icon_activate (GtkCellRenderer * cell, glade_cell_renderer_icon_activate (GtkCellRenderer *cell,
GdkEvent * event, GdkEvent *event,
GtkWidget * widget, GtkWidget *widget,
const gchar * path, const gchar *path,
const GdkRectangle * background_area, const GdkRectangle *background_area,
const GdkRectangle * cell_area, const GdkRectangle *cell_area,
GtkCellRendererState flags) GtkCellRendererState flags)
{ {
GladeCellRendererIcon *cellicon; GladeCellRendererIcon *cellicon;
...@@ -191,7 +187,7 @@ glade_cell_renderer_icon_activate (GtkCellRenderer * cell, ...@@ -191,7 +187,7 @@ glade_cell_renderer_icon_activate (GtkCellRenderer * cell,
} }
gboolean gboolean
glade_cell_renderer_icon_get_active (GladeCellRendererIcon * icon) glade_cell_renderer_icon_get_active (GladeCellRendererIcon *icon)
{ {
g_return_val_if_fail (GLADE_IS_CELL_RENDERER_ICON (icon), FALSE); g_return_val_if_fail (GLADE_IS_CELL_RENDERER_ICON (icon), FALSE);
...@@ -199,7 +195,7 @@ glade_cell_renderer_icon_get_active (GladeCellRendererIcon * icon) ...@@ -199,7 +195,7 @@ glade_cell_renderer_icon_get_active (GladeCellRendererIcon * icon)
} }
void void
glade_cell_renderer_icon_set_active (GladeCellRendererIcon * icon, glade_cell_renderer_icon_set_active (GladeCellRendererIcon *icon,
gboolean setting) gboolean setting)
{ {
g_return_if_fail (GLADE_IS_CELL_RENDERER_ICON (icon)); g_return_if_fail (GLADE_IS_CELL_RENDERER_ICON (icon));
...@@ -212,7 +208,7 @@ glade_cell_renderer_icon_set_active (GladeCellRendererIcon * icon, ...@@ -212,7 +208,7 @@ glade_cell_renderer_icon_set_active (GladeCellRendererIcon * icon,
} }
gboolean gboolean
glade_cell_renderer_icon_get_activatable (GladeCellRendererIcon * icon) glade_cell_renderer_icon_get_activatable (GladeCellRendererIcon *icon)
{ {
g_return_val_if_fail (GLADE_IS_CELL_RENDERER_ICON (icon), FALSE); g_return_val_if_fail (GLADE_IS_CELL_RENDERER_ICON (icon), FALSE);
...@@ -220,7 +216,7 @@ glade_cell_renderer_icon_get_activatable (GladeCellRendererIcon * icon) ...@@ -220,7 +216,7 @@ glade_cell_renderer_icon_get_activatable (GladeCellRendererIcon * icon)
} }
void void
glade_cell_renderer_icon_set_activatable (GladeCellRendererIcon * icon, glade_cell_renderer_icon_set_activatable (GladeCellRendererIcon *icon,
gboolean setting) gboolean setting)
{ {
g_return_if_fail (GLADE_IS_CELL_RENDERER_ICON (icon)); g_return_if_fail (GLADE_IS_CELL_RENDERER_ICON (icon));
......
...@@ -55,11 +55,13 @@ enum ...@@ -55,11 +55,13 @@ enum
static GParamSpec *properties[N_PROPERTIES]; static GParamSpec *properties[N_PROPERTIES];
G_DEFINE_TYPE (GladeClipboard, glade_clipboard, G_TYPE_OBJECT); G_DEFINE_TYPE_WITH_PRIVATE (GladeClipboard, glade_clipboard, G_TYPE_OBJECT);
static void static void
glade_project_get_property (GObject * object, glade_project_get_property (GObject *object,
guint prop_id, GValue * value, GParamSpec * pspec) guint prop_id,
GValue *value,
GParamSpec *pspec)
{ {
GladeClipboard *clipboard = GLADE_CLIPBOARD (object); GladeClipboard *clipboard = GLADE_CLIPBOARD (object);
...@@ -92,24 +94,19 @@ glade_clipboard_class_init (GladeClipboardClass * klass) ...@@ -92,24 +94,19 @@ glade_clipboard_class_init (GladeClipboardClass * klass)
/* Install all properties */ /* Install all properties */
g_object_class_install_properties (object_class, N_PROPERTIES, properties); g_object_class_install_properties (object_class, N_PROPERTIES, properties);
g_type_class_add_private (klass, sizeof (GladeClipboardPrivate));
} }
static void static void
glade_clipboard_init (GladeClipboard * clipboard) glade_clipboard_init (GladeClipboard *clipboard)
{ {
clipboard->priv = clipboard->priv = glade_clipboard_get_instance_private (clipboard);
G_TYPE_INSTANCE_GET_PRIVATE (clipboard,
GLADE_TYPE_CLIPBOARD,
GladeClipboardPrivate);
clipboard->priv->widgets = NULL; clipboard->priv->widgets = NULL;
clipboard->priv->has_selection = FALSE; clipboard->priv->has_selection = FALSE;
} }
static void static void
glade_clipboard_set_has_selection (GladeClipboard * clipboard, glade_clipboard_set_has_selection (GladeClipboard *clipboard,
gboolean has_selection) gboolean has_selection)
{ {
if (clipboard->priv->has_selection != has_selection) if (clipboard->priv->has_selection != has_selection)
...@@ -127,7 +124,7 @@ glade_clipboard_set_has_selection (GladeClipboard * clipboard, ...@@ -127,7 +124,7 @@ glade_clipboard_set_has_selection (GladeClipboard * clipboard,
* Returns: TRUE if this clipboard has selected items to paste. * Returns: TRUE if this clipboard has selected items to paste.
*/ */
gboolean gboolean
glade_clipboard_get_has_selection (GladeClipboard * clipboard) glade_clipboard_get_has_selection (GladeClipboard *clipboard)
{ {
g_return_val_if_fail (GLADE_IS_CLIPBOARD (clipboard), FALSE); g_return_val_if_fail (GLADE_IS_CLIPBOARD (clipboard), FALSE);
...@@ -163,7 +160,7 @@ glade_clipboard_new (void) ...@@ -163,7 +160,7 @@ glade_clipboard_new (void)
* This increases the reference count of each #GladeWidget in @widgets. * This increases the reference count of each #GladeWidget in @widgets.
*/ */
void void
glade_clipboard_add (GladeClipboard * clipboard, GList * widgets) glade_clipboard_add (GladeClipboard *clipboard, GList *widgets)
{ {
GladeWidget *widget; GladeWidget *widget;
GList *list; GList *list;
...@@ -192,7 +189,7 @@ glade_clipboard_add (GladeClipboard * clipboard, GList * widgets) ...@@ -192,7 +189,7 @@ glade_clipboard_add (GladeClipboard * clipboard, GList * widgets)
* Removes all widgets from the @clipboard. * Removes all widgets from the @clipboard.
*/ */
void void
glade_clipboard_clear (GladeClipboard * clipboard) glade_clipboard_clear (GladeClipboard *clipboard)
{ {
GladeWidget *widget; GladeWidget *widget;
GList *list; GList *list;
......
...@@ -94,7 +94,7 @@ static gint gc_group_id = 1; ...@@ -94,7 +94,7 @@ static gint gc_group_id = 1;
static gint gc_group_depth = 0; static gint gc_group_depth = 0;
G_DEFINE_TYPE (GladeCommand, glade_command, G_TYPE_OBJECT) G_DEFINE_TYPE_WITH_PRIVATE (GladeCommand, glade_command, G_TYPE_OBJECT)
static void static void
glade_command_finalize (GObject *obj) glade_command_finalize (GObject *obj)
...@@ -124,9 +124,7 @@ glade_command_collapse_impl (GladeCommand *this_cmd, GladeCommand *other_cmd) ...@@ -124,9 +124,7 @@ glade_command_collapse_impl (GladeCommand *this_cmd, GladeCommand *other_cmd)
static void static void
glade_command_init (GladeCommand *command) glade_command_init (GladeCommand *command)
{ {
command->priv = command->priv = glade_command_get_instance_private (command);
G_TYPE_INSTANCE_GET_PRIVATE ((command), GLADE_TYPE_COMMAND,
GladeCommandPrivate);
} }
static void static void
...@@ -142,8 +140,6 @@ glade_command_class_init (GladeCommandClass *klass) ...@@ -142,8 +140,6 @@ glade_command_class_init (GladeCommandClass *klass)
klass->execute = NULL; klass->execute = NULL;
klass->unifies = glade_command_unifies_impl; klass->unifies = glade_command_unifies_impl;
klass->collapse = glade_command_collapse_impl; klass->collapse = glade_command_collapse_impl;
g_type_class_add_private (klass, sizeof (GladeCommandPrivate));
} }
/* Macros for defining the derived command types */ /* Macros for defining the derived command types */
......
...@@ -35,9 +35,6 @@ ...@@ -35,9 +35,6 @@
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#define GLADE_DESIGN_LAYOUT_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), \
GLADE_TYPE_DESIGN_LAYOUT, \
GladeDesignLayoutPrivate))
#define GLADE_DESIGN_LAYOUT_PRIVATE(object) (((GladeDesignLayout*)object)->priv) #define GLADE_DESIGN_LAYOUT_PRIVATE(object) (((GladeDesignLayout*)object)->priv)
#define OUTLINE_WIDTH 4 #define OUTLINE_WIDTH 4
...@@ -124,7 +121,7 @@ enum ...@@ -124,7 +121,7 @@ enum
PROP_DESIGN_VIEW PROP_DESIGN_VIEW
}; };
G_DEFINE_TYPE (GladeDesignLayout, glade_design_layout, GTK_TYPE_BIN) G_DEFINE_TYPE_WITH_PRIVATE (GladeDesignLayout, glade_design_layout, GTK_TYPE_BIN)
#define RECTANGLE_POINT_IN(rect,x,y) (x >= rect.x && x <= (rect.x + rect.width) && y >= rect.y && y <= (rect.y + rect.height)) #define RECTANGLE_POINT_IN(rect,x,y) (x >= rect.x && x <= (rect.x + rect.width) && y >= rect.y && y <= (rect.y + rect.height))
...@@ -174,7 +171,7 @@ gdl_get_margins_from_pointer (GladeDesignLayout *layout, GtkWidget *widget, gint ...@@ -174,7 +171,7 @@ gdl_get_margins_from_pointer (GladeDesignLayout *layout, GtkWidget *widget, gint
static Activity static Activity
gdl_get_activity_from_pointer (GladeDesignLayout *layout, gint x, gint y) gdl_get_activity_from_pointer (GladeDesignLayout *layout, gint x, gint y)
{ {
GladeDesignLayoutPrivate *priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (layout); GladeDesignLayoutPrivate *priv = GLADE_DESIGN_LAYOUT_PRIVATE (layout);
if (priv->selection) if (priv->selection)
{ {
...@@ -1787,7 +1784,7 @@ glade_design_layout_unrealize (GtkWidget * widget) ...@@ -1787,7 +1784,7 @@ glade_design_layout_unrealize (GtkWidget * widget)
static void static void
glade_design_layout_style_updated (GtkWidget *widget) glade_design_layout_style_updated (GtkWidget *widget)
{ {
GladeDesignLayoutPrivate *priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget); GladeDesignLayoutPrivate *priv = GLADE_DESIGN_LAYOUT_PRIVATE (widget);
_glade_design_layout_get_colors (gtk_widget_get_style_context (widget), _glade_design_layout_get_colors (gtk_widget_get_style_context (widget),
&priv->frame_color[0], &priv->frame_color[0],
...@@ -1805,7 +1802,7 @@ glade_design_layout_init (GladeDesignLayout *layout) ...@@ -1805,7 +1802,7 @@ glade_design_layout_init (GladeDesignLayout *layout)
GladeDesignLayoutPrivate *priv; GladeDesignLayoutPrivate *priv;
gint i; gint i;
layout->priv = priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (layout); layout->priv = priv = glade_design_layout_get_instance_private (layout);
priv->activity = ACTIVITY_NONE; priv->activity = ACTIVITY_NONE;
...@@ -2059,8 +2056,6 @@ glade_design_layout_class_init (GladeDesignLayoutClass * klass) ...@@ -2059,8 +2056,6 @@ glade_design_layout_class_init (GladeDesignLayoutClass * klass)
GLADE_TYPE_DESIGN_LAYOUT, GLADE_TYPE_DESIGN_LAYOUT,
g_cclosure_new (G_CALLBACK (glade_design_layout_damage), g_cclosure_new (G_CALLBACK (glade_design_layout_damage),
NULL, NULL)); NULL, NULL));
g_type_class_add_private (object_class, sizeof (GladeDesignLayoutPrivate));
} }
/* Internal API */ /* Internal API */
......
...@@ -45,8 +45,6 @@ ...@@ -45,8 +45,6 @@
#include <glib.h> #include <glib.h>
#include <glib/gi18n.h> #include <glib/gi18n.h>