OSDN Git Service

Merge "Code cleanup for FontCacheAndroid.cpp"
[android-x86/external-webkit.git] / WebCore / config.h
1 /*
2  * Copyright (C) 2004, 2005, 2006 Apple Inc.
3  * Copyright (C) 2009 Google Inc. All rights reserved.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB.  If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  *
20  */
21
22 #if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
23 #ifdef BUILDING_WITH_CMAKE
24 #include "cmakeconfig.h"
25 #else
26 #include "autotoolsconfig.h"
27 #endif
28 #endif
29
30 #include <wtf/Platform.h>
31
32 #if !PLATFORM(CHROMIUM) && OS(WINDOWS) && !defined(BUILDING_WX__) && !COMPILER(GCC)
33 #if defined(BUILDING_JavaScriptCore) || defined(BUILDING_WTF)
34 #define JS_EXPORTDATA __declspec(dllexport)
35 #else
36 #define JS_EXPORTDATA __declspec(dllimport)
37 #endif
38 #if defined(BUILDING_WebCore) || defined(BUILDING_WebKit)
39 #define WEBKIT_EXPORTDATA __declspec(dllexport)
40 #else
41 #define WEBKIT_EXPORTDATA __declspec(dllimport)
42 #endif
43 #define JS_EXPORTCLASS JS_EXPORTDATA
44 #else
45 #define JS_EXPORTDATA
46 #define JS_EXPORTCLASS
47 #define WEBKIT_EXPORTDATA
48 #endif
49
50 #ifdef __APPLE__
51 #define HAVE_FUNC_USLEEP 1
52 #endif /* __APPLE__ */
53
54 #if OS(WINDOWS)
55
56 #ifndef _WIN32_WINNT
57 #define _WIN32_WINNT 0x0500
58 #endif
59
60 #ifndef WINVER
61 #define WINVER 0x0500
62 #endif
63
64 // If we don't define these, they get defined in windef.h.
65 // We want to use std::min and std::max.
66 #ifndef max
67 #define max max
68 #endif
69 #ifndef min
70 #define min min
71 #endif
72
73 // CURL needs winsock, so don't prevent inclusion of it
74 #if !USE(CURL)
75 #ifndef _WINSOCKAPI_
76 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
77 #endif
78 #endif
79
80 #endif /* OS(WINDOWS) */
81
82 // ANDROID def should be after all PLATFORM to avoid override.
83 #if PLATFORM(ANDROID)
84 // Android uses a single set of include directories when building WebKit and
85 // JavaScriptCore. Since WebCore/ is included before JavaScriptCore/, Android
86 // includes JavaScriptCore/config.h explicitly here to make sure it gets picked
87 // up.
88 #include <JavaScriptCore/config.h>
89
90 #define WEBCORE_NAVIGATOR_VENDOR "Google Inc."
91 // This must be defined before we include FastMalloc.h, below.
92 #define USE_SYSTEM_MALLOC 1
93 #define LOG_DISABLED 1
94 #include <wtf/Assertions.h>
95 // Central place to set which optional features Android uses.
96 #define ENABLE_DOM_STORAGE 1
97 #undef ENABLE_FTPDIR  // Enabled by default in Platform.h
98 #define ENABLE_FTPDIR 0
99 #ifndef ENABLE_SVG
100 #define ENABLE_SVG 0
101 #endif
102 #define ENABLE_VIDEO 1
103
104 #if ENABLE_SVG
105 #if !defined(ENABLE_SVG_ANIMATION)
106 #define ENABLE_SVG_ANIMATION 0 // to enable:
107     // fix error: no matching function for call to 'sort(WebCore::SVGSMILElement**, WebCore::SVGSMILElement**, WebCore::PriorityCompare)'
108     // fix error: no matching function for call to 'sort(WebCore::SMILTime*, WebCore::SMILTime*)'
109     // add ENABLE_SVG_ANIMATION=1 to SVG_FLAGS in JavaScriptCore.derived.mk
110 #endif
111 #define ENABLE_SVG_AS_IMAGE 1
112 #define ENABLE_SVG_FILTERS 1
113 #define ENABLE_SVG_FONTS 1
114 #define ENABLE_SVG_FOREIGN_OBJECT 1
115 #define ENABLE_SVG_USE 1
116 #endif
117
118 #define ENABLE_XBL 0
119 #define ENABLE_XHTMLMP 0
120 #define ENABLE_XPATH 1
121 #define ENABLE_XSLT 1
122 #undef ENABLE_ARCHIVE // Enabled by default in Platform.h
123 #define ENABLE_ARCHIVE 1
124 #define ENABLE_OFFLINE_WEB_APPLICATIONS 1
125 #define ENABLE_TOUCH_EVENTS 1
126 #undef ENABLE_GEOLOCATION  // Disabled by default in Platform.h
127 #define ENABLE_GEOLOCATION 1
128 #undef ENABLE_INSPECTOR  // Enabled by default in Platform.h
129 #define ENABLE_INSPECTOR 0
130 #define ENABLE_EVENT_SOURCE 0
131 #define ENABLE_DEVICE_ORIENTATION 1
132
133 #undef ENABLE_APPLICATION_INSTALLED
134 #define ENABLE_APPLICATION_INSTALLED 1
135
136 #define ENABLE_ANDROID_INSTALLABLE_WEB_APPS 1
137
138 // Uses composited RenderLayers for fixed elements
139 #undef ENABLE_COMPOSITED_FIXED_ELEMENTS // Disabled by default in Platform.h
140 #define ENABLE_COMPOSITED_FIXED_ELEMENTS 1
141
142 #define ENABLE_FILE_READER 1
143 #define ENABLE_BLOB 1
144
145 #define ANDROID_FLATTEN_FRAMESET
146 #define ANDROID_FLATTEN_IFRAME
147
148 #define ANDROID_LAYOUT
149
150 #define ANDROID_FIX
151
152 // Ensure that the fixed elements are always relative to the top document.
153 #define ANDROID_FIXED_ELEMENTS
154
155 // Passes the webkit-originated changes of a focused textfield to our UI
156 // thread
157 #define ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
158
159 #define ANDROID_META_SUPPORT
160
161 // Converts ListBoxes to dropdown popup lists.
162 #define ANDROID_LISTBOX_USES_MENU_LIST
163
164 #define ANDROID_MULTIPLE_WINDOWS
165 #define ANDROID_CSS_RING
166 #define ANDROID_CSS_TAP_HIGHLIGHT_COLOR
167
168 #define ANDROID_BLOCK_NETWORK_IMAGE
169
170 // Changes needed to support native plugins (npapi.h). If the change is generic,
171 // it may be under a different #define (see: PLUGIN_PLATFORM_SETVALUE,
172 // PLUGIN_SCHEDULE_TIMER)
173 #define ANDROID_PLUGINS
174
175 // This enables a portable implementation of NPN_[Un]ScheduleTimer
176 // Will submit this as a patch to apple
177 #define PLUGIN_SCHEDULE_TIMER
178
179 // This adds platformInit() and platformSetValue() to pluginview
180 // Will submit this as a patch to apple
181 #define PLUGIN_PLATFORM_SETVALUE
182
183 // This enables logging the DOM tree, Render tree even for the release build
184 #define ANDROID_DOM_LOGGING
185
186 // Notify WebViewCore when a clipped out rectangle is drawn,
187 // so that all invals are captured by the display tree.
188 #define ANDROID_CAPTURE_OFFSCREEN_PAINTS
189
190 // Enable dumping the display tree to a file (triggered in WebView.java)
191 #define ANDROID_DUMP_DISPLAY_TREE
192
193 // Allow webkit to initiate scroll when going to an anchor on a page
194 // The implementation is not acceptable to webkit. Either scrollRectToVisible
195 // needs additional flavor or parameter to know that it can't be ignored,
196 // and/or script engine must keep whether event was user initiated.
197 #define ANDROID_SCROLL_ON_GOTO_ANCHOR
198
199 // Animated GIF support.
200 #define ANDROID_ANIMATED_GIF
201
202 // apple-touch-icon support in <link> tags
203 #define ANDROID_APPLE_TOUCH_ICON
204
205 // Enable prefetching when specified via the rel element of <link> elements.
206 #define ENABLE_LINK_PREFETCH 1
207
208 // Enable scrollable divs in separate layers.  This might be upstreamed to
209 // webkit.org but for now, it is just an Android feature.
210 #define ENABLE_ANDROID_OVERFLOW_SCROLL 1
211
212 #if !defined(WTF_USE_CHROME_NETWORK_STACK)
213 #define WTF_USE_CHROME_NETWORK_STACK 0
214 #endif /* !defined(WTF_USE_CHROME_NETWORK_STACK) */
215
216 #endif /* PLATFORM(ANDROID) */
217
218 #ifdef __cplusplus
219
220 // These undefs match up with defines in WebCorePrefix.h for Mac OS X.
221 // Helps us catch if anyone uses new or delete by accident in code and doesn't include "config.h".
222 #undef new
223 #undef delete
224 #include <wtf/FastMalloc.h>
225
226 #endif
227
228 // On MSW, wx headers need to be included before windows.h is.
229 // The only way we can always ensure this is if we include wx here.
230 #if PLATFORM(WX)
231 #include <wx/defs.h>
232 #endif
233
234 // this breaks compilation of <QFontDatabase>, at least, so turn it off for now
235 // Also generates errors on wx on Windows, presumably because these functions
236 // are used from wx headers.
237 #if !PLATFORM(QT) && !PLATFORM(WX) && !PLATFORM(CHROMIUM)
238 #include <wtf/DisallowCType.h>
239 #endif
240
241 #if COMPILER(MSVC)
242 #define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
243 #elif !COMPILER(WINSCW)
244 #define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
245 #endif
246
247 #if PLATFORM(WIN)
248 #if defined(WIN_CAIRO)
249 #undef WTF_PLATFORM_CG
250 #define WTF_PLATFORM_CAIRO 1
251 #undef WTF_USE_CFNETWORK
252 #define WTF_USE_CURL 1
253 #ifndef _WINSOCKAPI_
254 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
255 #endif
256 #else
257 #define WTF_PLATFORM_CG 1
258 #undef WTF_PLATFORM_CAIRO
259 #define WTF_USE_CFNETWORK 1
260 #undef WTF_USE_CURL
261 #endif
262 #endif
263
264 #if PLATFORM(MAC)
265 // New theme
266 #define WTF_USE_NEW_THEME 1
267 #endif // PLATFORM(MAC)
268
269 #if OS(SYMBIAN)
270 #define USE_SYSTEM_MALLOC 1
271 #endif
272
273 #if PLATFORM(CHROMIUM)
274
275 #if !OS(DARWIN)
276 // Define SKIA on non-Mac.
277 #define WTF_PLATFORM_SKIA 1
278 #endif /* !OS(DARWIN) */
279
280 // Chromium uses this file instead of JavaScriptCore/config.h to compile
281 // JavaScriptCore/wtf (chromium doesn't compile the rest of JSC). Therefore,
282 // this define is required.
283 #define WTF_CHANGES 1
284
285 #define WTF_USE_GOOGLEURL 1
286
287 #if !defined(WTF_USE_V8)
288 #define WTF_USE_V8 1
289 #endif
290
291 #undef WTF_USE_CFNETWORK
292
293 #endif /* PLATFORM(CHROMIUM) */
294
295 #if !defined(WTF_USE_V8)
296 #define WTF_USE_V8 0
297 #endif /* !defined(WTF_USE_V8) */
298
299 /* Using V8 implies not using JSC and vice versa */
300 #if !defined(WTF_USE_JSC)
301 #define WTF_USE_JSC !WTF_USE_V8
302 #endif
303
304 #if PLATFORM(CG)
305 #ifndef CGFLOAT_DEFINED
306 #ifdef __LP64__
307 typedef double CGFloat;
308 #else
309 typedef float CGFloat;
310 #endif
311 #define CGFLOAT_DEFINED 1
312 #endif
313 #endif /* PLATFORM(CG) */
314
315 #ifdef BUILDING_ON_TIGER
316 #undef ENABLE_FTPDIR
317 #define ENABLE_FTPDIR 0
318 #endif
319
320 #if PLATFORM(WIN) && PLATFORM(CG)
321 #define WTF_USE_SAFARI_THEME 1
322 #endif
323
324 #if PLATFORM(QT) && USE(V8) && defined(Q_WS_X11)
325 /* protect ourselves from evil X11 defines */
326 #include <bridge/npruntime_internal.h>
327 #endif