diff options
Diffstat (limited to 'lib/egg')
-rw-r--r-- | lib/egg/egg-editable-toolbar.c | 35 | ||||
-rw-r--r-- | lib/egg/egg-toolbar-editor.c | 36 | ||||
-rw-r--r-- | lib/egg/egg-toolbars-model.c | 41 | ||||
-rw-r--r-- | lib/egg/eggtreemultidnd.c | 2 | ||||
-rwxr-xr-x | lib/egg/update-toolbareditor-from-libegg | 21 | ||||
-rwxr-xr-x | lib/egg/update-toolbareditor-from-libegg.sh | 35 |
6 files changed, 46 insertions, 124 deletions
diff --git a/lib/egg/egg-editable-toolbar.c b/lib/egg/egg-editable-toolbar.c index 2b26b4eaa..4d15dff07 100644 --- a/lib/egg/egg-editable-toolbar.c +++ b/lib/egg/egg-editable-toolbar.c @@ -48,8 +48,6 @@ #include <glib/gi18n.h> #include <string.h> -static void egg_editable_toolbar_class_init (EggEditableToolbarClass *klass); -static void egg_editable_toolbar_init (EggEditableToolbar *etoolbar); static GdkPixbuf * new_separator_pixbuf (void); #define MIN_TOOLBAR_HEIGHT 20 @@ -78,8 +76,6 @@ enum static guint egg_editable_toolbar_signals[LAST_SIGNAL] = { 0 }; -static GObjectClass *parent_class = NULL; - #define EGG_EDITABLE_TOOLBAR_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EGG_TYPE_EDITABLE_TOOLBAR, EggEditableToolbarPrivate)) struct _EggEditableToolbarPrivate @@ -104,32 +100,7 @@ struct _EggEditableToolbarPrivate GtkToolItem *dnd_toolitem; }; -GType -egg_editable_toolbar_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - static const GTypeInfo our_info = { - sizeof (EggEditableToolbarClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) egg_editable_toolbar_class_init, - NULL, - NULL, /* class_data */ - sizeof (EggEditableToolbar), - 0, /* n_preallocs */ - (GInstanceInitFunc) egg_editable_toolbar_init - }; - - type = g_type_register_static (GTK_TYPE_VBOX, - "EggEditableToolbar", - &our_info, 0); - } - - return type; -} +G_DEFINE_TYPE (EggEditableToolbar, egg_editable_toolbar, GTK_TYPE_VBOX); static int get_dock_position (EggEditableToolbar *etoolbar, @@ -1412,7 +1383,7 @@ egg_editable_toolbar_dispose (GObject *object) priv->model = NULL; } - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (egg_editable_toolbar_parent_class)->dispose (object); } static void @@ -1584,8 +1555,6 @@ egg_editable_toolbar_class_init (EggEditableToolbarClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); - object_class->dispose = egg_editable_toolbar_dispose; object_class->set_property = egg_editable_toolbar_set_property; object_class->get_property = egg_editable_toolbar_get_property; diff --git a/lib/egg/egg-toolbar-editor.c b/lib/egg/egg-toolbar-editor.c index fdf6e3f0f..07674d470 100644 --- a/lib/egg/egg-toolbar-editor.c +++ b/lib/egg/egg-toolbar-editor.c @@ -44,8 +44,7 @@ static const GtkTargetEntry source_drag_types[] = { {EGG_TOOLBAR_ITEM_TYPE, GTK_TARGET_SAME_APP, 0}, }; -static void egg_toolbar_editor_class_init (EggToolbarEditorClass *klass); -static void egg_toolbar_editor_init (EggToolbarEditor *t); + static void egg_toolbar_editor_finalize (GObject *object); static void update_editor_sheet (EggToolbarEditor *editor); @@ -56,8 +55,6 @@ enum PROP_TOOLBARS_MODEL }; -static GObjectClass *parent_class = NULL; - #define EGG_TOOLBAR_EDITOR_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EGG_TYPE_TOOLBAR_EDITOR, EggToolbarEditorPrivate)) struct EggToolbarEditorPrivate @@ -71,32 +68,7 @@ struct EggToolbarEditorPrivate GList *factory_list; }; -GType -egg_toolbar_editor_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - static const GTypeInfo our_info = { - sizeof (EggToolbarEditorClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) egg_toolbar_editor_class_init, - NULL, - NULL, /* class_data */ - sizeof (EggToolbarEditor), - 0, /* n_preallocs */ - (GInstanceInitFunc) egg_toolbar_editor_init - }; - - type = g_type_register_static (GTK_TYPE_VBOX, - "EggToolbarEditor", - &our_info, 0); - } - - return type; -} +G_DEFINE_TYPE (EggToolbarEditor, egg_toolbar_editor, GTK_TYPE_VBOX); static gint compare_items (gconstpointer a, @@ -224,8 +196,6 @@ egg_toolbar_editor_class_init (EggToolbarEditorClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); - object_class->finalize = egg_toolbar_editor_finalize; object_class->set_property = egg_toolbar_editor_set_property; object_class->get_property = egg_toolbar_editor_get_property; @@ -268,7 +238,7 @@ egg_toolbar_editor_finalize (GObject *object) g_list_free (editor->priv->actions_list); g_list_free (editor->priv->factory_list); - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (egg_toolbar_editor_parent_class)->finalize (object); } GtkWidget * diff --git a/lib/egg/egg-toolbars-model.c b/lib/egg/egg-toolbars-model.c index f0a5b0fa0..17c6e414b 100644 --- a/lib/egg/egg-toolbars-model.c +++ b/lib/egg/egg-toolbars-model.c @@ -30,8 +30,6 @@ #include <libxml/tree.h> #include <gdk/gdkproperty.h> -static void egg_toolbars_model_class_init (EggToolbarsModelClass *klass); -static void egg_toolbars_model_init (EggToolbarsModel *model); static void egg_toolbars_model_finalize (GObject *object); enum @@ -57,8 +55,6 @@ typedef struct static guint signals[LAST_SIGNAL] = { 0 }; -static GObjectClass *parent_class = NULL; - #define EGG_TOOLBARS_MODEL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EGG_TYPE_TOOLBARS_MODEL, EggToolbarsModelPrivate)) struct EggToolbarsModelPrivate @@ -68,36 +64,7 @@ struct EggToolbarsModelPrivate GHashTable *flags; }; -GType -egg_toolbars_model_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - static const GTypeInfo our_info = { - sizeof (EggToolbarsModelClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) egg_toolbars_model_class_init, - NULL, - NULL, /* class_data */ - sizeof (EggToolbarsModel), - 0, /* n_preallocs */ - (GInstanceInitFunc) egg_toolbars_model_init - }; - volatile GType flags_type; /* work around gcc's optimiser */ - - /* make sure the flags type is known */ - flags_type = EGG_TYPE_TB_MODEL_FLAGS; - - type = g_type_register_static (G_TYPE_OBJECT, - "EggToolbarsModel", - &our_info, 0); - } - - return type; -} +G_DEFINE_TYPE (EggToolbarsModel, egg_toolbars_model, G_TYPE_OBJECT) static xmlDocPtr egg_toolbars_model_to_xml (EggToolbarsModel *model) @@ -708,8 +675,10 @@ static void egg_toolbars_model_class_init (EggToolbarsModelClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); + volatile GType flags_type; /* work around gcc's optimiser */ - parent_class = g_type_class_peek_parent (klass); + /* make sure the flags type is known */ + flags_type = EGG_TYPE_TB_MODEL_FLAGS; object_class->finalize = egg_toolbars_model_finalize; @@ -776,7 +745,7 @@ egg_toolbars_model_finalize (GObject *object) g_node_destroy (model->priv->toolbars); g_hash_table_destroy (model->priv->flags); - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (egg_toolbars_model_parent_class)->finalize (object); } EggToolbarsModel * diff --git a/lib/egg/eggtreemultidnd.c b/lib/egg/eggtreemultidnd.c index 3a7da919c..4850c6860 100644 --- a/lib/egg/eggtreemultidnd.c +++ b/lib/egg/eggtreemultidnd.c @@ -59,7 +59,7 @@ egg_tree_multi_drag_source_get_type (void) if (!our_type) { - static const GTypeInfo our_info = + const GTypeInfo our_info = { sizeof (EggTreeMultiDragSourceIface), /* class_size */ NULL, /* base_init */ diff --git a/lib/egg/update-toolbareditor-from-libegg b/lib/egg/update-toolbareditor-from-libegg deleted file mode 100755 index fe56a2fc2..000000000 --- a/lib/egg/update-toolbareditor-from-libegg +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# Get latest toolbar editor from libegg -# Developers using the toolbar editor in their projects can use this script to -# fetch the latest toolbar editor from libegg -echo "Obtaining latest version of toolbar editor from libegg" - -FILES="egg-editable-toolbar.c \ - egg-toolbars-model.c \ - egg-toolbar-editor.c \ - eggtreemultidnd.c \ - egg-editable-toolbar.h \ - egg-toolbars-model.h \ - egg-toolbar-editor.h \ - eggtreemultidnd.h \ - eggmarshalers.list" - -for FILE in $FILES -do - svn export http://svn.gnome.org/svn/libegg/trunk/libegg/toolbareditor/$FILE -done - diff --git a/lib/egg/update-toolbareditor-from-libegg.sh b/lib/egg/update-toolbareditor-from-libegg.sh new file mode 100755 index 000000000..e047aa1dd --- /dev/null +++ b/lib/egg/update-toolbareditor-from-libegg.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# update-toolbareditor-from-libegg.sh +# +# Get latest toolbar editor from libegg +# Developers using the toolbar editor in their projects can use this script to +# fetch the latest toolbar editor from libegg. Just run this script +# + +SCRIPT_NAME=update-toolbareditor-from-libegg.sh +SVN_URI=http://svn.gnome.org/svn/libegg/trunk/libegg/toolbareditor +FILES="egg-editable-toolbar.c \ + egg-toolbars-model.c \ + egg-toolbar-editor.c \ + eggtreemultidnd.c \ + egg-editable-toolbar.h \ + egg-toolbars-model.h \ + egg-toolbar-editor.h \ + eggtreemultidnd.h \ + eggmarshalers.list" + + +if [ -z $1 ]; then + echo "Obtaining latest version of "$SCRIPT_NAME + svn export $SVN_URI/$SCRIPT_NAME + ./$SCRIPT_NAME --update-sources +fi +if [ "$1" = "--update-sources" ]; then + + echo "Obtaining latest version of the sources" + for FILE in $FILES + do + svn export $SVN_URI/$FILE + done +fi + |