]> icculus.org git repositories - mikachu/openbox.git/blob - otk/pseudorendercontrol.cc
add pseudorendercontrol
[mikachu/openbox.git] / otk / pseudorendercontrol.cc
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2
3 #ifdef    HAVE_CONFIG_H
4 #  include "../config.h"
5 #endif // HAVE_CONFIG_H
6
7 #include "pseudorendercontrol.hh"
8 #include "display.hh"
9 #include "screeninfo.hh"
10 #include "surface.hh"
11 #include "rendertexture.hh"
12
13 extern "C" {
14 #ifdef    HAVE_STDLIB_H
15 #  include <stdlib.h>
16 #endif // HAVE_STDLIB_H
17
18 #include "../src/gettext.h"
19 #define _(str) gettext(str)
20 }
21
22 namespace otk {
23
24 PseudoRenderControl::PseudoRenderControl(int screen)
25   : RenderControl(screen)
26 {
27   const ScreenInfo *info = display->screenInfo(_screen);
28
29   printf("Initializing PseudoColor RenderControl\n");
30
31 }
32
33 PseudoRenderControl::~PseudoRenderControl()
34 {
35   printf("Destroying PseudoColor RenderControl\n");
36
37
38 }
39
40 void PseudoRenderControl::drawGradientBackground(
41      Surface &sf, const RenderTexture &texture) const
42 {
43 }
44
45 void PseudoRenderControl::drawBackground(Surface& sf,
46                                        const RenderTexture &texture) const
47 {
48   assert(_screen == sf._screen);
49   assert(_screen == texture.color().screen());
50
51   if (texture.gradient() == RenderTexture::Solid) {
52     drawSolidBackground(sf, texture);
53   } else {
54     drawGradientBackground(sf, texture);
55   }
56 }
57
58 }