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::AlignedTextblock Class Referenceabstract

Base widget for all textblocks (sub classes of dw::Textblock), which are positioned vertically and aligned horizontally. More...

#include <alignedtextblock.hh>

Inheritance diagram for dw::AlignedTextblock:
[legend]
Collaboration diagram for dw::AlignedTextblock:
[legend]

Classes

class  List
 

Public Member Functions

 ~AlignedTextblock ()
 
- Public Member Functions inherited from dw::Textblock
 Textblock (bool limitTextWidth)
 
 ~Textblock ()
 
core::Iteratoriterator (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::WidgetgetWidgetAtPoint (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)
 
- Public Member Functions inherited from dw::core::Widget
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::StylegetStyle ()
 
AllocationgetAllocation ()
 
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::ColorgetBgColor ()
 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 ()
 
WidgetgetParent ()
 
WidgetgetTopLevel ()
 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...
 
WidgetgetNearestCommonAncestor (Widget *otherWidget)
 Get the widget with the highest level, which is a direct ancestor of widget1 and widget2. More...
 
LayoutgetLayout ()
 
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)
 
- Public Member Functions inherited from lout::identity::IdentifiableObject
 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...
 
- 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 Objectclone ()
 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 Public Attributes inherited from dw::Textblock
static int CLASS_ID = -1
 
- Static Public Attributes inherited from dw::core::Widget
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 ()
 
- Protected Member Functions inherited from dw::Textblock
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)
 
LineaddLine (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...
 
WordfindWord (int x, int y, bool *inSpace)
 Find the index of the word, or -1. More...
 
WordaddWord (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)
 
- Protected Member Functions inherited from dw::core::Widget
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)
 
- Protected Member Functions inherited from lout::identity::IdentifiableObject
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

Listlist
 
int listPos
 

Additional Inherited Members

- Static Public Member Functions inherited from dw::Textblock
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)
 
- Public Attributes inherited from dw::core::Widget
int parentRef
 This value is defined by the parent widget, and used for incremential resizing. More...
 
- Protected Types inherited from dw::core::Widget
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 Protected Member Functions inherited from dw::Textblock
static int getSpaceShrinkability (struct Word *word)
 
static int getSpaceStretchability (struct Word *word)
 
static int getLineShrinkability (Word *lastWord)
 
static int getLineStretchability (Word *lastWord)
 
- Protected Attributes inherited from dw::Textblock
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
 
- Protected Attributes inherited from dw::core::Widget
WidgetImgRendererwidgetImgRenderer
 
Allocation allocation
 The current allocation: size and position, always relative to the canvas. More...
 
Layoutlayout
 
- Static Protected Attributes inherited from dw::Textblock
static int penalties [PENALTY_NUM][2]
 
static int stretchabilityFactor = 100
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AlignedTextblock()

dw::AlignedTextblock::AlignedTextblock ( bool  limitTextWidth)
protected

◆ ~AlignedTextblock()

dw::AlignedTextblock::~AlignedTextblock ( )

Definition at line 81 of file alignedtextblock.cc.

References DBG_OBJ_DELETE, list, listPos, and dw::AlignedTextblock::List::unref().

Member Function Documentation

◆ getValue()

virtual int dw::AlignedTextblock::getValue ( )
protectedpure virtual

Implemented in dw::TableCell, and dw::ListItem.

Referenced by updateValue().

◆ setMaxValue()

virtual void dw::AlignedTextblock::setMaxValue ( int  maxValue,
int  value 
)
protectedpure virtual

Implemented in dw::TableCell, and dw::ListItem.

Referenced by updateValue().

◆ setRefTextblock()

void dw::AlignedTextblock::setRefTextblock ( AlignedTextblock ref)
protected

◆ updateValue()

Member Data Documentation

◆ CLASS_ID

int dw::AlignedTextblock::CLASS_ID = -1
static

Definition at line 54 of file alignedtextblock.hh.

Referenced by AlignedTextblock().

◆ list

List* dw::AlignedTextblock::list
private

Definition at line 41 of file alignedtextblock.hh.

Referenced by setRefTextblock(), updateValue(), and ~AlignedTextblock().

◆ listPos

int dw::AlignedTextblock::listPos
private

Definition at line 42 of file alignedtextblock.hh.

Referenced by setRefTextblock(), updateValue(), and ~AlignedTextblock().


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