diff options
Diffstat (limited to 'addressbook/gui/widgets')
23 files changed, 268 insertions, 293 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c index 6fa61a018b..e40ca3ce9a 100644 --- a/addressbook/gui/widgets/e-addressbook-model.c +++ b/addressbook/gui/widgets/e-addressbook-model.c @@ -18,8 +18,8 @@ #include "e-addressbook-util.h" #include "e-addressbook-marshal.h" -#define PARENT_TYPE gtk_object_get_type() -GtkObjectClass *parent_class; +#define PARENT_TYPE G_TYPE_OBJECT +GObjectClass *parent_class; /* * EAddressbookModel callbacks @@ -279,7 +279,7 @@ backend_died (EBook *book, static void e_addressbook_model_class_init (GObjectClass *object_class) { - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref (PARENT_TYPE); object_class->dispose = addressbook_dispose; object_class->set_property = e_addressbook_model_set_property; @@ -387,7 +387,7 @@ e_addressbook_model_class_init (GObjectClass *object_class) G_STRUCT_OFFSET (EAddressbookModelClass, stop_state_changed), NULL, NULL, e_addressbook_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + G_TYPE_NONE, 0); e_addressbook_model_signals [BACKEND_DIED] = g_signal_new ("backend_died", @@ -400,7 +400,7 @@ e_addressbook_model_class_init (GObjectClass *object_class) } static void -e_addressbook_model_init (GtkObject *object) +e_addressbook_model_init (GObject *object) { EAddressbookModel *model = E_ADDRESSBOOK_MODEL(object); model->book = NULL; @@ -594,24 +594,25 @@ e_addressbook_model_get_property (GObject *object, guint prop_id, GValue *value, } } -GtkType +GType e_addressbook_model_get_type (void) { - static GtkType type = 0; + static GType type = 0; - if (!type){ - GtkTypeInfo info = { - "EAddressbookModel", - sizeof (EAddressbookModel), + if (!type) { + static const GTypeInfo info = { sizeof (EAddressbookModelClass), - (GtkClassInitFunc) e_addressbook_model_class_init, - (GtkObjectInitFunc) e_addressbook_model_init, - NULL, /* reserved 1 */ - NULL, /* reserved 2 */ - (GtkClassInitFunc) NULL + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) e_addressbook_model_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (EAddressbookModel), + 0, /* n_preallocs */ + (GInstanceInitFunc) e_addressbook_model_init, }; - type = gtk_type_unique (PARENT_TYPE, &info); + type = g_type_register_static (PARENT_TYPE, "EAddressbookModel", &info, 0); } return type; @@ -622,7 +623,7 @@ e_addressbook_model_new (void) { EAddressbookModel *et; - et = gtk_type_new (e_addressbook_model_get_type ()); + et = g_object_new (E_TYPE_ADDRESSBOOK_MODEL, NULL); return et; } diff --git a/addressbook/gui/widgets/e-addressbook-model.h b/addressbook/gui/widgets/e-addressbook-model.h index 7cc97ba2ad..4863c62e07 100644 --- a/addressbook/gui/widgets/e-addressbook-model.h +++ b/addressbook/gui/widgets/e-addressbook-model.h @@ -2,22 +2,23 @@ #ifndef _E_ADDRESSBOOK_MODEL_H_ #define _E_ADDRESSBOOK_MODEL_H_ -#include <gtk/gtk.h> +#include <glib.h> +#include <glib-object.h> #include "addressbook/backend/ebook/e-book.h" #include "addressbook/backend/ebook/e-book-view.h" #include "addressbook/backend/ebook/e-card-simple.h" #define E_TYPE_ADDRESSBOOK_MODEL (e_addressbook_model_get_type ()) -#define E_ADDRESSBOOK_MODEL(o) (GTK_CHECK_CAST ((o), E_TYPE_ADDRESSBOOK_MODEL, EAddressbookModel)) -#define E_ADDRESSBOOK_MODEL_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TYPE_ADDRESSBOOK_MODEL, EAddressbookModelClass)) -#define E_IS_ADDRESSBOOK_MODEL(o) (GTK_CHECK_TYPE ((o), E_TYPE_ADDRESSBOOK_MODEL)) -#define E_IS_ADDRESSBOOK_MODEL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TYPE_ADDRESSBOOK_MODEL)) +#define E_ADDRESSBOOK_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_ADDRESSBOOK_MODEL, EAddressbookModel)) +#define E_ADDRESSBOOK_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_ADDRESSBOOK_MODEL, EAddressbookModelClass)) +#define E_IS_ADDRESSBOOK_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_ADDRESSBOOK_MODEL)) +#define E_IS_ADDRESSBOOK_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_ADDRESSBOOK_MODEL)) typedef struct _EAddressbookModel EAddressbookModel; typedef struct _EAddressbookModelClass EAddressbookModelClass; struct _EAddressbookModel { - GtkObject parent; + GObject parent; /* item specific fields */ EBook *book; @@ -40,7 +41,7 @@ struct _EAddressbookModel { struct _EAddressbookModelClass { - GtkObjectClass parent_class; + GObjectClass parent_class; /* * Signals @@ -58,7 +59,7 @@ struct _EAddressbookModelClass { }; -GtkType e_addressbook_model_get_type (void); +GType e_addressbook_model_get_type (void); EAddressbookModel *e_addressbook_model_new (void); /* Returns object with ref count of 1. */ diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c index 140a09facd..1310442471 100644 --- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c @@ -413,24 +413,25 @@ e_addressbook_reflow_adapter_init (GtkObject *object) priv->model_changed_id = 0; } -GtkType +GType e_addressbook_reflow_adapter_get_type (void) { - static GtkType type = 0; + static GType type = 0; - if (!type){ - GtkTypeInfo info = { - "EAddressbookReflowAdapter", - sizeof (EAddressbookReflowAdapter), + if (!type) { + static const GTypeInfo info = { sizeof (EAddressbookReflowAdapterClass), - (GtkClassInitFunc) e_addressbook_reflow_adapter_class_init, - (GtkObjectInitFunc) e_addressbook_reflow_adapter_init, - NULL, /* reserved 1 */ - NULL, /* reserved 2 */ - (GtkClassInitFunc) NULL + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) e_addressbook_reflow_adapter_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (EAddressbookReflowAdapter), + 0, /* n_preallocs */ + (GInstanceInitFunc) e_addressbook_reflow_adapter_init, }; - type = gtk_type_unique (PARENT_TYPE, &info); + type = g_type_register_static (PARENT_TYPE, "EAddressbookReflowAdapter", &info, 0); } return type; @@ -468,7 +469,7 @@ e_addressbook_reflow_adapter_new (EAddressbookModel *model) { EAddressbookReflowAdapter *et; - et = gtk_type_new (e_addressbook_reflow_adapter_get_type ()); + et = g_object_new (E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER, NULL); e_addressbook_reflow_adapter_construct (et, model); diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.h b/addressbook/gui/widgets/e-addressbook-reflow-adapter.h index b3f6ab9c0d..4bf131bc5c 100644 --- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.h +++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.h @@ -9,11 +9,11 @@ #include "addressbook/backend/ebook/e-book-view.h" #include "addressbook/backend/ebook/e-card.h" -#define E_ADDRESSBOOK_REFLOW_ADAPTER_TYPE (e_addressbook_reflow_adapter_get_type ()) -#define E_ADDRESSBOOK_REFLOW_ADAPTER(o) (GTK_CHECK_CAST ((o), E_ADDRESSBOOK_REFLOW_ADAPTER_TYPE, EAddressbookReflowAdapter)) -#define E_ADDRESSBOOK_REFLOW_ADAPTER_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_ADDRESSBOOK_REFLOW_ADAPTER_TYPE, EAddressbookReflowAdapterClass)) -#define E_IS_ADDRESSBOOK_REFLOW_ADAPTER(o) (GTK_CHECK_TYPE ((o), E_ADDRESSBOOK_REFLOW_ADAPTER_TYPE)) -#define E_IS_ADDRESSBOOK_REFLOW_ADAPTER_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_ADDRESSBOOK_REFLOW_ADAPTER_TYPE)) +#define E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER (e_addressbook_reflow_adapter_get_type ()) +#define E_ADDRESSBOOK_REFLOW_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER, EAddressbookReflowAdapter)) +#define E_ADDRESSBOOK_REFLOW_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER, EAddressbookReflowAdapterClass)) +#define E_IS_ADDRESSBOOK_REFLOW_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER)) +#define E_IS_ADDRESSBOOK_REFLOW_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER)) typedef struct _EAddressbookReflowAdapter EAddressbookReflowAdapter; typedef struct _EAddressbookReflowAdapterPrivate EAddressbookReflowAdapterPrivate; @@ -36,7 +36,7 @@ struct _EAddressbookReflowAdapterClass { }; -GtkType e_addressbook_reflow_adapter_get_type (void); +GType e_addressbook_reflow_adapter_get_type (void); void e_addressbook_reflow_adapter_construct (EAddressbookReflowAdapter *adapter, EAddressbookModel *model); EReflowModel *e_addressbook_reflow_adapter_new (EAddressbookModel *model); diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c index 2f38cffcff..eecb6248fd 100644 --- a/addressbook/gui/widgets/e-addressbook-table-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c @@ -343,24 +343,25 @@ model_changed (EAddressbookModel *model, e_table_model_changed (E_TABLE_MODEL (adapter)); } -GtkType +GType e_addressbook_table_adapter_get_type (void) { - static GtkType type = 0; + static GType type = 0; - if (!type){ - GtkTypeInfo info = { - "EAddressbookTableAdapter", - sizeof (EAddressbookTableAdapter), + if (!type) { + static const GTypeInfo info = { sizeof (EAddressbookTableAdapterClass), - (GtkClassInitFunc) e_addressbook_table_adapter_class_init, - (GtkObjectInitFunc) e_addressbook_table_adapter_init, - NULL, /* reserved 1 */ - NULL, /* reserved 2 */ - (GtkClassInitFunc) NULL + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) e_addressbook_table_adapter_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (EAddressbookTableAdapter), + 0, /* n_preallocs */ + (GInstanceInitFunc) e_addressbook_table_adapter_init, }; - type = gtk_type_unique (PARENT_TYPE, &info); + type = g_type_register_static (PARENT_TYPE, "EAddressbookTableAdapter", &info, 0); } return type; @@ -400,7 +401,7 @@ e_addressbook_table_adapter_new (EAddressbookModel *model) { EAddressbookTableAdapter *et; - et = gtk_type_new (e_addressbook_table_adapter_get_type ()); + et = g_object_new(E_TYPE_ADDRESSBOOK_TABLE_ADAPTER, NULL); e_addressbook_table_adapter_construct (et, model); diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.h b/addressbook/gui/widgets/e-addressbook-table-adapter.h index d76434e80a..df66e1dce9 100644 --- a/addressbook/gui/widgets/e-addressbook-table-adapter.h +++ b/addressbook/gui/widgets/e-addressbook-table-adapter.h @@ -7,11 +7,11 @@ #include "addressbook/backend/ebook/e-book-view.h" #include "addressbook/backend/ebook/e-card-simple.h" -#define E_ADDRESSBOOK_TABLE_ADAPTER_TYPE (e_addressbook_table_adapter_get_type ()) -#define E_ADDRESSBOOK_TABLE_ADAPTER(o) (GTK_CHECK_CAST ((o), E_ADDRESSBOOK_TABLE_ADAPTER_TYPE, EAddressbookTableAdapter)) -#define E_ADDRESSBOOK_TABLE_ADAPTER_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_ADDRESSBOOK_TABLE_ADAPTER_TYPE, EAddressbookTableAdapterClass)) -#define E_IS_ADDRESSBOOK_TABLE_ADAPTER(o) (GTK_CHECK_TYPE ((o), E_ADDRESSBOOK_TABLE_ADAPTER_TYPE)) -#define E_IS_ADDRESSBOOK_TABLE_ADAPTER_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_ADDRESSBOOK_TABLE_ADAPTER_TYPE)) +#define E_TYPE_ADDRESSBOOK_TABLE_ADAPTER (e_addressbook_table_adapter_get_type ()) +#define E_ADDRESSBOOK_TABLE_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_ADDRESSBOOK_TABLE_ADAPTER, EAddressbookTableAdapter)) +#define E_ADDRESSBOOK_TABLE_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_ADDRESSBOOK_TABLE_ADAPTER, EAddressbookTableAdapterClass)) +#define E_IS_ADDRESSBOOK_TABLE_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_ADDRESSBOOK_TABLE_ADAPTER)) +#define E_IS_ADDRESSBOOK_TABLE_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_ADDRESSBOOK_TABLE_ADAPTER)) /* Virtual Column list: 0 Email @@ -36,7 +36,7 @@ struct _EAddressbookTableAdapterClass { }; -GtkType e_addressbook_table_adapter_get_type (void); +GType e_addressbook_table_adapter_get_type (void); void e_addressbook_table_adapter_construct (EAddressbookTableAdapter *adapter, EAddressbookModel *model); ETableModel *e_addressbook_table_adapter_new (EAddressbookModel *model); diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 0f47f334b1..46019b2f94 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -21,7 +21,7 @@ #include <config.h> -#include <gtk/gtkinvisible.h> +#include <gtk/gtk.h> #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-util.h> @@ -128,25 +128,25 @@ static GdkAtom clipboard_atom = GDK_NONE; static GalViewCollection *collection = NULL; -GtkType +GType e_addressbook_view_get_type (void) { - static GtkType type = 0; + static GType type = 0; if (!type) { - static const GtkTypeInfo info = - { - "EAddressbookView", - sizeof (EAddressbookView), + static const GTypeInfo info = { sizeof (EAddressbookViewClass), - (GtkClassInitFunc) e_addressbook_view_class_init, - (GtkObjectInitFunc) e_addressbook_view_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) e_addressbook_view_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (EAddressbookView), + 0, /* n_preallocs */ + (GInstanceInitFunc) e_addressbook_view_init, }; - - type = gtk_type_unique (gtk_table_get_type (), &info); + + type = g_type_register_static (GTK_TYPE_TABLE, "EAddressbookView", &info, 0); } return type; @@ -356,7 +356,7 @@ e_addressbook_view_dispose (GObject *object) GtkWidget* e_addressbook_view_new (void) { - GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_addressbook_view_get_type ())); + GtkWidget *widget = GTK_WIDGET (g_object_new (E_TYPE_ADDRESSBOOK_VIEW, NULL)); return widget; } @@ -370,7 +370,6 @@ writable_status (GtkObject *object, gboolean writable, EAddressbookView *eav) static void init_collection (void) { -#ifdef PENDING_PORT_WORK GalViewFactory *factory; ETableSpecification *spec; char *galview; @@ -401,7 +400,6 @@ init_collection (void) gal_view_collection_load(collection); } -#endif } static void @@ -423,6 +421,7 @@ display_view(GalViewInstance *instance, static void setup_menus (EAddressbookView *view) { +#if PENDING_PORT_WORK if (view->book && view->view_instance == NULL) { init_collection (); view->view_instance = gal_view_instance_new (collection, e_book_get_uri (view->book)); @@ -437,6 +436,7 @@ setup_menus (EAddressbookView *view) g_signal_connect(view->view_instance, "display_view", G_CALLBACK (display_view), view); } +#endif } static void diff --git a/addressbook/gui/widgets/e-addressbook-view.h b/addressbook/gui/widgets/e-addressbook-view.h index 305092ff35..bf7b987b75 100644 --- a/addressbook/gui/widgets/e-addressbook-view.h +++ b/addressbook/gui/widgets/e-addressbook-view.h @@ -40,11 +40,11 @@ extern "C" { * -------------------------------------------------------------------------------- */ -#define E_ADDRESSBOOK_VIEW_TYPE (e_addressbook_view_get_type ()) -#define E_ADDRESSBOOK_VIEW(obj) (GTK_CHECK_CAST ((obj), E_ADDRESSBOOK_VIEW_TYPE, EAddressbookView)) -#define E_ADDRESSBOOK_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_ADDRESSBOOK_VIEW_TYPE, EAddressbookViewClass)) -#define E_IS_ADDRESSBOOK_VIEW(obj) (GTK_CHECK_TYPE ((obj), E_ADDRESSBOOK_VIEW_TYPE)) -#define E_IS_ADDRESSBOOK_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_ADDRESSBOOK_VIEW_TYPE)) +#define E_TYPE_ADDRESSBOOK_VIEW (e_addressbook_view_get_type ()) +#define E_ADDRESSBOOK_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_ADDRESSBOOK_VIEW, EAddressbookView)) +#define E_ADDRESSBOOK_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_ADDRESSBOOK_VIEW, EAddressbookViewClass)) +#define E_IS_ADDRESSBOOK_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_ADDRESSBOOK_VIEW)) +#define E_IS_ADDRESSBOOK_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_ADDRESSBOOK_VIEW)) typedef enum { E_ADDRESSBOOK_VIEW_NONE, /* initialized to this */ @@ -100,7 +100,7 @@ struct _EAddressbookViewClass }; GtkWidget *e_addressbook_view_new (void); -GtkType e_addressbook_view_get_type (void); +GType e_addressbook_view_get_type (void); void e_addressbook_view_setup_menus (EAddressbookView *view, BonoboUIComponent *uic); diff --git a/addressbook/gui/widgets/e-minicard-control.c b/addressbook/gui/widgets/e-minicard-control.c index 1aeba789e2..782e384029 100644 --- a/addressbook/gui/widgets/e-minicard-control.c +++ b/addressbook/gui/widgets/e-minicard-control.c @@ -26,6 +26,9 @@ #include "e-minicard-widget.h" #include "e-card-merging.h" +#define MINICARD_CONTROL_ID "OAFIID:GNOME_Evolution_Addressbook_MiniCard_Control" +#define MINICARD_CONTROL_FACTORY_ID "OAFIID:GNOME_Evolution_Addressbook_MiniCard_ControlFactory" + typedef struct { EMinicardWidget *minicard; GList *card_list; @@ -220,21 +223,6 @@ pstream_save (BonoboPersistStream *ps, const Bonobo_Stream stream, g_free (vcard); } /* pstream_save */ -static CORBA_long -pstream_get_max_size (BonoboPersistStream *ps, void *data, - CORBA_Environment *ev) -{ - EMinicardControl *minicard_control = data; - char *vcard; - gint length; - - vcard = e_card_list_get_vcard(minicard_control->card_list); - length = strlen (vcard); - g_free (vcard); - - return length; -} - static Bonobo_Persist_ContentTypeList * pstream_get_content_types (BonoboPersistStream *ps, void *closure, CORBA_Environment *ev) @@ -333,8 +321,8 @@ e_minicard_control_factory (BonoboGenericFactory *Factory, G_CALLBACK (free_struct), minicard_control); stream = bonobo_persist_stream_new (pstream_load, pstream_save, - pstream_get_max_size, pstream_get_content_types, + MINICARD_CONTROL_ID, minicard_control); #if 0 @@ -368,7 +356,7 @@ e_minicard_control_factory_init (void) factory = bonobo_generic_factory_new ( - "OAFIID:GNOME_Evolution_Addressbook_MiniCard_ControlFactory", + MINICARD_CONTROL_FACTORY_ID, e_minicard_control_factory, NULL); if (factory == NULL) diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c index 1dbbe22dad..22ec585c96 100644 --- a/addressbook/gui/widgets/e-minicard-label.c +++ b/addressbook/gui/widgets/e-minicard-label.c @@ -57,29 +57,28 @@ enum { ARG_EDITABLE }; -GtkType +GType e_minicard_label_get_type (void) { - static GtkType minicard_label_type = 0; - - if (!minicard_label_type) - { - static const GtkTypeInfo minicard_label_info = - { - "EMinicardLabel", - sizeof (EMinicardLabel), - sizeof (EMinicardLabelClass), - (GtkClassInitFunc) e_minicard_label_class_init, - (GtkObjectInitFunc) e_minicard_label_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - minicard_label_type = gtk_type_unique (gnome_canvas_group_get_type (), &minicard_label_info); - } + static GType type = 0; + + if (!type) { + static const GTypeInfo info = { + sizeof (EMinicardLabelClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) e_minicard_label_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (EMinicardLabel), + 0, /* n_preallocs */ + (GInstanceInitFunc) e_minicard_label_init, + }; + + type = g_type_register_static (gnome_canvas_group_get_type (), "EMinicardLabel", &info, 0); + } - return minicard_label_type; + return type; } static void diff --git a/addressbook/gui/widgets/e-minicard-label.h b/addressbook/gui/widgets/e-minicard-label.h index 3e1044defd..0fdc48a451 100644 --- a/addressbook/gui/widgets/e-minicard-label.h +++ b/addressbook/gui/widgets/e-minicard-label.h @@ -40,11 +40,11 @@ extern "C" { * fieldname string RW text in the fieldname label */ -#define E_MINICARD_LABEL_TYPE (e_minicard_label_get_type ()) -#define E_MINICARD_LABEL(obj) (GTK_CHECK_CAST ((obj), E_MINICARD_LABEL_TYPE, EMinicardLabel)) -#define E_MINICARD_LABEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_MINICARD_LABEL_TYPE, EMiniCardLabelClass)) -#define E_IS_MINICARD_LABEL(obj) (GTK_CHECK_TYPE ((obj), E_MINICARD_LABEL_TYPE)) -#define E_IS_MINICARD_LABEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_MINICARD_LABEL_TYPE)) +#define E_TYPE_MINICARD_LABEL (e_minicard_label_get_type ()) +#define E_MINICARD_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MINICARD_LABEL, EMinicardLabel)) +#define E_MINICARD_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MINICARD_LABEL, EMiniCardLabelClass)) +#define E_IS_MINICARD_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MINICARD_LABEL)) +#define E_IS_MINICARD_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MINICARD_LABEL)) typedef struct _EMinicardLabel EMinicardLabel; @@ -72,7 +72,7 @@ struct _EMinicardLabelClass }; -GtkType e_minicard_label_get_type (void); +GType e_minicard_label_get_type (void); GnomeCanvasItem *e_minicard_label_new(GnomeCanvasGroup *parent); void e_minicard_label_construct (GnomeCanvasItem *item); diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c index 626ceea5c3..5a2d9c3e0e 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.c +++ b/addressbook/gui/widgets/e-minicard-view-widget.c @@ -58,29 +58,28 @@ enum { static guint signals [LAST_SIGNAL] = {0, }; -GtkType +GType e_minicard_view_widget_get_type (void) { - static GtkType type = 0; - - if (!type) - { - static const GtkTypeInfo info = - { - "EMinicardViewWidget", - sizeof (EMinicardViewWidget), - sizeof (EMinicardViewWidgetClass), - (GtkClassInitFunc) e_minicard_view_widget_class_init, - (GtkObjectInitFunc) e_minicard_view_widget_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - type = gtk_type_unique (e_canvas_get_type (), &info); - } - - return type; + static GType type = 0; + + if (!type) { + static const GTypeInfo info = { + sizeof (EMinicardViewWidgetClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) e_minicard_view_widget_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (EMinicardViewWidget), + 0, /* n_preallocs */ + (GInstanceInitFunc) e_minicard_view_widget_init, + }; + + type = g_type_register_static (e_canvas_get_type (), "EMinicardViewWidget", &info, 0); + } + + return type; } static void diff --git a/addressbook/gui/widgets/e-minicard-view-widget.h b/addressbook/gui/widgets/e-minicard-view-widget.h index 96e3b9e465..abb6b9c745 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.h +++ b/addressbook/gui/widgets/e-minicard-view-widget.h @@ -24,16 +24,13 @@ #include "addressbook/backend/ebook/e-book.h" #include "e-minicard-view.h" -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ +G_BEGIN_DECLS -#define E_MINICARD_VIEW_WIDGET_TYPE (e_minicard_view_widget_get_type ()) -#define E_MINICARD_VIEW_WIDGET(obj) (GTK_CHECK_CAST ((obj), E_MINICARD_VIEW_WIDGET_TYPE, EMinicardViewWidget)) -#define E_MINICARD_VIEW_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_MINICARD_VIEW_WIDGET_TYPE, EMinicardViewWidgetClass)) -#define E_IS_MINICARD_VIEW_WIDGET(obj) (GTK_CHECK_TYPE ((obj), E_MINICARD_VIEW_WIDGET_TYPE)) -#define E_IS_MINICARD_VIEW_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_MINICARD_VIEW_WIDGET_TYPE)) +#define E_TYPE_MINICARD_VIEW_WIDGET (e_minicard_view_widget_get_type ()) +#define E_MINICARD_VIEW_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MINICARD_VIEW_WIDGET, EMinicardViewWidget)) +#define E_MINICARD_VIEW_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MINICARD_VIEW_WIDGET, EMinicardViewWidgetClass)) +#define E_IS_MINICARD_VIEW_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MINICARD_VIEW_WIDGET)) +#define E_IS_MINICARD_VIEW_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MINICARD_VIEW_WIDGET)) typedef struct _EMinicardViewWidget EMinicardViewWidget; @@ -63,15 +60,13 @@ struct _EMinicardViewWidgetClass }; -GtkType e_minicard_view_widget_get_type (void); +GType e_minicard_view_widget_get_type (void); GtkWidget *e_minicard_view_widget_new (EAddressbookReflowAdapter *adapter); /* Get parts of the view widget. */ ESelectionModel *e_minicard_view_widget_get_selection_model (EMinicardViewWidget *view); EMinicardView *e_minicard_view_widget_get_view (EMinicardViewWidget *view); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __E_MINICARD_VIEW_WIDGET_H__ */ diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c index 28f7cfe497..afb08ef02f 100644 --- a/addressbook/gui/widgets/e-minicard-view.c +++ b/addressbook/gui/widgets/e-minicard-view.c @@ -138,16 +138,14 @@ set_empty_message (EMinicardView *view) } if (editable) - empty_message = e_utf8_from_locale_string(_("\n\nThere are no items to show in this view.\n\n" - "Double-click here to create a new Contact.")); + empty_message = _("\n\nThere are no items to show in this view.\n\n" + "Double-click here to create a new Contact."); else - empty_message = e_utf8_from_locale_string(_("\n\nThere are no items to show in this view.")); + empty_message = _("\n\nThere are no items to show in this view."); g_object_set (view, "empty_message", empty_message, NULL); - - g_free (empty_message); } static void @@ -477,24 +475,25 @@ e_minicard_view_init (EMinicardView *view) set_empty_message (view); } -GtkType +GType e_minicard_view_get_type (void) { - static GtkType reflow_type = 0; + static GType reflow_type = 0; if (!reflow_type) { - static const GtkTypeInfo reflow_info = { - "EMinicardView", - sizeof (EMinicardView), + static const GTypeInfo reflow_info = { sizeof (EMinicardViewClass), - (GtkClassInitFunc) e_minicard_view_class_init, - (GtkObjectInitFunc) e_minicard_view_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) e_minicard_view_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (EMinicardView), + 0, /* n_preallocs */ + (GInstanceInitFunc) e_minicard_view_init, }; - reflow_type = gtk_type_unique (PARENT_TYPE, &reflow_info); + reflow_type = g_type_register_static (PARENT_TYPE, "EMinicardView", &reflow_info, 0); } return reflow_type; diff --git a/addressbook/gui/widgets/e-minicard-view.h b/addressbook/gui/widgets/e-minicard-view.h index 361cb3c628..afd432fd8e 100644 --- a/addressbook/gui/widgets/e-minicard-view.h +++ b/addressbook/gui/widgets/e-minicard-view.h @@ -27,10 +27,7 @@ #include "addressbook/backend/ebook/e-book.h" #include "e-addressbook-reflow-adapter.h" -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ +G_BEGIN_DECLS /* EMinicardView - A canvas item container. * @@ -51,11 +48,11 @@ extern "C" { * height double RW height of the reflow */ -#define E_MINICARD_VIEW_TYPE (e_minicard_view_get_type ()) -#define E_MINICARD_VIEW(obj) (GTK_CHECK_CAST ((obj), E_MINICARD_VIEW_TYPE, EMinicardView)) -#define E_MINICARD_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_MINICARD_VIEW_TYPE, EMinicardViewClass)) -#define E_IS_MINICARD_VIEW(obj) (GTK_CHECK_TYPE ((obj), E_MINICARD_VIEW_TYPE)) -#define E_IS_MINICARD_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_MINICARD_VIEW_TYPE)) +#define E_TYPE_MINICARD_VIEW (e_minicard_view_get_type ()) +#define E_MINICARD_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MINICARD_VIEW, EMinicardView)) +#define E_MINICARD_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MINICARD_VIEW, EMinicardViewClass)) +#define E_IS_MINICARD_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MINICARD_VIEW)) +#define E_IS_MINICARD_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MINICARD_VIEW)) typedef struct _EMinicardView EMinicardView; @@ -83,7 +80,7 @@ struct _EMinicardViewClass void (*right_click) (EMinicardView *view, GdkEvent *event); }; -GtkType e_minicard_view_get_type (void); +GType e_minicard_view_get_type (void); void e_minicard_view_remove_selection (EMinicardView *view, EBookCallback cb, gpointer closure); @@ -91,9 +88,7 @@ void e_minicard_view_jump_to_letter (EMinicardView *view, gunichar letter); GList *e_minicard_view_get_card_list (EMinicardView *view); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* __E_MINICARD_VIEW_H__ */ diff --git a/addressbook/gui/widgets/e-minicard-widget.c b/addressbook/gui/widgets/e-minicard-widget.c index 4c9d7b0f30..a82dae4ca0 100644 --- a/addressbook/gui/widgets/e-minicard-widget.c +++ b/addressbook/gui/widgets/e-minicard-widget.c @@ -41,27 +41,26 @@ enum { ARG_CARD, }; -GtkType +GType e_minicard_widget_get_type (void) { - static GtkType type = 0; - - if (!type) - { - static const GtkTypeInfo info = - { - "EMinicardWidget", - sizeof (EMinicardWidget), - sizeof (EMinicardWidgetClass), - (GtkClassInitFunc) e_minicard_widget_class_init, - (GtkObjectInitFunc) e_minicard_widget_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - type = gtk_type_unique (e_canvas_get_type (), &info); - } + static GType type = 0; + + if (!type) { + static const GTypeInfo info = { + sizeof (EMinicardWidgetClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) e_minicard_widget_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (EMinicardWidget), + 0, /* n_preallocs */ + (GInstanceInitFunc) e_minicard_widget_init, + }; + + type = g_type_register_static (e_canvas_get_type (), "EMinicardWidget", &info, 0); + } return type; } @@ -187,7 +186,7 @@ e_minicard_widget_destroy (GtkObject *object) GtkWidget* e_minicard_widget_new (void) { - GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_minicard_widget_get_type ())); + GtkWidget *widget = GTK_WIDGET (g_object_new (E_TYPE_MINICARD_WIDGET, NULL)); return widget; } diff --git a/addressbook/gui/widgets/e-minicard-widget.h b/addressbook/gui/widgets/e-minicard-widget.h index eaf0f8edb6..829ad8f77d 100644 --- a/addressbook/gui/widgets/e-minicard-widget.h +++ b/addressbook/gui/widgets/e-minicard-widget.h @@ -36,11 +36,11 @@ extern "C" { * -------------------------------------------------------------------------------- */ -#define E_MINICARD_WIDGET_TYPE (e_minicard_widget_get_type ()) -#define E_MINICARD_WIDGET(obj) (GTK_CHECK_CAST ((obj), E_MINICARD_WIDGET_TYPE, EMinicardWidget)) -#define E_MINICARD_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_MINICARD_WIDGET_TYPE, EMinicardWidgetClass)) -#define E_IS_MINICARD_WIDGET(obj) (GTK_CHECK_TYPE ((obj), E_MINICARD_WIDGET_TYPE)) -#define E_IS_MINICARD_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_MINICARD_WIDGET_TYPE)) +#define E_TYPE_MINICARD_WIDGET (e_minicard_widget_get_type ()) +#define E_MINICARD_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MINICARD_WIDGET, EMinicardWidget)) +#define E_MINICARD_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MINICARD_WIDGET, EMinicardWidgetClass)) +#define E_IS_MINICARD_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MINICARD_WIDGET)) +#define E_IS_MINICARD_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MINICARD_WIDGET)) typedef struct _EMinicardWidget EMinicardWidget; @@ -64,7 +64,7 @@ struct _EMinicardWidgetClass GtkWidget *e_minicard_widget_new(void); -GtkType e_minicard_widget_get_type (void); +GType e_minicard_widget_get_type (void); void e_minicard_widget_set_card (EMinicardWidget *, ECard *); diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index f932661eb6..28ae0d07e1 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -96,29 +96,28 @@ enum { static guint e_minicard_signals [LAST_SIGNAL] = {0, }; -GtkType +GType e_minicard_get_type (void) { - static GtkType minicard_type = 0; - - if (!minicard_type) - { - static const GtkTypeInfo minicard_info = - { - "EMinicard", - sizeof (EMinicard), - sizeof (EMinicardClass), - (GtkClassInitFunc) e_minicard_class_init, - (GtkObjectInitFunc) e_minicard_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - minicard_type = gtk_type_unique (gnome_canvas_group_get_type (), &minicard_info); - } + static GType type = 0; + + if (!type) { + static const GTypeInfo info = { + sizeof (EMinicardClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) e_minicard_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (EMinicard), + 0, /* n_preallocs */ + (GInstanceInitFunc) e_minicard_init, + }; + + type = g_type_register_static (gnome_canvas_group_get_type (), "EMinicard", &info, 0); + } - return minicard_type; + return type; } static void @@ -139,14 +138,14 @@ e_minicard_class_init (EMinicardClass *klass) g_param_spec_double ("width", _("Width"), /*_( */"XXX blurb" /*)*/, - 0.0, 0.0, 0.0, + 10.0, G_MAXDOUBLE, 10.0, G_PARAM_READWRITE | G_PARAM_LAX_VALIDATION)); g_object_class_install_property (object_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), /*_( */"XXX blurb" /*)*/, - 0.0, 0.0, 0.0, + 10.0, G_MAXDOUBLE, 10.0, G_PARAM_READWRITE | G_PARAM_LAX_VALIDATION)); g_object_class_install_property (object_class, PROP_HAS_FOCUS, diff --git a/addressbook/gui/widgets/e-minicard.h b/addressbook/gui/widgets/e-minicard.h index 674d709e4b..99e2ccbf63 100644 --- a/addressbook/gui/widgets/e-minicard.h +++ b/addressbook/gui/widgets/e-minicard.h @@ -41,11 +41,11 @@ extern "C" { * card ECard* RW Pointer to the ECard */ -#define E_MINICARD_TYPE (e_minicard_get_type ()) -#define E_MINICARD(obj) (GTK_CHECK_CAST ((obj), E_MINICARD_TYPE, EMinicard)) -#define E_MINICARD_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_MINICARD_TYPE, EMinicardClass)) -#define E_IS_MINICARD(obj) (GTK_CHECK_TYPE ((obj), E_MINICARD_TYPE)) -#define E_IS_MINICARD_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_MINICARD_TYPE)) +#define E_TYPE_MINICARD (e_minicard_get_type ()) +#define E_MINICARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MINICARD, EMinicard)) +#define E_MINICARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MINICARD, EMinicardClass)) +#define E_IS_MINICARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MINICARD)) +#define E_IS_MINICARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MINICARD)) typedef struct _EMinicard EMinicard; @@ -106,7 +106,7 @@ struct _EMinicardClass }; -GtkType e_minicard_get_type (void); +GType e_minicard_get_type (void); const char *e_minicard_get_card_id (EMinicard *minicard); int e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2); diff --git a/addressbook/gui/widgets/gal-view-factory-minicard.c b/addressbook/gui/widgets/gal-view-factory-minicard.c index 7e6767ce20..e6cac225ce 100644 --- a/addressbook/gui/widgets/gal-view-factory-minicard.c +++ b/addressbook/gui/widgets/gal-view-factory-minicard.c @@ -75,7 +75,7 @@ gal_view_factory_minicard_init (GalViewFactoryMinicard *factory) GalViewFactory * gal_view_factory_minicard_new (void) { - return gal_view_factory_minicard_construct (gtk_type_new (gal_view_factory_minicard_get_type ())); + return gal_view_factory_minicard_construct (g_object_new (GAL_TYPE_VIEW_FACTORY_MINICARD, NULL)); } /** @@ -93,26 +93,25 @@ gal_view_factory_minicard_construct (GalViewFactoryMinicard *factory) return GAL_VIEW_FACTORY(factory); } -GtkType +GType gal_view_factory_minicard_get_type (void) { - static guint type = 0; - - if (!type) - { - GtkTypeInfo info = - { - "GalViewFactoryMinicard", - sizeof (GalViewFactoryMinicard), + static GType type = 0; + + if (!type) { + static const GTypeInfo info = { sizeof (GalViewFactoryMinicardClass), - (GtkClassInitFunc) gal_view_factory_minicard_class_init, - (GtkObjectInitFunc) gal_view_factory_minicard_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gal_view_factory_minicard_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GalViewFactoryMinicard), + 0, /* n_preallocs */ + (GInstanceInitFunc) gal_view_factory_minicard_init, }; - - type = gtk_type_unique (PARENT_TYPE, &info); + + type = g_type_register_static (PARENT_TYPE, "GalViewFactoryMinicard", &info, 0); } return type; diff --git a/addressbook/gui/widgets/gal-view-factory-minicard.h b/addressbook/gui/widgets/gal-view-factory-minicard.h index 3816fdba46..02eea99e47 100644 --- a/addressbook/gui/widgets/gal-view-factory-minicard.h +++ b/addressbook/gui/widgets/gal-view-factory-minicard.h @@ -13,11 +13,11 @@ #include <gtk/gtkobject.h> #include <gal/menus/gal-view-factory.h> -#define GAL_VIEW_FACTORY_MINICARD_TYPE (gal_view_factory_minicard_get_type ()) -#define GAL_VIEW_FACTORY_MINICARD(o) (GTK_CHECK_CAST ((o), GAL_VIEW_FACTORY_MINICARD_TYPE, GalViewFactoryMinicard)) -#define GAL_VIEW_FACTORY_MINICARD_CLASS(k) (GTK_CHECK_CLASS_CAST((k), GAL_VIEW_FACTORY_MINICARD_TYPE, GalViewFactoryMinicardClass)) -#define GAL_IS_VIEW_FACTORY_MINICARD(o) (GTK_CHECK_TYPE ((o), GAL_VIEW_FACTORY_MINICARD_TYPE)) -#define GAL_IS_VIEW_FACTORY_MINICARD_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), GAL_VIEW_FACTORY_MINICARD_TYPE)) +#define GAL_TYPE_VIEW_FACTORY_MINICARD (gal_view_factory_minicard_get_type ()) +#define GAL_VIEW_FACTORY_MINICARD(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_TYPE_VIEW_FACTORY_MINICARD, GalViewFactoryMinicard)) +#define GAL_VIEW_FACTORY_MINICARD_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_TYPE_VIEW_FACTORY_MINICARD, GalViewFactoryMinicardClass)) +#define GAL_IS_VIEW_FACTORY_MINICARD(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_TYPE_VIEW_FACTORY_MINICARD)) +#define GAL_IS_VIEW_FACTORY_MINICARD_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_TYPE_VIEW_FACTORY_MINICARD)) typedef struct { GalViewFactory base; @@ -28,7 +28,7 @@ typedef struct { } GalViewFactoryMinicardClass; /* Standard functions */ -GtkType gal_view_factory_minicard_get_type (void); +GType gal_view_factory_minicard_get_type (void); GalViewFactory *gal_view_factory_minicard_new (void); GalViewFactory *gal_view_factory_minicard_construct (GalViewFactoryMinicard *factory); diff --git a/addressbook/gui/widgets/gal-view-minicard.c b/addressbook/gui/widgets/gal-view-minicard.c index aed71e86ac..44e4e9c86c 100644 --- a/addressbook/gui/widgets/gal-view-minicard.c +++ b/addressbook/gui/widgets/gal-view-minicard.c @@ -132,7 +132,7 @@ gal_view_minicard_init (GalViewMinicard *gvm) GalView * gal_view_minicard_new (const gchar *title) { - return gal_view_minicard_construct (gtk_type_new (gal_view_minicard_get_type ()), title); + return gal_view_minicard_construct (g_object_new (GAL_TYPE_VIEW_MINICARD, NULL), title); } /** @@ -153,26 +153,25 @@ gal_view_minicard_construct (GalViewMinicard *view, return GAL_VIEW(view); } -GtkType +GType gal_view_minicard_get_type (void) { - static guint type = 0; - - if (!type) - { - GtkTypeInfo info = - { - "GalViewMinicard", - sizeof (GalViewMinicard), + static GType type = 0; + + if (!type) { + static const GTypeInfo info = { sizeof (GalViewMinicardClass), - (GtkClassInitFunc) gal_view_minicard_class_init, - (GtkObjectInitFunc) gal_view_minicard_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gal_view_minicard_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GalViewMinicard), + 0, /* n_preallocs */ + (GInstanceInitFunc) gal_view_minicard_init, }; - - type = gtk_type_unique (PARENT_TYPE, &info); + + type = g_type_register_static (PARENT_TYPE, "GalViewMinicard", &info, 0); } return type; diff --git a/addressbook/gui/widgets/gal-view-minicard.h b/addressbook/gui/widgets/gal-view-minicard.h index 31a28c56d9..2d267d71d0 100644 --- a/addressbook/gui/widgets/gal-view-minicard.h +++ b/addressbook/gui/widgets/gal-view-minicard.h @@ -14,11 +14,11 @@ #include <gal/menus/gal-view.h> #include <e-minicard-view-widget.h> -#define GAL_VIEW_MINICARD_TYPE (gal_view_minicard_get_type ()) -#define GAL_VIEW_MINICARD(o) (GTK_CHECK_CAST ((o), GAL_VIEW_MINICARD_TYPE, GalViewMinicard)) -#define GAL_VIEW_MINICARD_CLASS(k) (GTK_CHECK_CLASS_CAST((k), GAL_VIEW_MINICARD_TYPE, GalViewMinicardClass)) -#define GAL_IS_VIEW_MINICARD(o) (GTK_CHECK_TYPE ((o), GAL_VIEW_MINICARD_TYPE)) -#define GAL_IS_VIEW_MINICARD_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), GAL_VIEW_MINICARD_TYPE)) +#define GAL_TYPE_VIEW_MINICARD (gal_view_minicard_get_type ()) +#define GAL_VIEW_MINICARD(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_TYPE_VIEW_MINICARD, GalViewMinicard)) +#define GAL_VIEW_MINICARD_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_TYPE_VIEW_MINICARD, GalViewMinicardClass)) +#define GAL_IS_VIEW_MINICARD(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_TYPE_VIEW_MINICARD)) +#define GAL_IS_VIEW_MINICARD_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_TYPE_VIEW_MINICARD)) typedef struct { GalView base; @@ -35,7 +35,7 @@ typedef struct { } GalViewMinicardClass; /* Standard functions */ -GtkType gal_view_minicard_get_type (void); +GType gal_view_minicard_get_type (void); GalView *gal_view_minicard_new (const gchar *title); GalView *gal_view_minicard_construct (GalViewMinicard *view, const gchar *title); |