Title: [156182] trunk/Source/WebCore
Revision
156182
Author
[email protected]
Date
2013-09-20 11:12:05 -0700 (Fri, 20 Sep 2013)

Log Message

[GTK] Clean up the Skip* functions in the GObject DOM bindings code generator
https://bugs.webkit.org/show_bug.cgi?id=121633

Reviewed by Gustavo Noronha Silva.

* bindings/scripts/CodeGeneratorGObject.pm:
(SkipAttribute): Fold in some skipping checks that are used by all callers.
(SkipFunction): Ditto.
(GenerateProperties): Rely on SkipAttribute more thoroughly.
(GenerateFunction): Rely on SkipFunction more thoroughly.
(GenerateFunctions): Rely on SkipAttribute more thoroughly.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (156181 => 156182)


--- trunk/Source/WebCore/ChangeLog	2013-09-20 17:44:47 UTC (rev 156181)
+++ trunk/Source/WebCore/ChangeLog	2013-09-20 18:12:05 UTC (rev 156182)
@@ -1,3 +1,17 @@
+2013-09-19  Martin Robinson  <[email protected]>
+
+        [GTK] Clean up the Skip* functions in the GObject DOM bindings code generator
+        https://bugs.webkit.org/show_bug.cgi?id=121633
+
+        Reviewed by Gustavo Noronha Silva.
+
+        * bindings/scripts/CodeGeneratorGObject.pm:
+        (SkipAttribute): Fold in some skipping checks that are used by all callers.
+        (SkipFunction): Ditto.
+        (GenerateProperties): Rely on SkipAttribute more thoroughly.
+        (GenerateFunction): Rely on SkipFunction more thoroughly.
+        (GenerateFunctions): Rely on SkipAttribute more thoroughly.
+
 2013-09-20  Patrick Gansterer  <[email protected]>
 
         Fix the build after r156144

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm (156181 => 156182)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm	2013-09-20 17:44:47 UTC (rev 156181)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm	2013-09-20 18:12:05 UTC (rev 156182)
@@ -226,6 +226,14 @@
         return 1;
     }
 
+    if ($attribute->signature->type eq "EventListener") {
+        return 1;
+    }
+
+    if ($attribute->signature->type eq "MediaQueryListListener") {
+        return 1;
+    }
+
     # Skip indexed database attributes for now, they aren't yet supported for the GObject generator.
     if ($attribute->signature->name =~ /^(?:webkit)?[Ii]ndexedDB/ or $attribute->signature->name =~ /^(?:webkit)?IDB/) {
         return 1;
@@ -235,6 +243,7 @@
 }
 
 sub SkipFunction {
+    my $object = shift;
     my $function = shift;
     my $decamelize = shift;
     my $prefix = shift;
@@ -255,6 +264,34 @@
         return 1;
     }
 
+    # Skip functions that have callback parameters, because this code generator doesn't know
+    # how to auto-generate callbacks.  Skip functions that have "MediaQueryListListener" or
+    # sequence<T> parameters, because this code generator doesn't know how to auto-generate
+    # MediaQueryListListener or sequence<T>. Skip EventListeners because they are handled elsewhere.
+    foreach my $param (@{$function->parameters}) {
+        if ($codeGenerator->IsCallbackInterface($param->type) ||
+            $param->extendedAttributes->{"Clamp"} ||
+            $param->type eq "MediaQueryListListener" ||
+            $param->type eq "EventListener" ||
+            $codeGenerator->GetSequenceType($param->type)) {
+            return 1;
+        }
+    }
+
+    # This is for DataTransferItemList.idl add(File) method
+    if ($functionName eq "webkit_dom_data_transfer_item_list_add" && @{$function->parameters} == 1) {
+        return 1;
+    }
+
+
+    if ($function->signature->name eq "set" and $parentNode->extendedAttributes->{"TypedArray"}) {
+        return 1;
+    }
+
+    if ($object eq "MediaQueryListListener") {
+        return 1;
+    }
+
     if ($function->signature->name eq "getSVGDocument") {
         return 1;
     }
@@ -267,12 +304,6 @@
         return 1;
     }
 
-    # This is for DataTransferItemList.idl add(File) method
-    if ($functionName eq "webkit_dom_data_transfer_item_list_add" &&
-        @{$function->parameters} == 1) {
-        return 1;
-    }
-
     if ($function->signature->name eq "timeEnd" || $function->signature->name eq "profile" || $function->signature->name eq "profileEnd") {
         return 1;
     }
@@ -285,19 +316,6 @@
         return 1;
     }
 
-    # Skip functions that have callback parameters, because this
-    # code generator doesn't know how to auto-generate callbacks.
-    # Skip functions that have "MediaQueryListListener" or sequence<T> parameters, because this
-    # code generator doesn't know how to auto-generate MediaQueryListListener or sequence<T>.
-    foreach my $param (@{$function->parameters}) {
-        if ($codeGenerator->IsCallbackInterface($param->type) ||
-            $param->extendedAttributes->{"Clamp"} ||
-            $param->type eq "MediaQueryListListener" ||
-            $codeGenerator->GetSequenceType($param->type)) {
-            return 1;
-        }
-    }
-
     return 0;
 }
 
@@ -644,10 +662,7 @@
         }
 
         foreach my $attribute (@readableProperties) {
-            if ($attribute->signature->type ne "EventListener" &&
-                $attribute->signature->type ne "MediaQueryListListener") {
-                GenerateProperty($attribute, $interfaceName, \@writeableProperties, $interface);
-            }
+            GenerateProperty($attribute, $interfaceName, \@writeableProperties, $interface);
         }
 
         push(@cBodyProperties, "};\n\n");
@@ -875,16 +890,10 @@
 
     my $decamelize = decamelize($interfaceName);
 
-    if ($object eq "MediaQueryListListener") {
+    if (SkipFunction($object, $function, $decamelize, $prefix)) {
         return;
     }
 
-    if (SkipFunction($function, $decamelize, $prefix)) {
-        return;
-    }
-
-    return if ($function->signature->name eq "set" and $parentNode->extendedAttributes->{"TypedArray"});
-
     my $functionSigType = $prefix eq "set_" ? "void" : $function->signature->type;
     my $functionName = "webkit_dom_" . $decamelize . "_" . $prefix . decamelize($function->signature->name);
     my $returnType = GetGlibTypeName($functionSigType);
@@ -900,14 +909,8 @@
     my $symbolSig = "${className}*";
 
     my @callImplParams;
-
     foreach my $param (@{$function->parameters}) {
         my $paramIDLType = $param->type;
-        if ($paramIDLType eq "EventListener" || $paramIDLType eq "MediaQueryListListener") {
-            # EventListeners are handled elsewhere.
-            return;
-        }
-
         my $paramType = GetGlibTypeName($paramIDLType);
         my $const = $paramType eq "gchar*" ? "const " : "";
         my $paramName = $param->name;
@@ -1204,12 +1207,10 @@
 
     TOP:
     foreach my $attribute (@{$interface->attributes}) {
-        if (SkipAttribute($attribute) ||
-            $attribute->signature->type eq "EventListener" ||
-            $attribute->signature->type eq "MediaQueryListListener") {
+        if (SkipAttribute($attribute)) {
             next TOP;
         }
-        
+
         if ($attribute->signature->name eq "type"
             # This will conflict with the get_type() function we define to return a GType
             # according to GObject conventions.  Skip this for now.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to