Package ch.bailu.gtk.gio
Klasse Icon
- Alle implementierten Schnittstellen:
PointerInterface
`GIcon` is a very minimal interface for icons. It provides functions
for checking the equality of two icons, hashing of icons and
serializing an icon to and from strings.
`GIcon` does not provide the actual pixmap for the icon as this is out
of GIO's scope, however implementations of `GIcon` may contain the name
of an icon (see [class@Gio.ThemedIcon]), or the path to an icon
(see [iface@Gio.LoadableIcon]).
To obtain a hash of a `GIcon`, see [method@Gio.Icon.hash].
To check if two `GIcon`s are equal, see [method@Gio.Icon.equal].
For serializing a `GIcon`, use [method@Gio.Icon.serialize] and
[func@Gio.Icon.deserialize].
If you want to consume `GIcon` (for example, in a toolkit) you must
be prepared to handle at least the three following cases:
[iface@Gio.LoadableIcon], [class@Gio.ThemedIcon] and [class@Gio.EmblemedIcon].
It may also make sense to have fast-paths for other cases (like handling
[`GdkPixbuf`](https://docs.gtk.org/gdk-pixbuf/class.Pixbuf.html) directly,
for example) but all compliant `GIcon` implementations outside of GIO must
implement [iface@Gio.LoadableIcon].
If your application or library provides one or more `GIcon`
implementations you need to ensure that your new implementation also
implements [iface@Gio.LoadableIcon]. Additionally, you must provide an
implementation of [method@Gio.Icon.serialize] that gives a result that is
understood by [func@Gio.Icon.deserialize], yielding one of the built-in
icon types.
for checking the equality of two icons, hashing of icons and
serializing an icon to and from strings.
`GIcon` does not provide the actual pixmap for the icon as this is out
of GIO's scope, however implementations of `GIcon` may contain the name
of an icon (see [class@Gio.ThemedIcon]), or the path to an icon
(see [iface@Gio.LoadableIcon]).
To obtain a hash of a `GIcon`, see [method@Gio.Icon.hash].
To check if two `GIcon`s are equal, see [method@Gio.Icon.equal].
For serializing a `GIcon`, use [method@Gio.Icon.serialize] and
[func@Gio.Icon.deserialize].
If you want to consume `GIcon` (for example, in a toolkit) you must
be prepared to handle at least the three following cases:
[iface@Gio.LoadableIcon], [class@Gio.ThemedIcon] and [class@Gio.EmblemedIcon].
It may also make sense to have fast-paths for other cases (like handling
[`GdkPixbuf`](https://docs.gtk.org/gdk-pixbuf/class.Pixbuf.html) directly,
for example) but all compliant `GIcon` implementations outside of GIO must
implement [iface@Gio.LoadableIcon].
If your application or library provides one or more `GIcon`
implementations you need to ensure that your new implementation also
implements [iface@Gio.LoadableIcon]. Additionally, you must provide an
implementation of [method@Gio.Icon.serialize] that gives a result that is
understood by [func@Gio.Icon.deserialize], yielding one of the built-in
icon types.
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic Icon
deserialize
(Variant value) Deserializes a #GIcon previously serialized using g_icon_serialize().boolean
Checks if two icons are equal.static ClassHandler
static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
int
hash()
Gets a hash for an icon.static Icon
newForString
(Str str) Generate a #GIcon instance from @str.Serializes a #GIcon into a #GVariant.toStr()
Generates a textual representation of @icon that can be used for
serialization such as when passing @icon to a different process or
saving it to persistent storage.Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden 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
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
-
Icon
-
-
Methodendetails
-
getClassHandler
-
equal
Checks if two icons are equal.- Parameter:
icon2
- pointer to the second #GIcon.- Gibt zurück:
- %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
-
hash
public int hash()Gets a hash for an icon.- Gibt zurück:
- a #guint containing a hash for the @icon, suitable for use in a #GHashTable or similar data structure.
-
serialize
Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved
back by calling g_icon_deserialize() on the returned value.
As serialization will avoid using raw icon data when possible, it only
makes sense to transfer the #GVariant between processes on the same machine,
(as opposed to over the network), and within the same file system namespace.- Gibt zurück:
- a #GVariant, or %NULL when serialization fails. The #GVariant will not be floating.
-
toStr
Generates a textual representation of @icon that can be used for
serialization such as when passing @icon to a different process or
saving it to persistent storage. Use g_icon_new_for_string() to
get @icon back from the returned string.
The encoding of the returned string is proprietary to #GIcon except
in the following two cases
- If @icon is a #GFileIcon, the returned string is a native path
(such as `/path/to/my icon.png`) without escaping
if the #GFile for @icon is a native file. If the file is not
native, the returned string is the result of g_file_get_uri()
(such as `sftp://path/to/my%20icon.png`).
- If @icon is a #GThemedIcon with exactly one name and no fallbacks,
the encoding is simply the name (such as `network-server`).- Gibt zurück:
- An allocated NUL-terminated UTF8 string or %NULL if @icon can't be serialized. Use g_free() to free.
-
deserialize
Deserializes a #GIcon previously serialized using g_icon_serialize().- Parameter:
value
- a #GVariant created with g_icon_serialize()- Gibt zurück:
- a #GIcon, or %NULL when deserialization fails.
-
newForString
Generate a #GIcon instance from @str. This function can fail if
@str is not valid - see g_icon_to_string() for discussion.
If your application or library provides one or more #GIcon
implementations you need to ensure that each #GType is registered
with the type system prior to calling g_icon_new_for_string().- Parameter:
str
- A string obtained via g_icon_to_string().- Gibt zurück:
- An object implementing the #GIcon interface or %NULL if @error is set.
- Löst aus:
AllocationError
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-