comparison 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
comparison
equal deleted inserted replaced
0:380af2bdd8e5 1:8b48be5454ce
11 * Port to the D Programming language: 11 * Port to the D Programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com> 12 * Jacob Carlborg <jacob.carlborg@gmail.com>
13 *******************************************************************************/ 13 *******************************************************************************/
14 module dwt.internal.C; 14 module dwt.internal.C;
15 15
16 public import tango.stdc.stdlib : free, malloc, getenv; 16 import stdc = tango.stdc.stdlib : free, malloc, getenv;
17 public import tango.stdc.string : memmove, memset, strlen; 17 import stdc = tango.stdc.string : memmove, memset, strlen;
18 18
19 import dwt.dwthelper.utils;
20 import dwt.internal.Library; 19 import dwt.internal.Library;
21 import dwt.internal.Platform; 20 import dwt.internal.Platform;
22 21
23 public class C : Platform 22 public class C : Platform {
24 {
25 23
26 /*static this () 24 /*static {
27 { 25 if ("Linux".equals (System.getProperty ("os.name")) && "motif".equals (Platform.PLATFORM)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
28 if ("Linux".opEquals(System.getProperty("os.name")) && "motif".opEquals( 26 try {
29 Platform.PLATFORM)) 27 Library.loadLibrary ("libXm.so.2", false); //$NON-NLS-1$
30 { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 28 } catch (Throwable ex) {}
31 try
32 {
33 Library.loadLibrary("libXm.so.2", false); //$NON-NLS-1$
34 }
35 catch (Exception ex)
36 {
37 }
38 } 29 }
39 30 Library.loadLibrary ("swt"); //$NON-NLS-1$
40 Library.loadLibrary("swt"); //$NON-NLS-1$
41 }*/ 31 }*/
32
33 public static const int PTR_SIZEOF = (void*).sizeof;
34
35 alias stdc.free free;
36 alias stdc.getenv getenv;
37 alias stdc.malloc malloc;
38 alias stdc.memset memset;
39 alias stdc.memmove memmove;
40 alias stdc.strlen strlen;
42 41
43 alias tango.stdc.string.memmove MoveMemory; 42 /+public static final native void free (int /*long*/ ptr);
44 43 public static final native int /*long*/ getenv (byte[] wcsToMbcs);
45 //public static final int PTR_SIZEOF = PTR_sizeof(); 44 public static final native int /*long*/ malloc (int /*long*/ size);
46 45 public static final native void memmove (int /*long*/ dest, byte[] src, int /*long*/ size);
47 //public static final native int PTR_sizeof (); 46 public static final native void memmove (int /*long*/ dest, char[] src, int /*long*/ size);
47 public static final native void memmove (int /*long*/ dest, double[] src, int /*long*/ size);
48 public static final native void memmove (int /*long*/ dest, float[] src, int /*long*/ size);
49 public static final native void memmove (int /*long*/ dest, int[] src, int /*long*/ size);
50 public static final native void memmove (int /*long*/ dest, long[] src, int /*long*/ size);
51 public static final native void memmove (int /*long*/ dest, short[] src, int /*long*/ size);
52 public static final native void memmove (byte[] dest, char[] src, int /*long*/ size);
53 public static final native void memmove (byte[] dest, int /*long*/ src, int /*long*/ size);
54 public static final native void memmove (int /*long*/ dest, int /*long*/ src, int /*long*/ size);
55 public static final native void memmove (char[] dest, int /*long*/ src, int /*long*/ size);
56 public static final native void memmove (double[] dest, int /*long*/ src, int /*long*/ size);
57 public static final native void memmove (float[] dest, int /*long*/ src, int /*long*/ size);
58 public static final native void memmove (int[] dest, byte[] src, int /*long*/ size);
59 public static final native void memmove (short[] dest, int /*long*/ src, int /*long*/ size);
60 public static final native void memmove (int[] dest, int /*long*/ src, int /*long*/ size);
61 public static final native void memmove (long[] dest, int /*long*/ src, int /*long*/ size);
62 public static final native int /*long*/ memset (int /*long*/ buffer, int c, int /*long*/ num);
63 public static final native int PTR_sizeof ();
64 public static final native int strlen (int /*long*/ s);+/
48 } 65 }