Package ch.bailu.gtk.gdk
Klasse ContentFormats
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.gdk.ContentFormats
- Alle implementierten Schnittstellen:
PointerInterface
Used to advertise and negotiate the format of content.
You will encounter `GdkContentFormats` when interacting with objects
controlling operations that pass data between different widgets, window
or application, like [class@Gdk.Drag], [class@Gdk.Drop],
[class@Gdk.Clipboard] or [class@Gdk.ContentProvider].
GDK supports content in 2 forms: `GType` and mime type.
Using `GTypes` is meant only for in-process content transfers. Mime types
are meant to be used for data passing both in-process and out-of-process.
The details of how data is passed is described in the documentation of
the actual implementations. To transform between the two forms,
[class@Gdk.ContentSerializer] and [class@Gdk.ContentDeserializer] are used.
A `GdkContentFormats` describes a set of possible formats content can be
exchanged in. It is assumed that this set is ordered. `GTypes` are more
important than mime types. Order between different `GTypes` or mime types
is the order they were added in, most important first. Functions that
care about order, such as [method@Gdk.ContentFormats.union], will describe
in their documentation how they interpret that order, though in general the
order of the first argument is considered the primary order of the result,
followed by the order of further arguments.
For debugging purposes, the function [method@Gdk.ContentFormats.to_string]
exists. It will print a comma-separated list of formats from most important
to least important.
`GdkContentFormats` is an immutable struct. After creation, you cannot change
the types it represents. Instead, new `GdkContentFormats` have to be created.
The [struct@Gdk.ContentFormatsBuilder] structure is meant to help in this
endeavor.
You will encounter `GdkContentFormats` when interacting with objects
controlling operations that pass data between different widgets, window
or application, like [class@Gdk.Drag], [class@Gdk.Drop],
[class@Gdk.Clipboard] or [class@Gdk.ContentProvider].
GDK supports content in 2 forms: `GType` and mime type.
Using `GTypes` is meant only for in-process content transfers. Mime types
are meant to be used for data passing both in-process and out-of-process.
The details of how data is passed is described in the documentation of
the actual implementations. To transform between the two forms,
[class@Gdk.ContentSerializer] and [class@Gdk.ContentDeserializer] are used.
A `GdkContentFormats` describes a set of possible formats content can be
exchanged in. It is assumed that this set is ordered. `GTypes` are more
important than mime types. Order between different `GTypes` or mime types
is the order they were added in, most important first. Functions that
care about order, such as [method@Gdk.ContentFormats.union], will describe
in their documentation how they interpret that order, though in general the
order of the first argument is considered the primary order of the result,
followed by the order of further arguments.
For debugging purposes, the function [method@Gdk.ContentFormats.to_string]
exists. It will print a comma-separated list of formats from most important
to least important.
`GdkContentFormats` is an immutable struct. After creation, you cannot change
the types it represents. Instead, new `GdkContentFormats` have to be created.
The [struct@Gdk.ContentFormatsBuilder] structure is meant to help in this
endeavor.
-
Feldübersicht
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungContentFormats
(PointerContainer pointer) ContentFormats
(Strs mime_types, int n_mime_types) Creates a new `GdkContentFormats` from an array of mime types. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
containGtype
(long type) Checks if a given `GType` is part of the given @formats.boolean
containMimeType
(Str mime_type) Checks if a given mime type is part of the given @formats.boolean
containMimeType
(String mime_type) Checks if a given mime type is part of the given @formats.static ClassHandler
static int
getMimeTypes
(Int64 n_mime_types) Gets the mime types included in @formats.static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
boolean
isEmpty()
Returns whether the content formats contain any formats.boolean
match
(ContentFormats second) Checks if @first and @second have any matching formats.long
matchGtype
(ContentFormats second) Finds the first `GType` from @first that is also contained
in @second.matchMimeType
(ContentFormats second) Finds the first mime type from @first that is also contained
in @second.static ContentFormats
newForGtypeContentFormats
(long type) Creates a new `GdkContentFormats` for a given `GType`.static ContentFormats
Parses the given @string into `GdkContentFormats` and
returns the formats.void
Prints the given @formats into a string for human consumption.ref()
Increases the reference count of a `GdkContentFormats` by one.toStr()
Prints the given @formats into a human-readable string.union
(ContentFormats second) Append all missing types from @second to @first, in the order
they had in @second.Add GTypes for mime types in @formats for which deserializers are
registered.Add mime types for GTypes in @formats for which deserializers are
registered.Add GTypes for the mime types in @formats for which serializers are
registered.Add mime types for GTypes in @formats for which serializers are
registered.void
unref()
Decreases the reference count of a `GdkContentFormats` by one.Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
ContentFormats
-
ContentFormats
Creates a new `GdkContentFormats` from an array of mime types.
The mime types must be valid and different from each other or the
behavior of the return value is undefined. If you cannot guarantee
this, use [struct@Gdk.ContentFormatsBuilder] instead.- Parameter:
mime_types
- Pointer to an array of mime typesn_mime_types
- number of entries in @mime_types.
-
-
Methodendetails
-
getClassHandler
-
newForGtypeContentFormats
Creates a new `GdkContentFormats` for a given `GType`.- Parameter:
type
- a `GType`- Gibt zurück:
- a new `GdkContentFormats`
-
containGtype
public boolean containGtype(long type) Checks if a given `GType` is part of the given @formats.- Parameter:
type
- the `GType` to search for- Gibt zurück:
- %TRUE if the `GType` was found
-
containMimeType
Checks if a given mime type is part of the given @formats.- Parameter:
mime_type
- the mime type to search for- Gibt zurück:
- %TRUE if the mime_type was found
-
containMimeType
Checks if a given mime type is part of the given @formats.- Parameter:
mime_type
- the mime type to search for- Gibt zurück:
- %TRUE if the mime_type was found
-
getMimeTypes
Gets the mime types included in @formats.
Note that @formats may not contain any mime types, in particular
when they are empty. In that case %NULL will be returned.- Parameter:
n_mime_types
- optional pointer to take the number of mime types contained in the return value- Gibt zurück:
- %NULL-terminated array of interned strings of mime types included in @formats
-
isEmpty
public boolean isEmpty()Returns whether the content formats contain any formats.- Gibt zurück:
- true if @formats contains no mime types and no GTypes
-
match
Checks if @first and @second have any matching formats.- Parameter:
second
- the `GdkContentFormats` to intersect with- Gibt zurück:
- %TRUE if a matching format was found.
-
matchGtype
Finds the first `GType` from @first that is also contained
in @second.
If no matching `GType` is found, %G_TYPE_INVALID is returned.- Parameter:
second
- the `GdkContentFormats` to intersect with- Gibt zurück:
- The first common `GType` or %G_TYPE_INVALID if none.
-
matchMimeType
Finds the first mime type from @first that is also contained
in @second.
If no matching mime type is found, %NULL is returned.- Parameter:
second
- the `GdkContentFormats` to intersect with- Gibt zurück:
- The first common mime type or %NULL if none
-
print
Prints the given @formats into a string for human consumption.
The result of this function can later be parsed with
[func@Gdk.ContentFormats.parse].- Parameter:
string
- a `GString` to print into
-
ref
Increases the reference count of a `GdkContentFormats` by one.- Gibt zurück:
- the passed in `GdkContentFormats`.
-
toStr
Prints the given @formats into a human-readable string.
The resulting string can be parsed with [func@Gdk.ContentFormats.parse].
This is a small wrapper around [method@Gdk.ContentFormats.print]
to help when debugging.- Gibt zurück:
- a new string
-
union
Append all missing types from @second to @first, in the order
they had in @second.- Parameter:
second
- the `GdkContentFormats` to merge from- Gibt zurück:
- a new `GdkContentFormats`
-
unionDeserializeGtypes
Add GTypes for mime types in @formats for which deserializers are
registered.- Gibt zurück:
- a new `GdkContentFormats`
-
unionDeserializeMimeTypes
Add mime types for GTypes in @formats for which deserializers are
registered.- Gibt zurück:
- a new `GdkContentFormats`
-
unionSerializeGtypes
Add GTypes for the mime types in @formats for which serializers are
registered.- Gibt zurück:
- a new `GdkContentFormats`
-
unionSerializeMimeTypes
Add mime types for GTypes in @formats for which serializers are
registered.- Gibt zurück:
- a new `GdkContentFormats`
-
unref
public void unref()Decreases the reference count of a `GdkContentFormats` by one.
If the resulting reference count is zero, frees the formats. -
parse
Parses the given @string into `GdkContentFormats` and
returns the formats.
Strings printed via [method@Gdk.ContentFormats.to_string]
can be read in again successfully using this function.
If @string does not describe valid content formats, %NULL
is returned.- Parameter:
string
- the string to parse- Gibt zurück:
- the content formats if @string is valid
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-