Changeset 58633 in webkit


Ignore:
Timestamp:
May 1, 2010 3:40:45 AM (14 years ago)
Author:
xan@webkit.org
Message:

2010-05-01 Xan Lopez <xlopez@igalia.com>

Reviewed by Oliver Hunt.

[GTK] GObject DOM bindings
https://bugs.webkit.org/show_bug.cgi?id=33590

Unify more logic to skip functions into SkipFunction, and
whitelist the two [Custom] methods in HTMLCollection.idl.

  • bindings/scripts/CodeGeneratorGObject.pm:
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r58631 r58633  
     12010-05-01  Xan Lopez  <xlopez@igalia.com>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        [GTK] GObject DOM bindings
     6        https://bugs.webkit.org/show_bug.cgi?id=33590
     7
     8        Unify more logic to skip functions into SkipFunction, and
     9        whitelist the two [Custom] methods in HTMLCollection.idl.
     10
     11        * bindings/scripts/CodeGeneratorGObject.pm:
     12
    1132010-05-01  Robert Hogan  <robert@webkit.org>
    214
  • trunk/WebCore/bindings/scripts/CodeGeneratorGObject.pm

    r58510 r58633  
    178178sub SkipFunction {
    179179    my $function = shift;
    180 
    181     # FIXME: skip all custom methods; is this ok?
    182     if ($function->signature->extendedAttributes->{"Custom"}) {
     180    my $decamelize = shift;
     181    my $prefix = shift;
     182
     183    my $functionName = "webkit_dom_" . $decamelize . "_" . $prefix . decamelize($function->signature->name);
     184    my $isCustomFunction = $function->signature->extendedAttributes->{"Custom"} ||
     185        $function->signature->extendedAttributes->{"CustomArgumentHandling"};
     186
     187    if ($isCustomFunction &&
     188        $functionName ne "webkit_dom_node_replace_child" &&
     189        $functionName ne "webkit_dom_node_insert_before" &&
     190        $functionName ne "webkit_dom_node_replace_child" &&
     191        $functionName ne "webkit_dom_node_append_child" &&
     192        $functionName ne "webkit_dom_html_collection_item" &&
     193        $functionName ne "webkit_dom_html_collection_named_item") {
    183194        return 1;
    184195    }
     
    679690    my ($object, $interfaceName, $function, $prefix) = @_;
    680691
    681     if (SkipFunction($function)) {
     692    my $decamelize = FixUpDecamelizedName(decamelize($interfaceName));
     693
     694    if (SkipFunction($function, $decamelize, $prefix)) {
    682695        return;
    683696    }
     
    685698    my $functionSigName = $function->signature->name;
    686699    my $functionSigType = $function->signature->type;
    687     my $decamelize = FixUpDecamelizedName(decamelize($interfaceName));
    688700    my $functionName = "webkit_dom_" . $decamelize . "_" . $prefix . decamelize($functionSigName);
    689701    my $returnType = GetGlibTypeName($functionSigType);
     
    734746
    735747        $implIncludes{"${functionSigType}.h"} = 1;
    736     }
    737 
    738     # skip custom functions for now
    739     # but skip from here to allow some headers to be created
    740     # for a successful compile.
    741     if ($isCustomFunction &&
    742         $functionName ne "webkit_dom_node_remove_child" &&
    743         $functionName ne "webkit_dom_node_insert_before" &&
    744         $functionName ne "webkit_dom_node_replace_child" &&
    745         $functionName ne "webkit_dom_node_append_child") {
    746         push(@hBody, "\n/* TODO: custom function ${functionName} */\n\n");
    747         push(@cBody, "\n/* TODO: custom function ${functionName} */\n\n");
    748         return;
    749748    }
    750749
     
    808807    my $assignPost = "";
    809808
    810     if ($returnType ne "void" && !$isCustomFunction) {
     809    # We need to special-case these Node methods because their C++
     810    # signature is different from what we'd expect given their IDL
     811    # description; see Node.h.
     812    my $functionHasCustomReturn = $functionName eq "webkit_dom_node_append_child" ||
     813        $functionName eq "webkit_dom_node_insert_before" ||
     814        $functionName eq "webkit_dom_node_replace_child" ||
     815        $functionName eq "webkit_dom_node_remove_child";
     816       
     817    if ($returnType ne "void" && !$functionHasCustomReturn) {
    811818        if ($returnValueIsGDOMType) {
    812819            $assign = "PassRefPtr<WebCore::${functionSigType}> g_res = ";
     
    827834    }
    828835
    829     # We need to special-case these Node methods because their C++ signature is different
    830     # from what we'd expect given their IDL description; see Node.h.
    831     if ($functionName eq "webkit_dom_node_append_child" ||
    832         $functionName eq "webkit_dom_node_insert_before" ||
    833         $functionName eq "webkit_dom_node_replace_child" ||
    834         $functionName eq "webkit_dom_node_remove_child") {
     836    if ($functionHasCustomReturn) {
    835837        my $customNodeAppendChild = << "EOF";
    836838    bool ok = item->${functionSigName}(${callImplParams}${exceptions});
     
    899901    }
    900902
    901     if ($returnType ne "void" && !$isCustomFunction) {
     903    if ($returnType ne "void" && !$functionHasCustomReturn) {
    902904        if ($functionSigType ne "DOMObject") {
    903905            if ($returnValueIsGDOMType) {
  • trunk/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp

    r58540 r58633  
    3232#include "webkit/WebKitDOMTestObj.h"
    3333#include "webkit/WebKitDOMTestObjPrivate.h"
    34 #include "webkit/WebKitDOMlog.h"
    35 #include "webkit/WebKitDOMlogPrivate.h"
    3634#include "webkitmarshal.h"
    3735#include "webkitprivate.h"
     
    152150
    153151}
    154 
    155 
    156 /* TODO: custom function webkit_dom_test_obj_custom_args_and_exception */
    157152
    158153
  • trunk/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h

    r58504 r58633  
    7070WEBKIT_API void
    7171webkit_dom_test_obj_method_with_exception (WebKitDOMTestObj *self, GError **error);
    72 
    73 
    74 /* TODO: custom function webkit_dom_test_obj_custom_args_and_exception */
    7572
    7673
Note: See TracChangeset for help on using the changeset viewer.