Beispiel #1
0
static void
impl_Bonobo_Listener_event (PortableServer_Servant servant, 
			    const CORBA_char      *event_name, 
			    const CORBA_any       *args, 
			    CORBA_Environment     *ev)
{
	BonoboListener *listener;

	listener = BONOBO_LISTENER (bonobo_object_from_servant (servant));

	bonobo_object_ref (BONOBO_OBJECT (listener));

	if (listener->priv->event_callback)
		bonobo_closure_invoke (
			listener->priv->event_callback,
			G_TYPE_NONE,
			BONOBO_TYPE_LISTENER,                       listener,
			G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE, event_name,
			BONOBO_TYPE_STATIC_CORBA_ANY,               args,
			BONOBO_TYPE_STATIC_CORBA_EXCEPTION,         ev,
			G_TYPE_INVALID);
		
	g_signal_emit (G_OBJECT (listener),
		       signals [EVENT_NOTIFY], 0,
		       event_name, args, ev);

	bonobo_object_unref (BONOBO_OBJECT (listener));
}
static void
impl_Bonobo_UIComponent_execVerb (PortableServer_Servant servant,
				  const CORBA_char      *cname,
				  CORBA_Environment     *ev)
{
	BonoboUIComponent *component;
	UIVerb *verb;

	component = bonobo_ui_from_servant (servant);

	bonobo_object_ref (BONOBO_OBJECT (component));
	
/*	g_warning ("TESTME: Exec verb '%s'", cname);*/

	verb = g_hash_table_lookup (component->priv->verbs, cname);
	if (verb && verb->closure)
		/* We need a funny arg order here - so for
		   our C closure we do odd things ! */
		bonobo_closure_invoke (
			verb->closure, G_TYPE_NONE,
			BONOBO_TYPE_UI_COMPONENT, component,
			G_TYPE_STRING, cname,
			G_TYPE_INVALID);
	else
		g_warning ("FIXME: verb '%s' not found, emit exception", cname);

	g_signal_emit (component, signals [EXEC_VERB], 0, cname);

	bonobo_object_unref (BONOBO_OBJECT (component));
}
Beispiel #3
0
GnoCamCamera *
gnocam_camera_new (Camera *camera, CORBA_Environment *ev)
{
	GnoCamCamera *gc;
	BonoboStorageCamera *storage;

	bonobo_return_val_if_fail (camera, NULL, ev);

	g_message ("Creating storage...");
	storage = bonobo_storage_camera_new (camera, "/",
					     Bonobo_Storage_READ |
					     Bonobo_Storage_WRITE, ev);
	if (BONOBO_EX (ev))
		return (NULL);

	gc = g_object_new (GNOCAM_TYPE_CAMERA, NULL);

	gc->camera = camera;
	gp_camera_ref (camera);

	g_message ("Adding interfaces...");
	bonobo_object_add_interface (BONOBO_OBJECT (gc),
				     BONOBO_OBJECT (storage));

	gc->priv->event_source = bonobo_event_source_new ();
	bonobo_object_add_interface (BONOBO_OBJECT (gc),
				     BONOBO_OBJECT (gc->priv->event_source));

	return (gc);
}
static BonoboObject*
bonobo_sample_moody_component_factory (BonoboGenericFactory* factory, void* data)
{
	GoodMood *good_mood = good_mood_new ();
	BadMood  *bad_mood  = bad_mood_new ();
	
	bonobo_object_add_interface
		(BONOBO_OBJECT(good_mood), BONOBO_OBJECT(bad_mood));
       
	return BONOBO_OBJECT (good_mood);
}
Beispiel #5
0
/**
 * bonobo_event_source_notify_listeners:
 * @event_source: the Event Source that will emit the event.
 * @event_name: Name of the event being emitted
 * @opt_value: A CORBA_any value that contains the data that is passed
 * to interested clients, or NULL for an empty value
 * @opt_ev: A CORBA_Environment where a failure code can be returned, can be NULL.
 *
 * This will notify all clients that have registered with this EventSource
 * (through the addListener or addListenerWithMask methods) of the availability
 * of the event named @event_name.  The @value CORBA::any value is passed to
 * all listeners.
 *
 * @event_name can not contain comma separators, as commas are used to
 * separate the various event names.
 */
