annotate dwt/internal/mozilla/nsID.d @ 156:969e7de37c3d default tip

Fixes to get dwt to work with dmd and ldc
author Jacob Carlborg <doob@me.com>
date Wed, 08 Jul 2009 21:56:44 +0200
parents 5583f8eeee6c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
45
d8635bb48c7c Merge with SWT 3.5
Jacob Carlborg <doob@me.com>
parents:
diff changeset
1 module dwt.internal.mozilla.nsID;
d8635bb48c7c Merge with SWT 3.5
Jacob Carlborg <doob@me.com>
parents:
diff changeset
2
125
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
3 import dwt.internal.mozilla.Common;
45
d8635bb48c7c Merge with SWT 3.5
Jacob Carlborg <doob@me.com>
parents:
diff changeset
4 import dwt.dwthelper.utils;
d8635bb48c7c Merge with SWT 3.5
Jacob Carlborg <doob@me.com>
parents:
diff changeset
5
125
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
6 align(1)
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
7 struct nsID
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
8 {
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
9 PRUint32 m0;
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
10 PRUint16 m1;
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
11 PRUint16 m2;
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
12 PRUint8[8] m3;
45
d8635bb48c7c Merge with SWT 3.5
Jacob Carlborg <doob@me.com>
parents:
diff changeset
13
125
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
14 static nsID opCall(String aIDStr)
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
15 {
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
16 nsID id;
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
17 if(aIDStr == null) throw new ParseException();
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
18 int i = 0;
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
19 with(id) {
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
20 for (; i < 8; i++) m0 = (m0 << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16);
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
21 if (aIDStr.charAt (i) != '-') throw new ParseException ();
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
22 i++;
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
23 for (; i < 13; i++) m1 = cast(short)((m1 << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
24 if (aIDStr.charAt (i) != '-') throw new ParseException ();
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
25 i++;
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
26 for (; i < 18; i++) m2 = cast(short)((m2 << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
27 if (aIDStr.charAt (i) != '-') throw new ParseException ();
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
28 i++;
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
29 for (; i < 21; i++) m3[0] = cast(byte)((m3[0] << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
30 for (; i < 23; i++) m3[1] = cast(byte)((m3[1] << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
31 if (aIDStr.charAt (i) != '-') throw new ParseException ();
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
32 i++;
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
33 for (; i < 26; i++) m3[2] = cast(byte)((m3[2] << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
34 for (; i < 28; i++) m3[3] = cast(byte)((m3[3] << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
35 for (; i < 30; i++) m3[4] = cast(byte)((m3[4] << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
36 for (; i < 32; i++) m3[5] = cast(byte)((m3[5] << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
37 for (; i < 34; i++) m3[6] = cast(byte)((m3[6] << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
38 for (; i < 36; i++) m3[7] = cast(byte)((m3[7] << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
39 }
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
40 return id;
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
41 }
45
d8635bb48c7c Merge with SWT 3.5
Jacob Carlborg <doob@me.com>
parents:
diff changeset
42
d8635bb48c7c Merge with SWT 3.5
Jacob Carlborg <doob@me.com>
parents:
diff changeset
43 }
d8635bb48c7c Merge with SWT 3.5
Jacob Carlborg <doob@me.com>
parents:
diff changeset
44
125
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
45 alias nsID nsCID;
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
46 alias nsID nsIID;