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