1 /** \file crsetup.h
2     \brief CREngine options definitions
3 
4     (c) Vadim Lopatin, 2000-2006
5 
6     This source code is distributed under the terms of
7     GNU General Public License.
8 
9     See LICENSE file for details.
10 
11 */
12 
13 #ifndef CRSETUP_H_INCLUDED
14 #define CRSETUP_H_INCLUDED
15 
16 
17 
18 // features set for LBOOK
19 #if (LBOOK==1)
20 
21 #ifndef LDOM_USE_OWN_MEM_MAN
22 #define LDOM_USE_OWN_MEM_MAN                 1
23 #endif
24 
25 #define USE_DOM_UTF8_STORAGE                 1
26 #define CR_USE_THREADS                       0
27 
28 #ifndef MAX_IMAGE_SCALE_MUL
29 #define MAX_IMAGE_SCALE_MUL                  2
30 #endif
31 
32 #define USE_ZLIB                             1
33 #define COLOR_BACKBUFFER                     0
34 #define USE_ANSI_FILES                       1
35 #define GRAY_INVERSE                         0
36 #define ALLOW_KERNING                        1
37 
38 #if (BUILD_LITE==1)
39 
40 #define USE_LIBJPEG                          0
41 #define USE_LIBPNG                           0
42 #define USE_GIF                              0
43 #define USE_FREETYPE                         0
44 #define USE_HARFBUZZ                         0
45 #define USE_FRIBIDI                          0
46 #define USE_LIBUNIBREAK                      0
47 #define USE_GLYPHCACHE_HASHTABLE             0
48 #define GLYPH_CACHE_SIZE                     0x1000
49 #define ZIP_STREAM_BUFFER_SIZE               0x1000
50 #define FILE_STREAM_BUFFER_SIZE              0x1000
51 
52 #else
53 
54 #define USE_LIBJPEG                          1
55 #define USE_LIBPNG                           1
56 #define USE_GIF                              1
57 #define USE_FREETYPE                         1
58 #define USE_HARFBUZZ                         1
59 #define USE_FRIBIDI                          1
60 #define USE_LIBUNIBREAK                      1
61 #define USE_GLYPHCACHE_HASHTABLE             0
62 #define GLYPH_CACHE_SIZE                     0x20000
63 #define ZIP_STREAM_BUFFER_SIZE               0x80000
64 #define FILE_STREAM_BUFFER_SIZE              0x40000
65 
66 #endif  // (BUILD_LITE==1)
67 
68 #elif defined(_LINUX) || defined (LINUX)
69 
70 #ifndef LDOM_USE_OWN_MEM_MAN
71 #define LDOM_USE_OWN_MEM_MAN                 1
72 #endif
73 
74 #ifdef ANDROID
75 #define CR_USE_THREADS                       1
76 #define USE_ATOMIC_REFCOUNT
77 #define USE_LIMITED_FONT_SIZES_SET           0
78 #else
79 #define CR_USE_THREADS                       0
80 #endif // ANDROID
81 
82 #define USE_LIBJPEG                          1
83 #define USE_LIBPNG                           1
84 #define USE_GIF                              1
85 #define USE_ZLIB                             1
86 
87 #ifndef COLOR_BACKBUFFER
88 #define COLOR_BACKBUFFER                     1
89 #endif
90 
91 #define USE_ANSI_FILES                       1
92 #define GRAY_INVERSE                         0
93 #define USE_FREETYPE                         1
94 #define USE_HARFBUZZ                         1
95 #define USE_FRIBIDI                          1
96 #define USE_LIBUNIBREAK                      1
97 #define USE_GLYPHCACHE_HASHTABLE             1
98 
99 #ifndef ANDROID
100 #ifndef MAC
101 #ifndef TIZEN
102 #ifndef USE_FONTCONFIG
103 #define USE_FONTCONFIG						 1
104 #endif
105 #endif  // TIZEN
106 #endif  // MAC
107 #endif  // ANDROID
108 #define ALLOW_KERNING                        1
109 #define GLYPH_CACHE_SIZE                     0x40000
110 #define ZIP_STREAM_BUFFER_SIZE               0x40000
111 #define FILE_STREAM_BUFFER_SIZE              0x20000
112 #endif  // defined(_LINUX) || defined (LINUX)
113 
114 //==================================================
115 // WIN32
116 //==================================================
117 #if !defined(__SYMBIAN32__) && defined(_WIN32)
118 /// maximum picture zoom (1, 2, 3)
119 #define CR_USE_THREADS                       0
120 #ifndef COLOR_BACKBUFFER
121 #define COLOR_BACKBUFFER                     1
122 #endif
123 #define GRAY_INVERSE						 0
124 #ifndef MAX_IMAGE_SCALE_MUL
125 #define MAX_IMAGE_SCALE_MUL                  1
126 #endif
127 #if defined(CYGWIN)
128 #define USE_FREETYPE                         0
129 #define USE_HARFBUZZ                         0
130 #define USE_FRIBIDI                          0
131 #define USE_LIBUNIBREAK                      0
132 #else
133 #define USE_FREETYPE                         1
134 #define USE_HARFBUZZ                         1
135 #ifndef _MSC_VER
136 #define USE_FRIBIDI                          1
137 #endif
138 #define USE_LIBUNIBREAK                      1
139 #endif
140 #define ALLOW_KERNING                        1
141 #define USE_GLYPHCACHE_HASHTABLE             1
142 #define GLYPH_CACHE_SIZE                     0x20000
143 #define ZIP_STREAM_BUFFER_SIZE               0x80000
144 #define FILE_STREAM_BUFFER_SIZE              0x40000
145 //#define USE_LIBJPEG 0
146 #endif  // !defined(__SYMBIAN32__) && defined(_WIN32)
147 
148 #ifndef GLYPH_CACHE_SIZE
149 /// freetype font glyph buffer size, in bytes
150 #define GLYPH_CACHE_SIZE 0x40000
151 #endif
152 
153 
154 // disable some features for SYMBIAN
155 #if defined(__SYMBIAN32__)
156 #define USE_LIBJPEG 0
157 #define USE_LIBPNG  0
158 #define USE_GIF     1
159 #define USE_ZLIB    0
160 #endif
161 
162 #ifndef USE_GIF
163 ///allow GIF support via embedded decoder
164 #define USE_GIF 1
165 #endif
166 
167 #ifndef USE_LIBJPEG
168 ///allow JPEG support via libjpeg
169 #define USE_LIBJPEG 1
170 #endif
171 
172 #ifndef USE_LIBPNG
173 ///allow PNG support via libpng
174 #define USE_LIBPNG 1
175 #endif
176 
177 #ifndef USE_ZLIB
178 ///allow PNG support via libpng
179 #define USE_ZLIB 1
180 #endif
181 
182 #ifndef GRAY_INVERSE
183 #define GRAY_INVERSE     1
184 #endif
185 
186 
187 /** \def LVLONG_FILE_SUPPORT
188     \brief define to 1 to use 64 bits for file position types
189 */
190 #define LVLONG_FILE_SUPPORT 0
191 
192 //#define USE_ANSI_FILES 1
193 
194 //1: use native Win32 fonts
195 //0: use bitmap fonts
196 //#define USE_WIN32_FONTS 1
197 
198 //1: use color backbuffer
199 //0: use gray backbuffer
200 #ifndef GRAY_BACKBUFFER_BITS
201 #define GRAY_BACKBUFFER_BITS 2
202 #endif // GRAY_BACKBUFFER_BITS
203 
204 #ifndef COLOR_BACKBUFFER
205 #ifdef _WIN32
206 #define COLOR_BACKBUFFER 1
207 #else
208 #define COLOR_BACKBUFFER 1
209 #endif
210 #endif  // COLOR_BACKBUFFER
211 
212 /// zlib stream decode cache size, used to avoid restart of decoding from beginning to move back
213 #ifndef ZIP_STREAM_BUFFER_SIZE
214 #define ZIP_STREAM_BUFFER_SIZE 0x10000
215 #endif
216 
217 /// document stream buffer size
218 #ifndef FILE_STREAM_BUFFER_SIZE
219 #define FILE_STREAM_BUFFER_SIZE 0x40000
220 #endif
221 
222 
223 
224 #if !defined(USE_WIN32_FONTS) && (USE_FREETYPE!=1)
225 
226 #if !defined(__SYMBIAN32__) && defined(_WIN32)
227 /** \def USE_WIN32_FONTS
228     \brief define to 1 to use windows system fonts instead of bitmap fonts
229 */
230 #define USE_WIN32_FONTS 1
231 #else
232 #define USE_WIN32_FONTS 0
233 #endif
234 
235 #ifndef ALLOW_KERNING
236 /// set to 1 to allow kerning
237 #define ALLOW_KERNING 0
238 #endif
239 
240 #endif  // !defined(USE_WIN32_FONTS) && (USE_FREETYPE!=1)
241 
242 
243 #ifndef CHM_SUPPORT_ENABLED
244 #define CHM_SUPPORT_ENABLED 1
245 #endif
246 
247 #ifndef USE_FREETYPE
248 #define USE_FREETYPE 0
249 #endif
250 
251 #ifndef USE_WIN32_FONTS
252 #define USE_WIN32_FONTS 0
253 #endif
254 
255 #ifndef LDOM_USE_OWN_MEM_MAN
256 #define LDOM_USE_OWN_MEM_MAN 0
257 #endif
258 
259 #ifndef USE_DOM_UTF8_STORAGE
260 #define USE_DOM_UTF8_STORAGE 0
261 #endif
262 
263 /// Set to 1 to support CR internal rotation of screen, 0 for system rotation
264 #ifndef CR_INTERNAL_PAGE_ORIENTATION
265 #define CR_INTERNAL_PAGE_ORIENTATION 1
266 #endif
267 
268 
269 #ifndef USE_BITMAP_FONTS
270 
271 #if (USE_WIN32_FONTS==1) || (USE_FREETYPE==1)
272 #define USE_BITMAP_FONTS 0
273 #else
274 #define USE_BITMAP_FONTS 1
275 #endif
276 
277 #endif  // USE_BITMAP_FONTS
278 
279 /// maximum picture zoom (1, 2, 3)
280 #ifndef MAX_IMAGE_SCALE_MUL
281 #define MAX_IMAGE_SCALE_MUL 2
282 #endif
283 
284 // max unpacked size of skin image to hold in cache unpacked
285 #ifndef MAX_SKIN_IMAGE_CACHE_ITEM_UNPACKED_SIZE
286 #define MAX_SKIN_IMAGE_CACHE_ITEM_UNPACKED_SIZE 80*80*4
287 #endif
288 
289 // max skin image file size to hold as a packed copy in memory
290 #ifndef MAX_SKIN_IMAGE_CACHE_ITEM_RAM_COPY_PACKED_SIZE
291 #define MAX_SKIN_IMAGE_CACHE_ITEM_RAM_COPY_PACKED_SIZE 10000
292 #endif
293 
294 
295 // Caching and MMAP options
296 
297 /// minimal document size to enable caching for
298 #ifndef DOCUMENT_CACHING_MIN_SIZE
299 #define DOCUMENT_CACHING_MIN_SIZE 0x10000 // 64K
300 #endif
301 
302 /// max ram data block usage, after which swapping to disk should occur
303 #ifndef DOCUMENT_CACHING_MAX_RAM_USAGE
304 #define DOCUMENT_CACHING_MAX_RAM_USAGE 0x800000 // 10Mb
305 #endif
306 
307 /// Document caching file size threshold (bytes). For longer documents, swapping to disk should occur
308 #ifndef DOCUMENT_CACHING_SIZE_THRESHOLD
309 #define DOCUMENT_CACHING_SIZE_THRESHOLD 0x100000 // 1Mb
310 #endif
311 
312 #ifndef ENABLE_ANTIWORD
313 #define ENABLE_ANTIWORD 1
314 #endif
315 
316 #ifndef ARBITRARY_IMAGE_SCALE_ENABLED
317 #define ARBITRARY_IMAGE_SCALE_ENABLED 1
318 #endif
319 
320 #ifndef MAX_IMAGE_SCALE_MUL
321 #define MAX_IMAGE_SCALE_MUL 2
322 #endif
323 
324 #ifndef USE_GLYPHCACHE_HASHTABLE
325 #define USE_GLYPHCACHE_HASHTABLE 0
326 #endif
327 
328 #ifndef USE_LIMITED_FONT_SIZES_SET
329 #define USE_LIMITED_FONT_SIZES_SET 1
330 #endif
331 
332 // Maximum & minimum screen resolution
333 #ifndef SCREEN_SIZE_MIN
334 #define SCREEN_SIZE_MIN 80
335 #endif
336 
337 #ifndef SCREEN_SIZE_MAX
338 #define SCREEN_SIZE_MAX 32767
339 #endif
340 
341 #endif//CRSETUP_H_INCLUDED
342