| 1 |
/** |
| 2 |
* libcaca Java bindings for libcaca |
| 3 |
* Copyright (c) 2009 Adrien Grand <[email protected]> |
| 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 |
|
| 12 |
package org.zoy.caca; |
| 13 |
|
| 14 |
public class Attribute { |
| 15 |
|
| 16 |
static { |
| 17 |
Caca.load(); |
| 18 |
} |
| 19 |
|
| 20 |
private Attribute() {} |
| 21 |
|
| 22 |
private static final native byte attributeToAnsi(int attr); |
| 23 |
|
| 24 |
public static byte toAnsi(int attr) { |
| 25 |
return attributeToAnsi(attr); |
| 26 |
} |
| 27 |
|
| 28 |
private static native byte attributeToAnsiForeground(int attr); |
| 29 |
|
| 30 |
public byte toAnsiForeground(int attr) { |
| 31 |
return attributeToAnsiForeground(attr); |
| 32 |
} |
| 33 |
|
| 34 |
private static native byte attributeToAnsiBackground(int attr); |
| 35 |
|
| 36 |
public byte toAnsiBackground(int attr) { |
| 37 |
return attributeToAnsiBackground(attr); |
| 38 |
} |
| 39 |
|
| 40 |
private static native short attributeToRgb12Foreground(int attr); |
| 41 |
|
| 42 |
public static short toRgb12Foreground(int attr) { |
| 43 |
return attributeToRgb12Foreground(attr); |
| 44 |
} |
| 45 |
|
| 46 |
private static native short attributeToRgb12Background(int attr); |
| 47 |
|
| 48 |
public static short toRgb12Background(int attr) { |
| 49 |
return attributeToRgb12Background(attr); |
| 50 |
} |
| 51 |
|
| 52 |
private static native byte[] attributeToArgb64(int attr); |
| 53 |
|
| 54 |
public static byte[] toArgb64(int attr) { |
| 55 |
return attributeToArgb64(attr); |
| 56 |
} |
| 57 |
|
| 58 |
} |