evolution r36144 - branches/mail-dbus-remoting/mail
- From: abharath svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution r36144 - branches/mail-dbus-remoting/mail
- Date: Thu, 28 Aug 2008 07:54:55 +0000 (UTC)
Author: abharath
Date: Thu Aug 28 07:54:55 2008
New Revision: 36144
URL: http://svn.gnome.org/viewvc/evolution?rev=36144&view=rev
Log:
Added Folder remote files
Added:
branches/mail-dbus-remoting/mail/camel-folder-remote-impl.c
branches/mail-dbus-remoting/mail/camel-folder-remote.c
branches/mail-dbus-remoting/mail/camel-folder-remote.h
Modified:
branches/mail-dbus-remoting/mail/Makefile.am
Modified: branches/mail-dbus-remoting/mail/Makefile.am
==============================================================================
--- branches/mail-dbus-remoting/mail/Makefile.am (original)
+++ branches/mail-dbus-remoting/mail/Makefile.am Thu Aug 28 07:54:55 2008
@@ -91,6 +91,7 @@
camel-store-remote.h \
camel-object-remote.h \
camel-session-remote.h \
+ camel-folder-remote.h \
mail-vfolder.h
# libevolution-mail
@@ -197,7 +198,6 @@
camel-store-remote.c \
camel-store-remote.h \
camel-store-remote-impl.c \
- camel-store-remote-impl.h \
mail-dbus.c \
mail-dbus.h \
evo-dbus.c \
@@ -205,7 +205,6 @@
camel-session-remote.c \
camel-session-remote.h \
camel-session-remote-impl.c \
- camel-session-remote-impl.h \
mail-session-remote.c \
mail-session-remote.h \
mail-session-remote-impl.c \
@@ -213,7 +212,10 @@
camel-object-remote.c \
camel-object-remote.h \
camel-object-remote-impl.c \
- camel-object-remote-impl.h
+ camel-object-remote-impl.h \
+ camel-folder-remote.c \
+ camel-folder-remote.h \
+ camel-folder-remote-impl.c
if ENABLE_SMIME
Added: branches/mail-dbus-remoting/mail/camel-folder-remote-impl.c
==============================================================================
--- (empty file)
+++ branches/mail-dbus-remoting/mail/camel-folder-remote-impl.c Thu Aug 28 07:54:55 2008
@@ -0,0 +1,74 @@
+#include <string.h>
+#include <glib.h>
+#include <glib/gi18n.h>
+#include "mail-dbus.h"
+#include <camel/camel.h>
+#include "camel-object-remote-impl.h"
+
+#define CAMEL_FOLDER_OBJECT_PATH "/org/gnome/evolution/camel/folder"
+#define CAMEL_FOLDER_INTERFACE "org.gnome.evolution.camel.folder"
+
+extern GHashTable *store_hash;
+extern GHashTable *folder_hash;
+
+static DBusHandlerResult
+dbus_listener_message_handler(DBusConnection * connection,
+ DBusMessage * message, void *user_data);
+
+void camel_folder_remote_impl_init(void);
+
+static DBusHandlerResult
+dbus_listener_message_handler(DBusConnection * connection,
+ DBusMessage * message, void *user_data)
+{
+ const char *method = dbus_message_get_member (message);
+ DBusMessage *return_val;
+ char *folder_hash_key, *store_hash_key;
+ CamelStore *store;
+ CamelFolder *folder;
+
+ printf
+ ("D-Bus message: obj_path = '%s' interface = '%s' method = '%s' destination = '%s'\n",
+ dbus_message_get_path (message),
+ dbus_message_get_interface (message),
+ dbus_message_get_member (message),
+ dbus_message_get_destination (message));
+
+ return_val = dbus_message_new_method_return (message);
+
+ if (strcmp(method, "camel_folder_construct") == 0) {
+ char *full_name, *name;
+ gboolean ret;
+
+ ret = dbus_message_get_args (message, NULL,
+ DBUS_TYPE_STRING, &folder_hash_key,
+ DBUS_TYPE_STRING, &store_hash_key,
+ DBUS_TYPE_STRING, &full_name,
+ DBUS_TYPE_STRING, &name,
+ DBUS_TYPE_INVALID);
+ store = g_hash_table_lookup (store_hash, store_hash_key);
+ folder = g_hash_table_lookup (folder_hash, folder_hash_key);
+
+ camel_folder_construct (folder, store, full_name, name);
+ dbus_message_append_args (return_val, DBUS_TYPE_INVALID);
+ } else if (strcmp(method, "camel_folder_thaw") == 0) {
+ gboolean ret;
+
+ ret = dbus_message_get_args (message, NULL,
+ DBUS_TYPE_STRING, &folder_hash_key,
+ DBUS_TYPE_INVALID);
+ folder = g_hash_table_lookup (folder_hash, folder_hash_key);
+
+ camel_folder_thaw (folder);
+ dbus_message_append_args (return_val, DBUS_TYPE_INVALID);
+ } else if (strncmp (method, "camel_object", 12) == 0) {
+ return camel_object_folder_signal_handler (connection, message, user_data);
+ } else
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+
+void camel_folder_remote_impl_init()
+{
+ e_dbus_register_handler(CAMEL_FOLDER_OBJECT_PATH,
+ dbus_listener_message_handler, NULL);
+}
Added: branches/mail-dbus-remoting/mail/camel-folder-remote.c
==============================================================================
--- (empty file)
+++ branches/mail-dbus-remoting/mail/camel-folder-remote.c Thu Aug 28 07:54:55 2008
@@ -0,0 +1,63 @@
+#include <mail-dbus.h>
+#include <evo-dbus.h>
+#include <dbind.h>
+#include <camel/camel-folder.h>
+#include "camel-folder-remote.h"
+
+
+#define d(x) x
+
+extern GHashTable *folder_hash;
+
+void
+camel_folder_construct_remote (CamelFolderRemote *folder,
+ CamelStoreRemote *parent_store,
+ const char *full_name,
+ const char *name)
+{
+ gboolean ret;
+ DBusError error;
+
+ dbus_error_init (&error);
+ /* Invoke the appropriate dbind call to MailSessionRemoteImpl */
+ ret = dbind_context_method_call (evolution_dbus_peek_context(),
+ CAMEL_DBUS_NAME,
+ CAMEL_FOLDER_OBJECT_PATH,
+ CAMEL_FOLDER_INTERFACE,
+ "camel_folder_construct",
+ &error,
+ "ssss", folder->object_id, parent_store->object_id, full_name, name);
+
+ if (!ret) {
+ g_warning ("Error: Constructing camel folder: %s\n", error.message);
+ return;
+ }
+
+ d(printf("Camel folder constructed remotely\n"));
+}
+
+void
+camel_folder_thaw_remote (CamelFolderRemote *folder)
+{
+ gboolean ret;
+ DBusError error;
+
+ dbus_error_init (&error);
+ /* Invoke the appropriate dbind call to MailSessionRemoteImpl */
+ ret = dbind_context_method_call (evolution_dbus_peek_context(),
+ CAMEL_DBUS_NAME,
+ CAMEL_FOLDER_OBJECT_PATH,
+ CAMEL_FOLDER_INTERFACE,
+ "camel_folder_thaw",
+ &error,
+ "s", folder->object_id);
+
+ if (!ret) {
+ g_warning ("Error: Camel folder thaw: %s\n", error.message);
+ return;
+ }
+
+ d(printf("Camel folder thaw remotely\n"));
+}
+
+
Added: branches/mail-dbus-remoting/mail/camel-folder-remote.h
==============================================================================
--- (empty file)
+++ branches/mail-dbus-remoting/mail/camel-folder-remote.h Thu Aug 28 07:54:55 2008
@@ -0,0 +1,14 @@
+#ifndef CAMEL_SESSION_REMOTE_H
+#define CAMEL_SESSION_REMOTE_H
+
+#include "camel-object-remote.h"
+#include "camel-store-remote.h"
+
+void camel_folder_construct_remote (CamelFolderRemote *folder,
+ CamelStoreRemote *parent_store,
+ const char *full_name,
+ const char *name);
+
+void camel_folder_thaw_remote (CamelFolderRemote *folder);
+
+#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]