Commit af1cc00a authored by hausmann@webkit.org's avatar hausmann@webkit.org

Fix the Qt build and the build without ENABLE(SVG_FONTS)


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 66deecf1
2008-03-27 Simon Hausmann <hausmann@webkit.org>
Reviewed by Eric Seidel.
Fix the Qt build and the build without ENABLE(SVG_FONTS)
* WebCore.pro: Removed ElementTimeControl.idl as it's ObjC only and
removed some SVG_FONTS specific idl files from IDL_BINDINGS for now
* bindings/js/JSSVGElementWrapperFactory.cpp: altGlyph is
ENABLE(SVG_FONTS) only
* platform/graphics/qt/FontQt.cpp:
(WebCore::Font::floatWidth): Adjust the function signature to Font.h
* rendering/SVGRootInlineBox.cpp:
(WebCore::SVGRootInlineBox::buildLayoutInformationForTextBox): Fix
compilation without SVG_FONTS
* svg/SVGAltGlyphElement.cpp: Compile only if ENABLE(SVG_FONTS)
* svg/SVGAltGlyphElement.h: Ditto
* svg/svgtags.in: hkern and altGlyph are SVG_FONTS only.
* svg/SVGTSpanElement.cpp:
(WebCore::SVGTSpanElement::childShouldCreateRenderer): Compile without
SVG_FONTS
* svg/SVGTextElement.cpp:
(WebCore::SVGTextElement::childShouldCreateRenderer): Ditto
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::childShouldCreateRenderer):
2008-03-26 Timothy Hatcher <timothy@apple.com>
Rename some Inspector files to facilitate the up-coming UI refresh changes.
......@@ -1303,10 +1303,9 @@ contains(DEFINES, ENABLE_SVG=1) {
XLINK_NAMES = $$PWD/svg/xlinkattrs.in
IDL_BINDINGS += svg/ElementTimeControl.idl \
IDL_BINDINGS += \
svg/SVGZoomEvent.idl \
svg/SVGAElement.idl \
svg/SVGAltGlyphElement.idl \
svg/SVGAngle.idl \
svg/SVGAnimateColorElement.idl \
svg/SVGAnimatedAngle.idl \
......@@ -1437,6 +1436,10 @@ contains(DEFINES, ENABLE_SVG=1) {
svg/SVGUseElement.idl \
svg/SVGViewElement.idl
# ### SVG_FONTS
# IDL_BINDINGS += \
# svg/SVGAltGlyphElement.idl \
SOURCES += \
# TODO: this-one-is-not-auto-added! FIXME! tmp/SVGElementFactory.cpp \
bindings/js/JSSVGElementWrapperFactory.cpp \
......
......@@ -192,6 +192,7 @@ typedef JSNode* (*CreateSVGElementWrapperFunction)(ExecState*, PassRefPtr<SVGEle
#if ENABLE(SVG_FONTS)
#define FOR_EACH_FONT_TAG(macro) \
macro(altGlyph, AltGlyph) \
macro(definition_src, DefinitionSrc) \
macro(font, Font) \
macro(font_face, FontFace) \
......@@ -247,7 +248,6 @@ typedef JSNode* (*CreateSVGElementWrapperFunction)(ExecState*, PassRefPtr<SVGEle
#define FOR_EACH_TAG(macro) \
macro(a, A) \
macro(altGlyph, AltGlyph) \
macro(circle, Circle) \
macro(clipPath, ClipPath) \
macro(cursor, Cursor) \
......
......@@ -475,9 +475,10 @@ float Font::floatWidth(const TextRun& run) const
return width(run);
}
float Font::floatWidth(const TextRun& run, int /*extraCharsAvailable*/, int& charsConsumed) const
float Font::floatWidth(const TextRun& run, int /*extraCharsAvailable*/, int& charsConsumed, String& glyphName) const
{
charsConsumed = run.length();
glyphName = "";
return width(run);
}
......
......@@ -1305,11 +1305,13 @@ void SVGRootInlineBox::buildLayoutInformationForTextBox(SVGCharacterLayoutInfo&
}
}
double kerning = 0.0;
lastGlyph.isValid = false;
#if ENABLE(SVG_FONTS)
SVGFontElement* svgFont = 0;
if (style->font().isSVGFont())
svgFont = style->font().svgFont();
double kerning = 0.0;
if (lastGlyph.isValid && style->font().isSVGFont()) {
SVGHorizontalKerningPair kerningPair;
if (svgFont->getHorizontalKerningPairForStringsAndGlyphs(lastGlyph.unicode, lastGlyph.glyphName, unicodeStr, glyphName, kerningPair))
......@@ -1320,10 +1322,9 @@ void SVGRootInlineBox::buildLayoutInformationForTextBox(SVGCharacterLayoutInfo&
lastGlyph.unicode = unicodeStr;
lastGlyph.glyphName = glyphName;
lastGlyph.isValid = true;
} else {
lastGlyph.isValid = false;
}
#endif
svgChar.x -= (float)kerning;
// Advance to new position
......
......@@ -21,7 +21,7 @@
#include "config.h"
#if ENABLE(SVG)
#if ENABLE(SVG_FONTS)
#include "SVGAltGlyphElement.h"
#include "ExceptionCode.h"
......
......@@ -21,7 +21,7 @@
#ifndef SVGAltGlyphElement_h
#define SVGAltGlyphElement_h
#if ENABLE(SVG)
#if ENABLE(SVG_FONTS)
#include "AtomicString.h"
#include "SVGTextPositioningElement.h"
......
......@@ -42,8 +42,11 @@ SVGTSpanElement::~SVGTSpanElement()
bool SVGTSpanElement::childShouldCreateRenderer(Node* child) const
{
if (child->isTextNode() || child->hasTagName(SVGNames::altGlyphTag) || child->hasTagName(SVGNames::tspanTag) ||
child->hasTagName(SVGNames::trefTag) || child->hasTagName(SVGNames::textPathTag))
if (child->isTextNode()
#if ENABLE(SVG_FONTS)
|| child->hasTagName(SVGNames::altGlyphTag)
#endif
|| child->hasTagName(SVGNames::tspanTag) || child->hasTagName(SVGNames::trefTag) || child->hasTagName(SVGNames::textPathTag))
return true;
return false;
......
......@@ -104,8 +104,11 @@ RenderObject* SVGTextElement::createRenderer(RenderArena* arena, RenderStyle* st
bool SVGTextElement::childShouldCreateRenderer(Node* child) const
{
if (child->isTextNode() || child->hasTagName(SVGNames::altGlyphTag) || child->hasTagName(SVGNames::tspanTag) ||
child->hasTagName(SVGNames::trefTag) || child->hasTagName(SVGNames::aTag) || child->hasTagName(SVGNames::textPathTag))
if (child->isTextNode()
#if ENABLE(SVG_FONTS)
|| child->hasTagName(SVGNames::altGlyphTag)
#endif
|| child->hasTagName(SVGNames::tspanTag) || child->hasTagName(SVGNames::trefTag) || child->hasTagName(SVGNames::aTag) || child->hasTagName(SVGNames::textPathTag))
return true;
return false;
}
......
......@@ -82,8 +82,11 @@ RenderObject* SVGTextPathElement::createRenderer(RenderArena* arena, RenderStyle
bool SVGTextPathElement::childShouldCreateRenderer(Node* child) const
{
if (child->isTextNode() || child->hasTagName(SVGNames::altGlyphTag) || child->hasTagName(SVGNames::trefTag) ||
child->hasTagName(SVGNames::tspanTag) || child->hasTagName(SVGNames::textPathTag))
if (child->isTextNode()
#if ENABLE(SVG_FONTS)
|| child->hasTagName(SVGNames::altGlyphTag)
#endif
|| child->hasTagName(SVGNames::trefTag) || child->hasTagName(SVGNames::tspanTag) || child->hasTagName(SVGNames::textPathTag))
return true;
return false;
......
a
#if ENABLE_SVG_FONTS
altGlyph
#endif
#if 0
altGlyphDef
altGlyphItem
......@@ -71,7 +73,9 @@ glyph
#if 0
glyphRef
#endif
#ifdef ENABLE_SVG_FONTS
hkern
#endif
image
line
linearGradient
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment