Top |
Functions
void | (*GdkContentSerializeFunc) () |
const char * | gdk_content_serializer_get_mime_type () |
GType | gdk_content_serializer_get_gtype () |
const GValue * | gdk_content_serializer_get_value () |
GOutputStream * | gdk_content_serializer_get_output_stream () |
int | gdk_content_serializer_get_priority () |
GCancellable * | gdk_content_serializer_get_cancellable () |
gpointer | gdk_content_serializer_get_user_data () |
void | gdk_content_serializer_set_task_data () |
gpointer | gdk_content_serializer_get_task_data () |
void | gdk_content_serializer_return_success () |
void | gdk_content_serializer_return_error () |
void | gdk_content_register_serializer () |
void | gdk_content_serialize_async () |
gboolean | gdk_content_serialize_finish () |
Description
A GdkContentSerializer is used to serialize content for inter-application data transfers.
Functions
GdkContentSerializeFunc ()
void
(*GdkContentSerializeFunc) (GdkContentSerializer *serializer
);
The type of a function that can be registered with gdk_content_register_serializer()
.
When the function gets called to operate on content, it can call functions on the
serializer
object to obtain the mime type, output stream, user data, etc. for its
operation.
gdk_content_serializer_get_mime_type ()
const char *
gdk_content_serializer_get_mime_type (GdkContentSerializer *serializer
);
Gets the mime type to serialize to.
gdk_content_serializer_get_gtype ()
GType
gdk_content_serializer_get_gtype (GdkContentSerializer *serializer
);
Gets the GType to of the object to serialize.
gdk_content_serializer_get_value ()
const GValue *
gdk_content_serializer_get_value (GdkContentSerializer *serializer
);
Gets the GValue to read the object to serialize from.
gdk_content_serializer_get_output_stream ()
GOutputStream *
gdk_content_serializer_get_output_stream
(GdkContentSerializer *serializer
);
Gets the output stream that was passed to gdk_content_serialize_async()
.
gdk_content_serializer_get_priority ()
int
gdk_content_serializer_get_priority (GdkContentSerializer *serializer
);
Gets the io priority that was passed to gdk_content_serialize_async()
.
gdk_content_serializer_get_cancellable ()
GCancellable *
gdk_content_serializer_get_cancellable
(GdkContentSerializer *serializer
);
Gets the cancellable that was passed to gdk_content_serialize_async()
.
gdk_content_serializer_get_user_data ()
gpointer
gdk_content_serializer_get_user_data (GdkContentSerializer *serializer
);
Gets the user data that was passed when the serializer was registered.
gdk_content_serializer_set_task_data ()
void gdk_content_serializer_set_task_data (GdkContentSerializer *serializer
,gpointer data
,GDestroyNotify notify
);
Associate data with the current serialization operation.
gdk_content_serializer_get_task_data ()
gpointer
gdk_content_serializer_get_task_data (GdkContentSerializer *serializer
);
Gets the data that was associated with serializer
via gdk_content_serializer_set_task_data()
.
gdk_content_serializer_return_success ()
void
gdk_content_serializer_return_success (GdkContentSerializer *serializer
);
Indicate that the serialization has been successfully completed.
gdk_content_serializer_return_error ()
void gdk_content_serializer_return_error (GdkContentSerializer *serializer
,GError *error
);
Indicate that the serialization has ended with an error.
This function consumes error
.
gdk_content_register_serializer ()
void gdk_content_register_serializer (GType type
,const char *mime_type
,GdkContentSerializeFunc serialize
,gpointer data
,GDestroyNotify notify
);
Registers a function to convert objects of the given type
to
a serialized representation with the given mime type.
gdk_content_serialize_async ()
void gdk_content_serialize_async (GOutputStream *stream
,const char *mime_type
,const GValue *value
,int io_priority
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Serialize content and write it to the given output stream, asynchronously.
When the operation is finished, callback
will be called. You can then
call gdk_content_serialize_finish()
to get the result of the operation.
Parameters
stream |
a GOutputStream to write the serialized content to |
|
mime_type |
the mime type to serialize to |
|
value |
the content to serialize |
|
io_priority |
the io priority of the operation |
|
cancellable |
optional GCancellable object. |
[nullable] |
callback |
callback to call when the operation is done. |
[scope async] |
user_data |
data to pass to the callback function. |
[closure] |