Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

GSkinEngine.h

00001 #ifndef _GSKIN_ENGINE_H_
00002 #define _GSKIN_ENGINE_H_
00003 
00004 #include "GList.h"
00005 
00006 // Feature support flags
00007 #define GSKIN_COLOUR        0x00000001
00008 #define GSKIN_BUTTON        0x00000002
00009 #define GSKIN_EDIT          0x00000004
00010 #define GSKIN_CHECKBOX      0x00000008
00011 #define GSKIN_RADIO         0x00000010
00012 #define GSKIN_GROUP         0x00000020
00013 #define GSKIN_SLIDER        0x00000040
00014 #define GSKIN_COMBO         0x00000080
00015 #define GSKIN_BITMAP        0x00000100
00016 #define GSKIN_PROGRESS      0x00000200
00017 #define GSKIN_TREE          0x00000400
00018 #define GSKIN_LIST          0x00000800
00019 #define GSKIN_LISTCOL       0x00001000
00020 #define GSKIN_TABVIEW       0x00002000
00021 
00022 // Drawing state
00023 class GSkinState
00024 {
00025 public:
00026     int Size;               // Class size, for version checking
00027     GSurface *pScreen;      // Output surface
00028     GDisplayString **Text;  // The display string for the view
00029     bool MouseOver;         // TRUE if the mouse is over the view
00030     GRect Rect;         // Region to paint (if relevant)
00031 
00032     GSkinState()
00033     {
00034         Size = sizeof(*this);
00035         pScreen = 0;
00036         Text = 0;
00037         MouseOver = false;
00038     }
00039 };
00040 
00041 // Engine class
00042 class GSkinEngine
00043 {
00044 public:
00045     virtual ~GSkinEngine() {}
00046 
00047     // Return the features the skin supports. Return the
00048     // bitwise OR of all the features you support (the GSKIN_?? flags)
00049     //
00050     // The class is designed to be extended by adding more virtual functions
00051     // on the bottom and then Lgi queries the class to see if it can call them
00052     // by using the flags returned from this function. At no time should the
00053     // existing functions change order or be removed.
00054     virtual uint32 GetFeatures() { return 0; }  
00055 
00056     // Return the RGB24 for the LC_??? colour index
00057     // Will only be called if you return GSKIN_COLOUR from GetFeatures()
00058     virtual uint32 GetColour(int i) { return 0; }
00059 
00060     // Do painting for the various controls, the relevant GSKIN_??? flag needs to
00061     // be returned from GetFeatures before you can call any of these.
00062     virtual void OnPaint_GText        (GText *Ctrl,        GSkinState *State) {};
00063     virtual void OnPaint_GButton      (GButton *Ctrl,      GSkinState *State) {};
00064     virtual void OnPaint_GEdit        (GEdit *Ctrl,        GSkinState *State) {};
00065     virtual void OnPaint_GCheckBox    (GCheckBox *Ctrl,    GSkinState *State) {};
00066     virtual void OnPaint_GRadioGroup  (GRadioGroup *Ctrl,  GSkinState *State) {};
00067     virtual void OnPaint_GRadioButton (GRadioButton *Ctrl, GSkinState *State) {};
00068     virtual void OnPaint_GTabView     (GTabView *Ctrl,     GSkinState *State) {};
00069     virtual void OnPaint_GSlider      (GSlider *Ctrl,      GSkinState *State) {};
00070     virtual void OnPaint_GCombo       (GCombo *Ctrl,       GSkinState *State) {};
00071     virtual void OnPaint_GBitmap      (GBitmap *Ctrl,      GSkinState *State) {};
00072     virtual void OnPaint_GProgress    (GProgress *Ctrl,    GSkinState *State) {};
00073     virtual void OnPaint_GTree        (GTree *Ctrl,        GSkinState *State) {};
00074     virtual void OnPaint_GList        (GList *Ctrl,        GSkinState *State) {};
00075     
00076     // 'Col' may be NULL in the case that the GList control wants to draw the
00077     // header beyond the last column. This function can use the call back
00078     // GListColumn::OnPaint_Content to draw the text, icon and mark.
00079     virtual void OnPaint_GListColumn(GListColumn *Col, GSkinState *State) {};
00080 
00081     // Get the default font for a control
00082     virtual GFont *GetDefaultFont(char *Class) { return SysFont; }
00083 
00085     // Add new features down here with an associated feature flag defined above. //
00087 };
00088 
00089 #define LgiSkinEntryPoint       "CreateSkinEngine"
00090 typedef GSkinEngine             *(*Proc_CreateSkinEngine)(class GApp *App);
00091 
00092 #endif

Generated on Wed Oct 26 14:46:49 2005 for Lgi by  doxygen 1.4.1