Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

Attribute.java 1.5 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /**
  2. * libcaca Java bindings for libcaca
  3. * Copyright (c) 2009 Adrien Grand <jpountz@dinauz.org>
  4. *
  5. * This library is free software. It comes without any warranty, to
  6. * the extent permitted by applicable law. You can redistribute it
  7. * and/or modify it under the terms of the Do What the Fuck You Want
  8. * to Public License, Version 2, as published by Sam Hocevar. See
  9. * http://www.wtfpl.net/ for more details.
  10. */
  11. package org.zoy.caca;
  12. public class Attribute {
  13. static {
  14. Caca.load();
  15. }
  16. private Attribute() {}
  17. private static final native byte attributeToAnsi(int attr);
  18. public static byte toAnsi(int attr) {
  19. return attributeToAnsi(attr);
  20. }
  21. private static native byte attributeToAnsiForeground(int attr);
  22. public byte toAnsiForeground(int attr) {
  23. return attributeToAnsiForeground(attr);
  24. }
  25. private static native byte attributeToAnsiBackground(int attr);
  26. public byte toAnsiBackground(int attr) {
  27. return attributeToAnsiBackground(attr);
  28. }
  29. private static native short attributeToRgb12Foreground(int attr);
  30. public static short toRgb12Foreground(int attr) {
  31. return attributeToRgb12Foreground(attr);
  32. }
  33. private static native short attributeToRgb12Background(int attr);
  34. public static short toRgb12Background(int attr) {
  35. return attributeToRgb12Background(attr);
  36. }
  37. private static native byte[] attributeToArgb64(int attr);
  38. public static byte[] toArgb64(int attr) {
  39. return attributeToArgb64(attr);
  40. }
  41. }