Commit ecad67c5 authored by hyatt's avatar hyatt

Fold QFont into Font and eliminate QFont completely.

        Reviewed by eric

        * ForwardingHeaders/qfont.h: Removed.
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/objc/DOM.mm:
        (-[DOMElement _font]):
        * bridge/mac/MacFrame.mm:
        (WebCore::MacFrame::attributedString):
        (WebCore::MacFrame::fontForSelection):
        (WebCore::MacFrame::fontAttributesForSelectionStart):
        * bridge/mac/WebCoreFrameBridge.mm:
        * css/css_computedstyle.cpp:
        (WebCore::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
        * css/cssstyleselector.cpp:
        (WebCore::CSSStyleSelector::applyProperty):
        * dom/DocumentImpl.cpp:
        (WebCore::DocumentImpl::recalcStyle):
        * ksvg2/svg/SVGLengthImpl.cpp:
        (SVGLengthImpl::updateValue):
        * kwq/KWQAccObject.mm:
        (AXAttributeStringSetStyle):
        * kwq/KWQComboBox.h:
        * kwq/KWQComboBox.mm:
        (QComboBox::setFont):
        * kwq/KWQFont.h: Removed.
        * kwq/KWQFont.mm: Removed.
        * kwq/KWQFontMetrics.h:
        * kwq/KWQFontMetrics.mm:
        (QFontMetricsPrivate::QFontMetricsPrivate):
        (QFontMetricsPrivate::~QFontMetricsPrivate):
        (QFontMetricsPrivate::getRenderer):
        (QFontMetricsPrivate::fontDescription):
        (QFontMetricsPrivate::setFontDescription):
        (QFontMetricsPrivate::getWebCoreFont):
        (QFontMetricsPrivate::isFixedPitch):
        (QFontMetricsPrivate::determinePitch):
        (QFontMetrics::QFontMetrics):
        (QFontMetrics::setFontDescription):
        (QFontMetrics::width):
        (QFontMetrics::floatWidth):
        (QFontMetrics::selectionRectForText):
        (QFontMetrics::checkSelectionPoint):
        (QFontMetrics::getWebCoreFont):
        (QFontMetrics::isFixedPitch):
        * kwq/KWQKHTMLSettings.h:
        * kwq/KWQLineEdit.h:
        * kwq/KWQLineEdit.mm:
        (-[NSSearchField _addStringToRecentSearches:]):
        (QLineEdit::setFont):
        * kwq/KWQListBox.h:
        * kwq/KWQListBox.mm:
        (QListBox::sizeForNumberOfLines):
        (QListBox::setFont):
        (-[KWQTableView drawRow:clipRect:]):
        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (WebCore::QPainter::font):
        (WebCore::QPainter::setFont):
        (WebCore::QPainter::fontMetrics):
        (WebCore::QPainter::_updateRenderer):
        (WebCore::QPainter::drawText):
        (WebCore::QPainter::drawHighlightForText):
        * kwq/KWQSlider.h:
        * kwq/KWQSlider.mm:
        (QSlider::setFont):
        * kwq/KWQTextEdit.h:
        * kwq/KWQTextEdit.mm:
        (QTextEdit::setFont):
        * platform/Font.cpp:
        (khtml::Font::update):
        * platform/Font.h:
        (WebCore::):
        (WebCore::Font::m_wordSpacing):
        (WebCore::Font::Font):
        (WebCore::Font::operator==):
        (WebCore::Font::operator!=):
        (WebCore::Font::fontMetrics):
        (WebCore::Font::pixelSize):
        (WebCore::Font::size):
        (WebCore::Font::letterSpacing):
        (WebCore::Font::setWordSpacing):
        (WebCore::Font::setLetterSpacing):
        (WebCore::Font::isFixedPitch):
        (WebCore::Font::isPrinterFont):
        (WebCore::Font::firstFamily):
        (WebCore::Font::family):
        (WebCore::Font::italic):
        (WebCore::Font::weight):
        (WebCore::Font::getNSFamily):
        (WebCore::Font::getNSFont):
        (WebCore::Font::getWebCoreFont):
        * platform/FontDescription.h:
        (WebCore::FontDescription::FontDescription):
        * platform/FontFamily.h:
        * platform/Widget.h:
        * platform/mac/WidgetMac.mm:
        (WebCore::Widget::font):
        (WebCore::Widget::setFont):
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::selectionRect):
        (WebCore::InlineTextBox::paint):
        (WebCore::InlineTextBox::positionForOffset):
        * rendering/RenderBlock.cpp:
        (WebCore::stripTrailingSpace):
        * rendering/RenderText.cpp:
        (WebCore::RenderText::cacheWidths):
        (WebCore::RenderText::trimmedMinMaxWidth):
        (WebCore::RenderText::calcMinMaxWidth):
        (WebCore::RenderText::font):
        (WebCore::RenderText::width):
        * rendering/RenderText.h:
        * rendering/bidi.cpp:
        (khtml::RenderBlock::computeHorizontalPositionsForLine):
        (khtml::RenderBlock::findNextLineBreak):
        * rendering/render_br.cpp:
        (WebCore::RenderBR::lineHeight):
        * rendering/render_flow.cpp:
        (WebCore::RenderFlow::lineHeight):
        * rendering/render_form.cpp:
        (WebCore::RenderFormElement::setStyle):
        (WebCore::RenderFormElement::addIntrinsicMarginsIfAllowed):
        * rendering/render_image.cpp:
        (WebCore::RenderImage::paint):
        * rendering/render_line.cpp:
        (WebCore::InlineFlowBox::placeBoxesHorizontally):
        (WebCore::InlineFlowBox::paintDecorations):
        (WebCore::EllipsisBox::paint):
        * rendering/render_list.cpp:
        (RenderListMarker::paint):
        * rendering/render_object.cpp:
        (WebCore::RenderObject::getVerticalPosition):
        (WebCore::RenderObject::lineHeight):
        * rendering/render_object.h:
        (WebCore::RenderObject::font):
        * rendering/render_replaced.cpp:
        (WebCore::RenderWidget::setStyle):
        * rendering/render_style.h:
        (khtml::RenderStyle::fontSize):
        (khtml::RenderStyle::fontMetrics):
        (khtml::RenderStyle::wordSpacing):
        (khtml::RenderStyle::letterSpacing):
        (khtml::RenderStyle::setFontDescription):
        (khtml::RenderStyle::setWordSpacing):
        (khtml::RenderStyle::setLetterSpacing):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@13063 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1431b3a8
