42
42
#include "showdesktop_options.h"
44
#define WIN_X(w) ((w)->x () - (w)->border ().left)
45
#define WIN_Y(w) ((w)->y () - (w)->border ().top)
46
#define WIN_W(w) ((w)->width () + (w)->border ().left + (w)->border ().right)
47
#define WIN_H(w) ((w)->height () + (w)->border ().top + (w)->border ().bottom)
49
#define OFF_LEFT(w) ((w)->width () + (w)->border ().right)
50
#define OFF_RIGHT(w) ((w)->border ().left)
51
#define OFF_TOP(w) ((w)->height () + (w)->border ().bottom)
52
#define OFF_BOTTOM(w) ((w)->border ().top)
54
#define MOVE_LEFT(w) ((WIN_X (w) + (WIN_W (w) / 2)) < (screen->width () / 2))
55
#define MOVE_UP(w) ((WIN_Y (w) + (WIN_H (w) / 2)) < (screen->height () / 2))
57
44
extern const unsigned short SD_STATE_OFF;
58
45
extern const unsigned short SD_STATE_ACTIVATING;
59
46
extern const unsigned short SD_STATE_ON;
60
47
extern const unsigned short SD_STATE_DEACTIVATING;
49
/* Initialize the enums containing allowed directions
50
* for intelligent random and fully random direction modes */
54
IntelligentRandomToCorners,
55
IntelligentRandomUpDown,
56
IntelligentRandomLeftRight
62
71
class ShowdesktopPlacer
65
74
ShowdesktopPlacer ();
76
void up (const CompRect &workArea,
77
const compiz::window::Geometry &geometry,
78
const compiz::window::extents::Extents &border,
81
void down (const CompRect &workArea,
82
const compiz::window::Geometry &geometry,
83
const compiz::window::extents::Extents &border,
86
void left (const CompRect &workArea,
87
const compiz::window::Geometry &geometry,
88
const compiz::window::extents::Extents &border,
91
void right (const CompRect &workArea,
92
const compiz::window::Geometry &geometry,
93
const compiz::window::extents::Extents &border,
96
void topLeft (const CompRect &workArea,
97
const compiz::window::Geometry &geometry,
98
const compiz::window::extents::Extents &border,
101
void topRight (const CompRect &workArea,
102
const compiz::window::Geometry &geometry,
103
const compiz::window::extents::Extents &border,
106
void bottomLeft (const CompRect &workArea,
107
const compiz::window::Geometry &geometry,
108
const compiz::window::extents::Extents &border,
111
void bottomRight (const CompRect &workArea,
112
const compiz::window::Geometry &geometry,
113
const compiz::window::extents::Extents &border,
116
void upOrDown (const CompRect &workArea,
117
const compiz::window::Geometry &geometry,
118
const compiz::window::extents::Extents &border,
119
const CompSize &screen,
122
void leftOrRight (const CompRect &workArea,
123
const compiz::window::Geometry &geometry,
124
const compiz::window::extents::Extents &border,
125
const CompSize &screen,
128
void closestCorner (const CompRect &workArea,
129
const compiz::window::Geometry &geometry,
130
const compiz::window::extents::Extents &border,
131
const CompSize &screen,
134
void partRandom (const CompRect &workArea,
135
const compiz::window::Geometry &geometry,
136
const compiz::window::extents::Extents &border,
137
const CompSize &screen,
140
void random (const CompRect &workArea,
141
const compiz::window::Geometry &geometry,
142
const compiz::window::extents::Extents &border,
68
146
int onScreenX, onScreenY;
69
147
int offScreenX, offScreenY;