1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
/*
* libcaca .NET bindings for libcaca
* Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org>
* 2007 Sam Hocevar <sam@hocevar.net>
* All Rights Reserved
*
* This library is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What the Fuck You Want
* to Public License, Version 2, as published by Sam Hocevar. See
* http://www.wtfpl.net/ for more details.
*/
using System;
using System.Runtime.InteropServices;
using System.Security;
using System.Drawing;
namespace Caca
{
public class Attr
{
private uint _attr;
public Attr(uint attr)
{
_attr = attr;
}
[DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
SuppressUnmanagedCodeSecurity]
private static extern byte caca_attr_to_ansi(uint a);
public byte toAnsi()
{
return caca_attr_to_ansi(_attr);
}
[DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
SuppressUnmanagedCodeSecurity]
private static extern byte caca_attr_to_ansi_fg(uint a);
public byte toAnsiFg()
{
return caca_attr_to_ansi_fg(_attr);
}
[DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
SuppressUnmanagedCodeSecurity]
private static extern byte caca_attr_to_ansi_bg(uint a);
public byte toAnsiBg()
{
return caca_attr_to_ansi_bg(_attr);
}
}
}
|