819f5eb809dc7e375de20d5114f2f3aee4a9283a
[WebKit-https.git] / Source / WebCore / PlatformGTK.cmake
1 include(platform/GStreamer.cmake)
2 include(platform/ImageDecoders.cmake)
3 include(platform/Linux.cmake)
4 include(platform/TextureMapper.cmake)
5
6 set(WebCore_OUTPUT_NAME WebCoreGTK)
7
8 list(APPEND WebCore_INCLUDE_DIRECTORIES
9     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
10     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector"
11     "${JAVASCRIPTCORE_DIR}"
12     "${JAVASCRIPTCORE_DIR}/ForwardingHeaders"
13     "${JAVASCRIPTCORE_DIR}/API"
14     "${JAVASCRIPTCORE_DIR}/assembler"
15     "${JAVASCRIPTCORE_DIR}/bytecode"
16     "${JAVASCRIPTCORE_DIR}/bytecompiler"
17     "${JAVASCRIPTCORE_DIR}/dfg"
18     "${JAVASCRIPTCORE_DIR}/disassembler"
19     "${JAVASCRIPTCORE_DIR}/heap"
20     "${JAVASCRIPTCORE_DIR}/debugger"
21     "${JAVASCRIPTCORE_DIR}/interpreter"
22     "${JAVASCRIPTCORE_DIR}/jit"
23     "${JAVASCRIPTCORE_DIR}/llint"
24     "${JAVASCRIPTCORE_DIR}/parser"
25     "${JAVASCRIPTCORE_DIR}/profiler"
26     "${JAVASCRIPTCORE_DIR}/runtime"
27     "${JAVASCRIPTCORE_DIR}/yarr"
28     "${THIRDPARTY_DIR}/ANGLE/"
29     "${THIRDPARTY_DIR}/ANGLE/include/KHR"
30     "${WEBCORE_DIR}/accessibility/atk"
31     "${WEBCORE_DIR}/editing/atk"
32     "${WEBCORE_DIR}/page/gtk"
33     "${WEBCORE_DIR}/platform/cairo"
34     "${WEBCORE_DIR}/platform/geoclue"
35     "${WEBCORE_DIR}/platform/gtk"
36     "${WEBCORE_DIR}/platform/graphics/cairo"
37     "${WEBCORE_DIR}/platform/graphics/egl"
38     "${WEBCORE_DIR}/platform/graphics/glx"
39     "${WEBCORE_DIR}/platform/graphics/gtk"
40     "${WEBCORE_DIR}/platform/graphics/freetype"
41     "${WEBCORE_DIR}/platform/graphics/harfbuzz/"
42     "${WEBCORE_DIR}/platform/graphics/harfbuzz/ng"
43     "${WEBCORE_DIR}/platform/graphics/opengl"
44     "${WEBCORE_DIR}/platform/graphics/opentype"
45     "${WEBCORE_DIR}/platform/graphics/wayland"
46     "${WEBCORE_DIR}/platform/graphics/x11"
47     "${WEBCORE_DIR}/platform/mock/mediasource"
48     "${WEBCORE_DIR}/platform/network/gtk"
49     "${WEBCORE_DIR}/platform/network/soup"
50     "${WEBCORE_DIR}/platform/text/gtk"
51     "${WTF_DIR}"
52 )
53
54 list(APPEND WebCore_SOURCES
55     accessibility/atk/AXObjectCacheAtk.cpp
56     accessibility/atk/AccessibilityObjectAtk.cpp
57     accessibility/atk/WebKitAccessibleHyperlink.cpp
58     accessibility/atk/WebKitAccessibleInterfaceAction.cpp
59     accessibility/atk/WebKitAccessibleInterfaceComponent.cpp
60     accessibility/atk/WebKitAccessibleInterfaceDocument.cpp
61     accessibility/atk/WebKitAccessibleInterfaceEditableText.cpp
62     accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp
63     accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp
64     accessibility/atk/WebKitAccessibleInterfaceImage.cpp
65     accessibility/atk/WebKitAccessibleInterfaceSelection.cpp
66     accessibility/atk/WebKitAccessibleInterfaceTable.cpp
67     accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp
68     accessibility/atk/WebKitAccessibleInterfaceText.cpp
69     accessibility/atk/WebKitAccessibleInterfaceValue.cpp
70     accessibility/atk/WebKitAccessibleUtil.cpp
71     accessibility/atk/WebKitAccessibleWrapperAtk.cpp
72
73     editing/SmartReplace.cpp
74
75     editing/atk/FrameSelectionAtk.cpp
76
77     loader/soup/CachedRawResourceSoup.cpp
78     loader/soup/SubresourceLoaderSoup.cpp
79
80     platform/KillRingNone.cpp
81     platform/PlatformStrategies.cpp
82
83     platform/audio/glib/AudioBusGLib.cpp
84
85     platform/crypto/gnutls/CryptoDigestGnuTLS.cpp
86
87     platform/geoclue/GeolocationProviderGeoclue1.cpp
88     platform/geoclue/GeolocationProviderGeoclue2.cpp
89
90     platform/glib/KeyedDecoderGlib.cpp
91     platform/glib/KeyedEncoderGlib.cpp
92     platform/glib/MainThreadSharedTimerGLib.cpp
93
94     platform/graphics/GLContext.cpp
95     platform/graphics/GraphicsContext3DPrivate.cpp
96     platform/graphics/ImageSource.cpp
97     platform/graphics/WOFFFileFormat.cpp
98
99     platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp
100     platform/graphics/cairo/BackingStoreBackendCairoX11.cpp
101     platform/graphics/cairo/BitmapImageCairo.cpp
102     platform/graphics/cairo/CairoUtilities.cpp
103     platform/graphics/cairo/FloatRectCairo.cpp
104     platform/graphics/cairo/FontCairo.cpp
105     platform/graphics/cairo/FontCairoHarfbuzzNG.cpp
106     platform/graphics/cairo/GradientCairo.cpp
107     platform/graphics/cairo/GraphicsContext3DCairo.cpp
108     platform/graphics/cairo/GraphicsContextCairo.cpp
109     platform/graphics/cairo/ImageBufferCairo.cpp
110     platform/graphics/cairo/ImageCairo.cpp
111     platform/graphics/cairo/IntRectCairo.cpp
112     platform/graphics/cairo/PathCairo.cpp
113     platform/graphics/cairo/PatternCairo.cpp
114     platform/graphics/cairo/PlatformContextCairo.cpp
115     platform/graphics/cairo/PlatformPathCairo.cpp
116     platform/graphics/cairo/RefPtrCairo.cpp
117     platform/graphics/cairo/TransformationMatrixCairo.cpp
118
119     platform/graphics/egl/GLContextEGL.cpp
120
121     platform/graphics/freetype/FontCacheFreeType.cpp
122     platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp
123     platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp
124     platform/graphics/freetype/SimpleFontDataFreeType.cpp
125
126     platform/graphics/glx/GLContextGLX.cpp
127
128     platform/graphics/gstreamer/ImageGStreamerCairo.cpp
129
130     platform/graphics/harfbuzz/HarfBuzzFace.cpp
131     platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp
132     platform/graphics/harfbuzz/HarfBuzzShaper.cpp
133
134     platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
135     platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
136     platform/graphics/opengl/TemporaryOpenGLSetting.cpp
137
138     platform/graphics/opentype/OpenTypeVerticalData.cpp
139
140     platform/graphics/x11/PlatformDisplayX11.cpp
141     platform/graphics/x11/XUniqueResource.cpp
142
143     platform/gtk/ErrorsGtk.cpp
144     platform/gtk/EventLoopGtk.cpp
145     platform/gtk/FileSystemGtk.cpp
146     platform/gtk/GamepadsGtk.cpp
147     platform/gtk/LanguageGtk.cpp
148     platform/gtk/LoggingGtk.cpp
149     platform/gtk/MIMETypeRegistryGtk.cpp
150     platform/gtk/ScrollAnimatorGtk.cpp
151     platform/gtk/SharedBufferGtk.cpp
152     platform/gtk/TemporaryLinkStubs.cpp
153     platform/gtk/UserAgentGtk.cpp
154
155     platform/image-decoders/cairo/ImageDecoderCairo.cpp
156
157     platform/network/gtk/CredentialBackingStore.cpp
158
159     platform/network/soup/AuthenticationChallengeSoup.cpp
160     platform/network/soup/CertificateInfo.cpp
161     platform/network/soup/CookieJarSoup.cpp
162     platform/network/soup/CookieStorageSoup.cpp
163     platform/network/soup/CredentialStorageSoup.cpp
164     platform/network/soup/DNSSoup.cpp
165     platform/network/soup/GRefPtrSoup.cpp
166     platform/network/soup/NetworkStorageSessionSoup.cpp
167     platform/network/soup/ProxyServerSoup.cpp
168     platform/network/soup/ResourceErrorSoup.cpp
169     platform/network/soup/ResourceHandleSoup.cpp
170     platform/network/soup/ResourceRequestSoup.cpp
171     platform/network/soup/ResourceResponseSoup.cpp
172     platform/network/soup/SocketStreamHandleSoup.cpp
173     platform/network/soup/SoupNetworkSession.cpp
174     platform/network/soup/SynchronousLoaderClientSoup.cpp
175     platform/network/soup/WebKitSoupRequestGeneric.cpp
176
177     platform/soup/PublicSuffixSoup.cpp
178     platform/soup/SharedBufferSoup.cpp
179     platform/soup/URLSoup.cpp
180
181     platform/text/Hyphenation.cpp
182     platform/text/LocaleICU.cpp
183
184     platform/text/enchant/TextCheckerEnchant.cpp
185
186     platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp
187
188     platform/text/hyphen/HyphenationLibHyphen.cpp
189 )
190
191 list(APPEND WebCorePlatformGTK_SOURCES
192     editing/gtk/EditorGtk.cpp
193
194     page/gtk/DragControllerGtk.cpp
195     page/gtk/EventHandlerGtk.cpp
196
197     platform/graphics/PlatformDisplay.cpp
198
199     platform/graphics/freetype/FontPlatformDataFreeType.cpp
200
201     platform/graphics/gtk/ColorGtk.cpp
202     platform/graphics/gtk/GdkCairoUtilities.cpp
203     platform/graphics/gtk/IconGtk.cpp
204     platform/graphics/gtk/ImageBufferGtk.cpp
205     platform/graphics/gtk/ImageGtk.cpp
206
207     platform/gtk/CursorGtk.cpp
208     platform/gtk/DataObjectGtk.cpp
209     platform/gtk/DragDataGtk.cpp
210     platform/gtk/DragImageGtk.cpp
211     platform/gtk/GRefPtrGtk.cpp
212     platform/gtk/GtkUtilities.cpp
213     platform/gtk/GtkVersioning.c
214     platform/gtk/LocalizedStringsGtk.cpp
215     platform/gtk/PasteboardGtk.cpp
216     platform/gtk/PasteboardHelper.cpp
217     platform/gtk/PlatformKeyboardEventGtk.cpp
218     platform/gtk/PlatformMouseEventGtk.cpp
219     platform/gtk/PlatformScreenGtk.cpp
220     platform/gtk/PlatformWheelEventGtk.cpp
221     platform/gtk/ScrollbarThemeGtk.cpp
222     platform/gtk/SoundGtk.cpp
223     platform/gtk/WidgetGtk.cpp
224
225     rendering/RenderThemeGtk.cpp
226 )
227
228 if (USE_GEOCLUE2)
229     list(APPEND WebCore_SOURCES
230         ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c
231     )
232     execute_process(COMMAND pkg-config --variable dbus_interface geoclue-2.0 OUTPUT_VARIABLE GEOCLUE_DBUS_INTERFACE)
233     add_custom_command(
234          OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.h
235          COMMAND gdbus-codegen --interface-prefix org.freedesktop.GeoClue2. --c-namespace Geoclue --generate-c-code ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface ${GEOCLUE_DBUS_INTERFACE}
236     )
237 endif ()
238
239 list(APPEND WebCore_USER_AGENT_STYLE_SHEETS
240     ${WEBCORE_DIR}/css/mediaControlsGtk.css
241 )
242
243 set(WebCore_USER_AGENT_SCRIPTS
244     ${WEBCORE_DIR}/English.lproj/mediaControlsLocalizedStrings.js
245     ${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsBase.js
246     ${WEBCORE_DIR}/Modules/mediacontrols/mediaControlsGtk.js
247 )
248
249 set(WebCore_USER_AGENT_SCRIPTS_DEPENDENCIES ${WEBCORE_DIR}/platform/gtk/RenderThemeGtk.cpp)
250
251 list(APPEND WebCore_LIBRARIES
252     ${ATK_LIBRARIES}
253     ${CAIRO_LIBRARIES}
254     ${ENCHANT_LIBRARIES}
255     ${FONTCONFIG_LIBRARIES}
256     ${FREETYPE2_LIBRARIES}
257     ${GEOCLUE_LIBRARIES}
258     ${GLIB_GIO_LIBRARIES}
259     ${GLIB_GMODULE_LIBRARIES}
260     ${GLIB_GOBJECT_LIBRARIES}
261     ${GLIB_LIBRARIES}
262     ${GNUTLS_LIBRARIES}
263     ${GUDEV_LIBRARIES}
264     ${HARFBUZZ_LIBRARIES}
265     ${LIBSECRET_LIBRARIES}
266     ${LIBSOUP_LIBRARIES}
267     ${LIBXML2_LIBRARIES}
268     ${LIBXSLT_LIBRARIES}
269     ${HYPHEN_LIBRARIES}
270     ${SQLITE_LIBRARIES}
271     ${X11_X11_LIB}
272     ${X11_Xcomposite_LIB}
273     ${X11_Xdamage_LIB}
274     ${X11_Xrender_LIB}
275     ${X11_Xt_LIB}
276     ${ZLIB_LIBRARIES}
277 )
278
279 list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
280     ${ATK_INCLUDE_DIRS}
281     ${CAIRO_INCLUDE_DIRS}
282     ${ENCHANT_INCLUDE_DIRS}
283     ${FREETYPE2_INCLUDE_DIRS}
284     ${GEOCLUE_INCLUDE_DIRS}
285     ${GIO_UNIX_INCLUDE_DIRS}
286     ${GLIB_INCLUDE_DIRS}
287     ${GNUTLS_INCLUDE_DIRS}
288     ${GUDEV_INCLUDE_DIRS}
289     ${HARFBUZZ_INCLUDE_DIRS}
290     ${LIBSECRET_INCLUDE_DIRS}
291     ${LIBSOUP_INCLUDE_DIRS}
292     ${LIBXML2_INCLUDE_DIR}
293     ${LIBXSLT_INCLUDE_DIR}
294     ${SQLITE_INCLUDE_DIR}
295     ${ZLIB_INCLUDE_DIRS}
296 )
297
298 if (USE_OPENGL_ES_2)
299     list(APPEND WebCore_SOURCES
300         platform/graphics/opengl/Extensions3DOpenGLES.cpp
301         platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp
302     )
303 endif ()
304
305 if (USE_OPENGL)
306     list(APPEND WebCore_SOURCES
307         platform/graphics/OpenGLShims.cpp
308
309         platform/graphics/opengl/Extensions3DOpenGL.cpp
310         platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
311     )
312 endif ()
313
314 if (ENABLE_PLUGIN_PROCESS_GTK2)
315     # WebKitPluginProcess2 needs a version of WebCore compiled against GTK+2, so we've isolated all the GTK+
316     # dependent files into a separate library which can be used to construct a GTK+2 WebCore
317     # for the plugin process.
318     add_library(WebCorePlatformGTK2 ${WebCore_LIBRARY_TYPE} ${WebCorePlatformGTK_SOURCES})
319     add_dependencies(WebCorePlatformGTK2 WebCore)
320     WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebCorePlatformGTK2)
321     set_property(TARGET WebCorePlatformGTK2
322         APPEND
323         PROPERTY COMPILE_DEFINITIONS GTK_API_VERSION_2=1
324     )
325     target_include_directories(WebCorePlatformGTK2 PRIVATE
326         ${WebCore_INCLUDE_DIRECTORIES}
327         ${GTK2_INCLUDE_DIRS}
328         ${GDK2_INCLUDE_DIRS}
329     )
330     target_include_directories(WebCorePlatformGTK2 SYSTEM PRIVATE
331         ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
332     )
333     target_link_libraries(WebCorePlatformGTK2
334          ${WebCore_LIBRARIES}
335          ${GTK2_LIBRARIES}
336          ${GDK2_LIBRARIES}
337     )
338 endif ()
339
340 if (ENABLE_WAYLAND_TARGET)
341     # Wayland protocol extension.
342     add_custom_command(
343         OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitGtkWaylandClientProtocol.c
344         DEPENDS ${WEBCORE_DIR}/platform/graphics/wayland/WebKitGtkWaylandClientProtocol.xml
345         COMMAND wayland-scanner server-header < ${WEBCORE_DIR}/platform/graphics/wayland/WebKitGtkWaylandClientProtocol.xml > ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitGtkWaylandServerProtocol.h
346         COMMAND wayland-scanner client-header < ${WEBCORE_DIR}/platform/graphics/wayland/WebKitGtkWaylandClientProtocol.xml > ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitGtkWaylandClientProtocol.h
347         COMMAND wayland-scanner code < ${WEBCORE_DIR}/platform/graphics/wayland/WebKitGtkWaylandClientProtocol.xml > ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitGtkWaylandClientProtocol.c
348     )
349
350     list(APPEND WebCore_SOURCES
351         platform/graphics/wayland/PlatformDisplayWayland.cpp
352         platform/graphics/wayland/WaylandEventSource.cpp
353         platform/graphics/wayland/WaylandSurface.cpp
354
355         ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitGtkWaylandClientProtocol.c
356     )
357
358     list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
359         ${WAYLAND_INCLUDE_DIRS}
360     )
361     list(APPEND WebCore_LIBRARIES
362         ${WAYLAND_LIBRARIES}
363     )
364 endif ()
365
366 add_library(WebCorePlatformGTK ${WebCore_LIBRARY_TYPE} ${WebCorePlatformGTK_SOURCES})
367 add_dependencies(WebCorePlatformGTK WebCore)
368 WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebCorePlatformGTK)
369 target_include_directories(WebCorePlatformGTK PRIVATE
370     ${WebCore_INCLUDE_DIRECTORIES}
371 )
372 target_include_directories(WebCorePlatformGTK SYSTEM PRIVATE
373     ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
374     ${GTK_INCLUDE_DIRS}
375     ${GDK_INCLUDE_DIRS}
376 )
377 target_link_libraries(WebCorePlatformGTK
378     ${WebCore_LIBRARIES}
379     ${GTK_LIBRARIES}
380     ${GDK_LIBRARIES}
381 )
382
383 include_directories(
384     ${WebCore_INCLUDE_DIRECTORIES}
385     "${WEBCORE_DIR}/bindings/gobject/"
386     "${DERIVED_SOURCES_DIR}"
387     "${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}"
388 )
389
390 include_directories(SYSTEM
391     ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
392 )
393
394 list(APPEND GObjectDOMBindings_SOURCES
395     bindings/gobject/ConvertToUTF8String.cpp
396     bindings/gobject/DOMObjectCache.cpp
397     bindings/gobject/GObjectEventListener.cpp
398     bindings/gobject/GObjectNodeFilterCondition.cpp
399     bindings/gobject/GObjectXPathNSResolver.cpp
400     bindings/gobject/WebKitDOMCustom.cpp
401     bindings/gobject/WebKitDOMDeprecated.cpp
402     bindings/gobject/WebKitDOMEventTarget.cpp
403     bindings/gobject/WebKitDOMHTMLPrivate.cpp
404     bindings/gobject/WebKitDOMNodeFilter.cpp
405     bindings/gobject/WebKitDOMObject.cpp
406     bindings/gobject/WebKitDOMPrivate.cpp
407     bindings/gobject/WebKitDOMXPathNSResolver.cpp
408     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomautocleanups.h
409     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomautocleanups-unstable.h
410     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
411     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines-unstable.h
412     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
413 )
414
415 list(APPEND GObjectDOMBindingsStable_IDL_FILES
416     css/CSSRule.idl
417     css/CSSRuleList.idl
418     css/CSSStyleDeclaration.idl
419     css/CSSStyleSheet.idl
420     css/CSSValue.idl
421     css/MediaList.idl
422     css/StyleSheet.idl
423     css/StyleSheetList.idl
424
425     dom/Attr.idl
426     dom/CDATASection.idl
427     dom/CharacterData.idl
428     dom/Comment.idl
429     dom/DOMImplementation.idl
430     dom/Document.idl
431     dom/DocumentFragment.idl
432     dom/DocumentType.idl
433     dom/Element.idl
434     dom/Event.idl
435     dom/KeyboardEvent.idl
436     dom/MouseEvent.idl
437     dom/NamedNodeMap.idl
438     dom/Node.idl
439     dom/NodeIterator.idl
440     dom/NodeList.idl
441     dom/ProcessingInstruction.idl
442     dom/Range.idl
443     dom/Text.idl
444     dom/TreeWalker.idl
445     dom/UIEvent.idl
446     dom/WheelEvent.idl
447
448     fileapi/Blob.idl
449     fileapi/File.idl
450     fileapi/FileList.idl
451
452     html/HTMLAnchorElement.idl
453     html/HTMLAppletElement.idl
454     html/HTMLAreaElement.idl
455     html/HTMLBRElement.idl
456     html/HTMLBaseElement.idl
457     html/HTMLBodyElement.idl
458     html/HTMLButtonElement.idl
459     html/HTMLCanvasElement.idl
460     html/HTMLCollection.idl
461     html/HTMLDListElement.idl
462     html/HTMLDirectoryElement.idl
463     html/HTMLDivElement.idl
464     html/HTMLDocument.idl
465     html/HTMLElement.idl
466     html/HTMLEmbedElement.idl
467     html/HTMLFieldSetElement.idl
468     html/HTMLFontElement.idl
469     html/HTMLFormElement.idl
470     html/HTMLFrameElement.idl
471     html/HTMLFrameSetElement.idl
472     html/HTMLHRElement.idl
473     html/HTMLHeadElement.idl
474     html/HTMLHeadingElement.idl
475     html/HTMLHtmlElement.idl
476     html/HTMLIFrameElement.idl
477     html/HTMLImageElement.idl
478     html/HTMLInputElement.idl
479     html/HTMLLIElement.idl
480     html/HTMLLabelElement.idl
481     html/HTMLLegendElement.idl
482     html/HTMLLinkElement.idl
483     html/HTMLMapElement.idl
484     html/HTMLMarqueeElement.idl
485     html/HTMLMenuElement.idl
486     html/HTMLMetaElement.idl
487     html/HTMLModElement.idl
488     html/HTMLOListElement.idl
489     html/HTMLObjectElement.idl
490     html/HTMLOptGroupElement.idl
491     html/HTMLOptionElement.idl
492     html/HTMLOptionsCollection.idl
493     html/HTMLParagraphElement.idl
494     html/HTMLParamElement.idl
495     html/HTMLPreElement.idl
496     html/HTMLQuoteElement.idl
497     html/HTMLScriptElement.idl
498     html/HTMLSelectElement.idl
499     html/HTMLStyleElement.idl
500     html/HTMLTableCaptionElement.idl
501     html/HTMLTableCellElement.idl
502     html/HTMLTableColElement.idl
503     html/HTMLTableElement.idl
504     html/HTMLTableRowElement.idl
505     html/HTMLTableSectionElement.idl
506     html/HTMLTextAreaElement.idl
507     html/HTMLTitleElement.idl
508     html/HTMLUListElement.idl
509
510     page/DOMWindow.idl
511
512     xml/XPathExpression.idl
513     xml/XPathResult.idl
514 )
515
516 list(APPEND GObjectDOMBindingsUnstable_IDL_FILES
517     Modules/battery/BatteryManager.idl
518
519     Modules/gamepad/deprecated/Gamepad.idl
520     Modules/gamepad/deprecated/GamepadList.idl
521
522     Modules/geolocation/Geolocation.idl
523
524     Modules/mediasource/VideoPlaybackQuality.idl
525
526     Modules/mediastream/MediaDevices.idl
527     Modules/mediastream/NavigatorMediaDevices.idl
528     Modules/mediastream/MediaTrackSupportedConstraints.idl
529
530     Modules/quota/StorageInfo.idl
531     Modules/quota/StorageQuota.idl
532
533     Modules/speech/DOMWindowSpeechSynthesis.idl
534     Modules/speech/SpeechSynthesis.idl
535     Modules/speech/SpeechSynthesisEvent.idl
536     Modules/speech/SpeechSynthesisUtterance.idl
537     Modules/speech/SpeechSynthesisVoice.idl
538
539     Modules/webdatabase/Database.idl
540
541     css/DOMWindowCSS.idl
542     css/MediaQueryList.idl
543     css/StyleMedia.idl
544
545     dom/DOMNamedFlowCollection.idl
546     dom/DOMStringList.idl
547     dom/DOMStringMap.idl
548     dom/MessagePort.idl
549     dom/Touch.idl
550     dom/WebKitNamedFlow.idl
551
552     html/DOMTokenList.idl
553     html/HTMLDetailsElement.idl
554     html/HTMLKeygenElement.idl
555     html/HTMLMediaElement.idl
556     html/MediaController.idl
557     html/MediaError.idl
558     html/TimeRanges.idl
559     html/ValidityState.idl
560
561     loader/appcache/DOMApplicationCache.idl
562
563     page/BarProp.idl
564     page/DOMSelection.idl
565     page/History.idl
566     page/Location.idl
567     page/Navigator.idl
568     page/Performance.idl
569     page/PerformanceEntry.idl
570     page/PerformanceEntryList.idl
571     page/PerformanceNavigation.idl
572     page/PerformanceTiming.idl
573     page/Screen.idl
574     page/UserMessageHandler.idl
575     page/UserMessageHandlersNamespace.idl
576     page/WebKitNamespace.idl
577     page/WebKitPoint.idl
578
579     plugins/DOMMimeType.idl
580     plugins/DOMMimeTypeArray.idl
581     plugins/DOMPlugin.idl
582     plugins/DOMPluginArray.idl
583
584     storage/Storage.idl
585 )
586
587 if (ENABLE_WEB_ANIMATIONS)
588     list(APPEND GObjectDOMBindingsUnstable_IDL_FILES
589         animation/AnimationTimeline.idl
590         animation/DocumentAnimation.idl
591         animation/DocumentTimeline.idl
592     )
593 endif ()
594
595 if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
596     list(APPEND GObjectDOMBindingsUnstable_IDL_FILES
597         html/HTMLAudioElement.idl
598         html/HTMLVideoElement.idl
599
600         html/track/AudioTrack.idl
601         html/track/AudioTrackList.idl
602         html/track/DataCue.idl
603         html/track/TextTrack.idl
604         html/track/TextTrackCue.idl
605         html/track/TextTrackCueList.idl
606         html/track/TextTrackList.idl
607         html/track/TrackEvent.idl
608         html/track/VTTCue.idl
609         html/track/VideoTrack.idl
610         html/track/VideoTrackList.idl
611     )
612 endif ()
613
614 if (ENABLE_QUOTA)
615     list(APPEND GObjectDOMBindingsUnstable_IDL_FILES
616         Modules/quota/DOMWindowQuota.idl
617         Modules/quota/NavigatorStorageQuota.idl
618         Modules/quota/StorageErrorCallback.idl
619         Modules/quota/StorageInfo.idl
620         Modules/quota/StorageQuota.idl
621         Modules/quota/StorageQuotaCallback.idl
622         Modules/quota/StorageUsageCallback.idl
623         Modules/quota/WorkerNavigatorStorageQuota.idl
624     )
625 endif ()
626
627 set(GObjectDOMBindings_STATIC_CLASS_LIST Custom Deprecated EventTarget NodeFilter Object XPathNSResolver)
628
629 set(GObjectDOMBindingsStable_CLASS_LIST ${GObjectDOMBindings_STATIC_CLASS_LIST})
630 set(GObjectDOMBindingsStable_INSTALLED_HEADERS
631      ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomautocleanups.h
632      ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
633      ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
634      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMCustom.h
635      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMDeprecated.h
636      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMEventTarget.h
637      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMNodeFilter.h
638      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMObject.h
639      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMXPathNSResolver.h
640 )
641
642 set(GObjectDOMBindingsUnstable_INSTALLED_HEADERS
643      ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomautocleanups-unstable.h
644      ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines-unstable.h
645      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMCustomUnstable.h
646 )
647
648 foreach (file ${GObjectDOMBindingsStable_IDL_FILES})
649     get_filename_component(classname ${file} NAME_WE)
650     list(APPEND GObjectDOMBindingsStable_CLASS_LIST ${classname})
651     list(APPEND GObjectDOMBindingsStable_INSTALLED_HEADERS ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/WebKitDOM${classname}.h)
652     list(APPEND GObjectDOMBindingsUnstable_INSTALLED_HEADERS ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/WebKitDOM${classname}Unstable.h)
653 endforeach ()
654
655 foreach (file ${GObjectDOMBindingsUnstable_IDL_FILES})
656     get_filename_component(classname ${file} NAME_WE)
657     list(APPEND GObjectDOMBindingsUnstable_CLASS_LIST ${classname})
658     list(APPEND GObjectDOMBindingsUnstable_INSTALLED_HEADERS ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/WebKitDOM${classname}.h)
659 endforeach ()
660
661 set(GOBJECT_DOM_BINDINGS_FEATURES_DEFINES "LANGUAGE_GOBJECT=1 ${FEATURE_DEFINES_WITH_SPACE_SEPARATOR}")
662 string(REPLACE "ENABLE_INDEXED_DATABASE=1" "" GOBJECT_DOM_BINDINGS_FEATURES_DEFINES ${GOBJECT_DOM_BINDINGS_FEATURES_DEFINES})
663 string(REPLACE REGEX "ENABLE_SVG[A-Z_]+=1" "" GOBJECT_DOM_BINDINGS_FEATURES_DEFINES ${GOBJECT_DOM_BINDINGS_FEATURES_DEFINES})
664
665 file(MAKE_DIRECTORY ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR})
666
667 add_custom_command(
668     OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
669     DEPENDS ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl
670     COMMAND echo ${GObjectDOMBindingsStable_CLASS_LIST} | ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl defines > ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
671 )
672
673 add_custom_command(
674     OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines-unstable.h
675     DEPENDS ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl
676     COMMAND echo ${GObjectDOMBindingsUnstable_CLASS_LIST} | ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl defines-unstable > ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines-unstable.h
677 )
678
679 add_custom_command(
680     OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
681     DEPENDS ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl
682     COMMAND echo ${GObjectDOMBindingsStable_CLASS_LIST} | ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl gdom > ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
683 )
684
685 add_custom_command(
686     OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomautocleanups.h
687     DEPENDS ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl
688     COMMAND echo ${GObjectDOMBindingsStable_CLASS_LIST} | ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl autocleanups > ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomautocleanups.h
689 )
690
691 add_custom_command(
692     OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomautocleanups-unstable.h
693     DEPENDS ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl
694     COMMAND echo ${GObjectDOMBindingsUnstable_CLASS_LIST} | ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl autocleanups > ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomautocleanups-unstable.h
695 )
696
697 # Some of the static headers are included by generated public headers with include <webkitdom/WebKitDOMFoo.h>.
698 # We need those headers in the derived sources to be in webkitdom directory.
699 set(GObjectDOMBindings_STATIC_HEADER_NAMES ${GObjectDOMBindings_STATIC_CLASS_LIST} CustomUnstable)
700 foreach (classname ${GObjectDOMBindings_STATIC_HEADER_NAMES})
701     add_custom_command(
702         OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/WebKitDOM${classname}.h
703         DEPENDS ${WEBCORE_DIR}/bindings/gobject/WebKitDOM${classname}.h
704         COMMAND ln -n -s -f ${WEBCORE_DIR}/bindings/gobject/WebKitDOM${classname}.h ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}
705     )
706     list(APPEND GObjectDOMBindings_STATIC_GENERATED_SOURCES ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/WebKitDOM${classname}.h)
707 endforeach ()
708
709 add_custom_target(fake-generated-webkitdom-headers
710     DEPENDS ${GObjectDOMBindings_STATIC_GENERATED_SOURCES}
711 )
712
713 set(GObjectDOMBindings_IDL_FILES ${GObjectDOMBindingsStable_IDL_FILES} ${GObjectDOMBindingsUnstable_IDL_FILES})
714 set(ADDITIONAL_BINDINGS_DEPENDENCIES
715     ${WEBCORE_DIR}/bindings/gobject/webkitdom.symbols
716     ${WINDOW_CONSTRUCTORS_FILE}
717     ${WORKERGLOBALSCOPE_CONSTRUCTORS_FILE}
718     ${DEDICATEDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE}
719 )
720 GENERATE_BINDINGS(GObjectDOMBindings_SOURCES
721     "${GObjectDOMBindings_IDL_FILES}"
722     "${WEBCORE_DIR}"
723     "${IDL_INCLUDES}"
724     "${GOBJECT_DOM_BINDINGS_FEATURES_DEFINES}"
725     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}
726     WebKitDOM GObject cpp
727     ${IDL_ATTRIBUTES_FILE}
728     ${SUPPLEMENTAL_DEPENDENCY_FILE}
729     ${ADDITIONAL_BINDINGS_DEPENDENCIES})
730
731 add_definitions(-DBUILDING_WEBKIT)
732 add_definitions(-DWEBKIT_DOM_USE_UNSTABLE_API)
733
734 add_library(GObjectDOMBindings STATIC ${GObjectDOMBindings_SOURCES})
735
736 WEBKIT_SET_EXTRA_COMPILER_FLAGS(GObjectDOMBindings)
737
738 add_dependencies(GObjectDOMBindings
739     WebCore
740     fake-generated-webkitdom-headers
741 )
742
743 file(WRITE ${CMAKE_BINARY_DIR}/gtkdoc-webkitdom.cfg
744     "[webkitdomgtk-${WEBKITGTK_API_VERSION}]\n"
745     "pkgconfig_file=${WebKit2_PKGCONFIG_FILE}\n"
746     "namespace=webkit_dom\n"
747     "cflags=-I${CMAKE_SOURCE_DIR}/Source\n"
748     "       -I${WEBCORE_DIR}/bindings\n"
749     "       -I${WEBCORE_DIR}/bindings/gobject\n"
750     "       -I${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}\n"
751     "doc_dir=${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/docs\n"
752     "source_dirs=${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}\n"
753     "            ${WEBCORE_DIR}/bindings/gobject\n"
754     "headers=${GObjectDOMBindingsStable_INSTALLED_HEADERS}\n"
755     "main_sgml_file=webkitdomgtk-docs.sgml\n"
756 )
757
758 install(FILES ${GObjectDOMBindingsStable_INSTALLED_HEADERS}
759         DESTINATION "${WEBKITGTK_HEADER_INSTALL_DIR}/webkitdom"
760 )
761
762 # Make unstable header optional if they don't exist
763 install(FILES ${GObjectDOMBindingsUnstable_INSTALLED_HEADERS}
764         DESTINATION "${WEBKITGTK_HEADER_INSTALL_DIR}/webkitdom"
765         OPTIONAL
766 )
767
768 # Some installed headers are not on the list of headers used for gir generation.
769 set(GObjectDOMBindings_GIR_HEADERS ${GObjectDOMBindingsStable_INSTALLED_HEADERS})
770 list(REMOVE_ITEM GObjectDOMBindings_GIR_HEADERS
771      bindings/gobject/WebKitDOMEventTarget.h
772      bindings/gobject/WebKitDOMNodeFilter.h
773      bindings/gobject/WebKitDOMObject.h
774      bindings/gobject/WebKitDOMXPathNSResolver.h
775 )
776
777 # Propagate this variable to the parent scope, so that it can be used in other parts of the build.
778 set(GObjectDOMBindings_GIR_HEADERS ${GObjectDOMBindings_GIR_HEADERS} PARENT_SCOPE)
779
780 if (ENABLE_SMOOTH_SCROLLING)
781     list(APPEND WebCore_SOURCES
782         platform/ScrollAnimationSmooth.cpp
783     )
784 endif ()
785
786 if (ENABLE_SUBTLE_CRYPTO)
787     list(APPEND WebCore_SOURCES
788         crypto/CryptoAlgorithm.cpp
789         crypto/CryptoAlgorithmDescriptionBuilder.cpp
790         crypto/CryptoAlgorithmRegistry.cpp
791         crypto/CryptoKey.cpp
792         crypto/CryptoKeyPair.cpp
793         crypto/SubtleCrypto.cpp
794
795         crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
796         crypto/algorithms/CryptoAlgorithmAES_KW.cpp
797         crypto/algorithms/CryptoAlgorithmHMAC.cpp
798         crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
799         crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp
800         crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp
801         crypto/algorithms/CryptoAlgorithmSHA1.cpp
802         crypto/algorithms/CryptoAlgorithmSHA224.cpp
803         crypto/algorithms/CryptoAlgorithmSHA256.cpp
804         crypto/algorithms/CryptoAlgorithmSHA384.cpp
805         crypto/algorithms/CryptoAlgorithmSHA512.cpp
806
807         crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp
808         crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp
809         crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp
810         crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp
811         crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp
812         crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp
813         crypto/gnutls/CryptoAlgorithmRegistryGnuTLS.cpp
814         crypto/gnutls/CryptoKeyRSAGnuTLS.cpp
815         crypto/gnutls/SerializedCryptoKeyWrapGnuTLS.cpp
816
817         crypto/keys/CryptoKeyAES.cpp
818         crypto/keys/CryptoKeyDataOctetSequence.cpp
819         crypto/keys/CryptoKeyDataRSAComponents.cpp
820         crypto/keys/CryptoKeyHMAC.cpp
821         crypto/keys/CryptoKeySerializationRaw.cpp
822     )
823 endif ()