Klasse Adw


public class Adw extends Package
  • Konstruktordetails

    • Adw

      public Adw()
  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • accentColorToRgba

      public static void accentColorToRgba(int self, @Nonnull RGBA rgba)
      Converts @self to a `GdkRGBA` representing its background color.

      The matching foreground color is white.
      Parameter:
      self - an accent color
      rgba - return location for the color
    • accentColorToStandaloneRgba

      public static void accentColorToStandaloneRgba(int self, boolean dark, @Nonnull RGBA rgba)
      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 color
      dark - Whether to calculate standalone color for light or dark background
      rgba - return location for the color
    • breakpointConditionParse

      public static BreakpointCondition breakpointConditionParse(@Nonnull Str str)
      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 value
      value - a value to ease
      Gibt zurück:
      the easing for @value
    • getEnableAnimations

      public static boolean getEnableAnimations(@Nonnull Widget widget)
      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

      public static double lengthUnitFromPx(int unit, double value, @Nullable Settings settings)
      Converts @value from pixels to @unit.
      Parameter:
      unit - a length unit
      value - a value in pixels
      settings - settings to use, or `NULL` for default settings
      Gibt zurück:
      the length in @unit
    • lengthUnitToPx

      public static double lengthUnitToPx(int unit, double value, @Nullable Settings settings)
      Converts @value from @unit to pixels.
      Parameter:
      unit - a length unit
      value - a value in @unit
      settings - 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 start
      b - the end
      t - 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 color
      dark - Whether to calculate standalone color for light or dark background
      standalone_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 widget
      first_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 widget
      resource_path - The resource to use
      release_notes_version - The version to retrieve release notes for
      first_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 window
      first_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 window
      resource_path - The resource to use
      release_notes_version - The version to retrieve release notes for
      first_property_name - the name of the first property
      _ellipsis - value of first property, followed by more pairs of property name and value, `NULL`-terminated