Use o3tl::convert in Math
[LibreOffice.git] / scp2 / inc / macros.inc
blobdbdc45786cc5840be46a0e3b508116eb38e42165
1 /*
2  * This file is part of the LibreOffice project.
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  *
8  * This file incorporates work covered by the following license notice:
9  *
10  *   Licensed to the Apache Software Foundation (ASF) under one or more
11  *   contributor license agreements. See the NOTICE file distributed
12  *   with this work for additional information regarding copyright
13  *   ownership. The ASF licenses this file to you under the Apache
14  *   License, Version 2.0 (the "License"); you may not use this file
15  *   except in compliance with the License. You may obtain a copy of
16  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
17  */
19 #ifndef MACROS_INC
20 #define MACROS_INC
21 /* =====================================================
22  * global helper macros
23  * =====================================================*/
25 #define DOSTRING( x )                           #x
26 #define STRING( x )                             DOSTRING( x )
27 #define DOCONCAT2( x, y )                       x##y
28 #define CONCAT2( x, y)                          DOCONCAT2(x,y)
29 #define DOCONCAT3( x, y, z )                    x##y##z
30 #define CONCAT3( x, y, z )                      DOCONCAT3(x,y,z)
31 #define DOCONCAT4( x, y, z, a )                 x##y##z##a
32 #define CONCAT4( x, y, z, a )                   DOCONCAT4(x,y,z,a)
33 #define DOCONCAT5( x, y, z, a, b )              x##y##z##a##b
34 #define CONCAT5( x, y, z, a, b )                DOCONCAT5(x,y,z,a,b)
35 #define DOCONCAT6( x, y, z, a, b, c )           x##y##z##a##b##c
36 #define CONCAT6( x, y, z, a, b, c )             DOCONCAT6(x,y,z,a,b,c)
37 #define DOCONCAT7( x, y, z, a, b, c, u)         x##y##z##a##b##c##u
38 #define CONCAT7( x, y, z, a, b, c, u)           DOCONCAT7(x,y,z,a,b,c,u)
39 #define DOCONCAT8( x, y, z, a, b, c, u, v)      x##y##z##a##b##c##u##v
40 #define CONCAT8( x, y, z, a, b, c, u, v)        DOCONCAT8(x,y,z,a,b,c,u,v)
41 #define DOCONCAT9( x, y, z, a, b, c, u, v, w)   x##y##z##a##b##c##u##v##w
42 #define CONCAT9( x, y, z, a, b, c, u, v, w)     DOCONCAT9(x,y,z,a,b,c,u,v,w)
44 #define MOD_NAME_DESC(id) \
45         ALL_LANG(Name,STR_NAME_##id); \
46         ALL_LANG(Description,STR_DESC_##id)
48 #define REG_VALUE_LNG(id) \
49         ALL_LANG(Value,STR_REG_VAL_##id);
51 #ifdef UNX
52     #ifdef MACOSX
53         #define UNXSUFFIX .dylib
54     #else
55         #define UNXSUFFIX .so
56     #endif
57 #endif
59 #ifdef UNX
60     #define PROFILENAME(name)                 STRING(CONCAT2(name,rc))
61 #else
62     #define PROFILENAME(name)                 STRING(CONCAT2(name,.ini))
63 #endif
65 #ifdef MACOSX
66     #define GID_BRAND_DIR_ETC gid_Brand_Dir_Share
67     #define GID_DIR_PY gid_Brand_Dir_Share
68     #define GID_DIR_URE_LIB gid_Dir_Frameworks
69 #else
70     #define GID_BRAND_DIR_ETC gid_Brand_Dir_Program
71     #define GID_DIR_PY gid_Brand_Dir_Program
72     #define GID_DIR_URE_LIB gid_Brand_Dir_Program
73 #endif
75 #define RESFILENAME(name,lang)                STRING(CONCAT3(name,lang,.res))
76 #define READMETXTFILENAME(name,lang,ext)      STRING(CONCAT4(name,lang,.,ext))
77 #define READMEFILENAME(name,lang)             STRING(CONCAT2(name,lang))
78 #define EXTRAFILENAME(name,lang)              STRING(CONCAT3(name,lang,.zip))
79 #define EXTRAFILELISTNAME(prefix,name,lang)   STRING(CONCAT4(prefix,name,lang,.filelist))
80 #define CONFIGLANGFILENAME(name,lang,ext)     STRING(CONCAT4(name,lang,.,ext))
82 #define SCP2_OOO_BIN_DIR gid_Brand_Dir_Program
84 #ifdef MACOSX
85     #define SCP2_OOO_LIB_DIR gid_Dir_Frameworks
86 #else
87     #define SCP2_OOO_LIB_DIR SCP2_OOO_BIN_DIR
88 #endif
90 #define BIN_FILE_BODY \
91         UnixRights   = 755
93 #define LIB_FILE_BODY \
94         UnixRights   = 755
96 #define TXT_FILE_BODY \
97         UnixRights   = 644
99 #define USER_FILE_BODY \
100         UnixRights   = 644
102 #define PACKED_TXT_FILE_BODY \
103         TXT_FILE_BODY; \
104         Styles = (PACKED)
106 #ifdef WITH_HELPPACK_INTEGRATION
107 #define FILELIST_TXT_FILE_BODY_HELPPACK \
108         TXT_FILE_BODY; \
109         Styles = (FILELIST,FORCEHELPPACK,LANGUAGEMODULE)
110 #else
111 #define FILELIST_TXT_FILE_BODY_HELPPACK \
112         TXT_FILE_BODY; \
113         Styles = (FILELIST,HELPPACK,LANGUAGEMODULE)
114 #endif
116 #define PACKAGE_FILELIST(id,name) \
117 File id \
118     Dir = FILELIST_DIR; \
119     Name = name; \
120     Styles = (FILELIST, USE_INTERNAL_RIGHTS, PACKED); \
123 #define PACKAGE_FILELIST_COMPONENTCONDITION(id,name,cond) \
124 File id \
125     Dir = FILELIST_DIR; \
126     Name = name; \
127     Styles = (FILELIST, USE_INTERNAL_RIGHTS, PACKED); \
128     ComponentCondition = cond; \
131 #ifdef WNT
132 #define PACKAGE_FILELIST_FONT(id,name) \
133 File id \
134     Dir = FILELIST_DIR; \
135     Name = name; \
136     Styles = (FILELIST, USE_INTERNAL_RIGHTS, PACKED, FONT); \
138 #else
139 #define PACKAGE_FILELIST_FONT PACKAGE_FILELIST
140 #endif // WNT
142 #define SDK_PACKAGE_FILELIST(id,name) \
143 File id \
144     Dir = FILELIST_SDK_DIR; \
145     Name = name; \
146     Styles = (FILELIST, USE_INTERNAL_RIGHTS, PACKED); \
149 #define PACKED_LIB_FILE_BODY \
150         LIB_FILE_BODY; \
151         Styles = (PACKED); \
152         Dir    = SCP2_OOO_LIB_DIR
154 #define LIBO_LIB_FILE(id,name) \
155     File id \
156         Name = name; \
157         PACKED_LIB_FILE_BODY; \
158     End
160 #define LIBO_LIB_FILE_BINARYTABLE(id,name) \
161     File id \
162         Name = name; \
163         PACKED_LIB_FILE_BODY; \
164         Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY); \
165     End
167 #define LIBO_LIB_FILE_COMPONENTCONDITION(id,name,cond) \
168     File id \
169         Name = name; \
170         PACKED_LIB_FILE_BODY; \
171         ComponentCondition = cond; \
172     End
174 #define SHLXTHDL_LIB_FILE(id,name) \
175     File id \
176         Name = name; \
177         LIB_FILE_BODY; \
178         Styles = (PACKED); \
179         Dir    = gid_Dir_Shlxthdl; \
180     End
182 #define SHLXTHDL_X64_LIB_FILE_COMPONENTCONDITION(id,name,cond) \
183     File id \
184         Name = name; \
185         LIB_FILE_BODY; \
186         Styles = (PACKED); \
187         Dir    = gid_Dir_Shlxthdl_x64; \
188         ComponentCondition = cond; \
189     End
191 #ifdef MACOSX
192 // links are created at configure time by odk/config/setsdkenv_unix.sh.in
193 #define SDK_LIBRARY_LINK(id,name,target)
194 #elif defined(WNT)
195 #define SDK_LIBRARY_LINK(id,name,target) \
196     File id \
197         TXT_FILE_BODY; \
198         Styles = (PACKED); \
199         Dir = gid_Dir_Lib_Sdk; \
200         Name = name; \
201     End
202 #else
203 #define SDK_LIBRARY_LINK(id,name,target) \
204     Unixlink id \
205      BIN_FILE_BODY; \
206      Styles = (); \
207      Dir = gid_Dir_Lib_Sdk; \
208      Name = name; \
209      Target = target; \
210     End
211 #endif
213 #define LIBO_JAR_FILE(id,name) \
214     File id \
215         TXT_FILE_BODY; \
216         Name = name; \
217         Dir = gid_Dir_Classes; \
218         Styles = (PACKED); \
219     End
221 #define URE_JAR_FILE(id,name) \
222     File id \
223         TXT_FILE_BODY; \
224         Name = name; \
225         Dir = gid_Dir_Classes; \
226         Styles = (PACKED); \
227     End
229 #define CONDITIONAL_MODULE_ENTRY(name,modid) \
230     Module gid_Module_Root_Reg_##name \
231         ParentID = modid; \
232         Name = STRING(CONCAT2(gid_Module_Root_,name)); \
233         Description = STRING(CONCAT2(gid_Module_Root_,name)); \
234         Default = YES; \
235         Styles = (HIDDEN_ROOT); \
238 #define REGISTRY_ENTRY_OPEN_WITH(name,cond,doc_type,modid,key) \
239     RegistryItem gid_Regitem_OpenOffice_##cond##_OpenWith_##doc_type \
240         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
241         ModuleID = modid; \
242         Subkey = STRING(CONCAT3(.,key,\OpenWithProgIDs)); \
243         Name = STRING(CONCAT2(CollaboraOffice.,name)); \
244         Value = " "; \
245     End
247 #define REGISTRY_ENTRY_OPEN_WITH_TMPL(name,cond,doc_type,modid,key) \
248     RegistryItem gid_Regitem_OpenOffice_##cond##_OpenWith_##doc_type \
249         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
250         ModuleID = modid; \
251         Subkey = STRING(CONCAT3(.,key,\OpenWithProgIDs)); \
252         Name = STRING(CONCAT2(CollaboraOffice.,name)); \
253         Value = " "; \
254     End
256 #define CONDITIONAL_REGISTRY_ENTRY_EXT(name,cond,key) \
257     RegistryItem gid_Regitem__##name \
258         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
259         ModuleID = gid_Module_Root_Reg_##name; \
260         Subkey = STRING(CONCAT2(.,key)); \
261         Value = STRING(CONCAT2(CollaboraOffice.,name)); \
262         ComponentCondition = STRING(CONCAT3(REGISTER_,cond,=1)); \
263     End
265 #define CONDITIONAL_REGISTRY_ENTRY_EXT_MEDIATYPE(name,cond,key,mediatype) \
266     RegistryItem gid_Regitem__MediaType_##name \
267         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
268         ModuleID = gid_Module_Root_Reg_##name; \
269         Subkey = STRING(CONCAT2(.,key)); \
270         Name = STRING(Content Type); \
271         Value = STRING(mediatype); \
272         ComponentCondition = STRING(CONCAT3(REGISTER_,cond,=1)); \
273     End
275 #define REGISTRY_ENTRY_DOC(name,modid,disp_name) \
276     RegistryItem CONCAT2(gid_Regitem_Openoffice_,name) \
277         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
278         ModuleID = modid; \
279         Subkey = STRING(CONCAT2(CollaboraOffice.,name)); \
280         REG_VALUE_LNG(disp_name) \
281     End
283 #define REGISTRY_ENTRY_APPUSERMODELID(name,modid,doc_type) \
284     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_AppUserModelID) \
285         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
286         ModuleID = modid; \
287         Subkey = STRING(CONCAT2(CollaboraOffice.,name)); \
288         Name = STRING(AppUserModelID); \
289         Value = STRING(CONCAT2(Collabora.CollaboraOffice.,doc_type)); \
290     End
292 #define REGISTRY_ENTRY_ICON(name,modid,icon_id) \
293     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Defaulticon) \
294         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
295         ModuleID = modid; \
296         Subkey = STRING(CONCAT3(CollaboraOffice.,name,\DefaultIcon)); \
297         Value = "<progpath>\program\soffice.bin," STRING(icon_id); \
298     End
300 #define REGISTRY_ENTRY_SHELL(name,default,modid) \
301     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell) \
302         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
303         ModuleID = modid; \
304         Subkey = STRING(CONCAT3(CollaboraOffice.,name,\shell)); \
305         Value = STRING(default); \
306     End
308 #define REGISTRY_ENTRY_NEW_CMD_PPA(name,modid,progpath_program_app) \
309     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_New) \
310         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
311         ModuleID = modid; \
312         Subkey = STRING(CONCAT3(CollaboraOffice.,name,\shell\new)); \
313         REG_VALUE_LNG(NEW) \
314     End \
315     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_New_Command) \
316         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
317         ModuleID = modid; \
318         Subkey = STRING(CONCAT3(CollaboraOffice.,name,\shell\new\command)); \
319         Value = "\"" STRING(progpath_program_app) "\" -n \"%1\""; \
320     End
322 #define REGISTRY_ENTRY_NEW_CMD(name,modid,app) \
323         REGISTRY_ENTRY_NEW_CMD_PPA(name,modid,<progpath>\program\app)
325 #define REGISTRY_ENTRY_OPEN_CMD_PPA(name,modid,progpath_program_app) \
326     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_Open_Command) \
327         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
328         ModuleID = modid; \
329         Subkey = STRING(CONCAT3(CollaboraOffice.,name,\shell\open\command)); \
330         Value = "\"" STRING(progpath_program_app) "\" -o \"%1\""; \
331     End
333 #define REGISTRY_ENTRY_OPEN_CMD(name,modid,app) \
334         REGISTRY_ENTRY_OPEN_CMD_PPA(name,modid,<progpath>\program\app)
336 #define REGISTRY_ENTRY_PRINT_CMD_PPA(name,modid,progpath_program_app) \
337     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_Print_Command) \
338         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
339         ModuleID = modid; \
340         Subkey = STRING(CONCAT3(CollaboraOffice.,name,\shell\print\command)); \
341         Value = "\"" STRING(progpath_program_app) "\" -p \"%1\""; \
342     End
344 #define REGISTRY_ENTRY_PRINT_CMD(name,modid,app) \
345         REGISTRY_ENTRY_PRINT_CMD_PPA(name,modid,<progpath>\program\app)
347 #define REGISTRY_ENTRY_PRINTTO_CMD_PPA(name,modid,progpath_program_app) \
348     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_Printto_Command) \
349         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
350         ModuleID = modid; \
351         Subkey = STRING(CONCAT3(CollaboraOffice.,name,\shell\printto\command)); \
352         Value = "\"" STRING(progpath_program_app) "\" -pt \"%2\" \"%1\""; \
353     End
355 #define REGISTRY_ENTRY_PRINTTO_CMD(name,modid,app) \
356         REGISTRY_ENTRY_PRINTTO_CMD_PPA(name,modid,<progpath>\program\app)
358 #define REGISTRY_ENTRY_CAPABILITIES(name,modid,key,doc_type) \
359     RegistryItem CONCAT2(gid_Regitem_Software_Manufacturer_Productname_Productversion_Capabilities_FileAssociations_,name) \
360         ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
361         ModuleID = modid; \
362         Subkey = STRING(Software\%MANUFACTURER\%PRODUCTNAME%PRODUCTADDON\%PRODUCTVERSION\Capabilities\FileAssociations); \
363         Name = STRING(CONCAT2(.,key)); \
364         Value = STRING(CONCAT2(CollaboraOffice.,name)); \
365         Styles = (); \
366     End
368 #define REGISTRY_ENTRY_TEMPLATE_CAPABILITIES(name,modid,key,doc_type) \
369     RegistryItem CONCAT2(gid_Regitem_Software_Manufacturer_Productname_Productversion_Capabilities_FileAssociations_,name) \
370         ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
371         ModuleID = modid; \
372         Subkey = STRING(Software\%MANUFACTURER\%PRODUCTNAME%PRODUCTADDON\%PRODUCTVERSION\Capabilities\FileAssociations); \
373         Name = STRING(CONCAT2(.,key)); \
374         Value = STRING(CONCAT2(CollaboraOffice.,name)); \
375         Styles = (); \
376     End
378 #define REGISTRY_ENTRY_CAPABILITIES_URL(scheme,name,modid,handler) \
379     RegistryItem CONCAT2(gid_Regitem_Software_Manufacturer_Productname_Productversion_Capabilities_URLAssociations_,name) \
380         ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
381         ModuleID = modid; \
382         Subkey = STRING(Software\%MANUFACTURER\%PRODUCTNAME%PRODUCTADDON\%PRODUCTVERSION\Capabilities\URLAssociations); \
383         Name = scheme; \
384         Value = handler; \
385         Styles = (); \
386     End
388 #define CONDITIONAL_REGISTER_DOC_OPEN_EXTENSION(name,modid,key,cond,disp_name,icon_id,app,default,doc_type) \
389     CONDITIONAL_MODULE_ENTRY(name,modid) \
390     REGISTRY_ENTRY_OPEN_WITH(name,cond,doc_type,modid,key) \
391     CONDITIONAL_REGISTRY_ENTRY_EXT(name,cond,key) \
392     REGISTRY_ENTRY_DOC(name,modid,disp_name) \
393     REGISTRY_ENTRY_APPUSERMODELID(name,modid,doc_type) \
394     REGISTRY_ENTRY_ICON(name,modid,icon_id) \
395     REGISTRY_ENTRY_SHELL(name,default,modid) \
396     REGISTRY_ENTRY_OPEN_CMD(name,modid,app) \
397     REGISTRY_ENTRY_CAPABILITIES(name,modid,key,doc_type) \
399 #define CONDITIONAL_REGISTER_DOC_EXTENSION(name,modid,key,cond,disp_name,icon_id,app,default,doc_type) \
400     CONDITIONAL_REGISTER_DOC_OPEN_EXTENSION(name,modid,key,cond,disp_name,icon_id,app,default,doc_type) \
401     REGISTRY_ENTRY_NEW_CMD(name,modid,app) \
402     REGISTRY_ENTRY_PRINT_CMD(name,modid,app) \
403     REGISTRY_ENTRY_PRINTTO_CMD(name,modid,app) \
405 #define CONDITIONAL_REGISTER_DOCTEMPLATE_EXTENSION(name,modid,key,cond,disp_name,icon_id,app,default,doc_type) \
406     CONDITIONAL_MODULE_ENTRY(name,modid) \
407     REGISTRY_ENTRY_OPEN_WITH_TMPL(name,cond,doc_type,modid,key) \
408     CONDITIONAL_REGISTRY_ENTRY_EXT(name,cond,key) \
409     REGISTRY_ENTRY_DOC(name,modid,disp_name) \
410     REGISTRY_ENTRY_APPUSERMODELID(name,modid,doc_type) \
411     REGISTRY_ENTRY_ICON(name,modid,icon_id) \
412     REGISTRY_ENTRY_SHELL(name,default,modid) \
413     REGISTRY_ENTRY_NEW_CMD(name,modid,app) \
414     REGISTRY_ENTRY_OPEN_CMD(name,modid,app) \
415     REGISTRY_ENTRY_PRINT_CMD(name,modid,app) \
416     REGISTRY_ENTRY_PRINTTO_CMD(name,modid,app) \
417     REGISTRY_ENTRY_TEMPLATE_CAPABILITIES(name,modid,key,doc_type) \
419 #ifdef _MSC_VER
421 #ifdef BUILD_X64
423 #define REGISTER_PROPERTY_HANDLER_FOR_EXTENSION(extension) \
424     RegistryItem CONCAT2(gid_Regitem_Software_Microsoft_Windows_CurrentVersion_PropertySystem_PropertyHandlers_,extension) \
425         ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
426         ModuleID = gid_Module_Optional_Winexplorerext; \
427         Subkey = STRING(CONCAT2(SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\.,extension)); \
428         Value = "{AE424E85-F6DF-4910-A6A9-438797986431}"; \
429     End \
431     RegistryItem CONCAT3(gid_Regitem_Software_Microsoft_Windows_CurrentVersion_PropertySystem_PropertyHandlers_,extension,_x64) \
432         ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
433         ModuleID = gid_Module_Optional_Winexplorerext_x64; \
434         ComponentCondition = "VersionNT64"; \
435         Subkey = STRING(CONCAT2(SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\.,extension)); \
436         Value = "{AE424E85-F6DF-4910-A6A9-438797986431}"; \
437     End
439 #else
441 #define REGISTER_PROPERTY_HANDLER_FOR_EXTENSION(extension) \
442     RegistryItem CONCAT2(gid_Regitem_Software_Microsoft_Windows_CurrentVersion_PropertySystem_PropertyHandlers_,extension) \
443         ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
444         ModuleID = gid_Module_Optional_Winexplorerext; \
445         Subkey = STRING(CONCAT2(SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\.,extension)); \
446         Value = "{AE424E85-F6DF-4910-A6A9-438797986431}"; \
447     End
449 #endif
451 #else
452 #define REGISTER_PROPERTY_HANDLER_FOR_EXTENSION(extension) // empty
453 #endif
456 #define SCP2_URE_DL_DIR GID_DIR_URE_LIB
457 #if defined WNT
458 #define SCP2_URE_DL_NORMAL(n) n ".dll"
459 #define SCP2_URE_DL_VER(n, v) n v ".dll"
460 #define SCP2_URE_DL_UNO_VER(n, v) n v ".dll"
461 #define SCP2_URE_DL_UNO_COMID_VER(n, v) n v STRING(COMID) ".dll"
462 #else
463 #define SCP2_URE_DL_NORMAL(n) "lib" n STRING(UNXSUFFIX)
464 #define SCP2_URE_DL_VER(n, v) "lib" n STRING(UNXSUFFIX) "." v
465 #define SCP2_URE_DL_UNO_VER(n, v) "libuno_" n STRING(UNXSUFFIX) "." v
466 #define SCP2_URE_DL_UNO_NORMAL(n) "libuno_" n STRING(UNXSUFFIX)
467 #define SCP2_URE_DL_UNO_COMID_VER(n, v) \
468     "libuno_" n STRING(COMID) STRING(UNXSUFFIX) "." v
469 #define SCP2_URE_DL_UNO_COMID_NORMAL(n) \
470     "libuno_" n STRING(COMID) STRING(UNXSUFFIX)
471 #endif
472 #if defined MACOSX
473 #define SCP2_URE_JDL_NORMAL(n) "lib" n ".jnilib"
474 #else
475 #define SCP2_URE_JDL_NORMAL(n) SCP2_URE_DL_NORMAL(n)
476 #endif
478 #if defined MACOSX
479 #define FILELIST_DIR PREDEFINED_PROGDIR
480 #define FILELIST_SDK_DIR PREDEFINED_PROGDIR
481 #else
482 #define FILELIST_DIR gid_Dir_Brand_Root
483 #if defined WNT
484 #define FILELIST_SDK_DIR gid_Dir_Sdkoo_Root
485 #else
486 #define FILELIST_SDK_DIR PREDEFINED_PROGDIR
487 #endif
488 #endif
490 #define UI_FILELIST(name, file) \
491     File CONCAT2(gid_File_Share_Config_Sofficecfg_uiconfig_, name) \
492         TXT_FILE_BODY; \
493         Styles = (FILELIST); \
494         Dir = FILELIST_DIR; \
495         Name = file; \
496     End
498 #include <langmacros.inc>
500 #define MO_FILELIST_ALL_LANG(name) \
501     File CONCAT3(gid_File_Res_, name, _Lang) \
502         TXT_FILE_BODY; \
503         Styles = (PACKED); \
504         Dir = gid_Dir_Resource; \
505         MO_ALL_LANG_EXCEPT_EN_US_AND_QTZ(name); \
506     End
508 #define URE_PRIVATE_LIB(id,name) \
509     File id \
510         LIB_FILE_BODY; \
511         Dir = SCP2_URE_DL_DIR; \
512         Name = name; \
513         Styles = (PACKED); \
514     End
516 #define URE_EXECUTABLE(id,name) \
517     File id \
518         BIN_FILE_BODY; \
519         Dir = gid_Brand_Dir_Program; \
520         Name = name; \
521         Styles = (PACKED); \
522     End
524 #define LIBO_EXECUTABLE(id,name) \
525     File id \
526         BIN_FILE_BODY; \
527         Dir = gid_Brand_Dir_Program; \
528         Name = name; \
529         Styles = (PACKED); \
530     End
532 #define LIBO_EXECUTABLE_COMPONENTCONDITION(id,name,cond) \
533     File id \
534         BIN_FILE_BODY; \
535         Dir = gid_Brand_Dir_Program; \
536         Name = name; \
537         Styles = (PACKED); \
538         ComponentCondition = cond; \
539     End
541 #define SDK_EXECUTABLE(id,name) \
542     File id \
543         BIN_FILE_BODY; \
544         Dir = gid_Dir_Sdkoo_Bin; \
545         Name = name; \
546         Styles = (PACKED); \
547     End
549 #define GALLERY_NAME(id) \
551 #define GALLERY_FILELIST(id) \
552 File gid_File_Extra_Gall##id \
553     Dir = FILELIST_DIR; \
554     TXT_FILE_BODY; \
555     Styles = (FILELIST, WORKSTATION); \
556     Name = STRING(CONCAT3(Gallery/,id,.filelist)); \
557 End \
558 File gid_File_Extra_GallFiles##id \
559     Dir = FILELIST_DIR; \
560     TXT_FILE_BODY; \
561     Styles = (FILELIST, WORKSTATION); \
562     Name = STRING(CONCAT3(Gallery/Files/,id,.filelist)); \
565 #define REGISTER_URI_HANDLER_IMPL(protocol,protid,modid,cond) \
566 RegistryItem CONCAT2(gid_Regitem_,protid) \
567     ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
568     ModuleID = modid; \
569     Subkey = STRING(protocol); \
570     Value = "URL:" STRING(protocol) " Protocol"; \
571     cond \
572 End \
573 RegistryItem CONCAT3(gid_Regitem_,protid,_URL_Protocol) \
574     ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
575     ModuleID = modid; \
576     Subkey = STRING(protocol); \
577     Name = "URL Protocol"; \
578 End \
579 RegistryItem CONCAT3(gid_Regitem_,protid,_UseOriginalUrlEncoding) \
580     ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
581     ModuleID = modid; \
582     Subkey = STRING(protocol); \
583     Name = "UseOriginalUrlEncoding"; \
584     Value = "#1"; \
585 End \
586 RegistryItem CONCAT3(gid_Regitem_,protid,_DefaultIcon) \
587     ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
588     ModuleID = modid; \
589     Subkey = STRING(CONCAT2(protocol,\DefaultIcon)); \
590     Value = "<progpath>\program\soffice.bin,0"; \
591 End \
592 RegistryItem CONCAT3(gid_Regitem_,protid,_shell_open_command) \
593     ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
594     ModuleID = modid; \
595     Subkey = STRING(CONCAT2(protocol,\shell\open\command)); \
596     Value = "\"<progpath>\program\soffice.exe\" \"%1\""; \
599 #define REG_COND(cond) \
600     ComponentCondition = STRING(CONCAT2(cond,=1));
602 #define REG_EMPTY_COND
604 #define REGISTER_URI_HANDLER(protocol,protid,modid) \
605     REGISTER_URI_HANDLER_IMPL(protocol,protid,modid,REG_EMPTY_COND)
607 #define CONDITIONAL_REGISTER_URI_HANDLER(protocol,protid,modid,cond) \
608     CONDITIONAL_MODULE_ENTRY(protid,modid) \
609     REGISTER_URI_HANDLER_IMPL(protocol,protid,gid_Module_Root_Reg_##protid,REG_COND(cond))
611 #endif // MACROS_INC