Dillo v3.1.1-98-g318d1f14
Loading...
Searching...
No Matches
dw::oof::OOFFloatsMgr Class Reference

OutOfFlowMgr implementation dealing with floats. More...

#include <ooffloatsmgr.hh>

Classes

class  Float
 
class  SortedFloatsVector
 This list is kept sorted. More...
 
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.
 
void tellPosition2 (core::Widget *widget, int x, int y)
 Called after tellPosition1.
 
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)
 Get the left border for the vertical position of y, for a height of h", based on floats; relative to the *container.
 
int getRightBorder (int y, int h, OOFAwareWidget *lastGB, int lastExtIndex)
 Get the right border for the vertical position of y, for a height of h, based on floats; relative to the container.
 
bool hasFloatLeft (int y, int h, OOFAwareWidget *lastGB, int lastExtIndex)
 Return whether there is a float on the left side.
 
bool hasFloatRight (int y, int h, OOFAwareWidget *lastGB, int lastExtIndex)
 Return whether there is a float on the right side.
 
int getLeftFloatHeight (int y, int h, OOFAwareWidget *lastGB, int lastExtIndex)
 Assuming there is a float on the left side, return the rest height of it.
 
int getRightFloatHeight (int y, int h, OOFAwareWidget *lastGB, int lastExtIndex)
 Assuming there is a float on the right side, return the rest height of it.
 
bool affectsLeftBorder (core::Widget *widget)
 
bool affectsRightBorder (core::Widget *widget)
 
bool mayAffectBordersAtAll ()
 
int getClearPosition (OOFAwareWidget *textblock)
 Return value is relative to the calling generator (not container).
 
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)
 
void updateGenerators (Float *vloat)
 Update all generators which are affected by a given float.
 
int findTBInfo (int y)
 y is given relative to the container.
 
void sizeAllocateFloats (Side side)
 
int getGBWidthForAllocation (Float *vloat)
 
int calcFloatX (Float *vloat)
 Return position of a float relative to the container.
 
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
 
bool SizeChanged
 

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.)

Definition at line 17 of file ooffloatsmgr.hh.

Member Enumeration Documentation

◆ Side

Enumerator
LEFT 
RIGHT 

Definition at line 22 of file ooffloatsmgr.hh.

Constructor & Destructor Documentation

◆ OOFFloatsMgr()

◆ ~OOFFloatsMgr()

dw::oof::OOFFloatsMgr::~OOFFloatsMgr ( )

Member Function Documentation

◆ addWidgetInFlow()

void dw::oof::OOFFloatsMgr::addWidgetInFlow ( OOFAwareWidget textblock,
OOFAwareWidget parentBlock,
int  externalIndex 
)
virtual

◆ addWidgetOOF()

◆ affectsLeftBorder()

bool dw::oof::OOFFloatsMgr::affectsLeftBorder ( core::Widget widget)
virtual

◆ affectsRightBorder()

bool dw::oof::OOFFloatsMgr::affectsRightBorder ( core::Widget widget)
virtual

◆ calcFloatX()

◆ calcWidgetRefSize()

void dw::oof::OOFFloatsMgr::calcWidgetRefSize ( core::Widget widget,
core::Requisition size 
)
virtual

◆ collidesH()

◆ collidesV()

◆ containerMustAdjustExtraSpace()

bool dw::oof::OOFFloatsMgr::containerMustAdjustExtraSpace ( )
virtual

Implements dw::oof::OutOfFlowMgr.

Definition at line 1005 of file ooffloatsmgr.cc.

◆ containerSizeChangedForChildren()

◆ createSubRefLeftFloat()

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

Definition at line 213 of file ooffloatsmgr.hh.

Referenced by addWidgetOOF().

◆ createSubRefRightFloat()

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

Definition at line 214 of file ooffloatsmgr.hh.

Referenced by addWidgetOOF().

◆ dealingWithSizeOfChild()

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

Implements dw::oof::OutOfFlowMgr.

Definition at line 1353 of file ooffloatsmgr.cc.

◆ draw()

◆ drawFloats()

◆ ensureFloatSize()

◆ findFloatByWidget()

OOFFloatsMgr::Float * dw::oof::OOFFloatsMgr::findFloatByWidget ( core::Widget widget)
private

Definition at line 626 of file ooffloatsmgr.cc.

References floatsByWidget.

Referenced by tellPosition1().

◆ findTBInfo()

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

y is given relative to the container.

