]> icculus.org git repositories - mikachu/openbox.git/blob - otk/rendercontrol.hh
add latex to the doc build process. fix namespace comments again.
[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 #include <X11/Xutil.h>
8 }
9
10 namespace otk {
11
12 class ScreenInfo;
13 class Surface;
14 class RenderTexture;
15 class Font;
16 class RenderColor;
17 class ustring;
18
19 class RenderControl {
20 protected:
21   int _screen;
22
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 /*
33   Bool _dither;
34
35   int _cpc; // colors-per-channel: must be a value between [2,6]
36   int _bpp; // bits-per-pixel
37
38   unsigned int *_grad_xbuffer;
39   unsigned int *_grad_ybuffer;
40   unsigned int _grad_buffer_width;
41   unsigned int _grad_buffer_height;
42
43   unsigned long *_sqrt_table;
44
45   // These values are all determined based on a visual
46
47   int _red_bits;    // the number of bits (1-255) that each shade of color
48   int _green_bits;  // spans across. best case is 1, which gives 255 shades.
49   int _blue_bits;
50   unsigned char _red_color_table[256];
51   unsigned char _green_color_table[256];
52   unsigned char _blue_color_table[256];
53
54   // These are only used for TrueColor visuals
55   int _red_offset;  // the offset of each color in a color mask
56   int _green_offset;
57   int _blue_offset;
58
59   // These are only used for !TrueColor visuals
60   XColor *_colors;
61   int _ncolors;
62 */
63
64   RenderControl(int screen);
65
66   virtual void drawSolidBackground(Surface& sf,
67                                    const RenderTexture& texture) const;
68   
69 public:
70   virtual ~RenderControl();
71
72   static RenderControl *getRenderControl(int screen);
73
74   virtual void drawRoot(const RenderColor &color) const;
75   
76   //! Draws a string onto a Surface
77   virtual void drawString(Surface &sf, const Font &font, int x, int y,
78                           const RenderColor &color,
79                           const ustring &string) const;
80
81   //! Draws a background onto a Surface, as specified by a RenderTexture
82   virtual void drawBackground(Surface &sf,
83                               const RenderTexture &texture) const = 0;
84 };
85
86 }
87
88 #endif // __rendercontrol_hh