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 @@
#define GLADE_CONFIG_FILENAME "glade.conf"
#define GLADE_APP_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), \
GLADE_TYPE_APP, \
GladeAppPrivate))
enum
{
DOC_SEARCH,
......@@ -91,7 +88,7 @@ static gchar *lib_dir = NULL;
static GladeApp *singleton_app = NULL;
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 *
......@@ -99,7 +96,7 @@ G_DEFINE_TYPE (GladeApp, glade_app, G_TYPE_OBJECT);
static GObject *
glade_app_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam * construct_properties)
GObjectConstructParam *construct_properties)
{
GObject *object;
......@@ -122,7 +119,7 @@ glade_app_constructor (GType type,
static void
glade_app_dispose (GObject * app)
glade_app_dispose (GObject *app)
{
GladeAppPrivate *priv = GLADE_APP (app)->priv;
......@@ -143,7 +140,7 @@ glade_app_dispose (GObject * app)
}
static void
glade_app_finalize (GObject * app)
glade_app_finalize (GObject *app)
{
g_free (catalogs_dir);
g_free (modules_dir);
......@@ -370,7 +367,7 @@ static void
glade_app_init (GladeApp *app)
{
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;
......@@ -407,7 +404,7 @@ glade_app_event_handler (GdkEvent *event, gpointer data)
}
static void
glade_app_class_init (GladeAppClass * klass)
glade_app_class_init (GladeAppClass *klass)
{
GObjectClass *object_class;
......@@ -467,8 +464,6 @@ glade_app_class_init (GladeAppClass * klass)
_glade_marshal_VOID__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);
}
......@@ -633,7 +628,7 @@ glade_app_get (void)
}
void
glade_app_set_window (GtkWidget * window)
glade_app_set_window (GtkWidget *window)
{
GladeApp *app = glade_app_get ();
......@@ -641,7 +636,7 @@ glade_app_set_window (GtkWidget * window)
}
GladeCatalog *
glade_app_get_catalog (const gchar * name)
glade_app_get_catalog (const gchar *name)
{
GladeApp *app = glade_app_get ();
GList *list;
......@@ -659,7 +654,7 @@ glade_app_get_catalog (const gchar * name)
}
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);
......@@ -725,7 +720,7 @@ glade_app_get_config (void)
}
gboolean
glade_app_is_project_loaded (const gchar * project_path)
glade_app_is_project_loaded (const gchar *project_path)
{
GladeApp *app;
GList *list;
......@@ -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
*/
GladeProject *
glade_app_get_project_by_path (const gchar * project_path)
glade_app_get_project_by_path (const gchar *project_path)
{
GladeApp *app;
GList *l;
......@@ -788,7 +783,7 @@ glade_app_get_project_by_path (const gchar * project_path)
}
void
glade_app_add_project (GladeProject * project)
glade_app_add_project (GladeProject *project)
{
GladeApp *app;
......@@ -805,7 +800,7 @@ glade_app_add_project (GladeProject * project)
}
void
glade_app_remove_project (GladeProject * project)
glade_app_remove_project (GladeProject *project)
{
GladeApp *app;
g_return_if_fail (GLADE_IS_PROJECT (project));
......
......@@ -114,7 +114,7 @@ enum
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 guint glade_base_editor_signals[LAST_SIGNAL] = { 0 };
......@@ -200,7 +200,8 @@ get_children_model_for_child_type (GladeBaseEditor *editor, GType type)
static gboolean
glade_base_editor_get_type_info (GladeBaseEditor *e,
GtkTreeIter *retiter,
GType child_type, ...)
GType child_type,
...)
{
GtkTreeModel *model;
GtkTreeIter iter;
......@@ -1184,7 +1185,7 @@ glade_base_editor_project_changed (GladeProject *project,
static void
glade_base_editor_project_disconnect (GladeBaseEditor * editor)
glade_base_editor_project_disconnect (GladeBaseEditor *editor)
{
GladeBaseEditorPrivate *e = editor->priv;
......@@ -1274,16 +1275,6 @@ glade_base_editor_set_container (GladeBaseEditor *editor, GObject *container)
}
/*************************** 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
glade_base_editor_dispose (GObject *object)
{
......@@ -1480,7 +1471,6 @@ glade_base_editor_class_init (GladeBaseEditorClass *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->set_property = glade_base_editor_set_property;
object_class->get_property = glade_base_editor_get_property;
......@@ -1707,7 +1697,7 @@ glade_base_editor_init (GladeBaseEditor *editor)
GTK_ORIENTATION_VERTICAL);
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 */
e->paned = paned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
......@@ -2077,7 +2067,8 @@ glade_base_editor_add_default_properties (GladeBaseEditor *editor,
void
glade_base_editor_add_properties (GladeBaseEditor *editor,
GladeWidget *gchild,
gboolean packing, ...)
gboolean packing,
...)
{
GladeEditorProperty *eprop;
va_list args;
......@@ -2183,8 +2174,7 @@ glade_base_editor_add_label (GladeBaseEditor *editor, gchar *str)
* Shows/hide @editor 's signal editor
*/
void
glade_base_editor_set_show_signal_editor (GladeBaseEditor *editor,
gboolean val)
glade_base_editor_set_show_signal_editor (GladeBaseEditor *editor, gboolean val)
{
g_return_if_fail (GLADE_IS_BASE_EDITOR (editor));
......
......@@ -23,22 +23,20 @@
#include "glade-cell-renderer-icon.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,
GValue * value,
GParamSpec * pspec);
static void glade_cell_renderer_icon_set_property (GObject * object,
GValue *value,
GParamSpec *pspec);
static void glade_cell_renderer_icon_set_property (GObject *object,
guint param_id,
const GValue * value,
GParamSpec * pspec);
static gboolean glade_cell_renderer_icon_activate (GtkCellRenderer * cell,
GdkEvent * event,
GtkWidget * widget,
const gchar * path,
const GdkRectangle *
background_area,
const GdkRectangle *
cell_area,
const GValue *value,
GParamSpec *pspec);
static gboolean glade_cell_renderer_icon_activate (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
const gchar *path,
const GdkRectangle *background_area,
const GdkRectangle *cell_area,
GtkCellRendererState flags);
struct _GladeCellRendererIconPrivate
......@@ -65,15 +63,13 @@ static GParamSpec *properties[N_PROPERTIES];
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)
static void glade_cell_renderer_icon_init (GladeCellRendererIcon *cellicon)
{
cellicon->priv =
G_TYPE_INSTANCE_GET_PRIVATE ((cellicon),
GLADE_TYPE_CELL_RENDERER_ICON,
GladeCellRendererIconPrivate);
cellicon->priv = glade_cell_renderer_icon_get_instance_private (cellicon);
cellicon->priv->activatable = TRUE;
cellicon->priv->active = FALSE;
......@@ -83,7 +79,7 @@ static void glade_cell_renderer_icon_init (GladeCellRendererIcon *cellicon)
}
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);
GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (class);
......@@ -116,14 +112,13 @@ glade_cell_renderer_icon_class_init (GladeCellRendererIconClass * class)
G_STRUCT_OFFSET (GladeCellRendererIconClass, activate),
NULL, NULL,
_glade_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
g_type_class_add_private (class, sizeof (GladeCellRendererIconPrivate));
}
static void
glade_cell_renderer_icon_get_property (GObject * object,
glade_cell_renderer_icon_get_property (GObject *object,
guint param_id,
GValue * value, GParamSpec * pspec)
GValue *value,
GParamSpec *pspec)
{
GladeCellRendererIcon *cellicon = GLADE_CELL_RENDERER_ICON (object);
......@@ -143,9 +138,10 @@ glade_cell_renderer_icon_get_property (GObject * object,
static void
glade_cell_renderer_icon_set_property (GObject * object,
glade_cell_renderer_icon_set_property (GObject *object,
guint param_id,
const GValue * value, GParamSpec * pspec)
const GValue *value,
GParamSpec *pspec)
{
GladeCellRendererIcon *cellicon = GLADE_CELL_RENDERER_ICON (object);
......@@ -170,12 +166,12 @@ glade_cell_renderer_icon_new (void)
}
static gint
glade_cell_renderer_icon_activate (GtkCellRenderer * cell,
GdkEvent * event,
GtkWidget * widget,
const gchar * path,
const GdkRectangle * background_area,
const GdkRectangle * cell_area,
glade_cell_renderer_icon_activate (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
const gchar *path,
const GdkRectangle *background_area,
const GdkRectangle *cell_area,
GtkCellRendererState flags)
{
GladeCellRendererIcon *cellicon;
......@@ -191,7 +187,7 @@ glade_cell_renderer_icon_activate (GtkCellRenderer * cell,
}
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);
......@@ -199,7 +195,7 @@ glade_cell_renderer_icon_get_active (GladeCellRendererIcon * icon)
}
void
glade_cell_renderer_icon_set_active (GladeCellRendererIcon * icon,
glade_cell_renderer_icon_set_active (GladeCellRendererIcon *icon,
gboolean setting)
{
g_return_if_fail (GLADE_IS_CELL_RENDERER_ICON (icon));
......@@ -212,7 +208,7 @@ glade_cell_renderer_icon_set_active (GladeCellRendererIcon * icon,
}
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);
......@@ -220,7 +216,7 @@ glade_cell_renderer_icon_get_activatable (GladeCellRendererIcon * icon)
}
void
glade_cell_renderer_icon_set_activatable (GladeCellRendererIcon * icon,
glade_cell_renderer_icon_set_activatable (GladeCellRendererIcon *icon,
gboolean setting)
{
g_return_if_fail (GLADE_IS_CELL_RENDERER_ICON (icon));
......
......@@ -55,11 +55,13 @@ enum
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
glade_project_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec)
glade_project_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GladeClipboard *clipboard = GLADE_CLIPBOARD (object);
......@@ -92,24 +94,19 @@ glade_clipboard_class_init (GladeClipboardClass * klass)
/* Install all properties */
g_object_class_install_properties (object_class, N_PROPERTIES, properties);
g_type_class_add_private (klass, sizeof (GladeClipboardPrivate));
}
static void
glade_clipboard_init (GladeClipboard * clipboard)
glade_clipboard_init (GladeClipboard *clipboard)
{
clipboard->priv =
G_TYPE_INSTANCE_GET_PRIVATE (clipboard,
GLADE_TYPE_CLIPBOARD,
GladeClipboardPrivate);
clipboard->priv = glade_clipboard_get_instance_private (clipboard);
clipboard->priv->widgets = NULL;
clipboard->priv->has_selection = FALSE;
}
static void
glade_clipboard_set_has_selection (GladeClipboard * clipboard,
glade_clipboard_set_has_selection (GladeClipboard *clipboard,
gboolean has_selection)
{
if (clipboard->priv->has_selection != has_selection)
......@@ -127,7 +124,7 @@ glade_clipboard_set_has_selection (GladeClipboard * clipboard,
* Returns: TRUE if this clipboard has selected items to paste.
*/
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);
......@@ -163,7 +160,7 @@ glade_clipboard_new (void)
* This increases the reference count of each #GladeWidget in @widgets.
*/
void
glade_clipboard_add (GladeClipboard * clipboard, GList * widgets)
glade_clipboard_add (GladeClipboard *clipboard, GList *widgets)
{
GladeWidget *widget;
GList *list;
......@@ -192,7 +189,7 @@ glade_clipboard_add (GladeClipboard * clipboard, GList * widgets)
* Removes all widgets from the @clipboard.
*/
void
glade_clipboard_clear (GladeClipboard * clipboard)
glade_clipboard_clear (GladeClipboard *clipboard)
{
GladeWidget *widget;
GList *list;
......
......@@ -94,7 +94,7 @@ static gint gc_group_id = 1;
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
glade_command_finalize (GObject *obj)
......@@ -124,9 +124,7 @@ glade_command_collapse_impl (GladeCommand *this_cmd, GladeCommand *other_cmd)
static void
glade_command_init (GladeCommand *command)
{
command->priv =
G_TYPE_INSTANCE_GET_PRIVATE ((command), GLADE_TYPE_COMMAND,
GladeCommandPrivate);
command->priv = glade_command_get_instance_private (command);
}
static void
......@@ -142,8 +140,6 @@ glade_command_class_init (GladeCommandClass *klass)
klass->execute = NULL;
klass->unifies = glade_command_unifies_impl;
klass->collapse = glade_command_collapse_impl;
g_type_class_add_private (klass, sizeof (GladeCommandPrivate));
}
/* Macros for defining the derived command types */
......
......@@ -35,9 +35,6 @@
#include <glib/gi18n-lib.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 OUTLINE_WIDTH 4
......@@ -124,7 +121,7 @@ enum
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))
......@@ -174,7 +171,7 @@ gdl_get_margins_from_pointer (GladeDesignLayout *layout, GtkWidget *widget, gint
static Activity
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)
{
......@@ -1787,7 +1784,7 @@ glade_design_layout_unrealize (GtkWidget * widget)
static void
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),
&priv->frame_color[0],
......@@ -1805,7 +1802,7 @@ glade_design_layout_init (GladeDesignLayout *layout)
GladeDesignLayoutPrivate *priv;
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;
......@@ -2059,8 +2056,6 @@ glade_design_layout_class_init (GladeDesignLayoutClass * klass)
GLADE_TYPE_DESIGN_LAYOUT,
g_cclosure_new (G_CALLBACK (glade_design_layout_damage),
NULL, NULL));
g_type_class_add_private (object_class, sizeof (GladeDesignLayoutPrivate));
}
/* Internal API */
......
......@@ -45,8 +45,6 @@
#include <glib.h>
#include <glib/gi18n.h>
#define GLADE_DESIGN_VIEW_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GLADE_TYPE_DESIGN_VIEW, GladeDesignViewPrivate))
#define GLADE_DESIGN_VIEW_KEY "GLADE_DESIGN_VIEW_KEY"
enum
......@@ -71,6 +69,7 @@ static GtkVBoxClass *parent_class = NULL;
static void glade_design_view_drag_init (_GladeDragInterface *iface);
G_DEFINE_TYPE_WITH_CODE (GladeDesignView, glade_design_view, GTK_TYPE_BOX,
G_ADD_PRIVATE (GladeDesignView)
G_IMPLEMENT_INTERFACE (GLADE_TYPE_DRAG,
glade_design_view_drag_init))
......@@ -328,7 +327,7 @@ logo_draw (GtkWidget *widget, cairo_t *cr)
static gboolean
glade_design_view_draw (GtkWidget *widget, cairo_t *cr)
{
GladeDesignViewPrivate *priv = GLADE_DESIGN_VIEW_GET_PRIVATE (widget);
GladeDesignViewPrivate *priv = GLADE_DESIGN_VIEW (widget)->priv;
GdkWindow *window = gtk_widget_get_window (widget);
gboolean should_draw = gtk_cairo_should_draw_window (cr, window);
gboolean sw_visible = gtk_widget_get_visible (priv->scrolled_window);
......@@ -370,7 +369,7 @@ glade_design_view_init (GladeDesignView *view)
{
GtkWidget *viewport;
view->priv = GLADE_DESIGN_VIEW_GET_PRIVATE (view);
view->priv = glade_design_view_get_instance_private (view);
gtk_widget_set_no_show_all (GTK_WIDGET (view), TRUE);
gtk_orientable_set_orientation (GTK_ORIENTABLE (view),
......@@ -715,8 +714,6 @@ glade_design_view_class_init (GladeDesignViewClass *klass)
GLADE_TYPE_PROJECT,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_type_class_add_private (object_class, sizeof (GladeDesignViewPrivate));
}
/* Private API */
......
......@@ -115,6 +115,7 @@ static void glade_editor_property_editable_init (GladeEditableIface *iface);
static GladeEditableIface *parent_editable_iface;
G_DEFINE_TYPE_WITH_CODE (GladeEditorProperty, glade_editor_property, GTK_TYPE_BOX,
G_ADD_PRIVATE (GladeEditorProperty)
G_IMPLEMENT_INTERFACE (GLADE_TYPE_EDITABLE,
glade_editor_property_editable_init));
......@@ -597,10 +598,7 @@ glade_editor_property_load_common (GladeEditorProperty *eprop,
static void
glade_editor_property_init (GladeEditorProperty *eprop)
{
eprop->priv =
G_TYPE_INSTANCE_GET_PRIVATE ((eprop),
GLADE_TYPE_EDITOR_PROPERTY,
GladeEditorPropertyPrivate);
eprop->priv = glade_editor_property_get_instance_private (eprop);
gtk_orientable_set_orientation (GTK_ORIENTABLE (eprop),
GTK_ORIENTATION_HORIZONTAL);
......@@ -692,8 +690,6 @@ glade_editor_property_class_init (GladeEditorPropertyClass *eprop_class)
("custom-text", _("Custom Text"),
_("Custom Text to display in the property label"),
NULL, G_PARAM_READWRITE));
g_type_class_add_private (eprop_class, sizeof (GladeEditorPropertyPrivate));
}
/*******************************************************************************
......
......@@ -49,6 +49,7 @@ static GladeEditableIface *parent_editable_iface;
static GtkBuildableIface *parent_buildable_iface;
G_DEFINE_TYPE_WITH_CODE (GladeEditorSkeleton, glade_editor_skeleton, GTK_TYPE_BOX,
G_ADD_PRIVATE (GladeEditorSkeleton)
G_IMPLEMENT_INTERFACE (GLADE_TYPE_EDITABLE,
glade_editor_skeleton_editable_init)
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
......@@ -57,20 +58,15 @@ G_DEFINE_TYPE_WITH_CODE (GladeEditorSkeleton, glade_editor_skeleton, GTK_TYPE_BO
static void
glade_editor_skeleton_init (GladeEditorSkeleton *skeleton)
{
skeleton->priv =
G_TYPE_INSTANCE_GET_PRIVATE (skeleton,
GLADE_TYPE_EDITOR_SKELETON,
GladeEditorSkeletonPrivate);
skeleton->priv = glade_editor_skeleton_get_instance_private (skeleton);
}
static void
glade_editor_skeleton_class_init (GladeEditorSkeletonClass *class)
glade_editor_skeleton_class_init (GladeEditorSkeletonClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->dispose = glade_editor_skeleton_dispose;
g_type_class_add_private (gobject_class, sizeof (GladeEditorSkeletonPrivate));
}
/***********************************************************
......@@ -114,7 +110,7 @@ glade_editor_skeleton_load (GladeEditable *editable,
}
static void
glade_editor_skeleton_set_show_name (GladeEditable * editable, gboolean show_name)
glade_editor_skeleton_set_show_name (GladeEditable *editable, gboolean show_name)
{
GladeEditorSkeleton *skeleton = GLADE_EDITOR_SKELETON (editable);
GladeEditorSkeletonPrivate *priv = skeleton->priv;
......@@ -129,7 +125,7 @@ glade_editor_skeleton_set_show_name (GladeEditable * editable, gboolean show_nam
}
static void
glade_editor_skeleton_editable_init (GladeEditableIface * iface)
glade_editor_skeleton_editable_init (GladeEditableIface *iface)
{
parent_editable_iface = g_type_default_interface_peek (GLADE_TYPE_EDITABLE);
......
......@@ -100,11 +100,12 @@ enum {
};
G_DEFINE_TYPE_WITH_CODE (GladeEditorTable, glade_editor_table, GTK_TYPE_GRID,
G_ADD_PRIVATE (GladeEditorTable)
G_IMPLEMENT_INTERFACE (GLADE_TYPE_EDITABLE,
glade_editor_table_editable_init));
static void
glade_editor_table_class_init (GladeEditorTableClass * klass)
glade_editor_table_class_init (GladeEditorTableClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
......@@ -121,17 +122,12 @@ glade_editor_table_class_init (GladeEditorTableClass * klass)
_("The editor page type to create this GladeEditorTable for"),
GLADE_TYPE_EDITOR_PAGE_TYPE, GLADE_PAGE_GENERAL,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
g_type_class_add_private (klass, sizeof (GladeEditorTablePrivate));
}
static void
glade_editor_table_init (GladeEditorTable * self)
glade_editor_table_init (GladeEditorTable *self)
{
self->priv =
G_TYPE_INSTANCE_GET_PRIVATE ((self),
GLADE_TYPE_EDITOR_TABLE,
GladeEditorTablePrivate);
self->priv = glade_editor_table_get_instance_private (self);
gtk_orientable_set_orientation (GTK_ORIENTABLE (self),
GTK_ORIENTATION_VERTICAL);
......@@ -143,7 +139,7 @@ glade_editor_table_init (GladeEditorTable * self)
}
static void
glade_editor_table_dispose (GObject * object)
glade_editor_table_dispose (GObject *object)
{
GladeEditorTable *table = GLADE_EDITOR_TABLE (object);
......@@ -179,7 +175,7 @@ glade_editor_table_set_property (GObject *object,
}
static void
glade_editor_table_realize (GtkWidget * widget)
glade_editor_table_realize (GtkWidget *widget)
{
GladeEditorTable *table = GLADE_EDITOR_TABLE (widget);
GList *list;
......@@ -196,7 +192,7 @@ glade_editor_table_realize (GtkWidget * widget)
}
static void
glade_editor_table_grab_focus (GtkWidget * widget)
glade_editor_table_grab_focus (GtkWidget *widget)
{
GladeEditorTable *editor_table = GLADE_EDITOR_TABLE (widget);
......@@ -210,7 +206,7 @@ glade_editor_table_grab_focus (GtkWidget * widget)
}
static void
widget_name_edited (GtkWidget * editable, GladeEditorTable * table)
widget_name_edited (GtkWidget *editable, GladeEditorTable *table)
{
GladeWidget *widget;
gchar *new_name;
......@@ -300,7 +296,7 @@ widget_composite_changed (GladeWidget *widget,
}
static void
widget_finalized (GladeEditorTable * table, GladeWidget * where_widget_was)
widget_finalized (GladeEditorTable *table, GladeWidget *where_widget_was)
{
table->priv->loaded_widget = NULL;
......@@ -309,7 +305,7 @@ widget_finalized (GladeEditorTable * table, GladeWidget * where_widget_was)
static void
glade_editor_table_load (GladeEditable * editable, GladeWidget * widget)
glade_editor_table_load (GladeEditable *editable, GladeWidget *widget)
{
GladeEditorTable *table = GLADE_EDITOR_TABLE (editable);
GladeEditorProperty *property;
......@@ -392,7 +388,7 @@ glade_editor_table_load (GladeEditable * editable, GladeWidget * widget)
}
static void
glade_editor_table_set_show_name (GladeEditable * editable, gboolean show_name)
glade_editor_table_set_show_name (GladeEditable *editable, gboolean show_name)
{
GladeEditorTable *table = GLADE_EDITOR_TABLE (editable);
......@@ -409,7 +405,7 @@ glade_editor_table_set_show_name (GladeEditable * editable, gboolean show_name)
}
static void
glade_editor_table_editable_init (GladeEditableIface * iface)
glade_editor_table_editable_init (GladeEditableIface *iface)
{
iface->load = glade_editor_table_load;
iface->set_show_name = glade_editor_table_set_show_name;
......@@ -466,7 +462,7 @@ property_class_comp (gconstpointer a, gconstpointer b)
}
static GList *
get_sorted_properties (GladeWidgetAdaptor * adaptor, GladeEditorPageType type)
get_sorted_properties (GladeWidgetAdaptor *adaptor, GladeEditorPageType type)
{
const GList *l, *properties;
GList *list = NULL;
......@@ -497,8 +493,9 @@ get_sorted_properties (GladeWidgetAdaptor * adaptor, GladeEditorPageType type)
}
static GladeEditorProperty *
append_item (GladeEditorTable * table,
GladePropertyClass * klass, gboolean from_query_dialog)