]> Dogcows Code - chaz/openbox/blob - otk/rendercontrol.cc
blef
[chaz/openbox] / otk / rendercontrol.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 "rendercontrol.hh"
8 #include "truerendercontrol.hh"
9 #include "display.hh"
10 #include "screeninfo.hh"
11
12 extern "C" {
13 #ifdef HAVE_STDLIB_H
14 # include <stdlib.h>
15 #endif // HAVE_STDLIB_H
16
17 #include "gettext.h"
18 #define _(str) gettext(str)
19 }
20
21 namespace otk {
22
23 RenderControl *RenderControl::getRenderControl(int screen)
24 {
25 const ScreenInfo *info = display->screenInfo(screen);
26
27 // get the visual on the screen and return the correct type of RenderControl
28 int vclass = info->visual()->c_class;
29 switch (vclass) {
30 case TrueColor:
31 return new TrueRenderControl(info);
32 case PseudoColor:
33 case StaticColor:
34 // return new PseudoRenderControl(info);
35 case GrayScale:
36 case StaticGray:
37 // return new GrayRenderControl(info);
38 default:
39 printf(_("RenderControl: Unsupported visual %d specified. Aborting.\n"),
40 vclass);
41 ::exit(1);
42 }
43 }
44
45 RenderControl::RenderControl(const ScreenInfo *screen)
46 : _screen(screen)
47 {
48 printf("Initializing RenderControl\n");
49
50
51 }
52
53 RenderControl::~RenderControl()
54 {
55 printf("Destroying RenderControl\n");
56
57
58 }
59
60 }
This page took 0.037424 seconds and 4 git commands to generate.