Thread: [Saggui-svn] SF.net SVN: saggui: [453] trunk (Page 9)
Status: Beta
Brought to you by:
juvinious
From: <sag...@li...> - 2007-07-28 19:42:25
|
Revision: 453 http://saggui.svn.sourceforge.net/saggui/?rev=453&view=rev Author: juvinious Date: 2007-07-28 12:42:23 -0700 (Sat, 28 Jul 2007) Log Message: ----------- Added deprecated macro. Deprecated button so that pushButton can be used instead. Fixed PALib compilation problems and updated to latest PALib. Modified Paths: -------------- trunk/CHANGELOG trunk/examples/demo/src/allegro.cpp trunk/examples/demo/src/allegrogl.cpp trunk/examples/demo/src/openlayer.cpp trunk/examples/demo/src/sdl.cpp trunk/examples/demo/src/sdlgl.cpp trunk/examples/gamedemo/include/gamedemo.h trunk/examples/gamedemo/src/gamedemo.cpp trunk/examples/widgets/include/widgets.h trunk/examples/widgets/src/widgets.cpp trunk/include/saggui/dllspec.h trunk/include/saggui/widgets/button.h trunk/include/saggui/widgets/listbox.h trunk/include/saggui/widgets/scroll_bar.h trunk/modules/palib/include/saggui/pa_gfx.h trunk/modules/palib/include/saggui/pa_mouse.h trunk/modules/palib/include/saggui/saggui.h trunk/modules/palib/saggui/pa_gfx.cpp trunk/modules/palib/saggui/pa_keyinput.cpp trunk/modules/palib/saggui/pa_mouse.cpp trunk/modules/palib/source/main.cpp trunk/src/widgets/listbox.cpp trunk/src/widgets/scroll_bar.cpp Modified: trunk/CHANGELOG =================================================================== --- trunk/CHANGELOG 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/CHANGELOG 2007-07-28 19:42:23 UTC (rev 453) @@ -1,4 +1,8 @@ -0.46 +0.48 +- Fixed compilation issues with PALib, updated to the most recent version of PALib as of 07/28/07 +- Moved all dependent widgets and examples from button to pushButton +- Deprecated button so that pushButton can be used in its place +- Added deprecated macro to dllspec to facilitate deprecation - Implemented a new push button which will eventually replace the current button implementation - Made additional fixes for abstractButton Modified: trunk/examples/demo/src/allegro.cpp =================================================================== --- trunk/examples/demo/src/allegro.cpp 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/examples/demo/src/allegro.cpp 2007-07-28 19:42:23 UTC (rev 453) @@ -183,7 +183,7 @@ //tBox.setWordWrap(false); // Button tester - button myButton; + pushButton myButton; myButton.setText("Press me!"); myButton.position.setPosition(400,400); Modified: trunk/examples/demo/src/allegrogl.cpp =================================================================== --- trunk/examples/demo/src/allegrogl.cpp 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/examples/demo/src/allegrogl.cpp 2007-07-28 19:42:23 UTC (rev 453) @@ -180,7 +180,7 @@ //tBox.setWordWrap(false); // Button tester - button myButton; + pushButton myButton; myButton.setText("Press me!"); myButton.position.setPosition(400,400); Modified: trunk/examples/demo/src/openlayer.cpp =================================================================== --- trunk/examples/demo/src/openlayer.cpp 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/examples/demo/src/openlayer.cpp 2007-07-28 19:42:23 UTC (rev 453) @@ -180,7 +180,7 @@ //tBox.setWordWrap(false); // Button tester - button myButton; + pushButton myButton; myButton.setText("Press me!"); myButton.position.setPosition(400,400); Modified: trunk/examples/demo/src/sdl.cpp =================================================================== --- trunk/examples/demo/src/sdl.cpp 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/examples/demo/src/sdl.cpp 2007-07-28 19:42:23 UTC (rev 453) @@ -179,7 +179,7 @@ //tBox.setWordWrap(false); // Button tester - button myButton; + pushButton myButton; myButton.setText("Press me!"); myButton.position.setPosition(400,400); Modified: trunk/examples/demo/src/sdlgl.cpp =================================================================== --- trunk/examples/demo/src/sdlgl.cpp 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/examples/demo/src/sdlgl.cpp 2007-07-28 19:42:23 UTC (rev 453) @@ -248,7 +248,7 @@ //tBox.setWordWrap(false); // Button tester - button myButton; + pushButton myButton; myButton.setText("Press me!"); myButton.position.setPosition(400,400); Modified: trunk/examples/gamedemo/include/gamedemo.h =================================================================== --- trunk/examples/gamedemo/include/gamedemo.h 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/examples/gamedemo/include/gamedemo.h 2007-07-28 19:42:23 UTC (rev 453) @@ -85,8 +85,8 @@ void toggleScreen2(const coord &c); box menu; - button opt1; - button opt2; + pushButton opt1; + pushButton opt2; checkBox check1; label checkLabel; }; @@ -143,7 +143,7 @@ public: icon(window *parent, graphic *bmp, double x, double y, double width=32, double height=32); ~icon(); - button b1; + pushButton b1; label text; blankDecor dec; }; Modified: trunk/examples/gamedemo/src/gamedemo.cpp =================================================================== --- trunk/examples/gamedemo/src/gamedemo.cpp 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/examples/gamedemo/src/gamedemo.cpp 2007-07-28 19:42:23 UTC (rev 453) @@ -307,7 +307,7 @@ icon::icon(window *parent, graphic *bmp, double x, double y, double width, double height) { parent->addChild(&b1); - b1.setBitmap(bmp); + b1.setIcon(bmp); b1.position.set(x,y,width,height); b1.onHover.connect(this,&icon::showText); b1.onHoverOut.connect(this,&icon::hideText); Modified: trunk/examples/widgets/include/widgets.h =================================================================== --- trunk/examples/widgets/include/widgets.h 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/examples/widgets/include/widgets.h 2007-07-28 19:42:23 UTC (rev 453) @@ -67,9 +67,7 @@ void onEnter(const keys &k); - void onButton1(); - - void onButton2(const coord &pos); + void onButton1(const coord &pos); }; #endif /* WIDGETS_H */ Modified: trunk/examples/widgets/src/widgets.cpp =================================================================== --- trunk/examples/widgets/src/widgets.cpp 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/examples/widgets/src/widgets.cpp 2007-07-28 19:42:23 UTC (rev 453) @@ -138,10 +138,8 @@ static inputBox *input1 = 0; -static button *pushButton1 = 0; +static pushButton *pushButton1 = 0; -static pushButton *pushButton2 = 0; - static textBox *textArea = 0; static listBox *lb = 0; @@ -201,17 +199,11 @@ input1->setHorizontalAlign(inputBox::T_Left); input1->setText("Input text"); - pushButton1 = new button(); + pushButton1 = new pushButton(); pushButton1->position.setPosition(140,220); pushButton1->setText("Clear text!"); - pushButton1->onButtonClick.connect(container,&widgetContainer::onButton1); + pushButton1->clicked.connect(container,&widgetContainer::onButton1); - pushButton2 = new pushButton(); - pushButton2->position.setPosition(240,220); - //pushButton2->setIcon(logo); - pushButton2->setText("Clear text!"); - pushButton2->clicked.connect(container,&widgetContainer::onButton2); - cb1 = new checkBox(); cb1->position.set(10,340,resourceManager::getFont()->getWidth()+4,resourceManager::getFont()->getWidth()+4); cb1->onEnable.connect(container,&widgetContainer::fullscreen); @@ -241,7 +233,6 @@ mainBox->addChild(text2); mainBox->addChild(input1); mainBox->addChild(pushButton1); - mainBox->addChild(pushButton2); mainBox->addChild(cb1); mainBox->addChild(text3); mainBox->addChild(lb); @@ -264,7 +255,6 @@ delete text2; delete input1; delete pushButton1; - delete pushButton2; delete cb1; delete text3; @@ -312,15 +302,10 @@ } } -void widgetContainer::onButton1() +void widgetContainer::onButton1(const coord &pos) { textArea->clearText(); } -void widgetContainer::onButton2(const coord &pos) -{ - textArea->clearText(); -} - #endif /* WIDGETS_CPP */ Modified: trunk/include/saggui/dllspec.h =================================================================== --- trunk/include/saggui/dllspec.h 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/include/saggui/dllspec.h 2007-07-28 19:42:23 UTC (rev 453) @@ -42,12 +42,15 @@ #if defined (_WIN32) && defined (SAGGUI_LIB_BUILD) && defined (SAGGUI_SHARED) #define SAGGUI_EXPORT __declspec(dllexport) #define SAGGUI_EXT_EXPORT __declspec(dllexport) +#define SAGGUI_EXPORT_METHOD dllexport #elif defined (_WIN32) && defined (SAGGUI_SHARED) #define SAGGUI_EXPORT __declspec(dllimport) #define SAGGUI_EXT_EXPORT __declspec(dllimport) +#define SAGGUI_EXPORT_METHOD dllexport #else #define SAGGUI_EXPORT #define SAGGUI_EXT_EXPORT +#define SAGGUI_EXPORT_METHOD #endif #ifdef _MSC_VER @@ -56,4 +59,11 @@ #endif #endif +#ifdef __GNUC__ +//#define SAGGUI_DEPRECATED __attribute__((deprecated, SAGGUI_EXPORT_METHOD)) +#define SAGGUI_DEPRECATED __attribute__ ((deprecated)) +#else +#define SAGGUI_DEPRECATED #endif + +#endif Modified: trunk/include/saggui/widgets/button.h =================================================================== --- trunk/include/saggui/widgets/button.h 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/include/saggui/widgets/button.h 2007-07-28 19:42:23 UTC (rev 453) @@ -54,6 +54,9 @@ * It can just be used to show off your clicks, make your interfaces neater. \n * Just connect events to it, slap a graphic on it and/or add some text.\n * It will autoresize if the text is larger than the width and height of the widget. \n + * + * + * \note This function has been deprecated please take a look at pushButton */ class SAGGUI_EXPORT button : public window, public mouseEvents, public keyEvents @@ -96,7 +99,7 @@ void setClickSystem(mouseButtons type); public: //! Constructor - button(); + SAGGUI_DEPRECATED button(); //! Destructor ~button(); Modified: trunk/include/saggui/widgets/listbox.h =================================================================== --- trunk/include/saggui/widgets/listbox.h 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/include/saggui/widgets/listbox.h 2007-07-28 19:42:23 UTC (rev 453) @@ -42,7 +42,7 @@ #include "saggui/window.h" #include "saggui/mouse_events.h" #include "saggui/key_events.h" -#include "saggui/widgets/button.h" +#include "saggui/widgets/pushbutton.h" #include "saggui/widgets/label.h" #include "saggui/widgets/scroll_bar.h" @@ -75,11 +75,11 @@ slot resized(); slot drawOnButton(const coord &pos, graphic *bmp, const std::vector<rgba> &colors, const uint32_t &flags, const shapeType &shape); - + slot showPopUp(); - slot showPopUp(const coord &c); - + slot showPopUp(const coord &pos); + slot hidePopUp(); slot onHoverItem(const coord &pos); @@ -111,7 +111,7 @@ //! Label to contain our chosen item label chosen; //! Button for drop down - button showListButton; + pushButton showListButton; //! Popup for selectable list box popUp; Modified: trunk/include/saggui/widgets/scroll_bar.h =================================================================== --- trunk/include/saggui/widgets/scroll_bar.h 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/include/saggui/widgets/scroll_bar.h 2007-07-28 19:42:23 UTC (rev 453) @@ -46,7 +46,7 @@ #include "saggui/key_events.h" #include "saggui/timer.h" #include "saggui/widgets/box.h" -#include "saggui/widgets/button.h" +#include "saggui/widgets/pushbutton.h" namespace saggui { @@ -86,10 +86,10 @@ double buttonSize; //! The topmost button (Top horizontal | left vertical) - button topButton; + pushButton topButton; //! The bottommost button (bottom horizontal | right vertical) - button bottomButton; + pushButton bottomButton; //! The centered button (crawls the index) box middleButton; @@ -151,10 +151,10 @@ virtual void onUp(const coord &c); virtual void scrollWheelUp(const coord &c); virtual void scrollWheelDown(const coord &c); - virtual void topButtonDown(); - virtual void topButtonUp(); - virtual void bottomButtonDown(); - virtual void bottomButtonUp(); + virtual slot topButtonDown(const coord &pos); + virtual slot topButtonUp(const coord &pos); + virtual slot bottomButtonDown(const coord &pos); + virtual slot bottomButtonUp(const coord &pos); virtual void middleButtonMove(); virtual void middleButtonUp(const coord &c); virtual void resizeButtons(); Modified: trunk/modules/palib/include/saggui/pa_gfx.h =================================================================== --- trunk/modules/palib/include/saggui/pa_gfx.h 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/modules/palib/include/saggui/pa_gfx.h 2007-07-28 19:42:23 UTC (rev 453) @@ -91,6 +91,11 @@ //! Draw Filled Circle to bitmap or passed bitmap void doCirclefill(double x, double y, double radius,const rgba & color, graphic *bmp=0); + + //! Draw a filled triangle between three points to bitmap or passed bitmap + void doTriangle(double x1, double y1, double x2, double y2, double x3, double y3, const rgba & color, graphic *bmp=0); + + // Bitmap Routines @@ -121,15 +126,9 @@ //! Clear to color void clearBmp(const rgba & color); - - //! Blit bitmap - void renderBmp(double x,double y,const rgba & color=rgba::NOCOLOR, graphic *b=0); - - //! Stretch Blit bitmap - void renderStretchedBmp(double x, double y, double width, double height,const rgba & color=rgba::NOCOLOR,graphic *b=0); - //! Render a portion of the bitmap to the given bitmap - void renderBmpArea(double x1, double y1, double x2, double y2, double width, double height, graphic *b); + //! Render a certain area of a bitmap + void renderBmp(double x1, double y1, double x2, double y2, double width, double height, const rgba &color, graphic *b=0); }; } Modified: trunk/modules/palib/include/saggui/pa_mouse.h =================================================================== --- trunk/modules/palib/include/saggui/pa_mouse.h 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/modules/palib/include/saggui/pa_mouse.h 2007-07-28 19:42:23 UTC (rev 453) @@ -65,6 +65,8 @@ ~paMouse(); //! Updates the mouse ie polling and setting keys void update(); + //! Sets the mouse pointer to specific location + void setPosition(int x, int y); }; } Modified: trunk/modules/palib/include/saggui/saggui.h =================================================================== --- trunk/modules/palib/include/saggui/saggui.h 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/modules/palib/include/saggui/saggui.h 2007-07-28 19:42:23 UTC (rev 453) @@ -52,9 +52,10 @@ //! These are the base GUI headers #include "saggui/animation.h" #include "saggui/bitmap_font.h" +#include "saggui/common.h" #include "saggui/coord.h" #include "saggui/debug.h" -#include "saggui/decorator.h" +#include "saggui/style.h" #include "saggui/dllspec.h" #include "saggui/font.h" #include "saggui/font_base.h" @@ -72,27 +73,33 @@ #include "saggui/mouse_manager.h" #include "saggui/resource_manager.h" #include "saggui/rgba.h" +#include "saggui/scheme.h" #include "saggui/sigslot.h" #include "saggui/sprite.h" #include "saggui/system_factory.h" -/* #include "saggui/system_graphics.h" */ #include "saggui/system.h" #include "saggui/timer.h" #include "saggui/window.h" - //! Headers for included widgets +#include "saggui/widgets/abstractbutton.h" #include "saggui/widgets/box.h" #include "saggui/widgets/button.h" +#include "saggui/widgets/buttongroup.h" #include "saggui/widgets/checkbox.h" #include "saggui/widgets/dialog.h" #include "saggui/widgets/input_box.h" #include "saggui/widgets/label.h" +#include "saggui/widgets/listbox.h" #include "saggui/widgets/progress_bar.h" +#include "saggui/widgets/pushbutton.h" #include "saggui/widgets/radial.h" #include "saggui/widgets/scroll_bar.h" #include "saggui/widgets/text_box.h" +//! Headers for included schemes +#include "saggui/schemes/defaultscheme.h" + //! Headers for module #include "pa_factory.h" #include "pa_font.h" Modified: trunk/modules/palib/saggui/pa_gfx.cpp =================================================================== --- trunk/modules/palib/saggui/pa_gfx.cpp 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/modules/palib/saggui/pa_gfx.cpp 2007-07-28 19:42:23 UTC (rev 453) @@ -46,13 +46,13 @@ { static void fixX(double &x) { - if(x<0)x=0; - if(x>255)x=255; + if(x<=1)x=1; + if(x>=254)x=254; } static void fixY(double &y) { - if(y<0)y=0; - if(y>191)y=191; + if(y<=1)y=1; + if(y>=190)y=190; } @@ -110,8 +110,8 @@ //!FIXME fixX(x); fixY(y); - if((x+width) > 255)width = 255 - x; - if((y+height) > 191)height = 191 - y; + width = ((x + width) > 254) ? 254 - x : width; + height = ((y + height) > 190) ? 190 - y : height; PA_Draw16bitLine (0, u16(x), u16(y), u16(x + width), u16(y), PA_RGB((u16)color.red >> 3,(u16)color.green >> 3,(u16)color.red >> 3)); PA_Draw16bitLine (0, u16(x), u16(y), u16(x), u16(y + height), PA_RGB((u16)color.red >> 3,(u16)color.green >> 3,(u16)color.red >> 3)); PA_Draw16bitLine (0, u16(x + width), u16(y), u16(x + width), u16(y + height), PA_RGB((u16)color.red >> 3,(u16)color.green >> 3,(u16)color.red >> 3)); @@ -125,8 +125,8 @@ //!FIXME fixX(x); fixY(y); - if((x+width) > 255)width = 255 - x; - if((y+height) > 191)height = 191 - y; + width = ((x + width) > 254) ? 254 - x : width; + height = ((y + height) > 190) ? 190 - y : height; PA_Draw16bitRect (0, s16(x), s16(y), s16(x+width), s16(y+height), PA_RGB((u16)color.red >> 3,(u16)color.green >> 3,(u16)color.red >> 3)); } @@ -142,6 +142,11 @@ { //!FIXME } + + void paGraphic::doTriangle(double x1, double y1, double x2, double y2, double x3, double y3, const rgba & color, graphic *bmp) + { + //!FIXME + } //! Load bitmap from file (and save filename) void paGraphic::loadBmp(const std::string & filename, const rgba & color) @@ -197,24 +202,11 @@ if(isScreenBmp())PA_Clear16bitBg(0); } - //! Blit - void paGraphic::renderBmp(double x,double y,const rgba & color, graphic *b) + //! render bmp + void paGraphic::renderBmp(double x1, double y1, double x2, double y2, double width, double height, const rgba &color, graphic *b) { //!FIXME - //PA_8bitDraw(0,0); } - //! Stretch Blit - void paGraphic::renderStretchedBmp(double x, double y, double width, double height,const rgba & color,graphic *b) - { - //!FIXME - //PA_8bitDraw(0,0); - } - - - void paGraphic::renderBmpArea(double x1, double y1, double x2, double y2, double width, double height, graphic *b) - { - //!FIXME - } } #endif Modified: trunk/modules/palib/saggui/pa_keyinput.cpp =================================================================== --- trunk/modules/palib/saggui/pa_keyinput.cpp 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/modules/palib/saggui/pa_keyinput.cpp 2007-07-28 19:42:23 UTC (rev 453) @@ -58,6 +58,8 @@ keys paKeyInput::convertKey(int unicode, int scancode) { //!FIXME + + return keys(); } //init Modified: trunk/modules/palib/saggui/pa_mouse.cpp =================================================================== --- trunk/modules/palib/saggui/pa_mouse.cpp 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/modules/palib/saggui/pa_mouse.cpp 2007-07-28 19:42:23 UTC (rev 453) @@ -68,6 +68,14 @@ else buttonState[LEFTBUTTON] = false; } + + + //! Sets the mouse pointer to specific location + void paMouse::setPosition(int x, int y) + { + Stylus.X = x; + Stylus.Y = y; + } } #endif Modified: trunk/modules/palib/source/main.cpp =================================================================== --- trunk/modules/palib/source/main.cpp 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/modules/palib/source/main.cpp 2007-07-28 19:42:23 UTC (rev 453) @@ -10,10 +10,10 @@ public: line() { - x1 = PA_RandMinMax(0,255); - x2 = PA_RandMinMax(0,255); - y1 = PA_RandMinMax(0,191); - y2 = PA_RandMinMax(0,191); + x1 = PA_RandMinMax(0,254); + x2 = PA_RandMinMax(0,254); + y1 = PA_RandMinMax(0,190); + y2 = PA_RandMinMax(0,190); if(PA_RandMinMax(0,100)<50)x1dir = -1; else x1dir = 1; if(PA_RandMinMax(0,100)<50)x2dir = -1; @@ -34,9 +34,9 @@ x1=0; x1dir=1; } - if(x1>=255) + if(x1>=254) { - x1=255; + x1=254; x1dir=-1; } if(x2<=0) @@ -44,10 +44,10 @@ x2dir=1; x2=0; } - if(x2>=255) + if(x2>=254) { x2dir=-1; - x2=255; + x2=254; } if(y1<=0) { @@ -57,17 +57,17 @@ if(y1>=191) { y1dir=-1; - y1=191; + y1=190; } if(y2<=0) { y2dir=1; y2=0; } - if(y2>=191) + if(y2>=190) { y2dir=-1; - y2=191; + y2=190; } x1+=x1dir; y1+=y1dir; @@ -110,7 +110,7 @@ int duration; }; -class touch : public sigslot::has_slots<> +class touch : public has_slots<> { public: touch() @@ -119,13 +119,13 @@ ~touch() { } - void info(coord c) + void info(const coord &c) { PA_OutputText(1,0,4,"x: %03d | y: %03d", s16(c.x), s16(c.y)); PA_OutputText(1,0,8,"Focused widget: %03d", s16(guiManager::getMouseOverWinIDWM())); } - void addPixel(coord c) + void addPixel(const coord &c) { pixels.push_back(pix(c.x,c.y)); } @@ -160,7 +160,7 @@ box b; b.position.set(50,50,50,50); - b.setDrag(window::ALLDRAG); + b.setDrag(M_AllDrag); checkBox c; c.position.set(100,100,25,25); @@ -194,9 +194,7 @@ bs.render(); guiManager::renderWindows(); - guiManager::renderToScreen(); - PA_WaitForVBL(); } Modified: trunk/src/widgets/listbox.cpp =================================================================== --- trunk/src/widgets/listbox.cpp 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/src/widgets/listbox.cpp 2007-07-28 19:42:23 UTC (rev 453) @@ -57,7 +57,7 @@ chosen.onKeyPress.connect(this,&listBox::mainKeyPress); addChild(&showListButton); - showListButton.onButtonClick.connect(this,&listBox::showPopUp); + showListButton.clicked.connect(this,&listBox::showPopUp); showListButton.onPaint.connect(this,&listBox::drawOnButton); popUp.addChild(&sideBar); @@ -167,7 +167,7 @@ mouseManager::setPosition(int(itemList[highlightedItem]->getRelativePosition().getX2() - (itemList[highlightedItem]->position.width/2)),int(itemList[highlightedItem]->getRelativePosition().getY2() - (itemList[highlightedItem]->position.height/2))); } - slot listBox::showPopUp(const coord &c) + slot listBox::showPopUp(const coord &pos) { showPopUp(); } Modified: trunk/src/widgets/scroll_bar.cpp =================================================================== --- trunk/src/widgets/scroll_bar.cpp 2007-07-27 17:38:34 UTC (rev 452) +++ trunk/src/widgets/scroll_bar.cpp 2007-07-28 19:42:23 UTC (rev 453) @@ -67,14 +67,14 @@ topButton.onScrollWheelUp.connect(this,&scrollBar::scrollWheelUp); topButton.onScrollWheelDown.connect(this,&scrollBar::scrollWheelDown); topButton.onPaint.connect(this,&scrollBar::drawButtonTop); - topButton.onButtonDown.connect(this,&scrollBar::topButtonDown); - topButton.onButtonRelease.connect(this,&scrollBar::topButtonUp); + topButton.pressed.connect(this,&scrollBar::topButtonDown); + topButton.released.connect(this,&scrollBar::topButtonUp); bottomButton.onScrollWheelUp.connect(this,&scrollBar::scrollWheelUp); bottomButton.onScrollWheelDown.connect(this,&scrollBar::scrollWheelDown); bottomButton.onPaint.connect(this,&scrollBar::drawButtonBottom); - bottomButton.onButtonDown.connect(this,&scrollBar::bottomButtonDown); - bottomButton.onButtonRelease.connect(this,&scrollBar::bottomButtonUp); + bottomButton.pressed.connect(this,&scrollBar::bottomButtonDown); + bottomButton.released.connect(this,&scrollBar::bottomButtonUp); middleButton.setDrag(M_NoDrag); middleButton.onMove.connect(this,&scrollBar::middleButtonMove); @@ -168,24 +168,24 @@ { scrollDown(scrollWheelIncrement); } - void scrollBar::topButtonDown() + slot scrollBar::topButtonDown(const coord &pos) { if(!mouseDown)clickTimer.reset(); mouseDown=true; buttonDir = BUTTONUP; } - void scrollBar::topButtonUp() + slot scrollBar::topButtonUp(const coord &pos) { mouseDown= clickPaused =false; buttonDir = NONE; } - void scrollBar::bottomButtonDown() + slot scrollBar::bottomButtonDown(const coord &pos) { if(!mouseDown)clickTimer.reset(); mouseDown=true; buttonDir = BUTTONDOWN; } - void scrollBar::bottomButtonUp() + slot scrollBar::bottomButtonUp(const coord &pos) { mouseDown= clickPaused =false; buttonDir = NONE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@li...> - 2007-08-17 00:07:12
|
Revision: 456 http://saggui.svn.sourceforge.net/saggui/?rev=456&view=rev Author: juvinious Date: 2007-08-16 17:07:10 -0700 (Thu, 16 Aug 2007) Log Message: ----------- Fixed some memory leaks and optimized a tad bit Modified Paths: -------------- trunk/CMakeLists.txt trunk/include/saggui/widgets/listbox.h trunk/src/bitmap_font.cpp trunk/src/scheme.cpp trunk/src/widgets/listbox.cpp trunk/src/widgets/scroll_bar.cpp Modified: trunk/CMakeLists.txt =================================================================== --- trunk/CMakeLists.txt 2007-08-16 22:20:24 UTC (rev 455) +++ trunk/CMakeLists.txt 2007-08-17 00:07:10 UTC (rev 456) @@ -76,12 +76,22 @@ # ------------------------------------------------------- option(CREATE_STATIC_LIB "Make the library static?" on) +option(HAVE_DEBUG "Make an unoptimized build of saggui?" off) + option(ENABLE_FREETYPE_FONTS "Enables freetype font support" on) if(NOT MSVC) - set(CXXFLAGS "-O2 -Wall -funroll-loops -fexpensive-optimizations -Woverloaded-virtual -Werror") + if(HAVE_DEBUG) + set(CXXFLAGS "-Wall") + else(HAVE_DEBUG) + set(CXXFLAGS "-O2 -Wall -funroll-loops -fexpensive-optimizations -Woverloaded-virtual -Werror") + endif(HAVE_DEBUG) else(NOT MSVC) - set(CXXFLAGS "-O2") + if(HAVE_DEBUG) + set(CXXFLAGS "") + else(HAVE_DEBUG) + set(CXXFLAGS "-O2") + endif(HAVE_DEBUG) endif(NOT MSVC) add_definitions(${CXXFLAGS}) Modified: trunk/include/saggui/widgets/listbox.h =================================================================== --- trunk/include/saggui/widgets/listbox.h 2007-08-16 22:20:24 UTC (rev 455) +++ trunk/include/saggui/widgets/listbox.h 2007-08-17 00:07:10 UTC (rev 456) @@ -115,7 +115,7 @@ //! Popup for selectable list box popUp; - scrollBar sideBar; + //scrollBar sideBar; }; } Modified: trunk/src/bitmap_font.cpp =================================================================== --- trunk/src/bitmap_font.cpp 2007-08-16 22:20:24 UTC (rev 455) +++ trunk/src/bitmap_font.cpp 2007-08-17 00:07:10 UTC (rev 456) @@ -129,6 +129,7 @@ if(instances>0)instances--; if(instances==0)resourceManager::destroyGraphic(unknownGlyph); if(loadedFromFile)resourceManager::destroyGraphic(currentFont); + glyphs.clear(); } //! Create glyph map Modified: trunk/src/scheme.cpp =================================================================== --- trunk/src/scheme.cpp 2007-08-16 22:20:24 UTC (rev 455) +++ trunk/src/scheme.cpp 2007-08-17 00:07:10 UTC (rev 456) @@ -89,7 +89,9 @@ } scheme::~scheme() { - + colors.clear(); + styles.clear(); + shapes.clear(); } //! Set translucency to the entire scheme Modified: trunk/src/widgets/listbox.cpp =================================================================== --- trunk/src/widgets/listbox.cpp 2007-08-16 22:20:24 UTC (rev 455) +++ trunk/src/widgets/listbox.cpp 2007-08-17 00:07:10 UTC (rev 456) @@ -60,12 +60,12 @@ showListButton.clicked.connect(this,&listBox::showPopUp); showListButton.onPaint.connect(this,&listBox::drawOnButton); - popUp.addChild(&sideBar); + //popUp.addChild(&sideBar); popUp.setAttribute(AT_Visible | AT_Enabled, false); popUp.onLostFocus.connect(this,&listBox::hidePopUp); popUp.onKeyPress.connect(this,&listBox::keyPress); - sideBar.setAttribute(AT_Visible | AT_Enabled, false); + //sideBar.setAttribute(AT_Visible | AT_Enabled, false); currentItem=-1; highlightedItem=0; Modified: trunk/src/widgets/scroll_bar.cpp =================================================================== --- trunk/src/widgets/scroll_bar.cpp 2007-08-16 22:20:24 UTC (rev 455) +++ trunk/src/widgets/scroll_bar.cpp 2007-08-17 00:07:10 UTC (rev 456) @@ -45,20 +45,26 @@ { scrollBar::scrollBar() : mouseEvents(this), keyEvents(this) { - setType(AT_Horizontal); - setStyle(BUTTONORIG); index = 0; + style = 0; buttonSize = 0; buttonIncrement = 1; + scrollArea = 0; + scrollAreaTop = 0; + scrollAreaBottom = 0; scrollAreaIncrement = 5; scrollWheelIncrement = 5; - setMaxSize(0); + maxSize = 0; mouseDown = false; clickPaused = false; pauseTime = 500; buttonDir = NONE; mouseLocation = NONE; + buttonIncrement = scrollAreaIncrement = scrollWheelIncrement = 0; + setType(AT_Horizontal); + setStyle(BUTTONORIG); + setAttribute(AT_Filled, true); onScrollWheelUp.connect(this,&scrollBar::scrollWheelUp); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@li...> - 2007-08-16 22:20:30
|
Revision: 455 http://saggui.svn.sourceforge.net/saggui/?rev=455&view=rev Author: juvinious Date: 2007-08-16 15:20:24 -0700 (Thu, 16 Aug 2007) Log Message: ----------- Fixed profiler and added it to build with the example apps Modified Paths: -------------- trunk/CHANGELOG trunk/CMakeLists.txt trunk/examples/demo/CMakeLists.txt trunk/examples/demo/include/test_classes.h trunk/examples/demo/src/allegro.cpp trunk/examples/demo/src/allegrogl.cpp trunk/examples/demo/src/openlayer.cpp trunk/examples/demo/src/sdl.cpp trunk/examples/demo/src/sdlgl.cpp trunk/examples/demo/src/test_classes.cpp trunk/examples/gamedemo/CMakeLists.txt trunk/examples/gamedemo/include/gamedemo.h trunk/examples/gamedemo/src/allegro.cpp trunk/examples/gamedemo/src/allegrogl.cpp trunk/examples/gamedemo/src/gamedemo.cpp trunk/examples/gamedemo/src/openlayer.cpp trunk/examples/gamedemo/src/sdl.cpp trunk/examples/gamedemo/src/sdlgl.cpp trunk/examples/widgets/CMakeLists.txt trunk/examples/widgets/include/widgets.h trunk/examples/widgets/src/allegro.cpp trunk/examples/widgets/src/allegrogl.cpp trunk/examples/widgets/src/openlayer.cpp trunk/examples/widgets/src/sdl.cpp trunk/examples/widgets/src/sdlgl.cpp trunk/examples/widgets/src/widgets.cpp trunk/include/saggui/animation.h trunk/include/saggui/bitmap_font.h trunk/include/saggui/common.h trunk/include/saggui/coord.h trunk/include/saggui/debug.h trunk/include/saggui/dllspec.h trunk/include/saggui/font.h trunk/include/saggui/font_base.h trunk/include/saggui/font_manager.h trunk/include/saggui/graphic_manager.h trunk/include/saggui/graphics.h trunk/include/saggui/gui_manager.h trunk/include/saggui/key_events.h trunk/include/saggui/keyinput.h trunk/include/saggui/keyinput_manager.h trunk/include/saggui/keys.h trunk/include/saggui/library_factory.h trunk/include/saggui/mouse.h trunk/include/saggui/mouse_events.h trunk/include/saggui/mouse_manager.h trunk/include/saggui/resource_manager.h trunk/include/saggui/rgba.h trunk/include/saggui/scheme.h trunk/include/saggui/schemes/defaultscheme.h trunk/include/saggui/sigslot.h trunk/include/saggui/sprite.h trunk/include/saggui/style.h trunk/include/saggui/system.h trunk/include/saggui/system_factory.h trunk/include/saggui/timer.h trunk/include/saggui/widgets/abstractbutton.h trunk/include/saggui/widgets/box.h trunk/include/saggui/widgets/button.h trunk/include/saggui/widgets/buttongroup.h trunk/include/saggui/widgets/checkbox.h trunk/include/saggui/widgets/dialog.h trunk/include/saggui/widgets/input_box.h trunk/include/saggui/widgets/label.h trunk/include/saggui/widgets/listbox.h trunk/include/saggui/widgets/progress_bar.h trunk/include/saggui/widgets/pushbutton.h trunk/include/saggui/widgets/radial.h trunk/include/saggui/widgets/scroll_bar.h trunk/include/saggui/widgets/text_box.h trunk/include/saggui/window.h trunk/modules/agl/include/agl_factory.h trunk/modules/agl/include/agl_gfx.h trunk/modules/agl/include/agl_system.h trunk/modules/agl/saggui_agl.h trunk/modules/agl/src/agl_factory.cpp trunk/modules/agl/src/agl_gfx.cpp trunk/modules/agl/src/agl_system.cpp trunk/modules/allegro/include/al_factory.h trunk/modules/allegro/include/al_font.h trunk/modules/allegro/include/al_gfx.h trunk/modules/allegro/include/al_keyinput.h trunk/modules/allegro/include/al_mouse.h trunk/modules/allegro/include/al_system.h trunk/modules/allegro/saggui_alleg.h trunk/modules/allegro/src/al_factory.cpp trunk/modules/allegro/src/al_font.cpp trunk/modules/allegro/src/al_gfx.cpp trunk/modules/allegro/src/al_keyinput.cpp trunk/modules/allegro/src/al_mouse.cpp trunk/modules/allegro/src/al_system.cpp trunk/modules/freetype/include/ft_default.h trunk/modules/freetype/include/ft_font.h trunk/modules/freetype/saggui_freetype.h trunk/modules/freetype/src/ft_font.cpp trunk/modules/opengl/include/opengl_gfx.h trunk/modules/opengl/src/opengl_gfx.cpp trunk/modules/openlayer/include/ol_factory.h trunk/modules/openlayer/include/ol_font.h trunk/modules/openlayer/include/ol_gfx.h trunk/modules/openlayer/include/ol_system.h trunk/modules/openlayer/saggui_ol.h trunk/modules/openlayer/src/ol_factory.cpp trunk/modules/openlayer/src/ol_font.cpp trunk/modules/openlayer/src/ol_gfx.cpp trunk/modules/openlayer/src/ol_system.cpp trunk/modules/palib/include/saggui/custom_timer.h trunk/modules/palib/include/saggui/pa_factory.h trunk/modules/palib/include/saggui/pa_font.h trunk/modules/palib/include/saggui/pa_gfx.h trunk/modules/palib/include/saggui/pa_keyinput.h trunk/modules/palib/include/saggui/pa_mouse.h trunk/modules/palib/include/saggui/pa_system.h trunk/modules/palib/include/saggui/saggui.h trunk/modules/palib/saggui/pa_factory.cpp trunk/modules/palib/saggui/pa_font.cpp trunk/modules/palib/saggui/pa_gfx.cpp trunk/modules/palib/saggui/pa_keyinput.cpp trunk/modules/palib/saggui/pa_mouse.cpp trunk/modules/palib/saggui/pa_system.cpp trunk/modules/profiler/CMakeLists.txt trunk/modules/sdl/include/sdl_factory.h trunk/modules/sdl/include/sdl_gfx.h trunk/modules/sdl/include/sdl_keyinput.h trunk/modules/sdl/include/sdl_mouse.h trunk/modules/sdl/include/sdl_system.h trunk/modules/sdl/saggui_sdl.h trunk/modules/sdl/src/sdl_factory.cpp trunk/modules/sdl/src/sdl_gfx.cpp trunk/modules/sdl/src/sdl_keyinput.cpp trunk/modules/sdl/src/sdl_mouse.cpp trunk/modules/sdl/src/sdl_system.cpp trunk/modules/sdlgl/include/sdlgl_factory.h trunk/modules/sdlgl/include/sdlgl_gfx.h trunk/modules/sdlgl/include/sdlgl_system.h trunk/modules/sdlgl/saggui_sdlgl.h trunk/modules/sdlgl/src/sdlgl_factory.cpp trunk/modules/sdlgl/src/sdlgl_gfx.cpp trunk/modules/sdlgl/src/sdlgl_system.cpp trunk/src/animation.cpp trunk/src/bitmap_font.cpp trunk/src/coord.cpp trunk/src/font.cpp trunk/src/font_base.cpp trunk/src/font_manager.cpp trunk/src/graphic_manager.cpp trunk/src/graphics.cpp trunk/src/gui_manager.cpp trunk/src/key_events.cpp trunk/src/keyinput.cpp trunk/src/keyinput_manager.cpp trunk/src/keys.cpp trunk/src/library_factory.cpp trunk/src/mouse.cpp trunk/src/mouse_events.cpp trunk/src/mouse_manager.cpp trunk/src/resource_manager.cpp trunk/src/rgba.cpp trunk/src/scheme.cpp trunk/src/schemes/defaultscheme.cpp trunk/src/style.cpp trunk/src/system.cpp trunk/src/system_factory.cpp trunk/src/timer.cpp trunk/src/widgets/abstractbutton.cpp trunk/src/widgets/box.cpp trunk/src/widgets/button.cpp trunk/src/widgets/buttongroup.cpp trunk/src/widgets/checkbox.cpp trunk/src/widgets/dialog.cpp trunk/src/widgets/input_box.cpp trunk/src/widgets/label.cpp trunk/src/widgets/listbox.cpp trunk/src/widgets/progress_bar.cpp trunk/src/widgets/pushbutton.cpp trunk/src/widgets/radial.cpp trunk/src/widgets/scroll_bar.cpp trunk/src/widgets/text_box.cpp trunk/src/window.cpp trunk/utils/bmpdump/bmpdump-alleg.cpp trunk/utils/bmpdump/bmpdump-sdl.cpp Added Paths: ----------- trunk/examples/demo/src/profiler.cpp trunk/examples/gamedemo/src/profiler.cpp trunk/examples/widgets/src/profiler.cpp trunk/modules/profiler/include/profilefactory.h trunk/modules/profiler/include/profilefont.h trunk/modules/profiler/include/profilegfx.h trunk/modules/profiler/include/profilekeyinput.h trunk/modules/profiler/include/profilemouse.h trunk/modules/profiler/include/profilesystem.h trunk/modules/profiler/saggui_profiler.h trunk/modules/profiler/src/profilefactory.cpp trunk/modules/profiler/src/profilefont.cpp trunk/modules/profiler/src/profilegfx.cpp trunk/modules/profiler/src/profilekeyinput.cpp trunk/modules/profiler/src/profilemouse.cpp trunk/modules/profiler/src/profilesystem.cpp Removed Paths: ------------- trunk/modules/profiler/include/al_factory.h trunk/modules/profiler/include/al_font.h trunk/modules/profiler/include/al_gfx.h trunk/modules/profiler/include/al_keyinput.h trunk/modules/profiler/include/al_mouse.h trunk/modules/profiler/include/al_system.h trunk/modules/profiler/saggui_alleg.h trunk/modules/profiler/src/al_factory.cpp trunk/modules/profiler/src/al_font.cpp trunk/modules/profiler/src/al_gfx.cpp trunk/modules/profiler/src/al_keyinput.cpp trunk/modules/profiler/src/al_mouse.cpp trunk/modules/profiler/src/al_system.cpp Modified: trunk/CHANGELOG =================================================================== --- trunk/CHANGELOG 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/CHANGELOG 2007-08-16 22:20:24 UTC (rev 455) @@ -1,4 +1,6 @@ -0.48 +0.50 +- Made several commentary updates throughout the source +- Added a profiler module to run tests and debug the library - Fixed compilation issues with PALib, updated to the most recent version of PALib as of 07/28/07 - Moved all dependent widgets and examples from button to pushButton - Deprecated button so that pushButton can be used in its place Modified: trunk/CMakeLists.txt =================================================================== --- trunk/CMakeLists.txt 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/CMakeLists.txt 2007-08-16 22:20:24 UTC (rev 455) @@ -250,6 +250,7 @@ add_subdirectory(${CMAKE_SOURCE_DIR}/modules/sdlgl) endif(ENABLE_SDLGL) +add_subdirectory(${CMAKE_SOURCE_DIR}/modules/profiler) add_subdirectory(${CMAKE_SOURCE_DIR}/examples/demo) add_subdirectory(${CMAKE_SOURCE_DIR}/examples/gamedemo) add_subdirectory(${CMAKE_SOURCE_DIR}/examples/widgets) Modified: trunk/examples/demo/CMakeLists.txt =================================================================== --- trunk/examples/demo/CMakeLists.txt 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/demo/CMakeLists.txt 2007-08-16 22:20:24 UTC (rev 455) @@ -70,4 +70,9 @@ add_executable(demo-sdlgl src/sdlgl.cpp ${DEMO_SRC}) target_link_libraries(demo-sdlgl ${FONT_LIBS} saggui-sdlgl saggui-sdl saggui) add_dependencies(demo-sdlgl saggui-sdlgl saggui-sdl saggui ${FONT_LIBS}) -endif(ENABLE_SDLGL) \ No newline at end of file +endif(ENABLE_SDLGL) + +# Profiler +add_executable(demo-profiler src/profiler.cpp ${DEMO_SRC}) +target_link_libraries(demo-profiler ${FONT_LIBS} saggui-profiler saggui) +add_dependencies(demo-profiler saggui-profiler saggui ${FONT_LIBS}) \ No newline at end of file Modified: trunk/examples/demo/include/test_classes.h =================================================================== --- trunk/examples/demo/include/test_classes.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/demo/include/test_classes.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/examples/demo/src/allegro.cpp =================================================================== --- trunk/examples/demo/src/allegro.cpp 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/demo/src/allegro.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/examples/demo/src/allegrogl.cpp =================================================================== --- trunk/examples/demo/src/allegrogl.cpp 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/demo/src/allegrogl.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/examples/demo/src/openlayer.cpp =================================================================== --- trunk/examples/demo/src/openlayer.cpp 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/demo/src/openlayer.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Copied: trunk/examples/demo/src/profiler.cpp (from rev 453, trunk/examples/demo/src/sdl.cpp) =================================================================== --- trunk/examples/demo/src/profiler.cpp (rev 0) +++ trunk/examples/demo/src/profiler.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -0,0 +1,399 @@ +/* +SAGGUI (Simplified All Gaming Graphical User Interface) +Copyright (c) 2005-2007, Miguel A. Gavidia +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + * Neither the name of the "SAGGUI" nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef MAIN_CPP +#define MAIN_CPP + +#include <iostream> +#include <vector> +#include <string> +#include "saggui.h" +#include "saggui_profiler.h" +#ifdef INCLUDE_FREETYPE +#include "saggui_freetype.h" +#endif +#include "debug.h" +#include "test_classes.h" + +using namespace saggui; + +static keys currentKey; + +class signalFuncs : public has_slots<> +{ + public: + void getKey(const keys &k) + { + currentKey = k; + } + + void screenChanged() + { + std::cout << "Resolution Changed.\n"; + } +}; + +class newBox : public dialog +{ + public: + + textBox text; + void resize() + { + text.position.set(leftPadding,topPadding,position.width-(leftPadding+rightPadding),position.height-(topPadding+bottomPadding)); + } + + newBox() + { + addChild(&text); + onResize.connect(this,&newBox::resize); + } + ~newBox() + { + } +}; + +int main(int argc, char *argv[]) +{ + resourceManager::registerBackend<PROFILER_SAGGUI>(); +#ifdef INCLUDE_FREETYPE + resourceManager::registerFont<freetype>(); +#endif + // Sets up the SAGGUI with the specified library + guiManager::setup("profiler"); + + // Create a timer to regulate the logic loop + guiTimer timer, fpsTimer; + int fps=0,fpsCounter =0; + + testDecorator decor(200,200); + + // Some Variables + int reso_x = 640,reso_y = 480; + int fontSizeW = 18; + int fontSizeH = 12; + int opacity=255; + bool fullscreen = false; + bool buffered = true; + rgba blackCol(0,0,0,0); + rgba whiteCol(255,255,255,255); + bool quit = false; + + // Set the resolution of the demo + if(!guiManager::setupScreen(reso_x,reso_y,32,fullscreen, buffered)) + { + std::cout << "Couldn't create display\n"; + return 1; + } + + // Connect to the resolution change to exemplify the useage + signalFuncs f; + guiManager::onResolutionChange.connect(&f, &signalFuncs::screenChanged); + + // Create a test font as an example + bool fontLoaded = true; + saggui::font *testFont = new saggui::font("freetype"); + if(!testFont->load("data/comic.ttf")) + { + delete testFont; + testFont = resourceManager::getFont(); + fontLoaded = false; + } + + //Create some windows + win window1,window3;//, window3, window4; + + newBox tBox; + + inputBox test; + test.position.set(10,400,200,20); + test.setHorizontalAlign(inputBox::T_Left); + //test.setAutoResize(true); + test.setText("I'm an input box"); + + // Scroll bar + scrollBar sbar1, sbar2; + + sbar1.setType(AT_Horizontal); + sbar1.position.set(15,300,450,15); + sbar1.setStyle(scrollBar::BUTTONORIG); + sbar1.setMaxSize(150); + + sbar2.setType(AT_Vertical); + sbar2.position.set(450,50,15,250); + sbar2.setStyle(scrollBar::BUTTONORIG); + sbar2.setMaxSize(150); + + // Create background noise + lines bgLines[5] = {lines(reso_x,reso_y),lines(reso_x,reso_y),lines(reso_x,reso_y),lines(reso_x,reso_y),lines(reso_x,reso_y)}; + + for(int i=0;i<5;++i) + { + guiManager::onUpdate.connect(&bgLines[i],&lines::update); + guiManager::drawUnderWindows.connect(&bgLines[i],&lines::draw); + } + + // connect keyInput + keyInputManager::pressed.connect(&f,&signalFuncs::getKey); + + // Permanent windows + window1.position.set(20,20,250,250); + + tBox.position.set(100,80,250,250); + tBox.text.setText("\\#FF0000C\\end\\#0000FFo\\end\\#00C000l\\end\\#FFFF00o\\end\\#A0A0A0r\\end\\#C05800e\\end\\#00FFFFd\\end \\#FF0000Text\\end using tags! Everyone knows that dragons don't exist. But while this simplistic formulation may satisfy the layman, it does not suffice for the scientific mind. The School of Higher Neantical Nillity is in fact wholly unconcerned with what does exist. Indeed, the banality of existence has been so amply demonstrated, there is no need for us to discuss it any further here. The brilliant Cerebron, attacking the problem analytically, discovered three distinct kinds of dragon: the mythical, the chimerical, and the purely hypothetical. They were all, one might say, nonexistent, but each nonexisted in an entirely different way."); + //tBox.setWordWrap(false); + + // Button tester + pushButton myButton; + myButton.setText("Press me!"); + myButton.position.setPosition(400,400); + + radial myRadial; + myRadial.position.set(15,360,15,15); + + label radialLabel; + radialLabel.setAutoResize(true); + radialLabel.setText("<-Radial Button"); + radialLabel.position.setPosition(35,358); + + checkBox myCheckbox; + myCheckbox.position.set(15,380,15,15); + + label cbLabel; + cbLabel.setAutoResize(true); + cbLabel.setText("<-checkbox Button"); + cbLabel.position.setPosition(35,378); + + testProgress progress1; + testProgress progress2; + testProgress progress3; + testProgress progress4; + testProgress progress5; + testProgress progress6; + testProgress progress7; + progress1.position.set(10,150,100,20); + progress2.position.set(10,175,100,20); + progress3.position.set(100,10,20,100); + progress4.position.set(125,10,20,100); + progress5.position.set(10,200,100,20); + progress6.position.set(150,10,20,100); + progress7.position.set(10,430,200,20); + progress1.setProgress(75.0); + progress2.setProgress(75.0); + progress3.setProgress(75.0); + progress4.setProgress(75.0); + progress1.setStyle(progressBar::TOP); + progress2.setStyle(progressBar::BOTTOM); + progress3.setStyle(progressBar::TOP); + progress4.setStyle(progressBar::BOTTOM); + progress5.setStyle(progressBar::MIDDLE); + progress6.setStyle(progressBar::MIDDLE); + progress7.setStyle(progressBar::BOTTOM); + progress3.setType(progressBar::VERTICAL); + progress4.setType(progressBar::VERTICAL); + progress6.setType(progressBar::VERTICAL); + + progress1.setColor(rgba::GREEN); + progress2.setColor(rgba::YELLOW); + progress5.setColor(rgba::BLUE); + progress3.setColor(rgba::GREEN); + progress4.setColor(rgba::YELLOW); + progress6.setColor(rgba::BLUE); + progress7.setColor(rgba::RED); + + window1.addChild(&progress1); + window1.addChild(&progress2); + window1.addChild(&progress3); + window1.addChild(&progress4); + window1.addChild(&progress5); + window1.addChild(&progress6); + + window3.position.set(77,67,150,150); + window1.addChild(&window3); + window3.onMove.connect(&window3, &win::moving); + + dialog dialogTest; + dialogTest.position.set(200,200,200,200); + + //Temporary windows + std::vector<window *>windows; + + // Main loop + while(!quit){ + + bool draw=false; + while (timer.msecs() >= 1000/60) + { + draw = true; + if(keyInputManager::keyState(keys::ESC)) + { + quit=true; + draw=false; + break; + } + if(keyInputManager::keyState(keys::NUM_1,true)) + { + guiManager::toggleActive(); + } + if((keyInputManager::keyState(keys::ALT)&&keyInputManager::keyState(keys::ENTER))) + { + if(fullscreen)fullscreen=false; + else fullscreen = true; + guiManager::setupScreen(reso_x,reso_y,32,fullscreen); + } + + if(keyInputManager::keyState(keys::UP)) + { + if(opacity<255)++opacity; + //guiManager::getScheme().setTranslucency(opacity); + whiteCol.alpha = opacity; + } + if(keyInputManager::keyState(keys::DOWN)) + { + if(opacity>0)--opacity; + //guiManager::getScheme().setTranslucency(opacity); + whiteCol.alpha = opacity; + } + if(keyInputManager::keyState(keys::LEFT,true)) + { + if(fontSizeW>0) + { + --fontSizeW; + --fontSizeH; + } + if(fontLoaded)testFont->setSize(fontSizeW,fontSizeH); + resourceManager::getFont()->setSize(fontSizeW,fontSizeH); + } + if(keyInputManager::keyState(keys::RIGHT,true)) + { + if(fontSizeW<50) + { + ++fontSizeW; + ++fontSizeH; + } + if(fontLoaded)testFont->setSize(fontSizeW,fontSizeH); + resourceManager::getFont()->setSize(fontSizeW,fontSizeH); + } + if(keyInputManager::keyState(keys::NUM_2,true)) + { + window *temp = new win(); + temp->position.set(rand()%400,rand()%300,200,200); + windows.push_back(temp); + guiManager::addWindow(temp); + if(rand()%2)temp->setStyle(&decor); + } + if(keyInputManager::keyState(keys::NUM_3,true)) + { + if(windows.size()>0) + { + window *temp = windows.back(); + guiManager::removeWindow(temp); + windows.pop_back(); + delete temp; + } + } + if(keyInputManager::keyState(keys::NUM_4,true)) + { + buffered = guiManager::useBuffering(!buffered); + } + + guiManager::update(); + + //for(int i=0;i<5;++i){bgLines[i].update();} + + timer.reset(); + } + + if(draw) + { + if(fpsTimer.secs()<=1)fpsCounter++; + (guiManager::getSystemBuffer())->clearBmp(blackCol); + + //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getSystemBuffer());} + + testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getSystemBuffer(),1,"Press ESC to quit"); + testFont->render(320,16,whiteCol,guiManager::getSystemBuffer(),1,"Press Alt-Enter to toggle Fullscreen"); + testFont->render(320,32,whiteCol,guiManager::getSystemBuffer(),1,"Press 1 to toggle GUI"); + testFont->render(320,48,whiteCol,guiManager::getSystemBuffer(),1,"Press 2 to add a new window"); + testFont->render(320,64,whiteCol,guiManager::getSystemBuffer(),1,"Press 3 to delete last window created"); + testFont->render(320,80,whiteCol,guiManager::getSystemBuffer(),1,"Press 4 to toggle buffered mode"); + testFont->render(320,96,whiteCol,guiManager::getSystemBuffer(),1,"Press UP to increase opacity"); + testFont->render(320,112,whiteCol,guiManager::getSystemBuffer(),1,"Press DOWN to decrease opacity"); + testFont->render(320,128,whiteCol,guiManager::getSystemBuffer(),1,"Press Right to increase font size"); + testFont->render(320,144,whiteCol,guiManager::getSystemBuffer(),1,"Press Left to decrease font size"); + + + testFont->render(320,398,whiteCol,guiManager::getSystemBuffer(),1,"FPS:%d",fps); + testFont->render(320,412,whiteCol,guiManager::getSystemBuffer(),1,"Current Key:%d",currentKey.getValue()); + + testFont->render(320,428,whiteCol,guiManager::getSystemBuffer(),1,"Font size: %d",fontSizeH); + testFont->render(320,444,whiteCol,guiManager::getSystemBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); + testFont->render(320,460,whiteCol,guiManager::getSystemBuffer(),1,guiManager::getMouseButtonInfoWM()); + + testFont->render(640,240,whiteCol,guiManager::getSystemBuffer(),2,"Testing right aligned"); + + guiManager::renderWindows(); + + + } + + if(fpsTimer.secs()>=1) + { + fpsTimer.reset(); + fps=fpsCounter; + fpsCounter=0; + } + while((timer.msecs())==0)timer.sleep(1); + + } + + // Remove temporary windows + for(std::vector<window *>::iterator i = windows.begin();i!=windows.end();++i) + { + window * loopWindow = (*i); + guiManager::removeWindow(loopWindow); + delete (loopWindow); + } + windows.clear(); + + if(fontLoaded)delete testFont; + + return 0; +} + +#endif Modified: trunk/examples/demo/src/sdl.cpp =================================================================== --- trunk/examples/demo/src/sdl.cpp 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/demo/src/sdl.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/examples/demo/src/sdlgl.cpp =================================================================== --- trunk/examples/demo/src/sdlgl.cpp 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/demo/src/sdlgl.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/examples/demo/src/test_classes.cpp =================================================================== --- trunk/examples/demo/src/test_classes.cpp 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/demo/src/test_classes.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/examples/gamedemo/CMakeLists.txt =================================================================== --- trunk/examples/gamedemo/CMakeLists.txt 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/gamedemo/CMakeLists.txt 2007-08-16 22:20:24 UTC (rev 455) @@ -69,3 +69,7 @@ target_link_libraries(gamedemo-sdlgl ${FONT_LIBS} saggui-sdlgl saggui-sdl saggui) add_dependencies(gamedemo-sdlgl saggui-sdlgl saggui-sdl saggui) endif(ENABLE_SDLGL) + +add_executable(gamedemo-profiler src/profiler.cpp ${GAMEDEMO_SRC}) +target_link_libraries(gamedemo-profiler ${FONT_LIBS} saggui-profiler saggui) +add_dependencies(gamedemo-profiler saggui-profiler saggui) \ No newline at end of file Modified: trunk/examples/gamedemo/include/gamedemo.h =================================================================== --- trunk/examples/gamedemo/include/gamedemo.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/gamedemo/include/gamedemo.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/examples/gamedemo/src/allegro.cpp =================================================================== --- trunk/examples/gamedemo/src/allegro.cpp 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/gamedemo/src/allegro.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/examples/gamedemo/src/allegrogl.cpp =================================================================== --- trunk/examples/gamedemo/src/allegrogl.cpp 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/gamedemo/src/allegrogl.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/examples/gamedemo/src/gamedemo.cpp =================================================================== --- trunk/examples/gamedemo/src/gamedemo.cpp 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/gamedemo/src/gamedemo.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/examples/gamedemo/src/openlayer.cpp =================================================================== --- trunk/examples/gamedemo/src/openlayer.cpp 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/gamedemo/src/openlayer.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Copied: trunk/examples/gamedemo/src/profiler.cpp (from rev 453, trunk/examples/gamedemo/src/sdl.cpp) =================================================================== --- trunk/examples/gamedemo/src/profiler.cpp (rev 0) +++ trunk/examples/gamedemo/src/profiler.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -0,0 +1,190 @@ +/* +SAGGUI (Simplified All Gaming Graphical User Interface) +Copyright (c) 2005-2007, Miguel A. Gavidia +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + * Neither the name of the "SAGGUI" nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "gamedemo.h" +#include <saggui_profiler.h> +#include "gamedemo_gfx.h" + +int main(int argc, char *argv[]) +{ + // Register library + resourceManager::registerBackend<PROFILER_SAGGUI>(); + // Sets up the SAGGUI with the specified library + guiManager::setup("profiler"); + + // Create a timer to regulate the logic loop + guiTimer timer, fpsTimer; + int fps=0,fpsCounter =0; + + gameData data; + + if(!guiManager::setupScreen(data.screenWidth,data.screenHeight,32,data.fullscreen, data.buffered)) + { + std::cout << "Couldn't create display\n"; + return 1; + } + + basicDecor baseDecor; + //baseDecor.background = rgba(80,80,140,255); + basicDecor buttonDecor; + filledDecor fillDecor; + plainDecor colorOnly; + + /* + guiManager::getCurrentScheme()->base = &baseDecor; + guiManager::getCurrentScheme()->button = &buttonDecor; + guiManager::getCurrentScheme()->filler = &fillDecor; + guiManager::getCurrentScheme()->colorOnly = &colorOnly; + */ + guiManager::getCurrentScheme()->styles[W_Basic] = baseDecor; + guiManager::getCurrentScheme()->styles[W_PushButton] = buttonDecor; + //guiManager::getCurrentScheme()->styles[W_Filler] = fillDecor; + //guiManager::getCurrentScheme()->schemes[W_CcolorOnly = &colorOnly; + + graphic *panel = resourceManager::createGraphic(); + graphic *button1 = resourceManager::createGraphic(); + graphic *button2 = resourceManager::createGraphic(); + graphic *button3 = resourceManager::createGraphic(); + graphic *eButton = resourceManager::createGraphic(); + graphic *mButton = resourceManager::createGraphic(); + + /* + panel->loadBmp("control-panel.bmp"); + button1->loadBmp("button1.bmp"); + button2->loadBmp("button2.bmp"); + button3->loadBmp("button3.bmp"); + eButton->loadBmp("quit.bmp"); + mButton->loadBmp("menu.bmp"); + */ + + panel->loadBmp(ctrlPanel,ctrlPanel_W,ctrlPanel_H); + button1->loadBmp(btn1,btn1_W,btn1_H); + button2->loadBmp(btn2,btn2_W,btn2_H); + button3->loadBmp(btn3,btn3_W,btn3_H); + eButton->loadBmp(quitbtn,quitbtn_W,quitbtn_H); + mButton->loadBmp(menubtn,menubtn_W,menubtn_H); + + box controlPanel; + controlPanel.setStyle(&colorOnly); + controlPanel.setBitmap(panel); + controlPanel.position.setPosition(0,280); + + mainMenu mMenu; + + icon b1(&controlPanel,button1,420,20); + b1.text.setText("Let's do some lightning!"); + icon b2(&controlPanel,button2,460,20); + b2.text.setText("Block or someshit!"); + icon b3(&controlPanel,button3,500,20); + b3.text.setText("They set us up the bomb!"); + icon b4(&controlPanel,button1,540,20); + b4.text.setText("Light my fire."); + icon b5(&controlPanel,button2,580,20); + b5.text.setText("Somshit that's not needed"); + icon b6(&controlPanel,button3,420,60); + b6.text.setText("You bomb again?"); + icon b7(&controlPanel,button1,460,60); + b7.text.setText("I HATE LIFE!"); + icon b8(&controlPanel,button2,500,60); + icon b9(&controlPanel,button3,540,60); + b9.text.setText("One bomb, two bomb, three bomb, 4...."); + icon b10(&controlPanel,button3,580,60); + b10.text.setText("Sevalecan is teh bomb!"); + + icon exitButton(&controlPanel,eButton,155,90,64,16); + exitButton.text.setText("Quit Demo"); + exitButton.b1.onLeftClick.connect(&data,&gameData::endGame); + + icon menuButton(&controlPanel,mButton,225,90,64,16); + menuButton.text.setText("Menu"); + menuButton.b1.onLeftClick.connect(&mMenu, &mainMenu::toggleMenu); + + // Nice stars + stars background; + // Main loop + while(!data.quit){ + + bool draw=false; + while (timer.msecs() >= 1000/60) + { + draw = true; + if(keyInputManager::keyState(keys::NUM_1,true)) + { + guiManager::toggleActive(); + } + + guiManager::update(); + + timer.reset(); + } + + if(draw) + { + if(fpsTimer.secs()<=1)fpsCounter++; + (guiManager::getSystemBuffer())->clearBmp(rgba::BLACK); + + resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps); + resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getSystemBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); + + guiManager::renderWindows(); + + + + } + + if(fpsTimer.secs()>=1) + { + fpsTimer.reset(); + fps=fpsCounter; + fpsCounter=0; + } + while((timer.msecs())==0)timer.sleep(1); + + } + + resourceManager::destroyGraphic(panel); + resourceManager::destroyGraphic(button1); + resourceManager::destroyGraphic(button2); + resourceManager::destroyGraphic(button3); + resourceManager::destroyGraphic(eButton); + resourceManager::destroyGraphic(mButton); + + + return 0; +} + Modified: trunk/examples/gamedemo/src/sdl.cpp =================================================================== --- trunk/examples/gamedemo/src/sdl.cpp 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/gamedemo/src/sdl.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/examples/gamedemo/src/sdlgl.cpp =================================================================== --- trunk/examples/gamedemo/src/sdlgl.cpp 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/gamedemo/src/sdlgl.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/examples/widgets/CMakeLists.txt =================================================================== --- trunk/examples/widgets/CMakeLists.txt 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/widgets/CMakeLists.txt 2007-08-16 22:20:24 UTC (rev 455) @@ -55,4 +55,8 @@ add_executable(widgets-sdlgl src/sdlgl.cpp ${WIDGETS_SRC}) target_link_libraries(widgets-sdlgl saggui-sdlgl saggui-sdl saggui) add_dependencies(widgets-sdlgl saggui-sdlgl saggui-sdl saggui) -endif(ENABLE_SDLGL) \ No newline at end of file +endif(ENABLE_SDLGL) + +add_executable(widgets-profiler src/profiler.cpp ${WIDGETS_SRC}) +target_link_libraries(widgets-profiler saggui-profiler saggui) +add_dependencies(widgets-profiler saggui-profiler saggui) \ No newline at end of file Modified: trunk/examples/widgets/include/widgets.h =================================================================== --- trunk/examples/widgets/include/widgets.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/widgets/include/widgets.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/examples/widgets/src/allegro.cpp =================================================================== --- trunk/examples/widgets/src/allegro.cpp 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/widgets/src/allegro.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005 - 2007, Miguel A. Gavidia All rights reserved. Modified: trunk/examples/widgets/src/allegrogl.cpp =================================================================== --- trunk/examples/widgets/src/allegrogl.cpp 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/widgets/src/allegrogl.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005 - 2007, Miguel A. Gavidia All rights reserved. Modified: trunk/examples/widgets/src/openlayer.cpp =================================================================== --- trunk/examples/widgets/src/openlayer.cpp 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/widgets/src/openlayer.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005 - 2007, Miguel A. Gavidia All rights reserved. Copied: trunk/examples/widgets/src/profiler.cpp (from rev 453, trunk/examples/widgets/src/sdl.cpp) =================================================================== --- trunk/examples/widgets/src/profiler.cpp (rev 0) +++ trunk/examples/widgets/src/profiler.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -0,0 +1,119 @@ +/* +SAGGUI (Simplified All Gaming Graphical User Interface) +Copyright (c) 2005 - 2007, Miguel A. Gavidia +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + * Neither the name of the "SAGGUI" nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef MAIN_CPP +#define MAIN_CPP + +#include "saggui_profiler.h" +#include "widgets.h" + +using namespace saggui; + +int main(int argc, char *argv[]) +{ + //Adds the backend to SAGGUI + resourceManager::registerBackend<PROFILER_SAGGUI>(); + + // Sets up the SAGGUI with the specified library + guiManager::setup("profiler"); + + // Create a timer to regulate the logic loop + guiTimer timer, fpsTimer; + int fps=0,fpsCounter =0; + + // Some Variables + bool fullscreen = false; + bool buffered = true; + bool quit = false; + + // Set the resolution of the demo + if(!guiManager::setupScreen(640,480,32,fullscreen, buffered)) + { + std::cout << "Couldn't create display\n"; + return 1; + } + + widgetContainer::setupWidgets(); + + // Main loop + while(!quit){ + + bool draw=false; + while (timer.msecs() >= 1000/60) + { + draw = true; + if(keyInputManager::keyState(keys::ESC)) + { + quit=true; + draw=false; + break; + } + + guiManager::update(); + + timer.reset(); + } + + if(draw) + { + if(fpsTimer.secs()<=1)fpsCounter++; + + resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getSystemBuffer(),1,"FPS: %d",fps); + + guiManager::renderWindows(); + + + + } + + if(fpsTimer.secs()>=1) + { + fpsTimer.reset(); + fps=fpsCounter; + fpsCounter=0; + } + while((timer.msecs())==0)timer.sleep(1); + + } + + widgetContainer::killWidgets(); + + return 0; +} + +#endif Modified: trunk/examples/widgets/src/sdl.cpp =================================================================== --- trunk/examples/widgets/src/sdl.cpp 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/widgets/src/sdl.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005 - 2007, Miguel A. Gavidia All rights reserved. Modified: trunk/examples/widgets/src/sdlgl.cpp =================================================================== --- trunk/examples/widgets/src/sdlgl.cpp 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/widgets/src/sdlgl.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005 - 2007, Miguel A. Gavidia All rights reserved. Modified: trunk/examples/widgets/src/widgets.cpp =================================================================== --- trunk/examples/widgets/src/widgets.cpp 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/examples/widgets/src/widgets.cpp 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/include/saggui/animation.h =================================================================== --- trunk/include/saggui/animation.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/animation.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/include/saggui/bitmap_font.h =================================================================== --- trunk/include/saggui/bitmap_font.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/bitmap_font.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. @@ -43,7 +43,7 @@ #include <map> #include "dllspec.h" -//! Simplified Allegro Gaming Graphical User Interface +//! Simplified All Gaming Graphical User Interface /*! This is the naming convention for this SAGGUI lib. */ Modified: trunk/include/saggui/common.h =================================================================== --- trunk/include/saggui/common.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/common.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/include/saggui/coord.h =================================================================== --- trunk/include/saggui/coord.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/coord.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. @@ -43,7 +43,7 @@ #include "sigslot.h" #include "dllspec.h" -//! Simplified Allegro Gaming Graphical User Interface +//! Simplified All Gaming Graphical User Interface /*! This is the naming convention for this SAGGUI lib. */ Modified: trunk/include/saggui/debug.h =================================================================== --- trunk/include/saggui/debug.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/debug.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/include/saggui/dllspec.h =================================================================== --- trunk/include/saggui/dllspec.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/dllspec.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/include/saggui/font.h =================================================================== --- trunk/include/saggui/font.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/font.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. @@ -46,7 +46,7 @@ #include "sigslot.h" #include "dllspec.h" -//! Simplified Allegro Gaming Graphical User Interface +//! Simplified All Gaming Graphical User Interface /*! This is the naming convention for this SAGGUI lib. */ Modified: trunk/include/saggui/font_base.h =================================================================== --- trunk/include/saggui/font_base.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/font_base.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. @@ -44,7 +44,7 @@ #include <stdarg.h> #include "dllspec.h" -//! Simplified Allegro Gaming Graphical User Interface +//! Simplified All Gaming Graphical User Interface /*! This is the naming convention for this SAGGUI lib. */ Modified: trunk/include/saggui/font_manager.h =================================================================== --- trunk/include/saggui/font_manager.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/font_manager.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/include/saggui/graphic_manager.h =================================================================== --- trunk/include/saggui/graphic_manager.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/graphic_manager.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/include/saggui/graphics.h =================================================================== --- trunk/include/saggui/graphics.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/graphics.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. @@ -45,7 +45,7 @@ #include "coord.h" #include "dllspec.h" -//! Simplified Allegro Gaming Graphical User Interface +//! Simplified All Gaming Graphical User Interface /*! This is the naming convention for this SAGGUI lib. */ Modified: trunk/include/saggui/gui_manager.h =================================================================== --- trunk/include/saggui/gui_manager.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/gui_manager.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/include/saggui/key_events.h =================================================================== --- trunk/include/saggui/key_events.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/key_events.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. @@ -45,7 +45,7 @@ #include "sigslot.h" #include "dllspec.h" -//! Simplified Allegro Gaming Graphical User Interface +//! Simplified All Gaming Graphical User Interface /*! This is the naming convention for this SAGGUI lib. */ Modified: trunk/include/saggui/keyinput.h =================================================================== --- trunk/include/saggui/keyinput.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/keyinput.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. @@ -46,7 +46,7 @@ #include <list> #include "dllspec.h" -//! Simplified Allegro Gaming Graphical User Interface +//! Simplified All Gaming Graphical User Interface /*! This is the naming convention for this SAGGUI lib. */ Modified: trunk/include/saggui/keyinput_manager.h =================================================================== --- trunk/include/saggui/keyinput_manager.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/keyinput_manager.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. @@ -48,7 +48,7 @@ #include "sigslot.h" #include "dllspec.h" -//! Simplified Allegro Gaming Graphical User Interface +//! Simplified All Gaming Graphical User Interface /*! This is the naming convention for this SAGGUI lib. */ Modified: trunk/include/saggui/keys.h =================================================================== --- trunk/include/saggui/keys.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/keys.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. @@ -41,7 +41,7 @@ #include "dllspec.h" -//! Simplified Allegro Gaming Graphical User Interface +//! Simplified All Gaming Graphical User Interface /*! This is the naming convention for this SAGGUI lib. */ Modified: trunk/include/saggui/library_factory.h =================================================================== --- trunk/include/saggui/library_factory.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/library_factory.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/include/saggui/mouse.h =================================================================== --- trunk/include/saggui/mouse.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/mouse.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. @@ -43,7 +43,7 @@ #include "coord.h" #include "dllspec.h" -//! Simplified Allegro Gaming Graphical User Interface +//! Simplified All Gaming Graphical User Interface /*! This is the naming convention for this SAGGUI lib. */ Modified: trunk/include/saggui/mouse_events.h =================================================================== --- trunk/include/saggui/mouse_events.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/mouse_events.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. @@ -45,7 +45,7 @@ #include "sigslot.h" #include "dllspec.h" -//! Simplified Allegro Gaming Graphical User Interface +//! Simplified All Gaming Graphical User Interface /*! This is the naming convention for this SAGGUI lib. */ Modified: trunk/include/saggui/mouse_manager.h =================================================================== --- trunk/include/saggui/mouse_manager.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/mouse_manager.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. @@ -50,7 +50,7 @@ #include "sigslot.h" #include "dllspec.h" -//! Simplified Allegro Gaming Graphical User Interface +//! Simplified All Gaming Graphical User Interface /*! This is the naming convention for this SAGGUI lib. */ Modified: trunk/include/saggui/resource_manager.h =================================================================== --- trunk/include/saggui/resource_manager.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/resource_manager.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/include/saggui/rgba.h =================================================================== --- trunk/include/saggui/rgba.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/rgba.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. @@ -42,7 +42,7 @@ #include <string> #include "dllspec.h" -//! Simplified Allegro Gaming Graphical User Interface +//! Simplified All Gaming Graphical User Interface /*! This is the naming convention for this SAGGUI lib. */ Modified: trunk/include/saggui/scheme.h =================================================================== --- trunk/include/saggui/scheme.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/scheme.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005 - 2007, Miguel A. Gavidia All rights reserved. Modified: trunk/include/saggui/schemes/defaultscheme.h =================================================================== --- trunk/include/saggui/schemes/defaultscheme.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/schemes/defaultscheme.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005 - 2007, Miguel A. Gavidia All rights reserved. Modified: trunk/include/saggui/sigslot.h =================================================================== --- trunk/include/saggui/sigslot.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/sigslot.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2007 Miguel A. Gavidia All rights reserved. Modified: trunk/include/saggui/sprite.h =================================================================== --- trunk/include/saggui/sprite.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/sprite.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. Modified: trunk/include/saggui/style.h =================================================================== --- trunk/include/saggui/style.h 2007-08-16 20:22:59 UTC (rev 454) +++ trunk/include/saggui/style.h 2007-08-16 22:20:24 UTC (rev 455) @@ -1,5 +1,5 @@ /* -SAGGUI (Simplified Allegro Gaming Graphical User Interface) +SAGGUI (Simplified All Gaming Graphical User Interface) Copyright (c) 2005-2007, Miguel A. Gavidia All rights reserved. @@ -44,7 +44,7 @@ #include "dllspec.h" #include <vector> -//! Simplified Allegro Gaming Graphical User Interface +//! Simplified All Gaming Graphical User Interface... [truncated message content] |
From: <sag...@li...> - 2007-08-19 10:01:36
|
Revision: 457 http://saggui.svn.sourceforge.net/saggui/?rev=457&view=rev Author: juvinious Date: 2007-08-19 03:01:33 -0700 (Sun, 19 Aug 2007) Log Message: ----------- Added several new members to system, resourcemanager, and guimanager to setup system externally without relying on saggui. Updated accordingly. Modified Paths: -------------- trunk/CHANGELOG trunk/include/saggui/gui_manager.h trunk/include/saggui/resource_manager.h trunk/include/saggui/system.h trunk/include/saggui/widgets/abstractbutton.h trunk/modules/agl/include/agl_system.h trunk/modules/agl/src/agl_system.cpp trunk/modules/allegro/include/al_system.h trunk/modules/allegro/src/al_system.cpp trunk/modules/openlayer/include/ol_system.h trunk/modules/openlayer/src/ol_system.cpp trunk/modules/palib/include/saggui/pa_system.h trunk/modules/palib/saggui/pa_system.cpp trunk/modules/profiler/include/profilesystem.h trunk/modules/profiler/src/profilesystem.cpp trunk/modules/sdl/include/sdl_system.h trunk/modules/sdl/src/sdl_system.cpp trunk/modules/sdlgl/include/sdlgl_system.h trunk/modules/sdlgl/src/sdlgl_system.cpp trunk/src/gui_manager.cpp trunk/src/resource_manager.cpp Modified: trunk/CHANGELOG =================================================================== --- trunk/CHANGELOG 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/CHANGELOG 2007-08-19 10:01:33 UTC (rev 457) @@ -1,4 +1,5 @@ 0.50 +- Added new member to system,resourceManager and guiManager to accomodate not having to use guiManagers setResolution - Made several commentary updates throughout the source - Added a profiler module to run tests and debug the library - Fixed compilation issues with PALib, updated to the most recent version of PALib as of 07/28/07 Modified: trunk/include/saggui/gui_manager.h =================================================================== --- trunk/include/saggui/gui_manager.h 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/include/saggui/gui_manager.h 2007-08-19 10:01:33 UTC (rev 457) @@ -58,8 +58,8 @@ class mouseManager; class resourceManager; class scheme; - class style; - class coord; + class style; + class coord; class keys; //! The Gui Manager Class @@ -71,69 +71,79 @@ */ class SAGGUI_EXPORT guiManager : public has_slots<> { - private: - //! ID number management - int WINDOW_ID; + public: + //! \name Public Members - //! This contains pointers to each created window (Every window must register with the Manager) - std::list<window *>windows; + //! Setup + static void setup(const std::string & sys, bool systemInitCalls=true); - //! Temp delete list - std::list< std::list<window *>::iterator >windowDelete; + //! Set system screen + static void setScreen(void *s, bool bitmapBuffers=true); - //! These are the main windows that are at the upper echelon (parents) - std::vector<window *>parents; + //! Resolution + static bool setupScreen(double width, double height, double depth=32, bool fullscreen=false, bool bitmapBuffers=true); - //! Temp delete queue - std::list< std::vector<window *>::iterator >parentDelete; + //! Add window + static void addWindow(window *w); - //! This points to the main bitmap buffer - graphic *dest; + //! Remove window + static void removeWindow(window *w); - //! Resource Manager - resourceManager *resources; + //! Fix window relationship + static void fixWindow(window *w); - //! Temp window holder to place currentWindowFocused in case the manager is disabled - window *tempWindowFocused; + //! Update + static void update(); - //! Current focused window - window *currentWindowFocused; + //! draw windows + static void renderWindows(); - //! Last focused window - window *lastWindowFocused; + //! Toggle if the system is active + static void toggleActive(); - //! Is guiManager initialized - bool initialized; + //! Get the current graphic bitmap + static graphic *getSystemBuffer(); + + //! Get the current set screen + static graphic *getScreen(); + + //! Set the current scheme + static void setScheme(scheme *s); + + //! Add a scheme + static void addScheme(scheme *s); + + //! Get the current default scheme + static scheme *getCurrentScheme(); - //! Is the system graphics loaded - bool systemGraphicsLoaded; + //! Get scheme list + static std::vector<scheme *> &getSchemes(); + + //! Set to use bitmap buffering if possible + static bool useBuffering(bool buffering=true); - //! window queue - bool newWindows; + //! Set the mouse clicking system ie left clicks or right clicks + static void setClickSystem(mouseButtons type= M_Left); - //! Is guiManager active - bool active; + //! Raises a window to the top + static void raiseWindowTop(window *w); - //! Viewport restriction - bool viewportRestrict; + //! Set window focused + static void setWindowFocused(window *w); - //! Prepare window for deletion - void addWindowForDeletion(window *w); - - //! Set window focus and trigger events - void setFocus(window *w); - - //! Raises window or its parent to the top of the vector - void raiseWindow(window *w); - - //! Recursive logic for windows and their children - void doWindowLogic(std::vector<window *>&winList); - - //! Recursive drawing for windows and their children - void doWindowRender(std::vector<window *>&winList, graphic *bmp); - - //! Assign style to a window - void assignWindowStyle(window *w); + //! Prevent windows from going outside viewport + static void restrictViewport(bool vp); + + // Remove later + static int getMouseOverWinIDWM(); + static std::string getMouseButtonInfoWM(); + + //! \name Signals + static signal0<> onResolutionChange; + static signal1<mouseButtons> switchClickSystem; + static signal0<> onUpdate; + static signal1<graphic *> drawUnderWindows; + static signal1<graphic *> drawOverWindows; protected: @@ -146,6 +156,9 @@ //! Destructor ~guiManager(); + //! Set screen + void setSystemScreen(void *s, bool bitmapBuffers); + //! Set resolution bool setResolution(double width, double height, double depth=32, bool fullscreen=false, bool bitmapBuffers=true); @@ -186,77 +199,69 @@ //! \name Keyboard Slots slot keyPress(const keys &k); slot keyRelease(const keys &k); + private: + //! ID number management + int WINDOW_ID; - public: - //! \name Public Members + //! This contains pointers to each created window (Every window must register with the Manager) + std::list<window *>windows; - //! Setup - static void setup(const std::string & sys, bool systemInitCalls=true); + //! Temp delete list + std::list< std::list<window *>::iterator >windowDelete; - //! Resolution - static bool setupScreen(double width, double height, double depth=32, bool fullscreen=false, bool bitmapBuffers=true); + //! These are the main windows that are at the upper echelon (parents) + std::vector<window *>parents; - //! Add window - static void addWindow(window *w); + //! Temp delete queue + std::list< std::vector<window *>::iterator >parentDelete; - //! Remove window - static void removeWindow(window *w); + //! This points to the main bitmap buffer + graphic *dest; - //! Fix window relationship - static void fixWindow(window *w); + //! Resource Manager + resourceManager *resources; - //! Update - static void update(); + //! Temp window holder to place currentWindowFocused in case the manager is disabled + window *tempWindowFocused; - //! draw windows - static void renderWindows(); + //! Current focused window + window *currentWindowFocused; - //! Toggle if the system is active - static void toggleActive(); + //! Last focused window + window *lastWindowFocused; - //! Get the current graphic bitmap - static graphic *getSystemBuffer(); - - //! Get the current set screen - static graphic *getScreen(); - - //! Set the current scheme - static void setScheme(scheme *s); - - //! Add a scheme - static void addScheme(scheme *s); - - //! Get the current default scheme - static scheme *getCurrentScheme(); + //! Is guiManager initialized + bool initialized; - //! Get scheme list - static std::vector<scheme *> &getSchemes(); - - //! Set to use bitmap buffering if possible - static bool useBuffering(bool buffering=true); + //! Is the system graphics loaded + bool systemGraphicsLoaded; - //! Set the mouse clicking system ie left clicks or right clicks - static void setClickSystem(mouseButtons type= M_Left); + //! window queue + bool newWindows; - //! Raises a window to the top - static void raiseWindowTop(window *w); + //! Is guiManager active + bool active; - //! Set window focused - static void setWindowFocused(window *w); + //! Viewport restriction + bool viewportRestrict; - //! Prevent windows from going outside viewport - static void restrictViewport(bool vp); - - // Remove later - static int getMouseOverWinIDWM(); - static std::string getMouseButtonInfoWM(); - - //! \name Signals - static signal0<> onResolutionChange; - static signal1<mouseButtons> switchClickSystem; - static signal0<> onUpdate; - static signal1<graphic *> drawUnderWindows; - static signal1<graphic *> drawOverWindows; + //! Prepare window for deletion + void addWindowForDeletion(window *w); + + //! Set window focus and trigger events + void setFocus(window *w); + + //! Raises window or its parent to the top of the vector + void raiseWindow(window *w); + + //! Recursive logic for windows and their children + void doWindowLogic(std::vector<window *>&winList); + + //! Recursive drawing for windows and their children + void doWindowRender(std::vector<window *>&winList, graphic *bmp); + + //! Assign style to a window + void assignWindowStyle(window *w); }; } Modified: trunk/include/saggui/resource_manager.h =================================================================== --- trunk/include/saggui/resource_manager.h 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/include/saggui/resource_manager.h 2007-08-19 10:01:33 UTC (rev 457) @@ -97,6 +97,9 @@ //! Setup the system bool setSystem(std::string sys, bool systemInitCalls=true); + //! Set system screen + void setSystemScreen(void *s); + //! Set screen resolution bool setScreen(double width, double height, double depth, bool fullscreen); Modified: trunk/include/saggui/system.h =================================================================== --- trunk/include/saggui/system.h 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/include/saggui/system.h 2007-08-19 10:01:33 UTC (rev 457) @@ -76,6 +76,10 @@ /*! Provides the means to which a library can set the Screen Resolution */ virtual bool setResolution(double width, double height, double depth=32, bool fullscreen=false)=0; + //! Set the screen of the actual system + /*! This is so that you can handle resolution calls yourself if you don't want saggui to do it for you */ + virtual void setSystemScreen(void *s)=0; + /*! Is this system capable of bitmap buffers? */ virtual bool canUseBitmapBuffers()=0; Modified: trunk/include/saggui/widgets/abstractbutton.h =================================================================== --- trunk/include/saggui/widgets/abstractbutton.h 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/include/saggui/widgets/abstractbutton.h 2007-08-19 10:01:33 UTC (rev 457) @@ -138,7 +138,7 @@ signal1<const coord &> pressed; signal1<const coord &> released; signal1<const coord &> clicked; - signal0<> toggled; + signal1<const bool> toggled; protected: //! Current set font Modified: trunk/modules/agl/include/agl_system.h =================================================================== --- trunk/modules/agl/include/agl_system.h 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/modules/agl/include/agl_system.h 2007-08-19 10:01:33 UTC (rev 457) @@ -78,6 +78,8 @@ //! Can use bitmap buffers bool canUseBitmapBuffers(); + void setSystemScreen(void *s); + //! Return screen Buffer graphic *getScreen(); }; Modified: trunk/modules/agl/src/agl_system.cpp =================================================================== --- trunk/modules/agl/src/agl_system.cpp 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/modules/agl/src/agl_system.cpp 2007-08-19 10:01:33 UTC (rev 457) @@ -109,6 +109,16 @@ return true; //return false; } + + + void aglSystem::setSystemScreen(void *s) + { + if(!aglScreen) + { + aglScreen = new allegroGraphic(); + } + setScreen(aglScreen,screen); + } //! Return screen Buffer graphic *aglSystem::getScreen() Modified: trunk/modules/allegro/include/al_system.h =================================================================== --- trunk/modules/allegro/include/al_system.h 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/modules/allegro/include/al_system.h 2007-08-19 10:01:33 UTC (rev 457) @@ -65,7 +65,7 @@ //! Constructor allegroSystem(); //! Destructor - ~allegroSystem(); + virtual ~allegroSystem(); //! Initialize the system bool setup(); @@ -79,6 +79,8 @@ //! Can use bitmap buffers bool canUseBitmapBuffers(); + void setSystemScreen(void *s); + //! Return screen Buffer graphic *getScreen(); }; Modified: trunk/modules/allegro/src/al_system.cpp =================================================================== --- trunk/modules/allegro/src/al_system.cpp 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/modules/allegro/src/al_system.cpp 2007-08-19 10:01:33 UTC (rev 457) @@ -99,6 +99,16 @@ return true; } + //! Set system screen + void allegroSystem::setSystemScreen(void *s) + { + if(!allegroScreen) + { + allegroScreen = new allegroGraphic(); + } + setScreen(allegroScreen,screen); + } + //! Can use bitmap buffers bool allegroSystem::canUseBitmapBuffers() { Modified: trunk/modules/openlayer/include/ol_system.h =================================================================== --- trunk/modules/openlayer/include/ol_system.h 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/modules/openlayer/include/ol_system.h 2007-08-19 10:01:33 UTC (rev 457) @@ -79,6 +79,9 @@ //! Can use bitmap buffers bool canUseBitmapBuffers(); + + void setSystemScreen(void *s); + //! Return screen Buffer graphic *getScreen(); }; Modified: trunk/modules/openlayer/src/ol_system.cpp =================================================================== --- trunk/modules/openlayer/src/ol_system.cpp 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/modules/openlayer/src/ol_system.cpp 2007-08-19 10:01:33 UTC (rev 457) @@ -100,6 +100,15 @@ return( true ); } + void olSystem::setSystemScreen(void *s) + { + if(!olScreen) + { + olScreen = new olGraphic(); + setScreen(olScreen,0); + } + } + //! Can use bitmap buffers bool olSystem::canUseBitmapBuffers() { Modified: trunk/modules/palib/include/saggui/pa_system.h =================================================================== --- trunk/modules/palib/include/saggui/pa_system.h 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/modules/palib/include/saggui/pa_system.h 2007-08-19 10:01:33 UTC (rev 457) @@ -71,6 +71,8 @@ //! Set screen resolution and color depth bool setResolution(double width, double height, double depth=32, bool fullscreen=false); + void setSystemScreen(void *s); + //! Can use bitmap buffers bool canUseBitmapBuffers(); Modified: trunk/modules/palib/saggui/pa_system.cpp =================================================================== --- trunk/modules/palib/saggui/pa_system.cpp 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/modules/palib/saggui/pa_system.cpp 2007-08-19 10:01:33 UTC (rev 457) @@ -101,6 +101,17 @@ return true; } + void paSystem::setSystemScreen(void *s) + { + if(!paScreen) + { + paScreen = new paGraphic(); + paScreen->width = 255; + paScreen->height = 191; + } + setScreen(paScreen,s); + } + //! Can use bitmap buffers bool paSystem::canUseBitmapBuffers() { Modified: trunk/modules/profiler/include/profilesystem.h =================================================================== --- trunk/modules/profiler/include/profilesystem.h 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/modules/profiler/include/profilesystem.h 2007-08-19 10:01:33 UTC (rev 457) @@ -71,6 +71,8 @@ //! Set screen resolution and color depth bool setResolution(double width, double height, double depth=32, bool fullscreen=false); + void setSystemScreen(void *s); + //! Can use bitmap buffers bool canUseBitmapBuffers(); Modified: trunk/modules/profiler/src/profilesystem.cpp =================================================================== --- trunk/modules/profiler/src/profilesystem.cpp 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/modules/profiler/src/profilesystem.cpp 2007-08-19 10:01:33 UTC (rev 457) @@ -74,6 +74,11 @@ { return true; } + + void profileSystem::setSystemScreen(void *s) + { + s = s; + } //! Can use bitmap buffers bool profileSystem::canUseBitmapBuffers() Modified: trunk/modules/sdl/include/sdl_system.h =================================================================== --- trunk/modules/sdl/include/sdl_system.h 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/modules/sdl/include/sdl_system.h 2007-08-19 10:01:33 UTC (rev 457) @@ -72,6 +72,8 @@ //! Set screen resolution and color depth bool setResolution(double width, double height, double depth=32, bool fullscreen=false); + void setSystemScreen(void *s); + //! Can use bitmap buffers bool canUseBitmapBuffers(); Modified: trunk/modules/sdl/src/sdl_system.cpp =================================================================== --- trunk/modules/sdl/src/sdl_system.cpp 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/modules/sdl/src/sdl_system.cpp 2007-08-19 10:01:33 UTC (rev 457) @@ -44,7 +44,7 @@ namespace saggui { static graphic *sdlScreen=0; - bool sdlSystem::isScreenSetup = false; + bool sdlSystem::isScreenSetup=false; //init sdlSystem::sdlSystem() @@ -96,6 +96,13 @@ return true; } + void sdlSystem::setSystemScreen(void *s) + { + if(!sdlScreen)sdlScreen = new sdlGraphic(); + setScreen(sdlScreen, s); + isScreenSetup = true; + } + //! Can use bitmap buffers bool sdlSystem::canUseBitmapBuffers() { Modified: trunk/modules/sdlgl/include/sdlgl_system.h =================================================================== --- trunk/modules/sdlgl/include/sdlgl_system.h 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/modules/sdlgl/include/sdlgl_system.h 2007-08-19 10:01:33 UTC (rev 457) @@ -71,6 +71,8 @@ //! Set screen resolution and color depth bool setResolution(double width, double height, double depth=32, bool fullscreen=false); + void setSystemScreen(void *s); + //! Can use bitmap buffers bool canUseBitmapBuffers(); Modified: trunk/modules/sdlgl/src/sdlgl_system.cpp =================================================================== --- trunk/modules/sdlgl/src/sdlgl_system.cpp 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/modules/sdlgl/src/sdlgl_system.cpp 2007-08-19 10:01:33 UTC (rev 457) @@ -107,6 +107,13 @@ return true; } + + void sdlglSystem::setSystemScreen(void *s) + { + if(!sdlglScreen)sdlglScreen = new sdlglGraphic(); + setScreen(sdlglScreen,s); + } + //! Can use bitmap buffers bool sdlglSystem::canUseBitmapBuffers() { Modified: trunk/src/gui_manager.cpp =================================================================== --- trunk/src/gui_manager.cpp 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/src/gui_manager.cpp 2007-08-19 10:01:33 UTC (rev 457) @@ -305,6 +305,20 @@ } } + //! Set screen + void guiManager::setSystemScreen(void *s, bool bitmapBuffers) + { + resources->setSystemScreen(s); + + enableBuffering(bitmapBuffers); + + if(!systemGraphicsLoaded) + { + mouseManager::loadDefaultImages(); + systemGraphicsLoaded = true; + } + } + // Set resolution bool guiManager::setResolution(double width, double height, double depth, bool fullscreen, bool bitmapBuffers) { @@ -706,6 +720,13 @@ } } + // Set system screen + void guiManager::setScreen(void *s, bool bitmapBuffers) + { + if(!windowManager)return; + windowManager->setSystemScreen(s, bitmapBuffers); + } + // resolution bool guiManager::setupScreen(double width, double height, double depth, bool fullscreen, bool bitmapBuffers) { Modified: trunk/src/resource_manager.cpp =================================================================== --- trunk/src/resource_manager.cpp 2007-08-17 00:07:10 UTC (rev 456) +++ trunk/src/resource_manager.cpp 2007-08-19 10:01:33 UTC (rev 457) @@ -177,8 +177,20 @@ reInitGraphics(); initialized=true; + + // Load system font + registerFont<bmpFont>(); + return true; } + + void resourceManager::setSystemScreen(void *s) + { + systemManager->setSystemScreen(s); + screenWidth = systemManager->getScreen()->getBmpWidth(); + screenHeight = systemManager->getScreen()->getBmpHeight(); + reInitGraphics(); + } // Set resolution bool resourceManager::setScreen(double width, double height, double depth, bool fullscreen) @@ -190,11 +202,6 @@ reInitGraphics(); screenWidth = width; screenHeight = height; - if(temp) - { - // Load system font - registerFont<bmpFont>(); - } return temp; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@li...> - 2007-08-20 20:52:58
|
Revision: 458 http://saggui.svn.sourceforge.net/saggui/?rev=458&view=rev Author: juvinious Date: 2007-08-20 13:52:54 -0700 (Mon, 20 Aug 2007) Log Message: ----------- Modified doxyfile, fixed scrollbar and polished style a bit Modified Paths: -------------- trunk/docs/Doxyfile trunk/src/style.cpp trunk/src/widgets/scroll_bar.cpp Modified: trunk/docs/Doxyfile =================================================================== --- trunk/docs/Doxyfile 2007-08-19 10:01:33 UTC (rev 457) +++ trunk/docs/Doxyfile 2007-08-20 20:52:54 UTC (rev 458) @@ -4,7 +4,7 @@ # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = "Simplified All Gaming Graphical User Interface (SAGGUI)" -PROJECT_NUMBER = +PROJECT_NUMBER = 0.50 OUTPUT_DIRECTORY = docs CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English Modified: trunk/src/style.cpp =================================================================== --- trunk/src/style.cpp 2007-08-19 10:01:33 UTC (rev 457) +++ trunk/src/style.cpp 2007-08-20 20:52:54 UTC (rev 458) @@ -107,8 +107,8 @@ bmp->doLine(size.x+size.width,size.y,size.x+size.width,size.y+size.height,colors[S_StandardFg]); if((flags & AT_MouseOver) && (flags && AT_Raised)) { - bmp->doLine(size.x,size.y,size.x + size.width,size.y,rgba::WHITE); - bmp->doLine(size.x,size.y+size.height,size.x + size.width,size.y+size.height,rgba::WHITE); + bmp->doLine(size.x,size.y,size.x + size.width, size.y,rgba::GRAY); + bmp->doLine(size.x,size.y+size.height,size.x + size.width,size.y+size.height,rgba::GRAY); } else { Modified: trunk/src/widgets/scroll_bar.cpp =================================================================== --- trunk/src/widgets/scroll_bar.cpp 2007-08-19 10:01:33 UTC (rev 457) +++ trunk/src/widgets/scroll_bar.cpp 2007-08-20 20:52:54 UTC (rev 458) @@ -60,7 +60,7 @@ pauseTime = 500; buttonDir = NONE; mouseLocation = NONE; - buttonIncrement = scrollAreaIncrement = scrollWheelIncrement = 0; + //buttonIncrement = scrollAreaIncrement = scrollWheelIncrement = 0; setType(AT_Horizontal); setStyle(BUTTONORIG); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@li...> - 2007-08-24 21:23:20
|
Revision: 459 http://saggui.svn.sourceforge.net/saggui/?rev=459&view=rev Author: juvinious Date: 2007-08-24 14:23:12 -0700 (Fri, 24 Aug 2007) Log Message: ----------- Added creational engine to support creating widgets from markup. Added in xml module made with tinyxml. Modified Paths: -------------- trunk/CMakeLists.txt Added Paths: ----------- trunk/include/saggui/creationengine.h trunk/modules/sagguixml/ trunk/modules/sagguixml/CMakeLists.txt trunk/modules/sagguixml/include/ trunk/modules/sagguixml/include/sagguixml.h trunk/modules/sagguixml/include/tinystr.h trunk/modules/sagguixml/include/tinyxml.h trunk/modules/sagguixml/saggui_xml.h trunk/modules/sagguixml/src/ trunk/modules/sagguixml/src/sagguixml.cpp trunk/modules/sagguixml/src/tinystr.cpp trunk/modules/sagguixml/src/tinyxml.cpp trunk/modules/sagguixml/src/tinyxmlerror.cpp trunk/modules/sagguixml/src/tinyxmlparser.cpp trunk/src/creationengine.cpp Modified: trunk/CMakeLists.txt =================================================================== --- trunk/CMakeLists.txt 2007-08-20 20:52:54 UTC (rev 458) +++ trunk/CMakeLists.txt 2007-08-24 21:23:12 UTC (rev 459) @@ -261,6 +261,7 @@ endif(ENABLE_SDLGL) add_subdirectory(${CMAKE_SOURCE_DIR}/modules/profiler) +add_subdirectory(${CMAKE_SOURCE_DIR}/modules/sagguixml) add_subdirectory(${CMAKE_SOURCE_DIR}/examples/demo) add_subdirectory(${CMAKE_SOURCE_DIR}/examples/gamedemo) add_subdirectory(${CMAKE_SOURCE_DIR}/examples/widgets) Copied: trunk/include/saggui/creationengine.h (from rev 458, trunk/include/saggui/font.h) =================================================================== --- trunk/include/saggui/creationengine.h (rev 0) +++ trunk/include/saggui/creationengine.h 2007-08-24 21:23:12 UTC (rev 459) @@ -0,0 +1,87 @@ +/* +SAGGUI (Simplified All Gaming Graphical User Interface) +Copyright (c) 2005-2007, Miguel A. Gavidia +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + * Neither the name of the "SAGGUI" nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef CREATION_ENGINE_H +#define CREATION_ENGINE_H + +#include <string> +#include <map> +#include "sigslot.h" +#include "dllspec.h" + +//! Simplified All Gaming Graphical User Interface +/*! + This is the naming convention for this SAGGUI lib. +*/ +namespace saggui +{ + class window; + + //! The Base Creational Engine Class + /*! + * This is the Creational Engine class. This provides a means to + * create custom engine to build widgets by means of xml or some other context. + */ + class SAGGUI_EXPORT creationEngine + { + public: + //! constructor + creationEngine(); + + //! destructor + virtual ~creationEngine(); + + //! load data + virtual void load(const std::string &filename)=0; + + //! find + window *find(const std::string &name); + + //! Get root window + window *getRootWindow(); + + protected: + //! Root window of entire engine + window *rootWindow; + + //! Map of all widgets + std::map<const std::string, window *> windows; + }; +} + +#endif Copied: trunk/modules/sagguixml/CMakeLists.txt (from rev 458, trunk/modules/allegro/CMakeLists.txt) =================================================================== --- trunk/modules/sagguixml/CMakeLists.txt (rev 0) +++ trunk/modules/sagguixml/CMakeLists.txt 2007-08-24 21:23:12 UTC (rev 459) @@ -0,0 +1,28 @@ +# ------------------------------------------------------- +# SAGGUI cmake build script to create sagguixml module called from +# main build +# Written by: juvinious +# ------------------------------------------------------- + +include_directories(include) + +set(XML_SRC src/sagguixml.cpp src/tinystr.cpp src/tinyxml.cpp src/tinyxmlerror.cpp src/tinyxmlparser.cpp) + +add_library(saggui-xml ${CREATE_STATIC_LIB} ${XML_SRC}) +target_link_libraries(saggui-xml) + +file(GLOB HEADERS ${CMAKE_SOURCE_DIR}/modules/sagguixml/include/*.h) +foreach(f ${HEADERS}) + STRING(REGEX REPLACE ".*/" "" name1 ${f}) + configure_file(${f} ${CMAKE_BINARY_DIR}/include/saggui/xml/${name1} COPYONLY) +endforeach(f ${HEADERS}) +configure_file(saggui_xml.h ${CMAKE_BINARY_DIR}/include/saggui_xml.h COPYONLY) + +if(CMAKE_PATCH_VERSION EQUAL 3 OR CMAKE_PATCH_VERSION LESS 3) + file(GLOB HEADERS ${CMAKE_SOURCE_DIR}/modules/sagguixml/include/*.h) + install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/saggui/xml) +else(CMAKE_PATCH_VERSION EQUAL 3 OR CMAKE_PATCH_VERSION LESS 3) + install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/saggui/xml PATTERN ".svn" EXCLUDE PATTERN "*~" EXCLUDE) +endif(CMAKE_PATCH_VERSION EQUAL 3 OR CMAKE_PATCH_VERSION LESS 3) +install(FILES saggui_xml.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include) +install(TARGETS saggui-xml DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) \ No newline at end of file Added: trunk/modules/sagguixml/include/sagguixml.h =================================================================== --- trunk/modules/sagguixml/include/sagguixml.h (rev 0) +++ trunk/modules/sagguixml/include/sagguixml.h 2007-08-24 21:23:12 UTC (rev 459) @@ -0,0 +1,68 @@ +/* +SAGGUI (Simplified All Gaming Graphical User Interface) +Copyright (c) 2005-2007, Miguel A. Gavidia +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + * Neither the name of the "SAGGUI" nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef XML_ENGINE_H +#define XML_ENGINE_H + +#include "saggui/creationengine.h" + +//! Simplified All Gaming Graphical User Interface +/*! + This is the naming convention for this SAGGUI lib. +*/ +namespace saggui +{ + //! The XML Creational Engine Class + /*! + * Create widgets utilizing XML. + */ + class SAGGUI_EXT_EXPORT xmlEngine : public creationEngine + { + public: + //! constructor + xmlEngine(); + + //! destructor + virtual ~xmlEngine(); + + //! load data + virtual void load(const std::string &filename); + }; +} + +#endif Added: trunk/modules/sagguixml/include/tinystr.h =================================================================== --- trunk/modules/sagguixml/include/tinystr.h (rev 0) +++ trunk/modules/sagguixml/include/tinystr.h 2007-08-24 21:23:12 UTC (rev 459) @@ -0,0 +1,319 @@ +/* +www.sourceforge.net/projects/tinyxml +Original file by Yves Berquin. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + +/* + * THIS FILE WAS ALTERED BY Tyge Lovset, 7. April 2005. + * + * - completely rewritten. compact, clean, and fast implementation. + * - sizeof(TiXmlString) = pointer size (4 bytes on 32-bit systems) + * - fixed reserve() to work as per specification. + * - fixed buggy compares operator==(), operator<(), and operator>() + * - fixed operator+=() to take a const ref argument, following spec. + * - added "copy" constructor with length, and most compare operators. + * - added swap(), clear(), size(), capacity(), operator+(). + */ + +#ifndef TIXML_USE_STL + +#ifndef TIXML_STRING_INCLUDED +#define TIXML_STRING_INCLUDED + +#include <assert.h> +#include <string.h> + +/* The support for explicit isn't that universal, and it isn't really + required - it is used to check that the TiXmlString class isn't incorrectly + used. Be nice to old compilers and macro it here: +*/ +#if defined(_MSC_VER) && (_MSC_VER >= 1200 ) + // Microsoft visual studio, version 6 and higher. + #define TIXML_EXPLICIT explicit +#elif defined(__GNUC__) && (__GNUC__ >= 3 ) + // GCC version 3 and higher.s + #define TIXML_EXPLICIT explicit +#else + #define TIXML_EXPLICIT +#endif + + +/* + TiXmlString is an emulation of a subset of the std::string template. + Its purpose is to allow compiling TinyXML on compilers with no or poor STL support. + Only the member functions relevant to the TinyXML project have been implemented. + The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase + a string and there's no more room, we allocate a buffer twice as big as we need. +*/ +class TiXmlString +{ + public : + // The size type used + typedef size_t size_type; + + // Error value for find primitive + static const size_type npos; // = -1; + + + // TiXmlString empty constructor + TiXmlString () : rep_(&nullrep_) + { + } + + // TiXmlString copy constructor + TiXmlString ( const TiXmlString & copy) : rep_(0) + { + init(copy.length()); + memcpy(start(), copy.data(), length()); + } + + // TiXmlString constructor, based on a string + TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(0) + { + init( static_cast<size_type>( strlen(copy) )); + memcpy(start(), copy, length()); + } + + // TiXmlString constructor, based on a string + TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(0) + { + init(len); + memcpy(start(), str, len); + } + + // TiXmlString destructor + ~TiXmlString () + { + quit(); + } + + // = operator + TiXmlString& operator = (const char * copy) + { + return assign( copy, (size_type)strlen(copy)); + } + + // = operator + TiXmlString& operator = (const TiXmlString & copy) + { + return assign(copy.start(), copy.length()); + } + + + // += operator. Maps to append + TiXmlString& operator += (const char * suffix) + { + return append(suffix, static_cast<size_type>( strlen(suffix) )); + } + + // += operator. Maps to append + TiXmlString& operator += (char single) + { + return append(&single, 1); + } + + // += operator. Maps to append + TiXmlString& operator += (const TiXmlString & suffix) + { + return append(suffix.data(), suffix.length()); + } + + + // Convert a TiXmlString into a null-terminated char * + const char * c_str () const { return rep_->str; } + + // Convert a TiXmlString into a char * (need not be null terminated). + const char * data () const { return rep_->str; } + + // Return the length of a TiXmlString + size_type length () const { return rep_->size; } + + // Alias for length() + size_type size () const { return rep_->size; } + + // Checks if a TiXmlString is empty + bool empty () const { return rep_->size == 0; } + + // Return capacity of string + size_type capacity () const { return rep_->capacity; } + + + // single char extraction + const char& at (size_type index) const + { + assert( index < length() ); + return rep_->str[ index ]; + } + + // [] operator + char& operator [] (size_type index) const + { + assert( index < length() ); + return rep_->str[ index ]; + } + + // find a char in a string. Return TiXmlString::npos if not found + size_type find (char lookup) const + { + return find(lookup, 0); + } + + // find a char in a string from an offset. Return TiXmlString::npos if not found + size_type find (char tofind, size_type offset) const + { + if (offset >= length()) return npos; + + for (const char* p = c_str() + offset; *p != '\0'; ++p) + { + if (*p == tofind) return static_cast< size_type >( p - c_str() ); + } + return npos; + } + + void clear () + { + //Lee: + //The original was just too strange, though correct: + // TiXmlString().swap(*this); + //Instead use the quit & re-init: + quit(); + init(0,0); + } + + /* Function to reserve a big amount of data when we know we'll need it. Be aware that this + function DOES NOT clear the content of the TiXmlString if any exists. + */ + void reserve (size_type cap); + + TiXmlString& assign (const char* str, size_type len); + + TiXmlString& append (const char* str, size_type len); + + void swap (TiXmlString& other) + { + Rep* r = rep_; + rep_ = other.rep_; + other.rep_ = r; + } + + private: + + void init(size_type sz) { init(sz, sz); } + void set_size(size_type sz) { rep_->str[ rep_->size = sz ] = '\0'; } + char* start() const { return rep_->str; } + char* finish() const { return rep_->str + rep_->size; } + + struct Rep + { + size_type size, capacity; + char str[1]; + }; + + void init(size_type sz, size_type cap) + { + if (cap) + { + // Lee: the original form: + // rep_ = static_cast<Rep*>(operator new(sizeof(Rep) + cap)); + // doesn't work in some cases of new being overloaded. Switching + // to the normal allocation, although use an 'int' for systems + // that are overly picky about structure alignment. + const size_type bytesNeeded = sizeof(Rep) + cap; + const size_type intsNeeded = ( bytesNeeded + sizeof(int) - 1 ) / sizeof( int ); + rep_ = reinterpret_cast<Rep*>( new int[ intsNeeded ] ); + + rep_->str[ rep_->size = sz ] = '\0'; + rep_->capacity = cap; + } + else + { + rep_ = &nullrep_; + } + } + + void quit() + { + if (rep_ != &nullrep_) + { + // The rep_ is really an array of ints. (see the allocator, above). + // Cast it back before delete, so the compiler won't incorrectly call destructors. + delete [] ( reinterpret_cast<int*>( rep_ ) ); + } + } + + Rep * rep_; + static Rep nullrep_; + +} ; + + +inline bool operator == (const TiXmlString & a, const TiXmlString & b) +{ + return ( a.length() == b.length() ) // optimization on some platforms + && ( strcmp(a.c_str(), b.c_str()) == 0 ); // actual compare +} +inline bool operator < (const TiXmlString & a, const TiXmlString & b) +{ + return strcmp(a.c_str(), b.c_str()) < 0; +} + +inline bool operator != (const TiXmlString & a, const TiXmlString & b) { return !(a == b); } +inline bool operator > (const TiXmlString & a, const TiXmlString & b) { return b < a; } +inline bool operator <= (const TiXmlString & a, const TiXmlString & b) { return !(b < a); } +inline bool operator >= (const TiXmlString & a, const TiXmlString & b) { return !(a < b); } + +inline bool operator == (const TiXmlString & a, const char* b) { return strcmp(a.c_str(), b) == 0; } +inline bool operator == (const char* a, const TiXmlString & b) { return b == a; } +inline bool operator != (const TiXmlString & a, const char* b) { return !(a == b); } +inline bool operator != (const char* a, const TiXmlString & b) { return !(b == a); } + +TiXmlString operator + (const TiXmlString & a, const TiXmlString & b); +TiXmlString operator + (const TiXmlString & a, const char* b); +TiXmlString operator + (const char* a, const TiXmlString & b); + + +/* + TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString. + Only the operators that we need for TinyXML have been developped. +*/ +class TiXmlOutStream : public TiXmlString +{ +public : + + // TiXmlOutStream << operator. + TiXmlOutStream & operator << (const TiXmlString & in) + { + *this += in; + return *this; + } + + // TiXmlOutStream << operator. + TiXmlOutStream & operator << (const char * in) + { + *this += in; + return *this; + } + +} ; + +#endif // TIXML_STRING_INCLUDED +#endif // TIXML_USE_STL Added: trunk/modules/sagguixml/include/tinyxml.h =================================================================== --- trunk/modules/sagguixml/include/tinyxml.h (rev 0) +++ trunk/modules/sagguixml/include/tinyxml.h 2007-08-24 21:23:12 UTC (rev 459) @@ -0,0 +1,1804 @@ +/* +www.sourceforge.net/projects/tinyxml +Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + + +#ifndef TINYXML_INCLUDED +#define TINYXML_INCLUDED + +#ifdef _MSC_VER +#pragma warning( push ) +#pragma warning( disable : 4530 ) +#pragma warning( disable : 4786 ) +#endif + +#include <ctype.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <assert.h> + +#define TIXML_USE_STL + +// Help out windows: +#if defined( _DEBUG ) && !defined( DEBUG ) +#define DEBUG +#endif + +#ifdef TIXML_USE_STL + #include <string> + #include <iostream> + #include <sstream> + #define TIXML_STRING std::string +#else + #include "tinystr.h" + #define TIXML_STRING TiXmlString +#endif + +// Deprecated library function hell. Compilers want to use the +// new safe versions. This probably doesn't fully address the problem, +// but it gets closer. There are too many compilers for me to fully +// test. If you get compilation troubles, undefine TIXML_SAFE +#define TIXML_SAFE + +#ifdef TIXML_SAFE + #if defined(_MSC_VER) && (_MSC_VER >= 1400 ) + // Microsoft visual studio, version 2005 and higher. + #define TIXML_SNPRINTF _snprintf_s + #define TIXML_SNSCANF _snscanf_s + #define TIXML_SSCANF sscanf_s + #elif defined(_MSC_VER) && (_MSC_VER >= 1200 ) + // Microsoft visual studio, version 6 and higher. + //#pragma message( "Using _sn* functions." ) + #define TIXML_SNPRINTF _snprintf + #define TIXML_SNSCANF _snscanf + #define TIXML_SSCANF sscanf + #elif defined(__GNUC__) && (__GNUC__ >= 3 ) + // GCC version 3 and higher.s + //#warning( "Using sn* functions." ) + #define TIXML_SNPRINTF snprintf + #define TIXML_SNSCANF snscanf + #define TIXML_SSCANF sscanf + #else + #define TIXML_SSCANF sscanf + #endif +#endif + +class TiXmlDocument; +class TiXmlElement; +class TiXmlComment; +class TiXmlUnknown; +class TiXmlAttribute; +class TiXmlText; +class TiXmlDeclaration; +class TiXmlParsingData; + +const int TIXML_MAJOR_VERSION = 2; +const int TIXML_MINOR_VERSION = 5; +const int TIXML_PATCH_VERSION = 3; + +/* Internal structure for tracking location of items + in the XML file. +*/ +struct TiXmlCursor +{ + TiXmlCursor() { Clear(); } + void Clear() { row = col = -1; } + + int row; // 0 based. + int col; // 0 based. +}; + + +/** + If you call the Accept() method, it requires being passed a TiXmlVisitor + class to handle callbacks. For nodes that contain other nodes (Document, Element) + you will get called with a VisitEnter/VisitExit pair. Nodes that are always leaves + are simple called with Visit(). + + If you return 'true' from a Visit method, recursive parsing will continue. If you return + false, <b>no children of this node or its sibilings</b> will be Visited. + + All flavors of Visit methods have a default implementation that returns 'true' (continue + visiting). You need to only override methods that are interesting to you. + + Generally Accept() is called on the TiXmlDocument, although all nodes suppert Visiting. + + You should never change the document from a callback. + + @sa TiXmlNode::Accept() +*/ +class TiXmlVisitor +{ +public: + virtual ~TiXmlVisitor() {} + + /// Visit a document. + virtual bool VisitEnter( const TiXmlDocument& /*doc*/ ) { return true; } + /// Visit a document. + virtual bool VisitExit( const TiXmlDocument& /*doc*/ ) { return true; } + + /// Visit an element. + virtual bool VisitEnter( const TiXmlElement& /*element*/, const TiXmlAttribute* /*firstAttribute*/ ) { return true; } + /// Visit an element. + virtual bool VisitExit( const TiXmlElement& /*element*/ ) { return true; } + + /// Visit a declaration + virtual bool Visit( const TiXmlDeclaration& /*declaration*/ ) { return true; } + /// Visit a text node + virtual bool Visit( const TiXmlText& /*text*/ ) { return true; } + /// Visit a comment node + virtual bool Visit( const TiXmlComment& /*comment*/ ) { return true; } + /// Visit an unknow node + virtual bool Visit( const TiXmlUnknown& /*unknown*/ ) { return true; } +}; + +// Only used by Attribute::Query functions +enum +{ + TIXML_SUCCESS, + TIXML_NO_ATTRIBUTE, + TIXML_WRONG_TYPE +}; + + +// Used by the parsing routines. +enum TiXmlEncoding +{ + TIXML_ENCODING_UNKNOWN, + TIXML_ENCODING_UTF8, + TIXML_ENCODING_LEGACY +}; + +const TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN; + +/** TiXmlBase is a base class for every class in TinyXml. + It does little except to establish that TinyXml classes + can be printed and provide some utility functions. + + In XML, the document and elements can contain + other elements and other types of nodes. + + @verbatim + A Document can contain: Element (container or leaf) + Comment (leaf) + Unknown (leaf) + Declaration( leaf ) + + An Element can contain: Element (container or leaf) + Text (leaf) + Attributes (not on tree) + Comment (leaf) + Unknown (leaf) + + A Decleration contains: Attributes (not on tree) + @endverbatim +*/ +class TiXmlBase +{ + friend class TiXmlNode; + friend class TiXmlElement; + friend class TiXmlDocument; + +public: + TiXmlBase() : userData(0) {} + virtual ~TiXmlBase() {} + + /** All TinyXml classes can print themselves to a filestream + or the string class (TiXmlString in non-STL mode, std::string + in STL mode.) Either or both cfile and str can be null. + + This is a formatted print, and will insert + tabs and newlines. + + (For an unformatted stream, use the << operator.) + */ + virtual void Print( FILE* cfile, int depth ) const = 0; + + /** The world does not agree on whether white space should be kept or + not. In order to make everyone happy, these global, static functions + are provided to set whether or not TinyXml will condense all white space + into a single space or not. The default is to condense. Note changing this + value is not thread safe. + */ + static void SetCondenseWhiteSpace( bool condense ) { condenseWhiteSpace = condense; } + + /// Return the current white space setting. + static bool IsWhiteSpaceCondensed() { return condenseWhiteSpace; } + + /** Return the position, in the original source file, of this node or attribute. + The row and column are 1-based. (That is the first row and first column is + 1,1). If the returns values are 0 or less, then the parser does not have + a row and column value. + + Generally, the row and column value will be set when the TiXmlDocument::Load(), + TiXmlDocument::LoadFile(), or any TiXmlNode::Parse() is called. It will NOT be set + when the DOM was created from operator>>. + + The values reflect the initial load. Once the DOM is modified programmatically + (by adding or changing nodes and attributes) the new values will NOT update to + reflect changes in the document. + + There is a minor performance cost to computing the row and column. Computation + can be disabled if TiXmlDocument::SetTabSize() is called with 0 as the value. + + @sa TiXmlDocument::SetTabSize() + */ + int Row() const { return location.row + 1; } + int Column() const { return location.col + 1; } ///< See Row() + + void SetUserData( void* user ) { userData = user; } ///< Set a pointer to arbitrary user data. + void* GetUserData() { return userData; } ///< Get a pointer to arbitrary user data. + const void* GetUserData() const { return userData; } ///< Get a pointer to arbitrary user data. + + // Table that returs, for a given lead byte, the total number of bytes + // in the UTF-8 sequence. + static const int utf8ByteTable[256]; + + virtual const char* Parse( const char* p, + TiXmlParsingData* data, + TiXmlEncoding encoding /*= TIXML_ENCODING_UNKNOWN */ ) = 0; + + /** Expands entities in a string. Note this should not contian the tag's '<', '>', etc, + or they will be transformed into entities! + */ + static void EncodeString( const TIXML_STRING& str, TIXML_STRING* out ); + + enum + { + TIXML_NO_ERROR = 0, + TIXML_ERROR, + TIXML_ERROR_OPENING_FILE, + TIXML_ERROR_OUT_OF_MEMORY, + TIXML_ERROR_PARSING_ELEMENT, + TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, + TIXML_ERROR_READING_ELEMENT_VALUE, + TIXML_ERROR_READING_ATTRIBUTES, + TIXML_ERROR_PARSING_EMPTY, + TIXML_ERROR_READING_END_TAG, + TIXML_ERROR_PARSING_UNKNOWN, + TIXML_ERROR_PARSING_COMMENT, + TIXML_ERROR_PARSING_DECLARATION, + TIXML_ERROR_DOCUMENT_EMPTY, + TIXML_ERROR_EMBEDDED_NULL, + TIXML_ERROR_PARSING_CDATA, + TIXML_ERROR_DOCUMENT_TOP_ONLY, + + TIXML_ERROR_STRING_COUNT + }; + +protected: + + static const char* SkipWhiteSpace( const char*, TiXmlEncoding encoding ); + inline static bool IsWhiteSpace( char c ) + { + return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' ); + } + inline static bool IsWhiteSpace( int c ) + { + if ( c < 256 ) + return IsWhiteSpace( (char) c ); + return false; // Again, only truly correct for English/Latin...but usually works. + } + + #ifdef TIXML_USE_STL + static bool StreamWhiteSpace( std::istream * in, TIXML_STRING * tag ); + static bool StreamTo( std::istream * in, int character, TIXML_STRING * tag ); + #endif + + /* Reads an XML name into the string provided. Returns + a pointer just past the last character of the name, + or 0 if the function has an error. + */ + static const char* ReadName( const char* p, TIXML_STRING* name, TiXmlEncoding encoding ); + + /* Reads text. Returns a pointer past the given end tag. + Wickedly complex options, but it keeps the (sensitive) code in one place. + */ + static const char* ReadText( const char* in, // where to start + TIXML_STRING* text, // the string read + bool ignoreWhiteSpace, // whether to keep the white space + const char* endTag, // what ends this text + bool ignoreCase, // whether to ignore case in the end tag + TiXmlEncoding encoding ); // the current encoding + + // If an entity has been found, transform it into a character. + static const char* GetEntity( const char* in, char* value, int* length, TiXmlEncoding encoding ); + + // Get a character, while interpreting entities. + // The length can be from 0 to 4 bytes. + inline static const char* GetChar( const char* p, char* _value, int* length, TiXmlEncoding encoding ) + { + assert( p ); + if ( encoding == TIXML_ENCODING_UTF8 ) + { + *length = utf8ByteTable[ *((const unsigned char*)p) ]; + assert( *length >= 0 && *length < 5 ); + } + else + { + *length = 1; + } + + if ( *length == 1 ) + { + if ( *p == '&' ) + return GetEntity( p, _value, length, encoding ); + *_value = *p; + return p+1; + } + else if ( *length ) + { + //strncpy( _value, p, *length ); // lots of compilers don't like this function (unsafe), + // and the null terminator isn't needed + for( int i=0; p[i] && i<*length; ++i ) { + _value[i] = p[i]; + } + return p + (*length); + } + else + { + // Not valid text. + return 0; + } + } + + // Return true if the next characters in the stream are any of the endTag sequences. + // Ignore case only works for english, and should only be relied on when comparing + // to English words: StringEqual( p, "version", true ) is fine. + static bool StringEqual( const char* p, + const char* endTag, + bool ignoreCase, + TiXmlEncoding encoding ); + + static const char* errorString[ TIXML_ERROR_STRING_COUNT ]; + + TiXmlCursor location; + + /// Field containing a generic user pointer + void* userData; + + // None of these methods are reliable for any language except English. + // Good for approximation, not great for accuracy. + static int IsAlpha( unsigned char anyByte, TiXmlEncoding encoding ); + static int IsAlphaNum( unsigned char anyByte, TiXmlEncoding encoding ); + inline static int ToLower( int v, TiXmlEncoding encoding ) + { + if ( encoding == TIXML_ENCODING_UTF8 ) + { + if ( v < 128 ) return tolower( v ); + return v; + } + else + { + return tolower( v ); + } + } + static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ); + +private: + TiXmlBase( const TiXmlBase& ); // not implemented. + void operator=( const TiXmlBase& base ); // not allowed. + + struct Entity + { + const char* str; + unsigned int strLength; + char chr; + }; + enum + { + NUM_ENTITY = 5, + MAX_ENTITY_LENGTH = 6 + + }; + static Entity entity[ NUM_ENTITY ]; + static bool condenseWhiteSpace; +}; + + +/** The parent class for everything in the Document Object Model. + (Except for attributes). + Nodes have siblings, a parent, and children. A node can be + in a document, or stand on its own. The type of a TiXmlNode + can be queried, and it can be cast to its more defined type. +*/ +class TiXmlNode : public TiXmlBase +{ + friend class TiXmlDocument; + friend class TiXmlElement; + +public: + #ifdef TIXML_USE_STL + + /** An input stream operator, for every class. Tolerant of newlines and + formatting, but doesn't expect them. + */ + friend std::istream& operator >> (std::istream& in, TiXmlNode& base); + + /** An output stream operator, for every class. Note that this outputs + without any newlines or formatting, as opposed to Print(), which + includes tabs and new lines. + + The operator<< and operator>> are not completely symmetric. Writing + a node to a stream is very well defined. You'll get a nice stream + of output, without any extra whitespace or newlines. + + But reading is not as well defined. (As it always is.) If you create + a TiXmlElement (for example) and read that from an input stream, + the text needs to define an element or junk will result. This is + true of all input streams, but it's worth keeping in mind. + + A TiXmlDocument will read nodes until it reads a root element, and + all the children of that root element. + */ + friend std::ostream& operator<< (std::ostream& out, const TiXmlNode& base); + + /// Appends the XML node or attribute to a std::string. + friend std::string& operator<< (std::string& out, const TiXmlNode& base ); + + #endif + + /** The types of XML nodes supported by TinyXml. (All the + unsupported types are picked up by UNKNOWN.) + */ + enum NodeType + { + DOCUMENT, + ELEMENT, + COMMENT, + UNKNOWN, + TEXT, + DECLARATION, + TYPECOUNT + }; + + virtual ~TiXmlNode(); + + /** The meaning of 'value' changes for the specific type of + TiXmlNode. + @verbatim + Document: filename of the xml file + Element: name of the element + Comment: the comment text + Unknown: the tag contents + Text: the text string + @endverbatim + + The subclasses will wrap this function. + */ + const char *Value() const { return value.c_str (); } + + #ifdef TIXML_USE_STL + /** Return Value() as a std::string. If you only use STL, + this is more efficient than calling Value(). + Only available in STL mode. + */ + const std::string& ValueStr() const { return value; } + #endif + + const TIXML_STRING& ValueTStr() const { return value; } + + /** Changes the value of the node. Defined as: + @verbatim + Document: filename of the xml file + Element: name of the element + Comment: the comment text + Unknown: the tag contents + Text: the text string + @endverbatim + */ + void SetValue(const char * _value) { value = _value;} + + #ifdef TIXML_USE_STL + /// STL std::string form. + void SetValue( const std::string& _value ) { value = _value; } + #endif + + /// Delete all the children of this node. Does not affect 'this'. + void Clear(); + + /// One step up the DOM. + TiXmlNode* Parent() { return parent; } + const TiXmlNode* Parent() const { return parent; } + + const TiXmlNode* FirstChild() const { return firstChild; } ///< The first child of this node. Will be null if there are no children. + TiXmlNode* FirstChild() { return firstChild; } + const TiXmlNode* FirstChild( const char * value ) const; ///< The first child of this node with the matching 'value'. Will be null if none found. + /// The first child of this node with the matching 'value'. Will be null if none found. + TiXmlNode* FirstChild( const char * _value ) { + // Call through to the const version - safe since nothing is changed. Exiting syntax: cast this to a const (always safe) + // call the method, cast the return back to non-const. + return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->FirstChild( _value )); + } + const TiXmlNode* LastChild() const { return lastChild; } /// The last child of this node. Will be null if there are no children. + TiXmlNode* LastChild() { return lastChild; } + + const TiXmlNode* LastChild( const char * value ) const; /// The last child of this node matching 'value'. Will be null if there are no children. + TiXmlNode* LastChild( const char * _value ) { + return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->LastChild( _value )); + } + + #ifdef TIXML_USE_STL + const TiXmlNode* FirstChild( const std::string& _value ) const { return FirstChild (_value.c_str ()); } ///< STL std::string form. + TiXmlNode* FirstChild( const std::string& _value ) { return FirstChild (_value.c_str ()); } ///< STL std::string form. + const TiXmlNode* LastChild( const std::string& _value ) const { return LastChild (_value.c_str ()); } ///< STL std::string form. + TiXmlNode* LastChild( const std::string& _value ) { return LastChild (_value.c_str ()); } ///< STL std::string form. + #endif + + /** An alternate way to walk the children of a node. + One way to iterate over nodes is: + @verbatim + for( child = parent->FirstChild(); child; child = child->NextSibling() ) + @endverbatim + + IterateChildren does the same thing with the syntax: + @verbatim + child = 0; + while( child = parent->IterateChildren( child ) ) + @endverbatim + + IterateChildren takes the previous child as input and finds + the next one. If the previous child is null, it returns the + first. IterateChildren will return null when done. + */ + const TiXmlNode* IterateChildren( const TiXmlNode* previous ) const; + TiXmlNode* IterateChildren( const TiXmlNode* previous ) { + return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( previous ) ); + } + + /// This flavor of IterateChildren searches for children with a particular 'value' + const TiXmlNode* IterateChildren( const char * value, const TiXmlNode* previous ) const; + TiXmlNode* IterateChildren( const char * _value, const TiXmlNode* previous ) { + return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( _value, previous ) ); + } + + #ifdef TIXML_USE_STL + const TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) const { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form. + TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form. + #endif + + /** Add a new node related to this. Adds a child past the LastChild. + Returns a pointer to the new object or NULL if an error occured. + */ + TiXmlNode* InsertEndChild( const TiXmlNode& addThis ); + + + /** Add a new node related to this. Adds a child past the LastChild. + + NOTE: the node to be added is passed by pointer, and will be + henceforth owned (and deleted) by tinyXml. This method is efficient + and avoids an extra copy, but should be used with care as it + uses a different memory model than the other insert functions. + + @sa InsertEndChild + */ + TiXmlNode* LinkEndChild( TiXmlNode* addThis ); + + /** Add a new node related to this. Adds a child before the specified child. + Returns a pointer to the new object or NULL if an error occured. + */ + TiXmlNode* InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis ); + + /** Add a new node related to this. Adds a child after the specified child. + Returns a pointer to the new object or NULL if an error occured. + */ + TiXmlNode* InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis ); + + /** Replace a child of this node. + Returns a pointer to the new object or NULL if an error occured. + */ + TiXmlNode* ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis ); + + /// Delete a child of this node. + bool RemoveChild( TiXmlNode* removeThis ); + + /// Navigate to a sibling node. + const TiXmlNode* PreviousSibling() const { return prev; } + TiXmlNode* PreviousSibling() { return prev; } + + /// Navigate to a sibling node. + const TiXmlNode* PreviousSibling( const char * ) const; + TiXmlNode* PreviousSibling( const char *_prev ) { + return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->PreviousSibling( _prev ) ); + } + + #ifdef TIXML_USE_STL + const TiXmlNode* PreviousSibling( const std::string& _value ) const { return PreviousSibling (_value.c_str ()); } ///< STL std::string form. + TiXmlNode* PreviousSibling( const std::string& _value ) { return PreviousSibling (_value.c_str ()); } ///< STL std::string form. + const TiXmlNode* NextSibling( const std::string& _value) const { return NextSibling (_value.c_str ()); } ///< STL std::string form. + TiXmlNode* NextSibling( const std::string& _value) { return NextSibling (_value.c_str ()); } ///< STL std::string form. + #endif + + /// Navigate to a sibling node. + const TiXmlNode* NextSibling() const { return next; } + TiXmlNode* NextSibling() { return next; } + + /// Navigate to a sibling node with the given 'value'. + const TiXmlNode* NextSibling( const char * ) const; + TiXmlNode* NextSibling( const char* _next ) { + return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->NextSibling( _next ) ); + } + + /** Convenience function to get through elements. + Calls NextSibling and ToElement. Will skip all non-Element + nodes. Returns 0 if there is not another element. + */ + const TiXmlElement* NextSiblingElement() const; + TiXmlElement* NextSiblingElement() { + return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement() ); + } + + /** Convenience function to get through elements. + Calls NextSibling and ToElement. Will skip all non-Element + nodes. Returns 0 if there is not another element. + */ + const TiXmlElement* NextSiblingElement( const char * ) const; + TiXmlElement* NextSiblingElement( const char *_next ) { + return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement( _next ) ); + } + + #ifdef TIXML_USE_STL + const TiXmlElement* NextSiblingElement( const std::string& _value) const { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form. + TiXmlElement* NextSiblingElement( const std::string& _value) { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form. + #endif + + /// Convenience function to get through elements. + const TiXmlElement* FirstChildElement() const; + TiXmlElement* FirstChildElement() { + return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement() ); + } + + /// Convenience function to get through elements. + const TiXmlElement* FirstChildElement( const char * _value ) const; + TiXmlElement* FirstChildElement( const char * _value ) { + return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement( _value ) ); + } + + #ifdef TIXML_USE_STL + const TiXmlElement* FirstChildElement( const std::string& _value ) const { return FirstChildElement (_value.c_str ()); } ///< STL std::string form. + TiXmlElement* FirstChildElement( const std::string& _value ) { return FirstChildElement (_value.c_str ()); } ///< STL std::string form. + #endif + + /** Query the type (as an enumerated value, above) of this node. + The possible types are: DOCUMENT, ELEMENT, COMMENT, + UNKNOWN, TEXT, and DECLARATION. + */ + int Type() const { return type; } + + /** Return a pointer to the Document this node lives in. + Returns null if not in a document. + */ + const TiXmlDocument* GetDocument() const; + TiXmlDocument* GetDocument() { + return const_cast< TiXmlDocument* >( (const_cast< const TiXmlNode* >(this))->GetDocument() ); + } + + /// Returns true if this node has no children. + bool NoChildren() const { return !firstChild; } + + virtual const TiXmlDocument* ToDocument() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual const TiXmlElement* ToElement() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual const TiXmlComment* ToComment() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual const TiXmlUnknown* ToUnknown() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual const TiXmlText* ToText() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual const TiXmlDeclaration* ToDeclaration() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + + virtual TiXmlDocument* ToDocument() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual TiXmlElement* ToElement() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual TiXmlComment* ToComment() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual TiXmlUnknown* ToUnknown() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual TiXmlText* ToText() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual TiXmlDeclaration* ToDeclaration() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + + /** Create an exact duplicate of this node and return it. The memory must be deleted + by the caller. + */ + virtual TiXmlNode* Clone() const = 0; + + /** Accept a hierchical visit the nodes in the TinyXML DOM. Every node in the + XML tree will be conditionally visited and the host will be called back + via the TiXmlVisitor interface. + + This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse + the XML for the callbacks, so the performance of TinyXML is unchanged by using this + interface versus any other.) + + The interface has been based on ideas from: + + - http://www.saxproject.org/ + - http://c2.com/cgi/wiki?HierarchicalVisitorPattern + + Which are both good references for "visiting". + + An example of using Accept(): + @verbatim + TiXmlPrinter printer; + tinyxmlDoc.Accept( &printer ); + const char* xmlcstr = printer.CStr(); + @endverbatim + */ + virtual bool Accept( TiXmlVisitor* visitor ) const = 0; + +protected: + TiXmlNode( NodeType _type ); + + // Copy to the allocated object. Shared functionality between Clone, Copy constructor, + // and the assignment operator. + void CopyTo( TiXmlNode* target ) const; + + #ifdef TIXML_USE_STL + // The real work of the input operator. + virtual void StreamIn( std::istream* in, TIXML_STRING* tag ) = 0; + #endif + + // Figure out what is at *p, and parse it. Returns null if it is not an xml node. + TiXmlNode* Identify( const char* start, TiXmlEncoding encoding ); + + TiXmlNode* parent; + NodeType type; + + TiXmlNode* firstChild; + TiXmlNode* lastChild; + + TIXML_STRING value; + + TiXmlNode* prev; + TiXmlNode* next; + +private: + TiXmlNode( const TiXmlNode& ); // not implemented. + void operator=( const TiXmlNode& base ); // not allowed. +}; + + +/** An attribute is a name-value pair. Elements have an arbitrary + number of attributes, each with a unique name. + + @note The attributes are not TiXmlNodes, since they are not + part of the tinyXML document object model. There are other + suggested ways to look at this problem. +*/ +class TiXmlAttribute : public TiXmlBase +{ + friend class TiXmlAttributeSet; + +public: + /// Construct an empty attribute. + TiXmlAttribute() : TiXmlBase() + { + document = 0; + prev = next = 0; + } + + #ifdef TIXML_USE_STL + /// std::string constructor. + TiXmlAttribute( const std::string& _name, const std::string& _value ) + { + name = _name; + value = _value; + document = 0; + prev = next = 0; + } + #endif + + /// Construct an attribute with a name and value. + TiXmlAttribute( const char * _name, const char * _value ) + { + name = _name; + value = _value; + document = 0; + prev = next = 0; + } + + const char* Name() const { return name.c_str(); } ///< Return the name of this attribute. + const char* Value() const { return value.c_str(); } ///< Return the value of this attribute. + #ifdef TIXML_USE_STL + const std::string& ValueStr() const { return value; } ///< Return the value of this attribute. + #endif + int IntValue() const; ///< Return the value of this attribute, converted to an integer. + double DoubleValue() const; ///< Return the value of this attribute, converted to a double. + + // Get the tinyxml string representation + const TIXML_STRING& NameTStr() const { return name; } + + /** QueryIntValue examines the value string. It is an alternative to the + IntValue() method with richer error checking. + If the value is an integer, it is stored in 'value' and + the call returns TIXML_SUCCESS. If it is not + an integer, it returns TIXML_WRONG_TYPE. + + A specialized but useful call. Note that for success it returns 0, + which is the opposite of almost all other TinyXml calls. + */ + int QueryIntValue( int* _value ) const; + /// QueryDoubleValue examines the value string. See QueryIntValue(). + int QueryDoubleValue( double* _value ) const; + + void SetName( const char* _name ) { name = _name; } ///< Set the name of this attribute. + void SetValue( const char* _value ) { value = _value; } ///< Set the value. + + void SetIntValue( int _value ); ///< Set the value from an integer. + void SetDoubleValue( double _value ); ///< Set the value from a double. + + #ifdef TIXML_USE_STL + /// STL std::string form. + void SetName( const std::string& _name ) { name = _name; } + /// STL std::string form. + void SetValue( const std::string& _value ) { value = _value; } + #endif + + /// Get the next sibling attribute in the DOM. Returns null at end. + const TiXmlAttribute* Next() const; + TiXmlAttribute* Next() { + return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Next() ); + } + + /// Get the previous sibling attribute in the DOM. Returns null at beginning. + const TiXmlAttribute* Previous() const; + TiXmlAttribute* Previous() { + return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Previous() ); + } + + bool operator==( const TiXmlAttribute& rhs ) const { return rhs.name == name; } + bool operator<( const TiXmlAttribute& rhs ) const { return name < rhs.name; } + bool operator>( const TiXmlAttribute& rhs ) const { return name > rhs.name; } + + /* Attribute parsing starts: first letter of the name + returns: the next char after the value end quote + */ + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + + // Prints this Attribute to a FILE stream. + virtual void Print( FILE* cfile, int depth ) const { + Print( cfile, depth, 0 ); + } + void Print( FILE* cfile, int depth, TIXML_STRING* str ) const; + + // [internal use] + // Set the document pointer so the attribute can report errors. + void SetDocument( TiXmlDocument* doc ) { document = doc; } + +private: + TiXmlAttribute( const TiXmlAttribute& ); // not implemented. + void operator=( const TiXmlAttribute& base ); // not allowed. + + TiXmlDocument* document; // A pointer back to a document, for error reporting. + TIXML_STRING name; + TIXML_STRING value; + TiXmlAttribute* prev; + TiXmlAttribute* next; +}; + + +/* A class used to manage a group of attributes. + It is only used internally, both by the ELEMENT and the DECLARATION. + + The set can be changed transparent to the Element and Declaration + classes that use it, but NOT transparent to the Attribute + which has to implement a next() and previous() method. Which makes + it a bit problematic and prevents the use of STL. + + This version is implemented with circular lists because: + - I like circular lists + - it demonstrates some independence from the (typical) doubly linked list. +*/ +class TiXmlAttributeSet +{ +public: + TiXmlAttributeSet(); + ~TiXmlAttributeSet(); + + void Add( TiXmlAttribute* attribute ); + void Remove( TiXmlAttribute* attribute ); + + const TiXmlAttribute* First() const { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } + TiXmlAttribute* First() { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } + const TiXmlAttribute* Last() const { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } + TiXmlAttribute* Last() { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } + + const TiXmlAttribute* Find( const char* _name ) const; + TiXmlAttribute* Find( const char* _name ) { + return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) ); + } + #ifdef TIXML_USE_STL + const TiXmlAttribute* Find( const std::string& _name ) const; + TiXmlAttribute* Find( const std::string& _name ) { + return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) ); + } + + #endif + +private: + //*ME: Because of hidden/disabled copy-construktor in TiXmlAttribute (sentinel-element), + //*ME: this class must be also use a hidden/disabled copy-constructor !!! + TiXmlAttributeSet( const TiXmlAttributeSet& ); // not allowed + void operator=( const TiXmlAttributeSet& ); // not allowed (as TiXmlAttribute) + + TiXmlAttribute sentinel; +}; + + +/** The element is a container class. It has a value, the element name, + and can contain other elements, text, comments, and unknowns. + Elements also contain an arbitrary number of attributes. +*/ +class TiXmlElement : public TiXmlNode +{ +public: + /// Construct an element. + TiXmlElement (const char * in_value); + + #ifdef TIXML_USE_STL + /// std::string constructor. + TiXmlElement( const std::string& _value ); + #endif + + TiXmlElement( const TiXmlElement& ); + + void operator=( const TiXmlElement& base ); + + virtual ~TiXmlElement(); + + /** Given an attribute name, Attribute() returns the value + for the attribute of that name, or null if none exists. + */ + const char* Attribute( const char* name ) const; + + /** Given an attribute name, Attribute() returns the value + for the attribute of that name, or null if none exists. + If the attribute exists and can be converted to an integer, + the integer value will be put in the return 'i', if 'i' + is non-null. + */ + const char* Attribute( const char* name, int* i ) const; + + /** Given an attribute name, Attribute() returns the value + for the attribute of that name, or null if none exists. + If the attribute exists and can be converted to an double, + the double value will be put in the return 'd', if 'd' + is non-null. + */ + const char* Attribute( const char* name, double* d ) const; + + /** QueryIntAttribute examines the attribute - it is an alternative to the + Attribute() method with richer error checking. + If the attribute is an integer, it is stored in 'value' and + the call returns TIXML_SUCCESS. If it is not + an integer, it returns TIXML_WRONG_TYPE. If the attribute + does not exist, then TIXML_NO_ATTRIBUTE is returned. + */ + int QueryIntAttribute( const char* name, int* _value ) const; + /// QueryDoubleAttribute examines the attribute - see QueryIntAttribute(). + int QueryDoubleAttribute( const char* name, double* _value ) const; + /// QueryFloatAttribute examines the attribute - see QueryIntAttribute(). + int QueryFloatAttribute( const char* name, float* _value ) const { + double d; + int result = QueryDoubleAttribute( name, &d ); + if ( result == TIXML_SUCCESS ) { + *_value = (float)d; + } + return result; + } + + #ifdef TIXML_USE_STL + /** Template form of the attribute query which will try to read the + attribute into the specified type. Very easy, very powerful, but + be careful to make sure to call this with the correct type. + + NOTE: This method doesn't work correctly for 'string' types. + + @return TIXML_SUCCESS, TIXML_WRONG_TYPE, or TIXML_NO_ATTRIBUTE + */ + template< typename T > int QueryValueAttribute( const std::string& name, T* outValue ) const + { + const TiXmlAttribute* node = attributeSet.Find( name ); + if ( !node ) + return TIXML_NO_ATTRIBUTE; + + std::stringstream sstream( node->ValueStr() ); + sstream >> *outValue; + if ( !sstream.fail() ) + return TIXML_SUCCESS; + return TIXML_WRONG_TYPE; + } + /* + This is - in theory - a bug fix for "QueryValueAtribute returns truncated std::string" + but template specialization is hard to get working cross-compiler. Leaving the bug for now. + + // The above will fail for std::string because the space character is used as a seperator. + // Specialize for strings. Bug [ 1695429 ] QueryValueAtribute returns truncated std::string + template<> int QueryValueAttribute( const std::string& name, std::string* outValue ) const + { + const TiXmlAttribute* node = attributeSet.Find( name ); + if ( !node ) + return TIXML_NO_ATTRIBUTE; + *outValue = node->ValueStr(); + return TIXML_SUCCESS; + } + */ + #endif + + /** Sets an attribute of name to a given value. The attribute + will be created if it does not exist, or changed if it does. + */ + void SetAttribute( const char* name, const char * _value ); + + #ifdef TIXML_USE_STL + const std::string* Attribute( const std::string& name ) const; + const std::string* Attribute( const std::string& name, int* i ) const; + const std::string* Attribute( const std::string& name, double* d ) const; + int QueryIntAttribute( const std::string& name, int* _value ) const; + int QueryDoubleAttribute( const std::string& name, double* _value ) const; + + /// STL std::string form. + void SetAttribute( const std::string& name, const std::string& _value ); + ///< STL std::string form. + void SetAttribute( const std::string& name, int _value ); + #endif + + /** Sets an attribute of name to a given value. The attribute + will be created if it does not exist, or changed if it does. + */ + void SetAttribute( const char * name, int value ); + + /** Sets an attribute of name to a given value. The attribute + will be created if it does not exist, or changed if it does. + */ + void SetDoubleAttribute( const char * name, double value ); + + /** Deletes an attribute with the given name. + */ + void RemoveAttribute( const char * name ); + #ifdef TIXML_USE_STL + void RemoveAttribute( const std::string& name ) { RemoveAttribute (name.c_str ()); } ///< STL std::string form. + #endif + + const TiXmlAttribute* FirstAttribute() const { return attributeSet.First(); } ///< Access the first attribute in this element. + TiXmlAttribute* FirstAttribute() { return attributeSet.First(); } + const TiXmlAttribute* LastAttribute() const { return attributeSet.Last(); } ///< Access the last attribute in this element. + TiXmlAttribute* LastAttribute() { return attributeSet.Last(); } + + /** Convenience function for easy access to the text inside an element. Although easy + and concise, GetText() is limited compared to getting the TiXmlText child + and accessing it directly. + + If the first child of 'this' is a TiXmlText, the GetText() + returns the character string of the Text node, else null is returned. + + This is a convenient method for getting the text of simple contained text: + @verbatim + <foo>This is text</foo> + const char* str = fooElement->GetText(); + @endverbatim + + 'str' will be a pointer to "This is text". + + Note that this function can be misleading. If the element foo was created from + this XML: + @verbatim + <foo><b>This is text</b></foo> + @endverbatim + + then the value of str would be null. The first child node isn't a text node, it is + another element. From this XML: + @verbatim + <foo>This is <b>text</b></foo> + @endverbatim + GetText() will return "This is ". + + WARNING: GetText() accesses a child node - don't become confused with the + similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are + safe type casts on the referenced node. + */ + const char* GetText() const; + + /// Creates a new Element and returns it - the returned element is a copy. + virtual TiXmlNode* Clone() const; + // Print the Element to a FILE stream. + virtual void Print( FILE* cfile, int depth ) const; + + /* Attribtue parsing starts: next char past '<' + returns: next char past '>' + */ + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + + virtual const TiXmlElement* ToElement() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + virtual TiXml... [truncated message content] |
From: <sag...@li...> - 2007-08-26 11:06:35
|
Revision: 462 http://saggui.svn.sourceforge.net/saggui/?rev=462&view=rev Author: juvinious Date: 2007-08-26 00:56:51 -0700 (Sun, 26 Aug 2007) Log Message: ----------- Cleaned up creationengine and sagguixml, added sagguiexception Modified Paths: -------------- trunk/CHANGELOG trunk/cmake/saggui.h.in trunk/include/saggui/common.h trunk/include/saggui/creationengine.h trunk/modules/sagguixml/include/sagguixml.h trunk/modules/sagguixml/src/sagguixml.cpp trunk/src/creationengine.cpp Added Paths: ----------- trunk/include/saggui/sagguiexception.h trunk/src/sagguiexception.cpp Modified: trunk/CHANGELOG =================================================================== --- trunk/CHANGELOG 2007-08-24 22:20:21 UTC (rev 461) +++ trunk/CHANGELOG 2007-08-26 07:56:51 UTC (rev 462) @@ -1,4 +1,5 @@ 0.50 +- Added in exception handler for saggui (sagguiException) - Added new class creationEngine to facilitate creating widgets via markup. Added an xml extension of that class. - Added new member to system,resourceManager and guiManager to accomodate not having to use guiManagers setResolution - Made several commentary updates throughout the source Modified: trunk/cmake/saggui.h.in =================================================================== --- trunk/cmake/saggui.h.in 2007-08-24 22:20:21 UTC (rev 461) +++ trunk/cmake/saggui.h.in 2007-08-26 07:56:51 UTC (rev 462) @@ -54,6 +54,7 @@ #include "saggui/bitmap_font.h" #include "saggui/common.h" #include "saggui/coord.h" +#include "saggui/creationengine.h" #include "saggui/debug.h" #include "saggui/style.h" #include "saggui/dllspec.h" @@ -74,6 +75,7 @@ #include "saggui/resource_manager.h" #include "saggui/rgba.h" #include "saggui/scheme.h" +#include "saggui/sagguiexception.h" #include "saggui/sigslot.h" #include "saggui/sprite.h" #include "saggui/system_factory.h" Modified: trunk/include/saggui/common.h =================================================================== --- trunk/include/saggui/common.h 2007-08-24 22:20:21 UTC (rev 461) +++ trunk/include/saggui/common.h 2007-08-26 07:56:51 UTC (rev 462) @@ -277,6 +277,54 @@ S_Rectangle, S_Triangle }; + + /*! \ref struct::typeInfo is a list for common widget data used in creationEngine:\n + * T_Type - widget type \n + * T_Id - widget Id name \n + * T_Text - widget text if applicable \n + * T_X - widget x coordinate \n + * T_Y - widget y coordinate \n + * T_Width - widget width \n + * T_Height - widget height \n + * T_Image - widget Image if applicable \n + * T_Min - widget minimal if applicable \n + * T_Max - widget maximum if applicable \n + * T_Index - widget set index if applicable \n + * T_Checked - widget checked if applicable \n + * T_Alignment - widget alignment if applicable \n + * T_DragState - widget dragState if applicable \n + * T_Enabled - widget set enabled if applicable \n + * T_Active - widget set active applicable \n + * T_Visible - widget set visible if applicable \n + * T_Modal - widget set modal if applicable \n + * T_Editable - widget set editable if applicable \n + * T_Off - widget off if applicable \n + * T_On - widget on if applicable \n + */ + enum typeInfo + { + T_Type = 0, + T_Id, + T_Text, + T_X, + T_Y, + T_Width, + T_Height, + T_Image, + T_Min, + T_Max, + T_Index, + T_Checked, + T_Alignment, + T_DragState, + T_Enabled, + T_Active, + T_Visible, + T_Modal, + T_Editable, + T_Off, + T_On + }; } #endif Modified: trunk/include/saggui/creationengine.h =================================================================== --- trunk/include/saggui/creationengine.h 2007-08-24 22:20:21 UTC (rev 461) +++ trunk/include/saggui/creationengine.h 2007-08-26 07:56:51 UTC (rev 462) @@ -41,8 +41,10 @@ #include <string> #include <map> -#include "sigslot.h" +#include <sstream> #include "dllspec.h" +#include "sagguiexception.h" +#include "common.h" //! Simplified All Gaming Graphical User Interface /*! @@ -52,6 +54,67 @@ { class window; + //! Class representing basic data of a widget + class SAGGUI_EXPORT windowMarkup + { + public: + static const std::string BOX; + static const std::string BUTTONGROUP; + static const std::string CHECKBOX; + static const std::string DIALOG; + static const std::string INPUTBOX; + static const std::string LABEL; + static const std::string LISTBOX; + static const std::string PROGRESSBAR; + static const std::string PUSHBUTTON; + static const std::string RADIAL; + static const std::string SCROLLBAR; + static const std::string TEXTBOX; + + //! ctor that sets the kind of widget that this represents + windowMarkup(const std::string &type); + ~windowMarkup(); + + inline const std::string getType() { return getString(T_Type); } + inline void addInfo(typeInfo type, const std::string &data){ markup[type] = data; } + inline const std::string getString(typeInfo type) throw (sagguiException) + { + std::map<typeInfo, std::string>::iterator temp = markup.find(type); + if(temp == markup.end())throw sagguiException("No item stored under that type!"); + return temp->second; + } + inline const int getInt(typeInfo type) throw (sagguiException) + { + std::map<typeInfo, std::string>::iterator temp = markup.find(type); + if(temp == markup.end())throw sagguiException("No item stored under that type!"); + std::istringstream is(temp->second); + int t; + is >> t; + return t; + } + inline const double getDouble(typeInfo type) throw (sagguiException) + { + std::map<typeInfo, std::string>::iterator temp = markup.find(type); + if(temp == markup.end())throw sagguiException("No item stored under that type!"); + std::istringstream is(temp->second); + double t; + is >> t; + return t; + } + inline const bool getBool(typeInfo type) throw (sagguiException) + { + std::map<typeInfo, std::string>::iterator temp = markup.find(type); + if(temp == markup.end())throw sagguiException("No item stored under that type!"); + std::istringstream is(temp->second); + bool t; + is >> t; + return t; + } + + private: + std::map<typeInfo, std::string> markup; + }; + //! The Base Creational Engine Class /*! * This is the Creational Engine class. This provides a means to @@ -70,27 +133,25 @@ virtual void load(const std::string &filename)=0; //! find - window *find(const std::string &name); + window *find(const std::string &id); - //! Get root window - window *getRootWindow(); + /*! Get a window according to a windowMarkup which automatically adds to the list of windows \n + * this is to allow the engine itself to add parameters or fill information about the widget \n + * that isn't covered by the common data in the markup + */ + window *createWindow(windowMarkup &win); protected: - //! Root window of entire engine - window *rootWindow; + //! Add a window to the list + void addWindow(const std::string &id, window *win); + + private: + //! Set windowDefaults defaults + void setWindowDefaults(window *win, windowMarkup &markup) throw(sagguiException); + //! Map of all widgets std::map<const std::string, window *> windows; - - /*! \ref creationEngine::typeInfo is a type list for windows and data:\n - * to store data - * TI_TYPE - widget type \n - */ - enum typeInfo - { - TI_TYPE = 0, - TI_TEXT - }; }; } Added: trunk/include/saggui/sagguiexception.h =================================================================== --- trunk/include/saggui/sagguiexception.h (rev 0) +++ trunk/include/saggui/sagguiexception.h 2007-08-26 07:56:51 UTC (rev 462) @@ -0,0 +1,63 @@ +/* +SAGGUI (Simplified All Gaming Graphical User Interface) +Copyright (c) 2005-2007, Miguel A. Gavidia +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + * Neither the name of the "SAGGUI" nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef SAGGUI_EXCEPTION_H +#define SAGGUI_EXCEPTION_H + +#include <exception> +#include <string> +#include "dllspec.h" + +namespace saggui +{ + class SAGGUI_EXPORT sagguiException : public std::exception + { + public: + sagguiException(); + sagguiException( const std::string & reason ); + + ~sagguiException() throw(); + + inline const std::string & getReason() const{ return reason; } + + protected: + std::string reason; + }; +} + +#endif Modified: trunk/modules/sagguixml/include/sagguixml.h =================================================================== --- trunk/modules/sagguixml/include/sagguixml.h 2007-08-24 22:20:21 UTC (rev 461) +++ trunk/modules/sagguixml/include/sagguixml.h 2007-08-26 07:56:51 UTC (rev 462) @@ -41,6 +41,11 @@ #include "saggui/creationengine.h" + +class TiXmlElement; +class TiXmlNode; +class TiXmlDocument; + //! Simplified All Gaming Graphical User Interface /*! This is the naming convention for this SAGGUI lib. @@ -61,7 +66,18 @@ virtual ~xmlEngine(); //! load data - virtual void load(const std::string &filename); + virtual void load(const std::string &filename) throw (sagguiException); + + //! Create windows from xml + virtual void parseWindows(TiXmlElement *element, window *parent) throw (sagguiException); + + //! Do window specific things if required + virtual void windowExtra(TiXmlElement *element, window *win); + + protected: + //! Document + TiXmlDocument *doc; + }; } Modified: trunk/modules/sagguixml/src/sagguixml.cpp =================================================================== --- trunk/modules/sagguixml/src/sagguixml.cpp 2007-08-24 22:20:21 UTC (rev 461) +++ trunk/modules/sagguixml/src/sagguixml.cpp 2007-08-26 07:56:51 UTC (rev 462) @@ -38,6 +38,7 @@ #include "sagguixml.h" #include "tinyxml.h" +#include "window.h" namespace saggui { @@ -52,9 +53,140 @@ } - void xmlEngine::load(const std::string &filename) + void xmlEngine::load(const std::string &filename) throw (sagguiException) { - // Bam TODO + TiXmlNode *node = 0; + doc = new TiXmlDocument(filename); + + if(!doc->LoadFile())throw sagguiException("Couldn't load file: " + filename); + + node = doc->FirstChild(); + if(!node)throw sagguiException("Document " + filename + " is empty or null!"); + + while(node != NULL) + { + parseWindows(node->ToElement(),0); + node = doc->IterateChildren(node); + } } + + void xmlEngine::parseWindows(TiXmlElement *element, window *parent) throw (sagguiException) + { + windowMarkup temp(element->Value()); + try + { + if(element->Attribute("id")) + { + temp.addInfo(T_Id,element->Attribute("id")); + } + if(element->Attribute("text")) + { + temp.addInfo(T_Text,element->Attribute("text")); + } + if(element->Attribute("x")) + { + temp.addInfo(T_X,element->Attribute("x")); + } + if(element->Attribute("y")) + { + temp.addInfo(T_Y,element->Attribute("y")); + } + if(element->Attribute("width")) + { + temp.addInfo(T_Width,element->Attribute("width")); + } + if(element->Attribute("height")) + { + temp.addInfo(T_Height,element->Attribute("height")); + } + if(element->Attribute("image")) + { + temp.addInfo(T_Image,element->Attribute("image")); + } + if(element->Attribute("min")) + { + temp.addInfo(T_Min,element->Attribute("min")); + } + if(element->Attribute("max")) + { + temp.addInfo(T_Max,element->Attribute("max")); + } + if(element->Attribute("index")) + { + temp.addInfo(T_Index,element->Attribute("index")); + } + if(element->Attribute("checked")) + { + temp.addInfo(T_Checked,element->Attribute("checked")); + } + if(element->Attribute("alignment")) + { + temp.addInfo(T_Alignment,element->Attribute("alignment")); + } + if(element->Attribute("dragstate")) + { + temp.addInfo(T_DragState,element->Attribute("dragstate")); + } + if(element->Attribute("enabled")) + { + temp.addInfo(T_Enabled,element->Attribute("enabled")); + } + if(element->Attribute("active")) + { + temp.addInfo(T_Active,element->Attribute("active")); + } + if(element->Attribute("visible")) + { + temp.addInfo(T_Visible,element->Attribute("visible")); + } + if(element->Attribute("modal")) + { + temp.addInfo(T_Modal,element->Attribute("modal")); + } + if(element->Attribute("Editable")) + { + temp.addInfo(T_Editable,element->Attribute("Editable")); + } + if(element->Attribute("off")) + { + temp.addInfo(T_Off,element->Attribute("off")); + } + if(element->Attribute("on")) + { + temp.addInfo(T_On,element->Attribute("on")); + } + } + catch(const sagguiException &e) + { + std::cout << "Problem: " + e.getReason() + "\n"; + + } + + window *tempWin = createWindow(temp); + + if(!tempWin)throw sagguiException("Failed to load window: " + std::string(element->Value()) + "!"); + + // Do other requirements for window + windowExtra(element, tempWin); + + //parsing child elements + TiXmlNode *child = element->FirstChild(); + + while(child != NULL) + { + TiXmlElement *elem = child->ToElement(); + parseWindows(elem,tempWin); + //child = doc->IterateChildren(child); + child = child->NextSibling(); + } + + if(parent)parent->addChild(tempWin); + } + + //! Do window specific things if required + void xmlEngine::windowExtra(TiXmlElement *element, window *win) + { + + } } Modified: trunk/src/creationengine.cpp =================================================================== --- trunk/src/creationengine.cpp 2007-08-24 22:20:21 UTC (rev 461) +++ trunk/src/creationengine.cpp 2007-08-26 07:56:51 UTC (rev 462) @@ -38,9 +38,44 @@ #include "saggui/creationengine.h" #include "saggui/window.h" +#include "saggui/resource_manager.h" +#include "saggui/widgets/box.h" +#include "saggui/widgets/buttongroup.h" +#include "saggui/widgets/checkbox.h" +#include "saggui/widgets/dialog.h" +#include "saggui/widgets/input_box.h" +#include "saggui/widgets/label.h" +#include "saggui/widgets/listbox.h" +#include "saggui/widgets/progress_bar.h" +#include "saggui/widgets/pushbutton.h" +#include "saggui/widgets/radial.h" +#include "saggui/widgets/scroll_bar.h" +#include "saggui/widgets/text_box.h" namespace saggui { + const std::string windowMarkup::BOX = "box"; + const std::string windowMarkup::BUTTONGROUP = "buttongroup"; + const std::string windowMarkup::CHECKBOX = "checkbox"; + const std::string windowMarkup::DIALOG = "dialog"; + const std::string windowMarkup::INPUTBOX = "inputbox"; + const std::string windowMarkup::LABEL = "label"; + const std::string windowMarkup::LISTBOX = "listbox"; + const std::string windowMarkup::PROGRESSBAR = "progressbar"; + const std::string windowMarkup::PUSHBUTTON = "pushbutton"; + const std::string windowMarkup::RADIAL = "radial"; + const std::string windowMarkup::SCROLLBAR = "scrollbar"; + const std::string windowMarkup::TEXTBOX = "textbox"; + + windowMarkup::windowMarkup(const std::string &type) + { + addInfo(T_Type, type); + } + windowMarkup::~windowMarkup() + { + // Nothing + } + // Constructor creationEngine::creationEngine() { @@ -52,14 +87,290 @@ } - window *creationEngine::find(const std::string &name) + window *creationEngine::find(const std::string &id) { - return windows.find(name)->second; + return windows.find(id)->second; } - window *creationEngine::getRootWindow() + window *creationEngine::createWindow(windowMarkup &win) { - return rootWindow; + window *temp = 0; + try + { + if(win.getType() == windowMarkup::BOX) + { + temp = new box(); + try + { + setWindowDefaults(temp,win); + try + { + box *t = dynamic_cast<box *>(temp); + if(t) + { + graphic *bmp = resourceManager::createGraphic(); + bmp->loadBmp(win.getString(T_Image)); + t->setBitmap(bmp); + } + } + catch(const sagguiException &e) + { + // Nothing + } + + try + { + box *t = dynamic_cast<box *>(temp); + if(t) + { + t->setDrag(mouseDragStates(win.getInt(T_DragState))); + } + } + catch(const sagguiException &e) + { + // Nothing + } + + addWindow(win.getString(T_Id),temp); + } + catch(const sagguiException &e) + { + if(temp)delete temp; + temp = 0; + } + } + } + catch(const sagguiException &e) + { + // Nothing + } + try + { + if(win.getType() == windowMarkup::BUTTONGROUP) + { + + } + } + catch(const sagguiException &e) + { + // Nothing + } + try + { + if(win.getType() == windowMarkup::CHECKBOX) + { + + } + } + catch(const sagguiException &e) + { + // Nothing + } + try + { + if(win.getType() == windowMarkup::DIALOG) + { + + } + } + catch(const sagguiException &e) + { + // Nothing + } + try + { + if(win.getType() == windowMarkup::INPUTBOX) + { + + } + } + catch(const sagguiException &e) + { + // Nothing + } + try + { + if(win.getType() == windowMarkup::LABEL) + { + + } + } + catch(const sagguiException &e) + { + // Nothing + } + + try + { + if(win.getType() == windowMarkup::LISTBOX) + { + + } + } + catch(const sagguiException &e) + { + // Nothing + } + + try + { + if(win.getType() == windowMarkup::PROGRESSBAR) + { + + } + } + catch(const sagguiException &e) + { + // Nothing + } + + try + { + if(win.getType() == windowMarkup::PUSHBUTTON) + { + + } + } + catch(const sagguiException &e) + { + // Nothing + } + + try + { + if(win.getType() == windowMarkup::RADIAL) + { + + } + } + catch(const sagguiException &e) + { + // Nothing + } + + try + { + if(win.getType() == windowMarkup::SCROLLBAR) + { + + } + } + catch(const sagguiException &e) + { + // Nothing + } + try + { + if(win.getType() == windowMarkup::TEXTBOX) + { + + } + } + catch(const sagguiException &e) + { + // Nothing + } + return temp; } + + // Add a window to the list + void creationEngine::addWindow(const std::string &id, window *win) + { + windows[id] = win; + } + + // Set windowDefaults defaults + void creationEngine::setWindowDefaults(window *win, windowMarkup &markup) throw(sagguiException) + { + if(!win)throw sagguiException("Window not created!"); + try + { + win->position.x = markup.getDouble(T_X); + } + catch(const sagguiException &e) + { + // Nothing + } + try + { + win->position.y = markup.getDouble(T_Y); + } + catch(const sagguiException &e) + { + // Nothing + } + try + { + win->position.width = markup.getDouble(T_Width); + } + catch(const sagguiException &e) + { + // Nothing + } + try + { + win->position.height = markup.getDouble(T_Height); + } + catch(const sagguiException &e) + { + // Nothing + } + try + { + win->setAttribute(AT_Enabled, markup.getBool(T_Enabled)); + } + catch(const sagguiException &e) + { + // Nothing + } + try + { + win->setAttribute(AT_Active, markup.getBool(T_Active)); + } + catch(const sagguiException &e) + { + // Nothing + } + try + { + win->setAttribute(AT_Visible, markup.getBool(T_Visible)); + } + catch(const sagguiException &e) + { + // Nothing + } + try + { + win->setAttribute(AT_Modal, markup.getBool(T_Modal)); + } + catch(const sagguiException &e) + { + // Nothing + } + try + { + win->setAttribute(AT_Editable, markup.getBool(T_Editable)); + } + catch(const sagguiException &e) + { + // Nothing + } + try + { + win->setAttribute(AT_Off, markup.getBool(T_Off)); + } + catch(const sagguiException &e) + { + // Nothing + } + try + { + win->setAttribute(AT_On, markup.getBool(T_On)); + } + catch(const sagguiException &e) + { + // Nothing + } + } } Copied: trunk/src/sagguiexception.cpp (from rev 461, trunk/src/creationengine.cpp) =================================================================== --- trunk/src/sagguiexception.cpp (rev 0) +++ trunk/src/sagguiexception.cpp 2007-08-26 07:56:51 UTC (rev 462) @@ -0,0 +1,57 @@ +/* +SAGGUI (Simplified All Gaming Graphical User Interface) +Copyright (c) 2005-2007, Miguel A. Gavidia +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + * Neither the name of the "SAGGUI" nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "saggui/sagguiexception.h" + +namespace saggui +{ + sagguiException::sagguiException() : std::exception() + { + } + + sagguiException::sagguiException( const std::string & reason ) : std::exception() + { + this->reason = reason; + } + + sagguiException::~sagguiException() throw() + { + } + +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@li...> - 2007-08-30 12:53:33
|
Revision: 467 http://saggui.svn.sourceforge.net/saggui/?rev=467&view=rev Author: juvinious Date: 2007-08-30 05:53:21 -0700 (Thu, 30 Aug 2007) Log Message: ----------- Added paintEvent class to pass to onPaint signals instead of a long parameter list Modified Paths: -------------- trunk/CHANGELOG Added Paths: ----------- trunk/include/saggui/paintevent.h trunk/src/paintevent.cpp Modified: trunk/CHANGELOG =================================================================== --- trunk/CHANGELOG 2007-08-29 13:13:34 UTC (rev 466) +++ trunk/CHANGELOG 2007-08-30 12:53:21 UTC (rev 467) @@ -1,4 +1,5 @@ 0.50 +- Added paintEvent class for passing paint info for onPaint events - Added xml demo for allegro to the repository - Completed some more widget information in sagguixml making it quite useable - Added entire widget collection to creationengine for use Copied: trunk/include/saggui/paintevent.h (from rev 461, trunk/include/saggui/key_events.h) =================================================================== --- trunk/include/saggui/paintevent.h (rev 0) +++ trunk/include/saggui/paintevent.h 2007-08-30 12:53:21 UTC (rev 467) @@ -0,0 +1,108 @@ +/* +SAGGUI (Simplified All Gaming Graphical User Interface) +Copyright (c) 2005-2007, Miguel A. Gavidia +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + * Neither the name of the "SAGGUI" nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef PAINT_EVENT_H +#define PAINT_EVENT_H + +#include <vector> +#include "common.h" +#include "dllspec.h" +#include "sagguiexception.h" + +//! Simplified All Gaming Graphical User Interface +/*! + This is the naming convention for this SAGGUI lib. +*/ +namespace saggui +{ + class graphic; + class coord; + class rgba; + //! The Paint Event Class + /*! + * This provides all necessary data about an event with paint properties + */ + + class SAGGUI_EXPORT paintEvent + { + public: + //! Constructor + paintEvent(); + + //! Deconstructor + ~paintEvent(); + + //! Set Position + void setPosition(coord &position); + + //! Get Position + const coord &getPosition() const throw(sagguiException); + + //! Set Graphic + void setGraphic(graphic *bitmap); + + //! Get Graphic + graphic *getGraphic() throw(sagguiException); + + //! Set colors + void setColors(std::vector<rgba> &colors); + + //! Get colors + const std::vector<rgba> &getColors() const throw(sagguiException); + + //! Set attributes + void setAttributes(uint32_t &attributes); + + //! Get attributes + const uint32_t &getAttributes() const throw(sagguiException); + + //! Set shape + void setShape(shapeType &shape); + + //! Get shape + const shapeType &getShape() const throw(sagguiException); + + private: + coord *position; + graphic *bitmap; + std::vector<rgba> *colors; + uint32_t *attributes; + shapeType *shape; + }; +} +#endif Copied: trunk/src/paintevent.cpp (from rev 461, trunk/src/key_events.cpp) =================================================================== --- trunk/src/paintevent.cpp (rev 0) +++ trunk/src/paintevent.cpp 2007-08-30 12:53:21 UTC (rev 467) @@ -0,0 +1,121 @@ +/* +SAGGUI (Simplified All Gaming Graphical User Interface) +Copyright (c) 2005-2007, Miguel A. Gavidia +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + * Neither the name of the "SAGGUI" nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "saggui/paintevent.h" +#include "saggui/graphics.h" +#include "saggui/coord.h" +#include "saggui/rgba.h" + +namespace saggui +{ + //init + paintEvent::paintEvent() : position(0), bitmap(0), colors(0), attributes(0), shape(0) + { + // Nothing + } + //de-init + paintEvent::~paintEvent() + { + // Nothing to be done + } + + // Set Position + void paintEvent::setPosition( coord &position) + { + this->position = &position; + } + + // Get Position + const coord &paintEvent::getPosition() const throw(sagguiException) + { + if(!position)throw sagguiException("coord (position) not set!"); + return *position; + } + + // Set Graphic + void paintEvent::setGraphic(graphic *bitmap) + { + this->bitmap = bitmap; + } + + // Get Graphic + graphic *paintEvent::getGraphic() throw(sagguiException) + { + if(!bitmap)throw sagguiException("graphic (bitmap) not set!"); + return bitmap; + } + + // Set colors + void paintEvent::setColors( std::vector<rgba> &colors) + { + this->colors = &colors; + } + + // Get colors + const std::vector<rgba> &paintEvent::getColors() const throw(sagguiException) + { + if(!colors)throw sagguiException("std::vector<rgba> (colors) not set!"); + return *colors; + } + + // Set attributes + void paintEvent::setAttributes( uint32_t &attributes) + { + this->attributes = &attributes; + } + + // Get attributes + const uint32_t &paintEvent::getAttributes() const throw(sagguiException) + { + if(!attributes)throw sagguiException("uint32_t (attributes) not set!"); + return *attributes; + } + + // Set shape + void paintEvent::setShape( shapeType &shape) + { + this->shape = &shape; + } + + // Get shape + const shapeType &paintEvent::getShape() const throw(sagguiException) + { + if(!shape)throw sagguiException("shapeType (shape) not set!"); + return *shape; + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@li...> - 2007-08-31 13:25:04
|
Revision: 468 http://saggui.svn.sourceforge.net/saggui/?rev=468&view=rev Author: juvinious Date: 2007-08-31 06:24:58 -0700 (Fri, 31 Aug 2007) Log Message: ----------- Switiching to use paintEvent instead of the long parameter list Modified Paths: -------------- trunk/include/saggui/paintevent.h trunk/include/saggui/widgets/label.h trunk/include/saggui/window.h trunk/src/gui_manager.cpp trunk/src/paintevent.cpp trunk/src/widgets/label.cpp trunk/src/window.cpp Modified: trunk/include/saggui/paintevent.h =================================================================== --- trunk/include/saggui/paintevent.h 2007-08-30 12:53:21 UTC (rev 467) +++ trunk/include/saggui/paintevent.h 2007-08-31 13:24:58 UTC (rev 468) @@ -50,6 +50,7 @@ */ namespace saggui { + class window; class graphic; class coord; class rgba; @@ -64,6 +65,9 @@ //! Constructor paintEvent(); + //! Ctor for passing a window and extracting info + paintEvent(window *win); + //! Deconstructor ~paintEvent(); Modified: trunk/include/saggui/widgets/label.h =================================================================== --- trunk/include/saggui/widgets/label.h 2007-08-30 12:53:21 UTC (rev 467) +++ trunk/include/saggui/widgets/label.h 2007-08-31 13:24:58 UTC (rev 468) @@ -85,7 +85,7 @@ void update(); //! Draw - void draw(const coord &pos, graphic *bmp, const std::vector<rgba> &colors, const uint32_t &flags, const shapeType &shape); + void draw(paintEvent &e); public: //! Constructor Modified: trunk/include/saggui/window.h =================================================================== --- trunk/include/saggui/window.h 2007-08-30 12:53:21 UTC (rev 467) +++ trunk/include/saggui/window.h 2007-08-31 13:24:58 UTC (rev 468) @@ -45,6 +45,7 @@ #include "dllspec.h" #include "sigslot.h" #include "coord.h" +#include "paintevent.h" #include "debug.h" @@ -113,7 +114,7 @@ signal0<> onMinimize; signal0<> onUpdate; - signal5<const coord &, graphic *, const std::vector<rgba> &, const uint32_t &, const shapeType &> onPaint; + signal1<paintEvent &> onPaint; //! \name Setters and Getters @@ -222,6 +223,7 @@ friend class guiManager; friend class mouseManager; + friend class paintEvent; }; } Modified: trunk/src/gui_manager.cpp =================================================================== --- trunk/src/gui_manager.cpp 2007-08-30 12:53:21 UTC (rev 467) +++ trunk/src/gui_manager.cpp 2007-08-31 13:24:58 UTC (rev 468) @@ -49,6 +49,7 @@ #include "saggui/coord.h" #include "saggui/keys.h" #include "saggui/scheme.h" +#include "saggui/paintevent.h" namespace saggui { @@ -244,10 +245,12 @@ coord temp = (*i)->position; temp.x = 0; temp.y = 0; + paintEvent paintInfo((*i)); + paintInfo.setPosition(temp); if((*i)->wStyle) { (*i)->wStyle->onPaintBackground.emit(temp,(*i)->background,(*i)->wColors, (*i)->attributes, (*i)->shape); - (*i)->onPaint.emit(temp,(*i)->background,(*i)->wColors, (*i)->attributes, (*i)->shape); + (*i)->onPaint.emit(paintInfo); if(!(*i)->children.empty()) { doWindowRender((*i)->children,(*i)->background); @@ -257,7 +260,7 @@ } else { - (*i)->onPaint.emit(temp,(*i)->background,(*i)->wColors, (*i)->attributes, (*i)->shape); + (*i)->onPaint.emit(paintInfo); if(!(*i)->children.empty()) { doWindowRender((*i)->children,(*i)->background); @@ -270,10 +273,12 @@ if(!bmp)continue; coord temp = (*i)->getRelativePosition(); bmp->setClip((*i)->getPosition().clipRect(temp)); + paintEvent paintInfo((*i)); + paintInfo.setPosition(temp); if((*i)->wStyle) { (*i)->wStyle->onPaintBackground.emit(temp,bmp,(*i)->wColors, (*i)->attributes, (*i)->shape); - (*i)->onPaint.emit(temp,bmp,(*i)->wColors, (*i)->attributes, (*i)->shape); + (*i)->onPaint.emit(paintInfo); if(!(*i)->children.empty()) { doWindowRender((*i)->children,bmp); @@ -282,7 +287,7 @@ } else { - (*i)->onPaint.emit(temp,bmp,(*i)->wColors, (*i)->attributes, (*i)->shape); + (*i)->onPaint.emit(paintInfo); if(!(*i)->children.empty()) { doWindowRender((*i)->children,bmp); Modified: trunk/src/paintevent.cpp =================================================================== --- trunk/src/paintevent.cpp 2007-08-30 12:53:21 UTC (rev 467) +++ trunk/src/paintevent.cpp 2007-08-31 13:24:58 UTC (rev 468) @@ -37,6 +37,7 @@ */ #include "saggui/paintevent.h" +#include "saggui/window.h" #include "saggui/graphics.h" #include "saggui/coord.h" #include "saggui/rgba.h" @@ -48,6 +49,12 @@ { // Nothing } + + //init + paintEvent::paintEvent(window *win) : position(&win->position), bitmap(win->background), colors(&win->wColors), attributes(&win->attributes), shape(&win->shape) + { + // Nothing + } //de-init paintEvent::~paintEvent() { Modified: trunk/src/widgets/label.cpp =================================================================== --- trunk/src/widgets/label.cpp 2007-08-30 12:53:21 UTC (rev 467) +++ trunk/src/widgets/label.cpp 2007-08-31 13:24:58 UTC (rev 468) @@ -99,11 +99,11 @@ } // Draw - void label::draw(const coord &pos, graphic *bmp, const std::vector<rgba> &colors, const uint32_t &flags, const shapeType &shape) + void label::draw(paintEvent &e) { if(attributes & AT_Visible) { - currentSetFont->render(pos.x+x1,pos.y+y1,textColor,background,hAlignment,currentSetText); + currentSetFont->render(e.getPosition().x+x1,e.getPosition().y+y1,textColor,e.getGraphic(),hAlignment,currentSetText); } } Modified: trunk/src/window.cpp =================================================================== --- trunk/src/window.cpp 2007-08-30 12:53:21 UTC (rev 467) +++ trunk/src/window.cpp 2007-08-31 13:24:58 UTC (rev 468) @@ -45,6 +45,7 @@ #include "saggui/style.h" #include "saggui/graphics.h" #include "saggui/rgba.h" +#include "saggui/paintevent.h" namespace saggui { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@li...> - 2007-08-31 14:45:37
|
Revision: 464 http://saggui.svn.sourceforge.net/saggui/?rev=464&view=rev Author: juvinious Date: 2007-08-26 13:07:44 -0700 (Sun, 26 Aug 2007) Log Message: ----------- Added xml demo to the repository examples directory. Made several bug fixes listed in changelog. Modified Paths: -------------- trunk/CHANGELOG trunk/CMakeLists.txt trunk/include/saggui/creationengine.h trunk/modules/sagguixml/include/sagguixml.h trunk/modules/sagguixml/src/sagguixml.cpp trunk/src/creationengine.cpp trunk/src/window.cpp Added Paths: ----------- trunk/examples/xml/ trunk/examples/xml/CMakeLists.txt trunk/examples/xml/data/ trunk/examples/xml/data/test.xml trunk/examples/xml/include/ trunk/examples/xml/src/ trunk/examples/xml/src/allegro.cpp Modified: trunk/CHANGELOG =================================================================== --- trunk/CHANGELOG 2007-08-26 10:53:51 UTC (rev 463) +++ trunk/CHANGELOG 2007-08-26 20:07:44 UTC (rev 464) @@ -1,4 +1,8 @@ 0.50 +- Added xml demo for allegro to the repository +- Completed some more widget information in sagguixml making it quite useable +- Added entire widget collection to creationengine for use +- Fixed several severe bug with window removal from guiManager on item deletion - Added in exception handler for saggui (sagguiException) - Added new class creationEngine to facilitate creating widgets via markup. Added an xml extension of that class. - Added new member to system,resourceManager and guiManager to accomodate not having to use guiManagers setResolution Modified: trunk/CMakeLists.txt =================================================================== --- trunk/CMakeLists.txt 2007-08-26 10:53:51 UTC (rev 463) +++ trunk/CMakeLists.txt 2007-08-26 20:07:44 UTC (rev 464) @@ -265,6 +265,7 @@ add_subdirectory(${CMAKE_SOURCE_DIR}/examples/demo) add_subdirectory(${CMAKE_SOURCE_DIR}/examples/gamedemo) add_subdirectory(${CMAKE_SOURCE_DIR}/examples/widgets) +add_subdirectory(${CMAKE_SOURCE_DIR}/examples/xml) add_subdirectory(${CMAKE_SOURCE_DIR}/utils/bmpdump) # ------------------------------------------------------- Copied: trunk/examples/xml/CMakeLists.txt (from rev 461, trunk/examples/demo/CMakeLists.txt) =================================================================== --- trunk/examples/xml/CMakeLists.txt (rev 0) +++ trunk/examples/xml/CMakeLists.txt 2007-08-26 20:07:44 UTC (rev 464) @@ -0,0 +1,31 @@ +# ------------------------------------------------------- +# SAGGUI cmake build script to create demo called from +# main build +# Written by: juvinious +# ------------------------------------------------------- + +include_directories(include) + +file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin/xml) +configure_file(data/test.xml ${CMAKE_BINARY_DIR}/bin/xml/test.xml COPYONLY) + +if(MSVC) + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/examples/xml/xml) +endif(MSVC) + +if(NOT ${CREATE_STATIC_LIB}) + if(MSVC) + remove_definitions(/DSAGGUI_LIB_BUILD) + else(MSVC) + remove_definitions(-DSAGGUI_LIB_BUILD) + endif(MSVC) +endif(NOT ${CREATE_STATIC_LIB}) + +set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin/xml) + +if(ENABLE_ALLEGRO) + include_directories(${ALLEGRO_INCLUDE_DIR}) + add_executable(xml-allegro src/allegro.cpp) + target_link_libraries(xml-allegro saggui-xml saggui-alleg saggui) + add_dependencies(xml-allegro saggui-xml saggui-alleg saggui) +endif(ENABLE_ALLEGRO) Added: trunk/examples/xml/data/test.xml =================================================================== --- trunk/examples/xml/data/test.xml (rev 0) +++ trunk/examples/xml/data/test.xml 2007-08-26 20:07:44 UTC (rev 464) @@ -0,0 +1,28 @@ +<box id="top" x="80" y="80" width="200" height="200" dragstate="3"> + <box id="sub1" x="20" y="20" width="50" height="50" dragstate="3"> + <box id="sub3" x="5" y="5" width="25" height="25" dragstate="3"/> + </box> + <box id="sub32" x="40" y="40" width="50" height="50" dragstate="3"/> +</box> +<box id="top2" x="280" y="280" width="100" height="100" dragstate="3"> + <box id="sub2" x="20" y="40" width="40" height="20" dragstate="3"/> +</box> + +<textbox id="textbox" x="220" y="240" width="80" height="80" dragstate="3" text="This is a text box. Full of tons of stuff for them to have fun with."/> + +<dialog id="dialog" x="50" y="50" width="120" height="120"/> + +<label id="label" x="50" y="350" width="120" height="120" text="My little label"/> + +<inputbox id="input" x="300" y="300" width="100" height="20" text="Type stuff!" halign="0" font-color="red" blink-speed="800" /> + +<listbox id="list" x="20" y="300" width="100" height="25"> + <li>item1</li> + <li>item2</li> + <li>item3</li> + <li>item4</li> +</listbox> + +<checkbox id="check" checked="1" x="30" y="250" width="25" height="25"/> +<radial id="radial" checked="1" x="60" y="250" width="25" height="25"/> +<pushbutton id="push" text="Hello World" x="400" y="400"/> \ No newline at end of file Added: trunk/examples/xml/src/allegro.cpp =================================================================== --- trunk/examples/xml/src/allegro.cpp (rev 0) +++ trunk/examples/xml/src/allegro.cpp 2007-08-26 20:07:44 UTC (rev 464) @@ -0,0 +1,101 @@ +#include <saggui.h> +#include <saggui_alleg.h> +#include <saggui_xml.h> + +using namespace saggui; + +int main() +{ + resourceManager::registerBackend<ALLEGRO_SAGGUI>(); + + guiManager::setup("allegro"); + + // Create a timer to regulate the logic loop + guiTimer timer, fpsTimer; + int fps=0,fpsCounter =0; + + // Some Variables + bool fullscreen = false; + bool buffered = true; + bool quit = false; + + // Set the resolution of the demo + if(!guiManager::setupScreen(640,480,32,fullscreen, buffered)) + { + std::cout << "Couldn't create display\n"; + return 1; + } + + xmlEngine xml; + try + { + xml.load("test.xml"); + } + catch(const sagguiException &e) + { + std::cout << "Couldn't load xml file! Reason: " + e.getReason() + "\n"; + } + + listBox *bleh = dynamic_cast<listBox *>(xml.find("list")); + if(bleh)std::cout << "selected item: " << bleh->selectedItem() << "\n"; + + // Main loop + while(!quit){ + + bool draw=false; + while (timer.msecs() >= 1000/60) + { + draw = true; + if(keyInputManager::keyState(keys::ESC)) + { + quit=true; + draw=false; + break; + } + + if(keyInputManager::keyState(keys::NUM_1,true)) + { + try + { + xml.load("test.xml"); + } + catch(const sagguiException &e) + { + std::cout << "Couldn't load xml file! Reason: " + e.getReason() + "\n"; + } + break; + } + + guiManager::update(); + + timer.reset(); + } + + if(draw) + { + if(fpsTimer.secs()<=1)fpsCounter++; + + guiManager::getSystemBuffer()->clearBmp(rgba::BLACK); + resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps); + resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getSystemBuffer(),0,"Press 1 to reload xml file"); + + guiManager::renderWindows(); + + + + } + + if(fpsTimer.secs()>=1) + { + fpsTimer.reset(); + fps=fpsCounter; + fpsCounter=0; + } + while((timer.msecs())==0)timer.sleep(1); + + } + + return 0; +} +END_OF_MAIN() + Modified: trunk/include/saggui/creationengine.h =================================================================== --- trunk/include/saggui/creationengine.h 2007-08-26 10:53:51 UTC (rev 463) +++ trunk/include/saggui/creationengine.h 2007-08-26 20:07:44 UTC (rev 464) @@ -53,6 +53,7 @@ namespace saggui { class window; + class rgba; //! Class representing basic data of a widget class SAGGUI_EXPORT windowMarkup @@ -140,10 +141,16 @@ */ window *createWindow(windowMarkup &win); + //! Usefull tool to convert colors + static rgba getColor(const std::string &color); + protected: //! Add a window to the list void addWindow(const std::string &id, window *win); + + //! Cleanup ie delete windows and stuff for a reload for example + void cleanup(); private: //! Set windowDefaults defaults Modified: trunk/modules/sagguixml/include/sagguixml.h =================================================================== --- trunk/modules/sagguixml/include/sagguixml.h 2007-08-26 10:53:51 UTC (rev 463) +++ trunk/modules/sagguixml/include/sagguixml.h 2007-08-26 20:07:44 UTC (rev 464) @@ -81,6 +81,9 @@ //! Specific to listbox virtual void listbox(TiXmlElement *element, window *parent); + //! Specific to inputbox + virtual void inputbox(TiXmlElement *element, window *parent); + }; } Modified: trunk/modules/sagguixml/src/sagguixml.cpp =================================================================== --- trunk/modules/sagguixml/src/sagguixml.cpp 2007-08-26 10:53:51 UTC (rev 463) +++ trunk/modules/sagguixml/src/sagguixml.cpp 2007-08-26 20:07:44 UTC (rev 464) @@ -40,6 +40,7 @@ #include "tinyxml.h" #include "window.h" #include "widgets/listbox.h" +#include "widgets/input_box.h" namespace saggui { @@ -56,6 +57,7 @@ void xmlEngine::load(const std::string &filename) throw (sagguiException) { + cleanup(); TiXmlNode *node = 0; doc = new TiXmlDocument(filename); @@ -176,6 +178,10 @@ { listbox(element, tempWin); } + else if(temp.getType() == windowMarkup::INPUTBOX) + { + inputbox(element, tempWin); + } else { children(element, tempWin); @@ -218,5 +224,39 @@ child = child->NextSibling(); } } + + void xmlEngine::inputbox(TiXmlElement *element, window *parent) + { + inputBox *temp = dynamic_cast<inputBox *>(parent); + if(!temp)return; + if(element->Attribute("valign")) + { + temp->setVerticalAlign(inputBox::textAlign(atoi(element->Attribute("valign")))); + } + if(element->Attribute("halign")) + { + temp->setHorizontalAlign(inputBox::textAlign(atoi(element->Attribute("halign")))); + } + if(element->Attribute("font-color")) + { + temp->setTextColor(getColor(element->Attribute("font-color"))); + } + if(element->Attribute("cursor-color")) + { + temp->setCursorColor(getColor(element->Attribute("cursor-color"))); + } + if(element->Attribute("blink-speed")) + { + temp->setCursorBlinkRate(atoi(element->Attribute("blink-speed"))); + } + if(element->Attribute("auto-resize")) + { + temp->setAutoResize(bool(element->Attribute("auto-resize"))); + } + if(element->Attribute("limit")) + { + temp->setLimit(atoi(element->Attribute("limit"))); + } + } } Modified: trunk/src/creationengine.cpp =================================================================== --- trunk/src/creationengine.cpp 2007-08-26 10:53:51 UTC (rev 463) +++ trunk/src/creationengine.cpp 2007-08-26 20:07:44 UTC (rev 464) @@ -66,8 +66,29 @@ const std::string windowMarkup::SCROLLBAR = "scrollbar"; const std::string windowMarkup::TEXTBOX = "textbox"; - rgba getColor(const std::string &color) + windowMarkup::windowMarkup(const std::string &type) + { + addInfo(T_Type, type); + } + windowMarkup::~windowMarkup() + { + // Nothing + } + + // Constructor + creationEngine::creationEngine() { + // Nothing + } + + creationEngine::~creationEngine() + { + // cleanup + cleanup(); + } + + rgba creationEngine::getColor(const std::string &color) + { if(color == "black")return rgba::BLACK; if(color == "white")return rgba::WHITE; if(color == "darkgray")return rgba::DARKGRAY; @@ -89,26 +110,6 @@ return rgba(); } - windowMarkup::windowMarkup(const std::string &type) - { - addInfo(T_Type, type); - } - windowMarkup::~windowMarkup() - { - // Nothing - } - - // Constructor - creationEngine::creationEngine() - { - // Nothing - } - - creationEngine::~creationEngine() - { - - } - window *creationEngine::find(const std::string &id) { return windows.find(id)->second; @@ -298,8 +299,6 @@ try { setWindowDefaults(temp,win); - listBox *t = dynamic_cast<listBox *>(temp); - if(t)t->addItem("EmptyList"); addWindow(win.getString(T_Id),temp); } catch(const sagguiException &e) @@ -552,7 +551,7 @@ if(!win)throw sagguiException("Window not created!"); try { - win->position.x = markup.getDouble(T_X); + win->position.setX(markup.getDouble(T_X)); } catch(const sagguiException &e) { @@ -560,7 +559,7 @@ } try { - win->position.y = markup.getDouble(T_Y); + win->position.setY(markup.getDouble(T_Y)); } catch(const sagguiException &e) { @@ -568,7 +567,7 @@ } try { - win->position.width = markup.getDouble(T_Width); + win->position.setWidth(markup.getDouble(T_Width)); } catch(const sagguiException &e) { @@ -576,7 +575,7 @@ } try { - win->position.height = markup.getDouble(T_Height); + win->position.setHeight(markup.getDouble(T_Height)); } catch(const sagguiException &e) { @@ -639,5 +638,14 @@ // Nothing } } + + void creationEngine::cleanup() + { + // Destroy all created windows + for(std::map<const std::string, window *>::iterator i = windows.begin();i!=windows.end();++i) + { + if(i->second)delete i->second; + } + } } Modified: trunk/src/window.cpp =================================================================== --- trunk/src/window.cpp 2007-08-26 10:53:51 UTC (rev 463) +++ trunk/src/window.cpp 2007-08-26 20:07:44 UTC (rev 464) @@ -77,6 +77,7 @@ window::~window() { // Do some shit + guiManager::removeWindow(this); } bool window::operator==(const window * const w) const This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@li...> - 2007-09-05 07:09:34
|
Revision: 465 http://saggui.svn.sourceforge.net/saggui/?rev=465&view=rev Author: juvinious Date: 2007-08-26 22:54:00 -0700 (Sun, 26 Aug 2007) Log Message: ----------- Fixed issue in windows with xml demo Modified Paths: -------------- trunk/examples/xml/src/allegro.cpp trunk/modules/sagguixml/include/sagguixml.h trunk/modules/sagguixml/src/sagguixml.cpp Modified: trunk/examples/xml/src/allegro.cpp =================================================================== --- trunk/examples/xml/src/allegro.cpp 2007-08-26 20:07:44 UTC (rev 464) +++ trunk/examples/xml/src/allegro.cpp 2007-08-27 05:54:00 UTC (rev 465) @@ -1,5 +1,43 @@ +/* +SAGGUI (Simplified All Gaming Graphical User Interface) +Copyright (c) 2005-2007, Miguel A. Gavidia +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + * Neither the name of the "SAGGUI" nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include <saggui_alleg.h> #include <saggui.h> -#include <saggui_alleg.h> #include <saggui_xml.h> using namespace saggui; Modified: trunk/modules/sagguixml/include/sagguixml.h =================================================================== --- trunk/modules/sagguixml/include/sagguixml.h 2007-08-26 20:07:44 UTC (rev 464) +++ trunk/modules/sagguixml/include/sagguixml.h 2007-08-27 05:54:00 UTC (rev 465) @@ -84,6 +84,9 @@ //! Specific to inputbox virtual void inputbox(TiXmlElement *element, window *parent); + //! Specific to inputbox + virtual void doLabel(TiXmlElement *element, window *parent); + }; } Modified: trunk/modules/sagguixml/src/sagguixml.cpp =================================================================== --- trunk/modules/sagguixml/src/sagguixml.cpp 2007-08-26 20:07:44 UTC (rev 464) +++ trunk/modules/sagguixml/src/sagguixml.cpp 2007-08-27 05:54:00 UTC (rev 465) @@ -41,6 +41,7 @@ #include "window.h" #include "widgets/listbox.h" #include "widgets/input_box.h" +#include "widgets/label.h" namespace saggui { @@ -182,6 +183,10 @@ { inputbox(element, tempWin); } + else if(temp.getType() == windowMarkup::LABEL) + { + doLabel(element, tempWin); + } else { children(element, tempWin); @@ -258,5 +263,28 @@ temp->setLimit(atoi(element->Attribute("limit"))); } } + + void xmlEngine::doLabel(TiXmlElement *element, window *parent) + { + label *temp = dynamic_cast<label *>(parent); + if(!temp)return; + if(element->Attribute("valign")) + { + temp->setVerticalAlign(inputBox::textAlign(atoi(element->Attribute("valign")))); + } + if(element->Attribute("halign")) + { + temp->setHorizontalAlign(inputBox::textAlign(atoi(element->Attribute("halign")))); + } + if(element->Attribute("font-color")) + { + temp->setColor(getColor(element->Attribute("font-color"))); + } + if(element->Attribute("auto-resize")) + { + temp->setAutoResize(bool(element->Attribute("auto-resize"))); + temp->onResize.emit(); + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@li...> - 2007-09-03 13:22:41
|
Revision: 471 http://saggui.svn.sourceforge.net/saggui/?rev=471&view=rev Author: juvinious Date: 2007-09-03 06:22:37 -0700 (Mon, 03 Sep 2007) Log Message: ----------- Several changes, check changelog Modified Paths: -------------- trunk/CHANGELOG trunk/examples/demo/src/allegro.cpp trunk/examples/demo/src/allegrogl.cpp trunk/examples/demo/src/openlayer.cpp trunk/examples/demo/src/profiler.cpp trunk/examples/demo/src/sdl.cpp trunk/examples/demo/src/sdlgl.cpp trunk/examples/gamedemo/src/allegro.cpp trunk/examples/gamedemo/src/allegrogl.cpp trunk/examples/gamedemo/src/gamedemo.cpp trunk/examples/gamedemo/src/openlayer.cpp trunk/examples/gamedemo/src/profiler.cpp trunk/examples/gamedemo/src/sdl.cpp trunk/examples/gamedemo/src/sdlgl.cpp trunk/examples/widgets/src/allegro.cpp trunk/examples/widgets/src/allegrogl.cpp trunk/examples/widgets/src/openlayer.cpp trunk/examples/widgets/src/profiler.cpp trunk/examples/widgets/src/sdl.cpp trunk/examples/widgets/src/sdlgl.cpp trunk/examples/xml/CMakeLists.txt trunk/examples/xml/src/allegro.cpp trunk/examples/xml/src/allegrogl.cpp trunk/examples/xml/src/openlayer.cpp trunk/examples/xml/src/sdl.cpp trunk/examples/xml/src/sdlgl.cpp trunk/include/saggui/creationengine.h trunk/include/saggui/graphics.h trunk/include/saggui/gui_manager.h trunk/include/saggui/resource_manager.h trunk/include/saggui/rgba.h trunk/include/saggui/window.h trunk/modules/allegro/src/al_font.cpp trunk/modules/allegro/src/al_gfx.cpp trunk/modules/openlayer/src/ol_gfx.cpp trunk/modules/sagguixml/src/sagguixml.cpp trunk/modules/sdl/src/sdl_gfx.cpp trunk/src/creationengine.cpp trunk/src/gui_manager.cpp trunk/src/rgba.cpp Modified: trunk/CHANGELOG =================================================================== --- trunk/CHANGELOG 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/CHANGELOG 2007-09-03 13:22:37 UTC (rev 471) @@ -1,4 +1,6 @@ 0.50 +- Some code cleanup and renamed some stuff which could impact the previous api +- Moved getColor from creationEngine to rgba - Converted all paint signals to use the new paintEvent class - Added paintEvent class for passing paint info for onPaint events - Added xml demo for allegro to the repository Modified: trunk/examples/demo/src/allegro.cpp =================================================================== --- trunk/examples/demo/src/allegro.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/demo/src/allegro.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -354,34 +354,34 @@ if(draw) { if(fpsTimer.secs()<=1)fpsCounter++; - (guiManager::getSystemBuffer())->clearBmp(blackCol); + (guiManager::getBuffer())->clearBmp(blackCol); - //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getSystemBuffer());} + //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getBuffer());} - testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getSystemBuffer(),1,"Press ESC to quit"); - testFont->render(320,16,whiteCol,guiManager::getSystemBuffer(),1,"Press Alt-Enter to toggle Fullscreen"); - testFont->render(320,32,whiteCol,guiManager::getSystemBuffer(),1,"Press 1 to toggle GUI"); - testFont->render(320,48,whiteCol,guiManager::getSystemBuffer(),1,"Press 2 to add a new window"); - testFont->render(320,64,whiteCol,guiManager::getSystemBuffer(),1,"Press 3 to delete last window created"); - testFont->render(320,80,whiteCol,guiManager::getSystemBuffer(),1,"Press 4 to toggle buffered mode"); - testFont->render(320,96,whiteCol,guiManager::getSystemBuffer(),1,"Press UP to increase opacity"); - testFont->render(320,112,whiteCol,guiManager::getSystemBuffer(),1,"Press DOWN to decrease opacity"); - testFont->render(320,128,whiteCol,guiManager::getSystemBuffer(),1,"Press Right to increase font size"); - testFont->render(320,144,whiteCol,guiManager::getSystemBuffer(),1,"Press Left to decrease font size"); + testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getBuffer(),1,"Press ESC to quit"); + testFont->render(320,16,whiteCol,guiManager::getBuffer(),1,"Press Alt-Enter to toggle Fullscreen"); + testFont->render(320,32,whiteCol,guiManager::getBuffer(),1,"Press 1 to toggle GUI"); + testFont->render(320,48,whiteCol,guiManager::getBuffer(),1,"Press 2 to add a new window"); + testFont->render(320,64,whiteCol,guiManager::getBuffer(),1,"Press 3 to delete last window created"); + testFont->render(320,80,whiteCol,guiManager::getBuffer(),1,"Press 4 to toggle buffered mode"); + testFont->render(320,96,whiteCol,guiManager::getBuffer(),1,"Press UP to increase opacity"); + testFont->render(320,112,whiteCol,guiManager::getBuffer(),1,"Press DOWN to decrease opacity"); + testFont->render(320,128,whiteCol,guiManager::getBuffer(),1,"Press Right to increase font size"); + testFont->render(320,144,whiteCol,guiManager::getBuffer(),1,"Press Left to decrease font size"); - testFont->render(320,398,whiteCol,guiManager::getSystemBuffer(),1,"FPS:%d",fps); - testFont->render(320,412,whiteCol,guiManager::getSystemBuffer(),1,"Current Key:%d",currentKey.getValue()); + testFont->render(320,398,whiteCol,guiManager::getBuffer(),1,"FPS:%d",fps); + testFont->render(320,412,whiteCol,guiManager::getBuffer(),1,"Current Key:%d",currentKey.getValue()); - testFont->render(320,428,whiteCol,guiManager::getSystemBuffer(),1,"Font size: %d",fontSizeH); - testFont->render(320,444,whiteCol,guiManager::getSystemBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); - testFont->render(320,460,whiteCol,guiManager::getSystemBuffer(),1,guiManager::getMouseButtonInfoWM()); + testFont->render(320,428,whiteCol,guiManager::getBuffer(),1,"Font size: %d",fontSizeH); + testFont->render(320,444,whiteCol,guiManager::getBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); + testFont->render(320,460,whiteCol,guiManager::getBuffer(),1,guiManager::getMouseButtonInfoWM()); - testFont->render(640,240,whiteCol,guiManager::getSystemBuffer(),2,"Testing right aligned"); + testFont->render(640,240,whiteCol,guiManager::getBuffer(),2,"Testing right aligned"); - //guiManager::getSystemBuffer()->doArc(50,50,AL_PI/2,15.0,rgba::WHITE); - guiManager::getSystemBuffer()->doRoundRectfill(50,50,100,100,radius,rgba::GRAY); - guiManager::getSystemBuffer()->doRoundRect(50,50,100,100,radius,rgba::WHITE); + //guiManager::getBuffer()->doArc(50,50,AL_PI/2,15.0,rgba::WHITE); + guiManager::getBuffer()->doRoundRectfill(50,50,100,100,radius,rgba::GRAY); + guiManager::getBuffer()->doRoundRect(50,50,100,100,radius,rgba::WHITE); guiManager::renderWindows(); Modified: trunk/examples/demo/src/allegrogl.cpp =================================================================== --- trunk/examples/demo/src/allegrogl.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/demo/src/allegrogl.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -343,32 +343,32 @@ if(draw) { if(fpsTimer.secs()<=1)fpsCounter++; - (guiManager::getSystemBuffer())->clearBmp(blackCol); + (guiManager::getBuffer())->clearBmp(blackCol); allegro_gl_set_allegro_mode(); - //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getSystemBuffer());} + //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getBuffer());} - testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getSystemBuffer(),1,"Press ESC to quit"); - testFont->render(320,16,whiteCol,guiManager::getSystemBuffer(),1,"Press Alt-Enter to toggle Fullscreen"); - testFont->render(320,32,whiteCol,guiManager::getSystemBuffer(),1,"Press 1 to toggle GUI"); - testFont->render(320,48,whiteCol,guiManager::getSystemBuffer(),1,"Press 2 to add a new window"); - testFont->render(320,64,whiteCol,guiManager::getSystemBuffer(),1,"Press 3 to delete last window created"); - testFont->render(320,80,whiteCol,guiManager::getSystemBuffer(),1,"Press 4 to toggle buffered mode"); - testFont->render(320,96,whiteCol,guiManager::getSystemBuffer(),1,"Press UP to increase opacity"); - testFont->render(320,112,whiteCol,guiManager::getSystemBuffer(),1,"Press DOWN to decrease opacity"); - testFont->render(320,128,whiteCol,guiManager::getSystemBuffer(),1,"Press Right to increase font size"); - testFont->render(320,144,whiteCol,guiManager::getSystemBuffer(),1,"Press Left to decrease font size"); + testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getBuffer(),1,"Press ESC to quit"); + testFont->render(320,16,whiteCol,guiManager::getBuffer(),1,"Press Alt-Enter to toggle Fullscreen"); + testFont->render(320,32,whiteCol,guiManager::getBuffer(),1,"Press 1 to toggle GUI"); + testFont->render(320,48,whiteCol,guiManager::getBuffer(),1,"Press 2 to add a new window"); + testFont->render(320,64,whiteCol,guiManager::getBuffer(),1,"Press 3 to delete last window created"); + testFont->render(320,80,whiteCol,guiManager::getBuffer(),1,"Press 4 to toggle buffered mode"); + testFont->render(320,96,whiteCol,guiManager::getBuffer(),1,"Press UP to increase opacity"); + testFont->render(320,112,whiteCol,guiManager::getBuffer(),1,"Press DOWN to decrease opacity"); + testFont->render(320,128,whiteCol,guiManager::getBuffer(),1,"Press Right to increase font size"); + testFont->render(320,144,whiteCol,guiManager::getBuffer(),1,"Press Left to decrease font size"); - testFont->render(320,398,whiteCol,guiManager::getSystemBuffer(),1,"FPS:%d",fps); - testFont->render(320,412,whiteCol,guiManager::getSystemBuffer(),1,"Current Key:%d",currentKey.getValue()); + testFont->render(320,398,whiteCol,guiManager::getBuffer(),1,"FPS:%d",fps); + testFont->render(320,412,whiteCol,guiManager::getBuffer(),1,"Current Key:%d",currentKey.getValue()); - testFont->render(320,428,whiteCol,guiManager::getSystemBuffer(),1,"Font size: %d",fontSizeH); - testFont->render(320,444,whiteCol,guiManager::getSystemBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); - testFont->render(320,460,whiteCol,guiManager::getSystemBuffer(),1,guiManager::getMouseButtonInfoWM()); + testFont->render(320,428,whiteCol,guiManager::getBuffer(),1,"Font size: %d",fontSizeH); + testFont->render(320,444,whiteCol,guiManager::getBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); + testFont->render(320,460,whiteCol,guiManager::getBuffer(),1,guiManager::getMouseButtonInfoWM()); - testFont->render(640,240,whiteCol,guiManager::getSystemBuffer(),2,"Testing right aligned"); + testFont->render(640,240,whiteCol,guiManager::getBuffer(),2,"Testing right aligned"); guiManager::renderWindows(); Modified: trunk/examples/demo/src/openlayer.cpp =================================================================== --- trunk/examples/demo/src/openlayer.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/demo/src/openlayer.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -343,30 +343,30 @@ if(draw) { if(fpsTimer.secs()<=1)fpsCounter++; - (guiManager::getSystemBuffer())->clearBmp(blackCol); + (guiManager::getBuffer())->clearBmp(blackCol); - //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getSystemBuffer());} + //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getBuffer());} - testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getSystemBuffer(),1,"Press ESC to quit"); - testFont->render(320,16,whiteCol,guiManager::getSystemBuffer(),1,"Press Alt-Enter to toggle Fullscreen"); - testFont->render(320,32,whiteCol,guiManager::getSystemBuffer(),1,"Press 1 to toggle GUI"); - testFont->render(320,48,whiteCol,guiManager::getSystemBuffer(),1,"Press 2 to add a new window"); - testFont->render(320,64,whiteCol,guiManager::getSystemBuffer(),1,"Press 3 to delete last window created"); - testFont->render(320,80,whiteCol,guiManager::getSystemBuffer(),1,"Press 4 to toggle buffered mode"); - testFont->render(320,96,whiteCol,guiManager::getSystemBuffer(),1,"Press UP to increase opacity"); - testFont->render(320,112,whiteCol,guiManager::getSystemBuffer(),1,"Press DOWN to decrease opacity"); - testFont->render(320,128,whiteCol,guiManager::getSystemBuffer(),1,"Press Right to increase font size"); - testFont->render(320,144,whiteCol,guiManager::getSystemBuffer(),1,"Press Left to decrease font size"); + testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getBuffer(),1,"Press ESC to quit"); + testFont->render(320,16,whiteCol,guiManager::getBuffer(),1,"Press Alt-Enter to toggle Fullscreen"); + testFont->render(320,32,whiteCol,guiManager::getBuffer(),1,"Press 1 to toggle GUI"); + testFont->render(320,48,whiteCol,guiManager::getBuffer(),1,"Press 2 to add a new window"); + testFont->render(320,64,whiteCol,guiManager::getBuffer(),1,"Press 3 to delete last window created"); + testFont->render(320,80,whiteCol,guiManager::getBuffer(),1,"Press 4 to toggle buffered mode"); + testFont->render(320,96,whiteCol,guiManager::getBuffer(),1,"Press UP to increase opacity"); + testFont->render(320,112,whiteCol,guiManager::getBuffer(),1,"Press DOWN to decrease opacity"); + testFont->render(320,128,whiteCol,guiManager::getBuffer(),1,"Press Right to increase font size"); + testFont->render(320,144,whiteCol,guiManager::getBuffer(),1,"Press Left to decrease font size"); - testFont->render(320,398,whiteCol,guiManager::getSystemBuffer(),1,"FPS:%d",fps); - testFont->render(320,412,whiteCol,guiManager::getSystemBuffer(),1,"Current Key:%d",currentKey.getValue()); + testFont->render(320,398,whiteCol,guiManager::getBuffer(),1,"FPS:%d",fps); + testFont->render(320,412,whiteCol,guiManager::getBuffer(),1,"Current Key:%d",currentKey.getValue()); - testFont->render(320,428,whiteCol,guiManager::getSystemBuffer(),1,"Font size: %d",fontSizeH); - testFont->render(320,444,whiteCol,guiManager::getSystemBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); - testFont->render(320,460,whiteCol,guiManager::getSystemBuffer(),1,guiManager::getMouseButtonInfoWM()); + testFont->render(320,428,whiteCol,guiManager::getBuffer(),1,"Font size: %d",fontSizeH); + testFont->render(320,444,whiteCol,guiManager::getBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); + testFont->render(320,460,whiteCol,guiManager::getBuffer(),1,guiManager::getMouseButtonInfoWM()); - testFont->render(640,240,whiteCol,guiManager::getSystemBuffer(),2,"Testing right aligned"); + testFont->render(640,240,whiteCol,guiManager::getBuffer(),2,"Testing right aligned"); guiManager::renderWindows(); Modified: trunk/examples/demo/src/profiler.cpp =================================================================== --- trunk/examples/demo/src/profiler.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/demo/src/profiler.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -342,30 +342,30 @@ if(draw) { if(fpsTimer.secs()<=1)fpsCounter++; - (guiManager::getSystemBuffer())->clearBmp(blackCol); + (guiManager::getBuffer())->clearBmp(blackCol); - //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getSystemBuffer());} + //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getBuffer());} - testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getSystemBuffer(),1,"Press ESC to quit"); - testFont->render(320,16,whiteCol,guiManager::getSystemBuffer(),1,"Press Alt-Enter to toggle Fullscreen"); - testFont->render(320,32,whiteCol,guiManager::getSystemBuffer(),1,"Press 1 to toggle GUI"); - testFont->render(320,48,whiteCol,guiManager::getSystemBuffer(),1,"Press 2 to add a new window"); - testFont->render(320,64,whiteCol,guiManager::getSystemBuffer(),1,"Press 3 to delete last window created"); - testFont->render(320,80,whiteCol,guiManager::getSystemBuffer(),1,"Press 4 to toggle buffered mode"); - testFont->render(320,96,whiteCol,guiManager::getSystemBuffer(),1,"Press UP to increase opacity"); - testFont->render(320,112,whiteCol,guiManager::getSystemBuffer(),1,"Press DOWN to decrease opacity"); - testFont->render(320,128,whiteCol,guiManager::getSystemBuffer(),1,"Press Right to increase font size"); - testFont->render(320,144,whiteCol,guiManager::getSystemBuffer(),1,"Press Left to decrease font size"); + testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getBuffer(),1,"Press ESC to quit"); + testFont->render(320,16,whiteCol,guiManager::getBuffer(),1,"Press Alt-Enter to toggle Fullscreen"); + testFont->render(320,32,whiteCol,guiManager::getBuffer(),1,"Press 1 to toggle GUI"); + testFont->render(320,48,whiteCol,guiManager::getBuffer(),1,"Press 2 to add a new window"); + testFont->render(320,64,whiteCol,guiManager::getBuffer(),1,"Press 3 to delete last window created"); + testFont->render(320,80,whiteCol,guiManager::getBuffer(),1,"Press 4 to toggle buffered mode"); + testFont->render(320,96,whiteCol,guiManager::getBuffer(),1,"Press UP to increase opacity"); + testFont->render(320,112,whiteCol,guiManager::getBuffer(),1,"Press DOWN to decrease opacity"); + testFont->render(320,128,whiteCol,guiManager::getBuffer(),1,"Press Right to increase font size"); + testFont->render(320,144,whiteCol,guiManager::getBuffer(),1,"Press Left to decrease font size"); - testFont->render(320,398,whiteCol,guiManager::getSystemBuffer(),1,"FPS:%d",fps); - testFont->render(320,412,whiteCol,guiManager::getSystemBuffer(),1,"Current Key:%d",currentKey.getValue()); + testFont->render(320,398,whiteCol,guiManager::getBuffer(),1,"FPS:%d",fps); + testFont->render(320,412,whiteCol,guiManager::getBuffer(),1,"Current Key:%d",currentKey.getValue()); - testFont->render(320,428,whiteCol,guiManager::getSystemBuffer(),1,"Font size: %d",fontSizeH); - testFont->render(320,444,whiteCol,guiManager::getSystemBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); - testFont->render(320,460,whiteCol,guiManager::getSystemBuffer(),1,guiManager::getMouseButtonInfoWM()); + testFont->render(320,428,whiteCol,guiManager::getBuffer(),1,"Font size: %d",fontSizeH); + testFont->render(320,444,whiteCol,guiManager::getBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); + testFont->render(320,460,whiteCol,guiManager::getBuffer(),1,guiManager::getMouseButtonInfoWM()); - testFont->render(640,240,whiteCol,guiManager::getSystemBuffer(),2,"Testing right aligned"); + testFont->render(640,240,whiteCol,guiManager::getBuffer(),2,"Testing right aligned"); guiManager::renderWindows(); Modified: trunk/examples/demo/src/sdl.cpp =================================================================== --- trunk/examples/demo/src/sdl.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/demo/src/sdl.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -342,30 +342,30 @@ if(draw) { if(fpsTimer.secs()<=1)fpsCounter++; - (guiManager::getSystemBuffer())->clearBmp(blackCol); + (guiManager::getBuffer())->clearBmp(blackCol); - //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getSystemBuffer());} + //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getBuffer());} - testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getSystemBuffer(),1,"Press ESC to quit"); - testFont->render(320,16,whiteCol,guiManager::getSystemBuffer(),1,"Press Alt-Enter to toggle Fullscreen"); - testFont->render(320,32,whiteCol,guiManager::getSystemBuffer(),1,"Press 1 to toggle GUI"); - testFont->render(320,48,whiteCol,guiManager::getSystemBuffer(),1,"Press 2 to add a new window"); - testFont->render(320,64,whiteCol,guiManager::getSystemBuffer(),1,"Press 3 to delete last window created"); - testFont->render(320,80,whiteCol,guiManager::getSystemBuffer(),1,"Press 4 to toggle buffered mode"); - testFont->render(320,96,whiteCol,guiManager::getSystemBuffer(),1,"Press UP to increase opacity"); - testFont->render(320,112,whiteCol,guiManager::getSystemBuffer(),1,"Press DOWN to decrease opacity"); - testFont->render(320,128,whiteCol,guiManager::getSystemBuffer(),1,"Press Right to increase font size"); - testFont->render(320,144,whiteCol,guiManager::getSystemBuffer(),1,"Press Left to decrease font size"); + testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getBuffer(),1,"Press ESC to quit"); + testFont->render(320,16,whiteCol,guiManager::getBuffer(),1,"Press Alt-Enter to toggle Fullscreen"); + testFont->render(320,32,whiteCol,guiManager::getBuffer(),1,"Press 1 to toggle GUI"); + testFont->render(320,48,whiteCol,guiManager::getBuffer(),1,"Press 2 to add a new window"); + testFont->render(320,64,whiteCol,guiManager::getBuffer(),1,"Press 3 to delete last window created"); + testFont->render(320,80,whiteCol,guiManager::getBuffer(),1,"Press 4 to toggle buffered mode"); + testFont->render(320,96,whiteCol,guiManager::getBuffer(),1,"Press UP to increase opacity"); + testFont->render(320,112,whiteCol,guiManager::getBuffer(),1,"Press DOWN to decrease opacity"); + testFont->render(320,128,whiteCol,guiManager::getBuffer(),1,"Press Right to increase font size"); + testFont->render(320,144,whiteCol,guiManager::getBuffer(),1,"Press Left to decrease font size"); - testFont->render(320,398,whiteCol,guiManager::getSystemBuffer(),1,"FPS:%d",fps); - testFont->render(320,412,whiteCol,guiManager::getSystemBuffer(),1,"Current Key:%d",currentKey.getValue()); + testFont->render(320,398,whiteCol,guiManager::getBuffer(),1,"FPS:%d",fps); + testFont->render(320,412,whiteCol,guiManager::getBuffer(),1,"Current Key:%d",currentKey.getValue()); - testFont->render(320,428,whiteCol,guiManager::getSystemBuffer(),1,"Font size: %d",fontSizeH); - testFont->render(320,444,whiteCol,guiManager::getSystemBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); - testFont->render(320,460,whiteCol,guiManager::getSystemBuffer(),1,guiManager::getMouseButtonInfoWM()); + testFont->render(320,428,whiteCol,guiManager::getBuffer(),1,"Font size: %d",fontSizeH); + testFont->render(320,444,whiteCol,guiManager::getBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); + testFont->render(320,460,whiteCol,guiManager::getBuffer(),1,guiManager::getMouseButtonInfoWM()); - testFont->render(640,240,whiteCol,guiManager::getSystemBuffer(),2,"Testing right aligned"); + testFont->render(640,240,whiteCol,guiManager::getBuffer(),2,"Testing right aligned"); guiManager::renderWindows(); Modified: trunk/examples/demo/src/sdlgl.cpp =================================================================== --- trunk/examples/demo/src/sdlgl.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/demo/src/sdlgl.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -412,30 +412,30 @@ { if(fpsTimer.secs()<=1)fpsCounter++; beginDraw(); - (guiManager::getSystemBuffer())->clearBmp(blackCol); + (guiManager::getBuffer())->clearBmp(blackCol); - //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getSystemBuffer());} + //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getBuffer());} - testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getSystemBuffer(),1,"Press ESC to quit"); - testFont->render(320,16,whiteCol,guiManager::getSystemBuffer(),1,"Press Alt-Enter to toggle Fullscreen"); - testFont->render(320,32,whiteCol,guiManager::getSystemBuffer(),1,"Press 1 to toggle GUI"); - testFont->render(320,48,whiteCol,guiManager::getSystemBuffer(),1,"Press 2 to add a new window"); - testFont->render(320,64,whiteCol,guiManager::getSystemBuffer(),1,"Press 3 to delete last window created"); - testFont->render(320,80,whiteCol,guiManager::getSystemBuffer(),1,"Press 4 to toggle buffered mode"); - testFont->render(320,96,whiteCol,guiManager::getSystemBuffer(),1,"Press UP to increase opacity"); - testFont->render(320,112,whiteCol,guiManager::getSystemBuffer(),1,"Press DOWN to decrease opacity"); - testFont->render(320,128,whiteCol,guiManager::getSystemBuffer(),1,"Press Right to increase font size"); - testFont->render(320,144,whiteCol,guiManager::getSystemBuffer(),1,"Press Left to decrease font size"); + testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getBuffer(),1,"Press ESC to quit"); + testFont->render(320,16,whiteCol,guiManager::getBuffer(),1,"Press Alt-Enter to toggle Fullscreen"); + testFont->render(320,32,whiteCol,guiManager::getBuffer(),1,"Press 1 to toggle GUI"); + testFont->render(320,48,whiteCol,guiManager::getBuffer(),1,"Press 2 to add a new window"); + testFont->render(320,64,whiteCol,guiManager::getBuffer(),1,"Press 3 to delete last window created"); + testFont->render(320,80,whiteCol,guiManager::getBuffer(),1,"Press 4 to toggle buffered mode"); + testFont->render(320,96,whiteCol,guiManager::getBuffer(),1,"Press UP to increase opacity"); + testFont->render(320,112,whiteCol,guiManager::getBuffer(),1,"Press DOWN to decrease opacity"); + testFont->render(320,128,whiteCol,guiManager::getBuffer(),1,"Press Right to increase font size"); + testFont->render(320,144,whiteCol,guiManager::getBuffer(),1,"Press Left to decrease font size"); - testFont->render(320,398,whiteCol,guiManager::getSystemBuffer(),1,"FPS:%d",fps); - testFont->render(320,412,whiteCol,guiManager::getSystemBuffer(),1,"Current Key:%d",currentKey.getValue()); + testFont->render(320,398,whiteCol,guiManager::getBuffer(),1,"FPS:%d",fps); + testFont->render(320,412,whiteCol,guiManager::getBuffer(),1,"Current Key:%d",currentKey.getValue()); - testFont->render(320,428,whiteCol,guiManager::getSystemBuffer(),1,"Font size: %d",fontSizeH); - testFont->render(320,444,whiteCol,guiManager::getSystemBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); - testFont->render(320,460,whiteCol,guiManager::getSystemBuffer(),1,guiManager::getMouseButtonInfoWM()); + testFont->render(320,428,whiteCol,guiManager::getBuffer(),1,"Font size: %d",fontSizeH); + testFont->render(320,444,whiteCol,guiManager::getBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); + testFont->render(320,460,whiteCol,guiManager::getBuffer(),1,guiManager::getMouseButtonInfoWM()); - testFont->render(640,240,whiteCol,guiManager::getSystemBuffer(),2,"Testing right aligned"); + testFont->render(640,240,whiteCol,guiManager::getBuffer(),2,"Testing right aligned"); guiManager::renderWindows(); Modified: trunk/examples/gamedemo/src/allegro.cpp =================================================================== --- trunk/examples/gamedemo/src/allegro.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/gamedemo/src/allegro.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -157,10 +157,10 @@ if(draw) { if(fpsTimer.secs()<=1)fpsCounter++; - (guiManager::getSystemBuffer())->clearBmp(rgba::BLACK); + (guiManager::getBuffer())->clearBmp(rgba::BLACK); - resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps); - resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getSystemBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); + resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps); + resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); guiManager::renderWindows(); Modified: trunk/examples/gamedemo/src/allegrogl.cpp =================================================================== --- trunk/examples/gamedemo/src/allegrogl.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/gamedemo/src/allegrogl.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -157,12 +157,12 @@ if(draw) { if(fpsTimer.secs()<=1)fpsCounter++; - (guiManager::getSystemBuffer())->clearBmp(rgba::BLACK); + (guiManager::getBuffer())->clearBmp(rgba::BLACK); allegro_gl_set_allegro_mode(); - resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps); - resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getSystemBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); + resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps); + resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); guiManager::renderWindows(); Modified: trunk/examples/gamedemo/src/gamedemo.cpp =================================================================== --- trunk/examples/gamedemo/src/gamedemo.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/gamedemo/src/gamedemo.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -63,15 +63,15 @@ guiManager::drawUnderWindows.connect(this,&stars::render); for(int i = 0; i < rand()%500 + 300;++i) { - back.push_back(coord(rand()%(int)guiManager::getSystemBuffer()->getBmpWidth(),rand()%(int)guiManager::getSystemBuffer()->getBmpHeight(),0,0)); + back.push_back(coord(rand()%(int)guiManager::getBuffer()->getBmpWidth(),rand()%(int)guiManager::getBuffer()->getBmpHeight(),0,0)); } for(int i = 0; i < rand()%300 + 100;++i) { - mid.push_back(coord(rand()%(int)guiManager::getSystemBuffer()->getBmpWidth(),rand()%(int)guiManager::getSystemBuffer()->getBmpHeight(),0,0)); + mid.push_back(coord(rand()%(int)guiManager::getBuffer()->getBmpWidth(),rand()%(int)guiManager::getBuffer()->getBmpHeight(),0,0)); } for(int i = 0; i < rand()%100 + 50;++i) { - front.push_back(coord(rand()%(int)guiManager::getSystemBuffer()->getBmpWidth(),rand()%(int)guiManager::getSystemBuffer()->getBmpHeight(),0,0)); + front.push_back(coord(rand()%(int)guiManager::getBuffer()->getBmpWidth(),rand()%(int)guiManager::getBuffer()->getBmpHeight(),0,0)); } } stars::~stars() @@ -82,17 +82,17 @@ for(vector<coord>::iterator i = back.begin();i<back.end();++i) { (*i).x+= 1; - if((*i).x > guiManager::getSystemBuffer()->getBmpWidth())(*i).x = 0; + if((*i).x > guiManager::getBuffer()->getBmpWidth())(*i).x = 0; } for(vector<coord>::iterator i = mid.begin();i<mid.end();++i) { (*i).x+= 1.8; - if((*i).x > guiManager::getSystemBuffer()->getBmpWidth())(*i).x = 0; + if((*i).x > guiManager::getBuffer()->getBmpWidth())(*i).x = 0; } for(vector<coord>::iterator i = front.begin();i<front.end();++i) { (*i).x+= 2.5; - if((*i).x > guiManager::getSystemBuffer()->getBmpWidth())(*i).x = 0; + if((*i).x > guiManager::getBuffer()->getBmpWidth())(*i).x = 0; } } void stars::render(graphic *buffer) Modified: trunk/examples/gamedemo/src/openlayer.cpp =================================================================== --- trunk/examples/gamedemo/src/openlayer.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/gamedemo/src/openlayer.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -163,10 +163,10 @@ if(draw) { if(fpsTimer.secs()<=1)fpsCounter++; - (guiManager::getSystemBuffer())->clearBmp(rgba::BLACK); + (guiManager::getBuffer())->clearBmp(rgba::BLACK); - resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps); - resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getSystemBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); + resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps); + resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); guiManager::renderWindows(); Modified: trunk/examples/gamedemo/src/profiler.cpp =================================================================== --- trunk/examples/gamedemo/src/profiler.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/gamedemo/src/profiler.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -156,10 +156,10 @@ if(draw) { if(fpsTimer.secs()<=1)fpsCounter++; - (guiManager::getSystemBuffer())->clearBmp(rgba::BLACK); + (guiManager::getBuffer())->clearBmp(rgba::BLACK); - resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps); - resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getSystemBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); + resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps); + resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); guiManager::renderWindows(); Modified: trunk/examples/gamedemo/src/sdl.cpp =================================================================== --- trunk/examples/gamedemo/src/sdl.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/gamedemo/src/sdl.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -157,10 +157,10 @@ if(draw) { if(fpsTimer.secs()<=1)fpsCounter++; - (guiManager::getSystemBuffer())->clearBmp(rgba::BLACK); + (guiManager::getBuffer())->clearBmp(rgba::BLACK); - resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps); - resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getSystemBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); + resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps); + resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); guiManager::renderWindows(); Modified: trunk/examples/gamedemo/src/sdlgl.cpp =================================================================== --- trunk/examples/gamedemo/src/sdlgl.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/gamedemo/src/sdlgl.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -227,10 +227,10 @@ { if(fpsTimer.secs()<=1)fpsCounter++; beginDraw(); - (guiManager::getSystemBuffer())->clearBmp(rgba::BLACK); + (guiManager::getBuffer())->clearBmp(rgba::BLACK); - resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps); - resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getSystemBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); + resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps); + resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM()); guiManager::renderWindows(); Modified: trunk/examples/widgets/src/allegro.cpp =================================================================== --- trunk/examples/widgets/src/allegro.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/widgets/src/allegro.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -93,7 +93,7 @@ { if(fpsTimer.secs()<=1)fpsCounter++; - resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getSystemBuffer(),1,"FPS: %d",fps); + resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getBuffer(),1,"FPS: %d",fps); guiManager::renderWindows(); Modified: trunk/examples/widgets/src/allegrogl.cpp =================================================================== --- trunk/examples/widgets/src/allegrogl.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/widgets/src/allegrogl.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -95,7 +95,7 @@ allegro_gl_set_allegro_mode(); - resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getSystemBuffer(),1,"FPS: %d",fps); + resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getBuffer(),1,"FPS: %d",fps); guiManager::renderWindows(); Modified: trunk/examples/widgets/src/openlayer.cpp =================================================================== --- trunk/examples/widgets/src/openlayer.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/widgets/src/openlayer.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -93,7 +93,7 @@ { if(fpsTimer.secs()<=1)fpsCounter++; - resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getSystemBuffer(),1,"FPS: %d",fps); + resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getBuffer(),1,"FPS: %d",fps); guiManager::renderWindows(); Modified: trunk/examples/widgets/src/profiler.cpp =================================================================== --- trunk/examples/widgets/src/profiler.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/widgets/src/profiler.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -93,7 +93,7 @@ { if(fpsTimer.secs()<=1)fpsCounter++; - resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getSystemBuffer(),1,"FPS: %d",fps); + resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getBuffer(),1,"FPS: %d",fps); guiManager::renderWindows(); Modified: trunk/examples/widgets/src/sdl.cpp =================================================================== --- trunk/examples/widgets/src/sdl.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/widgets/src/sdl.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -93,7 +93,7 @@ { if(fpsTimer.secs()<=1)fpsCounter++; - resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getSystemBuffer(),1,"FPS: %d",fps); + resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getBuffer(),1,"FPS: %d",fps); guiManager::renderWindows(); Modified: trunk/examples/widgets/src/sdlgl.cpp =================================================================== --- trunk/examples/widgets/src/sdlgl.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/widgets/src/sdlgl.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -163,7 +163,7 @@ beginDraw(); - resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getSystemBuffer(),1,"FPS: %d",fps); + resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getBuffer(),1,"FPS: %d",fps); guiManager::renderWindows(); Modified: trunk/examples/xml/CMakeLists.txt =================================================================== --- trunk/examples/xml/CMakeLists.txt 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/xml/CMakeLists.txt 2007-09-03 13:22:37 UTC (rev 471) @@ -38,10 +38,10 @@ endif(ENABLE_ALLEGROGL) if(ENABLE_OPENLAYER) - include_directories(${ALLEGRO_INCLUDE_DIR} ${ALLEGROGL_INCLUDE_DIR} ${OPENLAYER_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) + include_directories(${FREETYPE_INCLUDE_DIR} ${ALLEGRO_INCLUDE_DIR} ${ALLEGROGL_INCLUDE_DIR} ${OPENLAYER_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) add_executable(xml-openlayer src/openlayer.cpp) target_link_libraries(xml-openlayer saggui-xml saggui-ol saggui-agl saggui-alleg saggui) - add_dependencies(xml-openlayer saggui-xml saggui-ol saggui-agl saggui-alleg saggui) + add_dependencies(xml-openlayer ${FREETYPE_LIBRARIES} saggui-xml saggui-ol saggui-agl saggui-alleg saggui) endif(ENABLE_OPENLAYER) if(ENABLE_SDL) Modified: trunk/examples/xml/src/allegro.cpp =================================================================== --- trunk/examples/xml/src/allegro.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/xml/src/allegro.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -74,7 +74,7 @@ std::cout << "Couldn't load xml file! Reason: " + e.getReason() + "\n"; } - listBox *bleh = dynamic_cast<listBox *>(xml.find("list")); + listBox *bleh = xml.find<listBox>("list"); if(bleh)std::cout << "selected item: " << bleh->selectedItem() << "\n"; // Main loop @@ -113,9 +113,9 @@ { if(fpsTimer.secs()<=1)fpsCounter++; - guiManager::getSystemBuffer()->clearBmp(rgba::BLACK); - resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps); - resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getSystemBuffer(),0,"Press 1 to reload xml file"); + guiManager::getBuffer()->clearBmp(rgba::BLACK); + resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps); + resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getBuffer(),0,"Press 1 to reload xml file"); guiManager::renderWindows(); Modified: trunk/examples/xml/src/allegrogl.cpp =================================================================== --- trunk/examples/xml/src/allegrogl.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/xml/src/allegrogl.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -74,7 +74,7 @@ std::cout << "Couldn't load xml file! Reason: " + e.getReason() + "\n"; } - listBox *bleh = dynamic_cast<listBox *>(xml.find("list")); + listBox *bleh = xml.find<listBox>("list"); if(bleh)std::cout << "selected item: " << bleh->selectedItem() << "\n"; // Main loop @@ -116,9 +116,9 @@ allegro_gl_set_allegro_mode(); - guiManager::getSystemBuffer()->clearBmp(rgba::BLACK); - resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps); - resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getSystemBuffer(),0,"Press 1 to reload xml file"); + guiManager::getBuffer()->clearBmp(rgba::BLACK); + resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps); + resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getBuffer(),0,"Press 1 to reload xml file"); guiManager::renderWindows(); Modified: trunk/examples/xml/src/openlayer.cpp =================================================================== --- trunk/examples/xml/src/openlayer.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/xml/src/openlayer.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -74,7 +74,7 @@ std::cout << "Couldn't load xml file! Reason: " + e.getReason() + "\n"; } - listBox *bleh = dynamic_cast<listBox *>(xml.find("list")); + listBox *bleh = xml.find<listBox>("list"); if(bleh)std::cout << "selected item: " << bleh->selectedItem() << "\n"; // Main loop @@ -113,9 +113,9 @@ { if(fpsTimer.secs()<=1)fpsCounter++; - guiManager::getSystemBuffer()->clearBmp(rgba::BLACK); - resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps); - resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getSystemBuffer(),0,"Press 1 to reload xml file"); + guiManager::getBuffer()->clearBmp(rgba::BLACK); + resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps); + resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getBuffer(),0,"Press 1 to reload xml file"); guiManager::renderWindows(); Modified: trunk/examples/xml/src/sdl.cpp =================================================================== --- trunk/examples/xml/src/sdl.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/xml/src/sdl.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -74,7 +74,7 @@ std::cout << "Couldn't load xml file! Reason: " + e.getReason() + "\n"; } - listBox *bleh = dynamic_cast<listBox *>(xml.find("list")); + listBox *bleh = xml.find<listBox>("list"); if(bleh)std::cout << "selected item: " << bleh->selectedItem() << "\n"; // Main loop @@ -113,9 +113,9 @@ { if(fpsTimer.secs()<=1)fpsCounter++; - guiManager::getSystemBuffer()->clearBmp(rgba::BLACK); - resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps); - resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getSystemBuffer(),0,"Press 1 to reload xml file"); + guiManager::getBuffer()->clearBmp(rgba::BLACK); + resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps); + resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getBuffer(),0,"Press 1 to reload xml file"); guiManager::renderWindows(); Modified: trunk/examples/xml/src/sdlgl.cpp =================================================================== --- trunk/examples/xml/src/sdlgl.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/examples/xml/src/sdlgl.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -109,8 +109,15 @@ { resourceManager::registerBackend<SDLGL_SAGGUI>(); - guiManager::setup("sdl"); - + try + { + guiManager::setup("sdlgl"); + } + catch(const sagguiException &e) + { + std::cout << "Couldn't set up system!\n" << e.getReason(); + return 1; + } // Create a timer to regulate the logic loop guiTimer timer, fpsTimer; int fps=0,fpsCounter =0; @@ -121,9 +128,13 @@ bool quit = false; // Set the resolution of the demo - if(!guiManager::setupScreen(640,480,32,fullscreen, buffered)) + try { - std::cout << "Couldn't create display\n"; + guiManager::setupScreen(640,480,32,fullscreen, buffered); + } + catch(const sagguiException &e) + { + std::cout << "Couldn't create display!\n" << e.getReason(); return 1; } glMatrixMode(GL_PROJECTION); // projection transforms @@ -142,7 +153,7 @@ std::cout << "Couldn't load xml file! Reason: " + e.getReason() + "\n"; } - listBox *bleh = dynamic_cast<listBox *>(xml.find("list")); + listBox *bleh = xml.find<listBox>("list"); if(bleh)std::cout << "selected item: " << bleh->selectedItem() << "\n"; // Main loop @@ -182,9 +193,9 @@ if(fpsTimer.secs()<=1)fpsCounter++; beginDraw(); - guiManager::getSystemBuffer()->clearBmp(rgba::BLACK); - resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps); - resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getSystemBuffer(),0,"Press 1 to reload xml file"); + guiManager::getBuffer()->clearBmp(rgba::BLACK); + resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps); + resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getBuffer(),0,"Press 1 to reload xml file"); guiManager::renderWindows(); Modified: trunk/include/saggui/creationengine.h =================================================================== --- trunk/include/saggui/creationengine.h 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/include/saggui/creationengine.h 2007-09-03 13:22:37 UTC (rev 471) @@ -133,7 +133,7 @@ virtual void load(const std::string &filename)=0; //! find - window *find(const std::string &id); + template<typename T>T *find(const std::string &id){ return dynamic_cast<T *>(windows.find(id)->second); } /*! Get a window according to a windowMarkup which automatically adds to the list of windows \n * this is to allow the engine itself to add parameters or fill information about the widget \n @@ -141,9 +141,6 @@ */ window *createWindow(windowMarkup &win); - //! Usefull tool to convert colors - static rgba getColor(const std::string &color); - protected: //! Add a window to the list Modified: trunk/include/saggui/graphics.h =================================================================== --- trunk/include/saggui/graphics.h 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/include/saggui/graphics.h 2007-09-03 13:22:37 UTC (rev 471) @@ -61,64 +61,6 @@ class SAGGUI_EXPORT graphic { - private: - //! ID of bitmap to keep track of it - int ID; - - //! Is this graphic a screen bitmap - bool isScreen; - - //! Is buffered? - static bool buffered; - - //! Is a background bitmap buffer - bool bitmapBuffer; - - //! Screen bitmap - static graphic *screenBitmap; - - //! Comparison of IDs - bool operator==(graphic *bmp); - - //! Set screen Bitmap - void setScreenBmp(void *s); - - //! min (borrowed from allegro) - static inline double Min(double x, double y){ return (((x) < (y)) ? (x) : (y)); } - - //! max (borrowed from allegro) - static inline double Max(double x, double y){ return (((x) > (y)) ? (x) : (y)); } - - //! mid (borrowed from allegro) - static inline double Mid(double x,double y,double z){ return (Max((x), Min((y), (z)))); } - - friend class graphicManager; - friend class fontManager; - friend class resourceManager; - friend class guiManager; - friend class system; - - protected: - - // Bitmap related - //! Loaded filename, if nothing will be blank - std::string loadedFile; - - //! initialized - bool initialized; - - //! Bitmap1 - void *bitmap; - - //! Array dump - bool arrayDump; - - //! loaded file from int array - char **dataDump; - - //! Destroy Bitmap - virtual bool destroyBmp()=0; - public: //!Constructor @@ -216,7 +158,7 @@ virtual void resetClip()=0; //! Get the current buffer bitmap for the set system - template <class Buff>Buff getBmp() { return static_cast<Buff>(bitmap); } + template <typename T>T *getBmp() { return static_cast<T *>(bitmap); } //! Get bitmap Height virtual double getBmpHeight(void)=0; @@ -229,6 +171,65 @@ //! Render a certain area of a bitmap virtual void renderBmp(double x1, double y1, double x2, double y2, double width, double height, const rgba &color, graphic *b=0)=0; + + protected: + + // Bitmap related + //! Loaded filename, if nothing will be blank + std::string loadedFile; + + //! initialized + bool initialized; + + //! Bitmap1 + void *bitmap; + + //! Array dump + bool arrayDump; + + //! loaded file from int array + char **dataDump; + + //! Destroy Bitmap + virtual bool destroyBmp()=0; + + private: + //! ID of bitmap to keep track of it + int ID; + + //! Is this graphic a screen bitmap + bool isScreen; + + //! Is buffered? + static bool buffered; + + //! Is a background bitmap buffer + bool bitmapBuffer; + + //! Screen bitmap + static graphic *screenBitmap; + + //! Comparison of IDs + bool operator==(graphic *bmp); + + //! Set screen Bitmap + void setScreenBmp(void *s); + + //! min (borrowed from allegro) + static inline double Min(double x, double y){ return (((x) < (y)) ? (x) : (y)); } + + //! max (borrowed from allegro) + static inline double Max(double x, double y){ return (((x) > (y)) ? (x) : (y)); } + + //! mid (borrowed from allegro) + static inline double Mid(double x,double y,double z){ return (Max((x), Min((y), (z)))); } + + friend class graphicManager; + friend class fontManager; + friend class resourceManager; + friend class guiManager; + friend class system; + }; } Modified: trunk/include/saggui/gui_manager.h =================================================================== --- trunk/include/saggui/gui_manager.h 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/include/saggui/gui_manager.h 2007-09-03 13:22:37 UTC (rev 471) @@ -48,6 +48,7 @@ #include "dllspec.h" #include "window.h" #include "sigslot.h" +#include "sagguiexception.h" #include "debug.h" @@ -75,13 +76,13 @@ //! \name Public Members //! Setup - static void setup(const std::string & sys, bool systemInitCalls=true); + static void setup(const std::string & sys, bool systemInitCalls=true) throw(sagguiException); - //! Set system screen - static void setScreen(void *s, bool bitmapBuffers=true); + //! Set system buffer + static void setBuffer(void *s, bool bitmapBuffers=true); //! Resolution - static bool setupScreen(double width, double height, double depth=32, bool fullscreen=false, bool bitmapBuffers=true); + static bool setupScreen(double width, double height, double depth=32, bool fullscreen=false, bool bitmapBuffers=true) throw(sagguiException); //! Add window static void addWindow(window *w); @@ -101,8 +102,8 @@ //! Toggle if the system is active static void toggleActive(); - //! Get the current graphic bitmap - static graphic *getSystemBuffer(); + //! Get the current graphic buffer + static graphic *getBuffer(); //! Get the current set screen static graphic *getScreen(); @@ -157,7 +158,7 @@ ~guiManager(); //! Set screen - void setSystemScreen(void *s, bool bitmapBuffers); + void setSysBuffer(void *s, bool bitmapBuffers); //! Set resolution bool setResolution(double width, double height, double depth=32, bool fullscreen=false, bool bitmapBuffers=true); Modified: trunk/include/saggui/resource_manager.h =================================================================== --- trunk/include/saggui/resource_manager.h 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/include/saggui/resource_manager.h 2007-09-03 13:22:37 UTC (rev 471) @@ -66,6 +66,25 @@ */ class SAGGUI_EXPORT resourceManager { + public: + + //! Register backend library (ie allegro) with SAGGUI + /*! Registers the library with SAGGUI so it can be used */ + template <typename t>static void registerBackend() { libraryFactory::registerLibrary(new t); } + + //! Register font library (ie freetype) with SAGGUI + /*! Registers the library with SAGGUI so it can be used */ + template <typename t>static void registerFont() { fontManager::registerType(new t); } + + //! Create graphic from current set lib + static graphic *createGraphic(); + + //! Delete graphic from current set library_factory + static void destroyGraphic(graphic *bmp); + + //! Get font + static font *getFont(int ID=1); + private: //! Constructor resourceManager(); @@ -114,24 +133,6 @@ friend class guiManager; friend class font; - public: - - //! Register backend library (ie allegro) with SAGGUI - /*! Registers the library with SAGGUI so it can be used */ - template <typename t>static void registerBackend() { libraryFactory::registerLibrary(new t); } - - //! Register font library (ie freetype) with SAGGUI - /*! Registers the library with SAGGUI so it can be used */ - template <typename t>static void registerFont() { fontManager::registerType(new t); } - - //! Create graphic from current set lib - static graphic *createGraphic(); - - //! Delete graphic from current set library_factory - static void destroyGraphic(graphic *bmp); - - //! Get font - static font *getFont(int ID=1); }; } Modified: trunk/include/saggui/rgba.h =================================================================== --- trunk/include/saggui/rgba.h 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/include/saggui/rgba.h 2007-09-03 13:22:37 UTC (rev 471) @@ -112,7 +112,10 @@ //! get rgba value in the form of an unsigned integer const unsigned int get(); + //! Usefull tool to convert colors from strings + static rgba getColor(const std::string &color); + //! \name Static Colors static const rgba WHITE; static const rgba BLACK; Modified: trunk/include/saggui/window.h =================================================================== --- trunk/include/saggui/window.h 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/include/saggui/window.h 2007-09-03 13:22:37 UTC (rev 471) @@ -56,8 +56,8 @@ namespace saggui { //! Forward decleration of guiManager and mouseManager - class guiManager; // Requires forward declaration - class mouseManager; + //class guiManager; // Requires forward declaration + //class mouseManager; class style; class graphic; class rgba; Modified: trunk/modules/allegro/src/al_font.cpp =================================================================== --- trunk/modules/allegro/src/al_font.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/modules/allegro/src/al_font.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -140,15 +140,15 @@ switch(alignment) { case 0: - textout_ex(bmp->getBmp<BITMAP *>(), currentFont, str.str().c_str(), int(x), int(y), makecol(int(color.red), int(color.green), int(color.blue)), + textout_ex(bmp->getBmp<BITMAP>(), currentFont, str.str().c_str(), int(x), int(y), makecol(int(color.red), int(color.green), int(color.blue)), -1); break; case 1: - textout_centre_ex(bmp->getBmp<BITMAP *>(), currentFont, str.str().c_str(), int(x), int(y), makecol(int(color.red), int(color.green), int(color.blue)), + textout_centre_ex(bmp->getBmp<BITMAP>(), currentFont, str.str().c_str(), int(x), int(y), makecol(int(color.red), int(color.green), int(color.blue)), -1); break; case 2: - textout_right_ex(bmp->getBmp<BITMAP *>(), currentFont, str.str().c_str(), int(x), int(y), makecol(int(color.red), int(color.green), int(color.blue)), + textout_right_ex(bmp->getBmp<BITMAP>(), currentFont, str.str().c_str(), int(x), int(y), makecol(int(color.red), int(color.green), int(color.blue)), -1); break; } Modified: trunk/modules/allegro/src/al_gfx.cpp =================================================================== --- trunk/modules/allegro/src/al_gfx.cpp 2007-09-01 14:42:39 UTC (rev 470) +++ trunk/modules/allegro/src/al_gfx.cpp 2007-09-03 13:22:37 UTC (rev 471) @@ -77,7 +77,7 @@ { if(initialized) { - if(!isBuffered() && !getBmp<BITMAP *>()) + if(!isBuffered() && !getBmp<BITMAP>()) { if(color==rgba::NOCOLOR || color.alpha == 255) { @@ -91,31 +91,31 @@ solid_mode(); } } - else if(!bmp && getBmp<BITMAP *>()) + else if(!bmp && getBmp<BITMAP>()) { if(color==rgba::NOCOLOR || color.alpha == 255) { - line(getBmp<BITMAP *>(), (int)x1, (int)y1, (int)x2, (int)y2, make_allegro_color(color)); + line(getBmp<BITMAP>(), (int)x1, (int)y1, (int)x2, (int)y2, make_allegro_color(color)); } else { set_trans_blender((int)color.red, (int)color.green, (int)color.blue, (int)color.alpha); drawing_mode(DRAW_MODE_TRANS, 0, 0, 0); - line(getBmp<BITMAP *>(), (int)x1, (int)y1, (int)x2, (int)y2, make_allegro_color(color)); + line(getBmp<BITMAP>(), (int)x1, (int)y1, (int)x2, (int)y2, make_allegro_color(color)); solid_mode(); } } - else if(bmp && bmp->getBmp<BITMAP *>()) + else if(bmp && bmp->getBmp<BITMAP>()) { if(color==rgba::NOCOLOR || color.alpha == 255) { - line(bmp->getBmp<BITMAP *>(), (int)x1, (int)y1, (int)x2, (int)y2, make_allegro_color(color)); + line(bmp->getBmp<BITMAP>(), (int)x1, (int)y1, (int)x2, (int)y2, make_allegro_color(color)); } else { set_trans_blender((int)color.red, (int)color.green, (int)color.blue, (int)color.alpha); drawing_mode(DRAW_MODE_TRANS, 0, 0, 0); - line(bmp->getBmp<BITMAP *>(), (int)x1, (int)y1, (int)x2, (int)y2, make_allegro_color(color)); + line(bmp->getBmp<BITMAP>(), (int)x1, (int)y1, (int)x2, (int)y2, make_allegro_color(color)); solid_mode(); } } @@ -128,7 +128,7 @@ { if(initialized) { - if(!isBuffered() && !getBmp<BITMAP *>()) + if(!isBuffered() && !getBmp<BITMAP>()) { if(color==rgba::NOCOLOR || color.alpha == 255) { @@ -142,31 +142,31 @@ solid_mode(); } } - else if(!bmp && getBmp<BITMAP *>()) + else if(!bmp && getBmp<BITMAP>()) { if(color==rgba::NOCOLOR || color.alpha == 255) { - putpixel(getBmp<BITMAP *>(), (int)x, (int)y, make_allegro_color(color)); + putpixel(getBmp<BITMAP>(), (int)x, (int)y, make_allegro_color(color)); } else { set_trans_blender((int)color.red, (int)color.green, (int)color.blue, (int)color.alpha); drawing_mode(DRAW_MODE_TRANS, 0, 0, 0); - putpixel(getBmp<BITMAP *>(), (int)x, (int)y, make_allegro_color(color)); + putpixel(getBmp<BITMAP>(), (int)x, (int)y, make_allegro_color(color)); solid_mode(); } } - else if(bmp && bmp->getBmp<BITMAP *>()) + else if(bmp && bmp->getBmp<BITMAP>()) { if(color==rgba::NOCOLOR || color.alpha == 255) { - putpixel(bmp->getBmp<BITMAP *>(), (int)x, (int)y, make_allegro_color(color)); + putpixel(bmp->getBmp<BITMAP>(), (int)x, (int)y, make_allegro_color(color)); } else { set_trans_blender((int)color.red, (int)color.green, (int)color.blue, (int)color.alpha); drawing_mode(DRAW_MODE_TRANS, 0, 0, 0); - putpixel(bmp->getBmp<BITMAP *>(), (int)x, (int)y, make_allegro_color(color)); + putpixel(bmp->getBmp<BITMAP>(), (int)x, (int)y, make_allegro_color(color)); solid_mode(); } } @@ -178,17 +178,17 @@ int pixel=0; if(initialized) { - if(!isBuffered() && !getBmp<BITMAP *>()) + if(!isBuffered() && !getBmp<BITMAP>()) { pixel = getpixel(screen, (int)x, (int)y); } - else if(!bmp && getBmp<BITMAP *>()) + else if(!bmp && getBmp<BITMAP>()) { - pixel = getpixel(getBmp<BITMAP *>(), (int)x, (int)y); + pixel = getpixel(get... [truncated message content] |
From: <sag...@li...> - 2007-09-21 12:08:32
|
Revision: 472 http://saggui.svn.sourceforge.net/saggui/?rev=472&view=rev Author: juvinious Date: 2007-09-21 05:08:27 -0700 (Fri, 21 Sep 2007) Log Message: ----------- Added other widget specific parsing in xmlengine Modified Paths: -------------- trunk/CHANGELOG trunk/modules/sagguixml/include/sagguixml.h trunk/modules/sagguixml/src/sagguixml.cpp Modified: trunk/CHANGELOG =================================================================== --- trunk/CHANGELOG 2007-09-03 13:22:37 UTC (rev 471) +++ trunk/CHANGELOG 2007-09-21 12:08:27 UTC (rev 472) @@ -1,4 +1,5 @@ 0.50 +- api changes in guiManager: setScreen -> setBuffer ; some methods got some exceptions added - Some code cleanup and renamed some stuff which could impact the previous api - Moved getColor from creationEngine to rgba - Converted all paint signals to use the new paintEvent class Modified: trunk/modules/sagguixml/include/sagguixml.h =================================================================== --- trunk/modules/sagguixml/include/sagguixml.h 2007-09-03 13:22:37 UTC (rev 471) +++ trunk/modules/sagguixml/include/sagguixml.h 2007-09-21 12:08:27 UTC (rev 472) @@ -78,15 +78,36 @@ //! Do windows children virtual void children(TiXmlElement *element, window *parent); - //! Specific to listbox - virtual void listbox(TiXmlElement *element, window *parent); + //! Specific to checkbox + virtual void checkbox(TiXmlElement *element, window *parent); + //! Specific to dialog + virtual void doDialog(TiXmlElement *element, window *parent); + //! Specific to inputbox virtual void inputbox(TiXmlElement *element, window *parent); - //! Specific to inputbox + //! Specific to label virtual void doLabel(TiXmlElement *element, window *parent); + //! Specific to listbox + virtual void listbox(TiXmlElement *element, window *parent); + + //! Specific to progressbar + virtual void progressbar(TiXmlElement *element, window *parent); + + //! Specific to pushbutton + virtual void pushbutton(TiXmlElement *element, window *parent); + + //! Specific to radial + virtual void doRadial(TiXmlElement *element, window *parent); + + //! Specific to scrollbar + virtual void scrollbar(TiXmlElement *element, window *parent); + + //! Specific to textbox + virtual void textbox(TiXmlElement *element, window *parent); + }; } Modified: trunk/modules/sagguixml/src/sagguixml.cpp =================================================================== --- trunk/modules/sagguixml/src/sagguixml.cpp 2007-09-03 13:22:37 UTC (rev 471) +++ trunk/modules/sagguixml/src/sagguixml.cpp 2007-09-21 12:08:27 UTC (rev 472) @@ -39,9 +39,20 @@ #include "sagguixml.h" #include "tinyxml.h" #include "window.h" -#include "widgets/listbox.h" +#include "widgets/abstractbutton.h" +#include "widgets/box.h" +#include "widgets/button.h" +#include "widgets/buttongroup.h" +#include "widgets/checkbox.h" +#include "widgets/dialog.h" #include "widgets/input_box.h" #include "widgets/label.h" +#include "widgets/listbox.h" +#include "widgets/progress_bar.h" +#include "widgets/pushbutton.h" +#include "widgets/radial.h" +#include "widgets/scroll_bar.h" +#include "widgets/text_box.h" namespace saggui { @@ -175,10 +186,15 @@ if(!tempWin)throw sagguiException("Failed to load window: " + std::string(element->Value()) + "!"); // Do specific child related elements - if(temp.getType() == windowMarkup::LISTBOX) + + if(temp.getType() == windowMarkup::CHECKBOX) { - listbox(element, tempWin); + checkbox(element, tempWin); } + else if(temp.getType() == windowMarkup::DIALOG) + { + doDialog(element, tempWin); + } else if(temp.getType() == windowMarkup::INPUTBOX) { inputbox(element, tempWin); @@ -187,6 +203,30 @@ { doLabel(element, tempWin); } + else if(temp.getType() == windowMarkup::LISTBOX) + { + listbox(element, tempWin); + } + else if(temp.getType() == windowMarkup::PROGRESSBAR) + { + progressbar(element, tempWin); + } + else if(temp.getType() == windowMarkup::PUSHBUTTON) + { + pushbutton(element, tempWin); + } + else if(temp.getType() == windowMarkup::RADIAL) + { + doRadial(element, tempWin); + } + else if(temp.getType() == windowMarkup::SCROLLBAR) + { + scrollbar(element, tempWin); + } + else if(temp.getType() == windowMarkup::TEXTBOX) + { + textbox(element, tempWin); + } else { children(element, tempWin); @@ -208,28 +248,18 @@ } } - void xmlEngine::listbox(TiXmlElement *element, window *parent) + void xmlEngine::checkbox(TiXmlElement *element, window *parent) { - TiXmlNode *child = element->FirstChild(); - listBox *temp = dynamic_cast<listBox *>(parent); + checkBox *temp = dynamic_cast<checkBox *>(parent); if(!temp)return; - bool hasItems = false; - while(child != NULL) - { - TiXmlElement *elem = child->ToElement(); - if(elem->Value() == std::string("li")) - { - if(!hasItems) - { - hasItems=true; - temp->clearItems(); - } - temp->addItem(elem->FirstChild()->Value()); - } - child = child->NextSibling(); - } } + void xmlEngine::doDialog(TiXmlElement *element, window *parent) + { + dialog *temp = dynamic_cast<dialog *>(parent); + if(!temp)return; + } + void xmlEngine::inputbox(TiXmlElement *element, window *parent) { inputBox *temp = dynamic_cast<inputBox *>(parent); @@ -286,5 +316,58 @@ temp->onResize.emit(); } } + + void xmlEngine::listbox(TiXmlElement *element, window *parent) + { + TiXmlNode *child = element->FirstChild(); + listBox *temp = dynamic_cast<listBox *>(parent); + if(!temp)return; + bool hasItems = false; + while(child != NULL) + { + TiXmlElement *elem = child->ToElement(); + if(elem->Value() == std::string("li")) + { + if(!hasItems) + { + hasItems=true; + temp->clearItems(); + } + temp->addItem(elem->FirstChild()->Value()); + } + child = child->NextSibling(); + } + } + + void xmlEngine::progressbar(TiXmlElement *element, window *parent) + { + progressBar *temp = dynamic_cast<progressBar *>(parent); + if(!temp)return; + } + + void xmlEngine::pushbutton(TiXmlElement *element, window *parent) + { + pushButton *temp = dynamic_cast<pushButton *>(parent); + if(!temp)return; + } + + void xmlEngine::doRadial(TiXmlElement *element, window *parent) + { + radial *temp = dynamic_cast<radial *>(parent); + if(!temp)return; + } + + void xmlEngine::scrollbar(TiXmlElement *element, window *parent) + { + scrollBar *temp = dynamic_cast<scrollBar *>(parent); + if(!temp)return; + } + + void xmlEngine::textbox(TiXmlElement *element, window *parent) + { + textBox *temp = dynamic_cast<textBox *>(parent); + if(!temp)return; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@li...> - 2007-12-05 15:30:31
|
Revision: 473 http://saggui.svn.sourceforge.net/saggui/?rev=473&view=rev Author: juvinious Date: 2007-12-05 07:30:28 -0800 (Wed, 05 Dec 2007) Log Message: ----------- Fixed pushbutton to center icons. Fixed gamedemos buttons and some visual elements. Modified Paths: -------------- trunk/CHANGELOG trunk/examples/gamedemo/include/gamedemo.h trunk/examples/gamedemo/src/gamedemo.cpp trunk/src/widgets/pushbutton.cpp Modified: trunk/CHANGELOG =================================================================== --- trunk/CHANGELOG 2007-09-21 12:08:27 UTC (rev 472) +++ trunk/CHANGELOG 2007-12-05 15:30:28 UTC (rev 473) @@ -1,4 +1,6 @@ 0.50 +- Fixed gamedemo's buttons and other visual elements +- Fixed pushButton to center icon properly when added - api changes in guiManager: setScreen -> setBuffer ; some methods got some exceptions added - Some code cleanup and renamed some stuff which could impact the previous api - Moved getColor from creationEngine to rgba Modified: trunk/examples/gamedemo/include/gamedemo.h =================================================================== --- trunk/examples/gamedemo/include/gamedemo.h 2007-09-21 12:08:27 UTC (rev 472) +++ trunk/examples/gamedemo/include/gamedemo.h 2007-12-05 15:30:28 UTC (rev 473) @@ -140,6 +140,8 @@ private: void showText(const coord &c); void hideText(const coord &c); + + filledDecor decor; public: icon(window *parent, graphic *bmp, double x, double y, double width=32, double height=32); ~icon(); Modified: trunk/examples/gamedemo/src/gamedemo.cpp =================================================================== --- trunk/examples/gamedemo/src/gamedemo.cpp 2007-09-21 12:08:27 UTC (rev 472) +++ trunk/examples/gamedemo/src/gamedemo.cpp 2007-12-05 15:30:28 UTC (rev 473) @@ -237,7 +237,7 @@ { //foreground = rgba(0,128,128,255);//rgba(67,87,106,255); //background = foreground; - topPadding = bottomPadding = leftPadding = rightPadding = 4; + topPadding = bottomPadding = leftPadding = rightPadding = 1; onPaintBackground.connect(this,&filledDecor::doBackground); onPaintForeground.connect(this,&filledDecor::doForeground); } @@ -311,6 +311,7 @@ b1.position.set(x,y,width,height); b1.onHover.connect(this,&icon::showText); b1.onHoverOut.connect(this,&icon::hideText); + b1.setStyle(&decor); text.setAttribute(AT_Visible,false); text.setAutoResize(true); text.setText("Not Available"); Modified: trunk/src/widgets/pushbutton.cpp =================================================================== --- trunk/src/widgets/pushbutton.cpp 2007-09-21 12:08:27 UTC (rev 472) +++ trunk/src/widgets/pushbutton.cpp 2007-12-05 15:30:28 UTC (rev 473) @@ -144,8 +144,8 @@ iconPosition.setY(topPadding + 1); } - iconPosition.setX(leftPadding + 1); - iconPosition.setY(topPadding + 1); + iconPosition.setX(1); + iconPosition.setY(1); // This is to ensure that the text actually fixes itself onTextChanged(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@li...> - 2007-12-14 14:21:02
|
Revision: 474 http://saggui.svn.sourceforge.net/saggui/?rev=474&view=rev Author: juvinious Date: 2007-12-14 06:20:39 -0800 (Fri, 14 Dec 2007) Log Message: ----------- Made roundrect quite more accurate Modified Paths: -------------- trunk/CHANGELOG trunk/include/saggui/graphics.h trunk/src/graphics.cpp Modified: trunk/CHANGELOG =================================================================== --- trunk/CHANGELOG 2007-12-05 15:30:28 UTC (rev 473) +++ trunk/CHANGELOG 2007-12-14 14:20:39 UTC (rev 474) @@ -1,4 +1,6 @@ 0.50 +- Fixed roundRect so that it's accurate +- Changed arc to be more accurate, borrowed read in comments - Fixed gamedemo's buttons and other visual elements - Fixed pushButton to center icon properly when added - api changes in guiManager: setScreen -> setBuffer ; some methods got some exceptions added Modified: trunk/include/saggui/graphics.h =================================================================== --- trunk/include/saggui/graphics.h 2007-12-05 15:30:28 UTC (rev 473) +++ trunk/include/saggui/graphics.h 2007-12-14 14:20:39 UTC (rev 474) @@ -70,7 +70,9 @@ virtual ~graphic(); //! PI - static double S_PI; + const static double S_PI; + const static double DEG_TO_RAD; + const static double RAD_TO_DEG; //! Check if bitmap has been initialized bool isInitialized(); Modified: trunk/src/graphics.cpp =================================================================== --- trunk/src/graphics.cpp 2007-12-05 15:30:28 UTC (rev 473) +++ trunk/src/graphics.cpp 2007-12-14 14:20:39 UTC (rev 474) @@ -46,8 +46,15 @@ { bool graphic::buffered = false; graphic *graphic::screenBitmap = 0; - double graphic::S_PI = 3.14159265358979323846; + const double graphic::S_PI = 3.14159265358979323846; + const double graphic::DEG_TO_RAD = 180.0/S_PI; + const double graphic::RAD_TO_DEG = S_PI/180.0; + void round_double (double dbl_to_round , int &rounded_num) { + rounded_num = static_cast<int>(dbl_to_round); + if ((dbl_to_round - static_cast<double>(rounded_num)) >= 0.5) {rounded_num++;} + } + // Constructor graphic::graphic() { @@ -102,46 +109,84 @@ return screenBitmap; } - //! Draw an arc to bitmap or passed bitmap + /* Draw an arc to bitmap or passed bitmap + Borrowed code from a post on a.cc: + http://www.allegro.cc/forums/thread/594175 + */ void graphic::doArc(double x, double y, double startAngle, double radius, const rgba &color, graphic *bmp) { - float angleIncrement = std::min(( 2.0 * asin( 1.0/radius )/1.0 ), 0.35 * S_PI ); - float endAngle = startAngle + S_PI/2; + int q = 0;// for counters + double d_q = 0.0;// for percentage of loop completed + double d_q_plus_one = 0.0; - float prevX = x + cos(startAngle) * radius; - float prevY = y + sin(startAngle) * radius; - - if(!bmp) - { - for( float a = startAngle; a < endAngle; a += angleIncrement ) - { - float cosa = cos(a); - float sina = sin(a); - - float newX = x + cosa * radius; - float newY = y + sina * radius; - - doLine(prevX,prevY,newX,newY,color); - prevX = newX; - prevY = newY; + const double d_angular_length_deg = 0.030; + const double d_start_angle_rad = startAngle*DEG_TO_RAD; + const double d_angular_length_rad = d_angular_length_deg*DEG_TO_RAD; + const double d_arc_distance_between_points = 0.25*pow(2.0 , static_cast<double>(10) / 10.0); + double d_angular_length_rad_per_segment = 0.0; + + double arc_length = radius*d_angular_length_rad; + if (arc_length < 0.0) {arc_length *= -1.0;} + const double d_num_segments = arc_length / d_arc_distance_between_points; + + int num_segments = 0; + round_double(d_num_segments , num_segments); + + if (num_segments == 0) {num_segments += 1;} // need at least one segment (two points) + const int num_points = num_segments + 1; + const double d_num_points_minus_one = static_cast<double>(num_points - 1); + + int arc_point_x;//[num_points]; + int arc_point_y;//[num_points]; + int arc_point2_x;//[num_points]; + int arc_point2_y;//[num_points]; + double d_arc_point_x = 0.0; + double d_arc_point_y = 0.0; + double d_arc_point2_x = 0.0; + double d_arc_point2_y = 0.0; + + double current_angle_rad = 0.0; + double current_angle2_rad = 0.0; + + if (d_arc_distance_between_points <= 1.0) { + for (q = 0 ; q < num_points ; q++) { + d_q = static_cast<double>(q); + current_angle_rad = d_start_angle_rad + (d_q / d_num_points_minus_one)*d_angular_length_rad; + d_arc_point_x = x + radius*cos(current_angle_rad); + d_arc_point_y = y + radius*sin(current_angle_rad); + + round_double(d_arc_point_x , arc_point_x); + round_double(d_arc_point_y , arc_point_y); + + if(!bmp)placePixel(arc_point_x,arc_point_y,color); + else bmp->placePixel(arc_point_x,arc_point_y,color); } - doLine(prevX,prevY, x + cos(endAngle) * radius, y + sin(endAngle) * radius,color); } - else - { - for( float a = startAngle; a < endAngle; a += angleIncrement ) - { - float cosa = cos(a); - float sina = sin(a); - - float newX = x + cosa * radius; - float newY = y + sina * radius; - - bmp->doLine(prevX,prevY,newX,newY,color); - prevX = newX; - prevY = newY; + if (d_arc_distance_between_points > 1.0) { + + d_angular_length_rad_per_segment = d_angular_length_rad / d_num_points_minus_one; + for (q = 0 ; q < num_segments ; q++) { + d_q = static_cast<double>(q); + d_q_plus_one = static_cast<double>(q + 1); + + current_angle_rad = d_start_angle_rad + d_q*d_angular_length_rad_per_segment; + current_angle2_rad = d_start_angle_rad + d_q_plus_one*d_angular_length_rad_per_segment; + + d_arc_point_x = x + radius*cos(current_angle_rad); + d_arc_point_y = y + radius*sin(current_angle_rad); + + round_double(d_arc_point_x , arc_point_x); + round_double(d_arc_point_y , arc_point_y); + + d_arc_point2_x = x + radius*cos(current_angle2_rad); + d_arc_point2_y = y + radius*sin(current_angle2_rad); + + round_double(d_arc_point2_x , arc_point2_x); + round_double(d_arc_point2_y , arc_point2_y); + + if(!bmp)doLine(arc_point_x,arc_point_y, arc_point2_x, arc_point2_y,color); + else bmp->doLine(arc_point_x,arc_point_y, arc_point2_x, arc_point2_y,color); } - bmp->doLine(prevX,prevY, x + cos(endAngle) * radius, y + sin(endAngle) * radius,color); } } @@ -155,10 +200,10 @@ doLine(x+radius, y+height, x+width-radius,y+height, color); doLine(x, y+radius,x, y+height-radius, color); doLine(x+width, y+radius,x+width, y+height-radius, color); - doArc(x+radius, y+radius, S_PI, radius, color); - doArc(x+radius + (width - radius *2), y+radius, -S_PI/2, radius, color); - doArc(x+width-radius, y+height-radius, 0, radius ,color); - doArc(x+radius, y+height-radius, S_PI/2, radius, color); + doArc(x+radius, y+radius, S_PI-1.115, radius, color); + doArc(x+radius + (width - radius *2), y+radius, -S_PI/2 +0.116, radius, color); + doArc(x+width-radius, y+height-radius, -0.110, radius ,color); + doArc(x+radius, y+height-radius, S_PI/2-0.119, radius, color); } else { @@ -166,10 +211,10 @@ bmp->doLine(x+radius, y+height, x+width-radius,y+height, color); bmp->doLine(x, y+radius,x, y+height-radius, color); bmp->doLine(x+width, y+radius,x+width, y+height-radius, color); - bmp->doArc(x+radius, y+radius, S_PI, radius, color); - bmp->doArc(x+radius + (width - radius *2), y+radius, -S_PI/2, radius, color); - bmp->doArc(x+width-radius, y+height-radius, 0, radius ,color); - bmp->doArc(x+radius, y+height-radius, S_PI/2, radius, color); + bmp->doArc(x+radius, y+radius, S_PI-1.115, radius, color); + bmp->doArc(x+radius + (width - radius *2), y+radius, -S_PI/2 +0.116, radius, color); + bmp->doArc(x+width-radius, y+height-radius, -0.110, radius ,color); + bmp->doArc(x+radius, y+height-radius, S_PI/2-0.119, radius, color); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@li...> - 2007-12-18 05:25:07
|
Revision: 476 http://saggui.svn.sourceforge.net/saggui/?rev=476&view=rev Author: juvinious Date: 2007-12-17 21:24:37 -0800 (Mon, 17 Dec 2007) Log Message: ----------- Added the ability to disable mouse Modified Paths: -------------- trunk/CHANGELOG trunk/include/saggui/mouse_manager.h trunk/src/gui_manager.cpp trunk/src/mouse_manager.cpp Modified: trunk/CHANGELOG =================================================================== --- trunk/CHANGELOG 2007-12-18 03:17:22 UTC (rev 475) +++ trunk/CHANGELOG 2007-12-18 05:24:37 UTC (rev 476) @@ -1,6 +1,7 @@ 0.50 +- Added the ability to mouseManager to disable mouse - Fixed some install issues in CMakeLists.txt -- Moved over sagguixml into the main module since it reality doesn't need to be seperated as a module +- Moved over sagguixml into the main module since it really doesn't need to be seperated as a module - Fixed roundRect so that it's accurate - Changed arc to be more accurate, borrowed read in comments - Fixed gamedemo's buttons and other visual elements Modified: trunk/include/saggui/mouse_manager.h =================================================================== --- trunk/include/saggui/mouse_manager.h 2007-12-18 03:17:22 UTC (rev 475) +++ trunk/include/saggui/mouse_manager.h 2007-12-18 05:24:37 UTC (rev 476) @@ -172,6 +172,9 @@ //! Right mouse click state mouseStates mRightClickState; + //! Enabled + bool enabled; + //! Evaluate mouse and fire events void update(); @@ -247,6 +250,12 @@ //! Set currentMousePosition static void setPosition(int x, int y); + //! Enable mouse + static void enable(bool e); + + //! Enable mouse + static bool isEnabled(); + //! \name Signals static signal1<const coord &> move; Modified: trunk/src/gui_manager.cpp =================================================================== --- trunk/src/gui_manager.cpp 2007-12-18 03:17:22 UTC (rev 475) +++ trunk/src/gui_manager.cpp 2007-12-18 05:24:37 UTC (rev 476) @@ -163,7 +163,7 @@ (mouseManager::getInstance())->drag=false; currentWindowFocused = 0; } - (mouseManager::getInstance())->checkHover(parents); + if(mouseManager::getInstance()->isEnabled())(mouseManager::getInstance())->checkHover(parents); } // Raises window or its parent to the top of the vector @@ -547,7 +547,7 @@ void guiManager::updateLogic() { // Update the mouse - (mouseManager::getInstance())->update(); + if(mouseManager::getInstance()->isEnabled())mouseManager::getInstance()->update(); // Update the keys (Regardless of active state) (keyInputManager::getInstance())->update(); @@ -580,13 +580,13 @@ // Draw the mouse and to screen if(graphic::buffered) { - (mouseManager::getInstance())->render(dest); + if(mouseManager::getInstance()->isEnabled())(mouseManager::getInstance())->render(dest); dest->renderBmp(0,0,0,0,dest->getBmpWidth(), dest->getBmpHeight(),rgba::NOCOLOR, getSysScreen()); } else { - (mouseManager::getInstance())->render(getSysScreen()); + if(mouseManager::getInstance()->isEnabled())(mouseManager::getInstance())->render(getSysScreen()); getSysScreen()->renderBmp(0,0,0,0,getSysScreen()->getBmpWidth(), getSysScreen()->getBmpHeight(),rgba::NOCOLOR, getSysScreen()); } Modified: trunk/src/mouse_manager.cpp =================================================================== --- trunk/src/mouse_manager.cpp 2007-12-18 03:17:22 UTC (rev 475) +++ trunk/src/mouse_manager.cpp 2007-12-18 05:24:37 UTC (rev 476) @@ -271,6 +271,7 @@ mRightClickTicks.reset(); mMaxTicks=400; winEvents=true; + enabled = true; //! connect slots leftDown.connect(this, &mouseManager::onLeftDown); @@ -1068,6 +1069,26 @@ (getInstance())->mousePointer->setPosition(x,y); } } + + //! Enable mouse + void mouseManager::enable(bool e) + { + if((getInstance())->mousePointer) + { + (getInstance())->enabled = e; + } + } + + //! Enable mouse + bool mouseManager::isEnabled() + { + if((getInstance())->mousePointer) + { + return (getInstance())->enabled; + } + + return false; + } } #endif /* MOUSE_MANAGER_CPP */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@li...> - 2008-06-03 19:02:55
|
Revision: 480 http://saggui.svn.sourceforge.net/saggui/?rev=480&view=rev Author: juvinious Date: 2008-06-03 12:02:52 -0700 (Tue, 03 Jun 2008) Log Message: ----------- const correctness issues fixed Modified Paths: -------------- trunk/CHANGELOG trunk/examples/gamedemo/include/gamedemo_gfx.h trunk/examples/widgets/src/widgets.cpp trunk/include/saggui/bitmap_font.h trunk/include/saggui/font.h trunk/include/saggui/font_base.h trunk/include/saggui/graphics.h trunk/modules/allegro/include/al_font.h trunk/modules/allegro/src/al_font.cpp trunk/modules/freetype/include/ft_font.h trunk/modules/freetype/src/ft_font.cpp trunk/modules/profiler/include/profilefont.h trunk/modules/profiler/src/profilefont.cpp trunk/modules/sdlgl/include/sdlgl_gfx.h trunk/modules/sdlgl/src/sdlgl_gfx.cpp trunk/src/bitmap_font.cpp trunk/src/font.cpp trunk/src/graphics.cpp trunk/src/keys.cpp trunk/src/mouse_manager.cpp trunk/src/resource_manager.cpp trunk/src/widgets/input_box.cpp trunk/utils/bmpdump/bmpdump-alleg.cpp trunk/utils/bmpdump/bmpdump-sdl.cpp Modified: trunk/CHANGELOG =================================================================== --- trunk/CHANGELOG 2008-02-13 13:57:53 UTC (rev 479) +++ trunk/CHANGELOG 2008-06-03 19:02:52 UTC (rev 480) @@ -1,5 +1,6 @@ 0.50 02-13-08 - Tagged. API and roadmap changes are likely to occur above 0.50. +- Corrected some issues throughout with const correctness - Added the ability to mouseManager to disable mouse - Fixed some install issues in CMakeLists.txt - Moved over sagguixml into the main module since it really doesn't need to be seperated as a module Modified: trunk/examples/gamedemo/include/gamedemo_gfx.h =================================================================== --- trunk/examples/gamedemo/include/gamedemo_gfx.h 2008-02-13 13:57:53 UTC (rev 479) +++ trunk/examples/gamedemo/include/gamedemo_gfx.h 2008-06-03 19:02:52 UTC (rev 480) @@ -4,7 +4,7 @@ #define ctrlPanel_W 640 #define ctrlPanel_H 200 -static char *ctrlPanel[] = { +static const char *ctrlPanel[] = { "#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264", "#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3f5164","#3e5164","#3e5164","#3e5164","#3e5164","#3e5164","#3e5164","#3e5164","#3e5164","#3e5164","#3e5164","#3e5164","#3e5164","#3e5164","#3e5164","#3e5164","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264", "#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5264","#3f5064","#3f4f65","#3f4f65","#3f4e65","#3f4f65","#3f4f65","#3f4f65","#3f4f65","#3f4f65","#3f4f64","#3f4e64","#3f4e64","#3f4e64","#3f4e64","#3f4e64","#3f4f64","#3f4f64","#3f4e64","#3f4e64","#3f4e64","#3f4e64","#3f4e64","#3e4e64","#3e4e64","#3e4e64","#3e4e64","#3e4e64","#3e4d64","#3e4e64","#3d4e64","#3d4e64","#3d4e64","#3d4d64","#3d4d64","#3d4e64","#3d4e64","#3d4d64","#3c4d63","#3c4d62","#3c4d61","#3c4d61","#3c4d61","#3c4d61","#3c4d61","#3c4d61","#3c4d61","#3c4d61","#3c4d61","#3c4d61","#3c4d61","#3c4d60","#3c4d61","#3c4d60","#3c4d60","#3c4e60","#3c4e60","#3c4e60","#3c4e60","#3c4e60","#3c4e60","#3c4e60","#3c4e60","#3c4e60","#3c4e60","#3c4e60","#3c4e60","#3c4e60","#3c4e60","#3c4e60","#3c4e60","#3c4e60","#3c4e60","#3c4e60","#3c4e61","#3c4e61","#3c4e61","#3d4e61","#3d4e61","#3d4e61","#3d4f61","#3d4f61","#3d4f61","#3d4f61","#3d4f61","#3d4f62","#3d4f62","#3d4f62","#3d4f62","#3d4f62","#3d4f62","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3d5062","#3e5062","#3e5062","#3e5063","#3e5063","#3e5063","#3e5063","#3e5063","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163","#3e5163", @@ -209,7 +209,7 @@ #define btn1_W 32 #define btn1_H 32 -static char *btn1[] = { +static const char *btn1[] = { "#ff00ff","#ff00ff","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#ff00ff","#ff00ff", "#ff00ff","#008080","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#008080","#ff00ff", "#008080","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#008080", @@ -246,7 +246,7 @@ #define btn2_W 32 #define btn2_H 32 -static char *btn2[] = { +static const char *btn2[] = { "#ff00ff","#ff00ff","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#ff00ff","#ff00ff", "#ff00ff","#008080","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#008080","#ff00ff", "#008080","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#008080", @@ -283,7 +283,7 @@ #define btn3_W 32 #define btn3_H 32 -static char *btn3[] = { +static const char *btn3[] = { "#ff00ff","#ff00ff","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#008080","#ff00ff","#ff00ff", "#ff00ff","#008080","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#008080","#ff00ff", "#008080","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#8080ff","#008080", @@ -320,7 +320,7 @@ #define quitbtn_W 64 #define quitbtn_H 16 -static char *quitbtn[] = { +static const char *quitbtn[] = { "#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#ff00ff","#ff00ff","#ff00ff","#ff00ff", "#ff00ff","#ff00ff","#ff00ff","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#ff00ff","#ff00ff","#ff00ff", "#ff00ff","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#ff00ff", @@ -341,7 +341,7 @@ #define menubtn_W 64 #define menubtn_H 16 -static char *menubtn[] = { +static const char *menubtn[] = { "#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#ff00ff","#ff00ff","#ff00ff","#ff00ff", "#ff00ff","#ff00ff","#ff00ff","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#ff00ff","#ff00ff","#ff00ff", "#ff00ff","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#10c4d1","#0a7a82","#0a7a82","#0a7a82","#0a7a82","#ff00ff", Modified: trunk/examples/widgets/src/widgets.cpp =================================================================== --- trunk/examples/widgets/src/widgets.cpp 2008-02-13 13:57:53 UTC (rev 479) +++ trunk/examples/widgets/src/widgets.cpp 2008-06-03 19:02:52 UTC (rev 480) @@ -45,7 +45,7 @@ #define LOGO_W 287 #define LOGO_H 72 -static char *LOGO[] = { +static const char *LOGO[] = { "#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff", "#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#7624de","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#7624de","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff", "#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#8512d8","#5948e9","#3b6cf4","#8512d8","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#8512d8","#5948e9","#3b6cf4","#8512d8","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff", Modified: trunk/include/saggui/bitmap_font.h =================================================================== --- trunk/include/saggui/bitmap_font.h 2008-02-13 13:57:53 UTC (rev 479) +++ trunk/include/saggui/bitmap_font.h 2008-06-03 19:02:52 UTC (rev 480) @@ -104,7 +104,7 @@ bool load(graphic *bmp, const std::string & charSet); //! Load from graphic - bool load(char *data[], int width, int height, const std::string & charSet); + bool load(const char *data[], int width, int height, const std::string & charSet); //! Get text length double getLength(const std::string & text); Modified: trunk/include/saggui/font.h =================================================================== --- trunk/include/saggui/font.h 2008-02-13 13:57:53 UTC (rev 479) +++ trunk/include/saggui/font.h 2008-06-03 19:02:52 UTC (rev 480) @@ -101,7 +101,7 @@ bool load(graphic *bmp, const std::string & charSet); //! Load from graphic - bool load(char *data[], int width, int height, const std::string & charSet); + bool load(const char *data[], int width, int height, const std::string & charSet); //! Get text length double getLength(const std::string & text); Modified: trunk/include/saggui/font_base.h =================================================================== --- trunk/include/saggui/font_base.h 2008-02-13 13:57:53 UTC (rev 479) +++ trunk/include/saggui/font_base.h 2008-06-03 19:02:52 UTC (rev 480) @@ -90,7 +90,7 @@ virtual bool load(graphic *bmp, const std::string & charSet)=0; //! Load from graphic - virtual bool load(char *data[], int width, int height, const std::string & charSet)=0; + virtual bool load(const char *data[], int width, int height, const std::string & charSet)=0; //! Get text length virtual double getLength(const std::string & text)=0; Modified: trunk/include/saggui/graphics.h =================================================================== --- trunk/include/saggui/graphics.h 2008-02-13 13:57:53 UTC (rev 479) +++ trunk/include/saggui/graphics.h 2008-06-03 19:02:52 UTC (rev 480) @@ -139,7 +139,7 @@ // Bitmap Routines //! Load bitmap from from memory - virtual void loadBmp(char *data[], int width, int height); + virtual void loadBmp(const char *data[], int width, int height); //! Load bitmap form a file virtual void loadBmp(const std::string & filename, const rgba & color=rgba::NOCOLOR)=0; @@ -190,7 +190,7 @@ bool arrayDump; //! loaded file from int array - char **dataDump; + const char **dataDump; //! Destroy Bitmap virtual bool destroyBmp()=0; Modified: trunk/modules/allegro/include/al_font.h =================================================================== --- trunk/modules/allegro/include/al_font.h 2008-02-13 13:57:53 UTC (rev 479) +++ trunk/modules/allegro/include/al_font.h 2008-06-03 19:02:52 UTC (rev 480) @@ -78,7 +78,7 @@ bool load(graphic *bmp, const std::string & charSet); //! Load from graphic - bool load(char *data[], int width, int height, const std::string & charSet); + bool load(const char *data[], int width, int height, const std::string & charSet); //! Get text length double getLength(const std::string & text); Modified: trunk/modules/allegro/src/al_font.cpp =================================================================== --- trunk/modules/allegro/src/al_font.cpp 2008-02-13 13:57:53 UTC (rev 479) +++ trunk/modules/allegro/src/al_font.cpp 2008-06-03 19:02:52 UTC (rev 480) @@ -92,7 +92,7 @@ } //! Load from graphic - bool alFont::load(char *data[], int width, int height, const std::string & charSet) + bool alFont::load(const char *data[], int width, int height, const std::string & charSet) { return false; } Modified: trunk/modules/freetype/include/ft_font.h =================================================================== --- trunk/modules/freetype/include/ft_font.h 2008-02-13 13:57:53 UTC (rev 479) +++ trunk/modules/freetype/include/ft_font.h 2008-06-03 19:02:52 UTC (rev 480) @@ -192,7 +192,7 @@ bool load(graphic *bmp, const std::string & charSet); //! Load from graphic - bool load(char *data[], int width, int height, const std::string & charSet); + bool load(const char *data[], int width, int height, const std::string & charSet); //! Get text length double getLength(const std::string & text); Modified: trunk/modules/freetype/src/ft_font.cpp =================================================================== --- trunk/modules/freetype/src/ft_font.cpp 2008-02-13 13:57:53 UTC (rev 479) +++ trunk/modules/freetype/src/ft_font.cpp 2008-06-03 19:02:52 UTC (rev 480) @@ -304,7 +304,7 @@ } //! Load from graphic - bool freetype::load(char *data[], int width, int height, const std::string & charSet) + bool freetype::load(const char *data[], int width, int height, const std::string & charSet) { return false; } Modified: trunk/modules/profiler/include/profilefont.h =================================================================== --- trunk/modules/profiler/include/profilefont.h 2008-02-13 13:57:53 UTC (rev 479) +++ trunk/modules/profiler/include/profilefont.h 2008-06-03 19:02:52 UTC (rev 480) @@ -69,7 +69,7 @@ bool load(graphic *bmp, const std::string & charSet); //! Load from graphic - bool load(char *data[], int width, int height, const std::string & charSet); + bool load(const char *data[], int width, int height, const std::string & charSet); //! Get text length double getLength(const std::string & text); Modified: trunk/modules/profiler/src/profilefont.cpp =================================================================== --- trunk/modules/profiler/src/profilefont.cpp 2008-02-13 13:57:53 UTC (rev 479) +++ trunk/modules/profiler/src/profilefont.cpp 2008-06-03 19:02:52 UTC (rev 480) @@ -79,7 +79,7 @@ } //! Load from graphic - bool profileFont::load(char *data[], int width, int height, const std::string & charSet) + bool profileFont::load(const char *data[], int width, int height, const std::string & charSet) { return true; } Modified: trunk/modules/sdlgl/include/sdlgl_gfx.h =================================================================== --- trunk/modules/sdlgl/include/sdlgl_gfx.h 2008-02-13 13:57:53 UTC (rev 479) +++ trunk/modules/sdlgl/include/sdlgl_gfx.h 2008-06-03 19:02:52 UTC (rev 480) @@ -106,7 +106,7 @@ using graphic::loadBmp; //! Load bitmap from from memory - void loadBmp(char *data[], int width, int height); + void loadBmp(const char *data[], int width, int height); //! Load bitmap from file (and save filename) void loadBmp(const std::string & filename, const rgba &color=NULL); Modified: trunk/modules/sdlgl/src/sdlgl_gfx.cpp =================================================================== --- trunk/modules/sdlgl/src/sdlgl_gfx.cpp 2008-02-13 13:57:53 UTC (rev 479) +++ trunk/modules/sdlgl/src/sdlgl_gfx.cpp 2008-06-03 19:02:52 UTC (rev 480) @@ -116,7 +116,7 @@ // ol::Bitmap Routines //! Load bitmap from memory - void sdlglGraphic::loadBmp(char *data[], int width, int height) + void sdlglGraphic::loadBmp(const char *data[], int width, int height) { SDL_Surface *temp = getNewSurface(width,height,32); Modified: trunk/src/bitmap_font.cpp =================================================================== --- trunk/src/bitmap_font.cpp 2008-02-13 13:57:53 UTC (rev 479) +++ trunk/src/bitmap_font.cpp 2008-06-03 19:02:52 UTC (rev 480) @@ -50,7 +50,7 @@ #define unkChar_W 10 #define unkChar_H 17 - static char *unkChar[] = { + static const char *unkChar[] = { "#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff", "#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff", "#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff", @@ -72,7 +72,7 @@ #define defaultFont_W 665 #define defaultFont_H 8 - static char *defaultFont[] = { + static const char *defaultFont[] = { "#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#000000","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#000000","#000000","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#000000","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#000000","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#000000","#000000","#000000","#000000","#000000","#000000","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#000000","#000000","#000000","#000000","#000000","#000000","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#000000","#000000","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#000000","#000000","#000000","#000000","#000000","#000000","#ff00ff","#ffff00","#ff00ff","#000000","#000000","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#000000","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#000000","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#000000","#000000","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#000000","#000000","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#000000","#000000","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#000000","#000000","#000000","#000000","#000000","#000000","#ff00ff","#ffff00","#000000","#000000","#000000","#000000","#000000","#000000","#ff00ff","#ffff00","#ff00ff","#000000","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#000000","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#000000","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#000000","#000000","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#000000","#000000","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#000000","#000000","#000000","#000000","#000000","#000000","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#000000","#000000","#000000","#000000","#000000","#ff00ff","#ffff00","#000000","#000000","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#000000","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#000000","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ffff00","#000000","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00", "#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#000000","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#000000","#ff00ff","#000000","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#000000","#ff00ff","#ff00ff","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#000000","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#000000","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#000000","#ff00ff","#ff00ff","#000000","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#000000","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#000000","#ff00ff","#ff00ff","#000000","#000000","#ff00ff","#ffff00","#000000","#000000","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00", "#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#000000","#000000","#000000","#000000","#000000","#ff00ff","#ffff00","#000000","#ff00ff","#000000","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ffff00","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#ffff00","#ff00ff","#000000","#ff00ff","#ff00ff","#ff00ff","#000000","#ff00ff","#ff00ff","#ffff00","#000000","#000000","#000000","#000000","#000000","#000000","#ff00ff","#ff00ff","#ffff00","#000000","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00ff","#ff00... [truncated message content] |