xref: /aoo41x/main/scp2/inc/macros.inc (revision b597708b)
1707d5dc6SAndrew Rist/**************************************************************
2707d5dc6SAndrew Rist *
3707d5dc6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4707d5dc6SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5707d5dc6SAndrew Rist * distributed with this work for additional information
6707d5dc6SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7707d5dc6SAndrew Rist * to you under the Apache License, Version 2.0 (the
8707d5dc6SAndrew Rist * "License"); you may not use this file except in compliance
9707d5dc6SAndrew Rist * with the License.  You may obtain a copy of the License at
10707d5dc6SAndrew Rist *
11707d5dc6SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12707d5dc6SAndrew Rist *
13707d5dc6SAndrew Rist * Unless required by applicable law or agreed to in writing,
14707d5dc6SAndrew Rist * software distributed under the License is distributed on an
15707d5dc6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16707d5dc6SAndrew Rist * KIND, either express or implied.  See the License for the
17707d5dc6SAndrew Rist * specific language governing permissions and limitations
18707d5dc6SAndrew Rist * under the License.
19707d5dc6SAndrew Rist *
20707d5dc6SAndrew Rist *************************************************************/
21707d5dc6SAndrew Rist
22cdf0e10cSrcweir#ifndef MACROS_INC
23cdf0e10cSrcweir#define MACROS_INC
24cdf0e10cSrcweir/* =====================================================
25cdf0e10cSrcweir * global helper macros
26cdf0e10cSrcweir * =====================================================*/
27cdf0e10cSrcweir
28cdf0e10cSrcweir#define DOSTRING( x )                           #x
29cdf0e10cSrcweir#define STRING( x )                             DOSTRING( x )
30cdf0e10cSrcweir#define DOCONCAT2( x, y )                       x##y
31cdf0e10cSrcweir#define CONCAT2( x, y)                          DOCONCAT2(x,y)
32cdf0e10cSrcweir#define DOCONCAT3( x, y, z )                    x##y##z
33cdf0e10cSrcweir#define CONCAT3( x, y, z )                      DOCONCAT3(x,y,z)
34cdf0e10cSrcweir#define DOCONCAT4( x, y, z, a )                 x##y##z##a
35cdf0e10cSrcweir#define CONCAT4( x, y, z, a )                   DOCONCAT4(x,y,z,a)
36cdf0e10cSrcweir#define DOCONCAT5( x, y, z, a, b )              x##y##z##a##b
37cdf0e10cSrcweir#define CONCAT5( x, y, z, a, b )                DOCONCAT5(x,y,z,a,b)
38cdf0e10cSrcweir#define DOCONCAT6( x, y, z, a, b, c )           x##y##z##a##b##c
39cdf0e10cSrcweir#define CONCAT6( x, y, z, a, b, c )             DOCONCAT6(x,y,z,a,b,c)
40cdf0e10cSrcweir#define DOCONCAT7( x, y, z, a, b, c, u)         x##y##z##a##b##c##u
41cdf0e10cSrcweir#define CONCAT7( x, y, z, a, b, c, u)           DOCONCAT7(x,y,z,a,b,c,u)
42cdf0e10cSrcweir#define DOCONCAT8( x, y, z, a, b, c, u, v)      x##y##z##a##b##c##u##v
43cdf0e10cSrcweir#define CONCAT8( x, y, z, a, b, c, u, v)        DOCONCAT8(x,y,z,a,b,c,u,v)
44cdf0e10cSrcweir#define DOCONCAT9( x, y, z, a, b, c, u, v, w)   x##y##z##a##b##c##u##v##w
45cdf0e10cSrcweir#define CONCAT9( x, y, z, a, b, c, u, v, w)     DOCONCAT9(x,y,z,a,b,c,u,v,w)
46cdf0e10cSrcweir
47cdf0e10cSrcweir#define MOD_NAME_DESC(id) \
48cdf0e10cSrcweir        ALL_LANG(Name,STR_NAME_##id); \
49cdf0e10cSrcweir        ALL_LANG(Description,STR_DESC_##id)
50cdf0e10cSrcweir
51cdf0e10cSrcweir#define MOD_NAME_DESC_ON_DESELECT(id) \
52cdf0e10cSrcweir        MOD_NAME_DESC(id); \
53cdf0e10cSrcweir        ALL_LANG(OnDeselect,STR_DESELECT_##id)
54cdf0e10cSrcweir
55cdf0e10cSrcweir#define REG_VALUE_LNG(id) \
56cdf0e10cSrcweir        ALL_LANG(Value,STR_REG_VAL_##id);
57cdf0e10cSrcweir
58cdf0e10cSrcweir#define FOLDERITEM_NAME_LNG(id) \
59cdf0e10cSrcweir        ALL_LANG(Name,STR_FI_NAME_##id);
60cdf0e10cSrcweir
61cdf0e10cSrcweir#define ALL_LANG_STR_KEY(ident) \
62cdf0e10cSrcweir        ALL_LANG(Key,ident)
63cdf0e10cSrcweir
64cdf0e10cSrcweir#define ALL_LANG_STR_KEY_LNG(ident) \
65cdf0e10cSrcweir        ALL_LANG(Key,STR_KEY_##ident)
66cdf0e10cSrcweir
67cdf0e10cSrcweir#define ALL_LANG_STR_VALUE_LNG(ident) \
68cdf0e10cSrcweir        ALL_LANG(Value,STR_VALUE_##ident)
69cdf0e10cSrcweir
70cdf0e10cSrcweir#define ALL_LANG_VALUE(vident) \
71cdf0e10cSrcweir        ALL_LANG(Value,vident)
72cdf0e10cSrcweir
73cdf0e10cSrcweir#define ALL_LANG_KEY(vident) \
74cdf0e10cSrcweir        ALL_LANG(Key,vident)
75cdf0e10cSrcweir
76d44f38edSYuri Dario#ifdef OS2
77d44f38edSYuri Dario    #define UNXSUFFIX .dll
78d44f38edSYuri Dario#endif
79cdf0e10cSrcweir
80cdf0e10cSrcweir#ifdef UNX
81cdf0e10cSrcweir    #ifdef MACOSX
82cdf0e10cSrcweir        #define UNXSUFFIX .dylib
83cdf0e10cSrcweir    #else
84cdf0e10cSrcweir        #define UNXSUFFIX .so
85cdf0e10cSrcweir    #endif
86cdf0e10cSrcweir#endif
87cdf0e10cSrcweir
88cdf0e10cSrcweir#ifdef UNX
89cdf0e10cSrcweir    #define LIBNAME(name)                     STRING(CONCAT4(lib,name,DLLPOSTFIX,UNXSUFFIX))
90cdf0e10cSrcweir    #define FILTER_LIBNAME(name)              LIBNAME(name)
91cdf0e10cSrcweir    #define EXENAME(name)                     STRING(name)
92cdf0e10cSrcweir    #define PROFILENAME(name)                 STRING(CONCAT2(name,rc))
93cdf0e10cSrcweir    #define SPECIAL_NAME(name)                STRING(CONCAT3(lib,name,UNXSUFFIX))
9427b2fc91SAndre Fischer    #ifdef MACOSX
9527b2fc91SAndre Fischer    	#define SPECIAL_NAME_VER(name,version)    STRING(CONCAT5(lib,name,.,version,UNXSUFFIX))
9627b2fc91SAndre Fischer    #else
9727b2fc91SAndre Fischer	#define SPECIAL_NAME_VER(name,version)    STRING(CONCAT5(lib,name,UNXSUFFIX,.,version))
9827b2fc91SAndre Fischer    #endif
99cdf0e10cSrcweir    #define SPECIAL_COMPONENT_LIB_NAME(name)  STRING(CONCAT2(name,UNXSUFFIX))
100cdf0e10cSrcweir#else
101cdf0e10cSrcweir    #define LIBNAME(name)                     STRING(CONCAT3(name,DLLPOSTFIX,.dll))
102cdf0e10cSrcweir    #define FILTER_LIBNAME(name)              LIBNAME(name)
103cdf0e10cSrcweir    #define EXENAME(name)                     STRING(CONCAT2(name,.exe))
104cdf0e10cSrcweir    #define PROFILENAME(name)                 STRING(CONCAT2(name,.ini))
105cdf0e10cSrcweir    #define SPECIAL_NAME(name)                STRING(CONCAT2(name,.dll))
106cdf0e10cSrcweir    #define SPECIAL_COMPONENT_LIB_NAME(name)  STRING(CONCAT2(name,.dll))
107cdf0e10cSrcweir#endif
108cdf0e10cSrcweir
109cdf0e10cSrcweir#define RESFILENAME(name,lang)                STRING(CONCAT3(name,lang,.res))
110cdf0e10cSrcweir#define SHORTRESFILENAME(name,lang)           STRING(CONCAT3(name,lang,.res))
111cdf0e10cSrcweir#define READMETXTFILENAME(name,lang,ext)      STRING(CONCAT4(name,lang,.,ext))
112cdf0e10cSrcweir#define READMEFILENAME(name,lang)             STRING(CONCAT2(name,lang))
113cdf0e10cSrcweir#define HELPFILENAME(name,endung)             STRING(CONCAT3(name,.,endung))
114cdf0e10cSrcweir#define EXTRAFILENAME(name,lang)              STRING(CONCAT3(name,lang,.zip))
115cdf0e10cSrcweir#define CONFIGLANGFILENAME(name,lang,ext)     STRING(CONCAT4(name,lang,.,ext))
116cdf0e10cSrcweir
117*1076d7f7SJürgen Schmidt//#if defined(WNT) || defined(OS2)
118cdf0e10cSrcweir#define SCP2_OOO_BIN_DIR gid_Brand_Dir_Program
119*1076d7f7SJürgen Schmidt//#else
120*1076d7f7SJürgen Schmidt//#define SCP2_OOO_BIN_DIR gid_Dir_Program
121*1076d7f7SJürgen Schmidt//#endif
122cdf0e10cSrcweir
123cdf0e10cSrcweir#define BIN_FILE_BODY \
124cdf0e10cSrcweir        UnixRights   = 555
125cdf0e10cSrcweir
126cdf0e10cSrcweir#define TXT_FILE_BODY \
127cdf0e10cSrcweir        UnixRights   = 444
128cdf0e10cSrcweir
129cdf0e10cSrcweir#define USER_FILE_BODY \
130cdf0e10cSrcweir        UnixRights   = 644
131cdf0e10cSrcweir
132cdf0e10cSrcweir#define PACKED_TXT_FILE_BODY \
133cdf0e10cSrcweir        TXT_FILE_BODY; \
134cdf0e10cSrcweir        Styles = (PACKED)
135cdf0e10cSrcweir
136cdf0e10cSrcweir#define PACKED_TXT_FILE_BODY_PATCH \
137cdf0e10cSrcweir        TXT_FILE_BODY; \
138cdf0e10cSrcweir        Styles = (PACKED,PATCH)
139cdf0e10cSrcweir
140cdf0e10cSrcweir#define ARCHIVE_TXT_FILE_BODY \
141cdf0e10cSrcweir        TXT_FILE_BODY; \
142cdf0e10cSrcweir        Styles = (ARCHIVE)
143cdf0e10cSrcweir
144cdf0e10cSrcweir#define ARCHIVE_TXT_FILE_BODY_PATCH \
145cdf0e10cSrcweir        TXT_FILE_BODY; \
146cdf0e10cSrcweir        Styles = (ARCHIVE,PATCH)
147cdf0e10cSrcweir
148cdf0e10cSrcweir#define ARCHIVE_SUBST_FILE_BODY \
149cdf0e10cSrcweir        TXT_FILE_BODY; \
150cdf0e10cSrcweir        Styles = (ARCHIVE,SUBSTITUTE)
151cdf0e10cSrcweir
152cdf0e10cSrcweir#define ARCHIVE_SUBST_FILE_BODY_PATCH \
153cdf0e10cSrcweir        TXT_FILE_BODY; \
154cdf0e10cSrcweir        Styles = (ARCHIVE,SUBSTITUTE,PATCH)
155cdf0e10cSrcweir
156cdf0e10cSrcweir#define PACKED_LIB_FILE_BODY \
157cdf0e10cSrcweir        TXT_FILE_BODY; \
158cdf0e10cSrcweir        Styles = (PACKED); \
159cdf0e10cSrcweir        Dir    = SCP2_OOO_BIN_DIR
160cdf0e10cSrcweir
161cdf0e10cSrcweir#define PACKED_LIB_FILE_BODY_PATCH \
162cdf0e10cSrcweir        TXT_FILE_BODY; \
163cdf0e10cSrcweir        Styles = (PACKED,PATCH); \
164cdf0e10cSrcweir        Dir    = SCP2_OOO_BIN_DIR
165cdf0e10cSrcweir
166cdf0e10cSrcweir#define PACKED_FILTER_FILE_BODY \
167cdf0e10cSrcweir        TXT_FILE_BODY; \
168cdf0e10cSrcweir        Styles = (PACKED); \
169cdf0e10cSrcweir        Dir    = gid_Dir_Filter
170cdf0e10cSrcweir
171cdf0e10cSrcweir#define PACKED_FILTER_FILE_BODY_PATCH \
172cdf0e10cSrcweir        TXT_FILE_BODY; \
173cdf0e10cSrcweir        Styles = (PACKED,PATCH); \
174cdf0e10cSrcweir        Dir    = gid_Dir_Filter
175cdf0e10cSrcweir
176cdf0e10cSrcweir#define STD_LIB_FILE(id,name) \
177cdf0e10cSrcweir    File id \
178cdf0e10cSrcweir        Name   = LIBNAME(name); \
179cdf0e10cSrcweir        PACKED_LIB_FILE_BODY; \
180cdf0e10cSrcweir    End
181cdf0e10cSrcweir
182cdf0e10cSrcweir#define STD_LIB_FILE_PATCH(id,name) \
183cdf0e10cSrcweir    File id \
184cdf0e10cSrcweir        Name   = LIBNAME(name); \
185cdf0e10cSrcweir        PACKED_LIB_FILE_BODY_PATCH; \
186cdf0e10cSrcweir    End
187cdf0e10cSrcweir
188cdf0e10cSrcweir#define SPECIAL_LIB_FILE(id,name) \
189cdf0e10cSrcweir    File id \
190cdf0e10cSrcweir        Name    = SPECIAL_NAME(name); \
191cdf0e10cSrcweir        PACKED_LIB_FILE_BODY; \
192cdf0e10cSrcweir    End
193cdf0e10cSrcweir
194cdf0e10cSrcweir#define SPECIAL_LIB_FILE_PATCH(id,name) \
195cdf0e10cSrcweir    File id \
196cdf0e10cSrcweir        Name    = SPECIAL_NAME(name); \
197cdf0e10cSrcweir        PACKED_LIB_FILE_BODY_PATCH; \
198cdf0e10cSrcweir    End
199cdf0e10cSrcweir
200cdf0e10cSrcweir#define STD_RES_FILE(id,name) \
201cdf0e10cSrcweir    File id \
202cdf0e10cSrcweir        TXT_FILE_BODY; \
203cdf0e10cSrcweir        RESFILE_ALL_LANG(name); \
204cdf0e10cSrcweir        Dir     = gid_Dir_Resource; \
205cdf0e10cSrcweir        Styles  = (PACKED); \
206cdf0e10cSrcweir    End
207cdf0e10cSrcweir
208cdf0e10cSrcweir#define BRAND_RES_FILE(id,name) \
209cdf0e10cSrcweir    File id \
210cdf0e10cSrcweir        TXT_FILE_BODY; \
211cdf0e10cSrcweir        RESFILE_ALL_LANG(name); \
212cdf0e10cSrcweir        Dir     = gid_Brand_Dir_Resource; \
213cdf0e10cSrcweir        Styles  = (PACKED); \
214cdf0e10cSrcweir    End
215cdf0e10cSrcweir
216cdf0e10cSrcweir#define STD_RES_FILE_PATCH(id,name) \
217cdf0e10cSrcweir    File id \
218cdf0e10cSrcweir        TXT_FILE_BODY; \
219cdf0e10cSrcweir        RESFILE_ALL_LANG(name); \
220cdf0e10cSrcweir        Dir     = gid_Dir_Resource; \
221cdf0e10cSrcweir        Styles  = (PACKED,PATCH); \
222cdf0e10cSrcweir    End
223cdf0e10cSrcweir
224cdf0e10cSrcweir#define STD_RES_FILE_ONLY_PATCH(id,name) \
225cdf0e10cSrcweir    File id \
226cdf0e10cSrcweir        TXT_FILE_BODY; \
227cdf0e10cSrcweir        RESFILE_ALL_LANG(name); \
228cdf0e10cSrcweir        Dir     = gid_Dir_Resource; \
229cdf0e10cSrcweir        Styles  = (PACKED,PATCH,PATCH_ONLY); \
230cdf0e10cSrcweir    End
231cdf0e10cSrcweir
232cdf0e10cSrcweir#define STD_FILTER_FILE(id,name) \
233cdf0e10cSrcweir    File id \
234cdf0e10cSrcweir        PACKED_LIB_FILE_BODY; \
235cdf0e10cSrcweir        Name = FILTER_LIBNAME(name); \
236cdf0e10cSrcweir    End
237cdf0e10cSrcweir
238cdf0e10cSrcweir#define STD_FILTER_FILE_PATCH(id,name) \
239cdf0e10cSrcweir    File id \
240cdf0e10cSrcweir        PACKED_LIB_FILE_BODY_PATCH; \
241cdf0e10cSrcweir        Name = FILTER_LIBNAME(name); \
242cdf0e10cSrcweir    End
243cdf0e10cSrcweir
244cdf0e10cSrcweir#define STD_FONTUNX_FILE(id,name,fontname) \
245cdf0e10cSrcweir    File id \
246cdf0e10cSrcweir        TXT_FILE_BODY; \
247cdf0e10cSrcweir        Dir       = gid_Dir_Fonts_Truetype; \
248cdf0e10cSrcweir        Styles    = (PACKED, FONT_WARN_IF_EXISTS); \
249cdf0e10cSrcweir        Name      = STRING(name) ; \
250cdf0e10cSrcweir    End
251cdf0e10cSrcweir
252cdf0e10cSrcweir#define STD_FONTWIN_FILE(id,name,fontname) \
253cdf0e10cSrcweir    File id \
254cdf0e10cSrcweir        TXT_FILE_BODY; \
255cdf0e10cSrcweir        Dir      = PREDEFINED_OSSYSTEMFONTDIR; \
256cdf0e10cSrcweir        Styles   = (PACKED,FONT,DONT_DELETE,FONT_WARN_IF_EXISTS); \
257cdf0e10cSrcweir        Name     = STRING(name) ; \
258cdf0e10cSrcweir        FontName = STRING(fontname) ; \
259cdf0e10cSrcweir        NetDir   = gid_Dir_Winfonts; \
260cdf0e10cSrcweir    End
261cdf0e10cSrcweir
262cdf0e10cSrcweir#ifdef UNX
263cdf0e10cSrcweir#define STD_FONT_FILE(id,name,fontname) \
264cdf0e10cSrcweir    File id \
265cdf0e10cSrcweir        TXT_FILE_BODY; \
266cdf0e10cSrcweir        Dir       = gid_Dir_Fonts_Truetype; \
267cdf0e10cSrcweir        Styles    = (PACKED, FONT_WARN_IF_EXISTS); \
268cdf0e10cSrcweir        Name      = STRING(name) ; \
269cdf0e10cSrcweir    End
270cdf0e10cSrcweir#endif
271cdf0e10cSrcweir
272cdf0e10cSrcweir#ifdef UNX
273cdf0e10cSrcweir#define STD_FONT_FILE_DUO(id,name,unxfontname,winfontname) \
274cdf0e10cSrcweir    File id \
275cdf0e10cSrcweir        TXT_FILE_BODY; \
276cdf0e10cSrcweir        Dir       = gid_Dir_Fonts_Truetype; \
277cdf0e10cSrcweir        Styles    = (PACKED, FONT_WARN_IF_EXISTS); \
278cdf0e10cSrcweir        Name      = STRING(name) ; \
279cdf0e10cSrcweir    End
280cdf0e10cSrcweir#endif
281cdf0e10cSrcweir
282cdf0e10cSrcweir#ifdef WNT
283cdf0e10cSrcweir#define STD_FONT_FILE(id,name,fontname) \
284cdf0e10cSrcweir    File id \
285cdf0e10cSrcweir        TXT_FILE_BODY; \
286cdf0e10cSrcweir        Dir      = PREDEFINED_OSSYSTEMFONTDIR; \
287cdf0e10cSrcweir        Styles   = (PACKED,FONT,DONT_DELETE,FONT_WARN_IF_EXISTS); \
288cdf0e10cSrcweir        Name     = STRING(name) ; \
289cdf0e10cSrcweir        FontName = STRING(fontname) ; \
290cdf0e10cSrcweir        NetDir   = gid_Dir_Winfonts; \
291cdf0e10cSrcweir    End
292cdf0e10cSrcweir#endif
293cdf0e10cSrcweir
294cdf0e10cSrcweir#ifdef WNT
295cdf0e10cSrcweir#define STD_FONT_FILE_DUO(id,name,unxfontname,winfontname) \
296cdf0e10cSrcweir    File id \
297cdf0e10cSrcweir        TXT_FILE_BODY; \
298cdf0e10cSrcweir        Dir      = PREDEFINED_OSSYSTEMFONTDIR; \
299cdf0e10cSrcweir        Styles   = (PACKED,FONT,DONT_DELETE,FONT_WARN_IF_EXISTS); \
300cdf0e10cSrcweir        Name     = STRING(name) ; \
301cdf0e10cSrcweir        FontName = STRING(winfontname) ; \
302cdf0e10cSrcweir        NetDir   = gid_Dir_Winfonts; \
303cdf0e10cSrcweir    End
304cdf0e10cSrcweir#endif
305cdf0e10cSrcweir
306cdf0e10cSrcweir#define STD_JAR_FILE(id,name) \
307cdf0e10cSrcweir    File id \
308cdf0e10cSrcweir        TXT_FILE_BODY; \
309cdf0e10cSrcweir        Name     = STRING(CONCAT2(name,.jar)); \
310cdf0e10cSrcweir        Dir      = gid_Dir_Classes; \
311cdf0e10cSrcweir        Styles   = (PACKED,DONT_OVERWRITE); \
312cdf0e10cSrcweir    End
313cdf0e10cSrcweir
314cdf0e10cSrcweir#define STD_JAR_FILE_PATCH(id,name) \
315cdf0e10cSrcweir    File id \
316cdf0e10cSrcweir        TXT_FILE_BODY; \
317cdf0e10cSrcweir        Name     = STRING(CONCAT2(name,.jar)); \
318cdf0e10cSrcweir        Dir      = gid_Dir_Classes; \
319cdf0e10cSrcweir        Styles   = (PACKED,DONT_OVERWRITE,PATCH); \
320cdf0e10cSrcweir    End
321cdf0e10cSrcweir
322cdf0e10cSrcweir#define JARFILENAME(name) STRING(CONCAT2(name,.jar))
323cdf0e10cSrcweir
324cdf0e10cSrcweir#define PACKED_SHELLNEW_FILE_BODY \
325cdf0e10cSrcweir        TXT_FILE_BODY; \
326cdf0e10cSrcweir        Styles = (PACKED,WORKSTATION, OVERWRITE); \
327cdf0e10cSrcweir        Dir    = PREDEFINED_OSSHELLNEWDIR; \
328cdf0e10cSrcweir        NetDir = gid_Dir_Shellnew
329cdf0e10cSrcweir
330cdf0e10cSrcweir#define STD_SHELLNEW_FILE(id,name) \
331cdf0e10cSrcweir    File id \
332cdf0e10cSrcweir        PACKED_SHELLNEW_FILE_BODY; \
333cdf0e10cSrcweir        Name      = STRING(name) ; \
334cdf0e10cSrcweir    End
335cdf0e10cSrcweir
336cdf0e10cSrcweir#define SPECIAL_COMPONENT_LIB_FILE(id,name) \
337cdf0e10cSrcweir    File id \
338cdf0e10cSrcweir        Name     = SPECIAL_COMPONENT_LIB_NAME(name); \
339cdf0e10cSrcweir        PACKED_LIB_FILE_BODY; \
340cdf0e10cSrcweir    End
341cdf0e10cSrcweir
342cdf0e10cSrcweir#define SPECIAL_COMPONENT_LIB_FILE_PATCH(id,name) \
343cdf0e10cSrcweir    File id \
344cdf0e10cSrcweir        Name     = SPECIAL_COMPONENT_LIB_NAME(name); \
345cdf0e10cSrcweir        PACKED_LIB_FILE_BODY_PATCH; \
346cdf0e10cSrcweir    End
347cdf0e10cSrcweir
348cdf0e10cSrcweir#define WINW4WFILTERFILENAME(name) STRING(CONCAT2(name,f32w.dll))
349cdf0e10cSrcweir
350cdf0e10cSrcweir#define STD_WIN_W4WFILTER_FILE(id,name) \
351cdf0e10cSrcweir    File id \
352cdf0e10cSrcweir        PACKED_FILTER_FILE_BODY; \
353cdf0e10cSrcweir        Name            = WINW4WFILTERFILENAME(name);  \
354cdf0e10cSrcweir    End
355cdf0e10cSrcweir
356cdf0e10cSrcweir#define SOLSW4WFILTERFILENAME(name) STRING(CONCAT2(w4w, name))
357cdf0e10cSrcweir
358cdf0e10cSrcweir#define STD_SOLS_W4WFILTER_FILE(id,name) \
359cdf0e10cSrcweir    File id \
360cdf0e10cSrcweir        BIN_FILE_BODY; \
361cdf0e10cSrcweir        Styles = (PACKED); \
362cdf0e10cSrcweir        Dir = gid_Dir_Filter; \
363cdf0e10cSrcweir        Name = SOLSW4WFILTERFILENAME(name); \
364cdf0e10cSrcweir    End
365cdf0e10cSrcweir
366cdf0e10cSrcweir#define SPECIAL_NO_WARNING_IF_NOT_EXISTS_FILE(id,name) \
367cdf0e10cSrcweir    File id \
368cdf0e10cSrcweir        TXT_FILE_BODY; \
369cdf0e10cSrcweir        Name = LIBNAME(name); \
370cdf0e10cSrcweir        Dir = SCP2_OOO_BIN_DIR; \
371cdf0e10cSrcweir        Styles = (PACKED, NO_WARNING_IF_NOT_EXISTS); \
372cdf0e10cSrcweir    End
373cdf0e10cSrcweir
374cdf0e10cSrcweir// ---------------------------------------
375cdf0e10cSrcweir#define CONDITIONAL_MODULE_ENTRY(name,modid) \
376cdf0e10cSrcweir    Module gid_Module_Root_Reg_##name \
377cdf0e10cSrcweir	ParentID = modid; \
378cdf0e10cSrcweir	Name = STRING(CONCAT2(gid_Module_Root_,name)); \
379cdf0e10cSrcweir	Description = STRING(CONCAT2(gid_Module_Root_,name)); \
380cdf0e10cSrcweir	Default = YES; \
381cdf0e10cSrcweir	Styles = (HIDDEN_ROOT); \
382cdf0e10cSrcweirEnd
383cdf0e10cSrcweir
384cdf0e10cSrcweir#define REGISTRY_ENTRY_OPEN_WITH(name,cond,doc_type,modid,key) \
385cdf0e10cSrcweir    RegistryItem gid_Regitem_OpenOffice_##cond##_OpenWith_##doc_type \
386cdf0e10cSrcweir        ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
387cdf0e10cSrcweir        ModuleID = modid; \
388cdf0e10cSrcweir        Subkey = STRING(CONCAT3(.,key,\OpenWithProgIDs)); \
389599cc5b4SOliver-Rainer Wittmann        Name = STRING(CONCAT2(OpenOffice.,name)); \
390cdf0e10cSrcweir        Value = " "; \
391cdf0e10cSrcweir    End
392cdf0e10cSrcweir
393cdf0e10cSrcweir#define REGISTRY_ENTRY_OPEN_WITH_TMPL(name,cond,doc_type,modid,key) \
394cdf0e10cSrcweir    RegistryItem gid_Regitem_OpenOffice_##cond##_OpenWith_##doc_type \
395cdf0e10cSrcweir        ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
396cdf0e10cSrcweir        ModuleID = modid; \
397cdf0e10cSrcweir        Subkey = STRING(CONCAT3(.,key,\OpenWithProgIDs)); \
398599cc5b4SOliver-Rainer Wittmann        Name = STRING(CONCAT2(OpenOffice.,name)); \
399cdf0e10cSrcweir        Value = " "; \
400cdf0e10cSrcweir    End
401cdf0e10cSrcweir
402cdf0e10cSrcweir#define CONDITIONAL_REGISTRY_ENTRY_EXT(name,cond,key) \
403cdf0e10cSrcweir    RegistryItem gid_Regitem__##name \
404cdf0e10cSrcweir        ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
405cdf0e10cSrcweir        ModuleID = gid_Module_Root_Reg_##name; \
406cdf0e10cSrcweir        Subkey = STRING(CONCAT2(.,key)); \
407599cc5b4SOliver-Rainer Wittmann        Value = STRING(CONCAT2(OpenOffice.,name)); \
408cdf0e10cSrcweir        ComponentCondition = STRING(CONCAT3(REGISTER_,cond,=1)); \
409cdf0e10cSrcweir    End
410cdf0e10cSrcweir
411cdf0e10cSrcweir#define REGISTRY_ENTRY_DOC(name,modid,disp_name) \
412cdf0e10cSrcweir    RegistryItem CONCAT2(gid_Regitem_Openoffice_,name) \
413cdf0e10cSrcweir        ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
414cdf0e10cSrcweir        ModuleID = modid; \
415599cc5b4SOliver-Rainer Wittmann        Subkey = STRING(CONCAT2(OpenOffice.,name)); \
416cdf0e10cSrcweir        REG_VALUE_LNG(disp_name) \
417cdf0e10cSrcweir    End
418cdf0e10cSrcweir
419cdf0e10cSrcweir#define REGISTRY_ENTRY_ICON(name,modid,icon_id) \
420cdf0e10cSrcweir    RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Defaulticon) \
421cdf0e10cSrcweir        ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
422cdf0e10cSrcweir        ModuleID = modid; \
423599cc5b4SOliver-Rainer Wittmann        Subkey = STRING(CONCAT3(OpenOffice.,name,\DefaultIcon)); \
424cdf0e10cSrcweir        Value = "<progpath>\program\soffice.exe," STRING(icon_id); \
425cdf0e10cSrcweir    End
426cdf0e10cSrcweir
427cdf0e10cSrcweir#define REGISTRY_ENTRY_SHELL(name,default,modid) \
428cdf0e10cSrcweir    RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell) \
429cdf0e10cSrcweir        ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
430cdf0e10cSrcweir        ModuleID = modid; \
431599cc5b4SOliver-Rainer Wittmann        Subkey = STRING(CONCAT3(OpenOffice.,name,\shell)); \
432cdf0e10cSrcweir        Value = STRING(default); \
433cdf0e10cSrcweir    End
434cdf0e10cSrcweir
435cdf0e10cSrcweir#define REGISTRY_ENTRY_NEW_CMD(name,modid,app) \
436cdf0e10cSrcweir    RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_New) \
437cdf0e10cSrcweir        ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
438cdf0e10cSrcweir        ModuleID = modid; \
439599cc5b4SOliver-Rainer Wittmann        Subkey = STRING(CONCAT3(OpenOffice.,name,\shell\new)); \
440cdf0e10cSrcweir        REG_VALUE_LNG(NEW) \
441cdf0e10cSrcweir    End \
442cdf0e10cSrcweir    RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_New_Command) \
443cdf0e10cSrcweir        ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
444cdf0e10cSrcweir        ModuleID = modid; \
445599cc5b4SOliver-Rainer Wittmann        Subkey = STRING(CONCAT3(OpenOffice.,name,\shell\new\command)); \
446cdf0e10cSrcweir        Value = "\"<progpath>\program\\" STRING(app) "\" -n \"%1\""; \
447cdf0e10cSrcweir    End
448cdf0e10cSrcweir
449cdf0e10cSrcweir#define REGISTRY_ENTRY_OPEN_CMD(name,modid,app) \
450cdf0e10cSrcweir    RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_Open_Command) \
451cdf0e10cSrcweir        ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
452cdf0e10cSrcweir        ModuleID = modid; \
453599cc5b4SOliver-Rainer Wittmann        Subkey = STRING(CONCAT3(OpenOffice.,name,\shell\open\command)); \
454cdf0e10cSrcweir        Value = "\"<progpath>\program\\" STRING(app) "\" -o \"%1\""; \
455cdf0e10cSrcweir    End
456cdf0e10cSrcweir
457cdf0e10cSrcweir#define REGISTRY_ENTRY_PRINT_CMD(name,modid,app) \
458cdf0e10cSrcweir    RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_Print_Command) \
459cdf0e10cSrcweir        ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
460cdf0e10cSrcweir        ModuleID = modid; \
461599cc5b4SOliver-Rainer Wittmann        Subkey = STRING(CONCAT3(OpenOffice.,name,\shell\print\command)); \
462cdf0e10cSrcweir        Value = "\"<progpath>\program\\" STRING(app) "\" -p \"%1\""; \
463cdf0e10cSrcweir    End
464cdf0e10cSrcweir
465cdf0e10cSrcweir#define REGISTRY_ENTRY_PRINTTO_CMD(name,modid,app) \
466cdf0e10cSrcweir    RegistryItem CONCAT3(gid_Regitem_Openoffice_,name,_Shell_Printto_Command) \
467cdf0e10cSrcweir        ParentID = PREDEFINED_HKEY_CLASSES_ROOT; \
468cdf0e10cSrcweir        ModuleID = modid; \
469599cc5b4SOliver-Rainer Wittmann        Subkey = STRING(CONCAT3(OpenOffice.,name,\shell\printto\command)); \
470cdf0e10cSrcweir        Value = "\"<progpath>\program\\" STRING(app) "\" -pt \"%2\" \"%1\""; \
471cdf0e10cSrcweir    End
472cdf0e10cSrcweir
473cdf0e10cSrcweir#define REGISTRY_ENTRY_CAPABILITIES(name,modid,key,doc_type) \
474cdf0e10cSrcweir    RegistryItem CONCAT2(gid_Regitem_Software_Manufacturer_Productname_Productversion_Capabilities_FileAssociations_,name) \
475cdf0e10cSrcweir        ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
476cdf0e10cSrcweir        ModuleID = modid; \
477cdf0e10cSrcweir        Subkey = STRING(Software\%MANUFACTURER\%PRODUCTNAME%PRODUCTADDON\%PRODUCTVERSION\Capabilities\FileAssociations); \
478cdf0e10cSrcweir        Name = STRING(CONCAT2(.,key)); \
479599cc5b4SOliver-Rainer Wittmann        Value = STRING(CONCAT2(OpenOffice.,name)); \
480cdf0e10cSrcweir        Styles = (); \
481cdf0e10cSrcweir    End
482cdf0e10cSrcweir
483cdf0e10cSrcweir#define REGISTRY_ENTRY_TEMPLATE_CAPABILITIES(name,modid,key,doc_type) \
484cdf0e10cSrcweir    RegistryItem CONCAT2(gid_Regitem_Software_Manufacturer_Productname_Productversion_Capabilities_FileAssociations_,name) \
485cdf0e10cSrcweir        ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
486cdf0e10cSrcweir        ModuleID = modid; \
487cdf0e10cSrcweir        Subkey = STRING(Software\%MANUFACTURER\%PRODUCTNAME%PRODUCTADDON\%PRODUCTVERSION\Capabilities\FileAssociations); \
488cdf0e10cSrcweir        Name = STRING(CONCAT2(.,key)); \
489599cc5b4SOliver-Rainer Wittmann        Value = STRING(CONCAT2(OpenOffice.,name)); \
490cdf0e10cSrcweir        Styles = (); \
491cdf0e10cSrcweir    End
492cdf0e10cSrcweir
493cdf0e10cSrcweir#define CONDITIONAL_REGISTER_DOC_EXTENSION(name,modid,key,cond,disp_name,icon_id,app,default,doc_type) \
494cdf0e10cSrcweir    CONDITIONAL_MODULE_ENTRY(name,modid) \
495cdf0e10cSrcweir    REGISTRY_ENTRY_OPEN_WITH(name,cond,doc_type,modid,key) \
496cdf0e10cSrcweir    CONDITIONAL_REGISTRY_ENTRY_EXT(name,cond,key) \
497cdf0e10cSrcweir    REGISTRY_ENTRY_DOC(name,modid,disp_name) \
498cdf0e10cSrcweir    REGISTRY_ENTRY_ICON(name,modid,icon_id) \
499cdf0e10cSrcweir    REGISTRY_ENTRY_SHELL(name,default,modid) \
500cdf0e10cSrcweir    REGISTRY_ENTRY_NEW_CMD(name,modid,app) \
501cdf0e10cSrcweir    REGISTRY_ENTRY_OPEN_CMD(name,modid,app) \
502cdf0e10cSrcweir    REGISTRY_ENTRY_PRINT_CMD(name,modid,app) \
503cdf0e10cSrcweir    REGISTRY_ENTRY_PRINTTO_CMD(name,modid,app) \
504cdf0e10cSrcweir    REGISTRY_ENTRY_CAPABILITIES(name,modid,key,doc_type) \
505cdf0e10cSrcweir
506cdf0e10cSrcweir#define CONDITIONAL_REGISTER_DOCTEMPLATE_EXTENSION(name,modid,key,cond,disp_name,icon_id,app,default,doc_type) \
507cdf0e10cSrcweir    CONDITIONAL_MODULE_ENTRY(name,modid) \
508cdf0e10cSrcweir    REGISTRY_ENTRY_OPEN_WITH_TMPL(name,cond,doc_type,modid,key) \
509cdf0e10cSrcweir    CONDITIONAL_REGISTRY_ENTRY_EXT(name,cond,key) \
510cdf0e10cSrcweir    REGISTRY_ENTRY_DOC(name,modid,disp_name) \
511cdf0e10cSrcweir    REGISTRY_ENTRY_ICON(name,modid,icon_id) \
512cdf0e10cSrcweir    REGISTRY_ENTRY_SHELL(name,default,modid) \
513cdf0e10cSrcweir    REGISTRY_ENTRY_NEW_CMD(name,modid,app) \
514cdf0e10cSrcweir    REGISTRY_ENTRY_OPEN_CMD(name,modid,app) \
515cdf0e10cSrcweir    REGISTRY_ENTRY_PRINT_CMD(name,modid,app) \
516cdf0e10cSrcweir    REGISTRY_ENTRY_PRINTTO_CMD(name,modid,app) \
517cdf0e10cSrcweir    REGISTRY_ENTRY_TEMPLATE_CAPABILITIES(name,modid,key,doc_type) \
518cdf0e10cSrcweir
519cdf0e10cSrcweir// ---------------------------------------
520cdf0e10cSrcweir
521cdf0e10cSrcweir#define REGISTER_PROPERTY_HANDLER_FOR_EXTENSION(extension) \
522cdf0e10cSrcweir    RegistryItem CONCAT2(gid_Regitem_Software_Microsoft_Windows_CurrentVersion_PropertySystem_PropertyHandlers_,extension) \
523cdf0e10cSrcweir        ParentID = PREDEFINED_HKEY_LOCAL_MACHINE; \
524cdf0e10cSrcweir        ModuleID = gid_Module_Optional_Winexplorerext_PropertyHdl; \
525cdf0e10cSrcweir        ComponentCondition = "VersionNT >= 600"; \
526cdf0e10cSrcweir        Styles = (X64); \
527cdf0e10cSrcweir        Subkey = STRING(CONCAT2(SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\.,extension)); \
528cdf0e10cSrcweir        Value = "{AE424E85-F6DF-4910-A6A9-438797986431}"; \
529cdf0e10cSrcweir        Val64 = "{AE424E85-F6DF-4910-A6A9-438797986431}"; \
530cdf0e10cSrcweir    End
531cdf0e10cSrcweir
532cdf0e10cSrcweir// ---------------------------------------
533cdf0e10cSrcweir
534d44f38edSYuri Dario#if defined(WNT) || defined(OS2)
535*1076d7f7SJürgen Schmidt#define SCP2_URE_DL_DIR gid_Dir_Common_Ure
536*1076d7f7SJürgen Schmidt//#define SCP2_URE_DL_DIR gid_Dir_Ure_Bin
537cdf0e10cSrcweir#define SCP2_URE_DL_NORMAL(n) n ".dll"
538cdf0e10cSrcweir#define SCP2_URE_DL_BARE(n) n ".dll"
539cdf0e10cSrcweir#define SCP2_URE_DL_VER(n, v) n v ".dll"
540cdf0e10cSrcweir#define SCP2_URE_DL_COMID_VER(n, v) n v STRING(COMID) ".dll"
541cdf0e10cSrcweir#define SCP2_URE_DL_UNO_VER(n, v) n v ".dll"
542cdf0e10cSrcweir#define SCP2_URE_DL_UNO_COMID_VER(n, v) n v STRING(COMID) ".dll"
543cdf0e10cSrcweir#define SCP2_URE_SHARE_DIR gid_Dir_Common_Ure
544cdf0e10cSrcweir#else
545cdf0e10cSrcweir#define SCP2_URE_DL_DIR gid_Dir_Ure_Lib
546cdf0e10cSrcweir#define SCP2_URE_DL_NORMAL(n) "lib" n STRING(UNXSUFFIX)
547cdf0e10cSrcweir#define SCP2_URE_DL_BARE(n) n STRING(UNXSUFFIX)
548cdf0e10cSrcweir#define SCP2_URE_DL_VER(n, v) "lib" n STRING(UNXSUFFIX) "." v
549cdf0e10cSrcweir#define SCP2_URE_DL_COMID_VER(n, v) \
550cdf0e10cSrcweir    "lib" n STRING(COMID) STRING(UNXSUFFIX) "." v
551cdf0e10cSrcweir#define SCP2_URE_DL_UNO_VER(n, v) "libuno_" n STRING(UNXSUFFIX) "." v
552cdf0e10cSrcweir#define SCP2_URE_DL_UNO_NORMAL(n) "libuno_" n STRING(UNXSUFFIX)
553cdf0e10cSrcweir#define SCP2_URE_DL_UNO_COMID_VER(n, v)	\
554cdf0e10cSrcweir    "libuno_" n STRING(COMID) STRING(UNXSUFFIX) "." v
555cdf0e10cSrcweir#define SCP2_URE_DL_UNO_COMID_NORMAL(n)	\
556cdf0e10cSrcweir    "libuno_" n STRING(COMID) STRING(UNXSUFFIX)
557cdf0e10cSrcweir#define SCP2_URE_SHARE_DIR gid_Dir_Ure_Share
558cdf0e10cSrcweir#endif
559cdf0e10cSrcweir#if defined MACOSX
560cdf0e10cSrcweir#define SCP2_URE_JDL_NORMAL(n) "lib" n ".jnilib"
561cdf0e10cSrcweir#else
562cdf0e10cSrcweir#define SCP2_URE_JDL_NORMAL(n) SCP2_URE_DL_NORMAL(n)
563cdf0e10cSrcweir#endif
564cdf0e10cSrcweir
565cdf0e10cSrcweir#include <langmacros.inc>
566cdf0e10cSrcweir
567cdf0e10cSrcweir
568cdf0e10cSrcweir#endif // MACROS_INC
569cdf0e10cSrcweir
570