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