Пример #1
0
static void
pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream,
	      Bonobo_Persist_ContentType type, void *data,
	      CORBA_Environment *ev)
{
	EItipControl *itip = data;
	idle_data *id;

	if (type && g_ascii_strcasecmp (type, "text/calendar") != 0 &&
	    g_ascii_strcasecmp (type, "text/x-calendar") != 0) {
		bonobo_exception_set (ev, ex_Bonobo_Persist_WrongDataType);
		return;
	}

	id = g_new0 (idle_data, 1);
	if ((id->text = stream_read (stream)) == NULL) {
		bonobo_exception_set (ev, ex_Bonobo_Persist_FileNotFound);
		g_free (id);
		return;
	}
	g_object_ref (itip);
	id->itip = itip;

	g_idle_add (set_data_idle_cb, id);
}
Пример #2
0
/*
 * This function implements the Bonobo::PersistStream:save method.
 */
static void
pstream_save (BonoboPersistStream *ps, const Bonobo_Stream stream,
	      Bonobo_Persist_ContentType type, void *data,
	      CORBA_Environment *ev)
{
	EItipControl *itip = data;
	gchar *text;
	gint len;

	if (type && g_ascii_strcasecmp (type, "text/calendar") != 0 &&
	    g_ascii_strcasecmp (type, "text/x-calendar") != 0) {
		bonobo_exception_set (ev, ex_Bonobo_Persist_WrongDataType);
		return;
	}

	text = e_itip_control_get_data (itip);
	len = e_itip_control_get_data_size (itip);

	bonobo_stream_client_write (stream, text, len, ev);
	g_free (text);
} /* pstream_save */
Пример #3
0
static void
get_prop (BonoboPropertyBag *bag,
	  BonoboArg         *arg,
	  guint              arg_id,
	  CORBA_Environment *ev,
	  gpointer           user_data)
{
	PropData *pd = user_data;

	switch (arg_id) {
	case PROP_BOOLEAN_TEST:
		BONOBO_ARG_SET_BOOLEAN (arg, pd->b);
		break;

	case PROP_INTEGER_TEST:
		BONOBO_ARG_SET_INT (arg, pd->i);
		break;

	case PROP_LONG_TEST:
		BONOBO_ARG_SET_LONG (arg, pd->l);
		break;

	case PROP_FLOAT_TEST:
		BONOBO_ARG_SET_FLOAT (arg, pd->f);
		break;

	case PROP_DOUBLE_TEST:
		BONOBO_ARG_SET_DOUBLE (arg, pd->d);
		break;

	case PROP_STRING_TEST:
		BONOBO_ARG_SET_STRING (arg, pd->s);
		break;

	default:
		bonobo_exception_set (ev, ex_Bonobo_PropertyBag_NotFound);
	};
}