Update of /cvsroot/aedgui/aedGUI/src
In directory sc8-pr-cvs1:/tmp/cvs-serv11490/src
Modified Files:
SDL_loadso.c SDL_ttf.c aedAnimatedImage.cpp aedApp.cpp
aedBoxSizer.cpp aedButton.cpp aedCheckBox.cpp aedCursor.cpp
aedDialogBox.cpp aedFont.cpp aedFrame.cpp aedImage.cpp
aedImageBank.cpp aedListBox.cpp aedLog.cpp aedMenu.cpp
aedMenuBar.cpp aedObject.cpp aedProgressBar.cpp
aedRadioButtonGroup.cpp aedScrollBar.cpp aedSizer.cpp
aedSlider.cpp aedStaticImage.cpp aedStaticRTF.cpp
aedStaticText.cpp aedTextBox.cpp aedTheme.cpp aedTimer.cpp
aedUpdateManager.cpp aedWidget.cpp aedWindow.cpp
aedXmlFile.cpp drawlibs.cpp
Log Message:
Wow... indent sure makes a mess :)
Index: SDL_loadso.c
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/SDL_loadso.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SDL_loadso.c 31 Aug 2003 08:13:10 -0000 1.2
--- SDL_loadso.c 6 Nov 2003 18:46:34 -0000 1.3
***************
*** 1,2 ****
--- 1,3 ----
+
/*
SDL - Simple DirectMedia Layer
***************
*** 23,30 ****
#ifdef SAVE_RCSID
static char rcsid =
! "@(#) $Id$";
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* System dependent library loading routines */
--- 24,32 ----
#ifdef SAVE_RCSID
static char rcsid =
! "@(#) $Id$";
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
/* System dependent library loading routines */
***************
*** 46,49 ****
--- 48,52 ----
# include <ldg.h>
#else
+
/*#error Unsupported dynamic link environment*/
#endif /* system type */
***************
*** 52,209 ****
#include "SDL_error.h"
! void *SDL_LoadObject(const char *sofile)
{
! void *handle = NULL;
! const char *loaderror = "SDL_LoadObject() not implemented";
#if defined(USE_DLOPEN)
/* * */
! handle = dlopen(sofile, RTLD_NOW);
! loaderror = (char *)dlerror();
#elif defined(WIN32)
/* * */
! char errbuf[512];
! handle = (void *)LoadLibrary(sofile);
! /* Generate an error message if all loads failed */
! if ( handle == NULL ) {
! FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
! FORMAT_MESSAGE_FROM_SYSTEM),
! NULL, GetLastError(),
! MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
! errbuf, SDL_TABLESIZE(errbuf), NULL);
! loaderror = errbuf;
! }
#elif defined(__BEOS__)
/* * */
! image_id library_id;
! library_id = load_add_on(sofile);
! if ( library_id == B_ERROR ) {
! loaderror = "BeOS error";
! } else {
! handle = (void *)(library_id);
! }
#elif defined(macintosh)
/* * */
! CFragConnectionID library_id;
! Ptr mainAddr;
! Str255 errName;
! OSErr error;
! char psofile[512];
! strncpy(psofile, sofile, SDL_TABLESIZE(psofile));
! psofile[SDL_TABLESIZE(psofile)-1] = '\0';
! error = GetSharedLibrary(C2PStr(psofile), kCompiledCFragArch,
! kLoadCFrag, &library_id, &mainAddr, errName);
! switch (error) {
! case noErr:
! break;
! case cfragNoLibraryErr:
! loaderror = "Library not found";
! break;
! case cfragUnresolvedErr:
! loaderror = "Unabled to resolve symbols";
! break;
! case cfragNoPrivateMemErr:
! case cfragNoClientMemErr:
! loaderror = "Out of memory";
! break;
! default:
! loaderror = "Unknown Code Fragment Manager error";
! break;
! }
! if ( loaderror == NULL ) {
! handle = (void *)(library_id);
! }
#elif defined(__MINT__) && defined(ENABLE_LDG)
/* * */
! handle = (void *)ldg_open((char *)sofile, ldg_global);
#endif /* system type */
! if ( handle == NULL ) {
! SDL_SetError("Failed loading %s: %s", sofile, loaderror);
! }
! return(handle);
}
! void *SDL_LoadFunction(void *handle, const char *name)
{
! void *symbol = NULL;
! const char *loaderror = "SDL_LoadFunction not implemented";
#if defined(USE_DLOPEN)
/* * */
! symbol = dlsym(handle, name);
! if ( symbol == NULL ) {
! loaderror = (char *)dlerror();
! }
#elif defined(WIN32)
/* * */
! char errbuf[512];
! symbol = (void *)GetProcAddress((HMODULE)handle, name);
! if ( symbol == NULL ) {
! FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
! FORMAT_MESSAGE_FROM_SYSTEM),
! NULL, GetLastError(),
! MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
! errbuf, SDL_TABLESIZE(errbuf), NULL);
! loaderror = errbuf;
! }
#elif defined(__BEOS__)
/* * */
! image_id library_id = (image_id)handle;
! if ( get_image_symbol(library_id,
! name, B_SYMBOL_TYPE_TEXT, &symbol) != B_NO_ERROR ) {
! loaderror = "Symbol not found";
! }
#elif defined(macintosh)
/* * */
! CFragSymbolClass class;
! CFragConnectionID library_id = (CFragConnectionID)handle;
! char pname[512];
! strncpy(pname, name, SDL_TABLESIZE(pname));
! pname[SDL_TABLESIZE(pname)-1] = '\0';
! if ( FindSymbol(library_id, C2PStr(pname),
! (char **)&symbol, &class) != noErr ) {
! loaderror = "Symbol not found";
! }
#elif defined(__MINT__) && defined(ENABLE_LDG)
/* * */
! symbol = (void *)ldg_find((char *)name, (LDG *)handle);
#endif /* system type */
! if ( symbol == NULL ) {
! SDL_SetError("Failed loading %s: %s", name, loaderror);
! }
! return(symbol);
}
! void SDL_UnloadObject(void *handle)
{
#if defined(__BEOS__)
! image_id library_id;
#endif
! if ( handle == NULL ) {
! return;
! }
#if defined(USE_DLOPEN)
/* * */
! dlclose(handle);
#elif defined(WIN32)
/* * */
! FreeLibrary((HMODULE)handle);
#elif defined(__BEOS__)
/* * */
! library_id = (image_id)handle;
! unload_add_on(library_id);
#elif defined(macintosh)
/* * */
! CFragConnectionID library_id = (CFragConnectionID)handle;
! CloseConnection(library_id);
#elif defined(__MINT__) && defined(ENABLE_LDG)
/* * */
! ldg_close((LDG *)handle, ldg_global);
#endif /* system type */
}
--- 55,247 ----
#include "SDL_error.h"
! void *
! SDL_LoadObject(const char *sofile)
{
! void *handle = NULL;
! const char *loaderror = "SDL_LoadObject() not implemented";
!
#if defined(USE_DLOPEN)
+
/* * */
! handle = dlopen(sofile, RTLD_NOW);
! loaderror = (char *) dlerror();
#elif defined(WIN32)
+
/* * */
! char errbuf[512];
! handle = (void *) LoadLibrary(sofile);
! /* Generate an error message if all loads failed */
! if(handle == NULL)
! {
! FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
! FORMAT_MESSAGE_FROM_SYSTEM),
! NULL, GetLastError(),
! MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
! errbuf, SDL_TABLESIZE(errbuf), NULL);
! loaderror = errbuf;
! }
#elif defined(__BEOS__)
+
/* * */
! image_id library_id;
! library_id = load_add_on(sofile);
! if(library_id == B_ERROR)
! {
! loaderror = "BeOS error";
! }
! else
! {
! handle = (void *) (library_id);
! }
#elif defined(macintosh)
+
/* * */
! CFragConnectionID library_id;
! Ptr mainAddr;
! Str255 errName;
! OSErr error;
! char psofile[512];
! strncpy(psofile, sofile, SDL_TABLESIZE(psofile));
! psofile[SDL_TABLESIZE(psofile) - 1] = '\0';
! error = GetSharedLibrary(C2PStr(psofile), kCompiledCFragArch,
! kLoadCFrag, &library_id, &mainAddr, errName);
! switch (error)
! {
! case noErr:
! break;
! case cfragNoLibraryErr:
! loaderror = "Library not found";
! break;
! case cfragUnresolvedErr:
! loaderror = "Unabled to resolve symbols";
! break;
! case cfragNoPrivateMemErr:
! case cfragNoClientMemErr:
! loaderror = "Out of memory";
! break;
! default:
! loaderror = "Unknown Code Fragment Manager error";
! break;
! }
! if(loaderror == NULL)
! {
! handle = (void *) (library_id);
! }
#elif defined(__MINT__) && defined(ENABLE_LDG)
+
/* * */
! handle = (void *) ldg_open((char *) sofile, ldg_global);
#endif /* system type */
! if(handle == NULL)
! {
! SDL_SetError("Failed loading %s: %s", sofile, loaderror);
! }
! return (handle);
}
! void *
! SDL_LoadFunction(void *handle, const char *name)
{
! void *symbol = NULL;
! const char *loaderror = "SDL_LoadFunction not implemented";
!
#if defined(USE_DLOPEN)
+
/* * */
! symbol = dlsym(handle, name);
! if(symbol == NULL)
! {
! loaderror = (char *) dlerror();
! }
#elif defined(WIN32)
+
/* * */
! char errbuf[512];
! symbol = (void *) GetProcAddress((HMODULE) handle, name);
! if(symbol == NULL)
! {
! FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
! FORMAT_MESSAGE_FROM_SYSTEM),
! NULL, GetLastError(),
! MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
! errbuf, SDL_TABLESIZE(errbuf), NULL);
! loaderror = errbuf;
! }
#elif defined(__BEOS__)
+
/* * */
! image_id library_id = (image_id) handle;
!
! if(get_image_symbol(library_id,
! name, B_SYMBOL_TYPE_TEXT, &symbol) != B_NO_ERROR)
! {
! loaderror = "Symbol not found";
! }
#elif defined(macintosh)
+
/* * */
! CFragSymbolClass class;
! CFragConnectionID library_id = (CFragConnectionID) handle;
! char pname[512];
! strncpy(pname, name, SDL_TABLESIZE(pname));
! pname[SDL_TABLESIZE(pname) - 1] = '\0';
! if(FindSymbol(library_id, C2PStr(pname),
! (char **) &symbol, &class) != noErr)
! {
! loaderror = "Symbol not found";
! }
#elif defined(__MINT__) && defined(ENABLE_LDG)
+
/* * */
! symbol = (void *) ldg_find((char *) name, (LDG *) handle);
#endif /* system type */
! if(symbol == NULL)
! {
! SDL_SetError("Failed loading %s: %s", name, loaderror);
! }
! return (symbol);
}
! void
! SDL_UnloadObject(void *handle)
{
#if defined(__BEOS__)
! image_id library_id;
#endif
! if(handle == NULL)
! {
! return;
! }
#if defined(USE_DLOPEN)
+
/* * */
! dlclose(handle);
#elif defined(WIN32)
+
/* * */
! FreeLibrary((HMODULE) handle);
#elif defined(__BEOS__)
+
/* * */
! library_id = (image_id) handle;
! unload_add_on(library_id);
#elif defined(macintosh)
+
/* * */
! CFragConnectionID library_id = (CFragConnectionID) handle;
!
! CloseConnection(library_id);
#elif defined(__MINT__) && defined(ENABLE_LDG)
+
/* * */
! ldg_close((LDG *) handle, ldg_global);
#endif /* system type */
}
Index: SDL_ttf.c
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/SDL_ttf.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SDL_ttf.c 17 Sep 2003 19:35:44 -0000 1.3
--- SDL_ttf.c 6 Nov 2003 18:46:34 -0000 1.4
***************
*** 1,2 ****
--- 1,3 ----
+
/*
SDL_ttf: A companion library to SDL for working with TrueType (tm) fonts
***************
*** 67,118 ****
/* Cached glyph information */
! typedef struct cached_glyph {
! int stored;
[...3372 lines suppressed...]
! return font->style;
}
! void
! TTF_Quit(void)
{
! if(TTF_initialized)
! {
! if(--TTF_initialized == 0)
! {
! FT_Done_FreeType(library);
! }
! }
}
! int
! TTF_WasInit(void)
{
! return TTF_initialized;
}
Index: aedAnimatedImage.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedAnimatedImage.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** aedAnimatedImage.cpp 16 Jul 2003 10:31:10 -0000 1.5
--- aedAnimatedImage.cpp 6 Nov 2003 18:46:35 -0000 1.6
***************
*** 8,12 ****
}
! Uint16 aedAnimatedImage::getCurrentFrame(void)
{
return m_CurrentFrame;
--- 8,13 ----
}
! Uint16
! aedAnimatedImage::getCurrentFrame(void)
{
return m_CurrentFrame;
***************
*** 19,23 ****
}
! Uint16 aedAnimatedImage::fastForward(void)
{
m_CurrentFrame = m_Images.getSize() - 1;
--- 20,25 ----
}
! Uint16
! aedAnimatedImage::fastForward(void)
{
m_CurrentFrame = m_Images.getSize() - 1;
***************
*** 25,29 ****
}
! Uint16 aedAnimatedImage::rewind(void)
{
m_CurrentFrame = 0;
--- 27,32 ----
}
! Uint16
! aedAnimatedImage::rewind(void)
{
m_CurrentFrame = 0;
***************
*** 31,35 ****
}
! Uint16 aedAnimatedImage::previous(void)
{
if(m_CurrentFrame > 0)
--- 34,39 ----
}
! Uint16
! aedAnimatedImage::previous(void)
{
if(m_CurrentFrame > 0)
***************
*** 41,45 ****
}
! Uint16 aedAnimatedImage::next(void)
{
if(m_CurrentFrame < m_Images.getSize())
--- 45,50 ----
}
! Uint16
! aedAnimatedImage::next(void)
{
if(m_CurrentFrame < m_Images.getSize())
***************
*** 60,64 ****
aedAnimatedImage::render(void)
{
! SDL_Rect rect = {0,0,m_Surface->w, m_Surface->h};
// If our image is indeed loaded...
--- 65,69 ----
aedAnimatedImage::render(void)
{
! SDL_Rect rect = { 0, 0, m_Surface->w, m_Surface->h };
// If our image is indeed loaded...
Index: aedApp.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedApp.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** aedApp.cpp 5 Nov 2003 19:26:07 -0000 1.28
--- aedApp.cpp 6 Nov 2003 18:46:35 -0000 1.29
***************
*** 39,46 ****
pApp = this;
m_Root = NULL;
! m_FocusWidget = NULL;
! m_okayButton = NULL;
! m_cancelButton = NULL;
! m_UTF8 = false;
pLog = new aedLog;
--- 39,46 ----
pApp = this;
m_Root = NULL;
! m_FocusWidget = NULL;
! m_okayButton = NULL;
! m_cancelButton = NULL;
! m_UTF8 = false;
pLog = new aedLog;
***************
*** 53,66 ****
// Default font paths
addFontPath("./");
-
- SDL_EnableUNICODE(1);
- SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
! // Create the default theme (it's always in m_Themes[0])
! aedThemeEntry te;
! te.handle = NULL;
! te.theme = new aedTheme;
! m_Themes.push_back(te);
}
--- 53,66 ----
// Default font paths
addFontPath("./");
! SDL_EnableUNICODE(1);
! SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
! // Create the default theme (it's always in m_Themes[0])
! aedThemeEntry te;
!
! te.handle = NULL;
! te.theme = new aedTheme;
! m_Themes.push_back(te);
}
***************
*** 70,83 ****
Uint16 i, nmfe = 0;
! m_Root = NULL;
! m_FocusWidget = NULL;
- // m_Themes[0] is the default theme and can't be unloaded so we just
- // free the memory associated with it
- delete m_Themes[0].theme;
for(i = 1; i < m_Themes.size(); i++)
{
delete m_Themes[i].theme;
! SDL_UnloadObject(m_Themes[i].handle);
}
pLog->notice("Themes used (including the default one): %d\n",
--- 70,85 ----
Uint16 i, nmfe = 0;
! m_Root = NULL;
! m_FocusWidget = NULL;
!
! // m_Themes[0] is the default theme and can't be unloaded so we just
! // free the memory associated with it
! delete m_Themes[0].theme;
for(i = 1; i < m_Themes.size(); i++)
{
delete m_Themes[i].theme;
!
! SDL_UnloadObject(m_Themes[i].handle);
}
pLog->notice("Themes used (including the default one): %d\n",
***************
*** 109,144 ****
TTF_Quit();
!
! delete pLog;
! pLog = NULL;
!
! delete pUpdateMgr;
! pUpdateMgr = NULL;
!
pApp = NULL;
}
! void aedApp::setFocusWidget(aedWidget *win)
{
if(win && !win->canFocus())
! win = NULL;
if(m_FocusWidget != NULL && m_FocusWidget != m_Root)
{
! // tell the old widget that it lost focus
! m_FocusWidget->setActiveBorder(false);
! m_FocusWidget->setRenderState(true);
! m_FocusWidget->wm_lostfocus();
! m_FocusWidget->triggerEvent(LOST_FOCUS, m_FocusWidget, NULL);
}
!
m_FocusWidget = win;
if(m_FocusWidget && m_FocusWidget != m_Root)
{
! m_FocusWidget->setActiveBorder(true);
! m_FocusWidget->setRenderState(true);
! m_FocusWidget->wm_gotfocus();
! m_FocusWidget->triggerEvent(GOT_FOCUS, m_FocusWidget, NULL);
}
}
--- 111,149 ----
TTF_Quit();
!
! delete pLog;
!
! pLog = NULL;
!
! delete pUpdateMgr;
!
! pUpdateMgr = NULL;
!
pApp = NULL;
}
! void
! aedApp::setFocusWidget(aedWidget * win)
{
if(win && !win->canFocus())
! win = NULL;
if(m_FocusWidget != NULL && m_FocusWidget != m_Root)
{
! // tell the old widget that it lost focus
! m_FocusWidget->setActiveBorder(false);
! m_FocusWidget->setRenderState(true);
! m_FocusWidget->wm_lostfocus();
! m_FocusWidget->triggerEvent(LOST_FOCUS, m_FocusWidget, NULL);
}
!
m_FocusWidget = win;
if(m_FocusWidget && m_FocusWidget != m_Root)
{
! m_FocusWidget->setActiveBorder(true);
! m_FocusWidget->setRenderState(true);
! m_FocusWidget->wm_gotfocus();
! m_FocusWidget->triggerEvent(GOT_FOCUS, m_FocusWidget, NULL);
}
}
***************
*** 147,151 ****
aedApp::clickOkayButton()
{
! if ( m_okayButton )
m_okayButton->click();
}
--- 152,156 ----
aedApp::clickOkayButton()
{
! if(m_okayButton)
m_okayButton->click();
}
***************
*** 154,158 ****
aedApp::clickCancelButton()
{
! if ( m_cancelButton )
m_cancelButton->click();
}
--- 159,163 ----
aedApp::clickCancelButton()
{
! if(m_cancelButton)
m_cancelButton->click();
}
***************
*** 163,194 ****
void *handle;
aedTheme *p;
! Uint16 pif_version;
! aedTheme *(*get_theme_instance)();
! Uint16 (*get_pif_version)();
handle = SDL_LoadObject(file.c_str());
if(!handle)
{
! // Try adding extension to the filename
! std::string fext = file + THEME_EXT;
! handle = SDL_LoadObject(fext.c_str());
! if(!handle)
! {
! pLog->error("Couldn't load theme %s (%s)\n", file.c_str(), SDL_GetError());
! return NULL;
! }
! file += THEME_EXT;
}
// check if there's a version mismatch
! get_pif_version = (Uint16 (*)()) SDL_LoadFunction(handle, "get_pif_version");
if(get_pif_version == NULL)
{
! pLog->error("Couldn't load get_pif_version from %s (%s)\n", file.c_str(),
! SDL_GetError());
SDL_UnloadObject(handle);
return NULL;
! }
!
pif_version = get_pif_version();
if(pif_version != AEDGUI_PIF_VERSION)
--- 168,201 ----
void *handle;
aedTheme *p;
! Uint16 pif_version;
! aedTheme *(*get_theme_instance) ();
!
! Uint16(*get_pif_version) ();
handle = SDL_LoadObject(file.c_str());
if(!handle)
{
! // Try adding extension to the filename
! std::string fext = file + THEME_EXT;
! handle = SDL_LoadObject(fext.c_str());
! if(!handle)
! {
! pLog->error("Couldn't load theme %s (%s)\n", file.c_str(),
! SDL_GetError());
! return NULL;
! }
! file += THEME_EXT;
}
// check if there's a version mismatch
! get_pif_version = (Uint16(*)())SDL_LoadFunction(handle, "get_pif_version");
if(get_pif_version == NULL)
{
! pLog->error("Couldn't load get_pif_version from %s (%s)\n",
! file.c_str(), SDL_GetError());
SDL_UnloadObject(handle);
return NULL;
! }
!
pif_version = get_pif_version();
if(pif_version != AEDGUI_PIF_VERSION)
***************
*** 201,209 ****
}
! get_theme_instance = (aedTheme *(*)()) SDL_LoadFunction(handle, "get_theme_instance");
if(!get_theme_instance)
{
! pLog->error("Couldn't load get_theme_instance from %s (%s)\n", file.c_str(),
! SDL_GetError());
SDL_UnloadObject(handle);
return NULL;
--- 208,217 ----
}
! get_theme_instance =
! (aedTheme * (*)())SDL_LoadFunction(handle, "get_theme_instance");
if(!get_theme_instance)
{
! pLog->error("Couldn't load get_theme_instance from %s (%s)\n",
! file.c_str(), SDL_GetError());
SDL_UnloadObject(handle);
return NULL;
***************
*** 231,235 ****
size_t i;
size_t nThemeCount = m_Themes.size();
!
for(i = 0; i < nThemeCount; i++)
{
--- 239,243 ----
size_t i;
size_t nThemeCount = m_Themes.size();
!
for(i = 0; i < nThemeCount; i++)
{
***************
*** 249,259 ****
aedTheme *
! aedApp::getDefaultTheme() const
{
! return m_Themes[0].theme;
}
aedLog *
! aedApp::getLog() const
{
return pLog;
--- 257,267 ----
aedTheme *
! aedApp::getDefaultTheme() const const
{
! return m_Themes[0].theme;
}
aedLog *
! aedApp::getLog() const const
{
return pLog;
***************
*** 296,300 ****
{
int
! i = int(name.find_last_of("."));
if(i == -1 || name.substr(i, 4) != ".ttf")
--- 304,308 ----
{
int
! i = int (name.find_last_of("."));
if(i == -1 || name.substr(i, 4) != ".ttf")
***************
*** 394,399 ****
mfe.ptsize = size;
mfe.font_ptr = new aedFont();
! if(!mfe.font_ptr->
! openFont(mfe.data, mfe.data_size, mfe.ptsize))
{
pLog->error("Couldn't create memory font (%s, %d, %d)\n",
--- 402,406 ----
mfe.ptsize = size;
mfe.font_ptr = new aedFont();
! if(!mfe.font_ptr->openFont(mfe.data, mfe.data_size, mfe.ptsize))
{
pLog->error("Couldn't create memory font (%s, %d, %d)\n",
Index: aedBoxSizer.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedBoxSizer.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** aedBoxSizer.cpp 25 Oct 2003 00:05:18 -0000 1.3
--- aedBoxSizer.cpp 6 Nov 2003 18:46:36 -0000 1.4
***************
*** 2,33 ****
#include "rint.h"
! aedBoxSizer::
! aedBoxSizer(aedWidget *parent, boxType type)
{
! m_Parent = parent;
! m_BoxType = type;
}
void
! aedBoxSizer::
! calculateSize(void)
{
! if (m_BoxType == aedVERTICAL)
! {
! aedRect rect = m_Parent->getMyTranslatedPosition();
! Uint16 eachHeight = rint((rect.getHeight()-(m_Parent->getPositionOffset().getY())))/m_Widgets.size();
! for (unsigned int i=0;i<m_Widgets.size();i++)
! {
! //aedRect widgetRect = m_Widgets[i]->getPos();
! m_Widgets[i]->setPos(0, i*eachHeight);
! m_Widgets[i]->setSize(rect.getWidth()-(m_Parent->getPositionOffset().getX() * 2), eachHeight);
! }
! }
! else
! {
! }
}
--- 2,35 ----
#include "rint.h"
! aedBoxSizer::aedBoxSizer(aedWidget * parent, boxType type)
{
! m_Parent = parent;
! m_BoxType = type;
}
void
! aedBoxSizer::calculateSize(void)
{
! if(m_BoxType == aedVERTICAL)
! {
! aedRect rect = m_Parent->getMyTranslatedPosition();
! Uint16 eachHeight =
! rint((rect.getHeight() -
! (m_Parent->getPositionOffset().getY()))) / m_Widgets.size();
! for(unsigned int i = 0; i < m_Widgets.size(); i++)
! {
! //aedRect widgetRect = m_Widgets[i]->getPos();
! m_Widgets[i]->setPos(0, i * eachHeight);
! m_Widgets[i]->setSize(rect.getWidth() -
! (m_Parent->getPositionOffset().getX() * 2),
! eachHeight);
! }
! }
! else
! {
! }
}
Index: aedButton.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedButton.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** aedButton.cpp 5 Nov 2003 19:26:07 -0000 1.22
--- aedButton.cpp 6 Nov 2003 18:46:36 -0000 1.23
***************
*** 82,91 ****
if(m_ButtonDown && !isMouseOver())
this->wm_lbuttonup(0, 0);
!
return 0;
}
void
! aedButton::setCaption(const std::string &caption)
{
m_Caption = caption;
--- 82,91 ----
if(m_ButtonDown && !isMouseOver())
this->wm_lbuttonup(0, 0);
!
return 0;
}
void
! aedButton::setCaption(const std::string & caption)
{
m_Caption = caption;
***************
*** 107,111 ****
aedButton::render(void)
{
! if(m_ButtonType == ROUND)
m_Theme->drawButton(this, m_Surface);
else if(m_ButtonType == SQUARE)
--- 107,111 ----
aedButton::render(void)
{
! if(m_ButtonType == ROUND)
m_Theme->drawButton(this, m_Surface);
else if(m_ButtonType == SQUARE)
***************
*** 161,173 ****
}
! int aedButton::wm_mouseenter()
{
! setRenderState(true);
! return 0;
}
! int aedButton::wm_mouseleave()
{
! setRenderState(true);
! return 0;
}
--- 161,175 ----
}
! int
! aedButton::wm_mouseenter()
{
! setRenderState(true);
! return 0;
}
! int
! aedButton::wm_mouseleave()
{
! setRenderState(true);
! return 0;
}
Index: aedCheckBox.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedCheckBox.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** aedCheckBox.cpp 25 Oct 2003 00:05:18 -0000 1.12
--- aedCheckBox.cpp 6 Nov 2003 18:46:36 -0000 1.13
***************
*** 14,21 ****
void
! aedCheckBox::setCaption(const std::string &caption)
{
m_Caption = caption;
! setRenderState(true);
}
--- 14,21 ----
void
! aedCheckBox::setCaption(const std::string & caption)
{
m_Caption = caption;
! setRenderState(true);
}
***************
*** 23,27 ****
aedCheckBox::wm_lbuttondown(Uint16 x, Uint16 y)
{
! m_State = !m_State;
setRenderState(true);
triggerEvent(STATE_CHANGED, this, NULL);
--- 23,27 ----
aedCheckBox::wm_lbuttondown(Uint16 x, Uint16 y)
{
! m_State = !m_State;
setRenderState(true);
triggerEvent(STATE_CHANGED, this, NULL);
***************
*** 29,34 ****
}
! bool
! aedCheckBox::getState()
{
return m_State;
--- 29,33 ----
}
! bool aedCheckBox::getState()
{
return m_State;
***************
*** 38,63 ****
aedCheckBox::setState(bool state)
{
! if(m_State != state)
! {
! m_State = state;
! setRenderState(true);
! triggerEvent(STATE_CHANGED, this, NULL);
! }
}
! void aedCheckBox::render()
{
! m_Theme->drawCheckBox(this, m_Surface);
}
! int aedCheckBox::wm_mouseenter()
{
! setRenderState(true);
! return 0;
}
! int aedCheckBox::wm_mouseleave()
{
! setRenderState(true);
! return 0;
}
--- 37,65 ----
aedCheckBox::setState(bool state)
{
! if(m_State != state)
! {
! m_State = state;
! setRenderState(true);
! triggerEvent(STATE_CHANGED, this, NULL);
! }
}
! void
! aedCheckBox::render()
{
! m_Theme->drawCheckBox(this, m_Surface);
}
! int
! aedCheckBox::wm_mouseenter()
{
! setRenderState(true);
! return 0;
}
! int
! aedCheckBox::wm_mouseleave()
{
! setRenderState(true);
! return 0;
}
Index: aedCursor.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedCursor.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** aedCursor.cpp 3 Oct 2003 17:02:39 -0000 1.4
--- aedCursor.cpp 6 Nov 2003 18:46:36 -0000 1.5
***************
*** 3,46 ****
aedCursor::aedCursor()
{
! CursorImage = NULL;
! SavedImage = NULL;
! xHot=0;
! yHot=0;
};
aedCursor::~aedCursor()
{
! if(SavedImage!=NULL)
! SDL_FreeSurface(SavedImage);
};
! void aedCursor::setImage(SDL_Surface *Image)
{
! if(SavedImage!=NULL) SDL_FreeSurface(SavedImage);
! CursorImage = Image;
! SavedImage = SDL_CreateRGBSurface(CursorImage->flags,
! CursorImage->w,
! CursorImage->h,
! CursorImage->format->BitsPerPixel,
! CursorImage->format->Rmask,
! CursorImage->format->Gmask,
! CursorImage->format->Bmask,
! CursorImage->format->Amask);
!
};
! void aedCursor::render(SDL_Surface *Screen)
{
! SDL_Surface *Surface = Screen;
! int x,y;
! if(Surface==NULL) Surface = SDL_GetVideoSurface();
! SDL_BlitSurface(SavedImage,NULL,Surface,&SavedRect);
! SDL_PumpEvents();
! SDL_GetMouseState(&x,&y);
! SavedRect.w = CursorImage->w;
! SavedRect.h = CursorImage->h;
! SavedRect.x = x-xHot;
! SavedRect.y = y-yHot;
! SDL_BlitSurface(Surface,&SavedRect,SavedImage,NULL);
! SDL_BlitSurface(CursorImage,NULL,Surface,&SavedRect);
};
--- 3,51 ----
aedCursor::aedCursor()
{
! CursorImage = NULL;
! SavedImage = NULL;
! xHot = 0;
! yHot = 0;
};
aedCursor::~aedCursor()
{
! if(SavedImage != NULL)
! SDL_FreeSurface(SavedImage);
};
! void
! aedCursor::setImage(SDL_Surface * Image)
{
! if(SavedImage != NULL)
! SDL_FreeSurface(SavedImage);
! CursorImage = Image;
! SavedImage = SDL_CreateRGBSurface(CursorImage->flags,
! CursorImage->w,
! CursorImage->h,
! CursorImage->format->BitsPerPixel,
! CursorImage->format->Rmask,
! CursorImage->format->Gmask,
! CursorImage->format->Bmask,
! CursorImage->format->Amask);
!
};
! void
! aedCursor::render(SDL_Surface * Screen)
{
! SDL_Surface *Surface = Screen;
! int x, y;
!
! if(Surface == NULL)
! Surface = SDL_GetVideoSurface();
! SDL_BlitSurface(SavedImage, NULL, Surface, &SavedRect);
! SDL_PumpEvents();
! SDL_GetMouseState(&x, &y);
! SavedRect.w = CursorImage->w;
! SavedRect.h = CursorImage->h;
! SavedRect.x = x - xHot;
! SavedRect.y = y - yHot;
! SDL_BlitSurface(Surface, &SavedRect, SavedImage, NULL);
! SDL_BlitSurface(CursorImage, NULL, Surface, &SavedRect);
};
Index: aedDialogBox.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedDialogBox.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** aedDialogBox.cpp 16 Jul 2003 10:31:10 -0000 1.5
--- aedDialogBox.cpp 6 Nov 2003 18:46:36 -0000 1.6
***************
*** 4,8 ****
aedDialogBox::render(void)
{
! SDL_Rect rect = {0,0,m_Surface->w,m_Surface->h};
SDL_FillRect(m_Surface, &rect, 0xFFFFFFFF);
}
--- 4,8 ----
aedDialogBox::render(void)
{
! SDL_Rect rect = { 0, 0, m_Surface->w, m_Surface->h };
SDL_FillRect(m_Surface, &rect, 0xFFFFFFFF);
}
Index: aedFont.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedFont.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** aedFont.cpp 13 Sep 2003 15:39:41 -0000 1.13
--- aedFont.cpp 6 Nov 2003 18:46:36 -0000 1.14
***************
*** 12,22 ****
}
! aedFont:: ~ aedFont()
{
closeFont();
}
! bool
! aedFont::openFont(const char *file, int pointsize)
{
closeFont();
--- 12,21 ----
}
! aedFont::~aedFont()
{
closeFont();
}
! bool aedFont::openFont(const char *file, int pointsize)
{
closeFont();
***************
*** 25,30 ****
}
! bool
! aedFont::openFont(unsigned char *data, unsigned long int datasize, int pointsize)
{
closeFont();
--- 24,29 ----
}
! bool aedFont::openFont(unsigned char *data, unsigned long int datasize,
! int pointsize)
{
closeFont();
***************
*** 44,48 ****
int
! aedFont::getStyle() const
{
// The AED_FONT styles are the same as TTF styles
--- 43,47 ----
int
! aedFont::getStyle() const const
{
// The AED_FONT styles are the same as TTF styles
***************
*** 59,63 ****
int
! aedFont::getHeight() const
{
return TTF_FontHeight(data);
--- 58,62 ----
int
! aedFont::getHeight() const const
{
return TTF_FontHeight(data);
***************
*** 65,69 ****
int
! aedFont::getAscent() const
{
return TTF_FontAscent(data);
--- 64,68 ----
int
! aedFont::getAscent() const const
{
return TTF_FontAscent(data);
***************
*** 71,75 ****
int
! aedFont::getDescent() const
{
return TTF_FontDescent(data);
--- 70,74 ----
int
! aedFont::getDescent() const const
{
return TTF_FontDescent(data);
***************
*** 77,91 ****
int
! aedFont::getLineSkip() const
{
return TTF_FontLineSkip(data);
}
! bool
! aedFont::getGlyphMetrics(Uint16 c, int *minx, int *maxx, int *miny, int *maxy,
! int *advance)
{
! int status = TTF_GlyphMetrics(data, c, minx, maxx, miny, maxy, advance);
! return(status == 0);
}
--- 76,91 ----
int
! aedFont::getLineSkip() const const
{
return TTF_FontLineSkip(data);
}
! bool aedFont::getGlyphMetrics(Uint16 c, int *minx, int *maxx, int *miny,
! int *maxy, int *advance)
{
! int
! status = TTF_GlyphMetrics(data, c, minx, maxx, miny, maxy, advance);
!
! return (status == 0);
}
***************
*** 95,98 ****
--- 95,99 ----
int _w, _h;
int status;
+
if(pApp->getUTF8())
status = TTF_SizeUTF8(data, text, &_w, &_h);
***************
*** 105,109 ****
SDL_Surface *
! aedFont::renderTextSolid(const char *str, const aedColor &color)
{
if(pApp->getUTF8())
--- 106,110 ----
SDL_Surface *
! aedFont::renderTextSolid(const char *str, const aedColor & color)
{
if(pApp->getUTF8())
***************
*** 114,118 ****
SDL_Surface *
! aedFont::renderTextShaded(const char *str, const aedColor &fg, const aedColor &bg)
{
if(pApp->getUTF8())
--- 115,120 ----
SDL_Surface *
! aedFont::renderTextShaded(const char *str, const aedColor & fg,
! const aedColor & bg)
{
if(pApp->getUTF8())
***************
*** 123,127 ****
SDL_Surface *
! aedFont::renderTextBlended(const char *str, const aedColor &color)
{
if(pApp->getUTF8())
--- 125,129 ----
SDL_Surface *
! aedFont::renderTextBlended(const char *str, const aedColor & color)
{
if(pApp->getUTF8())
***************
*** 133,137 ****
void
aedFont::renderTextSolid(SDL_Surface * s, int x, int y, const char *str,
! const aedColor &color)
{
SDL_Rect dst;
--- 135,139 ----
void
aedFont::renderTextSolid(SDL_Surface * s, int x, int y, const char *str,
! const aedColor & color)
{
SDL_Rect dst;
***************
*** 150,154 ****
void
aedFont::renderTextShaded(SDL_Surface * s, int x, int y, const char *str,
! const aedColor &fg, const aedColor &bg)
{
SDL_Rect dst;
--- 152,156 ----
void
aedFont::renderTextShaded(SDL_Surface * s, int x, int y, const char *str,
! const aedColor & fg, const aedColor & bg)
{
SDL_Rect dst;
***************
*** 167,171 ****
void
aedFont::renderTextBlended(SDL_Surface * s, int x, int y, const char *str,
! const aedColor &color)
{
SDL_Rect dst;
--- 169,173 ----
void
aedFont::renderTextBlended(SDL_Surface * s, int x, int y, const char *str,
! const aedColor & color)
{
SDL_Rect dst;
Index: aedFrame.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedFrame.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** aedFrame.cpp 16 Aug 2003 10:13:33 -0000 1.15
--- aedFrame.cpp 6 Nov 2003 18:46:36 -0000 1.16
***************
*** 5,11 ****
aedFrame::aedFrame()
{
! m_FontSize = m_Theme->defaultFontSize;
! m_PositionOffset.setX(2);
! m_PositionOffset.setY((Sint16)(m_FontSize*1.5));
}
--- 5,11 ----
aedFrame::aedFrame()
{
! m_FontSize = m_Theme->defaultFontSize;
! m_PositionOffset.setX(2);
! m_PositionOffset.setY((Sint16) (m_FontSize * 1.5));
}
Index: aedImage.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedImage.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** aedImage.cpp 29 Jul 2003 23:47:39 -0000 1.3
--- aedImage.cpp 6 Nov 2003 18:46:36 -0000 1.4
***************
*** 18,22 ****
}
! aedImage aedImage::operator=(aedImage obj)
{
m_SurfacePointer = obj.getSurface();
--- 18,23 ----
}
! aedImage
! aedImage::operator=(aedImage obj)
{
m_SurfacePointer = obj.getSurface();
***************
*** 41,50 ****
{
! std::cout << "Information dump of surface " << m_SurfacePointer << std::endl;
!
! if (m_SurfacePointer->flags & SDL_SRCCOLORKEY)
std::cout << "Color Key enabled!" << std::endl;
!
std::cout << "--" << std::endl;
}
-
--- 42,51 ----
{
! std::cout << "Information dump of surface " << m_SurfacePointer << std::
! endl;
!
! if(m_SurfacePointer->flags & SDL_SRCCOLORKEY)
std::cout << "Color Key enabled!" << std::endl;
!
std::cout << "--" << std::endl;
}
Index: aedImageBank.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedImageBank.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** aedImageBank.cpp 17 Sep 2003 18:50:55 -0000 1.2
--- aedImageBank.cpp 6 Nov 2003 18:46:36 -0000 1.3
***************
*** 11,15 ****
}
! Uint16 aedImageBank::addImage(aedImage image)
{
// Please, notice that we don't do ANY checks for duplicates here. An image
--- 11,16 ----
}
! Uint16
! aedImageBank::addImage(aedImage image)
{
// Please, notice that we don't do ANY checks for duplicates here. An image
***************
*** 26,30 ****
! bool aedImageBank::delImage(Uint16 index)
{
if(index <= m_Data.size() - 1)
--- 27,32 ----
! bool
! aedImageBank::delImage(Uint16 index)
{
if(index <= m_Data.size() - 1)
***************
*** 39,43 ****
}
! Uint16 aedImageBank::getSize(void)
{
return Uint16(m_Data.size());
--- 41,46 ----
}
! Uint16
! aedImageBank::getSize(void)
{
return Uint16(m_Data.size());
Index: aedListBox.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedListBox.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** aedListBox.cpp 5 Nov 2003 19:26:07 -0000 1.18
--- aedListBox.cpp 6 Nov 2003 18:46:36 -0000 1.19
***************
*** 13,18 ****
aedListBox::add(std::string string)
{
! m_Strings.push_back(string);
! m_ReRender = true;
}
--- 13,18 ----
aedListBox::add(std::string string)
{
! m_Strings.push_back(string);
! m_ReRender = true;
}
***************
*** 20,25 ****
aedListBox::insert(int line, std::string string)
{
! m_Strings.insert(m_Strings.begin() + line, string);
! m_ReRender = true;
}
--- 20,25 ----
aedListBox::insert(int line, std::string string)
{
! m_Strings.insert(m_Strings.begin() + line, string);
! m_ReRender = true;
}
***************
*** 27,32 ****
aedListBox::del(int line)
{
! m_Strings.erase(m_Strings.begin() + line);
! m_ReRender = true;
}
--- 27,32 ----
aedListBox::del(int line)
{
! m_Strings.erase(m_Strings.begin() + line);
! m_ReRender = true;
}
***************
*** 34,39 ****
aedListBox::del(int startLine, int stopLine)
{
! m_Strings.erase(m_Strings.begin() + startLine, m_Strings.begin() + stopLine);
! m_ReRender = true;
}
--- 34,40 ----
aedListBox::del(int startLine, int stopLine)
{
! m_Strings.erase(m_Strings.begin() + startLine,
! m_Strings.begin() + stopLine);
! m_ReRender = true;
}
***************
*** 41,45 ****
aedListBox::size()
{
! return(int(m_Strings.size()));
}
--- 42,46 ----
aedListBox::size()
{
! return (int (m_Strings.size()));
}
***************
*** 47,51 ****
aedListBox::wm_update(Uint32 msdelta)
{
! return(0);
}
--- 48,52 ----
aedListBox::wm_update(Uint32 msdelta)
{
! return (0);
}
***************
*** 53,75 ****
aedListBox::render(void)
{
! aedRect myPos(0,0,m_Surface->w,m_Surface->h);
! SDL_Surface *s1 = NULL;
! SDL_Rect src, dest;
! Uint16 line;
! myPos.setX(myPos.getX() + ( cPad * 2 ));
! myPos.setY(myPos.getY() + cPad );
! myPos.setWidth(myPos.getWidth() - ( 2 * cPad * 2 ));
! myPos.setHeight(myPos.getHeight() - ( 2 * cPad ));
! src.x = 0;
! src.y = 0;
! dest.x = myPos.getX();
! dest.y = myPos.getY();
! for ( line = m_currentLine; line < m_Strings.size(); line++ )
! {
! if ( m_Strings[line] != "" )
! {
if(isEnabled())
{
--- 54,76 ----
aedListBox::render(void)
{
! aedRect myPos(0, 0, m_Surface->w, m_Surface->h);
! SDL_Surface *s1 = NULL;
! SDL_Rect src, dest;
! Uint16 line;
! myPos.setX(myPos.getX() + (cPad * 2));
! myPos.setY(myPos.getY() + cPad);
! myPos.setWidth(myPos.getWidth() - (2 * cPad * 2));
! myPos.setHeight(myPos.getHeight() - (2 * cPad));
! src.x = 0;
! src.y = 0;
! dest.x = myPos.getX();
! dest.y = myPos.getY();
! for(line = m_currentLine; line < m_Strings.size(); line++)
! {
! if(m_Strings[line] != "")
! {
if(isEnabled())
{
***************
*** 77,81 ****
thisColor.setA(this->getAlphaValue());
! s1 = m_Font->renderTextBlended(m_Strings[line].c_str(), thisColor);
}
else
--- 78,83 ----
thisColor.setA(this->getAlphaValue());
! s1 = m_Font->renderTextBlended(m_Strings[line].c_str(),
! thisColor);
}
else
***************
*** 83,114 ****
s1 = m_Font->renderTextBlended(m_Strings[line].c_str(),
aedColor(130, 130,
! 130, this->getAlphaValue()));
}
! src.w = myPos.getWidth();
! src.h = s1->h;
! dest.w = src.w;
! dest.h = src.h;
! if ( dest.y > myPos.getY() + myPos.getHeight() )
! {
! break;
! }
! else if ( myPos.getY() + myPos.getHeight() - dest.y < src.h )
! {
! src.h = myPos.getY() + myPos.getHeight() - dest.y;
! }
! if ( src.w > s1->w )
! {
! src.w = s1->w;
! }
! SDL_BlitSurface(s1, &src, m_Surface, &dest);
! SDL_FreeSurface(s1);
! }
! dest.y += dest.h + 1;
! }
}
--- 85,117 ----
s1 = m_Font->renderTextBlended(m_Strings[line].c_str(),
aedColor(130, 130,
! 130,
! this->getAlphaValue()));
}
! src.w = myPos.getWidth();
! src.h = s1->h;
! dest.w = src.w;
! dest.h = src.h;
! if(dest.y > myPos.getY() + myPos.getHeight())
! {
! break;
! }
! else if(myPos.getY() + myPos.getHeight() - dest.y < src.h)
! {
! src.h = myPos.getY() + myPos.getHeight() - dest.y;
! }
! if(src.w > s1->w)
! {
! src.w = s1->w;
! }
! SDL_BlitSurface(s1, &src, m_Surface, &dest);
! SDL_FreeSurface(s1);
! }
! dest.y += dest.h + 1;
! }
}
Index: aedLog.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedLog.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** aedLog.cpp 17 Sep 2003 18:50:55 -0000 1.8
--- aedLog.cpp 6 Nov 2003 18:46:36 -0000 1.9
***************
*** 12,102 ****
aedLog::aedLog()
{
! m_Mask = 0;
}
! unsigned int aedLog::addDestination(ostream *out)
{
! m_Destinations.push_back(out);
! return (unsigned int)(m_Destinations.size() - 1);
}
! void aedLog::removeDestination(unsigned int index)
{
! m_Destinations.erase(m_Destinations.begin() + index);
}
! void aedLog::output(const char *prefix, const char *str)
{
! unsigned int i;
! ostream *out;
! // We always write to cerr
! fprintf(stderr,"%s%s",prefix,str);
! //cerr << prefix << str;
! //cerr.flush();
!
! for(i = 0; i < m_Destinations.size(); i++)
! {
! out = m_Destinations[i];
! *out << prefix << str;
! out->flush();
! }
}
! void aedLog::notice(const char *msg, ...)
{
! char string[m_BufferSize];
! va_list args;
! if(m_Mask & AED_LOG_NOTICE)
! return;
!
! va_start(args, msg);
! vsprintf(string, msg, args);
! va_end(args);
!
! output("aedGUI: ", string);
}
! void aedLog::warning(const char *msg, ...)
{
! char string[m_BufferSize];
! va_list args;
! if(m_Mask & AED_LOG_WARNING)
! return;
! va_start(args, msg);
! vsprintf(string, msg, args);
! va_end(args);
!
! output("aedGUI: ** WARNING ** ", string);
}
! void aedLog::error(const char *msg, ...)
{
! char string[m_BufferSize];
! va_list args;
! if(m_Mask & AED_LOG_ERROR)
! return;
! va_start(args, msg);
! vsprintf(string, msg, args);
! va_end(args);
! output("aedGUI: ** ERROR ** ", string);
}
! void aedLog::fatal(const char *msg, ...)
{
! char string[m_BufferSize];
! va_list args;
! va_start(args, msg);
! vsprintf(string, msg, args);
! va_end(args);
!
! output("aedGUI: ** FATAL ERROR ** ", string);
! exit(1);
}
--- 12,109 ----
aedLog::aedLog()
{
! m_Mask = 0;
}
! unsigned int
! aedLog::addDestination(ostream * out)
{
! m_Destinations.push_back(out);
! return (unsigned int) (m_Destinations.size() - 1);
}
! void
! aedLog::removeDestination(unsigned int index)
{
! m_Destinations.erase(m_Destinations.begin() + index);
}
! void
! aedLog::output(const char *prefix, const char *str)
{
! unsigned int i;
! ostream *out;
! // We always write to cerr
! fprintf(stderr, "%s%s", prefix, str);
! //cerr << prefix << str;
! //cerr.flush();
!
! for(i = 0; i < m_Destinations.size(); i++)
! {
! out = m_Destinations[i];
! *out << prefix << str;
! out->flush();
! }
}
! void
! aedLog::notice(const char *msg, ...)
{
! char string[m_BufferSize];
! va_list args;
! if(m_Mask & AED_LOG_NOTICE)
! return;
!
! va_start(args, msg);
! vsprintf(string, msg, args);
! va_end(args);
!
! output("aedGUI: ", string);
}
! void
! aedLog::warning(const char *msg, ...)
{
! char string[m_BufferSize];
! va_list args;
! if(m_Mask & AED_LOG_WARNING)
! return;
! va_start(args, msg);
! vsprintf(string, msg, args);
! va_end(args);
!
! output("aedGUI: ** WARNING ** ", string);
}
! void
! aedLog::error(const char *msg, ...)
{
! char string[m_BufferSize];
! va_list args;
! if(m_Mask & AED_LOG_ERROR)
! return;
! va_start(args, msg);
! vsprintf(string, msg, args);
! va_end(args);
! output("aedGUI: ** ERROR ** ", string);
}
! void
! aedLog::fatal(const char *msg, ...)
{
! char string[m_BufferSize];
! va_list args;
! va_start(args, msg);
! vsprintf(string, msg, args);
! va_end(args);
!
! output("aedGUI: ** FATAL ERROR ** ", string);
! exit(1);
}
Index: aedMenu.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedMenu.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** aedMenu.cpp 25 Oct 2003 19:23:59 -0000 1.6
--- aedMenu.cpp 6 Nov 2003 18:46:36 -0000 1.7
***************
*** 15,19 ****
unsigned int
! aedMenu::addItem(const std::string &caption, aedMenu * child)
{
aedMenuItem mi;
--- 15,19 ----
unsigned int
! aedMenu::addItem(const std::string & caption, aedMenu * child)
{
aedMenuItem mi;
***************
*** 22,27 ****
mi.child = child;
m_Items.push_back(mi);
! setSize(100, int(m_Items.size()) * (m_Font->getHeight() + SPACING) + SPACING);
! return (unsigned int)(m_Items.size() - 1);
}
--- 22,28 ----
mi.child = child;
m_Items.push_back(mi);
! setSize(100,
! int (m_Items.size()) * (m_Font->getHeight() + SPACING) + SPACING);
! return (unsigned int) (m_Items.size() - 1);
}
***************
*** 41,54 ****
dst.x = 4;
dst.y = SPACING;
! size_t nItemsSize = m_Items.size();
for(size_t i = 0; i < nItemsSize; ++i)
{
aedColor color(0, 0, 0, 255);
! if((int)i == m_Highlight)
color = aedColor(255, 255, 255, 255);
s = m_Font->renderTextBlended(m_Items[i].caption.c_str(), color);
! if((int)i == m_Highlight)
{
SDL_Surface *bg =
--- 42,56 ----
dst.x = 4;
dst.y = SPACING;
! size_t nItemsSize = m_Items.size();
!
for(size_t i = 0; i < nItemsSize; ++i)
{
aedColor color(0, 0, 0, 255);
! if((int) i == m_Highlight)
color = aedColor(255, 255, 255, 255);
s = m_Font->renderTextBlended(m_Items[i].caption.c_str(), color);
! if((int) i == m_Highlight)
{
SDL_Surface *bg =
***************
*** 94,103 ****
if(getParent())
{
! aedRect r = getRealPos();
! getParent()->wm_paint(SDL_GetVideoSurface(), r.getX(), r.getY(),
! r.getWidth(), r.getHeight());
! pUpdateMgr->addRect(r);
!
! getParent()->removeWidget(this);
}
return 0;
--- 96,106 ----
if(getParent())
{
! aedRect r = getRealPos();
!
! getParent()->wm_paint(SDL_GetVideoSurface(), r.getX(), r.getY(),
! r.getWidth(), r.getHeight());
! pUpdateMgr->addRect(r);
!
! getParent()->removeWidget(this);
}
return 0;
Index: aedMenuBar.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedMenuBar.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** aedMenuBar.cpp 25 Oct 2003 19:23:59 -0000 1.4
--- aedMenuBar.cpp 6 Nov 2003 18:46:36 -0000 1.5
***************
*** 22,26 ****
m_Menus.push_back(menu);
setRenderState(true);
! return (unsigned int)(m_Menus.size() - 1);
}
--- 22,26 ----
m_Menus.push_back(menu);
setRenderState(true);
! return (unsigned int) (m_Menus.size() - 1);
}
***************
*** 36,47 ****
void
! aedMenuBar::detachMenu(aedMenu *menu)
{
! std::vector<aedMenu *>::iterator p;
!
p = std::find(m_Menus.begin(), m_Menus.end(), menu);
if(p != m_Menus.end())
{
! m_Menus.erase(p);
setRenderState(true);
}
--- 36,47 ----
void
! aedMenuBar::detachMenu(aedMenu * menu)
{
! std::vector < aedMenu * >::iterator p;
!
p = std::find(m_Menus.begin(), m_Menus.end(), menu);
if(p != m_Menus.end())
{
! m_Menus.erase(p);
setRenderState(true);
}
Index: aedObject.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedObject.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** aedObject.cpp 3 Oct 2003 19:27:17 -0000 1.8
--- aedObject.cpp 6 Nov 2003 18:46:36 -0000 1.9
***************
*** 1,16 ****
#include "aedObject.h"
! aedObject::
! aedObject()
{
}
! aedObject::
! ~aedObject()
{
}
! bool
! aedObject::connect(aedEvents evt, aedCallBack cbf)
{
m_Signals.insert(std::make_pair(evt, aedSignal(cbf)));
--- 1,13 ----
#include "aedObject.h"
! aedObject::aedObject()
{
}
! aedObject::~aedObject()
{
}
! bool aedObject::connect(aedEvents evt, aedCallBack cbf)
{
m_Signals.insert(std::make_pair(evt, aedSignal(cbf)));
***************
*** 18,23 ****
}
! bool
! aedObject::disconnect(aedEvents evt)
{
m_Signals.erase(evt);
--- 15,19 ----
}
! bool aedObject::disconnect(aedEvents evt)
{
m_Signals.erase(evt);
***************
*** 28,34 ****
aedObject::triggerEvent(aedEvents evt, void *caller, void *data)
{
! std::multimap<aedEvents, aedSignal>::iterator pos;
! for (pos = m_Signals.lower_bound(evt); pos != m_Signals.upper_bound(evt); ++pos)
pos->second.trigger(caller, data);
}
--- 24,31 ----
aedObject::triggerEvent(aedEvents evt, void *caller, void *data)
{
! std::multimap < aedEvents, aedSignal >::iterator pos;
! for(pos = m_Signals.lower_bound(evt); pos != m_Signals.upper_bound(evt);
! ++pos)
pos->second.trigger(caller, data);
}
Index: aedProgressBar.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedProgressBar.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** aedProgressBar.cpp 8 Sep 2003 19:55:50 -0000 1.10
--- aedProgressBar.cpp 6 Nov 2003 18:46:36 -0000 1.11
***************
*** 26,34 ****
if(value != m_PercentValue)
{
! if(value > 100)
! value = 100;
!
! m_PercentValue = value;
! setRenderState(true);
}
}
--- 26,34 ----
if(value != m_PercentValue)
{
! if(value > 100)
! value = 100;
!
! m_PercentValue = value;
! setRenderState(true);
}
}
Index: aedRadioButtonGroup.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedRadioButtonGroup.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** aedRadioButtonGroup.cpp 25 Oct 2003 19:23:59 -0000 1.13
--- aedRadioButtonGroup.cpp 6 Nov 2003 18:46:36 -0000 1.14
***************
*** 16,20 ****
void
! aedRadioButtonGroup::addButton(const std::string &caption)
{
aedCheckBox *p;
--- 16,20 ----
void
! aedRadioButtonGroup::addButton(const std::string & caption)
{
aedCheckBox *p;
***************
*** 70,92 ****
{
m_Buttons[m_Selected]->setState(false);
! m_Buttons[index]->setState(true);
! if(pApp->getFocusWidget() == this)
! {
! m_Buttons[m_Selected]->setActiveBorder(false);
! m_Buttons[index]->setActiveBorder(true);
! }
m_Selected = index;
!
setRenderState(true);
triggerEvent(STATE_CHANGED, this, NULL);
}
! else
! {
! if(pApp->getFocusWidget() == this)
! {
! m_Buttons[m_Selected]->setActiveBorder(true);
! m_Buttons[m_Selected]->setRenderState(true);
! }
! }
}
}
--- 70,92 ----
{
m_Buttons[m_Selected]->setState(false);
! m_Buttons[index]->setState(true);
! if(pApp->getFocusWidget() == this)
! {
! m_Buttons[m_Selected]->setActiveBorder(false);
! m_Buttons[index]->setActiveBorder(true);
! }
m_Selected = index;
!
setRenderState(true);
triggerEvent(STATE_CHANGED, this, NULL);
}
! else
! {
! if(pApp->getFocusWidget() == this)
! {
! m_Buttons[m_Selected]->setActiveBorder(true);
! m_Buttons[m_Selected]->setRenderState(true);
! }
! }
}
}
***************
*** 107,111 ****
}
! int aedRadioButtonGroup::wm_lostfocus()
{
m_Buttons[m_Selected]->setActiveBorder(false);
--- 107,112 ----
}
! int
! aedRadioButtonGroup::wm_lostfocus()
{
m_Buttons[m_Selected]->setActiveBorder(false);
Index: aedScrollBar.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedScrollBar.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** aedScrollBar.cpp 25 Oct 2003 00:05:18 -0000 1.24
--- aedScrollBar.cpp 6 Nov 2003 18:46:36 -0000 1.25
***************
*** 9,14 ****
void
! aedScrollBar::create(aedWidget * parent, aedRect pos,
! std::string caption)
{
aedWidget::create(parent, pos, caption);
--- 9,13 ----
void
! aedScrollBar::create(aedWidget * parent, aedRect pos, std::string caption)
{
aedWidget::create(parent, pos, caption);
***************
*** 18,23 ****
m_ButtonUp.create(this, aedRect(0, 0, TAKEOVERX, 18));
m_ButtonDown.create(this, aedRect(0, FULLY, TAKEOVERX, 18));
! m_ButtonUp.setButtonType(BUTTON_ARROW_UP);
! m_ButtonDown.setButtonType(BUTTON_ARROW_DOWN);
}
else
--- 17,22 ----
m_ButtonUp.create(this, aedRect(0, 0, TAKEOVERX, 18));
m_ButtonDown.create(this, aedRect(0, FULLY, TAKEOVERX, 18));
! m_ButtonUp.setButtonType(BUTTON_ARROW_UP);
! m_ButtonDown.setButtonType(BUTTON_ARROW_DOWN);
}
else
***************
*** 25,36 ****
m_ButtonUp.create(this, aedRect(0, 0, 18, TAKEOVERY));
m_ButtonDown.create(this, aedRect(FULLX, 0, 18, TAKEOVERY));
! m_ButtonUp.setButtonType(BUTTON_ARROW_RIGHT);
! m_ButtonDown.setButtonType(BUTTON_ARROW_LEFT);
}
! m_ButtonUp.connect(MOUSE_LBUTTON_DOWN, aedCallBack(this, &aedScrollBar::buttonUpClicked));
m_ButtonDown.connect(MOUSE_LBUTTON_DOWN,
aedCallBack(this, &aedScrollBar::buttonDownClicked));
!
m_ButtonUp.setBorder(AED_BORDER_NONE);
m_ButtonDown.setBorder(AED_BORDER_NONE);
--- 24,36 ----
m_ButtonUp.create(this, aedRect(0, 0, 18, TAKEOVERY));
m_ButtonDown.create(this, aedRect(FULLX, 0, 18, TAKEOVERY));
! m_ButtonUp.setButtonType(BUTTON_ARROW_RIGHT);
! m_ButtonDown.setButtonType(BUTTON_ARROW_LEFT);
}
! m_ButtonUp.connect(MOUSE_LBUTTON_DOWN,
! aedCallBack(this, &aedScrollBar::buttonUpClicked));
m_ButtonDown.connect(MOUSE_LBUTTON_DOWN,
aedCallBack(this, &aedScrollBar::buttonDownClicked));
!
m_ButtonUp.setBorder(AED_BORDER_NONE);
m_ButtonDown.setBorder(AED_BORDER_NONE);
***************
*** 41,45 ****
}
! aedRect aedScrollBar::getElevatorRect()
{
Uint32 max, min;
--- 41,46 ----
}
! aedRect
! aedScrollBar::getElevatorRect()
{
Uint32 max, min;
***************
*** 83,87 ****
if(!getRealPos().isPointIn(mx, my))
return 0;
!
if(state & SDL_BUTTON(1))
{
--- 84,88 ----
if(!getRealPos().isPointIn(mx, my))
return 0;
!
if(state & SDL_BUTTON(1))
{
Index: aedSizer.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedSizer.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** aedSizer.cpp 25 Oct 2003 00:05:18 -0000 1.2
--- aedSizer.cpp 6 Nov 2003 18:46:36 -0000 1.3
***************
*** 1,26 ****
#include "aedSizer.h"
!
! aedSizer::
! aedSizer()
! {
! m_Parent = NULL;
! }
!
! aedSizer::
! ~aedSizer()
! {
!
! }
!
! aedSizer::
! aedSizer(aedWidget *parent)
! {
! m_Parent = parent;
! }
!
! void
aedSizer::
! addWidget(aedWidget *widget)
! {
! m_Widgets.push_back(widget);
! }
--- 1,16 ----
#include "aedSizer.h"
!
aedSizer::
aedSizer()
! {
!
m_Parent = NULL;
!
}
aedSizer::
~aedSizer()
! {
!
}
aedSizer::
aedSizer(aedWidget * parent)
! {
!
m_Parent = parent;
!
}
void
!
aedSizer::
! addWidget(aedWidget * widget)
! {
!
m_Widgets.push_back(widget);
!
}
Index: aedSlider.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGU...
[truncated message content] |