CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

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 "csextern.h"
00028  
00029 #include "csskin.h"
00030 #include "csbackgr.h"
00031 
00032 #define CSWS_SKIN_DECLARE_DEFAULT(var)  \
00033   CSWS_SKIN_DECLARE (my##var##Type, csSkin);    \
00034     CSWS_SKIN_SLICE (DefaultScrollBar);         \
00035     CSWS_SKIN_SLICE (DefaultButton);            \
00036     CSWS_SKIN_SLICE (DefaultWindow);            \
00037     CSWS_SKIN_SLICE (DefaultDialog);            \
00038     CSWS_SKIN_SLICE (DefaultTitlebar);          \
00039     CSWS_SKIN_SLICE (DefaultListBox);           \
00040     CSWS_SKIN_SLICE (DefaultListBoxItem);               \
00041   CSWS_SKIN_DECLARE_END var
00042 
00043 class csButton;
00044 class csListBox;
00045 struct iTextureHandle;
00046 
00050 class CS_CSWS_EXPORT csDefaultButtonSkin : public csButtonSkin
00051 {
00052 public:
00054   virtual void Draw (csComponent &iComp);
00055 
00057   virtual void SuggestSize (csButton &This, int &w, int &h);
00058 };
00059 
00063 class CS_CSWS_EXPORT csDefaultWindowSkin : public csWindowSkin
00064 {
00065   // The texture for titlebar buttons
00066   iTextureHandle *ButtonTex;
00067   // Window background
00068   csBackground Back;
00069   // The parent skin object
00070   csSkin *Skin;
00071 
00072 public:
00074   csDefaultWindowSkin () : ButtonTex (0), Skin (0) {}
00075 
00077   virtual void Initialize (csApp *iApp, csSkin *Parent);
00078 
00080   virtual void Deinitialize ();
00081 
00083   virtual void Draw (csComponent &iComp);
00084 
00086   virtual void PlaceGadgets (csWindow &This);
00087 
00089   virtual csButton *CreateButton (csWindow &This, int ButtonID);
00090 
00092   virtual void SetState (csWindow &This, int Which, bool State);
00093 
00095   virtual void SetBorderSize (csWindow &This);
00096 
00097 protected:
00098   void SetButtBitmap (csButton *button, const char *id);
00099 };
00100 
00104 class CS_CSWS_EXPORT csDefaultDialogSkin : public csDialogSkin
00105 {
00106   // The background
00107   csBackground Back;
00108 
00109 public:
00111   virtual void Initialize (csApp *iApp, csSkin *Parent);
00112 
00114   virtual void Deinitialize ();
00115 
00117   virtual void Draw (csComponent &iComp);
00118 
00120   virtual void SetBorderSize (csDialog &This);
00121 };
00122 
00126 class CS_CSWS_EXPORT csDefaultTitlebarSkin : public csTitlebarSkin
00127 {
00128   // The active window titlebar background
00129   csBackground ABack;
00130   // The inactive window titlebar background
00131   csBackground IBack;
00133   bool Hash;
00134 
00135 public:
00137   void Initialize (csApp *iApp, csSkin *Parent);
00138 
00140   virtual void Deinitialize ();
00141 
00143   virtual void Draw (csComponent &iComp);
00144 };
00145 
00149 class CS_CSWS_EXPORT csDefaultListBoxSkin : public csListBoxSkin
00150 {
00151 public:
00153   virtual void Draw (csComponent &iComp);
00154 
00156  virtual void SuggestSize (csListBox &This, int &w, int &h);
00157 };
00158 
00162 class CS_CSWS_EXPORT csDefaultListBoxItemSkin : public csListBoxItemSkin
00163 {
00164 public:
00166   virtual void Draw (csComponent &iComp);
00167 };
00168 
00169 
00173  class CS_CSWS_EXPORT csDefaultScrollBarSkin : public csScrollBarSkin
00174  {
00175  public:
00177    virtual void Draw(csComponent &iComp);
00178  };
00179 
00182 #endif // __CS_SDEFAULT_H__

Generated for Crystal Space by doxygen 1.2.18