/* * evolution-wizard.c * * Copyright (C) 2001 Ximian, Inc. * * Authors: Iain Holmes */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include "evolution-wizard.h" #include "Evolution.h" struct _EvolutionWizardPrivate { EvolutionWizardGetControlFn get_fn; BonoboEventSource *event_source; void *closure; int page_count; }; enum { NEXT, PREPARE, BACK, FINISH, CANCEL, HELP, LAST_SIGNAL }; #define PARENT_TYPE BONOBO_X_OBJECT_TYPE static GtkObjectClass *parent_class; static guint32 signals[LAST_SIGNAL] = { 0 }; static CORBA_long impl_GNOME_Evolution_Wizard__get_pageCount (PortableServer_Servant servant, CORBA_Environment *ev) { BonoboObject *bonobo_object; EvolutionWizard *wizard; EvolutionWizardPrivate *priv; bonobo_object = bonobo_object_from_servant (servant); wizard = EVOLUTION_WIZARD (bonobo_object); priv = wizard->priv; return priv->page_count; } static Bonobo_Control impl_GNOME_Evolution_Wizard_getControl (PortableServer_Servant servant, CORBA_long pagenumber, CORBA_Environment *ev) { BonoboObject *bonobo_object; EvolutionWizard *wizard; EvolutionWizardPrivate *priv; BonoboControl *control; bonobo_object = bonobo_object_from_servant (servant); wizard = EVOLUTION_WIZARD (bonobo_object); priv = wizard->priv; if (pagenumber < 0 || pagenumber >= priv->page_count) { CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Wizard_NoPage, NULL); return CORBA_OBJECT_NIL; } control = priv->get_fn (wizard, pagenumber, priv->closure); if (control == NULL) return CORBA_OBJECT_NIL; return (Bonobo_Control) CORBA_Object_duplicate (BONOBO_OBJREF (control), ev); } static void impl_GNOME_Evolution_Wizard_notifyAction (PortableServer_Servant servant, CORBA_long pagenumber, GNOME_Evolution_Wizard_Action action, CORBA_Environment *ev) { BonoboObject *bonobo_object; EvolutionWizard *wizard; EvolutionWizardPrivate *priv; bonobo_object = bonobo_object_from_servant (servant); wizard = EVOLUTION_WIZARD (bonobo_object); priv = wizard->priv; if (pagenumber < 0 || pagenumber >= priv->page_count) { CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Wizard_NoPage, NULL); return; } switch (action) { case GNOME_Evolution_Wizard_NEXT: gtk_signal_emit (GTK_OBJECT (bonobo_object), signals[NEXT], pagenumber); break; case GNOME_Evolution_Wizard_PREPARE: gtk_signal_emit (GTK_OBJECT (bonobo_object), signals[PREPARE], pagenumber); break; case GNOME_Evolution_Wizard_BACK: gtk_signal_emit (GTK_OBJECT (bonobo_object), signals[BACK], pagenumber); break; case GNOME_Evolution_Wizard_FINISH: gtk_signal_emit (GTK_OBJECT (bonobo_object), signals[FINISH], pagenumber); break; case GNOME_Evolution_Wizard_CANCEL: gtk_signal_emit (GTK_OBJECT (bonobo_object), signals[CANCEL], pagenumber); break; case GNOME_Evolution_Wizard_HELP: gtk_signal_emit (GTK_OBJECT (bonobo_object), signals[HELP], pagenumber); break; default: break; } } static void evolution_wizard_destroy (GtkObject *object) { EvolutionWizard *wizard; wizard = EVOLUTION_WIZARD (object); if (wizard->priv == NULL) { return; } g_free (wizard->priv); wizard->priv = NULL; parent_class->destroy (object); } static void evolution_wizard_class_init (EvolutionWizardClass *klass) { GtkObjectClass *object_class; POA_GNOME_Evolution_Wizard__epv *epv = &klass->epv; object_class = GTK_OBJECT_CLASS (klass); object_class->destroy = evolution_wizard_destroy; signals[NEXT] = gtk_signal_new ("next", GTK_RUN_FIRST, object_class->type, GTK_SIGNAL_OFFSET (EvolutionWizardClass, next), gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT); signals[PREPARE] = gtk_signal_new ("prepare", GTK_RUN_FIRST, object_class->type, GTK_SIGNAL_OFFSET (EvolutionWizardClass, prepare), gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT); signals[BACK] = gtk_signal_new ("back", GTK_RUN_FIRST, object_class->type, GTK_SIGNAL_OFFSET (EvolutionWizardClass, back), gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT); signals[FINISH] = gtk_signal_new ("finish", GTK_RUN_FIRST, object_class->type, GTK_SIGNAL_OFFSET (EvolutionWizardClass, finish), gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT); signals[CANCEL] = gtk_signal_new ("cancel", GTK_RUN_FIRST, object_class->type, GTK_SIGNAL_OFFSET (EvolutionWizardClass, cancel), gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT); signals[HELP] = gtk_signal_new ("help", GTK_RUN_FIRST, object_class->type, GTK_SIGNAL_OFFSET (EvolutionWizardClass, help), gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT); gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); parent_class = gtk_type_class (PARENT_TYPE); epv->_get_pageCount = impl_GNOME_Evolution_Wizard__get_pageCount; epv->getControl = impl_GNOME_Evolution_Wizard_getControl; epv->notifyAction = impl_GNOME_Evolution_Wizard_notifyAction; } static void evolution_wizard_init (EvolutionWizard *wizard) { wizard->priv = g_new0 (EvolutionWizardPrivate, 1); } BONOBO_X_TYPE_FUNC_FULL (EvolutionWizard, GNOME_Evolution_Wizard, PARENT_TYPE, evolution_wizard); EvolutionWizard * evolution_wizard_construct (EvolutionWizard *wizard, BonoboEventSource *event_source, EvolutionWizardGetControlFn get_fn, int num_pages, void *closure) { EvolutionWizardPrivate *priv; g_return_val_if_fail (BONOBO_IS_EVENT_SOURCE (event_source), NULL); g_return_val_if_fail (IS_EVOLUTION_WIZARD (wizard), NULL); priv = wizard->priv; priv->get_fn = get_fn; priv->page_count = num_pages; priv->closure = closure; priv->event_source = event_source; bonobo_object_add_interface (BONOBO_OBJECT (wizard), BONOBO_OBJECT (event_source)); return wizard; } EvolutionWizard * evolution_wizard_new_full (EvolutionWizardGetControlFn get_fn, int num_pages, BonoboEventSource *event_source, void *closure) { EvolutionWizard *wizard; g_return_val_if_fail (num_pages > 0, NULL); g_return_val_if_fail (BONOBO_IS_EVENT_SOURCE (event_source), NULL); wizard = gtk_type_new (evolution_wizard_get_type ()); return evolution_wizard_construct (wizard, event_source, get_fn, num_pages, closure); } EvolutionWizard * evolution_wizard_new (EvolutionWizardGetControlFn get_fn, int num_pages, void *closure) { BonoboEventSource *event_source; g_return_val_if_fail (num_pages > 0, NULL); event_source = bonobo_event_source_new (); return evolution_wizard_new_full (get_fn, num_pages, event_source, closure); } void evolution_wizard_set_buttons_sensitive (EvolutionWizard *wizard, gboolean back_sensitive, gboolean next_sensitive, gboolean cancel_sensitive, CORBA_Environment *opt_ev) { EvolutionWizardPrivate *priv; CORBA_Environment ev; CORBA_any any; CORBA_short s; g_return_if_fail (IS_EVOLUTION_WIZARD (wizard)); priv = wizard->priv; if (opt_ev == NULL) { CORBA_exception_init (&ev); } else { ev = *opt_ev; } s = back_sensitive << 2 | next_sensitive << 1 | cancel_sensitive; any._type = (CORBA_TypeCode) TC_short; any._value = &s; bonobo_event_source_notify_listeners (priv->event_source, EVOLUTION_WIZARD_SET_BUTTONS_SENSITIVE, &any, &ev); if (opt_ev == NULL && BONOBO_EX (&ev)) { g_warning ("ERROR(evolution_wizard_set_buttons_sensitive): %s", CORBA_exception_id (&ev)); } if (opt_ev == NULL) { CORBA_exception_free (&ev); } } void evolution_wizard_set_show_finish (EvolutionWizard *wizard, gboolean show_finish, CORBA_Environment *opt_ev) { EvolutionWizardPrivate *priv; CORBA_Environment ev; CORBA_any any; CORBA_boolean b; g_return_if_fail (IS_EVOLUTION_WIZARD (wizard)); priv = wizard->priv; if (opt_ev == NULL) { CORBA_exception_init (&ev); } else { ev = *opt_ev; } b = show_finish; any._type = (CORBA_TypeCode) TC_boolean; any._value = &b; bonobo_event_source_notify_listeners (priv->event_source, EVOLUTION_WIZARD_SET_SHOW_FINISH, &any, &ev); if (opt_ev == NULL && BONOBO_EX (&ev)) { g_warning ("ERROR(evolution_wizard_set_show_finish): %s", CORBA_exception_id (&ev)); } if (opt_ev == NULL) { CORBA_exception_free (&ev); } } void evolution_wizard_set_page (EvolutionWizard *wizard, int page_number, CORBA_Environment *opt_ev) { EvolutionWizardPrivate *priv; CORBA_Environment ev; CORBA_any any; CORBA_short s; g_return_if_fail (IS_EVOLUTION_WIZARD (wizard)); priv = wizard->priv; g_return_if_fail (page_number >= 0 && page_number < priv->page_count); if (opt_ev == NULL) { CORBA_exception_init (&ev); } else { ev = *opt_ev; } s = page_number; any._type = (CORBA_TypeCode) TC_short; any._value = &s; bonobo_event_source_notify_listeners (priv->event_source, EVOLUTION_WIZARD_SET_PAGE, &any, &ev); if (opt_ev == NULL && BONOBO_EX (&ev)) { g_warning ("ERROR(evolution_wizard_set_page): %s", CORBA_exception_id (&ev)); } if (opt_ev == NULL) { CORBA_exception_free (&ev); } } BonoboEventSource * evolution_wizard_get_event_source (EvolutionWizard *wizard) { g_return_val_if_fail (IS_EVOLUTION_WIZARD (wizard), NULL); return wizard->priv->event_source; } ove category pkg/COMMENT files in favour of a COMMENT variable in thekris2004-04-022-1/+2 * SIZEify (maintainer timeout)trevor2004-03-3112-0/+12 * Whoa there, boy, that's a mighty big commit y'all have there...ade2004-03-143-3/+3 * Update MASTER_SITES.petef2004-03-111-1/+1 * BROKEN on !i386: Does not compilekris2004-02-251-0/+4 * Correct error in previous commitkris2004-02-181-1/+1 * Remove BROKEN tag; this now compiles on 5.x.kris2004-02-181-6/+0 * Remove BROKEN tag; this port now compiles on 5.x.kris2004-02-181-4/+0 * [seems like when I thought I committed this first, I only committedfenner2004-02-082-6/+5 * Use PLIST_FILES (bento-tested, marcus-reviewed).trevor2004-02-0612-6/+6 * Use PLIST_FILES.trevor2004-02-062-1/+1 * Bump PORTREVISION on all ports that depend on gettext to aid with upgrading.marcus2004-02-045-1/+5 * Update tcl/tk dependency to 8.4.fenner2004-02-023-3/+14 * Upgrade rat to version 4.2.25.fenner2004-02-025-33/+12 * Update to sdr 3.0.fenner2004-02-023-14/+3 * SIZEify.trevor2004-01-303-0/+3 * Use the new ghostscript options.marcus2004-01-211-9/+3 * Add a dummy run-autotools target to pacify the new bsd.port.mk.marcus2004-01-201-0/+3 * Reset maintainer to ports@ due to maintainer's request -- he hasn'tlinimon2004-01-131-1/+1 * - Update to 2.99.1pav2004-01-0912-37/+189 * Add xspeakfree, a Tcl/Tk frontent to Speak Freely.pav2003-12-135-0/+56 * Mark as broken on 5.x due to the usual gcc3.3 bitrot.linimon2003-12-121-2/+8 * - Unbreak by adding dependency on makedepend.pav2003-11-211-0/+2 * Define USE_PERL5_BUILD, not erroneous USE_PERL.trevor2003-11-201-1/+1 * Define USE_PERL to make Perl available for (mostly deprecated)trevor2003-11-201-0/+1 * Add mcl 2.99,bms2003-11-1532-0/+560 * ports with possibly unreachable MAINTAINERsedwin2003-11-021-1/+1 * Move inclusion of bsd.port.pre.mk after definiton of all variables.linimon2003-10-295-24/+28 * Remove blank line to pacify portlint.linimon2003-10-221-1/+0 * Mark as broken on 5.x. Fix plist. Notified maintainer.linimon2003-10-222-2/+7 * Mark as broken on 5.x. The last distfile is from 1997. A google searchlinimon2003-10-221-2/+8 * Mark as broken on 5.x. The distfile is from 1997. While here, updatelinimon2003-10-222-1/+9 * Mark broken on 5.x. The distfile is from 1996 so updates might notlinimon2003-10-222-1/+9 * Make portlint(1) happy by changing strip to ${STRIP_CMD}osa2003-09-243-4/+4 * [PATCH] mbone/wb: enable choose of ghostscript interpreteredwin2003-08-311-1/+15 * Update to 7.6a.naddy2003-06-264-36/+43 * Undo an obsoleted patch to include <sys/soundcard.h> instead ofkris2003-05-101-3/+3 * Use -DAUDIO_BLOCKING. This should hopefully fix sfmike wedging and becomingadamw2003-03-241-1/+1 * Clear moonlight beckons.ade2003-03-0720-10/+10 * Remove RESTRICTED tag for crypto stuff.nork2003-02-232-3/+0 * De-pkg-comment.knu2003-02-214-2/+2 * De-pkg-comment.knu2003-02-214-2/+2 * Don't treat alpha specially with INT_64. INT_64 is not used consistentlyfenner2003-02-011-0/+15 * Make the struct huffentry public so that global variablesfenner2003-01-241-0/+16 * Use std::memset instead of just memsetfenner2003-01-241-0/+73 * Fix signal handler prototype to make newer g++ happyfenner2003-01-242-0/+18 * Build with tcl/tk 8.3fenner2003-01-242-37/+37 * Change of back-up location.orion2003-01-211-3/+3 * Partially fix build on sparc64 (Don't need to prototype inet_ntopkris2003-01-121-0/+13 * fix fetch for mbone/speak-freelyedwin2002-12-126-88/+54 * Fix fetcharved2002-12-111-1/+1 * Made mbone/rat compiling again (double patch-file)edwin2002-11-151-53/+0 * o Rollback PORTCOMMENT modifications while this feature's implementationlioux2002-11-114-4/+2 * Use PORTCOMMENT in the Makefile, and whack the pkg-comment.adamw2002-11-074-2/+4 * Change MAINTAINER to tmutoh@mx10.freecom.ne.jp.nork2002-10-271-1/+1 * Fix build on -current and respect CC and CFLAGSkris2002-10-215-72/+96 * MASTER_SITE moved. Upgrade still to do.fenner2002-10-081-1/+1 * Fix broken rtpmon build.fenner2002-09-303-12/+35 * Fix broken rqm port to work with more modern uclmmbasefenner2002-09-301-0/+18 * Fix build on -current (machine/soundcard.h -> sys/soundcard.h)kris2002-09-082-0/+22 * Update to version 4.2.22.orion2002-08-114-293/+8 * Bump PORTREVISION.jkoshy2002-06-131-0/+1 * Fix a bug that removes a startup problem with rtpmon, namely erroring outjkoshy2002-06-111-0/+10 * machine/soundcard.h -> sys/soundcard.hpetef2002-06-071-0/+5 * Support IPv6.sumikawa2002-03-244-2/+81 * Sync to rat-4.2.20.orion2002-02-259-168/+305 * Fix MASTER_SITES and remove redundant distinfo entrypat2002-02-082-2/+1 * Fix for autoconfpat2002-01-271-2/+2 * Fix for -CURRENT, malloc.h->stdlib.hpat2002-01-021-0/+4 * Set LATEST_LINK to rat30.knu2001-11-071-0/+2 * Sort entries and remove a duplicate "rqm".knu2001-09-211-2/+1 * Replace the ghostscript55 dependencies with ghostscript-gnu.knu2001-09-121-1/+1 * Make nte initialize TCL properly.fenner2001-08-021-0/+16 * Update to vic 2.8ucl-1.1.3fenner2001-08-0230-3415/+149 * New port for multicast AV tool.kiri2001-06-079-0/+113 * New port for RAT(network audio tool) version 3.kiri2001-06-0710-0/+199 * wb compatible open source shared whiteboard programassar2001-05-127-0/+90 * Update to rtptools 1.17fenner2001-04-225-52/+54 * Remove patch-agmharo2001-04-061-13/+0 * Fix buildmharo2001-04-062-10/+59 * Correct reversed patchmharo2001-04-061-4/+4 * Remove empty filemharo2001-04-061-0/+0 * Update to 4.2.13mharo2001-04-026-1085/+43 * Bump PORTREVISION to reflect Orion's fix for newpcm duplex and mixers.fenner2001-02-161-0/+1 * patch-ah: add Orion Hodson's full-duplex probing and AC97 fixfenner2001-02-155-110/+123