Dillo
Classes | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
dw::oof::OOFFloatsMgr Class Reference

OutOfFlowMgr implementation dealing with floats. More...

#include <ooffloatsmgr.hh>

Classes

class  Float
 
class  SortedFloatsVector
 
class  TBInfo
 
class  WidgetInfo
 

Public Member Functions

 OOFFloatsMgr (OOFAwareWidget *container, int oofmIndex)
 
 ~OOFFloatsMgr ()
 
void sizeAllocateStart (OOFAwareWidget *caller, core::Allocation *allocation)
 
void sizeAllocateEnd (OOFAwareWidget *caller)
 
void containerSizeChangedForChildren ()
 
void draw (core::View *view, core::Rectangle *area, core::DrawingContext *context)
 
void markSizeChange (int ref)
 
void markExtremesChange (int ref)
 
core::WidgetgetWidgetAtPoint (int x, int y, core::GettingWidgetAtPointContext *context)
 
void addWidgetInFlow (OOFAwareWidget *textblock, OOFAwareWidget *parentBlock, int externalIndex)
 
int addWidgetOOF (core::Widget *widget, OOFAwareWidget *generatingBlock, int externalIndex)
 
void calcWidgetRefSize (core::Widget *widget, core::Requisition *size)
 
void moveExternalIndices (OOFAwareWidget *generatingBlock, int oldStartIndex, int diff)
 
void tellPosition1 (core::Widget *widget, int x, int y)
 Called before tellPosition2, see there for more. More...
 
void tellPosition2 (core::Widget *widget, int x, int y)
 Called after tellPosition1. More...
 
void tellIncompletePosition1 (core::Widget *generator, core::Widget *widget, int x, int y)
 
void tellIncompletePosition2 (core::Widget *generator, core::Widget *widget, int x, int y)
 
void getSize (core::Requisition *cbReq, int *oofWidth, int *oofHeight)
 
bool containerMustAdjustExtraSpace ()
 
void getExtremes (core::Extremes *cbExtr, int *oofMinWidth, int *oofMaxWidth)
 
int getLeftBorder (int y, int h, OOFAwareWidget *lastGB, int lastExtIndex)
 
int getRightBorder (int y, int h, OOFAwareWidget *lastGB, int lastExtIndex)
 
bool hasFloatLeft (int y, int h, OOFAwareWidget *lastGB, int lastExtIndex)
 
bool hasFloatRight (int y, int h, OOFAwareWidget *lastGB, int lastExtIndex)
 
int getLeftFloatHeight (int y, int h, OOFAwareWidget *lastGB, int lastExtIndex)
 
int getRightFloatHeight (int y, int h, OOFAwareWidget *lastGB, int lastExtIndex)
 
bool affectsLeftBorder (core::Widget *widget)
 
bool affectsRightBorder (core::Widget *widget)
 
bool mayAffectBordersAtAll ()
 
int getClearPosition (OOFAwareWidget *textblock)
 
bool dealingWithSizeOfChild (core::Widget *child)
 
int getAvailWidthOfChild (core::Widget *child, bool forceValue)
 
int getAvailHeightOfChild (core::Widget *child, bool forceValue)
 
int getNumWidgets ()
 
core::WidgetgetWidget (int i)
 
- Public Member Functions inherited from dw::oof::OutOfFlowMgr
 OutOfFlowMgr ()
 
virtual ~OutOfFlowMgr ()
 

Private Types

enum  Side { LEFT, RIGHT }
 

Private Member Functions

void moveExternalIndices (lout::container::typed::Vector< Float > *list, int oldStartIndex, int diff)
 
FloatfindFloatByWidget (core::Widget *widget)
 
int findTBInfo (int y)
 
void sizeAllocateFloats (Side side)
 
int getGBWidthForAllocation (Float *vloat)
 
int calcFloatX (Float *vloat)
 Return position of a float relative to the container. More...
 
void drawFloats (SortedFloatsVector *list, core::View *view, core::Rectangle *area, core::DrawingContext *context)
 
core::WidgetgetFloatWidgetAtPoint (SortedFloatsVector *list, int x, int y, core::GettingWidgetAtPointContext *context)
 
bool collidesV (Float *vloat, Float *other, int *yReal)
 
bool collidesH (Float *vloat, Float *other)
 
void getFloatsListsAndSide (Float *vloat, SortedFloatsVector **listSame, SortedFloatsVector **listOpp, Side *side)
 
void getFloatsSize (core::Requisition *cbReq, Side side, int *width, int *height)
 
void getFloatsExtremes (core::Extremes *cbExtr, Side side, int *minWidth, int *maxWidth)
 
TBInfogetOOFAwareWidget (OOFAwareWidget *widget)
 
