aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/vee
diff options
context:
space:
mode:
authorPeter Williams <peterw@src.gnome.org>2000-08-11 01:30:50 +0800
committerPeter Williams <peterw@src.gnome.org>2000-08-11 01:30:50 +0800
commit8cb514d6dd9497893a35a089d07a132d51263ee7 (patch)
tree9f4e5d1f929da7e0be900919753d419fe4c9c61a /camel/providers/vee
parentbcbb63c59f80eb4e684036c5ef58ab141fb01b03 (diff)
downloadgsoc2013-evolution-8cb514d6dd9497893a35a089d07a132d51263ee7.tar
gsoc2013-evolution-8cb514d6dd9497893a35a089d07a132d51263ee7.tar.gz
gsoc2013-evolution-8cb514d6dd9497893a35a089d07a132d51263ee7.tar.bz2
gsoc2013-evolution-8cb514d6dd9497893a35a089d07a132d51263ee7.tar.lz
gsoc2013-evolution-8cb514d6dd9497893a35a089d07a132d51263ee7.tar.xz
gsoc2013-evolution-8cb514d6dd9497893a35a089d07a132d51263ee7.tar.zst
gsoc2013-evolution-8cb514d6dd9497893a35a089d07a132d51263ee7.zip
Merge with camel-async.
svn path=/trunk/; revision=4687
Diffstat (limited to 'camel/providers/vee')
-rw-r--r--camel/providers/vee/camel-vee-folder.c61
-rw-r--r--camel/providers/vee/camel-vee-folder.h7
-rw-r--r--camel/providers/vee/camel-vee-store.c50
-rw-r--r--camel/providers/vee/camel-vee-store.h7
4 files changed, 42 insertions, 83 deletions
diff --git a/camel/providers/vee/camel-vee-folder.c b/camel/providers/vee/camel-vee-folder.c
index 18eb49bc98..87f2be856b 100644
--- a/camel/providers/vee/camel-vee-folder.c
+++ b/camel/providers/vee/camel-vee-folder.c
@@ -63,36 +63,26 @@ static void vee_set_message_user_flag (CamelFolder *folder, const char *uid, con
static void camel_vee_folder_class_init (CamelVeeFolderClass *klass);
static void camel_vee_folder_init (CamelVeeFolder *obj);
-static void camel_vee_folder_finalise (GtkObject *obj);
+static void camel_vee_folder_finalise (CamelObject *obj);
static void vee_folder_build(CamelVeeFolder *vf, CamelException *ex);
static void vee_folder_build_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException *ex);
static CamelFolderClass *camel_vee_folder_parent;
-enum SIGNALS {
- LAST_SIGNAL
-};
-
-static guint signals[LAST_SIGNAL] = { 0 };
-
-guint
+CamelType
camel_vee_folder_get_type (void)
{
- static guint type = 0;
+ static CamelType type = CAMEL_INVALID_TYPE;
- if (!type) {
- GtkTypeInfo type_info = {
- "CamelVeeFolder",
- sizeof (CamelVeeFolder),
- sizeof (CamelVeeFolderClass),
- (GtkClassInitFunc) camel_vee_folder_class_init,
- (GtkObjectInitFunc) camel_vee_folder_init,
- (GtkArgSetFunc) NULL,
- (GtkArgGetFunc) NULL
- };
-
- type = gtk_type_unique (camel_folder_get_type (), &type_info);
+ if (type == CAMEL_INVALID_TYPE) {
+ type = camel_type_register (camel_folder_get_type (), "CamelVeeFolder",
+ sizeof (CamelVeeFolder),
+ sizeof (CamelVeeFolderClass),
+ (CamelObjectClassInitFunc) camel_vee_folder_class_init,
+ NULL,
+ (CamelObjectInitFunc) camel_vee_folder_init,
+ (CamelObjectFinalizeFunc) camel_vee_folder_finalise);
}
return type;
@@ -101,10 +91,9 @@ camel_vee_folder_get_type (void)
static void
camel_vee_folder_class_init (CamelVeeFolderClass *klass)
{
- GtkObjectClass *object_class = (GtkObjectClass *) klass;
CamelFolderClass *folder_class = (CamelFolderClass *) klass;
- camel_vee_folder_parent = gtk_type_class (camel_folder_get_type ());
+ camel_vee_folder_parent = CAMEL_FOLDER_CLASS(camel_type_get_global_classfuncs (camel_folder_get_type ()));
folder_class->init = vee_init;
folder_class->sync = vee_sync;
@@ -125,10 +114,6 @@ camel_vee_folder_class_init (CamelVeeFolderClass *klass)
folder_class->set_message_flags = vee_set_message_flags;
folder_class->get_message_user_flag = vee_get_message_user_flag;
folder_class->set_message_user_flag = vee_set_message_user_flag;
-
- object_class->finalize = camel_vee_folder_finalise;
-
- gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
}
static void
@@ -140,7 +125,7 @@ camel_vee_folder_init (CamelVeeFolder *obj)
}
static void
-camel_vee_folder_finalise (GtkObject *obj)
+camel_vee_folder_finalise (CamelObject *obj)
{
CamelVeeFolder *vf = (CamelVeeFolder *)obj;
struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
@@ -149,11 +134,9 @@ camel_vee_folder_finalise (GtkObject *obj)
node = p->folders;
while (node) {
CamelFolder *f = node->data;
- gtk_object_unref((GtkObject *)f);
+ camel_object_unref((CamelObject *)f);
node = g_list_next(node);
}
-
- ((GtkObjectClass *)(camel_vee_folder_parent))->finalize((GtkObject *)obj);
}
/**
@@ -166,12 +149,12 @@ camel_vee_folder_finalise (GtkObject *obj)
CamelVeeFolder *
camel_vee_folder_new (void)
{
- CamelVeeFolder *new = CAMEL_VEE_FOLDER ( gtk_type_new (camel_vee_folder_get_type ()));
+ CamelVeeFolder *new = CAMEL_VEE_FOLDER ( camel_object_new (camel_vee_folder_get_type ()));
return new;
}
static void
-folder_changed(CamelFolder *sub, int type, CamelVeeFolder *vf)
+folder_changed(CamelFolder *sub, gpointer type, CamelVeeFolder *vf)
{
CamelException *ex;
@@ -179,7 +162,7 @@ folder_changed(CamelFolder *sub, int type, CamelVeeFolder *vf)
vee_folder_build_folder(vf, sub, ex);
camel_exception_free(ex);
/* FIXME: should only raise follow-on event if the result changed */
- gtk_signal_emit_by_name((GtkObject *)vf, "folder_changed", 0);
+ camel_object_trigger_event( CAMEL_OBJECT(vf), "folder_changed", GINT_TO_POINTER(0));
}
/* track flag changes in the summary */
@@ -203,7 +186,7 @@ message_changed(CamelFolder *f, const char *uid, CamelVeeFolder *mf)
camel_flag_set(&vinfo->user_flags, flag->name, TRUE);
flag = flag->next;
}
- gtk_signal_emit_by_name((GtkObject *)mf, "message_changed", vinfo->uid);
+ camel_object_trigger_event( CAMEL_OBJECT(mf), "message_changed", vinfo->uid);
}
g_free(vuid);
}
@@ -214,17 +197,17 @@ camel_vee_folder_add_folder(CamelVeeFolder *vf, CamelFolder *sub)
struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
CamelException *ex;
- gtk_object_ref((GtkObject *)sub);
+ camel_object_ref((CamelObject *)sub);
p->folders = g_list_append(p->folders, sub);
- gtk_signal_connect((GtkObject *)sub, "folder_changed", folder_changed, vf);
- gtk_signal_connect((GtkObject *)sub, "message_changed", message_changed, vf);
+ camel_object_hook_event ((CamelObject *)sub, "folder_changed", (CamelObjectEventHookFunc) folder_changed, vf);
+ camel_object_hook_event ((CamelObject *)sub, "message_changed", (CamelObjectEventHookFunc) message_changed, vf);
ex = camel_exception_new();
vee_folder_build_folder(vf, sub, ex);
camel_exception_free(ex);
/* FIXME: should only raise follow-on event if the result changed */
- gtk_signal_emit_by_name((GtkObject *)vf, "folder_changed", 0);
+ camel_object_trigger_event( CAMEL_OBJECT(vf), "folder_changed", GINT_TO_POINTER(0));
}
diff --git a/camel/providers/vee/camel-vee-folder.h b/camel/providers/vee/camel-vee-folder.h
index ea2a82a25b..6f7c788125 100644
--- a/camel/providers/vee/camel-vee-folder.h
+++ b/camel/providers/vee/camel-vee-folder.h
@@ -22,12 +22,11 @@
#ifndef _CAMEL_VEE_FOLDER_H
#define _CAMEL_VEE_FOLDER_H
-#include <gtk/gtk.h>
#include <camel/camel-folder.h>
-#define CAMEL_VEE_FOLDER(obj) GTK_CHECK_CAST (obj, camel_vee_folder_get_type (), CamelVeeFolder)
-#define CAMEL_VEE_FOLDER_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, camel_vee_folder_get_type (), CamelVeeFolderClass)
-#define IS_CAMEL_VEE_FOLDER(obj) GTK_CHECK_TYPE (obj, camel_vee_folder_get_type ())
+#define CAMEL_VEE_FOLDER(obj) CAMEL_CHECK_CAST (obj, camel_vee_folder_get_type (), CamelVeeFolder)
+#define CAMEL_VEE_FOLDER_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_vee_folder_get_type (), CamelVeeFolderClass)
+#define IS_CAMEL_VEE_FOLDER(obj) CAMEL_CHECK_TYPE (obj, camel_vee_folder_get_type ())
typedef struct _CamelVeeFolder CamelVeeFolder;
typedef struct _CamelVeeFolderClass CamelVeeFolderClass;
diff --git a/camel/providers/vee/camel-vee-store.c b/camel/providers/vee/camel-vee-store.c
index 4b1fc3f23b..8be8298b2c 100644
--- a/camel/providers/vee/camel-vee-store.c
+++ b/camel/providers/vee/camel-vee-store.c
@@ -32,33 +32,22 @@ struct _CamelVeeStorePrivate {
static void camel_vee_store_class_init (CamelVeeStoreClass *klass);
static void camel_vee_store_init (CamelVeeStore *obj);
-static void camel_vee_store_finalise (GtkObject *obj);
static CamelStoreClass *camel_vee_store_parent;
-enum SIGNALS {
- LAST_SIGNAL
-};
-
-static guint signals[LAST_SIGNAL] = { 0 };
-
-guint
+CamelType
camel_vee_store_get_type (void)
{
- static guint type = 0;
+ static CamelType type = CAMEL_INVALID_TYPE;
- if (!type) {
- GtkTypeInfo type_info = {
- "CamelVeeStore",
- sizeof (CamelVeeStore),
- sizeof (CamelVeeStoreClass),
- (GtkClassInitFunc) camel_vee_store_class_init,
- (GtkObjectInitFunc) camel_vee_store_init,
- (GtkArgSetFunc) NULL,
- (GtkArgGetFunc) NULL
- };
-
- type = gtk_type_unique (camel_store_get_type (), &type_info);
+ if (type == CAMEL_INVALID_TYPE) {
+ type = camel_type_register (camel_store_get_type (), "CamelVeeStore",
+ sizeof (CamelVeeStore),
+ sizeof (CamelVeeStoreClass),
+ (CamelObjectClassInitFunc) camel_vee_store_class_init,
+ NULL,
+ (CamelObjectInitFunc) camel_vee_store_init,
+ NULL);
}
return type;
@@ -68,18 +57,13 @@ static void
camel_vee_store_class_init (CamelVeeStoreClass *klass)
{
- GtkObjectClass *object_class = (GtkObjectClass *) klass;
CamelStoreClass *store_class = (CamelStoreClass *) klass;
- camel_vee_store_parent = gtk_type_class (camel_store_get_type ());
+ camel_vee_store_parent = CAMEL_STORE_CLASS(camel_type_get_global_classfuncs (camel_store_get_type ()));
/* virtual method overload */
store_class->get_folder = vee_get_folder;
store_class->get_folder_name = vee_get_folder_name;
-
- object_class->finalize = camel_vee_store_finalise;
-
- gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
}
static void
@@ -90,12 +74,6 @@ camel_vee_store_init (CamelVeeStore *obj)
p = _PRIVATE(obj) = g_malloc0(sizeof(*p));
}
-static void
-camel_vee_store_finalise (GtkObject *obj)
-{
- ((GtkObjectClass *)(camel_vee_store_parent))->finalize((GtkObject *)obj);
-}
-
/**
* camel_vee_store_new:
*
@@ -106,7 +84,7 @@ camel_vee_store_finalise (GtkObject *obj)
CamelVeeStore *
camel_vee_store_new (void)
{
- CamelVeeStore *new = CAMEL_VEE_STORE ( gtk_type_new (camel_vee_store_get_type ()));
+ CamelVeeStore *new = CAMEL_VEE_STORE ( camel_object_new (camel_vee_store_get_type ()));
return new;
}
@@ -115,9 +93,9 @@ vee_get_folder (CamelStore *store, const char *folder_name, gboolean create, Cam
{
CamelFolder *folder;
- folder = gtk_type_new (camel_vee_folder_get_type());
+ folder = CAMEL_FOLDER (camel_object_new (camel_vee_folder_get_type()));
- ((CamelFolderClass *)((GtkObject *)folder)->klass)->init (folder, store, NULL, folder_name, "/", TRUE, ex);
+ ((CamelFolderClass *)(CAMEL_OBJECT_GET_CLASS(folder)))->init (folder, store, NULL, folder_name, "/", TRUE, ex);
return folder;
}
diff --git a/camel/providers/vee/camel-vee-store.h b/camel/providers/vee/camel-vee-store.h
index 848769296a..d4ed7a0610 100644
--- a/camel/providers/vee/camel-vee-store.h
+++ b/camel/providers/vee/camel-vee-store.h
@@ -22,12 +22,11 @@
#ifndef _CAMEL_VEE_STORE_H
#define _CAMEL_VEE_STORE_H
-#include <gtk/gtk.h>
#include <camel/camel-store.h>
-#define CAMEL_VEE_STORE(obj) GTK_CHECK_CAST (obj, camel_vee_store_get_type (), CamelVeeStore)
-#define CAMEL_VEE_STORE_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, camel_vee_store_get_type (), CamelVeeStoreClass)
-#define IS_CAMEL_VEE_STORE(obj) GTK_CHECK_TYPE (obj, camel_vee_store_get_type ())
+#define CAMEL_VEE_STORE(obj) CAMEL_CHECK_CAST (obj, camel_vee_store_get_type (), CamelVeeStore)
+#define CAMEL_VEE_STORE_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_vee_store_get_type (), CamelVeeStoreClass)
+#define IS_CAMEL_VEE_STORE(obj) CAMEL_CHECK_TYPE (obj, camel_vee_store_get_type ())
typedef struct _CamelVeeStore CamelVeeStore;
typedef struct _CamelVeeStoreClass CamelVeeStoreClass;