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 horizontalGradient(Surface &sf, const RenderTexture &texture) const;
32 void diagonalGradient(Surface &sf, const RenderTexture &texture) const;
33 void crossDiagonalGradient(Surface &sf, const RenderTexture &texture) const;
34 virtual void drawGradientBackground(Surface &sf,
35 const RenderTexture &texture) const;
36 virtual void drawSolidBackground(Surface& sf,
37 const RenderTexture& texture) const;
39 //! Reduces a Surface's Surface::pixelData so that it will display correctly
40 //! on the screen's depth
42 This function allocates and sets the im->data member. The allocated memory
43 will be freed when XDetroyImage is called on the XImage.
45 virtual void reduceDepth(Surface &sf, XImage *im) const = 0;
48 virtual ~RenderControl();
50 static RenderControl *createRenderControl(int screen);
52 //! Draws a background onto a Surface, as specified by a RenderTexture
54 This function will overwrite the entire surface.
56 virtual void drawBackground(Surface &sf,
57 const RenderTexture &texture) const;
59 //! Draws an image onto the surface
61 This function will overwrite the entire surface.<br>
62 The image must be specified in 32-bit packed ARGB format. The current
63 background will be used for applying the alpha.
65 virtual void drawImage(Surface &sf, int w, int h,
66 unsigned long *data) const;
68 //! Draws an image onto the surface
69 virtual void drawImage(Surface &sf, Pixmap pixmap, Pixmap mask) const;
71 //! Draws a string onto a Surface
72 virtual void drawString(Surface &sf, const Font &font, int x, int y,
73 const RenderColor &color,
74 const ustring &string) const;
76 //! Draws a PixmapMask with a specified color onto a Surface
77 virtual void drawMask(Surface &sf, const RenderColor &color,
78 const PixmapMask &mask) const;
80 virtual void allocateColor(XColor *color) const = 0;
85 #endif // __rendercontrol_hh