TBInfogetOOFAwareWidgetWhenRegistered (OOFAwareWidget *widget)
 
bool isOOFAwareWidgetRegistered (OOFAwareWidget *widget)
 
int getBorder (Side side, int y, int h, OOFAwareWidget *lastGB, int lastExtIndex)
 
bool hasFloat (Side side, int y, int h, OOFAwareWidget *lastGB, int lastExtIndex)
 
int getFloatHeight (Side side, int y, int h, OOFAwareWidget *lastGB, int lastExtIndex)
 
int getClearPosition (OOFAwareWidget *widget, Side side)
 
void ensureFloatSize (Float *vloat)
 

Static Private Member Functions

static int createSubRefLeftFloat (int index)
 
static int createSubRefRightFloat (int index)
 
static bool isSubRefLeftFloat (int ref)
 
static bool isSubRefRightFloat (int ref)
 
static int getFloatIndexFromSubRef (int ref)
 

Private Attributes

OOFAwareWidgetcontainer
 
int oofmIndex
 
core::Allocation containerAllocation
 
SortedFloatsVectorleftFloats
 
SortedFloatsVectorrightFloats
 
lout::container::typed::HashTable
< lout::object::TypedPointer
< dw::core::Widget >, Float > * 
floatsByWidget
 
lout::container::typed::Vector
< TBInfo > * 
tbInfos
 
lout::container::typed::HashTable
< lout::object::TypedPointer
< OOFAwareWidget >, TBInfo > * 
tbInfosByOOFAwareWidget
 
int lastLeftTBIndex
 
int lastRightTBIndex
 
int leftFloatsMark
 
int rightFloatsMark
 

Friends

class WidgetInfo
 

Detailed Description

OutOfFlowMgr implementation dealing with floats.

Note: The identifiers and comments of this class still refer to "Textblock" instead of "OOFAwareWidget"; should be cleaned up some day. (OTOH, these widgets are always textblocks.)

Member Enumeration Documentation

Enumerator
LEFT 
RIGHT 

Constructor & Destructor Documentation

dw::oof::OOFFloatsMgr::OOFFloatsMgr ( OOFAwareWidget container,
int  oofmIndex 
)
dw::oof::OOFFloatsMgr::~OOFFloatsMgr ( )

Member Function Documentation

void dw::oof::OOFFloatsMgr::addWidgetInFlow ( OOFAwareWidget textblock,
OOFAwareWidget parentBlock,
int  externalIndex 
)
virtual
int dw::oof::OOFFloatsMgr::addWidgetOOF ( core::Widget widget,
OOFAwareWidget generatingBlock,
int  externalIndex 
)
virtual
bool dw::oof::OOFFloatsMgr::affectsLeftBorder ( core::Widget widget)
virtual
bool dw::oof::OOFFloatsMgr::affectsRightBorder ( core::Widget widget)
virtual
int dw::oof::OOFFloatsMgr::calcFloatX ( Float vloat)
private
void dw::oof::OOFFloatsMgr::calcWidgetRefSize ( core::Widget widget,
core::Requisition size 
)
virtual
bool dw::oof::OOFFloatsMgr::collidesH ( Float vloat,
Float other 
)
private
bool dw::oof::OOFFloatsMgr::collidesV ( Float vloat,
Float other,
int *  yReal 
)
private
bool dw::oof::OOFFloatsMgr::containerMustAdjustExtraSpace ( )
virtual

Implements dw::oof::OutOfFlowMgr.

void dw::oof::OOFFloatsMgr::containerSizeChangedForChildren ( )
virtual
static int dw::oof::OOFFloatsMgr::createSubRefLeftFloat ( int  index)
inlinestaticprivate

Referenced by addWidgetOOF().

static int dw::oof::OOFFloatsMgr::createSubRefRightFloat ( int  index)
inlinestaticprivate

Referenced by addWidgetOOF().

bool dw::oof::OOFFloatsMgr::dealingWithSizeOfChild ( core::Widget child)
virtual

Implements dw::oof::OutOfFlowMgr.

void dw::oof::OOFFloatsMgr::draw ( core::View view,
core::Rectangle area,
core::DrawingContext context 
)
virtual
void dw::oof::OOFFloatsMgr::drawFloats ( SortedFloatsVector list,
core::View view,
core::Rectangle area,
core::DrawingContext context 
)
private
void dw::oof::OOFFloatsMgr::ensureFloatSize ( Float vloat)
private
OOFFloatsMgr::Float * dw::oof::OOFFloatsMgr::findFloatByWidget ( core::Widget widget)
private

References floatsByWidget.

Referenced by tellPosition1().

int dw::oof::OOFFloatsMgr::findTBInfo ( int  y)
private

y is given relative to the container.

