]> Dogcows Code - chaz/openbox/blob - otk/rendercontrol.hh
starting to make render's interface
[chaz/openbox] / 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 #include <X11/Xutil.h>
8 }
9
10 namespace otk {
11
12 class ScreenInfo;
13 class Surface;
14 class RenderTexture;
15
16 class RenderControl {
17 protected:
18 const ScreenInfo *_screen;
19
20 int _red_bits;
21 int _green_bits;
22 int _blue_bits;
23
24 // color tables, meaning, 256 (possibly) different shades of each color,
25 // based on the number of bits there are available for each color in the
26 // visual
27 unsigned char _red_color_table[256];
28 unsigned char _green_color_table[256];
29 unsigned char _blue_color_table[256];
30
31 /*
32 Bool _dither;
33
34 int _cpc; // colors-per-channel: must be a value between [2,6]
35 int _bpp; // bits-per-pixel
36
37 unsigned int *_grad_xbuffer;
38 unsigned int *_grad_ybuffer;
39 unsigned int _grad_buffer_width;
40 unsigned int _grad_buffer_height;
41
42 unsigned long *_sqrt_table;
43
44 // These values are all determined based on a visual
45
46 int _red_bits; // the number of bits (1-255) that each shade of color
47 int _green_bits; // spans across. best case is 1, which gives 255 shades.
48 int _blue_bits;
49 unsigned char _red_color_table[256];
50 unsigned char _green_color_table[256];
51 unsigned char _blue_color_table[256];
52
53 // These are only used for TrueColor visuals
54 int _red_offset; // the offset of each color in a color mask
55 int _green_offset;
56 int _blue_offset;
57
58 // These are only used for !TrueColor visuals
59 XColor *_colors;
60 int _ncolors;
61 */
62
63 RenderControl(const ScreenInfo *screen);
64
65 public:
66 virtual ~RenderControl();
67
68 static RenderControl *getRenderControl(int screen);
69
70 virtual void drawBackground(Surface *sf,
71 const RenderTexture &texture) const = 0;
72 };
73
74 }
75
76 #endif // __rendercontrol_hh
This page took 0.040609 seconds and 5 git commands to generate.