Changeset 2045 for libcaca/trunk/csharp/Caca.cs
- Timestamp:
- Nov 24, 2007, 2:26:33 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/csharp/Caca.cs
r2044 r2045 1 1 /* 2 * CacaSharp.NET bindings for libcaca2 * libcaca .NET bindings for libcaca 3 3 * Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org> 4 4 * All Rights Reserved … … 13 13 */ 14 14 15 16 17 15 using System; 18 16 using System.Runtime.InteropServices; 19 17 using System.Security; 20 18 21 using libCucul;19 using Cucul; 22 20 23 24 namespace libCaca 25 { 21 namespace Caca 22 { 26 23 27 24 enum Keys … … 86 83 87 84 88 public unsafe class Caca: IDisposable85 public unsafe class Display : IDisposable 89 86 { 90 [DllImport("lib Caca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]87 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 91 88 public static extern IntPtr caca_create_display(IntPtr qq); 92 [DllImport("lib Caca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]89 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 93 90 public static extern void caca_free_display(IntPtr kk); 94 [DllImport("lib Caca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]91 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 95 92 public static extern void caca_refresh_display(IntPtr kk); 96 [DllImport("lib Caca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]93 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 97 94 public static extern void caca_set_display_time(IntPtr kk, Int32 d); 98 [DllImport("lib Caca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]95 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 99 96 public static extern Int32 caca_get_display_time(IntPtr kk); 100 [DllImport("lib Caca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]97 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 101 98 public static extern Int32 caca_get_display_width(IntPtr kk); 102 [DllImport("lib Caca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]99 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 103 100 public static extern Int32 caca_get_display_height(IntPtr kk); 104 [DllImport("lib Caca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]101 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 105 102 public static extern Int32 caca_set_display_title(IntPtr kk, string t); 106 [DllImport("lib Caca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]103 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 107 104 public static extern Int32 caca_get_event(IntPtr k, Event.type t, Event e, Int32 timeout); 108 [DllImport("lib Caca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]105 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 109 106 public static extern Int32 caca_get_mouse_x(IntPtr k); 110 [DllImport("lib Caca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]107 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 111 108 public static extern Int32 caca_get_mouse_y(IntPtr k); 112 [DllImport("lib Caca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]109 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 113 110 public static extern void caca_set_mouse(IntPtr k, bool status); 114 111 … … 120 117 IntPtr kk; 121 118 122 public Caca(Cuculqqt)123 119 public Display(CuculCanvas qqt) 120 { 124 121 qq = qqt.get_cucul_t(); 125 122 kk = caca_create_display(qq); 126 123 } 127 124 public void Dispose() 128 125 { 129 126 caca_free_display(kk); 130 127 GC.SuppressFinalize(this); 131 128 } 132 129 public void Refresh() 133 130 { 134 131 caca_refresh_display(kk); 135 132 } 136 133 public void setDisplayTime(Int32 d) 137 134 { 138 135 caca_set_display_time(kk, d); 139 136 } 140 137 public Int32 getDisplayTime() 141 138 { 142 139 return caca_get_display_time(kk); 143 140 } 144 141 public Int32 getDisplayWidth() 145 142 { 146 143 return caca_get_display_width(kk); 147 144 } 148 145 public Int32 getDisplayHeight() 149 146 { 150 147 return caca_get_display_height(kk); 151 148 } 152 149 public Int32 setDisplayTitle(string t) 153 150 { 154 151 return caca_set_display_title(kk, t); 155 152 } 156 153 public Int32 getEvent(Event.type t, Event e, Int32 timeout) 157 154 { 158 155 return caca_get_event(kk, t, e, timeout); 159 156 } 160 157 public Int32 getMouseX() 161 158 { 162 159 return caca_get_mouse_x(kk); 163 160 } 164 161 public Int32 getMouseY() 165 162 { 166 163 return caca_get_mouse_y(kk); 167 164 } 168 165 public void caca_set_mouse(bool status) 169 166 { 170 167 caca_set_mouse(kk, status); 171 168 } 172 169 173 170 … … 178 175 179 176 public IntPtr get_caca_t() 180 177 { 181 178 return kk; 182 }183 184 185 179 } 186 } 180 } 181 }
Note: See TracChangeset
for help on using the changeset viewer.