Package ch.bailu.gtk.adw
Klasse Adw
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Package
ch.bailu.gtk.adw.Adw
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic void
accentColorToRgba
(int self, RGBA rgba) Converts @self to a `GdkRGBA` representing its background color.static void
accentColorToStandaloneRgba
(int self, boolean dark, RGBA rgba) Converts @self to a `GdkRGBA` representing its standalone color.static BreakpointCondition
Parses a condition from a string.static double
easingEase
(int self, double value) Computes easing with @easing for @value.static ClassHandler
static boolean
getEnableAnimations
(Widget widget) Checks whether animations are enabled for @widget.static int
Returns the major version number of the Adwaita library.static int
Returns the micro version number of the Adwaita library.static int
Returns the minor version number of the Adwaita library.static void
init()
Initializes Libadwaita.static boolean
Use this function to check if libadwaita has been initialized with
[func@init].static double
lengthUnitFromPx
(int unit, double value, Settings settings) Converts @value from pixels to @unit.static double
lengthUnitToPx
(int unit, double value, Settings settings) Converts @value from @unit to pixels.static double
lerp
(double a, double b, double t) Computes the linear interpolation between @a and @b for @t.static void
rgbaToStandalone
(RGBA rgba, boolean dark, RGBA standalone_rgba) Adjusts @rgba to be suitable as a standalone color.static void
showAboutDialog
(Widget parent, Str first_property_name, Object... _ellipsis) A convenience function for showing an application’s about dialog.static void
showAboutDialogFromAppdata
(Widget parent, Str resource_path, Str release_notes_version, Str first_property_name, Object... _ellipsis) A convenience function for showing an application’s about dialog from
AppStream metadata.static void
showAboutWindow
(Window parent, Str first_property_name, Object... _ellipsis) Veraltet.static void
showAboutWindowFromAppdata
(Window parent, Str resource_path, Str release_notes_version, Str first_property_name, Object... _ellipsis) Veraltet.Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
-
Konstruktordetails
-
Adw
public Adw()
-
-
Methodendetails
-
getClassHandler
-
accentColorToRgba
Converts @self to a `GdkRGBA` representing its background color.
The matching foreground color is white.- Parameter:
self
- an accent colorrgba
- return location for the color
-
accentColorToStandaloneRgba
Converts @self to a `GdkRGBA` representing its standalone color.
It will typically be darker for light background, and lighter for dark
background, ensuring contrast.- Parameter:
self
- an accent colordark
- Whether to calculate standalone color for light or dark backgroundrgba
- return location for the color
-
breakpointConditionParse
Parses a condition from a string.
Length conditions are specified as `<type>: <value>[<unit>]`, where:
- `<type>` can be `min-width`, `max-width`, `min-height` or `max-height`
- `<value>` is a fractional number
- `<unit>` can be `px`, `pt` or `sp`
If the unit is omitted, `px` is assumed.
See [ctor@BreakpointCondition.new_length].
Examples:
- `min-width: 500px`
- `min-height: 400pt`
- `max-width: 100sp`
- `max-height: 500`
Ratio conditions are specified as `<type>: <width>[/<height>]`, where:
- `<type>` can be `min-aspect-ratio` or `max-aspect-ratio`
- `<width>` and `<height>` are integer numbers
See [ctor@BreakpointCondition.new_ratio].
The ratio is represented as `<width>` divided by `<height>`.
If `<height>` is omitted, it's assumed to be 1.
Examples:
- `min-aspect-ratio: 4/3`
- `max-aspect-ratio: 1`
The logical operators `and`, `or` can be used to compose a complex condition
as follows:
- `<condition> and <condition>`: the condition is true when both
`<condition>`s are true, same as when using
[ctor@BreakpointCondition.new_and]
- `<condition> or <condition>`: the condition is true when either of the
`<condition>`s is true, same as when using
[ctor@BreakpointCondition.new_or]
Examples:
- `min-width: 400px and max-aspect-ratio: 4/3`
- `max-width: 360sp or max-width: 360px`
Conditions can be further nested using parentheses, for example:
- `min-width: 400px and (max-aspect-ratio: 4/3 or max-height: 400px)`
If parentheses are omitted, the first operator takes priority.- Parameter:
str
- the string specifying the condition- Gibt zurück:
- the parsed condition
-
easingEase
public static double easingEase(int self, double value) Computes easing with @easing for @value.
@value should generally be in the [0, 1] range.- Parameter:
self
- an easing valuevalue
- a value to ease- Gibt zurück:
- the easing for @value
-
getEnableAnimations
Checks whether animations are enabled for @widget.
This should be used when implementing an animated widget to know whether to
animate it or not.- Parameter:
widget
- a `GtkWidget`- Gibt zurück:
- whether animations are enabled for @widget
-
getMajorVersion
public static int getMajorVersion()Returns the major version number of the Adwaita library.
For example, in libadwaita version 1.2.3 this is 1.
This function is in the library, so it represents the libadwaita library your
code is running against. Contrast with the [const@MAJOR_VERSION] constant,
which represents the major version of the libadwaita headers you have
included when compiling your code.- Gibt zurück:
- the major version number of the Adwaita library
-
getMicroVersion
public static int getMicroVersion()Returns the micro version number of the Adwaita library.
For example, in libadwaita version 1.2.3 this is 3.
This function is in the library, so it represents the libadwaita library your
code is running against. Contrast with the [const@MAJOR_VERSION] constant,
which represents the micro version of the libadwaita headers you have
included when compiling your code.- Gibt zurück:
- the micro version number of the Adwaita library
-
getMinorVersion
public static int getMinorVersion()Returns the minor version number of the Adwaita library.
For example, in libadwaita version 1.2.3 this is 2.
This function is in the library, so it represents the libadwaita library your
code is running against. Contrast with the [const@MAJOR_VERSION] constant,
which represents the minor version of the libadwaita headers you have
included when compiling your code.- Gibt zurück:
- the minor version number of the Adwaita library
-
init
public static void init()Initializes Libadwaita.
This function can be used instead of [func@Gtk.init] as it initializes GTK
implicitly.
There's no need to call this function if you're using [class@Application].
If Libadwaita has already been initialized, the function will simply return.
This makes sure translations, types, themes, and icons for the Adwaita
library are set up properly. -
isInitialized
public static boolean isInitialized()Use this function to check if libadwaita has been initialized with
[func@init].- Gibt zurück:
- the initialization status
-
lengthUnitFromPx
Converts @value from pixels to @unit.- Parameter:
unit
- a length unitvalue
- a value in pixelssettings
- settings to use, or `NULL` for default settings- Gibt zurück:
- the length in @unit
-
lengthUnitToPx
Converts @value from @unit to pixels.- Parameter:
unit
- a length unitvalue
- a value in @unitsettings
- settings to use, or `NULL` for default settings- Gibt zurück:
- the length in pixels
-
lerp
public static double lerp(double a, double b, double t) Computes the linear interpolation between @a and @b for @t.- Parameter:
a
- the startb
- the endt
- the interpolation rate- Gibt zurück:
- the computed value
-
rgbaToStandalone
public static void rgbaToStandalone(@Nonnull RGBA rgba, boolean dark, @Nonnull RGBA standalone_rgba) Adjusts @rgba to be suitable as a standalone color.
It will typically be darker for light background, and lighter for dark
background, ensuring contrast.- Parameter:
rgba
- a background colordark
- Whether to calculate standalone color for light or dark backgroundstandalone_rgba
- return location for the standalone color
-
showAboutDialog
public static void showAboutDialog(@Nonnull Widget parent, @Nonnull Str first_property_name, Object... _ellipsis) A convenience function for showing an application’s about dialog.- Parameter:
parent
- the parent widgetfirst_property_name
- the name of the first property_ellipsis
- value of first property, followed by more pairs of property name and value, `NULL`-terminated
-
showAboutDialogFromAppdata
public static void showAboutDialogFromAppdata(@Nonnull Widget parent, @Nonnull Str resource_path, @Nullable Str release_notes_version, @Nonnull Str first_property_name, Object... _ellipsis) A convenience function for showing an application’s about dialog from
AppStream metadata.
See [ctor@AboutDialog.new_from_appdata] for details.- Parameter:
parent
- the parent widgetresource_path
- The resource to userelease_notes_version
- The version to retrieve release notes forfirst_property_name
- the name of the first property_ellipsis
- value of first property, followed by more pairs of property name and value, `NULL`-terminated
-
showAboutWindow
@Deprecated public static void showAboutWindow(@Nullable Window parent, @Nonnull Str first_property_name, Object... _ellipsis) Veraltet.A convenience function for showing an application’s about window.- Parameter:
parent
- the parent top-level windowfirst_property_name
- the name of the first property_ellipsis
- value of first property, followed by more pairs of property name and value, `NULL`-terminated
-
showAboutWindowFromAppdata
@Deprecated public static void showAboutWindowFromAppdata(@Nullable Window parent, @Nonnull Str resource_path, @Nullable Str release_notes_version, @Nonnull Str first_property_name, Object... _ellipsis) Veraltet.A convenience function for showing an application’s about window from
AppStream metadata.
See [ctor@AboutWindow.new_from_appdata] for details.- Parameter:
parent
- the parent top-level windowresource_path
- The resource to userelease_notes_version
- The version to retrieve release notes forfirst_property_name
- the name of the first property_ellipsis
- value of first property, followed by more pairs of property name and value, `NULL`-terminated
-