예제 #1
0
static EComponentInfo *
component_info_new (const char *id,
		    GNOME_Evolution_Component iface,
		    const char *alias,
		    const char *button_label,
	  	    const char *button_tooltips,
		    const char *menu_label,
		    const char *menu_accelerator,
		    int sort_order,
		    GdkPixbuf *button_icon,
		    GdkPixbuf *menu_icon)
{
	EComponentInfo *info = g_new0 (EComponentInfo, 1);

	info->id = g_strdup (id);
	info->iface = bonobo_object_dup_ref(iface, NULL);
	info->alias = g_strdup (alias);
	info->button_label = g_strdup (button_label);
	info->button_tooltips = g_strdup (button_tooltips);
	info->menu_label = g_strdup (menu_label);
	info->menu_accelerator = g_strdup (menu_accelerator);
	info->sort_order = sort_order;

	info->button_icon = button_icon;
	if (info->button_icon)
		g_object_ref (info->button_icon);

	info->menu_icon = menu_icon;
	if (info->menu_icon)
		g_object_ref (info->menu_icon);

	return info;
}
예제 #2
0
static void
impl_Bonobo_EventSource_addListenerWithMask (PortableServer_Servant servant,
        const Bonobo_Listener  l,
        const CORBA_char      *event_mask,
        CORBA_Environment     *ev)
{
    BonoboEventSource *event_source;
    ListenerDesc      *desc;

    g_return_if_fail (l != CORBA_OBJECT_NIL);

    event_source = bonobo_event_source_from_servant (servant);

    if (event_source->priv->ignore) /* Hook for running context */
        bonobo_running_context_ignore_object (l);

    desc = g_new0 (ListenerDesc, 1);
    desc->listener = bonobo_object_dup_ref (l, ev);

    if (event_mask)
        desc->event_masks = g_strsplit (event_mask, ",", 0);

    event_source->priv->listeners = g_slist_prepend (
                                        event_source->priv->listeners, desc);
}
예제 #3
0
파일: gnocam-main.c 프로젝트: rajbot/gphoto
static void
impl_GNOME_GnoCam_getCamera (PortableServer_Servant servant,
			     Bonobo_Listener listener, CORBA_Environment *ev)
{
	IdleData *d;

	d = g_new0 (IdleData, 1);
	d->gm = GNOCAM_MAIN (bonobo_object_from_servant (servant));
	bonobo_object_ref (d->gm);
	d->listener = bonobo_object_dup_ref (listener, NULL);

	g_message ("Adding idle function...");
	g_idle_add (get_camera_idle, d);
}
예제 #4
0
GNOME_Evolution_Component
e_component_registry_activate (EComponentRegistry *registry,
			       const char *id,
			       CORBA_Environment  *ev)
{
	EComponentInfo *info;

	g_return_val_if_fail (E_IS_COMPONENT_REGISTRY (registry), CORBA_OBJECT_NIL);

	info = e_component_registry_peek_info (registry, ECR_FIELD_ID, id);
	if (info == NULL) {
		g_warning ("%s - Unknown id \"%s\"", G_STRFUNC, id);
		return CORBA_OBJECT_NIL;
	}

	/* it isn't in the registry unless it is already activated */
	return bonobo_object_dup_ref (info->iface, NULL);
}
예제 #5
0
파일: gnocam-main.c 프로젝트: rajbot/gphoto
static void
impl_GNOME_GnoCam_getCameraByModelAndPort (
		PortableServer_Servant servant, 
		Bonobo_Listener listener,
		const CORBA_char *model, const CORBA_char *port,
		CORBA_Environment *ev)
{
	IdleData *d;
	
	d = g_new0 (IdleData, 1);
	d->model = CORBA_string_dup (model);
	d->port = CORBA_string_dup (port);
	d->gm = GNOCAM_MAIN (bonobo_object_from_servant (servant));
	bonobo_object_ref (d->gm);
	d->listener = bonobo_object_dup_ref (listener, NULL);

	g_message ("Adding idle function...");
	g_idle_add (get_camera_idle, d);
}
static void
e_cal_view_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
{
	ECalView *view;
	ECalViewPrivate *priv;

	view = E_CAL_VIEW (object);
	priv = view->priv;

	switch (property_id) {
	case PROP_VIEW:
		if (priv->view != CORBA_OBJECT_NIL)
			bonobo_object_release_unref (priv->view, NULL);

		priv->view = bonobo_object_dup_ref (g_value_get_pointer (value), NULL);
		break;
	case PROP_LISTENER:
		if (priv->listener) {
			g_signal_handlers_disconnect_matched (priv->listener, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, view);
			bonobo_object_unref (BONOBO_OBJECT (priv->listener));
		}

		priv->listener = bonobo_object_ref (g_value_get_pointer (value));

		g_signal_connect (G_OBJECT (priv->listener), "objects_added",
				  G_CALLBACK (objects_added_cb), view);
		g_signal_connect (G_OBJECT (priv->listener), "objects_modified",
				  G_CALLBACK (objects_modified_cb), view);
		g_signal_connect (G_OBJECT (priv->listener), "objects_removed",
				  G_CALLBACK (objects_removed_cb), view);
		g_signal_connect (G_OBJECT (priv->listener), "view_progress",
				  G_CALLBACK (view_progress_cb), view);
		g_signal_connect (G_OBJECT (priv->listener), "view_done",
				  G_CALLBACK (view_done_cb), view);
		break;
	case PROP_CLIENT:
		priv->client = E_CAL (g_value_dup_object (value));
		break;
	default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}
예제 #7
0
파일: application.c 프로젝트: GNOME/at-spi
static void
notify_listeners (GList *listeners, SpiAccessible *source, Accessibility_Event *e)
{
  GList *l;
  CORBA_Environment ev;

  CORBA_exception_init (&ev);

  for (l = listeners; l; l = l->next)
    {
      Accessibility_EventListener listener = l->data;

      e->source = bonobo_object_dup_ref (BONOBO_OBJREF (source), &ev);

      Accessibility_EventListener_notifyEvent (listener, e, &ev);
      /*
       * when this (oneway) call completes, the CORBA refcount and
       * Bonobo_Unknown refcount will be decremented by the recipient
       */
      CORBA_exception_free (&ev);
    }
}