@@ -1,5 +1,5 @@
/*
/*
* CuculSharp .NET bindings for libcucul
* libcucul .NET bindings for libcucul
* Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org>
* Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org>
* All Rights Reserved
* All Rights Reserved
*
*
@@ -18,441 +18,485 @@ using System;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security;
namespace Cucul
{
public static class Libcucul
{
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_rand(int min, int max);
namespace libCucul
{
public unsafe class Cucul : IDisposable
public static int Rand(int min, int max)
{
return cucul_rand(min, max);
}
/* Constants */
public const int BLACK = 0x00;
public const int BLUE = 0x01;
public const int GREEN = 0x02;
public const int CYAN = 0x03;
public const int RED = 0x04;
public const int MAGENTA = 0x05;
public const int BROWN = 0x06;
public const int LIGHTGRAY = 0x07;
public const int DARKGRAY = 0x08;
public const int LIGHTBLUE = 0x09;
public const int LIGHTGREEN = 0x0a;
public const int LIGHTCYAN = 0x0b;
public const int LIGHTRED = 0x0c;
public const int LIGHTMAGENTA = 0x0d;
public const int YELLOW = 0x0e;
public const int WHITE = 0x0f;
public const int DEFAULT = 0x10;
public const int TRANSPARENT = 0x20;
public const int BOLD = 0x01;
public const int ITALICS = 0x02;
public const int UNDERLINE = 0x04;
public const int BLINK = 0x08;
}
public unsafe class CuculCanvas : IDisposable
{
{
/* Fixme */
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern IntPtr cucul_create_canvas(int w, int h);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_get_canvas_width(IntPtr qq);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_get_canvas_height(IntPtr qq);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_canvas_size(IntPtr qq, int w, int h);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_rand(int min, int max);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_free_canvas(IntPtr qq);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_color(IntPtr qq, int fg, int bg);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_truecolor(IntPtr qq, Int32 fg, Int32 bg);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_putchar(IntPtr qq, int x, int y, char c);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_putstr(IntPtr qq, int x , int y, String c);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_clear_canvas(IntPtr qq);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_blit(IntPtr qq, Int32 x, Int32 y, IntPtr qq1, IntPtr qq2);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_draw_line(IntPtr qq, Int32 x1, Int32 y1, Int32 x2, Int32 y2, Int32 c);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_draw_polyline(IntPtr qq, Int32[] x, Int32[] y, Int32 n, IntPtr c);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_draw_thin_line(IntPtr qq, Int32 x1, Int32 y1, Int32 x2, Int32 y2);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_draw_thin_polyline(IntPtr qq, Int32[] x, Int32[] y, Int32 n);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_gotoxy(IntPtr qq, Int32 x, Int32 y);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_get_cursor_x(IntPtr qq);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_get_cursor_y(IntPtr qq);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_put_char(IntPtr qq, Int32 x, Int32 y, Int32 c);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_get_char(IntPtr qq, Int32 x, Int32 y);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_put_str(IntPtr qq, Int32 x, Int32 y, string c);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_get_attr(IntPtr qq, Int32 x, Int32 y);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_attr(IntPtr qq, Int32 a);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_put_attr(IntPtr qq, Int32 x, Int32 y, Int32 a);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_color_ansi(IntPtr qq, Int32 fg, Int32 bg);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_color_argb(IntPtr qq, Int32 fg, Int32 bg);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_canvas_handle(IntPtr qq, Int32 x, Int32 y);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_get_canvas_handle_x(IntPtr qq);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_get_canvas_handle_y(IntPtr qq);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_canvas_boundaries(IntPtr qq, Int32 x, Int32 y,
Int32 h, Int32 w);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_invert(IntPtr qq);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_flip(IntPtr qq);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_flop(IntPtr qq);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_rotate(IntPtr qq);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_attr_to_ansi(Int64 a);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_attr_to_ansi_fg(Int64 a);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_attr_to_ansi_bg(Int64 a);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_get_frame_count(IntPtr qq);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_frame(IntPtr qq, Int32 f);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern string cucul_get_frame_name(IntPtr qq);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_frame_name(IntPtr qq, string n);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_create_frame(IntPtr qq, Int32 f);
[DllImport("libCucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_free_frame(IntPtr qq, Int32 f);
/* Constants */
public const Int32 CUCUL_BLACK = 0x00; /**< The colour index for black. */
public const Int32 CUCUL_BLUE = 0x01; /**< The colour index for blue. */
public const Int32 CUCUL_GREEN = 0x02; /**< The colour index for green. */
public const Int32 CUCUL_CYAN = 0x03; /**< The colour index for cyan. */
public const Int32 CUCUL_RED = 0x04; /**< The colour index for red. */
public const Int32 CUCUL_MAGENTA = 0x05; /**< The colour index for magenta. */
public const Int32 CUCUL_BROWN = 0x06; /**< The colour index for brown. */
public const Int32 CUCUL_LIGHTGRAY = 0x07; /**< The colour index for light gray. */
public const Int32 CUCUL_DARKGRAY = 0x08; /**< The colour index for dark gray. */
public const Int32 CUCUL_LIGHTBLUE = 0x09; /**< The colour index for blue. */
public const Int32 CUCUL_LIGHTGREEN = 0x0a; /**< The colour index for light green. */
public const Int32 CUCUL_LIGHTCYAN = 0x0b; /**< The colour index for light cyan. */
public const Int32 CUCUL_LIGHTRED = 0x0c; /**< The colour index for light red. */
public const Int32 CUCUL_LIGHTMAGENTA = 0x0d; /**< The colour index for light magenta. */
public const Int32 CUCUL_YELLOW = 0x0e; /**< The colour index for yellow. */
public const Int32 CUCUL_WHITE = 0x0f; /**< The colour index for white. */
public const Int32 CUCUL_DEFAULT = 0x10; /**< The output driver's default colour. */
public const Int32 CUCUL_TRANSPARENT = 0x20; /**< The transparent colour. */
public const Int32 CUCUL_BOLD = 0x01; /**< The style mask for bold. */
public const Int32 CUCUL_ITALICS = 0x02; /**< The style mask for italics. */
public const Int32 CUCUL_UNDERLINE = 0x04; /**< The style mask for underline. */
public const Int32 CUCUL_BLINK = 0x08; /**< The style mask for blink. */
IntPtr qq;
public Cucul()
{
qq = cucul_create_canvas(0, 0);
}
/* Fixme */
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern IntPtr cucul_create_canvas(int w, int h);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_get_canvas_width(IntPtr cv);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_get_canvas_height(IntPtr cv);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_canvas_size(IntPtr cv, int w, int h);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_free_canvas(IntPtr cv);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_color(IntPtr cv, int fg, int bg);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_truecolor(IntPtr cv, int fg, int bg);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_putchar(IntPtr cv, int x, int y, char c);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_putstr(IntPtr cv, int x , int y, String c);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_clear_canvas(IntPtr cv);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_blit(IntPtr cv, int x, int y, IntPtr cv1, IntPtr cv2);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_draw_line(IntPtr cv, int x1, int y1, int x2, int y2, int c);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_draw_polyline(IntPtr cv, int[] x, int[] y, int n, IntPtr c);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_draw_thin_line(IntPtr cv, int x1, int y1, int x2, int y2);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_draw_thin_polyline(IntPtr cv, int[] x, int[] y, int n);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_gotoxy(IntPtr cv, int x, int y);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_get_cursor_x(IntPtr cv);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_get_cursor_y(IntPtr cv);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_put_char(IntPtr cv, int x, int y, int c);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_get_char(IntPtr cv, int x, int y);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_put_str(IntPtr cv, int x, int y, string c);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_get_attr(IntPtr cv, int x, int y);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_attr(IntPtr cv, int a);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_put_attr(IntPtr cv, int x, int y, int a);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_color_ansi(IntPtr cv, int fg, int bg);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_color_argb(IntPtr cv, int fg, int bg);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_canvas_handle(IntPtr cv, int x, int y);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_get_canvas_handle_x(IntPtr cv);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_get_canvas_handle_y(IntPtr cv);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_canvas_boundaries(IntPtr cv, int x, int y,
int h, int w);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_invert(IntPtr cv);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_flip(IntPtr cv);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_flop(IntPtr cv);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_rotate(IntPtr cv);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_attr_to_ansi(Int64 a);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_attr_to_ansi_fg(Int64 a);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_attr_to_ansi_bg(Int64 a);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_get_frame_count(IntPtr cv);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_frame(IntPtr cv, int f);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern string cucul_get_frame_name(IntPtr cv);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_frame_name(IntPtr cv, string n);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_create_frame(IntPtr cv, int f);
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_free_frame(IntPtr cv, int f);
IntPtr cv;
public CuculCanvas()
{
cv = cucul_create_canvas(0, 0);
}
public void Dispose()
public void Dispose()
{
cucul_free_canvas(qq);
GC.SuppressFinalize(this);
}
public Cucul(Int32 w, Int32 h)
{
qq = cucul_create_canvas(w, h);
}
public Int32 getWidth()
{
return cucul_get_canvas_width(qq);
}
public Int32 getHeight()
{
return cucul_get_canvas_height(qq);
}
public Int32 setSize(Int32 w, Int32 h)
{
return cucul_set_canvas_size(qq, w, h);
}
public static Int32 Rand(Int32 min, Int32 max)
{
return cucul_rand(min, max);
}
public Int32 setColor(int fg, int bg)
{
return cucul_set_color(qq, fg, bg);
}
public Int32 setTruecolor(Int32 fg, Int32 bg)
{
return cucul_set_truecolor(qq, fg, bg);
}
public Int32 putChar(int x, int y, char c)
{
return cucul_putchar(qq, x, y, c);
}
public Int32 Clear()
{
return cucul_clear_canvas(qq);
}
public Int32 Blit(int x, int y, Cucul qq1, Cucul qq2)
{
return cucul_blit(qq, x, y, qq1.get_cucul_t(), qq2.get_cucul_t());
}
public Int32 drawLine(Int32 x1, Int32 y1, Int32 x2, Int32 y2, Int32 c)
{
return cucul_draw_line(qq, x1, y1, x2, y2, c);
}
public Int32 putStr(Int32 x, Int32 y, string c)
{
return cucul_putstr(qq, x, y, c);
}
public Int32 gotoXY(Int32 x, Int32 y)
{
return cucul_gotoxy(qq, x, y);
}
public Int32 getCursorX()
{
return cucul_get_cursor_x(qq);
}
public Int32 getCursorY()
{
return cucul_get_cursor_y(qq);
}
public Int32 getChar(Int32 x, Int32 y)
{
return cucul_get_char(qq, x, y);
}
public Int32 getAttr(Int32 x, Int32 y)
{
return cucul_get_attr(qq, x, y);
}
public Int32 setAttr(Int32 a)
{
return cucul_set_attr(qq, a);
}
public Int32 setAttr(Int32 x, Int32 y, Int32 a)
{
return cucul_put_attr(qq, x, y, a);
}
public Int32 setColorANSI(Int32 fg, Int32 bg)
{
return cucul_set_color_ansi(qq, fg, bg);
}
public Int32 setColorARGB(Int32 fg, Int32 bg)
{
return cucul_set_color_ansi(qq, fg, bg);
}
public Int32 setCanvasHandle(Int32 x, Int32 y)
{
return cucul_set_canvas_handle(qq, x, y);
}
public Int32 getCanvasHandleX()
{
return cucul_get_canvas_handle_x(qq);
}
public Int32 getCanvasHandleY()
{
return cucul_get_canvas_handle_y(qq);
}
public Int32 setCanvasHandleY(Int32 x, Int32 y, Int32 h, Int32 w)
{
return cucul_set_canvas_boundaries(qq, x, y, h, w);
}
{
cucul_free_canvas(cv);
GC.SuppressFinalize(this);
}
public CuculCanvas(int w, int h)
{
cv = cucul_create_canvas(w, h);
}
public int getWidth()
{
return cucul_get_canvas_width(cv);
}
public int getHeight()
{
return cucul_get_canvas_height(cv);
}
public int setSize(int w, int h)
{
return cucul_set_canvas_size(cv, w, h);
}
public int setColor(int fg, int bg)
{
return cucul_set_color(cv, fg, bg);
}
public int setTruecolor(int fg, int bg)
{
return cucul_set_truecolor(cv, fg, bg);
}
public int putChar(int x, int y, char c)
{
return cucul_putchar(cv, x, y, c);
}
public int Clear()
{
return cucul_clear_canvas(cv);
}
public int Blit(int x, int y, CuculCanvas cv1, CuculCanvas cv2)
{
return cucul_blit(cv, x, y, cv1.get_cucul_t(), cv2.get_cucul_t());
}
public int drawLine(int x1, int y1, int x2, int y2, int c)
{
return cucul_draw_line(cv, x1, y1, x2, y2, c);
}
public int putStr(int x, int y, string c)
{
return cucul_putstr(cv, x, y, c);
}
public int gotoXY(int x, int y)
{
return cucul_gotoxy(cv, x, y);
}
public int getCursorX()
{
return cucul_get_cursor_x(cv);
}
public int getCursorY()
{
return cucul_get_cursor_y(cv);
}
public int getChar(int x, int y)
{
return cucul_get_char(cv, x, y);
}
public int getAttr(int x, int y)
{
return cucul_get_attr(cv, x, y);
}
public int setAttr(int a)
{
return cucul_set_attr(cv, a);
}
public int setAttr(int x, int y, int a)
{
return cucul_put_attr(cv, x, y, a);
}
public int setColorANSI(int fg, int bg)
{
return cucul_set_color_ansi(cv, fg, bg);
}
public int setColorARGB(int fg, int bg)
{
return cucul_set_color_ansi(cv, fg, bg);
}
public int setCanvasHandle(int x, int y)
{
return cucul_set_canvas_handle(cv, x, y);
}
public int getCanvasHandleX()
{
return cucul_get_canvas_handle_x(cv);
}
public int getCanvasHandleY()
{
return cucul_get_canvas_handle_y(cv);
}
public int setCanvasHandleY(int x, int y, int h, int w)
{
return cucul_set_canvas_boundaries(cv, x, y, h, w);
}
public Int32 Invert()
{
return cucul_invert(qq);
}
public Int32 Flip()
{
return cucul_flip(qq);
}
public Int32 Flop()
{
return cucul_flop(qq);
}
public Int32 Rotate()
{
return cucul_rotate(qq);
}
public Int32 AttrToANSI(Int64 a)
{
public int Invert()
{
return cucul_invert(cv);
}
public int Flip()
{
return cucul_flip(cv);
}
public int Flop()
{
return cucul_flop(cv);
}
public int Rotate()
{
return cucul_rotate(cv);
}
public int AttrToANSI(Int64 a)
{
return cucul_attr_to_ansi(a);
return cucul_attr_to_ansi(a);
}
public Int32 AttrToANSIFg(Int64 a)
{
}
public int AttrToANSIFg(Int64 a)
{
return cucul_attr_to_ansi_fg(a);
return cucul_attr_to_ansi_fg(a);
}
public Int32 AttrToANSIBg(Int64 a)
{
}
public int AttrToANSIBg(Int64 a)
{
return cucul_attr_to_ansi_bg(a);
return cucul_attr_to_ansi_bg(a);
}
}
public int getFrameCount()
{
return cucul_get_frame_count(cv);
}
public int setFrame(int f)
{
return cucul_set_frame(cv, f);
}
public Int32 getFrameCount()
{
return cucul_get_frame_count(qq);
}
public Int32 setFrame(Int32 f)
{
return cucul_set_frame(qq, f);
}
public string getFrameName()
public string getFrameName()
{
return cucul_get_frame_name(qq);
}
public Int32 setFrameName(string n)
{
return cucul_set_frame_name(qq, n);
}
public Int32 createFrame(Int32 f)
{
return cucul_create_frame(qq, f);
}
public Int32 freeFrame(Int32 f)
{
return cucul_free_frame(qq, f);
}
{
return cucul_get_frame_name(cv);
}
public int setFrameName(string n)
{
return cucul_set_frame_name(cv, n);
}
public int createFrame(int f)
{
return cucul_create_frame(cv, f);
}
public int freeFrame(int f)
{
return cucul_free_frame(cv, f);
}
/* Privates methods, are not meant to be called by user*/
/* Privates methods, are not meant to be called by user*/
public IntPtr get_cucul_t()
public IntPtr get_cucul_t()
{
return qq;
}
{
return cv;
}
}
}
public unsafe class Dither : IDisposable
public unsafe class CuculDither : IDisposable
{
{
[DllImport("libC ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern IntPtr cucul_create_dither(Int32 bpp, Int32 w,
Int32 h, Int32 pitch,
[DllImport("libc ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern IntPtr cucul_create_dither(int bpp, int w,
int h, int pitch,
Int64 rmask,
Int64 rmask,
Int64 gmask,
Int64 gmask,
Int64 bmask,
Int64 bmask,
Int64 amask);
Int64 amask);
[DllImport("libC ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_dither_palette(IntPtr d,
Int32[] r, Int32 [] g,
Int32[] b, Int32 [] a);
[DllImport("libC ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_dither_brightness(IntPtr d, float b);
[DllImport("libC ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_dither_gamma(IntPtr d, float g);
[DllImport("libC ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_dither_contrast(IntPtr d, float c);
[DllImport("libC ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_dither_invert(IntPtr d, int i);
[DllImport("libC ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_dither_antialias(IntPtr d, string s);
[DllImport("libC ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
[DllImport("libc ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_dither_palette(IntPtr d,
int[] r, int [] g,
int[] b, int [] a);
[DllImport("libc ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_dither_brightness(IntPtr d, float b);
[DllImport("libc ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_dither_gamma(IntPtr d, float g);
[DllImport("libc ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_dither_contrast(IntPtr d, float c);
[DllImport("libc ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_dither_invert(IntPtr d, int i);
[DllImport("libc ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_dither_antialias(IntPtr d, string s);
[DllImport("libc ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern string[] cucul_get_dither_antialias_list(IntPtr d);
public static extern string[] cucul_get_dither_antialias_list(IntPtr d);
[DllImport("libC ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_dither_color(IntPtr d, string s);
[DllImport("libC ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
[DllImport("libc ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_dither_color(IntPtr d, string s);
[DllImport("libc ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern string[] cucul_get_dither_color_list(IntPtr d);
public static extern string[] cucul_get_dither_color_list(IntPtr d);
[DllImport("libC ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_dither_charset(IntPtr d, string s);
[DllImport("libC ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
[DllImport("libc ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_dither_charset(IntPtr d, string s);
[DllImport("libc ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern string[] cucul_get_dither_charset_list(IntPtr d);
public static extern string[] cucul_get_dither_charset_list(IntPtr d);
[DllImport("libC ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_set_dither_mode(IntPtr d, string s);
[DllImport("libC ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
[DllImport("libc ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_set_dither_mode(IntPtr d, string s);
[DllImport("libc ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern string[] cucul_get_dither_mode_list(IntPtr d);
public static extern string[] cucul_get_dither_mode_list(IntPtr d);
[DllImport("libC ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 cucul_free_dither(IntPtr d);
[DllImport("libc ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern int cucul_free_dither(IntPtr d);
/* FIXME [DllImport("libC ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
Int32 cucul_dither_bitmap(Cucul c,Int32 x, Int32 y, Int32 w , Int32 y,
/* FIXME [DllImport("libc ucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
int cucul_dither_bitmap(Canvas c,int x, int y, int w , int y,
IntPtr d2, void *);*/
IntPtr d2, void *);*/
IntPtr dither;
IntPtr dither;
public Dither(Int32 bpp, Int32 w,Int32 h, Int32 pitch,
Int64 rmask, Int64 gmask,Int64 bmask, Int64 amask)
{
dither = cucul_create_dither(bpp, w, h, pitch, rmask, gmask, bmask, amask);
}
public CuculDither(int bpp, int w,int h, int pitch,
Int64 rmask, Int64 gmask,Int64 bmask, Int64 amask)
{
dither = cucul_create_dither(bpp, w, h, pitch, rmask, gmask, bmask, amask);
}
public void Dispose()
public void Dispose()
{
cucul_free_dither(dither);
GC.SuppressFinalize(this);
}
public Int32 setBrightness(float b)
{
{
cucul_free_dither(dither);
GC.SuppressFinalize(this);
}
public int setBrightness(float b)
{
return cucul_set_dither_brightness(dither, b);
return cucul_set_dither_brightness(dither, b);
}
public Int32 setGamma(float g)
{
}
public int setGamma(float g)
{
return cucul_set_dither_gamma(dither, g);
return cucul_set_dither_gamma(dither, g);
}
public Int32 setContrast(float c)
{
}
public int setContrast(float c)
{
return cucul_set_dither_contrast(dither, c);
return cucul_set_dither_contrast(dither, c);
}
public Int32 setInvert(Int32 i)
{
}
public int setInvert(int i)
{
return cucul_set_dither_invert(dither, i);
return cucul_set_dither_invert(dither, i);
}
public Int32 setAntialias(string s)
{
}
public int setAntialias(string s)
{
return cucul_set_dither_antialias(dither, s);
return cucul_set_dither_antialias(dither, s);
}
public Int32 setColor(string s)
{
}
public int setColor(string s)
{
return cucul_set_dither_color(dither, s);
return cucul_set_dither_color(dither, s);
}
public Int32 setCharset(string s)
{
}
public int setCharset(string s)
{
return cucul_set_dither_charset(dither, s);
return cucul_set_dither_charset(dither, s);
}
public Int32 setMode(string s)
{
return cucul_set_dither_mode(dither, s);
}
/* <FIXME> */
public string[] getAntialiasList()
{
return cucul_get_dither_antialias_list(dither);
}
public string[] getColorList()
{
return cucul_get_dither_color_list(dither);
}
public string[] getCharsetList()
{
return cucul_get_dither_charset_list(dither);
}
public string[] getModeList()
{
return cucul_get_dither_mode_list(dither);
}
/* </FIXME> */
}
public int setMode(string s)
{
return cucul_set_dither_mode(dither, s);
}
/* <FIXME> */
public string[] getAntialiasList()
{
return cucul_get_dither_antialias_list(dither);
}
public string[] getColorList()
{
return cucul_get_dither_color_list(dither);
}
public string[] getCharsetList()
{
return cucul_get_dither_charset_list(dither);
}
public string[] getModeList()
{
return cucul_get_dither_mode_list(dither);
}
/* </FIXME> */
}
}
}
}