Dillo v3.1.1-119-g140d9ebd
Loading...
Searching...
No Matches
tools.hh
Go to the documentation of this file.
1#ifndef __DW_TOOLS_HH__
2#define __DW_TOOLS_HH__
3
4#ifndef __INCLUDED_FROM_DW_CORE_HH__
5# error Do not include this file directly, use "core.hh" instead.
6#endif
7
8#include "core.hh"
9#include "../lout/debug.hh"
10
11namespace dw {
12namespace core {
13
19{
20private:
21 int numPos;
23 int *x, *y;
24
25 void init ();
26 void cleanup ();
27
28 inline void debugPrint () {
30 DBG_OBJ_SET_NUM ("numPos", numPos);
31 for (int i = 0; i < numPos; i++) {
32 DBG_OBJ_ARRSET_PTR ("references", i, references[i]);
33 DBG_OBJ_ARRSET_NUM ("x", i, x[i]);
34 DBG_OBJ_ARRSET_NUM ("y", i, y[i]);
35 }
36 }
37 }
38
39public:
40 SizeParams ();
41 SizeParams (int numPos, Widget **references, int *x, int *y);
42 SizeParams (const SizeParams &other);
43 ~SizeParams ();
44
45 SizeParams &operator=(const SizeParams &other);
46
47 void fill (int numPos, Widget **references, int *x, int *y);
48 void forChild (Widget *parent, Widget *child, int xRel, int yRel,
49 SizeParams *childParams);
50 bool findReference (Widget *reference, int *x, int *y);
51
52 bool isEquivalent (SizeParams *other);
53
54 inline int getNumPos () { return numPos; }
55 inline Widget **getReferences () { return references; }
56 inline int *getX () { return x; }
57 inline int *getY () { return y; }
58 inline Widget *getReference (int i) { return references[i]; }
59 inline int getX (int i) { return x[i]; }
60 inline int getY (int i) { return y[i]; }
61};
62
63} // namespace core
64} // namespace dw
65
66#endif // __DW_TOOLS_HH__
Hold arguments passed to dw::core::Widget::sizeRequest and dw::core::Widget::getExtremes,...
Definition tools.hh:19
Widget * getReference(int i)
Definition tools.hh:58
bool isEquivalent(SizeParams *other)
Compares two instances, but considers a change in the order of the reference widgets as equivalent.
Definition tools.cc:164
int getY(int i)
Definition tools.hh:60
int getX(int i)
Definition tools.hh:59
Widget ** references
Definition tools.hh:22
SizeParams & operator=(const SizeParams &other)
Definition tools.cc:37
void fill(int numPos, Widget **references, int *x, int *y)
Definition tools.cc:65
void forChild(Widget *parent, Widget *child, int xRel, int yRel, SizeParams *childParams)
Definition tools.cc:88
Widget ** getReferences()
Definition tools.hh:55
bool findReference(Widget *reference, int *x, int *y)
Definition tools.cc:130
The base class of all dillo widgets.
Definition widget.hh:44
#define DBG_IF_RTFL
Definition debug.hh:73
#define DBG_OBJ_SET_NUM(var, val)
#define DBG_OBJ_ARRSET_NUM(var, ind, val)
#define DBG_OBJ_ARRSET_PTR(var, ind, val)
Dw is in this namespace, or sub namespaces of this one.