aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorbertrand <bertrand@helixcode.com>2000-03-12 23:17:01 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>2000-03-12 23:17:01 +0800
commit5adb1dedf6e2fedd68edecc67f8badb28994dce7 (patch)
tree7cb2cec0e80c9521287661870618ee35549c1451 /shell
parent6e515d204a3477cabe2d5dd934ee45406c528ab5 (diff)
downloadgsoc2013-evolution-5adb1dedf6e2fedd68edecc67f8badb28994dce7.tar.gz
gsoc2013-evolution-5adb1dedf6e2fedd68edecc67f8badb28994dce7.tar.zst
gsoc2013-evolution-5adb1dedf6e2fedd68edecc67f8badb28994dce7.zip
Implementation of the service repository interface as a bonobo object.
2000-03-12 bertrand <bertrand@helixcode.com> * shell/evolution-service-repository.c: * shell/evolution-service-repository.h: Implementation of the service repository interface as a bonobo object. * shell/evolution-service-repository.idl: new file. Contains the definition for the service repository interface. * shell/Shell.idl: move the shell related stuff here svn path=/trunk/; revision=2103
Diffstat (limited to 'shell')
-rw-r--r--shell/Evolution.idl21
-rw-r--r--shell/Makefile.am12
-rw-r--r--shell/Shell.idl40
-rw-r--r--shell/e-folder.h7
-rw-r--r--shell/e-service.c6
-rw-r--r--shell/e-service.h6
-rw-r--r--shell/e-shell-view.c2
-rw-r--r--shell/e-shell.c14
-rw-r--r--shell/evolution-service-repository.c96
-rw-r--r--shell/evolution-service-repository.h47
-rw-r--r--shell/evolution-service-repository.idl21
11 files changed, 236 insertions, 36 deletions
diff --git a/shell/Evolution.idl b/shell/Evolution.idl
index 51b083c5d7..0253971a5b 100644
--- a/shell/Evolution.idl
+++ b/shell/Evolution.idl
@@ -1,3 +1,5 @@
+/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
/*
* CORBA interface for the Evolution shell
*
@@ -7,22 +9,7 @@
* (C) 2000 Helix Code, Inc.
*/
#include <Bonobo.idl>
+#include <Shell.idl>
+#include <evolution-service-repository.idl>
-module Evolution {
- interface Shell : Bonobo::Unknown {
- enum NewType {
- APPOINTMENT,
- MEETING_REQUEST,
- TASK,
- TASK_REQUEST,
- CONTACT,
- MAIL_MESSAGE,
- DISTRIBUTION_LIST,
- JOURNAL_ENTRY,
- NOTE
- };
-
- void new (in NewType type);
- };
-};
diff --git a/shell/Makefile.am b/shell/Makefile.am
index 1ad4872aad..f7d4476eac 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -32,11 +32,14 @@ evolution_SOURCES = \
e-shell-view-menu.c \
e-shell-view-menu.h \
e-shortcut.c \
- e-shortcut.h
+ e-shortcut.h \
+ evolution-service-repository.c \
+ evolution-service-repository.h
+
Evolution-impl.o: Evolution.h
-$(EVOLUTION_CORBA_GENERATED): Evolution.idl
+$(EVOLUTION_CORBA_GENERATED): Evolution.idl evolution-service-repository.idl
orbit-idl -I`$(GNOME_CONFIG) --datadir`/idl -I$(srcdir) $(srcdir)/Evolution.idl
evolution_LDADD = \
@@ -45,4 +48,7 @@ evolution_LDADD = \
../e-util/libeutil.la \
$(BONOBO_GNOME_LIBS)
-EXTRA_DIST = Evolution.idl
+EXTRA_DIST = Evolution.idl \
+ Shell.idl \
+ evolution-service-repository.idl
+
diff --git a/shell/Shell.idl b/shell/Shell.idl
index d776713b51..07dfbbf191 100644
--- a/shell/Shell.idl
+++ b/shell/Shell.idl
@@ -8,16 +8,38 @@
*/
#include <bonobo.idl>
-module GNOME {
- module Evolution {
-
- interface Shell : GNOME::Unknown {
- /*
- * add a service to the shell.
- *
- */
- void AddService (string service);
+module Evolution {
+ interface Shell : Bonobo::Unknown {
+ enum NewType {
+ APPOINTMENT,
+ MEETING_REQUEST,
+ TASK,
+ TASK_REQUEST,
+ CONTACT,
+ MAIL_MESSAGE,
+ DISTRIBUTION_LIST,
+ JOURNAL_ENTRY,
+ NOTE
+ };
+
+ enum ServiceType {
+ MAIL_STORE,
+ MAIL_TRANSPORT
};
+
+ void new (in NewType type);
+
+ /**
+ * register_service : register a service into the shell
+ *
+ * @type : type of the service
+ * @uri : uri of the service, uniquely determine the service.
+ *
+ */
+ void register_service (in ServiceType type,
+ in string uri);
+
+
};
};
diff --git a/shell/e-folder.h b/shell/e-folder.h
index 0de9ae6576..37b0f63862 100644
--- a/shell/e-folder.h
+++ b/shell/e-folder.h
@@ -5,9 +5,12 @@
#ifndef _E_FOLDER_H_
#define _E_FOLDER_H_
+
+#include "eshell-types.h"
#include <gtk/gtkobject.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
+
#define E_FOLDER_TYPE (e_folder_get_type ())
#define E_FOLDER(o) (GTK_CHECK_CAST ((o), E_FOLDER_TYPE, EFolder))
#define E_FOLDER_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_FOLDER_TYPE, EFolderClass))
@@ -27,7 +30,7 @@ typedef enum {
E_FOLDER_OTHER
} EFolderType;
-typedef struct {
+struct _EFolder {
GtkObject parent_object;
EFolderType type;
@@ -46,7 +49,7 @@ typedef struct {
* Administration properties
*/
char *view_name; /* View name */
-} EFolder;
+};
typedef struct {
GtkObjectClass parent_class;
diff --git a/shell/e-service.c b/shell/e-service.c
index f567487ef4..c8c52383f7 100644
--- a/shell/e-service.c
+++ b/shell/e-service.c
@@ -81,10 +81,10 @@ E_MAKE_TYPE (e_service, "EService", EService, e_service_class_init, e_service_in
EFolder *
e_service_get_root_efolder (EService *eservice)
{
- g_return_if_fail (eservice != NULL);
- g_return_if_fail (E_IS_SERVICE (eservice));
-
+ g_return_val_if_fail (eservice != NULL, NULL);
+ g_return_val_if_fail (E_IS_SERVICE (eservice), NULL);
+ return eservice->root_efolder;
}
diff --git a/shell/e-service.h b/shell/e-service.h
index 54d54d6b38..3488d613ee 100644
--- a/shell/e-service.h
+++ b/shell/e-service.h
@@ -59,6 +59,7 @@
#ifndef _E_SERVICE_H_
#define _E_SERVICE_H_
+#include "eshell-types.h"
#include <gtk/gtkobject.h>
#define E_SERVICE_TYPE (e_service_get_type ())
@@ -76,7 +77,8 @@ typedef enum {
E_SERVICE_OTHER = 1 << 4
} EServiceType;
-typedef struct {
+ struct _EService {
+
GtkObject parent_object;
EFolder *root_efolder; /* a service may have a root EFolder */
@@ -92,7 +94,7 @@ typedef struct {
EServiceType type; /* type of the service */
-} EService;
+};
typedef struct {
GtkObjectClass parent_class;
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 8ab912fefc..ea5f30897a 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
/*
* E-shell-view.c: Implements a Shell View of Evolution
*
diff --git a/shell/e-shell.c b/shell/e-shell.c
index cd4be67bc6..e78a30e876 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
/*
* E-shell.c: Shell object for Evolution
*
@@ -123,6 +125,17 @@ EShell_cmd_new (PortableServer_Servant servant,
}
}
+static void
+EShell_register_service (PortableServer_Servant servant,
+ const Evolution_Shell_ServiceType type,
+ const CORBA_char *uri,
+ CORBA_Environment *ev)
+{
+ printf ("toto\n");
+
+}
+
+
static POA_Evolution_Shell__epv *
e_shell_get_epv (void)
{
@@ -131,6 +144,7 @@ e_shell_get_epv (void)
epv = g_new0 (POA_Evolution_Shell__epv, 1);
epv->new = EShell_cmd_new;
+ epv->register_service = EShell_register_service;
return epv;
}
diff --git a/shell/evolution-service-repository.c b/shell/evolution-service-repository.c
new file mode 100644
index 0000000000..d2f525f995
--- /dev/null
+++ b/shell/evolution-service-repository.c
@@ -0,0 +1,96 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+#include <config.h>
+#include <gtk/gtksignal.h>
+#include <gtk/gtkmarshal.h>
+#include "evolution-service-repository.h"
+
+/* Parent GTK object class */
+static BonoboObjectClass *evolution_service_repository_parent_class;
+
+/**
+ * evolution_service_repository_get_epv:
+ */
+POA_Evolution_ServiceRepository__epv *
+evolution_service_repository_get_epv (void)
+{
+ POA_Evolution_ServiceRepository__epv *epv;
+
+ epv = g_new0 (POA_Evolution_ServiceRepository__epv, 1);
+
+ return epv;
+}
+
+static void
+init_service_repository_corba_class (void)
+{
+}
+
+static void
+evolution_service_repository_destroy (GtkObject *object)
+{
+ GTK_OBJECT_CLASS (evolution_service_repository_parent_class)->destroy (object);
+}
+
+static void
+evolution_service_repository_class_init (EvolutionServiceRepositoryClass *klass)
+{
+ GtkObjectClass *object_class = (GtkObjectClass *) klass;
+
+ evolution_service_repository_parent_class = gtk_type_class (bonobo_object_get_type ());
+
+ /*
+ * Override and initialize methods
+ */
+ object_class->destroy = evolution_service_repository_destroy;
+
+ init_service_repository_corba_class ();
+}
+
+static void
+evolution_service_repository_init (EvolutionServiceRepository *service_repository)
+{
+}
+
+EvolutionServiceRepository *
+evolution_service_repository_construct (EvolutionServiceRepository *service_repository,
+ Evolution_ServiceRepository corba_service_repository)
+{
+ g_return_val_if_fail (service_repository != NULL, NULL);
+ g_return_val_if_fail (EVOLUTION_IS_SERVICE_REPOSITORY (service_repository), NULL);
+ g_return_val_if_fail (corba_service_repository != CORBA_OBJECT_NIL, NULL);
+
+ bonobo_object_construct (BONOBO_OBJECT (service_repository), corba_service_repository);
+
+ return service_repository;
+}
+
+/**
+ * evolution_service_repository_get_type:
+ *
+ * Returns: the GtkType for the EvolutionServiceRepository class.
+ */
+GtkType
+evolution_service_repository_get_type (void)
+{
+ static GtkType type = 0;
+
+ if (!type){
+ GtkTypeInfo info = {
+ "EvolutionServiceRepository",
+ sizeof (EvolutionServiceRepository),
+ sizeof (EvolutionServiceRepositoryClass),
+ (GtkClassInitFunc) evolution_service_repository_class_init,
+ (GtkObjectInitFunc) evolution_service_repository_init,
+ NULL, /* reserved 1 */
+ NULL, /* reserved 2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ type = gtk_type_unique (bonobo_object_get_type (), &info);
+ }
+
+ return type;
+}
+
+
diff --git a/shell/evolution-service-repository.h b/shell/evolution-service-repository.h
new file mode 100644
index 0000000000..677f88152d
--- /dev/null
+++ b/shell/evolution-service-repository.h
@@ -0,0 +1,47 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+#ifndef _EVOLUTION_SERVICE_REPOSITORY_H
+#define _EVOLUTION_SERVICE_REPOSITORY_H 1
+
+#include <bonobo/bonobo-object.h>
+#include "Evolution.h"
+
+BEGIN_GNOME_DECLS
+
+#define EVOLUTION_SERVICE_REPOSITORY_TYPE (evolution_service_repository_get_type ())
+#define EVOLUTION_SERVICE_REPOSITORY(o) (GTK_CHECK_CAST ((o), EVOLUTION_SERVICE_REPOSITORY_TYPE, EvolutionServiceRepository))
+#define EVOLUTION_SERVICE_REPOSITORY_CLASS(k) (GTK_CHECK_CLASS_CAST((k), EVOLUTION_SERVICE_REPOSITORY_TYPE, EvolutionServiceRepositoryClass))
+#define EVOLUTION_IS_SERVICE_REPOSITORY(o) (GTK_CHECK_TYPE ((o), EVOLUTION_SERVICE_REPOSITORY_TYPE))
+#define EVOLUTION_IS_SERVICE_REPOSITORY_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), EVOLUTION_SERVICE_REPOSITORY_TYPE))
+
+typedef struct _EvolutionServiceRepository EvolutionServiceRepositoryPrivate;
+
+
+typedef struct {
+ BonoboObject object;
+
+ EvolutionServiceRepositoryPrivate *priv;
+
+} EvolutionServiceRepository;
+
+
+
+typedef struct {
+ BonoboObjectClass parent_class;
+
+} EvolutionServiceRepositoryClass;
+
+
+
+GtkType evolution_service_repository_get_type (void);
+EvolutionServiceRepository *evolution_service_repository_construct (EvolutionServiceRepository *service_repository,
+ Evolution_ServiceRepository corba_service_repository);
+
+POA_Evolution_ServiceRepository__epv *evolution_service_repository_get_epv (void);
+
+extern POA_Evolution_ServiceRepository__vepv evolution_service_repository_vepv;
+
+END_GNOME_DECLS
+
+
+#endif /* _EVOLUTION_SERVICE_REPOSITORY_H */
+
diff --git a/shell/evolution-service-repository.idl b/shell/evolution-service-repository.idl
new file mode 100644
index 0000000000..809ccbdc21
--- /dev/null
+++ b/shell/evolution-service-repository.idl
@@ -0,0 +1,21 @@
+/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * Component Interface
+ *
+ * Authors:
+ * Bertrand Guiheneuf (bg@aful.org)
+ *
+ * (C) 2000 Helix Code, Inc.
+ */
+#include <Bonobo.idl>
+
+module Evolution {
+ interface ServiceRepository : Bonobo::Unknown {
+
+ void set_shell (in Shell shell);
+
+
+ };
+};
+