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).
![]() ![]() |
Base widget for all textblocks (sub classes of dw::Textblock), which are positioned vertically and aligned horizontally. More...
#include <alignedtextblock.hh>
Classes | |
class | List |
Public Member Functions | |
~AlignedTextblock () | |
![]() | |
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 Attributes | |
static int | CLASS_ID = -1 |
![]() | |
static int | CLASS_ID = -1 |
![]() | |
static int | CLASS_ID = -1 |
Protected Member Functions | |
AlignedTextblock (bool limitTextWidth) | |
virtual int | getValue ()=0 |
virtual void | setMaxValue (int maxValue, int value)=0 |
void | setRefTextblock (AlignedTextblock *ref) |
void | updateValue () |
![]() | |
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... | |
Private Attributes | |
List * | list |
int | listPos |
Additional Inherited Members | |
![]() | |
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) |
![]() | |
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 } |
![]() | |
static int | getSpaceShrinkability (struct Word *word) |
static int | getSpaceStretchability (struct Word *word) |
static int | getLineShrinkability (Word *lastWord) |
static int | getLineStretchability (Word *lastWord) |
![]() | |
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 int | penalties [PENALTY_NUM][2] |
static int | stretchabilityFactor = 100 |
Base widget for all textblocks (sub classes of dw::Textblock), which are positioned vertically and aligned horizontally.
Definition at line 13 of file alignedtextblock.hh.
|
protected |
Definition at line 63 of file alignedtextblock.cc.
References CLASS_ID, DBG_OBJ_CREATE, and lout::identity::IdentifiableObject::registerName().
dw::AlignedTextblock::~AlignedTextblock | ( | ) |
Definition at line 81 of file alignedtextblock.cc.
References DBG_OBJ_DELETE, list, listPos, and dw::AlignedTextblock::List::unref().
|
protectedpure virtual |
Implemented in dw::TableCell, and dw::ListItem.
Referenced by updateValue().
|
protectedpure virtual |
Implemented in dw::TableCell, and dw::ListItem.
Referenced by updateValue().
|
protected |
Definition at line 70 of file alignedtextblock.cc.
References dw::AlignedTextblock::List::add(), list, listPos, and updateValue().
Referenced by dw::ListItem::ListItem(), and dw::TableCell::TableCell().
|
protected |
Definition at line 87 of file alignedtextblock.cc.
References dw::AlignedTextblock::List::getMaxValue(), dw::AlignedTextblock::List::getTextblock(), dw::AlignedTextblock::List::getValue(), getValue(), list, listPos, dw::AlignedTextblock::List::setMaxValue(), setMaxValue(), dw::AlignedTextblock::List::setValue(), and dw::AlignedTextblock::List::size().
Referenced by dw::ListItem::initWithText(), dw::ListItem::initWithWidget(), setRefTextblock(), and dw::TableCell::wordWrap().
|
static |
Definition at line 54 of file alignedtextblock.hh.
Referenced by AlignedTextblock().
|
private |
Definition at line 41 of file alignedtextblock.hh.
Referenced by setRefTextblock(), updateValue(), and ~AlignedTextblock().
|
private |
Definition at line 42 of file alignedtextblock.hh.
Referenced by setRefTextblock(), updateValue(), and ~AlignedTextblock().