|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- /*
- * libcaca .NET bindings for libcaca
- * Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org>
- * 2007 Sam Hocevar <sam@zoy.org>
- * All Rights Reserved
- *
- * $Id$
- *
- * 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://sam.zoy.org/wtfpl/COPYING 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);
- }
- }
- }
-
|