Mercurial > projects > dwt-mac
diff dwt/internal/C.d @ 1:8b48be5454ce
The internal cocoa classes compile now
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Tue, 19 Aug 2008 17:35:17 +0200 |
parents | 380af2bdd8e5 |
children | a329f9c3d66d |
line wrap: on
line diff
--- a/dwt/internal/C.d Sat Aug 09 17:00:02 2008 +0200 +++ b/dwt/internal/C.d Tue Aug 19 17:35:17 2008 +0200 @@ -13,36 +13,53 @@ *******************************************************************************/ module dwt.internal.C; -public import tango.stdc.stdlib : free, malloc, getenv; -public import tango.stdc.string : memmove, memset, strlen; +import stdc = tango.stdc.stdlib : free, malloc, getenv; +import stdc = tango.stdc.string : memmove, memset, strlen; -import dwt.dwthelper.utils; import dwt.internal.Library; import dwt.internal.Platform; -public class C : Platform -{ +public class C : Platform { + + /*static { + if ("Linux".equals (System.getProperty ("os.name")) && "motif".equals (Platform.PLATFORM)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + try { + Library.loadLibrary ("libXm.so.2", false); //$NON-NLS-1$ + } catch (Throwable ex) {} + } + Library.loadLibrary ("swt"); //$NON-NLS-1$ + }*/ + + public static const int PTR_SIZEOF = (void*).sizeof; - /*static this () - { - if ("Linux".opEquals(System.getProperty("os.name")) && "motif".opEquals( - Platform.PLATFORM)) - { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - try - { - Library.loadLibrary("libXm.so.2", false); //$NON-NLS-1$ - } - catch (Exception ex) - { - } - } - - Library.loadLibrary("swt"); //$NON-NLS-1$ - }*/ + alias stdc.free free; + alias stdc.getenv getenv; + alias stdc.malloc malloc; + alias stdc.memset memset; + alias stdc.memmove memmove; + alias stdc.strlen strlen; - alias tango.stdc.string.memmove MoveMemory; - - //public static final int PTR_SIZEOF = PTR_sizeof(); - - //public static final native int PTR_sizeof (); +/+public static final native void free (int /*long*/ ptr); +public static final native int /*long*/ getenv (byte[] wcsToMbcs); +public static final native int /*long*/ malloc (int /*long*/ size); +public static final native void memmove (int /*long*/ dest, byte[] src, int /*long*/ size); +public static final native void memmove (int /*long*/ dest, char[] src, int /*long*/ size); +public static final native void memmove (int /*long*/ dest, double[] src, int /*long*/ size); +public static final native void memmove (int /*long*/ dest, float[] src, int /*long*/ size); +public static final native void memmove (int /*long*/ dest, int[] src, int /*long*/ size); +public static final native void memmove (int /*long*/ dest, long[] src, int /*long*/ size); +public static final native void memmove (int /*long*/ dest, short[] src, int /*long*/ size); +public static final native void memmove (byte[] dest, char[] src, int /*long*/ size); +public static final native void memmove (byte[] dest, int /*long*/ src, int /*long*/ size); +public static final native void memmove (int /*long*/ dest, int /*long*/ src, int /*long*/ size); +public static final native void memmove (char[] dest, int /*long*/ src, int /*long*/ size); +public static final native void memmove (double[] dest, int /*long*/ src, int /*long*/ size); +public static final native void memmove (float[] dest, int /*long*/ src, int /*long*/ size); +public static final native void memmove (int[] dest, byte[] src, int /*long*/ size); +public static final native void memmove (short[] dest, int /*long*/ src, int /*long*/ size); +public static final native void memmove (int[] dest, int /*long*/ src, int /*long*/ size); +public static final native void memmove (long[] dest, int /*long*/ src, int /*long*/ size); +public static final native int /*long*/ memset (int /*long*/ buffer, int c, int /*long*/ num); +public static final native int PTR_sizeof (); +public static final native int strlen (int /*long*/ s);+/ }