Permalink
Browse files

Add support for GObject DOM bindings

  • Loading branch information...
1 parent 9d0c967 commit 860f602464cea0688ae90b653446e4665ba00268 @mrobinson committed Dec 10, 2013
@@ -18,6 +18,7 @@
*/
// http://dev.w3.org/2009/dap/system-info/battery-status.html
+#if !defined(LANGUAGE_GOBJECT) || !LANGUAGE_OBJECT
[
NoInterfaceObject,
Conditional=BATTERY_STATUS,
@@ -43,4 +44,4 @@
optional boolean useCapture);
[RaisesException] boolean dispatchEvent(Event event);
};
-
+#endif
@@ -17,9 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
+#if !defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT
[
Conditional=BATTERY_STATUS,
] partial interface Navigator {
readonly attribute BatteryManager webkitBattery;
};
-
+#endif
@@ -27,5 +27,7 @@
Conditional=VIDEO&MEDIA_STREAM,
] partial interface HTMLMediaElement
{
+#if !defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT
attribute MediaStream? srcObject;
+#endif
};
@@ -17,9 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
+#if !defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT
[
Conditional=NETWORK_INFO,
] partial interface Navigator {
readonly attribute NetworkInfoConnection webkitConnection;
};
-
+#endif
@@ -20,6 +20,7 @@
*/
// http://dvcs.w3.org/hg/dap/raw-file/tip/network-api/index.html
+#if !defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT
[
NoInterfaceObject,
Conditional=NETWORK_INFO,
@@ -40,3 +41,4 @@
optional boolean useCapture);
[RaisesException] boolean dispatchEvent(Event evt);
};
+#endif
@@ -360,3 +360,247 @@ if (ENABLE_WEB_AUDIO)
DESTINATION
"${DATA_INSTALL_DIR}/resources/audio")
endif ()
+
+if (ENABLE_WEBKIT2)
+ set(DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR ${DERIVED_SOURCES_DIR}/webkitdom)
+
+ include_directories(
+ "${WebCore_INCLUDE_DIRECTORIES}"
+ "${DERIVED_SOURCES_DIR}"
+ "${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}"
+ )
+
+ list(APPEND GObjectDOMBindings_SOURCES
+ bindings/gobject/ConvertToUTF8String.cpp
+ bindings/gobject/ConvertToUTF8String.h
+ bindings/gobject/DOMObjectCache.cpp
+ bindings/gobject/DOMObjectCache.h
+ bindings/gobject/GObjectEventListener.cpp
+ bindings/gobject/GObjectEventListener.h
+ bindings/gobject/WebKitDOMCustom.cpp
+ bindings/gobject/WebKitDOMCustom.h
+ bindings/gobject/WebKitDOMEventTarget.cpp
+ bindings/gobject/WebKitDOMEventTarget.h
+ bindings/gobject/WebKitDOMEventTargetPrivate.h
+ bindings/gobject/WebKitDOMHTMLPrivate.cpp
+ bindings/gobject/WebKitDOMHTMLPrivate.h
+ bindings/gobject/WebKitDOMObject.cpp
+ bindings/gobject/WebKitDOMObject.h
+ bindings/gobject/WebKitDOMPrivate.cpp
+ bindings/gobject/WebKitDOMPrivate.h
+ ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
+ ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
+ )
+
+ list(APPEND GObjectDOMBindings_IDL_FILES
+ css/CSSRule.idl
+ css/CSSRuleList.idl
+ css/CSSStyleDeclaration.idl
+ css/CSSStyleSheet.idl
+ css/CSSValue.idl
+ css/DOMWindowCSS.idl
+ css/MediaList.idl
+ css/MediaQueryList.idl
+ css/StyleMedia.idl
+ css/StyleSheet.idl
+ css/StyleSheetList.idl
+ dom/Attr.idl
+ dom/CDATASection.idl
+ dom/CharacterData.idl
+ dom/Comment.idl
+ dom/DocumentFragment.idl
+ dom/Document.idl
+ dom/DocumentType.idl
+ dom/DOMImplementation.idl
+ dom/DOMNamedFlowCollection.idl
+ dom/DOMStringList.idl
+ dom/DOMStringMap.idl
+ dom/Element.idl
+ dom/EntityReference.idl
+ dom/Event.idl
+ dom/KeyboardEvent.idl
+ dom/MessagePort.idl
+ dom/MouseEvent.idl
+ dom/NamedNodeMap.idl
+ dom/NodeFilter.idl
+ dom/Node.idl
+ dom/NodeIterator.idl
+ dom/NodeList.idl
+ dom/ProcessingInstruction.idl
+ dom/Range.idl
+ dom/ShadowRoot.idl
+ dom/Text.idl
+ dom/TreeWalker.idl
+ dom/UIEvent.idl
+ dom/WebKitNamedFlow.idl
+ dom/WheelEvent.idl
+ fileapi/Blob.idl
+ fileapi/File.idl
+ fileapi/FileList.idl
+ html/DOMSettableTokenList.idl
+ html/DOMTokenList.idl
+ html/HTMLAnchorElement.idl
+ html/HTMLAppletElement.idl
+ html/HTMLAreaElement.idl
+ html/HTMLBaseElement.idl
+ html/HTMLBaseFontElement.idl
+ html/HTMLBodyElement.idl
+ html/HTMLBRElement.idl
+ html/HTMLButtonElement.idl
+ html/HTMLCanvasElement.idl
+ html/HTMLCollection.idl
+ html/HTMLDetailsElement.idl
+ html/HTMLDirectoryElement.idl
+ html/HTMLDivElement.idl
+ html/HTMLDListElement.idl
+ html/HTMLDocument.idl
+ html/HTMLElement.idl
+ html/HTMLEmbedElement.idl
+ html/HTMLFieldSetElement.idl
+ html/HTMLFontElement.idl
+ html/HTMLFormElement.idl
+ html/HTMLFrameElement.idl
+ html/HTMLFrameSetElement.idl
+ html/HTMLHeadElement.idl
+ html/HTMLHeadingElement.idl
+ html/HTMLHRElement.idl
+ html/HTMLHtmlElement.idl
+ html/HTMLIFrameElement.idl
+ html/HTMLImageElement.idl
+ html/HTMLInputElement.idl
+ html/HTMLKeygenElement.idl
+ html/HTMLLabelElement.idl
+ html/HTMLLegendElement.idl
+ html/HTMLLIElement.idl
+ html/HTMLLinkElement.idl
+ html/HTMLMapElement.idl
+ html/HTMLMarqueeElement.idl
+ html/HTMLMediaElement.idl
+ html/HTMLMenuElement.idl
+ html/HTMLMetaElement.idl
+ html/HTMLModElement.idl
+ html/HTMLObjectElement.idl
+ html/HTMLOListElement.idl
+ html/HTMLOptGroupElement.idl
+ html/HTMLOptionElement.idl
+ html/HTMLOptionsCollection.idl
+ html/HTMLParagraphElement.idl
+ html/HTMLParamElement.idl
+ html/HTMLPreElement.idl
+ html/HTMLQuoteElement.idl
+ html/HTMLScriptElement.idl
+ html/HTMLSelectElement.idl
+ html/HTMLStyleElement.idl
+ html/HTMLTableCaptionElement.idl
+ html/HTMLTableCellElement.idl
+ html/HTMLTableColElement.idl
+ html/HTMLTableElement.idl
+ html/HTMLTableRowElement.idl
+ html/HTMLTableSectionElement.idl
+ html/HTMLTextAreaElement.idl
+ html/HTMLTitleElement.idl
+ html/HTMLUListElement.idl
+ html/MediaController.idl
+ html/MediaError.idl
+ html/TimeRanges.idl
+ html/ValidityState.idl
+ loader/appcache/DOMApplicationCache.idl
+ Modules/battery/BatteryManager.idl
+ Modules/gamepad/Gamepad.idl
+ Modules/gamepad/GamepadList.idl
+ Modules/geolocation/Geolocation.idl
+ Modules/quota/StorageInfo.idl
+ Modules/quota/StorageQuota.idl
+ Modules/webdatabase/Database.idl
+ page/BarProp.idl
+ page/Console.idl
+ page/DOMSecurityPolicy.idl
+ page/DOMSelection.idl
+ page/DOMWindow.idl
+ page/History.idl
+ page/Location.idl
+ page/Navigator.idl
+ page/PerformanceEntry.idl
+ page/PerformanceEntryList.idl
+ page/Performance.idl
+ page/PerformanceNavigation.idl
+ page/PerformanceTiming.idl
+ page/Screen.idl
+ page/WebKitPoint.idl
+ plugins/DOMMimeTypeArray.idl
+ plugins/DOMMimeType.idl
+ plugins/DOMPluginArray.idl
+ plugins/DOMPlugin.idl
+ storage/Storage.idl
+ xml/XPathExpression.idl
+ xml/XPathNSResolver.idl
+ xml/XPathResult.idl
+ )
+
+ if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
+ list(APPEND GObjectDOMBindings_IDL_FILES
+ html/HTMLAudioElement.idl
+ html/HTMLVideoElement.idl
+ html/track/AudioTrack.idl
+ html/track/AudioTrackList.idl
+ html/track/TextTrack.idl
+ html/track/TextTrackList.idl
+ html/track/TextTrackCue.idl
+ html/track/TextTrackCueList.idl
+ html/track/TrackEvent.idl
+ html/track/VideoTrack.idl
+ html/track/VideoTrackList.idl
+ )
+ endif ()
+
+ foreach(file Custom EventTarget Object Deprecated ${GObjectDOMBindings_IDL_FILES})
+ GET_FILENAME_COMPONENT(file ${file} NAME_WE)
+ list(APPEND GObjectDOMBindings_CLASS_LIST ${file})
+ endforeach ()
+
+ set(GOBJECT_DOM_BINDINGS_FEATURES_DEFINES "LANGUAGE_GOBJECT=1 ${FEATURE_DEFINES_WITH_SPACE_SEPARATOR}")
+ string(REPLACE "ENABLE_INDEXED_DATABASE=1" "" GOBJECT_DOM_BINDINGS_FEATURES_DEFINES ${GOBJECT_DOM_BINDINGS_FEATURES_DEFINES})
+ string(REPLACE REGEX "ENABLE_SVG[A-Z_]+=1" "" GOBJECT_DOM_BINDINGS_FEATURES_DEFINES ${GOBJECT_DOM_BINDINGS_FEATURES_DEFINES})
+
+ file(MAKE_DIRECTORY ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR})
+
+ add_custom_command(
+ OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
+ COMMAND echo ${GObjectDOMBindings_CLASS_LIST} | ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl defines > ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
+ )
+
+ add_custom_command(
+ OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
+ COMMAND echo ${GObjectDOMBindings_CLASS_LIST} | ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl gdom > ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
+ )
+
+ add_custom_target(fake-installed-webkitdom-headers
+ COMMAND ln -n -s -f ${WEBCORE_DIR}/bindings/gobject/* ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}
+ )
+
+ GENERATE_BINDINGS(GObjectDOMBindings_SOURCES
+ "${GObjectDOMBindings_IDL_FILES}"
+ "${WEBCORE_DIR}"
+ "${IDL_INCLUDES}"
+ "${GOBJECT_DOM_BINDINGS_FEATURES_DEFINES}"
+ ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}
+ WebKitDOM GObject
+ ${IDL_ATTRIBUTES_FILE}
+ ${SUPPLEMENTAL_DEPENDENCY_FILE}
+ ${WINDOW_CONSTRUCTORS_FILE}
+ ${WORKERGLOBALSCOPE_CONSTRUCTORS_FILE}
+ ${SHAREDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE}
+ ${DEDICATEDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE})
+
+ add_definitions(-DBUILDING_WEBKIT)
+
+ add_library(GObjectDOMBindings STATIC ${GObjectDOMBindings_SOURCES})
+
+ WEBKIT_SET_EXTRA_COMPILER_FLAGS(GObjectDOMBindings)
+
+ add_dependencies(GObjectDOMBindings
+ WebCore
+ fake-installed-webkitdom-headers
+ )
+endif ()
+
@@ -239,7 +239,7 @@
[Conditional=FONT_LOAD_EVENTS] readonly attribute FontLoader fontloader;
#endif
-#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
+#if (!defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C) && (!defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT)
// Event handler DOM attributes
[NotEnumerable] attribute EventListener onabort;
[NotEnumerable] attribute EventListener onblur;
@@ -108,7 +108,7 @@
[ImplementedAs=setMediaKeys] void webkitSetMediaKeys(MediaKeys mediaKeys);
#endif
-#if defined(ENABLE_VIDEO_TRACK) && ENABLE_VIDEO_TRACK
+#if defined(ENABLE_VIDEO_TRACK) && ENABLE_VIDEO_TRACK && (!defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT)
[RaisesException] TextTrack addTextTrack(DOMString kind, optional DOMString label, optional DOMString language);
readonly attribute AudioTrackList audioTracks;
readonly attribute TextTrackList textTracks;

0 comments on commit 860f602

Please sign in to comment.