References DBG_OBJ_ENTER, DBG_OBJ_LEAVE_VAL, oofmIndex, tbInfos, and dw::oof::OOFFloatsMgr::TBInfo::y.

int dw::oof::OOFFloatsMgr::getAvailHeightOfChild ( core::Widget child,
bool  forceValue 
)
virtual
int dw::oof::OOFFloatsMgr::getAvailWidthOfChild ( core::Widget child,
bool  forceValue 
)
virtual
int dw::oof::OOFFloatsMgr::getBorder ( Side  side,
int  y,
int  h,
OOFAwareWidget lastGB,
int  lastExtIndex 
)
private
int dw::oof::OOFFloatsMgr::getClearPosition ( OOFAwareWidget widget,
Side  side 
)
private
int dw::oof::OOFFloatsMgr::getClearPosition ( OOFAwareWidget widget)
virtual
void dw::oof::OOFFloatsMgr::getExtremes ( core::Extremes cbExtr,
int *  oofMinWidth,
int *  oofMaxWidth 
)
virtual
int dw::oof::OOFFloatsMgr::getFloatHeight ( Side  side,
int  y,
int  h,
OOFAwareWidget lastGB,
int  lastExtIndex 
)
private
static int dw::oof::OOFFloatsMgr::getFloatIndexFromSubRef ( int  ref)
inlinestaticprivate

Referenced by markSizeChange().

void dw::oof::OOFFloatsMgr::getFloatsExtremes ( core::Extremes cbExtr,
Side  side,
int *  minWidth,
int *  maxWidth 
)
private
void dw::oof::OOFFloatsMgr::getFloatsListsAndSide ( Float vloat,
SortedFloatsVector **  listSame,
SortedFloatsVector **  listOpp,
Side side 
)
private
void dw::oof::OOFFloatsMgr::getFloatsSize ( core::Requisition cbReq,
Side  side,
int *  width,
int *  height 
)
private
Widget * dw::oof::OOFFloatsMgr::getFloatWidgetAtPoint ( SortedFloatsVector list,
int  x,
int  y,
core::GettingWidgetAtPointContext context 
)
private
int dw::oof::OOFFloatsMgr::getGBWidthForAllocation ( Float vloat)
private
int dw::oof::OOFFloatsMgr::getLeftBorder ( int  y,
int  h,
OOFAwareWidget lastGen,
int  lastExtIndex 
)
virtual

Get the left border for the vertical position of y, for a height of h", based on floats; relative to the *container.

The border includes marging/border/padding of the calling textblock but is 0 if there is no float, so a caller should also consider other borders.

Implements dw::oof::OutOfFlowMgr.

References DBG_OBJ_MSGF, getBorder(), and LEFT.

int dw::oof::OOFFloatsMgr::getLeftFloatHeight ( int  y,
int  h,
OOFAwareWidget lastGen,
int  lastExtIndex 
)
virtual

Assuming there is a float on the left side, return the rest height of it. y is relative to the container.

See also getLeftBorder().

Implements dw::oof::OutOfFlowMgr.

References getFloatHeight(), and LEFT.

int dw::oof::OOFFloatsMgr::getNumWidgets ( )
virtual
OOFFloatsMgr::TBInfo * dw::oof::OOFFloatsMgr::getOOFAwareWidget ( OOFAwareWidget widget)
private
OOFFloatsMgr::TBInfo * dw::oof::OOFFloatsMgr::getOOFAwareWidgetWhenRegistered ( OOFAwareWidget widget)
private
int dw::oof::OOFFloatsMgr::getRightBorder ( int  y,
int  h,
OOFAwareWidget lastGen,
int  lastExtIndex 
)
virtual

Get the right border for the vertical position of y, for a height of h, based on floats; relative to the container.

See also getLeftBorder().

Implements dw::oof::OutOfFlowMgr.

References DBG_OBJ_MSGF, getBorder(), and RIGHT.

int dw::oof::OOFFloatsMgr::getRightFloatHeight ( int  y,
int  h,
OOFAwareWidget lastGen,
int  lastExtIndex 
)
virtual

Assuming there is a float on the right side, return the rest height of it. y is relative to the container.

See also getLeftFloatHeight(), getLeftBorder().

Implements dw::oof::OutOfFlowMgr.

References getFloatHeight(), and RIGHT.

void dw::oof::OOFFloatsMgr::getSize ( core::Requisition cbReq,
int *  oofWidth,
int *  oofHeight 
)
virtual
Widget * dw::oof::OOFFloatsMgr::getWidget ( int  i)
virtual
Widget * dw::oof::OOFFloatsMgr::getWidgetAtPoint ( int  x,
int  y,
core::GettingWidgetAtPointContext context 
)
virtual
bool dw::oof::OOFFloatsMgr::hasFloat ( Side  side,
int  y,
int  h,
OOFAwareWidget lastGB,
int  lastExtIndex 
)
private
bool dw::oof::OOFFloatsMgr::hasFloatLeft ( int  y,
int  h,
OOFAwareWidget lastGen,
int  lastExtIndex 
)
virtual

