summaryrefslogtreecommitdiff
path: root/src/hoverfx.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/hoverfx.h')
-rw-r--r--src/hoverfx.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/src/hoverfx.h b/src/hoverfx.h
new file mode 100644
index 0000000..6183670
--- /dev/null
+++ b/src/hoverfx.h
@@ -0,0 +1,84 @@
+/*copyright*/
+
+#include <core/core.h>
+#include <composite/composite.h>
+#include <opengl/opengl.h>
+
+#include "hoverfx_options.h"
+
+class HoverScreen :
+ public PluginClassHandler <HoverScreen, CompScreen>,
+ public ScreenInterface,
+ public CompositeScreenInterface,
+ public GLScreenInterface,
+ public HoverfxOptions
+{
+ public:
+
+ HoverScreen (CompScreen *);
+
+ CompositeScreen *cScreen;
+ GLScreen *gScreen;
+
+ void
+ preparePaint (int);
+
+ void
+ handleEvent (XEvent *);
+
+ void
+ donePaint ();
+
+ bool
+ glPaintOutput (const GLScreenPaintAttrib &attrib,
+ const GLMatrix &transform,
+ const CompRegion &region,
+ CompOutput *output,
+ unsigned int mask);
+};
+
+#define HOVER_SCREEN(s) \
+ HoverScreen *hs = HoverScreen::get(s)
+
+
+class HoverWindow :
+ public PluginClassHandler <HoverWindow, CompWindow>,
+ public CompositeWindowInterface,
+ public GLWindowInterface
+{
+ public:
+
+ HoverWindow (CompWindow *);
+
+ CompWindow *window;
+ CompositeWindow *cWindow;
+ GLWindow *gWindow;
+
+ bool mIsHovered;
+ bool mAnimate;
+
+ float mOldScale;
+ float mCurrentScale;
+ float mTargetScale;
+
+ bool shouldAnimate ();
+
+ bool
+ glPaint (const GLWindowPaintAttrib &,
+ const GLMatrix &,
+ const CompRegion &,
+ unsigned int);
+
+ bool
+ damageRect (bool, CompRect &);
+};
+
+#define HOVER_WINDOW(w) \
+ HoverWindow *hw = HoverWindow::get (w);
+
+class HoverPluginVTable :
+ public CompPlugin::VTableForScreenAndWindow <HoverScreen, HoverWindow>
+{
+ public:
+ bool init ();
+}; \ No newline at end of file