sub SkipFunction {
my $function = shift;
+ my $decamelize = shift;
+ my $prefix = shift;
- # FIXME: skip all custom methods; is this ok?
- if ($function->signature->extendedAttributes->{"Custom"}) {
+ my $functionName = "webkit_dom_" . $decamelize . "_" . $prefix . decamelize($function->signature->name);
+ my $isCustomFunction = $function->signature->extendedAttributes->{"Custom"} ||
+ $function->signature->extendedAttributes->{"CustomArgumentHandling"};
+
+ if ($isCustomFunction &&
+ $functionName ne "webkit_dom_node_replace_child" &&
+ $functionName ne "webkit_dom_node_insert_before" &&
+ $functionName ne "webkit_dom_node_replace_child" &&
+ $functionName ne "webkit_dom_node_append_child" &&
+ $functionName ne "webkit_dom_html_collection_item" &&
+ $functionName ne "webkit_dom_html_collection_named_item") {
return 1;
}
sub GenerateFunction {
my ($object, $interfaceName, $function, $prefix) = @_;
- if (SkipFunction($function)) {
+ my $decamelize = FixUpDecamelizedName(decamelize($interfaceName));
+
+ if (SkipFunction($function, $decamelize, $prefix)) {
return;
}
my $functionSigName = $function->signature->name;
my $functionSigType = $function->signature->type;
- my $decamelize = FixUpDecamelizedName(decamelize($interfaceName));
my $functionName = "webkit_dom_" . $decamelize . "_" . $prefix . decamelize($functionSigName);
my $returnType = GetGlibTypeName($functionSigType);
my $returnValueIsGDOMType = IsGDOMClassType($functionSigType);
$implIncludes{"${functionSigType}.h"} = 1;
}
- # skip custom functions for now
- # but skip from here to allow some headers to be created
- # for a successful compile.
- if ($isCustomFunction &&
- $functionName ne "webkit_dom_node_remove_child" &&
- $functionName ne "webkit_dom_node_insert_before" &&
- $functionName ne "webkit_dom_node_replace_child" &&
- $functionName ne "webkit_dom_node_append_child") {
- push(@hBody, "\n/* TODO: custom function ${functionName} */\n\n");
- push(@cBody, "\n/* TODO: custom function ${functionName} */\n\n");
- return;
- }
-
if(@{$function->raisesExceptions}) {
$functionSig .= ", GError **error";
}
my $assignPre = "";
my $assignPost = "";
- if ($returnType ne "void" && !$isCustomFunction) {
+ # We need to special-case these Node methods because their C++
+ # signature is different from what we'd expect given their IDL
+ # description; see Node.h.
+ my $functionHasCustomReturn = $functionName eq "webkit_dom_node_append_child" ||
+ $functionName eq "webkit_dom_node_insert_before" ||
+ $functionName eq "webkit_dom_node_replace_child" ||
+ $functionName eq "webkit_dom_node_remove_child";
+
+ if ($returnType ne "void" && !$functionHasCustomReturn) {
if ($returnValueIsGDOMType) {
$assign = "PassRefPtr<WebCore::${functionSigType}> g_res = ";
$assignPre = "WTF::getPtr(";
}
}
- # We need to special-case these Node methods because their C++ signature is different
- # from what we'd expect given their IDL description; see Node.h.
- if ($functionName eq "webkit_dom_node_append_child" ||
- $functionName eq "webkit_dom_node_insert_before" ||
- $functionName eq "webkit_dom_node_replace_child" ||
- $functionName eq "webkit_dom_node_remove_child") {
+ if ($functionHasCustomReturn) {
my $customNodeAppendChild = << "EOF";
bool ok = item->${functionSigName}(${callImplParams}${exceptions});
if (ok)
}
}
- if ($returnType ne "void" && !$isCustomFunction) {
+ if ($returnType ne "void" && !$functionHasCustomReturn) {
if ($functionSigType ne "DOMObject") {
if ($returnValueIsGDOMType) {
push(@cBody, " ${returnType} res = static_cast<${returnType}>(WebKit::kit(g_res.get()));\n");