OSDN Git Service

9a3cd78fd3ba779d0cc3025f6fe4668126d602f9
[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 #define WEBCORE_NAVIGATOR_VENDOR "Google Inc."
85 // This must be defined before we include FastMalloc.h, below.
86 #define USE_SYSTEM_MALLOC 1
87 #define LOG_DISABLED 1
88 #include <wtf/Assertions.h>
89 // Central place to set which optional features Android uses.
90 #define ENABLE_DOM_STORAGE 1
91 #undef ENABLE_FTPDIR  // Enabled by default in Platform.h
92 #define ENABLE_FTPDIR 0
93 #ifndef ENABLE_SVG
94 #define ENABLE_SVG 0
95 #endif
96 #define ENABLE_3D_RENDERING 0
97 #define ENABLE_VIDEO 1
98
99 #if ENABLE_SVG
100 #if !defined(ENABLE_SVG_ANIMATION)
101 #define ENABLE_SVG_ANIMATION 0 // to enable:
102     // fix error: no matching function for call to 'sort(WebCore::SVGSMILElement**, WebCore::SVGSMILElement**, WebCore::PriorityCompare)'
103     // fix error: no matching function for call to 'sort(WebCore::SMILTime*, WebCore::SMILTime*)'
104     // add ENABLE_SVG_ANIMATION=1 to SVG_FLAGS in JavaScriptCore.derived.mk
105 #endif
106 #define ENABLE_SVG_AS_IMAGE 1
107 #define ENABLE_SVG_FILTERS 1
108 #define ENABLE_SVG_FONTS 1
109 #define ENABLE_SVG_FOREIGN_OBJECT 1
110 #define ENABLE_SVG_USE 1
111 #endif
112
113 #define ENABLE_XBL 0
114 #define ENABLE_XHTMLMP 0
115 #define ENABLE_XPATH 1
116 #define ENABLE_XSLT 1
117 #undef ENABLE_ARCHIVE  // Enabled by default in Platform.h
118 #define ENABLE_ARCHIVE 1
119 #define ENABLE_OFFLINE_WEB_APPLICATIONS 1
120 #define ENABLE_TOUCH_EVENTS 1
121 #undef ENABLE_GEOLOCATION  // Disabled by default in Platform.h
122 #define ENABLE_GEOLOCATION 1
123 #undef ENABLE_INSPECTOR  // Enabled by default in Platform.h
124 #define ENABLE_INSPECTOR 0
125 #define ENABLE_EVENT_SOURCE 0
126 #undef ENABLE_APPLICATION_INSTALLED
127 #define ENABLE_APPLICATION_INSTALLED 1
128
129 #define ENABLE_ANDROID_INSTALLABLE_WEB_APPS 1
130
131 // Uses composited RenderLayers for fixed elements
132 #undef ENABLE_COMPOSITED_FIXED_ELEMENTS // Disabled by default in Platform.h
133 #define ENABLE_COMPOSITED_FIXED_ELEMENTS 1
134
135 #define ENABLE_FILE_READER 1
136 #define ENABLE_BLOB_SLICE 1
137
138 #define ANDROID_FLATTEN_FRAMESET
139 #define ANDROID_FLATTEN_IFRAME
140
141 #define ANDROID_LAYOUT
142
143 #define ANDROID_FIX
144
145 // Ensure that the fixed elements are always relative to the top document.
146 #define ANDROID_FIXED_ELEMENTS
147
148 // Passes the webkit-originated changes of a focused textfield to our UI
149 // thread
150 #define ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
151
152 #define ANDROID_META_SUPPORT
153
154 // Converts ListBoxes to dropdown popup lists.
155 #define ANDROID_LISTBOX_USES_MENU_LIST
156
157 #define ANDROID_MULTIPLE_WINDOWS
158 #define ANDROID_CSS_TAP_HIGHLIGHT_COLOR
159
160 #define ANDROID_BLOCK_NETWORK_IMAGE
161
162 // Changes needed to support native plugins (npapi.h). If the change is generic,
163 // it may be under a different #define (see: PLUGIN_PLATFORM_SETVALUE,
164 // PLUGIN_SCHEDULE_TIMER)
165 #define ANDROID_PLUGINS
166
167 // This enables a portable implementation of NPN_[Un]ScheduleTimer
168 // Will submit this as a patch to apple
169 #define PLUGIN_SCHEDULE_TIMER
170
171 // This adds platformInit() and platformSetValue() to pluginview
172 // Will submit this as a patch to apple
173 #define PLUGIN_PLATFORM_SETVALUE
174
175 // This enables logging the DOM tree, Render tree even for the release build
176 #define ANDROID_DOM_LOGGING
177
178 // Notify WebViewCore when a clipped out rectangle is drawn,
179 // so that all invals are captured by the display tree.
180 #define ANDROID_CAPTURE_OFFSCREEN_PAINTS
181
182 // Enable dumping the display tree to a file (triggered in WebView.java)
183 #define ANDROID_DUMP_DISPLAY_TREE
184
185 // Allow webkit to initiate scroll when going to an anchor on a page
186 // The implementation is not acceptable to webkit. Either scrollRectToVisible
187 // needs additional flavor or parameter to know that it can't be ignored,
188 // and/or script engine must keep whether event was user initiated.
189 #define ANDROID_SCROLL_ON_GOTO_ANCHOR
190
191 // Animated GIF support.
192 #define ANDROID_ANIMATED_GIF
193
194 // apple-touch-icon support in <link> tags
195 #define ANDROID_APPLE_TOUCH_ICON
196
197 // Enable prefetching when specified via the rel element of <link> elements.
198 #define ENABLE_LINK_PREFETCH 1
199
200 // Enable hit test with point plus a size
201 #define ANDROID_HITTEST_WITHSIZE
202
203
204 #endif /* PLATFORM(ANDROID) */
205
206 #ifdef __cplusplus
207
208 // These undefs match up with defines in WebCorePrefix.h for Mac OS X.
209 // Helps us catch if anyone uses new or delete by accident in code and doesn't include "config.h".
210 #undef new
211 #undef delete
212 #include <wtf/FastMalloc.h>
213
214 #endif
215
216 // On MSW, wx headers need to be included before windows.h is.
217 // The only way we can always ensure this is if we include wx here.
218 #if PLATFORM(WX)
219 #include <wx/defs.h>
220 #endif
221
222 // this breaks compilation of <QFontDatabase>, at least, so turn it off for now
223 // Also generates errors on wx on Windows, presumably because these functions
224 // are used from wx headers.
225 #if !PLATFORM(QT) && !PLATFORM(WX) && !PLATFORM(CHROMIUM)
226 #include <wtf/DisallowCType.h>
227 #endif
228
229 #if COMPILER(MSVC)
230 #define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
231 #elif !COMPILER(WINSCW)
232 #define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
233 #endif
234
235 #if PLATFORM(WIN)
236 #if defined(WIN_CAIRO)
237 #undef WTF_PLATFORM_CG
238 #define WTF_PLATFORM_CAIRO 1
239 #undef WTF_USE_CFNETWORK
240 #define WTF_USE_CURL 1
241 #ifndef _WINSOCKAPI_
242 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
243 #endif
244 #else
245 #define WTF_PLATFORM_CG 1
246 #undef WTF_PLATFORM_CAIRO
247 #define WTF_USE_CFNETWORK 1
248 #undef WTF_USE_CURL
249 #endif
250 #undef WTF_USE_WININET
251 #define WTF_PLATFORM_CF 1
252 #define WTF_USE_PTHREADS 0
253 #endif
254
255 #if PLATFORM(MAC)
256 // ATSUI vs. CoreText
257 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
258 #define WTF_USE_ATSUI 0
259 #define WTF_USE_CORE_TEXT 1
260 #else
261 #define WTF_USE_ATSUI 1
262 #define WTF_USE_CORE_TEXT 0
263 #endif
264
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