blob: 1dd5704df54a14b8797e446dd7c4ec84ca4be7a9 (
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
|
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifdef HAVE_CONFIG_H
# include "../config.h"
#endif // HAVE_CONFIG_H
#include "rendercontrol.hh"
#include "truerendercontrol.hh"
#include "display.hh"
#include "screeninfo.hh"
extern "C" {
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif // HAVE_STDLIB_H
#include "gettext.h"
#define _(str) gettext(str)
}
namespace otk {
RenderControl *RenderControl::getRenderControl(int screen)
{
const ScreenInfo *info = display->screenInfo(screen);
// get the visual on the screen and return the correct type of RenderControl
int vclass = info->visual()->c_class;
switch (vclass) {
case TrueColor:
return new TrueRenderControl(info);
case PseudoColor:
case StaticColor:
// return new PseudoRenderControl(info);
case GrayScale:
case StaticGray:
// return new GrayRenderControl(info);
default:
printf(_("RenderControl: Unsupported visual %d specified. Aborting.\n"),
vclass);
::exit(1);
}
}
RenderControl::RenderControl(const ScreenInfo *screen)
: _screen(screen)
{
printf("Initializing RenderControl\n");
}
RenderControl::~RenderControl()
{
printf("Destroying RenderControl\n");
}
}
|