Class Adw
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Indicates anAnimation
with an infinite duration.static final int
Adwaita major version component (e.g.static final int
Adwaita micro version component (e.g.static final int
Adwaita minor version component (e.g.static final String
Adwaita version, encoded as a string, useful for printing and concatenation. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
getEnableAnimations
(Widget widget) Checks whether animations are enabled forwidget
.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 withinit()
.static void
static double
lerp
(double a, double b, double t) Computes the linear interpolation betweena
andb
fort
.static void
rgbaToStandalone
(RGBA rgba, boolean dark, RGBA standaloneRgba) Adjustsrgba
to be suitable as a standalone color.static void
showAboutDialog
(Widget parent, String firstPropertyName, Object... varargs) A convenience function for showing an application’s about dialog.static void
showAboutDialogFromAppdata
(Widget parent, String resourcePath, @Nullable String releaseNotesVersion, String firstPropertyName, Object... varargs) A convenience function for showing an application’s about dialog from AppStream metadata.static void
showAboutWindow
(Window parent, String firstPropertyName, Object... varargs) Deprecated.static void
-
Field Details
-
DURATION_INFINITE
public static final int DURATION_INFINITEIndicates anAnimation
with an infinite duration.This value is mostly used internally.
- See Also:
-
MAJOR_VERSION
public static final int MAJOR_VERSIONAdwaita major version component (e.g. 1 if the version is 1.2.3).- See Also:
-
MICRO_VERSION
public static final int MICRO_VERSIONAdwaita micro version component (e.g. 3 if the version is 1.2.3).- See Also:
-
MINOR_VERSION
public static final int MINOR_VERSIONAdwaita minor version component (e.g. 2 if the version is 1.2.3).- See Also:
-
VERSION_S
Adwaita version, encoded as a string, useful for printing and concatenation.- See Also:
-
-
Constructor Details
-
Adw
public Adw()
-
-
Method Details
-
javagi$ensureInitialized
public static void javagi$ensureInitialized() -
getEnableAnimations
Checks whether animations are enabled forwidget
.This should be used when implementing an animated widget to know whether to animate it or not.
- Parameters:
widget
- aGtkWidget
- Returns:
- 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
MAJOR_VERSION
constant, which represents the major version of the libadwaita headers you have included when compiling your code.- Returns:
- 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
MAJOR_VERSION
constant, which represents the micro version of the libadwaita headers you have included when compiling your code.- Returns:
- 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
MAJOR_VERSION
constant, which represents the minor version of the libadwaita headers you have included when compiling your code.- Returns:
- the minor version number of the Adwaita library
-
init
public static void init()Initializes Libadwaita.This function can be used instead of
Gtk.init()
as it initializes GTK implicitly.There's no need to call this function if you're using
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 withinit()
.- Returns:
- the initialization status
-
lerp
public static double lerp(double a, double b, double t) Computes the linear interpolation betweena
andb
fort
.- Parameters:
a
- the startb
- the endt
- the interpolation rate- Returns:
- the computed value
-
rgbaToStandalone
Adjustsrgba
to be suitable as a standalone color.It will typically be darker for light background, and lighter for dark background, ensuring contrast.
- Parameters:
rgba
- a background colordark
- Whether to calculate standalone color for light or dark backgroundstandaloneRgba
- return location for the standalone color
-
showAboutDialog
A convenience function for showing an application’s about dialog.- Parameters:
parent
- the parent widgetfirstPropertyName
- the name of the first propertyvarargs
- value of first property, followed by more pairs of property name and value,NULL
-terminated
-
showAboutDialogFromAppdata
public static void showAboutDialogFromAppdata(Widget parent, String resourcePath, @Nullable @Nullable String releaseNotesVersion, String firstPropertyName, Object... varargs) A convenience function for showing an application’s about dialog from AppStream metadata.See
AboutDialog.fromAppdata(java.lang.String, java.lang.String)
for details.- Parameters:
parent
- the parent widgetresourcePath
- The resource to usereleaseNotesVersion
- The version to retrieve release notes forfirstPropertyName
- the name of the first propertyvarargs
- value of first property, followed by more pairs of property name and value,NULL
-terminated
-
showAboutWindow
@Deprecated public static void showAboutWindow(@Nullable Window parent, String firstPropertyName, Object... varargs) A convenience function for showing an application’s about window.- Parameters:
parent
- the parent top-level windowfirstPropertyName
- the name of the first propertyvarargs
- value of first property, followed by more pairs of property name and value,NULL
-terminated
-
showAboutWindowFromAppdata
@Deprecated public static void showAboutWindowFromAppdata(@Nullable Window parent, String resourcePath, @Nullable @Nullable String releaseNotesVersion, String firstPropertyName, Object... varargs) Deprecated.A convenience function for showing an application’s about window from AppStream metadata.See
AboutWindow.fromAppdata(java.lang.String, java.lang.String)
for details.- Parameters:
parent
- the parent top-level windowresourcePath
- The resource to usereleaseNotesVersion
- The version to retrieve release notes forfirstPropertyName
- the name of the first propertyvarargs
- value of first property, followed by more pairs of property name and value,NULL
-terminated
-
showAboutDialog(org.gnome.gtk.Widget, java.lang.String, java.lang.Object...)
.