00001 #ifndef _GSKIN_ENGINE_H_
00002 #define _GSKIN_ENGINE_H_
00003
00004 #include "GList.h"
00005
00006
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
00023 class GSkinState
00024 {
00025 public:
00026 int Size;
00027 GSurface *pScreen;
00028 GDisplayString **Text;
00029 GRect Rect;
00030 bool MouseOver;
00031 int64 Value;
00032 bool Enabled;
00033
00034 GSkinState()
00035 {
00036 Value = 0;
00037 Enabled = true;
00038 Size = sizeof(*this);
00039 pScreen = 0;
00040 Text = 0;
00041 MouseOver = false;
00042 }
00043 };
00044
00045 typedef void (*ProcColumnPaint)(void *UserData, GSurface *pDC, GRect &r, bool FillBackground);
00046
00047
00048 class GSkinEngine
00049 {
00050 public:
00051 virtual ~GSkinEngine() {}
00052
00053
00054
00055
00056
00057
00058
00059
00060 virtual uint32 GetFeatures() { return 0; }
00061
00062
00063
00064 virtual uint32 GetColour(int i) { return 0; }
00065
00066
00067
00068 virtual void OnPaint_GText (GText *Ctrl, GSkinState *State) {};
00069 virtual void OnPaint_GButton (GButton *Ctrl, GSkinState *State) {};
00070 virtual void OnPaint_GEdit (GEdit *Ctrl, GSkinState *State) {};
00071 virtual void OnPaint_GCheckBox (GCheckBox *Ctrl, GSkinState *State) {};
00072 virtual void OnPaint_GRadioGroup (GRadioGroup *Ctrl, GSkinState *State) {};
00073 virtual void OnPaint_GRadioButton (GRadioButton *Ctrl, GSkinState *State) {};
00074 virtual void OnPaint_GTabView (GTabView *Ctrl, GSkinState *State) {};
00075 virtual void OnPaint_GSlider (GSlider *Ctrl, GSkinState *State) {};
00076 virtual void OnPaint_GCombo (GCombo *Ctrl, GSkinState *State) {};
00077 virtual void OnPaint_GBitmap (GBitmap *Ctrl, GSkinState *State) {};
00078 virtual void OnPaint_GProgress (GProgress *Ctrl, GSkinState *State) {};
00079 virtual void OnPaint_GTree (GTree *Ctrl, GSkinState *State) {};
00080 virtual void OnPaint_GList (GList *Ctrl, GSkinState *State) {};
00081
00082
00083
00084
00085 virtual void OnPaint_ListColumn(ProcColumnPaint Callback, void *UserData, GSkinState *State) = 0;
00086
00087
00088 virtual GFont *GetDefaultFont(char *Class) { return SysFont; }
00089
00090
00091 virtual void FillPath(class GPath *Path, GSurface *pDC, bool Down, bool Enabled = true) {}
00092
00093
00094 virtual void DrawBtn(GSurface *pDC, GRect &r, bool Down, bool Enabled, bool Default = false) {}
00095
00097
00099 };
00100
00101 #define LgiSkinEntryPoint "CreateSkinEngine"
00102 typedef GSkinEngine *(*Proc_CreateSkinEngine)(class GApp *App);
00103
00104 #endif