void
bonobo_event_source_notify_listeners (BonoboEventSource *event_source,
                                      const char        *event_name,
                                      const CORBA_any   *opt_value,
                                      CORBA_Environment *opt_ev)
{
    GSList *l, *notify;
    CORBA_Environment  *ev, temp_ev;
    const BonoboArg *my_value;

    g_return_if_fail (BONOBO_IS_EVENT_SOURCE (event_source));

    if (!opt_ev) {
        CORBA_exception_init (&temp_ev);
        ev = &temp_ev;
    } else
        ev = opt_ev;

    if (!opt_value)
        my_value = bonobo_arg_new (BONOBO_ARG_NULL);
    else
        my_value = opt_value;

    notify = NULL;

    for (l = event_source->priv->listeners; l; l = l->next) {
        ListenerDesc *desc = (ListenerDesc *) l->data;

        if (desc->event_masks == NULL ||
                event_match (event_name, desc->event_masks)) {
            notify = g_slist_prepend (
                         notify,
                         CORBA_Object_duplicate (desc->listener, ev));
        }
    }

    bonobo_object_ref (BONOBO_OBJECT (event_source));

    for (l = notify; l; l = l->next) {
        Bonobo_Listener_event (l->data, event_name, my_value, ev);
        CORBA_Object_release (l->data, ev);
    }

    bonobo_object_unref (BONOBO_OBJECT (event_source));

    g_slist_free (notify);

    if (!opt_ev)
        CORBA_exception_free (ev);

    if (!opt_value)
        bonobo_arg_release ((BonoboArg *) my_value);
}
Beispiel #6
0
/* Factory function for the calendar component factory; just creates and
 * references a singleton service object.
 */
static BonoboObject *
comp_editor_factory_fn (void)
{
	if (!comp_editor_factory) {
		comp_editor_factory = comp_editor_factory_new ();
		if (!comp_editor_factory)
			return NULL;
	}

	bonobo_object_ref (BONOBO_OBJECT (comp_editor_factory));
	return BONOBO_OBJECT (comp_editor_factory);
}
static Bonobo_Control
impl__get_control (PortableServer_Servant servant,
		   CORBA_Environment *ev)
{
	EvolutionConfigControl *config_control;
	EvolutionConfigControlPrivate *priv;

	config_control = EVOLUTION_CONFIG_CONTROL (bonobo_object_from_servant (servant));
	priv = config_control->priv;

	bonobo_object_ref (BONOBO_OBJECT (priv->control));

	return CORBA_Object_duplicate (bonobo_object_corba_objref (BONOBO_OBJECT (priv->control)), ev);
}
/**
 * bonobo_ui_component_set_container:
 * @component: the component
 * @container: a remote container object.
 * 
 * This associates this @component with a remote @container
 * object.
 **/
void
bonobo_ui_component_set_container (BonoboUIComponent *component,
				   Bonobo_UIContainer container,
				   CORBA_Environment *opt_ev)
{
	Bonobo_UIContainer ref_cont;

	g_return_if_fail (BONOBO_IS_UI_COMPONENT (component));

	bonobo_object_ref (BONOBO_OBJECT (component));

	if (container != CORBA_OBJECT_NIL) {
		Bonobo_UIComponent corba_component;
		CORBA_Environment *ev, temp_ev;
		char              *name;
		
		if (!opt_ev) {
			CORBA_exception_init (&temp_ev);
			ev = &temp_ev;
		} else
			ev = opt_ev;

		ref_cont = CORBA_Object_duplicate (container, ev);

		corba_component = BONOBO_OBJREF (component);

		name = component->priv->name ? component->priv->name : "";

		Bonobo_UIContainer_registerComponent (
			ref_cont, name, corba_component, ev);

		if (!opt_ev && BONOBO_EX (ev)) {
			char *err;
			g_warning ("Serious exception registering component '%s'",
				   (err = bonobo_exception_get_text (ev)));
			g_free (err);
		}
		
		if (!opt_ev)
			CORBA_exception_free (&temp_ev);
	} else
		ref_cont = CORBA_OBJECT_NIL;

	bonobo_ui_component_unset_container (component, NULL);

	component->priv->container = ref_cont;

	bonobo_object_unref (BONOBO_OBJECT (component));
}
/**
 * bonobo_zoomable_frame_bind_to_zoomable:
 * @zoomable_frame: A BonoboZoomableFrame object.
 * @zoomable: The CORBA object for the BonoboZoomable embedded
 * in this BonoboZoomableFrame.
 *
 * Associates @zoomable with this @zoomable_frame.
 */
