Package ch.bailu.gtk.gdk
Class ContentSerializer
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gdk.ContentSerializer
- All Implemented Interfaces:
PointerInterface
A `GdkContentSerializer` is used to serialize content for
inter-application data transfers.
The `GdkContentSerializer` transforms an object that is identified
by a GType into a serialized form (i.e. a byte stream) that is
identified by a mime type.
GTK provides serializers and deserializers for common data types
such as text, colors, images or file lists. To register your own
serialization functions, use [func@Gdk.content_register_serializer].
Also see [class@Gdk.ContentDeserializer].
inter-application data transfers.
The `GdkContentSerializer` transforms an object that is identified
by a GType into a serialized form (i.e. a byte stream) that is
identified by a mime type.
GTK provides serializers and deserializers for common data types
such as text, colors, images or file lists. To register your own
serialization functions, use [func@Gdk.content_register_serializer].
Also see [class@Gdk.ContentDeserializer].
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionImplements interfaceAsyncResult
.Gets the cancellable for the current operation.static ClassHandler
long
getGtype()
Gets the `GType` to of the object to serialize.static int
Gets the mime type to serialize to.Gets the output stream for the current operation.static long
static TypeSystem.TypeSize
int
Gets the I/O priority for the current operation.Gets the data that was associated with the current operation.static long
static TypeSystem.TypeSize
Gets the user data that was passed when the serializer was registered.getValue()
Gets the `GValue` to read the object to serialize from.void
returnError
(Error error) Indicate that the serialization has ended with an error.void
Indicate that the serialization has been successfully completed.void
setTaskData
(Pointer data, ContentSerializer.OnDestroyNotify notify) Associate data with the current serialization operation.Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
ContentSerializer
-
-
Method Details
-
getClassHandler
-
getCancellable
Gets the cancellable for the current operation.
This is the `GCancellable` that was passed to [func@content_serialize_async].- Returns:
- the cancellable for the current operation
-
getGtype
public long getGtype()Gets the `GType` to of the object to serialize.- Returns:
- the `GType` for the current operation
-
getMimeType
Gets the mime type to serialize to.- Returns:
- the mime type for the current operation
-
getOutputStream
Gets the output stream for the current operation.
This is the stream that was passed to [func@content_serialize_async].- Returns:
- the output stream for the current operation
-
getPriority
public int getPriority()Gets the I/O priority for the current operation.
This is the priority that was passed to [func@content_serialize_async].- Returns:
- the I/O priority for the current operation
-
getTaskData
Gets the data that was associated with the current operation.
See [method@Gdk.ContentSerializer.set_task_data].- Returns:
- the task data for @serializer
-
getUserData
Gets the user data that was passed when the serializer was registered.- Returns:
- the user data for this serializer
-
getValue
Gets the `GValue` to read the object to serialize from.- Returns:
- the `GValue` for the current operation
-
returnError
Indicate that the serialization has ended with an error.
This function consumes @error.- Parameters:
error
- a `GError`
-
returnSuccess
public void returnSuccess()Indicate that the serialization has been successfully completed. -
setTaskData
Associate data with the current serialization operation.- Parameters:
data
- data to associate with this operationnotify
- destroy notify for @data
-
asAsyncResult
Implements interfaceAsyncResult
. Call this to get access to interface functions.- Returns:
AsyncResult
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-