60 sb->
append (
"{ widget = ");
70 sb->
append (
", content = ");
104 int curStart, curEnd, cmp;
126 eit3->
next (), atStart =
false) {
151 if (alloc1.
x > alloc2.
x) {
192 if (alloc1.
y > alloc2.
y) {
203 x1, y1, x2 - x1, y2 - y1);
267 const char *text):
Iterator (widget, mask, atEnd)
340 for (
int i = 0; i <
size (); i++)
373 while (fromEnd ? it2->
prev () : it2->
next ()) {
414 while (fromEnd ? it2->
prev () : it2->
next ()) {
557 for (w = it->
getWidget (), level = thisLevel;
570 bool hasNext = it->
next();
626 assert (otherDeepIterator->
stack.
size() > 0);
635 == otherDeepIterator->
stack.
get(level)->getWidget());
637 while (
stack.
get(level)->getWidget ()
638 == otherDeepIterator->
stack.
get(level)->getWidget ()) {
640 level == otherDeepIterator->
stack.
size() - 1)
647 while (
stack.
get(level)->getWidget ()
648 != otherDeepIterator->
stack.
get(level)->getWidget ())
779 return pos - otherIt->
pos;
786 it->getContent()->text[pos] == 0)) {
792 ch = it->getContent()->text[pos];
803 }
else if (ch == END)
808 ch = it->getContent()->text[pos];
810 if (it->getContent()->space) {
829 if (it->getContent()->text[0] == 0)
832 pos = strlen (it->getContent()->text);
833 if (it->getContent()->space) {
837 ch = it->getContent()->text[pos];
847 }
else if (ch == START)
852 ch = it->getContent()->text[pos];
872 it->
next (), start =
false) {
static void highlight(CharIterator *it1, CharIterator *it2, HighlightLayer layer)
int compareTo(lout::object::Comparable *other)
Compare two objects, this and other.
static void unhighlight(CharIterator *it1, CharIterator *it2, HighlightLayer layer)
lout::object::Object * clone()
Return an exact copy of the object.
A stack of iterators, to iterate recursively through a widget tree.
static Iterator * searchDownward(Iterator *it, Content::Type mask, bool fromEnd)
static Iterator * searchSideward(Iterator *it, Content::Type mask, bool fromEnd)
DeepIterator * cloneDeepIterator()
static int getRespectiveLevel(Widget *widget, Content::Type mask)
DeepIterator * createVariant(Iterator *it)
void highlight(int start, int end, HighlightLayer layer)
Highlight a part of the current content.
int compareTo(lout::object::Comparable *other)
Compare two objects, this and other.
bool prev()
Move iterator backward and store content it.
lout::object::Object * clone()
Return an exact copy of the object.
static Widget * getRespectiveParent(Widget *widget, Content::Type mask)
bool next()
Move iterator forward and store content it.
void getAllocation(int start, int end, Allocation *allocation)
Return the shape, which a part of the item, the iterator points on, allocates.
void unhighlight(int direction, HighlightLayer layer)
This implementation of dw::core::Iterator can be used by widgets with no contents.
bool next()
Move iterator forward and store content it.
EmptyIterator(EmptyIterator &it)
lout::object::Object * clone()
Return an exact copy of the object.
void unhighlight(int direction, HighlightLayer layer)
Shrink highlighted region to no longer contain the current content.
int compareTo(lout::object::Comparable *other)
Compare two objects, this and other.
void getAllocation(int start, int end, Allocation *allocation)
Return the shape, which a part of the item, the iterator points on, allocates.
bool prev()
Move iterator backward and store content it.
void highlight(int start, int end, HighlightLayer layer)
Extend highlighted region to contain part of the current content.
Iterators are used to iterate through the contents of a widget.
virtual void getAllocation(int start, int end, Allocation *allocation)=0
Return the shape, which a part of the item, the iterator points on, allocates.
virtual void unref()
Delete the iterator.
static void scrollTo(Iterator *it1, Iterator *it2, int start, int end, HPosition hpos, VPosition vpos)
Scrolls the viewport, so that the region between it1 and it2 is seen, according to hpos and vpos.
void intoStringBuffer(lout::misc::StringBuffer *sb)
Store a textual representation of the object in a misc::StringBuffer.
virtual bool next()=0
Move iterator forward and store content it.
Iterator(Widget *widget, Content::Type mask, bool atEnd)
virtual bool prev()=0
Move iterator backward and store content it.
bool equals(Object *other)
Returns, whether two objects are equal.
Iterator * cloneIterator()
void scrollTo(HPosition hpos, VPosition vpos, int x, int y, int width, int height)
Scrolls all viewports, so that the region [x, y, width, height] is seen, according to hpos and vpos.
This implementation of dw::core::Iterator can be used by widgets having one text word as contents.
const char * text
May be NULL, in this case, the next is skipped.
TextIterator(TextIterator &it)
bool next()
Move iterator forward and store content it.
bool prev()
Move iterator backward and store content it.
void getAllocation(int start, int end, Allocation *allocation)
Return the shape, which a part of the item, the iterator points on, allocates.
int compareTo(lout::object::Comparable *other)
Compare two objects, this and other.
void put(T *newElement, int newPos=-1)
Iterator * get(int pos) const
const char * getClassName()
Return the name, under which the class of this object was registered.
A class for fast concatenation of a large number of strings.
void appendPointer(void *p)
void append(const char *str)
Append a NUL-terminated string to the buffer, with copying.
Instances of a sub class of may be compared (less, greater).
virtual int compareTo(Comparable *other)=0
Compare two objects, this and other.
This is the base class for many other classes, which defines very common virtual methods.
Dw is in this namespace, or sub namespaces of this one.
Represents the allocation, i.e.
@ WIDGET_OOF_REF
reference to a widget out of flow (OOF); this widget (containing this content) is only the generator ...
@ WIDGET_OOF_CONT
widget out of flow (OOF); this widget (containing this content) is only the container (parent),...
static Content::Type maskForSelection(bool followReferences)
static void maskIntoStringBuffer(Type mask, lout::misc::StringBuffer *sb)
static void intoStringBuffer(Content *content, lout::misc::StringBuffer *sb)