2006-02-28 David Hyatt <hyatt@apple.com>
Fold QFont into Font and eliminate QFont completely.
Reviewed by eric
* ForwardingHeaders/qfont.h: Removed.
* WebCore.xcodeproj/project.pbxproj:
* bindings/objc/DOM.mm:
(-[DOMElement _font]):
* bridge/mac/MacFrame.mm:
(WebCore::MacFrame::attributedString):
(WebCore::MacFrame::fontForSelection):
(WebCore::MacFrame::fontAttributesForSelectionStart):
* bridge/mac/WebCoreFrameBridge.mm:
* css/css_computedstyle.cpp:
(WebCore::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
* css/cssstyleselector.cpp:
(WebCore::CSSStyleSelector::applyProperty):
* dom/DocumentImpl.cpp:
(WebCore::DocumentImpl::recalcStyle):
* ksvg2/svg/SVGLengthImpl.cpp:
(SVGLengthImpl::updateValue):
* kwq/KWQAccObject.mm:
(AXAttributeStringSetStyle):
* kwq/KWQComboBox.h:
* kwq/KWQComboBox.mm:
(QComboBox::setFont):
* kwq/KWQFont.h: Removed.
* kwq/KWQFont.mm: Removed.
* kwq/KWQFontMetrics.h:
* kwq/KWQFontMetrics.mm:
(QFontMetricsPrivate::QFontMetricsPrivate):
(QFontMetricsPrivate::~QFontMetricsPrivate):
(QFontMetricsPrivate::getRenderer):
(QFontMetricsPrivate::fontDescription):
(QFontMetricsPrivate::setFontDescription):
(QFontMetricsPrivate::getWebCoreFont):
(QFontMetricsPrivate::isFixedPitch):
(QFontMetricsPrivate::determinePitch):
(QFontMetrics::QFontMetrics):
(QFontMetrics::setFontDescription):
(QFontMetrics::width):
(QFontMetrics::floatWidth):
(QFontMetrics::selectionRectForText):
(QFontMetrics::checkSelectionPoint):
(QFontMetrics::getWebCoreFont):
(QFontMetrics::isFixedPitch):
* kwq/KWQKHTMLSettings.h:
* kwq/KWQLineEdit.h:
* kwq/KWQLineEdit.mm:
(-[NSSearchField _addStringToRecentSearches:]):
(QLineEdit::setFont):
* kwq/KWQListBox.h:
* kwq/KWQListBox.mm:
(QListBox::sizeForNumberOfLines):
(QListBox::setFont):
(-[KWQTableView drawRow:clipRect:]):
* kwq/KWQPainter.h:
* kwq/KWQPainter.mm:
(WebCore::QPainter::font):
(WebCore::QPainter::setFont):
(WebCore::QPainter::fontMetrics):
(WebCore::QPainter::_updateRenderer):
(WebCore::QPainter::drawText):
(WebCore::QPainter::drawHighlightForText):
* kwq/KWQSlider.h:
* kwq/KWQSlider.mm:
(QSlider::setFont):
* kwq/KWQTextEdit.h:
* kwq/KWQTextEdit.mm:
(QTextEdit::setFont):
* platform/Font.cpp:
(khtml::Font::update):
* platform/Font.h:
(WebCore::):
(WebCore::Font::m_wordSpacing):
(WebCore::Font::Font):
(WebCore::Font::operator==):
(WebCore::Font::operator!=):
(WebCore::Font::fontMetrics):
(WebCore::Font::pixelSize):
(WebCore::Font::size):
(WebCore::Font::letterSpacing):
(WebCore::Font::setWordSpacing):
(WebCore::Font::setLetterSpacing):
(WebCore::Font::isFixedPitch):
(WebCore::Font::isPrinterFont):
(WebCore::Font::firstFamily):
(WebCore::Font::family):
(WebCore::Font::italic):
(WebCore::Font::weight):
(WebCore::Font::getNSFamily):
(WebCore::Font::getNSFont):
(WebCore::Font::getWebCoreFont):
* platform/FontDescription.h:
(WebCore::FontDescription::FontDescription):
* platform/FontFamily.h:
* platform/Widget.h:
* platform/mac/WidgetMac.mm:
(WebCore::Widget::font):
(WebCore::Widget::setFont):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::selectionRect):
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::positionForOffset):
* rendering/RenderBlock.cpp:
(WebCore::stripTrailingSpace):
* rendering/RenderText.cpp:
(WebCore::RenderText::cacheWidths):
(WebCore::RenderText::trimmedMinMaxWidth):
(WebCore::RenderText::calcMinMaxWidth):
(WebCore::RenderText::font):
(WebCore::RenderText::width):
* rendering/RenderText.h:
* rendering/bidi.cpp:
(khtml::RenderBlock::computeHorizontalPositionsForLine):
(khtml::RenderBlock::findNextLineBreak):
* rendering/render_br.cpp:
(WebCore::RenderBR::lineHeight):
* rendering/render_flow.cpp:
(WebCore::RenderFlow::lineHeight):
* rendering/render_form.cpp:
(WebCore::RenderFormElement::setStyle):
(WebCore::RenderFormElement::addIntrinsicMarginsIfAllowed):
* rendering/render_image.cpp:
(WebCore::RenderImage::paint):
* rendering/render_line.cpp:
(WebCore::InlineFlowBox::placeBoxesHorizontally):
(WebCore::InlineFlowBox::paintDecorations):
(WebCore::EllipsisBox::paint):
* rendering/render_list.cpp:
(RenderListMarker::paint):
* rendering/render_object.cpp:
(WebCore::RenderObject::getVerticalPosition):
(WebCore::RenderObject::lineHeight):
* rendering/render_object.h:
(WebCore::RenderObject::font):
* rendering/render_replaced.cpp:
(WebCore::RenderWidget::setStyle):
* rendering/render_style.h:
(khtml::RenderStyle::fontSize):
(khtml::RenderStyle::fontMetrics):
(khtml::RenderStyle::wordSpacing):
(khtml::RenderStyle::letterSpacing):
(khtml::RenderStyle::setFontDescription):
(khtml::RenderStyle::setWordSpacing):
(khtml::RenderStyle::setLetterSpacing):
2006-02-28 Darin Adler <darin@apple.com>
Reviewed by Adele.
......
......@@ -241,8 +241,6 @@
93F1992F08245E59001E9ABC /* Cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868402DE3B8601EA4122 /* Cursor.h */; };
93F1993308245E59001E9ABC /* KWQDef.h in Headers */ = {isa = PBXBuildFile; fileRef = F58784DA02DE375901EA4122 /* KWQDef.h */; };
93F1993908245E59001E9ABC /* KWQFileButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CCF7D4033BD43C008635CE /* KWQFileButton.h */; };
93F1993A08245E59001E9ABC /* KWQFont.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868A02DE3B8601EA4122 /* KWQFont.h */; };
93F1993C08245E59001E9ABC /* KWQFontMetrics.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868D02DE3B8601EA4122 /* KWQFontMetrics.h */; };
93F1993E08245E59001E9ABC /* KWQGuardedPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = F587869002DE3B8601EA4122 /* KWQGuardedPtr.h */; };
93F1994508245E59001E9ABC /* KWQKCookieJar.h in Headers */ = {isa = PBXBuildFile; fileRef = F58784EE02DE375901EA4122 /* KWQKCookieJar.h */; };
93F1994F08245E59001E9ABC /* KWQKHTMLSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = F587863A02DE3A1401EA4122 /* KWQKHTMLSettings.h */; };
......@@ -330,8 +328,6 @@
93F19A0B08245E59001E9ABC /* westResizeCursor.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 84C0FA2E052B966D000440A1 /* westResizeCursor.tiff */; };
93F19A1708245E59001E9ABC /* KWQComboBox.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784D202DE375901EA4122 /* KWQComboBox.mm */; };
93F19A1808245E59001E9ABC /* KWQCString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F58784D502DE375901EA4122 /* KWQCString.cpp */; };
93F19A1E08245E59001E9ABC /* KWQFont.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784E002DE375901EA4122 /* KWQFont.mm */; };
93F19A1F08245E59001E9ABC /* KWQFontMetrics.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784E202DE375901EA4122 /* KWQFontMetrics.mm */; };
93F19A2208245E59001E9ABC /* KWQGuardedPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F58784E602DE375901EA4122 /* KWQGuardedPtr.cpp */; };
93F19A2508245E59001E9ABC /* KWQKCookieJar.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784EF02DE375901EA4122 /* KWQKCookieJar.mm */; };
93F19A2608245E59001E9ABC /* CursorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784F002DE375901EA4122 /* CursorMac.mm */; };
......@@ -903,6 +899,8 @@
BC73E3190978AFFC00EDFF8A /* IntPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = BC73E3180978AFFB00EDFF8A /* IntPoint.h */; };
BC73E3920978CED700EDFF8A /* FloatPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC73E3900978CED700EDFF8A /* FloatPoint.cpp */; };
BC73E3930978CED700EDFF8A /* FloatPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = BC73E3910978CED700EDFF8A /* FloatPoint.h */; };
BC9B62E409B3DC85006131EB /* KWQFontMetrics.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B62E209B3DC85006131EB /* KWQFontMetrics.h */; };
BC9B62E509B3DC85006131EB /* KWQFontMetrics.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC9B62E309B3DC85006131EB /* KWQFontMetrics.mm */; };
BC9C328B09933A6E001D6924 /* ImageAnimationObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9C328A09933A6D001D6924 /* ImageAnimationObserver.h */; };
BCB16AF90979A08500467741 /* FloatRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16AF50979A08500467741 /* FloatRect.cpp */; };
BCB16AFA0979A08500467741 /* FloatRect.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16AF60979A08500467741 /* FloatRect.h */; };
......@@ -1956,6 +1954,8 @@
BC7B2AF90450824100A8000F /* KWQScrollBar.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQScrollBar.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BC86FB8D061F5C23006BB822 /* KWQSlider.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQSlider.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BC86FB8E061F5C23006BB822 /* KWQSlider.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQSlider.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BC9B62E209B3DC85006131EB /* KWQFontMetrics.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQFontMetrics.h; sourceTree = "<group>"; };
BC9B62E309B3DC85006131EB /* KWQFontMetrics.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQFontMetrics.mm; sourceTree = "<group>"; };
BC9C328A09933A6D001D6924 /* ImageAnimationObserver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ImageAnimationObserver.h; path = platform/ImageAnimationObserver.h; sourceTree = "<group>"; };
BCB16AF50979A08500467741 /* FloatRect.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = FloatRect.cpp; path = platform/FloatRect.cpp; sourceTree = "<group>"; };
BCB16AF60979A08500467741 /* FloatRect.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FloatRect.h; path = platform/FloatRect.h; sourceTree = "<group>"; };
......@@ -2201,8 +2201,6 @@
F58784D202DE375901EA4122 /* KWQComboBox.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQComboBox.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58784D502DE375901EA4122 /* KWQCString.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KWQCString.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58784DA02DE375901EA4122 /* KWQDef.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQDef.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58784E002DE375901EA4122 /* KWQFont.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQFont.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58784E202DE375901EA4122 /* KWQFontMetrics.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQFontMetrics.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58784E602DE375901EA4122 /* KWQGuardedPtr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KWQGuardedPtr.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58784EE02DE375901EA4122 /* KWQKCookieJar.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQKCookieJar.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58784EF02DE375901EA4122 /* KWQKCookieJar.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQKCookieJar.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
......@@ -2253,8 +2251,6 @@
F587868202DE3B8601EA4122 /* KWQComboBox.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQComboBox.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587868302DE3B8601EA4122 /* KWQCString.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQCString.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587868402DE3B8601EA4122 /* Cursor.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = Cursor.h; path = platform/Cursor.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587868A02DE3B8601EA4122 /* KWQFont.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQFont.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587868D02DE3B8601EA4122 /* KWQFontMetrics.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQFontMetrics.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587869002DE3B8601EA4122 /* KWQGuardedPtr.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQGuardedPtr.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587869802DE3B8601EA4122 /* KWQLineEdit.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQLineEdit.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587869902DE3B8601EA4122 /* KWQPtrList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQPtrList.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
......@@ -3841,10 +3837,8 @@
F58784D202DE375901EA4122 /* KWQComboBox.mm */,
F58784D502DE375901EA4122 /* KWQCString.cpp */,
F587868302DE3B8601EA4122 /* KWQCString.h */,
F587868A02DE3B8601EA4122 /* KWQFont.h */,
F58784E002DE375901EA4122 /* KWQFont.mm */,
F587868D02DE3B8601EA4122 /* KWQFontMetrics.h */,
F58784E202DE375901EA4122 /* KWQFontMetrics.mm */,
BC9B62E209B3DC85006131EB /* KWQFontMetrics.h */,
BC9B62E309B3DC85006131EB /* KWQFontMetrics.mm */,
F58784E602DE375901EA4122 /* KWQGuardedPtr.cpp */,
F587869002DE3B8601EA4122 /* KWQGuardedPtr.h */,
F587869802DE3B8601EA4122 /* KWQLineEdit.h */,
......@@ -3932,8 +3926,6 @@
93F1992F08245E59001E9ABC /* Cursor.h in Headers */,
93F1993308245E59001E9ABC /* KWQDef.h in Headers */,
93F1993908245E59001E9ABC /* KWQFileButton.h in Headers */,
93F1993A08245E59001E9ABC /* KWQFont.h in Headers */,
93F1993C08245E59001E9ABC /* KWQFontMetrics.h in Headers */,
93F1993E08245E59001E9ABC /* KWQGuardedPtr.h in Headers */,
93F1994508245E59001E9ABC /* KWQKCookieJar.h in Headers */,
93F1994F08245E59001E9ABC /* KWQKHTMLSettings.h in Headers */,
......@@ -4408,6 +4400,7 @@
657BD74E09AFDC54005A2056 /* StreamingTextDecoder.h in Headers */,
657BD75009AFDC54005A2056 /* TextEncoding.h in Headers */,
BC6D6E2609AF943500F59759 /* ScrollView.h in Headers */,
BC9B62E409B3DC85006131EB /* KWQFontMetrics.h in Headers */,
65F537D909B2B20F00F3DC4A /* CharsetNames.h in Headers */,
65F5386909B2BFDA00F3DC4A /* ExtraCFEncodings.h in Headers */,
935EB36209B2D7DB00F3AF5B /* TransferJobClient.h in Headers */,
......@@ -5051,8 +5044,6 @@
files = (
93F19A1708245E59001E9ABC /* KWQComboBox.mm in Sources */,
93F19A1808245E59001E9ABC /* KWQCString.cpp in Sources */,
93F19A1E08245E59001E9ABC /* KWQFont.mm in Sources */,
93F19A1F08245E59001E9ABC /* KWQFontMetrics.mm in Sources */,
93F19A2208245E59001E9ABC /* KWQGuardedPtr.cpp in Sources */,
93F19A2508245E59001E9ABC /* KWQKCookieJar.mm in Sources */,
93F19A2608245E59001E9ABC /* CursorMac.mm in Sources */,
......@@ -5523,6 +5514,7 @@
6593923A09AE435C002C531F /* KURLMac.mm in Sources */,
BC6D6DD209AF906600F59759 /* Font.cpp in Sources */,
9353676B09AED88B00D35CD6 /* ScrollViewMac.mm in Sources */,
BC9B62E509B3DC85006131EB /* KWQFontMetrics.mm in Sources */,
657BD74D09AFDC54005A2056 /* StreamingTextDecoder.cpp in Sources */,
657BD74F09AFDC54005A2056 /* TextEncoding.cpp in Sources */,
6576F9D609B2484A000041F7 /* TextEncodingMac.cpp in Sources */,
......
......@@ -1493,7 +1493,7 @@ static ListenerMap *listenerMap;
{
RenderObject *renderer = [self _elementImpl]->renderer();
if (renderer) {
return renderer->style()->qfont().getNSFont();
return renderer->style()->font().getNSFont();
}
return nil;
}
......
......@@ -2326,7 +2326,7 @@ NSAttributedString *MacFrame::attributedString(NodeImpl *_start, int startOffset
RenderObject *renderer = n->renderer();
if (renderer) {
RenderStyle *style = renderer->style();
NSFont *font = style->qfont().getNSFont();
NSFont *font = style->font().getNSFont();
bool needSpace = pendingStyledSpace != nil;
if (n->isTextNode()) {
if (hasNewLine) {
......@@ -2667,7 +2667,7 @@ NSAttributedString *MacFrame::attributedString(NodeImpl *_start, int startOffset
RenderStyle *style = r->style();
int rx;
NSFont *font = style->qfont().getNSFont();
NSFont *font = style->font().getNSFont();
float pointSize = [font pointSize];
#ifdef POSITION_LIST
......@@ -2801,7 +2801,7 @@ NSFont *MacFrame::fontForSelection(bool *hasMultipleFonts) const
NSFont *result = 0;
if (style)
result = style->qfont().getNSFont();
result = style->font().getNSFont();
if (nodeToRemove) {
int exceptionCode;
......@@ -2825,7 +2825,7 @@ NSFont *MacFrame::fontForSelection(bool *hasMultipleFonts) const
if (!renderer)
continue;
// FIXME: Are there any node types that have renderers, but that we should be skipping?
NSFont *f = renderer->style()->qfont().getNSFont();
NSFont *f = renderer->style()->font().getNSFont();
if (font == nil) {
font = f;
if (!hasMultipleFonts)
......@@ -2852,8 +2852,8 @@ NSDictionary *MacFrame::fontAttributesForSelectionStart() const
if (style->backgroundColor().isValid() && style->backgroundColor().alpha() != 0)
[result setObject:nsColor(style->backgroundColor()) forKey:NSBackgroundColorAttributeName];
if (style->qfont().getNSFont())
[result setObject:style->qfont().getNSFont() forKey:NSFontAttributeName];
if (style->font().getNSFont())
[result setObject:style->font().getNSFont() forKey:NSFontAttributeName];
if (style->color().isValid() && style->color() != Color::black)
[result setObject:nsColor(style->color()) forKey:NSForegroundColorAttributeName];
......
......@@ -38,7 +38,7 @@
#import "CharsetNames.h"
#import "KWQClipboard.h"
#import "KWQEditCommand.h"
#import "KWQFont.h"
#import "Font.h"
#import "FoundationExtras.h"
#import "KWQLoader.h"
#import "KWQPageState.h"
......
......@@ -653,8 +653,8 @@ PassRefPtr<CSSValueImpl> CSSComputedStyleDeclarationImpl::getPropertyCSSValue(in
}
case CSS_PROP_FONT_SIZE:
{
FontDescription def = style->fontDescription();
return new CSSPrimitiveValueImpl(def.specifiedSize(), CSSPrimitiveValue::CSS_PX);
FontDescription desc = style->fontDescription();
return new CSSPrimitiveValueImpl(desc.computedPixelSize(), CSSPrimitiveValue::CSS_PX);
}
case CSS_PROP_FONT_STRETCH:
// FIXME: unimplemented
......@@ -681,7 +681,7 @@ PassRefPtr<CSSValueImpl> CSSComputedStyleDeclarationImpl::getPropertyCSSValue(in
// FIXME: this does not reflect the full range of weights
// that can be expressed with CSS
const FontDescription& desc = style->fontDescription();
if (desc.weight() == QFont::Bold)
if (desc.weight() == cBoldWeight)
return new CSSPrimitiveValueImpl(CSS_VAL_BOLD);
else
return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL);
......
......@@ -1983,7 +1983,7 @@ void CSSStyleSelector::applyProperty( int id, CSSValueImpl *value )
if (isInherit)
fontDescription.setWeight(parentStyle->fontDescription().weight());
else if (isInitial)
fontDescription.setWeight(QFont::Normal);
fontDescription.setWeight(cNormalWeight);
else {
if (!primitiveValue) return;
if (primitiveValue->getIdent()) {
......@@ -1995,7 +1995,7 @@ void CSSStyleSelector::applyProperty( int id, CSSValueImpl *value )
case CSS_VAL_700:
case CSS_VAL_800:
case CSS_VAL_900:
fontDescription.setWeight(QFont::Bold);
fontDescription.setWeight(cBoldWeight);
break;
case CSS_VAL_NORMAL:
case CSS_VAL_LIGHTER:
......@@ -2004,7 +2004,7 @@ void CSSStyleSelector::applyProperty( int id, CSSValueImpl *value )
case CSS_VAL_300:
case CSS_VAL_400:
case CSS_VAL_500:
fontDescription.setWeight(QFont::Normal);
fontDescription.setWeight(cNormalWeight);
break;
default:
return;
......@@ -2930,7 +2930,7 @@ void CSSStyleSelector::applyProperty( int id, CSSValueImpl *value )
}
lineHeight = Length(primitiveValue->computeLength(style, multiplier), Fixed);
} else if (type == CSSPrimitiveValue::CSS_PERCENTAGE)
lineHeight = Length( ( style->qfont().pixelSize() * int(primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_PERCENTAGE)) ) / 100, Fixed );
lineHeight = Length( (style->fontSize() * int(primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_PERCENTAGE)) ) / 100, Fixed );
else if (type == CSSPrimitiveValue::CSS_NUMBER)
lineHeight = Length(int(primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_NUMBER)*100), Percent);
else
......
......@@ -794,10 +794,6 @@ void DocumentImpl::recalcStyle(StyleChange change)
// ### make the font stuff _really_ work!!!!
FontDescription fontDescription;
QFont f;
fontDescription.setFamily(*(f.firstFamily()));
fontDescription.setItalic(f.italic());
fontDescription.setWeight(f.weight());
fontDescription.setUsePrinterFont(printing());
if (m_view) {
const KHTMLSettings *settings = m_view->frame()->settings();
......
......@@ -214,8 +214,8 @@ void SVGLengthImpl::updateValue(bool notify)
case SVG_LENGTHTYPE_EMS:
case SVG_LENGTHTYPE_EXS:
if (m_context && m_context->renderer()) {
khtml::RenderStyle *style = m_context->renderer()->style();
float useSize = style->qfont().pixelSize();
RenderStyle *style = m_context->renderer()->style();
float useSize = style->fontSize();
ASSERT(useSize > 0);
if (m_unitType == SVG_LENGTHTYPE_EMS)
m_value = m_valueInSpecifiedUnits * useSize;
......
......@@ -1205,7 +1205,7 @@ static void AXAttributeStringSetStyle(NSMutableAttributedString *attrString, Ren
RenderStyle *style = renderer->style();
// set basic font info
AXAttributeStringSetFont(attrString, NSAccessibilityFontTextAttribute, style->qfont().getNSFont(), range);
AXAttributeStringSetFont(attrString, NSAccessibilityFontTextAttribute, style->font().getNSFont(), range);
// set basic colors
AXAttributeStringSetColor(attrString, NSAccessibilityForegroundColorTextAttribute, nsColor(style->color()), range);
......
......@@ -52,7 +52,7 @@ public:
IntRect frameGeometry() const;
void setFrameGeometry(const IntRect &);
int baselinePosition(int height) const;
void setFont(const QFont &);
void setFont(const WebCore::Font&);
void itemSelected();
......
......@@ -286,7 +286,7 @@ void QComboBox::itemSelected()
_activated.call(_currentItem);
}
void QComboBox::setFont(const QFont &f)
void QComboBox::setFont(const Font& f)
{
Widget::setFont(f);
......
/*
* Copyright (C) 2003 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef QFONT_H_
#define QFONT_H_
#include "FontFamily.h"
#include "WebCoreTextRendererFactory.h"
class QFont {
public:
enum Weight { Normal = 50, Bold = 63 };
enum Pitch { Unknown, Fixed, Variable };
QFont();
~QFont();
QFont(const QFont &);
QFont &operator=(const QFont &);
void setFamily(const QString &);
QString family() const;
const FontFamily *firstFamily() const { return &_family; }
FontFamily *firstFamily() { return &_family; }
void setFirstFamily(const FontFamily &family);
void setWeight(int);
int weight() const;
bool bold() const;
void setItalic(bool);
bool italic() const;
void setPixelSize(float s);
int pixelSize() const { return (int)_size; }
bool isFixedPitch() const { if (_pitch == Unknown) determinePitch(); return _pitch == Fixed; };
void determinePitch() const;
void setPrinterFont(bool);
bool isPrinterFont() const { return _isPrinterFont; }
bool operator==(const QFont &x) const;
bool operator!=(const QFont &x) const { return !(*this == x); }
#if __APPLE__
NSString *getNSFamily() const { return _family.getNSFamily(); }
int getNSTraits() const { return _trait; }
float getNSSize() const { return _size; }
NSFont *getNSFont() const { return getWebCoreFont().font; }
const WebCoreFont &getWebCoreFont() const;
#endif
private:
FontFamily _family;
int _trait;
float _size;
bool _isPrinterFont : 1;
mutable Pitch _pitch : 2;
#if __APPLE__
mutable WebCoreFont m_webCoreFont;
#endif
};
#endif
/*
* Copyright (C) 2003 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#import "KWQFont.h"
#import "KWQExceptions.h"
#import "QString.h"
#import "FoundationExtras.h"
#import "WebCoreTextRendererFactory.h"
QFont::QFont()
: _trait(0)
, _size(12.0)
, _isPrinterFont(false)
, _pitch(Unknown)
{
m_webCoreFont.font = nil;
}
QFont::~QFont()
{
KWQRelease(m_webCoreFont.font);
}
QFont::QFont(const QFont &other)
: _family(other._family)
, _trait(other._trait)
, _size(other._size)
, _isPrinterFont(other._isPrinterFont)
, _pitch(other._pitch)
, m_webCoreFont(other.m_webCoreFont)
{
KWQRetain(m_webCoreFont.font);
}
QFont &QFont::operator=(const QFont &other)
{
_family = other._family;
_trait = other._trait;
_size = other._size;
_isPrinterFont = other._isPrinterFont;
_pitch = other._pitch;
KWQRetain(other.m_webCoreFont.font);
KWQRelease(m_webCoreFont.font);
m_webCoreFont = other.m_webCoreFont;
return *this;
}
QString QFont::family() const
{
return _family.family().qstring();
}
void QFont::setFamily(const QString &qfamilyName)
{
_family.setFamily(qfamilyName);
KWQRelease(m_webCoreFont.font);
m_webCoreFont.font = nil;
_pitch = Unknown;
}
void QFont::setFirstFamily(const FontFamily& family)
{
_family = family;
KWQRelease(m_webCoreFont.font);
m_webCoreFont.font = nil;
_pitch = Unknown;
}
void QFont::setPixelSize(float s)
{
if (_size != s) {
KWQRelease(m_webCoreFont.font);
m_webCoreFont.font = nil;
_pitch = Unknown;
}
_size = s;
}
void QFont::setWeight(int weight)
{
if (weight == Bold) {
if (!(_trait & NSBoldFontMask)) {
KWQRelease(m_webCoreFont.font);
m_webCoreFont.font = nil;
_pitch = Unknown;
}
_trait |= NSBoldFontMask;