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).
  Fossies Dox: dillo-3.0.5.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

dw::core::DeepIterator Class Reference

A stack of iterators, to iterate recursively through a widget tree. More...

#include <iterator.hh>

Inheritance diagram for dw::core::DeepIterator:
[legend]
Collaboration diagram for dw::core::DeepIterator:
[legend]

Classes

class  Stack
 

Public Member Functions

 DeepIterator (Iterator *it)
 Create a new deep iterator from an existing dw::core::Iterator. More...
 
 ~DeepIterator ()
 
lout::object::Objectclone ()
 Return an exact copy of the object. More...
 
DeepIteratorcreateVariant (Iterator *it)
 
IteratorgetTopIterator ()
 
ContentgetContent ()
 
bool isEmpty ()
 
bool next ()
 Move iterator forward and store content it. More...
 
bool prev ()
 Move iterator backward and store content it. More...
 
DeepIteratorcloneDeepIterator ()
 
int compareTo (lout::object::Comparable *other)
 Compare two objects c1 and c2. More...
 
void highlight (int start, int end, HighlightLayer layer)
 Highlight a part of the current content. More...
 
void getAllocation (int start, int end, Allocation *allocation)
 Return the shape, which a part of the item, the iterator points on, allocates. More...
 
void unhighlight (int direction, HighlightLayer layer)
 
- Public Member Functions inherited from lout::object::Object
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 void intoStringBuffer (misc::StringBuffer *sb)
 Store a textual representation of the object in a misc::StringBuffer. 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 scrollTo (DeepIterator *it1, DeepIterator *it2, int start, int end, HPosition hpos, VPosition vpos)
 
- Static Public Member Functions inherited from lout::object::Comparable
static int compareFun (const void *p1, const void *p2)
 This static method may be used as compare function for qsort(3) and bsearch(3), for an array of Object* (Object*[] or Object**). More...
 

Private Member Functions

 DeepIterator ()
 

Static Private Member Functions

static IteratorsearchDownward (Iterator *it, Content::Type mask, bool fromEnd)
 
static IteratorsearchSideward (Iterator *it, Content::Type mask, bool fromEnd)
 

Private Attributes

Stack stack
 
Content::Type mask
 
Content content
 
bool hasContents
 

Detailed Description

A stack of iterators, to iterate recursively through a widget tree.

This class is similar to dw::core::Iterator, but not created by a widget, but explicitly from another iterator. Deep iterators do not have the limitation, that iteration is only done within a widget, instead, child widgets are iterated through recursively.

Definition at line 145 of file iterator.hh.

Constructor & Destructor Documentation

◆ DeepIterator() [1/2]

dw::core::DeepIterator::DeepIterator ( )
inlineprivate

Definition at line 169 of file iterator.hh.

Referenced by dw::core::CharIterator::CharIterator(), clone(), and createVariant().

◆ DeepIterator() [2/2]

dw::core::DeepIterator::DeepIterator ( Iterator it)

Create a new deep iterator from an existing dw::core::Iterator.

The content of the return value will be the content of it. If within the widget tree, there is no non-widget content, the resulting deep iterator is empty (denoted by dw::core::DeepIterator::stack == NULL).

Notes:

  1. The mask of i" must include DW_CONTENT_WIDGET, but dw::core::DeepIterator::next will never return widgets.

Definition at line 457 of file iterator.cc.

References dw::core::Iterator::cloneIterator(), content, dw::core::Iterator::getContent(), dw::core::Widget::getLevel(), dw::core::Iterator::getMask(), dw::core::Widget::getParent(), dw::core::Iterator::getWidget(), hasContents, dw::core::Widget::iterator(), mask, dw::core::Iterator::next(), lout::container::typed::Vector< T >::put(), searchDownward(), searchSideward(), stack, dw::core::Content::type, dw::core::Iterator::unref(), dw::core::Content::WIDGET, and dw::core::Content::widget.

◆ ~DeepIterator()

dw::core::DeepIterator::~DeepIterator ( )

Definition at line 520 of file iterator.cc.

Member Function Documentation

◆ clone()

object::Object * dw::core::DeepIterator::clone ( )
virtual

◆ cloneDeepIterator()

