summaryrefslogtreecommitdiff
path: root/wrapper.cpp
blob: b9b74c239b88f6fd65f0b99fe28a486e6447b365 (plain)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#include "screensaver_internal.h"

DisplayWrapper::DisplayWrapper( CompDisplay* d )
{
	SCREENSAVER_DISPLAY(d);
	this->d = d;
	this->sd = sd;
}

void DisplayWrapper::handleEvent( XEvent *event )
{
	UNWRAP (sd, d, handleEvent);
	d->handleEvent(d, event);
	WRAP (sd, d, handleEvent, screenSaverHandleEvent);
}

ScreenWrapper::ScreenWrapper( CompScreen* s )
{
	SCREENSAVER_SCREEN(s);
	this->s = s;
	this->ss = ss;
}

void ScreenWrapper::getRotation( float* x, float* v )
{
	CUBE_SCREEN(s);
	UNWRAP( ss, cs, getRotation );
	cs->getRotation( s, x, v );
	WRAP( ss, cs, getRotation, screenSaverGetRotation );
}

void ScreenWrapper::preparePaintScreen( int msSinceLastPaint )
{
	UNWRAP (ss, s, preparePaintScreen);
	s->preparePaintScreen(s, msSinceLastPaint);
	WRAP (ss, s, preparePaintScreen, screenSaverPreparePaintScreen);
}

void ScreenWrapper::donePaintScreen()
{
	UNWRAP (ss, s, donePaintScreen);
	s->donePaintScreen(s);
	WRAP (ss, s, donePaintScreen, screenSaverDonePaintScreen);
}

void ScreenWrapper::paintTransformedOutput(	const ScreenPaintAttrib* sAttrib, \
											const CompTransform* transform, Region region, \
											CompOutput *output, unsigned int mask)
{
	UNWRAP(ss, s, paintTransformedOutput);
	s->paintTransformedOutput(s, sAttrib, transform, region, output, mask);
	WRAP( ss, s, paintTransformedOutput, screenSaverPaintTransformedOutput );
}

Bool ScreenWrapper::paintOutput(	const ScreenPaintAttrib *sAttrib, \
									const CompTransform* transform, Region region, \
									CompOutput* output, unsigned int mask)
{
	UNWRAP (ss, s, paintOutput);
	Bool status = s->paintOutput(s, sAttrib, transform, region, output, mask);
	WRAP (ss, s, paintOutput, screenSaverPaintOutput);
	return status;
}

void ScreenWrapper::paintScreen (CompOutput *outputs, int numOutputs, unsigned int mask)
{
    UNWRAP (ss, s, paintScreen);
    (*s->paintScreen) (s, outputs, numOutputs, mask);
    WRAP (ss, s, paintScreen, screenSaverPaintScreen);
}

void ScreenWrapper::paintBackground( Region region, unsigned int mask )
{
	UNWRAP( ss, s, paintBackground );
	s->paintBackground( s, region, mask );
	WRAP( ss, s, paintBackground, screenSaverPaintBackground );
}

WindowWrapper::WindowWrapper( CompWindow* w )
{
	SCREENSAVER_WINDOW(w);
	this->w = w;
	this->sw = sw;
}

Bool WindowWrapper::paintWindow(	const WindowPaintAttrib* attrib, \
									const CompTransform* transform, Region region, unsigned int mask)
{
	CompScreen* s = w->screen;
	SCREENSAVER_SCREEN(s);
	
	UNWRAP (ss, s, paintWindow);
	Bool status = s->paintWindow(w, attrib, transform, region, mask);
	WRAP (ss, s, paintWindow, screenSaverPaintWindow);
	return status;
}