23#include "../lout/msg.h"
24#include "../lout/misc.hh"
62 DBG_OBJ_ENTER_O (
"iterator", 0, getWidget (),
"TextblockIterator::highlight",
63 "..., %d, %d, %d", start, end, layer);
81 int oldEndIndex = textblock->
hlEnd[layer].
index;
82 int oldEndChar = textblock->
hlEnd[layer].
nChar;
113 oldEndIndex != textblock->
hlEnd[layer].
index ||
117 highlightOOF (start, end, layer);
127 "TextblockIterator/unhighlight",
"..., %d, %d",
149 int oldEndIndex = textblock->
hlEnd[layer].
index;
150 int oldEndChar = textblock->
hlEnd[layer].
nChar;
152 if (direction == 0) {
178 oldEndIndex != textblock->
hlEnd[layer].
index ||
182 unhighlightOOF (direction, layer);
193 int index = getInFlowIndex ();
200 if (lineIndex != -1) {
202 Line *line = textblock->
lines->getRef (lineIndex);
210 Line *prevLine = textblock->
lines->size () > 0 ?
211 textblock->
lines->getLastRef () : NULL;
212 firstWordOfLine = prevLine ? prevLine->
lastWord + 1 : 0;
222 + (textblock->
lines->size () == 0 ?
227 lineBorderAscent = 0;
228 for (
int i = firstWordOfLine; i < textblock->
words->size (); i++) {
234 lineBorderAscent =
misc::max (lineBorderAscent, borderAscent);
239 for (
int i = firstWordOfLine; i <
index; i++) {
257 if (start > 0 || end < wordEnd) {
276 return ((
Textblock*)getWidget())->words->size ();
void unhighlight(int direction, core::HighlightLayer layer)
Shrink highlighted region to no longer contain the current content.
lout::object::Object * clone()
Return an exact copy of the object.
static TextblockIterator * createWordIndexIterator(Textblock *textblock, core::Content::Type mask, int wordIndex)
TextblockIterator(Textblock *textblock, core::Content::Type mask, bool atEnd)
void highlight(int start, int end, core::HighlightLayer layer)
Extend highlighted region to contain part of the current content.
void getAllocation(int start, int end, core::Allocation *allocation)
Return the shape, which a part of the item, the iterator points on, allocates.
void getContentInFlow(int index, core::Content *content)
A Widget for rendering text blocks, i.e.
struct dw::Textblock::@28 hlEnd[core::HIGHLIGHT_NUM_LAYERS]
lout::misc::NotSoSimpleVector< Word > * words
int yOffsetOfLineToBeCreated(int *lastMargin=NULL)
Includes margin, border, and padding.
bool mustBorderBeRegarded(Line *line)
Of nested text blocks, only the most inner one must regard the borders of floats.
struct dw::Textblock::@28 hlStart[core::HIGHLIGHT_NUM_LAYERS]
int findLineOfWord(int wordIndex)
Find the line of word wordIndex.
int textWidth(const char *text, int start, int len, core::style::Style *style, bool isStart, bool isEnd)
void queueDrawRange(int index1, int index2)
int lineYOffsetCanvas(Line *line, core::Allocation *allocation)
lout::misc::SimpleVector< Line > * lines
void intoStringBuffer(misc::StringBuffer *sb)
Store a textual representation of the object in a misc::StringBuffer.
A class for fast concatenation of a large number of strings.
const char * getChars()
Return a NUL-terminated strings containing all appended strings.
This is the base class for many other classes, which defines very common virtual methods.
#define DBG_OBJ_LEAVE_O(obj)
#define DBG_OBJ_MSGF_O(aspect, prio, obj, fmt,...)
#define DBG_OBJ_ENTER_O(aspect, prio, obj, funname, fmt,...)
#define DBG_OBJ_ARRATTRSET_NUM_O(obj, var, ind, attr, val)
Dw is in this namespace, or sub namespaces of this one.
core::style::Style * style
Represents the allocation, i.e.
@ WIDGET_IN_FLOW
widget in normal flow, so that this widget (containing this content) is both container (parent) and g...