Made Evolution OAF-compatible.

svn path=/trunk/; revision=2673
This commit is contained in:
Ettore Perazzoli
2000-04-28 04:23:19 +00:00
parent 02ed4a60f3
commit 9483369aa0
50 changed files with 1078 additions and 192 deletions

View File

@ -1,3 +1,11 @@
2000-04-27 Ettore Perazzoli <ettore@helixcode.com>
* acconfig.h: New configured #define `USING_OAF'.
* configure.in: Added `--enable-oaf' option and corresponding
`OAF_LIBS' and `OAF_FLAGS' variables. Code friendly provided by
Maciej Stachowiak <mjs@eazel.com>.
2000-04-27 NotZed <NotZed@HelixCode.com>
* tests/test10.c: Fix for removal of camelmimebodypart, and changes

View File

@ -12,8 +12,9 @@
#undef SENDMAIL_PATH
#undef SYSTEM_MAIL_DIR
#undef HAVE_LDAP
#undef HAVE_TIMEZONE
#undef HAVE_TM_GMTOFF
#undef USING_OAF
/* Define this if you want to build against the development gtk */
#undef HAVE_DEVGTK
#undef HAVE_TIMEZONE
#undef HAVE_TM_GMTOFF

View File

@ -1,3 +1,36 @@
2000-04-27 Ettore Perazzoli <ettore@helixcode.com>
* ename/Makefile.am
(gnome_libs): Use `BONOBO_GNOME_LIBS'.
(INCLUDES): Add `-I$(srcdir)/..'.
* backend/pas/pas-book-factory.c
(register_factory): New function to register the factory.
Implementation different according to `USING_OAF'.
(pas_book_factory_activate): Use `register_factory()'.
* gui/component/addressbook.c: New #define `CONTROL_FACTORY_ID',
varying depending on whether we are `USING_OAF'.
(addressbook_factory_init): Use `CONTROL_FACTORY_ID'.
* backend/ebook/test-client.c (init_corba): New function,
implemented differently according to the `USING_OAF' #define.
* backend/ebook/e-book.c: New #define `CARDSERVER_OAF_ID'.
(e_book_construct): Work with OAF #if `USING_OAF'.
* backend/ebook/Makefile.am (gnome_libs): Removed.
(corbadir): Removed.
(ebook_libs): Removed.
(test_client_LDADD): Just add `libebook.la'.
(test_card_LDADD): Likewise.
(test_client_list_LDADD): Likewise.
* gui/component/addressbook-factory.c
(init_corba): New helper function, implemented differently
according to `USING_OAF'.
(main): Call `init_corba()'.
2000-04-27 Christopher James Lahey <clahey@helixcode.com>
* backend/ebook/e-card.c, backend/ebook/e-card.h: Added file as,

View File

@ -1,7 +1,5 @@
noinst_PROGRAMS = test-card test-client test-client-list
corbadir = $(sysconfdir)/CORBA/servers
CORBA_SOURCE = \
addressbook.h \
addressbook-common.c \
@ -24,16 +22,6 @@ INCLUDES = \
-I$(top_builddir)/addressbook/backend \
$(BONOBO_GNOME_CFLAGS)
gnome_libs = \
$(GNOME_LIBDIR) \
$(GNOMEUI_LIBS) \
$(GNOMEGNORBA_LIBS) \
$(INTLLIBS)
ebook_libs = \
libebook.la \
$(gnome_libs)
lib_LTLIBRARIES = libebook.la
libebook_la_SOURCES = \
@ -65,24 +53,24 @@ test_client_SOURCES = \
test-client.c
test_client_LDADD = \
libebook.la \
$(BONOBO_GNOME_LIBS) \
$(ebook_libs) \
$(top_builddir)/libversit/libversit.la
test_client_list_SOURCES = \
test-client-list.c
test_client_list_LDADD = \
libebook.la \
$(BONOBO_GNOME_LIBS) \
$(ebook_libs) \
$(top_builddir)/libversit/libversit.la
test_card_SOURCES = \
test-card.c
test_card_LDADD = \
libebook.la \
$(BONOBO_GNOME_LIBS) \
$(ebook_libs) \
$(top_builddir)/libversit/libversit.la
BUILT_SOURCES = $(CORBA_SOURCE)

View File

@ -9,9 +9,9 @@
*/
#include <config.h>
#include <libgnorba/gnorba.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkmarshal.h>
#include "addressbook.h"
#include "e-card-cursor.h"
#include "e-book-view-listener.h"

View File

@ -9,9 +9,9 @@
*/
#include <config.h>
#include <libgnorba/gnorba.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkmarshal.h>
#include "addressbook.h"
#include "e-card-cursor.h"
#include "e-book-listener.h"
@ -19,7 +19,13 @@
GtkObjectClass *e_book_parent_class;
#ifdef USING_OAF
#include <liboaf/liboaf.h>
#define CARDSERVER_OAF_ID "OAFIID:evolution:addressbook-server:0fbc844d-c721-4615-98d0-d67eacf42d80"
#else
#include <libgnorba/gnorba.h>
#define CARDSERVER_GOAD_ID "evolution:addressbook-server"
#endif
typedef enum {
URINotLoaded,
@ -426,8 +432,14 @@ e_book_construct (EBook *book)
/*
* Connect to the Personal Addressbook Server.
*/
#ifdef USING_OAF
book->priv->book_factory = (Evolution_BookFactory)
oaf_activate_from_id (CARDSERVER_OAF_ID, 0, NULL, NULL);
#else
book->priv->book_factory = (Evolution_BookFactory)
goad_server_activate_with_id (NULL, CARDSERVER_GOAD_ID, 0, NULL);
#endif
if (book->priv->book_factory == CORBA_OBJECT_NIL) {
g_warning ("e_book_construct: Could not obtain a handle "

View File

@ -2,26 +2,31 @@
#include <config.h>
#include <bonobo.h>
#include <gnome.h>
#ifdef USING_OAF
#include <liboaf/liboaf.h>
#else
#include <libgnorba/gnorba.h>
#endif
#include "e-book.h"
CORBA_Environment ev;
CORBA_ORB orb;
static void
init_bonobo (int argc, char **argv)
{
#ifdef USING_OAF
gnome_init ("blah", "0.0", argc, argv);
oaf_init (argc, argv);
#else
gnome_CORBA_init_with_popt_table (
"blah", "0.0",
&argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev);
#endif
orb = gnome_CORBA_ORB ();
if (bonobo_init (orb, NULL, NULL) == FALSE)
if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE)
g_error (_("Could not initialize Bonobo"));
}
static void

View File

@ -2,7 +2,6 @@
#include <config.h>
#include <bonobo.h>
#include <gnome.h>
#include <libgnorba/gnorba.h>
#include <e-book.h>
@ -31,22 +30,39 @@
"
static CORBA_Environment ev;
static CORBA_ORB orb;
static char *cardstr;
#ifdef USING_OAF
#include <liboaf/liboaf.h>
static void
init_corba (int *argc, char **argv)
{
gnome_init_with_popt_table("blah", "0.0", *argc, argv, NULL, 0, NULL);
oaf_init (*argc, argv);
}
#else
#include <libgnorba/gnorba.h>
static void
init_corba (int *argc, char **argv)
{
gnome_CORBA_init_with_popt_table (
"blah", "0.0",
argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev);
}
#endif
static void
init_bonobo (int argc, char **argv)
{
gnome_CORBA_init_with_popt_table (
"blah", "0.0",
&argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev);
orb = gnome_CORBA_ORB ();
if (bonobo_init (orb, NULL, NULL) == FALSE)
if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE)
g_error (_("Could not initialize Bonobo"));
}
static void
@ -155,6 +171,8 @@ main (int argc, char **argv)
{
CORBA_exception_init (&ev);
init_corba (&argc, argv);
init_bonobo (argc, argv);
cardstr = NULL;

View File

@ -8,11 +8,17 @@
#include <config.h>
#include <ctype.h>
#include <libgnorba/gnorba.h>
#include "addressbook.h"
#include "pas-book-factory.h"
#ifdef USING_OAF
#include <liboaf/liboaf.h>
#define PAS_BOOK_FACTORY_OAF_ID "OAFIID:evolution:addressbook-server:0fbc844d-c721-4615-98d0-d67eacf42d80"
#else
#include <libgnorba/gnorba.h>
#define PAS_BOOK_FACTORY_GOAD_ID "evolution:addressbook-server"
#endif
static BonoboObjectClass *pas_book_factory_parent_class;
POA_Evolution_BookFactory__vepv pas_book_factory_vepv;
@ -301,25 +307,43 @@ pas_book_factory_new (void)
return factory;
}
/**
* pas_book_factory_activate:
*/
void
pas_book_factory_activate (PASBookFactory *factory)
#ifdef USING_OAF
static gboolean
register_factory (CORBA_Object obj)
{
OAF_RegistrationResult result;
puts ("about to register addressbook");
result = oaf_active_server_register (PAS_BOOK_FACTORY_OAF_ID, obj);
switch (result) {
case OAF_REG_SUCCESS:
return TRUE;
case OAF_REG_NOT_LISTED:
g_message ("Error registering the PAS factory: not listed");
return FALSE;
case OAF_REG_ALREADY_ACTIVE:
g_message ("Error registering the PAS factory: already active");
return FALSE;
case OAF_REG_ERROR:
default:
g_message ("Error registering the PAS factory: generic error");
return FALSE;
}
}
#else
static gboolean
register_factory (CORBA_Object obj)
{
CORBA_Environment ev;
int ret;
g_return_if_fail (factory != NULL);
g_return_if_fail (PAS_IS_BOOK_FACTORY (factory));
CORBA_exception_init (&ev);
int ret;
ret = goad_server_register (
NULL,
bonobo_object_corba_objref (BONOBO_OBJECT (factory)),
PAS_BOOK_FACTORY_GOAD_ID, "server",
&ev);
ret = goad_server_register (NULL, obj, PAS_BOOK_FACTORY_GOAD_ID, "server", &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
g_message ("pas_book_factory_activate: Exception "
@ -330,22 +354,34 @@ pas_book_factory_activate (PASBookFactory *factory)
CORBA_exception_free (&ev);
if (ret == -1) {
g_message ("pas_book_factory_activate: Error "
"registering PASBookFactory!\n");
return;
}
if (ret == -2) {
switch (ret) {
case 0:
return TRUE;
case -2:
g_message ("pas_book_factory_activate: Another "
"PASBookFactory is already running.\n");
return;
return FALSE;
case -1:
default:
g_message ("pas_book_factory_activate: Error "
"registering PASBookFactory!\n");
return FALSE;
}
return;
}
#endif
/**
* pas_book_factory_activate:
*/
void
pas_book_factory_activate (PASBookFactory *factory)
{
g_return_if_fail (factory != NULL);
g_return_if_fail (PAS_IS_BOOK_FACTORY (factory));
register_factory (bonobo_object_corba_objref (BONOBO_OBJECT (factory)));
}
static void
pas_book_factory_init (PASBookFactory *factory)

View File

@ -1,7 +1,9 @@
INCLUDES = \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DG_LOG_DOMAIN=\"EName\" \
-I$(srcdir) -I$(top_srcdir) \
-I$(srcdir) \
-I$(srcdir)/.. \
-I$(top_srcdir) \
-I. \
-I.. \
-I$(top_builddir) \
@ -9,9 +11,7 @@ INCLUDES = \
$(GNOME_INCLUDEDIR)
gnome_libs = \
$(GNOME_LIBDIR) \
$(GNOMEUI_LIBS) \
$(GNOMEGNORBA_LIBS) \
$(BONOBO_GNOME_LIBS) \
$(INTLLIBS)
ename_libs = \

View File

@ -0,0 +1,30 @@
<oaf_info>
<oaf_server iid="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17"
type="exe"
location="evolution-addressbook">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/GenericFactory:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="Factory for the sample Addressbook control"/>
</oaf_server>
<oaf_server iid="OAFIID:control:addressbook:851f883b-2fe7-4c94-a1e3-a1f2a7a03c49"
type="factory"
location="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:BonoboControl/addressbook-control:1.0"/>
<item value="IDL:GNOME/Control:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="A sample Bonobo control which displays an addressbook."/>
</oaf_server>
</oaf_info>

View File

@ -0,0 +1,30 @@
<oaf_info>
<oaf_server iid="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17"
type="exe"
location="evolution-addressbook">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/GenericFactory:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="Factory for the sample Addressbook control"/>
</oaf_server>
<oaf_server iid="OAFIID:control:addressbook:851f883b-2fe7-4c94-a1e3-a1f2a7a03c49"
type="factory"
location="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:BonoboControl/addressbook-control:1.0"/>
<item value="IDL:GNOME/Control:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="A sample Bonobo control which displays an addressbook."/>
</oaf_server>
</oaf_info>

View File

@ -35,5 +35,14 @@ evolution_addressbook_LDADD = \
evolution_addressbook_LDFLAGS = `gnome-config --libs gdk_pixbuf`
if USING_OAF
oafdir = $(datadir)/oaf
oaf_DATA = addressbook.oafinfo
else
gnorbadir = $(sysconfdir)/CORBA/servers
gnorba_DATA = addressbook.gnorba
endif
EXTRA_DIST = \
addressbook.gnorba \
addressbook.oafinfo

View File

@ -10,25 +10,48 @@
#include <config.h>
#include <gnome.h>
#include <libgnorba/gnorba.h>
#include <bonobo.h>
#include <glade/glade.h>
#include "addressbook.h"
CORBA_Environment ev;
CORBA_ORB orb;
#ifdef USING_OAF
#include <liboaf/liboaf.h>
static void
init_corba (int *argc, char **argv)
{
gnome_init_with_popt_table ("evolution-addressbook", "0.0",
*argc, argv, oaf_popt_options, 0, NULL);
oaf_init (*argc, argv);
}
#else
#include <libgnorba/gnorba.h>
static void
init_corba (int *argc, char **argv)
{
CORBA_Environment ev;
CORBA_exception_init (&ev);
gnome_CORBA_init_with_popt_table (
"evolution-addressbook", "0.0",
argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev);
CORBA_exception_free (&ev);
}
#endif
static void
init_bonobo (int argc, char **argv)
{
gnome_CORBA_init_with_popt_table (
"evolution-addressbook", "0.0",
&argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev);
orb = gnome_CORBA_ORB ();
if (bonobo_init (orb, NULL, NULL) == FALSE)
if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE)
g_error (_("Could not initialize Bonobo"));
glade_gnome_init ();
@ -37,7 +60,7 @@ init_bonobo (int argc, char **argv)
int
main (int argc, char **argv)
{
CORBA_exception_init (&ev);
init_corba (&argc, argv);
init_bonobo (argc, argv);

View File

@ -9,6 +9,7 @@
*/
#include <config.h>
#include <gnome.h>
#include <libgnorba/gnorba.h>
#include <bonobo.h>
@ -20,6 +21,12 @@
#include "e-minicard-view.h"
#include "e-contact-editor.h"
#ifdef USING_OAF
#define CONTROL_FACTORY_ID "OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17"
#else
#define CONTROL_FACTORY_ID "control-factory:addressbook"
#endif
static void
control_deactivate (BonoboControl *control, BonoboUIHandler *uih)
{
@ -451,10 +458,9 @@ addressbook_factory_init (void)
if (addressbook_control_factory != NULL)
return;
addressbook_control_factory =
bonobo_generic_factory_new (
"control-factory:addressbook",
addressbook_factory, NULL);
addressbook_control_factory = bonobo_generic_factory_new (CONTROL_FACTORY_ID,
addressbook_factory,
NULL);
if (addressbook_control_factory == NULL) {
g_error ("I could not register a Addressbook factory.");

View File

@ -0,0 +1,30 @@
<oaf_info>
<oaf_server iid="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17"
type="exe"
location="evolution-addressbook">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/GenericFactory:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="Factory for the sample Addressbook control"/>
</oaf_server>
<oaf_server iid="OAFIID:control:addressbook:851f883b-2fe7-4c94-a1e3-a1f2a7a03c49"
type="factory"
location="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:BonoboControl/addressbook-control:1.0"/>
<item value="IDL:GNOME/Control:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="A sample Bonobo control which displays an addressbook."/>
</oaf_server>
</oaf_info>

View File

@ -1,3 +1,27 @@
2000-04-27 Ettore Perazzoli <ettore@helixcode.com>
* gui/evolution-calendar-control.c
(init_bonobo): OAFized.
* gui/main.c (main): Initialize with OAF if `USING_OAF'.
* gui/evolution-calendar-control.c: New #define
`CONTROL_FACTORY_ID', varying according to whether we are
`USING_OAF'.
(calendar_factory_init): Use `CONTROL_FACTORY_ID'.
* gui/Makefile.am: Updated for OAF.
* pcs/cal-factory.h: Explicitly #include
"calendar/pcs/evolution-calendar.h" instead of just
"evolution-calendar.h".
* cal-client/cal-client.c (cal_client_construct) [USING_OAF]: Use
OAF.
* cal-client/client-test.c (init_corba): New function, implemented
differently depending on `USING_OAF'.
2000-04-27 <alves@hungry.com>
* pcs/cal-backend.c (cal_backend_load): fix memory leak

