Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

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 __SDEFAULT_H__
00021 #define __SDEFAULT_H__
00022 
00023 #include "csskin.h"
00024 #include "csbackgr.h"
00025 
00026 #define CSWS_SKIN_DECLARE_DEFAULT(var)  \
00027   CSWS_SKIN_DECLARE (my##var##Type, csSkin);    \
00028     CSWS_SKIN_SLICE (DefaultScrollBar);         \
00029     CSWS_SKIN_SLICE (DefaultButton);            \
00030     CSWS_SKIN_SLICE (DefaultWindow);            \
00031     CSWS_SKIN_SLICE (DefaultDialog);            \
00032     CSWS_SKIN_SLICE (DefaultTitlebar);          \
00033     CSWS_SKIN_SLICE (DefaultListBox);           \
00034     CSWS_SKIN_SLICE (DefaultListBoxItem);               \
00035   CSWS_SKIN_DECLARE_END var
00036 
00037 class csButton;
00038 class csListBox;
00039 struct iTextureHandle;
00040 
00044 class csDefaultButtonSkin : public csButtonSkin
00045 {
00046 public:
00048   virtual void Draw (csComponent &iComp);
00049 
00051   virtual void SuggestSize (csButton &This, int &w, int &h);
00052 };
00053 
00057 class csDefaultWindowSkin : public csWindowSkin
00058 {
00059   // The texture for titlebar buttons
00060   iTextureHandle *ButtonTex;
00061   // Window background
00062   csBackground Back;
00063   // The parent skin object
00064   csSkin *Skin;
00065 
00066 public:
00068   csDefaultWindowSkin () : ButtonTex (NULL), Skin (NULL) {}
00069 
00071   virtual void Initialize (csApp *iApp, csSkin *Parent);
00072 
00074   virtual void Deinitialize ();
00075 
00077   virtual void Draw (csComponent &iComp);
00078 
00080   virtual void PlaceGadgets (csWindow &This);
00081 
00083   virtual csButton *CreateButton (csWindow &This, int ButtonID);
00084 
00086   virtual void SetState (csWindow &This, int Which, bool State);
00087 
00089   virtual void SetBorderSize (csWindow &This);
00090 
00091 protected:
00092   void SetButtBitmap (csButton *button, const char *id);
00093 };
00094 
00098 class csDefaultDialogSkin : public csDialogSkin
00099 {
00100   // The background
00101   csBackground Back;
00102 
00103 public:
00105   virtual void Initialize (csApp *iApp, csSkin *Parent);
00106 
00108   virtual void Deinitialize ();
00109 
00111   virtual void Draw (csComponent &iComp);
00112 
00114   virtual void SetBorderSize (csDialog &This);
00115 };
00116 
00120 class csDefaultTitlebarSkin : public csTitlebarSkin
00121 {
00122   // The active window titlebar background
00123   csBackground ABack;
00124   // The inactive window titlebar background
00125   csBackground IBack;
00127   bool Hash;
00128 
00129 public:
00131   void Initialize (csApp *iApp, csSkin *Parent);
00132 
00134   virtual void Deinitialize ();
00135 
00137   virtual void Draw (csComponent &iComp);
00138 };
00139 
00143 class csDefaultListBoxSkin : public csListBoxSkin
00144 {
00145 public:
00147   virtual void Draw (csComponent &iComp);
00148 
00150  virtual void SuggestSize (csListBox &This, int &w, int &h);
00151 };
00152 
00156 class csDefaultListBoxItemSkin : public csListBoxItemSkin
00157 {
00158 public:
00160   virtual void Draw (csComponent &iComp);
00161 };
00162 
00163 
00167  class csDefaultScrollBarSkin : public csScrollBarSkin
00168  {
00169  public:
00171    virtual void Draw(csComponent &iComp);
00172  };
00173 
00174 
00175 #endif // __SDEFAULT_H__

Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000