From 0dcbf985c11c850b30b2983e1e20cd8cf033f054 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 18 Jan 2003 00:33:48 +0000 Subject: start of new render code --- otk/rendercontrol.cc | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 otk/rendercontrol.cc (limited to 'otk/rendercontrol.cc') 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 +#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"); + + +} + +} -- cgit v1.2.3