2 * This file is part of the LibreOffice project.
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/.
8 * This file incorporates work covered by the following license notice:
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 .
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);
53 #define UNXSUFFIX .dylib
60 #define PROFILENAME(name) STRING(CONCAT2(name,rc))
62 #define PROFILENAME(name) STRING(CONCAT2(name,.ini))
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
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
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
85 #define SCP2_OOO_LIB_DIR gid_Dir_Frameworks
87 #define SCP2_OOO_LIB_DIR SCP2_OOO_BIN_DIR
90 #define BIN_FILE_BODY \
93 #define LIB_FILE_BODY \
96 #define TXT_FILE_BODY \
99 #define USER_FILE_BODY \
102 #define PACKED_TXT_FILE_BODY \
106 #define ARCHIVE_TXT_FILE_BODY \
110 #ifdef WITH_HELPPACK_INTEGRATION
111 #define FILELIST_TXT_FILE_BODY_HELPPACK \
113 Styles = (FILELIST,FORCEHELPPACK,LANGUAGEMODULE)
115 #define FILELIST_TXT_FILE_BODY_HELPPACK \
117 Styles = (FILELIST,HELPPACK,LANGUAGEMODULE)
120 #define PACKAGE_FILELIST(id,name) \
122 Dir = FILELIST_DIR; \
124 Styles = (FILELIST, USE_INTERNAL_RIGHTS, PACKED); \
127 #define PACKED_LIB_FILE_BODY \
130 Dir = SCP2_OOO_LIB_DIR
132 #define LIBO_LIB_FILE(id,name) \
135 PACKED_LIB_FILE_BODY; \
138 #define LIBO_LIB_FILE_BINARYTABLE(id,name) \
141 PACKED_LIB_FILE_BODY; \
142 Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY); \
145 #define LIBO_LIB_FILE_COMPONENTCONDITION(id,name,cond) \
148 PACKED_LIB_FILE_BODY; \
149 ComponentCondition = cond; \
152 #define SHLXTHDL_LIB_FILE(id,name) \
157 Dir = gid_Dir_Shlxthdl; \
160 #define SHLXTHDL_LIB_FILE_COMPONENTCONDITION(id,name,cond) \
165 Dir = gid_Dir_Shlxthdl; \
166 ComponentCondition = cond; \
170 // links are craeted at configure time by odk/config/setsdkenv_unix.sh.in
171 #define SDK_LIBRARY_LINK(id,name,target)
173 #define SDK_LIBRARY_LINK(id,name,target) \
177 Dir = gid_Dir_Lib_Sdk; \
181 #define SDK_LIBRARY_LINK(id,name,target) \
185 Dir = gid_Dir_Lib_Sdk; \
191 #define STD_RES_FILE(id,name) \
194 RESFILE_ALL_LANG(name); \
195 Dir = gid_Dir_Resource; \
199 #define STD_FONTWIN_FILE(id,name,fontname) \
202 Dir = gid_Dir_Fonts_Truetype; \
203 Styles = (PACKED,FONT,DONT_DELETE,FONT_WARN_IF_EXISTS); \
204 Name = STRING(name) ; \
205 NetDir = gid_Dir_Winfonts; \
209 #define STD_FONT_FILELIST(id,name) \
212 Dir = FILELIST_DIR; \
213 Styles = (FILELIST, PACKED, FONT_WARN_IF_EXISTS); \
219 #define STD_FONT_FILELIST(id,name) \
222 Dir = FILELIST_DIR; \
223 Styles = (FILELIST,PACKED,FONT,DONT_DELETE,FONT_WARN_IF_EXISTS); \
228 #define LIBO_JAR_FILE(id,name) \
232 Dir = gid_Dir_Classes; \
236 #define URE_JAR_FILE(id,name) \
240 Dir = gid_Dir_Classes; \
244 #define STD_PY_FILE(id,name) \
246 PACKED_TXT_FILE_BODY; \
252 #define CONDITIONAL_MODULE_ENTRY(name,modid) \
253 Module gid_Module_Root_Reg_##name \
255 Name = STRING(CONCAT2(gid_Module_Root_,name)); \
256 Description = STRING(CONCAT2(gid_Module_Root_,name)); \
258 Styles = (HIDDEN_ROOT); \
261 #define REGISTRY_ENTRY_OPEN_WITH(name,cond,doc_type,modid,key) \
262 RegistryItem gid_Regitem_OpenOffice_##cond##_OpenWith_##doc_type \
263 ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
265 Subkey = STRING(CONCAT3(.,key,\OpenWithProgIDs)); \
266 Name = STRING(CONCAT2(LibreOffice.,name)); \
270 #define REGISTRY_ENTRY_OPEN_WITH_TMPL(name,cond,doc_type,modid,key) \
271 RegistryItem gid_Regitem_OpenOffice_##cond##_OpenWith_##doc_type \
272 ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
274 Subkey = STRING(CONCAT3(.,key,\OpenWithProgIDs)); \
275 Name = STRING(CONCAT2(LibreOffice.,name)); \
279 #define CONDITIONAL_REGISTRY_ENTRY_EXT(name,cond,key) \
280 RegistryItem gid_Regitem__##name \
281 ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
282 ModuleID = gid_Module_Root_Reg_##name; \
283 Subkey = STRING(CONCAT2(.,key)); \
284 Value = STRING(CONCAT2(LibreOffice.,name)); \
285 ComponentCondition = STRING(CONCAT3(REGISTER_,cond,=1)); \
288 #define REGISTRY_ENTRY_DOC(name,modid,disp_name) \
289 RegistryItem CONCAT2(gid_Regitem_Openoffice_,name) \
290 ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
292 Subkey = STRING(CONCAT2(LibreOffice.,name)); \
293 REG_VALUE_LNG(disp_name) \
296 #define REGISTRY_ENTRY_APPUSERMODELID(name,modid,doc_type) \
297 RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_AppUserModelID) \
298 ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
300 ComponentCondition = STRING(VersionNT >= 601); \
301 Subkey = STRING(CONCAT2(LibreOffice.,name)); \
302 Name = STRING(AppUserModelID); \
303 Value = STRING(CONCAT2(TheDocumentFoundation.LibreOffice.,doc_type)); \
306 #define REGISTRY_ENTRY_ICON(name,modid,icon_id) \
307 RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Defaulticon) \
308 ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
310 Subkey = STRING(CONCAT3(LibreOffice.,name,\DefaultIcon)); \
311 Value = "<progpath>\program\soffice.bin," STRING(icon_id); \
314 #define REGISTRY_ENTRY_SHELL(name,default,modid) \
315 RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell) \
316 ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
318 Subkey = STRING(CONCAT3(LibreOffice.,name,\shell)); \
319 Value = STRING(default); \
322 #define REGISTRY_ENTRY_NEW_CMD(name,modid,app) \
323 RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_New) \
324 ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
326 Subkey = STRING(CONCAT3(LibreOffice.,name,\shell\new)); \
329 RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_New_Command) \
330 ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
332 Subkey = STRING(CONCAT3(LibreOffice.,name,\shell\new\command)); \
333 Value = "\"<progpath>\program\\" STRING(app) "\" -n \"%1\""; \
336 #define REGISTRY_ENTRY_OPEN_CMD(name,modid,app) \
337 RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_Open_Command) \
338 ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
340 Subkey = STRING(CONCAT3(LibreOffice.,name,\shell\open\command)); \
341 Value = "\"<progpath>\program\\" STRING(app) "\" -o \"%1\""; \
344 #define REGISTRY_ENTRY_PRINT_CMD(name,modid,app) \
345 RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_Print_Command) \
346 ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
348 Subkey = STRING(CONCAT3(LibreOffice.,name,\shell\print\command)); \
349 Value = "\"<progpath>\program\\" STRING(app) "\" -p \"%1\""; \
352 #define REGISTRY_ENTRY_PRINTTO_CMD(name,modid,app) \
353 RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_Printto_Command) \
354 ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
356 Subkey = STRING(CONCAT3(LibreOffice.,name,\shell\printto\command)); \
357 Value = "\"<progpath>\program\\" STRING(app) "\" -pt \"%2\" \"%1\""; \
360 #define REGISTRY_ENTRY_CAPABILITIES(name,modid,key,doc_type) \
361 RegistryItem CONCAT2(gid_Regitem_Software_Manufacturer_Productname_Productversion_Capabilities_FileAssociations_,name) \
362 ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
364 Subkey = STRING(Software\%MANUFACTURER\%PRODUCTNAME%PRODUCTADDON\%PRODUCTVERSION\Capabilities\FileAssociations); \
365 Name = STRING(CONCAT2(.,key)); \
366 Value = STRING(CONCAT2(LibreOffice.,name)); \
370 #define REGISTRY_ENTRY_TEMPLATE_CAPABILITIES(name,modid,key,doc_type) \
371 RegistryItem CONCAT2(gid_Regitem_Software_Manufacturer_Productname_Productversion_Capabilities_FileAssociations_,name) \
372 ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
374 Subkey = STRING(Software\%MANUFACTURER\%PRODUCTNAME%PRODUCTADDON\%PRODUCTVERSION\Capabilities\FileAssociations); \
375 Name = STRING(CONCAT2(.,key)); \
376 Value = STRING(CONCAT2(LibreOffice.,name)); \
380 #define REGISTRY_ENTRY_KINDMAP(name, modid, key) \
381 RegistryItem CONCAT2(gid_Regitem_Software_Manufacturer_Productname_Productversion_Explorer_KindMap_,name) \
382 ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
384 ComponentCondition = STRING(VersionNT >= 600); \
385 Subkey = STRING(SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\KindMap); \
386 Name = STRING(CONCAT2(.,key)); \
387 Value = STRING(document); \
390 #define CONDITIONAL_REGISTER_DOC_EXTENSION(name,modid,key,cond,disp_name,icon_id,app,default,doc_type) \
391 CONDITIONAL_MODULE_ENTRY(name,modid) \
392 REGISTRY_ENTRY_OPEN_WITH(name,cond,doc_type,modid,key) \
393 CONDITIONAL_REGISTRY_ENTRY_EXT(name,cond,key) \
394 REGISTRY_ENTRY_DOC(name,modid,disp_name) \
395 REGISTRY_ENTRY_APPUSERMODELID(name,modid,doc_type) \
396 REGISTRY_ENTRY_ICON(name,modid,icon_id) \
397 REGISTRY_ENTRY_SHELL(name,default,modid) \
398 REGISTRY_ENTRY_NEW_CMD(name,modid,app) \
399 REGISTRY_ENTRY_OPEN_CMD(name,modid,app) \
400 REGISTRY_ENTRY_PRINT_CMD(name,modid,app) \
401 REGISTRY_ENTRY_PRINTTO_CMD(name,modid,app) \
402 REGISTRY_ENTRY_CAPABILITIES(name,modid,key,doc_type) \
404 #define CONDITIONAL_REGISTER_DOCTEMPLATE_EXTENSION(name,modid,key,cond,disp_name,icon_id,app,default,doc_type) \
405 CONDITIONAL_MODULE_ENTRY(name,modid) \
406 REGISTRY_ENTRY_OPEN_WITH_TMPL(name,cond,doc_type,modid,key) \
407 CONDITIONAL_REGISTRY_ENTRY_EXT(name,cond,key) \
408 REGISTRY_ENTRY_DOC(name,modid,disp_name) \
409 REGISTRY_ENTRY_APPUSERMODELID(name,modid,doc_type) \
410 REGISTRY_ENTRY_ICON(name,modid,icon_id) \
411 REGISTRY_ENTRY_SHELL(name,default,modid) \
412 REGISTRY_ENTRY_NEW_CMD(name,modid,app) \
413 REGISTRY_ENTRY_OPEN_CMD(name,modid,app) \
414 REGISTRY_ENTRY_PRINT_CMD(name,modid,app) \
415 REGISTRY_ENTRY_PRINTTO_CMD(name,modid,app) \
416 REGISTRY_ENTRY_TEMPLATE_CAPABILITIES(name,modid,key,doc_type) \
422 #define REGISTER_PROPERTY_HANDLER_FOR_EXTENSION(extension) \
423 RegistryItem CONCAT2(gid_Regitem_Software_Microsoft_Windows_CurrentVersion_PropertySystem_PropertyHandlers_,extension) \
424 ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
425 ModuleID = gid_Module_Optional_Winexplorerext; \
426 ComponentCondition = "VersionNT >= 600"; \
427 Subkey = STRING(CONCAT2(SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\.,extension)); \
428 Value = "{AE424E85-F6DF-4910-A6A9-438797986431}"; \
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 >= 600"; \
435 Subkey = STRING(CONCAT2(SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\.,extension)); \
436 Value = "{AE424E85-F6DF-4910-A6A9-438797986431}"; \
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 ComponentCondition = "VersionNT >= 600"; \
446 Subkey = STRING(CONCAT2(SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\.,extension)); \
447 Value = "{AE424E85-F6DF-4910-A6A9-438797986431}"; \
453 #define REGISTER_PROPERTY_HANDLER_FOR_EXTENSION(extension) // empty
457 #define SCP2_URE_DL_DIR GID_DIR_URE_LIB
459 #define SCP2_URE_DL_NORMAL(n) n ".dll"
460 #define SCP2_URE_DL_BARE(n) n ".dll"
461 #define SCP2_URE_DL_VER(n, v) n v ".dll"
462 #define SCP2_URE_DL_COMID_VER(n, v) n v STRING(COMID) ".dll"
463 #define SCP2_URE_DL_COMID_NORMAL(n) n STRING(COMID) ".dll"
464 #define SCP2_URE_DL_UNO_VER(n, v) n v ".dll"
465 #define SCP2_URE_DL_UNO_COMID_VER(n, v) n v STRING(COMID) ".dll"
467 #define SCP2_URE_DL_NORMAL(n) "lib" n STRING(UNXSUFFIX)
468 #define SCP2_URE_DL_BARE(n) n STRING(UNXSUFFIX)
469 #define SCP2_URE_DL_VER(n, v) "lib" n STRING(UNXSUFFIX) "." v
470 #define SCP2_URE_DL_COMID_VER(n, v) \
471 "lib" n STRING(COMID) STRING(UNXSUFFIX) "." v
472 #define SCP2_URE_DL_COMID_NORMAL(n) \
473 "lib" n STRING(COMID) STRING(UNXSUFFIX)
474 #define SCP2_URE_DL_UNO_VER(n, v) "libuno_" n STRING(UNXSUFFIX) "." v
475 #define SCP2_URE_DL_UNO_NORMAL(n) "libuno_" n STRING(UNXSUFFIX)
476 #define SCP2_URE_DL_UNO_COMID_VER(n, v) \
477 "libuno_" n STRING(COMID) STRING(UNXSUFFIX) "." v
478 #define SCP2_URE_DL_UNO_COMID_NORMAL(n) \
479 "libuno_" n STRING(COMID) STRING(UNXSUFFIX)
482 #define SCP2_URE_JDL_NORMAL(n) "lib" n ".jnilib"
484 #define SCP2_URE_JDL_NORMAL(n) SCP2_URE_DL_NORMAL(n)
488 #define FILELIST_DIR PREDEFINED_PROGDIR
489 #define FILELIST_SDK_DIR PREDEFINED_PROGDIR
491 #define FILELIST_DIR gid_Dir_Brand_Root
493 #define FILELIST_SDK_DIR gid_Dir_Sdkoo_Root
495 #define FILELIST_SDK_DIR PREDEFINED_PROGDIR
499 #define UI_FILELIST(name, file) \
500 File CONCAT2(gid_File_Share_Config_Sofficecfg_uiconfig_, name) \
502 Styles = (FILELIST); \
503 Dir = FILELIST_DIR; \
507 #include <langmacros.inc>
509 #define UI_FILELIST_ALL_LANG(name, file) \
510 File CONCAT3(gid_File_Share_Config_Sofficecfg_uiconfig_, name, _Lang) \
513 Dir = gid_Dir_Share_Config_Sofficecfg; \
514 UI_ALL_LANG_BUT_EN_US(file); \
517 #define URE_PRIVATE_LIB(id,name) \
520 Dir = SCP2_URE_DL_DIR; \
525 #define URE_EXECUTABLE(id,name) \
528 Dir = gid_Brand_Dir_Program; \
533 #define LIBO_EXECUTABLE(id,name) \
536 Dir = gid_Brand_Dir_Program; \
541 #define SDK_EXECUTABLE(id,name) \
544 Dir = gid_Dir_Sdkoo_Bin; \
549 #define GALLERY_NAME(id) \
551 #define GALLERY_FILELIST(id) \
552 File gid_File_Extra_Gall##id \
553 Dir = FILELIST_DIR; \
555 Styles = (FILELIST, WORKSTATION); \
556 Name = STRING(CONCAT3(Gallery/,id,.filelist)); \
558 File gid_File_Extra_GallFiles##id \
559 Dir = FILELIST_DIR; \
561 Styles = (FILELIST, WORKSTATION); \
562 Name = STRING(CONCAT3(Gallery/Files/,id,.filelist)); \