# FIXME: try to merge this somehow with the fixes in ClassNameToGobjectType
$classname =~ s/x_path/xpath/;
$classname =~ s/web_kit/webkit/;
+ $classname =~ s/htmli_frame/html_iframe/;
return $classname;
}
my $className = shift;
my $CLASS_NAME = uc(decamelize($className));
# Fixup: with our prefix being 'WebKitDOM' decamelize can't get
- # WebKitDOMCSS right, so we have to fix it manually (and there
- # might be more like this in the future)
+ # WebKitDOMCSS and similar names right, so we have to fix it
+ # manually.
$CLASS_NAME =~ s/DOMCSS/DOM_CSS/;
$CLASS_NAME =~ s/DOMHTML/DOM_HTML/;
$CLASS_NAME =~ s/DOMDOM/DOM_DOM/;
$CLASS_NAME =~ s/DOMX_PATH/DOM_XPATH/;
$CLASS_NAME =~ s/DOM_WEB_KIT/DOM_WEBKIT/;
$CLASS_NAME =~ s/DOMUI/DOM_UI/;
+ $CLASS_NAME =~ s/HTMLI_FRAME/HTML_IFRAME/;
return $CLASS_NAME;
}
# Skip functions that have ["Callback"] parameters, because this
# code generator doesn't know how to auto-generate callbacks.
+ # Skip functions that have "MediaQueryListListener" parameters, because this
+ # code generator doesn't know how to auto-generate MediaQueryListListener.
foreach my $param (@{$function->parameters}) {
- if ($param->extendedAttributes->{"Callback"}) {
+ if ($param->extendedAttributes->{"Callback"} ||
+ $param->type eq "MediaQueryListListener") {
return 1;
}
}
push(@txtSetProps, $txtSetProps);
foreach my $attribute (@readableProperties) {
- if ($attribute->signature->type ne "EventListener") {
+ if ($attribute->signature->type ne "EventListener" &&
+ $attribute->signature->type ne "MediaQueryListListener") {
GenerateProperty($attribute, $interfaceName, \@writeableProperties);
}
}
return "" if $type eq "unsigned short";
return "" if $type eq "DOMTimeStamp";
return "" if $type eq "EventListener";
+ return "" if $type eq "MediaQueryListListener";
return "" if $type eq "unsigned char";
return "" if $type eq "DOMString";
return "" if $type eq "float";
my $decamelize = FixUpDecamelizedName(decamelize($interfaceName));
+ if ($object eq "MediaQueryListListener") {
+ return;
+ }
+
if (SkipFunction($function, $decamelize, $prefix)) {
return;
}
foreach my $param (@{$function->parameters}) {
my $paramIDLType = $param->type;
- if ($paramIDLType eq "EventListener") {
+ if ($paramIDLType eq "EventListener" || $paramIDLType eq "MediaQueryListListener") {
push(@hBody, "\n/* TODO: event function ${functionName} */\n\n");
push(@cBody, "\n/* TODO: event function ${functionName} */\n\n");
return;
bool ok = item->${functionSigName}(${callImplParams}${exceptions});
if (ok)
{
- ${returnType} res = static_cast<${returnType}>(WebKit::kit($returnParamName));
+ ${returnType} res = WebKit::kit($returnParamName);
return res;
}
EOF
if ($returnType ne "void" && !$functionHasCustomReturn) {
if ($functionSigType ne "DOMObject") {
if ($returnValueIsGDOMType) {
- push(@cBody, " ${returnType} res = static_cast<${returnType}>(WebKit::kit(g_res.get()));\n");
+ push(@cBody, " ${returnType} res = WebKit::kit(g_res.get());\n");
}
}
if ($functionSigType eq "DOMObject") {
TOP:
foreach my $attribute (@{$dataNode->attributes}) {
- if (SkipAttribute($attribute) || $attribute->signature->type eq "EventListener") {
+ if (SkipAttribute($attribute) ||
+ $attribute->signature->type eq "EventListener" ||
+ $attribute->signature->type eq "MediaQueryListListener") {
next TOP;
}
if ($className ne "WebKitDOMNode") {
$text = << "EOF";
- gpointer
+ ${className}*
kit(WebCore::${interfaceName}* node);
EOF
$implIncludes{"webkitmarshal.h"} = 1;
$implIncludes{"webkitprivate.h"} = 1;
+ $implIncludes{"DOMObjectCache.h"} = 1;
$implIncludes{"WebKitDOMBinding.h"} = 1;
$implIncludes{"gobject/ConvertToUTF8String.h"} = 1;
$implIncludes{"webkit/$className.h"} = 1;
my $converter = << "EOF";
namespace WebKit {
-gpointer kit(WebCore::$interfaceName* obj)
+${className}* kit(WebCore::$interfaceName* obj)
{
g_return_val_if_fail(obj, 0);
if (gpointer ret = DOMObjectCache::get(obj))
- return ret;
+ return static_cast<${className}*>(ret);
- return DOMObjectCache::put(obj, WebKit::wrap${interfaceName}(obj));
+ return static_cast<${className}*>(DOMObjectCache::put(obj, WebKit::wrap${interfaceName}(obj)));
}
} // namespace WebKit //