2 * Copyright (C) 2004, 2005, 2006 Apple Inc.
3 * Copyright (C) 2009 Google Inc. All rights reserved.
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.
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.
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.
22 #if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
23 #ifdef BUILDING_WITH_CMAKE
24 #include "cmakeconfig.h"
26 #include "autotoolsconfig.h"
30 #include <wtf/Platform.h>
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)
36 #define JS_EXPORTDATA __declspec(dllimport)
38 #if defined(BUILDING_WebCore) || defined(BUILDING_WebKit)
39 #define WEBKIT_EXPORTDATA __declspec(dllexport)
41 #define WEBKIT_EXPORTDATA __declspec(dllimport)
43 #define JS_EXPORTCLASS JS_EXPORTDATA
46 #define JS_EXPORTCLASS
47 #define WEBKIT_EXPORTDATA
51 #define HAVE_FUNC_USLEEP 1
52 #endif /* __APPLE__ */
57 #define _WIN32_WINNT 0x0500
64 // If we don't define these, they get defined in windef.h.
65 // We want to use std::min and std::max.
73 // CURL needs winsock, so don't prevent inclusion of it
76 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
80 #endif /* OS(WINDOWS) */
82 // ANDROID def should be after all PLATFORM to avoid override.
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
88 #include <JavaScriptCore/config.h>
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
102 #define ENABLE_VIDEO 1
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
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
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
133 #undef ENABLE_APPLICATION_INSTALLED
134 #define ENABLE_APPLICATION_INSTALLED 1
136 #define ENABLE_ANDROID_INSTALLABLE_WEB_APPS 1
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
142 #define ENABLE_FILE_READER 1
143 #define ENABLE_BLOB 1
145 #define ANDROID_FLATTEN_FRAMESET
146 #define ANDROID_FLATTEN_IFRAME
148 #define ANDROID_LAYOUT
152 // Ensure that the fixed elements are always relative to the top document.
153 #define ANDROID_FIXED_ELEMENTS
155 // Passes the webkit-originated changes of a focused textfield to our UI
157 #define ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
159 #define ANDROID_META_SUPPORT
161 // Converts ListBoxes to dropdown popup lists.
162 #define ANDROID_LISTBOX_USES_MENU_LIST
164 #define ANDROID_MULTIPLE_WINDOWS
165 #define ANDROID_CSS_RING
166 #define ANDROID_CSS_TAP_HIGHLIGHT_COLOR
168 #define ANDROID_BLOCK_NETWORK_IMAGE
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
175 // This enables a portable implementation of NPN_[Un]ScheduleTimer
176 // Will submit this as a patch to apple
177 #define PLUGIN_SCHEDULE_TIMER
179 // This adds platformInit() and platformSetValue() to pluginview
180 // Will submit this as a patch to apple
181 #define PLUGIN_PLATFORM_SETVALUE
183 // This enables logging the DOM tree, Render tree even for the release build
184 #define ANDROID_DOM_LOGGING
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
190 // Enable dumping the display tree to a file (triggered in WebView.java)
191 #define ANDROID_DUMP_DISPLAY_TREE
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
199 // Animated GIF support.
200 #define ANDROID_ANIMATED_GIF
202 // apple-touch-icon support in <link> tags
203 #define ANDROID_APPLE_TOUCH_ICON
205 // Enable prefetching when specified via the rel element of <link> elements.
206 #define ENABLE_LINK_PREFETCH 1
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
212 #if !defined(WTF_USE_CHROME_NETWORK_STACK)
213 #define WTF_USE_CHROME_NETWORK_STACK 0
214 #endif /* !defined(WTF_USE_CHROME_NETWORK_STACK) */
216 #endif /* PLATFORM(ANDROID) */
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".
224 #include <wtf/FastMalloc.h>
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.
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>
242 #define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
243 #elif !COMPILER(WINSCW)
244 #define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
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
254 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
257 #define WTF_PLATFORM_CG 1
258 #undef WTF_PLATFORM_CAIRO
259 #define WTF_USE_CFNETWORK 1
266 #define WTF_USE_NEW_THEME 1
267 #endif // PLATFORM(MAC)
270 #define USE_SYSTEM_MALLOC 1
273 #if PLATFORM(CHROMIUM)
276 // Define SKIA on non-Mac.
277 #define WTF_PLATFORM_SKIA 1
278 #endif /* !OS(DARWIN) */
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
285 #define WTF_USE_GOOGLEURL 1
287 #if !defined(WTF_USE_V8)
291 #undef WTF_USE_CFNETWORK
293 #endif /* PLATFORM(CHROMIUM) */
295 #if !defined(WTF_USE_V8)
297 #endif /* !defined(WTF_USE_V8) */
299 /* Using V8 implies not using JSC and vice versa */
300 #if !defined(WTF_USE_JSC)
301 #define WTF_USE_JSC !WTF_USE_V8
305 #ifndef CGFLOAT_DEFINED
307 typedef double CGFloat;
309 typedef float CGFloat;
311 #define CGFLOAT_DEFINED 1
313 #endif /* PLATFORM(CG) */
315 #ifdef BUILDING_ON_TIGER
317 #define ENABLE_FTPDIR 0
320 #if PLATFORM(WIN) && PLATFORM(CG)
321 #define WTF_USE_SAFARI_THEME 1
324 #if PLATFORM(QT) && USE(V8) && defined(Q_WS_X11)
325 /* protect ourselves from evil X11 defines */
326 #include <bridge/npruntime_internal.h>