Package ch.bailu.gtk.gdk
Klasse Gdk
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Package
ch.bailu.gtk.gdk.Gdk
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interface
static interface
static interface
static interface
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic void
cairoDrawFromGl
(Context cr, Surface surface, int source, int source_type, int buffer_scale, int x, int y, int width, int height) Veraltet.static void
cairoRectangle
(Context cr, Rectangle rectangle) Adds the given rectangle to the current path of @cr.static void
cairoRegion
(Context cr, Region region) Adds the given region to the current path of @cr.static Region
cairoRegionCreateFromSurface
(Surface surface) Creates region that covers the area where the given
@surface is more than 50% opaque.static void
cairoSetSourcePixbuf
(Context cr, Pixbuf pixbuf, double pixbuf_x, double pixbuf_y) Sets the given pixbuf as the source pattern for @cr.static void
cairoSetSourceRgba
(Context cr, RGBA rgba) Sets the specified `GdkRGBA` as the source color of @cr.static ColorState
Returns the color state object representing the oklab color space.static ColorState
Returns the color state object representing the oklch color space.static ColorState
Returns the color state object representing the linear rec2100 color space.static ColorState
Returns the color state object representing the rec2100-pq color space.static ColorState
Returns the color state object representing the sRGB color space.static ColorState
Returns the color state object representing the linearized sRGB color space.static void
contentDeserializeAsync
(InputStream stream, Str mime_type, long type, int io_priority, Cancellable cancellable, Gdk.OnAsyncReadyCallback callback, Pointer user_data) Reads content from the given input stream and deserialize it, asynchronously.static boolean
contentDeserializeFinish
(AsyncResult result, Value value) Finishes a content deserialization operation.static ContentFormats
contentFormatsParse
(Str string) Parses the given @string into `GdkContentFormats` and
returns the formats.static void
contentRegisterDeserializer
(Str mime_type, long type, Gdk.OnContentDeserializeFunc deserialize, Pointer data, Gdk.OnDestroyNotify notify) Registers a function to deserialize object of a given type.static void
contentRegisterSerializer
(long type, Str mime_type, Gdk.OnContentSerializeFunc serialize, Pointer data, Gdk.OnDestroyNotify notify) Registers a function to serialize objects of a given type.static void
contentSerializeAsync
(OutputStream stream, Str mime_type, Value value, int io_priority, Cancellable cancellable, Gdk.OnAsyncReadyCallback callback, Pointer user_data) Serialize content and write it to the given output stream, asynchronously.static boolean
contentSerializeFinish
(AsyncResult result) Finishes a content serialization operation.static int
Registers an error quark for [class@Gdk.DmabufTexture] errors.static boolean
dragActionIsUnique
(int action) Checks if @action represents a single action or includes
multiple actions.static ClassHandler
static int
Registers an error quark for [class@Gdk.GLContext] errors.static Str
internMimeType
(Str string) Canonicalizes the given mime type and interns the result.static int
keyvalFromName
(Str keyval_name) Converts a key name to a key value.static boolean
keyvalIsLower
(int keyval) Returns true if the given key value is in lower case.static boolean
keyvalIsUpper
(int keyval) Returns true if the given key value is in upper case.static Str
keyvalName
(int keyval) Converts a key value into a symbolic name.static int
keyvalToLower
(int keyval) Converts a key value to lower case, if applicable.static int
keyvalToUnicode
(int keyval) Converts from a GDK key symbol to the corresponding Unicode
character.static int
keyvalToUpper
(int keyval) Converts a key value to upper case, if applicable.static Paintable
paintableNewEmpty
(int intrinsic_width, int intrinsic_height) Returns a paintable that has the given intrinsic size and draws nothing.static Pixbuf
pixbufGetFromSurface
(Surface surface, int src_x, int src_y, int width, int height) Veraltet.static Pixbuf
pixbufGetFromTexture
(Texture texture) Veraltet.static void
setAllowedBackends
(Str backends) Sets a list of backends that GDK should try to use.static int
Registers an error quark for [class@Gdk.Texture] errors.static int
unicodeToKeyval
(int wc) Converts from a Unicode character to a key symbol.static int
Registers an error quark for [class@Gdk.VulkanContext] errors.Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
-
Konstruktordetails
-
Gdk
public Gdk()
-
-
Methodendetails
-
getClassHandler
-
cairoDrawFromGl
@Deprecated public static void cairoDrawFromGl(@Nonnull Context cr, @Nonnull Surface surface, int source, int source_type, int buffer_scale, int x, int y, int width, int height) Veraltet.Draws GL content onto a cairo context.
It takes a render buffer ID (@source_type == GL_RENDERBUFFER) or a texture
id (@source_type == GL_TEXTURE) and draws it onto @cr with an OVER operation,
respecting the current clip. The top left corner of the rectangle specified
by @x, @y, @width and @height will be drawn at the current (0,0) position of
the `cairo_t`.
This will work for *all* `cairo_t`, as long as @surface is realized, but the
fallback implementation that reads back the pixels from the buffer may be
used in the general case. In the case of direct drawing to a surface with
no special effects applied to @cr it will however use a more efficient
approach.
For GL_RENDERBUFFER the code will always fall back to software for buffers
with alpha components, so make sure you use GL_TEXTURE if using alpha.
Calling this may change the current GL context.- Parameter:
cr
- a cairo contextsurface
- The surface we're rendering for (not necessarily into)source
- The GL ID of the source buffersource_type
- The type of the @sourcebuffer_scale
- The scale-factor that the @source buffer is allocated forx
- The source x position in @source to start copying from in GL coordinatesy
- The source y position in @source to start copying from in GL coordinateswidth
- The width of the region to drawheight
- The height of the region to draw
-
cairoRectangle
Adds the given rectangle to the current path of @cr.- Parameter:
cr
- a cairo contextrectangle
- a `GdkRectangle`
-
cairoRegion
Adds the given region to the current path of @cr.- Parameter:
cr
- a cairo contextregion
- a `cairo_region_t`
-
cairoRegionCreateFromSurface
Creates region that covers the area where the given
@surface is more than 50% opaque.
This function takes into account device offsets that might be
set with cairo_surface_set_device_offset().- Parameter:
surface
- a cairo surface- Gibt zurück:
- A `cairo_region_t`
-
cairoSetSourcePixbuf
public static void cairoSetSourcePixbuf(@Nonnull Context cr, @Nonnull Pixbuf pixbuf, double pixbuf_x, double pixbuf_y) Sets the given pixbuf as the source pattern for @cr.
The pattern has an extend mode of %CAIRO_EXTEND_NONE and is aligned
so that the origin of @pixbuf is @pixbuf_x, @pixbuf_y.- Parameter:
cr
- a cairo contextpixbuf
- a `GdkPixbuf`pixbuf_x
- X coordinate of location to place upper left corner of @pixbufpixbuf_y
- Y coordinate of location to place upper left corner of @pixbuf
-
cairoSetSourceRgba
Sets the specified `GdkRGBA` as the source color of @cr.- Parameter:
cr
- a cairo contextrgba
- a `GdkRGBA`
-
colorStateGetOklab
Returns the color state object representing the oklab color space.
This is a perceptually uniform color state.- Gibt zurück:
- the color state object for oklab
-
colorStateGetOklch
Returns the color state object representing the oklch color space.
This is the polar variant of oklab, in which the hue is encoded as
a polar coordinate.- Gibt zurück:
- the color state object for oklch
-
colorStateGetRec2100Linear
Returns the color state object representing the linear rec2100 color space.
This color state uses the primaries defined by BT.2020-2 and BT.2100-0 and a linear
transfer function.
It is equivalent to the [Cicp](class.CicpParams.html) tuple 9/8/0/1.
See e.g. [the CSS HDR Module](https://drafts.csswg.org/css-color-hdr/#valdef-color-rec2100-linear)
for details about this colorstate.- Gibt zurück:
- the color state object for linearized rec2100
-
colorStateGetRec2100Pq
Returns the color state object representing the rec2100-pq color space.
This color state uses the primaries defined by BT.2020-2 and BT.2100-0 and the transfer
function defined by SMPTE ST 2084 and BT.2100-2.
It is equivalent to the [Cicp](class.CicpParams.html) tuple 9/16/0/1.
See e.g. [the CSS HDR Module](https://drafts.csswg.org/css-color-hdr/#valdef-color-rec2100-pq)
for details about this colorstate.- Gibt zurück:
- the color state object for rec2100-pq
-
colorStateGetSrgb
Returns the color state object representing the sRGB color space.
This color state uses the primaries defined by BT.709-6 and the transfer function
defined by IEC 61966-2-1.
It is equivalent to the [Cicp](class.CicpParams.html) tuple 1/13/0/1.
See e.g. [the CSS Color Module](https://www.w3.org/TR/css-color-4/#predefined-sRGB)
for details about this colorstate.- Gibt zurück:
- the color state object for sRGB
-
colorStateGetSrgbLinear
Returns the color state object representing the linearized sRGB color space.
This color state uses the primaries defined by BT.709-6 and a linear transfer function.
It is equivalent to the [Cicp](class.CicpParams.html) tuple 1/8/0/1.
See e.g. [the CSS Color Module](https://www.w3.org/TR/css-color-4/#predefined-sRGB-linear)
for details about this colorstate.- Gibt zurück:
- the color state object for linearized sRGB
-
contentDeserializeAsync
public static void contentDeserializeAsync(@Nonnull InputStream stream, @Nonnull Str mime_type, long type, int io_priority, @Nullable Cancellable cancellable, Gdk.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Reads content from the given input stream and deserialize it, asynchronously.
The default I/O priority is `G_PRIORITY_DEFAULT` (i.e. 0), and lower numbers
indicate a higher priority.- Parameter:
stream
- a `GInputStream` to read the serialized content frommime_type
- the mime type to deserialize fromtype
- the GType to deserialize fromio_priority
- the I/O priority of the operationcancellable
- optional `GCancellable` objectcallback
- callback to call when the operation is doneuser_data
- data to pass to the callback function
-
contentDeserializeFinish
public static boolean contentDeserializeFinish(@Nonnull AsyncResult result, @Nonnull Value value) throws AllocationError Finishes a content deserialization operation.- Parameter:
result
- the `GAsyncResult`value
- return location for the result of the operation- Gibt zurück:
- %TRUE if the operation was successful. In this case, @value is set. %FALSE if an error occurred. In this case, @error is set
- Löst aus:
AllocationError
-
contentFormatsParse
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
-
contentRegisterDeserializer
public static void contentRegisterDeserializer(@Nonnull Str mime_type, long type, Gdk.OnContentDeserializeFunc deserialize, @Nullable Pointer data, Gdk.OnDestroyNotify notify) Registers a function to deserialize object of a given type.- Parameter:
mime_type
- the mime type which the function can deserialize fromtype
- the type of objects that the function createsdeserialize
- the callbackdata
- data that @deserialize can accessnotify
- destroy notify for @data
-
contentRegisterSerializer
public static void contentRegisterSerializer(long type, @Nonnull Str mime_type, Gdk.OnContentSerializeFunc serialize, @Nullable Pointer data, Gdk.OnDestroyNotify notify) Registers a function to serialize objects of a given type.- Parameter:
type
- the type of objects that the function can serializemime_type
- the mime type to serialize toserialize
- the callbackdata
- data that @serialize can accessnotify
- destroy notify for @data
-
contentSerializeAsync
public static void contentSerializeAsync(@Nonnull OutputStream stream, @Nonnull Str mime_type, @Nonnull Value value, int io_priority, @Nullable Cancellable cancellable, Gdk.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Serialize content and write it to the given output stream, asynchronously.
The default I/O priority is %G_PRIORITY_DEFAULT (i.e. 0), and lower numbers
indicate a higher priority.- Parameter:
stream
- a `GOutputStream` to write the serialized content tomime_type
- the mime type to serialize tovalue
- the content to serializeio_priority
- the I/O priority of the operationcancellable
- optional `GCancellable` objectcallback
- callback to call when the operation is doneuser_data
- data to pass to the callback function
-
contentSerializeFinish
Finishes a content serialization operation.- Parameter:
result
- the `GAsyncResult`- Gibt zurück:
- %TRUE if the operation was successful, %FALSE if an error occurred. In this case, @error is set
- Löst aus:
AllocationError
-
dmabufErrorQuark
public static int dmabufErrorQuark()Registers an error quark for [class@Gdk.DmabufTexture] errors.- Gibt zurück:
- the error quark
-
dragActionIsUnique
public static boolean dragActionIsUnique(int action) Checks if @action represents a single action or includes
multiple actions.
When @action is 0 - ie no action was given, %TRUE
is returned.- Parameter:
action
- a `GdkDragAction`- Gibt zurück:
- %TRUE if exactly one action was given
-
glErrorQuark
public static int glErrorQuark()Registers an error quark for [class@Gdk.GLContext] errors.- Gibt zurück:
- the error quark
-
internMimeType
Canonicalizes the given mime type and interns the result.
If @string is not a valid mime type, %NULL is returned instead.
See RFC 2048 for the syntax if mime types.- Parameter:
string
- string of a potential mime type- Gibt zurück:
- An interned string for the canonicalized mime type or %NULL if the string wasn't a valid mime type
-
keyvalFromName
Converts a key name to a key value.
The names are the same as those in the
`gdk/gdkkeysyms.h` header file
but without the leading “GDK_KEY_”.- Parameter:
keyval_name
- a key name- Gibt zurück:
- the corresponding key value, or `GDK_KEY_VoidSymbol` if the key name is not a valid key
-
keyvalIsLower
public static boolean keyvalIsLower(int keyval) Returns true if the given key value is in lower case.- Parameter:
keyval
- a key value.- Gibt zurück:
- true if @keyval is in lower case, or if @keyval is not subject to case conversion.
-
keyvalIsUpper
public static boolean keyvalIsUpper(int keyval) Returns true if the given key value is in upper case.- Parameter:
keyval
- a key value.- Gibt zurück:
- true if @keyval is in upper case, or if @keyval is not subject to case conversion.
-
keyvalName
Converts a key value into a symbolic name.
The names are the same as those in the
`gdk/gdkkeysyms.h` header file
but without the leading “GDK_KEY_”.- Parameter:
keyval
- a key value- Gibt zurück:
- a string containing the name of the key
-
keyvalToLower
public static int keyvalToLower(int keyval) Converts a key value to lower case, if applicable.- Parameter:
keyval
- a key value.- Gibt zurück:
- the lower case form of @keyval, or @keyval itself if it is already in lower case or it is not subject to case conversion.
-
keyvalToUnicode
public static int keyvalToUnicode(int keyval) Converts from a GDK key symbol to the corresponding Unicode
character.
Note that the conversion does not take the current locale
into consideration, which might be expected for particular
keyvals, such as `GDK_KEY_KP_Decimal`.- Parameter:
keyval
- a GDK key symbol- Gibt zurück:
- the corresponding unicode character, or 0 if there is no corresponding character.
-
keyvalToUpper
public static int keyvalToUpper(int keyval) Converts a key value to upper case, if applicable.- Parameter:
keyval
- a key value.- Gibt zurück:
- the upper case form of @keyval, or @keyval itself if it is already in upper case or it is not subject to case conversion.
-
paintableNewEmpty
Returns a paintable that has the given intrinsic size and draws nothing.
This is often useful for implementing the
[vfunc@Gdk.Paintable.get_current_image] virtual function
when the paintable is in an incomplete state (like a
[GtkMediaStream](../gtk4/class.MediaStream.html) before receiving
the first frame).- Parameter:
intrinsic_width
- The intrinsic width to report. Can be 0 for no width.intrinsic_height
- The intrinsic height to report. Can be 0 for no height.- Gibt zurück:
- a `GdkPaintable`
-
pixbufGetFromSurface
@Deprecated public static Pixbuf pixbufGetFromSurface(@Nonnull Surface surface, int src_x, int src_y, int width, int height) Veraltet.Transfers image data from a `cairo_surface_t` and converts it
to a `GdkPixbuf`.
This allows you to efficiently read individual pixels from cairo surfaces.
This function will create an RGB pixbuf with 8 bits per channel.
The pixbuf will contain an alpha channel if the @surface contains one.- Parameter:
surface
- surface to copy fromsrc_x
- Source X coordinate within @surfacesrc_y
- Source Y coordinate within @surfacewidth
- Width in pixels of region to getheight
- Height in pixels of region to get- Gibt zurück:
- A newly-created pixbuf with a reference count of 1
-
pixbufGetFromTexture
Veraltet.Creates a new pixbuf from @texture.
This should generally not be used in newly written code as later
stages will almost certainly convert the pixbuf back into a texture
to draw it on screen.- Parameter:
texture
- a `GdkTexture`- Gibt zurück:
- a new `GdkPixbuf`
-
setAllowedBackends
Sets a list of backends that GDK should try to use.
This can be useful if your application does not
work with certain GDK backends.
By default, GDK tries all included backends.
For example:
```c
gdk_set_allowed_backends ("wayland,macos,*");
```
instructs GDK to try the Wayland backend first, followed by the
MacOs backend, and then all others.
If the `GDK_BACKEND` environment variable is set, it determines
what backends are tried in what order, while still respecting the
set of allowed backends that are specified by this function.
The possible backend names are:
- `broadway`
- `macos`
- `wayland`.
- `win32`
- `x11`
You can also include a `*` in the list to try all remaining backends.
This call must happen prior to functions that open a display, such
as [func@Gdk.Display.open], `gtk_init()`, or `gtk_init_check()`
in order to take effect.- Parameter:
backends
- a comma-separated list of backends
-
textureErrorQuark
public static int textureErrorQuark()Registers an error quark for [class@Gdk.Texture] errors.- Gibt zurück:
- the error quark
-
unicodeToKeyval
public static int unicodeToKeyval(int wc) Converts from a Unicode character to a key symbol.- Parameter:
wc
- a Unicode character- Gibt zurück:
- the corresponding GDK key symbol, if one exists, or, if there is no corresponding symbol, `wc | 0x01000000`
-
vulkanErrorQuark
public static int vulkanErrorQuark()Registers an error quark for [class@Gdk.VulkanContext] errors.- Gibt zurück:
- the error quark
-