[Webkit-unassigned] [Bug 133983] [GTK] Add support for constants in GObject DOM bindings
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Jun 25 09:28:43 PDT 2014
https://bugs.webkit.org/show_bug.cgi?id=133983
--- Comment #3 from Martin Robinson <mrobinson at webkit.org> 2014-06-25 09:29:01 PST ---
(From update of attachment 233415)
View in context: https://bugs.webkit.org/attachment.cgi?id=233415&action=review
> Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm:896
> + push(@hBody, $implContent);
> +
> + if ($isStableClass) {
> + push(@symbols, "GType ${lowerCaseIfaceName}_get_type(void)\n");
> + }
> +
> + if (@{$interface->constants}) {
> + my @constants = @{$interface->constants};
> + foreach my $constant (@constants) {
> + my $conditionalString = $codeGenerator->GenerateConditionalString($constant);
> + my $constantName = "WEBKIT_DOM_${clsCaps}_" . $constant->name;
> + my $constantValue = $constant->value;
> + my $isStableSymbol = grep {$_ eq $constantName} @stableSymbols;
> + if ($isStableSymbol) {
> + push(@symbols, "$constantName\n");
> + }
> +
> + my @constantHeader = ();
> + push(@constantHeader, "#if ${conditionalString}") if $conditionalString;
> + push(@constantHeader, "/**");
> + push(@constantHeader, " * ${constantName}:");
> + push(@constantHeader, " */");
> + push(@constantHeader, "#define $constantName $constantValue");
> + push(@constantHeader, "#endif /* ${conditionalString} */") if $conditionalString;
> + push(@constantHeader, "\n");
> +
> + if ($isStableSymbol or !$isStableClass) {
> + push(@hBody, join("\n", @constantHeader));
> + } else {
> + push(@hBodyUnstable, join("\n", @constantHeader));
> + }
> + }
> + }
> +
I think it makes sense to move this to a helper. We don't do that a lot, but these files need serious cleanup.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list