~george-edison55/stackfusion/trunk

« back to all changes in this revision

Viewing changes to plugins/stackfusion/src/stackfusion.cpp

  • Committer: Nathan Osman
  • Date: 2011-07-25 02:49:11 UTC
  • Revision ID: admin@quickmediasolutions.com-20110725024911-vh1af9g160fkmq3x
Added logging functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include "stackfusion.h"
2
2
 
 
3
#include <fstream>
 
4
std::ofstream fout("/tmp/log", std::ios_base::trunc);
 
5
 
3
6
COMPIZ_PLUGIN_20090315 (stackfusion, StackFusionVTable);
4
7
 
5
8
StackFusionScreen::StackFusionScreen(CompScreen * screen)
6
9
    : PluginClassHandler <StackFusionScreen, CompScreen> (screen),
7
 
      m_c_screen (CompositeScreen::get(screen)),
8
 
      m_g_screen (GLScreen::get(screen))
 
10
      m_c_screen(CompositeScreen::get(screen)),
 
11
      m_g_screen(GLScreen::get(screen))
9
12
{
10
13
    CompositeScreenInterface::setHandler(m_c_screen, false);
11
14
    GLScreenInterface::setHandler(m_g_screen, false);
 
15
 
 
16
    // Open the file
 
17
    fout << "Plugin initialized!" << std::endl;
12
18
}
13
19
 
14
20
StackFusionScreen::~StackFusionScreen()
15
21
{
16
 
    ///...
 
22
    fout << "Plugin unloaded!" << std::endl;
17
23
}
18
24
 
19
25
// Painting functions
20
26
void StackFusionScreen::preparePaint(int ms)
21
27
{
22
28
    m_c_screen->preparePaint(ms);
 
29
 
 
30
    fout << "preparePaint()" << std::endl;
23
31
}
24
32
 
25
33
void StackFusionScreen::donePaint()
26
34
{
27
35
    m_c_screen->donePaint();
 
36
 
 
37
    fout << "donePaint()" << std::endl;
 
38
}
 
39
 
 
40
void StackFusionScreen::postLoad()
 
41
{
 
42
    //m_c_screen->preparePaintSetEnabled(this, true);
 
43
    //m_c_screen->donePaintSetEnabled(this, true);
 
44
    m_g_screen->glPaintOutputSetEnabled(this, true);
28
45
}
29
46
 
30
47
bool StackFusionScreen::glPaintOutput (const GLScreenPaintAttrib & sAttrib,
35
52
{
36
53
    bool status = m_g_screen->glPaintOutput (sAttrib, transform, region, output, mask);
37
54
 
38
 
    /*
39
55
    // Draw a triangle.
40
56
    glColor4f(0.0, 1.0, 0.0, 1.0);
41
57
 
44
60
    glVertex2f(150, 150);
45
61
    glVertex2f(50, 150);
46
62
    glEnd();
47
 
    */
 
63
 
 
64
    fout << "glPaintOutput()" << std::endl;
48
65
 
49
66
    return status;
50
67
}