annotate dwt/internal/mozilla/nsISupports.d @ 154:535243e6d16a

Fixes to make dwt compile with ldc
author Jacob Carlborg <doob@me.com>
date Sat, 13 Jun 2009 00:25:05 +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.nsISupports;
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;
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
4 import dwt.internal.mozilla.nsID;
45
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 const char[] NS_ISUPPORTS_IID_STR = "00000000-0000-0000-c000-000000000046";
45
d8635bb48c7c Merge with SWT 3.5
Jacob Carlborg <doob@me.com>
parents:
diff changeset
7
125
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
8 const nsIID NS_ISUPPORTS_IID=
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
9 { 0x00000000, 0x0000, 0x0000,
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
10 [ 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 ] };
45
d8635bb48c7c Merge with SWT 3.5
Jacob Carlborg <doob@me.com>
parents:
diff changeset
11
125
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
12 interface IUnknown
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
13 {
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
14 static const char[] IID_STR = NS_ISUPPORTS_IID_STR;
154
535243e6d16a Fixes to make dwt compile with ldc
Jacob Carlborg <doob@me.com>
parents: 125
diff changeset
15 static /*const*/ nsIID IID = NS_ISUPPORTS_IID; // const causes bug in ldc TODO
45
d8635bb48c7c Merge with SWT 3.5
Jacob Carlborg <doob@me.com>
parents:
diff changeset
16
154
535243e6d16a Fixes to make dwt compile with ldc
Jacob Carlborg <doob@me.com>
parents: 125
diff changeset
17 extern(System): //causes assert in ldc TODO
125
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
18 nsresult QueryInterface( nsIID* uuid, void **result);
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
19 nsrefcnt AddRef();
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
20 nsrefcnt Release();
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
21 }
45
d8635bb48c7c Merge with SWT 3.5
Jacob Carlborg <doob@me.com>
parents:
diff changeset
22
125
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
23 // WHY WE USE COM's IUnknown for XPCOM:
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
24 //
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
25 // The IUnknown interface is special-cased in D and is specifically designed to be
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
26 // compatible with MS COM. XPCOM's nsISupports interface is the exact equivalent
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
27 // of IUnknown so we alias it here to take advantage of D's COM support. -JJR
45
d8635bb48c7c Merge with SWT 3.5
Jacob Carlborg <doob@me.com>
parents:
diff changeset
28
125
5583f8eeee6c Synced mozilla with dwt-linux
Jacob Carlborg <doob@me.com>
parents: 45
diff changeset
29 alias IUnknown nsISupports;