Return whether there is a float on the left side. y is relative to the container.

See also getLeftBorder().

Implements dw::oof::OutOfFlowMgr.

References DBG_OBJ_MSGF, hasFloat(), and LEFT.

bool dw::oof::OOFFloatsMgr::hasFloatRight ( int  y,
int  h,
OOFAwareWidget lastGen,
int  lastExtIndex 
)
virtual

Return whether there is a float on the right side. y is relative to the container.

See also hasFloatLeft(), getLeftBorder();

Implements dw::oof::OutOfFlowMgr.

References DBG_OBJ_MSGF, hasFloat(), and RIGHT.

bool dw::oof::OOFFloatsMgr::isOOFAwareWidgetRegistered ( OOFAwareWidget widget)
inlineprivate
static bool dw::oof::OOFFloatsMgr::isSubRefLeftFloat ( int  ref)
inlinestaticprivate

Referenced by markSizeChange().

static bool dw::oof::OOFFloatsMgr::isSubRefRightFloat ( int  ref)
inlinestaticprivate

Referenced by markSizeChange().

void dw::oof::OOFFloatsMgr::markExtremesChange ( int  ref)
virtual

Implements dw::oof::OutOfFlowMgr.

void dw::oof::OOFFloatsMgr::markSizeChange ( int  ref)
virtual
bool dw::oof::OOFFloatsMgr::mayAffectBordersAtAll ( )
virtual

Implements dw::oof::OutOfFlowMgr.

void dw::oof::OOFFloatsMgr::moveExternalIndices ( lout::container::typed::Vector< Float > *  list,
int  oldStartIndex,
int  diff 
)
private
void dw::oof::OOFFloatsMgr::moveExternalIndices ( OOFAwareWidget generatingBlock,
int  oldStartIndex,
int  diff 
)
virtual
void dw::oof::OOFFloatsMgr::sizeAllocateEnd ( OOFAwareWidget caller)
virtual
void dw::oof::OOFFloatsMgr::sizeAllocateFloats ( Side  side)
private
void dw::oof::OOFFloatsMgr::sizeAllocateStart ( OOFAwareWidget caller,
core::Allocation allocation 
)
virtual
void dw::oof::OOFFloatsMgr::tellIncompletePosition1 ( core::Widget generator,
core::Widget widget,
int  x,
int  y 
)
virtual
void dw::oof::OOFFloatsMgr::tellIncompletePosition2 ( core::Widget generator,
core::Widget widget,
int  x,
int  y 
)
virtual
void dw::oof::OOFFloatsMgr::tellPosition1 ( core::Widget widget,
int  x,
int  y 
)
virtual
void dw::oof::OOFFloatsMgr::tellPosition2 ( core::Widget widget,
int  x,
int  y 
)
virtual

Called after tellPosition1.

An implementation should only implement either tellPosition1 or tellPosition2. Coordinates are relative to the container.

Implements dw::oof::OutOfFlowMgr.

Friends And Related Function Documentation

friend class WidgetInfo
friend

Member Data Documentation

OOFAwareWidget* dw::oof::OOFFloatsMgr::container
private
core::Allocation dw::oof::OOFFloatsMgr::containerAllocation
private
lout::container::typed::HashTable<lout::object::TypedPointer <dw::core::Widget>, Float>* dw::oof::OOFFloatsMgr::floatsByWidget
private
int dw::oof::OOFFloatsMgr::lastLeftTBIndex
private

Referenced by OOFFloatsMgr().

int dw::oof::OOFFloatsMgr::lastRightTBIndex
private

Referenced by OOFFloatsMgr().

SortedFloatsVector* dw::oof::OOFFloatsMgr::leftFloats
private
int dw::oof::OOFFloatsMgr::leftFloatsMark
private

Referenced by OOFFloatsMgr().

int dw::oof::OOFFloatsMgr::oofmIndex
private
SortedFloatsVector * dw::oof::OOFFloatsMgr::rightFloats
private
int dw::oof::OOFFloatsMgr::rightFloatsMark
private

Referenced by OOFFloatsMgr().

lout::container::typed::Vector<TBInfo>* dw::oof::OOFFloatsMgr::tbInfos
private
lout::container::typed::HashTable<lout::object::TypedPointer<OOFAwareWidget>, TBInfo>* dw::oof::OOFFloatsMgr::tbInfosByOOFAwareWidget
private

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