aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-04-28 12:23:19 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-04-28 12:23:19 +0800
commit9483369aa04a5d2c4dc5c0034a3e4431153d9c99 (patch)
treeb52233be1d2618e4af4a919800422774133b4998 /calendar
parent02ed4a60f394f53de32b10459c959ad6a1f7b887 (diff)
downloadgsoc2013-evolution-9483369aa04a5d2c4dc5c0034a3e4431153d9c99.tar
gsoc2013-evolution-9483369aa04a5d2c4dc5c0034a3e4431153d9c99.tar.gz
gsoc2013-evolution-9483369aa04a5d2c4dc5c0034a3e4431153d9c99.tar.bz2
gsoc2013-evolution-9483369aa04a5d2c4dc5c0034a3e4431153d9c99.tar.lz
gsoc2013-evolution-9483369aa04a5d2c4dc5c0034a3e4431153d9c99.tar.xz
gsoc2013-evolution-9483369aa04a5d2c4dc5c0034a3e4431153d9c99.tar.zst
gsoc2013-evolution-9483369aa04a5d2c4dc5c0034a3e4431153d9c99.zip
Made Evolution OAF-compatible.
svn path=/trunk/; revision=2673
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog24
-rw-r--r--calendar/cal-client/cal-client.c14
-rw-r--r--calendar/cal-client/client-test.c36
-rw-r--r--calendar/gui/GNOME_Evolution_Calendar_Control.oaf.in28
-rw-r--r--calendar/gui/GNOME_Evolution_Calendar_Control.oafinfo28
-rw-r--r--calendar/gui/Makefile.am9
-rw-r--r--calendar/gui/calendar-control.oafinfo28
-rw-r--r--calendar/gui/evolution-calendar-control.c33
-rw-r--r--calendar/gui/gnomecal.oafinfo27
-rw-r--r--calendar/gui/main.c26
-rw-r--r--calendar/pcs/cal-factory.h3
11 files changed, 231 insertions, 25 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 5e5d9c1876..fa05cff137 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -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
diff --git a/calendar/cal-client/cal-client.c b/calendar/cal-client/cal-client.c
index 34192387b4..bffa12ac65 100644
--- a/calendar/cal-client/cal-client.c
+++ b/calendar/cal-client/cal-client.c
@@ -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");
diff --git a/calendar/cal-client/client-test.c b/calendar/cal-client/client-test.c
index fa8316707d..f4b847eb65 100644
--- a/calendar/cal-client/client-test.c
+++ b/calendar/cal-client/client-test.c
@@ -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,13 +144,25 @@ 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)
{
- CORBA_Environment ev;
+ gnome_init ("tl-test", VERSION, *argc, argv);
+ oaf_init (*argc, argv);
+}
- bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);
+#else
+
+#include <libgnorba/gnorba.h>
+
+static void
+init_corba (int *argc, char **argv)
+{
+ CORBA_Environment ev;
CORBA_exception_init (&ev);
gnome_CORBA_init ("tl-test", VERSION, &argc, argv, 0, &ev);
@@ -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");
diff --git a/calendar/gui/GNOME_Evolution_Calendar_Control.oaf.in b/calendar/gui/GNOME_Evolution_Calendar_Control.oaf.in
new file mode 100644
index 0000000000..fb0f138caf
--- /dev/null
+++ b/calendar/gui/GNOME_Evolution_Calendar_Control.oaf.in
@@ -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>
diff --git a/calendar/gui/GNOME_Evolution_Calendar_Control.oafinfo b/calendar/gui/GNOME_Evolution_Calendar_Control.oafinfo
new file mode 100644
index 0000000000..fb0f138caf
--- /dev/null
+++ b/calendar/gui/GNOME_Evolution_Calendar_Control.oafinfo
@@ -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>
diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am
index 07e8ca1531..fa15a9286e 100644
--- a/calendar/gui/Makefile.am
+++ b/calendar/gui/Makefile.am
@@ -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 \
diff --git a/calendar/gui/calendar-control.oafinfo b/calendar/gui/calendar-control.oafinfo
new file mode 100644
index 0000000000..fb0f138caf
--- /dev/null
+++ b/calendar/gui/calendar-control.oafinfo
@@ -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>
diff --git a/calendar/gui/evolution-calendar-control.c b/calendar/gui/evolution-calendar-control.c
index c8c419d471..54ac148889 100644
--- a/calendar/gui/evolution-calendar-control.c
+++ b/calendar/gui/evolution-calendar-control.c
@@ -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 ();
diff --git a/calendar/gui/gnomecal.oafinfo b/calendar/gui/gnomecal.oafinfo
new file mode 100644
index 0000000000..c4b91b9dd8
--- /dev/null
+++ b/calendar/gui/gnomecal.oafinfo
@@ -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>
diff --git a/calendar/gui/main.c b/calendar/gui/main.c
index 904868513e..46f4c31e3e 100644
--- a/calendar/gui/main.c
+++ b/calendar/gui/main.c
@@ -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");
diff --git a/calendar/pcs/cal-factory.h b/calendar/pcs/cal-factory.h
index 85435e45ae..03b2cc8dc3 100644
--- a/calendar/pcs/cal-factory.h
+++ b/calendar/pcs/cal-factory.h
@@ -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