annotate dwt/internal/mozilla/XPCOM.d @ 364:2bcb17ebe0be default tip

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