]> icculus.org git repositories - mikachu/openbox.git/blob - otk/rendercontrol.hh
move render()
[mikachu/openbox.git] / otk / rendercontrol.hh
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 #ifndef __rendercontrol_hh
3 #define __rendercontrol_hh
4
5 extern "C" {
6 #include <X11/Xlib.h>
7 }
8
9 namespace otk {
10
11 class ScreenInfo;
12
13 class RenderControl {
14 protected:
15   const ScreenInfo *_screen;
16
17   // the number of bits (1-255) that each shade of color spans across. best
18   // case is 1, which gives 255 shades
19   int _red_bits;
20   int _green_bits;
21   int _blue_bits;
22
23   // color tables, meaning, 256 (possibly) different shades of each color,
24   // based on the number of bits there are available for each color in the
25   // visual
26   unsigned char _red_color_table[256];
27   unsigned char _green_color_table[256];
28   unsigned char _blue_color_table[256];
29
30 /*
31   Bool _dither;
32
33   int _cpc; // colors-per-channel: must be a value between [2,6]
34   int _bpp; // bits-per-pixel
35
36   unsigned int *_grad_xbuffer;
37   unsigned int *_grad_ybuffer;
38   unsigned int _grad_buffer_width;
39   unsigned int _grad_buffer_height;
40
41   unsigned long *_sqrt_table;
42
43   // These values are all determined based on a visual
44
45   int _red_bits;    // the number of bits (1-255) that each shade of color
46   int _green_bits;  // spans across. best case is 1, which gives 255 shades.
47   int _blue_bits;
48   unsigned char _red_color_table[256];
49   unsigned char _green_color_table[256];
50   unsigned char _blue_color_table[256];
51
52   // These are only used for TrueColor visuals
53   int _red_offset;  // the offset of each color in a color mask
54   int _green_offset;
55   int _blue_offset;
56
57   // These are only used for !TrueColor visuals
58   XColor *_colors;
59   int _ncolors;
60 */
61
62   RenderControl(const ScreenInfo *screen);
63
64 public:
65   virtual ~RenderControl();
66
67   static RenderControl *getRenderControl(int screen);
68
69   virtual void render(::Drawable d);
70 };
71
72 }
73
74 #endif // __rendercontrol_hh