2
* Copyright © 2007 Novell, Inc.
4
* Permission to use, copy, modify, distribute, and sell this software
5
* and its documentation for any purpose is hereby granted without
6
* fee, provided that the above copyright notice appear in all copies
7
* and that both that copyright notice and this permission notice
8
* appear in supporting documentation, and that the name of
9
* Novell, Inc. not be used in advertising or publicity pertaining to
10
* distribution of the software without specific, written prior permission.
11
* Novell, Inc. makes no representations about the suitability of this
12
* software for any purpose. It is provided "as is" without express or
15
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17
* NO EVENT SHALL NOVELL, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23
* Author: David Reveman <davidr@novell.com>
26
#ifndef _SCALE_PRIVATES_H
27
#define _SCALE_PRIVATES_H
29
#include <scale/scale.h>
30
#include "scale_options.h"
37
typedef std::vector<SlotArea> vector;
40
class PrivateScaleScreen :
41
public ScreenInterface,
42
public CompositeScreenInterface,
43
public GLScreenInterface,
47
PrivateScaleScreen (CompScreen *);
48
~PrivateScaleScreen ();
50
void handleEvent (XEvent *event);
52
void preparePaint (int);
55
bool glPaintOutput (const GLScreenPaintAttrib &,
56
const GLMatrix &, const CompRegion &,
57
CompOutput *, unsigned int);
59
void activateEvent (bool activating);
61
void layoutSlotsForArea (const CompRect&, int);
63
void findBestSlots ();
64
bool fillInWindows ();
67
SlotArea::vector getSlotAreas ();
69
ScaleWindow * checkForWindowAt (int x, int y);
71
void sendDndStatusMessage (Window);
74
actionShouldToggle (CompAction *action,
75
CompAction::State state);
77
static bool scaleTerminate (CompAction *action,
78
CompAction::State state,
79
CompOption::Vector &options);
80
static bool scaleInitiate (CompAction *action,
81
CompAction::State state,
82
CompOption::Vector &options,
85
bool scaleInitiateCommon (CompAction *action,
86
CompAction::State state,
87
CompOption::Vector &options);
89
bool ensureDndRedirectWindow ();
91
bool selectWindowAt (int x, int y, bool moveInputFocus);
93
void moveFocusWindow (int dx, int dy);
95
void windowRemove (CompWindow *);
99
void updateOpacity ();
101
int getMultioutputMode ();
105
CompositeScreen *cScreen;
108
unsigned int lastActiveNum;
109
Window lastActiveWindow;
111
Window selectedWindow;
112
Window hoveredWindow;
113
Window previousActiveWindow;
115
KeyCode leftKeyCode, rightKeyCode, upKeyCode, downKeyCode;
118
CompScreen::GrabHandle grabIndex;
124
ScaleScreen::State state;
129
std::vector<ScaleSlot> slots;
132
ScaleScreen::WindowList windows;
141
CompMatch currentMatch;
144
class PrivateScaleWindow :
145
public CompositeWindowInterface,
146
public GLWindowInterface
149
PrivateScaleWindow (CompWindow *);
150
~PrivateScaleWindow ();
152
bool damageRect (bool, const CompRect &);
154
bool glPaint (const GLWindowPaintAttrib &, const GLMatrix &,
155
const CompRegion &, unsigned int);
157
bool isNeverScaleWin () const;
158
bool isScaleWin () const;
160
bool adjustScaleVelocity ();
162
static bool compareWindowsDistance (ScaleWindow *, ScaleWindow *);
166
CompositeWindow *cWindow;
168
ScaleWindow *sWindow;
169
ScaleScreen *sScreen;
170
PrivateScaleScreen *spScreen;
177
GLfloat xVelocity, yVelocity, scaleVelocity;
183
float lastThumbOpacity;