Explorar el Código

* Minor naming convention changes in the C# bindings.

tags/v0.99.beta14
Sam Hocevar sam hace 17 años
padre
commit
9c0f19ecc6
Se han modificado 3 ficheros con 20 adiciones y 21 borrados
  1. +12
    -12
      csharp/Caca.cs
  2. +2
    -3
      csharp/Cucul.cs
  3. +6
    -6
      csharp/test.cs

+ 12
- 12
csharp/Caca.cs Ver fichero

@@ -131,7 +131,7 @@ namespace Caca
[DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
SuppressUnmanagedCodeSecurity]
private static extern int caca_get_event_type(IntPtr ev);
public CacaEventType type
public CacaEventType Type
{
get { return (CacaEventType)caca_get_event_type(cevent); }
}
@@ -139,7 +139,7 @@ namespace Caca
[DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
SuppressUnmanagedCodeSecurity]
private static extern int caca_get_event_key_ch(IntPtr ev);
public int keyCh
public int KeyCh
{
get { return caca_get_event_key_ch(cevent); }
}
@@ -147,7 +147,7 @@ namespace Caca
[DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
SuppressUnmanagedCodeSecurity]
private static extern int caca_get_event_key_utf32(IntPtr ev);
public int keyUtf32
public int KeyUtf32
{
get { return caca_get_event_key_utf32(cevent); }
}
@@ -156,7 +156,7 @@ namespace Caca
SuppressUnmanagedCodeSecurity]
private static extern int caca_get_event_key_utf8(IntPtr ev,
IntPtr _utf8);
public string keyUtf8
public string KeyUtf8
{
get
{
@@ -168,7 +168,7 @@ namespace Caca
[DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
SuppressUnmanagedCodeSecurity]
private static extern int caca_get_event_mouse_button(IntPtr ev);
public int mouseButton
public int MouseButton
{
get { return caca_get_event_mouse_button(cevent); }
}
@@ -179,7 +179,7 @@ namespace Caca
[DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
SuppressUnmanagedCodeSecurity]
private static extern int caca_get_event_mouse_y(IntPtr ev);
public Point mousePos
public Point MousePos
{
get { return new Point(caca_get_event_mouse_x(cevent),
caca_get_event_mouse_y(cevent)); }
@@ -191,7 +191,7 @@ namespace Caca
[DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
SuppressUnmanagedCodeSecurity]
private static extern int caca_get_event_resize_height(IntPtr ev);
public Size resizeSize
public Size ResizeSize
{
get { return new Size(caca_get_event_resize_width(cevent),
caca_get_event_resize_height(cevent)); }
@@ -235,7 +235,7 @@ namespace Caca
[DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
SuppressUnmanagedCodeSecurity]
private static extern int caca_get_display_time(IntPtr dp);
public int displayTime
public int DisplayTime
{
get { return caca_get_display_time(_dp); }
set { caca_set_display_time(_dp, value); }
@@ -268,7 +268,7 @@ namespace Caca
[DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
SuppressUnmanagedCodeSecurity]
private static extern int caca_set_display_title(IntPtr dp, string t);
public string title
public string Title
{
set { caca_set_display_title(_dp, value); }
}
@@ -276,7 +276,7 @@ namespace Caca
[DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
SuppressUnmanagedCodeSecurity]
private static extern void caca_set_mouse(IntPtr k, bool status);
public bool mouse
public bool Mouse
{
set { caca_set_mouse(_dp, value); }
}
@@ -287,7 +287,7 @@ namespace Caca
[DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
SuppressUnmanagedCodeSecurity]
private static extern int caca_get_mouse_y(IntPtr k);
public Point mousePos
public Point MousePos
{
get { return new Point(caca_get_mouse_x(_dp),
caca_get_mouse_y(_dp)); }
@@ -296,7 +296,7 @@ namespace Caca
[DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
SuppressUnmanagedCodeSecurity]
private static extern void caca_set_cursor(IntPtr k, bool status);
public bool cursor
public bool Cursor
{
set { caca_set_cursor(_dp, value); }
}


+ 2
- 3
csharp/Cucul.cs Ver fichero

@@ -325,7 +325,6 @@ namespace Cucul
}

/* primitives drawing */
/* FIXME: highly incomplete */

[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl),
SuppressUnmanagedCodeSecurity]
@@ -508,7 +507,7 @@ namespace Cucul
[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl),
SuppressUnmanagedCodeSecurity]
private static extern int cucul_set_frame_name(IntPtr cv, string n);
public string frameName
public string FrameName
{
get { return cucul_get_frame_name(_cv); }
set { cucul_set_frame_name(_cv, value); }
@@ -553,7 +552,7 @@ namespace Cucul

public CuculAttr(int attr)
{
attr = _attr;
_attr = attr;
}

[DllImport("libcucul.dll", CallingConvention=CallingConvention.Cdecl),


+ 6
- 6
csharp/test.cs Ver fichero

@@ -91,8 +91,8 @@ class DemoDisplay : CacaDisplay

public DemoDisplay(DemoCanvas _cv) : base(_cv)
{
displayTime = 20000; // Refresh every 20 ms
title = "libcaca .NET Bindings test suite";
Title = "libcaca .NET Bindings test suite";
DisplayTime = 20000; // Refresh every 20 ms
cv = _cv;
}

@@ -100,17 +100,17 @@ class DemoDisplay : CacaDisplay
{
CacaEvent ev;

while((ev = getEvent(CacaEventType.KEY_RELEASE, 10)).type == 0)
while((ev = getEvent(CacaEventType.KEY_RELEASE, 10)).Type == 0)
{
cv.Draw();

Refresh();
}

if(ev.keyCh > 0x20 && ev.keyCh < 0x7f)
Console.WriteLine("Key pressed: {0}", ev.keyUtf8);
if(ev.KeyCh > 0x20 && ev.KeyCh < 0x7f)
Console.WriteLine("Key pressed: {0}", ev.KeyUtf8);
else
Console.WriteLine("Key pressed: 0x{0:x}", ev.keyCh);
Console.WriteLine("Key pressed: 0x{0:x}", ev.KeyCh);
}
}



Cargando…
Cancelar
Guardar