[vala] webkit2gtk-web-extension-4.0: add delegate for EventTarget listener



commit 6a1a1ab1637455f43e5e8dd707da1bb3bec37f66
Author: Evan Nemerson <evan nemerson com>
Date:   Thu Oct 16 09:23:13 2014 -0700

    webkit2gtk-web-extension-4.0: add delegate for EventTarget listener

 vapi/Makefile.am                               |    2 +-
 vapi/metadata/WebKit2WebExtension-4.0.metadata |    2 ++
 vapi/webkit2gtk-web-extension-4.0.vapi         |    4 +++-
 3 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/vapi/Makefile.am b/vapi/Makefile.am
index bb7219b..eb039b2 100644
--- a/vapi/Makefile.am
+++ b/vapi/Makefile.am
@@ -795,4 +795,4 @@ webkit2gtk-4.0:
        $(GENVAPI) --library $(srcdir)/webkit2gtk-4.0 --metadatadir $(METADATADIR) --pkg gtk+-3.0 --pkg 
libsoup-2.4 $(GIRDIR)/WebKit2-4.0.gir
 
 webkit2gtk-web-extension-4.0:
-       $(GENVAPI) --library $(srcdir)/webkit2gtk-web-extension-4.0 --metadatadir $(METADATADIR) --pkg 
gtk+-3.0 $(GIRDIR)/WebKit2WebExtension-4.0.gir
+       $(GENVAPI) --library $(srcdir)/webkit2gtk-web-extension-4.0 --metadatadir $(METADATADIR) --pkg 
gtk+-3.0 $(METADATADIR)/WebKit2WebExtension-4.0-custom.vala $(GIRDIR)/WebKit2WebExtension-4.0.gir
diff --git a/vapi/metadata/WebKit2WebExtension-4.0.metadata b/vapi/metadata/WebKit2WebExtension-4.0.metadata
index 64865ca..1c01075 100644
--- a/vapi/metadata/WebKit2WebExtension-4.0.metadata
+++ b/vapi/metadata/WebKit2WebExtension-4.0.metadata
@@ -3,3 +3,5 @@ DOM* parent="WebKit.DOM" name="DOM(.+)"
 DOMEventTarget.add_event_listener skip
 
 Frame.get_javascript_* type="void*"
+
+DOMEventTarget.add_event_listener_with_closure.handler type="owned WebKit.DOM.EventTargetFunc"
diff --git a/vapi/webkit2gtk-web-extension-4.0.vapi b/vapi/webkit2gtk-web-extension-4.0.vapi
index be320ec..1700474 100644
--- a/vapi/webkit2gtk-web-extension-4.0.vapi
+++ b/vapi/webkit2gtk-web-extension-4.0.vapi
@@ -2409,7 +2409,7 @@ namespace WebKit {
                [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = 
"webkit_dom_event_target_get_type ()")]
                [GIR (name = "DOMEventTarget")]
                public interface EventTarget : GLib.Object {
-                       public bool add_event_listener_with_closure (string event_name, GLib.Closure handler, 
bool use_capture);
+                       public bool add_event_listener_with_closure (string event_name, [CCode (type = 
"GClosure*")] owned WebKit.DOM.EventTargetFunc handler, bool use_capture);
                        public abstract bool dispatch_event (WebKit.DOM.Event event) throws GLib.Error;
                        public abstract bool remove_event_listener (string event_name, GLib.Closure handler, 
bool use_capture);
                        public bool remove_event_listener_with_closure (string event_name, GLib.Closure 
handler, bool use_capture);
@@ -2424,6 +2424,8 @@ namespace WebKit {
                public interface XPathNSResolver : GLib.Object {
                        public abstract string lookup_namespace_uri (string prefix);
                }
+               [CCode (cheader_filename = "webkit2/webkit-web-extension.h")]
+               public delegate void EventTargetFunc (WebKit.DOM.EventTarget target, WebKit.DOM.Event event);
                [CCode (cheader_filename = "webkit2/webkit-web-extension.h", cname = 
"WEBKIT_DOM_CSS_RULE_CHARSET_RULE")]
                public const int _CSS_RULE_CHARSET_RULE;
                [CCode (cheader_filename = "webkit2/webkit-web-extension.h", cname = 
"WEBKIT_DOM_CSS_RULE_FONT_FACE_RULE")]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]