Definition at line 698 of file ooffloatsmgr.cc.

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

◆ getAvailHeightOfChild()

int dw::oof::OOFFloatsMgr::getAvailHeightOfChild ( core::Widget child,
bool  forceValue 
)
virtual

Implements dw::oof::OutOfFlowMgr.

Definition at line 1364 of file ooffloatsmgr.cc.

References lout::misc::notImplemented().

◆ getAvailWidthOfChild()

int dw::oof::OOFFloatsMgr::getAvailWidthOfChild ( core::Widget child,
bool  forceValue 
)
virtual

Implements dw::oof::OutOfFlowMgr.

Definition at line 1358 of file ooffloatsmgr.cc.

References lout::misc::notImplemented().

◆ getBorder()

◆ getClearPosition() [1/2]

◆ getClearPosition() [2/2]

◆ getExtremes()

void dw::oof::OOFFloatsMgr::getExtremes ( core::Extremes cbExtr,
int *  oofMinWidth,
int *  oofMaxWidth 
)
virtual

◆ getFloatHeight()

◆ getFloatIndexFromSubRef()

static int dw::oof::OOFFloatsMgr::getFloatIndexFromSubRef ( int  ref)
inlinestaticprivate

Definition at line 222 of file ooffloatsmgr.hh.

Referenced by markSizeChange().

◆ getFloatsExtremes()

◆ getFloatsListsAndSide()

◆ getFloatsSize()

◆ getFloatWidgetAtPoint()

◆ getGBWidthForAllocation()

int dw::oof::OOFFloatsMgr::getGBWidthForAllocation ( Float vloat)
private

◆ getLeftBorder()

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.

Definition at line 1100 of file ooffloatsmgr.cc.

References DBG_OBJ_MSGF, getBorder(), and LEFT.

◆ getLeftFloatHeight()

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.

Definition at line 1215 of file ooffloatsmgr.cc.

References getFloatHeight(), and LEFT.

◆ getNumWidgets()

int dw::oof::OOFFloatsMgr::getNumWidgets ( )
virtual

◆ getOOFAwareWidget()

OOFFloatsMgr::TBInfo * dw::oof::OOFFloatsMgr::getOOFAwareWidget ( OOFAwareWidget widget)
private

◆ getOOFAwareWidgetWhenRegistered()

OOFFloatsMgr::TBInfo * dw::oof::OOFFloatsMgr::getOOFAwareWidgetWhenRegistered ( OOFAwareWidget widget)
private

◆ getRightBorder()

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.

Definition at line 1109 of file ooffloatsmgr.cc.

References DBG_OBJ_MSGF, getBorder(), and RIGHT.

◆ getRightFloatHeight()

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.

Definition at line 1221 of file ooffloatsmgr.cc.

References getFloatHeight(), and RIGHT.

◆ getSize()

void dw::oof::OOFFloatsMgr::getSize ( core::Requisition cbReq,
int *  oofWidth,
int *  oofHeight 
)
virtual

◆ getWidget()

◆ getWidgetAtPoint()

Widget * dw::oof::OOFFloatsMgr::getWidgetAtPoint ( int  x,
int  y,
core::GettingWidgetAtPointContext context 
)
virtual

Implements dw::oof::OutOfFlowMgr.

Definition at line 721 of file ooffloatsmgr.cc.

References getFloatWidgetAtPoint(), leftFloats, and rightFloats.

◆ hasFloat()

bool dw::oof::OOFFloatsMgr::hasFloat ( Side  side,
int  y,
int  h,
OOFAwareWidget lastGB,
int  lastExtIndex 
)
private

◆ hasFloatLeft()

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.

Definition at line 1183 of file ooffloatsmgr.cc.

References DBG_OBJ_MSGF, hasFloat(), and LEFT.

◆ hasFloatRight()

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.

Definition at line 1192 of file ooffloatsmgr.cc.

References DBG_OBJ_MSGF, hasFloat(), and RIGHT.

◆ isOOFAwareWidgetRegistered()

bool dw::oof::OOFFloatsMgr::isOOFAwareWidgetRegistered ( OOFAwareWidget widget)
inlineprivate

Definition at line 199 of file ooffloatsmgr.hh.

References getOOFAwareWidgetWhenRegistered().

◆ isSubRefLeftFloat()

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

Definition at line 217 of file ooffloatsmgr.hh.

Referenced by markSizeChange().

◆ isSubRefRightFloat()

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

Definition at line 219 of file ooffloatsmgr.hh.

