Mercurial > projects > dwt-linux
comparison dwt/internal/mozilla/XPCOM.d @ 340:3f4a5c7d138f
Fixes
author | John Reimer <terminal.node@gmail.com> |
---|---|
date | Sun, 26 Oct 2008 08:09:00 -0700 |
parents | eec6ddb07873 |
children |
comparison
equal
deleted
inserted
replaced
339:c317081df76f | 340:3f4a5c7d138f |
---|---|
24 * - Binding to permit interfacing between Mozilla and DWT | 24 * - Binding to permit interfacing between Mozilla and DWT |
25 * - Copyright (C) 2003, 2006 IBM Corp. All Rights Reserved. | 25 * - Copyright (C) 2003, 2006 IBM Corp. All Rights Reserved. |
26 * Port to the D programming language: | 26 * Port to the D programming language: |
27 * John Reimer <terminal.node@gmail.com> | 27 * John Reimer <terminal.node@gmail.com> |
28 *******************************************************************************/ | 28 *******************************************************************************/ |
29 | |
29 module dwt.internal.mozilla.XPCOM; | 30 module dwt.internal.mozilla.XPCOM; |
30 | 31 |
31 import dwt.dwthelper.utils; | 32 import dwt.internal.mozilla.Common; |
32 | 33 import dwt.internal.mozilla.nsID; |
33 //import dwt.internal.C; | 34 import dwt.internal.mozilla.nsStringAPI; |
34 | 35 import dwt.internal.mozilla.nsIModule; |
35 public class XPCOM { | 36 import dwt.internal.mozilla.nsIComponentManager; |
36 public static final String MOZILLA_FIVE_HOME = "MOZILLA_FIVE_HOME"; //$NON-NLS-1$ | 37 import dwt.internal.mozilla.nsIComponentRegistrar; |
37 public static final String MOZILLA_PLUGIN_PATH = "MOZ_PLUGIN_PATH"; //$NON-NLS-1$ | 38 import dwt.internal.mozilla.nsIServiceManager; |
38 public static final String CONTENT_MAYBETEXT = "application/x-vnd.mozilla.maybe-text"; //$NON-NLS-1$ | 39 import dwt.internal.mozilla.nsIFile; |
39 public static final String CONTENT_MULTIPART = "multipart/x-mixed-replace"; //$NON-NLS-1$ | 40 import dwt.internal.mozilla.nsILocalFile; |
40 public static final String DOMEVENT_FOCUS = "focus"; //$NON-NLS-1$ | 41 import dwt.internal.mozilla.nsIDirectoryService; |
41 public static final String DOMEVENT_UNLOAD = "unload"; //$NON-NLS-1$ | 42 import dwt.internal.mozilla.nsIMemory; |
42 public static final String DOMEVENT_MOUSEDOWN = "mousedown"; //$NON-NLS-1$ | 43 import dwt.internal.mozilla.nsIDebug; |
43 public static final String DOMEVENT_MOUSEUP = "mouseup"; //$NON-NLS-1$ | 44 import dwt.internal.mozilla.nsITraceRefcnt; |
44 public static final String DOMEVENT_MOUSEMOVE = "mousemove"; //$NON-NLS-1$ | 45 |
45 public static final String DOMEVENT_MOUSEDRAG = "draggesture"; //$NON-NLS-1$ | 46 private import dwt.dwthelper.utils; |
46 public static final String DOMEVENT_MOUSEWHEEL = "DOMMouseScroll"; //$NON-NLS-1$ | 47 |
47 public static final String DOMEVENT_MOUSEOVER = "mouseover"; //$NON-NLS-1$ | 48 /****************************************************************************** |
48 public static final String DOMEVENT_MOUSEOUT = "mouseout"; //$NON-NLS-1$ | 49 |
49 public static final String DOMEVENT_KEYUP = "keyup"; //$NON-NLS-1$ | 50 Original SWT XPCOM constant declarations for XPCOM |
50 public static final String DOMEVENT_KEYDOWN = "keydown"; //$NON-NLS-1$ | 51 |
51 public static final String DOMEVENT_KEYPRESS = "keypress"; //$NON-NLS-1$ | 52 ******************************************************************************/ |
52 | 53 |
53 /* CID constants */ | 54 const String MOZILLA_FIVE_HOME = "MOZILLA_FIVE_HOME"; //$NON-NLS-1$ |
54 public static final nsID NS_APPSHELL_CID = new nsID("2d96b3df-c051-11d1-a827-0040959a28c9"); //$NON-NLS-1$ | 55 const String MOZILLA_PLUGIN_PATH = "MOZ_PLUGIN_PATH"; //$NON-NLS-1$ |
55 public static final nsID NS_CATEGORYMANAGER_CID = new nsID("16d222a6-1dd2-11b2-b693-f38b02c021b2"); //$NON-NLS-1$ | 56 const String CONTENT_MAYBETEXT = "application/x-vnd.mozilla.maybe-text"; //$NON-NLS-1$ |
56 public static final nsID NS_DOWNLOAD_CID = new nsID("e3fa9D0a-1dd1-11b2-bdef-8c720b597445"); //$NON-NLS-1$ | 57 const String CONTENT_MULTIPART = "multipart/x-mixed-replace"; //$NON-NLS-1$ |
57 public static final nsID NS_FILEPICKER_CID = new nsID("54ae32f8-1dd2-11b2-a209-df7c505370f8"); //$NON-NLS-1$ | 58 const String DOMEVENT_FOCUS = "focus"; //$NON-NLS-1$ |
58 public static final nsID NS_HELPERAPPLAUNCHERDIALOG_CID = new nsID("f68578eb-6ec2-4169-ae19-8c6243f0abe1"); //$NON-NLS-1$ | 59 const String DOMEVENT_UNLOAD = "unload"; //$NON-NLS-1$ |
59 public static final nsID NS_INPUTSTREAMCHANNEL_CID = new nsID("6ddb050c-0d04-11d4-986e-00c04fa0cf4a"); //$NON-NLS-1$ | 60 const String DOMEVENT_MOUSEDOWN = "mousedown"; //$NON-NLS-1$ |
60 public static final nsID NS_IOSERVICE_CID = new nsID("9ac9e770-18bc-11d3-9337-00104ba0fd40"); //$NON-NLS-1$ | 61 const String DOMEVENT_MOUSEUP = "mouseup"; //$NON-NLS-1$ |
61 public static final nsID NS_LOADGROUP_CID = new nsID("e1c61582-2a84-11d3-8cce-0060b0fc14a3"); //$NON-NLS-1$ | 62 const String DOMEVENT_MOUSEMOVE = "mousemove"; //$NON-NLS-1$ |
62 public static final nsID NS_PROMPTSERVICE_CID = new nsID("a2112d6a-0e28-421f-b46a-25c0b308cbd0"); //$NON-NLS-1$ | 63 const String DOMEVENT_MOUSEDRAG = "draggesture"; //$NON-NLS-1$ |
63 | 64 const String DOMEVENT_MOUSEWHEEL = "DOMMouseScroll"; //$NON-NLS-1$ |
64 public static final String NS_CONTEXTSTACK_CONTRACTID = "@mozilla.org/js/xpc/ContextStack;1"; //$NON-NLS-1$ | 65 const String DOMEVENT_MOUSEOVER = "mouseover"; //$NON-NLS-1$ |
65 public static final String NS_COOKIEMANAGER_CONTRACTID = "@mozilla.org/cookiemanager;1"; //$NON-NLS-1$ | 66 const String DOMEVENT_MOUSEOUT = "mouseout"; //$NON-NLS-1$ |
66 public static final String NS_DIRECTORYSERVICE_CONTRACTID = "@mozilla.org/file/directory_service;1"; //$NON-NLS-1$ | 67 const String DOMEVENT_KEYUP = "keyup"; //$NON-NLS-1$ |
67 public static final String NS_DOMSERIALIZER_CONTRACTID = "@mozilla.org/xmlextras/xmlserializer;1"; //$NON-NLS-1$ | 68 const String DOMEVENT_KEYDOWN = "keydown"; //$NON-NLS-1$ |
68 public static final String NS_DOWNLOAD_CONTRACTID = "@mozilla.org/download;1"; //$NON-NLS-1$ | 69 const String DOMEVENT_KEYPRESS = "keypress"; //$NON-NLS-1$ |
69 public static final String NS_FILEPICKER_CONTRACTID = "@mozilla.org/filepicker;1"; //$NON-NLS-1$ | 70 |
70 public static final String NS_HELPERAPPLAUNCHERDIALOG_CONTRACTID = "@mozilla.org/helperapplauncherdialog;1"; //$NON-NLS-1$ | 71 /* CID constants */ |
71 public static final String NS_MEMORY_CONTRACTID = "@mozilla.org/xpcom/memory-service;1"; //$NON-NLS-1$ | 72 const nsID NS_APPSHELL_CID = { 0x2d96b3df, 0xc051, 0x11d1, [0xa8,0x27,0x00,0x40,0x95,0x9a,0x28, 0xc9]}; //$NON-NLS-1$ |
72 public static final String NS_OBSERVER_CONTRACTID = "@mozilla.org/observer-service;1"; //$NON-NLS-1$ | 73 const nsID NS_CATEGORYMANAGER_CID = { 0x16d222a6, 0x1dd2, 0x11b2, [0xb6,0x93,0xf3,0x8b,0x02,0xc0,0x21,0xb2]}; //$NON-NLS-1$ |
73 public static final String NS_PREFLOCALIZEDSTRING_CONTRACTID = "@mozilla.org/pref-localizedstring;1"; //$NON-NLS-1$ | 74 const nsID NS_DOWNLOAD_CID = { 0xe3fa9D0a, 0x1dd1, 0x11b2, [0xbd,0xef,0x8c,0x72,0x0b,0x59,0x74,0x45]}; //$NON-NLS-1$ |
74 public static final String NS_PREFSERVICE_CONTRACTID = "@mozilla.org/preferences-service;1"; //$NON-NLS-1$ | 75 const nsID NS_FILEPICKER_CID = { 0x54ae32f8, 0x1dd2, 0x11b2, [0xa2,0x09,0xdf,0x7c,0x50,0x53,0x70,0xf8]}; //$NON-NLS-1$ |
75 public static final String NS_PROMPTSERVICE_CONTRACTID = "@mozilla.org/embedcomp/prompt-service;1"; //$NON-NLS-1$ | 76 const nsID NS_HELPERAPPLAUNCHERDIALOG_CID = {0xf68578eb,0x6ec2,0x4169,[0xae,0x19,0x8c,0x62,0x43,0xf0,0xab,0xe1]}; //$NON-NLS-1$ |
76 public static final String NS_TRANSFER_CONTRACTID = "@mozilla.org/transfer;1"; //$NON-NLS-1$ | 77 const nsID NS_INPUTSTREAMCHANNEL_CID = {0x6ddb050c,0x0d04,0x11d4,[0x98,0x6e,0x00,0xc0,0x4f,0xa0,0xcf,0x4a]}; //$NON-NLS-1$ |
77 public static final String NS_WEBNAVIGATIONINFO_CONTRACTID = "@mozilla.org/webnavigation-info;1"; //$NON-NLS-1$ | 78 const nsID NS_IOSERVICE_CID = {0x9ac9e770,0x18bc,0x11d3,[0x93,0x37,0x00,0x10,0x4b,0xa0,0xfd,0x40]}; //$NON-NLS-1$ |
78 public static final String NS_WINDOWWATCHER_CONTRACTID = "@mozilla.org/embedcomp/window-watcher;1"; //$NON-NLS-1$ | 79 const nsID NS_LOADGROUP_CID = {0xe1c61582,0x2a84,0x11d3,[0x8c,0xce,0x00,0x60,0xb0,0xfc,0x14,0xa3]}; //$NON-NLS-1$ |
79 | 80 const nsID NS_PROMPTSERVICE_CID = {0xa2112d6a,0x0e28,0x421f,[0xb4,0x6a,0x25,0xc0,0xb3,0x08,0xcb,0xd0]}; //$NON-NLS-1$ |
80 /* directory service constants */ | 81 |
81 public static final String NS_APP_APPLICATION_REGISTRY_DIR = "AppRegD"; //$NON-NLS-1$ | 82 const String NS_CONTEXTSTACK_CONTRACTID = "@mozilla.org/js/xpc/ContextStack;1"; //$NON-NLS-1$ |
82 public static final String NS_APP_CACHE_PARENT_DIR = "cachePDir"; //$NON-NLS-1$ | 83 const String NS_COOKIEMANAGER_CONTRACTID = "@mozilla.org/cookiemanager;1"; //$NON-NLS-1$ |
83 public static final String NS_APP_HISTORY_50_FILE = "UHist"; //$NON-NLS-1$ | 84 const String NS_DIRECTORYSERVICE_CONTRACTID = "@mozilla.org/file/directory_service;1"; //$NON-NLS-1$ |
84 public static final String NS_APP_LOCALSTORE_50_FILE = "LclSt"; //$NON-NLS-1$ | 85 const String NS_DOMSERIALIZER_CONTRACTID = "@mozilla.org/xmlextras/xmlserializer;1"; //$NON-NLS-1$ |
85 public static final String NS_APP_PLUGINS_DIR_LIST = "APluginsDL"; //$NON-NLS-1$ | 86 const String NS_DOWNLOAD_CONTRACTID = "@mozilla.org/download;1"; //$NON-NLS-1$ |
86 public static final String NS_APP_PREF_DEFAULTS_50_DIR = "PrfDef"; //$NON-NLS-1$ | 87 const String NS_FILEPICKER_CONTRACTID = "@mozilla.org/filepicker;1"; //$NON-NLS-1$ |
87 public static final String NS_APP_PREFS_50_DIR = "PrefD"; //$NON-NLS-1$ | 88 const String NS_HELPERAPPLAUNCHERDIALOG_CONTRACTID = "@mozilla.org/helperapplauncherdialog;1"; //$NON-NLS-1$ |
88 public static final String NS_APP_PREFS_50_FILE = "PrefF"; //$NON-NLS-1$ | 89 const String NS_MEMORY_CONTRACTID = "@mozilla.org/xpcom/memory-service;1"; //$NON-NLS-1$ |
89 public static final String NS_APP_USER_CHROME_DIR = "UChrm"; //$NON-NLS-1$ | 90 const String NS_OBSERVER_CONTRACTID = "@mozilla.org/observer-service;1"; //$NON-NLS-1$ |
90 public static final String NS_APP_USER_MIMETYPES_50_FILE = "UMimTyp"; //$NON-NLS-1$ | 91 const String NS_PREFLOCALIZEDSTRING_CONTRACTID = "@mozilla.org/pref-localizedstring;1"; //$NON-NLS-1$ |
91 public static final String NS_APP_USER_PROFILE_50_DIR = "ProfD"; //$NON-NLS-1$ | 92 const String NS_PREFSERVICE_CONTRACTID = "@mozilla.org/preferences-service;1"; //$NON-NLS-1$ |
92 public static final String NS_GRE_COMPONENT_DIR = "GreComsD"; //$NON-NLS-1$ | 93 const String NS_PROMPTSERVICE_CONTRACTID = "@mozilla.org/embedcomp/prompt-service;1"; //$NON-NLS-1$ |
93 public static final String NS_GRE_DIR = "GreD"; //$NON-NLS-1$ | 94 const String NS_TRANSFER_CONTRACTID = "@mozilla.org/transfer;1"; //$NON-NLS-1$ |
94 public static final String NS_OS_CURRENT_PROCESS_DIR = "CurProcD"; //$NON-NLS-1$ | 95 const String NS_WEBNAVIGATIONINFO_CONTRACTID = "@mozilla.org/webnavigation-info;1"; //$NON-NLS-1$ |
95 public static final String NS_OS_HOME_DIR = "Home"; //$NON-NLS-1$ | 96 const String NS_WINDOWWATCHER_CONTRACTID = "@mozilla.org/embedcomp/window-watcher;1"; //$NON-NLS-1$ |
96 public static final String NS_OS_TEMP_DIR = "TmpD"; //$NON-NLS-1$ | 97 |
97 public static final String NS_XPCOM_COMPONENT_DIR = "ComsD"; //$NON-NLS-1$ | 98 /* directory service constants */ |
98 public static final String NS_XPCOM_CURRENT_PROCESS_DIR = "XCurProcD"; //$NON-NLS-1$ | 99 const String NS_APP_APPLICATION_REGISTRY_DIR = "AppRegD"; //$NON-NLS-1$ |
99 public static final String NS_XPCOM_INIT_CURRENT_PROCESS_DIR = "MozBinD"; //$NON-NLS-1$ | 100 const String NS_APP_CACHE_PARENT_DIR = "cachePDir"; //$NON-NLS-1$ |
100 | 101 const String NS_APP_HISTORY_50_FILE = "UHist"; //$NON-NLS-1$ |
101 /* XPCOM constants */ | 102 const String NS_APP_LOCALSTORE_50_FILE = "LclSt"; //$NON-NLS-1$ |
102 public static final int NS_OK = 0; | 103 const String NS_APP_PLUGINS_DIR_LIST = "APluginsDL"; //$NON-NLS-1$ |
103 public static final int NS_COMFALSE = 1; | 104 const String NS_APP_PREF_DEFAULTS_50_DIR = "PrfDef"; //$NON-NLS-1$ |
104 public static final int NS_BINDING_ABORTED = 0x804B0002; | 105 const String NS_APP_PREFS_50_DIR = "PrefD"; //$NON-NLS-1$ |
105 public static final int NS_ERROR_BASE = 0xc1f30000; | 106 const String NS_APP_PREFS_50_FILE = "PrefF"; //$NON-NLS-1$ |
106 public static final int NS_ERROR_NOT_INITIALIZED = NS_ERROR_BASE + 1; | 107 const String NS_APP_USER_CHROME_DIR = "UChrm"; //$NON-NLS-1$ |
107 public static final int NS_ERROR_ALREADY_INITIALIZED = NS_ERROR_BASE + 2; | 108 const String NS_APP_USER_MIMETYPES_50_FILE = "UMimTyp"; //$NON-NLS-1$ |
108 public static final int NS_ERROR_NOT_IMPLEMENTED = 0x80004001; | 109 const String NS_APP_USER_PROFILE_50_DIR = "ProfD"; //$NON-NLS-1$ |
109 public static final int NS_NOINTERFACE = 0x80004002; | 110 const String NS_GRE_COMPONENT_DIR = "GreComsD"; //$NON-NLS-1$ |
110 public static final int NS_ERROR_NO_INTERFACE = NS_NOINTERFACE; | 111 const String NS_GRE_DIR = "GreD"; //$NON-NLS-1$ |
111 public static final int NS_ERROR_INVALID_POINTER = 0x80004003; | 112 const String NS_OS_CURRENT_PROCESS_DIR = "CurProcD"; //$NON-NLS-1$ |
112 public static final int NS_ERROR_NULL_POINTER = NS_ERROR_INVALID_POINTER; | 113 const String NS_OS_HOME_DIR = "Home"; //$NON-NLS-1$ |
113 public static final int NS_ERROR_ABORT = 0x80004004; | 114 const String NS_OS_TEMP_DIR = "TmpD"; //$NON-NLS-1$ |
114 public static final int NS_ERROR_FAILURE = 0x80004005; | 115 const String NS_XPCOM_COMPONENT_DIR = "ComsD"; //$NON-NLS-1$ |
115 public static final int NS_ERROR_UNEXPECTED = 0x8000ffff; | 116 const String NS_XPCOM_CURRENT_PROCESS_DIR = "XCurProcD"; //$NON-NLS-1$ |
116 public static final int NS_ERROR_OUT_OF_MEMORY = 0x8007000e; | 117 const String NS_XPCOM_INIT_CURRENT_PROCESS_DIR = "MozBinD"; //$NON-NLS-1$ |
117 public static final int NS_ERROR_ILLEGAL_VALUE = 0x80070057; | 118 |
118 public static final int NS_ERROR_INVALID_ARG = NS_ERROR_ILLEGAL_VALUE; | 119 /* XPCOM constants */ |
119 public static final int NS_ERROR_NO_AGGREGATION = 0x80040110; | 120 const int NS_OK = 0; |
120 public static final int NS_ERROR_NOT_AVAILABLE = 0x80040111; | 121 const int NS_COMFALSE = 1; |
121 public static final int NS_ERROR_FACTORY_NOT_REGISTERED = 0x80040154; | 122 const int NS_BINDING_ABORTED = 0x804B0002; |
122 public static final int NS_ERROR_FACTORY_REGISTER_AGAIN = 0x80040155; | 123 const int NS_ERROR_BASE = 0xc1f30000; |
123 public static final int NS_ERROR_FACTORY_NOT_LOADED = 0x800401f8; | 124 const int NS_ERROR_NOT_INITIALIZED = NS_ERROR_BASE + 1; |
124 public static final int NS_ERROR_FACTORY_NO_SIGNATURE_SUPPORT = NS_ERROR_BASE + 0x101; | 125 const int NS_ERROR_ALREADY_INITIALIZED = NS_ERROR_BASE + 2; |
125 public static final int NS_ERROR_FACTORY_EXISTS = NS_ERROR_BASE + 0x100; | 126 const int NS_ERROR_NOT_IMPLEMENTED = 0x80004001; |
126 public static final int NS_ERROR_HTMLPARSER_UNRESOLVEDDTD = 0x804e03f3; | 127 const int NS_NOINTERFACE = 0x80004002; |
127 public static final int NS_ERROR_FILE_NOT_FOUND = 0x80520012; | 128 const int NS_ERROR_NO_INTERFACE = NS_NOINTERFACE; |
128 public static final int NS_ERROR_FILE_UNRECOGNIZED_PATH = 0x80520001; | 129 const int NS_ERROR_INVALID_POINTER = 0x80004003; |
129 | 130 const int NS_ERROR_NULL_POINTER = NS_ERROR_INVALID_POINTER; |
130 public static final nsresult NS_FAILED( nsresult result ) { | 131 const int NS_ERROR_ABORT = 0x80004004; |
131 return result & 0x80000000; | 132 const int NS_ERROR_FAILURE = 0x80004005; |
132 } | 133 const int NS_ERROR_UNEXPECTED = 0x8000ffff; |
133 | 134 const int NS_ERROR_OUT_OF_MEMORY = 0x8007000e; |
134 public static final nsresult NS_SUCCEEDED( nsresult result ) { | 135 const int NS_ERROR_ILLEGAL_VALUE = 0x80070057; |
135 return !(result & 0x80000000); | 136 const int NS_ERROR_INVALID_ARG = NS_ERROR_ILLEGAL_VALUE; |
136 } | 137 const int NS_ERROR_NO_AGGREGATION = 0x80040110; |
137 | 138 const int NS_ERROR_NOT_AVAILABLE = 0x80040111; |
138 public static final PRUint32 strlen_PRUnichar ( PRUnichar* str ) | 139 const int NS_ERROR_FACTORY_NOT_REGISTERED = 0x80040154; |
139 { | 140 const int NS_ERROR_FACTORY_REGISTER_AGAIN = 0x80040155; |
140 PRUint32 len = 0; | 141 const int NS_ERROR_FACTORY_NOT_LOADED = 0x800401f8; |
141 if (str !is null) | 142 const int NS_ERROR_FACTORY_NO_SIGNATURE_SUPPORT = NS_ERROR_BASE + 0x101; |
142 while (*(str++) != 0) len++; | 143 const int NS_ERROR_FACTORY_EXISTS = NS_ERROR_BASE + 0x100; |
143 ret len; | 144 const int NS_ERROR_HTMLPARSER_UNRESOLVEDDTD = 0x804e03f3; |
144 } | 145 const int NS_ERROR_FILE_NOT_FOUND = 0x80520012; |
145 | 146 const int NS_ERROR_FILE_UNRECOGNIZED_PATH = 0x80520001; |
146 //public static final native void memmove(nsID dest, int /*long*/ src, int nbytes); | 147 |
147 //public static final native void memmove(int /*long*/ dest, nsID src, int nbytes); | 148 public nsresult NS_FAILED( nsresult result ) { |
148 public static final native int NS_GetComponentManager(int /*long*/[] result); | 149 return result & 0x80000000; |
149 public static final native int NS_GetServiceManager(int /*long*/[] result); | 150 } |
150 public static final native int NS_InitXPCOM2(int /*long*/ result, int /*long*/ binDirectory, int /*long*/ appFileLocationProvider); | 151 |
151 public static final native int NS_NewLocalFile(int /*long*/ path, int followLinks, int /*long*/[] result); | 152 public nsresult NS_SUCCEEDED( nsresult result ) { |
152 //public static final native int strlen_PRUnichar(int /*long*/ s); | 153 return !(result & 0x80000000); |
153 //public static final native int /*long*/ nsEmbedCString_new(); | 154 } |
154 //public static final native int /*long*/ nsEmbedCString_new(byte[] aString, int length); | 155 |
155 //public static final native int /*long*/ nsEmbedCString_new(int aString, int length); | 156 public PRUint32 strlen_PRUnichar ( PRUnichar* str ) |
156 //public static final native void nsEmbedCString_delete(int /*long*/ ptr); | 157 { |
157 //public static final native int nsEmbedCString_Length(int /*long*/ ptr); | 158 PRUint32 len = 0; |
158 //public static final native int /*long*/ nsEmbedCString_get(int /*long*/ ptr); | 159 if (str !is null) |
159 //public static final native void nsID_delete(int /*long*/ ptr); | 160 while (*(str++) != 0) len++; |
160 //public static final native int /*long*/ nsID_new(); | 161 return len; |
161 //public static final native int nsID_Equals(int /*long*/ ptr, int /*long*/ other); | 162 } |
162 //public static final native int /*long*/ nsEmbedString_new(); | 163 |
163 //public static final native int /*long*/ nsEmbedString_new(char[] aString); | 164 /****************************************************************************** |
164 //public static final native void nsEmbedString_delete(int /*long*/ ptr); | 165 |
165 //public static final native int nsEmbedString_Length(int /*long*/ ptr); | 166 XPCOM Startup functions |
166 //public static final native int /*long*/ nsEmbedString_get(int /*long*/ ptr); | 167 |
167 public static final native int XPCOMGlueStartup(byte[] place); | 168 ******************************************************************************/ |
168 public static final native int XPCOMGlueShutdown(); | 169 |
169 } | 170 extern (System): |
171 | |
172 struct nsStaticModuleInfo | |
173 { | |
174 char *name; | |
175 nsGetModuleProc getModule; | |
176 } | |
177 | |
178 alias nsresult function (nsIComponentManager, nsIFile, nsIModule*) nsGetModuleProc; | |
179 | |
180 /****************************************************************************** | |
181 | |
182 ******************************************************************************/ | |
183 | |
184 nsresult NS_InitXPCOM2( nsIServiceManager *result, nsIFile binDirectory, | |
185 nsIDirectoryServiceProvider appFileLocationProvider ); | |
186 nsresult NS_InitXPCOM3( nsIServiceManager *result, nsIFile binDirectory, | |
187 nsIDirectoryServiceProvider appFileLocationProvider, | |
188 nsStaticModuleInfo* staticComponents, | |
189 PRUint32 componentCount ); | |
190 | |
191 nsresult NS_ShutdownXPCOM(nsIServiceManager servMgr); | |
192 nsresult NS_GetServiceManager(nsIServiceManager *result); | |
193 nsresult NS_GetComponentManager(nsIComponentManager *result); | |
194 nsresult NS_GetComponentRegistrar(nsIComponentRegistrar *result); | |
195 nsresult NS_GetMemoryManager(nsIMemory *result); | |
196 nsresult NS_NewLocalFile(nsAString* path, PRBool followLinks, nsILocalFile* result); | |
197 nsresult NS_NewNativeLocalFile(nsACString* path, PRBool followLinks, nsILocalFile* result); | |
198 void * NS_Alloc(PRSize size); | |
199 void * NS_Realloc(void *ptr, PRSize size); | |
200 void NS_Free(void *ptr); | |
201 nsresult NS_GetDebug(nsIDebug *result); | |
202 nsresult NS_GetTraceRefcnt(nsITraceRefcnt *result); |