csws/sdefault.h
00001 /* 00002 Crystal Space Windowing System: default skin 00003 Copyright (C) 2000 by Andrew Zabolotny <bit@eltech.ru> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with this library; if not, write to the Free 00017 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00018 */ 00019 00020 #ifndef __CS_SDEFAULT_H__ 00021 #define __CS_SDEFAULT_H__ 00022 00027 #include "csskin.h" 00028 #include "csbackgr.h" 00029 00030 #define CSWS_SKIN_DECLARE_DEFAULT(var) \ 00031 CSWS_SKIN_DECLARE (my##var##Type, csSkin); \ 00032 CSWS_SKIN_SLICE (DefaultScrollBar); \ 00033 CSWS_SKIN_SLICE (DefaultButton); \ 00034 CSWS_SKIN_SLICE (DefaultWindow); \ 00035 CSWS_SKIN_SLICE (DefaultDialog); \ 00036 CSWS_SKIN_SLICE (DefaultTitlebar); \ 00037 CSWS_SKIN_SLICE (DefaultListBox); \ 00038 CSWS_SKIN_SLICE (DefaultListBoxItem); \ 00039 CSWS_SKIN_DECLARE_END var 00040 00041 class csButton; 00042 class csListBox; 00043 struct iTextureHandle; 00044 00048 class csDefaultButtonSkin : public csButtonSkin 00049 { 00050 public: 00052 virtual void Draw (csComponent &iComp); 00053 00055 virtual void SuggestSize (csButton &This, int &w, int &h); 00056 }; 00057 00061 class csDefaultWindowSkin : public csWindowSkin 00062 { 00063 // The texture for titlebar buttons 00064 iTextureHandle *ButtonTex; 00065 // Window background 00066 csBackground Back; 00067 // The parent skin object 00068 csSkin *Skin; 00069 00070 public: 00072 csDefaultWindowSkin () : ButtonTex (0), Skin (0) {} 00073 00075 virtual void Initialize (csApp *iApp, csSkin *Parent); 00076 00078 virtual void Deinitialize (); 00079 00081 virtual void Draw (csComponent &iComp); 00082 00084 virtual void PlaceGadgets (csWindow &This); 00085 00087 virtual csButton *CreateButton (csWindow &This, int ButtonID); 00088 00090 virtual void SetState (csWindow &This, int Which, bool State); 00091 00093 virtual void SetBorderSize (csWindow &This); 00094 00095 protected: 00096 void SetButtBitmap (csButton *button, const char *id); 00097 }; 00098 00102 class csDefaultDialogSkin : public csDialogSkin 00103 { 00104 // The background 00105 csBackground Back; 00106 00107 public: 00109 virtual void Initialize (csApp *iApp, csSkin *Parent); 00110 00112 virtual void Deinitialize (); 00113 00115 virtual void Draw (csComponent &iComp); 00116 00118 virtual void SetBorderSize (csDialog &This); 00119 }; 00120 00124 class csDefaultTitlebarSkin : public csTitlebarSkin 00125 { 00126 // The active window titlebar background 00127 csBackground ABack; 00128 // The inactive window titlebar background 00129 csBackground IBack; 00131 bool Hash; 00132 00133 public: 00135 void Initialize (csApp *iApp, csSkin *Parent); 00136 00138 virtual void Deinitialize (); 00139 00141 virtual void Draw (csComponent &iComp); 00142 }; 00143 00147 class csDefaultListBoxSkin : public csListBoxSkin 00148 { 00149 public: 00151 virtual void Draw (csComponent &iComp); 00152 00154 virtual void SuggestSize (csListBox &This, int &w, int &h); 00155 }; 00156 00160 class csDefaultListBoxItemSkin : public csListBoxItemSkin 00161 { 00162 public: 00164 virtual void Draw (csComponent &iComp); 00165 }; 00166 00167 00171 class csDefaultScrollBarSkin : public csScrollBarSkin 00172 { 00173 public: 00175 virtual void Draw(csComponent &iComp); 00176 }; 00177 00180 #endif // __CS_SDEFAULT_H__
Generated for Crystal Space by doxygen 1.2.18