DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
if ENABLE_CALENDAR
-CALENDAR_DIR = calendar src
+CALENDAR_DIR = calendar
endif
SUBDIRS = win32 libedataserver libebackend servers camel addressbook $(CALENDAR_DIR) libedataserverui docs art po
-DIST_SUBDIRS = win32 libedataserver libebackend servers camel addressbook calendar src libedataserverui docs art po
+DIST_SUBDIRS = win32 libedataserver libebackend servers camel addressbook calendar libedataserverui docs art po
changelogs = \
ChangeLog
fi
dnl ******************************
-dnl factory flags
-dnl ******************************
-E_FACTORY_DEPS="$mozilla_nspr"
-if test "x${enable_calendar}" = "xyes"; then
- E_FACTORY_DEPS="$E_FACTORY_DEPS libical"
-fi
-EVO_SET_COMPILE_FLAGS(E_FACTORY, $E_FACTORY_DEPS, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS $LIBICAL_EXTRA_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS $LIBICAL_EXTRA_LIBS)
-AC_SUBST(E_FACTORY_CFLAGS)
-AC_SUBST(E_FACTORY_LIBS)
-
-dnl ******************************
dnl Google flags
dnl ******************************
GDATA_DEPS="libsoup-2.4 libxml-2.0"
servers/google/libgdata/libgdata.pc
servers/google/libgdata-google/Makefile
servers/google/libgdata-google/libgdata-google.pc
-src/Makefile
win32/Makefile
docs/Makefile
docs/reference/Makefile
+++ /dev/null
-/*
- * Server interfaces.
- *
- * Copyright (C) 2000, 2001, 2002, Ximian, Inc.
- */
-
-#include <Bonobo.idl>
-
-module GNOME {
-module Evolution {
-module DataServer {
-
- interface Config {
- };
-
- interface InterfaceCheck : Bonobo::Unknown {
- readonly attribute string interfaceVersion;
- };
-
-
- interface Logging : Bonobo::EventSource {
- enum Level {
- Error,
- Critical,
- Warning,
- Message,
- Info,
- Debug
- };
-
- struct LogEvent {
- string domain;
- Level level;
- string message;
- };
-
- };
-};
-};
-};
+++ /dev/null
-<oaf_info>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_DataServer_BookFactory:@API_VERSION@"
- type="exe"
- location="@LIBEXECDIR_IN_SERVER_FILE@/evolution-data-server-@VERSION@@EXEEXT@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/DataServer/BookFactory:@API_VERSION@"/>
- <item value="IDL:Bonobo/Unknown:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook file backend"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_DataServer_CalFactory:@API_VERSION@"
- type="exe"
- location="@LIBEXECDIR_IN_SERVER_FILE@/evolution-data-server-@VERSION@@EXEEXT@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/DataServer/CalFactory:@API_VERSION@"/>
- <item value="IDL:Bonobo/Unknown:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Calendar file and webcal backend"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_DataServer_InterfaceCheck"
- type="exe"
- location="@LIBEXECDIR_IN_SERVER_FILE@/evolution-data-server-@VERSION@@EXEEXT@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/ServerInterfaceCheck:1.0"/>
- <item value="IDL:Bonobo/Unknown:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string" _value="Evolution Data Server interface check service"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_DataServer_Logging"
- type="exe"
- location="@LIBEXECDIR_IN_SERVER_FILE@/evolution-data-server-@VERSION@@EXEEXT@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/ServerLogging:1.0"/>
- <item value="IDL:Bonobo/Unknown:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string" _value="Evolution Data Server logging service"/>
-</oaf_server>
-
-</oaf_info>
+++ /dev/null
-IDLS = \
- Evolution-DataServer.idl
-
-IDL_GENERATED_H = \
- Evolution-DataServer.h
-
-IDL_GENERATED_C = \
- Evolution-DataServer-common.c \
- Evolution-DataServer-skels.c \
- Evolution-DataServer-stubs.c
-
-IDL_GENERATED = $(IDL_GENERATED_H) $(IDL_GENERATED_C)
-
-$(IDL_GENERATED_H): $(IDLS)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) $(srcdir)/Evolution-DataServer.idl
-
-$(IDL_GENERATED_C): $(IDL_GENERATED_H)
-
-
-noinst_PROGRAMS = \
- evolution-data-server
-
-evolution_data_server_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- -DG_LOG_DOMAIN=\"evolution-data-server\" \
- -DPREFIX=\"$(prefix)\" \
- -DSYSCONFDIR=\"$(sysconfdir)\" \
- -DDATADIR=\"$(datadir)\" \
- -DLIBDIR=\"$(libdir)\" \
- -I$(top_srcdir) \
- -I$(top_srcdir)/calendar \
- -I$(top_srcdir)/calendar \
- -I$(top_builddir)/calendar \
- -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
- $(SOUP_CFLAGS) \
- $(E_FACTORY_CFLAGS) \
- $(E_DATA_SERVER_CFLAGS)
-
-evolution_data_server_SOURCES = \
- $(IDL_GENERATED) \
- server-interface-check.c \
- server-interface-check.h \
- server-logging.c \
- server-logging.h \
- server.c \
- offline-listener.c \
- offline-listener.h
-
-if ENABLE_CALENDAR
-E_DATA_CAL_LIBS=$(top_builddir)/calendar/libedata-cal/libedata-cal-1.2.la
-endif
-
-evolution_data_server_LDADD = \
- $(top_builddir)/libebackend/libebackend-1.2.la \
- $(top_builddir)/libedataserver/libedataserver-1.2.la \
- $(E_DATA_CAL_LIBS) \
- $(E_FACTORY_LIBS) \
- $(E_DATA_SERVER_LIBS)
-
-if OS_WIN32
-evolution_data_server_LDFLAGS = -mwindows
-endif
-
-install-evolution-data-servers:
- $(mkinstalldirs) $(DESTDIR)$(libexecdir)
- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) evolution-data-server@EXEEXT@ $(DESTDIR)$(libexecdir)/evolution-data-server-$(BASE_VERSION)@EXEEXT@
-
-SERVER_IN_FILE=GNOME_Evolution_DataServer.server.in.in
-
-server_in_files = GNOME_Evolution_DataServer.server.in.in
-server_DATA = $(server_in_files:.server.in.in=_$(API_VERSION).server)
-@EVO_SUBST_SERVER_RULE@
-@EVO_NAME_SERVER_RULE@
-@INTLTOOL_SERVER_RULE@
-
-idl_DATA = $(IDLS)
-
-EXTRA_DIST = \
- $(server_in_files) \
- $(idl_DATA)
-
-BUILT_SOURCES = $(IDL_GENERATED) $(server_DATA)
-CLEANFILES = $(BUILT_SOURCES)
-
-install-exec-local: install-evolution-data-servers
-
-uninstall-local:
- rm -f $(DESTDIR)$(libexecdir)/evolution-data-server-$(BASE_VERSION)@EXEEXT@
-
-dist-hook:
- cd $(distdir); rm -f $(BUILT_SOURCES)
-
-if ENABLE_PURIFY
-PLINK = $(LIBTOOL) --mode=link $(PURIFY) $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-
-all-local: evolution-data-server.pure
-
-evolution-data-server.pure: evolution-data-server@EXEEXT@
- @rm -f evolution-data-server.pure
- $(PLINK) $(evolution_data_server_LDFLAGS) $(evolution_data_server_OBJECTS) $(evolution_data_server_LDADD) $(LIBS)
-
-endif
+++ /dev/null
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* server-interface-check.h
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU Lesser General Public
- * License as published by the Free Software Foundation.
- *
- * 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 Lesser General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- * Author: Sivaiah Nallagatla <snallagatla@novell.com>
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "offline-listener.h"
-#include <libedata-cal/e-data-cal-factory.h>
-#include <gconf/gconf-client.h>
-
-enum {
-
- OFFLINE_MODE=1,
- ONLINE_MODE
-};
-
-static GObjectClass *parent_class = NULL;
-
-struct _OfflineListenerPrivate
-{
- GConfClient *default_client;
-
- EDataCalFactory *cal_factory;
-
- gboolean is_offline_now;
-};
-
-static void
-set_online_status (OfflineListener *offline_listener, gboolean is_offline)
-{
- OfflineListenerPrivate *priv;
-
- priv = offline_listener->priv;
-
- e_data_cal_factory_set_backend_mode
- (priv->cal_factory, is_offline ? OFFLINE_MODE : ONLINE_MODE);
-}
-
-static void
-online_status_changed (GConfClient *client, gint cnxn_id, GConfEntry *entry, gpointer data)
-{
- GConfValue *value;
- gboolean offline;
- OfflineListener *offline_listener;
- OfflineListenerPrivate *priv;
-
- offline_listener = OFFLINE_LISTENER(data);
- priv = offline_listener->priv;
- offline = FALSE;
- value = gconf_entry_get_value (entry);
- if (value)
- offline = gconf_value_get_bool (value);
- if (priv->is_offline_now != offline) {
- priv->is_offline_now = offline;
- set_online_status (offline_listener ,offline);
- }
-
-}
-
-static void
-setup_offline_listener (OfflineListener *offline_listener)
-{
- OfflineListenerPrivate *priv = offline_listener->priv;
-
- priv->default_client = gconf_client_get_default ();
- gconf_client_add_dir (priv->default_client, "/apps/evolution/shell", GCONF_CLIENT_PRELOAD_RECURSIVE,NULL);
- gconf_client_notify_add (priv->default_client, "/apps/evolution/shell/start_offline", (GConfClientNotifyFunc)online_status_changed, offline_listener, NULL, NULL);
- priv->is_offline_now = gconf_client_get_bool (priv->default_client, "/apps/evolution/shell/start_offline", NULL);
- set_online_status (offline_listener, priv->is_offline_now);
-}
-
-OfflineListener*
-offline_listener_new (EDataCalFactory *cal_factory)
-{
- OfflineListener *offline_listener = g_object_new (OFFLINE_TYPE_LISTENER, NULL);
- OfflineListenerPrivate *priv = offline_listener->priv;
-
- priv->cal_factory = cal_factory;
- setup_offline_listener (offline_listener);
- return offline_listener;
-
-}
-
-static void
-offline_listener_dispose (GObject *object)
-{
- OfflineListener *offline_listener = OFFLINE_LISTENER (object);
- if (offline_listener->priv->default_client) {
- g_object_unref (offline_listener->priv->default_client);
- offline_listener->priv->default_client = NULL;
- }
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-static void
-offline_listener_finalize (GObject *object)
-{
- OfflineListener *offline_listener;
- OfflineListenerPrivate *priv;
-
- offline_listener = OFFLINE_LISTENER (object);
- priv = offline_listener->priv;
-
- g_free (priv);
- offline_listener->priv = NULL;
-
- parent_class->finalize (object);
-}
-
-static void
-offline_listener_init (OfflineListener *listener)
-{
- OfflineListenerPrivate *priv;
-
- priv =g_new0 (OfflineListenerPrivate, 1);
- listener->priv = priv;
-
-}
-
-static void
-offline_listener_class_init (OfflineListener *klass)
-{
- GObjectClass *object_class;
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class = G_OBJECT_CLASS (klass);
- object_class->dispose = offline_listener_dispose;
- object_class->finalize = offline_listener_finalize;
-
-}
-
-GType
-offline_listener_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static GTypeInfo info = {
- sizeof (OfflineListenerClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) offline_listener_class_init,
- NULL, NULL,
- sizeof (OfflineListener),
- 0,
- (GInstanceInitFunc) offline_listener_init,
- };
- type = g_type_register_static (G_TYPE_OBJECT, "OfflineListener", &info, 0);
- }
-
- return type;
-}
+++ /dev/null
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* server-interface-check.h
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU Lesser General Public
- * License as published by the Free Software Foundation.
- *
- * 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 Lesser General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- * Author: Sivaiah Nallagatla <snallagatla@novell.com>
- */
-
-#ifndef _OFFLINE_LISTNER_H_
-#define _OFFLINE_LISTNER_H_
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib-object.h>
-#include <libedata-cal/e-data-cal-factory.h>
-
-G_BEGIN_DECLS
-
-#define OFFLINE_TYPE_LISTENER (offline_listener_get_type ())
-#define OFFLINE_LISTENER(obj) ((G_TYPE_CHECK_INSTANCE_CAST((obj), OFFLINE_TYPE_LISTENER, OfflineListener)))
-#define OFFLINE_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), OFFLINE_TYPE_LISTENER, OfflineListenerClass))
-#define OFFLINE_IS_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OFFLINE_TYPE_LISTENER))
-#define OFFLINE_IS_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), OFFLINE_TYPE_LISTENER))
-
-typedef struct _OfflineListener OfflineListener;
-typedef struct _OfflineListenerPrivate OfflineListenerPrivate;
-typedef struct _OfflineListenerClass OfflineListenerClass;
-
-struct _OfflineListener {
- GObject parent;
- OfflineListenerPrivate *priv;
-
-};
-
-struct _OfflineListenerClass {
- GObjectClass parent_class;
-
-};
-
-GType offline_listener_get_type (void);
-
-OfflineListener *offline_listener_new (EDataCalFactory *cal_factory);
-
-G_END_DECLS
-
-#endif /* _OFFLINE_LISTNER_H_ */
+++ /dev/null
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* server-interface-check.c
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU Lesser General Public
- * License as published by the Free Software Foundation.
- *
- * 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 Lesser General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- * Author: Ettore Perazzoli <ettore@ximian.com>
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "server-interface-check.h"
-
-\f
-#define PARENT_TYPE bonobo_object_get_type ()
-static BonoboObjectClass *parent_class = NULL;
-
-\f
-static CORBA_char *
-impl__get_interfaceVersion (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- return CORBA_string_dup (VERSION);
-}
-
-\f
-static void
-server_interface_check_class_init (ServerInterfaceCheckClass *class)
-{
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- class->epv._get_interfaceVersion = impl__get_interfaceVersion;
-}
-
-static void
-server_interface_check_init (ServerInterfaceCheck *interface_check)
-{
- /* (Nothing to initialize here.) */
-}
-
-\f
-ServerInterfaceCheck *
-server_interface_check_new (void)
-{
- return g_object_new (SERVER_TYPE_INTERFACE_CHECK, NULL);
-}
-
-\f
-BONOBO_TYPE_FUNC_FULL (ServerInterfaceCheck,
- GNOME_Evolution_DataServer_InterfaceCheck,
- PARENT_TYPE,
- server_interface_check)
+++ /dev/null
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* server-interface-check.h
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU Lesser General Public
- * License as published by the Free Software Foundation.
- *
- * 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 Lesser General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- * Author: Ettore Perazzoli <ettore@ximian.com>
- */
-
-#ifndef _SERVER_INTERFACE_CHECK_H_
-#define _SERVER_INTERFACE_CHECK_H_
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <bonobo/bonobo-object.h>
-#include "Evolution-DataServer.h"
-
-G_BEGIN_DECLS
-
-/* Standard GObject macros */
-#define SERVER_TYPE_INTERFACE_CHECK \
- (server_interface_check_get_type ())
-#define SERVER_INTERFACE_CHECK(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST \
- ((obj), SERVER_TYPE_INTERFACE_CHECK, ServerInterfaceCheck))
-#define SERVER_INTERFACE_CHECK_CLASS(cls) \
- (G_TYPE_CHECK_CLASS_CAST \
- ((cls), SERVER_TYPE_INTERFACE_CHECK, ServerInterfaceCheckClass))
-#define SERVER_IS_INTERFACE_CHECK(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE \
- ((obj), SERVER_TYPE_INTERFACE_CHECK))
-#define SERVER_IS_INTERFACE_CHECK_CLASS(cls) \
- (G_TYPE_CHECK_CLASS_TYPE \
- ((cls), SERVER_TYPE_INTERFACE_CHECK))
-
-\f
-typedef struct _ServerInterfaceCheck ServerInterfaceCheck;
-typedef struct _ServerInterfaceCheckPrivate ServerInterfaceCheckPrivate;
-typedef struct _ServerInterfaceCheckClass ServerInterfaceCheckClass;
-
-struct _ServerInterfaceCheck {
- BonoboObject parent;
-};
-
-struct _ServerInterfaceCheckClass {
- BonoboObjectClass parent_class;
-
- POA_GNOME_Evolution_DataServer_InterfaceCheck__epv epv;
-};
-
-\f
-GType server_interface_check_get_type (void);
-ServerInterfaceCheck *server_interface_check_new (void);
-
-G_END_DECLS
-
-#endif /* _SERVER_INTERFACE_CHECK_H_ */
+++ /dev/null
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* server-logging.c
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU Lesser General Public
- * License as published by the Free Software Foundation.
- *
- * 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 Lesser General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- * Author: Chris Toshok <toshok@ximian.com>
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "server-logging.h"
-
-\f
-#define PARENT_TYPE bonobo_event_source_get_type ()
-static BonoboEventSourceClass *parent_class = NULL;
-
-typedef struct {
- gchar *domain;
- guint id;
-} ServerLoggingHandler;
-
-struct _ServerLoggingPrivate {
- GSList *handlers;
-};
-
-\f
-static void
-server_logging_dispose (GObject *object)
-{
- ServerLogging *logging = SERVER_LOGGING (object);
- ServerLoggingPrivate *priv;
- GSList *l;
-
- priv = logging->priv;
-
- for (l = priv->handlers; l; l = l->next) {
- ServerLoggingHandler *handler = l->data;
-
- g_log_remove_handler (handler->domain, handler->id);
- g_free (handler->domain);
- g_free (handler);
- }
- g_slist_free (priv->handlers);
- priv->handlers = NULL;
-
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-server_logging_finalize (GObject *object)
-{
- ServerLogging *logging = SERVER_LOGGING (object);
-
- g_free (logging->priv);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-server_logging_class_init (ServerLoggingClass *klass)
-{
- GObjectClass *object_class;
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class = G_OBJECT_CLASS (klass);
- object_class->dispose = server_logging_dispose;
- object_class->finalize = server_logging_finalize;
-}
-
-static void
-server_logging_init (ServerLogging *logging)
-{
- ServerLoggingPrivate *priv;
-
- priv = g_new0 (ServerLoggingPrivate, 1);
-
- logging->priv = priv;
-}
-
-\f
-ServerLogging *
-server_logging_new (void)
-{
- return g_object_new (SERVER_TYPE_LOGGING, NULL);
-}
-
-\f
-BONOBO_TYPE_FUNC_FULL (ServerLogging,
- GNOME_Evolution_DataServer_Logging,
- PARENT_TYPE,
- server_logging)
-
-\f
-static void
-server_log_handler(const gchar *domain,
- GLogLevelFlags flags,
- const gchar *msg,
- gpointer user_data)
-{
- ServerLogging *logging = SERVER_LOGGING (user_data);
- BonoboEventSource *es = BONOBO_EVENT_SOURCE (logging);
- CORBA_Environment ev;
- CORBA_any value;
- GNOME_Evolution_DataServer_Logging_LogEvent log_event;
-
- printf ("in server_log_handler\n");
-
- if ((flags & G_LOG_LEVEL_ERROR) == G_LOG_LEVEL_ERROR)
- log_event.level = GNOME_Evolution_DataServer_Logging_Error;
- else if ((flags & G_LOG_LEVEL_CRITICAL) == G_LOG_LEVEL_CRITICAL)
- log_event.level = GNOME_Evolution_DataServer_Logging_Critical;
- else if ((flags & G_LOG_LEVEL_WARNING) == G_LOG_LEVEL_WARNING)
- log_event.level = GNOME_Evolution_DataServer_Logging_Warning;
- else if ((flags & G_LOG_LEVEL_MESSAGE) == G_LOG_LEVEL_MESSAGE)
- log_event.level = GNOME_Evolution_DataServer_Logging_Warning;
- else if ((flags & G_LOG_LEVEL_INFO) == G_LOG_LEVEL_INFO)
- log_event.level = GNOME_Evolution_DataServer_Logging_Info;
- else if ((flags & G_LOG_LEVEL_DEBUG) == G_LOG_LEVEL_DEBUG)
- log_event.level = GNOME_Evolution_DataServer_Logging_Debug;
-
- log_event.domain = (CORBA_char *) domain;
- log_event.message = (CORBA_char *) msg;
-
- value._type = TC_GNOME_Evolution_DataServer_Logging_LogEvent;
- value._value = &log_event;
-
- if (bonobo_event_source_has_listener (es, "log_event")) {
- CORBA_exception_init (&ev);
- bonobo_event_source_notify_listeners (es, "log_event", &value, &ev);
- CORBA_exception_free (&ev);
- }
-
- g_log_default_handler (domain, flags, msg, NULL);
-}
-
-void
-server_logging_register_domain (ServerLogging *logging,
- const gchar *domain)
-{
- ServerLoggingPrivate *priv;
- guint handler_id;
-
- priv = logging->priv;
-
- handler_id = g_log_set_handler(domain, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
- server_log_handler, logging);
-
- if (handler_id) {
- ServerLoggingHandler *handler;
-
- handler = g_new0 (ServerLoggingHandler, 1);
- handler->domain = g_strdup (domain);
- handler->id = handler_id;
-
- priv->handlers = g_slist_prepend (priv->handlers, handler);
- }
-}
+++ /dev/null
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* server-logging.h
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU Lesser General Public
- * License as published by the Free Software Foundation.
- *
- * 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 Lesser General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- * Author: Chris Toshok <toshok@ximian.com>
- */
-
-#ifndef _SERVER_LOGGING_H_
-#define _SERVER_LOGGING_H_
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <bonobo/bonobo-event-source.h>
-#include "Evolution-DataServer.h"
-
-G_BEGIN_DECLS
-
-#define SERVER_TYPE_LOGGING (server_logging_get_type ())
-#define SERVER_LOGGING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SERVER_TYPE_LOGGING, ServerLogging))
-#define SERVER_LOGGING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SERVER_TYPE_LOGGING, ServerLoggingClass))
-#define SERVER_IS_LOGGING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SERVER_TYPE_LOGGING))
-#define SERVER_IS_LOGGING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SERVER_TYPE_LOGGING))
-
-\f
-typedef struct _ServerLogging ServerLogging;
-typedef struct _ServerLoggingPrivate ServerLoggingPrivate;
-typedef struct _ServerLoggingClass ServerLoggingClass;
-
-struct _ServerLogging {
- BonoboEventSource parent;
-
- ServerLoggingPrivate *priv;
-};
-
-struct _ServerLoggingClass {
- BonoboEventSourceClass parent_class;
-
- POA_GNOME_Evolution_DataServer_Logging__epv epv;
-};
-
-\f
-GType server_logging_get_type (void);
-ServerLogging *server_logging_new (void);
-
-void server_logging_register_domain (ServerLogging *logging, const gchar *domain);
-
-G_END_DECLS
-
-#endif /* _SERVER_LOGGING_H_ */
+++ /dev/null
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* server.c
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU Lesser General Public
- * License as published by the Free Software Foundation.
- *
- * 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 Lesser General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- * Author: Nat Friedman (nat@ximian.com)
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-/* define this if you need/want to be able to send USR2 to server and
- get a list of the active backends */
-/*#define DEBUG_BACKENDS*/
-
-#include <stdlib.h>
-#include <signal.h>
-#include <unistd.h>
-#include <pthread.h>
-
-#include <glib.h>
-#include <glib/gi18n.h>
-#include <bonobo-activation/bonobo-activation.h>
-#include <bonobo/bonobo-main.h>
-#include <bonobo/bonobo-exception.h>
-#include <bonobo/bonobo-generic-factory.h>
-#include <gconf/gconf-client.h>
-
-#include <libebackend/e-data-server-module.h>
-#include <libedata-cal/e-data-cal-factory.h>
-
-#ifdef G_OS_WIN32
-#include <libedataserver/e-data-server-util.h>
-#endif
-
-#include "server-interface-check.h"
-#include "server-logging.h"
-#include "offline-listener.h"
-
-#define E_DATA_SERVER_INTERFACE_CHECK_OAF_ID "OAFIID:GNOME_Evolution_DataServer_InterfaceCheck"
-#define E_DATA_SERVER_LOGGING_OAF_ID "OAFIID:GNOME_Evolution_DataServer_Logging"
-
-#define E_DATA_CAL_FACTORY_OAF_ID "OAFIID:GNOME_Evolution_DataServer_CalFactory:" API_VERSION
-
-/* The calendar factory */
-
-static EDataCalFactory *e_data_cal_factory;
-
-/* The other interfaces we implement */
-
-static ServerLogging *logging_iface;
-static ServerInterfaceCheck *interface_check_iface;
-
-/* Timeout interval in milliseconds for termination */
-#define EXIT_TIMEOUT 5000
-
-/* Timeout ID for termination handler */
-static guint termination_handler_id;
-
-static GStaticMutex termination_lock = G_STATIC_MUTEX_INIT;
-
-/* Termination */
-
-/* Termination handler. Checks if both factories have zero running backends,
- * and if so terminates the program.
- */
-static gboolean
-termination_handler (gpointer data)
-{
- gint count = 0;
-
- count += e_data_cal_factory_get_n_backends (e_data_cal_factory);
-
- if (count == 0) {
- g_message ("termination_handler(): Terminating the Server. Have a nice day.");
- bonobo_main_quit ();
- }
-
- termination_handler_id = 0;
- return FALSE;
-}
-
-/* Queues a timeout for handling termination of Server */
-static void
-queue_termination (void)
-{
- g_static_mutex_lock (&termination_lock);
- if (termination_handler_id)
- g_source_remove (termination_handler_id);
-
- termination_handler_id = g_timeout_add (EXIT_TIMEOUT, termination_handler, NULL);
- g_static_mutex_unlock (&termination_lock);
-}
-
-\f
-/* Personal calendar server */
-
-/* Callback used when the calendar factory has no more running backends */
-static void
-last_calendar_gone_cb (EDataCalFactory *factory, gpointer data)
-{
- queue_termination ();
-}
-
-/* Creates the calendar factory object and registers it */
-static gboolean
-setup_cals (void)
-{
- e_data_cal_factory = e_data_cal_factory_new ();
-
- if (!e_data_cal_factory) {
- g_warning (G_STRLOC ": Could not create the calendar factory");
- return FALSE;
- }
-
- e_data_cal_factory_register_backends (e_data_cal_factory);
-
- if (!e_data_cal_factory_register_storage (e_data_cal_factory, E_DATA_CAL_FACTORY_OAF_ID)) {
- bonobo_object_unref (BONOBO_OBJECT (e_data_cal_factory));
- e_data_cal_factory = NULL;
- return FALSE;
- }
-
- g_signal_connect (G_OBJECT (e_data_cal_factory),
- "last_calendar_gone",
- G_CALLBACK (last_calendar_gone_cb),
- NULL);
-
- return TRUE;
-
-}
-\f
-/* Logging iface. */
-static gboolean
-setup_logging (void)
-{
- gint result;
-
- logging_iface = server_logging_new ();
-
- server_logging_register_domain (logging_iface, NULL);
- server_logging_register_domain (logging_iface, "Gdk");
- server_logging_register_domain (logging_iface, "Gtk");
- server_logging_register_domain (logging_iface, "GdkPixbuf");
- server_logging_register_domain (logging_iface, "GLib");
- server_logging_register_domain (logging_iface, "GModule");
- server_logging_register_domain (logging_iface, "GLib-GObject");
- server_logging_register_domain (logging_iface, "GThread");
-
- server_logging_register_domain (logging_iface, "evolution-data-server");
- server_logging_register_domain (logging_iface, "libecalbackendfile");
-
- result = bonobo_activation_active_server_register (E_DATA_SERVER_LOGGING_OAF_ID,
- BONOBO_OBJREF (logging_iface));
-
- return result == Bonobo_ACTIVATION_REG_SUCCESS;
-}
-
-\f
-/* Interface check iface. */
-
-static gboolean
-setup_interface_check (void)
-{
- gint result;
-
- interface_check_iface = server_interface_check_new ();
- result = bonobo_activation_active_server_register (E_DATA_SERVER_INTERFACE_CHECK_OAF_ID,
- BONOBO_OBJREF (interface_check_iface));
-
- return result == Bonobo_ACTIVATION_REG_SUCCESS;
-}
-
-#ifdef DEBUG_BACKENDS
-static void
-dump_backends (gint signal)
-{
- e_data_cal_factory_dump_active_backends (e_data_cal_factory);
-}
-#endif
-
-#ifdef G_OS_WIN32
-#undef EVOLUTION_LOCALEDIR
-#define EVOLUTION_LOCALEDIR e_util_get_localedir ()
-
-/* Used in GNOME_PROGRAM_STANDARD_PROPERTIES: */
-#undef PREFIX
-#define PREFIX e_util_get_prefix ()
-
-static const gchar *
-sysconfdir (void)
-{
- return e_util_replace_prefix (PREFIX,
- e_util_get_prefix (),
- SYSCONFDIR);
-}
-#undef SYSCONFDIR
-#define SYSCONFDIR sysconfdir ()
-
-static const gchar *
-datadir (void)
-{
- return e_util_replace_prefix (PREFIX,
- e_util_get_prefix (),
- DATADIR);
-}
-#undef DATADIR
-#define DATADIR datadir ()
-
-static const gchar *
-libdir (void)
-{
- return e_util_replace_prefix (PREFIX,
- e_util_get_prefix (),
- LIBDIR);
-}
-#undef LIBDIR
-#define LIBDIR libdir ()
-
-#endif
-
-gint
-main (gint argc, gchar **argv)
-{
- OfflineListener *offline_listener = NULL;
-
- bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
- printf ("evolution-data-server-Message: Starting server\n");
-
-#ifdef DEBUG_BACKENDS
- signal (SIGUSR2, dump_backends);
-#endif
-
- bonobo_init_full (&argc, argv,
- bonobo_activation_orb_get(),
- CORBA_OBJECT_NIL,
- CORBA_OBJECT_NIL);
-
- e_data_server_module_init ();
-
- if (!setup_cals ()) {
-
- g_warning (G_STRLOC ": could not initialize Server service \"CALS\"; terminating");
-
- if (e_data_cal_factory) {
- bonobo_object_unref (BONOBO_OBJECT (e_data_cal_factory));
- e_data_cal_factory = NULL;
- }
-
- exit (EXIT_FAILURE);
- }
-
- offline_listener = offline_listener_new (e_data_cal_factory);
-
- if ( setup_logging ()) {
- if ( setup_interface_check ()) {
- g_message ("Server up and running");
-
- bonobo_main ();
- } else
- g_error (G_STRLOC "Cannot register DataServer::InterfaceCheck object");
- } else
- g_error (G_STRLOC "Cannot register DataServer::Logging object");
-
- g_object_unref (offline_listener);
-
- bonobo_object_unref (BONOBO_OBJECT (e_data_cal_factory));
- e_data_cal_factory = NULL;
-
- bonobo_object_unref (BONOBO_OBJECT (logging_iface));
- logging_iface = NULL;
-
- bonobo_object_unref (BONOBO_OBJECT (interface_check_iface));
- interface_check_iface = NULL;
-
- return 0;
-}