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

guimain.h

00001 /***************************************************************************
00002                         guimain.h    -  description
00003                             -------------------
00004     begin                : lun 22 mar 2004
00005     copyright            : (C) 2004-2006 by Duong-Khang NGUYEN
00006     email                : neoneurone @ users sourceforge net
00007 
00008     $Id: guimain.h 43 2006-09-12 21:29:41Z neoneurone $
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *   This program is free software; you can redistribute it and/or modify  *
00014  *   it under the terms of the GNU General Public License as published by  *
00015  *   the Free Software Foundation; either version 2 of the License, or     *
00016  *   any later version.                                                    *
00017  *                                                                         *
00018  ***************************************************************************/
00019 
00020 #if !defined(_OPENCITY_GUIMAIN_H_)
00021 #define _OPENCITY_GUIMAIN_H_ 1
00022 
00023 #include "main.h"
00024 #include "ui.h"
00025 
00026 #include "SDL_image.h"
00027 
00028 // each GUIMain object has the following attributes
00029 #define OC_GUIMAIN_VISIBLE    0x01      
00030 #define OC_GUIMAIN_CLICKED    0x02      
00031 #define OC_GUIMAIN_MOUSEOVER  0x04      
00032 
00033 #define OC_GUIMAIN_BLENDING   0x40      
00034 
00035 
00038 struct Color {
00039     GLubyte r, g, b, a;
00040 };
00041 
00042 
00043 //========================================================================
00046 class GUIMain : public UI {
00047 public:
00051     GUIMain():ubAttribute( 0 ) {
00052     }
00053 
00054     virtual ~GUIMain() {}
00055 
00056     virtual void
00057     Display() const = 0;
00058 
00059 
00060     GUIMain* const
00061     GetContainer() const {
00062         return this->pguicontainer;
00063     }
00064 
00065     void
00066     SetContainer(
00067         GUIMain* const pguicontain ) {
00068         this->pguicontainer = pguicontain;
00069     }
00070 
00071     void
00072     GetLocation(
00073         int & riX,
00074         int & riY ) const {
00075         riX = this->iX;
00076         riY = this->iY;
00077     }
00078 
00079     void
00080     SetLocation(
00081         const int & rciX,
00082         const int & rciY ) {
00083         this->iX = rciX;
00084         this->iY = rciY;
00085     }
00086 
00087     void
00088     Set(
00089         const OC_UBYTE & rcubAttribute ) {
00090         this->ubAttribute |= rcubAttribute;
00091     }
00092 
00093     void
00094     Unset(
00095         const OC_UBYTE & rcubAttribute ) {
00096         this->ubAttribute &= ~rcubAttribute;
00097     }
00098 
00099     const bool
00100     IsSet(
00101         const OC_UBYTE & rcubAttribute ) const {
00102         if ( (this->ubAttribute & rcubAttribute) == rcubAttribute )
00103             return true;
00104         else
00105             return false;
00106     }
00107 
00108 
00109    //========================================================================
00110    //                         STATIC    METHODS
00111    //========================================================================
00112 
00113 
00114 protected:
00115     GUIMain* pguicontainer;     
00116     int  iX, iY;                
00117     uint uiWidth, uiHeight; 
00118     OC_UBYTE ubAttribute;       
00119 
00120 };
00121 
00122 #endif
00123 
00124 
00125 
00126 
00127 
00128 
00129 
00130 
00131 
00132 
00133 
00134 
00135 
00136 
00137 
00138 
00139 
00140 
00141 
00142 
00143 
00144 
00145 
00146 
00147 
00148 
00149 
00150 
00151 
00152 
00153 
00154 

Generated on Sat Nov 11 10:21:10 2006 for OpenCity by  doxygen 1.4.2