You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

61 line
1.5 KiB

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