Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

/otk/rendercontrol.hh

Go to the documentation of this file.
00001 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
00002 #ifndef __rendercontrol_hh
00003 #define __rendercontrol_hh
00004 
00005 extern "C" {
00006 #include <X11/Xlib.h>
00007 #include <X11/Xutil.h>
00008 }
00009 
00010 namespace otk {
00011 
00012 class ScreenInfo;
00013 class Surface;
00014 class RenderTexture;
00015 class Font;
00016 class RenderColor;
00017 class ustring;
00018 
00019 class RenderControl {
00020 protected:
00021   int _screen;
00022 
00023   /*
00024   // color tables, meaning, 256 (possibly) different shades of each color,
00025   // based on the number of bits there are available for each color in the
00026   // visual
00027   unsigned char _red_color_table[256];
00028   unsigned char _green_color_table[256];
00029   unsigned char _blue_color_table[256];
00030   */
00031 
00032 /*
00033   Bool _dither;
00034 
00035   int _cpc; // colors-per-channel: must be a value between [2,6]
00036   int _bpp; // bits-per-pixel
00037 
00038   unsigned int *_grad_xbuffer;
00039   unsigned int *_grad_ybuffer;
00040   unsigned int _grad_buffer_width;
00041   unsigned int _grad_buffer_height;
00042 
00043   unsigned long *_sqrt_table;
00044 
00045   // These values are all determined based on a visual
00046 
00047   int _red_bits;    // the number of bits (1-255) that each shade of color
00048   int _green_bits;  // spans across. best case is 1, which gives 255 shades.
00049   int _blue_bits;
00050   unsigned char _red_color_table[256];
00051   unsigned char _green_color_table[256];
00052   unsigned char _blue_color_table[256];
00053 
00054   // These are only used for TrueColor visuals
00055   int _red_offset;  // the offset of each color in a color mask
00056   int _green_offset;
00057   int _blue_offset;
00058 
00059   // These are only used for !TrueColor visuals
00060   XColor *_colors;
00061   int _ncolors;
00062 */
00063 
00064   RenderControl(int screen);
00065 
00066   virtual void drawSolidBackground(Surface& sf,
00067                                    const RenderTexture& texture) const;
00068   
00069 public:
00070   virtual ~RenderControl();
00071 
00072   static RenderControl *getRenderControl(int screen);
00073 
00074   virtual void drawRoot(const RenderColor &color) const;
00075   
00076   //! Draws a string onto a Surface
00077   virtual void drawString(Surface &sf, const Font &font, int x, int y,
00078         const RenderColor &color,
00079                           const ustring &string) const;
00080 
00081   //! Draws a background onto a Surface, as specified by a RenderTexture
00082   virtual void drawBackground(Surface &sf,
00083             const RenderTexture &texture) const = 0;
00084 };
00085 
00086 }
00087 
00088 #endif // __rendercontrol_hh

Generated on Tue Feb 4 22:58:56 2003 for Openbox by doxygen1.3-rc2