00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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
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
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