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