annotate dwt/browser/HelperAppLauncherDialogFactory.d @ 352:a3c5f744d03f

Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
author John Reimer <terminal.node@gmail.com>
date Tue, 04 Nov 2008 21:20:45 -0800
parents 9a4d7706df52
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
278
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
1 /*******************************************************************************
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
2 * Copyright (c) 2003, 2007 IBM Corporation and others.
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
3 * All rights reserved. This program and the accompanying materials
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
4 * are made available under the terms of the Eclipse Public License v1.0
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
5 * which accompanies this distribution, and is available at
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
6 * http://www.eclipse.org/legal/epl-v10.html
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
7 *
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
8 * Contributors:
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
9 * IBM Corporation - initial API and implementation
298
eec6ddb07873 More xpcom/mozilla port
John Reimer<terminal.node@gmail.com>
parents: 278
diff changeset
10 * Port to the D programming language:
eec6ddb07873 More xpcom/mozilla port
John Reimer<terminal.node@gmail.com>
parents: 278
diff changeset
11 * John Reimer <terminal.node@gmail.com>
278
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
12 *******************************************************************************/
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
13 module dwt.browser.HelperAppLauncherDialogFactory;
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
14
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
15 import dwt.dwthelper.utils;
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
16
341
942da4b6558a Ongoing fixup for compile
John Reimer <terminal.node@gmail.com>
parents: 298
diff changeset
17 import XPCOM = dwt.internal.mozilla.XPCOM;
352
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
18
341
942da4b6558a Ongoing fixup for compile
John Reimer <terminal.node@gmail.com>
parents: 298
diff changeset
19 import dwt.internal.mozilla.Common;
278
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
20 import dwt.internal.mozilla.nsID;
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
21 import dwt.internal.mozilla.nsIFactory;
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
22 import dwt.internal.mozilla.nsISupports;
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
23
341
942da4b6558a Ongoing fixup for compile
John Reimer <terminal.node@gmail.com>
parents: 298
diff changeset
24 import dwt.browser.HelperAppLauncherDialog;
352
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
25 import dwt.browser.HelperAppLauncherDialog_1_9;
341
942da4b6558a Ongoing fixup for compile
John Reimer <terminal.node@gmail.com>
parents: 298
diff changeset
26
298
eec6ddb07873 More xpcom/mozilla port
John Reimer<terminal.node@gmail.com>
parents: 278
diff changeset
27 class HelperAppLauncherDialogFactory : nsIFactory {
278
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
28 int refCount = 0;
352
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
29 bool isPre_1_9 = true;
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
30
278
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
31
298
eec6ddb07873 More xpcom/mozilla port
John Reimer<terminal.node@gmail.com>
parents: 278
diff changeset
32 this () {
278
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
33 }
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
34
348
9a4d7706df52 Test Update to fix linux XPCOM interface issues
John Reimer <terminal.node@gmail.com>
parents: 341
diff changeset
35 extern(System)
298
eec6ddb07873 More xpcom/mozilla port
John Reimer<terminal.node@gmail.com>
parents: 278
diff changeset
36 nsrefcnt AddRef () {
278
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
37 refCount++;
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
38 return refCount;
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
39 }
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
40
348
9a4d7706df52 Test Update to fix linux XPCOM interface issues
John Reimer <terminal.node@gmail.com>
parents: 341
diff changeset
41 extern(System)
298
eec6ddb07873 More xpcom/mozilla port
John Reimer<terminal.node@gmail.com>
parents: 278
diff changeset
42 nsresult QueryInterface (nsID* riid, void** ppvObject) {
eec6ddb07873 More xpcom/mozilla port
John Reimer<terminal.node@gmail.com>
parents: 278
diff changeset
43 if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
278
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
44
298
eec6ddb07873 More xpcom/mozilla port
John Reimer<terminal.node@gmail.com>
parents: 278
diff changeset
45 if (*riid == nsISupports.IID) {
eec6ddb07873 More xpcom/mozilla port
John Reimer<terminal.node@gmail.com>
parents: 278
diff changeset
46 *ppvObject = cast(void*)cast(nsISupports)this;
278
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
47 AddRef ();
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
48 return XPCOM.NS_OK;
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
49 }
298
eec6ddb07873 More xpcom/mozilla port
John Reimer<terminal.node@gmail.com>
parents: 278
diff changeset
50 if (*riid == nsIFactory.IID) {
eec6ddb07873 More xpcom/mozilla port
John Reimer<terminal.node@gmail.com>
parents: 278
diff changeset
51 *ppvObject = cast(void*)cast(nsIFactory)this;
278
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
52 AddRef ();
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
53 return XPCOM.NS_OK;
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
54 }
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
55
298
eec6ddb07873 More xpcom/mozilla port
John Reimer<terminal.node@gmail.com>
parents: 278
diff changeset
56 *ppvObject = null;
278
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
57 return XPCOM.NS_ERROR_NO_INTERFACE;
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
58 }
348
9a4d7706df52 Test Update to fix linux XPCOM interface issues
John Reimer <terminal.node@gmail.com>
parents: 341
diff changeset
59
9a4d7706df52 Test Update to fix linux XPCOM interface issues
John Reimer <terminal.node@gmail.com>
parents: 341
diff changeset
60 extern(System)
298
eec6ddb07873 More xpcom/mozilla port
John Reimer<terminal.node@gmail.com>
parents: 278
diff changeset
61 nsrefcnt Release () {
278
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
62 refCount--;
352
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
63 if (refCount is 0) return 0;
278
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
64 return refCount;
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
65 }
348
9a4d7706df52 Test Update to fix linux XPCOM interface issues
John Reimer <terminal.node@gmail.com>
parents: 341
diff changeset
66
278
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
67 /* nsIFactory */
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
68
348
9a4d7706df52 Test Update to fix linux XPCOM interface issues
John Reimer <terminal.node@gmail.com>
parents: 341
diff changeset
69 extern(System)
298
eec6ddb07873 More xpcom/mozilla port
John Reimer<terminal.node@gmail.com>
parents: 278
diff changeset
70 nsresult CreateInstance (nsISupports aOuter, nsID* iid, void** result) {
352
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
71 if (isPre_1_9) {
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
72 if (result is null)
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
73 return XPCOM.NS_ERROR_INVALID_ARG;
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
74 auto helperAppLauncherDialog = new HelperAppLauncherDialog;
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
75 nsresult rv = helperAppLauncherDialog.QueryInterface( iid, result );
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
76 if (XPCOM.NS_FAILED(rv)) {
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
77 *result = null;
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
78 delete helperAppLauncherDialog;
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
79 } else {
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
80 if (result is null)
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
81 return XPCOM.NS_ERROR_INVALID_ARG;
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
82 auto helperAppLauncherDialog19 = new HelperAppLauncherDialog_1_9;
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
83 rv = helperAppLauncherDialog19.QueryInterface( iid, result );
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
84 if (XPCOM.NS_FAILED(rv)) {
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
85 *result = null;
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
86 delete helperAppLauncherDialog19;
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
87 }
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
88 return rv;
a3c5f744d03f Update Browser/Mozilla package to SWT 3.4.1 and bug fixes
John Reimer <terminal.node@gmail.com>
parents: 348
diff changeset
89 }
298
eec6ddb07873 More xpcom/mozilla port
John Reimer<terminal.node@gmail.com>
parents: 278
diff changeset
90 }
278
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
91 }
348
9a4d7706df52 Test Update to fix linux XPCOM interface issues
John Reimer <terminal.node@gmail.com>
parents: 341
diff changeset
92
9a4d7706df52 Test Update to fix linux XPCOM interface issues
John Reimer <terminal.node@gmail.com>
parents: 341
diff changeset
93 extern(System)
298
eec6ddb07873 More xpcom/mozilla port
John Reimer<terminal.node@gmail.com>
parents: 278
diff changeset
94 nsresult LockFactory (PRBool lock) {
278
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
95 return XPCOM.NS_OK;
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
96 }
93409d9838c5 Commit more browser/xpcom updates, including still uncoverted source.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
97 }