~george-edison55/stackfusion/trunk

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
// StackFusion - Experimental Compiz plugin that provides
// fancy animations when events happen on registered Stack Exchange
// accounts.

// Include files
#include <core/core.h>
#include <core/pluginclasshandler.h>
#include <composite/composite.h>
#include <opengl/opengl.h>

#include "stackfusion_options.h"
#include "bubble.h"

class StackFusionScreen :
        public PluginClassHandler <StackFusionScreen, CompScreen>,
        public GLScreenInterface,
        public CompositeScreenInterface,
        public StackfusionOptions
{
public:

    StackFusionScreen(CompScreen *);
    ~StackFusionScreen();

    // Painting functions
    void preparePaint(int);
    void donePaint();

    // Toggle the display
    void ToggleDisplay();

    bool glPaintOutput (const GLScreenPaintAttrib &,
                        const GLMatrix &,
                        const CompRegion &,
                        CompOutput *,
                        unsigned int);

    // Key binding handlers
    bool toggle(CompAction *, CompAction::State, CompOption::Vector);

private:

    // Compiz variables
    CompositeScreen * m_c_screen;
    GLScreen	    * m_g_screen;

    // State variables
    bool m_active;
    int m_ms;
    
    // Bubble to display
    Bubble m_bubble;
};

class StackFusionVTable :
        public CompPlugin::VTableForScreen <StackFusionScreen>
{
public:

    bool init();
};