source: libcaca/trunk/caca-sharp/Attr.cs @ 4333

Last change on this file since 4333 was 4333, checked in by Sam Hocevar, 10 years ago

Large source code cleanup, getting rid of spaces, tabs, and svn keywords.

File size: 1.6 KB
Line 
1/*
2 *  libcaca       .NET bindings for libcaca
3 *  Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org>
4 *                2007 Sam Hocevar <sam@hocevar.net>
5 *                All Rights Reserved
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
14using System;
15using System.Runtime.InteropServices;
16using System.Security;
17using System.Drawing;
18
19namespace Caca
20{
21    public class Attr
22    {
23        private uint _attr;
24
25        public Attr(uint attr)
26        {
27            _attr = attr;
28        }
29
30        [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
31         SuppressUnmanagedCodeSecurity]
32        private static extern byte caca_attr_to_ansi(uint a);
33        public byte toAnsi()
34        {
35            return caca_attr_to_ansi(_attr);
36        }
37
38        [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
39         SuppressUnmanagedCodeSecurity]
40        private static extern byte caca_attr_to_ansi_fg(uint a);
41        public byte toAnsiFg()
42        {
43            return caca_attr_to_ansi_fg(_attr);
44        }
45
46        [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
47         SuppressUnmanagedCodeSecurity]
48        private static extern byte caca_attr_to_ansi_bg(uint a);
49        public byte toAnsiBg()
50        {
51            return caca_attr_to_ansi_bg(_attr);
52        }
53    }
54}
55
Note: See TracBrowser for help on using the repository browser.