-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathLayoutStrategy.h
80 lines (57 loc) · 1.54 KB
/
LayoutStrategy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef _LAYOUTSTRATEGY_
#define _LAYOUTSTRATEGY_
#include <vector>
#include "Geometry.h"
class LayoutStrategy {
public:
virtual ~LayoutStrategy() = 0;
virtual void unfocus() = 0;
virtual void focus(const Point &p) = 0;
virtual const GeometryObject &addWidget() = 0;
virtual int widgetAt(const Point &x) const = 0;
virtual bool atHoverZone(const Point &x) const = 0;
virtual Size frameSize() const = 0;
};
class WaveLayout : public LayoutStrategy {
public:
WaveLayout(int widget_size = 32, int num_anim = 3, float zoom_factor = 1.8,
float jump_factor = 1.0);
~WaveLayout();
void unfocus();
void focus(const Point &p);
const Rect &addWidget();
int widgetAt(const Point &x) const;
bool atHoverZone(const Point &x) const;
const Rect &dockLayout() const;
Size frameSize() const;
protected:
int widget_size;
int widget_dist;
int bar_margin;
int num_animated;
float zoom_factor;
float jump_factor;
int widget_unit() const;
int widget_growth() const;
int bar_y() const;
int bar_height() const;
float _upgrowth() const;
float _dngrowth() const;
std::vector<Point *> position;
std::vector<Rect *> bounds;
Rect dock_bounds;
};
class CoverflowLayout : public LayoutStrategy {
public:
CoverflowLayout();
void unfocus();
void focus(const Point &p);
const Rect &addWidget();
int widgetAt(const Point &x) const;
bool atHoverZone(const Point &x) const;
const Rect &dockLayout() const;
Size frameSize() const;
protected:
};
#endif /* _LAYOUTSTRATEGY_ */
/* vim: set sw=2 sts=2 : */