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
This commit is contained in:
committed by
Bertrand Guiheneuf
parent
6e515d204a
commit
5adb1dedf6
14
ChangeLog
14
ChangeLog
@ -1,3 +1,17 @@
|
||||
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
|
||||
|
||||
2000-03-12 Christopher James Lahey <clahey@helixcode.com>
|
||||
|
||||
* widgets/Makefile.am: Rearranged SUBDIRS for dependencies.
|
||||
|
||||
@ -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);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
*
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
96
shell/evolution-service-repository.c
Normal file
96
shell/evolution-service-repository.c
Normal file
@ -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;
|
||||
}
|
||||
|
||||
|
||||
47
shell/evolution-service-repository.h
Normal file
47
shell/evolution-service-repository.h
Normal file
@ -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 */
|
||||
|
||||
21
shell/evolution-service-repository.idl
Normal file
21
shell/evolution-service-repository.idl
Normal file
@ -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);
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user