]>
Dogcows Code - chaz/openbox/blob - rendercontrol.hh
52d80c526d1a76cc1c78403615e2eb54e8593f06
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 #ifndef __rendercontrol_hh
3 #define __rendercontrol_hh
26 // color tables, meaning, 256 (possibly) different shades of each color,
27 // based on the number of bits there are available for each color in the
29 unsigned char _red_color_table[256];
30 unsigned char _green_color_table[256];
31 unsigned char _blue_color_table[256];
37 int _cpc; // colors-per-channel: must be a value between [2,6]
38 int _bpp; // bits-per-pixel
40 unsigned int *_grad_xbuffer;
41 unsigned int *_grad_ybuffer;
42 unsigned int _grad_buffer_width;
43 unsigned int _grad_buffer_height;
45 unsigned long *_sqrt_table;
47 // These values are all determined based on a visual
49 int _red_bits; // the number of bits (1-255) that each shade of color
50 int _green_bits; // spans across. best case is 1, which gives 255 shades.
52 unsigned char _red_color_table[256];
53 unsigned char _green_color_table[256];
54 unsigned char _blue_color_table[256];
56 // These are only used for TrueColor visuals
57 int _red_offset; // the offset of each color in a color mask
61 // These are only used for !TrueColor visuals
66 RenderControl(int screen
);
68 virtual void reduceDepth(Surface
&sf
, XImage
*im
) const = 0;
70 inline void highlight(pixel32
*x
, pixel32
*y
, bool raised
) const;
71 void verticalGradient(Surface
&sf
, const RenderTexture
&texture
) const;
72 void diagonalGradient(Surface
&sf
, const RenderTexture
&texture
) const;
73 void crossDiagonalGradient(Surface
&sf
, const RenderTexture
&texture
) const;
74 virtual void drawGradientBackground(Surface
&sf
,
75 const RenderTexture
&texture
) const;
76 virtual void drawSolidBackground(Surface
& sf
,
77 const RenderTexture
& texture
) const;
80 virtual ~RenderControl();
82 static RenderControl
*getRenderControl(int screen
);
84 virtual void drawRoot(const RenderColor
&color
) const;
86 //! Draws a background onto a Surface, as specified by a RenderTexture
88 This function will overwrite the entire surface.
90 virtual void drawBackground(Surface
&sf
,
91 const RenderTexture
&texture
) const;
93 //! Draws an image onto the surface
95 This function will overwrite the entire surface.<br>
96 The image must be specified in 32-bit packed ARGB format. The current
97 background will be used for applying the alpha.
99 virtual void drawImage(Surface
&sf
, int w
, int h
,
100 unsigned long *data
) const;
102 //! Draws a string onto a Surface
103 virtual void drawString(Surface
&sf
, const Font
&font
, int x
, int y
,
104 const RenderColor
&color
,
105 const ustring
&string
) const;
107 //! Draws a PixmapMask with a specified color onto a Surface
108 virtual void drawMask(Surface
&sf
, const RenderColor
&color
,
109 const PixmapMask
&mask
) const;
114 #endif // __rendercontrol_hh
This page took 0.038203 seconds and 3 git commands to generate.