◆ compareTo()

int dw::core::DeepIterator::compareTo ( lout::object::Comparable other)
virtual

Compare two objects c1 and c2.

Return a value < 0, when c1 is less than c2, a value > 0, when c1 is greater than c2, or 0, when c1 and c2 are equal.

If c1.equals(c2) (as defined in Object), c1.compareTo(c2) must be 0, but, unlike you may expect, the reversed is not necessarily true. This method returns 0, if, according to the rules for sorting, there is no difference, but there may still be differences (not relevant for sorting), which "equals" will care about.

Implements lout::object::Comparable.

Definition at line 538 of file iterator.cc.

References lout::container::typed::Vector< T >::get(), lout::container::typed::Vector< T >::size(), and stack.

Referenced by dw::core::SelectionState::adjustSelection(), dw::core::SelectionState::copy(), dw::core::CharIterator::highlight(), dw::core::SelectionState::highlight0(), dw::core::Iterator::scrollTo(), and dw::core::CharIterator::unhighlight().

◆ createVariant()

DeepIterator * dw::core::DeepIterator::createVariant ( Iterator it)
Todo:
Not yet implemented, and actually not yet needed very much.

Definition at line 560 of file iterator.cc.

References DeepIterator().

Referenced by dw::core::SelectionState::adjustSelection().

◆ getAllocation()

void dw::core::DeepIterator::getAllocation ( int  start,
int  end,
Allocation allocation 
)
inline

Return the shape, which a part of the item, the iterator points on, allocates.

The parameters start and end have the same meaning as in DwIterator::highlight().

Definition at line 206 of file iterator.hh.

References dw::core::Iterator::getAllocation(), dw::core::DeepIterator::Stack::getTop(), and stack.

Referenced by dw::core::Iterator::scrollTo().

◆ getContent()

Content* dw::core::DeepIterator::getContent ( )
inline

◆ getTopIterator()

Iterator* dw::core::DeepIterator::getTopIterator ( )
inline

◆ highlight()

void dw::core::DeepIterator::highlight ( int  start,
int  end,
HighlightLayer  layer 
)
inline

Highlight a part of the current content.

Unhighlight the current content by passing -1 as start (see also (dw::core::Iterator::unhighlight). For text, start and end define the characters, otherwise, the shape is defined as [0, 1], i.e. for highlighting a whole dw::core::Content, pass 0 and >= 1.

Definition at line 196 of file iterator.hh.

References dw::core::DeepIterator::Stack::getTop(), dw::core::Iterator::highlight(), and stack.

Referenced by dw::core::SelectionState::adjustSelection(), dw::core::CharIterator::highlight(), and dw::core::SelectionState::highlight0().

◆ isEmpty()

bool dw::core::DeepIterator::isEmpty ( )

Definition at line 566 of file iterator.cc.

References hasContents.

Referenced by dw::core::SelectionState::buttonPress().

◆ next()

◆ prev()

◆ scrollTo()

static void dw::core::DeepIterator::scrollTo ( DeepIterator it1,
DeepIterator it2,
int  start,
int  end,
HPosition  hpos,
VPosition  vpos 
)
inlinestatic

◆ searchDownward()

Iterator * dw::core::DeepIterator::searchDownward ( Iterator it,
Content::Type  mask,
bool  fromEnd 
)
staticprivate

◆ searchSideward()

◆ unhighlight()

void dw::core::DeepIterator::unhighlight ( int  direction,
HighlightLayer  layer 
)
inline

Member Data Documentation

◆ content

Content dw::core::DeepIterator::content
private

Definition at line 166 of file iterator.hh.

Referenced by clone(), DeepIterator(), getContent(), next(), and prev().

◆ hasContents

bool dw::core::DeepIterator::hasContents
private

Definition at line 167 of file iterator.hh.

Referenced by clone(), DeepIterator(), and isEmpty().

◆ mask

Content::Type dw::core::DeepIterator::mask
private

Definition at line 165 of file iterator.hh.

Referenced by clone(), DeepIterator(), next(), prev(), searchDownward(), and searchSideward().

◆ stack

Stack dw::core::DeepIterator::stack
private

The documentation for this class was generated from the following files: