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 #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
96 #define ENABLE_3D_RENDERING 0
97 #define ENABLE_VIDEO 1
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
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
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
129 #define ENABLE_ANDROID_INSTALLABLE_WEB_APPS 1
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
135 #define ENABLE_FILE_READER 1
136 #define ENABLE_BLOB_SLICE 1
138 #define ANDROID_FLATTEN_FRAMESET
139 #define ANDROID_FLATTEN_IFRAME
141 #define ANDROID_LAYOUT
145 // Ensure that the fixed elements are always relative to the top document.
146 #define ANDROID_FIXED_ELEMENTS
148 // Passes the webkit-originated changes of a focused textfield to our UI
150 #define ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
152 #define ANDROID_META_SUPPORT
154 // Converts ListBoxes to dropdown popup lists.
155 #define ANDROID_LISTBOX_USES_MENU_LIST
157 #define ANDROID_MULTIPLE_WINDOWS
158 #define ANDROID_CSS_TAP_HIGHLIGHT_COLOR
160 #define ANDROID_BLOCK_NETWORK_IMAGE
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
167 // This enables a portable implementation of NPN_[Un]ScheduleTimer
168 // Will submit this as a patch to apple
169 #define PLUGIN_SCHEDULE_TIMER
171 // This adds platformInit() and platformSetValue() to pluginview
172 // Will submit this as a patch to apple
173 #define PLUGIN_PLATFORM_SETVALUE
175 // This enables logging the DOM tree, Render tree even for the release build
176 #define ANDROID_DOM_LOGGING
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
182 // Enable dumping the display tree to a file (triggered in WebView.java)
183 #define ANDROID_DUMP_DISPLAY_TREE
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
191 // Animated GIF support.
192 #define ANDROID_ANIMATED_GIF
194 // apple-touch-icon support in <link> tags
195 #define ANDROID_APPLE_TOUCH_ICON
197 // Enable prefetching when specified via the rel element of <link> elements.
198 #define ENABLE_LINK_PREFETCH 1
200 // Enable hit test with point plus a size
201 #define ANDROID_HITTEST_WITHSIZE
204 #endif /* PLATFORM(ANDROID) */
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".
212 #include <wtf/FastMalloc.h>
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.
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>
230 #define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
231 #elif !COMPILER(WINSCW)
232 #define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
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
242 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
245 #define WTF_PLATFORM_CG 1
246 #undef WTF_PLATFORM_CAIRO
247 #define WTF_USE_CFNETWORK 1
250 #undef WTF_USE_WININET
251 #define WTF_PLATFORM_CF 1
252 #define WTF_USE_PTHREADS 0
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
261 #define WTF_USE_ATSUI 1
262 #define WTF_USE_CORE_TEXT 0
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