From b8eefeb931f765e5046244ed98791b7030cec536 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 11 Sep 2007 19:33:47 +0000 Subject: Move the test component to "shell/test" so it installs properly (#469992). svn path=/trunk/; revision=34235 --- shell/ChangeLog | 4 + shell/GNOME_Evolution_Test.server.in.in | 39 ------ shell/Makefile.am | 35 ++---- shell/evolution-test-component.c | 180 --------------------------- shell/evolution-test-component.h | 56 --------- shell/test/GNOME_Evolution_Test.server.in.in | 39 ++++++ shell/test/evolution-test-component.c | 180 +++++++++++++++++++++++++++ shell/test/evolution-test-component.h | 56 +++++++++ 8 files changed, 286 insertions(+), 303 deletions(-) delete mode 100644 shell/GNOME_Evolution_Test.server.in.in delete mode 100644 shell/evolution-test-component.c delete mode 100644 shell/evolution-test-component.h create mode 100644 shell/test/GNOME_Evolution_Test.server.in.in create mode 100644 shell/test/evolution-test-component.c create mode 100644 shell/test/evolution-test-component.h (limited to 'shell') diff --git a/shell/ChangeLog b/shell/ChangeLog index 3d34bf6213..e5d3ca3115 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,7 @@ +2007-09-11 Matthew Barnes + + * Move the test component to a 'test' subdirectory (#469992). + 2007-09-03 Srinivasa Ragavan * e-shell-window-commands.c: Add contributors to the credits section. diff --git a/shell/GNOME_Evolution_Test.server.in.in b/shell/GNOME_Evolution_Test.server.in.in deleted file mode 100644 index ef0db8b1ac..0000000000 --- a/shell/GNOME_Evolution_Test.server.in.in +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/shell/Makefile.am b/shell/Makefile.am index 8eef0ef0df..916acd779b 100644 --- a/shell/Makefile.am +++ b/shell/Makefile.am @@ -1,3 +1,7 @@ +if ENABLE_TEST_COMPONENT +SUBDIRS = . test +endif + INCLUDES = \ -I$(top_srcdir)/widgets \ -I$(top_srcdir)/widgets/misc \ @@ -17,8 +21,7 @@ INCLUDES = \ -DLIBDIR=\""$(datadir)"\" \ -DG_LOG_DOMAIN=\"evolution-shell\" \ $(TZDIALOG_CFLAGS) \ - $(SHELL_CFLAGS) \ - $(EVOLUTION_TEST_CFLAGS) + $(SHELL_CFLAGS) noinst_PROGRAMS = evolution @@ -157,29 +160,6 @@ evolution_LDADD = \ $(TZDIALOG_LIBS) \ $(SHELL_LIBS) -# Test component - -if ENABLE_TEST_COMPONENT -component_LTLIBRARIES = libevolution-test.la -endif - -libevolution_test_la_SOURCES = \ - $(IDL_GENERATED) \ - evolution-test-component.c \ - evolution-test-component.h - -libevolution_test_la_LIBADD = \ - libeshell.la \ - $(EVOLUTION_TEST_LIBS) - -libevolution_test_la_LDFLAGS = -avoid-version -module $(NO_UNDEFINED) - -if ENABLE_TEST_COMPONENT -testserver_in_files = GNOME_Evolution_Test.server.in.in -testserver_DATA = $(testserver_in_files:.server.in.in=.server) -testserverdir = $(serverdir) -endif - # Misc stuff server_in_files = GNOME_Evolution_Shell.server.in.in @@ -223,7 +203,7 @@ install-data-local: fi endif -install-evolution: +install-evolution: $(install-privsolibLTLIBRARIES) $(mkinstalldirs) $(DESTDIR)$(bindir) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) evolution$(EXEEXT) $(DESTDIR)$(bindir)/evolution$(EXEEXT) @@ -256,7 +236,6 @@ MARSHAL_GENERATED = e-shell-marshal.c e-shell-marshal.h EXTRA_DIST = \ $(IDLS) \ $(server_in_files) \ - GNOME_Evolution_Test.server.in.in \ shell.error.xml \ $(glade_DATA) \ $(schema_in_files) \ @@ -278,7 +257,7 @@ evolution.pure: evolution endif -BUILT_SOURCES = $(IDL_GENERATED) $(MARSHAL_GENERATED) $(server_DATA) $(testserver_DATA) $(DATASERVER_IDL_GENERATED) $(error_DATA) +BUILT_SOURCES = $(IDL_GENERATED) $(MARSHAL_GENERATED) $(server_DATA) $(DATASERVER_IDL_GENERATED) $(error_DATA) CLEANFILES = $(BUILT_SOURCES) DISTCLEANFILES = $(schema_DATA) diff --git a/shell/evolution-test-component.c b/shell/evolution-test-component.c deleted file mode 100644 index 1e1cc92483..0000000000 --- a/shell/evolution-test-component.c +++ /dev/null @@ -1,180 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* tasks-component.c - * - * Copyright (C) 2004 Novell, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU 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 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: JP Rosevear - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include "e-task-bar.h" -#include "evolution-test-component.h" - - -#define FACTORY_ID "OAFIID:GNOME_Evolution_Test_Factory:" BASE_VERSION -#define TEST_COMPONENT_ID "OAFIID:GNOME_Evolution_Test_Component:" BASE_VERSION -#define CREATE_TEST_ID "test" - -#define PARENT_TYPE bonobo_object_get_type () - -static BonoboObjectClass *parent_class = NULL; - -struct _EvolutionTestComponentPrivate { - BonoboControl *view_control; - BonoboControl *sidebar_control; - BonoboControl *status_control; -}; - -/* GObject methods */ - -static void -impl_dispose (GObject *object) -{ - EvolutionTestComponentPrivate *priv; - - priv = EVOLUTION_TEST_COMPONENT (object)->priv; - - (* G_OBJECT_CLASS (parent_class)->dispose) (object); -} - -static void -impl_finalize (GObject *object) -{ - EvolutionTestComponentPrivate *priv = EVOLUTION_TEST_COMPONENT (object)->priv; - - g_free (priv); - - (* G_OBJECT_CLASS (parent_class)->finalize) (object); -} - -/* Evolution::Component CORBA methods */ - -static CORBA_boolean -impl_upgradeFromVersion (PortableServer_Servant servant, - CORBA_short major, - CORBA_short minor, - CORBA_short revision, - CORBA_Environment *ev) -{ - EvolutionTestComponent *component = EVOLUTION_TEST_COMPONENT (bonobo_object_from_servant (servant)); - EvolutionTestComponentPrivate *priv; - - priv = component->priv; - - g_message ("Upgrading from %d.%d.%d", major, minor, revision); - - return CORBA_TRUE; -} - - -static GNOME_Evolution_CreatableItemTypeList * -impl__get_userCreatableItems (PortableServer_Servant servant, - CORBA_Environment *ev) -{ - GNOME_Evolution_CreatableItemTypeList *list = GNOME_Evolution_CreatableItemTypeList__alloc (); - - list->_length = 1; - list->_maximum = list->_length; - list->_buffer = GNOME_Evolution_CreatableItemTypeList_allocbuf (list->_length); - - CORBA_sequence_set_release (list, FALSE); - - list->_buffer[0].id = CREATE_TEST_ID; - list->_buffer[0].description = _("New Test"); - list->_buffer[0].menuDescription = _("_Test"); - list->_buffer[0].tooltip = _("Create a new test item"); - list->_buffer[0].menuShortcut = 'i'; - list->_buffer[0].iconName = ""; - - return list; -} - -static void -impl_requestCreateItem (PortableServer_Servant servant, - const CORBA_char *item_type_name, - CORBA_Environment *ev) -{ - EvolutionTestComponent *evolution_test_component = EVOLUTION_TEST_COMPONENT (bonobo_object_from_servant (servant)); - EvolutionTestComponentPrivate *priv; - - priv = evolution_test_component->priv; - - if (strcmp (item_type_name, CREATE_TEST_ID) == 0) { - g_message ("Creating test item"); - } else { - bonobo_exception_set (ev, ex_GNOME_Evolution_Component_UnknownType); - return; - } -} - -/* Initialization */ - -static void -evolution_test_component_class_init (EvolutionTestComponentClass *klass) -{ - POA_GNOME_Evolution_Component__epv *epv = &klass->epv; - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - parent_class = g_type_class_peek_parent (klass); - - epv->upgradeFromVersion = impl_upgradeFromVersion; - epv->_get_userCreatableItems = impl__get_userCreatableItems; - epv->requestCreateItem = impl_requestCreateItem; - - object_class->dispose = impl_dispose; - object_class->finalize = impl_finalize; -} - -static void -evolution_test_component_init (EvolutionTestComponent *component, EvolutionTestComponentClass *klass) -{ - EvolutionTestComponentPrivate *priv; - - priv = g_new0 (EvolutionTestComponentPrivate, 1); - - component->priv = priv; -} - -BONOBO_TYPE_FUNC_FULL (EvolutionTestComponent, GNOME_Evolution_Component, PARENT_TYPE, evolution_test_component) - -static BonoboObject * -factory (BonoboGenericFactory *factory, - const char *component_id, - void *closure) -{ - if (strcmp (component_id, TEST_COMPONENT_ID) == 0) { - BonoboObject *object = BONOBO_OBJECT (g_object_new (EVOLUTION_TEST_TYPE_COMPONENT, NULL)); - bonobo_object_ref (object); - return object; - } - - g_warning (FACTORY_ID ": Don't know what to do with %s", component_id); - - return NULL; -} - -BONOBO_ACTIVATION_SHLIB_FACTORY (FACTORY_ID, "Evolution Calendar component factory", factory, NULL) diff --git a/shell/evolution-test-component.h b/shell/evolution-test-component.h deleted file mode 100644 index 598ddbedb5..0000000000 --- a/shell/evolution-test-component.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* evolution-test-component.h - * - * Copyright (C) 2004 Novell, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU 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 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: JP Rosevear - */ - -#ifndef _EVOLUTION_TEST_COMPONENT_H_ -#define _EVOLUTION_TEST_COMPONENT_H_ - -#include -#include "Evolution.h" - - -#define EVOLUTION_TEST_TYPE_COMPONENT (evolution_test_component_get_type ()) -#define EVOLUTION_TEST_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EVOLUTION_TEST_TYPE_COMPONENT, EvolutionTestComponent)) -#define EVOLUTION_TEST_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EVOLUTION_TEST_TYPE_COMPONENT, EvolutionTestComponentClass)) -#define EVOLUTION_TEST_IS_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EVOLUTION_TEST_TYPE_COMPONENT)) -#define EVOLUTION_TEST_IS_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), EVOLUTION_TEST_TYPE_COMPONENT)) - - -typedef struct _EvolutionTestComponent EvolutionTestComponent; -typedef struct _EvolutionTestComponentPrivate EvolutionTestComponentPrivate; -typedef struct _EvolutionTestComponentClass EvolutionTestComponentClass; - -struct _EvolutionTestComponent { - BonoboObject parent; - - EvolutionTestComponentPrivate *priv; -}; - -struct _EvolutionTestComponentClass { - BonoboObjectClass parent_class; - - POA_GNOME_Evolution_Component__epv epv; -}; - - -GType evolution_test_component_get_type (void); - -#endif /* _EVOLUTION_TEST_COMPONENT_H_ */ diff --git a/shell/test/GNOME_Evolution_Test.server.in.in b/shell/test/GNOME_Evolution_Test.server.in.in new file mode 100644 index 0000000000..ef0db8b1ac --- /dev/null +++ b/shell/test/GNOME_Evolution_Test.server.in.in @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shell/test/evolution-test-component.c b/shell/test/evolution-test-component.c new file mode 100644 index 0000000000..1e1cc92483 --- /dev/null +++ b/shell/test/evolution-test-component.c @@ -0,0 +1,180 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* tasks-component.c + * + * Copyright (C) 2004 Novell, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU 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 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: JP Rosevear + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include "e-task-bar.h" +#include "evolution-test-component.h" + + +#define FACTORY_ID "OAFIID:GNOME_Evolution_Test_Factory:" BASE_VERSION +#define TEST_COMPONENT_ID "OAFIID:GNOME_Evolution_Test_Component:" BASE_VERSION +#define CREATE_TEST_ID "test" + +#define PARENT_TYPE bonobo_object_get_type () + +static BonoboObjectClass *parent_class = NULL; + +struct _EvolutionTestComponentPrivate { + BonoboControl *view_control; + BonoboControl *sidebar_control; + BonoboControl *status_control; +}; + +/* GObject methods */ + +static void +impl_dispose (GObject *object) +{ + EvolutionTestComponentPrivate *priv; + + priv = EVOLUTION_TEST_COMPONENT (object)->priv; + + (* G_OBJECT_CLASS (parent_class)->dispose) (object); +} + +static void +impl_finalize (GObject *object) +{ + EvolutionTestComponentPrivate *priv = EVOLUTION_TEST_COMPONENT (object)->priv; + + g_free (priv); + + (* G_OBJECT_CLASS (parent_class)->finalize) (object); +} + +/* Evolution::Component CORBA methods */ + +static CORBA_boolean +impl_upgradeFromVersion (PortableServer_Servant servant, + CORBA_short major, + CORBA_short minor, + CORBA_short revision, + CORBA_Environment *ev) +{ + EvolutionTestComponent *component = EVOLUTION_TEST_COMPONENT (bonobo_object_from_servant (servant)); + EvolutionTestComponentPrivate *priv; + + priv = component->priv; + + g_message ("Upgrading from %d.%d.%d", major, minor, revision); + + return CORBA_TRUE; +} + + +static GNOME_Evolution_CreatableItemTypeList * +impl__get_userCreatableItems (PortableServer_Servant servant, + CORBA_Environment *ev) +{ + GNOME_Evolution_CreatableItemTypeList *list = GNOME_Evolution_CreatableItemTypeList__alloc (); + + list->_length = 1; + list->_maximum = list->_length; + list->_buffer = GNOME_Evolution_CreatableItemTypeList_allocbuf (list->_length); + + CORBA_sequence_set_release (list, FALSE); + + list->_buffer[0].id = CREATE_TEST_ID; + list->_buffer[0].description = _("New Test"); + list->_buffer[0].menuDescription = _("_Test"); + list->_buffer[0].tooltip = _("Create a new test item"); + list->_buffer[0].menuShortcut = 'i'; + list->_buffer[0].iconName = ""; + + return list; +} + +static void +impl_requestCreateItem (PortableServer_Servant servant, + const CORBA_char *item_type_name, + CORBA_Environment *ev) +{ + EvolutionTestComponent *evolution_test_component = EVOLUTION_TEST_COMPONENT (bonobo_object_from_servant (servant)); + EvolutionTestComponentPrivate *priv; + + priv = evolution_test_component->priv; + + if (strcmp (item_type_name, CREATE_TEST_ID) == 0) { + g_message ("Creating test item"); + } else { + bonobo_exception_set (ev, ex_GNOME_Evolution_Component_UnknownType); + return; + } +} + +/* Initialization */ + +static void +evolution_test_component_class_init (EvolutionTestComponentClass *klass) +{ + POA_GNOME_Evolution_Component__epv *epv = &klass->epv; + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + parent_class = g_type_class_peek_parent (klass); + + epv->upgradeFromVersion = impl_upgradeFromVersion; + epv->_get_userCreatableItems = impl__get_userCreatableItems; + epv->requestCreateItem = impl_requestCreateItem; + + object_class->dispose = impl_dispose; + object_class->finalize = impl_finalize; +} + +static void +evolution_test_component_init (EvolutionTestComponent *component, EvolutionTestComponentClass *klass) +{ + EvolutionTestComponentPrivate *priv; + + priv = g_new0 (EvolutionTestComponentPrivate, 1); + + component->priv = priv; +} + +BONOBO_TYPE_FUNC_FULL (EvolutionTestComponent, GNOME_Evolution_Component, PARENT_TYPE, evolution_test_component) + +static BonoboObject * +factory (BonoboGenericFactory *factory, + const char *component_id, + void *closure) +{ + if (strcmp (component_id, TEST_COMPONENT_ID) == 0) { + BonoboObject *object = BONOBO_OBJECT (g_object_new (EVOLUTION_TEST_TYPE_COMPONENT, NULL)); + bonobo_object_ref (object); + return object; + } + + g_warning (FACTORY_ID ": Don't know what to do with %s", component_id); + + return NULL; +} + +BONOBO_ACTIVATION_SHLIB_FACTORY (FACTORY_ID, "Evolution Calendar component factory", factory, NULL) diff --git a/shell/test/evolution-test-component.h b/shell/test/evolution-test-component.h new file mode 100644 index 0000000000..598ddbedb5 --- /dev/null +++ b/shell/test/evolution-test-component.h @@ -0,0 +1,56 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* evolution-test-component.h + * + * Copyright (C) 2004 Novell, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU 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 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: JP Rosevear + */ + +#ifndef _EVOLUTION_TEST_COMPONENT_H_ +#define _EVOLUTION_TEST_COMPONENT_H_ + +#include +#include "Evolution.h" + + +#define EVOLUTION_TEST_TYPE_COMPONENT (evolution_test_component_get_type ()) +#define EVOLUTION_TEST_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EVOLUTION_TEST_TYPE_COMPONENT, EvolutionTestComponent)) +#define EVOLUTION_TEST_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EVOLUTION_TEST_TYPE_COMPONENT, EvolutionTestComponentClass)) +#define EVOLUTION_TEST_IS_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EVOLUTION_TEST_TYPE_COMPONENT)) +#define EVOLUTION_TEST_IS_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), EVOLUTION_TEST_TYPE_COMPONENT)) + + +typedef struct _EvolutionTestComponent EvolutionTestComponent; +typedef struct _EvolutionTestComponentPrivate EvolutionTestComponentPrivate; +typedef struct _EvolutionTestComponentClass EvolutionTestComponentClass; + +struct _EvolutionTestComponent { + BonoboObject parent; + + EvolutionTestComponentPrivate *priv; +}; + +struct _EvolutionTestComponentClass { + BonoboObjectClass parent_class; + + POA_GNOME_Evolution_Component__epv epv; +}; + + +GType evolution_test_component_get_type (void); + +#endif /* _EVOLUTION_TEST_COMPONENT_H_ */ -- cgit v1.2.3