1 | # ***** BEGIN LICENSE BLOCK *****
|
---|
2 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
---|
3 | #
|
---|
4 | # The contents of this file are subject to the Mozilla Public License Version
|
---|
5 | # 1.1 (the "License"); you may not use this file except in compliance with
|
---|
6 | # the License. You may obtain a copy of the License at
|
---|
7 | # http://www.mozilla.org/MPL/
|
---|
8 | #
|
---|
9 | # Software distributed under the License is distributed on an "AS IS" basis,
|
---|
10 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
---|
11 | # for the specific language governing rights and limitations under the
|
---|
12 | # License.
|
---|
13 | #
|
---|
14 | # The Original Code is the Python XPCOM language bindings.
|
---|
15 | #
|
---|
16 | # The Initial Developer of the Original Code is
|
---|
17 | # ActiveState Tool Corp.
|
---|
18 | # Portions created by the Initial Developer are Copyright (C) 2000, 2001
|
---|
19 | # the Initial Developer. All Rights Reserved.
|
---|
20 | #
|
---|
21 | # Contributor(s):
|
---|
22 | # Mark Hammond <mhammond@skippinet.com.au> (original author)
|
---|
23 | #
|
---|
24 | # Alternatively, the contents of this file may be used under the terms of
|
---|
25 | # either the GNU General Public License Version 2 or later (the "GPL"), or
|
---|
26 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
---|
27 | # in which case the provisions of the GPL or the LGPL are applicable instead
|
---|
28 | # of those above. If you wish to allow use of your version of this file only
|
---|
29 | # under the terms of either the GPL or the LGPL, and not to allow others to
|
---|
30 | # use your version of this file under the terms of the MPL, indicate your
|
---|
31 | # decision by deleting the provisions above and replace them with the notice
|
---|
32 | # and other provisions required by the GPL or the LGPL. If you do not delete
|
---|
33 | # the provisions above, a recipient may use your version of this file under
|
---|
34 | # the terms of any one of the MPL, the GPL or the LGPL.
|
---|
35 | #
|
---|
36 | # ***** END LICENSE BLOCK *****
|
---|
37 |
|
---|
38 | # Could maybe later have a process that extracted these enums should they change.
|
---|
39 | # from nsFileLocations.h
|
---|
40 | App_DirectoryBase = 0x00010000
|
---|
41 | App_PrefsDirectory30 = App_DirectoryBase + 1
|
---|
42 | App_PrefsDirectory40 = App_DirectoryBase + 2
|
---|
43 | App_PrefsDirectory50 = App_DirectoryBase + 3
|
---|
44 | App_ResDirectory = App_DirectoryBase + 5
|
---|
45 | App_UserProfileDirectory30 = App_DirectoryBase + 10
|
---|
46 | App_UserProfileDirectory40 = App_DirectoryBase + 11
|
---|
47 | App_UserProfileDirectory50 = App_DirectoryBase + 12
|
---|
48 | App_DefaultUserProfileRoot30 = App_DirectoryBase + 13
|
---|
49 | App_DefaultUserProfileRoot40 = App_DirectoryBase + 14
|
---|
50 | App_DefaultUserProfileRoot50 = App_DirectoryBase + 15
|
---|
51 | App_ProfileDefaultsFolder30 = App_DirectoryBase + 16
|
---|
52 | App_ProfileDefaultsFolder40 = App_DirectoryBase + 17
|
---|
53 | App_ProfileDefaultsFolder50 = App_DirectoryBase + 18
|
---|
54 | App_PrefDefaultsFolder50 = App_DirectoryBase + 19
|
---|
55 | App_DefaultsFolder50 = App_DirectoryBase + 25
|
---|
56 | App_ComponentsDirectory = App_DirectoryBase + 30
|
---|
57 | App_ChromeDirectory = App_DirectoryBase + 31
|
---|
58 | App_PluginsDirectory = App_DirectoryBase + 32
|
---|
59 | App_UserChromeDirectory = App_DirectoryBase + 40
|
---|
60 | App_FileBase = App_DirectoryBase + 1000
|
---|
61 | App_PreferencesFile30 = App_FileBase + 1
|
---|
62 | App_PreferencesFile40 = App_FileBase + 2
|
---|
63 | App_PreferencesFile50 = App_FileBase + 3
|
---|
64 | App_BookmarksFile30 = App_FileBase + 10
|
---|
65 | App_BookmarksFile40 = App_FileBase + 11
|
---|
66 | App_BookmarksFile50 = App_FileBase + 12
|
---|
67 | App_Registry40 = App_FileBase + 20
|
---|
68 | App_Registry50 = App_FileBase + 21
|
---|
69 | App_LocalStore50 = App_FileBase + 30
|
---|
70 | App_History50 = App_FileBase + 40
|
---|
71 | App_MailDirectory50 = App_FileBase + 50
|
---|
72 | App_ImapMailDirectory50 = App_FileBase + 60
|
---|
73 | App_NewsDirectory50 = App_FileBase + 70
|
---|
74 | App_MessengerFolderCache50 = App_FileBase + 80
|
---|
75 | App_UsersPanels50 = App_FileBase + 90
|
---|
76 | App_SearchFile50 = App_FileBase + 100
|
---|
77 | App_SearchDirectory50 = App_FileBase + 101
|
---|
78 |
|
---|
79 | # From nsSpecialSystemDirectory.h
|
---|
80 | OS_DriveDirectory = 1
|
---|
81 | OS_TemporaryDirectory = 2
|
---|
82 | OS_CurrentProcessDirectory= 3
|
---|
83 | OS_CurrentWorkingDirectory= 4
|
---|
84 |
|
---|
85 | XPCOM_CurrentProcessComponentDirectory= 5
|
---|
86 | XPCOM_CurrentProcessComponentRegistry= 6
|
---|
87 |
|
---|
88 | Moz_BinDirectory = 10
|
---|
89 |
|
---|
90 | Mac_SystemDirectory = 101
|
---|
91 | Mac_DesktopDirectory = 102
|
---|
92 | Mac_TrashDirectory = 103
|
---|
93 | Mac_StartupDirectory = 104
|
---|
94 | Mac_ShutdownDirectory = 105
|
---|
95 | Mac_AppleMenuDirectory = 106
|
---|
96 | Mac_ControlPanelDirectory = 107
|
---|
97 | Mac_ExtensionDirectory = 108
|
---|
98 | Mac_FontsDirectory = 109
|
---|
99 | Mac_PreferencesDirectory = 110
|
---|
100 | Mac_DocumentsDirectory = 111
|
---|
101 | Mac_InternetSearchDirectory = 112
|
---|
102 |
|
---|
103 | Win_SystemDirectory = 201
|
---|
104 | Win_WindowsDirectory = 202
|
---|
105 |
|
---|
106 | Win_HomeDirectory = 203
|
---|
107 | Win_Desktop = 204
|
---|
108 | Win_Programs = 205
|
---|
109 | Win_Controls = 206
|
---|
110 | Win_Printers = 207
|
---|
111 | Win_Personal = 208
|
---|
112 | Win_Favorites = 209
|
---|
113 | Win_Startup = 210
|
---|
114 | Win_Recent = 211
|
---|
115 | Win_Sendto = 212
|
---|
116 | Win_Bitbucket = 213
|
---|
117 | Win_Startmenu = 214
|
---|
118 | Win_Desktopdirectory = 215
|
---|
119 | Win_Drives = 216
|
---|
120 | Win_Network = 217
|
---|
121 | Win_Nethood = 218
|
---|
122 | Win_Fonts = 219
|
---|
123 | Win_Templates = 220
|
---|
124 | Win_Common_Startmenu = 221
|
---|
125 | Win_Common_Programs = 222
|
---|
126 | Win_Common_Startup = 223
|
---|
127 | Win_Common_Desktopdirectory = 224
|
---|
128 | Win_Appdata = 225
|
---|
129 | Win_Printhood = 226
|
---|
130 |
|
---|
131 | Unix_LocalDirectory = 301
|
---|
132 | Unix_LibDirectory = 302
|
---|
133 | Unix_HomeDirectory = 303
|
---|
134 |
|
---|
135 | BeOS_SettingsDirectory = 401
|
---|
136 | BeOS_HomeDirectory = 402
|
---|
137 | BeOS_DesktopDirectory = 403
|
---|
138 | BeOS_SystemDirectory = 404
|
---|
139 |
|
---|
140 | OS2_SystemDirectory = 501
|
---|
141 |
|
---|
142 | # Type/Variant related constants.
|
---|
143 | TD_INT8 = 0
|
---|
144 | TD_INT16 = 1
|
---|
145 | TD_INT32 = 2
|
---|
146 | TD_INT64 = 3
|
---|
147 | TD_UINT8 = 4
|
---|
148 | TD_UINT16 = 5
|
---|
149 | TD_UINT32 = 6
|
---|
150 | TD_UINT64 = 7
|
---|
151 | TD_FLOAT = 8
|
---|
152 | TD_DOUBLE = 9
|
---|
153 | TD_BOOL = 10
|
---|
154 | TD_CHAR = 11
|
---|
155 | TD_WCHAR = 12
|
---|
156 | TD_VOID = 13
|
---|
157 | TD_PNSIID = 14
|
---|
158 | TD_DOMSTRING = 15
|
---|
159 | TD_PSTRING = 16
|
---|
160 | TD_PWSTRING = 17
|
---|
161 | TD_INTERFACE_TYPE = 18
|
---|
162 | TD_INTERFACE_IS_TYPE = 19
|
---|
163 | TD_ARRAY = 20
|
---|
164 | TD_PSTRING_SIZE_IS = 21
|
---|
165 | TD_PWSTRING_SIZE_IS = 22
|
---|
166 | TD_UTF8STRING = 23
|
---|
167 | TD_CSTRING = 24
|
---|
168 | TD_ASTRING = 25
|
---|
169 |
|
---|
170 | # From xpt_struct.h
|
---|
171 | XPT_TDP_POINTER = 0x80
|
---|
172 | XPT_TDP_UNIQUE_POINTER = 0x40
|
---|
173 | XPT_TDP_REFERENCE = 0x20
|
---|
174 | XPT_TDP_FLAGMASK = 0xe0
|
---|
175 | XPT_TDP_TAGMASK = (~XPT_TDP_FLAGMASK)
|
---|
176 | def XPT_TDP_TAG(tdp): return (tdp & XPT_TDP_TAGMASK)
|
---|
177 |
|
---|
178 | def XPT_TDP_IS_POINTER(flags): return (flags & XPT_TDP_POINTER)
|
---|
179 | def XPT_TDP_IS_UNIQUE_POINTER(flags): return (flags & XPT_TDP_UNIQUE_POINTER)
|
---|
180 | def XPT_TDP_IS_REFERENCE(flags): return (flags & XPT_TDP_REFERENCE)
|
---|
181 |
|
---|
182 | XPT_ID_SCRIPTABLE = 0x80
|
---|
183 | XPT_ID_FLAGMASK = 0x80
|
---|
184 | XPT_ID_TAGMASK = ~XPT_ID_FLAGMASK
|
---|
185 | def XPT_ID_TAG(id): return id & XPT_ID_TAGMASK
|
---|
186 |
|
---|
187 | def XPT_ID_IS_SCRIPTABLE(flags): return flags & XPT_ID_SCRIPTABLE
|
---|
188 |
|
---|
189 | XPT_PD_IN = 0x80
|
---|
190 | XPT_PD_OUT = 0x40
|
---|
191 | XPT_PD_RETVAL = 0x20
|
---|
192 | XPT_PD_SHARED = 0x10
|
---|
193 | XPT_PD_DIPPER = 0x08
|
---|
194 | XPT_PD_FLAGMASK = 0xf0
|
---|
195 |
|
---|
196 | def XPT_PD_IS_IN(flags): return (flags & XPT_PD_IN)
|
---|
197 | def XPT_PD_IS_OUT(flags): return (flags & XPT_PD_OUT)
|
---|
198 | def XPT_PD_IS_RETVAL(flags): return (flags & XPT_PD_RETVAL)
|
---|
199 | def XPT_PD_IS_SHARED(flags): return (flags & XPT_PD_SHARED)
|
---|
200 | def XPT_PD_IS_DIPPER(flags): return (flags & XPT_PD_DIPPER)
|
---|
201 |
|
---|
202 | XPT_MD_GETTER = 0x80
|
---|
203 | XPT_MD_SETTER = 0x40
|
---|
204 | XPT_MD_NOTXPCOM = 0x20
|
---|
205 | XPT_MD_CTOR = 0x10
|
---|
206 | XPT_MD_HIDDEN = 0x08
|
---|
207 | XPT_MD_FLAGMASK = 0xf8
|
---|
208 |
|
---|
209 | def XPT_MD_IS_GETTER(flags): return (flags & XPT_MD_GETTER)
|
---|
210 | def XPT_MD_IS_SETTER(flags): return (flags & XPT_MD_SETTER)
|
---|
211 | def XPT_MD_IS_NOTXPCOM(flags): return (flags & XPT_MD_NOTXPCOM)
|
---|
212 | def XPT_MD_IS_CTOR(flags): return (flags & XPT_MD_CTOR)
|
---|
213 | def XPT_MD_IS_HIDDEN(flags): return (flags & XPT_MD_HIDDEN)
|
---|
214 |
|
---|
215 | # From xptinfo.h
|
---|
216 |
|
---|
217 | T_I8 = TD_INT8
|
---|
218 | T_I16 = TD_INT16
|
---|
219 | T_I32 = TD_INT32
|
---|
220 | T_I64 = TD_INT64
|
---|
221 | T_U8 = TD_UINT8
|
---|
222 | T_U16 = TD_UINT16
|
---|
223 | T_U32 = TD_UINT32
|
---|
224 | T_U64 = TD_UINT64
|
---|
225 | T_FLOAT = TD_FLOAT
|
---|
226 | T_DOUBLE = TD_DOUBLE
|
---|
227 | T_BOOL = TD_BOOL
|
---|
228 | T_CHAR = TD_CHAR
|
---|
229 | T_WCHAR = TD_WCHAR
|
---|
230 | T_VOID = TD_VOID
|
---|
231 | T_IID = TD_PNSIID
|
---|
232 | T_DOMSTRING = TD_DOMSTRING
|
---|
233 | T_CHAR_STR = TD_PSTRING
|
---|
234 | T_WCHAR_STR = TD_PWSTRING
|
---|
235 | T_INTERFACE = TD_INTERFACE_TYPE
|
---|
236 | T_INTERFACE_IS = TD_INTERFACE_IS_TYPE
|
---|
237 | T_ARRAY = TD_ARRAY
|
---|
238 | T_PSTRING_SIZE_IS = TD_PSTRING_SIZE_IS
|
---|
239 | T_PWSTRING_SIZE_IS = TD_PWSTRING_SIZE_IS
|
---|
240 | T_UTF8STRING = TD_UTF8STRING
|
---|
241 | T_CSTRING = TD_CSTRING
|
---|
242 | T_ASTRING = TD_ASTRING
|
---|
243 |
|
---|
244 | # from nsIVariant
|
---|
245 | VTYPE_INT8 = 0
|
---|
246 | VTYPE_INT16 = 1
|
---|
247 | VTYPE_INT32 = 2
|
---|
248 | VTYPE_INT64 = 3
|
---|
249 | VTYPE_UINT8 = 4
|
---|
250 | VTYPE_UINT16 = 5
|
---|
251 | VTYPE_UINT32 = 6
|
---|
252 | VTYPE_UINT64 = 7
|
---|
253 | VTYPE_FLOAT = 8
|
---|
254 | VTYPE_DOUBLE = 9
|
---|
255 | VTYPE_BOOL = 10
|
---|
256 | VTYPE_CHAR = 11
|
---|
257 | VTYPE_WCHAR = 12
|
---|
258 | VTYPE_VOID = 13
|
---|
259 | VTYPE_ID = 14
|
---|
260 | VTYPE_DOMSTRING = 15
|
---|
261 | VTYPE_CHAR_STR = 16
|
---|
262 | VTYPE_WCHAR_STR = 17
|
---|
263 | VTYPE_INTERFACE = 18
|
---|
264 | VTYPE_INTERFACE_IS = 19
|
---|
265 | VTYPE_ARRAY = 20
|
---|
266 | VTYPE_STRING_SIZE_IS = 21
|
---|
267 | VTYPE_WSTRING_SIZE_IS = 22
|
---|
268 | VTYPE_UTF8STRING = 23
|
---|
269 | VTYPE_CSTRING = 24
|
---|
270 | VTYPE_ASTRING = 25
|
---|
271 | VTYPE_EMPTY_ARRAY = 254
|
---|
272 | VTYPE_EMPTY = 255
|
---|