aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2003-03-29 05:41:44 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2003-03-29 05:41:44 +0800
commit132fc1149479104a340578924341438f5f0c53b0 (patch)
tree2c0023a22905a836cbfa92e437e3e9ccaf0d03be
parent0dadd716b3f82e2c2ec278850d1166688d03d6fe (diff)
downloadgsoc2013-evolution-132fc1149479104a340578924341438f5f0c53b0.tar.gz
gsoc2013-evolution-132fc1149479104a340578924341438f5f0c53b0.tar.zst
gsoc2013-evolution-132fc1149479104a340578924341438f5f0c53b0.zip
Add InterfaceCheck object. Likewise.
* GNOME_Evolution_WombatLDAP.server.in.in: Add InterfaceCheck object. * GNOME_Evolution_WombatNOLDAP.server.in.in: Likewise. * wombat-interface-check.c: New, from evolution-1-2-branch. * wombat-interface-check.h: Likewise. * wombat.c (setup_pas): Removed argc/argv args. (setup_pcs): Likewise. (setup_interface_check): New interface to set up the InterfaceCheck object. (main): Call the latter. svn path=/trunk/; revision=20563
-rw-r--r--wombat/ChangeLog15
-rw-r--r--wombat/Evolution-Wombat.idl9
-rw-r--r--wombat/GNOME_Evolution_WombatLDAP.server.in.in13
-rw-r--r--wombat/GNOME_Evolution_WombatNOLDAP.server.in.in13
-rw-r--r--wombat/Makefile.am24
-rw-r--r--wombat/wombat-interface-check.c70
-rw-r--r--wombat/wombat-interface-check.h68
-rw-r--r--wombat/wombat.c43
8 files changed, 240 insertions, 15 deletions
diff --git a/wombat/ChangeLog b/wombat/ChangeLog
index aaef6c16f3..931f09a9df 100644
--- a/wombat/ChangeLog
+++ b/wombat/ChangeLog
@@ -1,3 +1,18 @@
+2003-03-28 Ettore Perazzoli <ettore@ximian.com>
+
+ * GNOME_Evolution_WombatLDAP.server.in.in: Add InterfaceCheck
+ object.
+ * GNOME_Evolution_WombatNOLDAP.server.in.in: Likewise.
+
+ * wombat-interface-check.c: New, from evolution-1-2-branch.
+ * wombat-interface-check.h: Likewise.
+
+ * wombat.c (setup_pas): Removed argc/argv args.
+ (setup_pcs): Likewise.
+ (setup_interface_check): New interface to set up the
+ InterfaceCheck object.
+ (main): Call the latter.
+
2003-03-13 Dan Winship <danw@ximian.com>
* Makefile.am (GNOME_Evolution_Wombat.server.in.in): Make this
diff --git a/wombat/Evolution-Wombat.idl b/wombat/Evolution-Wombat.idl
index 2c9538bfce..ec951c5f1e 100644
--- a/wombat/Evolution-Wombat.idl
+++ b/wombat/Evolution-Wombat.idl
@@ -1,9 +1,11 @@
/*
- * The Evolution Personal Organization Server.
+ * Wombat interfaces.
*
- * Copyright 2000, Ximian, Inc.
+ * Copyright (C) 2000, 2001, 2002, Ximian, Inc.
*/
+#include <Bonobo.idl>
+
module GNOME {
module Evolution {
@@ -13,7 +15,10 @@ module Evolution {
};
interface Config {
+ };
+ interface WombatInterfaceCheck : Bonobo::Unknown {
+ readonly attribute string interfaceVersion;
};
};
};
diff --git a/wombat/GNOME_Evolution_WombatLDAP.server.in.in b/wombat/GNOME_Evolution_WombatLDAP.server.in.in
index f76b9504a2..74450de9df 100644
--- a/wombat/GNOME_Evolution_WombatLDAP.server.in.in
+++ b/wombat/GNOME_Evolution_WombatLDAP.server.in.in
@@ -32,4 +32,17 @@
</oaf_server>
+<oaf_server iid="OAFIID:GNOME_Evolution_Wombat_InterfaceCheck"
+ type="exe"
+ location="@LIBEXECDIR@/evolution-wombat">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:GNOME/Evolution/WombatInterfaceCheck:1.0"/>
+ <item value="IDL:Bonobo/Unknown:1.0"/>
+ </oaf_attribute>
+
+ <oaf_attribute name="description" type="string" _value="Wombat InterfaceCheck interface"/>
+
+</oaf_server>
+
</oaf_info>
diff --git a/wombat/GNOME_Evolution_WombatNOLDAP.server.in.in b/wombat/GNOME_Evolution_WombatNOLDAP.server.in.in
index 659751c4e5..fee8a777c1 100644
--- a/wombat/GNOME_Evolution_WombatNOLDAP.server.in.in
+++ b/wombat/GNOME_Evolution_WombatNOLDAP.server.in.in
@@ -31,4 +31,17 @@
</oaf_server>
+<oaf_server iid="OAFIID:GNOME_Evolution_Wombat_InterfaceCheck"
+ type="exe"
+ location="@LIBEXECDIR@/evolution-wombat">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:GNOME/Evolution/WombatInterfaceCheck:1.0"/>
+ <item value="IDL:Bonobo/Unknown:1.0"/>
+ </oaf_attribute>
+
+ <oaf_attribute name="description" type="string" _value="Wombat InterfaceCheck interface"/>
+
+</oaf_server>
+
</oaf_info>
diff --git a/wombat/Makefile.am b/wombat/Makefile.am
index 16feea5c8c..311adad020 100644
--- a/wombat/Makefile.am
+++ b/wombat/Makefile.am
@@ -16,10 +16,32 @@ INCLUDES = \
-DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
$(WOMBAT_CFLAGS)
+IDLS = \
+ Evolution-Wombat.idl
+
+IDL_GENERATED_H = \
+ Evolution-Wombat.h
+
+IDL_GENERATED_C = \
+ Evolution-Wombat-common.c \
+ Evolution-Wombat-skels.c \
+ Evolution-Wombat-stubs.c
+
+IDL_GENERATED = $(IDL_GENERATED_H) $(IDL_GENERATED_C)
+
+$(IDL_GENERATED_H): $(IDLS)
+ $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) $(srcdir)/Evolution-Wombat.idl
+
+$(IDL_GENERATED_C): $(IDL_GENERATED_H)
+
+
privlibexec_PROGRAMS = \
evolution-wombat
evolution_wombat_SOURCES = \
+ $(IDL_GENERATED) \
+ wombat-interface-check.c \
+ wombat-interface-check.h \
wombat.c
if ENABLE_LDAP
@@ -59,7 +81,7 @@ $(server_in_files:.server.in.in=.server.in): $(server_in_files)
@INTLTOOL_SERVER_RULE@
-idl_DATA = Evolution-Wombat.idl
+idl_DATA = $(IDLS)
EXTRA_DIST = $(server_DATA) \
$(server_in_files) \
diff --git a/wombat/wombat-interface-check.c b/wombat/wombat-interface-check.c
new file mode 100644
index 0000000000..f7766cd218
--- /dev/null
+++ b/wombat/wombat-interface-check.c
@@ -0,0 +1,70 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* wombat-interface-check.c
+ *
+ * Copyright (C) 2002 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Ettore Perazzoli <ettore@ximian.com>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "wombat-interface-check.h"
+
+#include <gal/util/e-util.h>
+
+
+#define PARENT_TYPE bonobo_object_get_type ()
+static BonoboObjectClass *parent_class = NULL;
+
+
+static CORBA_char *
+impl__get_interfaceVersion (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ return CORBA_string_dup (VERSION);
+}
+
+
+static void
+wombat_interface_check_class_init (WombatInterfaceCheckClass *class)
+{
+ parent_class = g_type_class_ref (PARENT_TYPE);
+
+ class->epv._get_interfaceVersion = impl__get_interfaceVersion;
+}
+
+static void
+wombat_interface_check_init (WombatInterfaceCheck *interface_check)
+{
+ /* (Nothing to initialize here.) */
+}
+
+
+WombatInterfaceCheck *
+wombat_interface_check_new (void)
+{
+ return g_object_new (WOMBAT_TYPE_INTERFACE_CHECK, NULL);
+}
+
+
+BONOBO_TYPE_FUNC_FULL (WombatInterfaceCheck,
+ GNOME_Evolution_WombatInterfaceCheck,
+ PARENT_TYPE,
+ wombat_interface_check)
diff --git a/wombat/wombat-interface-check.h b/wombat/wombat-interface-check.h
new file mode 100644
index 0000000000..9cd00b5b62
--- /dev/null
+++ b/wombat/wombat-interface-check.h
@@ -0,0 +1,68 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* wombat-interface-check.h
+ *
+ * Copyright (C) 2002 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Ettore Perazzoli <ettore@ximian.com>
+ */
+
+#ifndef _WOMBAT_INTERFACE_CHECK_H_
+#define _WOMBAT_INTERFACE_CHECK_H_
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <bonobo/bonobo-object.h>
+#include "Evolution-Wombat.h"
+
+#ifdef __cplusplus
+extern "C" {
+#pragma }
+#endif /* __cplusplus */
+
+#define WOMBAT_TYPE_INTERFACE_CHECK (wombat_interface_check_get_type ())
+#define WOMBAT_INTERFACE_CHECK(obj) (GTK_CHECK_CAST ((obj), WOMBAT_TYPE_INTERFACE_CHECK, WombatInterfaceCheck))
+#define WOMBAT_INTERFACE_CHECK_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), WOMBAT_TYPE_INTERFACE_CHECK, WombatInterfaceCheckClass))
+#define WOMBAT_IS_INTERFACE_CHECK(obj) (GTK_CHECK_TYPE ((obj), WOMBAT_TYPE_INTERFACE_CHECK))
+#define WOMBAT_IS_INTERFACE_CHECK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), WOMBAT_TYPE_INTERFACE_CHECK))
+
+
+typedef struct _WombatInterfaceCheck WombatInterfaceCheck;
+typedef struct _WombatInterfaceCheckPrivate WombatInterfaceCheckPrivate;
+typedef struct _WombatInterfaceCheckClass WombatInterfaceCheckClass;
+
+struct _WombatInterfaceCheck {
+ BonoboObject parent;
+};
+
+struct _WombatInterfaceCheckClass {
+ BonoboObjectClass parent_class;
+
+ POA_GNOME_Evolution_WombatInterfaceCheck__epv epv;
+};
+
+
+GType wombat_interface_check_get_type (void);
+WombatInterfaceCheck *wombat_interface_check_new (void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _WOMBAT_INTERFACE_CHECK_H_ */
diff --git a/wombat/wombat.c b/wombat/wombat.c
index 47244afadb..563579f370 100644
--- a/wombat/wombat.c
+++ b/wombat/wombat.c
@@ -24,6 +24,8 @@
#include <libgnomevfs/gnome-vfs-init.h>
#include <bonobo/bonobo-main.h>
#include <bonobo/bonobo-i18n.h>
+#include <bonobo/bonobo-exception.h>
+#include <bonobo/bonobo-generic-factory.h>
#include "pas/pas-book-factory.h"
#include "pas/pas-backend-file.h"
@@ -31,6 +33,8 @@
#include "calendar/pcs/cal-factory.h"
#include "calendar/pcs/cal-backend-file.h"
+#include "wombat-interface-check.h"
+
#ifdef HAVE_LDAP
#include "pas/pas-backend-ldap.h"
#endif
@@ -90,7 +94,7 @@ last_book_gone_cb (PASBookFactory *factory, gpointer data)
}
static gboolean
-setup_pas (int argc, char **argv)
+setup_pas (void)
{
pas_book_factory = pas_book_factory_new ();
@@ -120,7 +124,6 @@ setup_pas (int argc, char **argv)
}
-
/* Personal calendar server */
/* Callback used when the calendar factory has no more running backends */
@@ -132,7 +135,7 @@ last_calendar_gone_cb (CalFactory *factory, gpointer data)
/* Creates the calendar factory object and registers it */
static gboolean
-setup_pcs (int argc, char **argv)
+setup_pcs (void)
{
cal_factory = cal_factory_new ();
@@ -158,7 +161,22 @@ setup_pcs (int argc, char **argv)
}
+/* Interface check iface. */
+
+static gboolean
+setup_interface_check (void)
+{
+ WombatInterfaceCheck *interface_check_iface = wombat_interface_check_new ();
+ int result;
+
+ result = bonobo_activation_active_server_register ("OAFIID:GNOME_Evolution_Wombat_InterfaceCheck",
+ BONOBO_OBJREF (interface_check_iface));
+
+ return result == Bonobo_ACTIVATION_REG_SUCCESS;
+}
+
+
#ifdef DEBUG_BACKENDS
static void
dump_backends (int signal)
@@ -192,20 +210,16 @@ main (int argc, char **argv)
CORBA_OBJECT_NIL,
CORBA_OBJECT_NIL);
- /*g_log_set_always_fatal (G_LOG_LEVEL_ERROR |
- G_LOG_LEVEL_CRITICAL |
- G_LOG_LEVEL_WARNING);*/
-
- if (!( (did_pas = setup_pas (argc, argv))
- && (did_pcs = setup_pcs (argc, argv))
- )) {
+ if (!( (did_pas = setup_pas ())
+ && (did_pcs = setup_pcs ())
+ )) {
const gchar *failed = NULL;
if (!did_pas)
- failed = "PAS";
+ failed = "PAS";
else if (!did_pcs)
- failed = "PCS";
+ failed = "PCS";
g_message ("main(): could not initialize Wombat service \"%s\"; terminating", failed);
@@ -221,6 +235,11 @@ main (int argc, char **argv)
exit (EXIT_FAILURE);
}
+ if (! setup_interface_check ()) {
+ g_message ("Cannot register Wombat::InterfaceCheck object");
+ exit (EXIT_FAILURE);
+ }
+
g_print ("Wombat up and running\n");
bonobo_main ();