dillo
3.0.5
About: dillo is a small, fast, extensible Web browser particularly suitable for older or smaller computers and embedded systems (but only limited or no support for frames, CSS, JavaScript, Java).
![]() ![]() |
A Widget for rendering text blocks, i.e. paragraphs or sequences of paragraphs. More...
#include <textblock.hh>
Classes | |
struct | Anchor |
class | BadnessAndPenalty |
struct | DivChar |
struct | Line |
struct | Paragraph |
class | SpaceImgRenderer |
class | TextblockIterator |
struct | Word |
class | WordImgRenderer |
Implementation used for words. More... | |
Public Member Functions | |
Textblock (bool limitTextWidth) | |
~Textblock () | |
core::Iterator * | iterator (core::Content::Type mask, bool atEnd) |
Return an iterator for this widget. More... | |
void | flush () |
void | addText (const char *text, size_t len, core::style::Style *style) |
void | addText (const char *text, core::style::Style *style) |
void | addWidget (core::Widget *widget, core::style::Style *style) |
bool | addAnchor (const char *name, core::style::Style *style) |
void | addSpace (core::style::Style *style) |
void | addBreakOption (core::style::Style *style, bool forceBreak) |
void | addParbreak (int space, core::style::Style *style) |
void | addLinebreak (core::style::Style *style) |
core::Widget * | getWidgetAtPoint (int x, int y, int level) |
Search recursively through widget. More... | |
void | handOverBreak (core::style::Style *style) |
void | changeLinkColor (int link, int newColor) |
void | changeWordStyle (int from, int to, core::style::Style *style, bool includeFirstSpace, bool includeLastSpace) |
![]() | |
void | setDeleteCallback (DW_Callback_t func, void *data) |
Widget () | |
~Widget () | |
bool | needsResize () |
bool | needsAllocate () |
bool | extremesChanged () |
bool | wasAllocated () |
bool | usesHints () |
bool | hasContents () |
bool | blockLevel () |
void | setParent (Widget *parent) |
style::Style * | getStyle () |
Allocation * | getAllocation () |
void | sizeRequest (Requisition *requisition) |
This method is a wrapper for Widget::sizeRequestImpl(); it calls the latter only when needed. More... | |
void | getExtremes (Extremes *extremes) |
Wrapper for Widget::getExtremesImpl(). More... | |
void | sizeAllocate (Allocation *allocation) |
Wrapper for Widget::sizeAllocateImpl, calls the latter only when needed. More... | |
bool | intersects (Rectangle *area, Rectangle *intersection) |
Calculates the intersection of widget->allocation and area, returned in intersection (in widget coordinates!). More... | |
bool | buttonPress (EventButton *event) |
bool | buttonRelease (EventButton *event) |
bool | motionNotify (EventMotion *event) |
void | enterNotify (EventCrossing *event) |
void | leaveNotify (EventCrossing *event) |
virtual void | setStyle (style::Style *style) |
Change the style of a widget. More... | |
void | setBgColor (style::Color *bgColor) |
Set the background "behind" the widget, if it is not the background of the parent widget, e.g. the background of a table row. More... | |
style::Color * | getBgColor () |
Get the actual background of a widget. More... | |
void | drawBox (View *view, style::Style *style, Rectangle *area, int x, int y, int width, int height, bool inverse) |
Draw borders and background of a widget part, which allocation is given by (x, y, width, height) (widget coordinates). More... | |
void | drawWidgetBox (View *view, Rectangle *area, bool inverse) |
Draw borders and background of a widget. More... | |
void | drawSelected (View *view, Rectangle *area) |
void | setButtonSensitive (bool buttonSensitive) |
bool | isButtonSensitive () |
Widget * | getParent () |
Widget * | getTopLevel () |
Get the widget at the root of the tree, this widget is part from. More... | |
int | getLevel () |
Get the level of the widget within the tree. More... | |
Widget * | getNearestCommonAncestor (Widget *otherWidget) |
Get the widget with the highest level, which is a direct ancestor of widget1 and widget2. More... | |
Layout * | getLayout () |
void | scrollTo (HPosition hpos, VPosition vpos, int x, int y, int width, int height) |
void | getPaddingArea (int *xPad, int *yPad, int *widthPad, int *heightPad) |
Return the padding area (content plus padding). More... | |
virtual void | removeChild (Widget *child) |
![]() | |
IdentifiableObject () | |
virtual void | intoStringBuffer (misc::StringBuffer *sb) |
Store a textual representation of the object in a misc::StringBuffer. More... | |
int | getClassId () |
Returns the class identifier. More... | |
const char * | getClassName () |
Return the name, under which the class of this object was registered. More... | |
bool | instanceOf (int otherClassId) |
Returns, whether this class is an instance of the class, given by otherClassId, or of a sub class of this class. More... | |
![]() | |
virtual | ~Object () |
The destructor is defined as virtual (but not abstract), so that destruction of Object's works properly. More... | |
virtual bool | equals (Object *other) |
Returns, whether two objects are equal. More... | |
virtual int | hashValue () |
Return a hash value for the object. More... | |
virtual Object * | clone () |
Return an exact copy of the object. More... | |
const char * | toString () |
Use object::Object::intoStringBuffer to return a textual representation of the object. More... | |
virtual size_t | sizeOf () |
Return the number of bytes, this object totally uses. More... | |
Static Public Member Functions | |
static void | setPenaltyHyphen (int penaltyHyphen) |
static void | setPenaltyHyphen2 (int penaltyHyphen2) |
static void | setPenaltyEmDashLeft (int penaltyLeftEmDash) |
static void | setPenaltyEmDashRight (int penaltyRightEmDash) |
static void | setPenaltyEmDashRight2 (int penaltyRightEmDash2) |
static void | setStretchabilityFactor (int stretchabilityFactor) |
Static Public Attributes | |
static int | CLASS_ID = -1 |
![]() | |
static int | CLASS_ID = -1 |
Protected Member Functions | |
void | printWordShort (Word *word) |
void | printWordFlags (short flags) |
void | printWordWithFlags (Word *word) |
void | printWord (Word *word) |
void | queueDrawRange (int index1, int index2) |
void | getWordExtremes (Word *word, core::Extremes *extremes) |
void | justifyLine (Line *line, int diff) |
Line * | addLine (int firstWord, int lastWord, bool temporary) |
void | calcWidgetSize (core::Widget *widget, core::Requisition *size) |
void | rewrap () |
void | fillParagraphs () |
void | showMissingLines () |
void | removeTemporaryLines () |
void | decorateText (core::View *view, core::style::Style *style, core::style::Color::Shading shading, int x, int yBase, int width) |
void | drawText (core::View *view, core::style::Style *style, core::style::Color::Shading shading, int x, int y, const char *text, int start, int len, bool isStart, bool isEnd) |
void | drawWord (Line *line, int wordIndex1, int wordIndex2, core::View *view, core::Rectangle *area, int xWidget, int yWidgetBase) |
void | drawWord0 (int wordIndex1, int wordIndex2, const char *text, int totalWidth, bool drawHyphen, core::style::Style *style, core::View *view, core::Rectangle *area, int xWidget, int yWidgetBase) |
void | drawSpace (int wordIndex, core::View *view, core::Rectangle *area, int xWidget, int yWidgetBase) |
void | drawLine (Line *line, core::View *view, core::Rectangle *area) |
int | findLineIndex (int y) |
int | findLineOfWord (int wordIndex) |
Find the line of word wordIndex. More... | |
int | findParagraphOfWord (int wordIndex) |
Find the paragraph of word wordIndex. More... | |
Word * | findWord (int x, int y, bool *inSpace) |
Find the index of the word, or -1. More... | |
Word * | addWord (int width, int ascent, int descent, short flags, core::style::Style *style) |
void | initWord (int wordNo) |
void | removeWordImgRenderer (int wordNo) |
void | setWordImgRenderer (int wordNo) |
void | removeSpaceImgRenderer (int wordNo) |
void | setSpaceImgRenderer (int wordNo) |
void | fillWord (int wordNo, int width, int ascent, int descent, short flags, core::style::Style *style) |
void | fillSpace (int wordNo, core::style::Style *style) |
void | setBreakOption (Word *word, core::style::Style *style, int breakPenalty1, int breakPenalty2, bool forceBreak) |
bool | isBreakAllowed (Word *word) |
int | textWidth (const char *text, int start, int len, core::style::Style *style, bool isStart, bool isEnd) |
void | calcTextSize (const char *text, size_t len, core::style::Style *style, core::Requisition *size, bool isStart, bool isEnd) |
int | lineXOffsetContents (Line *line) |
Returns the x offset (the indentation plus any offset needed for centering or right justification) for the line. More... | |
int | lineXOffsetWidget (Line *line) |
Like lineXOffset, but relative to the allocation (i.e. including border etc.). More... | |
int | lineYOffsetWidgetAllocation (Line *line, core::Allocation *allocation) |
int | lineYOffsetWidget (Line *line) |
int | lineYOffsetCanvasAllocation (Line *line, core::Allocation *allocation) |
int | lineYOffsetCanvas (Line *line) |
int | lineYOffsetWidgetI (int lineIndex) |
int | lineYOffsetCanvasI (int lineIndex) |
int | calcPenaltyIndexForNewLine () |
bool | sendSelectionEvent (core::SelectionState::EventType eventType, core::MousePositionEvent *event) |
Send event to selection. More... | |
void | accumulateWordExtremes (int firstWord, int lastWord, int *maxOfMinWidth, int *sumOfMaxWidth) |
void | processWord (int wordIndex) |
virtual bool | wordWrap (int wordIndex, bool wrapAll) |
int | searchMinBap (int firstWord, int lastWordm, int penaltyIndex, bool correctAtEnd) |
int | considerHyphenation (int firstIndex, int breakPos) |
bool | isHyphenationCandidate (Word *word) |
void | handleWordExtremes (int wordIndex) |
void | correctLastWordExtremes () |
int | hyphenateWord (int wordIndex) |
void | accumulateWordForLine (int lineIndex, int wordIndex) |
void | accumulateWordData (int wordIndex) |
int | calcAvailWidth (int lineIndex) |
void | initLine1Offset (int wordIndex) |
void | alignLine (int lineIndex) |
void | sizeRequestImpl (core::Requisition *requisition) |
void | getExtremesImpl (core::Extremes *extremes) |
See Sizes of Dillo Widgets. More... | |
void | sizeAllocateImpl (core::Allocation *allocation) |
See Sizes of Dillo Widgets. More... | |
void | resizeDrawImpl () |
Called after sizeAllocateImpl() to redraw necessary areas. By default the whole widget is redrawn. More... | |
void | markSizeChange (int ref) |
See Sizes of Dillo Widgets. More... | |
void | markExtremesChange (int ref) |
See Sizes of Dillo Widgets. More... | |
void | setWidth (int width) |
void | setAscent (int ascent) |
void | setDescent (int descent) |
void | draw (core::View *view, core::Rectangle *area) |
bool | buttonPressImpl (core::EventButton *event) |
bool | buttonReleaseImpl (core::EventButton *event) |
bool | motionNotifyImpl (core::EventMotion *event) |
void | enterNotifyImpl (core::EventCrossing *event) |
void | leaveNotifyImpl (core::EventCrossing *event) |
void | removeChild (Widget *child) |
void | addText0 (const char *text, size_t len, short flags, core::style::Style *style, core::Requisition *size) |
void | calcTextSizes (const char *text, size_t textLen, core::style::Style *style, int numBreaks, int *breakPos, core::Requisition *wordSize) |
![]() | |
int | getHeight () |
int | getContentWidth () |
int | getContentHeight () |
void | setFlags (Flags f) |
void | unsetFlags (Flags f) |
void | queueDraw () |
void | queueDrawArea (int x, int y, int width, int height) |
void | queueResize (int ref, bool extremesChanged) |
This method should be called, when a widget changes its size. More... | |
char * | addAnchor (const char *name) |
char * | addAnchor (const char *name, int y) |
void | changeAnchor (char *name, int y) |
void | removeAnchor (char *name) |
void | setCursor (style::Cursor cursor) |
bool | selectionHandleEvent (SelectionState::EventType eventType, Iterator *it, int charPos, int linkNo, MousePositionEvent *event) |
![]() | |
void | registerName (const char *className, int *classId) |
This method must be called in the constructor for the sub class. See class comment for details. More... | |
Static Protected Member Functions | |
static int | getSpaceShrinkability (struct Word *word) |
static int | getSpaceStretchability (struct Word *word) |
static int | getLineShrinkability (Word *lastWord) |
static int | getLineStretchability (Word *lastWord) |
Protected Attributes | |
bool | hasListitemValue |
int | innerPadding |
int | line1Offset |
int | line1OffsetEff |
bool | ignoreLine1OffsetSometimes |
bool | mustQueueResize |
bool | limitTextWidth |
int | redrawY |
int | lastWordDrawn |
int | availWidth |
int | availAscent |
int | availDescent |
int | wrapRefLines |
int | wrapRefParagraphs |
lout::misc::SimpleVector< Line > * | lines |
lout::misc::SimpleVector< Paragraph > * | paragraphs |
int | nonTemporaryLines |
lout::misc::NotSoSimpleVector< Word > * | words |
lout::misc::SimpleVector< Anchor > * | anchors |
struct { | |
int index | |
int nChar | |
} | hlStart [core::HIGHLIGHT_NUM_LAYERS] |
struct { | |
int index | |
int nChar | |
} | hlEnd [core::HIGHLIGHT_NUM_LAYERS] |
int | hoverLink |
![]() | |
WidgetImgRenderer * | widgetImgRenderer |
Allocation | allocation |
The current allocation: size and position, always relative to the canvas. More... | |
Layout * | layout |
Static Protected Attributes | |
static int | penalties [PENALTY_NUM][2] |
static int | stretchabilityFactor = 100 |
Private Types | |
enum | { PENALTY_FORCE_BREAK = INT_MIN, PENALTY_PROHIBIT_BREAK = INT_MAX } |
enum | { PENALTY_HYPHEN, PENALTY_EM_DASH_LEFT, PENALTY_EM_DASH_RIGHT, PENALTY_NUM } |
enum | { NUM_DIV_CHARS = 4 } |
Static Private Attributes | |
static DivChar | divChars [NUM_DIV_CHARS] |
static const char * | hyphenDrawChar = "-" |
Friends | |
class | TextblockIterator |
Additional Inherited Members | |
![]() | |
int | parentRef |
This value is defined by the parent widget, and used for incremential resizing. More... | |
![]() | |
enum | Flags { NEEDS_RESIZE = 1 << 0, NEEDS_ALLOCATE = 1 << 1, EXTREMES_CHANGED = 1 << 2, USES_HINTS = 1 << 3, HAS_CONTENTS = 1 << 4, WAS_ALLOCATED = 1 << 5, BLOCK_LEVEL = 1 << 6 } |
A Widget for rendering text blocks, i.e. paragraphs or sequences of paragraphs.
dw::Textblock uses the signals defined in dw::core::Layout::LinkReceiver, related to links. The coordinates are always -1.
The idea behind this is that every paragraph has a specific vertical space around and that they are combined to one space, according to rules stated below. A paragraph consists either of the lines between two paragraph breaks within a dw::Textblock, or of a dw::Textblock within a dw::Textblock, in a single line; the latter is used for indented boxes and list items.
The rules:
If a paragraph is following by another, the space between them is the maximum of both box spaces:
are combined like this:
a) If one paragraph is the first paragraph within another, the upper space of these paragraphs collapse. b) The analogue is the case for the last box:
If B and C are put into A, the result is:
For achieving this, there are some features of dw::Textblock:
Consequent breaks are automatically combined, according to rule 1. See the code of dw::Textblock::addParBreak for details.
If a break is added as the first word of the dw::Textblock within another dw::Textblock, collapsing according to rule 2a is done automatically. See the code of dw::Textblock::addParBreak.
Collapsing margins, as defined in the CSS2 specification, are, supported in addition to collapsing spaces. Also, spaces and margins collapse themselves. I.e., the space between two paragraphs is the maximum of the space calculated as described in "Collapsing Spaces" and the space calculated according to the rules for collapsing margins.
(This is an intermediate hybrid state, collapsing spaces are used in the current version of dillo, while I implemented collapsing margins for the CSS prototype and integrated it already into the main trunk. For a pure CSS-based dillo, collapsing spaces will not be needed anymore, and may be removed for simplicity.)
There are 4 lists, dw::Textblock::words, dw::Textblock::paragraphs, dw::Textblock::lines, and dw::Textblock::anchors. The word list is quite static; only new words may be added. A word is either text, a widget, or a break.
Lines refer to the word list (first and last). They are completely redundant, i.e., they can be rebuilt from the words. Lines can be rewrapped either completely or partially (see "Incremental Resizing" below). For the latter purpose, several values are accumulated in the lines. See dw::Textblock::Line for details.
A recent change was the introduction of the paragraphs list, which works quite similar, is also redundant, but is used to calculate the extremes, not the size.
Anchors associate the anchor name with the index of the next word at the point of the anchor.
dw::Textblock makes use of incremental resizing as described in Sizes of Dillo Widgets. The parentRef is, for children of a dw::Textblock, simply the number of the line.
Generally, there are three cases which may change the size of the widget:
The available size of the widget has changed, e.g., because the user has changed the size of the browser window. In this case, it is necessary to rewrap all the lines.
A child widget has changed its size. In this case, only a rewrap down from the line where this widget is located is necessary.
(This case is very important for tables. Tables are quite at the bottom, so that a partial rewrap is relevant. Otherwise, tables change their size quite often, so that this is necessary for a fast, non-blocking rendering)
The state of the size calculation is stored in wrapRef within dw::Textblock, which has the value -1 if no rewrapping of lines necessary, or otherwise the line from which a rewrap is necessary.
Definition at line 149 of file textblock.hh.
|
private |
This class encapsulates the badness/penalty calculation, and so (i) makes changes (hopefully) simpler, and (ii) hides the integer arithmetic (floating point arithmetic avoided for performance reasons). Unfortunately, the value range of the badness is not well defined, so fiddling with the penalties is a bit difficult.
Enumerator | |
---|---|
PENALTY_FORCE_BREAK | |
PENALTY_PROHIBIT_BREAK |
Definition at line 161 of file textblock.hh.
|
private |
Enumerator | |
---|---|
PENALTY_HYPHEN | |
PENALTY_EM_DASH_LEFT | |
PENALTY_EM_DASH_RIGHT | |
PENALTY_NUM |
Definition at line 224 of file textblock.hh.
|
private |
Enumerator | |
---|---|
NUM_DIV_CHARS |
Definition at line 226 of file textblock.hh.
dw::Textblock::Textblock | ( | bool | limitTextWidth | ) |
Definition at line 223 of file textblock.cc.
References DBG_OBJ_CREATE, and dw::core::HIGHLIGHT_NUM_LAYERS.
dw::Textblock::~Textblock | ( | ) |
Definition at line 281 of file textblock.cc.
References _MSG, dw::Textblock::Word::content, DBG_OBJ_DELETE, hoverTooltip, dw::Textblock::Anchor::name, dw::Textblock::Word::spaceStyle, dw::Textblock::Word::style, dw::core::Content::type, dw::core::style::Style::unref(), and dw::core::Content::widget.
|
protected |
Definition at line 1022 of file textblock_linebreaking.cc.
References dw::core::Requisition::ascent, dw::Textblock::Word::badnessAndPenalty, dw::Textblock::BadnessAndPenalty::calcBadness(), dw::core::Requisition::descent, dw::Textblock::Word::hyphenWidth, lout::misc::max(), dw::Textblock::Word::maxAscent, dw::Textblock::Word::maxDescent, dw::Textblock::Word::origSpace, PRINTF, dw::Textblock::Word::size, dw::Textblock::Word::totalSpaceShrinkability, dw::Textblock::Word::totalSpaceStretchability, dw::Textblock::Word::totalWidth, and dw::core::Requisition::width.
|
protected |
Definition at line 437 of file textblock_linebreaking.cc.
References dw::Textblock::Word::badnessAndPenalty, dw::Textblock::Word::hyphenWidth, dw::Textblock::BadnessAndPenalty::lineCanBeBroken(), lout::misc::max(), dw::core::Extremes::maxWidth, dw::core::Extremes::minWidth, and dw::Textblock::Word::origSpace.
|
protected |
Definition at line 964 of file textblock_linebreaking.cc.
References dw::core::Requisition::ascent, dw::core::style::Font::ascent, dw::core::Widget::blockLevel(), dw::core::style::Box::bottom, dw::Textblock::Line::boxAscent, dw::Textblock::Line::boxDescent, dw::core::Content::breakSpace, dw::Textblock::Line::breakSpace, dw::Textblock::Word::content, dw::Textblock::Line::contentAscent, dw::Textblock::Line::contentDescent, dw::core::Requisition::descent, dw::core::style::Font::descent, dw::core::style::StyleAttrs::font, dw::core::Widget::getStyle(), dw::core::style::StyleAttrs::margin, dw::Textblock::Line::marginDescent, lout::misc::max(), dw::core::Widget::parentRef, PRINTF, dw::Textblock::Word::size, dw::Textblock::Word::style, dw::core::style::Box::top, dw::core::Content::type, dw::core::style::StyleAttrs::valign, dw::core::style::VALIGN_SUB, dw::core::style::VALIGN_SUPER, and dw::core::Content::widget.
bool dw::Textblock::addAnchor | ( | const char * | name, |
core::style::Style * | style | ||
) |
Add an anchor to the page. "name" is copied, so no strdup is necessary for the caller.
Return true on success, and false, when this anchor had already been added to the widget tree.
Definition at line 1987 of file textblock.cc.
References dw::Textblock::Anchor::name, and dw::Textblock::Anchor::wordIndex.
void dw::Textblock::addBreakOption | ( | core::style::Style * | style, |
bool | forceBreak | ||
) |
Add a break option (see setBreakOption() for details). Used instead of addStyle for ideographic characters.
When "forceBreak" is true, a break is even possible within PRE etc.
Definition at line 2040 of file textblock.cc.
|
protected |
Definition at line 338 of file textblock_linebreaking.cc.
References dw::Textblock::Line::boxAscent, dw::Textblock::Line::boxDescent, dw::Textblock::Line::breakSpace, dw::Textblock::Line::contentAscent, dw::Textblock::Line::contentDescent, dw::Textblock::Word::effSpace, dw::Textblock::Line::firstWord, dw::Textblock::Line::lastWord, dw::Textblock::Line::leftOffset, dw::Textblock::Line::marginDescent, lout::misc::max(), dw::Textblock::Line::maxLineWidth, dw::Textblock::Word::origSpace, PRINTF, dw::Textblock::WordImgRenderer::setData(), dw::Textblock::Word::size, dw::Textblock::Word::spaceImgRenderer, dw::Textblock::Line::top, dw::Textblock::Word::totalWidth, dw::core::Requisition::width, and dw::Textblock::Word::wordImgRenderer.
void dw::Textblock::addLinebreak | ( | core::style::Style * | style | ) |
Definition at line 2214 of file textblock.cc.
References dw::core::style::Font::ascent, dw::Textblock::Word::badnessAndPenalty, dw::core::Content::breakSpace, dw::Textblock::Word::content, DBG_OBJ_ASSOC_CHILD, dw::core::style::Font::descent, dw::core::style::StyleAttrs::font, dw::Textblock::BadnessAndPenalty::setPenalty(), and dw::core::Content::type.
void dw::Textblock::addParbreak | ( | int | space, |
core::style::Style * | style | ||
) |
Cause a paragraph break
Definition at line 2137 of file textblock.cc.
References dw::Textblock::Word::badnessAndPenalty, dw::Textblock::Line::boxDescent, dw::core::Content::breakSpace, dw::Textblock::Line::breakSpace, dw::Textblock::Word::content, DBG_OBJ_ASSOC_CHILD, dw::core::Widget::getParent(), hasListitemValue, lines, dw::Textblock::Line::marginDescent, lout::misc::max(), mustQueueResize, dw::core::Widget::queueResize(), dw::Textblock::BadnessAndPenalty::setPenalty(), dw::core::Content::type, and words.
Referenced by handOverBreak(), and Html_tag_content_frame().
void dw::Textblock::addSpace | ( | core::style::Style * | style | ) |
?
Definition at line 2024 of file textblock.cc.
Referenced by Html_tag_content_frame(), dw::ListItem::initWithText(), and dw::ListItem::initWithWidget().
|
inline |
Definition at line 686 of file textblock.hh.
References addText(), and dw::core::Widget::style.
void dw::Textblock::addText | ( | const char * | text, |
size_t | len, | ||
core::style::Style * | style | ||
) |
Add a word to the page structure. If it contains dividing characters (hard or soft hyphens, em-dashes, etc.), it is divided.
Definition at line 1676 of file textblock.cc.
References dw::core::style::StyleAttrs::font, dw::Textblock::Word::hyphenWidth, lout::unicode::nextUtf8Char(), PRINTF, PUTCHAR, and dw::Textblock::Word::style.
Referenced by addText(), Html_tag_content_frame(), and dw::ListItem::initWithText().
|
protected |
Add a word (without hyphens) to the page structure.
Definition at line 1923 of file textblock.cc.
References dw::core::Requisition::ascent, dw::Textblock::Word::content, DBG_OBJ_ASSOC_CHILD, dw::core::Requisition::descent, dw::core::Content::text, dw::core::Content::type, and dw::core::Requisition::width.
void dw::Textblock::addWidget | ( | core::Widget * | widget, |
core::style::Style * | style | ||
) |
Add a widget (word type) to the page.
Definition at line 1945 of file textblock.cc.
References dw::core::Requisition::ascent, dw::Textblock::Word::content, dw::core::Requisition::descent, dw::core::Widget::parentRef, PRINTF, dw::core::Widget::setParent(), dw::core::Widget::setStyle(), dw::core::Content::type, dw::core::Content::widget, and dw::core::Requisition::width.
Referenced by Html_tag_content_frame(), and dw::ListItem::initWithWidget().
|
protected |
Add a new word (text, widget etc.) to a page.
Definition at line 1457 of file textblock.cc.
References dw::Textblock::Word::size.
|
protected |
Align the line.
Definition at line 1132 of file textblock_linebreaking.cc.
References dw::Textblock::Word::content, dw::Textblock::Line::firstWord, dw::Textblock::Line::lastWord, dw::Textblock::Line::leftOffset, dw::Textblock::Word::origSpace, dw::Textblock::Word::style, dw::core::style::TEXT_ALIGN_CENTER, dw::core::style::TEXT_ALIGN_JUSTIFY, dw::core::style::TEXT_ALIGN_LEFT, dw::core::style::TEXT_ALIGN_RIGHT, dw::core::style::TEXT_ALIGN_STRING, dw::core::style::StyleAttrs::textAlign, dw::Textblock::Word::totalWidth, and dw::core::Content::type.
|
protectedvirtual |
Reimplemented from dw::core::Widget.
Definition at line 652 of file textblock.cc.
|
protectedvirtual |
Reimplemented from dw::core::Widget.
Definition at line 657 of file textblock.cc.
|
protected |
Definition at line 1081 of file textblock_linebreaking.cc.
|
inlineprotected |
Definition at line 605 of file textblock.hh.
References dw::Textblock::Word::DIV_CHAR_AT_EOL, dw::core::Widget::flags, lines, dw::Textblock::Word::PERM_DIV_CHAR, and words.
|
protected |
Calculate the size of a text word.
For "isStart" and "isEnd" see textWidth and drawText.
Definition at line 1621 of file textblock.cc.
References dw::core::style::absLengthVal(), dw::core::Requisition::ascent, dw::core::style::Font::ascent, dw::core::Requisition::descent, dw::core::style::Font::descent, dw::core::style::StyleAttrs::font, dw::core::style::isAbsLength(), dw::core::style::LENGTH_AUTO, dw::core::style::StyleAttrs::lineHeight, lout::misc::max(), dw::core::style::multiplyWithPerLengthRounded(), lout::misc::roundInt(), dw::core::style::FontAttrs::size, dw::core::style::StyleAttrs::valign, dw::core::style::VALIGN_SUB, dw::core::style::VALIGN_SUPER, and dw::core::Requisition::width.
|
protected |
Definition at line 1886 of file textblock.cc.
References PRINTF, PUTCHAR, and dw::core::Requisition::width.
|
protected |
Calculate the size of a widget within the page. (Subject of change in the near future!)
Definition at line 885 of file textblock.cc.
References dw::core::style::absLengthVal(), dw::core::Requisition::ascent, dw::core::style::Box::bottom, dw::core::style::StyleAttrs::boxDiffHeight(), dw::core::style::StyleAttrs::boxDiffWidth(), dw::core::Requisition::descent, dw::core::Widget::getStyle(), dw::core::style::StyleAttrs::height, dw::core::style::isAbsLength(), dw::core::style::LENGTH_AUTO, dw::core::style::StyleAttrs::margin, dw::core::style::multiplyWithPerLength(), dw::core::Widget::setAscent(), dw::core::Widget::setDescent(), dw::core::Widget::setWidth(), dw::core::Widget::sizeRequest(), dw::core::style::Box::top, dw::core::Widget::usesHints(), dw::core::Requisition::width, and dw::core::style::StyleAttrs::width.
void dw::Textblock::changeLinkColor | ( | int | link, |
int | newColor | ||
) |
Definition at line 2318 of file textblock.cc.
References dw::Textblock::Line::boxAscent, dw::Textblock::Line::boxDescent, dw::core::style::StyleAttrs::color, dw::Textblock::Word::content, dw::Textblock::Line::firstWord, dw::core::Widget::getStyle(), dw::core::style::StyleAttrs::setBorderColor(), dw::core::Widget::setStyle(), dw::Textblock::Word::spaceStyle, dw::Textblock::Word::style, dw::core::Content::type, dw::core::style::Style::unref(), dw::core::Content::widget, and dw::core::style::StyleAttrs::x_link.
void dw::Textblock::changeWordStyle | ( | int | from, |
int | to, | ||
core::style::Style * | style, | ||
bool | includeFirstSpace, | ||
bool | includeLastSpace | ||
) |
Definition at line 2369 of file textblock.cc.
|
protected |
Suggest a word to hyphenate, when breaking at breakPos is planned. Return a word index or -1, when hyphenation makes no sense.
Definition at line 722 of file textblock_linebreaking.cc.
References dw::Textblock::Word::badnessAndPenalty, dw::Textblock::BadnessAndPenalty::lineLoose(), and dw::Textblock::BadnessAndPenalty::lineTight().
|
protected |
Called when something changed for the last word (space, hyphens etc.).
Definition at line 849 of file textblock_linebreaking.cc.
References dw::Textblock::Word::badnessAndPenalty, dw::Textblock::Word::flags, dw::Textblock::BadnessAndPenalty::lineCanBeBroken(), and PRINTF.
|
protected |
Definition at line 942 of file textblock.cc.
References dw::core::style::Font::ascent, dw::core::style::StyleAttrs::color, dw::core::style::Font::descent, dw::core::View::drawRectangle(), dw::core::style::StyleAttrs::font, dw::core::style::TEXT_DECORATION_LINE_THROUGH, dw::core::style::TEXT_DECORATION_OVERLINE, dw::core::style::TEXT_DECORATION_UNDERLINE, dw::core::style::StyleAttrs::textDecoration, and dw::core::style::Font::xHeight.
|
protectedvirtual |
Area is given in widget coordinates.
Implements dw::core::Widget.
Definition at line 1433 of file textblock.cc.
References dw::core::Rectangle::height, PRINTF, dw::core::Rectangle::width, dw::core::Rectangle::x, and dw::core::Rectangle::y.
|
protected |
Definition at line 1246 of file textblock.cc.
References dw::Textblock::Line::boxAscent, dw::Textblock::Line::boxDescent, dw::Textblock::Word::content, dw::core::Widget::draw(), dw::Textblock::Word::effSpace, dw::Textblock::Line::firstWord, dw::core::style::StyleAttrs::hasBackground(), dw::Textblock::Word::hyphenWidth, dw::core::Widget::intersects(), dw::Textblock::Word::size, dw::Textblock::Word::spaceStyle, dw::Textblock::Word::style, dw::core::Content::type, dw::core::Content::widget, dw::core::Rectangle::width, dw::core::Requisition::width, and dw::core::Rectangle::x.
|
protected |
Definition at line 1196 of file textblock.cc.
References dw::core::style::Font::ascent, dw::core::style::StyleAttrs::backgroundColor, dw::core::style::Font::descent, dw::core::View::drawRectangle(), dw::Textblock::Word::effSpace, dw::core::style::StyleAttrs::font, dw::core::HIGHLIGHT_NUM_LAYERS, dw::Textblock::Word::spaceStyle, dw::core::style::StyleAttrs::textDecoration, dw::core::style::StyleAttrs::valign, dw::core::style::VALIGN_SUB, and dw::core::style::VALIGN_SUPER.
|
protected |
Definition at line 972 of file textblock.cc.
References dw::core::style::StyleAttrs::color, dw::core::View::drawText(), dw::core::style::StyleAttrs::font, dw::core::style::TEXT_TRANSFORM_CAPITALIZE, dw::core::style::TEXT_TRANSFORM_LOWERCASE, dw::core::style::TEXT_TRANSFORM_NONE, dw::core::style::TEXT_TRANSFORM_UPPERCASE, and dw::core::style::StyleAttrs::textTransform.
|
protected |
Draw a word of text.
Since hyphenated words consist of multiple instance of dw::Textblock::Word, which should be drawn as a whole (to preserve kerning etc.; see Changes in Line-Breaking and Hyphenation), two indices are passed. See also drawLine(), where drawWord() is called.
Definition at line 1039 of file textblock.cc.
References dw::Textblock::Line::boxAscent, dw::Textblock::Line::boxDescent, dw::Textblock::Word::content, dw::core::style::StyleAttrs::hasBackground(), dw::Textblock::Line::lastWord, dw::Textblock::Word::size, dw::core::Content::text, and dw::core::Requisition::width.
|
protected |
TODO Comment
Definition at line 1092 of file textblock.cc.
References dw::core::style::Font::ascent, dw::core::style::StyleAttrs::backgroundColor, dw::core::style::Font::descent, dw::core::View::drawRectangle(), dw::core::style::StyleAttrs::font, dw::core::HIGHLIGHT_NUM_LAYERS, lout::misc::min(), dw::core::style::StyleAttrs::textDecoration, dw::core::style::StyleAttrs::valign, dw::core::style::VALIGN_SUB, and dw::core::style::VALIGN_SUPER.
|
protectedvirtual |
Reimplemented from dw::core::Widget.
Definition at line 709 of file textblock.cc.
References _MSG, and hoverTooltip.
|
protected |
Counter part to rewrap(), but for extremes, not size calculation.
Definition at line 1229 of file textblock_linebreaking.cc.
References lout::misc::max(), and PRINTF.
|
protected |
Definition at line 2050 of file textblock.cc.
References dw::Textblock::Word::content, dw::Textblock::Word::effSpace, dw::core::style::StyleAttrs::font, dw::Textblock::Word::origSpace, dw::core::style::Style::ref(), dw::core::Content::space, dw::Textblock::Word::spaceStyle, dw::core::style::Font::spaceWidth, dw::core::style::Style::unref(), and dw::core::style::StyleAttrs::wordSpacing.
|
protected |
Definition at line 1527 of file textblock.cc.
References dw::core::Requisition::ascent, dw::Textblock::Word::badnessAndPenalty, dw::Textblock::Word::content, dw::core::Requisition::descent, dw::Textblock::Word::effSpace, dw::Textblock::Word::flags, dw::Textblock::Word::hyphenWidth, dw::Textblock::Word::origSpace, dw::core::style::Style::ref(), dw::Textblock::BadnessAndPenalty::setPenalty(), dw::Textblock::Word::size, dw::core::Content::space, dw::Textblock::Word::spaceStyle, dw::Textblock::Word::style, and dw::core::Requisition::width.
|
protected |
Find the first line index that includes y, relative to top of widget.
Definition at line 1308 of file textblock.cc.
|
protected |
Find the line of word wordIndex.
Definition at line 1341 of file textblock.cc.
Referenced by dw::Textblock::TextblockIterator::getAllocation().
|
protected |
Find the paragraph of word wordIndex.
Definition at line 1364 of file textblock.cc.
|
protected |
Find the index of the word, or -1.
Definition at line 1390 of file textblock.cc.
References dw::core::Requisition::ascent, dw::core::style::Font::ascent, dw::Textblock::Line::boxAscent, dw::Textblock::Line::boxDescent, dw::Textblock::Word::effSpace, dw::Textblock::Line::firstWord, dw::core::style::StyleAttrs::font, dw::Textblock::Word::size, dw::Textblock::Word::spaceStyle, and dw::core::Requisition::width.
void dw::Textblock::flush | ( | ) |
Definition at line 2304 of file textblock.cc.
References PRINTF.
|
protectedvirtual |
Reimplemented from dw::core::Widget.
Definition at line 406 of file textblock.cc.
References dw::Textblock::Paragraph::maxParMax, dw::Textblock::Paragraph::maxParMin, dw::core::Extremes::maxWidth, dw::core::Extremes::minWidth, and PRINTF.
|
staticprotected |
Definition at line 1307 of file textblock_linebreaking.cc.
|
staticprotected |
Definition at line 1312 of file textblock_linebreaking.cc.
References dw::Textblock::Word::maxAscent, dw::Textblock::Word::maxDescent, dw::Textblock::Word::spaceStyle, dw::core::style::TEXT_ALIGN_JUSTIFY, and dw::core::style::StyleAttrs::textAlign.
|
staticprotected |
Definition at line 1289 of file textblock_linebreaking.cc.
References dw::Textblock::Word::origSpace, dw::Textblock::Word::spaceStyle, dw::core::style::TEXT_ALIGN_JUSTIFY, and dw::core::style::StyleAttrs::textAlign.
|
staticprotected |
Definition at line 1297 of file textblock_linebreaking.cc.
References dw::Textblock::Word::origSpace, dw::Textblock::Word::spaceStyle, dw::core::style::TEXT_ALIGN_JUSTIFY, and dw::core::style::StyleAttrs::textAlign.
|
virtual |
Search recursively through widget.
This is an optimized version of the general dw::core::Widget::getWidgetAtPoint method.
Reimplemented from dw::core::Widget.
Definition at line 2243 of file textblock.cc.
References dw::Textblock::Word::content, dw::Textblock::Line::firstWord, dw::core::Widget::getWidgetAtPoint(), dw::core::Content::type, and dw::core::Content::widget.
|
protected |
Get the extremes of a word within a textblock.
Definition at line 376 of file textblock.cc.
References dw::core::style::absLengthVal(), dw::core::style::StyleAttrs::boxDiffWidth(), dw::Textblock::Word::content, dw::core::Widget::getExtremes(), dw::core::Widget::getStyle(), dw::core::Widget::hasContents(), dw::core::style::isAbsLength(), dw::core::style::isPerLength(), dw::core::Extremes::maxWidth, dw::core::Extremes::minWidth, dw::Textblock::Word::size, dw::Textblock::Word::style, dw::core::Content::type, dw::core::Widget::usesHints(), dw::core::Content::widget, dw::core::Requisition::width, and dw::core::style::StyleAttrs::width.
|
protected |
Counter part to wordWrap(), but for extremes, not size calculation.
Definition at line 770 of file textblock_linebreaking.cc.
References dw::Textblock::Word::badnessAndPenalty, dw::Textblock::Paragraph::firstWord, dw::Textblock::Word::flags, dw::Textblock::Word::hyphenWidth, dw::Textblock::Paragraph::lastWord, dw::Textblock::BadnessAndPenalty::lineCanBeBroken(), lout::misc::max(), dw::Textblock::Paragraph::maxParMax, dw::Textblock::Paragraph::maxParMin, dw::core::Extremes::maxWidth, dw::core::Extremes::minWidth, dw::Textblock::Word::origSpace, dw::Textblock::Paragraph::parMax, dw::Textblock::Paragraph::parMin, and PRINTF.
void dw::Textblock::handOverBreak | ( | core::style::Style * | style | ) |
This function "hands" the last break of a page "over" to a parent page. This is used for "collapsing spaces".
Definition at line 2284 of file textblock.cc.
References addParbreak(), and dw::Textblock::Line::breakSpace.
|
protected |
Definition at line 863 of file textblock_linebreaking.cc.
References dw::Textblock::Word::badnessAndPenalty, dw::Textblock::Word::content, dw::Textblock::Word::flags, dw::core::style::StyleAttrs::font, dw::Hyphenator::hyphenateWord(), dw::Textblock::Word::hyphenWidth, PRINTF, dw::Textblock::BadnessAndPenalty::setPenalties(), dw::core::Content::space, dw::Textblock::Word::spaceStyle, dw::Textblock::Word::style, dw::core::Content::text, dw::core::Content::type, dw::core::style::Style::unref(), dw::Textblock::Anchor::wordIndex, and dw::core::style::StyleAttrs::x_lang.
|
protected |
Definition at line 1099 of file textblock_linebreaking.cc.
References dw::core::style::absLengthVal(), dw::core::Widget::blockLevel(), dw::Textblock::Word::content, dw::core::style::isPerLength(), dw::core::style::multiplyWithPerLengthRounded(), dw::Textblock::Word::size, dw::core::Content::type, dw::core::Content::widget, and dw::core::Requisition::width.
|
protected |
Basic initialization, which is neccessary before fillWord.
Definition at line 1470 of file textblock.cc.
References dw::Textblock::Word::spaceImgRenderer, dw::Textblock::Word::spaceStyle, dw::Textblock::Word::style, and dw::Textblock::Word::wordImgRenderer.
|
protected |
Definition at line 2115 of file textblock.cc.
References lout::misc::assertNotReached(), dw::Textblock::Word::style, dw::core::style::WHITE_SPACE_NORMAL, dw::core::style::WHITE_SPACE_NOWRAP, dw::core::style::WHITE_SPACE_PRE, dw::core::style::WHITE_SPACE_PRE_LINE, dw::core::style::WHITE_SPACE_PRE_WRAP, and dw::core::style::StyleAttrs::whiteSpace.
|
protected |
Definition at line 757 of file textblock_linebreaking.cc.
References dw::Textblock::Word::content, dw::Textblock::Word::flags, dw::Textblock::Word::style, dw::core::Content::text, dw::core::Content::type, and dw::core::style::StyleAttrs::x_lang.
|
virtual |
Return an iterator for this widget.
mask can narrow the types returned by the iterator, this can enhance performance quite much, e.g. when only searching for child widgets.
With atEnd == false, the iterator starts before the beginning, i.e. the first call of dw::core::Iterator::next will let the iterator point on the first piece of contents. Likewise, With atEnd == true, the iterator starts after the last piece of contents, call dw::core::Iterator::prev in this case.
Implements dw::core::Widget.
Definition at line 875 of file textblock.cc.
|
protected |
Definition at line 288 of file textblock_linebreaking.cc.
References dw::Textblock::Word::effSpace, dw::Textblock::Line::firstWord, dw::Textblock::Word::origSpace, and PRINTF.
|
protectedvirtual |
Reimplemented from dw::core::Widget.
Definition at line 716 of file textblock.cc.
References _MSG, hoverTooltip, and dw::core::style::Tooltip::onLeave().
|
inlineprotected |
Returns the x offset (the indentation plus any offset needed for centering or right justification) for the line.
The offset returned is relative to the page content (i.e. without border etc.).
Definition at line 552 of file textblock.hh.
References innerPadding, dw::Textblock::Line::leftOffset, line1OffsetEff, and lines.
Referenced by lineXOffsetWidget().
|
inlineprotected |
Like lineXOffset, but relative to the allocation (i.e. including border etc.).
Definition at line 562 of file textblock.hh.
References dw::core::style::StyleAttrs::boxOffsetX(), dw::core::Widget::getStyle(), and lineXOffsetContents().
Referenced by dw::Textblock::TextblockIterator::getAllocation().
|
inlineprotected |
Returns the y offset (within the canvas) of a line.
Definition at line 590 of file textblock.hh.
References dw::core::Widget::allocation, and lineYOffsetCanvasAllocation().
Referenced by dw::Textblock::TextblockIterator::getAllocation(), and lineYOffsetCanvasI().
|
inlineprotected |
Like lineYOffsetCanvas, but with the allocation as parameter.
Definition at line 581 of file textblock.hh.
References dw::core::Widget::allocation, lineYOffsetWidgetAllocation(), and dw::core::Allocation::y.
Referenced by lineYOffsetCanvas().
|
inlineprotected |
Definition at line 600 of file textblock.hh.
References lines, and lineYOffsetCanvas().
|
inlineprotected |
Definition at line 573 of file textblock.hh.
References dw::core::Widget::allocation, and lineYOffsetWidgetAllocation().
Referenced by lineYOffsetWidgetI().
|
inlineprotected |
Definition at line 567 of file textblock.hh.
References dw::core::Widget::allocation, dw::core::Allocation::ascent, lines, and dw::Textblock::Line::top.
Referenced by lineYOffsetCanvasAllocation(), and lineYOffsetWidget().
|
inlineprotected |
Definition at line 595 of file textblock.hh.
References lines, and lineYOffsetWidget().
|
protectedvirtual |
Reimplemented from dw::core::Widget.
Definition at line 587 of file textblock.cc.
References lout::misc::min(), and PRINTF.
|
protectedvirtual |
Reimplemented from dw::core::Widget.
Definition at line 562 of file textblock.cc.
References lout::misc::min(), and PRINTF.
|
protectedvirtual |
Reimplemented from dw::core::Widget.
Definition at line 667 of file textblock.cc.
References _MSG, dw::core::BUTTON1_MASK, dw::core::style::StyleAttrs::cursor, hoverTooltip, dw::core::style::Tooltip::onEnter(), dw::core::style::Tooltip::onLeave(), dw::core::style::Tooltip::onMotion(), dw::Textblock::Word::spaceStyle, dw::core::MouseEvent::state, dw::Textblock::Word::style, dw::core::style::StyleAttrs::x_link, dw::core::style::StyleAttrs::x_tooltip, dw::core::MousePositionEvent::xWidget, and dw::core::MousePositionEvent::yWidget.
|
protected |
Definition at line 272 of file textblock_linebreaking.cc.
References dw::Textblock::Word::badnessAndPenalty, dw::Textblock::Word::origSpace, dw::Textblock::BadnessAndPenalty::print(), dw::Textblock::Word::size, dw::Textblock::Word::totalSpaceShrinkability, dw::Textblock::Word::totalSpaceStretchability, dw::Textblock::Word::totalWidth, and dw::core::Requisition::width.
|
protected |
Definition at line 252 of file textblock_linebreaking.cc.
|
protected |
Definition at line 233 of file textblock_linebreaking.cc.
References dw::Textblock::Word::content, lout::identity::IdentifiableObject::getClassName(), dw::core::Content::text, dw::core::Content::type, and dw::core::Content::widget.
|
protected |
Definition at line 264 of file textblock_linebreaking.cc.
References dw::Textblock::Word::flags.
|
protected |
Definition at line 475 of file textblock_linebreaking.cc.
|
protected |
Definition at line 2374 of file textblock.cc.
References dw::Textblock::Line::boxAscent, dw::Textblock::Line::contentAscent, lout::misc::max(), and lout::misc::min().
Referenced by dw::Textblock::TextblockIterator::highlight(), and dw::Textblock::TextblockIterator::unhighlight().
|
protected |
Definition at line 870 of file textblock.cc.
|
protected |
Definition at line 1503 of file textblock.cc.
References dw::core::style::StyleAttrs::backgroundImage, dw::core::style::StyleImage::removeExternalImgRenderer(), dw::Textblock::Word::spaceImgRenderer, and dw::Textblock::Word::spaceStyle.
|
protected |
Definition at line 1284 of file textblock_linebreaking.cc.
|
protected |
Definition at line 1479 of file textblock.cc.
References dw::core::style::StyleAttrs::backgroundImage, dw::core::style::StyleImage::removeExternalImgRenderer(), dw::Textblock::Word::style, and dw::Textblock::Word::wordImgRenderer.
|
protectedvirtual |
Called after sizeAllocateImpl() to redraw necessary areas. By default the whole widget is redrawn.
Reimplemented from dw::core::Widget.
Definition at line 548 of file textblock.cc.
References dw::Textblock::Line::lastWord.
|
protected |
Rewrap the page from the line from which this is necessary. There are basically two times we'll want to do this: either when the viewport is resized, or when the size changes on one of the child widgets.
Definition at line 1185 of file textblock_linebreaking.cc.
References dw::Textblock::Word::content, lout::misc::min(), PRINTF, dw::Textblock::Word::size, dw::core::Content::type, and dw::core::Content::widget.
|
protected |
Definition at line 663 of file textblock_linebreaking.cc.
References dw::Textblock::Word::badnessAndPenalty, dw::Textblock::BadnessAndPenalty::compareTo(), PRINTF, and dw::Textblock::BadnessAndPenalty::setPenalty().
|
protected |
Send event to selection.
Definition at line 733 of file textblock.cc.
References dw::core::Requisition::ascent, dw::core::style::Font::ascent, dw::Textblock::Line::boxAscent, dw::Textblock::Line::boxDescent, dw::Textblock::Word::content, dw::core::Requisition::descent, dw::core::style::Font::descent, dw::Textblock::Word::effSpace, dw::Textblock::Line::firstWord, dw::Textblock::Word::flags, dw::core::style::StyleAttrs::font, dw::Textblock::Line::lastWord, dw::Textblock::Word::size, dw::Textblock::Word::spaceStyle, dw::Textblock::Word::style, dw::core::Content::text, dw::core::Content::type, dw::core::Iterator::unref(), dw::core::Requisition::width, dw::core::style::StyleAttrs::x_link, dw::core::MousePositionEvent::xWidget, dw::core::MousePositionEvent::yCanvas, and dw::core::MousePositionEvent::yWidget.
|
protectedvirtual |
Reimplemented from dw::core::Widget.
Definition at line 624 of file textblock.cc.
|
protected |
Set a break option, if allowed by the style. Called by fillSpace (and so addSpace), but may be called, via addBreakOption(), as an alternative, e. g. for ideographic characters.
Definition at line 2101 of file textblock.cc.
References dw::Textblock::Word::badnessAndPenalty, dw::Textblock::BadnessAndPenalty::lineMustBeBroken(), dw::Textblock::BadnessAndPenalty::setPenalties(), and dw::Textblock::BadnessAndPenalty::setPenalty().
|
protectedvirtual |
Reimplemented from dw::core::Widget.
Definition at line 638 of file textblock.cc.
|
static |
Definition at line 202 of file textblock.cc.
Referenced by main().
|
static |
Definition at line 208 of file textblock.cc.
Referenced by main().
|
static |
Definition at line 213 of file textblock.cc.
Referenced by main().
|
static |
Definition at line 192 of file textblock.cc.
Referenced by main().
|
static |
Definition at line 197 of file textblock.cc.
Referenced by main().
|
protected |
Definition at line 1515 of file textblock.cc.
References dw::core::style::StyleAttrs::backgroundImage, dw::core::style::StyleImage::putExternalImgRenderer(), dw::Textblock::Word::spaceImgRenderer, and dw::Textblock::Word::spaceStyle.
|
static |
Definition at line 218 of file textblock.cc.
Referenced by main().
|
protectedvirtual |
Reimplemented from dw::core::Widget.
Definition at line 607 of file textblock.cc.
|
protected |
Definition at line 1491 of file textblock.cc.
References dw::core::style::StyleAttrs::backgroundImage, dw::core::style::StyleImage::putExternalImgRenderer(), dw::Textblock::Word::style, and dw::Textblock::Word::wordImgRenderer.
|
protected |
Definition at line 1273 of file textblock_linebreaking.cc.
References PRINTF.
|
protectedvirtual |
Reimplemented from dw::core::Widget.
Definition at line 431 of file textblock.cc.
References dw::core::Allocation::ascent, dw::core::Requisition::ascent, dw::core::style::Box::bottom, dw::Textblock::Line::boxAscent, dw::Textblock::Word::content, dw::core::Allocation::descent, dw::core::Requisition::descent, dw::Textblock::Word::effSpace, dw::Textblock::Line::firstWord, dw::core::Widget::getAllocation(), dw::core::Widget::getStyle(), dw::Textblock::Line::lastWord, dw::core::style::StyleAttrs::margin, lout::misc::min(), dw::Textblock::Anchor::name, PRINTF, dw::Textblock::Word::size, dw::core::Widget::sizeAllocate(), dw::core::style::Box::top, dw::core::Content::type, dw::core::Widget::wasAllocated(), dw::core::Content::widget, dw::core::Allocation::width, dw::core::Requisition::width, dw::Textblock::Anchor::wordIndex, dw::core::Allocation::x, and dw::core::Allocation::y.
|
protectedvirtual |
The ascent of a textblock is the ascent of the first line, plus padding/border/margin. This can be used to align the first lines of several textblocks in a horizontal line.
Implements dw::core::Widget.
Definition at line 324 of file textblock.cc.
References dw::core::Requisition::ascent, dw::Textblock::Line::boxAscent, dw::Textblock::Line::boxDescent, dw::core::Requisition::descent, dw::Textblock::Line::maxLineWidth, PRINTF, dw::Textblock::Line::top, and dw::core::Requisition::width.
|
protected |
Definition at line 1559 of file textblock.cc.
References dw::core::style::StyleAttrs::font, dw::core::style::TEXT_TRANSFORM_CAPITALIZE, dw::core::style::TEXT_TRANSFORM_LOWERCASE, dw::core::style::TEXT_TRANSFORM_NONE, dw::core::style::TEXT_TRANSFORM_UPPERCASE, and dw::core::style::StyleAttrs::textTransform.
Referenced by dw::Textblock::TextblockIterator::getAllocation().
|
protectedvirtual |
Reimplemented in dw::TableCell.
Definition at line 508 of file textblock_linebreaking.cc.
References dw::Textblock::Word::badnessAndPenalty, dw::Textblock::Word::content, dw::Textblock::Word::effSpace, lout::identity::IdentifiableObject::getClassName(), dw::Textblock::BadnessAndPenalty::lineMustBeBroken(), dw::Textblock::BadnessAndPenalty::lineTooTight(), dw::Textblock::Word::origSpace, dw::core::Widget::parentRef, PRINTF, dw::core::Content::type, and dw::core::Content::widget.
Referenced by dw::TableCell::wordWrap().
|
friend |
Definition at line 430 of file textblock.hh.
Referenced by dw::Textblock::TextblockIterator::clone().
|
protected |
Definition at line 488 of file textblock.hh.
|
protected |
Definition at line 480 of file textblock.hh.
|
protected |
Definition at line 480 of file textblock.hh.
|
protected |
Definition at line 480 of file textblock.hh.
|
static |
Definition at line 669 of file textblock.hh.
Referenced by DilloHtml::HtmlLinkReceiver::click().
|
staticprivate |
Definition at line 235 of file textblock.hh.
|
protected |
Definition at line 433 of file textblock.hh.
Referenced by addParbreak(), dw::ListItem::initWithText(), and dw::ListItem::initWithWidget().
struct { ... } dw::Textblock::hlEnd[core::HIGHLIGHT_NUM_LAYERS] |
struct { ... } dw::Textblock::hlStart[core::HIGHLIGHT_NUM_LAYERS] |
|
protected |
Definition at line 493 of file textblock.hh.
|
staticprivate |
The character which is used to draw a hyphen at the end of a line, either caused by automatic hyphenation, or by soft hyphens.
Initially, soft hyphens were used, but they are not drawn on some platforms. Also, unconditional hyphens (U+2010) are not available in many fonts; so, a simple hyphen-minus is used.
Definition at line 237 of file textblock.hh.
|
protected |
Definition at line 457 of file textblock.hh.
int dw::Textblock::index |
Definition at line 490 of file textblock.hh.
Referenced by dw::Textblock::TextblockIterator::clone(), dw::Textblock::TextblockIterator::compareTo(), dw::Textblock::TextblockIterator::getAllocation(), dw::Textblock::TextblockIterator::highlight(), dw::Textblock::TextblockIterator::next(), dw::Textblock::TextblockIterator::prev(), and dw::Textblock::TextblockIterator::unhighlight().
|
protected |
Definition at line 435 of file textblock.hh.
Referenced by lineXOffsetContents(), and dw::ListItem::setMaxValue().
|
protected |
Definition at line 477 of file textblock.hh.
|
protected |
Definition at line 474 of file textblock.hh.
|
protected |
Definition at line 437 of file textblock.hh.
Referenced by dw::ListItem::setMaxValue(), and dw::TableCell::setMaxValue().
|
protected |
Definition at line 440 of file textblock.hh.
Referenced by lineXOffsetContents().
|
protected |
Definition at line 484 of file textblock.hh.
Referenced by addParbreak(), calcPenaltyIndexForNewLine(), dw::Textblock::TextblockIterator::getAllocation(), lineXOffsetContents(), lineYOffsetCanvasI(), lineYOffsetWidgetAllocation(), and lineYOffsetWidgetI().
|
protected |
Definition at line 459 of file textblock.hh.
Referenced by addParbreak().
int dw::Textblock::nChar |
Definition at line 490 of file textblock.hh.
Referenced by dw::Textblock::TextblockIterator::highlight(), and dw::Textblock::TextblockIterator::unhighlight().
|
protected |
Definition at line 486 of file textblock.hh.
|
protected |
Definition at line 485 of file textblock.hh.
|
staticprotected |
The penalties for hyphens and other, multiplied by 100. So, 100 means 1.0. INT_MAX and INT_MIN are also allowed. See dw::Textblock::BadnessAndPenalty::setPenalty for more details. Set from preferences.
Definition at line 467 of file textblock.hh.
|
protected |
Definition at line 476 of file textblock.hh.
Referenced by dw::ListItem::setMaxValue().
|
staticprotected |
...
Definition at line 472 of file textblock.hh.
|
protected |
Definition at line 487 of file textblock.hh.
Referenced by addParbreak(), calcPenaltyIndexForNewLine(), dw::Textblock::TextblockIterator::getAllocation(), dw::ListItem::getValue(), dw::TableCell::getValue(), dw::Textblock::TextblockIterator::next(), dw::Textblock::TextblockIterator::prev(), dw::Textblock::TextblockIterator::TextblockIterator(), and dw::TableCell::wordWrap().
|
protected |
Definition at line 482 of file textblock.hh.
|
protected |
Definition at line 482 of file textblock.hh.