diff options
author | Peter Williams <peterw@src.gnome.org> | 2000-08-11 01:30:50 +0800 |
---|---|---|
committer | Peter Williams <peterw@src.gnome.org> | 2000-08-11 01:30:50 +0800 |
commit | 8cb514d6dd9497893a35a089d07a132d51263ee7 (patch) | |
tree | 9f4e5d1f929da7e0be900919753d419fe4c9c61a /camel/providers/pop3 | |
parent | bcbb63c59f80eb4e684036c5ef58ab141fb01b03 (diff) | |
download | gsoc2013-evolution-8cb514d6dd9497893a35a089d07a132d51263ee7.tar.gz gsoc2013-evolution-8cb514d6dd9497893a35a089d07a132d51263ee7.tar.zst gsoc2013-evolution-8cb514d6dd9497893a35a089d07a132d51263ee7.zip |
Merge with camel-async.
svn path=/trunk/; revision=4687
Diffstat (limited to 'camel/providers/pop3')
-rw-r--r-- | camel/providers/pop3/camel-pop3-folder.c | 42 | ||||
-rw-r--r-- | camel/providers/pop3/camel-pop3-folder.h | 11 | ||||
-rw-r--r-- | camel/providers/pop3/camel-pop3-store.c | 38 | ||||
-rw-r--r-- | camel/providers/pop3/camel-pop3-store.h | 11 |
4 files changed, 40 insertions, 62 deletions
diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c index 9733a5f114..6dbba64c20 100644 --- a/camel/providers/pop3/camel-pop3-folder.c +++ b/camel/providers/pop3/camel-pop3-folder.c @@ -33,10 +33,10 @@ #include <stdlib.h> #include <string.h> -#define CF_CLASS(o) (CAMEL_FOLDER_CLASS (GTK_OBJECT (o)->klass)) +#define CF_CLASS(o) (CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(o))) static CamelFolderClass *parent_class; -static void pop3_finalize (GtkObject *object); +static void pop3_finalize (CamelObject *object); static void pop3_sync (CamelFolder *folder, gboolean expunge, CamelException *ex); @@ -56,10 +56,8 @@ camel_pop3_folder_class_init (CamelPop3FolderClass *camel_pop3_folder_class) { CamelFolderClass *camel_folder_class = CAMEL_FOLDER_CLASS (camel_pop3_folder_class); - GtkObjectClass *object_class = - GTK_OBJECT_CLASS (camel_pop3_folder_class); - parent_class = gtk_type_class (camel_folder_get_type ()); + parent_class = CAMEL_FOLDER_CLASS(camel_type_get_global_classfuncs (camel_folder_get_type ())); /* virtual method overload */ camel_folder_class->sync = pop3_sync; @@ -70,12 +68,10 @@ camel_pop3_folder_class_init (CamelPop3FolderClass *camel_pop3_folder_class) camel_folder_class->get_message = pop3_get_message; camel_folder_class->set_message_flags = pop3_set_message_flags; - - object_class->finalize = pop3_finalize; } static void -camel_pop3_folder_init (gpointer object, gpointer klass) +camel_pop3_folder_init (gpointer object) { CamelFolder *folder = CAMEL_FOLDER (object); @@ -85,32 +81,26 @@ camel_pop3_folder_init (gpointer object, gpointer klass) folder->has_search_capability = FALSE; } -GtkType +CamelType camel_pop3_folder_get_type (void) { - static GtkType camel_pop3_folder_type = 0; + static CamelType camel_pop3_folder_type = CAMEL_INVALID_TYPE; if (!camel_pop3_folder_type) { - GtkTypeInfo camel_pop3_folder_info = - { - "CamelPop3Folder", - sizeof (CamelPop3Folder), - sizeof (CamelPop3FolderClass), - (GtkClassInitFunc) camel_pop3_folder_class_init, - (GtkObjectInitFunc) camel_pop3_folder_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - camel_pop3_folder_type = gtk_type_unique (CAMEL_FOLDER_TYPE, &camel_pop3_folder_info); + camel_pop3_folder_type = camel_type_register (CAMEL_FOLDER_TYPE, "CamelPop3Folder", + sizeof (CamelPop3Folder), + sizeof (CamelPop3FolderClass), + (CamelObjectClassInitFunc) camel_pop3_folder_class_init, + NULL, + (CamelObjectInitFunc) camel_pop3_folder_init, + (CamelObjectFinalizeFunc) pop3_finalize); } return camel_pop3_folder_type; } void -pop3_finalize (GtkObject *object) +pop3_finalize (CamelObject *object) { CamelPop3Folder *pop3_folder = CAMEL_POP3_FOLDER (object); @@ -171,7 +161,7 @@ camel_pop3_folder_new (CamelStore *parent, CamelException *ex) } } - pop3_folder = gtk_type_new (CAMEL_POP3_FOLDER_TYPE); + pop3_folder = CAMEL_POP3_FOLDER(camel_object_new (CAMEL_POP3_FOLDER_TYPE)); CF_CLASS (pop3_folder)->init ((CamelFolder *)pop3_folder, parent, NULL, "inbox", "/", TRUE, ex); pop3_folder->uids = uids; @@ -304,7 +294,7 @@ pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex) camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (msg), CAMEL_STREAM (msgstream)); - gtk_object_unref (GTK_OBJECT (msgstream)); + camel_object_unref (CAMEL_OBJECT (msgstream)); return msg; } diff --git a/camel/providers/pop3/camel-pop3-folder.h b/camel/providers/pop3/camel-pop3-folder.h index 89c16c4c89..b4cfd469b6 100644 --- a/camel/providers/pop3/camel-pop3-folder.h +++ b/camel/providers/pop3/camel-pop3-folder.h @@ -33,13 +33,12 @@ extern "C" { #pragma } #endif /* __cplusplus }*/ -#include <gtk/gtk.h> #include "camel-folder.h" #define CAMEL_POP3_FOLDER_TYPE (camel_pop3_folder_get_type ()) -#define CAMEL_POP3_FOLDER(obj) (GTK_CHECK_CAST((obj), CAMEL_POP3_FOLDER_TYPE, CamelPop3Folder)) -#define CAMEL_POP3_FOLDER_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), CAMEL_POP3_FOLDER_TYPE, CamelPop3FolderClass)) -#define IS_CAMEL_POP3_FOLDER(o) (GTK_CHECK_TYPE((o), CAMEL_POP3_FOLDER_TYPE)) +#define CAMEL_POP3_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_POP3_FOLDER_TYPE, CamelPop3Folder)) +#define CAMEL_POP3_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_POP3_FOLDER_TYPE, CamelPop3FolderClass)) +#define IS_CAMEL_POP3_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_POP3_FOLDER_TYPE)) typedef struct { @@ -63,8 +62,8 @@ typedef struct { /* public methods */ CamelFolder *camel_pop3_folder_new (CamelStore *parent, CamelException *ex); -/* Standard Gtk function */ -GtkType camel_pop3_folder_get_type (void); +/* Standard Camel function */ +CamelType camel_pop3_folder_get_type (void); #ifdef __cplusplus } diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index 953a286a25..3cab99e0dd 100644 --- a/camel/providers/pop3/camel-pop3-store.c +++ b/camel/providers/pop3/camel-pop3-store.c @@ -58,7 +58,7 @@ static CamelServiceClass *service_class = NULL; -static void finalize (GtkObject *object); +static void finalize (CamelObject *object); static gboolean pop3_connect (CamelService *service, CamelException *ex); static gboolean pop3_disconnect (CamelService *service, CamelException *ex); @@ -78,18 +78,14 @@ static int pop3_get_response (CamelPop3Store *store, char **ret); static void camel_pop3_store_class_init (CamelPop3StoreClass *camel_pop3_store_class) { - GtkObjectClass *object_class = - GTK_OBJECT_CLASS (camel_pop3_store_class); CamelServiceClass *camel_service_class = CAMEL_SERVICE_CLASS (camel_pop3_store_class); CamelStoreClass *camel_store_class = CAMEL_STORE_CLASS (camel_pop3_store_class); - service_class = gtk_type_class (camel_service_get_type ()); + service_class = CAMEL_SERVICE_CLASS(camel_type_get_global_classfuncs (camel_service_get_type ())); /* virtual method overload */ - object_class->finalize = finalize; - camel_service_class->connect = pop3_connect; camel_service_class->disconnect = pop3_disconnect; camel_service_class->query_auth_types = query_auth_types; @@ -111,32 +107,26 @@ camel_pop3_store_init (gpointer object, gpointer klass) service->url_flags = (CAMEL_SERVICE_URL_NEED_USER | CAMEL_SERVICE_URL_NEED_HOST); } -GtkType +CamelType camel_pop3_store_get_type (void) { - static GtkType camel_pop3_store_type = 0; + static CamelType camel_pop3_store_type = CAMEL_INVALID_TYPE; if (!camel_pop3_store_type) { - GtkTypeInfo camel_pop3_store_info = - { - "CamelPop3Store", - sizeof (CamelPop3Store), - sizeof (CamelPop3StoreClass), - (GtkClassInitFunc) camel_pop3_store_class_init, - (GtkObjectInitFunc) camel_pop3_store_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - camel_pop3_store_type = gtk_type_unique (CAMEL_STORE_TYPE, &camel_pop3_store_info); + camel_pop3_store_type = camel_type_register (CAMEL_STORE_TYPE, "CamelPop3Store", + sizeof (CamelPop3Store), + sizeof (CamelPop3StoreClass), + (CamelObjectClassInitFunc) camel_pop3_store_class_init, + NULL, + (CamelObjectInitFunc) camel_pop3_store_init, + finalize); } return camel_pop3_store_type; } static void -finalize (GtkObject *object) +finalize (CamelObject *object) { CamelPop3Store *pop3_store = CAMEL_POP3_STORE (object); CamelException ex; @@ -548,11 +538,11 @@ pop3_disconnect (CamelService *service, CamelException *ex) d(printf ("POP3: Disconnecting from %s\n", service->url->host)); if (store->ostream) { - gtk_object_unref (GTK_OBJECT (store->ostream)); + camel_object_unref (CAMEL_OBJECT (store->ostream)); store->ostream = NULL; } if (store->istream) { - gtk_object_unref (GTK_OBJECT (store->istream)); + camel_object_unref (CAMEL_OBJECT (store->istream)); store->istream = NULL; } diff --git a/camel/providers/pop3/camel-pop3-store.h b/camel/providers/pop3/camel-pop3-store.h index 74174a32f2..f5e447d9ea 100644 --- a/camel/providers/pop3/camel-pop3-store.h +++ b/camel/providers/pop3/camel-pop3-store.h @@ -33,14 +33,13 @@ extern "C" { #pragma } #endif /* __cplusplus }*/ -#include <gtk/gtk.h> #include "camel-types.h" #include "camel-store.h" #define CAMEL_POP3_STORE_TYPE (camel_pop3_store_get_type ()) -#define CAMEL_POP3_STORE(obj) (GTK_CHECK_CAST((obj), CAMEL_POP3_STORE_TYPE, CamelPop3Store)) -#define CAMEL_POP3_STORE_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), CAMEL_POP3_STORE_TYPE, CamelPop3StoreClass)) -#define IS_CAMEL_POP3_STORE(o) (GTK_CHECK_TYPE((o), CAMEL_POP3_STORE_TYPE)) +#define CAMEL_POP3_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_POP3_STORE_TYPE, CamelPop3Store)) +#define CAMEL_POP3_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_POP3_STORE_TYPE, CamelPop3StoreClass)) +#define IS_CAMEL_POP3_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_POP3_STORE_TYPE)) typedef struct { @@ -70,8 +69,8 @@ int camel_pop3_command (CamelPop3Store *store, char **ret, char *fmt, ...); char *camel_pop3_command_get_additional_data (CamelPop3Store *store, CamelException *ex); -/* Standard Gtk function */ -GtkType camel_pop3_store_get_type (void); +/* Standard Camel function */ +CamelType camel_pop3_store_get_type (void); #ifdef __cplusplus } |