From 132fc1149479104a340578924341438f5f0c53b0 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Fri, 28 Mar 2003 21:41:44 +0000 Subject: 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 --- wombat/ChangeLog | 15 +++++ wombat/Evolution-Wombat.idl | 9 ++- wombat/GNOME_Evolution_WombatLDAP.server.in.in | 13 +++++ wombat/GNOME_Evolution_WombatNOLDAP.server.in.in | 13 +++++ wombat/Makefile.am | 24 +++++++- wombat/wombat-interface-check.c | 70 ++++++++++++++++++++++++ wombat/wombat-interface-check.h | 68 +++++++++++++++++++++++ wombat/wombat.c | 43 +++++++++++---- 8 files changed, 240 insertions(+), 15 deletions(-) create mode 100644 wombat/wombat-interface-check.c create mode 100644 wombat/wombat-interface-check.h (limited to 'wombat') 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 + + * 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 * 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 + 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 @@ + + + + + + + + + + + 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 @@ + + + + + + + + + + + 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 + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "wombat-interface-check.h" + +#include + + +#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 + */ + +#ifndef _WOMBAT_INTERFACE_CHECK_H_ +#define _WOMBAT_INTERFACE_CHECK_H_ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#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 #include #include +#include +#include #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 (); -- cgit v1.2.3