Changeset 3648 – WebKit
source link: https://trac.webkit.org/changeset/3648/webkit
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Changeset 3648 in webkit
Show the changes in full context
Timestamp: Feb 14, 2003 11:43:07 AM (21 years ago) Author: hyatt Message:
Make the inline box model live. Borders/backgrounds and text
decorations have been rewritten.
Also fixed a bug with clip rects. They didn't include borders.
Reviewed by kocienda
- khtml/css/cssstyleselector.cpp:
- khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall):
- khtml/rendering/bidi.cpp:
- khtml/rendering/font.cpp:
- khtml/rendering/font.h:
- khtml/rendering/render_block.cpp:
- khtml/rendering/render_block.h:
- khtml/rendering/render_box.cpp: (RenderBox::paintBackground): (RenderBox::paintBackgroundExtended): (RenderBox::getClipRect): (RenderBox::position):
- khtml/rendering/render_box.h:
- khtml/rendering/render_flow.cpp: (RenderFlow::createInlineBox): (RenderFlow::paintLineBoxBackgroundBorder): (RenderFlow::paintLineBoxDecorations): (RenderFlow::repaint):
- khtml/rendering/render_flow.h:
- khtml/rendering/render_inline.cpp: (RenderInline::paintObject): (RenderInline::width): (RenderInline::height): (RenderInline::offsetLeft): (RenderInline::offsetTop): (RenderInline::nodeAtPoint):
- khtml/rendering/render_inline.h:
- khtml/rendering/render_line.cpp: (InlineFlowBox::verticallyAlignBoxes): (InlineFlowBox::computeLogicalBoxHeights): (InlineFlowBox::placeBoxesVertically): (InlineFlowBox::shrinkBoxesWithNoTextChildren): (InlineFlowBox::paintBackgroundAndBorder): (shouldDrawDecoration): (InlineFlowBox::paintDecorations):
- khtml/rendering/render_line.h:
- khtml/rendering/render_object.cpp: (RenderObject::setStyle): (RenderObject::lineHeight): (RenderObject::getTextDecorationColors):
- khtml/rendering/render_object.h:
- khtml/rendering/render_root.cpp: (enclosingPositionedRect):
- khtml/rendering/render_style.cpp: (StyleVisualData::StyleVisualData): (StyleInheritedData::StyleInheritedData): (StyleInheritedData::operator==): (RenderStyle::diff):
- khtml/rendering/render_style.h:
- khtml/rendering/render_table.cpp: (RenderTableCell::repaintRectangle):
- khtml/rendering/render_text.cpp: (TextRun::paintDecoration): (TextRun::checkSelectionPoint): (RenderText::nodeAtPoint): (RenderText::cursorPos): (RenderText::absolutePosition): (RenderText::paintObject): (RenderText::paint): (RenderText::position):
- khtml/rendering/render_text.h:
- kwq/KWQPainter.h:
- kwq/KWQPainter.mm: (QPainter::drawLineForText):
- kwq/WebCoreTextRenderer.h:
Location: trunk/WebCore Files:
-
TabularUnified trunk/WebCore/ChangeLog-2003-10-25 ¶
r3647 r3648 1 2003-02-14 David Hyatt <[email protected]> 2 3 Make the inline box model live. Borders/backgrounds and text 4 decorations have been rewritten. 5 6 Also fixed a bug with clip rects. They didn't include borders. 7 8 Reviewed by kocienda 9 10 * khtml/css/cssstyleselector.cpp: 11 * khtml/ecma/kjs_window.cpp: 12 (WindowFunc::tryCall): 13 * khtml/rendering/bidi.cpp: 14 * khtml/rendering/font.cpp: 15 * khtml/rendering/font.h: 16 * khtml/rendering/render_block.cpp: 17 * khtml/rendering/render_block.h: 18 * khtml/rendering/render_box.cpp: 19 (RenderBox::paintBackground): 20 (RenderBox::paintBackgroundExtended): 21 (RenderBox::getClipRect): 22 (RenderBox::position): 23 * khtml/rendering/render_box.h: 24 * khtml/rendering/render_flow.cpp: 25 (RenderFlow::createInlineBox): 26 (RenderFlow::paintLineBoxBackgroundBorder): 27 (RenderFlow::paintLineBoxDecorations): 28 (RenderFlow::repaint): 29 * khtml/rendering/render_flow.h: 30 * khtml/rendering/render_inline.cpp: 31 (RenderInline::paintObject): 32 (RenderInline::width): 33 (RenderInline::height): 34 (RenderInline::offsetLeft): 35 (RenderInline::offsetTop): 36 (RenderInline::nodeAtPoint): 37 * khtml/rendering/render_inline.h: 38 * khtml/rendering/render_line.cpp: 39 (InlineFlowBox::verticallyAlignBoxes): 40 (InlineFlowBox::computeLogicalBoxHeights): 41 (InlineFlowBox::placeBoxesVertically): 42 (InlineFlowBox::shrinkBoxesWithNoTextChildren): 43 (InlineFlowBox::paintBackgroundAndBorder): 44 (shouldDrawDecoration): 45 (InlineFlowBox::paintDecorations): 46 * khtml/rendering/render_line.h: 47 * khtml/rendering/render_object.cpp: 48 (RenderObject::setStyle): 49 (RenderObject::lineHeight): 50 (RenderObject::getTextDecorationColors): 51 * khtml/rendering/render_object.h: 52 * khtml/rendering/render_root.cpp: 53 (enclosingPositionedRect): 54 * khtml/rendering/render_style.cpp: 55 (StyleVisualData::StyleVisualData): 56 (StyleInheritedData::StyleInheritedData): 57 (StyleInheritedData::operator==): 58 (RenderStyle::diff): 59 * khtml/rendering/render_style.h: 60 * khtml/rendering/render_table.cpp: 61 (RenderTableCell::repaintRectangle): 62 * khtml/rendering/render_text.cpp: 63 (TextRun::paintDecoration): 64 (TextRun::checkSelectionPoint): 65 (RenderText::nodeAtPoint): 66 (RenderText::cursorPos): 67 (RenderText::absolutePosition): 68 (RenderText::paintObject): 69 (RenderText::paint): 70 (RenderText::position): 71 * khtml/rendering/render_text.h: 72 * kwq/KWQPainter.h: 73 * kwq/KWQPainter.mm: 74 (QPainter::drawLineForText): 75 * kwq/WebCoreTextRenderer.h: 76 1 77 2003-02-13 Trey Matteson <[email protected]> 2 78 -
TabularUnified trunk/WebCore/ChangeLog-2005-08-23 ¶
r3647 r3648 1 2003-02-14 David Hyatt <[email protected]> 2 3 Make the inline box model live. Borders/backgrounds and text 4 decorations have been rewritten. 5 6 Also fixed a bug with clip rects. They didn't include borders. 7 8 Reviewed by kocienda 9 10 * khtml/css/cssstyleselector.cpp: 11 * khtml/ecma/kjs_window.cpp: 12 (WindowFunc::tryCall): 13 * khtml/rendering/bidi.cpp: 14 * khtml/rendering/font.cpp: 15 * khtml/rendering/font.h: 16 * khtml/rendering/render_block.cpp: 17 * khtml/rendering/render_block.h: 18 * khtml/rendering/render_box.cpp: 19 (RenderBox::paintBackground): 20 (RenderBox::paintBackgroundExtended): 21 (RenderBox::getClipRect): 22 (RenderBox::position): 23 * khtml/rendering/render_box.h: 24 * khtml/rendering/render_flow.cpp: 25 (RenderFlow::createInlineBox): 26 (RenderFlow::paintLineBoxBackgroundBorder): 27 (RenderFlow::paintLineBoxDecorations): 28 (RenderFlow::repaint): 29 * khtml/rendering/render_flow.h: 30 * khtml/rendering/render_inline.cpp: 31 (RenderInline::paintObject): 32 (RenderInline::width): 33 (RenderInline::height): 34 (RenderInline::offsetLeft): 35 (RenderInline::offsetTop): 36 (RenderInline::nodeAtPoint): 37 * khtml/rendering/render_inline.h: 38 * khtml/rendering/render_line.cpp: 39 (InlineFlowBox::verticallyAlignBoxes): 40 (InlineFlowBox::computeLogicalBoxHeights): 41 (InlineFlowBox::placeBoxesVertically): 42 (InlineFlowBox::shrinkBoxesWithNoTextChildren): 43 (InlineFlowBox::paintBackgroundAndBorder): 44 (shouldDrawDecoration): 45 (InlineFlowBox::paintDecorations): 46 * khtml/rendering/render_line.h: 47 * khtml/rendering/render_object.cpp: 48 (RenderObject::setStyle): 49 (RenderObject::lineHeight): 50 (RenderObject::getTextDecorationColors): 51 * khtml/rendering/render_object.h: 52 * khtml/rendering/render_root.cpp: 53 (enclosingPositionedRect): 54 * khtml/rendering/render_style.cpp: 55 (StyleVisualData::StyleVisualData): 56 (StyleInheritedData::StyleInheritedData): 57 (StyleInheritedData::operator==): 58 (RenderStyle::diff): 59 * khtml/rendering/render_style.h: 60 * khtml/rendering/render_table.cpp: 61 (RenderTableCell::repaintRectangle): 62 * khtml/rendering/render_text.cpp: 63 (TextRun::paintDecoration): 64 (TextRun::checkSelectionPoint): 65 (RenderText::nodeAtPoint): 66 (RenderText::cursorPos): 67 (RenderText::absolutePosition): 68 (RenderText::paintObject): 69 (RenderText::paint): 70 (RenderText::position): 71 * khtml/rendering/render_text.h: 72 * kwq/KWQPainter.h: 73 * kwq/KWQPainter.mm: 74 (QPainter::drawLineForText): 75 * kwq/WebCoreTextRenderer.h: 76 1 77 2003-02-13 Trey Matteson <[email protected]> 2 78 -
TabularUnified trunk/WebCore/khtml/css/cssstyleselector.cpp ¶
r3548 r3648 1905 1905 case CSS_PROP_COLOR: 1906 1906 style->setColor(col); break; 1907 case CSS_PROP_TEXT_DECORATION_COLOR:1908 style->setTextDecorationColor(col); break;1909 1907 case CSS_PROP_OUTLINE_COLOR: 1910 1908 style->setOutlineColor(col); break; … … 2660 2658 { 2661 2659 if(!parentNode) return; 2662 style-> setTextDecoration(parentStyle->textDecoration());2663 style->setTextDecoration Color(parentStyle->textDecorationColor());2660 style->addToTextDecorationsInEffect(parentStyle->textDecorationsInEffect()); 2661 style->setTextDecoration(parentStyle->textDecorationsInEffect()); 2664 2662 return; 2665 2663 } … … 2693 2691 } 2694 2692 } 2695 style->setTextDecoration(t); 2696 style->setTextDecorationColor(style->color()); 2697 break; 2693 2694 style->addToTextDecorationsInEffect(t); 2695 style->setTextDecoration(t); 2696 break; 2698 2697 } 2699 2698 case CSS_PROP__KONQ_FLOW_MODE: -
TabularUnified trunk/WebCore/khtml/ecma/kjs_window.cpp ¶
r3646 r3648 1445 1445 if (listener) { 1446 1446 DOM::Document doc = part->document(); 1447 if (doc.isHTMLDocument()) { 1448 DOM::HTMLDocument htmlDoc = doc; 1449 htmlDoc.body().addEventListener(args[0].toString(exec).string(),listener,args[2].toBoolean(exec)); 1450 } 1451 else 1452 doc.addEventListener(args[0].toString(exec).string(),listener,args[2].toBoolean(exec)); 1447 doc.addEventListener(args[0].toString(exec).string(),listener,args[2].toBoolean(exec)); 1453 1448 } 1454 1449 return Undefined(); … … 1460 1455 if (listener) { 1461 1456 DOM::Document doc = part->document(); 1462 if (doc.isHTMLDocument()) { 1463 DOM::HTMLDocument htmlDoc = doc; 1464 htmlDoc.body().removeEventListener(args[0].toString(exec).string(),listener,args[2].toBoolean(exec)); 1465 } 1466 else 1467 doc.removeEventListener(args[0].toString(exec).string(),listener,args[2].toBoolean(exec)); 1457 doc.removeEventListener(args[0].toString(exec).string(),listener,args[2].toBoolean(exec)); 1468 1458 } 1469 1459 return Undefined(); -
TabularUnified trunk/WebCore/khtml/rendering/bidi.cpp ¶
r3627 r3648 667 667 lineBox->verticallyAlignBoxes(m_height); 668 668 669 // See if the line spilled out. If so set overflow height accordingly. 670 int bottomOfLine = lineBox->bottomOverflow(); 671 if (bottomOfLine > m_height && bottomOfLine > m_overflowHeight) 672 m_overflowHeight = bottomOfLine; 673 669 674 // Now make sure we place replaced render objects correctly. 670 675 BidiRun* r = runs.first(); 671 676 while (r) { 672 r->obj->position(r->box, r-> box->yPos(), r->start, r->stop - r->start, r->level%2);677 r->obj->position(r->box, r->start, r->stop - r->start, r->level%2); 673 678 r = runs.next(); 674 679 } … … 1250 1255 adjustEmbeddding = false; 1251 1256 } 1252 1257 1258 m_firstLine = false; 1253 1259 newLine(); 1254 1260 } 1255 m_firstLine = false;1256 1261 deleteMidpoints(renderArena(), smidpoints); 1257 1262 } … … 1269 1274 1270 1275 // Always make sure this is at least our height. 1271 m_overflowHeight = m_height; 1276 if (m_overflowHeight < m_height) 1277 m_overflowHeight = m_height; 1272 1278 1273 1279 #if BIDI_DEBUG > 1 -
TabularUnified trunk/WebCore/khtml/rendering/font.cpp ¶
r3455 r3648 39 39 40 40 using namespace khtml; 41 42 #if APPLE_CHANGES43 void Font::drawLineForText( QPainter *p, int x, int y, QChar *str, int slen, int pos, int len,44 int toAdd, int yOffset, QPainter::TextDirection d, int from, int to) const45 {46 p->drawLineForText(x, y, str + pos, std::min(slen - pos, len), from, to, toAdd, yOffset, d, letterSpacing, wordSpacing);47 }48 #endif49 41 50 42 void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, int len, -
TabularUnified trunk/WebCore/khtml/rendering/font.h ¶
r3465 r3648 102 102 103 103 #if APPLE_CHANGES 104 void drawLineForText( QPainter *p, int x, int y, QChar *str, int slen, int pos, int len, int toAdd, int yOffset,105 QPainter::TextDirection d, int from=-1, int to=-1) const;106 104 float floatWidth( QChar *str, int slen, int pos, int len ) const; 107 105 void floatCharacterWidths( QChar *str, int slen, int pos, int len, int toAdd, float *buffer) const; -
TabularUnified trunk/WebCore/khtml/rendering/render_block.cpp ¶
r3627 r3648 1031 1031 if (!overhangingContents() && !isRelPositioned() && !isPositioned() ) 1032 1032 { 1033 int h = m_height; 1034 if(m_specialObjects && floatBottom() > h) h = floatBottom(); 1035 if((_ty > _y + _h) || (_ty + h < _y)) 1036 { 1037 //kdDebug( 6040 ) << "cut!" << endl; 1033 int h = m_overflowHeight; 1034 int yPos = _ty; 1035 if (m_specialObjects && floatBottom() > h) 1036 h = floatBottom(); 1037 1038 // Sanity check the first line 1039 // to see if it extended a little above our box. Overflow out the bottom is already handled via 1040 // overflowHeight(), so we don't need to check that. 1041 if (m_firstLineBox && m_firstLineBox->topOverflow() < 0) 1042 yPos += m_firstLineBox->topOverflow(); 1043 1044 if( (yPos > _y + _h) || (_ty + h < _y)) 1038 1045 return; 1039 }1040 1046 } 1041 1047 … … 1060 1066 1061 1067 // 2. paint contents 1068 paintLineBoxBackgroundBorder(p, _x, _y, _w, _h, _tx, _ty, paintAction); 1062 1069 RenderObject *child = firstChild(); 1063 1070 while(child != 0) … … 1067 1074 child = child->nextSibling(); 1068 1075 } 1069 1076 paintLineBoxDecorations(p, _x, _y, _w, _h, _tx, _ty, paintAction); 1077 1070 1078 // 3. paint floats. 1071 1079 if (!inlineRunIn && (paintAction == PaintActionFloat || paintAction == PaintActionSelection)) -
TabularUnified trunk/WebCore/khtml/rendering/render_block.h ¶
r3627 r3648 95 95 BidiIterator findNextLineBreak(BidiIterator &start, QPtrList<BidiIterator>& midpoints); 96 96 InlineFlowBox* constructLine(QPtrList<BidiRun>& runs, const BidiIterator& start, 97 const BidiIterator& end); 97 const BidiIterator& end); 98 98 InlineFlowBox* createLineBoxes(RenderObject* obj); 99 99 void computeHorizontalPositionsForLine(InlineFlowBox* lineBox, QPtrList<BidiRun>& runs, -
TabularUnified trunk/WebCore/khtml/rendering/render_box.cpp ¶
r3627 r3648 199 199 void RenderBox::paintBackground(QPainter *p, const QColor &c, CachedImage *bg, int clipy, int cliph, int _tx, int _ty, int w, int height) 200 200 { 201 paintBackgroundExtended(p, c, bg, clipy, cliph, _tx, _ty, w, height, 202 borderLeft(), borderRight()); 203 } 204 205 void RenderBox::paintBackgroundExtended(QPainter *p, const QColor &c, CachedImage *bg, int clipy, int cliph, 206 int _tx, int _ty, int w, int h, 207 int bleft, int bright) 208 { 201 209 if(c.isValid()) 202 210 p->fillRect(_tx, clipy, w, cliph, c); … … 216 224 int cw,ch; 217 225 int cx,cy; 218 int vpab = b orderRight() + borderLeft();226 int vpab = bleft + bright; 219 227 int hpab = borderTop() + borderBottom(); 220 228 221 229 // CSS2 chapter 14.2.1 222 230 … … 224 232 { 225 233 //scroll 226 int pw = m_width - vpab; 227 int h = isHtml() ? height : m_height; 228 if (isTableCell()) { 229 // Table cells' m_height variable is wrong. You have to take into 230 // account this hack extra stuff to get the right height. 231 // Otherwise using background-position: bottom won't work in 232 // a table cell that has the extra height. -dwh 233 RenderTableCell* tableCell = static_cast<RenderTableCell*>(this); 234 h += tableCell->borderTopExtra() + tableCell->borderBottomExtra(); 235 } 234 int pw = w - vpab; 236 235 int ph = h - hpab; 237 236 … … 263 262 } 264 263 265 cx += b orderLeft();264 cx += bleft; 266 265 267 266 if( (bgr == NO_REPEAT || bgr == REPEAT_X) && h > pixh ) { … … 314 313 } 315 314 316 if( (bgr == NO_REPEAT || bgr == REPEAT_X) && h eight> pixh ) {315 if( (bgr == NO_REPEAT || bgr == REPEAT_X) && h > pixh ) { 317 316 ch = pixh; 318 317 cy = vr.y() + sptr->backgroundYPosition().minWidth(ph-pixh); … … 328 327 329 328 QRect fix(cx,cy,cw,ch); 330 QRect ele(_tx+b orderLeft(),_ty+borderTop(),w-vpab,height-hpab);329 QRect ele(_tx+bleft,_ty+borderTop(),w-vpab,h-hpab); 331 330 QRect b = fix.intersect(ele); 332 331 sx+=b.x()-cx; … … 365 364 QRect RenderBox::getClipRect(int tx, int ty) 366 365 { 367 int bl=borderLeft(),bt=borderTop(),bb=borderBottom(),br=borderRight(); 368 int clipx = tx+bl; 369 int clipy = ty+bt; 370 int clipw = m_width-bl-br; 371 int cliph = m_height-bt-bb; 366 int clipx = tx; 367 int clipy = ty; 368 int clipw = m_width; 369 int cliph = m_height; 372 370 373 371 if (!style()->clipLeft().isVariable()) 374 372 { 375 int c=style()->clipLeft().width(m_width -bl-br);373 int c=style()->clipLeft().width(m_width); 376 374 clipx+=c; 377 375 clipw-=c; … … 380 378 if (!style()->clipRight().isVariable()) 381 379 { 382 int w = style()->clipRight().width(m_width -bl-br);383 clipw -= m_width - bl - br -w;380 int w = style()->clipRight().width(m_width); 381 clipw -= m_width - w; 384 382 } 385 383 386 384 if (!style()->clipTop().isVariable()) 387 385 { 388 int c=style()->clipTop().width(m_height -bt-bb);386 int c=style()->clipTop().width(m_height); 389 387 clipy+=c; 390 388 cliph-=c; … … 392 390 if (!style()->clipBottom().isVariable()) 393 391 { 394 int h = style()->clipBottom().width(m_height -bt-bb);395 cliph -= m_height - bt - bb -h;392 int h = style()->clipBottom().width(m_height); 393 cliph -= m_height - h; 396 394 } 397 395 //kdDebug( 6040 ) << "setting clip("<<clipx<<","<<clipy<<","<<clipw<<","<<cliph<<")"<<endl; … … 438 436 } 439 437 440 void RenderBox::position(InlineBox* box, int y, intfrom, int len, bool reverse)438 void RenderBox::position(InlineBox* box, int from, int len, bool reverse) 441 439 { 442 440 m_x = box->xPos(); 443 m_y = y + marginTop();441 m_y = box->yPos(); 444 442 } 445 443 -
TabularUnified trunk/WebCore/khtml/rendering/render_box.h ¶
r3627 r3648 84 84 void calcHorizontalMargins(const Length& ml, const Length& mr, int cw); 85 85 86 virtual void position(InlineBox* box, int y, intfrom, int len, bool reverse);86 virtual void position(InlineBox* box, int from, int len, bool reverse); 87 87 88 88 virtual int lowestPosition() const; … … 112 112 113 113 virtual RenderLayer* layer() const { return m_layer; } 114 115 virtual void paintBackgroundExtended(QPainter *p, const QColor &c, CachedImage *bg, int clipy, int cliph, 116 int _tx, int _ty, int w, int height, 117 int bleft, int bright); 114 118 115 119 protected: -
TabularUnified trunk/WebCore/khtml/rendering/render_flow.cpp ¶
r3627 r3648 154 154 InlineBox* RenderFlow::createInlineBox() 155 155 { 156 InlineFlowBox* flowBox = new (renderArena()) InlineFlowBox(this); 156 InlineFlowBox* flowBox = 0; 157 if (isInlineFlow()) 158 flowBox = new (renderArena()) InlineFlowBox(this); 159 else 160 flowBox = new (renderArena()) RootInlineBox(this); 161 157 162 if (!m_firstLineBox) 158 163 m_firstLineBox = m_lastLineBox = flowBox; … … 166 171 } 167 172 173 void RenderFlow::paintLineBoxBackgroundBorder(QPainter *p, int _x, int _y, 174 int _w, int _h, int _tx, int _ty, PaintAction paintAction) 175 { 176 if (!firstLineBox()) 177 return; 178 179 if (style()->visibility() == VISIBLE && paintAction == PaintActionForeground) { 180 // We can check the first box and last box and avoid painting if we don't 181 // intersect. 182 int yPos = _ty + firstLineBox()->yPos(); 183 int h = lastLineBox()->yPos() + lastLineBox()->height() - firstLineBox()->yPos(); 184 if( (yPos > _y + _h) || (yPos + h < _y)) 185 return; 186 187 // See if our boxes intersect with the dirty rect. If so, then we paint 188 // them. Note that boxes can easily overlap, so we can't make any assumptions 189 // based off positions of our first line box or our last line box. 190 int xOffsetWithinLineBoxes = 0; 191 for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) { 192 yPos = _ty + curr->yPos(); 193 h = curr->height(); 194 if ((yPos <= _y + _h) && (yPos + h >= _y)) 195 curr->paintBackgroundAndBorder(p, _x, _y, _w, _h, _tx, _ty, xOffsetWithinLineBoxes); 196 xOffsetWithinLineBoxes += curr->width(); 197 } 198 } 199 } 200 201 void RenderFlow::paintLineBoxDecorations(QPainter *p, int _x, int _y, 202 int _w, int _h, int _tx, int _ty, PaintAction paintAction) 203 { 204 if (!firstLineBox()) 205 return; 206 207 if (style()->visibility() == VISIBLE && paintAction == PaintActionForeground) { 208 // We only paint line box decorations in strict or almost strict mode. 209 // Otherwise we let the TextRuns paint their own decorations. 210 RenderObject* curr = this; 211 while (curr && !curr->element()) 212 curr = curr->container(); 213 bool quirksMode = (curr && curr->element()->getDocument()->inQuirksMode()); 214 if (quirksMode) 215 return; 216 217 // We can check the first box and last box and avoid painting if we don't 218 // intersect. 219 int yPos = _ty + firstLineBox()->yPos();; 220 int h = lastLineBox()->yPos() + lastLineBox()->height() - firstLineBox()->yPos(); 221 if( (yPos > _y + _h) || (yPos + h < _y)) 222 return; 223 224 // See if our boxes intersect with the dirty rect. If so, then we paint 225 // them. Note that boxes can easily overlap, so we can't make any assumptions 226 // based off positions of our first line box or our last line box. 227 for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) { 228 yPos = _ty + curr->yPos(); 229 h = curr->height(); 230 if ((yPos <= _y + _h) && (yPos + h >= _y)) 231 curr->paintDecorations(p, _x, _y, _w, _h, _tx, _ty); 232 } 233 } 234 } 235 236 void RenderFlow::repaint(bool immediate) 237 { 238 if (isInlineFlow()) { 239 // Find our leftmost position. 240 int left = 0; 241 int top = firstLineBox() ? firstLineBox()->yPos() : 0; 242 for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) 243 if (curr == firstLineBox() || curr->xPos() < left) 244 left = curr->xPos(); 245 246 // Now invalidate a rectangle. 247 int ow = style() ? style()->outlineWidth() : 0; 248 containingBlock()->repaintRectangle(-ow+left, -ow+top, 249 width()+ow*2, height()+ow*2, immediate); 250 } 251 else { 252 if (firstLineBox() && firstLineBox()->topOverflow() < 0) { 253 int ow = style() ? style()->outlineWidth() : 0; 254 repaintRectangle(-ow, -ow+firstLineBox()->topOverflow(), 255 overflowWidth()+ow*2, overflowHeight()+ow*2, immediate); 256 } 257 else 258 return RenderBox::repaint(); 259 } 260 } 261 -
TabularUnified trunk/WebCore/khtml/rendering/render_flow.h ¶
r3627 r3648 60 60 virtual void detach(RenderArena* arena); 61 61 62 InlineFlowBox* firstLineBox() { return m_firstLineBox; } 63 InlineFlowBox* lastLineBox() { return m_lastLineBox; } 62 InlineFlowBox* firstLineBox() const { return m_firstLineBox; } 63 InlineFlowBox* lastLineBox() const { return m_lastLineBox; } 64 64 65 65 virtual InlineBox* createInlineBox(); 66 67 void paintLineBoxBackgroundBorder(QPainter *p, int _x, int _y, 68 int _w, int _h, int _tx, int _ty, PaintAction paintAction); 69 void paintLineBoxDecorations(QPainter *p, int _x, int _y, 70 int _w, int _h, int _tx, int _ty, PaintAction paintAction); 71 72 virtual void repaint(bool immediate = false); 66 73 67 74 protected: -
TabularUnified trunk/WebCore/khtml/rendering/render_inline.cpp ¶
r3627 r3648 25 25 #include "render_inline.h" 26 26 #include "render_block.h" 27 #include "xml/dom_nodeimpl.h" 27 28 28 29 using namespace khtml; … … 244 245 int _w, int _h, int _tx, int _ty, PaintAction paintAction) 245 246 { 246 247 247 #ifdef DEBUG_LAYOUT 248 248 // kdDebug( 6040 ) << renderName() << "(RenderInline) " << this << " ::paintObject() w/h = (" << width() << "/" << height() << ")" << endl; 249 249 #endif 250 250 251 // FIXME: This function will eventually get much more complicated. :) - dwh252 // paint contents251 paintLineBoxBackgroundBorder(p, _x, _y, _w, _h, _tx, _ty, paintAction); 252 253 253 RenderObject *child = firstChild(); 254 254 while(child != 0) … … 258 258 child = child->nextSibling(); 259 259 } 260 261 paintLineBoxDecorations(p, _x, _y, _w, _h, _tx, _ty, paintAction); 260 262 } 261 263 … … 275 277 } 276 278 277 short RenderInline::offsetWidth() const 278 { 279 short w = 0; 280 RenderObject* object = firstChild(); 281 while (object) { 282 w += object->offsetWidth(); 283 object = object->nextSibling(); 284 } 285 return w; 286 } 287 288 int RenderInline::offsetHeight() const 289 { 290 if (firstChild()) 291 return firstChild()->offsetHeight(); 292 return height(); 279 short RenderInline::width() const 280 { 281 // Return the width of the minimal left side and the maximal right side. 282 short leftSide = 0; 283 short rightSide = 0; 284 for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) { 285 if (curr == firstLineBox() || curr->xPos() < leftSide) 286 leftSide = curr->xPos(); 287 if (curr == firstLineBox() || curr->xPos() + curr->width() > rightSide) 288 rightSide = curr->xPos() + curr->width(); 289 } 290 291 return rightSide - leftSide; 292 } 293 294 int RenderInline::height() const 295 { 296 int h = 0; 297 if (firstLineBox()) 298 h = lastLineBox()->yPos() + lastLineBox()->height() - firstLineBox()->yPos(); 299 return h; 293 300 } 294 301 … … 296 303 { 297 304 int x = RenderFlow::offsetLeft(); 298 RenderObject* textChild = (RenderObject*)this; 299 while (textChild && textChild->isInline() && !textChild->isText()) 300 textChild = textChild->firstChild(); 301 if (textChild && textChild != this) 302 x += textChild->xPos() - textChild->borderLeft() - textChild->paddingLeft(); 305 if (firstLineBox()) 306 x += firstLineBox()->xPos(); 303 307 return x; 304 308 } … … 306 310 int RenderInline::offsetTop() const 307 311 { 308 RenderObject* textChild = (RenderObject*)this;309 while (textChild && textChild->isInline() && !textChild->isText())310 textChild = textChild->firstChild();311 312 int y = RenderFlow::offsetTop(); 312 if ( textChild && textChild != this)313 y += textChild->yPos() - textChild->borderTop() - textChild->paddingTop();313 if (firstLineBox()) 314 y += firstLineBox()->yPos(); 314 315 return y; 315 316 } … … 323 324 return "RenderInline"; 324 325 } 326 327 bool RenderInline::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty, bool inside) 328 { 329 // Always check our kids. 330 for (RenderObject* child = lastChild(); child; child = child->previousSibling()) 331 if (!child->layer() && child->nodeAtPoint(info, _x, _y, _tx, _ty)) 332 inside = true; 333 334 // Check our line boxes if we're still not inside. 335 if (!inside && style()->visibility() != HIDDEN) { 336 // See if we're inside one of our line boxes. 337 for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) { 338 if((_y >=_ty + curr->m_y) && (_y < _ty + curr->m_y + curr->m_height) && 339 (_x >= _tx + curr->m_x) && (_x <_tx + curr->m_x + curr->m_width) ) { 340 inside = true; 341 break; 342 } 343 } 344 } 345 346 if (inside && element()) { 347 if (info.innerNode() && info.innerNode()->renderer() && 348 !info.innerNode()->renderer()->isInline()) { 349 // Within the same layer, inlines are ALWAYS fully above blocks. Change inner node. 350 info.setInnerNode(element()); 351 352 // Clear everything else. 353 info.setInnerNonSharedNode(0); 354 info.setURLElement(0); 355 } 356 357 if (!info.innerNode()) 358 info.setInnerNode(element()); 359 360 if(!info.innerNonSharedNode()) 361 info.setInnerNonSharedNode(element()); 362 363 if (!info.URLElement()) { 364 RenderObject* p = this; 365 while (p) { 366 if (p->element() && p->element()->hasAnchor()) { 367 info.setURLElement(p->element()); 368 break; 369 } 370 if (!isSpecial()) break; 371 p = p->parent(); 372 } 373 } 374 375 } 376 377 if (!info.readonly()) { 378 // lets see if we need a new style 379 bool oldinside = mouseInside(); 380 setMouseInside(inside); 381 382 setHoverAndActive(info, oldinside, inside); 383 if (!isInline() && continuation()) 384 continuation()->setHoverAndActive(info, oldinside, inside); 385 } 386 387 return inside; 388 } 389 -
TabularUnified trunk/WebCore/khtml/rendering/render_inline.h ¶
r3627 r3648 54 54 int tx, int ty, PaintAction paintAction); 55 55 56 virtual bool nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty, bool inside); 57 56 58 virtual void calcMinMaxWidth(); 57 59 … … 59 61 virtual bool requiresLayer() { return isRelPositioned(); } 60 62 63 virtual short width() const; 64 virtual int height() const; 65 61 66 // used to calculate offsetWidth/Height. Overridden by inlines (render_flow) to return 62 67 // the remaining width on a given line (and the height of a single line). 63 virtual short offsetWidth() const;64 virtual int offsetHeight() const;65 68 virtual int offsetLeft() const; 66 69 virtual int offsetTop() const; -
TabularUnified trunk/WebCore/khtml/rendering/render_line.cpp ¶
r3627 r3648 273 273 274 274 int maxHeight = maxAscent + maxDescent; 275 placeBoxesVertically(heightOfBlock, maxHeight, maxAscent, strictMode); 275 int topPosition = heightOfBlock; 276 int bottomPosition = heightOfBlock; 277 placeBoxesVertically(heightOfBlock, maxHeight, maxAscent, strictMode, topPosition, bottomPosition); 278 279 setOverflowPositions(topPosition, bottomPosition); 280 281 // Shrink boxes with no text children in quirks and almost strict mode. 282 if (!strictMode) 283 shrinkBoxesWithNoTextChildren(topPosition, bottomPosition); 284 276 285 heightOfBlock += maxHeight; 277 286 } … … 305 314 int& maxAscent, int& maxDescent, bool strictMode) 306 315 { 307 if ( !parent()) {316 if (isRootInlineBox()) { 308 317 // Examine our root box. 309 318 setHeight(object()->lineHeight(m_firstLine)); … … 351 360 } 352 361 353 void InlineFlowBox::placeBoxesVertically(int y, int maxHeight, int maxAscent, bool strictMode) 354 { 355 if (!parent()) { 356 if (hasTextChildren() || strictMode) 357 setYPos(y + maxAscent - baseline());// Place our root box. 358 // FIXME: Use the tallest y/height out of our children. 359 } 362 void InlineFlowBox::placeBoxesVertically(int y, int maxHeight, int maxAscent, bool strictMode, 363 int& topPosition, int& bottomPosition) 364 { 365 if (isRootInlineBox()) 366 setYPos(y + maxAscent - baseline());// Place our root box. 360 367 361 368 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { 369 // Adjust boxes to use their real box y/height and not the logical height (as dictated by 370 // line-height). 371 if (curr->isInlineFlowBox()) 372 static_cast<InlineFlowBox*>(curr)->placeBoxesVertically(y, maxHeight, maxAscent, strictMode, 373 topPosition, bottomPosition); 374 375 bool childAffectsTopBottomPos = true; 362 376 if (curr->yPos() == PositionTop) 363 377 curr->setYPos(y); 364 378 else if (curr->yPos() == PositionBottom) 365 379 curr->setYPos(y + maxHeight - curr->height()); 366 else if (curr->hasTextChildren() || strictMode) 367 // FIXME: Use the tallest y/height out of our children. 380 else { 381 if (!curr->hasTextChildren() && !strictMode) 382 childAffectsTopBottomPos = false; 368 383 curr->setYPos(curr->yPos() + y + maxAscent - curr->baseline()); 369 370 // FIXME: Adjust the y position and heights of replaced elements for margins. 371 // Adjust inline flows to use the font box height and not the logical height. 384 } 385 386 int newY = curr->yPos(); 387 int newHeight = curr->height(); 388 int newBaseline = curr->baseline(); 389 if (curr->isTextRun() || curr->isInlineFlowBox()) { 390 const QFontMetrics &fm = curr->object()->fontMetrics( m_firstLine ); 391 newBaseline = fm.ascent(); 392 newY += curr->baseline() - newBaseline; 393 newHeight = newBaseline+fm.descent(); 394 if (curr->isInlineFlowBox()) { 395 newHeight += curr->object()->borderTop() + curr->object()->paddingTop() + 396 curr->object()->borderBottom() + curr->object()->paddingBottom(); 397 newY -= curr->object()->borderTop() + curr->object()->paddingTop(); 398 newBaseline += curr->object()->borderTop() + curr->object()->paddingTop(); 399 } 400 } 401 else { 402 newY += curr->object()->marginTop(); 403 newHeight = curr->height() - (curr->object()->marginTop() + curr->object()->marginBottom()); 404 } 405 406 curr->setYPos(newY); 407 curr->setHeight(newHeight); 408 curr->setBaseline(newBaseline); 409 410 if (childAffectsTopBottomPos) { 411 if (newY < topPosition) 412 topPosition = newY; 413 if (newY + newHeight > bottomPosition) 414 bottomPosition = newY + newHeight; 415 } 416 } 417 418 if (isRootInlineBox()) { 419 const QFontMetrics &fm = object()->fontMetrics( m_firstLine ); 420 setHeight(fm.ascent()+fm.descent()); 421 setYPos(yPos() + baseline() - fm.ascent()); 422 setBaseline(fm.ascent()); 423 if (hasTextChildren() || strictMode) { 424 if (yPos() < topPosition) 425 topPosition = yPos(); 426 if (yPos() + height() > bottomPosition) 427 bottomPosition = yPos() + height(); 428 } 429 } 430 } 431 432 void InlineFlowBox::shrinkBoxesWithNoTextChildren(int topPos, int bottomPos) 433 { 434 // First shrink our kids. 435 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { 372 436 if (curr->isInlineFlowBox()) 373 static_cast<InlineFlowBox*>(curr)->placeBoxesVertically(y, maxHeight, maxAscent, 374 strictMode); 375 } 376 } 377 378 437 static_cast<InlineFlowBox*>(curr)->shrinkBoxesWithNoTextChildren(topPos, bottomPos); 438 } 439 440 // See if we have text children. If not, then we need to shrink ourselves to fit on the line. 441 if (!hasTextChildren()) { 442 if (yPos() < topPos) 443 setYPos(topPos); 444 if (height() > bottomPos - topPos) 445 setHeight(bottomPos - topPos); 446 if (baseline() > height()) 447 setBaseline(height()); 448 } 449 } 450 451 void InlineFlowBox::paintBackgroundAndBorder(QPainter *p, int _x, int _y, 452 int _w, int _h, int _tx, int _ty, int xOffsetOnLine) 453 { 454 // Move x/y to our coordinates. 455 _tx += m_x; 456 _ty += m_y; 457 458 int w = width(); 459 int h = height(); 460 461 int my = QMAX(_ty,_y); 462 int mh; 463 if (_ty<_y) 464 mh= QMAX(0,h-(_y-_ty)); 465 else 466 mh = QMIN(_h,h); 467 468 // You can use p::first-line to specify a background. If so, the root line boxes for 469 // a line may actually have to paint a background. 470 RenderStyle* styleToUse = object()->style(m_firstLine); 471 if (object()->hasFirstLine() || (parent() && object()->shouldPaintBackgroundOrBorder())) { 472 CachedImage* bg = styleToUse->backgroundImage(); 473 bool hasBackgroundImage = bg && (bg->pixmap_size() == bg->valid_rect().size()) && 474 !bg->isTransparent() && !bg->isErrorImage(); 475 if (!hasBackgroundImage || (!prevLineBox() && !nextLineBox()) || !parent()) 476 object()->paintBackgroundExtended(p, styleToUse->backgroundColor(), 477 bg, my, mh, _tx, _ty, w, h, 478 borderLeft(), borderRight()); 479 else { 480 // We have a background image that spans multiple lines. 481 // We need to adjust _tx and _ty by the width of all previous lines. 482 // Think of background painting on inlines as though you had one long line, a single continuous 483 // strip. Even though that strip has been broken up across multiple lines, you still paint it 484 // as though you had one single line. This means each line has to pick up the background where 485 // the previous line left off. 486 int startX = _tx - xOffsetOnLine; 487 int totalWidth = xOffsetOnLine; 488 for (InlineRunBox* curr = this; curr; curr = curr->nextLineBox()) 489 totalWidth += curr->width(); 490 QRect clipRect(_tx, _ty, width(), height()); 491 clipRect = p->xForm(clipRect); 492 p->save(); 493 p->addClip(clipRect); 494 object()->paintBackgroundExtended(p, object()->style()->backgroundColor(), 495 object()->style()->backgroundImage(), my, mh, startX, _ty, 496 totalWidth, h, 497 borderLeft(), borderRight()); 498 p->restore(); 499 } 500 501 // :first-line cannot be used to put borders on a line. Always paint borders with our 502 // non-first-line style. 503 if (parent() && object()->style()->hasBorder()) 504 object()->paintBorder(p, _tx, _ty, w, h, object()->style(), includeLeftEdge(), includeRightEdge()); 505 } 506 } 507 508 static bool shouldDrawDecoration(RenderObject* obj) 509 { 510 bool shouldDraw = false; 511 for (RenderObject* curr = obj->firstChild(); 512 curr; curr = curr->nextSibling()) { 513 if (curr->isInlineFlow() || curr->isText()) { 514 shouldDraw = true; 515 break; 516 } 517 } 518 return shouldDraw; 519 } 520 521 void InlineFlowBox::paintDecorations(QPainter *p, int _x, int _y, 522 int _w, int _h, int _tx, int _ty) 523 { 524 // Now paint our text decorations. We only do this if we aren't in quirks mode (i.e., in 525 // almost-strict mode or strict mode). 526 _tx += m_x; 527 _ty += m_y; 528 RenderStyle* styleToUse = object()->style(m_firstLine); 529 int deco = parent() ? styleToUse->textDecoration() : styleToUse->textDecorationsInEffect(); 530 if (deco != TDNONE && shouldDrawDecoration(object())) { 531 // We must have child boxes and have decorations defined. 532 _tx += borderLeft() + paddingLeft(); 533 int w = m_width - (borderLeft() + paddingLeft() + borderRight() + paddingRight()); 534 QColor underline, overline, linethrough; 535 underline = overline = linethrough = styleToUse->color(); 536 if (!parent()) 537 object()->getTextDecorationColors(deco, underline, overline, linethrough); 538 if (deco & UNDERLINE) { 539 p->setPen(underline); 540 p->drawLineForText(_tx, _ty, m_baseline, w); 541 } 542 if (deco & OVERLINE) { 543 p->setPen(overline); 544 p->drawLineForText(_tx, _ty, 0, w); 545 } 546 if (deco & LINE_THROUGH) { 547 p->setPen(linethrough); 548 p->drawLineForText(_tx, _ty, 2*m_baseline/3, w); 549 } 550 } 551 } -
TabularUnified trunk/WebCore/khtml/rendering/render_line.h ¶
r3627 r3648 60 60 virtual bool isContainer() { return false; } 61 61 virtual bool isTextRun() { return false; } 62 virtual bool isRootInlineBox() { return false; } 62 63 63 64 bool isConstructed() { return m_constructed; } … … 93 94 94 95 virtual bool hasTextChildren() { return true; } 96 97 virtual int topOverflow() { return yPos(); } 98 virtual int bottomOverflow() { return yPos()+height(); } 95 99 96 100 public: // FIXME: Would like to make this protected, but methods are accessing these … … 127 131 void setNextLineBox(InlineRunBox* n) { m_nextLine = n; } 128 132 void setPreviousLineBox(InlineRunBox* p) { m_prevLine = p; } 133 134 virtual void paintBackgroundAndBorder(QPainter *p, int _x, int _y, 135 int _w, int _h, int _tx, int _ty, int xOffsetOnLine) {}; 136 virtual void paintDecorations(QPainter *p, int _x, int _y, 137 int _w, int _h, int _tx, int _ty) {}; 129 138 130 139 protected: … … 169 178 } 170 179 180 virtual void paintBackgroundAndBorder(QPainter *p, int _x, int _y, 181 int _w, int _h, int _tx, int _ty, int xOffsetOnLine); 182 virtual void paintDecorations(QPainter *p, int _x, int _y, 183 int _w, int _h, int _tx, int _ty); 184 171 185 int marginBorderPaddingLeft(); 172 186 int marginBorderPaddingRight(); … … 185 199 } 186 200 virtual bool hasTextChildren() { return m_hasTextChildren; } 187 201 188 202 // Helper functions used during line construction and placement. 189 203 void determineSpacingForFlowBoxes(bool lastLine, RenderObject* endObject); … … 198 212 void adjustMaxAscentAndDescent(int& maxAscent, int& maxDescent, 199 213 int maxPositionTop, int maxPositionBottom); 200 void placeBoxesVertically(int y, int maxHeight, int maxAscent, bool strictMode); 214 void placeBoxesVertically(int y, int maxHeight, int maxAscent, bool strictMode, 215 int& topPosition, int& bottomPosition); 216 void shrinkBoxesWithNoTextChildren(int topPosition, int bottomPosition); 217 218 virtual void setOverflowPositions(int top, int bottom) {} 201 219 202 220 protected: … … 208 226 }; 209 227 228 class RootInlineBox : public InlineFlowBox 229 { 230 public: 231 RootInlineBox(RenderObject* obj) 232 :InlineFlowBox(obj) 233 { 234 m_topOverflow = m_bottomOverflow = 0; 235 } 236 237 virtual bool isRootInlineBox() { return true; } 238 virtual int topOverflow() { return m_topOverflow; } 239 virtual int bottomOverflow() { return m_bottomOverflow; } 240 virtual void setOverflowPositions(int top, int bottom) { m_topOverflow = top; m_bottomOverflow = bottom; } 241 242 protected: 243 int m_topOverflow; 244 int m_bottomOverflow; 245 }; 246 210 247 }; //namespace 211 248 -
TabularUnified trunk/WebCore/khtml/rendering/render_object.cpp ¶
r3627 r3648 879 879 setMinMaxKnown(false); 880 880 setLayouted(false); 881 } else if ( m_parent ) { 881 } else if ( m_parent && !isText()) { 882 882 //qDebug("triggering repaint"); 883 883 repaint(); … … 1295 1295 short RenderObject::lineHeight( bool firstLine ) const 1296 1296 { 1297 Length lh; 1298 if( firstLine && hasFirstLine() ) { 1299 RenderStyle *pseudoStyle = style()->getPseudoStyle(RenderStyle::FIRST_LINE); 1300 if ( pseudoStyle ) 1301 lh = pseudoStyle->lineHeight(); 1302 } 1303 else 1304 lh = style()->lineHeight(); 1297 Length lh = style(firstLine)->lineHeight(); 1305 1298 1306 1299 // its "unset", choose nice default 1307 1300 if ( lh.value < 0 ) 1308 return style()->fontMetrics().lineSpacing(); 1301 return style(firstLine)->fontMetrics().lineSpacing(); 1309 1302 1310 1303 if ( lh.isPercent() ) 1311 return lh.minWidth( style()->font().pixelSize() ); 1304 return lh.minWidth( style(firstLine)->font().pixelSize() ); 1312 1305 1313 1306 // its fixed … … 1389 1382 } 1390 1383 1384 void RenderObject::getTextDecorationColors(int& decorations, QColor& underline, QColor& overline, 1385 QColor& linethrough) 1386 { 1387 int newDecorations = decorations; 1388 RenderObject* curr = this; 1389 do { 1390 int currDecs = curr->style()->textDecoration(); 1391 if (currDecs) { 1392 if (currDecs & UNDERLINE) { 1393 newDecorations &= ~UNDERLINE; 1394 underline = curr->style()->color(); 1395 } 1396 if (currDecs & OVERLINE) { 1397 newDecorations &= ~OVERLINE; 1398 overline = curr->style()->color(); 1399 } 1400 if (currDecs & LINE_THROUGH) { 1401 newDecorations &= ~LINE_THROUGH; 1402 linethrough = curr->style()->color(); 1403 } 1404 } 1405 curr = curr->parent(); 1406 if (curr && curr->isRenderBlock() && curr->continuation()) 1407 curr = curr->continuation(); 1408 } while (curr && newDecorations); 1409 1410 if (newDecorations) 1411 // Null out everything that's left. 1412 decorations &= ~newDecorations; 1413 } -
TabularUnified trunk/WebCore/khtml/rendering/render_object.h ¶
r3627 r3648 277 277 int _w, int _h, int _tx, int _ty) {}; 278 278 279 virtual void paintBackgroundExtended(QPainter *p, const QColor &c, CachedImage *bg, int clipy, int cliph, 280 int _tx, int _ty, int w, int height, 281 int bleft, int bright) {}; 282 279 283 /* 280 284 * This function calculates the minimum & maximum width that the object … … 331 335 friend class RenderImage; 332 336 friend class RenderText; 337 friend class RenderInline; 333 338 friend class RenderObject; 334 339 friend class RenderFrameSet; … … 483 488 } 484 489 490 void getTextDecorationColors(int& decorations, QColor& underline, QColor& overline, 491 QColor& linethrough); 492 485 493 enum BorderSide { 486 494 BSTop, BSBottom, BSLeft, BSRight … … 506 514 507 515 // positioning of inline childs (bidi) 508 virtual void position(InlineBox*, int, int, int,bool) {}516 virtual void position(InlineBox*, int, int, bool) {} 509 517 510 518 enum SelectionState { -
TabularUnified trunk/WebCore/khtml/rendering/render_root.cpp ¶
r3588 r3648 292 292 static QRect enclosingPositionedRect (RenderObject *n) 293 293 { 294 RenderObject *enclosingParent = (RenderObject*)n; 295 QRect rect; 296 297 while (enclosingParent && (enclosingParent->isText() || (enclosingParent->width() == 0 && enclosingParent->height() == 0))){ 298 enclosingParent = enclosingParent->parent(); 299 } 300 if (enclosingParent){ 294 RenderObject *enclosingParent = n->containingBlock(); 295 QRect rect(0,0,0,0); 296 if (enclosingParent) { 301 297 int ox, oy; 302 303 298 enclosingParent->absolutePosition(ox, oy); 304 299 rect.setX(ox); -
TabularUnified trunk/WebCore/khtml/rendering/render_style.cpp ¶
r3548 r3648 86 86 87 87 StyleVisualData::StyleVisualData() 88 : hasClip(false), colspan( 1 ), counter_increment( 0 ), counter_reset( 0 ), 88 : hasClip(false), textDecoration(TDNONE), colspan( 1 ), counter_increment( 0 ), counter_reset( 0 ), 89 89 palette( QApplication::palette() ) 90 90 { … … 96 96 StyleVisualData::StyleVisualData(const StyleVisualData& o ) 97 97 : Shared<StyleVisualData>(), 98 clip( o.clip ), hasClip( o.hasClip ), colspan( o.colspan ), 98 clip( o.clip ), hasClip( o.hasClip ), textDecoration(o.textDecoration), colspan( o.colspan ), 99 99 counter_increment( o.counter_increment ), counter_reset( o.counter_reset ), 100 100 palette( o.palette ) … … 131 131 StyleInheritedData::StyleInheritedData() 132 132 : indent( Fixed ), line_height( -100, Percent ), style_image( 0 ), 133 cursor_image( 0 ), font(), color( Qt::black ), decoration_color( Qt::black ),border_spacing( 0 )133 cursor_image( 0 ), font(), color( Qt::black ), border_spacing( 0 ) 134 134 { 135 135 } … … 143 143 indent( o.indent ), line_height( o.line_height ), style_image( o.style_image ), 144 144 cursor_image( o.cursor_image ), font( o.font ), 145 color( o.color ), decoration_color( o.decoration_color ),145 color( o.color ), 146 146 border_spacing( o.border_spacing ) 147 147 { … … 157 157 cursor_image == o.cursor_image && 158 158 font == o.font && 159 color == o.color && 160 decoration_color == o.decoration_color; 159 color == o.color; 161 160 162 161 // doesn't work because structs are not packed … … 339 338 340 339 if ( *box.get() != *other->box.get() || 341 *visual.get() != *other->visual.get() ||342 340 *surround.get() != *other->surround.get() || 343 341 !(inherited->indent == other->inherited->indent) || … … 350 348 !(inherited_flags._htmlHacks == other->inherited_flags._htmlHacks) || 351 349 !(noninherited_flags._position == other->noninherited_flags._position) || 352 !(noninherited_flags._floating == other->noninherited_flags._floating) ) 350 !(noninherited_flags._floating == other->noninherited_flags._floating) || 351 visual->colspan != other->visual->colspan || 352 visual->counter_increment != other->visual->counter_increment || 353 visual->counter_reset != other->visual->counter_reset) 353 354 return CbLayout; 354 355 … … 413 414 // DataRef<StyleBackgroundData> background; 414 415 if (inherited->color != other->inherited->color || 415 inherited->decoration_color != other->inherited->decoration_color ||416 416 !(inherited_flags._visibility == other->inherited_flags._visibility) || 417 417 !(noninherited_flags._overflow == other->noninherited_flags._overflow) || 418 418 !(noninherited_flags._bg_repeat == other->noninherited_flags._bg_repeat) || 419 419 !(noninherited_flags._bg_attachment == other->noninherited_flags._bg_attachment) || 420 !(inherited_flags._text_decoration == other->inherited_flags._text_decoration) || 421 *background.get() != *other->background.get() 420 !(inherited_flags._text_decorations == other->inherited_flags._text_decorations) || 421 *background.get() != *other->background.get() || 422 !(visual->clip == other->visual->clip) || 423 visual->hasClip != other->visual->hasClip || 424 visual->textDecoration != other->visual->textDecoration || 425 !(visual->palette == other->visual->palette) 422 426 ) 423 427 return Visible; -
TabularUnified trunk/WebCore/khtml/rendering/render_style.h ¶
r3376 r3648 324 324 bool operator==( const StyleVisualData &o ) const { 325 325 return ( clip == o.clip && 326 hasClip == o.hasClip && 326 hasClip == o.hasClip && 327 327 colspan == o.colspan && 328 328 counter_increment == o.counter_increment && 329 329 counter_reset == o.counter_reset && 330 palette == o.palette ); 330 palette == o.palette && textDecoration == o.textDecoration); 331 331 } 332 332 bool operator!=( const StyleVisualData &o ) const { … … 336 336 LengthBox clip; 337 337 bool hasClip : 1; 338 int textDecoration : 4; // Text decorations defined *only* by this element. 338 339 339 340 short colspan; // for html, not a css2 attribute … … 425 426 khtml::Font font; 426 427 QColor color; 427 QColor decoration_color; 428 428 429 429 short border_spacing; 430 430 }; … … 520 520 ETextAlign _text_align : 3; 521 521 ETextTransform _text_transform : 2; 522 int _text_decoration : 4; 522 int _text_decorations : 4; 523 523 ECursor _cursor_style : 4; 524 524 EDirection _direction : 1; … … 589 589 inherited_flags._text_align = TAAUTO; 590 590 inherited_flags._text_transform = TTNONE; 591 inherited_flags._text_decoration = TDNONE; 591 inherited_flags._text_decorations = TDNONE; 592 592 inherited_flags._cursor_style = CURSOR_AUTO; 593 593 inherited_flags._direction = LTR; … … 718 718 ETextAlign textAlign() const { return inherited_flags._text_align; } 719 719 ETextTransform textTransform() const { return inherited_flags._text_transform; } 720 int textDecoration () const { return inherited_flags._text_decoration; }721 const QColor &textDecorationColor() const { return inherited->decoration_color; }720 int textDecorationsInEffect() const { return inherited_flags._text_decorations; } 721 int textDecoration() const { return visual->textDecoration; } 722 722 int wordSpacing() const { return inherited->font.wordSpacing; } 723 723 int letterSpacing() const { return inherited->font.letterSpacing; } … … 831 831 void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; } 832 832 void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; } 833 void setTextDecoration(int v) { inherited_flags._text_decoration= v; }834 void setTextDecoration Color(const QColor &v) { SET_VAR(inherited,decoration_color,v)}833 void addToTextDecorationsInEffect(int v) { inherited_flags._text_decorations |= v; } 834 void setTextDecoration(int v) { SET_VAR(visual, textDecoration, v); } 835 835 void setDirection(EDirection v) { inherited_flags._direction = v; } 836 836 void setLineHeight(Length v) { SET_VAR(inherited,line_height,v) } -
TabularUnified trunk/WebCore/khtml/rendering/render_table.cpp ¶
r3627 r3648 1430 1430 void RenderTableCell::repaintRectangle(int x, int y, int w, int h, bool immediate, bool f) 1431 1431 { 1432 RenderBlock::repaintRectangle(x, y, w, h+_topExtra+_bottomExtra, immediate, f); 1432 y += _topExtra; 1433 RenderBlock::repaintRectangle(x, y, w, h, immediate, f); 1433 1434 } 1434 1435 -
TabularUnified trunk/WebCore/khtml/rendering/render_text.cpp ¶
r3627 r3648 99 99 100 100 #ifdef APPLE_CHANGES 101 void TextRun::paintDecoration( QPainter *pt, const Font *f, RenderText* p, 102 int _tx, int _ty, int deco, bool begin, bool end, int from, int to) 101 void TextRun::paintDecoration( QPainter *pt, int _tx, int _ty, int deco) 103 102 { 104 103 _tx += m_x; 105 104 _ty += m_y; 105 106 // Get the text decoration colors. 107 QColor underline, overline, linethrough; 108 object()->getTextDecorationColors(deco, underline, overline, linethrough); 106 109 107 110 // Use a special function for underlines to get the positioning exactly right. 108 111 if (deco & UNDERLINE) { 109 f->drawLineForText(pt, _tx, _ty, p->str->s, p->str->l, m_start, m_len,110 m_toAdd, m_baseline, m_reversed ? QPainter::RTL : QPainter::LTR, from, to);112 pt->setPen(underline); 113 pt->drawLineForText(_tx, _ty, m_baseline, m_width); 111 114 } 112 115 if (deco & OVERLINE) { 113 f->drawLineForText(pt, _tx, _ty, p->str->s, p->str->l, m_start, m_len,114 m_toAdd, 0, m_reversed ? QPainter::RTL : QPainter::LTR, from, to);116 pt->setPen(overline); 117 pt->drawLineForText(_tx, _ty, 0, m_width); 115 118 } 116 119 if (deco & LINE_THROUGH) { 117 f->drawLineForText(pt, _tx, _ty, p->str->s, p->str->l, m_start, m_len,118 m_toAdd, 2*m_baseline/3, m_reversed ? QPainter::RTL : QPainter::LTR, from, to);120 pt->setPen(linethrough); 121 pt->drawLineForText(_tx, _ty, 2*m_baseline/3, m_width); 119 122 } 120 123 } 121 124 #else 122 void TextRun::paintDecoration( QPainter *pt, RenderText* p, int _tx, int _ty, int decoration, bool begin, bool end)125 void TextRun::paintDecoration( QPainter *pt, int _tx, int _ty, int decoration) 123 126 { 124 127 _tx += m_x; … … 127 130 int width = m_width - 1; 128 131 129 if( begin ) 130 width -= p->paddingLeft() + p->borderLeft(); 131 132 if ( end ) 133 width -= p->paddingRight() + p->borderRight(); 134 132 QColor underline, overline, linethrough; 133 object()->getTextDecorationColors(decoration, underline, overline, linethrough); 134 135 135 int underlineOffset = ( pt->fontMetrics().height() + m_baseline ) / 2; 136 136 if(underlineOffset <= m_baseline) underlineOffset = m_baseline+1; 137 137 138 138 if(deco & UNDERLINE){ 139 pt->setPen(underline); 139 140 pt->drawLine(_tx, _ty + underlineOffset, _tx + width, _ty + underlineOffset ); 140 141 } 141 if(deco & OVERLINE) 142 if (deco & OVERLINE) { 143 pt->setPen(overline); 142 144 pt->drawLine(_tx, _ty, _tx + width, _ty ); 143 if(deco & LINE_THROUGH) 145 } 146 if(deco & LINE_THROUGH) { 147 pt->setPen(linethrough); 144 148 pt->drawLine(_tx, _ty + 2*m_baseline/3, _tx + width, _ty + 2*m_baseline/3 ); 149 } 145 150 // NO! Do NOT add BLINK! It is the most annouing feature of Netscape, and IE has a reason not to 146 151 // support it. Lars 147 152 } 148 153 #endif 149 150 151 void TextRun::paintBoxDecorations(QPainter *pt, RenderStyle* style, RenderText *p, int _tx, int _ty, bool begin, bool end)152 {153 int topExtra = p->borderTop() + p->paddingTop();154 int bottomExtra = p->borderBottom() + p->paddingBottom();155 // ### firstline156 int halfleading = (p->m_lineHeight - style->font().pixelSize() ) / 2;157 158 _tx += m_x;159 _ty += m_y + halfleading - topExtra;160 161 int width = m_width + p->borderLeft() + p->borderRight() + p->paddingLeft() + p->paddingRight();162 163 // the height of the decorations is: topBorder + topPadding + CSS font-size + bottomPadding + bottomBorder164 int height = style->font().pixelSize() + topExtra + bottomExtra;165 166 if( begin )167 _tx -= p->paddingLeft() + p->borderLeft();168 169 QColor c = style->backgroundColor();170 CachedImage *i = style->backgroundImage();171 if(c.isValid() && (!i || i->tiled_pixmap(c).mask()))172 pt->fillRect(_tx, _ty, width, height, c);173 174 if(i) {175 // ### might need to add some correct offsets176 // ### use paddingX/Y177 pt->drawTiledPixmap(_tx, _ty, width, height, i->tiled_pixmap(c));178 }179 180 #ifdef DEBUG_VALIGN181 pt->fillRect(_tx, _ty, width, height, Qt::cyan );182 #endif183 184 if(style->hasBorder())185 p->paintBorder(pt, _tx, _ty, width, height, style, begin, end);186 }187 154 188 155 #define LOCAL_WIDTH_BUF_SIZE 1024 … … 197 164 return SelectionPointBefore; // above -> before 198 165 199 if ( _y > _ty + m_y + lineHeight ) {166 if ( _y > _ty + m_y + m_height ) { 200 167 // below -> after 201 168 // Set the offset to the max … … 451 418 assert(parent()); 452 419 453 int height = m_lineHeight;454 455 420 TextRun *s = m_lines.count() ? m_lines[0] : 0; 456 421 int si = 0; 457 422 while(s) { 458 if((_y >=_ty + s->m_y) && (_y < _ty + s->m_y + height) &&423 if((_y >=_ty + s->m_y) && (_y < _ty + s->m_y + s->height()) && 459 424 (_x >= _tx + s->m_x) && (_x <_tx + s->m_x + s->m_width) ) { 460 425 inside = true; … … 544 509 TextRun * s = findTextRun( offset, pos ); 545 510 _y = s->m_y; 546 height = m_lineHeight; // ### firstLine!!!s->m_height;547 548 const QFontMetrics &fm = metrics( false ); // #### wrong for first-line!511 height = s->m_height; 512 513 const QFontMetrics &fm = metrics( s->m_firstLine ); 549 514 QString tekst(str->s + s->m_start, s->m_len); 550 515 _x = s->m_x + (fm.boundingRect(tekst, pos)).right(); … … 570 535 { 571 536 return RenderObject::absolutePosition(xPos, yPos, false); 572 573 if(parent() && parent()->absolutePosition(xPos, yPos, false)) {574 xPos -= paddingLeft() + borderLeft();575 yPos -= borderTop() + paddingTop();576 return true;577 }578 xPos = yPos = 0;579 return false;580 537 } 581 538 … … 617 574 int ow = style()->outlineWidth(); 618 575 RenderStyle* pseudoStyle = style()->getPseudoStyle(RenderStyle::FIRST_LINE); 619 int d = style()->textDecoration(); 576 int d = style()->textDecorationsInEffect(); 620 577 TextRun f(0, y-ty); 621 578 int si = m_lines.findFirstMatching(&f); … … 625 582 { 626 583 // Move up until out of area to be printed 627 while(si > 0 && m_lines[si-1]->checkVerticalPoint(y, ty, h , m_lineHeight))584 while(si > 0 && m_lines[si-1]->checkVerticalPoint(y, ty, h)) 628 585 si--; 629 586 … … 669 626 si = startLine; 670 627 671 bool drawDecorations = !haveSelection || pass == 0;672 628 bool drawSelectionBackground = haveSelection && pass == 0 && paintAction != PaintActionSelection; 673 629 bool drawText = !haveSelection || pass == 1; … … 681 637 if (isPrinting) 682 638 { 639 // FIXME: Need to understand what this section is doing. 683 640 int lh = lineHeight( false ) + paddingBottom() + borderBottom(); 684 641 if (ty+s->m_y < y) … … 704 661 font = &_style->htmlFont(); 705 662 } 706 707 #if APPLE_CHANGES708 if (drawDecorations)709 #endif710 if((shouldPaintBackgroundOrBorder() &&711 (parent()->isInline() || pseudoStyle)) &&712 (!pseudoStyle || s->m_firstLine))713 s->paintBoxDecorations(p, _style, this, tx, ty, si == 0, si == (int)m_lines.count()-1);714 663 715 664 #if APPLE_CHANGES … … 735 684 } 736 685 737 if (d != TDNONE)686 if (d != TDNONE && paintAction == PaintActionForeground) 738 687 { 739 p->setPen(_style->textDecorationColor()); 740 if (paintAction == PaintActionSelection) { 741 int offset = s->m_start; 742 int sPos = QMAX( startPos - offset, 0 ); 743 int ePos = QMIN( endPos - offset, s->m_len ); 744 if ( sPos < ePos ){ 745 s->paintDecoration(p, font, this, tx, ty, d, si == 0, si == ( int ) m_lines.count()-1, sPos, ePos); 746 } 747 } else { 748 s->paintDecoration(p, font, this, tx, ty, d,si == 0, si == ( int ) m_lines.count()-1); 688 RenderObject* curr = this; 689 while (curr && !curr->element()) 690 curr = curr->container(); 691 bool quirksMode = (curr && curr->element()->getDocument()->inQuirksMode()); 692 if (quirksMode) { 693 p->setPen(_style->color()); 694 s->paintDecoration(p, tx, ty, d); 749 695 } 750 696 } … … 801 747 #endif 802 748 803 } while (++si < (int)m_lines.count() && m_lines[si]->checkVerticalPoint(y-ow, ty, h , m_lineHeight));749 } while (++si < (int)m_lines.count() && m_lines[si]->checkVerticalPoint(y-ow, ty, h)); 804 750 805 751 #if APPLE_CHANGES … … 820 766 int tx, int ty, PaintAction paintAction) 821 767 { 822 if (paintAction != PaintActionForeground && paintAction != PaintActionSelection) {768 if (paintAction != PaintActionForeground && paintAction != PaintActionSelection) 823 769 return; 824 }825 if (style()->visibility() != VISIBLE) {770 771 if (style()->visibility() != VISIBLE) 826 772 return; 827 }828 773 829 774 int s = m_lines.count() - 1; 830 if ( s < 0 ) return;831 832 // ### incorporate padding/border here! 833 if ( ty + m_lines[0]->m_y > y + h + 64) return;834 if ( ty + m_lines[s]->m_y + m_lines[s]->m_baseline + m_lineHeight + 64< y ) return;775 if ( s < 0 ) 776 return; 777 778 if (ty + m_lines[0]->yPos() > y + h) return; 779 if (ty + m_lines[s]->yPos() + m_lines[s]->height() < y ) return; 835 780 836 781 paintObject(p, x, y, w, h, tx, ty, paintAction); … … 1194 1139 } 1195 1140 1196 void RenderText::position(InlineBox* box, int y, intfrom, int len, bool reverse)1141 void RenderText::position(InlineBox* box, int from, int len, bool reverse) 1197 1142 { 1198 1143 // ### should not be needed!!! … … 1210 1155 TextRun *s = static_cast<TextRun*>(box); 1211 1156 s->m_reversed = reverse; 1212 s->m_y = y;1213 1157 s->m_start = from; 1214 1158 s->m_len = len; 1215 s->m_baseline = baselinePosition(s->m_firstLine);1216 1159 1217 1160 if(m_lines.count() == m_lines.size()) -
TabularUnified trunk/WebCore/khtml/rendering/render_text.h ¶
r3627 r3648 50 50 m_start = 0; 51 51 m_len = 0; 52 m_baseline = 0;53 52 m_reversed = false; 54 53 m_toAdd = 0; … … 74 73 virtual bool isTextRun() { return true; } 75 74 76 #ifdef APPLE_CHANGES 77 void paintDecoration( QPainter *pt, const Font *, RenderText* p, 78 int _tx, int _ty, int decoration, bool begin, bool end, int from=-1, int to=-1); 79 #else 80 void paintDecoration( QPainter *pt, RenderText* p, int _tx, int _ty, int decoration, bool begin, bool end); 81 #endif 82 void paintBoxDecorations(QPainter *p, RenderStyle* style, RenderText *parent, int _tx, int _ty, bool begin, bool end); 75 void paintDecoration( QPainter *pt, int _tx, int _ty, int decoration); 83 76 void paintSelection(const Font *f, RenderText *text, QPainter *p, RenderStyle* style, int tx, int ty, int startPos, int endPos); 84 77 … … 91 84 * of this object's representation? 92 85 */ 93 bool checkVerticalPoint(int _y, int _ty, int _h , int height)94 { if((_ty + m_y > _y + _h) || (_ty + m_y + m_baseline + height < _y)) return false; return true; } 86 bool checkVerticalPoint(int _y, int _ty, int _h) 87 { if((_ty + m_y > _y + _h) || (_ty + m_y + m_baseline + height() < _y)) return false; return true; } 95 88 96 89 int m_start; 97 90 unsigned short m_len; 98 unsigned short m_baseline;99 91 100 92 bool m_reversed : 1; … … 159 151 QChar *text() const { return str->s; } 160 152 unsigned int stringLength() const { return str->l; } // non virtual implementation of length() 161 virtual void position(InlineBox* box, int y, intfrom, int len, bool reverse);153 virtual void position(InlineBox* box, int from, int len, bool reverse); 162 154 163 155 virtual unsigned int width(unsigned int from, unsigned int len, const Font *f) const; -
TabularUnified trunk/WebCore/kwq/KWQPainter.h ¶
r3455 r3648 94 94 void drawText(int x, int y, const QChar *, int length, int from, int to, int toAdd, 95 95 const QColor& backgroundColor, QPainter::TextDirection d, int letterSpacing, int wordSpacing); 96 void drawLineForText(int x, int y, const QChar *, int length, int from, int to, int toAdd, 97 int yOffset, QPainter::TextDirection d, int letterSpacing, int wordSpacing); 96 void drawLineForText(int x, int y, int yOffset, int width); 98 97 static QColor selectedTextBackgroundColor(); 99 98 -
TabularUnified trunk/WebCore/kwq/KWQPainter.mm ¶
r3455 r3648 418 418 } 419 419 420 void QPainter::drawLineForText(int x, int y, const QChar *str, int length, int from, int to, int toAdd, int yOffset, QPainter::TextDirection d, int letterSpacing, int wordSpacing) 421 { 422 if (data->state.paintingDisabled) 423 return; 424 425 CREATE_FAMILY_ARRAY(data->state.font, families); 426 427 _updateRenderer(families); 420 void QPainter::drawLineForText(int x, int y, int yOffset, int width) 421 { 422 if (data->state.paintingDisabled) 423 return; 428 424 429 425 [data->lastTextRenderer 430 drawLineForCharacters:(const UniChar *)str stringLength:length 431 fromCharacterPosition:from 432 toCharacterPosition:to 433 atPoint:NSMakePoint(x, y) 426 drawLineForCharacters: NSMakePoint(x, y) 434 427 yOffset:(float)yOffset 435 withPadding: toAdd 436 withColor:data->state.pen.color().getNSColor() 437 rightToLeft: d == RTL ? true : false 438 letterSpacing: letterSpacing 439 wordSpacing: wordSpacing 440 fontFamilies: families]; 428 withWidth: width 429 withColor:data->state.pen.color().getNSColor()]; 441 430 } 442 431 -
TabularUnified trunk/WebCore/kwq/WebCoreTextRenderer.h ¶
r3376 r3648 43 43 // drawing 44 44 - (void)drawCharacters:(const UniChar *)characters stringLength:(unsigned)length fromCharacterPosition:(int)from toCharacterPosition:(int)to atPoint:(NSPoint)point withPadding: (int)padding withTextColor:(NSColor *)textColor backgroundColor:(NSColor *)backgroundColor rightToLeft: (BOOL)rtl letterSpacing: (int)letterSpacing wordSpacing: (int)wordSpacing fontFamilies: (NSString **)families; 45 - (void)drawLineForCharacters:( const UniChar *)characters stringLength:(unsigned)length fromCharacterPosition:(int)from toCharacterPosition:(int)to atPoint:(NSPoint)point yOffset:(float)yOffset withPadding: (int)padding withColor:(NSColor *)color rightToLeft: (BOOL)rtl letterSpacing: (int)letterSpacing wordSpacing: (int)wordSpacing fontFamilies: (NSString **)families;45 - (void)drawLineForCharacters:(NSPoint)point yOffset:(float)yOffset withWidth: (int)width withColor:(NSColor *)color; 46 46 47 47 @end
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK