Class ClipboardTypes

java.lang.Object
limn.backend.lwjgl.transfer.ClipboardTypes

public final class ClipboardTypes extends Object
The canonical names a NativeClipboard speaks, and their spellings on the two Linux windowing systems, where a type is a string any program may write its own way.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Files, as an RFC 2483 URI list.
    static final String
    An HTML fragment, as UTF-8 bytes.
    static final String
    A picture, as the bytes of an image file: PNG when written, any decodable kind when read.
    static final String
    A picture as its pixels: the width and the height as two little-endian integers, then the rows of straight-alpha RGBA, top first.
    static final String
    Plain text, as UTF-8 bytes.
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    canonical(String spelling)
     
    static List<String>
    canonical(List<String> offered)
    What another program offers, as canonical types: one text and one image however many spellings it wrote, every other type as it is.
    static @Nullable String
    spellingIn(String canonical, List<String> offered)
    The spelling to ask another program for.
    static List<String>
    spellings(String canonical)
    The spellings to announce for a canonical type on X11 and Wayland, so that a program that knows only an older one still finds it.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • TEXT

      public static final String TEXT
      Plain text, as UTF-8 bytes.
      See Also:
    • HTML

      public static final String HTML
      An HTML fragment, as UTF-8 bytes.
      See Also:
    • IMAGE

      public static final String IMAGE
      A picture, as the bytes of an image file: PNG when written, any decodable kind when read.
      See Also:
    • FILES

      public static final String FILES
      Files, as an RFC 2483 URI list.
      See Also:
    • PIXELS

      public static final String PIXELS
      A picture as its pixels: the width and the height as two little-endian integers, then the rows of straight-alpha RGBA, top first. Never announced to another program; it is what a system's clipboard asks this one for when its own picture format is made of pixels.
      See Also:
  • Method Details

    • spellings

      public static List<String> spellings(String canonical)
      The spellings to announce for a canonical type on X11 and Wayland, so that a program that knows only an older one still finds it.
      Parameters:
      canonical - a canonical type
      Returns:
      what to offer, the canonical name first
    • canonical

      public static String canonical(String spelling)
      Parameters:
      spelling - a type another program asked for
      Returns:
      the canonical type it is a spelling of, or itself
    • canonical

      public static List<String> canonical(List<String> offered)
      What another program offers, as canonical types: one text and one image however many spellings it wrote, every other type as it is.
      Parameters:
      offered - the type names as offered
      Returns:
      the canonical types, in the order first met
    • spellingIn

      public static @Nullable String spellingIn(String canonical, List<String> offered)
      The spelling to ask another program for.
      Parameters:
      canonical - the canonical type wanted
      offered - the type names as offered
      Returns:
      the best spelling on offer, or null when there is none