Changeset 2046
- Timestamp:
- Nov 24, 2007, 4:00:21 PM (13 years ago)
- Location:
- libcaca/trunk/csharp
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/csharp/Caca.cs
r2045 r2046 23 23 24 24 enum Keys 25 { 25 { 26 26 CACA_KEY_UNKNOWN = 0x00, /**< Unknown key. */ 27 27 … … 62 62 CACA_KEY_F14 = 0x127, /**< The F14 key. */ 63 63 CACA_KEY_F15 = 0x128 /**< The F15 key. */ 64 } 64 } 65 65 public unsafe class Event 66 66 { … … 68 68 { 69 69 NONE = 0x0000, /**< No event. */ 70 70 71 71 KEY_PRESS = 0x0001, /**< A key was pressed. */ 72 72 KEY_RELEASE = 0x0002, /**< A key was released. */ … … 76 76 RESIZE = 0x0020, /**< The window was resized. */ 77 77 QUIT = 0x0040, /**< The user requested to quit. */ 78 78 79 79 ANY = 0xffff /**< Bitmask for any event. */ 80 80 }; 81 81 82 82 } 83 83 … … 86 86 { 87 87 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 88 public static extern IntPtr caca_create_display(IntPtr qq);88 public static extern IntPtr caca_create_display(IntPtr cv); 89 89 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 90 public static extern void caca_free_display(IntPtr kk);90 public static extern void caca_free_display(IntPtr dp); 91 91 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 92 public static extern void caca_refresh_display(IntPtr kk);92 public static extern void caca_refresh_display(IntPtr dp); 93 93 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 94 public static extern void caca_set_display_time(IntPtr kk, Int32 d);94 public static extern void caca_set_display_time(IntPtr dp, Int32 d); 95 95 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 96 public static extern Int32 caca_get_display_time(IntPtr kk);96 public static extern Int32 caca_get_display_time(IntPtr dp); 97 97 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 98 public static extern Int32 caca_get_display_width(IntPtr kk);98 public static extern Int32 caca_get_display_width(IntPtr dp); 99 99 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 100 public static extern Int32 caca_get_display_height(IntPtr kk);100 public static extern Int32 caca_get_display_height(IntPtr dp); 101 101 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 102 public static extern Int32 caca_set_display_title(IntPtr kk, string t);102 public static extern Int32 caca_set_display_title(IntPtr dp, string t); 103 103 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 104 104 public static extern Int32 caca_get_event(IntPtr k, Event.type t, Event e, Int32 timeout); … … 114 114 115 115 116 IntPtr qq;117 IntPtr kk;116 IntPtr _cv; 117 IntPtr _dp; 118 118 119 public Display(CuculCanvas qqt)119 public Display(CuculCanvas cv) 120 120 { 121 qq = qqt.get_cucul_t();122 kk = caca_create_display(qq);121 _cv = cv._cv; 122 _dp = caca_create_display(_cv); 123 123 } 124 124 public void Dispose() 125 125 { 126 caca_free_display( kk);126 caca_free_display(_dp); 127 127 GC.SuppressFinalize(this); 128 128 } 129 129 public void Refresh() 130 130 { 131 caca_refresh_display( kk);131 caca_refresh_display(_dp); 132 132 } 133 133 public void setDisplayTime(Int32 d) 134 134 { 135 caca_set_display_time( kk, d);135 caca_set_display_time(_dp, d); 136 136 } 137 137 public Int32 getDisplayTime() 138 138 { 139 return caca_get_display_time( kk);139 return caca_get_display_time(_dp); 140 140 } 141 141 public Int32 getDisplayWidth() 142 142 { 143 return caca_get_display_width( kk);143 return caca_get_display_width(_dp); 144 144 } 145 145 public Int32 getDisplayHeight() 146 146 { 147 return caca_get_display_height( kk);147 return caca_get_display_height(_dp); 148 148 } 149 149 public Int32 setDisplayTitle(string t) 150 150 { 151 return caca_set_display_title( kk, t);151 return caca_set_display_title(_dp, t); 152 152 } 153 153 public Int32 getEvent(Event.type t, Event e, Int32 timeout) 154 154 { 155 return caca_get_event( kk, t, e, timeout);155 return caca_get_event(_dp, t, e, timeout); 156 156 } 157 157 public Int32 getMouseX() 158 158 { 159 return caca_get_mouse_x( kk);159 return caca_get_mouse_x(_dp); 160 160 } 161 161 public Int32 getMouseY() 162 162 { 163 return caca_get_mouse_y( kk);163 return caca_get_mouse_y(_dp); 164 164 } 165 165 public void caca_set_mouse(bool status) 166 166 { 167 caca_set_mouse( kk, status);167 caca_set_mouse(_dp, status); 168 168 } 169 169 … … 176 176 public IntPtr get_caca_t() 177 177 { 178 return kk;178 return _dp; 179 179 } 180 180 } -
libcaca/trunk/csharp/Cucul.cs
r2045 r2046 13 13 */ 14 14 15 16 17 15 using System; 18 16 using System.Runtime.InteropServices; … … 21 19 namespace Cucul 22 20 { 21 /* Static libcucul stuff that does not fit in any object */ 23 22 public static class Libcucul 24 23 { 25 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 26 public static extern int cucul_rand(int min, int max); 24 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 25 SuppressUnmanagedCodeSecurity] 26 private static extern int cucul_rand(int min, int max); 27 27 28 28 public static int Rand(int min, int max) … … 31 31 } 32 32 33 /* Constants */ 34 public const int BLACK = 0x00; 35 public const int BLUE = 0x01; 36 public const int GREEN = 0x02; 37 public const int CYAN = 0x03; 38 public const int RED = 0x04; 39 public const int MAGENTA = 0x05; 40 public const int BROWN = 0x06; 41 public const int LIGHTGRAY = 0x07; 42 public const int DARKGRAY = 0x08; 43 public const int LIGHTBLUE = 0x09; 44 public const int LIGHTGREEN = 0x0a; 45 public const int LIGHTCYAN = 0x0b; 46 public const int LIGHTRED = 0x0c; 47 public const int LIGHTMAGENTA = 0x0d; 48 public const int YELLOW = 0x0e; 49 public const int WHITE = 0x0f; 50 public const int DEFAULT = 0x10; 51 public const int TRANSPARENT = 0x20; 52 53 public const int BOLD = 0x01; 54 public const int ITALICS = 0x02; 55 public const int UNDERLINE = 0x04; 56 public const int BLINK = 0x08; 33 public const int BLACK = 0x00, 34 BLUE = 0x01, 35 GREEN = 0x02, 36 CYAN = 0x03, 37 RED = 0x04, 38 MAGENTA = 0x05, 39 BROWN = 0x06, 40 LIGHTGRAY = 0x07, 41 DARKGRAY = 0x08, 42 LIGHTBLUE = 0x09, 43 LIGHTGREEN = 0x0a, 44 LIGHTCYAN = 0x0b, 45 LIGHTRED = 0x0c, 46 LIGHTMAGENTA = 0x0d, 47 YELLOW = 0x0e, 48 WHITE = 0x0f, 49 DEFAULT = 0x10, 50 TRANSPARENT = 0x20; 51 52 public const int BOLD = 0x01, 53 ITALICS = 0x02, 54 UNDERLINE = 0x04, 55 BLINK = 0x08; 57 56 } 58 57 59 58 public unsafe class CuculCanvas : IDisposable 60 59 { 61 /* Fixme */ 62 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 63 public static extern IntPtr cucul_create_canvas(int w, int h); 64 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 65 public static extern int cucul_get_canvas_width(IntPtr cv); 66 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 67 public static extern int cucul_get_canvas_height(IntPtr cv); 68 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 69 public static extern int cucul_set_canvas_size(IntPtr cv, int w, int h); 70 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 71 public static extern int cucul_free_canvas(IntPtr cv); 72 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 73 public static extern int cucul_set_color(IntPtr cv, int fg, int bg); 74 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 75 public static extern int cucul_set_truecolor(IntPtr cv, int fg, int bg); 76 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 77 public static extern int cucul_putchar(IntPtr cv, int x, int y, char c); 78 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 79 public static extern int cucul_putstr(IntPtr cv, int x , int y, String c); 80 81 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 82 public static extern int cucul_clear_canvas(IntPtr cv); 83 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 84 public static extern int cucul_blit(IntPtr cv, int x, int y, IntPtr cv1, IntPtr cv2); 85 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 86 public static extern int cucul_draw_line(IntPtr cv, int x1, int y1, int x2, int y2, int c); 87 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 88 public static extern int cucul_draw_polyline(IntPtr cv, int[] x, int[] y, int n, IntPtr c); 89 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 90 public static extern int cucul_draw_thin_line(IntPtr cv, int x1, int y1, int x2, int y2); 91 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 92 public static extern int cucul_draw_thin_polyline(IntPtr cv, int[] x, int[] y, int n); 93 94 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 95 public static extern int cucul_gotoxy(IntPtr cv, int x, int y); 96 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 97 public static extern int cucul_get_cursor_x(IntPtr cv); 98 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 99 public static extern int cucul_get_cursor_y(IntPtr cv); 100 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 101 public static extern int cucul_put_char(IntPtr cv, int x, int y, int c); 102 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 103 public static extern int cucul_get_char(IntPtr cv, int x, int y); 104 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 105 public static extern int cucul_put_str(IntPtr cv, int x, int y, string c); 106 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 107 public static extern int cucul_get_attr(IntPtr cv, int x, int y); 108 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 109 public static extern int cucul_set_attr(IntPtr cv, int a); 110 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 111 public static extern int cucul_put_attr(IntPtr cv, int x, int y, int a); 112 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 113 public static extern int cucul_set_color_ansi(IntPtr cv, int fg, int bg); 114 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 115 public static extern int cucul_set_color_argb(IntPtr cv, int fg, int bg); 116 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 117 public static extern int cucul_set_canvas_handle(IntPtr cv, int x, int y); 118 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 119 public static extern int cucul_get_canvas_handle_x(IntPtr cv); 120 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 121 public static extern int cucul_get_canvas_handle_y(IntPtr cv); 122 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 123 public static extern int cucul_set_canvas_boundaries(IntPtr cv, int x, int y, 124 int h, int w); 125 126 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 127 public static extern int cucul_invert(IntPtr cv); 128 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 129 public static extern int cucul_flip(IntPtr cv); 130 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 131 public static extern int cucul_flop(IntPtr cv); 132 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 133 public static extern int cucul_rotate(IntPtr cv); 134 135 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 136 public static extern int cucul_attr_to_ansi(Int64 a); 137 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 138 public static extern int cucul_attr_to_ansi_fg(Int64 a); 139 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 140 public static extern int cucul_attr_to_ansi_bg(Int64 a); 141 142 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 143 public static extern int cucul_get_frame_count(IntPtr cv); 144 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 145 public static extern int cucul_set_frame(IntPtr cv, int f); 146 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 147 public static extern string cucul_get_frame_name(IntPtr cv); 148 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 149 public static extern int cucul_set_frame_name(IntPtr cv, string n); 150 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 151 public static extern int cucul_create_frame(IntPtr cv, int f); 152 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 153 public static extern int cucul_free_frame(IntPtr cv, int f); 154 155 IntPtr cv; 156 60 public readonly IntPtr _cv; 61 62 /* libcucul basic functions */ 63 64 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 65 SuppressUnmanagedCodeSecurity] 66 private static extern IntPtr cucul_create_canvas(int w, int h); 157 67 public CuculCanvas() 158 68 { 159 cv = cucul_create_canvas(0, 0); 160 } 161 69 _cv = cucul_create_canvas(0, 0); 70 } 71 72 public CuculCanvas(int w, int h) 73 { 74 _cv = cucul_create_canvas(w, h); 75 } 76 77 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 78 SuppressUnmanagedCodeSecurity] 79 private static extern int cucul_free_canvas(IntPtr cv); 162 80 public void Dispose() 163 81 { 164 cucul_free_canvas( cv);82 cucul_free_canvas(_cv); 165 83 GC.SuppressFinalize(this); 166 84 } 167 85 168 public CuculCanvas(int w, int h) 169 { 170 cv = cucul_create_canvas(w, h); 171 } 172 173 public int getWidth() 174 { 175 return cucul_get_canvas_width(cv); 176 } 177 178 public int getHeight() 179 { 180 return cucul_get_canvas_height(cv); 181 } 182 183 public int setSize(int w, int h) 184 { 185 return cucul_set_canvas_size(cv, w, h); 186 } 187 188 public int setColor(int fg, int bg) 189 { 190 return cucul_set_color(cv, fg, bg); 191 } 192 193 public int setTruecolor(int fg, int bg) 194 { 195 return cucul_set_truecolor(cv, fg, bg); 196 } 197 198 public int putChar(int x, int y, char c) 199 { 200 return cucul_putchar(cv, x, y, c); 201 } 202 86 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 87 SuppressUnmanagedCodeSecurity] 88 private static extern int cucul_set_canvas_size(IntPtr cv, 89 int w, int h); 90 public void setSize(int w, int h) 91 { 92 cucul_set_canvas_size(_cv, w, h); 93 } 94 95 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 96 SuppressUnmanagedCodeSecurity] 97 private static extern int cucul_get_canvas_width(IntPtr cv); 98 public int width 99 { 100 get { return cucul_get_canvas_width(_cv); } 101 set { cucul_set_canvas_size(_cv, value, 102 cucul_get_canvas_height(_cv)); } 103 } 104 105 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 106 SuppressUnmanagedCodeSecurity] 107 private static extern int cucul_get_canvas_height(IntPtr cv); 108 public int height 109 { 110 get { return cucul_get_canvas_height(_cv); } 111 set { cucul_set_canvas_size(_cv, cucul_get_canvas_width(_cv), 112 value); } 113 } 114 115 /* canvas drawing */ 116 117 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 118 SuppressUnmanagedCodeSecurity] 119 private static extern int cucul_gotoxy(IntPtr cv, int x, int y); 120 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 121 SuppressUnmanagedCodeSecurity] 122 private static extern int cucul_get_cursor_x(IntPtr cv); 123 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 124 SuppressUnmanagedCodeSecurity] 125 private static extern int cucul_get_cursor_y(IntPtr cv); 126 public int cursorX 127 { 128 get { return cucul_get_cursor_x(_cv); } 129 set { cucul_gotoxy(_cv, value, cucul_get_cursor_y(_cv)); } 130 } 131 132 public int cursorY 133 { 134 get { return cucul_get_cursor_y(_cv); } 135 set { cucul_gotoxy(_cv, cucul_get_cursor_x(_cv), value); } 136 } 137 138 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 139 SuppressUnmanagedCodeSecurity] 140 private static extern int cucul_put_char(IntPtr cv, 141 int x, int y, int c); 142 public int putChar(int x, int y, int c) 143 { 144 return cucul_put_char(_cv, x, y, c); 145 } 146 147 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 148 SuppressUnmanagedCodeSecurity] 149 private static extern int cucul_get_char(IntPtr cv, int x, int y); 150 public int getChar(int x, int y) 151 { 152 return cucul_get_char(_cv, x, y); 153 } 154 155 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 156 SuppressUnmanagedCodeSecurity] 157 private static extern int cucul_put_str(IntPtr cv, 158 int x, int y, string c); 159 public int putStr(int x, int y, string c) 160 { 161 return cucul_put_str(_cv, x, y, c); 162 } 163 164 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 165 SuppressUnmanagedCodeSecurity] 166 private static extern int cucul_get_attr(IntPtr cv, int x, int y); 167 public int getAttr(int x, int y) 168 { 169 return cucul_get_attr(_cv, x, y); 170 } 171 172 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 173 SuppressUnmanagedCodeSecurity] 174 private static extern int cucul_set_attr(IntPtr cv, int a); 175 public int setAttr(int a) 176 { 177 return cucul_set_attr(_cv, a); 178 } 179 180 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 181 SuppressUnmanagedCodeSecurity] 182 private static extern int cucul_put_attr(IntPtr cv, 183 int x, int y, int a); 184 public int putAttr(int x, int y, int a) 185 { 186 return cucul_put_attr(_cv, x, y, a); 187 } 188 189 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 190 SuppressUnmanagedCodeSecurity] 191 private static extern int cucul_set_color_ansi(IntPtr cv, 192 byte fg, byte bg); 193 public int setColorAnsi(int fg, int bg) 194 { 195 return cucul_set_color_ansi(_cv, (byte)fg, (byte)bg); 196 } 197 198 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 199 SuppressUnmanagedCodeSecurity] 200 private static extern int cucul_set_color_argb(IntPtr cv, 201 int fg, int bg); 202 public int setColorArgb(int fg, int bg) 203 { 204 return cucul_set_color_argb(_cv, fg, bg); 205 } 206 207 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 208 SuppressUnmanagedCodeSecurity] 209 private static extern int cucul_clear_canvas(IntPtr cv); 203 210 public int Clear() 204 211 { 205 return cucul_clear_canvas(cv); 206 } 207 208 public int Blit(int x, int y, CuculCanvas cv1, CuculCanvas cv2) 209 { 210 return cucul_blit(cv, x, y, cv1.get_cucul_t(), cv2.get_cucul_t()); 211 } 212 212 return cucul_clear_canvas(_cv); 213 } 214 215 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 216 SuppressUnmanagedCodeSecurity] 217 private static extern int cucul_set_canvas_handle(IntPtr cv, 218 int x, int y); 219 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 220 SuppressUnmanagedCodeSecurity] 221 private static extern int cucul_get_canvas_handle_x(IntPtr cv); 222 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 223 SuppressUnmanagedCodeSecurity] 224 private static extern int cucul_get_canvas_handle_y(IntPtr cv); 225 public int handleX 226 { 227 get { return cucul_get_canvas_handle_x(_cv); } 228 set { cucul_set_canvas_handle(_cv, value, 229 cucul_get_canvas_handle_y(_cv)); } 230 } 231 232 public int handleY 233 { 234 get { return cucul_get_canvas_handle_y(_cv); } 235 set { cucul_set_canvas_handle(_cv, cucul_get_canvas_handle_x(_cv), 236 value); } 237 } 238 239 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 240 SuppressUnmanagedCodeSecurity] 241 private static extern int cucul_blit(IntPtr cv, int x, int y, 242 IntPtr cv1, IntPtr cv2); 243 public int Blit(int x, int y, CuculCanvas canvas) 244 { 245 return cucul_blit(_cv, x, y, canvas._cv, IntPtr.Zero); 246 } 247 248 public int Blit(int x, int y, CuculCanvas cv, CuculCanvas mask) 249 { 250 return cucul_blit(_cv, x, y, cv._cv, mask._cv); 251 } 252 253 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 254 SuppressUnmanagedCodeSecurity] 255 private static extern int cucul_set_canvas_boundaries(IntPtr cv, 256 int x, int y, 257 int h, int w); 258 public int setBoundaries(int x, int y, int h, int w) 259 { 260 return cucul_set_canvas_boundaries(_cv, x, y, h, w); 261 } 262 263 /* canvas transformation */ 264 265 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 266 SuppressUnmanagedCodeSecurity] 267 private static extern int cucul_invert(IntPtr cv); 268 public int Invert() 269 { 270 return cucul_invert(_cv); 271 } 272 273 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 274 SuppressUnmanagedCodeSecurity] 275 private static extern int cucul_flip(IntPtr cv); 276 public int Flip() 277 { 278 return cucul_flip(_cv); 279 } 280 281 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 282 SuppressUnmanagedCodeSecurity] 283 private static extern int cucul_flop(IntPtr cv); 284 public int Flop() 285 { 286 return cucul_flop(_cv); 287 } 288 289 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 290 SuppressUnmanagedCodeSecurity] 291 private static extern int cucul_rotate_180(IntPtr cv); 292 public int Rotate180() 293 { 294 return cucul_rotate_180(_cv); 295 } 296 297 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 298 SuppressUnmanagedCodeSecurity] 299 private static extern int cucul_rotate_left(IntPtr cv); 300 public int RotateLeft() 301 { 302 return cucul_rotate_left(_cv); 303 } 304 305 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 306 SuppressUnmanagedCodeSecurity] 307 private static extern int cucul_rotate_right(IntPtr cv); 308 public int RotateRight() 309 { 310 return cucul_rotate_right(_cv); 311 } 312 313 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 314 SuppressUnmanagedCodeSecurity] 315 private static extern int cucul_stretch_left(IntPtr cv); 316 public int StretchLeft() 317 { 318 return cucul_stretch_left(_cv); 319 } 320 321 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 322 SuppressUnmanagedCodeSecurity] 323 private static extern int cucul_stretch_right(IntPtr cv); 324 public int StretchRight() 325 { 326 return cucul_stretch_right(_cv); 327 } 328 329 /* primitives drawing */ 330 /* FIXME: highly incomplete */ 331 332 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 333 SuppressUnmanagedCodeSecurity] 334 private static extern int cucul_draw_line(IntPtr cv, int x1, int y1, int x2, int y2, int c); 213 335 public int drawLine(int x1, int y1, int x2, int y2, int c) 214 336 { 215 return cucul_draw_line(cv, x1, y1, x2, y2, c); 216 } 217 218 public int putStr(int x, int y, string c) 219 { 220 return cucul_putstr(cv, x, y, c); 221 } 222 223 public int gotoXY(int x, int y) 224 { 225 return cucul_gotoxy(cv, x, y); 226 } 227 228 public int getCursorX() 229 { 230 return cucul_get_cursor_x(cv); 231 } 232 233 public int getCursorY() 234 { 235 return cucul_get_cursor_y(cv); 236 } 237 238 public int getChar(int x, int y) 239 { 240 return cucul_get_char(cv, x, y); 241 } 242 243 public int getAttr(int x, int y) 244 { 245 return cucul_get_attr(cv, x, y); 246 } 247 248 public int setAttr(int a) 249 { 250 return cucul_set_attr(cv, a); 251 } 252 253 public int setAttr(int x, int y, int a) 254 { 255 return cucul_put_attr(cv, x, y, a); 256 } 257 258 public int setColorANSI(int fg, int bg) 259 { 260 return cucul_set_color_ansi(cv, fg, bg); 261 } 262 263 public int setColorARGB(int fg, int bg) 264 { 265 return cucul_set_color_ansi(cv, fg, bg); 266 } 267 268 public int setCanvasHandle(int x, int y) 269 { 270 return cucul_set_canvas_handle(cv, x, y); 271 } 272 273 public int getCanvasHandleX() 274 { 275 return cucul_get_canvas_handle_x(cv); 276 } 277 278 public int getCanvasHandleY() 279 { 280 return cucul_get_canvas_handle_y(cv); 281 } 282 283 public int setCanvasHandleY(int x, int y, int h, int w) 284 { 285 return cucul_set_canvas_boundaries(cv, x, y, h, w); 286 } 287 288 289 290 public int Invert() 291 { 292 return cucul_invert(cv); 293 } 294 295 public int Flip() 296 { 297 return cucul_flip(cv); 298 } 299 300 public int Flop() 301 { 302 return cucul_flop(cv); 303 } 304 305 public int Rotate() 306 { 307 return cucul_rotate(cv); 308 } 309 310 311 public int AttrToANSI(Int64 a) 312 { 313 return cucul_attr_to_ansi(a); 314 } 315 316 public int AttrToANSIFg(Int64 a) 317 { 318 return cucul_attr_to_ansi_fg(a); 319 } 320 321 public int AttrToANSIBg(Int64 a) 322 { 323 return cucul_attr_to_ansi_bg(a); 324 } 325 326 327 328 337 return cucul_draw_line(_cv, x1, y1, x2, y2, c); 338 } 339 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 340 SuppressUnmanagedCodeSecurity] 341 private static extern int cucul_draw_polyline(IntPtr cv, int[] x, int[] y, int n, IntPtr c); 342 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 343 SuppressUnmanagedCodeSecurity] 344 private static extern int cucul_draw_thin_line(IntPtr cv, int x1, int y1, int x2, int y2); 345 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 346 SuppressUnmanagedCodeSecurity] 347 private static extern int cucul_draw_thin_polyline(IntPtr cv, int[] x, int[] y, int n); 348 349 /* frame handling */ 350 /* FIXME: clean up this shit */ 351 352 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 353 SuppressUnmanagedCodeSecurity] 354 private static extern int cucul_get_frame_count(IntPtr cv); 355 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 356 SuppressUnmanagedCodeSecurity] 357 private static extern int cucul_set_frame(IntPtr cv, int f); 358 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 359 SuppressUnmanagedCodeSecurity] 360 private static extern string cucul_get_frame_name(IntPtr cv); 361 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 362 SuppressUnmanagedCodeSecurity] 363 private static extern int cucul_set_frame_name(IntPtr cv, string n); 364 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 365 SuppressUnmanagedCodeSecurity] 366 private static extern int cucul_create_frame(IntPtr cv, int f); 367 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 368 SuppressUnmanagedCodeSecurity] 369 private static extern int cucul_free_frame(IntPtr cv, int f); 329 370 330 371 public int getFrameCount() 331 372 { 332 return cucul_get_frame_count( cv);373 return cucul_get_frame_count(_cv); 333 374 } 334 375 335 376 public int setFrame(int f) 336 377 { 337 return cucul_set_frame( cv, f);378 return cucul_set_frame(_cv, f); 338 379 } 339 380 340 381 public string getFrameName() 341 382 { 342 return cucul_get_frame_name( cv);383 return cucul_get_frame_name(_cv); 343 384 } 344 385 345 386 public int setFrameName(string n) 346 387 { 347 return cucul_set_frame_name( cv, n);388 return cucul_set_frame_name(_cv, n); 348 389 } 349 390 350 391 public int createFrame(int f) 351 392 { 352 return cucul_create_frame( cv, f);393 return cucul_create_frame(_cv, f); 353 394 } 354 395 355 396 public int freeFrame(int f) 356 397 { 357 return cucul_free_frame(cv, f); 358 } 359 360 361 362 /* Privates methods, are not meant to be called by user*/ 363 364 public IntPtr get_cucul_t() 365 { 366 return cv; 367 } 368 398 return cucul_free_frame(_cv, f); 399 } 369 400 } 370 401 371 372 402 public unsafe class CuculAttr 403 { 404 private int _attr; 405 406 public CuculAttr(int attr) 407 { 408 attr = _attr; 409 } 410 411 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 412 SuppressUnmanagedCodeSecurity] 413 private static extern byte cucul_attr_to_ansi(Int32 a); 414 public byte toAnsi() 415 { 416 return cucul_attr_to_ansi(_attr); 417 } 418 419 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 420 SuppressUnmanagedCodeSecurity] 421 private static extern byte cucul_attr_to_ansi_fg(Int32 a); 422 public byte toAnsiFg() 423 { 424 return cucul_attr_to_ansi_fg(_attr); 425 } 426 427 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 428 SuppressUnmanagedCodeSecurity] 429 private static extern byte cucul_attr_to_ansi_bg(Int32 a); 430 public byte toAnsiBg() 431 { 432 return cucul_attr_to_ansi_bg(_attr); 433 } 434 } 373 435 374 436 public unsafe class CuculDither : IDisposable 375 437 { 376 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 377 public static extern IntPtr cucul_create_dither(int bpp, int w, 438 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 439 SuppressUnmanagedCodeSecurity] 440 private static extern IntPtr cucul_create_dither(int bpp, int w, 378 441 int h, int pitch, 379 442 Int64 rmask, … … 383 446 384 447 385 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 386 public static extern int cucul_set_dither_palette(IntPtr d, 387 int[] r, int[] g, 388 int[] b, int[] a); 389 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 390 public static extern int cucul_set_dither_brightness(IntPtr d, float b); 391 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 392 public static extern int cucul_set_dither_gamma(IntPtr d, float g); 393 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 394 public static extern int cucul_set_dither_contrast(IntPtr d, float c); 395 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 396 public static extern int cucul_set_dither_invert(IntPtr d, int i); 397 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 398 public static extern int cucul_set_dither_antialias(IntPtr d, string s); 399 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 400 public static extern string[] cucul_get_dither_antialias_list(IntPtr d); 401 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 402 public static extern int cucul_set_dither_color(IntPtr d, string s); 403 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 404 public static extern string[] cucul_get_dither_color_list(IntPtr d); 405 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 406 public static extern int cucul_set_dither_charset(IntPtr d, string s); 407 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 408 public static extern string[] cucul_get_dither_charset_list(IntPtr d); 409 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 410 public static extern int cucul_set_dither_mode(IntPtr d, string s); 411 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 412 public static extern string[] cucul_get_dither_mode_list(IntPtr d); 413 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 414 public static extern int cucul_free_dither(IntPtr d); 415 416 /* FIXME [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 417 int cucul_dither_bitmap(Canvas c,int x, int y, int w , int y, 448 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 449 SuppressUnmanagedCodeSecurity] 450 private static extern int cucul_set_dither_palette(IntPtr d, 451 int[] r, int[] g, 452 int[] b, int[] a); 453 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 454 SuppressUnmanagedCodeSecurity] 455 private static extern int cucul_set_dither_brightness(IntPtr d, float b); 456 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 457 SuppressUnmanagedCodeSecurity] 458 private static extern int cucul_set_dither_gamma(IntPtr d, float g); 459 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 460 SuppressUnmanagedCodeSecurity] 461 private static extern int cucul_set_dither_contrast(IntPtr d, float c); 462 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 463 SuppressUnmanagedCodeSecurity] 464 private static extern int cucul_set_dither_invert(IntPtr d, int i); 465 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 466 SuppressUnmanagedCodeSecurity] 467 private static extern int cucul_set_dither_antialias(IntPtr d, string s); 468 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 469 SuppressUnmanagedCodeSecurity] 470 private static extern string[] cucul_get_dither_antialias_list(IntPtr d); 471 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 472 SuppressUnmanagedCodeSecurity] 473 private static extern int cucul_set_dither_color(IntPtr d, string s); 474 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 475 SuppressUnmanagedCodeSecurity] 476 private static extern string[] cucul_get_dither_color_list(IntPtr d); 477 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 478 SuppressUnmanagedCodeSecurity] 479 private static extern int cucul_set_dither_charset(IntPtr d, string s); 480 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 481 SuppressUnmanagedCodeSecurity] 482 private static extern string[] cucul_get_dither_charset_list(IntPtr d); 483 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 484 SuppressUnmanagedCodeSecurity] 485 private static extern int cucul_set_dither_mode(IntPtr d, string s); 486 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 487 SuppressUnmanagedCodeSecurity] 488 private static extern string[] cucul_get_dither_mode_list(IntPtr d); 489 [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 490 SuppressUnmanagedCodeSecurity] 491 private static extern int cucul_free_dither(IntPtr d); 492 493 /* FIXME [DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl), 494 SuppressUnmanagedCodeSecurity] 495 int cucul_dither_bitmap(Canvas c, int x, int y, int w , int y, 418 496 IntPtr d2, void *);*/ 419 497 420 421 422 IntPtr dither; 498 IntPtr _dither; 423 499 424 500 public CuculDither(int bpp, int w,int h, int pitch, 425 501 Int64 rmask, Int64 gmask,Int64 bmask, Int64 amask) 426 502 { 427 dither = cucul_create_dither(bpp, w, h, pitch, rmask, gmask, bmask, amask);503 _dither = cucul_create_dither(bpp, w, h, pitch, rmask, gmask, bmask, amask); 428 504 } 429 505 430 506 public void Dispose() 431 507 { 432 cucul_free_dither( dither);508 cucul_free_dither(_dither); 433 509 GC.SuppressFinalize(this); 434 510 } … … 436 512 public int setBrightness(float b) 437 513 { 438 return cucul_set_dither_brightness( dither, b);514 return cucul_set_dither_brightness(_dither, b); 439 515 } 440 516 441 517 public int setGamma(float g) 442 518 { 443 return cucul_set_dither_gamma( dither, g);519 return cucul_set_dither_gamma(_dither, g); 444 520 } 445 521 446 522 public int setContrast(float c) 447 523 { 448 return cucul_set_dither_contrast( dither, c);524 return cucul_set_dither_contrast(_dither, c); 449 525 } 450 526 451 527 public int setInvert(int i) 452 528 { 453 return cucul_set_dither_invert( dither, i);529 return cucul_set_dither_invert(_dither, i); 454 530 } 455 531 456 532 public int setAntialias(string s) 457 533 { 458 return cucul_set_dither_antialias( dither, s);534 return cucul_set_dither_antialias(_dither, s); 459 535 } 460 536 461 537 public int setColor(string s) 462 538 { 463 return cucul_set_dither_color( dither, s);539 return cucul_set_dither_color(_dither, s); 464 540 } 465 541 466 542 public int setCharset(string s) 467 543 { 468 return cucul_set_dither_charset( dither, s);544 return cucul_set_dither_charset(_dither, s); 469 545 } 470 546 471 547 public int setMode(string s) 472 548 { 473 return cucul_set_dither_mode( dither, s);549 return cucul_set_dither_mode(_dither, s); 474 550 } 475 551 476 552 /* <FIXME> */ 477 public string[] getAntialiasList() 478 { 479 return cucul_get_dither_antialias_list( dither);480 } 481 482 public string[] getColorList() 483 { 484 return cucul_get_dither_color_list( dither);485 } 486 487 public string[] getCharsetList() 488 { 489 return cucul_get_dither_charset_list( dither);490 } 491 492 public string[] getModeList() 493 { 494 return cucul_get_dither_mode_list( dither);553 public string[] getAntialiasList() 554 { 555 return cucul_get_dither_antialias_list(_dither); 556 } 557 558 public string[] getColorList() 559 { 560 return cucul_get_dither_color_list(_dither); 561 } 562 563 public string[] getCharsetList() 564 { 565 return cucul_get_dither_charset_list(_dither); 566 } 567 568 public string[] getModeList() 569 { 570 return cucul_get_dither_mode_list(_dither); 495 571 } 496 572 497 573 /* </FIXME> */ 498 574 } 499 500 575 } 501 576 502 -
libcaca/trunk/csharp/test.cs
r2045 r2046 27 27 Console.WriteLine("libcaca .NET test"); 28 28 Console.WriteLine("(c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org>"); 29 29 30 30 /* Instanciate a cucul canvas */ 31 31 CuculCanvas cv = new CuculCanvas(); 32 32 33 34 /* Random number. This is a static method, 33 34 /* Random number. This is a static method, 35 35 not to be used with previous instance */ 36 36 Console.WriteLine("A random number : {0}", Libcucul.Rand(0, 1337)); … … 47 47 Int32 y = 0; 48 48 Event e = new Event(); 49 Int32i;50 49 int i; 50 51 51 DateTime startTime = DateTime.Now; 52 52 while(dp.getEvent(Event.type.KEY_RELEASE, e, 10) == 0) … … 54 54 TimeSpan curTime = DateTime.Now - startTime; 55 55 double t = curTime.TotalMilliseconds; 56 cv.setColor (Libcucul.WHITE, Libcucul.BLACK);57 for(i=0; i<barCount;i++) 56 cv.setColorAnsi(Libcucul.WHITE, Libcucul.BLACK); 57 for(i=0; i<barCount;i++) 58 58 { 59 v = ((Math.Sin((t/500.0)+(i/((double)barCount)))+1)/2)*cv. getHeight();59 v = ((Math.Sin((t/500.0)+(i/((double)barCount)))+1)/2)*cv.height; 60 60 y = (Int32) v; 61 61 62 63 62 64 cv.setColor(i+9, Libcucul.BLACK); 63 64 cv.setColorAnsi(i+9, Libcucul.BLACK); 65 65 /* drawLine is already clipped, we don't care about overflows */ 66 cv.drawLine(0, y-2, cv. getWidth(), y-2, '-');67 cv.drawLine(0, y-1, cv. getWidth(), y-1, '*');68 cv.drawLine(0, y, cv. getWidth(), y, '#');69 cv.drawLine(0, y+1, cv. getWidth(), y+1, '*');70 cv.drawLine(0, y+2, cv. getWidth(), y+2, '-');66 cv.drawLine(0, y-2, cv.width, y-2, '-'); 67 cv.drawLine(0, y-1, cv.width, y-1, '*'); 68 cv.drawLine(0, y, cv.width, y, '#'); 69 cv.drawLine(0, y+1, cv.width, y+1, '*'); 70 cv.drawLine(0, y+2, cv.width, y+2, '-'); 71 71 } 72 72 73 cv.setColor (Libcucul.WHITE, Libcucul.BLUE);74 cv.putStr(cv. getWidth() - 30,cv.getHeight()- 2," -=[ Powered by libcaca ]=- ");75 cv.setColor (Libcucul.WHITE, Libcucul.BLACK);76 73 cv.setColorAnsi(Libcucul.WHITE, Libcucul.BLUE); 74 cv.putStr(cv.width - 30,cv.height - 2," -=[ Powered by libcaca ]=- "); 75 cv.setColorAnsi(Libcucul.WHITE, Libcucul.BLACK); 76 77 77 78 78 dp.Refresh(); 79 79 cv.Clear(); 80 80 81 81 } 82 82
Note: See TracChangeset
for help on using the changeset viewer.