Ignore:
Timestamp:
Nov 24, 2007, 2:26:33 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Some mass-renaming in the C# bindings: + Renamed the dlls so that the C# versions do not have the same name

as the C DLLs on Win32. It's now "cucul-sharp.dll", mimicking GTK#.

+ Renamed namespaces: "using Cucul" instead of "using libCucul".
+ Renamed the Cucul class into CuculCanvas? to avoid namespace/class

name collisions.

+ Renamed old-fashioned "kk"/"qq" names into "dp"/"cv".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/csharp/Caca.cs

    r2044 r2045  
    11/*
    2  *  CacaSharp      .NET bindings for libcaca
     2 *  libcaca    .NET bindings for libcaca
    33 *  Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org>
    44 *                All Rights Reserved
     
    1313 */
    1414
    15 
    16 
    1715using System;
    1816using System.Runtime.InteropServices;
    1917using System.Security;
    2018
    21 using libCucul;
     19using Cucul;
    2220
    23 
    24 namespace libCaca
    25   {
     21namespace Caca
     22{
    2623
    2724  enum Keys
     
    8683
    8784
    88   public unsafe class Caca : IDisposable
     85  public unsafe class Display : IDisposable
    8986    {
    90     [DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
     87    [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
    9188      public static extern IntPtr caca_create_display(IntPtr qq);
    92     [DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
     89    [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
    9390      public static extern void caca_free_display(IntPtr kk);
    94     [DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
     91    [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
    9592      public static extern void caca_refresh_display(IntPtr kk);
    96     [DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
     93    [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
    9794      public static extern void caca_set_display_time(IntPtr kk, Int32 d);
    98     [DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
     95    [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
    9996      public static extern Int32 caca_get_display_time(IntPtr kk);
    100     [DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
     97    [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
    10198      public static extern Int32 caca_get_display_width(IntPtr kk);
    102     [DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
     99    [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
    103100      public static extern Int32 caca_get_display_height(IntPtr kk);
    104     [DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
     101    [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
    105102      public static extern Int32 caca_set_display_title(IntPtr kk, string t);
    106     [DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
     103    [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
    107104      public static extern Int32 caca_get_event(IntPtr k, Event.type t, Event e, Int32 timeout);
    108     [DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
     105    [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
    109106      public static extern Int32 caca_get_mouse_x(IntPtr k);
    110     [DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
     107    [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
    111108      public static extern Int32 caca_get_mouse_y(IntPtr k);
    112     [DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
     109    [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
    113110      public static extern void caca_set_mouse(IntPtr k, bool status);
    114111
     
    120117    IntPtr kk;
    121118
    122     public Caca(Cucul qqt)
    123         {
     119    public Display(CuculCanvas qqt)
     120    {
    124121        qq = qqt.get_cucul_t();
    125122        kk = caca_create_display(qq);
    126         }
     123    }
    127124    public void Dispose()
    128         {
     125    {
    129126        caca_free_display(kk);
    130127        GC.SuppressFinalize(this);
    131         }
     128    }
    132129    public void Refresh()
    133         {
     130    {
    134131        caca_refresh_display(kk);
    135         }
     132    }
    136133    public void setDisplayTime(Int32 d)
    137         {
     134    {
    138135        caca_set_display_time(kk, d);
    139         }
     136    }
    140137    public Int32 getDisplayTime()
    141         {
     138    {
    142139        return caca_get_display_time(kk);
    143         }
     140    }
    144141    public Int32 getDisplayWidth()
    145         {
     142    {
    146143        return caca_get_display_width(kk);
    147         }
     144    }
    148145    public Int32 getDisplayHeight()
    149         {
     146    {
    150147        return caca_get_display_height(kk);
    151         }
     148    }
    152149    public Int32 setDisplayTitle(string t)
    153         {
     150    {
    154151        return caca_set_display_title(kk, t);
    155         }
     152    }
    156153    public Int32 getEvent(Event.type t, Event e, Int32 timeout)
    157         {
     154    {
    158155        return caca_get_event(kk, t, e, timeout);
    159         }
     156    }
    160157    public Int32 getMouseX()
    161         {
     158    {
    162159        return caca_get_mouse_x(kk);
    163         }
     160    }
    164161    public Int32 getMouseY()
    165         {
     162    {
    166163        return caca_get_mouse_y(kk);
    167         }
     164    }
    168165    public void caca_set_mouse(bool status)
    169         {
     166    {
    170167        caca_set_mouse(kk, status);
    171         }
     168    }
    172169
    173170
     
    178175
    179176    public IntPtr get_caca_t()
    180         {
     177    {
    181178        return kk;
    182         }
    183 
    184 
    185179    }
    186   }
     180    }
     181}
Note: See TracChangeset for help on using the changeset viewer.