2
* Compiz Fusion Grid plugin
4
* Copyright (c) 2008 Stephen Kennedy <suasol@gmail.com>
5
* Copyright (c) 2010 Scott Moreau <oreaus@gmail.com>
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 2
10
* of the License, or (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
19
* Plugin to act like winsplit revolution (http://www.winsplit-revolution.com/)
20
* use <Control><Alt>NUMPAD_KEY to move and tile your windows.
22
* Press the tiling keys several times to cycle through some tiling options.
25
#include <core/core.h>
26
#include <core/atoms.h>
27
#include <core/pluginclasshandler.h>
28
#include <composite/composite.h>
29
#include <opengl/opengl.h>
31
#include "grid_options.h"
33
#define SNAPOFF_THRESHOLD 50
50
typedef struct _GridProps
89
public ScreenInterface,
90
public CompositeScreenInterface,
91
public GLScreenInterface,
92
public PluginClassHandler <GridScreen, CompScreen>,
97
GridScreen (CompScreen *);
98
CompositeScreen *cScreen;
101
CompRect workarea, currentRect, desiredSlot, lastSlot,
102
desiredRect, lastWorkarea, currentWorkarea;
104
Edges edge, lastEdge;
105
CompOption::Vector o;
107
CompWindow *mGrabWindow;
110
void getPaintRectangle (CompRect&);
111
void setCurrentRect (Animation&);
113
bool initiateCommon (CompAction*, CompAction::State,
114
CompOption::Vector&, GridType, bool);
116
void glPaintRectangle (const GLScreenPaintAttrib&,
117
const GLMatrix&, CompOutput *);
119
bool glPaintOutput (const GLScreenPaintAttrib &,
120
const GLMatrix &, const CompRegion &,
121
CompOutput *, unsigned int);
123
void preparePaint (int msSinceLastPaint);
126
std::vector <Animation> animations;
128
GridType edgeToGridType ();
130
void handleEvent (XEvent *event);
132
bool restoreWindow (CompAction*,
134
CompOption::Vector&);
137
snapbackOptionChanged (CompOption *option,
141
slotToRect (CompWindow *w,
142
const CompRect& slot);
144
constrainSize (CompWindow *w,
145
const CompRect& slot);
149
public WindowInterface,
150
public PluginClassHandler <GridWindow, CompWindow>
154
GridWindow (CompWindow *);
159
bool isGridMaximized;
163
CompRect originalSize;
166
void grabNotify (int, int, unsigned int, unsigned int);
168
void ungrabNotify ();
170
void moveNotify (int, int, bool);
173
#define GRID_WINDOW(w) \
174
GridWindow *gw = GridWindow::get (w)
176
class GridPluginVTable :
177
public CompPlugin::VTableForScreenAndWindow <GridScreen, GridWindow>
184
COMPIZ_PLUGIN_20090315 (grid, GridPluginVTable);