aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/text/e-text-model-uri.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2002-11-17 07:49:31 +0800
committerChris Toshok <toshok@src.gnome.org>2002-11-17 07:49:31 +0800
commitd8e4ebebc320c72ae93c88dc43d8ae220a94331d (patch)
treeee09f7d541eed7543ec2fb0edbc54c8723c15176 /widgets/text/e-text-model-uri.c
parent09e8fe231719c87f7b1b4a22cc7015773bb1be19 (diff)
downloadgsoc2013-evolution-d8e4ebebc320c72ae93c88dc43d8ae220a94331d.tar.gz
gsoc2013-evolution-d8e4ebebc320c72ae93c88dc43d8ae220a94331d.tar.zst
gsoc2013-evolution-d8e4ebebc320c72ae93c88dc43d8ae220a94331d.zip
Lots of GObject work.
2002-11-16 Chris Toshok <toshok@ximian.com> * gal/e-text/e-completion-test.c: Lots of GObject work. * gal/e-text/e-completion-view.[ch]: same. * gal/e-text/e-completion.[ch]: same. * gal/e-text/e-entry.[ch]: same. * gal/e-text/e-table-text-model.[ch]: same. * gal/e-text/e-text-model-uri.[ch]: same. * gal/e-text/e-text-model.[ch]: same. * gal/e-text/e-text-test.c: same. * gal/e-text/e-text.[ch]: same. svn path=/trunk/; revision=18800
Diffstat (limited to 'widgets/text/e-text-model-uri.c')
-rw-r--r--widgets/text/e-text-model-uri.c50
1 files changed, 18 insertions, 32 deletions
diff --git a/widgets/text/e-text-model-uri.c b/widgets/text/e-text-model-uri.c
index 7292d2954e..858771b481 100644
--- a/widgets/text/e-text-model-uri.c
+++ b/widgets/text/e-text-model-uri.c
@@ -30,10 +30,11 @@
#include <regex.h>
#include <gtk/gtkmain.h>
#include <libgnome/gnome-url.h>
+#include <gal/util/e-util.h>
static void e_text_model_uri_class_init (ETextModelURIClass *class);
static void e_text_model_uri_init (ETextModelURI *model);
-static void e_text_model_uri_destroy (GtkObject *object);
+static void e_text_model_uri_dispose (GObject *object);
static void objectify_uris (ETextModelURI *model);
@@ -48,43 +49,28 @@ struct _ObjInfo {
gint offset, len;
};
+#define PARENT_TYPE E_TYPE_TEXT_MODEL
static GtkObject *parent_class;
-GtkType
-e_text_model_uri_get_type (void)
-{
- static GtkType model_uri_type = 0;
-
- if (!model_uri_type) {
- GtkTypeInfo model_uri_info = {
- "ETextModelURI",
- sizeof (ETextModelURI),
- sizeof (ETextModelURIClass),
- (GtkClassInitFunc) e_text_model_uri_class_init,
- (GtkObjectInitFunc) e_text_model_uri_init,
- NULL, /* reserved_1 */
- NULL, /* reserved_2 */
- (GtkClassInitFunc) NULL
- };
-
- model_uri_type = gtk_type_unique (e_text_model_get_type (), &model_uri_info);
- }
-
- return model_uri_type;
-}
-
+E_MAKE_TYPE (e_text_model_uri,
+ "ETextModelURI",
+ ETextModelURI,
+ e_text_model_uri_class_init,
+ e_text_model_uri_init,
+ PARENT_TYPE)
+
static void
e_text_model_uri_class_init (ETextModelURIClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
ETextModelClass *model_class;
- object_class = (GtkObjectClass *) klass;
+ object_class = (GObjectClass *) klass;
model_class = E_TEXT_MODEL_CLASS (klass);
- parent_class = gtk_type_class (e_text_model_get_type ());
+ parent_class = g_type_class_ref (PARENT_TYPE);
- object_class->destroy = e_text_model_uri_destroy;
+ object_class->dispose = e_text_model_uri_dispose;
model_class->object_activated = e_text_model_uri_activate_nth_object;
@@ -102,7 +88,7 @@ e_text_model_uri_init (ETextModelURI *model)
}
static void
-e_text_model_uri_destroy (GtkObject *object)
+e_text_model_uri_dispose (GObject *object)
{
ETextModelURI *model_uri = E_TEXT_MODEL_URI (object);
GList *iter;
@@ -117,8 +103,8 @@ e_text_model_uri_destroy (GtkObject *object)
g_list_free (model_uri->uris);
model_uri->uris = NULL;
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ if (G_OBJECT_CLASS (parent_class)->dispose)
+ (* G_OBJECT_CLASS (parent_class)->dispose) (object);
}
@@ -351,7 +337,7 @@ e_text_model_uri_activate_nth_object (ETextModel *model, gint i)
ETextModel *
e_text_model_uri_new (void)
{
- return E_TEXT_MODEL (gtk_type_new (e_text_model_uri_get_type ()));
+ return E_TEXT_MODEL (g_object_new (E_TYPE_TEXT_MODEL_URI, NULL));
}