MCPcopy Create free account
hub / github.com/dillo-browser/dillo / drawLevel

Method drawLevel

dw/textblock.cc:1730–1771  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1728}
1729
1730void Textblock::drawLevel (core::View *view, core::Rectangle *area,
1731 int level, core::DrawingContext *context)
1732{
1733 DBG_OBJ_ENTER ("draw", 0, "Textblock::drawLevel", "(%d, %d, %d * %d), %s",
1734 area->x, area->y, area->width, area->height,
1735 stackingLevelText (level));
1736
1737 switch (level) {
1738 case SL_IN_FLOW:
1739 for (int lineIndex = findLineIndexWhenAllocated (area->y);
1740 lineIndex < lines->size (); lineIndex++) {
1741 Line *line = lines->getRef (lineIndex);
1742 if (lineYOffsetWidget (line) >= area->y + area->height)
1743 break;
1744
1745 DBG_OBJ_MSGF ("draw", 0, "line %d (of %d)", lineIndex, lines->size ());
1746 drawLine (line, view, area, context);
1747 }
1748 break;
1749
1750 case SL_OOF_REF:
1751 // TODO Inefficient. Perhaps store OOF references in seperate
1752 // (much smaller!) list.
1753 for (int oofmIndex = 0; oofmIndex < NUM_OOFM; oofmIndex++) {
1754 for (int wordIndex = 0; wordIndex < words->size (); wordIndex++) {
1755 Word *word = words->getRef (wordIndex);
1756 if (word->content.type == core::Content::WIDGET_OOF_REF &&
1757 getOOFMIndex (word->content.widgetReference->widget)
1758 == oofmIndex &&
1759 doesWidgetOOFInterruptDrawing (word->content.widget))
1760 word->content.widget->drawInterruption (view, area, context);
1761 }
1762 }
1763 break;
1764
1765 default:
1766 OOFAwareWidget::drawLevel (view, area, level, context);
1767 break;
1768 }
1769
1770 DBG_OBJ_LEAVE ();
1771}
1772
1773/**
1774 * Add a new word (text, widget etc.) to a page.

Callers

nothing calls this directly

Calls 3

drawInterruptionMethod · 0.80
sizeMethod · 0.45
getRefMethod · 0.45

Tested by

no test coverage detected