annotate dwt/internal/mozilla/XPCOM.d @ 341:f403c83322c3 default tip

fix: thx torhu
author Frank Benoit <benoit@tionex.de>
date Sun, 08 Nov 2009 20:58:32 +0100
parents b0d7eb5bd76c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
327
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
1 /* ***** BEGIN LICENSE BLOCK *****
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
2 * Version: MPL 1.1
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
3 *
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
4 * The contents of this file are subject to the Mozilla Public License Version
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
5 * 1.1 (the "License"); you may not use this file except in compliance with
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
6 * the License. You may obtain a copy of the License at
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
7 * http://www.mozilla.org/MPL/
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
8 *
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
9 * Software distributed under the License is distributed on an "AS IS" basis,
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
11 * for the specific language governing rights and limitations under the
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
12 * License.
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
13 *
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
14 * The Original Code is Mozilla Communicator client code, released March 31, 1998.
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
15 *
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
16 * The Initial Developer of the Original Code is
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
17 * Netscape Communications Corporation.
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
18 * Portions created by Netscape are Copyright (C) 1998-1999
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
19 * Netscape Communications Corporation. All Rights Reserved.
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
20 *
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
21 * Contributor(s):
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
22 *
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
23 * IBM
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
24 * - Binding to permit interfacing between Mozilla and DWT
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
25 * - Copyright (C) 2003, 2006 IBM Corp. All Rights Reserved.
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
26 * Port to the D programming language:
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
27 * John Reimer <terminal.node@gmail.com>
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
28 *******************************************************************************/
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
29
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
30 module dwt.internal.mozilla.XPCOM;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
31
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
32 import dwt.internal.mozilla.Common;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
33 import dwt.internal.mozilla.nsID;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
34 import dwt.internal.mozilla.nsStringAPI;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
35 import dwt.internal.mozilla.nsIModule;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
36 import dwt.internal.mozilla.nsIComponentManager;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
37 import dwt.internal.mozilla.nsIComponentRegistrar;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
38 import dwt.internal.mozilla.nsIServiceManager;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
39 import dwt.internal.mozilla.nsIFile;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
40 import dwt.internal.mozilla.nsILocalFile;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
41 import dwt.internal.mozilla.nsIDirectoryService;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
42 import dwt.internal.mozilla.nsIMemory;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
43 import dwt.internal.mozilla.nsIDebug;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
44 import dwt.internal.mozilla.nsITraceRefcnt;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
45
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
46 private import dwt.dwthelper.utils;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
47
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
48 /******************************************************************************
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
49
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
50 Original SWT XPCOM constant declarations for XPCOM
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
51
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
52 ******************************************************************************/
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
53
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
54 const String MOZILLA_FIVE_HOME = "MOZILLA_FIVE_HOME"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
55 const String MOZILLA_PLUGIN_PATH = "MOZ_PLUGIN_PATH"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
56 const String CONTENT_MAYBETEXT = "application/x-vnd.mozilla.maybe-text"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
57 const String CONTENT_MULTIPART = "multipart/x-mixed-replace"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
58 const String DOMEVENT_FOCUS = "focus"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
59 const String DOMEVENT_UNLOAD = "unload"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
60 const String DOMEVENT_MOUSEDOWN = "mousedown"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
61 const String DOMEVENT_MOUSEUP = "mouseup"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
62 const String DOMEVENT_MOUSEMOVE = "mousemove"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
63 const String DOMEVENT_MOUSEDRAG = "draggesture"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
64 const String DOMEVENT_MOUSEWHEEL = "DOMMouseScroll"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
65 const String DOMEVENT_MOUSEOVER = "mouseover"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
66 const String DOMEVENT_MOUSEOUT = "mouseout"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
67 const String DOMEVENT_KEYUP = "keyup"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
68 const String DOMEVENT_KEYDOWN = "keydown"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
69 const String DOMEVENT_KEYPRESS = "keypress"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
70
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
71 /* CID constants */
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
72 const nsID NS_APPSHELL_CID = { 0x2d96b3df, 0xc051, 0x11d1, [0xa8,0x27,0x00,0x40,0x95,0x9a,0x28, 0xc9]}; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
73 const nsID NS_CATEGORYMANAGER_CID = { 0x16d222a6, 0x1dd2, 0x11b2, [0xb6,0x93,0xf3,0x8b,0x02,0xc0,0x21,0xb2]}; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
74 const nsID NS_DOWNLOAD_CID = { 0xe3fa9D0a, 0x1dd1, 0x11b2, [0xbd,0xef,0x8c,0x72,0x0b,0x59,0x74,0x45]}; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
75 const nsID NS_FILEPICKER_CID = { 0x54ae32f8, 0x1dd2, 0x11b2, [0xa2,0x09,0xdf,0x7c,0x50,0x53,0x70,0xf8]}; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
76 const nsID NS_HELPERAPPLAUNCHERDIALOG_CID = {0xf68578eb,0x6ec2,0x4169,[0xae,0x19,0x8c,0x62,0x43,0xf0,0xab,0xe1]}; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
77 const nsID NS_INPUTSTREAMCHANNEL_CID = {0x6ddb050c,0x0d04,0x11d4,[0x98,0x6e,0x00,0xc0,0x4f,0xa0,0xcf,0x4a]}; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
78 const nsID NS_IOSERVICE_CID = {0x9ac9e770,0x18bc,0x11d3,[0x93,0x37,0x00,0x10,0x4b,0xa0,0xfd,0x40]}; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
79 const nsID NS_LOADGROUP_CID = {0xe1c61582,0x2a84,0x11d3,[0x8c,0xce,0x00,0x60,0xb0,0xfc,0x14,0xa3]}; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
80 const nsID NS_PROMPTSERVICE_CID = {0xa2112d6a,0x0e28,0x421f,[0xb4,0x6a,0x25,0xc0,0xb3,0x08,0xcb,0xd0]}; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
81
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
82 const String NS_CONTEXTSTACK_CONTRACTID = "@mozilla.org/js/xpc/ContextStack;1"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
83 const String NS_COOKIEMANAGER_CONTRACTID = "@mozilla.org/cookiemanager;1"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
84 const String NS_DIRECTORYSERVICE_CONTRACTID = "@mozilla.org/file/directory_service;1"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
85 const String NS_DOMSERIALIZER_CONTRACTID = "@mozilla.org/xmlextras/xmlserializer;1"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
86 const String NS_DOWNLOAD_CONTRACTID = "@mozilla.org/download;1"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
87 const String NS_FILEPICKER_CONTRACTID = "@mozilla.org/filepicker;1"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
88 const String NS_HELPERAPPLAUNCHERDIALOG_CONTRACTID = "@mozilla.org/helperapplauncherdialog;1"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
89 const String NS_MEMORY_CONTRACTID = "@mozilla.org/xpcom/memory-service;1"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
90 const String NS_OBSERVER_CONTRACTID = "@mozilla.org/observer-service;1"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
91 const String NS_PREFLOCALIZEDSTRING_CONTRACTID = "@mozilla.org/pref-localizedstring;1"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
92 const String NS_PREFSERVICE_CONTRACTID = "@mozilla.org/preferences-service;1"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
93 const String NS_PROMPTSERVICE_CONTRACTID = "@mozilla.org/embedcomp/prompt-service;1"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
94 const String NS_TRANSFER_CONTRACTID = "@mozilla.org/transfer;1"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
95 const String NS_WEBNAVIGATIONINFO_CONTRACTID = "@mozilla.org/webnavigation-info;1"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
96 const String NS_WINDOWWATCHER_CONTRACTID = "@mozilla.org/embedcomp/window-watcher;1"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
97
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
98 /* directory service constants */
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
99 const String NS_APP_APPLICATION_REGISTRY_DIR = "AppRegD"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
100 const String NS_APP_CACHE_PARENT_DIR = "cachePDir"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
101 const String NS_APP_HISTORY_50_FILE = "UHist"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
102 const String NS_APP_LOCALSTORE_50_FILE = "LclSt"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
103 const String NS_APP_PLUGINS_DIR_LIST = "APluginsDL"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
104 const String NS_APP_PREF_DEFAULTS_50_DIR = "PrfDef"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
105 const String NS_APP_PREFS_50_DIR = "PrefD"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
106 const String NS_APP_PREFS_50_FILE = "PrefF"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
107 const String NS_APP_USER_CHROME_DIR = "UChrm"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
108 const String NS_APP_USER_MIMETYPES_50_FILE = "UMimTyp"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
109 const String NS_APP_USER_PROFILE_50_DIR = "ProfD"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
110 const String NS_GRE_COMPONENT_DIR = "GreComsD"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
111 const String NS_GRE_DIR = "GreD"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
112 const String NS_OS_CURRENT_PROCESS_DIR = "CurProcD"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
113 const String NS_OS_HOME_DIR = "Home"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
114 const String NS_OS_TEMP_DIR = "TmpD"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
115 const String NS_XPCOM_COMPONENT_DIR = "ComsD"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
116 const String NS_XPCOM_CURRENT_PROCESS_DIR = "XCurProcD"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
117 const String NS_XPCOM_INIT_CURRENT_PROCESS_DIR = "MozBinD"; //$NON-NLS-1$
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
118
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
119 /* XPCOM constants */
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
120 const int NS_OK = 0;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
121 const int NS_COMFALSE = 1;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
122 const int NS_BINDING_ABORTED = 0x804B0002;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
123 const int NS_ERROR_BASE = 0xc1f30000;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
124 const int NS_ERROR_NOT_INITIALIZED = NS_ERROR_BASE + 1;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
125 const int NS_ERROR_ALREADY_INITIALIZED = NS_ERROR_BASE + 2;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
126 const int NS_ERROR_NOT_IMPLEMENTED = 0x80004001;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
127 const int NS_NOINTERFACE = 0x80004002;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
128 const int NS_ERROR_NO_INTERFACE = NS_NOINTERFACE;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
129 const int NS_ERROR_INVALID_POINTER = 0x80004003;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
130 const int NS_ERROR_NULL_POINTER = NS_ERROR_INVALID_POINTER;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
131 const int NS_ERROR_ABORT = 0x80004004;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
132 const int NS_ERROR_FAILURE = 0x80004005;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
133 const int NS_ERROR_UNEXPECTED = 0x8000ffff;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
134 const int NS_ERROR_OUT_OF_MEMORY = 0x8007000e;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
135 const int NS_ERROR_ILLEGAL_VALUE = 0x80070057;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
136 const int NS_ERROR_INVALID_ARG = NS_ERROR_ILLEGAL_VALUE;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
137 const int NS_ERROR_NO_AGGREGATION = 0x80040110;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
138 const int NS_ERROR_NOT_AVAILABLE = 0x80040111;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
139 const int NS_ERROR_FACTORY_NOT_REGISTERED = 0x80040154;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
140 const int NS_ERROR_FACTORY_REGISTER_AGAIN = 0x80040155;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
141 const int NS_ERROR_FACTORY_NOT_LOADED = 0x800401f8;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
142 const int NS_ERROR_FACTORY_NO_SIGNATURE_SUPPORT = NS_ERROR_BASE + 0x101;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
143 const int NS_ERROR_FACTORY_EXISTS = NS_ERROR_BASE + 0x100;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
144 const int NS_ERROR_HTMLPARSER_UNRESOLVEDDTD = 0x804e03f3;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
145 const int NS_ERROR_FILE_NOT_FOUND = 0x80520012;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
146 const int NS_ERROR_FILE_UNRECOGNIZED_PATH = 0x80520001;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
147
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
148 public nsresult NS_FAILED( nsresult result ) {
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
149 return result & 0x80000000;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
150 }
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
151
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
152 public nsresult NS_SUCCEEDED( nsresult result ) {
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
153 return !(result & 0x80000000);
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
154 }
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
155
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
156 public PRUint32 strlen_PRUnichar ( PRUnichar* str )
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
157 {
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
158 PRUint32 len = 0;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
159 if (str !is null)
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
160 while (*(str++) != 0) len++;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
161 return len;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
162 }
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
163
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
164 /******************************************************************************
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
165
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
166 XPCOM Startup functions
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
167
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
168 ******************************************************************************/
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
169
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
170 extern (System):
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
171
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
172 struct nsStaticModuleInfo
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
173 {
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
174 char *name;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
175 nsGetModuleProc getModule;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
176 }
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
177
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
178 alias nsresult function (nsIComponentManager, nsIFile, nsIModule*) nsGetModuleProc;
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
179
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
180 /******************************************************************************
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
181
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
182 ******************************************************************************/
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
183
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
184 nsresult NS_InitXPCOM2( nsIServiceManager *result, nsIFile binDirectory,
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
185 nsIDirectoryServiceProvider appFileLocationProvider );
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
186 nsresult NS_InitXPCOM3( nsIServiceManager *result, nsIFile binDirectory,
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
187 nsIDirectoryServiceProvider appFileLocationProvider,
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
188 nsStaticModuleInfo* staticComponents,
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
189 PRUint32 componentCount );
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
190
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
191 nsresult NS_ShutdownXPCOM(nsIServiceManager servMgr);
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
192 nsresult NS_GetServiceManager(nsIServiceManager *result);
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
193 nsresult NS_GetComponentManager(nsIComponentManager *result);
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
194 nsresult NS_GetComponentRegistrar(nsIComponentRegistrar *result);
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
195 nsresult NS_GetMemoryManager(nsIMemory *result);
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
196 nsresult NS_NewLocalFile(nsAString* path, PRBool followLinks, nsILocalFile* result);
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
197 nsresult NS_NewNativeLocalFile(nsACString* path, PRBool followLinks, nsILocalFile* result);
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
198 void * NS_Alloc(PRSize size);
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
199 void * NS_Realloc(void *ptr, PRSize size);
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
200 void NS_Free(void *ptr);
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
201 nsresult NS_GetDebug(nsIDebug *result);
b0d7eb5bd76c Adding Mozilla XPCOM interfaces from dwt-linux to dwt-win
John Reimer <terminal.node@gmail.com>
parents:
diff changeset
202 nsresult NS_GetTraceRefcnt(nsITraceRefcnt *result);