Interface

Gtk-4.0GtkSymbolicPaintableInterface

Interface for implementing SymbolicPaintable. Contains only the virtual methods that need to be implemented.

interface Interface {
    vfunc_get_current_image(): Gdk.Paintable;
    vfunc_get_flags(): Gdk.PaintableFlags;
    vfunc_get_intrinsic_aspect_ratio(): number;
    vfunc_get_intrinsic_height(): number;
    vfunc_get_intrinsic_width(): number;
    vfunc_snapshot(snapshot: Gdk.Snapshot, width: number, height: number): void;
    vfunc_snapshot_symbolic(
        snapshot: Gdk.Snapshot,
        width: number,
        height: number,
        colors: Gdk.RGBA[],
    ): void;
    vfunc_snapshot_with_weight(
        snapshot: Gdk.Snapshot,
        width: number,
        height: number,
        colors: Gdk.RGBA[],
        weight: number,
    ): void;
}

Hierarchy (View Summary)

Index

Methods

  • Snapshots the paintable with the given colors.

    If less than 5 colors are provided, GTK will pad the array with default colors.

    Parameters

    • snapshot: Gdk.Snapshot

      a Gdk.Snapshot to snapshot to

    • width: number

      width to snapshot in

    • height: number

      height to snapshot in

    • colors: Gdk.RGBA[]

      a pointer to an array of colors

    Returns void

  • Snapshots the paintable with the given colors and weight.

    If less than 5 colors are provided, GTK will pad the array with default colors.

    Parameters

    • snapshot: Gdk.Snapshot

      a Gdk.Snapshot to snapshot to

    • width: number

      width to snapshot in

    • height: number

      height to snapshot in

    • colors: Gdk.RGBA[]

      a pointer to an array of colors

    • weight: number

      The font weight to use (from 1 to 1000, with default 400)

    Returns void

Methods - Inherited from Gdk

  • Gets an immutable paintable for the current contents displayed by paintable.

    This is useful when you want to retain the current state of an animation, for example to take a screenshot of a running animation.

    If the paintable is already immutable, it will return itself.

    Returns Gdk.Paintable

  • Gets the preferred aspect ratio the paintable would like to be displayed at.

    The aspect ratio is the width divided by the height, so a value of 0.5 means that the paintable prefers to be displayed twice as high as it is wide. Consumers of this interface can use this to preserve aspect ratio when displaying the paintable.

    This is a purely informational value and does not in any way limit the values that may be passed to Gdk.Paintable.snapshot.

    Usually when a paintable returns nonzero values from Gdk.Paintable.get_intrinsic_width and Gdk.Paintable.get_intrinsic_height the aspect ratio should conform to those values, though that is not required.

    If the paintable does not have a preferred aspect ratio, it returns 0. Negative values are never returned.

    Returns number

  • Gets the preferred height the paintable would like to be displayed at.

    Consumers of this interface can use this to reserve enough space to draw the paintable.

    This is a purely informational value and does not in any way limit the values that may be passed to Gdk.Paintable.snapshot.

    If the paintable does not have a preferred height, it returns 0. Negative values are never returned.

    Returns number

  • Gets the preferred width the paintable would like to be displayed at.

    Consumers of this interface can use this to reserve enough space to draw the paintable.

    This is a purely informational value and does not in any way limit the values that may be passed to Gdk.Paintable.snapshot.

    If the paintable does not have a preferred width, it returns 0. Negative values are never returned.

    Returns number

  • Snapshots the given paintable with the given width and height.

    The paintable is drawn at the current (0,0) offset of the snapshot. If width and height are not larger than zero, this function will do nothing.

    Parameters

    • snapshot: Gdk.Snapshot

      a Gdk.Snapshot to snapshot to

    • width: number

      width to snapshot in

    • height: number

      height to snapshot in

    Returns void