Dillo
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 
11 namespace dw {
12 namespace core {
13 
19 {
20 private:
21  int numPos;
23  int *x, *y;
24 
25  void init ();
26  void cleanup ();
27 
28  inline void debugPrint () {
29  DBG_IF_RTFL {
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 
39 public:
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__
int * y
Definition: tools.hh:23
#define DBG_OBJ_ARRSET_PTR(var, ind, val)
Definition: debug_rtfl.hh:440
bool isEquivalent(SizeParams *other)
Definition: tools.cc:162
~SizeParams()
Definition: tools.cc:31
int * x
Definition: tools.hh:23
int * getY()
Definition: tools.hh:57
void cleanup()
Definition: tools.cc:53
#define DBG_OBJ_SET_NUM(var, val)
Definition: debug_rtfl.hh:420
#define DBG_IF_RTFL
Definition: debug.hh:73
Hold arguments passed to dw::core::Widget::sizeRequest and dw::core::Widget::getExtremes, as described in Size requisitions depending on positions.
Definition: tools.hh:18
Widget ** references
Definition: tools.hh:22
The base class of all dillo widgets.
Definition: widget.hh:23
void forChild(Widget *parent, Widget *child, int xRel, int yRel, SizeParams *childParams)
Definition: tools.cc:88
int numPos
Definition: tools.hh:21
bool findReference(Widget *reference, int *x, int *y)
Definition: tools.cc:128
int getY(int i)
Definition: tools.hh:60
Widget ** getReferences()
Definition: tools.hh:55
void fill(int numPos, Widget **references, int *x, int *y)
Definition: tools.cc:65
int getNumPos()
Definition: tools.hh:54
Dw is in this namespace, or sub namespaces of this one.
Definition: alignedtablecell.cc:28
int * getX()
Definition: tools.hh:56
SizeParams & operator=(const SizeParams &other)
Definition: tools.cc:37
SizeParams()
Definition: tools.cc:8
void init()
Definition: tools.cc:46
Widget * getReference(int i)
Definition: tools.hh:58
#define DBG_OBJ_ARRSET_NUM(var, ind, val)
Definition: debug_rtfl.hh:432
void debugPrint()
Definition: tools.hh:28
int getX(int i)
Definition: tools.hh:59