예제 #1
0
static void
do_write (GAsyncReadyCallback callback, GTask *task, ConnectAsyncData *data)
{
  GOutputStream *out;
  out = g_io_stream_get_output_stream (data->io_stream);
  g_output_stream_write_async (out,
			       data->buffer + data->offset,
			       data->length - data->offset,
			       g_task_get_priority (task),
			       g_task_get_cancellable (task),
			       callback, task);
}
예제 #2
0
static void
do_read (GAsyncReadyCallback callback, GTask *task, ConnectAsyncData *data)
{
   GInputStream *in;
   in = g_io_stream_get_input_stream (data->io_stream);
   g_input_stream_read_async (in,
			      data->buffer + data->offset,
			      data->length - data->offset,
			      g_task_get_priority (task),
			      g_task_get_cancellable (task),
			      callback, task);
}
예제 #3
0
}

static void
cancel_output_stream (GtkSourceFileSaver *saver)
{
	GCancellable *cancellable;

	DEBUG ({
	       g_print ("Cancel output stream\n");
	});

	cancellable = g_cancellable_new ();
	g_cancellable_cancel (cancellable);

	g_output_stream_close_async (saver->priv->output_stream,
				     g_task_get_priority (saver->priv->task),
				     cancellable,
				     (GAsyncReadyCallback) cancel_output_stream_ready_cb,
				     saver);

	g_object_unref (cancellable);
}

/*
 * END NOTE
 */

static void
query_info_cb (GFile              *file,
	       GAsyncResult       *result,
	       GtkSourceFileSaver *saver)