◆ markExtremesChange()

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

Implements dw::oof::OutOfFlowMgr.

Definition at line 716 of file ooffloatsmgr.cc.

◆ markSizeChange()

◆ mayAffectBordersAtAll()

bool dw::oof::OOFFloatsMgr::mayAffectBordersAtAll ( )
virtual

Implements dw::oof::OutOfFlowMgr.

Definition at line 1287 of file ooffloatsmgr.cc.

◆ moveExternalIndices() [1/2]

void dw::oof::OOFFloatsMgr::moveExternalIndices ( lout::container::typed::Vector< Float > *  list,
int  oldStartIndex,
int  diff 
)
private

◆ moveExternalIndices() [2/2]

void dw::oof::OOFFloatsMgr::moveExternalIndices ( OOFAwareWidget generatingBlock,
int  oldStartIndex,
int  diff 
)
virtual

◆ sizeAllocateEnd()

void dw::oof::OOFFloatsMgr::sizeAllocateEnd ( OOFAwareWidget caller)
virtual

Implements dw::oof::OutOfFlowMgr.

Definition at line 380 of file ooffloatsmgr.cc.

References container, DBG_OBJ_ENTER, DBG_OBJ_LEAVE, LEFT, RIGHT, and sizeAllocateFloats().

◆ sizeAllocateFloats()

◆ sizeAllocateStart()

◆ tellIncompletePosition1()

void dw::oof::OOFFloatsMgr::tellIncompletePosition1 ( core::Widget generator,
core::Widget widget,
int  x,
int  y 
)
virtual

Implements dw::oof::OutOfFlowMgr.

Definition at line 858 of file ooffloatsmgr.cc.

References lout::misc::notImplemented().

◆ tellIncompletePosition2()

void dw::oof::OOFFloatsMgr::tellIncompletePosition2 ( core::Widget generator,
core::Widget widget,
int  x,
int  y 
)
virtual

Implements dw::oof::OutOfFlowMgr.

Definition at line 864 of file ooffloatsmgr.cc.

References lout::misc::notImplemented().

◆ tellPosition1()

◆ tellPosition2()

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.

Definition at line 853 of file ooffloatsmgr.cc.

◆ updateGenerators()

Friends And Related Symbol Documentation

◆ WidgetInfo

friend class WidgetInfo
friend

Definition at line 19 of file ooffloatsmgr.hh.

Member Data Documentation

◆ container

OOFAwareWidget* dw::oof::OOFFloatsMgr::container
private

◆ containerAllocation

core::Allocation dw::oof::OOFFloatsMgr::containerAllocation
private

Definition at line 27 of file ooffloatsmgr.hh.

Referenced by OOFFloatsMgr(), sizeAllocateFloats(), and sizeAllocateStart().

◆ floatsByWidget

lout::container::typed::HashTable<lout::object::TypedPointer <dw::core::Widget>, Float>* dw::oof::OOFFloatsMgr::floatsByWidget
private

Definition at line 161 of file ooffloatsmgr.hh.

Referenced by addWidgetOOF(), findFloatByWidget(), OOFFloatsMgr(), and ~OOFFloatsMgr().

◆ lastLeftTBIndex

int dw::oof::OOFFloatsMgr::lastLeftTBIndex
private

Definition at line 167 of file ooffloatsmgr.hh.

Referenced by OOFFloatsMgr().

◆ lastRightTBIndex

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

Definition at line 167 of file ooffloatsmgr.hh.

Referenced by OOFFloatsMgr().

◆ leftFloats

◆ leftFloatsMark

int dw::oof::OOFFloatsMgr::leftFloatsMark
private

Definition at line 167 of file ooffloatsmgr.hh.

Referenced by OOFFloatsMgr().

◆ oofmIndex

int dw::oof::OOFFloatsMgr::oofmIndex
private

◆ rightFloats

◆ rightFloatsMark

int dw::oof::OOFFloatsMgr::rightFloatsMark
private

Definition at line 167 of file ooffloatsmgr.hh.

Referenced by OOFFloatsMgr().

◆ SizeChanged

bool dw::oof::OOFFloatsMgr::SizeChanged
private

Definition at line 168 of file ooffloatsmgr.hh.

Referenced by getSize(), OOFFloatsMgr(), and updateGenerators().

◆ tbInfos

lout::container::typed::Vector<TBInfo>* dw::oof::OOFFloatsMgr::tbInfos
private

◆ tbInfosByOOFAwareWidget

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: