00001 /************************************************************************/ 00002 /* Ex Nihlo Engine by Hermanns Christophe */ 00003 /************************************************************************/ 00004 /* This program is free software; you can redistribute it and/or */ 00005 /* modify it under the terms of the GNU General Public License */ 00006 /* as published by the Free Software Foundation; either version 2 */ 00007 /* of the License, or (at your option) any later version. */ 00008 /* */ 00009 /* This program is distributed in the hope that it will be useful, */ 00010 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 00011 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ 00012 /* */ 00013 /* See the GNU General Public License for more details. */ 00014 /* */ 00015 /* You should have received a copy of the GNU General Public License */ 00016 /* along with this program; if not, write to the Free Software */ 00017 /* Foundation, Inc., 59 Temple Place - Suite 330, */ 00018 /* Boston, MA 02111-1307, USA. */ 00019 /* */ 00020 /* If you use a important part of this code please send me a mail */ 00021 /* I just want to see where my code go thks :) */ 00022 /************************************************************************/ 00023 00024 /************************************************************************/ 00025 /* Contact */ 00026 /************************************************************************/ 00027 /* ExNihilo Website :www.ploksoftware.org */ 00028 /* */ 00029 /* Hermanns Christophe ExNihilo creator and main programmer */ 00030 /* */ 00031 /* Mail : Data@ploksoftware.org */ 00032 /* ICQ : 8030901 */ 00033 /* MSN Messenger : Data_7@hotmail.com */ 00034 /* */ 00035 /* */ 00036 /************************************************************************/ 00037 00038 /************************************************************************/ 00039 /* File Description */ 00040 /************************************************************************/ 00041 /* File Name :ExCWindowObject.h */ 00042 /* */ 00043 /* Star Date :03/14/2003 */ 00044 /* */ 00045 /* Last Update :06/20/2003 */ 00046 /* */ 00047 /* File Description : */ 00048 /* */ 00049 /* For update of this file check : www.ploksoftware.org */ 00050 /************************************************************************/ 00051 00052 #ifndef __ExCWindowObject_H__ 00053 #define __ExCWindowObject_H__ 00054 //------------------------------------------------------------------------ 00055 //Includes 00056 //------------------------------------------------------------------------ 00057 #include "ExDefine.h" 00058 //------------------------------------------------------------------------ 00059 #include "Math/ExMath.h" 00060 //------------------------------------------------------------------------ 00061 #include "Object/Object2D/ExCObject2D.h" 00062 //------------------------------------------------------------------------ 00063 #include "Manager/ManagerObject/ExManagerTexture.h" 00064 //------------------------------------------------------------------------ 00065 #include "Manager/ExManagerWindow.h" 00066 //------------------------------------------------------------------------ 00067 class ExCWindowObject :public ExCObject2D 00068 { 00069 //------------------------------------------------------------------------ 00070 // Variable 00071 //------------------------------------------------------------------------ 00072 protected: 00073 ExManagerTexture *ManagerTexture; 00074 ExManagerWindow *ManagerWindow; 00075 00076 ExCWindowObject *m_Parent; 00077 00078 ExCVec2D m_OldMousePosition; 00079 00080 //Title 00081 bool m_ShowWindowTitle; 00082 std::string m_WindowTitle; 00083 std::string m_WindowOldTitle; 00084 ExCVec3D m_WindowTitleColor; 00085 //Size and position 00086 ExCVec2D m_WindowSize; 00087 ExCVec2D m_OldSize; 00088 ExCVec2D m_OldPosition; 00089 //Color and blending 00090 bool m_Blending; 00091 ExCVec3D m_BackroundColor; 00092 float m_BackroundBlending; 00093 //Border 00094 ExCVec3D m_BorderColor; 00095 float m_BorderSize; 00096 bool m_ShowBorder; 00097 //Texturing 00098 bool m_BackroundIsTexturing1; 00099 std::string m_BackroundTexture1; 00100 bool m_BackroundIsTexturing2; 00101 std::string m_BackroundTexture2; 00102 bool m_TextureIsMouving; 00103 ExCVec2D m_TextureMouvingVec; 00104 00105 public: 00106 //------------------------------------------------------------------------ 00107 // Constructor // Destructor 00108 //------------------------------------------------------------------------ 00109 ExCWindowObject(void); 00110 ExCWindowObject(ExCVec2D Size); 00111 //inline ExCWindowObject(float x,float y){ExCWindowObject(ExCVec2D(x,y));}; 00112 ExCWindowObject(ExCVec2D Size,ExCVec2D Position); 00113 /*inline ExCWindowObject(float x,float y,float xp,float yp) 00114 {ExCWindowObject(ExCVec2D(x,y),ExCVec2D(xp,yp));};*/ 00115 ExCWindowObject(ExCVec2D Size,ExCVec2D Position,std::string Title); 00116 /*inline ExCWindowObject(float x,float y,float xp,float yp,std::string Title) 00117 {ExCWindowObject(ExCVec2D(x,y),ExCVec2D(xp,yp),Title);}*/ 00118 ~ExCWindowObject(void); 00119 //------------------------------------------------------------------------ 00120 // Methode 00121 //------------------------------------------------------------------------ 00122 void SetPosition(ExCVec2D Position); 00123 void SetManagerTexture(ExManagerTexture * Texture); 00124 inline void SetManagerWindow(ExManagerWindow *Window){ManagerWindow = Window;} 00125 00126 inline void SetParrent(ExCWindowObject *Parent){m_Parent=Parent;} 00127 inline ExCWindowObject* GetParrent(void){return m_Parent;} 00128 00129 void Init(void); 00130 virtual void Draw(void); 00131 virtual ExCAction InputAction(ExCAction Action); 00132 virtual ExCAction InputCommand(ExCCommand Command); 00133 00134 //Title 00135 inline void ShowWindowTitle(bool state){m_ShowWindowTitle=state;} 00136 inline bool IsShowWindowTitle(void){return m_ShowWindowTitle;} 00137 inline void SetWindowTitle(std::string Title){m_WindowTitle=Title;} 00138 inline std::string GetWindowTitle(void){return m_WindowTitle;} 00139 inline void SetWindowOldTitle(std::string Title){m_WindowOldTitle=Title;} 00140 inline std::string GetWindowOldTitle(void){return m_WindowOldTitle;} 00141 inline void SetWindowTitleColor(ExCVec3D Color){m_WindowTitleColor=Color;} 00142 inline ExCVec3D GetWindowTitleColor(void){return m_WindowTitleColor;} 00143 00144 //Position and size 00145 inline void SetWindowSize(ExCVec2D vec){m_WindowSize=vec;} 00146 inline ExCVec2D GetWindowSize(void){return m_WindowSize;} 00147 inline void SetOldWindowSize(ExCVec2D vec){m_OldSize=vec;} 00148 inline ExCVec2D GetOldWindowSize(void){return m_OldSize;} 00149 inline void SetOldPosition(ExCVec2D vec){m_OldPosition=vec;} 00150 inline ExCVec2D GetOldPosition(void){return m_OldPosition;} 00151 00152 //Check location 00153 bool PointInWindow(ExCVec2D point); 00154 //Texturing 00155 inline bool IsBackroundTexturing1(void){return m_BackroundIsTexturing1;} 00156 inline void SetBackroundTexturing1(bool status,std::string texture){m_BackroundIsTexturing1=status;m_BackroundTexture1=texture;} 00157 inline std::string GetBackroundTexture1(void){return m_BackroundTexture1;} 00158 inline bool IsBackroundTexturing2(void){return m_BackroundIsTexturing2;} 00159 inline void SetBackroundTexturing2(bool status,std::string texture){m_BackroundIsTexturing2=status;m_BackroundTexture2=texture;} 00160 inline std::string GetBackroundTexture2(void){return m_BackroundTexture2;} 00161 inline bool IsTextureIsMouving(void){return m_TextureIsMouving;} 00162 inline void SetTextureIsMouving(bool state){m_TextureIsMouving=state;} 00163 inline void SetTextureMouvingVec(ExCVec2D vec){m_TextureMouvingVec=vec;} 00164 inline ExCVec2D GetTextureMouvingVec(void ){return m_TextureMouvingVec;} 00165 //Color and blending 00166 inline bool IsBackroundBlending(void){return m_Blending;} 00167 inline float GetBackroundBlending(void){return m_BackroundBlending;} 00168 inline void SetBackroundBlending(bool state){m_Blending=state;} 00169 inline void SetBackroundBlending(bool state,float value){m_Blending=state;m_BackroundBlending=value;} 00170 inline void SetBackroundColor(ExCVec3D Color){m_BackroundColor=Color;} 00171 inline ExCVec3D GetBackroundColor(void){return m_BackroundColor;} 00172 //Border Size en color 00173 inline void SetBorderSize(float value){m_BorderSize=value;} 00174 inline float GetBorderSize(void){return m_BorderSize;} 00175 inline void SetBorderColor(ExCVec3D Color){m_BorderColor=Color;} 00176 inline ExCVec3D GetBorderColor(void){return m_BorderColor;} 00177 inline bool GetShowBorder(void){return m_ShowBorder;} 00178 inline void SetShowBorder(bool status){m_ShowBorder=status;} 00179 00180 //Load 00181 void Load(std::ifstream *file); 00182 std::string Load(std::string FileName); 00183 00184 }; 00185 //------------------------------------------------------------------------ 00186 #endif //__ExCWindowObject_H__