1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 #ifndef __rendercontrol_hh
3 #define __rendercontrol_hh
27 RenderControl(int screen);
29 inline void highlight(pixel32 *x, pixel32 *y, bool raised) const;
30 void verticalGradient(Surface &sf, const RenderTexture &texture) const;
31 void diagonalGradient(Surface &sf, const RenderTexture &texture) const;
32 void crossDiagonalGradient(Surface &sf, const RenderTexture &texture) const;
33 virtual void drawGradientBackground(Surface &sf,
34 const RenderTexture &texture) const;
35 virtual void drawSolidBackground(Surface& sf,
36 const RenderTexture& texture) const;
38 //! Reduces a Surface's Surface::pixelData so that it will display correctly
39 //! on the screen's depth
41 This function allocates and sets the im->data member. The allocated memory
42 will be freed when XDetroyImage is called on the XImage.
44 virtual void reduceDepth(Surface &sf, XImage *im) const = 0;
47 virtual ~RenderControl();
49 static RenderControl *getRenderControl(int screen);
51 //! Draws a background onto a Surface, as specified by a RenderTexture
53 This function will overwrite the entire surface.
55 virtual void drawBackground(Surface &sf,
56 const RenderTexture &texture) const;
58 //! Draws an image onto the surface
60 This function will overwrite the entire surface.<br>
61 The image must be specified in 32-bit packed ARGB format. The current
62 background will be used for applying the alpha.
64 virtual void drawImage(Surface &sf, int w, int h,
65 unsigned long *data) const;
67 //! Draws an image onto the surface
68 virtual void drawImage(Surface &sf, Pixmap pixmap, Pixmap mask) const;
70 //! Draws a string onto a Surface
71 virtual void drawString(Surface &sf, const Font &font, int x, int y,
72 const RenderColor &color,
73 const ustring &string) const;
75 //! Draws a PixmapMask with a specified color onto a Surface
76 virtual void drawMask(Surface &sf, const RenderColor &color,
77 const PixmapMask &mask) const;
79 virtual void allocateColor(XColor *color) const = 0;
84 #endif // __rendercontrol_hh