View File

@ -22,7 +22,13 @@
#include <config.h>
#include <gtk/gtksignal.h>
#ifdef USING_OAF
#include <liboaf/liboaf.h>
#else
#include <libgnorba/gnorba.h>
#endif
#include "cal-client.h"
#include "cal-listener.h"
@ -375,18 +381,24 @@ cal_client_construct (CalClient *client)
CORBA_Environment ev;
int result;
CORBA_exception_init (&ev);
g_return_val_if_fail (client != NULL, NULL);
g_return_val_if_fail (IS_CAL_CLIENT (client), NULL);
priv = client->priv;
#ifdef USING_OAF
factory = (Evolution_Calendar_CalFactory) oaf_activate_from_id (
"OAFIID:evolution:calendar-factory:1c915858-ece3-4a6f-9d81-ea0f108a9554",
OAF_FLAG_NO_LOCAL, NULL, &ev);
#else
factory = (Evolution_Calendar_CalFactory) goad_server_activate_with_id (
NULL,
"evolution:calendar-factory",
GOAD_ACTIVATE_REMOTE,
NULL);
#endif
CORBA_exception_init (&ev);
result = CORBA_Object_is_nil (factory, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
g_message ("cal_client_construct(): could not see if the factory is NIL");

View File

@ -1,8 +1,7 @@
#include <config.h>
#include <libgnorba/gnorba.h>
#include <bonobo.h>
#include <gnome.h>
#include <cal-client/cal-client.h>
static CalClient *client1;
static CalClient *client2;
@ -145,14 +144,26 @@ client_destroy_cb (GtkObject *object, gpointer data)
gtk_main_quit ();
}
int
main (int argc, char **argv)
#ifdef USING_OAF
#include <liboaf/liboaf.h>
static void
init_corba (int *argc, char **argv)
{
gnome_init ("tl-test", VERSION, *argc, argv);
oaf_init (*argc, argv);
}
#else
#include <libgnorba/gnorba.h>
static void
init_corba (int *argc, char **argv)
{
CORBA_Environment ev;
bindtextdomain (PACKAGE, GNOMELOCALEDIR);
textdomain (PACKAGE);
CORBA_exception_init (&ev);
gnome_CORBA_init ("tl-test", VERSION, &argc, argv, 0, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
@ -161,6 +172,17 @@ main (int argc, char **argv)
exit (1);
}
CORBA_exception_free (&ev);
}
#endif
int
main (int argc, char **argv)
{
bindtextdomain (PACKAGE, GNOMELOCALEDIR);
textdomain (PACKAGE);
init_corba (&argc, argv);
if (!bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL)) {
g_message ("main(): could not initialize Bonobo");

View File

@ -0,0 +1,28 @@
<oaf_info>
<oaf_server iid="OAFIID:control-factory:calendar:f4f90989-0f50-4af2-ad94-8bbdf331f0bc"
type="exe"
location="evolution-calendar">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/GenericFactory:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="Factory for the sample Calendar control"/>
</oaf_server>
<oaf_server iid="OAFIID:control:calendar:dd34ddae-25c6-486b-a8a8-3e8f0286b54c"
type="factory"
location="OAFIID:control-factory:calendar:f4f90989-0f50-4af2-ad94-8bbdf331f0bc">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:BonoboControl/calendar-control:1.0"/>
<item value="IDL:Bonobo/Control:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="A sample Bonobo control which displays an calendar."/>
</oaf_server>
</oaf_info>

View File

@ -0,0 +1,28 @@
<oaf_info>
<oaf_server iid="OAFIID:control-factory:calendar:f4f90989-0f50-4af2-ad94-8bbdf331f0bc"
type="exe"
location="evolution-calendar">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/GenericFactory:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="Factory for the sample Calendar control"/>
</oaf_server>
<oaf_server iid="OAFIID:control:calendar:dd34ddae-25c6-486b-a8a8-3e8f0286b54c"
type="factory"
location="OAFIID:control-factory:calendar:f4f90989-0f50-4af2-ad94-8bbdf331f0bc">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:BonoboControl/calendar-control:1.0"/>
<item value="IDL:Bonobo/Control:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="A sample Bonobo control which displays an calendar."/>
</oaf_server>
</oaf_info>

View File

@ -81,8 +81,17 @@ evolution_calendar_LDADD = \
evolution_calendar_LDFLAGS = `gnome-config --libs gdk_pixbuf`
if USING_OAF
oafdir = $(datadir)/oaf
oaf_DATA = calendar-control.oafinfo
else
gnorbadir = $(sysconfdir)/CORBA/servers
gnorba_DATA = calendar-control.gnorba
endif
EXTRA_DIST = \
calendar-control.gnorba \
calendar-control.oafinfo
#calendar_pilot_sync_SOURCES = \
# GnomeCal-common.c \

View File

@ -0,0 +1,28 @@
<oaf_info>
<oaf_server iid="OAFIID:control-factory:calendar:f4f90989-0f50-4af2-ad94-8bbdf331f0bc"
type="exe"
location="evolution-calendar">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/GenericFactory:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="Factory for the sample Calendar control"/>
</oaf_server>
<oaf_server iid="OAFIID:control:calendar:dd34ddae-25c6-486b-a8a8-3e8f0286b54c"
type="factory"
location="OAFIID:control-factory:calendar:f4f90989-0f50-4af2-ad94-8bbdf331f0bc">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:BonoboControl/calendar-control:1.0"/>
<item value="IDL:Bonobo/Control:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="A sample Bonobo control which displays an calendar."/>
</oaf_server>
</oaf_info>

View File

@ -2,10 +2,14 @@
#include <config.h>
#include <gnome.h>
#include <libgnorba/gnorba.h>
#include <bonobo.h>
#include <bonobo/bonobo-control.h>
#ifdef USING_OAF
#include <liboaf/liboaf.h>
#else
#include <libgnorba/gnorba.h>
#endif
#include <cal-util/timeutil.h>
#include <gui/alarm.h>
@ -17,6 +21,11 @@
#define PROPERTY_CALENDAR_URI_IDX 1
#ifdef USING_OAF
#define CONTROL_FACTORY_ID "OAFIID:control-factory:calendar:f4f90989-0f50-4af2-ad94-8bbdf331f0bc"
#else
#define CONTROL_FACTORY_ID "control-factory:calendar"
#endif
CORBA_Environment ev;
CORBA_ORB orb;
@ -36,15 +45,21 @@ control_activate_cb (BonoboControl *control,
static void
init_bonobo (int argc, char **argv)
init_bonobo (int *argc, char **argv)
{
#ifdef USING_OAF
/* FIXME: VERSION instead of "0.0". */
gnome_init_with_popt_table ("evolution-calendar", "0.0",
*argc, argv, oaf_popt_options,
0, NULL);
oaf_init (*argc, argv);
#else
gnome_CORBA_init_with_popt_table (
"evolution-calendar", "0.0",
&argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev);
argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev);
#endif
orb = gnome_CORBA_ORB ();
if (bonobo_init (orb, NULL, NULL) == FALSE)
if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE)
g_error (_("Could not initialize Bonobo"));
}
@ -144,8 +159,10 @@ calendar_factory_init (void)
if (calendar_control_factory != NULL)
return;
puts ("XXXXXX - initializing calendar factory!!!");
calendar_control_factory =
bonobo_generic_factory_new ("control-factory:calendar",
bonobo_generic_factory_new (CONTROL_FACTORY_ID,
calendar_factory, NULL);
if (calendar_control_factory == NULL) {
@ -164,7 +181,7 @@ main (int argc, char **argv)
CORBA_exception_init (&ev);
init_bonobo (argc, argv);
init_bonobo (&argc, argv);
calendar_factory_init ();

View File

@ -0,0 +1,27 @@
<oaf_info>
<oaf_server iid="OAFIID:IDL:GNOME:Calendar:Repository:1.0:56989bb6-65a1-430c-86a8-81bbe64bf7ab"
type="factory"
location="OAFIID:IDL:GNOME:Calendar:RepositoryLocator:1.0:83b25bb0-b68b-4c6b-86e7-c303e9897c21">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Gnome/Calendar/Repository:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="Calendar Repository"/>
</oaf_server>
<oaf_server iid="OAFIID:IDL:GNOME:Calendar:RepositoryLocator:1.0:83b25bb0-b68b-4c6b-86e7-c303e9897c21"
type="exe"
location="gnomecal">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/GenericFactory:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="Calendar Server"/>
</oaf_server>
</oaf_info>

View File

@ -9,6 +9,7 @@
*/
#include <config.h>
#include <pwd.h>
#include <unistd.h>
#include <sys/types.h>
@ -325,22 +326,31 @@ int
main (int argc, char **argv)
{
GnomeClient *client;
CORBA_Environment ev;
GtkWidget *cal_window;
GnomeCalendar *cal_frame;
bindtextdomain (PACKAGE, GNOMELOCALEDIR);
textdomain (PACKAGE);
CORBA_exception_init (&ev);
gnome_CORBA_init_with_popt_table ("calendar", VERSION, &argc, argv,
options, 0, NULL, 0, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
g_message ("main(): could not initialize the ORB");
#ifdef USING_OAF
gnome_init_with_popt_table ("calendar", VERSION, argc, argv, oaf_popt_options,
0, NULL);
oaf_init (argc, argv);
#else
{
CORBA_Environment ev;
CORBA_exception_init (&ev);
gnome_CORBA_init_with_popt_table ("calendar", VERSION, &argc, argv,
options, 0, NULL, 0, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
g_message ("main(): could not initialize the ORB");
CORBA_exception_free (&ev);
exit (EXIT_FAILURE);
}
CORBA_exception_free (&ev);
exit (EXIT_FAILURE);
}
CORBA_exception_free (&ev);
#endif
if (!bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL)) {
g_message ("main(): could not initialize Bonobo");

View File

@ -24,7 +24,8 @@
#include <libgnome/gnome-defs.h>
#include <bonobo/bonobo-object.h>
#include "evolution-calendar.h"
#include "calendar/pcs/evolution-calendar.h"
BEGIN_GNOME_DECLS

View File

@ -1,3 +1,11 @@
2000-04-27 Ettore Perazzoli <ettore@helixcode.com>
* providers/pop3/Makefile.am (INCLUDES): Add `-I$(srcdir)/../../..'
to pick the Camel includes.
* providers/sendmail/Makefile.am (INCLUDES): Likewise.
* camel.h: Don't #include <camel/data-wrapper-repository.h> anymore.
2000-04-27 NotZed <NotZed@HelixCode.com>
* camel-mime-utils.c (check_header): Dont try and check a NULL

View File

@ -8,9 +8,14 @@ providerdir = $(pkglibdir)/camel-providers/$(VERSION)
provider_LTLIBRARIES = libcamelpop3.la
INCLUDES = -I.. -I$(srcdir)/.. -I$(includedir) \
INCLUDES = \
-I.. \
-I$(srcdir)/.. \
-I$(srcdir)/../../.. \
-I$(includedir) \
-I$(top_srcdir)/intl \
$(GTK_INCLUDEDIR) -I$(top_srcdir)/camel \
$(GTK_INCLUDEDIR) \
-I$(top_srcdir)/camel \
-I$(srcdir)/../mbox
libcamelpop3_la_SOURCES = \

View File

@ -9,7 +9,11 @@ providerdir = $(pkglibdir)/camel-providers/$(VERSION)
provider_LTLIBRARIES = libcamelsendmail.la
INCLUDES = -I.. -I$(srcdir)/.. -I$(includedir) \
INCLUDES = \
-I.. \
-I$(srcdir)/.. \
-I$(srcdir)/../../.. \
-I$(includedir) \
-I$(top_srcdir)/intl \
$(GTK_INCLUDEDIR) -I$(top_srcdir)/camel

View File

@ -8,9 +8,14 @@ providerdir = $(pkglibdir)/camel-providers/$(VERSION)
provider_LTLIBRARIES = libcamelsmtp.la
INCLUDES = -I.. -I$(srcdir)/.. -I$(includedir) \
INCLUDES = \
-I.. \
-I$(srcdir)/.. \
-I$(srcdir)/../../.. \
-I$(includedir) \
-I$(top_srcdir)/intl \
$(GTK_INCLUDEDIR) -I$(top_srcdir)/camel
$(GTK_INCLUDEDIR) \
-I$(top_srcdir)/camel
libcamelsmtp_la_SOURCES = \
camel-smtp-provider.c \

View File

@ -166,6 +166,7 @@ dnl ******************************
AC_MSG_CHECKING(for Bonobo > 0.5)
if gnome-config --libs bonobo > /dev/null 2>&1; then
vers=`gnome-config --modversion bonobo`
echo $vers
case $vers
in
bonobo-0.[[012345]]) bonobo_ok=false ;;
@ -299,7 +300,7 @@ AC_SUBST(BONOBO_VFS_GNOME_CFLAGS)
dnl ******************************
dnl Pilot checking
dnl ******************************
GNOME_PILOT_CHECK
dnl GNOME_PILOT_CHECK
dnl ******
@ -321,7 +322,44 @@ AC_DEFINE_UNQUOTED(CAMEL_HARD_LOG_LEVEL, $camel_hard_log_level)
AC_CONFIG_SUBDIRS(libical)
AC_SUBST(CAPPLET_LIBS)
dnl ******************************
dnl Whether to use OAF
dnl ******************************
AC_ARG_ENABLE(oaf,
[ --enable-oaf=[no/yes] Use OAF instead of GOAD.],,enable_oaf=no)
if test "x$enable_oaf" = "xyes"; then
AC_PATH_PROG(OAF_CONFIG,oaf-config,no)
if test x$OAF_CONFIG = xno; then
AC_MSG_ERROR("You enabled OAF support but oaf-config was not found")
else
OAF_LIBS=`$OAF_CONFIG --libs`
OAF_CFLAGS=`$OAF_CONFIG --cflags`
GNORBA_LIBNAME=
fi
else
OAF_LIBS=
OAF_CFLAGS=
GNORBA_LIBNAME=gnorba
fi
AC_SUBST(OAF_LIBS)
AC_SUBST(OAF_CFLAGS)
AM_CONDITIONAL(USING_OAF, test "x$enable_oaf" = "xyes")
if test "x$enable_oaf" = "xyes"; then
AC_DEFINE(USING_OAF)
BONOBO_GNOME_LIBS="`oaf-config --libs` $BONOBO_GNOME_LIBS"
BONOBO_GNOME_CFLAGS="`oaf-config --cflags ` $BONOBO_GNOME_CFLAGS"
fi
dnl ******************************
dnl Makefiles
dnl ******************************
AC_OUTPUT([
Makefile
macros/Makefile

View File

@ -1,7 +1,9 @@
INCLUDES = \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DG_LOG_DOMAIN=\"EName\" \
-I$(srcdir) -I$(top_srcdir) \
-I$(srcdir) \
-I$(srcdir)/.. \
-I$(top_srcdir) \
-I. \
-I.. \
-I$(top_builddir) \
@ -9,9 +11,7 @@ INCLUDES = \
$(GNOME_INCLUDEDIR)
gnome_libs = \
$(GNOME_LIBDIR) \
$(GNOMEUI_LIBS) \
$(GNOMEGNORBA_LIBS) \
$(BONOBO_GNOME_LIBS) \
$(INTLLIBS)
ename_libs = \

View File

@ -1,3 +1,27 @@
2000-04-27 Ettore Perazzoli <ettore@helixcode.com>
* folder-browser-factory.c: New macro `CONTROL_FACTORY_ID', which
is #defined to a different value according to whether we are
`USING_OAF' or not.
(folder_browser_factory_init): Use `CONTROL_FACTORY_ID'.
* test-mail.c
(init_corba): New helper function, implemented differently
according to `USING_OAF'.
(main): Use `init_corba()'.
* main.c
(init_corba): New helper function, implemented differently
according to `USING_OAF'.
(init_bonobo): Use `init_corba()'.
* Makefile.am: Install OAF stuff if `USING_OAF'. Add
`-I$(datadir)/idl' to the `orbit-idl' command-line so that we can
use Bonobo IDL files installed under our prefix as well. Also,
use `$(ORBIT_IDL)' instead of hardcoded `orbit-idl'.
* evolution-mail.oafinfo: New file.
2000-04-27 Dan Winship <danw@helixcode.com>
* mail-format.c: Move text_to_html to e-util.

View File

@ -0,0 +1,28 @@
<oaf_info>
<oaf_server iid="OAFIID:control-factory:evolution-mail:25902062-543b-4f44-8702-d90145fcdbf2"
type="exe"
location="evolution-mail">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/GenericFactory:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="Evolution mail folder factory component."/>
</oaf_server>
<oaf_server iid="OAFIID:control:evolution-mail:833d5a71-a201-4a0e-b7e6-5475c5c4cb45"
type="factory"
location="OAFIID:control-factory:evolution-mail:25902062-543b-4f44-8702-d90145fcdbf2">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:BonoboControl/evolution-mail:1.0"/>
<item value="IDL:GNOME/Control:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="Evolution mail folder display component."/>
</oaf_server>
</oaf_info>

View File

@ -0,0 +1,28 @@
<oaf_info>
<oaf_server iid="OAFIID:control-factory:evolution-mail:25902062-543b-4f44-8702-d90145fcdbf2"
type="exe"
location="evolution-mail">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/GenericFactory:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="Evolution mail folder factory component."/>
</oaf_server>
<oaf_server iid="OAFIID:control:evolution-mail:833d5a71-a201-4a0e-b7e6-5475c5c4cb45"
type="factory"
location="OAFIID:control-factory:evolution-mail:25902062-543b-4f44-8702-d90145fcdbf2">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:BonoboControl/evolution-mail:1.0"/>
<item value="IDL:GNOME/Control:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="Evolution mail folder display component."/>
</oaf_server>
</oaf_info>

View File

@ -63,13 +63,21 @@ test_mail_LDADD = \
$(BONOBO_HTML_GNOME_LIBS)
GOAD_FILES = evolution-mail.gnorba
OAF_FILES = evolution-mail.oafinfo
if USING_OAF
oafdir = $(datadir)/oaf
oaf_DATA = $(OAF_FILES)
else
gnorbadir = $(sysconfdir)/CORBA/servers
gnorba_DATA = evolution-mail.gnorba
gnorba_DATA = $(GOAD_FILES)
endif
$(EVOLUTION_MAIL_CORBA_GENERATED): Mail.idl
orbit-idl -I`$(GNOME_CONFIG) --datadir`/idl -I$(srcdir) $(srcdir)/Mail.idl
$(ORBIT_IDL) -I$(datadir)/idl -I`$(GNOME_CONFIG) --datadir`/idl -I$(srcdir) $(srcdir)/Mail.idl
EXTRA_DIST = Mail.idl evolution-mail.gnorba
EXTRA_DIST = Mail.idl $(GOAD_FILES) $(OAF_FILES)
dist-hook:
-mkdir $(distdir)/pixmaps

View File

@ -0,0 +1,28 @@
<oaf_info>
<oaf_server iid="OAFIID:control-factory:evolution-mail:25902062-543b-4f44-8702-d90145fcdbf2"
type="exe"
location="evolution-mail">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/GenericFactory:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="Evolution mail folder factory component."/>
</oaf_server>
<oaf_server iid="OAFIID:control:evolution-mail:833d5a71-a201-4a0e-b7e6-5475c5c4cb45"
type="factory"
location="OAFIID:control-factory:evolution-mail:25902062-543b-4f44-8702-d90145fcdbf2">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:BonoboControl/evolution-mail:1.0"/>
<item value="IDL:GNOME/Control:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="Evolution mail folder display component."/>
</oaf_server>
</oaf_info>

View File

@ -23,6 +23,11 @@
#include <camel/camel-stream-fs.h>
#include "mail-ops.h"
#ifdef USING_OAF
#define CONTROL_FACTORY_ID "OAFIID:control-factory:evolution-mail:25902062-543b-4f44-8702-d90145fcdbf2"
#else
#define CONTROL_FACTORY_ID "control-factory:evolution-mail"
#endif
static void
folder_browser_set_shell (EvolutionServiceRepository *sr,
@ -252,14 +257,12 @@ folder_browser_factory_init (void)
{
static BonoboGenericFactory *bonobo_folder_browser_factory = NULL;
if (bonobo_folder_browser_factory != NULL)
return;
bonobo_folder_browser_factory =
bonobo_generic_factory_new (
"control-factory:evolution-mail",
folder_browser_factory, NULL);
bonobo_folder_browser_factory = bonobo_generic_factory_new (CONTROL_FACTORY_ID,
folder_browser_factory,
NULL);
if (bonobo_folder_browser_factory == NULL){
e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,

View File

@ -8,7 +8,6 @@
*/
#include <config.h>
#include <gnome.h>
#include <libgnorba/gnorba.h>
#include <bonobo/bonobo-main.h>
#include <glade/glade.h>
#include "e-util/e-gui-utils.h"
@ -16,28 +15,48 @@
#include "main.h"
#include "session.h"
CORBA_ORB orb;
#ifdef USING_OAF
#include <liboaf/liboaf.h>
static void
init_bonobo (int argc, char **argv)
init_corba (int argc, char *argv [])
{
gnome_init_with_popt_table ("evolution-mail-component", VERSION, argc, argv,
oaf_popt_options, 0, NULL);
oaf_init (argc, argv);
}
#else /* USING_OAF */
#include <libgnorba/gnorba.h>
static void
init_corba (int *argc, char *argv [])
{
CORBA_Environment ev;
CORBA_exception_init (&ev);
gnome_CORBA_init_with_popt_table (
gnome_CORBA_init_with_popt_table (
"evolution-mail-component", "1.0",
&argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev);
orb = gnome_CORBA_ORB ();
CORBA_exception_free (&ev);
}
if (bonobo_init (orb, NULL, NULL) == FALSE){
#endif /* USING_OAF */
static void
init_bonobo (int argc, char **argv)
{
init_corba (argc, argv);
if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE){
e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("Mail Component: I could not initialize Bonobo"));
exit (1);
}
CORBA_exception_free (&ev);
}
int

View File

@ -6,10 +6,41 @@
*
* (C) 2000 Helix Code, Inc.
*/
#include <config.h>
#include <gnome.h>
#include <bonobo.h>
#ifdef USING_OAF
#include <liboaf/liboaf.h>
static void
init_corba (int *argc, char *argv[])
{
gnome_init ("sample-control-container", "1.0", *argc, argv);
oaf_init (*argc, argv);
}
#else /* USING_OAF */
#include <libgnorba/gnorba.h>
static void
init_corba (int *argc, char *argv [])
{
CORBA_Environment ev;
CORBA_exception_init (&ev);
gnome_CORBA_init ("sample-control-container", "1.0", argc, argv, 0, &ev);
CORBA_exception_free (&ev);
}
#endif /* USING_OAF */
static guint
create_container (void)
{
@ -46,21 +77,10 @@ create_container (void)
int
main (int argc, char *argv [])
{
CORBA_Environment ev;
CORBA_ORB orb;
init_corba (&argc, argv);
CORBA_exception_init (&ev);
gnome_CORBA_init ("sample-control-container", "1.0", &argc, argv, 0, &ev);
CORBA_exception_free (&ev);
orb = gnome_CORBA_ORB ();
if (bonobo_init (orb, NULL, NULL) == FALSE)
if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE)
g_error ("Could not initialize Bonobo\n");
gtk_idle_add ((GtkFunction) create_container, NULL);

View File

@ -1,3 +1,16 @@
2000-04-27 Ettore Perazzoli <ettore@helixcode.com>
* e-shell-view.c: OAFized.
(get_view): If `bonobo_widget_new_control()' fails for the
calendar, don't try to get the property bag and stuff and thus
prevent a segfault.
* main.c
(corba_init): Removed Bonobo initialization. Implemented OAF
version for the case in which `USING_OAF' is #defined.
(init_bonob): New function.
(main): Call `init_bonobo()'.
2000-04-26 Matt Loper <matt@helixcode.com>
* e-shell-view.c (bonobo_widget_is_dead): Helper function to see

View File

@ -21,12 +21,25 @@
#include <libgnorba/gnorba.h>
#include <gtk/gtkprivate.h>
#ifdef USING_OAF
# define MAIL_CONTROL_ID "OAFIID:control:evolution-mail:833d5a71-a201-4a0e-b7e6-5475c5c4cb45"
# define ADDRESSBOOK_CONTROL_ID "OAFIID:control:addressbook:851f883b-2fe7-4c94-a1e3-a1f2a7a03c49"
# define CALENDAR_CONTROL_ID "OAFIID:control:calendar:dd34ddae-25c6-486b-a8a8-3e8f0286b54c"
#else
# define MAIL_CONTROL_ID "control:evolution-mail"
# define ADDRESSBOOK_CONTROL_ID "control:addressbook"
# define CALENDAR_CONTROL_ID "control:calendar"
#endif
#define PARENT_TYPE gnome_app_get_type ()
static GtkObjectClass *parent_class;
struct _EShellViewPrivate
{
struct _EShellViewPrivate {
/* a hashtable of e-folders -> widgets */
GHashTable *folder_views;
GtkWidget *notebook;
@ -150,11 +163,11 @@ get_view (EShellView *eshell_view, EFolder *efolder, Bonobo_UIHandler uih)
switch (e_folder_type) {
case E_FOLDER_MAIL :
w = bonobo_widget_new_control ("control:evolution-mail", uih);
w = bonobo_widget_new_control (MAIL_CONTROL_ID, uih);
break;
case E_FOLDER_CONTACTS :
w = bonobo_widget_new_control ("control:addressbook", uih);
w = bonobo_widget_new_control (ADDRESSBOOK_CONTROL_ID, uih);
break;
case E_FOLDER_CALENDAR : {
@ -162,7 +175,7 @@ get_view (EShellView *eshell_view, EFolder *efolder, Bonobo_UIHandler uih)
BonoboPropertyBagClient *pbc;
BonoboControlFrame *cf;
w = bonobo_widget_new_control ("control:calendar", uih);
w = bonobo_widget_new_control (CALENDAR_CONTROL_ID, uih);
if (w) {
cf = bonobo_widget_get_control_frame (BONOBO_WIDGET (w));
@ -191,8 +204,7 @@ get_view (EShellView *eshell_view, EFolder *efolder, Bonobo_UIHandler uih)
return NULL;
}
if (w)
{
if (w) {
Evolution_ServiceRepository corba_sr;
BonoboObjectClient *server =
bonobo_widget_get_server (BONOBO_WIDGET (w));
@ -347,8 +359,10 @@ e_shell_view_set_view (EShellView *eshell_view, EFolder *efolder)
int new_page_index;
folder_view = get_view (eshell_view, efolder, uih);
if (!folder_view)
if (!folder_view) {
/* FIXME: Report failure. */
return;
}
gtk_notebook_append_page (notebook, folder_view, NULL);
new_page_index = gtk_notebook_page_num (notebook,

View File

@ -5,15 +5,23 @@
* Miguel de Icaza (miguel@helixcode.com)
*
*/
#include <config.h>
#include <gnome.h>
#include <libgnorba/gnorba.h>
#include <bonobo.h>
#include <e-util/e-gui-utils.h>
#include <e-util/e-cursors.h>
#include <e-util/e-setup.h> /* for e_setup_base_dir */
#include <glade/glade.h>
#include <glade/glade-xml.h>
#ifdef USING_OAF
#include <liboaf/liboaf.h>
#else
#include <libgnorba/gnorba.h>
#endif
#include "e-shell.h"
#include "e-shell-view.h"
@ -29,6 +37,21 @@ const struct poptOption shell_popt_options [] = {
{ NULL, '\0', 0, NULL, 0 }
};
#ifdef USING_OAF
static void
corba_init (int *argc, char *argv [])
{
gnomelib_register_popt_table (shell_popt_options, "Evolution shell options");
gnome_init_with_popt_table ("Evolution", VERSION, *argc, argv,
oaf_popt_options, 0, NULL);
oaf_init (*argc, argv);
}
#else /* USING_OAF */
static void
corba_init (int *argc, char *argv [])
{
@ -39,8 +62,14 @@ corba_init (int *argc, char *argv [])
"Evolution", VERSION, argc, argv,
shell_popt_options, 0, &ctx, GNORBA_INIT_SERVER_FUNC, &ev);
CORBA_exception_free (&ev);
if (bonobo_init (gnome_CORBA_ORB (), NULL, NULL) == FALSE){
}
#endif /* USING_OAF */
static void
init_bonobo (void)
{
if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE){
e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("Failed to initialize the Bonobo component system"));
exit (1);
@ -96,6 +125,8 @@ main (int argc, char *argv [])
textdomain (PACKAGE);
corba_init (&argc, argv);
init_bonobo ();
gui_init ();
evolution_boot ();

View File

@ -1,3 +1,14 @@
2000-04-27 Ettore Perazzoli <ettore@helixcode.com>
* wombat.c
(register_pcs): New function for registering into the name
service. Varies according on whether we are `USING_OAF' or not.
(init_corba): New function for initializing the CORBA stuff.
Implementation depends on `USING_OAF'.
(init_bonobo): Use `init_corba'.
* Makefile.am: Updated for OAF.
2000-04-25 Federico Mena Quintero <federico@helixcode.com>
* wombat.c (cal_factory pas_book_factory): New module-wide

View File

@ -0,0 +1,30 @@
<oaf_info>
<oaf_server iid="OAFIID:evolution:addressbook-server:0fbc844d-c721-4615-98d0-d67eacf42d80"
type="exe"
location="wombat">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Evolution/BookFactory:1.0"/>
<item value="IDL:Bonobo/Unknown:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="The Personal Addressbook Server"/>
</oaf_server>
<oaf_server iid="OAFIID:evolution:calendar-factory:1c915858-ece3-4a6f-9d81-ea0f108a9554"
type="exe"
location="wombat">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Evolution/Calendar/CalFactory:1.0"/>
<item value="IDL:Bonobo/Unknown:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="The Personal Calendar Server; calendar factory"/>
</oaf_server>
</oaf_info>

View File

@ -0,0 +1,30 @@
<oaf_info>
<oaf_server iid="OAFIID:evolution:addressbook-server:0fbc844d-c721-4615-98d0-d67eacf42d80"
type="exe"
location="wombat">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Evolution/BookFactory:1.0"/>
<item value="IDL:Bonobo/Unknown:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="The Personal Addressbook Server"/>
</oaf_server>
<oaf_server iid="OAFIID:evolution:calendar-factory:1c915858-ece3-4a6f-9d81-ea0f108a9554"
type="exe"
location="wombat">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Evolution/Calendar/CalFactory:1.0"/>
<item value="IDL:Bonobo/Unknown:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="The Personal Calendar Server; calendar factory"/>
</oaf_server>
</oaf_info>

View File

@ -31,5 +31,14 @@ wombat_LDADD = \
wombat_LDFLAGS = `gnome-config --libs gnorba`
if USING_OAF
oafdir = $(datadir)/oaf
oaf_DATA = wombat.oafinfo
else
gnorbadir = $(sysconfdir)/CORBA/servers
gnorba_DATA = wombat.gnorba
endif
EXTRA_DIST = \
wombat.gnorba \
wombat.oafinfo

View File

@ -9,17 +9,14 @@
#include <bonobo.h>
#include <pas/pas-book-factory.h>
#include <pas/pas-backend-file.h>
#include <libgnomevfs/gnome-vfs-init.h>
#ifdef HAVE_LDAP
#include <pas/pas-backend-ldap.h>
#endif
#include <libgnomevfs/gnome-vfs-init.h>
#include <libgnorba/gnorba.h>
#include "calendar/pcs/cal-factory.h"
static CORBA_ORB orb;
/* The and addressbook calendar factories */
static CalFactory *cal_factory;
@ -89,24 +86,50 @@ last_calendar_gone_cb (CalFactory *factory, gpointer data)
queue_termination ();
}
/* Creates the calendar factory object and registers it with GOAD */
static void
setup_pcs (int argc, char **argv)
#ifdef USING_OAF
/* (For the OAF popt stuff, which otherwise does not get in.) */
#include <gnome.h>
#include <liboaf/liboaf.h>
static gboolean
register_pcs (CORBA_Object obj)
{
OAF_RegistrationResult result;
result = oaf_active_server_register
("OAFIID:evolution:calendar-factory:1c915858-ece3-4a6f-9d81-ea0f108a9554",
obj);
switch (result) {
case OAF_REG_SUCCESS:
return TRUE; /* Wooho! */
case OAF_REG_NOT_LISTED:
g_message ("Cannot register the PCS because not listed");
return FALSE;
case OAF_REG_ALREADY_ACTIVE:
g_message ("Cannot register the PCS because already active");
return FALSE;
case OAF_REG_ERROR:
default:
g_message ("Cannot register the PCS because we suck");
return FALSE;
}
}
#else /* USING_OAF */
#include <libgnorba/gnorba.h>
static gboolean
register_pcs (CORBA_Object object)
{
CORBA_Object object;
CORBA_Environment ev;
int result;
cal_factory = cal_factory_new ();
if (!cal_factory) {
g_message ("setup_pcs(): Could not create the calendar factory");
return;
}
object = bonobo_object_corba_objref (BONOBO_OBJECT (cal_factory));
CORBA_exception_init (&ev);
result = goad_server_register (CORBA_OBJECT_NIL,
object,
"evolution:calendar-factory",
@ -117,23 +140,47 @@ setup_pcs (int argc, char **argv)
if (ev._major != CORBA_NO_EXCEPTION || result == -1) {
g_message ("setup_pcs(): could not register the calendar factory");
bonobo_object_unref (BONOBO_OBJECT (cal_factory));
cal_factory = NULL;
CORBA_exception_free (&ev);
return;
} else if (result == -2) {
return FALSE;
}
if (result == -2) {
g_message ("setup_pcs(): a calendar factory is already registered");
bonobo_object_unref (BONOBO_OBJECT (cal_factory));
cal_factory = NULL;
CORBA_exception_free (&ev);
return FALSE;
}
CORBA_exception_free (&ev);
return TRUE;
}
#endif /* USING_OAF */
/* Creates the calendar factory object and registers it with GOAD */
static void
setup_pcs (int argc, char **argv)
{
CORBA_Object object;
cal_factory = cal_factory_new ();
if (!cal_factory) {
g_message ("setup_pcs(): Could not create the calendar factory");
return;
}
gtk_signal_connect (GTK_OBJECT (cal_factory), "last_calendar_gone",
object = bonobo_object_corba_objref (BONOBO_OBJECT (cal_factory));
if (! register_pcs (object)) {
bonobo_object_unref (BONOBO_OBJECT (cal_factory));
cal_factory = NULL;
return;
}
gtk_signal_connect (GTK_OBJECT (cal_factory),
"last_calendar_gone",
GTK_SIGNAL_FUNC (last_calendar_gone_cb),
NULL);
CORBA_exception_free (&ev);
}
@ -154,8 +201,20 @@ setup_vfs (int argc, char **argv)
#ifdef USING_OAF
static void
init_bonobo (int argc, char **argv)
init_corba (int *argc, char **argv)
{
gnome_init_with_popt_table ("Personal Addressbook Server", "0.0",
*argc, argv, oaf_popt_options, 0, NULL);
oaf_init (*argc, argv);
}
#else
static void
init_corba (int *argc, char **argv)
{
CORBA_Environment ev;
@ -163,7 +222,7 @@ init_bonobo (int argc, char **argv)
gnome_CORBA_init_with_popt_table (
"Personal Addressbook Server", "0.0",
&argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev);
argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
g_message ("init_bonobo(): could not initialize GOAD");
@ -172,10 +231,16 @@ init_bonobo (int argc, char **argv)
}
CORBA_exception_free (&ev);
}
orb = gnome_CORBA_ORB ();
#endif
if (!bonobo_init (orb, NULL, NULL)) {
static void
init_bonobo (int *argc, char **argv)
{
init_corba (argc, argv);
if (!bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL)) {
g_message ("init_bonobo(): could not initialize Bonobo");
exit (EXIT_FAILURE);
}
@ -184,7 +249,7 @@ init_bonobo (int argc, char **argv)
int
main (int argc, char **argv)
{
init_bonobo (argc, argv);
init_bonobo (&argc, argv);
setup_vfs (argc, argv);
setup_pas (argc, argv);

30
wombat/wombat.oafinfo Normal file
View File

@ -0,0 +1,30 @@
<oaf_info>
<oaf_server iid="OAFIID:evolution:addressbook-server:0fbc844d-c721-4615-98d0-d67eacf42d80"
type="exe"
location="wombat">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Evolution/BookFactory:1.0"/>
<item value="IDL:Bonobo/Unknown:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="The Personal Addressbook Server"/>
</oaf_server>
<oaf_server iid="OAFIID:evolution:calendar-factory:1c915858-ece3-4a6f-9d81-ea0f108a9554"
type="exe"
location="wombat">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Evolution/Calendar/CalFactory:1.0"/>
<item value="IDL:Bonobo/Unknown:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
value="The Personal Calendar Server; calendar factory"/>
</oaf_server>
</oaf_info>