Package ch.bailu.gtk.gdk
Klasse Cursor
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.gdk.Cursor
- Alle implementierten Schnittstellen:
PointerInterface
Used to create and destroy cursors.
Cursors are immutable objects, so once you created them, there is no way
to modify them later. You should create a new cursor when you want to change
something about it.
Cursors by themselves are not very interesting: they must be bound to a
window for users to see them. This is done with [method@Gdk.Surface.set_cursor]
or [method@Gdk.Surface.set_device_cursor]. Applications will typically
use higher-level GTK functions such as [gtk_widget_set_cursor()](../gtk4/method.Widget.set_cursor.html)
instead.
Cursors are not bound to a given [class@Gdk.Display], so they can be shared.
However, the appearance of cursors may vary when used on different
platforms.
## Named and texture cursors
There are multiple ways to create cursors. The platform's own cursors
can be created with [ctor@Gdk.Cursor.new_from_name]. That function lists
the commonly available names that are shared with the CSS specification.
Other names may be available, depending on the platform in use. On some
platforms, what images are used for named cursors may be influenced by
the cursor theme.
Another option to create a cursor is to use [ctor@Gdk.Cursor.new_from_texture]
and provide an image to use for the cursor.
To ease work with unsupported cursors, a fallback cursor can be provided.
If a [class@Gdk.Surface] cannot use a cursor because of the reasons mentioned
above, it will try the fallback cursor. Fallback cursors can themselves have
fallback cursors again, so it is possible to provide a chain of progressively
easier to support cursors. If none of the provided cursors can be supported,
the default cursor will be the ultimate fallback.
Cursors are immutable objects, so once you created them, there is no way
to modify them later. You should create a new cursor when you want to change
something about it.
Cursors by themselves are not very interesting: they must be bound to a
window for users to see them. This is done with [method@Gdk.Surface.set_cursor]
or [method@Gdk.Surface.set_device_cursor]. Applications will typically
use higher-level GTK functions such as [gtk_widget_set_cursor()](../gtk4/method.Widget.set_cursor.html)
instead.
Cursors are not bound to a given [class@Gdk.Display], so they can be shared.
However, the appearance of cursors may vary when used on different
platforms.
## Named and texture cursors
There are multiple ways to create cursors. The platform's own cursors
can be created with [ctor@Gdk.Cursor.new_from_name]. That function lists
the commonly available names that are shared with the CSS specification.
Other names may be available, depending on the platform in use. On some
platforms, what images are used for named cursors may be influenced by
the cursor theme.
Another option to create a cursor is to use [ctor@Gdk.Cursor.new_from_texture]
and provide an image to use for the cursor.
To ease work with unsupported cursors, a fallback cursor can be provided.
If a [class@Gdk.Surface] cannot use a cursor because of the reasons mentioned
above, it will try the fallback cursor. Fallback cursors can themselves have
fallback cursors again, so it is possible to provide a chain of progressively
easier to support cursors. If none of the provided cursors can be supported,
the default cursor will be the ultimate fallback.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interface
static interface
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, 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 ClassHandler
Returns the fallback for this @cursor.int
Returns the horizontal offset of the hotspot.int
Returns the vertical offset of the hotspot.static int
getName()
Returns the name of the cursor.static long
static TypeSystem.TypeSize
Returns the texture for the cursor.static long
static TypeSystem.TypeSize
static Cursor
newFromCallbackCursor
(Cursor.OnCursorGetTextureCallback callback, Pointer data, Cursor.OnDestroyNotify destroy, Cursor fallback) Creates a new callback-based cursor object.static Cursor
newFromNameCursor
(Str name, Cursor fallback) Creates a new cursor by looking up @name in the current cursor
theme.static Cursor
newFromNameCursor
(String name, Cursor fallback) Creates a new cursor by looking up @name in the current cursor
theme.static Cursor
newFromTextureCursor
(Texture texture, int hotspot_x, int hotspot_y, Cursor fallback) Creates a new cursor from a `GdkTexture`.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
-
Cursor
-
-
Methodendetails
-
getClassHandler
-
newFromCallbackCursor
public static Cursor newFromCallbackCursor(Cursor.OnCursorGetTextureCallback callback, @Nullable Pointer data, Cursor.OnDestroyNotify destroy, @Nullable Cursor fallback) Creates a new callback-based cursor object.
Cursors of this kind produce textures for the cursor
image on demand, when the @callback is called.- Parameter:
callback
- the `GdkCursorGetTextureCallback`data
- data to pass to @callbackdestroy
- destroy notify for @datafallback
- the `GdkCursor` to fall back to when this one cannot be supported- Gibt zurück:
- a new `GdkCursor`
-
newFromNameCursor
Creates a new cursor by looking up @name in the current cursor
theme.
A recommended set of cursor names that will work across different
platforms can be found in the CSS specification:
| | | | |
| --- | --- | ---- | --- |
| "none" |  "default" |  "help" |  "pointer" |
|  "context-menu" |  "progress" |  "wait" |  "cell" |
|  "crosshair" |  "text" |  "vertical-text" |  "alias" |
|  "copy" |  "no-drop" |  "move" |  "not-allowed" |
|  "grab" |  "grabbing" |  "all-scroll" |  "col-resize" |
|  "row-resize" |  "n-resize" |  "e-resize" |  "s-resize" |
|  "w-resize" |  "ne-resize" |  "nw-resize" |  "sw-resize" |
|  "se-resize" |  "ew-resize" |  "ns-resize" |  "nesw-resize" |
|  "nwse-resize" |  "zoom-in" |  "zoom-out" | |- Parameter:
name
- the name of the cursorfallback
- %NULL or the `GdkCursor` to fall back to when this one cannot be supported- Gibt zurück:
- a new `GdkCursor`, or %NULL if there is no cursor with the given name
-
newFromNameCursor
Creates a new cursor by looking up @name in the current cursor
theme.
A recommended set of cursor names that will work across different
platforms can be found in the CSS specification:
| | | | |
| --- | --- | ---- | --- |
| "none" |  "default" |  "help" |  "pointer" |
|  "context-menu" |  "progress" |  "wait" |  "cell" |
|  "crosshair" |  "text" |  "vertical-text" |  "alias" |
|  "copy" |  "no-drop" |  "move" |  "not-allowed" |
|  "grab" |  "grabbing" |  "all-scroll" |  "col-resize" |
|  "row-resize" |  "n-resize" |  "e-resize" |  "s-resize" |
|  "w-resize" |  "ne-resize" |  "nw-resize" |  "sw-resize" |
|  "se-resize" |  "ew-resize" |  "ns-resize" |  "nesw-resize" |
|  "nwse-resize" |  "zoom-in" |  "zoom-out" | |- Parameter:
name
- the name of the cursorfallback
- %NULL or the `GdkCursor` to fall back to when this one cannot be supported- Gibt zurück:
- a new `GdkCursor`, or %NULL if there is no cursor with the given name
-
newFromTextureCursor
public static Cursor newFromTextureCursor(@Nonnull Texture texture, int hotspot_x, int hotspot_y, @Nullable Cursor fallback) Creates a new cursor from a `GdkTexture`.- Parameter:
texture
- the texture providing the pixel datahotspot_x
- the horizontal offset of the “hotspot” of the cursorhotspot_y
- the vertical offset of the “hotspot” of the cursorfallback
- the `GdkCursor` to fall back to when this one cannot be supported- Gibt zurück:
- a new `GdkCursor`
-
getFallback
Returns the fallback for this @cursor.
The fallback will be used if this cursor is not available on a given
`GdkDisplay`. For named cursors, this can happen when using nonstandard
names or when using an incomplete cursor theme. For textured cursors,
this can happen when the texture is too large or when the `GdkDisplay`
it is used on does not support textured cursors.- Gibt zurück:
- the fallback of the cursor or %NULL to use the default cursor as fallback
-
getHotspotX
public int getHotspotX()Returns the horizontal offset of the hotspot.
The hotspot indicates the pixel that will be directly above the cursor.
Note that named cursors may have a nonzero hotspot, but this function
will only return the hotspot position for cursors created with
[ctor@Gdk.Cursor.new_from_texture].- Gibt zurück:
- the horizontal offset of the hotspot or 0 for named cursors
-
getHotspotY
public int getHotspotY()Returns the vertical offset of the hotspot.
The hotspot indicates the pixel that will be directly above the cursor.
Note that named cursors may have a nonzero hotspot, but this function
will only return the hotspot position for cursors created with
[ctor@Gdk.Cursor.new_from_texture].- Gibt zurück:
- the vertical offset of the hotspot or 0 for named cursors
-
getName
Returns the name of the cursor.
If the cursor is not a named cursor, %NULL will be returned.- Gibt zurück:
- the name of the cursor or %NULL if it is not a named cursor
-
getTexture
Returns the texture for the cursor.
If the cursor is a named cursor, %NULL will be returned.- Gibt zurück:
- the texture for cursor or %NULL if it is a named cursor
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-