build fix: no comphelper/profilezone.hxx in this branch
[LibreOffice.git] / scp2 / inc / macros.inc
blobb2ded7678a2f2d6c9891536028f039772ad7ee4a
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 PACKED_LIB_FILE_BODY \
124         LIB_FILE_BODY; \
125         Styles = (PACKED); \
126         Dir    = SCP2_OOO_LIB_DIR
128 #define LIBO_LIB_FILE(id,name) \
129     File id \
130         Name = name; \
131         PACKED_LIB_FILE_BODY; \
132     End
134 #define LIBO_LIB_FILE_BINARYTABLE(id,name) \
135     File id \
136         Name = name; \
137         PACKED_LIB_FILE_BODY; \
138         Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY); \
139     End
141 #define LIBO_LIB_FILE_COMPONENTCONDITION(id,name,cond) \
142     File id \
143         Name = name; \
144         PACKED_LIB_FILE_BODY; \
145         ComponentCondition = cond; \
146     End
148 #define SHLXTHDL_LIB_FILE(id,name) \
149     File id \
150         Name = name; \
151         LIB_FILE_BODY; \
152         Styles = (PACKED); \
153         Dir    = gid_Dir_Shlxthdl; \
154     End
156 #define SHLXTHDL_LIB_FILE_COMPONENTCONDITION(id,name,cond) \
157     File id \
158         Name = name; \
159         LIB_FILE_BODY; \
160         Styles = (PACKED); \
161         Dir    = gid_Dir_Shlxthdl; \
162         ComponentCondition = cond; \
163     End
165 #ifdef MACOSX
166 // links are created at configure time by odk/config/setsdkenv_unix.sh.in
167 #define SDK_LIBRARY_LINK(id,name,target)
168 #elif defined(WNT)
169 #define SDK_LIBRARY_LINK(id,name,target) \
170     File id \
171         TXT_FILE_BODY; \
172         Styles = (PACKED); \
173         Dir = gid_Dir_Lib_Sdk; \
174         Name = name; \
175     End
176 #else
177 #define SDK_LIBRARY_LINK(id,name,target) \
178     Unixlink id \
179      BIN_FILE_BODY; \
180      Styles = (); \
181      Dir = gid_Dir_Lib_Sdk; \
182      Name = name; \
183      Target = target; \
184     End
185 #endif
187 #define STD_RES_FILE(id,name) \
188     File id \
189         TXT_FILE_BODY; \
190         RESFILE_ALL_LANG(name); \
191         Dir     = gid_Dir_Resource; \
192         Styles  = (PACKED); \
193     End
195 #ifdef UNX
196 #define STD_FONT_FILELIST(id,name) \
197     File id \
198         TXT_FILE_BODY; \
199         Dir       = FILELIST_DIR; \
200         Styles    = (FILELIST, PACKED, FONT_WARN_IF_EXISTS); \
201         Name      = name; \
202     End
203 #endif
205 #ifdef WNT
206 #define STD_FONT_FILELIST(id,name) \
207     File id \
208         TXT_FILE_BODY; \
209         Dir       = FILELIST_DIR; \
210         Styles   = (FILELIST,PACKED,FONT,DONT_DELETE,FONT_WARN_IF_EXISTS); \
211         Name      = name; \
212     End
213 #endif
215 #define LIBO_JAR_FILE(id,name) \
216     File id \
217         TXT_FILE_BODY; \
218         Name = name; \
219         Dir = gid_Dir_Classes; \
220         Styles = (PACKED); \
221     End
223 #define URE_JAR_FILE(id,name) \
224     File id \
225         TXT_FILE_BODY; \
226         Name = name; \
227         Dir = gid_Dir_Classes; \
228         Styles = (PACKED); \
229     End
231 #define CONDITIONAL_MODULE_ENTRY(name,modid) \
232     Module gid_Module_Root_Reg_##name \
233         ParentID = modid; \
234         Name = STRING(CONCAT2(gid_Module_Root_,name)); \
235         Description = STRING(CONCAT2(gid_Module_Root_,name)); \
236         Default = YES; \
237         Styles = (HIDDEN_ROOT); \
240 #define REGISTRY_ENTRY_OPEN_WITH(name,cond,doc_type,modid,key) \
241     RegistryItem gid_Regitem_OpenOffice_##cond##_OpenWith_##doc_type \
242         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
243         ModuleID = modid; \
244         Subkey = STRING(CONCAT3(.,key,\OpenWithProgIDs)); \
245         Name = STRING(CONCAT2(LibreOffice.,name)); \
246         Value = " "; \
247     End
249 #define REGISTRY_ENTRY_OPEN_WITH_TMPL(name,cond,doc_type,modid,key) \
250     RegistryItem gid_Regitem_OpenOffice_##cond##_OpenWith_##doc_type \
251         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
252         ModuleID = modid; \
253         Subkey = STRING(CONCAT3(.,key,\OpenWithProgIDs)); \
254         Name = STRING(CONCAT2(LibreOffice.,name)); \
255         Value = " "; \
256     End
258 #define CONDITIONAL_REGISTRY_ENTRY_EXT(name,cond,key) \
259     RegistryItem gid_Regitem__##name \
260         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
261         ModuleID = gid_Module_Root_Reg_##name; \
262         Subkey = STRING(CONCAT2(.,key)); \
263         Value = STRING(CONCAT2(LibreOffice.,name)); \
264         ComponentCondition = STRING(CONCAT3(REGISTER_,cond,=1)); \
265     End
267 #define CONDITIONAL_REGISTRY_ENTRY_EXT_MEDIATYPE(name,cond,key,mediatype) \
268     RegistryItem gid_Regitem__MediaType_##name \
269         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
270         ModuleID = gid_Module_Root_Reg_##name; \
271         Subkey = STRING(CONCAT2(.,key)); \
272         Name = STRING(Content Type); \
273         Value = STRING(mediatype); \
274         ComponentCondition = STRING(CONCAT3(REGISTER_,cond,=1)); \
275     End
277 #define CONDITIONAL_REGISTRY_ENTRY_MEDIATYPE_DEF_EXT(name,cond,key,mediatype) \
278     RegistryItem gid_Regitem__MediaType_DefExt_##name \
279         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
280         ModuleID = gid_Module_Root_Reg_##name; \
281         Subkey = STRING(CONCAT2(MIME\Database\Content Type\,mediatype)); \
282         Name = STRING(Extension); \
283         Value = STRING(CONCAT2(.,key)); \
284         ComponentCondition = STRING(CONCAT3(REGISTER_,cond,=1)); \
285     End
287 #define REGISTRY_ENTRY_DOC(name,modid,disp_name) \
288     RegistryItem CONCAT2(gid_Regitem_Openoffice_,name) \
289         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
290         ModuleID = modid; \
291         Subkey = STRING(CONCAT2(LibreOffice.,name)); \
292         REG_VALUE_LNG(disp_name) \
293     End
295 #define REGISTRY_ENTRY_APPUSERMODELID(name,modid,doc_type) \
296     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_AppUserModelID) \
297         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
298         ModuleID = modid; \
299         ComponentCondition = STRING(VersionNT >= 601); \
300         Subkey = STRING(CONCAT2(LibreOffice.,name)); \
301         Name = STRING(AppUserModelID); \
302         Value = STRING(CONCAT2(TheDocumentFoundation.LibreOffice.,doc_type)); \
303     End
305 #define REGISTRY_ENTRY_ICON(name,modid,icon_id) \
306     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Defaulticon) \
307         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
308         ModuleID = modid; \
309         Subkey = STRING(CONCAT3(LibreOffice.,name,\DefaultIcon)); \
310         Value = "<progpath>\program\soffice.bin," STRING(icon_id); \
311     End
313 #define REGISTRY_ENTRY_SHELL(name,default,modid) \
314     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell) \
315         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
316         ModuleID = modid; \
317         Subkey = STRING(CONCAT3(LibreOffice.,name,\shell)); \
318         Value = STRING(default); \
319     End
321 #define REGISTRY_ENTRY_NEW_CMD_PPA(name,modid,progpath_program_app) \
322     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_New) \
323         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
324         ModuleID = modid; \
325         Subkey = STRING(CONCAT3(LibreOffice.,name,\shell\new)); \
326         REG_VALUE_LNG(NEW) \
327     End \
328     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_New_Command) \
329         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
330         ModuleID = modid; \
331         Subkey = STRING(CONCAT3(LibreOffice.,name,\shell\new\command)); \
332         Value = "\"" STRING(progpath_program_app) "\" -n \"%1\""; \
333     End
335 #define REGISTRY_ENTRY_NEW_CMD(name,modid,app) \
336         REGISTRY_ENTRY_NEW_CMD_PPA(name,modid,<progpath>\program\app)
338 #define REGISTRY_ENTRY_OPEN_CMD_PPA(name,modid,progpath_program_app) \
339     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_Open_Command) \
340         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
341         ModuleID = modid; \
342         Subkey = STRING(CONCAT3(LibreOffice.,name,\shell\open\command)); \
343         Value = "\"" STRING(progpath_program_app) "\" -o \"%1\""; \
344     End
346 #define REGISTRY_ENTRY_OPEN_CMD(name,modid,app) \
347         REGISTRY_ENTRY_OPEN_CMD_PPA(name,modid,<progpath>\program\app)
349 #define REGISTRY_ENTRY_PRINT_CMD_PPA(name,modid,progpath_program_app) \
350     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_Print_Command) \
351         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
352         ModuleID = modid; \
353         Subkey = STRING(CONCAT3(LibreOffice.,name,\shell\print\command)); \
354         Value = "\"" STRING(progpath_program_app) "\" -p \"%1\""; \
355     End
357 #define REGISTRY_ENTRY_PRINT_CMD(name,modid,app) \
358         REGISTRY_ENTRY_PRINT_CMD_PPA(name,modid,<progpath>\program\app)
360 #define REGISTRY_ENTRY_PRINTTO_CMD_PPA(name,modid,progpath_program_app) \
361     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_Printto_Command) \
362         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
363         ModuleID = modid; \
364         Subkey = STRING(CONCAT3(LibreOffice.,name,\shell\printto\command)); \
365         Value = "\"" STRING(progpath_program_app) "\" -pt \"%2\" \"%1\""; \
366     End
368 #define REGISTRY_ENTRY_PRINTTO_CMD(name,modid,app) \
369         REGISTRY_ENTRY_PRINTTO_CMD_PPA(name,modid,<progpath>\program\app)
371 #define REGISTRY_ENTRY_CAPABILITIES(name,modid,key,doc_type) \
372     RegistryItem CONCAT2(gid_Regitem_Software_Manufacturer_Productname_Productversion_Capabilities_FileAssociations_,name) \
373         ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
374         ModuleID = modid; \
375         Subkey = STRING(Software\%MANUFACTURER\%PRODUCTNAME%PRODUCTADDON\%PRODUCTVERSION\Capabilities\FileAssociations); \
376         Name = STRING(CONCAT2(.,key)); \
377         Value = STRING(CONCAT2(LibreOffice.,name)); \
378         Styles = (); \
379     End
381 #define REGISTRY_ENTRY_TEMPLATE_CAPABILITIES(name,modid,key,doc_type) \
382     RegistryItem CONCAT2(gid_Regitem_Software_Manufacturer_Productname_Productversion_Capabilities_FileAssociations_,name) \
383         ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
384         ModuleID = modid; \
385         Subkey = STRING(Software\%MANUFACTURER\%PRODUCTNAME%PRODUCTADDON\%PRODUCTVERSION\Capabilities\FileAssociations); \
386         Name = STRING(CONCAT2(.,key)); \
387         Value = STRING(CONCAT2(LibreOffice.,name)); \
388         Styles = (); \
389     End
391 #define REGISTRY_ENTRY_CAPABILITIES_URL(scheme,name,modid,handler) \
392     RegistryItem CONCAT2(gid_Regitem_Software_Manufacturer_Productname_Productversion_Capabilities_URLAssociations_,name) \
393         ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
394         ModuleID = modid; \
395         Subkey = STRING(Software\%MANUFACTURER\%PRODUCTNAME%PRODUCTADDON\%PRODUCTVERSION\Capabilities\URLAssociations); \
396         Name = scheme; \
397         Value = handler; \
398         Styles = (); \
399     End
401 #define CONDITIONAL_REGISTER_DOC_OPEN_EXTENSION(name,modid,key,cond,disp_name,icon_id,app,default,doc_type) \
402     CONDITIONAL_MODULE_ENTRY(name,modid) \
403     REGISTRY_ENTRY_OPEN_WITH(name,cond,doc_type,modid,key) \
404     CONDITIONAL_REGISTRY_ENTRY_EXT(name,cond,key) \
405     REGISTRY_ENTRY_DOC(name,modid,disp_name) \
406     REGISTRY_ENTRY_APPUSERMODELID(name,modid,doc_type) \
407     REGISTRY_ENTRY_ICON(name,modid,icon_id) \
408     REGISTRY_ENTRY_SHELL(name,default,modid) \
409     REGISTRY_ENTRY_OPEN_CMD(name,modid,app) \
410     REGISTRY_ENTRY_CAPABILITIES(name,modid,key,doc_type) \
412 #define CONDITIONAL_REGISTER_DOC_EXTENSION(name,modid,key,cond,disp_name,icon_id,app,default,doc_type) \
413     CONDITIONAL_REGISTER_DOC_OPEN_EXTENSION(name,modid,key,cond,disp_name,icon_id,app,default,doc_type) \
414     REGISTRY_ENTRY_NEW_CMD(name,modid,app) \
415     REGISTRY_ENTRY_PRINT_CMD(name,modid,app) \
416     REGISTRY_ENTRY_PRINTTO_CMD(name,modid,app) \
418 #define CONDITIONAL_REGISTER_DOCTEMPLATE_EXTENSION(name,modid,key,cond,disp_name,icon_id,app,default,doc_type) \
419     CONDITIONAL_MODULE_ENTRY(name,modid) \
420     REGISTRY_ENTRY_OPEN_WITH_TMPL(name,cond,doc_type,modid,key) \
421     CONDITIONAL_REGISTRY_ENTRY_EXT(name,cond,key) \
422     REGISTRY_ENTRY_DOC(name,modid,disp_name) \
423     REGISTRY_ENTRY_APPUSERMODELID(name,modid,doc_type) \
424     REGISTRY_ENTRY_ICON(name,modid,icon_id) \
425     REGISTRY_ENTRY_SHELL(name,default,modid) \
426     REGISTRY_ENTRY_NEW_CMD(name,modid,app) \
427     REGISTRY_ENTRY_OPEN_CMD(name,modid,app) \
428     REGISTRY_ENTRY_PRINT_CMD(name,modid,app) \
429     REGISTRY_ENTRY_PRINTTO_CMD(name,modid,app) \
430     REGISTRY_ENTRY_TEMPLATE_CAPABILITIES(name,modid,key,doc_type) \
432 #ifdef _MSC_VER
434 #ifdef BUILD_X64
436 #define REGISTER_PROPERTY_HANDLER_FOR_EXTENSION(extension) \
437     RegistryItem CONCAT2(gid_Regitem_Software_Microsoft_Windows_CurrentVersion_PropertySystem_PropertyHandlers_,extension) \
438         ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
439         ModuleID = gid_Module_Optional_Winexplorerext; \
440         ComponentCondition = "VersionNT >= 600"; \
441         Subkey = STRING(CONCAT2(SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\.,extension)); \
442         Value = "{AE424E85-F6DF-4910-A6A9-438797986431}"; \
443     End \
445     RegistryItem CONCAT3(gid_Regitem_Software_Microsoft_Windows_CurrentVersion_PropertySystem_PropertyHandlers_,extension,_x64) \
446         ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
447         ModuleID = gid_Module_Optional_Winexplorerext_x64; \
448         ComponentCondition = "VersionNT64 >= 600"; \
449         Subkey = STRING(CONCAT2(SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\.,extension)); \
450         Value = "{AE424E85-F6DF-4910-A6A9-438797986431}"; \
451     End
453 #else
455 #define REGISTER_PROPERTY_HANDLER_FOR_EXTENSION(extension) \
456     RegistryItem CONCAT2(gid_Regitem_Software_Microsoft_Windows_CurrentVersion_PropertySystem_PropertyHandlers_,extension) \
457         ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
458         ModuleID = gid_Module_Optional_Winexplorerext; \
459         ComponentCondition = "VersionNT >= 600"; \
460         Subkey = STRING(CONCAT2(SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\.,extension)); \
461         Value = "{AE424E85-F6DF-4910-A6A9-438797986431}"; \
462     End
464 #endif
466 #else
467 #define REGISTER_PROPERTY_HANDLER_FOR_EXTENSION(extension) // empty
468 #endif
471 #define SCP2_URE_DL_DIR GID_DIR_URE_LIB
472 #if defined WNT
473 #define SCP2_URE_DL_NORMAL(n) n ".dll"
474 #define SCP2_URE_DL_VER(n, v) n v ".dll"
475 #define SCP2_URE_DL_UNO_VER(n, v) n v ".dll"
476 #define SCP2_URE_DL_UNO_COMID_VER(n, v) n v STRING(COMID) ".dll"
477 #else
478 #define SCP2_URE_DL_NORMAL(n) "lib" n STRING(UNXSUFFIX)
479 #define SCP2_URE_DL_VER(n, v) "lib" n STRING(UNXSUFFIX) "." v
480 #define SCP2_URE_DL_UNO_VER(n, v) "libuno_" n STRING(UNXSUFFIX) "." v
481 #define SCP2_URE_DL_UNO_NORMAL(n) "libuno_" n STRING(UNXSUFFIX)
482 #define SCP2_URE_DL_UNO_COMID_VER(n, v) \
483     "libuno_" n STRING(COMID) STRING(UNXSUFFIX) "." v
484 #define SCP2_URE_DL_UNO_COMID_NORMAL(n) \
485     "libuno_" n STRING(COMID) STRING(UNXSUFFIX)
486 #endif
487 #if defined MACOSX
488 #define SCP2_URE_JDL_NORMAL(n) "lib" n ".jnilib"
489 #else
490 #define SCP2_URE_JDL_NORMAL(n) SCP2_URE_DL_NORMAL(n)
491 #endif
493 #if defined MACOSX
494 #define FILELIST_DIR PREDEFINED_PROGDIR
495 #define FILELIST_SDK_DIR PREDEFINED_PROGDIR
496 #else
497 #define FILELIST_DIR gid_Dir_Brand_Root
498 #if defined WNT
499 #define FILELIST_SDK_DIR gid_Dir_Sdkoo_Root
500 #else
501 #define FILELIST_SDK_DIR PREDEFINED_PROGDIR
502 #endif
503 #endif
505 #define UI_FILELIST(name, file) \
506     File CONCAT2(gid_File_Share_Config_Sofficecfg_uiconfig_, name) \
507         TXT_FILE_BODY; \
508         Styles = (FILELIST); \
509         Dir = FILELIST_DIR; \
510         Name = file; \
511     End
513 #include <langmacros.inc>
515 #define UI_FILELIST_ALL_LANG(name, file) \
516     File CONCAT3(gid_File_Share_Config_Sofficecfg_uiconfig_, name, _Lang) \
517         TXT_FILE_BODY; \
518         Styles = (PACKED); \
519         Dir = gid_Dir_Share_Config_Sofficecfg; \
520         UI_ALL_LANG_BUT_EN_US(file); \
521     End
523 #define URE_PRIVATE_LIB(id,name) \
524     File id \
525         LIB_FILE_BODY; \
526         Dir = SCP2_URE_DL_DIR; \
527         Name = name; \
528         Styles = (PACKED); \
529     End
531 #define URE_EXECUTABLE(id,name) \
532     File id \
533         BIN_FILE_BODY; \
534         Dir = gid_Brand_Dir_Program; \
535         Name = name; \
536         Styles = (PACKED); \
537     End
539 #define LIBO_EXECUTABLE(id,name) \
540     File id \
541         BIN_FILE_BODY; \
542         Dir = gid_Brand_Dir_Program; \
543         Name = name; \
544         Styles = (PACKED); \
545     End
547 #define LIBO_EXECUTABLE_COMPONENTCONDITION(id,name,cond) \
548     File id \
549         BIN_FILE_BODY; \
550         Dir = gid_Brand_Dir_Program; \
551         Name = name; \
552         Styles = (PACKED); \
553         ComponentCondition = cond; \
554     End
556 #define SDK_EXECUTABLE(id,name) \
557     File id \
558         BIN_FILE_BODY; \
559         Dir = gid_Dir_Sdkoo_Bin; \
560         Name = name; \
561         Styles = (PACKED); \
562     End
564 #define GALLERY_NAME(id) \
566 #define GALLERY_FILELIST(id) \
567 File gid_File_Extra_Gall##id \
568     Dir = FILELIST_DIR; \
569     TXT_FILE_BODY; \
570     Styles = (FILELIST, WORKSTATION); \
571     Name = STRING(CONCAT3(Gallery/,id,.filelist)); \
572 End \
573 File gid_File_Extra_GallFiles##id \
574     Dir = FILELIST_DIR; \
575     TXT_FILE_BODY; \
576     Styles = (FILELIST, WORKSTATION); \
577     Name = STRING(CONCAT3(Gallery/Files/,id,.filelist)); \
580 #define REGISTER_URI_HANDLER_IMPL(protocol,protid,modid,cond) \
581 RegistryItem CONCAT2(gid_Regitem_,protid) \
582     ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
583     ModuleID = modid; \
584     Subkey = STRING(protocol); \
585     Value = "URL:" STRING(protocol) " Protocol"; \
586     cond \
587 End \
588 RegistryItem CONCAT3(gid_Regitem_,protid,_URL_Protocol) \
589     ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
590     ModuleID = modid; \
591     Subkey = STRING(protocol); \
592     Name = "URL Protocol"; \
593 End \
594 RegistryItem CONCAT3(gid_Regitem_,protid,_UseOriginalUrlEncoding) \
595     ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
596     ModuleID = modid; \
597     Subkey = STRING(protocol); \
598     Name = "UseOriginalUrlEncoding"; \
599     Value = "#1"; \
600 End \
601 RegistryItem CONCAT3(gid_Regitem_,protid,_DefaultIcon) \
602     ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
603     ModuleID = modid; \
604     Subkey = STRING(CONCAT2(protocol,\DefaultIcon)); \
605     Value = "<progpath>\program\soffice.bin,0"; \
606 End \
607 RegistryItem CONCAT3(gid_Regitem_,protid,_shell_open_command) \
608     ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
609     ModuleID = modid; \
610     Subkey = STRING(CONCAT2(protocol,\shell\open\command)); \
611     Value = "\"<progpath>\program\soffice.exe\" \"%1\""; \
614 #define REG_COND(cond) \
615     ComponentCondition = STRING(CONCAT2(cond,=1));
617 #define REG_EMPTY_COND
619 #define REGISTER_URI_HANDLER(protocol,protid,modid) \
620     REGISTER_URI_HANDLER_IMPL(protocol,protid,modid,REG_EMPTY_COND)
622 #define CONDITIONAL_REGISTER_URI_HANDLER(protocol,protid,modid,cond) \
623     CONDITIONAL_MODULE_ENTRY(protid,modid) \
624     REGISTER_URI_HANDLER_IMPL(protocol,protid,gid_Module_Root_Reg_##protid,REG_COND(cond))
626 #endif // MACROS_INC