Class IconPaintable

All Implemented Interfaces:
Paintable, SymbolicPaintable, Proxy

@Generated("org.javagi.JavaGI") public class IconPaintable extends GObject implements Paintable, SymbolicPaintable

Contains information found when looking up an icon in GtkIconTheme or loading it from a file.

GtkIconPaintable implements GdkPaintable and GtkSymbolicPaintable.

  • Constructor Details

    • IconPaintable

      public IconPaintable(MemorySegment address)
      Create a IconPaintable instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • IconPaintable

      public IconPaintable()
      Create a new IconPaintable.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the IconPaintable class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected IconPaintable asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class GObject
      Returns:
      the instance as if it were its parent type
    • forFile

      public static IconPaintable forFile(File file, int size, int scale)

      Creates a GtkIconPaintable for a file with a given size and scale.

      The icon can then be rendered by using it as a GdkPaintable.

      Parameters:
      file - a GFile
      size - desired icon size, in application pixels
      scale - the desired scale
      Returns:
      a GtkIconPaintable containing for the icon. Unref with g_object_unref()
    • getFile

      public @Nullable File getFile()

      Gets the GFile that was used to load the icon.

      Returns null if the icon was not loaded from a file.

      Returns:
      the GFile for the icon
    • getIconName

      @Deprecated public @Nullable String getIconName()
      Deprecated.

      Get the icon name being used for this icon.

      When an icon looked up in the icon theme was not available, the icon theme may use fallback icons - either those specified to gtk_icon_theme_lookup_icon() or the always-available "image-missing". The icon chosen is returned by this function.

      If the icon was created without an icon theme, this function returns null.

      Returns:
      the themed icon-name for the icon, or null if its not a themed icon.
    • isSymbolic

      @Deprecated public boolean isSymbolic()
      Deprecated.

      Checks if the icon is symbolic or not.

      This currently uses only the file name and not the file contents for determining this. This behaviour may change in the future.

      Returns:
      true if the icon is symbolic, false otherwise
    • builder

      public static IconPaintable.Builder<? extends IconPaintable.Builder> builder()
      A IconPaintable.Builder object constructs a IconPaintable with the specified properties. Use the various set...() methods to set properties, and finish construction with IconPaintable.Builder.build().
      Returns:
      the builder object