diff options
Diffstat (limited to 'executive-summary/test-service')
-rw-r--r-- | executive-summary/test-service/.cvsignore | 6 | ||||
-rw-r--r-- | executive-summary/test-service/GNOME_Evolution_Summary_test.oaf.in | 27 | ||||
-rw-r--r-- | executive-summary/test-service/GNOME_Evolution_Summary_test.oafinfo | 27 | ||||
-rw-r--r-- | executive-summary/test-service/Makefile.am | 21 | ||||
-rw-r--r-- | executive-summary/test-service/main.c | 196 | ||||
-rw-r--r-- | executive-summary/test-service/test-service.oafinfo | 27 |
6 files changed, 0 insertions, 304 deletions
diff --git a/executive-summary/test-service/.cvsignore b/executive-summary/test-service/.cvsignore deleted file mode 100644 index 2473a602c4..0000000000 --- a/executive-summary/test-service/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -Makefile.in -Makefile -core -.deps -.libs -test-service
\ No newline at end of file diff --git a/executive-summary/test-service/GNOME_Evolution_Summary_test.oaf.in b/executive-summary/test-service/GNOME_Evolution_Summary_test.oaf.in deleted file mode 100644 index 2c2329255d..0000000000 --- a/executive-summary/test-service/GNOME_Evolution_Summary_test.oaf.in +++ /dev/null @@ -1,27 +0,0 @@ -<oaf_info> - -<oaf_server iid="OAFIID:evolution-summary-component-factory:test-service:0ea887d5-622b-4b8c-b525-18aa1cbe18a6" - type="exe" - location="test-service"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME:GenericFactory:1.0"/> - </oaf_attribute> - - <oaf_attribute name="description" type="string" - value="Factory for the test component."/> -</oaf_server> - -<oaf_server iid="OAFIID:evolution-summary-component:test-service:d3cb3ed6-a654-4337-8aa0-f443751d6d1b" - type="factory" - location="OAFIID:evolution-summary-component-factory:test-service:0ea887d5-622b-4b8c-b525-18aa1cbe18a6"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:Evolution:SummaryComponent:1.0"/> - </oaf_attribute> - - <oaf_attribute name="description" type="string" - value="Test service"/> -</oaf_server> - -</oaf_info> diff --git a/executive-summary/test-service/GNOME_Evolution_Summary_test.oafinfo b/executive-summary/test-service/GNOME_Evolution_Summary_test.oafinfo deleted file mode 100644 index 2c2329255d..0000000000 --- a/executive-summary/test-service/GNOME_Evolution_Summary_test.oafinfo +++ /dev/null @@ -1,27 +0,0 @@ -<oaf_info> - -<oaf_server iid="OAFIID:evolution-summary-component-factory:test-service:0ea887d5-622b-4b8c-b525-18aa1cbe18a6" - type="exe" - location="test-service"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME:GenericFactory:1.0"/> - </oaf_attribute> - - <oaf_attribute name="description" type="string" - value="Factory for the test component."/> -</oaf_server> - -<oaf_server iid="OAFIID:evolution-summary-component:test-service:d3cb3ed6-a654-4337-8aa0-f443751d6d1b" - type="factory" - location="OAFIID:evolution-summary-component-factory:test-service:0ea887d5-622b-4b8c-b525-18aa1cbe18a6"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:Evolution:SummaryComponent:1.0"/> - </oaf_attribute> - - <oaf_attribute name="description" type="string" - value="Test service"/> -</oaf_server> - -</oaf_info> diff --git a/executive-summary/test-service/Makefile.am b/executive-summary/test-service/Makefile.am deleted file mode 100644 index e294a3ea49..0000000000 --- a/executive-summary/test-service/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -bin_PROGRAMS = test-service - -CFLAGS += -g -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/executive-summary \ - $(EXTRA_GNOME_CFLAGS) \ - $(BONOBO_HTML_GNOME_CFLAGS) \ - $(UNICODE_CFLAGS) - -test_service_SOURCES = \ - main.c - -test_service_LDADD = \ - $(top_builddir)/executive-summary/evolution-services/libevolution-services.la \ - $(BONOBO_VFS_GNOME_LIBS) \ - $(EXTRA_GNOME_LIBS) -oafdir = $(datadir)/oaf -oaf_DATA = test-service.oafinfo - -EXTRA_DIST = $(oaf_DATA) diff --git a/executive-summary/test-service/main.c b/executive-summary/test-service/main.c deleted file mode 100644 index 75bbc3199b..0000000000 --- a/executive-summary/test-service/main.c +++ /dev/null @@ -1,196 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* main.c - * Test Service that counts the number of seconds since it was started. - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * Copyright (C) 2000 Helix Code, 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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gnome.h> -#include <bonobo.h> - -#include <evolution-services/executive-summary-component.h> -#include <evolution-services/executive-summary-component-view.h> - -#include <liboaf/liboaf.h> - -static int running_views = 0; - -struct userdata { - int i; -}; - -#define TEST_SERVICE_ID "OAFIID:evolution-summary-component-factory:test-service:0ea887d5-622b-4b8c-b525-18aa1cbe18a6" - -static BonoboGenericFactory *factory = NULL; - -/* The "do something interesting" function */ -int -add_one (ExecutiveSummaryComponentView *view) -{ - char *html; - struct userdata *ud; - - /* Get the user data from the view */ - ud = gtk_object_get_data (GTK_OBJECT (view), "timer-data"); - if (ud == NULL) { - g_warning ("No user data"); - return FALSE; - } - - /* Generate the new html */ - html = g_strdup_printf ("Since you started this service<br>" - "<center>%d</center><br>seconds have passed.", ud->i); - - /* Change the html on the view - which will tell the Executive Summary that something needs updating */ - executive_summary_component_view_set_html (view, html); - - /* executive_summary_component_view_set_html () makes a copy of the HTML - passed into it, so we don't need to keep it around */ - g_free (html); - - /* Do something "fun" */ - ud->i++; - - return TRUE; -} - -void -view_destroyed (GtkObject *object, - gpointer data) -{ - ExecutiveSummaryComponentView *view; - struct userdata *ud; - int id; - - /* Free the user data for this view*/ - ud = gtk_object_get_data (object, "timer-data"); - gtk_object_set_data (object, "timer-data", NULL); - g_free (ud); - - /* Remove one running view */ - running_views--; - - /* If there are no running views left, quit */ - if (running_views <= 0) - gtk_main_quit (); -} - -/* Create the view: - HTML only */ -static void -create_view (ExecutiveSummaryComponent *component, - ExecutiveSummaryComponentView *view, - void *closure) -{ - char *html = "Since you started this service<br><center>0</center><br>seconds have passed."; - struct userdata *ud; - - g_print ("In: %s\n", __FUNCTION__); - /* Create the userdata structure */ - ud = g_new (struct userdata, 1); - - ud->i = 1; - executive_summary_component_view_construct (view, component, NULL, - html, "The Magic Counter", - "gnome-clock.png"); - g_print ("Out: %s\n", __FUNCTION__); - /* Set the user data on the object */ - gtk_object_set_data (GTK_OBJECT (view), "timer-data", ud); - - /* Connect the the destroyed signal to find out - when the view is destroyed */ - gtk_signal_connect (GTK_OBJECT (view), "destroy", - GTK_SIGNAL_FUNC (view_destroyed), NULL); - - /* Increase the number of running views */ - running_views++; - - /* Do something "interesting" once a second */ - gtk_timeout_add (1000, add_one, view); -} - -static void -configure (ExecutiveSummaryComponent *component, - void *closure) -{ - GtkWidget *window, *label; - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - label = gtk_label_new ("This is a configuration dialog.\nNo it really is"); - - gtk_container_add (GTK_CONTAINER (window), label); - gtk_widget_show_all (window); -} - -static BonoboObject * -factory_fn (BonoboGenericFactory *_factory, - void *closure) -{ - ExecutiveSummaryComponent *component; - - /* Create an executive summary component for this factory */ - component = executive_summary_component_new (create_view, - configure, - NULL); - return BONOBO_OBJECT (component); -} - -void -test_service_factory_init (void) -{ - if (factory != NULL) - return; - - /* Register the factory creation function and the IID */ - factory = bonobo_generic_factory_new (TEST_SERVICE_ID, factory_fn, NULL); - if (factory == NULL) { - g_warning ("Cannot initialize test service"); - exit (0); - } -} - -int -main (int argc, char **argv) -{ - CORBA_ORB orb; - - /* Init GNOME, oaf and bonobo */ - gnome_init_with_popt_table ("Test service", VERSION, - argc, argv, oaf_popt_options, 0, NULL); - orb = oaf_init (argc, argv); - - if (bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) { - g_error ("Could not initialize Bonobo"); - } - - /* Register the factory */ - test_service_factory_init (); - - /* Enter main */ - bonobo_main (); - - return 0; -} - diff --git a/executive-summary/test-service/test-service.oafinfo b/executive-summary/test-service/test-service.oafinfo deleted file mode 100644 index 2c2329255d..0000000000 --- a/executive-summary/test-service/test-service.oafinfo +++ /dev/null @@ -1,27 +0,0 @@ -<oaf_info> - -<oaf_server iid="OAFIID:evolution-summary-component-factory:test-service:0ea887d5-622b-4b8c-b525-18aa1cbe18a6" - type="exe" - location="test-service"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME:GenericFactory:1.0"/> - </oaf_attribute> - - <oaf_attribute name="description" type="string" - value="Factory for the test component."/> -</oaf_server> - -<oaf_server iid="OAFIID:evolution-summary-component:test-service:d3cb3ed6-a654-4337-8aa0-f443751d6d1b" - type="factory" - location="OAFIID:evolution-summary-component-factory:test-service:0ea887d5-622b-4b8c-b525-18aa1cbe18a6"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:Evolution:SummaryComponent:1.0"/> - </oaf_attribute> - - <oaf_attribute name="description" type="string" - value="Test service"/> -</oaf_server> - -</oaf_info> |