From 1166ec33c10712a7184ce51fa00b0f75286fa0db Mon Sep 17 00:00:00 2001 From: cozman Date: Wed, 11 Jun 2003 00:19:29 +0000 Subject: [PATCH] explicitly use std in STL & ZE in ZEngine areas --- include/GewiEngine.h | 14 +++++++------- include/GewiIncludes.h | 4 +--- include/GewiStaticText.h | 12 ++++++------ include/GewiTextButton.h | 12 ++++++------ include/GewiTextField.h | 10 +++++----- include/GewiWidget.h | 6 +++--- src/GewiEngine.cpp | 14 +++++++------- src/GewiStaticText.cpp | 8 ++++---- src/GewiTextButton.cpp | 8 ++++---- src/GewiTextField.cpp | 6 +++--- src/GewiWidget.cpp | 4 ++-- test/gewiTest00.cpp | 3 ++- 12 files changed, 50 insertions(+), 51 deletions(-) diff --git a/include/GewiEngine.h b/include/GewiEngine.h index c6e54b4..18237e7 100755 --- a/include/GewiEngine.h +++ b/include/GewiEngine.h @@ -13,7 +13,7 @@ \brief Definition file for GewiEngine. Definition file for GewiEngine, core engine for Gewi GUI control. -
$Id: GewiEngine.h,v 1.6 2003/06/10 23:56:09 cozman Exp $
+
$Id: GewiEngine.h,v 1.7 2003/06/11 00:19:40 cozman Exp $
\author James Turk **/ @@ -51,9 +51,9 @@ class GewiEngine //! Singleton static instance of GewiEngine. static GewiEngine *sInstance; //! Vector of pointers to ZImages, used by resource management system. - vector mImageVec; + std::vector mImageVec; //! Vector of pointers to ZFonts, used by resource management system. - vector mFontVec; + std::vector mFontVec; //! List of widgets in global context. WidgetList mWidgetList; @@ -122,7 +122,7 @@ class GewiEngine \param image Image to add to resources. \return ID number of new resource. **/ - ResourceID AddResource(ZImage *image); + ResourceID AddResource(ZE::ZImage *image); /*! \brief Adds a font resource to the private vector. @@ -131,7 +131,7 @@ class GewiEngine \param font Font to add to resources. \return ID number of new resource. **/ - ResourceID AddResource(ZFont *font); + ResourceID AddResource(ZE::ZFont *font); /*! \brief Access an image in the resource vector. @@ -140,7 +140,7 @@ class GewiEngine \param id ID of image to retrieve. \return Pointer to image or NULL if invalid ID for images. **/ - ZImage* Image(ResourceID id); + ZE::ZImage* Image(ResourceID id); /*! \brief Access a font in the resource vector. @@ -149,7 +149,7 @@ class GewiEngine \param id ID of font to retrieve. \return Pointer to font or NULL if invalid ID for fonts. **/ - ZFont* Font(ResourceID id); + ZE::ZFont* Font(ResourceID id); /*! \brief Free all resources. diff --git a/include/GewiIncludes.h b/include/GewiIncludes.h index ad91e1a..c3d09d1 100755 --- a/include/GewiIncludes.h +++ b/include/GewiIncludes.h @@ -20,13 +20,11 @@ #ifndef __gewiincludes_h__ #define __gewiincludes_h__ +#include #include #include #include #include "ZEngine.h" #include "GewiDefines.h" -using namespace std; -using namespace ZE; - #endif //__gewiincludes_h__ \ No newline at end of file diff --git a/include/GewiStaticText.h b/include/GewiStaticText.h index fcd7865..bfa527d 100755 --- a/include/GewiStaticText.h +++ b/include/GewiStaticText.h @@ -13,7 +13,7 @@ \brief Definition file for GStaticText. Definition file for GStaticText, file to hold static text, labels and such. -
$Id: GewiStaticText.h,v 1.4 2003/06/07 05:41:18 cozman Exp $
+
$Id: GewiStaticText.h,v 1.5 2003/06/11 00:19:40 cozman Exp $
\author James Turk **/ @@ -39,9 +39,9 @@ class GStaticText : public GWidget //! Font to use for label. ResourceID rFont; //! Current text of label. - string rText; + std::string rText; //! Text buffer ZImage, used internally. - ZImage rTextBuf; + ZE::ZImage rTextBuf; //! Calculated X Offset for text, calculated from justification. int rXOff; //! Calculated Y Offset for text, calculated from justification. @@ -71,7 +71,7 @@ class GStaticText : public GWidget \param backgroundImg Image for background, defaults to GewiEngine::InvalidID. **/ virtual void Create(float x, float y, float width, float height, - ResourceID font, string text=" ", GewiJustify just=GJ_CENTER, ResourceID backgroundImg=GewiEngine::InvalidID); + ResourceID font, std::string text=" ", GewiJustify just=GJ_CENTER, ResourceID backgroundImg=GewiEngine::InvalidID); /*! \brief Overload of Message, used to recieve messages. @@ -98,7 +98,7 @@ class GStaticText : public GWidget Sets the current text of the label. \param text New text for label. **/ - void SetText(string text); + void SetText(std::string text); /*! \brief Get current text in label. @@ -106,7 +106,7 @@ class GStaticText : public GWidget Return text in label. \return text currently in label. **/ - string GetText(); + std::string GetText(); }; } diff --git a/include/GewiTextButton.h b/include/GewiTextButton.h index 5896c68..701105c 100755 --- a/include/GewiTextButton.h +++ b/include/GewiTextButton.h @@ -13,7 +13,7 @@ \brief Definition file for GTextButton. Definition file for GTextButton, a GButton that has a text label. -
$Id: GewiTextButton.h,v 1.4 2003/06/07 05:41:18 cozman Exp $
+
$Id: GewiTextButton.h,v 1.5 2003/06/11 00:19:40 cozman Exp $
\author James Turk **/ @@ -35,9 +35,9 @@ class GTextButton : public GButton { protected: //! Text label for button. - string rText; + std::string rText; //! Text Buffer, used internally. - ZImage rTextBuf; + ZE::ZImage rTextBuf; //! X offset of text. int rXOff; //! Y offset of text. @@ -69,7 +69,7 @@ class GTextButton : public GButton \param type GButtonType, either the default, GBT_PRESS (normal button), or GBT_HOVER (a button which responds to the hovering mouse). **/ virtual void Create(float x, float y, float width, float height, ResourceID normalImg, ResourceID pressImg, ResourceID font, - string text=" ", GButtonType type=GBT_PRESS); + std::string text=" ", GButtonType type=GBT_PRESS); /*! \brief Draws static label to the screen. @@ -84,7 +84,7 @@ class GTextButton : public GButton Sets the current text of the button. \param text New text for button. **/ - void SetText(string text); + void SetText(std::string text); /*! \brief Get current text of button label. @@ -92,7 +92,7 @@ class GTextButton : public GButton Return text on button label. \return text currently on button label. **/ - string GetText(); + std::string GetText(); }; } diff --git a/include/GewiTextField.h b/include/GewiTextField.h index 4fdc241..0ff0f03 100755 --- a/include/GewiTextField.h +++ b/include/GewiTextField.h @@ -13,7 +13,7 @@ \brief Definition file for GTextField. Definition file for GTextField, text input area widget. -
$Id: GewiTextField.h,v 1.5 2003/06/07 05:41:18 cozman Exp $
+
$Id: GewiTextField.h,v 1.6 2003/06/11 00:19:40 cozman Exp $
\author James Turk **/ @@ -35,9 +35,9 @@ class GTextField : public GWidget { protected: //! Text currently entered. - string rText; + std::string rText; //! Text buffer, used internally. - ZImage rBuffer; + ZE::ZImage rBuffer; //! Font for text. ResourceID rFont; //! Background for text input area. @@ -96,7 +96,7 @@ class GTextField : public GWidget Sets the current text of the buffer for input area. \param text New text for button. **/ - void SetText(string text); + void SetText(std::string text); /*! \brief Get current text of the input box. @@ -104,7 +104,7 @@ class GTextField : public GWidget Return text in the input buffer. \return text currently in input buffer. **/ - string GetText(); + std::string GetText(); }; } diff --git a/include/GewiWidget.h b/include/GewiWidget.h index 6d632b8..fdda420 100755 --- a/include/GewiWidget.h +++ b/include/GewiWidget.h @@ -13,7 +13,7 @@ \brief Definition file for GWidget. Definition file for GWidget, virtual widget base class. -
$Id: GewiWidget.h,v 1.5 2003/06/09 03:28:59 cozman Exp $
+
$Id: GewiWidget.h,v 1.6 2003/06/11 00:19:40 cozman Exp $
\author James Turk **/ @@ -39,9 +39,9 @@ class GWidget //! Pointer to GewiEngine instance. GewiEngine *rGewi; //! Pointer to ZEngine instance. - ZEngine *rZE; + ZE::ZEngine *rZE; //! Rectangle describing area of widget. - ZRect rBoundRect; + ZE::ZRect rBoundRect; //! Pointer to parent container. (NULL means it lays in the global setting). GContainer *rParent; //! Relative X position, relative to parent, or top corner of screen if in global setting. diff --git a/src/GewiEngine.cpp b/src/GewiEngine.cpp index bab918d..6bc1683 100755 --- a/src/GewiEngine.cpp +++ b/src/GewiEngine.cpp @@ -13,7 +13,7 @@ \brief Implementation of GewiEngine. Implementation of GewiEngine, core engine for Gewi GUI control. -
$Id: GewiEngine.cpp,v 1.6 2003/06/10 23:55:59 cozman Exp $
+
$Id: GewiEngine.cpp,v 1.7 2003/06/11 00:19:29 cozman Exp $
\author James Turk **/ @@ -33,7 +33,7 @@ GewiEngine::GewiEngine() //check version of ZEngine if(ZE::ZEngine::Version < GewiEngine::MinZEVersion) - ze->WriteLog(FormatStr("Gewi %s requires ZEngine %s or greater, ZEngine %s in use.", + ze->WriteLog(ZE::FormatStr("Gewi %s requires ZEngine %s or greater, ZEngine %s in use.", GewiEngine::Version.GetString().c_str(), GewiEngine::MinZEVersion.GetString().c_str(), ZE::ZEngine::Version.GetString().c_str())); @@ -61,7 +61,7 @@ void GewiEngine::ReleaseInstance() //set everything back to default SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_INTERVAL,SDL_DEFAULT_REPEAT_INTERVAL); SDL_EnableUNICODE(0); - ZEngine::GetInstance()->SetEventFilter(NULL); + ZE::ZEngine::GetInstance()->SetEventFilter(NULL); } } @@ -122,19 +122,19 @@ void GewiEngine::Display() mWidgetList.ShowWidgets(); } -ResourceID GewiEngine::AddResource(ZImage *image) +ResourceID GewiEngine::AddResource(ZE::ZImage *image) { mImageVec.push_back(image); return static_cast(mImageVec.size()-1); } -ResourceID GewiEngine::AddResource(ZFont *font) +ResourceID GewiEngine::AddResource(ZE::ZFont *font) { mFontVec.push_back(font); return static_cast(mFontVec.size()-1); } -ZImage* GewiEngine::Image(ResourceID id) +ZE::ZImage* GewiEngine::Image(ResourceID id) { //do range checking if(id >= 0 && id < mImageVec.size()) @@ -143,7 +143,7 @@ ZImage* GewiEngine::Image(ResourceID id) return NULL; } -ZFont* GewiEngine::Font(ResourceID id) +ZE::ZFont* GewiEngine::Font(ResourceID id) { //do range checking if(id >= 0 && id < mFontVec.size()) diff --git a/src/GewiStaticText.cpp b/src/GewiStaticText.cpp index 8520018..a1188ab 100755 --- a/src/GewiStaticText.cpp +++ b/src/GewiStaticText.cpp @@ -13,7 +13,7 @@ \brief Implementation of GStaticText. Implementation of GStaticText, file to hold static text, labels and such. -
$Id: GewiStaticText.cpp,v 1.4 2003/06/07 05:42:33 cozman Exp $
+
$Id: GewiStaticText.cpp,v 1.5 2003/06/11 00:19:29 cozman Exp $
\author James Turk **/ @@ -34,7 +34,7 @@ GStaticText::GStaticText(GContainer *parent) : void GStaticText::Create(float x, float y, float width, float height, - ResourceID font, string text, GewiJustify justify, ResourceID backgroundImg) + ResourceID font, std::string text, GewiJustify justify, ResourceID backgroundImg) { GWidget::Create(x,y,width,height); @@ -61,7 +61,7 @@ void GStaticText::Show() } -void GStaticText::SetText(string text) +void GStaticText::SetText(std::string text) { int w,h; @@ -94,7 +94,7 @@ void GStaticText::SetText(string text) } } -string GStaticText::GetText() +std::string GStaticText::GetText() { return rText; } diff --git a/src/GewiTextButton.cpp b/src/GewiTextButton.cpp index d8b2f5d..06284ea 100755 --- a/src/GewiTextButton.cpp +++ b/src/GewiTextButton.cpp @@ -13,7 +13,7 @@ \brief Implementation of GTextButton. Implementation of GTextButton, a GButton that has a text label. -
$Id: GewiTextButton.cpp,v 1.3 2003/05/20 00:08:55 cozman Exp $
+
$Id: GewiTextButton.cpp,v 1.4 2003/06/11 00:19:29 cozman Exp $
\author James Turk **/ @@ -31,7 +31,7 @@ GTextButton::GTextButton(GContainer *parent) : void GTextButton::Create(float x, float y, float width, float height, ResourceID normalImg, ResourceID pressImg, ResourceID font, - string text, GButtonType type) + std::string text, GButtonType type) { GButton::Create(x,y,width,height,normalImg,pressImg,type); rFont = font; @@ -49,7 +49,7 @@ void GTextButton::Show() rTextBuf.Draw(rBoundRect.X()+rXOff,rBoundRect.Y()+rYOff); //draw text shifted by offset } -void GTextButton::SetText(string text) +void GTextButton::SetText(std::string text) { rText = text; rGewi->Font(rFont)->DrawText(rText,rTextBuf); @@ -58,7 +58,7 @@ void GTextButton::SetText(string text) rYOff = static_cast(rBoundRect.Height()-rTextBuf.Height())/2; } -string GTextButton::GetText() +std::string GTextButton::GetText() { return rText; } diff --git a/src/GewiTextField.cpp b/src/GewiTextField.cpp index 03877b9..9cf3499 100755 --- a/src/GewiTextField.cpp +++ b/src/GewiTextField.cpp @@ -13,7 +13,7 @@ \brief Implementation of GTextField. Implementation of GTextField, text input area widget. -
$Id: GewiTextField.cpp,v 1.4 2003/06/07 05:42:33 cozman Exp $
+
$Id: GewiTextField.cpp,v 1.5 2003/06/11 00:19:29 cozman Exp $
\author James Turk **/ @@ -61,13 +61,13 @@ void GTextField::Show() rBuffer.Draw(rLeftPadding+rBoundRect.X(),rBoundRect.Y()+(rBoundRect.Height()-rBuffer.Height())/2); } -void GTextField::SetText(string text) +void GTextField::SetText(std::string text) { rText = text; rGewi->Font(rFont)->DrawText(rText,rBuffer); } -string GTextField::GetText() +std::string GTextField::GetText() { return rText; } diff --git a/src/GewiWidget.cpp b/src/GewiWidget.cpp index e0fe398..1c4a96f 100755 --- a/src/GewiWidget.cpp +++ b/src/GewiWidget.cpp @@ -13,7 +13,7 @@ \brief Implementation of GWidget. Implementation of GWidget, virtual widget base class. -
$Id: GewiWidget.cpp,v 1.5 2003/06/09 03:28:43 cozman Exp $
+
$Id: GewiWidget.cpp,v 1.6 2003/06/11 00:19:29 cozman Exp $
\author James Turk **/ @@ -34,7 +34,7 @@ void GWidget::FitParent() //adjust to relative pos + parent pos GWidget::GWidget(GContainer *parent) : rGewi(GewiEngine::GetInstance()), - rZE(ZEngine::GetInstance()), + rZE(ZE::ZEngine::GetInstance()), rParent(parent), rRelX(0), rRelY(0), diff --git a/test/gewiTest00.cpp b/test/gewiTest00.cpp index 78b9a57..43e3f85 100755 --- a/test/gewiTest00.cpp +++ b/test/gewiTest00.cpp @@ -10,6 +10,7 @@ #include "ZEngine.h" #include "Gewi.h" +#include using namespace ZE; using namespace Gewi; @@ -20,7 +21,7 @@ void Init() ZConfigFile cfg("gewiTest.zcf"); int w,h,bpp; bool fs; - string title; + std::string title; w = cfg.GetInt("screen","width",800); h = cfg.GetInt("screen","height",600);