Bump version to 6.0-36
[LibreOffice.git] / scp2 / inc / macros.inc
blob4e113f90a7f0dfe22b6cfce318f3a9bb0a4a451a
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_LIB_FILE_COMPONENTCONDITION(id,name,cond) \
183     File id \
184         Name = name; \
185         LIB_FILE_BODY; \
186         Styles = (PACKED); \
187         Dir    = gid_Dir_Shlxthdl; \
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(LibreOffice.,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(LibreOffice.,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(LibreOffice.,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 CONDITIONAL_REGISTRY_ENTRY_MEDIATYPE_DEF_EXT(name,cond,key,mediatype) \
276     RegistryItem gid_Regitem__MediaType_DefExt_##name \
277         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
278         ModuleID = gid_Module_Root_Reg_##name; \
279         Subkey = STRING(CONCAT2(MIME\Database\Content Type\,mediatype)); \
280         Name = STRING(Extension); \
281         Value = STRING(CONCAT2(.,key)); \
282         ComponentCondition = STRING(CONCAT3(REGISTER_,cond,=1)); \
283     End
285 #define REGISTRY_ENTRY_DOC(name,modid,disp_name) \
286     RegistryItem CONCAT2(gid_Regitem_Openoffice_,name) \
287         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
288         ModuleID = modid; \
289         Subkey = STRING(CONCAT2(LibreOffice.,name)); \
290         REG_VALUE_LNG(disp_name) \
291     End
293 #define REGISTRY_ENTRY_APPUSERMODELID(name,modid,doc_type) \
294     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_AppUserModelID) \
295         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
296         ModuleID = modid; \
297         Subkey = STRING(CONCAT2(LibreOffice.,name)); \
298         Name = STRING(AppUserModelID); \
299         Value = STRING(CONCAT2(TheDocumentFoundation.LibreOffice.,doc_type)); \
300     End
302 #define REGISTRY_ENTRY_ICON(name,modid,icon_id) \
303     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Defaulticon) \
304         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
305         ModuleID = modid; \
306         Subkey = STRING(CONCAT3(LibreOffice.,name,\DefaultIcon)); \
307         Value = "<progpath>\program\soffice.bin," STRING(icon_id); \
308     End
310 #define REGISTRY_ENTRY_SHELL(name,default,modid) \
311     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell) \
312         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
313         ModuleID = modid; \
314         Subkey = STRING(CONCAT3(LibreOffice.,name,\shell)); \
315         Value = STRING(default); \
316     End
318 #define REGISTRY_ENTRY_NEW_CMD_PPA(name,modid,progpath_program_app) \
319     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_New) \
320         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
321         ModuleID = modid; \
322         Subkey = STRING(CONCAT3(LibreOffice.,name,\shell\new)); \
323         REG_VALUE_LNG(NEW) \
324     End \
325     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_New_Command) \
326         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
327         ModuleID = modid; \
328         Subkey = STRING(CONCAT3(LibreOffice.,name,\shell\new\command)); \
329         Value = "\"" STRING(progpath_program_app) "\" -n \"%1\""; \
330     End
332 #define REGISTRY_ENTRY_NEW_CMD(name,modid,app) \
333         REGISTRY_ENTRY_NEW_CMD_PPA(name,modid,<progpath>\program\app)
335 #define REGISTRY_ENTRY_OPEN_CMD_PPA(name,modid,progpath_program_app) \
336     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_Open_Command) \
337         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
338         ModuleID = modid; \
339         Subkey = STRING(CONCAT3(LibreOffice.,name,\shell\open\command)); \
340         Value = "\"" STRING(progpath_program_app) "\" -o \"%1\""; \
341     End
343 #define REGISTRY_ENTRY_OPEN_CMD(name,modid,app) \
344         REGISTRY_ENTRY_OPEN_CMD_PPA(name,modid,<progpath>\program\app)
346 #define REGISTRY_ENTRY_PRINT_CMD_PPA(name,modid,progpath_program_app) \
347     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_Print_Command) \
348         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
349         ModuleID = modid; \
350         Subkey = STRING(CONCAT3(LibreOffice.,name,\shell\print\command)); \
351         Value = "\"" STRING(progpath_program_app) "\" -p \"%1\""; \
352     End
354 #define REGISTRY_ENTRY_PRINT_CMD(name,modid,app) \
355         REGISTRY_ENTRY_PRINT_CMD_PPA(name,modid,<progpath>\program\app)
357 #define REGISTRY_ENTRY_PRINTTO_CMD_PPA(name,modid,progpath_program_app) \
358     RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_Printto_Command) \
359         ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
360         ModuleID = modid; \
361         Subkey = STRING(CONCAT3(LibreOffice.,name,\shell\printto\command)); \
362         Value = "\"" STRING(progpath_program_app) "\" -pt \"%2\" \"%1\""; \
363     End
365 #define REGISTRY_ENTRY_PRINTTO_CMD(name,modid,app) \
366         REGISTRY_ENTRY_PRINTTO_CMD_PPA(name,modid,<progpath>\program\app)
368 #define REGISTRY_ENTRY_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(LibreOffice.,name)); \
375         Styles = (); \
376     End
378 #define REGISTRY_ENTRY_TEMPLATE_CAPABILITIES(name,modid,key,doc_type) \
379     RegistryItem CONCAT2(gid_Regitem_Software_Manufacturer_Productname_Productversion_Capabilities_FileAssociations_,name) \
380         ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
381         ModuleID = modid; \
382         Subkey = STRING(Software\%MANUFACTURER\%PRODUCTNAME%PRODUCTADDON\%PRODUCTVERSION\Capabilities\FileAssociations); \
383         Name = STRING(CONCAT2(.,key)); \
384         Value = STRING(CONCAT2(LibreOffice.,name)); \
385         Styles = (); \
386     End
388 #define REGISTRY_ENTRY_CAPABILITIES_URL(scheme,name,modid,handler) \
389     RegistryItem CONCAT2(gid_Regitem_Software_Manufacturer_Productname_Productversion_Capabilities_URLAssociations_,name) \
390         ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
391         ModuleID = modid; \
392         Subkey = STRING(Software\%MANUFACTURER\%PRODUCTNAME%PRODUCTADDON\%PRODUCTVERSION\Capabilities\URLAssociations); \
393         Name = scheme; \
394         Value = handler; \
395         Styles = (); \
396     End
398 #define CONDITIONAL_REGISTER_DOC_OPEN_EXTENSION(name,modid,key,cond,disp_name,icon_id,app,default,doc_type) \
399     CONDITIONAL_MODULE_ENTRY(name,modid) \
400     REGISTRY_ENTRY_OPEN_WITH(name,cond,doc_type,modid,key) \
401     CONDITIONAL_REGISTRY_ENTRY_EXT(name,cond,key) \
402     REGISTRY_ENTRY_DOC(name,modid,disp_name) \
403     REGISTRY_ENTRY_APPUSERMODELID(name,modid,doc_type) \
404     REGISTRY_ENTRY_ICON(name,modid,icon_id) \
405     REGISTRY_ENTRY_SHELL(name,default,modid) \
406     REGISTRY_ENTRY_OPEN_CMD(name,modid,app) \
407     REGISTRY_ENTRY_CAPABILITIES(name,modid,key,doc_type) \
409 #define CONDITIONAL_REGISTER_DOC_EXTENSION(name,modid,key,cond,disp_name,icon_id,app,default,doc_type) \
410     CONDITIONAL_REGISTER_DOC_OPEN_EXTENSION(name,modid,key,cond,disp_name,icon_id,app,default,doc_type) \
411     REGISTRY_ENTRY_NEW_CMD(name,modid,app) \
412     REGISTRY_ENTRY_PRINT_CMD(name,modid,app) \
413     REGISTRY_ENTRY_PRINTTO_CMD(name,modid,app) \
415 #define CONDITIONAL_REGISTER_DOCTEMPLATE_EXTENSION(name,modid,key,cond,disp_name,icon_id,app,default,doc_type) \
416     CONDITIONAL_MODULE_ENTRY(name,modid) \
417     REGISTRY_ENTRY_OPEN_WITH_TMPL(name,cond,doc_type,modid,key) \
418     CONDITIONAL_REGISTRY_ENTRY_EXT(name,cond,key) \
419     REGISTRY_ENTRY_DOC(name,modid,disp_name) \
420     REGISTRY_ENTRY_APPUSERMODELID(name,modid,doc_type) \
421     REGISTRY_ENTRY_ICON(name,modid,icon_id) \
422     REGISTRY_ENTRY_SHELL(name,default,modid) \
423     REGISTRY_ENTRY_NEW_CMD(name,modid,app) \
424     REGISTRY_ENTRY_OPEN_CMD(name,modid,app) \
425     REGISTRY_ENTRY_PRINT_CMD(name,modid,app) \
426     REGISTRY_ENTRY_PRINTTO_CMD(name,modid,app) \
427     REGISTRY_ENTRY_TEMPLATE_CAPABILITIES(name,modid,key,doc_type) \
429 #ifdef _MSC_VER
431 #ifdef BUILD_X64
433 #define REGISTER_PROPERTY_HANDLER_FOR_EXTENSION(extension) \
434     RegistryItem CONCAT2(gid_Regitem_Software_Microsoft_Windows_CurrentVersion_PropertySystem_PropertyHandlers_,extension) \
435         ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
436         ModuleID = gid_Module_Optional_Winexplorerext; \
437         Subkey = STRING(CONCAT2(SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\.,extension)); \
438         Value = "{AE424E85-F6DF-4910-A6A9-438797986431}"; \
439     End \
441     RegistryItem CONCAT3(gid_Regitem_Software_Microsoft_Windows_CurrentVersion_PropertySystem_PropertyHandlers_,extension,_x64) \
442         ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
443         ModuleID = gid_Module_Optional_Winexplorerext_x64; \
444         ComponentCondition = "VersionNT64"; \
445         Subkey = STRING(CONCAT2(SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\.,extension)); \
446         Value = "{AE424E85-F6DF-4910-A6A9-438797986431}"; \
447     End
449 #else
451 #define REGISTER_PROPERTY_HANDLER_FOR_EXTENSION(extension) \
452     RegistryItem CONCAT2(gid_Regitem_Software_Microsoft_Windows_CurrentVersion_PropertySystem_PropertyHandlers_,extension) \
453         ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
454         ModuleID = gid_Module_Optional_Winexplorerext; \
455         Subkey = STRING(CONCAT2(SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\.,extension)); \
456         Value = "{AE424E85-F6DF-4910-A6A9-438797986431}"; \
457     End
459 #endif
461 #else
462 #define REGISTER_PROPERTY_HANDLER_FOR_EXTENSION(extension) // empty
463 #endif
466 #define SCP2_URE_DL_DIR GID_DIR_URE_LIB
467 #if defined WNT
468 #define SCP2_URE_DL_NORMAL(n) n ".dll"
469 #define SCP2_URE_DL_VER(n, v) n v ".dll"
470 #define SCP2_URE_DL_UNO_VER(n, v) n v ".dll"
471 #define SCP2_URE_DL_UNO_COMID_VER(n, v) n v STRING(COMID) ".dll"
472 #else
473 #define SCP2_URE_DL_NORMAL(n) "lib" n STRING(UNXSUFFIX)
474 #define SCP2_URE_DL_VER(n, v) "lib" n STRING(UNXSUFFIX) "." v
475 #define SCP2_URE_DL_UNO_VER(n, v) "libuno_" n STRING(UNXSUFFIX) "." v
476 #define SCP2_URE_DL_UNO_NORMAL(n) "libuno_" n STRING(UNXSUFFIX)
477 #define SCP2_URE_DL_UNO_COMID_VER(n, v) \
478     "libuno_" n STRING(COMID) STRING(UNXSUFFIX) "." v
479 #define SCP2_URE_DL_UNO_COMID_NORMAL(n) \
480     "libuno_" n STRING(COMID) STRING(UNXSUFFIX)
481 #endif
482 #if defined MACOSX
483 #define SCP2_URE_JDL_NORMAL(n) "lib" n ".jnilib"
484 #else
485 #define SCP2_URE_JDL_NORMAL(n) SCP2_URE_DL_NORMAL(n)
486 #endif
488 #if defined MACOSX
489 #define FILELIST_DIR PREDEFINED_PROGDIR
490 #define FILELIST_SDK_DIR PREDEFINED_PROGDIR
491 #else
492 #define FILELIST_DIR gid_Dir_Brand_Root
493 #if defined WNT
494 #define FILELIST_SDK_DIR gid_Dir_Sdkoo_Root
495 #else
496 #define FILELIST_SDK_DIR PREDEFINED_PROGDIR
497 #endif
498 #endif
500 #define UI_FILELIST(name, file) \
501     File CONCAT2(gid_File_Share_Config_Sofficecfg_uiconfig_, name) \
502         TXT_FILE_BODY; \
503         Styles = (FILELIST); \
504         Dir = FILELIST_DIR; \
505         Name = file; \
506     End
508 #include <langmacros.inc>
510 #define MO_FILELIST_ALL_LANG(name) \
511     File CONCAT3(gid_File_Res_, name, _Lang) \
512         TXT_FILE_BODY; \
513         Styles = (PACKED); \
514         Dir = gid_Dir_Resource; \
515         MO_ALL_LANG_EXCEPT_EN_US_AND_QTZ(name); \
516     End
518 #define URE_PRIVATE_LIB(id,name) \
519     File id \
520         LIB_FILE_BODY; \
521         Dir = SCP2_URE_DL_DIR; \
522         Name = name; \
523         Styles = (PACKED); \
524     End
526 #define URE_EXECUTABLE(id,name) \
527     File id \
528         BIN_FILE_BODY; \
529         Dir = gid_Brand_Dir_Program; \
530         Name = name; \
531         Styles = (PACKED); \
532     End
534 #define LIBO_EXECUTABLE(id,name) \
535     File id \
536         BIN_FILE_BODY; \
537         Dir = gid_Brand_Dir_Program; \
538         Name = name; \
539         Styles = (PACKED); \
540     End
542 #define LIBO_EXECUTABLE_COMPONENTCONDITION(id,name,cond) \
543     File id \
544         BIN_FILE_BODY; \
545         Dir = gid_Brand_Dir_Program; \
546         Name = name; \
547         Styles = (PACKED); \
548         ComponentCondition = cond; \
549     End
551 #define SDK_EXECUTABLE(id,name) \
552     File id \
553         BIN_FILE_BODY; \
554         Dir = gid_Dir_Sdkoo_Bin; \
555         Name = name; \
556         Styles = (PACKED); \
557     End
559 #define GALLERY_NAME(id) \
561 #define GALLERY_FILELIST(id) \
562 File gid_File_Extra_Gall##id \
563     Dir = FILELIST_DIR; \
564     TXT_FILE_BODY; \
565     Styles = (FILELIST, WORKSTATION); \
566     Name = STRING(CONCAT3(Gallery/,id,.filelist)); \
567 End \
568 File gid_File_Extra_GallFiles##id \
569     Dir = FILELIST_DIR; \
570     TXT_FILE_BODY; \
571     Styles = (FILELIST, WORKSTATION); \
572     Name = STRING(CONCAT3(Gallery/Files/,id,.filelist)); \
575 #define REGISTER_URI_HANDLER_IMPL(protocol,protid,modid,cond) \
576 RegistryItem CONCAT2(gid_Regitem_,protid) \
577     ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
578     ModuleID = modid; \
579     Subkey = STRING(protocol); \
580     Value = "URL:" STRING(protocol) " Protocol"; \
581     cond \
582 End \
583 RegistryItem CONCAT3(gid_Regitem_,protid,_URL_Protocol) \
584     ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
585     ModuleID = modid; \
586     Subkey = STRING(protocol); \
587     Name = "URL Protocol"; \
588 End \
589 RegistryItem CONCAT3(gid_Regitem_,protid,_UseOriginalUrlEncoding) \
590     ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
591     ModuleID = modid; \
592     Subkey = STRING(protocol); \
593     Name = "UseOriginalUrlEncoding"; \
594     Value = "#1"; \
595 End \
596 RegistryItem CONCAT3(gid_Regitem_,protid,_DefaultIcon) \
597     ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
598     ModuleID = modid; \
599     Subkey = STRING(CONCAT2(protocol,\DefaultIcon)); \
600     Value = "<progpath>\program\soffice.bin,0"; \
601 End \
602 RegistryItem CONCAT3(gid_Regitem_,protid,_shell_open_command) \
603     ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
604     ModuleID = modid; \
605     Subkey = STRING(CONCAT2(protocol,\shell\open\command)); \
606     Value = "\"<progpath>\program\soffice.exe\" \"%1\""; \
609 #define REG_COND(cond) \
610     ComponentCondition = STRING(CONCAT2(cond,=1));
612 #define REG_EMPTY_COND
614 #define REGISTER_URI_HANDLER(protocol,protid,modid) \
615     REGISTER_URI_HANDLER_IMPL(protocol,protid,modid,REG_EMPTY_COND)
617 #define CONDITIONAL_REGISTER_URI_HANDLER(protocol,protid,modid,cond) \
618     CONDITIONAL_MODULE_ENTRY(protid,modid) \
619     REGISTER_URI_HANDLER_IMPL(protocol,protid,gid_Module_Root_Reg_##protid,REG_COND(cond))
621 #endif // MACROS_INC