Dillo v3.1.1-119-g140d9ebd
Loading...
Searching...
No Matches
oofpositionedmgr.hh
Go to the documentation of this file.
1 #ifndef __DW_OOFPOSITIONEDMGR_HH__
2#define __DW_OOFPOSITIONEDMGR_HH__
3
4#include "outofflowmgr.hh"
5#include "oofawarewidget.hh"
6
7namespace dw {
8
9namespace oof {
10
12{
13protected:
25
30
35
36 inline bool getPosLeft (core::Widget *child, int availWidth, int *result)
37 { return getPosBorder (child->getStyle()->left, availWidth, result); }
38 inline bool getPosRight (core::Widget *child, int availWidth, int *result)
39 { return getPosBorder (child->getStyle()->right, availWidth, result); }
40 inline bool getPosTop (core::Widget *child, int availHeight, int *result)
41 { return getPosBorder (child->getStyle()->top, availHeight, result); }
42 inline bool getPosBottom (core::Widget *child, int availHeight, int *result)
43 { return getPosBorder (child->getStyle()->bottom, availHeight, result); }
44
45 bool getPosBorder (core::style::Length cssValue, int refLength, int *result);
46
49
51
52 virtual void sizeAllocateChildren () = 0;
53 virtual bool posXAbsolute (Child *child) = 0;
54 virtual bool posYAbsolute (Child *child) = 0;
55
56 inline bool generatorPosDefined (Child *child) {
57 return child->generator == container ||
59 && child->generator->wasAllocated ());
60 }
61 inline int generatorPosX (Child *child) {
62 assert (generatorPosDefined (child));
63 return child->generator == container ? 0 :
65 }
66 inline int generatorPosY (Child *child) {
67 assert (generatorPosDefined (child));
68 return child->generator == container ? 0 :
70 }
71
72 inline bool posXDefined (Child *child)
73 { return posXAbsolute (child) || generatorPosDefined (child); }
74
75 inline bool posYDefined (Child *child)
76 { return posYAbsolute (child) || generatorPosDefined (child); }
77
78public:
81
83 core::Allocation *allocation);
84 void sizeAllocateEnd (OOFAwareWidget *caller);
85
87 void draw (core::View *view, core::Rectangle *area,
88 core::DrawingContext *context);
89
90 void markSizeChange (int ref);
91 void markExtremesChange (int ref);
92 core::Widget *getWidgetAtPoint (int x, int y,
94
95 void addWidgetInFlow (OOFAwareWidget *widget, OOFAwareWidget *parent,
96 int externalIndex);
97 int addWidgetOOF (core::Widget *widget, OOFAwareWidget *generator,
98 int externalIndex);
99 void moveExternalIndices (OOFAwareWidget *generator, int oldStartIndex,
100 int diff);
101
102 void tellPosition1 (core::Widget *widget, int x, int y);
103 void tellPosition2 (core::Widget *widget, int x, int y);
104 void tellIncompletePosition1 (core::Widget *generator, core::Widget *widget,
105 int x, int y);
106 void tellIncompletePosition2 (core::Widget *generator, core::Widget *widget,
107 int x, int y);
108
109
111
112 int getLeftBorder (int y, int h, OOFAwareWidget *lastGen, int lastExtIndex);
113 int getRightBorder (int y, int h, OOFAwareWidget *lastGen, int lastExtIndex);
114
115 bool hasFloatLeft (int y, int h, OOFAwareWidget *lastGen, int lastExtIndex);
116 bool hasFloatRight (int y, int h, OOFAwareWidget *lastGen, int lastExtIndex);
117
118 int getLeftFloatHeight (int y, int h, OOFAwareWidget *lastGen,
119 int lastExtIndex);
120 int getRightFloatHeight (int y, int h, OOFAwareWidget *lastGen,
121 int lastExtIndex);
122
123 int getClearPosition (OOFAwareWidget *widget);
124
125 bool affectsLeftBorder (core::Widget *widget);
126 bool affectsRightBorder (core::Widget *widget);
127 bool mayAffectBordersAtAll ();
128
130
131 int getNumWidgets ();
132 core::Widget *getWidget (int i);
133};
134
135} // namespace oof
136
137} // namespace dw
138
139#endif // __DW_OOFPOSITIONEDMGR_HH__
Set at the top when drawing.
Definition types.hh:295
Set at the top when getting the widget at the point.
Definition types.hh:313
dw::core::Shape implemtation for simple rectangles.
Definition types.hh:70
An interface to encapsulate platform dependent drawing.
Definition view.hh:17
The base class of all dillo widgets.
Definition widget.hh:44
Allocation * getAllocation()
Definition widget.hh:484
style::Style * getStyle()
Definition widget.hh:482
bool wasAllocated()
Definition widget.hh:475
Base class for widgets which can act as container and generator for widgets out of flow.
core::Widget * getWidget(int i)
int getLeftBorder(int y, int h, OOFAwareWidget *lastGen, int lastExtIndex)
Get the left border for the vertical position of y, for a height of h", based on floats; relative to ...
virtual bool posXAbsolute(Child *child)=0
void tellPosition1(core::Widget *widget, int x, int y)
Called before tellPosition2, see there for more.
bool hasFloatRight(int y, int h, OOFAwareWidget *lastGen, int lastExtIndex)
Return whether there is a float on the right side.
lout::container::typed::HashTable< lout::object::TypedPointer< dw::core::Widget >, Child > * childrenByWidget
bool affectsRightBorder(core::Widget *widget)
bool posXDefined(Child *child)
bool posYDefined(Child *child)
lout::container::typed::Vector< Child > * children
virtual void sizeAllocateChildren()=0
bool getPosLeft(core::Widget *child, int availWidth, int *result)
void addWidgetInFlow(OOFAwareWidget *widget, OOFAwareWidget *parent, int externalIndex)
int getLeftFloatHeight(int y, int h, OOFAwareWidget *lastGen, int lastExtIndex)
Assuming there is a float on the left side, return the rest height of it.
bool affectsLeftBorder(core::Widget *widget)
int generatorPosX(Child *child)
int generatorPosY(Child *child)
bool getPosBorder(core::style::Length cssValue, int refLength, int *result)
int addWidgetOOF(core::Widget *widget, OOFAwareWidget *generator, int externalIndex)
bool getPosRight(core::Widget *child, int availWidth, int *result)
virtual bool posYAbsolute(Child *child)=0
core::Allocation containerAllocation
void sizeAllocateEnd(OOFAwareWidget *caller)
enum dw::oof::OOFPositionedMgr::@14 containerAllocationState
int getRightFloatHeight(int y, int h, OOFAwareWidget *lastGen, int lastExtIndex)
Assuming there is a float on the right side, return the rest height of it.
void draw(core::View *view, core::Rectangle *area, core::DrawingContext *context)
void tellPosition2(core::Widget *widget, int x, int y)
Called after tellPosition1.
int getRightBorder(int y, int h, OOFAwareWidget *lastGen, int lastExtIndex)
Get the right border for the vertical position of y, for a height of h, based on floats; relative to ...
bool generatorPosDefined(Child *child)
int getClearPosition(OOFAwareWidget *widget)
Return value is relative to the calling generator (not container).
void tellIncompletePosition1(core::Widget *generator, core::Widget *widget, int x, int y)
bool getPosTop(core::Widget *child, int availHeight, int *result)
void moveExternalIndices(OOFAwareWidget *generator, int oldStartIndex, int diff)
bool hasFloatLeft(int y, int h, OOFAwareWidget *lastGen, int lastExtIndex)
Return whether there is a float on the left side.
bool dealingWithSizeOfChild(core::Widget *child)
void tellIncompletePosition2(core::Widget *generator, core::Widget *widget, int x, int y)
void sizeAllocateStart(OOFAwareWidget *caller, core::Allocation *allocation)
core::Widget * getWidgetAtPoint(int x, int y, core::GettingWidgetAtPointContext *context)
bool getPosBottom(core::Widget *child, int availHeight, int *result)
Represents additional data for OOF containers.
Typed version of container::untyped::HashTable.
Definition container.hh:536
Typed version of container::untyped::Vector.
Definition container.hh:447
This is the base class for many other classes, which defines very common virtual methods.
Definition object.hh:25
A typed version of object::Pointer.
Definition object.hh:116
int Length
Type for representing all lengths within dw::core::style.
Definition style.hh:429
Dw is in this namespace, or sub namespaces of this one.
Represents the allocation, i.e.
Definition types.hh:164