void
bonobo_zoomable_frame_bind_to_zoomable (BonoboZoomableFrame *zoomable_frame,
					Bonobo_Zoomable      zoomable,
					CORBA_Environment   *opt_ev)
{
	CORBA_Environment *ev, temp_ev;

	g_return_if_fail (zoomable != CORBA_OBJECT_NIL);
	g_return_if_fail (BONOBO_IS_ZOOMABLE_FRAME (zoomable_frame));

	if (zoomable_frame->priv->zoomable != CORBA_OBJECT_NIL)
		CORBA_Object_release (zoomable_frame->priv->zoomable, NULL);

	zoomable_frame->priv->zoomable = CORBA_Object_duplicate (zoomable, NULL);

	if (!opt_ev) {
		CORBA_exception_init (&temp_ev);
		ev = &temp_ev;
	} else
		ev = opt_ev;

	Bonobo_Zoomable_setFrame (zoomable, BONOBO_OBJREF (zoomable_frame), ev);

	if (BONOBO_EX (ev))
		bonobo_object_check_env (BONOBO_OBJECT (zoomable_frame), zoomable, ev);

	if (!opt_ev)
		CORBA_exception_free (&temp_ev);
}
Beispiel #10
0
SpiHyperlink *
spi_hyperlink_new (AtkHyperlink *object)
{
  SpiHyperlink *new_hyperlink = g_object_new (
	  SPI_HYPERLINK_TYPE, NULL);

  spi_base_construct (SPI_BASE (new_hyperlink), G_OBJECT(object));

  /* 
   * some hyperlinks are actionable... this is an ATK convention 
   * that seems convenient though possibly poorly documented or unintended.
   */
  if (ATK_IS_ACTION (object))
    {
      /* 
       * NOTE: we don't cast 'object' to ATK_OBJECT in the call to 
       * spi_action_interface_new(), because of the above convention, 
       * even though it means we may be violating the func prototype.
       * See discussion in bugzilla bug #120659.
       * !!!
       * IMPORTANT! The 'AtkObject' typecast, instead of the cast macro,
       * is used below, because 'object' may NOT really be an AtkObject;
       * it will be cast back to a G_OBJECT inside spi_action_interface_new
       * before use, so this is OK though very ropey coding style.
       */

	/* Don't aggregate action twice... if this is from AtkHyperlinkImpl */
	if (!bonobo_object_query_interface (bonobo_object (new_hyperlink), "IDL:Accessibility/Action:1.0",
					    NULL))
	    
	    bonobo_object_add_interface (bonobo_object (new_hyperlink),
					 BONOBO_OBJECT (spi_action_interface_new ((AtkObject *) object)));
    }
  return new_hyperlink;
}
static void
set_data (BonoboWidget *control, const char *string)
{
	Bonobo_PersistStream persist;
	BonoboObject *bstream;

	CORBA_Environment ev;

	persist = (Bonobo_PersistStream) Bonobo_Unknown_queryInterface (
		       bonobo_widget_get_objref (control), 
		       "IDL:Bonobo/PersistStream:1.0", &ev);
			
	if (persist == CORBA_OBJECT_NIL) {
			g_object_ref_sink (G_OBJECT (control));
			return ;
	}

	bstream = bonobo_stream_mem_create (string, strlen (string), TRUE, FALSE);

	CORBA_exception_init (&ev);
	Bonobo_PersistStream_load (persist, BONOBO_OBJREF (bstream),
				   "text/calendar", &ev);
	bonobo_object_unref (BONOBO_OBJECT (bstream));
	Bonobo_Unknown_unref (persist, &ev);
	CORBA_Object_release (persist, &ev);
}
BonoboObject *
gwget_application_server_new (GdkScreen *screen)
{
	BonoboGenericFactory *factory;
	char                 *display_name;
	char                 *registration_id;

	/* We must ensure an instance of gwget per screen
	 * as gwget has no multiscreen support 
	 */
	display_name = gdk_screen_make_display_name (screen);
	registration_id = bonobo_activation_make_registration_id (
					"OAFIID:GNOME_Gwget_Factory",
					display_name);
	
	factory = bonobo_generic_factory_new ("OAFIID:GNOME_Gwget_Factory",
					      gwget_application_server_factory,
					      NULL);
	
	if (!BONOBO_IS_GENERIC_FACTORY(factory))
			g_message("Cant create corba factory");
	
	g_free (display_name);
	g_free (registration_id);

	return BONOBO_OBJECT (factory);
}
static BonoboObject *
factory_fn (BonoboGenericFactory *factory,
	    void *closure)
{
	EvolutionShellComponent *shell_component;

	running_objects++;

	shell_component = evolution_shell_component_new (folder_types,
							 NULL,
							 create_view,
							 create_folder,
							 remove_folder,
							 xfer_folder, NULL,
							 NULL, NULL);

/* New Yank in the File-New menu */
/*  	evolution_shell_component_add_user_creatable_item (shell_component, "Yank", _("New Yank"), _("New _Yank"), 'y');  */
/* Connect a cb to this menu item */
/* 	gtk_signal_connect (GTK_OBJECT(shell_component), "user_create_new_item", */
/* 		GTK_SIGNAL_FUNC (user_create_new_item_cb), NULL); */

	gtk_signal_connect (GTK_OBJECT (shell_component), "destroy",
			    GTK_SIGNAL_FUNC (component_destroy), NULL);
	gtk_signal_connect (GTK_OBJECT (shell_component), "owner_set",
			    GTK_SIGNAL_FUNC (owner_set_cb), NULL);
	gtk_signal_connect (GTK_OBJECT (shell_component), "owner_unset",
			    GTK_SIGNAL_FUNC (owner_unset_cb), NULL);


	return BONOBO_OBJECT (shell_component);
}
static EvolutionShellComponentResult
create_view (EvolutionShellComponent *shell,
	     const char *physical_uri,
	     const char *folder_type,
	     BonoboControl **control_return,
	     void *closure)
{
	EvolutionShellClient *shell_client;
	GNOME_Evolution_Shell corba_shell;
	BonoboControl *control;

	puts("create view");

	if (g_strcasecmp (folder_type, YANK_TYPE) != 0) {
		return EVOLUTION_SHELL_COMPONENT_UNSUPPORTEDTYPE;
	}

	shell_client = evolution_shell_component_get_owner (shell);
	corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client));
	control = e_yank_factory_new_control (physical_uri, corba_shell);
	if (!control)
		return EVOLUTION_SHELL_COMPONENT_NOTFOUND;

	*control_return = control;


	return EVOLUTION_SHELL_COMPONENT_OK;
}
Beispiel #15
0
static void
peacock_file_control_construct (BonoboControl *control, GtkWidget *widget)
{
	PeacockFileControlData *cd;

	cd = peacock_file_control_data_new ();
	cd->control = control;
	cd->uiContainer = bonobo_control_get_remote_ui_container (cd->control,
								  NULL);

	/* Create the PeacockFile. */
	cd->file = peacock_file_new ();

	/* ...then the PeacockFileView */
	cd->view = PEACOCK_FILE_VIEW (peacock_file_view_new (cd->file, cd->uiContainer));
	gtk_box_pack_start_defaults (GTK_BOX (widget), GTK_WIDGET (cd->view));
	gtk_widget_show (GTK_WIDGET (cd->view));

	/* Add the Bonobo::PersistFile interface. */
	cd->persistFile = peacock_file_persist_file_new (cd->file);
	bonobo_object_add_interface (BONOBO_OBJECT (cd->control),
				     cd->persistFile);
	
	/* Load the menus and toolbars. */
	peacock_file_control_load_ui (control, cd);
	
	/* 
	 * Expose the GObject properties through the
	 * BonoboPropertyBag interface.
	 */
	peacock_file_control_add_property_bag (control, widget);

	return;
}
GList *
bonobo_zoomable_frame_get_preferred_zoom_level_names (BonoboZoomableFrame *zoomable_frame)
{
	CORBA_Environment ev;
	Bonobo_ZoomLevelNameList *zoom_level_names;
	GList *list = NULL;
	int i;

	g_return_val_if_fail (BONOBO_IS_ZOOMABLE_FRAME (zoomable_frame), NULL);

	CORBA_exception_init (&ev);

	zoom_level_names = Bonobo_Zoomable__get_preferredLevelNames (
		zoomable_frame->priv->zoomable, &ev);

	if (BONOBO_EX (&ev)) {
		bonobo_object_check_env (BONOBO_OBJECT (zoomable_frame),
					 zoomable_frame->priv->zoomable, &ev);
		CORBA_exception_free (&ev);
		return NULL;
	}
	CORBA_exception_free (&ev);

	if (zoom_level_names == CORBA_OBJECT_NIL)
		return NULL;

	for (i = 0; i < zoom_level_names->_length; i++)
		list = g_list_prepend (list, g_strdup (zoom_level_names->_buffer [i]));

	CORBA_free (zoom_level_names);

	return g_list_reverse (list);
}
Beispiel #17
0
Bonobo_Listener
bonobo_event_source_client_add_listener_full (Bonobo_Unknown     object,
        GClosure          *event_callback,
        const char        *opt_mask,
        CORBA_Environment *opt_ev)
{
    BonoboListener    *listener = NULL;
    Bonobo_Listener    corba_listener = CORBA_OBJECT_NIL;
    Bonobo_Unknown     es;
    CORBA_Environment *ev, temp_ev;

    g_return_val_if_fail (event_callback != NULL, CORBA_OBJECT_NIL);

    if (!opt_ev) {
        ev = &temp_ev;
        CORBA_exception_init (ev);
    } else
        ev = opt_ev;

    es = Bonobo_Unknown_queryInterface (object,
                                        "IDL:Bonobo/EventSource:1.0", ev);

    if (BONOBO_EX (ev) || !es)
        goto add_listener_end;

    if (!(listener = bonobo_listener_new_closure (event_callback)))
        goto add_listener_end;

    corba_listener = BONOBO_OBJREF (listener);

    if (opt_mask)
        Bonobo_EventSource_addListenerWithMask (
            es, corba_listener, opt_mask, ev);
    else
        Bonobo_EventSource_addListener (
            es, corba_listener, ev);

    corba_listener = CORBA_Object_duplicate (corba_listener, ev);

    bonobo_object_unref (BONOBO_OBJECT (listener));

    bonobo_object_release_unref (es, ev);

add_listener_end:

    if (!opt_ev) {
        if (BONOBO_EX (ev)) {
            char *text = bonobo_exception_get_text (ev);
            g_warning ("add_listener failed '%s'", text);
            g_free (text);
        }
        CORBA_exception_free (ev);
    }

    return corba_listener;
}
Beispiel #18
0
static BonoboObject *
gth_application_factory (BonoboGenericFactory *this_factory,
			 const char           *iid,
			 gpointer              user_data)
{
	if (strcmp (iid, "OAFIID:GNOME_GThumb_Application") != 0)
		return NULL;
	else
		return BONOBO_OBJECT (g_object_new (GTH_TYPE_APPLICATION, NULL));
}
static void
impl_Bonobo_UIComponent_uiEvent (PortableServer_Servant             servant,
				 const CORBA_char                  *id,
				 const Bonobo_UIComponent_EventType type,
				 const CORBA_char                  *state,
				 CORBA_Environment                 *ev)
{
	BonoboUIComponent *component;

	component = bonobo_ui_from_servant (servant);

/*	g_warning ("TESTME: Event '%s' '%d' '%s'\n", path, type, state);*/

	bonobo_object_ref (BONOBO_OBJECT (component));

	g_signal_emit (component, signals [UI_EVENT], 0, id, type, state);

	bonobo_object_unref (BONOBO_OBJECT (component));
}
/**
 * bonobo_ui_component_unset_container:
 * @component: the component
 * 
 * This dis-associates the @component from its associated
 * #BonoboUIContainer.
 **/
void
bonobo_ui_component_unset_container (BonoboUIComponent *component,
				     CORBA_Environment *opt_ev)
{
	Bonobo_UIContainer container;

	g_return_if_fail (BONOBO_IS_UI_COMPONENT (component));

	bonobo_object_ref (BONOBO_OBJECT (component));

	container = component->priv->container;
	component->priv->container = CORBA_OBJECT_NIL;

	if (container != CORBA_OBJECT_NIL) {
		CORBA_Environment *ev, temp_ev;
		char              *name;
		
		if (!opt_ev) {
			CORBA_exception_init (&temp_ev);
			ev = &temp_ev;
		} else
			ev = opt_ev;

		name = component->priv->name ? component->priv->name : "";

		Bonobo_UIContainer_deregisterComponent (container, name, ev);
		
		if (!opt_ev && BONOBO_EX (ev)) {
			char *err;
			g_warning ("Serious exception deregistering component '%s'",
				   (err = bonobo_exception_get_text (ev)));
			g_free (err);
		}

		CORBA_Object_release (container, ev);

		if (!opt_ev)
			CORBA_exception_free (&temp_ev);
	}

	bonobo_object_unref (BONOBO_OBJECT (component));
}
Beispiel #21
0
static void
test_exit (TestGnomeApp *app)
{
	bonobo_object_unref (BONOBO_OBJECT (app->ui_component));

	gtk_widget_destroy (app->app);
	
	g_free (app);

	gtk_main_quit ();
}
static void
run_tests (void)
{
	BonoboEventSource *es;
	CORBA_Environment ev;
	CORBA_any *value;
	char *mask;

	CORBA_exception_init (&ev);

	g_source_remove (idle_id);

	value = bonobo_arg_new (BONOBO_ARG_LONG);

	es = bonobo_event_source_new ();
	g_assert (es != NULL);
	
	mask = "a/test";
	bonobo_event_source_client_add_listener (BONOBO_OBJREF (es), event_cb, mask, &ev, mask);

	mask = "=a/test";
	bonobo_event_source_client_add_listener (BONOBO_OBJREF (es), event_cb, mask, &ev, mask);
	
	bonobo_event_source_notify_listeners (es, "a/test", value, &ev); 
	CHECK_RESULT (&ev, 2, 1);

	bonobo_event_source_notify_listeners (es, "a/test/xyz", value, &ev); 
	CHECK_RESULT (&ev, 3, 1);

	bonobo_event_source_notify_listeners (es, "a/tes", value, &ev); 
	CHECK_RESULT (&ev, 3, 1);

	bonobo_event_source_notify_listeners (es, "test", value, &ev); 
	CHECK_RESULT (&ev, 3, 1);

	bonobo_event_source_notify_listeners (es, "a/test", value, &ev); 
	CHECK_RESULT (&ev, 5, 2);
	
	bonobo_event_source_notify_listeners (es, "a/test:", value, &ev); 
	CHECK_RESULT (&ev, 6, 2);

	bonobo_event_source_notify_listeners (es, "a/test:xyz", value, &ev); 
	CHECK_RESULT (&ev, 7, 2);

	bonobo_event_source_notify_listeners (es, "a/", value, &ev); 
	CHECK_RESULT (&ev, 7, 2);

	bonobo_event_source_notify_listeners (es, "a/test1:xyz", value, &ev); 
	CHECK_RESULT (&ev, 8, 2);

	bonobo_object_unref (BONOBO_OBJECT (es));

	bonobo_main_quit ();
}
static BonoboObject *
gwget_application_server_factory (BonoboGenericFactory *this_factory,
			   const char *iid,
			   gpointer user_data)
{
        GwgetApplicationServer *a;
        
        a  = g_object_new (GWGET_APPLICATION_SERVER_TYPE, NULL);

		return BONOBO_OBJECT (a);
}
static BonoboObject *
stardict_application_server_factory (BonoboGenericFactory *this_factory,
			   const char *iid,
			   gpointer user_data)
{
        StardictApplicationServer *a;
        
        a  = (StardictApplicationServer *)g_object_new (STARDICT_APPLICATION_SERVER_TYPE, NULL);

        return BONOBO_OBJECT (a);
}
/**
 * bonobo_ui_component_add_verb_list_with_data:
 * @component: the component
 * @list: the list of verbs
 * @user_data: the user data passed to the verb callbacks
 * 
 * This is a helper function to save registering verbs individualy
 * it allows registration of a great batch of verbs at one time
 * in a list of #BonoboUIVerb terminated by #BONOBO_UI_VERB_END
 **/
void
bonobo_ui_component_add_verb_list_with_data (BonoboUIComponent  *component,
					     const BonoboUIVerb *list,
					     gpointer            user_data)
{
	const BonoboUIVerb *l;

	g_return_if_fail (list != NULL);
	g_return_if_fail (BONOBO_IS_UI_COMPONENT (component));

	bonobo_object_ref (BONOBO_OBJECT (component));

	for (l = list; l && l->cname; l++) {
		bonobo_ui_component_add_verb (
			component, l->cname, l->cb,
			user_data ? user_data : l->user_data);
	}

	bonobo_object_unref (BONOBO_OBJECT (component));
}
static void
impl_dispose (GObject *object)
{
	EvolutionConfigControl *config_control;
	EvolutionConfigControlPrivate *priv;

	config_control = EVOLUTION_CONFIG_CONTROL (object);
	priv = config_control->priv;

	if (priv->control != NULL) {
		bonobo_object_unref (BONOBO_OBJECT (priv->control));
		priv->control = NULL;
	}

	if (priv->event_source != NULL) {
		bonobo_object_unref (BONOBO_OBJECT (priv->event_source));
		priv->event_source = NULL;
	}

	(* G_OBJECT_CLASS (parent_class)->dispose) (object);
}
BonoboControl *
itip_bonobo_control_new (void)
{
	BonoboControl *control;
	BonoboPropertyBag *prop_bag;
	BonoboPersistStream *stream;
	GtkWidget *itip;

	itip = e_itip_control_new ();
	gtk_widget_show (itip);
	control = bonobo_control_new (itip);

	/* create a property bag */
	prop_bag = bonobo_property_bag_new (get_prop, set_prop, itip);
	bonobo_property_bag_add (prop_bag, "from_address", FROM_ADDRESS_ARG_ID, BONOBO_ARG_STRING, NULL,
				 "from_address", 0 );
	bonobo_property_bag_add (prop_bag, "view_only", VIEW_ONLY_ARG_ID, BONOBO_ARG_INT, NULL,
				 "view_only", 0 );

	bonobo_control_set_properties (control, bonobo_object_corba_objref (BONOBO_OBJECT (prop_bag)), NULL);
	bonobo_object_unref (BONOBO_OBJECT (prop_bag));

	bonobo_control_set_automerge (control, TRUE);

	stream = bonobo_persist_stream_new (pstream_load, pstream_save,
					    pstream_get_content_types,
					    "OAFIID:GNOME_Evolution_Calendar_iTip_Control:" BASE_VERSION,
					    itip);

	if (stream == NULL) {
		bonobo_object_unref (BONOBO_OBJECT (control));
		return NULL;
	}

	bonobo_object_add_interface (BONOBO_OBJECT (control),
				     BONOBO_OBJECT (stream));

	return control;
}
void
bonobo_zoomable_frame_set_zoom_level (BonoboZoomableFrame *zoomable_frame, float zoom_level)
{
	CORBA_Environment ev;

	g_return_if_fail (BONOBO_IS_ZOOMABLE_FRAME (zoomable_frame));

	CORBA_exception_init (&ev);
	Bonobo_Zoomable_setLevel (zoomable_frame->priv->zoomable, zoom_level, &ev);
	bonobo_object_check_env (BONOBO_OBJECT (zoomable_frame),
				 zoomable_frame->priv->zoomable, &ev);
	CORBA_exception_free (&ev);
}
static BonoboObject *
bonobo_shlib_factory_new_generic (BonoboGenericFactory *factory,
				  const char           *act_iid)
{
	BonoboObject *retval;

	retval = BONOBO_GENERIC_FACTORY_CLASS (
		bonobo_shlib_factory_parent_class)->new_generic (factory, act_iid);

	/* The factory reference doesn't persist inside bonobo-activation */
	bonobo_object_unref (BONOBO_OBJECT (factory));

	return retval;
}
void
bonobo_zoomable_frame_zoom_to_default (BonoboZoomableFrame *zoomable_frame)
{
	CORBA_Environment ev;

	g_return_if_fail (BONOBO_IS_ZOOMABLE_FRAME (zoomable_frame));
	g_return_if_fail (zoomable_frame->priv->zoomable != CORBA_OBJECT_NIL);

	CORBA_exception_init (&ev);
	Bonobo_Zoomable_zoomDefault (zoomable_frame->priv->zoomable, &ev);
	bonobo_object_check_env (BONOBO_OBJECT (zoomable_frame),
				 zoomable_frame->priv->zoomable, &ev);
	CORBA_exception_free (&ev);
}