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) 
|
Go to the documentation of this file. 1 #ifndef __DW_TEXTBLOCK_HH__ 2 #define __DW_TEXTBLOCK_HH__ 7 #include "../lout/misc.hh" 11 #define PRINTF(fmt, ...) 176 int totalWidth, idealWidth, totalStretchability, totalShrinkability;
210 int totalStretchability,
int totalShrinkability);
258 void getBgArea (
int *x,
int *y,
int *width,
int *height);
259 void getRefArea (
int *xRef,
int *yRef,
int *widthRef,
int *heightRef);
261 void draw (
int x,
int y,
int width,
int height);
263 virtual void print ();
272 void getBgArea (
int *x,
int *y,
int *width,
int *height);
499 Line *
addLine (
int firstWord,
int lastWord,
bool temporary);
508 int x,
int yBase,
int width);
511 const char *text,
int start,
int len,
bool isStart,
515 void drawWord0 (
int wordIndex1,
int wordIndex2,
516 const char *text,
int totalWidth,
bool drawHyphen,
520 int xWidget,
int yWidgetBase);
534 void fillWord (
int wordNo,
int width,
int ascent,
int descent,
538 int breakPenalty1,
int breakPenalty2,
bool forceBreak);
540 int textWidth (
const char *text,
int start,
int len,
607 if (
lines->size() == 0)
619 int *maxOfMinWidth,
int *sumOfMaxWidth);
621 virtual bool wordWrap (
int wordIndex,
bool wrapAll);
622 int searchMinBap (
int firstWord,
int lastWordm,
int penaltyIndex,
665 int numBreaks,
int *breakPos,
701 bool includeFirstSpace,
bool includeLastSpace);
706 #endif // __DW_TEXTBLOCK_HH__
void getRefArea(int *xRef, int *yRef, int *widthRef, int *heightRef)
Return the "reference area".
static void setPenaltyEmDashRight2(int penaltyRightEmDash2)
bool next()
Move iterator forward and store content it.
void alignLine(int lineIndex)
void drawSpace(int wordIndex, core::View *view, core::Rectangle *area, int xWidget, int yWidgetBase)
void markSizeChange(int ref)
See Sizes of Dillo Widgets.
void draw(int x, int y, int width, int height)
Draw (or queue for drawing) an area, which is given in canvas coordinates.
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)
int lineYOffsetWidgetAllocation(Line *line, core::Allocation *allocation)
void removeTemporaryLines()
static const char * hyphenDrawChar
Textblock(bool limitTextWidth)
int lineYOffsetCanvasAllocation(Line *line, core::Allocation *allocation)
void addParbreak(int space, core::style::Style *style)
A Widget for rendering text blocks, i.e. paragraphs or sequences of paragraphs.
void printWordShort(Word *word)
void changeWordStyle(int from, int to, core::style::Style *style, bool includeFirstSpace, bool includeLastSpace)
void setPenalties(int penalty1, int penalty2)
Base class for all mouse events related to a specific position.
core::style::Style * getStyle()
Return the style this background image is part of.
bool addAnchor(const char *name, core::style::Style *style)
Represents a enter or leave notify event.
int badnessValue(int infLevel)
void addSpace(core::style::Style *style)
int lineYOffsetCanvasI(int lineIndex)
void markExtremesChange(int ref)
See Sizes of Dillo Widgets.
enum dw::Textblock::BadnessAndPenalty::@24 badnessState
bool lineCanBeBroken(int penaltyIndex)
void handOverBreak(core::style::Style *style)
int hyphenateWord(int wordIndex)
int penaltyValue(int index, int infLevel)
Iterators are used to iterate through the contents of a widget.
void sizeRequestImpl(core::Requisition *requisition)
bool sendSelectionEvent(core::SelectionState::EventType eventType, core::MousePositionEvent *event)
Send event to selection.
int calcAvailWidth(int lineIndex)
int searchMinBap(int firstWord, int lastWordm, int penaltyIndex, bool correctAtEnd)
static void setPenaltyHyphen2(int penaltyHyphen2)
static int getLineShrinkability(Word *lastWord)
void handleWordExtremes(int wordIndex)
void removeChild(Widget *child)
lout::object::Object * clone()
Return an exact copy of the object.
Represents the allocation, i.e. actual position and size of a dw::core::Widget.
lout::misc::SimpleVector< Paragraph > * paragraphs
void getWordExtremes(Word *word, core::Extremes *extremes)
core::Iterator * iterator(core::Content::Type mask, bool atEnd)
Return an iterator for this widget.
int totalSpaceShrinkability
int lineYOffsetWidgetI(int lineIndex)
int findLineOfWord(int wordIndex)
Find the line of word wordIndex.
lout::misc::SimpleVector< Anchor > * anchors
int totalSpaceStretchability
void leaveNotifyImpl(core::EventCrossing *event)
BadnessAndPenalty badnessAndPenalty
void accumulateWordExtremes(int firstWord, int lastWord, int *maxOfMinWidth, int *sumOfMaxWidth)
void removeSpaceImgRenderer(int wordNo)
void removeWordImgRenderer(int wordNo)
void processWord(int wordIndex)
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)
bool lineMustBeBroken(int penaltyIndex)
void setDescent(int descent)
void setData(int xWordWidget, int lineNo)
void setSinglePenalty(int index, int penalty)
bool isHyphenationCandidate(Word *word)
void queueDrawRange(int index1, int index2)
int textWidth(const char *text, int start, int len, core::style::Style *style, bool isStart, bool isEnd)
bool buttonReleaseImpl(core::EventButton *event)
void accumulateWordForLine(int lineIndex, int wordIndex)
int considerHyphenation(int firstIndex, int breakPos)
core::style::Style * style
int lineYOffsetWidget(Line *line)
This is the base class for many other classes, which defines very common virtual methods.
void calcWidgetSize(core::Widget *widget, core::Requisition *size)
SpaceImgRenderer(Textblock *textblock, int wordNo)
static int penalties[PENALTY_NUM][2]
void drawLine(Line *line, core::View *view, core::Rectangle *area)
void fillWord(int wordNo, int width, int ascent, int descent, short flags, core::style::Style *style)
void calcTextSize(const char *text, size_t len, core::style::Style *style, core::Requisition *size, bool isStart, bool isEnd)
core::style::Style * spaceStyle
int calcPenaltyIndexForNewLine()
Represents a mouse motion event.
void calcBadness(int totalWidth, int idealWidth, int totalStretchability, int totalShrinkability)
int lineXOffsetWidget(Line *line)
Like lineXOffset, but relative to the allocation (i.e. including border etc.).
bool motionNotifyImpl(core::EventMotion *event)
static void setStretchabilityFactor(int stretchabilityFactor)
bool readyToDraw()
If this method returns false, nothing is done at all.
void decorateText(core::View *view, core::style::Style *style, core::style::Color::Shading shading, int x, int yBase, int width)
core::style::Style * getStyle()
Return the style this background image is part of.
static void setPenaltyEmDashRight(int penaltyRightEmDash)
void resizeDrawImpl()
Called after sizeAllocateImpl() to redraw necessary areas. By default the whole widget is redrawn.
lout::misc::SimpleVector< Line > * lines
core::Widget * getWidgetAtPoint(int x, int y, int level)
Search recursively through widget.
void addText0(const char *text, size_t len, short flags, core::style::Style *style, core::Requisition *size)
int compareTo(lout::object::Comparable *other)
Compare two objects c1 and c2.
void fillSpace(int wordNo, core::style::Style *style)
void printWordWithFlags(Word *word)
TextblockIterator(Textblock *textblock, core::Content::Type mask, bool atEnd)
bool ignoreLine1OffsetSometimes
int findParagraphOfWord(int wordIndex)
Find the paragraph of word wordIndex.
dw::core::Shape implemtation for simple rectangles.
static void setPenaltyHyphen(int penaltyHyphen)
void addWidget(core::Widget *widget, core::style::Style *style)
bool prev()
Move iterator backward and store content it.
static void setPenaltyEmDashLeft(int penaltyLeftEmDash)
An interface to encapsulate platform dependent drawing.
void printWordFlags(short flags)
bool unbreakableForMinWidth
void correctLastWordExtremes()
int lineYOffsetCanvas(Line *line)
void changeLinkColor(int link, int newColor)
void printWord(Word *word)
lout::misc::NotSoSimpleVector< Word > * words
int compareTo(int penaltyIndex, BadnessAndPenalty *other)
void setWordImgRenderer(int wordNo)
void addText(const char *text, core::style::Style *style)
void getBgArea(int *x, int *y, int *width, int *height)
Return the area covered by the background image.
Container similar to lout::misc::SimpleVector, but some cases of insertion optimized (used for hyphen...
static int getLineStretchability(Word *lastWord)
Line * addLine(int firstWord, int lastWord, bool temporary)
Instances of a sub class of may be compared (less, greater).
static int getSpaceStretchability(struct Word *word)
void addBreakOption(core::style::Style *style, bool forceBreak)
struct dw::Textblock::@23 hlEnd[core::HIGHLIGHT_NUM_LAYERS]
static int stretchabilityFactor
void calcTextSizes(const char *text, size_t textLen, core::style::Style *style, int numBreaks, int *breakPos, core::Requisition *wordSize)
void setBreakOption(Word *word, core::style::Style *style, int breakPenalty1, int breakPenalty2, bool forceBreak)
static DivChar divChars[NUM_DIV_CHARS]
void sizeAllocateImpl(core::Allocation *allocation)
See Sizes of Dillo Widgets.
bool buttonPressImpl(core::EventButton *event)
void draw(core::View *view, core::Rectangle *area)
void accumulateWordData(int wordIndex)
Word * addWord(int width, int ascent, int descent, short flags, core::style::Style *style)
WordImgRenderer * wordImgRenderer
void enterNotifyImpl(core::EventCrossing *event)
void justifyLine(Line *line, int diff)
SpaceImgRenderer * spaceImgRenderer
struct dw::Textblock::@23 hlStart[core::HIGHLIGHT_NUM_LAYERS]
static int getSpaceShrinkability(struct Word *word)
void addLinebreak(core::style::Style *style)
void drawWord(Line *line, int wordIndex1, int wordIndex2, core::View *view, core::Rectangle *area, int xWidget, int yWidgetBase)
void setAscent(int ascent)
Dw is in this namespace, or sub namespaces of this one.
void getAllocation(int start, int end, core::Allocation *allocation)
Return the shape, which a part of the item, the iterator points on, allocates.
Implementation used for words.
void getBgArea(int *x, int *y, int *width, int *height)
Return the area covered by the background image.
void highlight(int start, int end, core::HighlightLayer layer)
Extend highlighted region to contain part of the current content.
bool isBreakAllowed(Word *word)
Word * findWord(int x, int y, bool *inSpace)
Find the index of the word, or -1.
void initWord(int wordNo)
Simple (simpler than container::untyped::Vector and container::typed::Vector) template based vector.
void setPenalty(int penalty)
virtual bool wordWrap(int wordIndex, bool wrapAll)
void setSpaceImgRenderer(int wordNo)
void addText(const char *text, size_t len, core::style::Style *style)
void initLine1Offset(int wordIndex)
void getExtremesImpl(core::Extremes *extremes)
See Sizes of Dillo Widgets.
int lineXOffsetContents(Line *line)
Returns the x offset (the indentation plus any offset needed for centering or right justification) fo...
void unhighlight(int direction, core::HighlightLayer layer)
Shrink highlighted region to no longer contain the current content.
WordImgRenderer(Textblock *textblock, int wordNo)