diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-01-18 00:33:48 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-01-18 00:33:48 +0000 |
| commit | 0dcbf985c11c850b30b2983e1e20cd8cf033f054 (patch) | |
| tree | 665cc076435ccedee0163f28d3e0d0b95b44a695 /otk/rendercontrol.cc | |
| parent | 29f331b63fa9d800fd99d8e1ea99fffa91a4b663 (diff) | |
start of new render code
Diffstat (limited to 'otk/rendercontrol.cc')
| -rw-r--r-- | otk/rendercontrol.cc | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/otk/rendercontrol.cc b/otk/rendercontrol.cc new file mode 100644 index 00000000..1dd5704d --- /dev/null +++ b/otk/rendercontrol.cc @@ -0,0 +1,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"); + + +} + +} |
