You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(118) |
Jun
(139) |
Jul
(184) |
Aug
(177) |
Sep
(127) |
Oct
(54) |
Nov
(16) |
Dec
(8) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(4) |
Feb
(28) |
Mar
(4) |
Apr
(6) |
May
(19) |
Jun
|
Jul
(1) |
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
From: Rodrigo H. <kw...@us...> - 2004-09-20 16:09:43
|
Update of /cvsroot/aedgui/aedGUI/VisualC7_2003 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3926/VisualC7_2003 Modified Files: aedgui.vcproj Log Message: updated Visual Studio 2003 solution Index: aedgui.vcproj =================================================================== RCS file: /cvsroot/aedgui/aedGUI/VisualC7_2003/aedgui.vcproj,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** aedgui.vcproj 25 Oct 2003 00:07:02 -0000 1.7 --- aedgui.vcproj 20 Sep 2004 16:09:32 -0000 1.8 *************** *** 1,389 **** ! <?xml version="1.0" encoding="Windows-1252"?> ! <VisualStudioProject ! ProjectType="Visual C++" ! Version="7.10" ! Name="aedGUI" ! ProjectGUID="{619B1F65-D3A1-43F6-9B71-11A0CDD86CEB}" ! Keyword="Win32Proj"> ! <Platforms> ! <Platform ! Name="Win32"/> ! </Platforms> ! <Configurations> ! <Configuration ! Name="Shared Debug|Win32" ! OutputDirectory="Debug" ! IntermediateDirectory="Debug" ! ConfigurationType="2" ! CharacterSet="2"> ! <Tool ! Name="VCCLCompilerTool" ! Optimization="0" ! AdditionalIncludeDirectories="..\include" ! PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;AEDGUI" ! MinimalRebuild="TRUE" ! BasicRuntimeChecks="3" ! RuntimeLibrary="3" ! RuntimeTypeInfo="TRUE" ! UsePrecompiledHeader="0" ! WarningLevel="3" ! Detect64BitPortabilityProblems="TRUE" ! DebugInformationFormat="4"/> ! <Tool ! Name="VCCustomBuildTool"/> ! <Tool ! Name="VCLinkerTool" ! AdditionalDependencies="sdl.lib freetype214MT.lib" ! OutputFile="../test/aedGUI.dll" ! LinkIncremental="2" ! GenerateDebugInformation="TRUE" ! ProgramDatabaseFile="$(OutDir)/aedGUI.pdb" ! SubSystem="2" ! ImportLibrary="$(OutDir)/aedGUI.lib" ! TargetMachine="1"/> ! <Tool ! Name="VCMIDLTool"/> ! <Tool ! Name="VCPostBuildEventTool" ! Description="Copying debug library..." ! CommandLine="copy Debug\aedGui.lib aedGui.lib"/> ! <Tool ! Name="VCPreBuildEventTool"/> ! <Tool ! Name="VCPreLinkEventTool"/> ! <Tool ! Name="VCResourceCompilerTool"/> ! <Tool ! Name="VCWebServiceProxyGeneratorTool"/> ! <Tool ! Name="VCXMLDataGeneratorTool"/> ! <Tool ! Name="VCWebDeploymentTool"/> ! <Tool ! Name="VCManagedWrapperGeneratorTool"/> ! <Tool ! Name="VCAuxiliaryManagedWrapperGeneratorTool"/> ! </Configuration> ! <Configuration ! Name="Shared Release|Win32" ! OutputDirectory="Release" ! IntermediateDirectory="Release" ! ConfigurationType="2" ! CharacterSet="2"> ! <Tool ! Name="VCCLCompilerTool" ! Optimization="3" ! InlineFunctionExpansion="2" ! FavorSizeOrSpeed="1" ! OmitFramePointers="TRUE" ! AdditionalIncludeDirectories="..\include" ! PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;AEDGUI" ! GeneratePreprocessedFile="0" ! StringPooling="TRUE" ! BasicRuntimeChecks="0" ! RuntimeLibrary="2" ! EnableFunctionLevelLinking="TRUE" ! RuntimeTypeInfo="TRUE" ! UsePrecompiledHeader="0" ! WarningLevel="3" ! Detect64BitPortabilityProblems="TRUE" ! DebugInformationFormat="3" ! DisableSpecificWarnings="4251"/> ! <Tool ! Name="VCCustomBuildTool"/> ! <Tool ! Name="VCLinkerTool" ! AdditionalDependencies="sdl.lib freetype214MT.lib" ! OutputFile="../test/$(ProjectName).dll"/> ! <Tool ! Name="VCMIDLTool"/> ! <Tool ! Name="VCPostBuildEventTool" ! Description="Copying library..." ! CommandLine="copy Release\aedGui.lib aedGui.lib"/> ! <Tool ! Name="VCPreBuildEventTool"/> ! <Tool ! Name="VCPreLinkEventTool"/> ! <Tool ! Name="VCResourceCompilerTool"/> ! <Tool ! Name="VCWebServiceProxyGeneratorTool"/> ! <Tool ! Name="VCXMLDataGeneratorTool"/> ! <Tool ! Name="VCWebDeploymentTool"/> ! <Tool ! Name="VCManagedWrapperGeneratorTool"/> ! <Tool ! Name="VCAuxiliaryManagedWrapperGeneratorTool"/> ! </Configuration> ! </Configurations> ! <References> ! </References> ! <Files> ! <Filter ! Name="Source Files" ! Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> ! <File ! RelativePath="..\src\aedAnimatedImage.cpp"> ! </File> ! <File ! RelativePath="..\src\aedApp.cpp"> ! </File> ! <File ! RelativePath="..\src\aedBoxSizer.cpp"> ! </File> ! <File ! RelativePath="..\src\aedButton.cpp"> ! </File> ! <File ! RelativePath="..\src\aedCheckBox.cpp"> ! </File> ! <File ! RelativePath="..\src\aedCursor.cpp"> ! </File> ! <File ! RelativePath="..\src\aedDialogBox.cpp"> ! </File> ! <File ! RelativePath="..\src\aedFont.cpp"> ! </File> ! <File ! RelativePath="..\src\aedFrame.cpp"> ! </File> ! <File ! RelativePath="..\src\aedImage.cpp"> ! </File> ! <File ! RelativePath="..\src\aedImageBank.cpp"> ! </File> ! <File ! RelativePath="..\src\aedListBox.cpp"> ! </File> ! <File ! RelativePath="..\src\aedLog.cpp"> ! </File> ! <File ! RelativePath="..\src\aedMenu.cpp"> ! </File> ! <File ! RelativePath="..\src\aedMenuBar.cpp"> ! </File> ! <File ! RelativePath="..\src\aedObject.cpp"> ! </File> ! <File ! RelativePath="..\src\aedProgressBar.cpp"> ! </File> ! <File ! RelativePath="..\src\aedRadioButtonGroup.cpp"> ! </File> ! <File ! RelativePath="..\src\aedScrollBar.cpp"> ! </File> ! <File ! RelativePath="..\src\aedSignal.cpp"> ! </File> ! <File ! RelativePath="..\src\aedSizer.cpp"> ! </File> ! <File ! RelativePath="..\src\aedSlider.cpp"> ! </File> ! <File ! RelativePath="..\src\aedSpinner.cpp"> ! </File> ! <File ! RelativePath="..\src\aedStaticImage.cpp"> ! </File> ! <File ! RelativePath="..\src\aedStaticRTF.cpp"> ! </File> ! <File ! RelativePath="..\src\aedStaticText.cpp"> ! </File> ! <File ! RelativePath="..\src\aedTextBox.cpp"> ! </File> ! <File ! RelativePath="..\src\aedTheme.cpp"> ! </File> ! <File ! RelativePath="..\src\aedTimer.cpp"> ! </File> ! <File ! RelativePath="..\src\aedUpdateManager.cpp"> ! </File> ! <File ! RelativePath="..\src\aedWidget.cpp"> ! </File> ! <File ! RelativePath="..\src\aedWindow.cpp"> ! </File> ! <File ! RelativePath="..\src\aedXmlFile.cpp"> ! </File> ! <File ! RelativePath="..\src\drawlibs.cpp"> ! </File> ! <File ! RelativePath="..\src\SDL_loadso.c"> ! </File> ! <File ! RelativePath="..\src\SDL_ttf.h"> ! </File> ! <File ! RelativePath="..\src\tinyxml\tinyxml.cpp"> ! </File> ! <File ! RelativePath="..\src\tinyxml\tinyxmlerror.cpp"> ! </File> ! <File ! RelativePath="..\src\tinyxml\tinyxmlparser.cpp"> ! </File> ! </Filter> ! <Filter ! Name="Header Files" ! Filter="h;hpp;hxx;hm;inl;inc"> ! <File ! RelativePath="..\include\aedAnimatedImage.h"> ! </File> ! <File ! RelativePath="..\include\aedApp.h"> ! </File> ! <File ! RelativePath="..\include\aedBoxSizer.h"> ! </File> ! <File ! RelativePath="..\include\aedButton.h"> ! </File> ! <File ! RelativePath="..\include\aedCallBack.h"> ! </File> ! <File ! RelativePath="..\include\aedCheckBox.h"> ! </File> ! <File ! RelativePath="..\include\aedColor.h"> ! </File> ! <File ! RelativePath="..\include\aedCursor.h"> ! </File> ! <File ! RelativePath="..\include\aedDialogBox.h"> ! </File> ! <File ! RelativePath="..\include\aedFont.h"> ! </File> ! <File ! RelativePath="..\include\aedFrame.h"> ! </File> ! <File ! RelativePath="..\include\aedFunctor1Arg.h"> ! </File> ! <File ! RelativePath="..\include\aedFunctorBase.h"> ! </File> ! <File ! RelativePath="..\include\aedFunctorNoArgs.h"> ! </File> ! <File ! RelativePath="..\include\aedGui.h"> ! </File> ! <File ! RelativePath="..\include\aedImage.h"> ! </File> ! <File ! RelativePath="..\include\aedImageBank.h"> ! </File> ! <File ! RelativePath="..\include\aedListBox.h"> ! </File> ! <File ! RelativePath="..\include\aedLog.h"> ! </File> ! <File ! RelativePath="..\include\aedMenu.h"> ! </File> ! <File ! RelativePath="..\include\aedMenuBar.h"> ! </File> ! <File ! RelativePath="..\include\aedObject.h"> ! </File> ! <File ! RelativePath="..\include\aedProgressBar.h"> ! </File> ! <File ! RelativePath="..\include\aedRadioButtonGroup.h"> ! </File> ! <File ! RelativePath="..\include\aedRect.h"> ! </File> ! <File ! RelativePath="..\include\aedScrollBar.h"> ! </File> ! <File ! RelativePath="..\include\aedSignal.h"> ! </File> ! <File ! RelativePath="..\include\aedSizer.h"> ! </File> ! <File ! RelativePath="..\include\aedSlider.h"> ! </File> ! <File ! RelativePath="..\include\aedSpinner.h"> ! </File> ! <File ! RelativePath="..\include\aedStaticImage.h"> ! </File> ! <File ! RelativePath="..\include\aedStaticRTF.h"> ! </File> ! <File ! RelativePath="..\include\aedStaticText.h"> ! </File> ! <File ! RelativePath="..\include\aedTextBox.h"> ! </File> ! <File ! RelativePath="..\include\aedTheme.h"> ! </File> ! <File ! RelativePath="..\include\aedTimer.h"> ! </File> ! <File ! RelativePath="..\include\aedUpdateManager.h"> ! </File> ! <File ! RelativePath="..\include\aedWidget.h"> ! </File> ! <File ! RelativePath="..\include\aedWindow.h"> ! </File> ! <File ! RelativePath="..\include\aedXmlFile.h"> ! </File> ! <File ! RelativePath="..\include\dllmacros.h"> ! </File> ! <File ! RelativePath="..\include\drawlibs.h"> ! </File> ! <File ! RelativePath="..\include\rint.h"> ! </File> ! <File ! RelativePath="..\src\tinyxml\tinyxml.h"> ! </File> ! </Filter> ! <Filter ! Name="Resource Files" ! Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> ! </Filter> ! </Files> ! <Globals> ! </Globals> ! </VisualStudioProject> --- 1,395 ---- ! <?xml version="1.0" encoding="Windows-1252"?> ! <VisualStudioProject ! ProjectType="Visual C++" ! Version="7.10" ! Name="aedGUI" ! ProjectGUID="{619B1F65-D3A1-43F6-9B71-11A0CDD86CEB}" ! Keyword="Win32Proj"> ! <Platforms> ! <Platform ! Name="Win32"/> ! </Platforms> ! <Configurations> ! <Configuration ! Name="Shared Debug|Win32" ! OutputDirectory="Debug" ! IntermediateDirectory="Debug" ! ConfigurationType="2" ! CharacterSet="2"> ! <Tool ! Name="VCCLCompilerTool" ! Optimization="0" ! AdditionalIncludeDirectories="..\include" ! PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;AEDGUI" ! MinimalRebuild="TRUE" ! BasicRuntimeChecks="3" ! RuntimeLibrary="3" ! RuntimeTypeInfo="TRUE" ! UsePrecompiledHeader="0" ! WarningLevel="3" ! Detect64BitPortabilityProblems="TRUE" ! DebugInformationFormat="4"/> ! <Tool ! Name="VCCustomBuildTool"/> ! <Tool ! Name="VCLinkerTool" ! AdditionalDependencies="sdl.lib freetype219MT.lib opengl32.lib glu32.lib" ! OutputFile="../test/aedGUI.dll" ! LinkIncremental="2" ! GenerateDebugInformation="TRUE" ! ProgramDatabaseFile="$(OutDir)/aedGUI.pdb" ! SubSystem="2" ! ImportLibrary="$(OutDir)/aedGUI.lib" ! TargetMachine="1"/> ! <Tool ! Name="VCMIDLTool"/> ! <Tool ! Name="VCPostBuildEventTool" ! Description="Copying debug library..." ! CommandLine="copy Debug\aedGui.lib aedGui.lib"/> ! <Tool ! Name="VCPreBuildEventTool"/> ! <Tool ! Name="VCPreLinkEventTool"/> ! <Tool ! Name="VCResourceCompilerTool"/> ! <Tool ! Name="VCWebServiceProxyGeneratorTool"/> ! <Tool ! Name="VCXMLDataGeneratorTool"/> ! <Tool ! Name="VCWebDeploymentTool"/> ! <Tool ! Name="VCManagedWrapperGeneratorTool"/> ! <Tool ! Name="VCAuxiliaryManagedWrapperGeneratorTool"/> ! </Configuration> ! <Configuration ! Name="Shared Release|Win32" ! OutputDirectory="Release" ! IntermediateDirectory="Release" ! ConfigurationType="2" ! CharacterSet="2"> ! <Tool ! Name="VCCLCompilerTool" ! Optimization="3" ! InlineFunctionExpansion="2" ! FavorSizeOrSpeed="1" ! OmitFramePointers="TRUE" ! AdditionalIncludeDirectories="..\include" ! PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;AEDGUI" ! GeneratePreprocessedFile="0" ! StringPooling="TRUE" ! BasicRuntimeChecks="0" ! RuntimeLibrary="2" ! EnableFunctionLevelLinking="TRUE" ! RuntimeTypeInfo="TRUE" ! UsePrecompiledHeader="0" ! WarningLevel="3" ! Detect64BitPortabilityProblems="TRUE" ! DebugInformationFormat="3" ! DisableSpecificWarnings="4251"/> ! <Tool ! Name="VCCustomBuildTool"/> ! <Tool ! Name="VCLinkerTool" ! AdditionalDependencies="sdl.lib freetype214MT.lib" ! OutputFile="../test/$(ProjectName).dll"/> ! <Tool ! Name="VCMIDLTool"/> ! <Tool ! Name="VCPostBuildEventTool" ! Description="Copying library..." ! CommandLine="copy Release\aedGui.lib aedGui.lib"/> ! <Tool ! Name="VCPreBuildEventTool"/> ! <Tool ! Name="VCPreLinkEventTool"/> ! <Tool ! Name="VCResourceCompilerTool"/> ! <Tool ! Name="VCWebServiceProxyGeneratorTool"/> ! <Tool ! Name="VCXMLDataGeneratorTool"/> ! <Tool ! Name="VCWebDeploymentTool"/> ! <Tool ! Name="VCManagedWrapperGeneratorTool"/> ! <Tool ! Name="VCAuxiliaryManagedWrapperGeneratorTool"/> ! </Configuration> ! </Configurations> ! <References> ! </References> ! <Files> ! <Filter ! Name="Source Files" ! Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> ! <File ! RelativePath="..\src\aedAnimatedImage.cpp"> ! </File> ! <File ! RelativePath="..\src\aedApp.cpp"> ! </File> ! <File ! RelativePath="..\src\aedBoxSizer.cpp"> ! </File> ! <File ! RelativePath="..\src\aedButton.cpp"> ! </File> ! <File ! RelativePath="..\src\aedCheckBox.cpp"> ! </File> ! <File ! RelativePath="..\src\aedClipboard.cpp"> ! </File> ! <File ! RelativePath="..\src\aedCursor.cpp"> ! </File> ! <File ! RelativePath="..\src\aedDialogBox.cpp"> ! </File> ! <File ! RelativePath="..\src\aedFont.cpp"> ! </File> ! <File ! RelativePath="..\src\aedFrame.cpp"> ! </File> ! <File ! RelativePath="..\src\aedImage.cpp"> ! </File> ! <File ! RelativePath="..\src\aedImageBank.cpp"> ! </File> ! <File ! RelativePath="..\src\aedListBox.cpp"> ! </File> ! <File ! RelativePath="..\src\aedLog.cpp"> ! </File> ! <File ! RelativePath="..\src\aedMenu.cpp"> ! </File> ! <File ! RelativePath="..\src\aedMenuBar.cpp"> ! </File> ! <File ! RelativePath="..\src\aedObject.cpp"> ! </File> ! <File ! RelativePath="..\src\aedProgressBar.cpp"> ! </File> ! <File ! RelativePath="..\src\aedRadioButtonGroup.cpp"> ! </File> ! <File ! RelativePath="..\src\aedRect.cpp"> ! </File> ! <File ! RelativePath="..\src\aedScrollBar.cpp"> ! </File> ! <File ! RelativePath="..\src\aedSignal.cpp"> ! </File> ! <File ! RelativePath="..\src\aedSizer.cpp"> ! </File> ! <File ! RelativePath="..\src\aedSlider.cpp"> ! </File> ! <File ! RelativePath="..\src\aedSpinner.cpp"> ! </File> ! <File ! RelativePath="..\src\aedStaticImage.cpp"> ! </File> ! <File ! RelativePath="..\src\aedStaticRTF.cpp"> ! </File> ! <File ! RelativePath="..\src\aedStaticText.cpp"> ! </File> ! <File ! RelativePath="..\src\aedTextBox.cpp"> ! </File> ! <File ! RelativePath="..\src\aedTheme.cpp"> ! </File> ! <File ! RelativePath="..\src\aedTimer.cpp"> ! </File> ! <File ! RelativePath="..\src\aedUpdateManager.cpp"> ! </File> ! <File ! RelativePath="..\src\aedWidget.cpp"> ! </File> ! <File ! RelativePath="..\src\aedWindow.cpp"> ! </File> ! <File ! RelativePath="..\src\aedXmlFile.cpp"> ! </File> ! <File ! RelativePath="..\src\drawlibs.cpp"> ! </File> ! <File ! RelativePath="..\src\SDL_loadso.c"> ! </File> ! <File ! RelativePath="..\src\SDL_ttf.h"> ! </File> ! <File ! RelativePath="..\src\tinyxml\tinyxml.cpp"> ! </File> ! <File ! RelativePath="..\src\tinyxml\tinyxmlerror.cpp"> ! </File> ! <File ! RelativePath="..\src\tinyxml\tinyxmlparser.cpp"> ! </File> ! </Filter> ! <Filter ! Name="Header Files" ! Filter="h;hpp;hxx;hm;inl;inc"> ! <File ! RelativePath="..\include\aedAnimatedImage.h"> ! </File> ! <File ! RelativePath="..\include\aedApp.h"> ! </File> ! <File ! RelativePath="..\include\aedBoxSizer.h"> ! </File> ! <File ! RelativePath="..\include\aedButton.h"> ! </File> ! <File ! RelativePath="..\include\aedCallBack.h"> ! </File> ! <File ! RelativePath="..\include\aedCheckBox.h"> ! </File> ! <File ! RelativePath="..\include\aedColor.h"> ! </File> ! <File ! RelativePath="..\include\aedCursor.h"> ! </File> ! <File ! RelativePath="..\include\aedDialogBox.h"> ! </File> ! <File ! RelativePath="..\include\aedFont.h"> ! </File> ! <File ! RelativePath="..\include\aedFrame.h"> ! </File> ! <File ! RelativePath="..\include\aedFunctor1Arg.h"> ! </File> ! <File ! RelativePath="..\include\aedFunctorBase.h"> ! </File> ! <File ! RelativePath="..\include\aedFunctorNoArgs.h"> ! </File> ! <File ! RelativePath="..\include\aedGui.h"> ! </File> ! <File ! RelativePath="..\include\aedImage.h"> ! </File> ! <File ! RelativePath="..\include\aedImageBank.h"> ! </File> ! <File ! RelativePath="..\include\aedListBox.h"> ! </File> ! <File ! RelativePath="..\include\aedLog.h"> ! </File> ! <File ! RelativePath="..\include\aedMenu.h"> ! </File> ! <File ! RelativePath="..\include\aedMenuBar.h"> ! </File> ! <File ! RelativePath="..\include\aedObject.h"> ! </File> ! <File ! RelativePath="..\include\aedProgressBar.h"> ! </File> ! <File ! RelativePath="..\include\aedRadioButtonGroup.h"> ! </File> ! <File ! RelativePath="..\include\aedRect.h"> ! </File> ! <File ! RelativePath="..\include\aedScrollBar.h"> ! </File> ! <File ! RelativePath="..\include\aedSignal.h"> ! </File> ! <File ! RelativePath="..\include\aedSizer.h"> ! </File> ! <File ! RelativePath="..\include\aedSlider.h"> ! </File> ! <File ! RelativePath="..\include\aedSpinner.h"> ! </File> ! <File ! RelativePath="..\include\aedStaticImage.h"> ! </File> ! <File ! RelativePath="..\include\aedStaticRTF.h"> ! </File> ! <File ! RelativePath="..\include\aedStaticText.h"> ! </File> ! <File ! RelativePath="..\include\aedTextBox.h"> ! </File> ! <File ! RelativePath="..\include\aedTheme.h"> ! </File> ! <File ! RelativePath="..\include\aedTimer.h"> ! </File> ! <File ! RelativePath="..\include\aedUpdateManager.h"> ! </File> ! <File ! RelativePath="..\include\aedWidget.h"> ! </File> ! <File ! RelativePath="..\include\aedWindow.h"> ! </File> ! <File ! RelativePath="..\include\aedXmlFile.h"> ! </File> ! <File ! RelativePath="..\include\dllmacros.h"> ! </File> ! <File ! RelativePath="..\include\drawlibs.h"> ! </File> ! <File ! RelativePath="..\include\rint.h"> ! </File> ! <File ! RelativePath="..\src\tinyxml\tinyxml.h"> ! </File> ! </Filter> ! <Filter ! Name="Resource Files" ! Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> ! </Filter> ! </Files> ! <Globals> ! </Globals> ! </VisualStudioProject> |
From: Rodrigo H. <kw...@us...> - 2004-09-20 16:09:43
|
Update of /cvsroot/aedgui/aedGUI/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3926/src Modified Files: SDL_ttf.c aedApp.cpp Log Message: updated Visual Studio 2003 solution Index: SDL_ttf.c =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/SDL_ttf.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SDL_ttf.c 6 Nov 2003 18:46:34 -0000 1.4 --- SDL_ttf.c 20 Sep 2004 16:09:32 -0000 1.5 *************** *** 41,47 **** #endif ! #include <freetype/freetype.h> #include <freetype/ftoutln.h> ! #include <freetype/ttnameid.h> #include <freetype/internal/ftobjs.h> --- 41,50 ---- #endif ! #include <ft2build.h> ! #include FT_FREETYPE_H ! ! //#include <freetype/freetype.h> #include <freetype/ftoutln.h> ! //#include <freetype/ttnameid.h> #include <freetype/internal/ftobjs.h> Index: aedApp.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedApp.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** aedApp.cpp 16 Apr 2004 01:29:56 -0000 1.32 --- aedApp.cpp 20 Sep 2004 16:09:32 -0000 1.33 *************** *** 49,53 **** pUpdateMgr = new aedUpdateManager; ! // Initialize clipboard if(init_scrap() < 0) pLog->warning("Couldn't init clipboard\n"); --- 49,53 ---- pUpdateMgr = new aedUpdateManager; ! //Initialize clipboard if(init_scrap() < 0) pLog->warning("Couldn't init clipboard\n"); |
From: Rodrigo H. <kw...@us...> - 2004-09-20 16:09:43
|
Update of /cvsroot/aedgui/aedGUI/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3926/test Modified Files: main.cpp Log Message: updated Visual Studio 2003 solution Index: main.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/test/main.cpp,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** main.cpp 24 May 2004 17:42:43 -0000 1.56 --- main.cpp 20 Sep 2004 16:09:32 -0000 1.57 *************** *** 138,141 **** --- 138,149 ---- txtBox1.create(&frame1, aedRect(10, 0, 180, 25), "Great looking widgets!"); + //txtBox1.setCaption("Once upon a time there was a lib called aedGUI."); + //txtBox1.getCaption(); + //txtBox1.getCaption(); + //txtBox1.getCaption(); + //txtBox1.getCaption(); + //txtBox1.getCaption(); + //txtBox1.getCaption(); + aedCheckBox checkBox, chk2; |
From: Rodrigo H. <kw...@us...> - 2004-07-04 22:58:44
|
Update of /cvsroot/aedgui/aedGUI/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18091/include Modified Files: aedFont.h drawlibs.h Log Message: Added Asko's VC++6 fixes Index: drawlibs.h =================================================================== RCS file: /cvsroot/aedgui/aedGUI/include/drawlibs.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** drawlibs.h 16 Apr 2004 01:29:56 -0000 1.7 --- drawlibs.h 4 Jul 2004 22:57:03 -0000 1.8 *************** *** 60,64 **** }; DLLEXPORT void DrawArrow(void* s, int type, int x, int y, int a, ! aedColor &aedColor, bool fill, aedColor &fillcolor); #define SLOCK(surface) \ --- 60,64 ---- }; DLLEXPORT void DrawArrow(void* s, int type, int x, int y, int a, ! aedColor &foreground, bool fill, aedColor &fillcolor); #define SLOCK(surface) \ Index: aedFont.h =================================================================== RCS file: /cvsroot/aedgui/aedGUI/include/aedFont.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** aedFont.h 29 May 2004 18:05:28 -0000 1.16 --- aedFont.h 4 Jul 2004 22:57:03 -0000 1.17 *************** *** 40,44 **** typedef struct _TTF_Font TTF_Font; ! typedef struct chardata { SDL_Surface *solidSurface; --- 40,44 ---- typedef struct _TTF_Font TTF_Font; ! struct chardata { SDL_Surface *solidSurface; |
From: Rodrigo H. <kw...@us...> - 2004-05-30 21:51:24
|
Update of /cvsroot/aedgui/aedGUI/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15526/src Modified Files: aedFont.cpp aedTextBox.cpp Log Message: Fixed alpha blending for button labels, broke it for textboxes Index: aedTextBox.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedTextBox.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** aedTextBox.cpp 30 May 2004 03:51:19 -0000 1.39 --- aedTextBox.cpp 30 May 2004 21:50:56 -0000 1.40 *************** *** 434,438 **** if((width>m_Surface->w)||(m_Justification == AED_JUST_RIGHT)) { ! dest.x= m_Surface->w-width; } Uint32 index = m_Font->getIndexToFirstChar(m_Surface, --- 434,438 ---- if((width>m_Surface->w)||(m_Justification == AED_JUST_RIGHT)) { ! dest.x= m_Surface->w-width-cPad; } Uint32 index = m_Font->getIndexToFirstChar(m_Surface, Index: aedFont.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedFont.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** aedFont.cpp 29 May 2004 18:11:20 -0000 1.20 --- aedFont.cpp 30 May 2004 21:50:56 -0000 1.21 *************** *** 350,354 **** aedFont::generateFontVector() { ! Uint16 ch; // these Colors are not randomly selected // in OpenGL these will help us get proper --- 350,355 ---- aedFont::generateFontVector() { ! char ch[2]; ! ch[1]=0; // these Colors are not randomly selected // in OpenGL these will help us get proper *************** *** 365,371 **** for(int i=0;i<charcount;++i) { ! ch = i+charoffset; TTF_GlyphMetrics(data, ! ch, &minx, &maxx, --- 366,372 ---- for(int i=0;i<charcount;++i) { ! ch[0] = i+charoffset; TTF_GlyphMetrics(data, ! ch[0], &minx, &maxx, *************** *** 374,381 **** &advance); charVector.push_back(charData); ! charVector[i].solidSurface = TTF_RenderGlyph_Solid(data,ch,fg); ! charVector[i].blendedSurface = TTF_RenderGlyph_Blended(data,ch,fg); charVector[i].advance = advance; ! charVector[i].yoffset = TTF_FontAscent(data) - maxy; charVector[i].blendedColor = fg; charVector[i].solidColor = fg; --- 375,395 ---- &advance); charVector.push_back(charData); ! if(pApp->getUTF8()) ! { ! charVector[i].solidSurface = TTF_RenderUTF8_Solid(data,ch,fg); ! charVector[i].blendedSurface = TTF_RenderUTF8_Blended(data,ch,fg); ! } ! else ! { ! charVector[i].solidSurface = TTF_RenderText_Solid(data,ch,fg); ! charVector[i].blendedSurface = TTF_RenderText_Blended(data,ch,fg); ! } ! if(charVector[i].blendedSurface!=NULL) ! SDL_SetAlpha(charVector[i].blendedSurface, 0, 0); ! ! // charVector[i].solidSurface = TTF_RenderGlyph_Solid(data,ch[0],fg); ! // charVector[i].blendedSurface = TTF_RenderGlyph_Blended(data,ch[0],fg); charVector[i].advance = advance; ! charVector[i].yoffset = 0;//TTF_FontAscent(data) - maxy; charVector[i].blendedColor = fg; charVector[i].solidColor = fg; |
From: Eduardo Bras?o da F. <edu...@us...> - 2004-05-30 03:51:30
|
Update of /cvsroot/aedgui/aedGUI/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4689/src Modified Files: aedTextBox.cpp Log Message: Fixed the empty string bug on aedTextBox.cpp. I'm back :) Index: aedTextBox.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedTextBox.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** aedTextBox.cpp 29 May 2004 18:05:28 -0000 1.38 --- aedTextBox.cpp 30 May 2004 03:51:19 -0000 1.39 *************** *** 416,420 **** } m_Theme->drawBox(this, m_Surface); ! m_Font->getTextSize(m_Caption.c_str(), &width, &height); aedColor thisColor = m_TextColor; --- 416,420 ---- } m_Theme->drawBox(this, m_Surface); ! m_Font->getTextSize(m_Caption.c_str(), (Uint16 *)&width, (Uint16 *)&height); aedColor thisColor = m_TextColor; *************** *** 430,434 **** dest.h -= cPad * 3; ! if(width>=0) // don't bother if there's no text { if((width>m_Surface->w)||(m_Justification == AED_JUST_RIGHT)) --- 430,434 ---- dest.h -= cPad * 3; ! if(width>0) // don't bother if there's no text { if((width>m_Surface->w)||(m_Justification == AED_JUST_RIGHT)) *************** *** 439,442 **** --- 439,443 ---- dest.x, m_Caption.c_str()); + if(index<0) return; else if(index>0) *************** *** 444,450 **** temp1 = m_Caption.substr(index,m_Caption.size()-index); } ! else { temp1 = m_Caption; } m_Font->renderTextBlended(m_Surface, --- 445,452 ---- temp1 = m_Caption.substr(index,m_Caption.size()-index); } ! else // == 0 { temp1 = m_Caption; + } m_Font->renderTextBlended(m_Surface, |
From: Rodrigo H. <kw...@us...> - 2004-05-29 18:11:36
|
Update of /cvsroot/aedgui/aedGUI/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13042/src Modified Files: aedFont.cpp Log Message: removed some debug loging code Index: aedFont.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedFont.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** aedFont.cpp 29 May 2004 18:05:28 -0000 1.19 --- aedFont.cpp 29 May 2004 18:11:20 -0000 1.20 *************** *** 325,332 **** { x = dst.x; - fprintf(stdout,"X: %d Index %d\n",x,i); return i; } - //dst = cliprect.getSDLRect(); dst.x+=charVector[ch].advance; }; --- 325,330 ---- |
From: Rodrigo H. <kw...@us...> - 2004-05-29 18:05:40
|
Update of /cvsroot/aedgui/aedGUI/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12074/include Modified Files: aedFont.h Log Message: Fixed aedTextBox text scrolling past its width and caret rendering algo Index: aedFont.h =================================================================== RCS file: /cvsroot/aedgui/aedGUI/include/aedFont.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** aedFont.h 22 May 2004 19:28:08 -0000 1.15 --- aedFont.h 29 May 2004 18:05:28 -0000 1.16 *************** *** 164,167 **** --- 164,180 ---- DLLEXPORT #endif + /*! getIndexToFirstChar + returns the index to the first character from "str" that would be rendered into "s" if the whole string was rendered at x + \param s [in] Surface where the text would be blit to + \param x [in/out] X position for the blit, upon return it holds the X offset needed for the string to be rendered + \param str text to check for + \return Returns the index to the first character from "str" that would be rendered into "s" if the whole string was rendered at x, returns -1 if no text at all is rendered. + \sa aedFont::renderTextSolid,aedFont::renderTextBlended,aedFont::renderTextShaded + */ + int getIndexToFirstChar(SDL_Surface * s, Sint16& x,const char *str); + + #ifndef _MSC_VER + DLLEXPORT + #endif /*! getCharXOffset returns the Y offset the character at position "index" would be rendered on the string "str". |
From: Rodrigo H. <kw...@us...> - 2004-05-29 18:05:40
|
Update of /cvsroot/aedgui/aedGUI/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12074/src Modified Files: aedFont.cpp aedTextBox.cpp Log Message: Fixed aedTextBox text scrolling past its width and caret rendering algo Index: aedTextBox.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedTextBox.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** aedTextBox.cpp 22 May 2004 19:28:08 -0000 1.37 --- aedTextBox.cpp 29 May 2004 18:05:28 -0000 1.38 *************** *** 404,416 **** aedTextBox::render(void) { - //SDL_Surface *s1 = NULL; - SDL_Rect src = { - 0, 0, 0, 0 - }; SDL_Rect dest = { 0, 0, m_Surface->w, m_Surface->h }; std::string temp1, temp2, pass, selected; ! Uint16 width1, height1, width2, height2; if(m_PasswordMode) --- 404,412 ---- aedTextBox::render(void) { SDL_Rect dest = { 0, 0, m_Surface->w, m_Surface->h }; std::string temp1, temp2, pass, selected; ! Uint16 width, height,xoffset; if(m_PasswordMode) *************** *** 420,440 **** } m_Theme->drawBox(this, m_Surface); ! if(m_CaretPos <= 0) ! { ! temp1 = ""; ! temp2 = m_Caption; ! } ! else if(m_CaretPos < m_Caption.size()) ! { ! temp1 = m_Caption.substr(0, m_CaretPos); ! temp2 = m_Caption.substr(m_CaretPos, m_Caption.size()); ! } ! else ! { ! temp1 = m_Caption; ! temp2 = ""; ! } ! m_Font->getTextSize(temp1.c_str(), &width1, &height1); ! m_Font->getTextSize(temp2.c_str(), &width2, &height2); aedColor thisColor = m_TextColor; --- 416,420 ---- } m_Theme->drawBox(this, m_Surface); ! m_Font->getTextSize(m_Caption.c_str(), &width, &height); aedColor thisColor = m_TextColor; *************** *** 450,486 **** dest.h -= cPad * 3; ! if(width1>=0) // don't bother if there's no text { ! if(width1 < m_StartPixel) ! { ! m_StartPixel = int (width1 - (dest.w / 4)); ! ! if(m_StartPixel < 0) ! m_StartPixel = 0; ! } ! else if(width1 > m_StartPixel + dest.w) ! { ! m_StartPixel = int (width1 - dest.w + (dest.w / 4)); ! ! if(m_StartPixel + dest.w > width1) ! m_StartPixel = width1 - dest.w; ! } ! ! if(width1 + width2 < dest.w) ! { ! if(m_Justification == AED_JUST_RIGHT) ! dest.x += dest.w - (width1 + width2); ! else if(m_Justification == AED_JUST_CENTER) ! dest.x += (dest.w - (width1 + width2)) / 2; ! } ! ! src.x = m_StartPixel; ! src.y = 0; ! src.h = height1; ! src.w = dest.w; m_Font->renderTextBlended(m_Surface, dest.x, dest.y, ! m_Caption.c_str(), thisColor); if(m_SelectionStart != m_SelectionEnd) --- 430,455 ---- dest.h -= cPad * 3; ! if(width>=0) // don't bother if there's no text { ! if((width>m_Surface->w)||(m_Justification == AED_JUST_RIGHT)) ! { ! dest.x= m_Surface->w-width; ! } ! Uint32 index = m_Font->getIndexToFirstChar(m_Surface, ! dest.x, ! m_Caption.c_str()); ! if(index<0) return; ! else if(index>0) ! { ! temp1 = m_Caption.substr(index,m_Caption.size()-index); ! } ! else ! { ! temp1 = m_Caption; ! } m_Font->renderTextBlended(m_Surface, dest.x, dest.y, ! temp1.c_str(), thisColor); if(m_SelectionStart != m_SelectionEnd) *************** *** 494,497 **** --- 463,468 ---- if(SelectStart > SelectEnd) std::swap(SelectStart, SelectEnd); + if((SelectStart<index)&&(SelectEnd<index)) return; + else if (SelectStart<index) SelectStart = index; selected = m_Caption.substr(SelectStart, SelectEnd - SelectStart); m_Font->renderTextShaded(m_Surface, *************** *** 504,509 **** // caret ! if(hasFocus() && m_ShowCaret && isEnabled()) ! { void* screenORrect = NULL; aedRect rect; --- 475,481 ---- // caret ! if(hasFocus() && m_ShowCaret && isEnabled()) ! { ! void* screenORrect = NULL; aedRect rect; *************** *** 517,527 **** screenORrect = m_Surface; } ! SLOCK(m_Surface); ! DrawLine(screenORrect, ! dest.x + width1 - m_StartPixel, dest.y, ! dest.x + width1 - m_StartPixel, ! dest.y + dest.h, m_TextColor); ! SUNLOCK(m_Surface); ! } if(m_PasswordMode) --- 489,515 ---- screenORrect = m_Surface; } ! if(width>=0) ! { ! SLOCK(m_Surface); ! // avoid calling getCharXOffset Twice ! xoffset = dest.x+m_Font->getCharXOffset(m_Caption.c_str(),m_CaretPos); ! DrawLine(screenORrect, ! xoffset, ! dest.y, ! xoffset, ! dest.y + dest.h, m_TextColor); ! SUNLOCK(m_Surface); ! } ! else ! { ! SLOCK(m_Surface); ! DrawLine(screenORrect, ! dest.x, ! dest.y, ! dest.x, ! dest.y + dest.h, m_TextColor); ! SUNLOCK(m_Surface); ! } ! } if(m_PasswordMode) Index: aedFont.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedFont.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** aedFont.cpp 24 May 2004 17:42:42 -0000 1.18 --- aedFont.cpp 29 May 2004 18:05:28 -0000 1.19 *************** *** 307,314 **** } int aedFont::getCharXOffset(const char *str,int index) { int nTextLenght = strlen(str); ! if (nTextLenght<index) return -1; int xoffset = 0; unsigned char ch; --- 307,341 ---- } + int + aedFont::getIndexToFirstChar(SDL_Surface * s, Sint16& x,const char *str) + { + SDL_Rect dst; + int nTextLenght = strlen(str); + aedRect cliprect; + SDL_Rect src = {0,0,s->w,s->h}; + unsigned char ch; + dst.x = x; + dst.y = 0; + dst.h = 10; + for(int i=0;i<nTextLenght;++i) + { + ch = (unsigned char)(str[i])-charoffset; + dst.w = charVector[ch].blendedSurface->w; + if(cliprect.intersectRect(dst,src)) + { + x = dst.x; + fprintf(stdout,"X: %d Index %d\n",x,i); + return i; + } + //dst = cliprect.getSDLRect(); + dst.x+=charVector[ch].advance; + }; + return -1; + } + int aedFont::getCharXOffset(const char *str,int index) { int nTextLenght = strlen(str); ! //if (nTextLenght<index) return -1; int xoffset = 0; unsigned char ch; *************** *** 319,325 **** xoffset+=charVector[ch].advance; }; ! return -1; // this should not happen but prevents the event in which ! // it could happen plus avoids a warning about not all paths ! // of execution returning a value in MSVC }; --- 346,350 ---- xoffset+=charVector[ch].advance; }; ! return xoffset; }; |
From: Rodrigo H. <kw...@us...> - 2004-05-24 17:42:54
|
Update of /cvsroot/aedgui/aedGUI/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6774/test Modified Files: main.cpp Log Message: Fixed Problem with ASCII extended set crashing applications Index: main.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/test/main.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** main.cpp 22 May 2004 21:07:02 -0000 1.55 --- main.cpp 24 May 2004 17:42:43 -0000 1.56 *************** *** 267,271 **** staticText1.create(&desktop, aedRect(400, 380, 175, 60), ! "aedGUI test application. http://aedgui.sf.net/ blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah"); staticText1.setJustification(AED_JUST_RIGHT); staticText1.setWordWrap(true); --- 267,271 ---- staticText1.create(&desktop, aedRect(400, 380, 175, 60), ! "aedGUI test application. http://aedgui.sf.net/ Ññáéíóú¿"); staticText1.setJustification(AED_JUST_RIGHT); staticText1.setWordWrap(true); |
From: Rodrigo H. <kw...@us...> - 2004-05-24 17:42:53
|
Update of /cvsroot/aedgui/aedGUI/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6774/src Modified Files: aedFont.cpp Log Message: Fixed Problem with ASCII extended set crashing applications Index: aedFont.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedFont.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** aedFont.cpp 22 May 2004 19:28:08 -0000 1.17 --- aedFont.cpp 24 May 2004 17:42:42 -0000 1.18 *************** *** 12,17 **** data = NULL; ! charcount = 224; ! charoffset = 32; } --- 12,17 ---- data = NULL; ! charcount = 255; ! charoffset = 0; } *************** *** 150,167 **** aedRect cliprect; SDL_Rect src = {0,0,s->w,s->h}; dst.x = x; dst.y = y; for(int i=0;i<nTextLenght;++i) { ! dst.w = charVector[str[i]-charoffset].solidSurface->w; ! dst.h = charVector[str[i]-charoffset].solidSurface->h; if(!cliprect.intersectRect(dst,src)) return i; dst = cliprect.getSDLRect(); ! if(charVector[str[i]-charoffset].solidColor != color) { // Borrowed the following from SDL_ttf.c palette = ! charVector[str[i]-charoffset].solidSurface->format->palette; palette->colors[0].r = 255 - color.getR(); palette->colors[0].g = 255 - color.getG(); --- 150,169 ---- aedRect cliprect; SDL_Rect src = {0,0,s->w,s->h}; + unsigned char ch; dst.x = x; dst.y = y; for(int i=0;i<nTextLenght;++i) { ! ch = (unsigned char)(str[i])-charoffset; ! dst.w = charVector[ch].solidSurface->w; ! dst.h = charVector[ch].solidSurface->h; if(!cliprect.intersectRect(dst,src)) return i; dst = cliprect.getSDLRect(); ! if(charVector[ch].solidColor != color) { // Borrowed the following from SDL_ttf.c palette = ! charVector[ch].solidSurface->format->palette; palette->colors[0].r = 255 - color.getR(); palette->colors[0].g = 255 - color.getG(); *************** *** 170,180 **** palette->colors[1].g = color.getG(); palette->colors[1].b = color.getB(); ! SDL_SetColorKey(charVector[str[i]-charoffset].solidSurface, SDL_SRCCOLORKEY, 0); ! charVector[str[i]-charoffset].solidColor = color; } ! dst.y = y+charVector[str[i]-charoffset].yoffset; ! SDL_BlitSurface(charVector[str[i]-charoffset].solidSurface, NULL, s, &dst); ! dst.x+=charVector[str[i]-charoffset].advance; }; return nTextLenght; --- 172,182 ---- palette->colors[1].g = color.getG(); palette->colors[1].b = color.getB(); ! SDL_SetColorKey(charVector[ch].solidSurface, SDL_SRCCOLORKEY, 0); ! charVector[ch].solidColor = color; } ! dst.y = y+charVector[ch].yoffset; ! SDL_BlitSurface(charVector[ch].solidSurface, NULL, s, &dst); ! dst.x+=charVector[ch].advance; }; return nTextLenght; *************** *** 187,196 **** SDL_Rect dst; SDL_Surface *srf; - // SDL_Palette *palette; int nTextLenght = strlen(str); // no need to call slow strlen more than once ! // int rdiff; ! // int gdiff; ! // int bdiff; Uint32 *pixel; Uint32 uColor = --- 189,195 ---- SDL_Rect dst; SDL_Surface *srf; int nTextLenght = strlen(str); // no need to call slow strlen more than once ! unsigned char ch; Uint32 *pixel; Uint32 uColor = *************** *** 206,217 **** for(int i=0;i<nTextLenght;++i) { ! shaderect.w = dst.w = charVector[str[i]-charoffset].advance; ! dst.h = charVector[str[i]-charoffset].blendedSurface->h; if(!cliprect.intersectRect(dst,src)) return i; dst = cliprect.getSDLRect(); ! if(charVector[str[i]-charoffset].blendedColor != fg) { ! srf = charVector[str[i]-charoffset].blendedSurface; SDL_LockSurface(srf); pixel = (Uint32*) srf->pixels; --- 205,217 ---- for(int i=0;i<nTextLenght;++i) { ! ch = (unsigned char)(str[i])-charoffset; ! shaderect.w = dst.w = charVector[ch].advance; ! dst.h = charVector[ch].blendedSurface->h; if(!cliprect.intersectRect(dst,src)) return i; dst = cliprect.getSDLRect(); ! if(charVector[ch].blendedColor != fg) { ! srf = charVector[ch].blendedSurface; SDL_LockSurface(srf); pixel = (Uint32*) srf->pixels; *************** *** 222,234 **** }; SDL_UnlockSurface(srf); ! charVector[str[i]-charoffset].blendedColor = fg; } ! dst.y = y+charVector[str[i]-charoffset].yoffset; SDL_FillRect(s, &shaderect,bg.getUint32(s)); ! SDL_BlitSurface(charVector[str[i]-charoffset].blendedSurface, NULL, s, &dst); ! dst.x+=charVector[str[i]-charoffset].advance; shaderect.x = dst.x; }; --- 222,234 ---- }; SDL_UnlockSurface(srf); ! charVector[ch].blendedColor = fg; } ! dst.y = y+charVector[ch].yoffset; SDL_FillRect(s, &shaderect,bg.getUint32(s)); ! SDL_BlitSurface(charVector[ch].blendedSurface, NULL, s, &dst); ! dst.x+=charVector[ch].advance; shaderect.x = dst.x; }; *************** *** 245,248 **** --- 245,249 ---- aedRect cliprect; SDL_Rect src = {0,0,s->w,s->h}; + unsigned char ch; dst.x = x; dst.y = y; *************** *** 255,266 **** for(int i=0;i<nTextLenght;++i) { ! dst.w = charVector[str[i]-charoffset].blendedSurface->w; ! dst.h = charVector[str[i]-charoffset].blendedSurface->h; if(!cliprect.intersectRect(dst,src)) return i; dst = cliprect.getSDLRect(); ! if(charVector[str[i]-charoffset].blendedColor != color) { ! srf = charVector[str[i]-charoffset].blendedSurface; SDL_LockSurface(srf); pixel = (Uint32*) srf->pixels; --- 256,268 ---- for(int i=0;i<nTextLenght;++i) { ! ch = (unsigned char)(str[i])-charoffset; ! dst.w = charVector[ch].blendedSurface->w; ! dst.h = charVector[ch].blendedSurface->h; if(!cliprect.intersectRect(dst,src)) return i; dst = cliprect.getSDLRect(); ! if(charVector[ch].blendedColor != color) { ! srf = charVector[ch].blendedSurface; SDL_LockSurface(srf); pixel = (Uint32*) srf->pixels; *************** *** 271,279 **** }; SDL_UnlockSurface(srf); ! charVector[str[i]-charoffset].blendedColor = color; } ! dst.y = y+charVector[str[i]-charoffset].yoffset; ! SDL_BlitSurface(charVector[str[i]-charoffset].blendedSurface, NULL, s, &dst); ! dst.x+=charVector[str[i]-charoffset].advance; }; return nTextLenght; --- 273,281 ---- }; SDL_UnlockSurface(srf); ! charVector[ch].blendedColor = color; } ! dst.y = y+charVector[ch].yoffset; ! SDL_BlitSurface(charVector[ch].blendedSurface, NULL, s, &dst); ! dst.x+=charVector[ch].advance; }; return nTextLenght; *************** *** 287,302 **** aedRect cliprect; SDL_Rect src = {0,0,s->w,s->h}; dst.x = x; dst.y = y; for(int i=0;i<nTextLenght;++i) { ! dst.w = charVector[str[i]-charoffset].blendedSurface->w; ! dst.h = charVector[str[i]-charoffset].blendedSurface->h; // take into account half chars if((!cliprect.intersectRect(dst,src))||(cliprect.getWidth()!=dst.w)) return i; dst = cliprect.getSDLRect(); ! dst.y = y+charVector[str[i]-charoffset].yoffset; ! dst.x+=charVector[str[i]-charoffset].advance; }; return nTextLenght; --- 289,306 ---- aedRect cliprect; SDL_Rect src = {0,0,s->w,s->h}; + unsigned char ch; dst.x = x; dst.y = y; for(int i=0;i<nTextLenght;++i) { ! ch = (unsigned char)(str[i])-charoffset; ! dst.w = charVector[ch].blendedSurface->w; ! dst.h = charVector[ch].blendedSurface->h; // take into account half chars if((!cliprect.intersectRect(dst,src))||(cliprect.getWidth()!=dst.w)) return i; dst = cliprect.getSDLRect(); ! dst.y = y+charVector[ch].yoffset; ! dst.x+=charVector[ch].advance; }; return nTextLenght; *************** *** 308,315 **** if (nTextLenght<index) return -1; int xoffset = 0; for(int i=0;i<nTextLenght;++i) { if (i==index) return xoffset; ! xoffset+=charVector[str[i]-charoffset].advance; }; return -1; // this should not happen but prevents the event in which --- 312,321 ---- if (nTextLenght<index) return -1; int xoffset = 0; + unsigned char ch; for(int i=0;i<nTextLenght;++i) { + ch = (unsigned char)(str[i])-charoffset; if (i==index) return xoffset; ! xoffset+=charVector[ch].advance; }; return -1; // this should not happen but prevents the event in which *************** *** 321,325 **** aedFont::generateFontVector() { ! char ch; // these Colors are not randomly selected // in OpenGL these will help us get proper --- 327,331 ---- aedFont::generateFontVector() { ! Uint16 ch; // these Colors are not randomly selected // in OpenGL these will help us get proper |
From: Rodrigo H. <kw...@us...> - 2004-05-22 21:07:11
|
Update of /cvsroot/aedgui/aedGUI/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7387/test Modified Files: main.cpp Log Message: Removed SDL_Delay(30) from aedGuiTest for acurate FPS Index: main.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/test/main.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** main.cpp 21 May 2004 13:48:30 -0000 1.54 --- main.cpp 22 May 2004 21:07:02 -0000 1.55 *************** *** 332,336 **** desktop.renderAll(); Cursor.render(); ! SDL_Delay(30); } --- 332,336 ---- desktop.renderAll(); Cursor.render(); ! //SDL_Delay(30); } |
From: Rodrigo H. <kw...@us...> - 2004-05-22 19:28:17
|
Update of /cvsroot/aedgui/aedGUI/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21721/src Modified Files: aedFont.cpp aedTextBox.cpp Log Message: Fixed crashing bug when selecting text, changed Selected text rendering code Index: aedTextBox.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedTextBox.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** aedTextBox.cpp 21 May 2004 13:48:30 -0000 1.36 --- aedTextBox.cpp 22 May 2004 19:28:08 -0000 1.37 *************** *** 166,169 **** --- 166,186 ---- m_ShowCaret = true; } + if((event.mod & KMOD_SHIFT)) + { + if (!m_Selecting) + { + m_Selecting = true; + setSelection(m_CaretPos + 1, m_CaretPos); + } + else + { + setSelectionEnd(m_CaretPos); + } + } + else + { + m_Selecting = false; + setSelection(0, 0); + } processed = true; break; *************** *** 179,182 **** --- 196,216 ---- m_ShowCaret = true; } + if((event.mod & KMOD_SHIFT)) + { + if (!m_Selecting) + { + m_Selecting = true; + setSelection(m_CaretPos - 1, m_CaretPos); + } + else + { + setSelectionEnd(m_CaretPos); + } + } + else + { + m_Selecting = false; + setSelection(0, 0); + } processed = true; break; *************** *** 187,190 **** --- 221,241 ---- /* Fall through */ case SDLK_HOME: + if((event.mod & KMOD_SHIFT)) + { + if (!m_Selecting) + { + m_Selecting = true; + setSelection(m_CaretPos, 0); + } + else + { + setSelectionEnd(0); + } + } + else + { + m_Selecting = false; + setSelection(0, 0); + } m_CaretPos = 0; processed = true; *************** *** 196,199 **** --- 247,267 ---- /* Fall through */ case SDLK_END: + if((event.mod & KMOD_SHIFT)) + { + if (!m_Selecting) + { + m_Selecting = true; + setSelection(m_CaretPos, int (m_Caption.size())); + } + else + { + setSelectionEnd(int (m_Caption.size())); + } + } + else + { + m_Selecting = false; + setSelection(0, 0); + } m_CaretPos = int (m_Caption.size()); processed = true; *************** *** 217,220 **** --- 285,289 ---- m_Caption.erase(m_Caption.begin() + m_CaretPos); } + m_Selecting = false; processed = true; break; *************** *** 236,239 **** --- 305,309 ---- m_Caption.erase(m_Caption.begin() + m_CaretPos); } + m_Selecting = false; processed = true; break; *************** *** 246,249 **** --- 316,320 ---- m_CaretPos = 0; setSelection(0, 0); + m_Selecting = false; processed = true; break; *************** *** 275,278 **** --- 346,350 ---- setSelection(0, 0); } + m_Selecting = false; processed = true; break; *************** *** 298,301 **** --- 370,374 ---- } } + m_Selecting = false; processed = true; break; *************** *** 305,309 **** } ! if(!processed && isprint(key)) { if(SelectStart != SelectEnd) --- 378,383 ---- } ! //if(!processed && isprint(key)) ! if(!processed && key) { if(SelectStart != SelectEnd) *************** *** 313,316 **** --- 387,391 ---- m_CaretPos = SelectStart; setSelection(0, 0); + m_Selecting = false; } // FIXME: This doesn't handle wide characters *************** *** 329,333 **** aedTextBox::render(void) { ! //SDL_Surface *s1 = NULL; SDL_Rect src = { 0, 0, 0, 0 --- 404,408 ---- aedTextBox::render(void) { ! //SDL_Surface *s1 = NULL; SDL_Rect src = { 0, 0, 0, 0 *************** *** 336,340 **** 0, 0, m_Surface->w, m_Surface->h }; ! std::string temp1, temp2, pass; Uint16 width1, height1, width2, height2; --- 411,415 ---- 0, 0, m_Surface->w, m_Surface->h }; ! std::string temp1, temp2, pass, selected; Uint16 width1, height1, width2, height2; *************** *** 369,417 **** thisColor.setA(this->getAlphaValue()); - //s1 = m_Font->renderTextBlended(m_Caption.c_str(), thisColor); - - if(m_SelectionStart != m_SelectionEnd) - { - Uint16 SelectionStartX, SelectionWidth; - Uint16 SelectionBoxHeight; - - Uint32 SelectStart = m_SelectionStart; - Uint32 SelectEnd = m_SelectionEnd; - - if(SelectStart > SelectEnd) - std::swap(SelectStart, SelectEnd); - - std::string BeforeSelection(m_Caption.substr(0, SelectStart)); - std::string SelectedText(m_Caption. - substr(SelectStart, SelectEnd - SelectStart)); - - m_Font->getTextSize(BeforeSelection.c_str(), &SelectionStartX, - &SelectionBoxHeight); - m_Font->getTextSize(SelectedText.c_str(), &SelectionWidth, - &SelectionBoxHeight); - - aedColor SelectColor(0, 0, 200, 255); // TODO: This needs to come from the theme - - void* screenORrect = NULL; - aedRect rect; - if(pApp->usesOpenGL()) - { - rect = getRealPos(); - screenORrect = ▭ - } - else - { - //screenORrect = s1; - } - - //SLOCK(s1); // TODO: What should selected text look like? - int x2 = SelectionStartX + SelectionWidth - 1; - - if(x2 >= width1) - x2 = width1 - 1; - DrawRect(screenORrect, SelectionStartX, 0, x2, SelectionBoxHeight - 1, - SelectColor); - //SUNLOCK(s1); - } dest.x += cPad + 1; --- 444,447 ---- *************** *** 454,459 **** m_Caption.c_str(), thisColor); ! //SDL_BlitSurface(s1, &src, m_Surface, &dest); ! //SDL_FreeSurface(s1); } --- 484,504 ---- m_Caption.c_str(), thisColor); ! if(m_SelectionStart != m_SelectionEnd) ! { ! Uint32 SelectStart = m_SelectionStart; ! Uint32 SelectEnd = m_SelectionEnd; ! aedColor SelectedColor = m_BGColor;//(0, 0, 200, 255); ! aedColor InvertedthisColor = thisColor; ! InvertedthisColor.invertRGB(); ! SelectedColor.invertRGB(); ! if(SelectStart > SelectEnd) ! std::swap(SelectStart, SelectEnd); ! selected = m_Caption.substr(SelectStart, SelectEnd - SelectStart); ! m_Font->renderTextShaded(m_Surface, ! dest.x+m_Font->getCharXOffset(m_Caption.c_str(),SelectStart), ! dest.y, ! selected.c_str(), ! InvertedthisColor,SelectedColor); ! } } Index: aedFont.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedFont.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** aedFont.cpp 21 May 2004 13:48:30 -0000 1.16 --- aedFont.cpp 22 May 2004 19:28:08 -0000 1.17 *************** *** 303,306 **** --- 303,321 ---- } + int aedFont::getCharXOffset(const char *str,int index) + { + int nTextLenght = strlen(str); + if (nTextLenght<index) return -1; + int xoffset = 0; + for(int i=0;i<nTextLenght;++i) + { + if (i==index) return xoffset; + xoffset+=charVector[str[i]-charoffset].advance; + }; + return -1; // this should not happen but prevents the event in which + // it could happen plus avoids a warning about not all paths + // of execution returning a value in MSVC + }; + void aedFont::generateFontVector() |
From: Rodrigo H. <kw...@us...> - 2004-05-22 19:28:16
|
Update of /cvsroot/aedgui/aedGUI/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21721/include Modified Files: aedColor.h aedFont.h Log Message: Fixed crashing bug when selecting text, changed Selected text rendering code Index: aedColor.h =================================================================== RCS file: /cvsroot/aedgui/aedGUI/include/aedColor.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** aedColor.h 21 May 2004 13:48:29 -0000 1.7 --- aedColor.h 22 May 2004 19:28:08 -0000 1.8 *************** *** 91,94 **** --- 91,110 ---- return SDL_MapRGBA(surface->format, r, g, b, a); } + /*! invertRGB + Inverts the Red,Green and Blue Values + */ + void invertRGB() + { + r = 255 - r; + g = 255 - g; + b = 255 - b; + }; + /*! invertA + Inverts the Alpha Value + */ + void invertA() + { + a = 255 - a; + }; operator SDL_Color() const { Index: aedFont.h =================================================================== RCS file: /cvsroot/aedgui/aedGUI/include/aedFont.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** aedFont.h 21 May 2004 13:48:29 -0000 1.14 --- aedFont.h 22 May 2004 19:28:08 -0000 1.15 *************** *** 160,163 **** --- 160,175 ---- */ int getMaxCharLen(SDL_Surface * s, int x, int y, const char *str); + + #ifndef _MSC_VER + DLLEXPORT + #endif + /*! getCharXOffset + returns the Y offset the character at position "index" would be rendered on the string "str". + \param str String to check + \param index Index to the character inside the string to retrieve the X Offset for. + \return Returns the X Offset in pixels to the character at index or -1 if index exceeds the size of str + */ + int getCharXOffset(const char *str,int index); + static Uint16 getUnicode(const char *utf8, int *advance) { |
From: Rodrigo H. <kw...@us...> - 2004-05-21 15:07:01
|
Update of /cvsroot/aedgui/aedGUI/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7380 Modified Files: aedStaticText.cpp Added Files: aedRect.cpp Log Message: aedFont now uses a vector of surfaces for text rendering Index: aedStaticText.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedStaticText.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** aedStaticText.cpp 21 May 2004 14:24:23 -0000 1.36 --- aedStaticText.cpp 21 May 2004 15:06:51 -0000 1.37 *************** *** 121,126 **** for(;;) { - // the following doesn't quite work - // yet temp2 = temp.substr(0,m_Font->getMaxCharLen(m_Surface, dest.x, --- 121,124 ---- --- NEW FILE: aedRect.cpp --- #include "aedRect.h" bool aedRect::intersectRect(const SDL_Rect& rect1, const SDL_Rect& rect2) { //This function was taken and modified from ParaGUI int px0,py0,px1,py1; int cx0,cy0,cx1,cy1; int rx0,ry0,rx1,ry1; // get coordinates of the rectangles px0 = rect1.x; py0 = rect1.y; px1 = rect1.x + rect1.w - 1; py1 = rect1.y + rect1.h - 1; cx0 = rect2.x; cy0 = rect2.y; cx1 = rect2.x + rect2.w - 1; cy1 = rect2.y + rect2.h - 1; // check if the rectangles intersect if(/*(cx0 < px0) && */(cx1 < px0)) return false; if((cx0 > px1) /*&& (cx1 > px1)*/) return false; if(/*(cy0 < py0) && */(cy1 < py0)) return false; if((cy0 > py1) /*&& (cy1 > py1)*/) return false; // intersect x if(cx0 <= px0) rx0 = px0; else rx0 = cx0; if(cx1 >= px1) rx1 = px1; else rx1 = cx1; // intersect y if(cy0 <= py0) ry0 = py0; else ry0 = cy0; if(cy1 >= py1) ry1 = py1; else ry1 = cy1; // fill in result rect m_X = rx0; m_Y = ry0; m_W = (rx1-rx0)+1; m_H = (ry1-ry0)+1; return true; }; |
From: Rodrigo H. <kw...@us...> - 2004-05-21 14:24:31
|
Update of /cvsroot/aedgui/aedGUI/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31255/src Modified Files: aedStaticText.cpp Log Message: aedFont now uses a vector of surfaces for text rendering Index: aedStaticText.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedStaticText.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** aedStaticText.cpp 21 May 2004 14:13:55 -0000 1.35 --- aedStaticText.cpp 21 May 2004 14:24:23 -0000 1.36 *************** *** 80,86 **** SDL_Rect src, dest; ! size_t startPos = 0, endPos = 0; ! Uint16 line = 0, width = 0, height = 0; ! size_t x; std::string temp,temp2; --- 80,85 ---- SDL_Rect src, dest; ! size_t startPos = 0; ! Uint16 width = 0, height = 0; std::string temp,temp2; *************** *** 163,167 **** dest.y, m_Caption.c_str(), ! thisColor) } } --- 162,166 ---- dest.y, m_Caption.c_str(), ! thisColor); } } |
From: Rodrigo H. <kw...@us...> - 2004-05-21 14:14:04
|
Update of /cvsroot/aedgui/aedGUI/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29252/src Modified Files: aedStaticText.cpp Log Message: aedFont now uses a vector of surfaces for text rendering Index: aedStaticText.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedStaticText.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** aedStaticText.cpp 21 May 2004 13:48:30 -0000 1.34 --- aedStaticText.cpp 21 May 2004 14:13:55 -0000 1.35 *************** *** 122,125 **** --- 122,127 ---- for(;;) { + // the following doesn't quite work + // yet temp2 = temp.substr(0,m_Font->getMaxCharLen(m_Surface, dest.x, *************** *** 157,160 **** --- 159,167 ---- else if(m_Justification == AED_JUST_CENTER) dest.x = myPos.getX() + int ((myPos.getWidth() - dest.w) / 2); + m_Font->renderTextBlended(m_Surface, + dest.x, + dest.y, + m_Caption.c_str(), + thisColor) } } |
Update of /cvsroot/aedgui/aedGUI/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23670/src Modified Files: Makefile.am aedFont.cpp aedListBox.cpp aedMenu.cpp aedMenuBar.cpp aedStaticRTF.cpp aedStaticText.cpp aedTextBox.cpp Log Message: aedFont now uses a vector of surfaces for text rendering Index: aedStaticRTF.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedStaticRTF.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** aedStaticRTF.cpp 6 Nov 2003 18:46:36 -0000 1.6 --- aedStaticRTF.cpp 21 May 2004 13:48:30 -0000 1.7 *************** *** 4,7 **** --- 4,12 ---- #ifdef HAVE_SDL_RTF + #include "SDL_ttf.h" + #ifndef HAVE_SDL_TTF + #include "SDL_ttf.c" + #endif + #include "SDL_rtf.h" *************** *** 63,69 **** RenderText(void *_font, const char *text, SDL_Color fg) { ! aedFont *font = (aedFont *) _font; ! ! return font->renderTextBlended(text, aedColor(fg.r, fg.g, fg.b, 255)); } --- 68,76 ---- RenderText(void *_font, const char *text, SDL_Color fg) { ! // Moved this from the renderTextBlended Function that was removed ! if(pApp->getUTF8()) ! return TTF_RenderUTF8_Blended(((aedFont*)_font)->getTTFFont(), text, fg); ! else ! return TTF_RenderText_Blended(((aedFont*)_font)->getTTFFont(), text, fg); } Index: aedMenu.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedMenu.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** aedMenu.cpp 6 Nov 2003 18:46:36 -0000 1.7 --- aedMenu.cpp 21 May 2004 13:48:30 -0000 1.8 *************** *** 37,43 **** aedMenu::render() { ! SDL_Surface *s; SDL_Rect dst; ! dst.x = 4; dst.y = SPACING; --- 37,44 ---- aedMenu::render() { ! //SDL_Surface *s; SDL_Rect dst; ! Uint16 width; ! Uint16 height; dst.x = 4; dst.y = SPACING; *************** *** 51,59 **** 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 = ! CreateSurface(SDL_SWSURFACE, m_Surface->w - 8, s->h); SDL_FillRect(bg, NULL, SDL_MapRGBA(bg->format, 0, 0, 255, 255)); SDL_SetAlpha(bg, SDL_SRCALPHA, 170); --- 52,62 ---- color = aedColor(255, 255, 255, 255); ! //s = m_Font->renderTextBlended(m_Items[i].caption.c_str(), color); ! m_Font->getTextSize(m_Items[i].caption.c_str(), &width, &height); ! if((int) i == m_Highlight) { SDL_Surface *bg = ! CreateSurface(SDL_SWSURFACE, m_Surface->w - 8, height); SDL_FillRect(bg, NULL, SDL_MapRGBA(bg->format, 0, 0, 255, 255)); SDL_SetAlpha(bg, SDL_SRCALPHA, 170); *************** *** 61,68 **** SDL_FreeSurface(bg); } ! SDL_BlitSurface(s, NULL, m_Surface, &dst); ! dst.y += s->h + SPACING; ! SDL_FreeSurface(s); } } --- 64,77 ---- SDL_FreeSurface(bg); } + + m_Font->renderTextBlended(m_Surface, + dst.x, + dst.y, + m_Items[i].caption.c_str(), + color); ! //SDL_BlitSurface(s, NULL, m_Surface, &dst); ! dst.y += height + SPACING; ! //SDL_FreeSurface(s); } } Index: Makefile.am =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/Makefile.am,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Makefile.am 16 Apr 2004 01:29:56 -0000 1.34 --- Makefile.am 21 May 2004 13:48:30 -0000 1.35 *************** *** 46,49 **** aedSizer.cpp \ aedBoxSizer.cpp \ ! aedClipboard.cpp --- 46,50 ---- aedSizer.cpp \ aedBoxSizer.cpp \ ! aedClipboard.cpp \ ! aedRect.cpp Index: aedListBox.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedListBox.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** aedListBox.cpp 22 Mar 2004 20:35:05 -0000 1.20 --- aedListBox.cpp 21 May 2004 13:48:30 -0000 1.21 *************** *** 142,152 **** aedListBox::del(int line) { ! // CHANGE- reset values for when information changes ! m_currentLine = 0; ! m_currentLineBase = 0; ! resetScrollBar(); ! m_VScrollBar->enable(true); ! //-- ! m_Strings.erase(m_Strings.begin() + line); m_ReRender = true; --- 142,151 ---- aedListBox::del(int line) { ! // CHANGE- reset values for when information changes ! m_currentLine = 0; ! m_currentLineBase = 0; ! resetScrollBar(); ! m_VScrollBar->enable(true); ! //-- m_Strings.erase(m_Strings.begin() + line); m_ReRender = true; *************** *** 201,323 **** aedListBox::render(void) { ! aedRect myPos(0, 0, m_Surface->w, m_Surface->h); ! SDL_Surface *s1 = NULL; ! SDL_Rect src, dest; ! Uint16 line; ! Uint32 scrollRange; ! Uint16 prevHeight; ! ! // CHANGE ! // FIXME- for some reason, this is geting reset to 0 after del() is called ! if (m_Strings.size() == 0) { return; } ! //-- ! ! myPos.setX(myPos.getX() + (cPad * 2)); ! myPos.setY(myPos.getY() + cPad); ! myPos.setWidth(myPos.getWidth() - (2 * cPad * 2)); ! myPos.setHeight(myPos.getHeight() - (2 * cPad)); ! ! // Calculating the actual LinesMax, according to the actual font height set ! m_maxLinesInTheBox = (Uint16)(myPos.getHeight()/(Sint32)m_Font->getHeight()); ! if(m_maxLinesInTheBox > m_Strings.size()) { ! m_maxLinesInTheBox = m_Strings.size(); ! } ! if(m_maxLinesInTheBox < 1) { ! m_maxLinesInTheBox = 1; } ! ! // Setting the actual range of the m_ScrollBar ! if(m_Strings.size() - m_maxLinesInTheBox > 0) { ! scrollRange = m_Strings.size() - m_maxLinesInTheBox; ! } else { ! scrollRange = 2; } ! m_VScrollBar->setRange(0, scrollRange); ! ! // Showing the scrollbar when it's neccessary ! if(m_VScrollBar) { ! if(m_maxLinesInTheBox < m_Strings.size()) { ! if(!m_VScrollBar->isVisible()) { ! m_VScrollBar->enable(true); ! m_VScrollBar->show(); ! } ! } else if (m_VScrollBar->isVisible()) { ! m_VScrollBar->hide(); ! m_VScrollBar->enable(false); ! } ! } ! ! //Workaround ! if(isEnabled()) { m_VScrollBar->enable(true); } ! else { m_VScrollBar->enable(false); } ! //--- ! src.x = 0; src.y = 0; dest.x = myPos.getX(); dest.y = myPos.getY(); ! ! for(line = m_currentLineBase; line<m_currentLineBase+m_maxLinesInTheBox;line++) { ! if(m_Strings[line] != "") { ! if(isEnabled()) { ! aedColor thisColor = aedColor(0, 0, 0, 255); ! aedColor thisBgColor; ! ! if(hasFocus()) { thisBgColor = aedColor(200, 0, 0, 255); } ! else { thisBgColor = aedColor(0, 200, 0, 255); } ! ! thisBgColor.setA(this->getAlphaValue()); thisColor.setA(this->getAlphaValue()); ! ! if (line == m_currentLine) { ! // this is the Chosen One ;) ! s1 = m_Font->renderTextShaded(m_Strings[line].c_str(), ! thisColor, ! thisBgColor); ! dest.w=myPos.getWidth(); ! dest.h=s1->h; ! ! // It is very ugly but simple and fast! ! SDL_FillRect(m_Surface, &dest, thisBgColor.getUint32(m_Surface)); ! } else { ! s1 = m_Font->renderTextBlended(m_Strings[line].c_str(), ! thisColor); ! } ! } else { ! 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; } ! ! // FIXME- Hack to prevent problem with dest.h getting overwritten in ! // SDL_BlitSurface call... ! prevHeight = dest.h; ! //-- ! ! SDL_BlitSurface(s1, &src, m_Surface, &dest); ! SDL_FreeSurface(s1); ! ! // FIXME- Continuation of the hack mentioned above ! if (dest.h != prevHeight) { dest.h = prevHeight; } ! //-- ! ! dest.y += dest.h + 1; ! } ! ! } m_RowHeight = dest.h + 1; } --- 200,322 ---- aedListBox::render(void) { ! aedRect myPos(0, 0, m_Surface->w, m_Surface->h); ! //SDL_Surface *s1 = NULL; ! SDL_Rect src, dest; ! Uint16 line = 0, width = 0, height = 0; ! Uint32 scrollRange; ! // these should really be members ! aedColor thisColor; ! aedColor thisBgColor; ! ! // CHANGE ! // FIXME- for some reason, this is geting reset to 0 after del() is called ! if (m_Strings.size() == 0) { return; } ! //-- ! ! myPos.setX(myPos.getX() + (cPad * 2)); ! myPos.setY(myPos.getY() + cPad); ! myPos.setWidth(myPos.getWidth() - (2 * cPad * 2)); ! myPos.setHeight(myPos.getHeight() - (2 * cPad)); ! ! // Calculating the actual LinesMax, according to the actual font height set ! m_maxLinesInTheBox = (Uint16)(myPos.getHeight()/(Sint32)m_Font->getHeight()); ! if(m_maxLinesInTheBox > m_Strings.size()) ! { ! m_maxLinesInTheBox = m_Strings.size(); ! } ! if(m_maxLinesInTheBox < 1) ! { ! m_maxLinesInTheBox = 1; ! } ! ! // Setting the actual range of the m_ScrollBar ! if(m_Strings.size() - m_maxLinesInTheBox > 0) ! { ! scrollRange = m_Strings.size() - m_maxLinesInTheBox; ! } ! else ! { ! scrollRange = 2; ! } ! m_VScrollBar->setRange(0, scrollRange); ! ! // Showing the scrollbar when it's neccessary ! if(m_VScrollBar) ! { ! if(m_maxLinesInTheBox < m_Strings.size()) ! { ! if(!m_VScrollBar->isVisible()) ! { ! m_VScrollBar->enable(true); ! m_VScrollBar->show(); ! } } ! else if (m_VScrollBar->isVisible()) ! { ! m_VScrollBar->hide(); ! m_VScrollBar->enable(false); } ! } ! ! //Workaround ! if(isEnabled()) { m_VScrollBar->enable(true); } ! else { m_VScrollBar->enable(false); } ! //--- ! src.x = 0; src.y = 0; dest.x = myPos.getX(); dest.y = myPos.getY(); ! ! for(line = m_currentLineBase; ! line<m_currentLineBase+m_maxLinesInTheBox; ! ++line) ! { ! if(m_Strings[line] != "") ! { ! m_Font->getTextSize(m_Strings[line].c_str(), &width, &height); ! if(isEnabled()) ! { ! thisColor = aedColor(0, 0, 0, 255); ! if(hasFocus()) { thisBgColor = aedColor(200, 0, 0, 255); } ! else { thisBgColor = aedColor(0, 200, 0, 255); } ! ! thisBgColor.setA(this->getAlphaValue()); thisColor.setA(this->getAlphaValue()); ! ! if (line == m_currentLine) ! { ! // this is the Chosen One ;) ! // s1 = m_Font->renderTextShaded(m_Strings[line].c_str(), ! // thisColor, ! // thisBgColor); ! dest.w=myPos.getWidth(); ! dest.h=height; ! ! // It is very ugly but simple and fast! ! SDL_FillRect(m_Surface, &dest, thisBgColor.getUint32(m_Surface)); ! } ! } ! else ! { ! thisColor = aedColor(130, ! 130, ! 130, ! this->getAlphaValue()); ! } ! src.w = myPos.getWidth(); ! src.h = height; ! 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; ! } ! m_Font->renderTextBlended(m_Surface,dest.x,dest.y,m_Strings[line].c_str(),thisColor); ! dest.y += dest.h + 1; ! } ! } m_RowHeight = dest.h + 1; } Index: aedMenuBar.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedMenuBar.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** aedMenuBar.cpp 6 Nov 2003 18:46:36 -0000 1.5 --- aedMenuBar.cpp 21 May 2004 13:48:30 -0000 1.6 *************** *** 52,57 **** { unsigned int i; ! SDL_Surface *s; SDL_Rect dst; // needs centering! --- 52,59 ---- { unsigned int i; ! //SDL_Surface *s; SDL_Rect dst; + Uint16 width; + Uint16 height; // needs centering! *************** *** 65,74 **** color = aedColor(255, 255, 255, 255); ! s = m_Font->renderTextBlended(m_Menus[i]->getCaption().c_str(), color); ! dst.w = s->w; ! dst.h = s->h; if(i == (unsigned) m_Highlight) { ! SDL_Surface *bg = CreateSurface(SDL_SWSURFACE, s->w, s->h); SDL_FillRect(bg, NULL, SDL_MapRGBA(bg->format, 0, 0, 255, 255)); --- 67,78 ---- color = aedColor(255, 255, 255, 255); ! //s = m_Font->renderTextBlended(m_Menus[i]->getCaption().c_str(), color); ! m_Font->getTextSize(m_Menus[i]->getCaption().c_str(), &width, &height); ! ! dst.w = width; ! dst.h = height; if(i == (unsigned) m_Highlight) { ! SDL_Surface *bg = CreateSurface(SDL_SWSURFACE, width, height); SDL_FillRect(bg, NULL, SDL_MapRGBA(bg->format, 0, 0, 255, 255)); *************** *** 78,84 **** } ! SDL_BlitSurface(s, NULL, m_Surface, &dst); ! dst.x += s->w + PADDING; ! SDL_FreeSurface(s); } setRenderState(true); --- 82,94 ---- } ! //SDL_BlitSurface(s, NULL, m_Surface, &dst); ! m_Font->renderTextBlended(m_Surface, ! dst.x, ! dst.y, ! m_Menus[i]->getCaption().c_str(), ! color); ! ! dst.x += width + PADDING; ! //SDL_FreeSurface(s); } setRenderState(true); Index: aedStaticText.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedStaticText.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** aedStaticText.cpp 6 Nov 2003 18:46:36 -0000 1.33 --- aedStaticText.cpp 21 May 2004 13:48:30 -0000 1.34 *************** *** 80,89 **** SDL_Rect src, dest; ! std::string::size_type startPos = 0, endPos = 0; Uint16 line = 0, width = 0, height = 0; size_t x; ! std::string temp; ! SDL_Surface *s1 = NULL; SDL_Rect rect = myPos.getSDLRect(); --- 80,88 ---- SDL_Rect src, dest; ! size_t startPos = 0, endPos = 0; Uint16 line = 0, width = 0, height = 0; size_t x; ! std::string temp,temp2; SDL_Rect rect = myPos.getSDLRect(); *************** *** 98,164 **** thisColor.setA(this->getAlphaValue()); ! s1 = m_Font->renderTextBlended(m_Caption.c_str(), thisColor); src.x = 0; src.y = 0; src.w = myPos.getWidth(); ! src.h = s1->h; dest.x = myPos.getX(); ! dest.y = myPos.getY(); dest.w = src.w; dest.h = src.h; ! // vertical alignment ! m_Font->getTextSize(m_Caption.c_str(), &width, &height); ! if(width <= myPos.getWidth()) ! dest.y = myPos.getY() + int ((myPos.getHeight() - height) / 2); ! ! for(line = 1; endPos < m_Caption.size(); line++) ! { ! if(src.x + src.w > s1->w) ! src.w = s1->w - src.x; ! ! if(dest.y + dest.h > myPos.getY() + myPos.getHeight()) ! break; ! ! endPos = getPosAtPixel(src.x + src.w, src.y) - 1; ! if(endPos < 1) ! break; ! ! temp = m_Caption.substr(startPos, endPos); ! ! if(m_WordWrap) ! { ! for(x = temp.size(); x > 0; x--) ! { ! if(temp.substr(x, 1) == " ") ! { ! endPos = startPos + x + 1; ! temp = temp.substr(startPos, endPos); ! break; ! } ! } ! } ! ! m_Font->getTextSize(temp.c_str(), &width, &height); ! src.w = width; ! dest.w = src.w; ! ! if(m_Justification == AED_JUST_RIGHT) ! dest.x = myPos.getX() + (myPos.getWidth() - dest.w); ! else if(m_Justification == AED_JUST_CENTER) ! dest.x = myPos.getX() + int ((myPos.getWidth() - dest.w) / 2); ! ! SDL_SetAlpha(s1, 0, 0); ! SDL_BlitSurface(s1, &src, m_Surface, &dest); ! ! src.x += src.w; ! src.w = myPos.getWidth(); ! dest.x = myPos.getX(); ! dest.y += dest.h; ! startPos = endPos; ! } ! ! SDL_FreeSurface(s1); } --- 97,160 ---- thisColor.setA(this->getAlphaValue()); ! ! m_Font->getTextSize(m_Caption.c_str(), &width, &height); src.x = 0; src.y = 0; src.w = myPos.getWidth(); ! src.h = height; dest.x = myPos.getX(); ! if(width <= myPos.getWidth()) // Why set dest.y twice? ! { ! dest.y = myPos.getY() + int ((myPos.getHeight() - height) / 2); ! } ! else ! { ! dest.y = myPos.getY(); ! } dest.w = src.w; dest.h = src.h; ! if(m_WordWrap) ! { ! temp = m_Caption; ! for(;;) ! { ! temp2 = temp.substr(0,m_Font->getMaxCharLen(m_Surface, ! dest.x, ! dest.y, ! temp.c_str())); ! temp = temp.substr(temp2.size(),temp.size()-temp2.size()); ! m_Font->getTextSize(temp2.c_str(), &width, &height); ! dest.w = width; ! if(m_Justification == AED_JUST_RIGHT) ! { ! dest.x = myPos.getX() + (myPos.getWidth() - dest.w); ! } ! else if(m_Justification == AED_JUST_CENTER) ! { ! dest.x = myPos.getX() + int ((myPos.getWidth() - dest.w) / 2); ! } ! startPos = m_Font->renderTextBlended(m_Surface, ! dest.x, ! dest.y, ! temp2.c_str(), ! thisColor); ! if((temp.empty())||(startPos==0)) break; ! else dest.y += m_Font->getHeight(); ! } ! } ! else ! { ! // if no WordWrap is needed just render the string, there is code ! // inside renderTextBlended to deal with text clipping, so, ! // no need to do all those nasty calculations here ! m_Font->getTextSize(m_Caption.c_str(), &width, &height); ! dest.w = width; ! if(m_Justification == AED_JUST_RIGHT) ! dest.x = myPos.getX() + (myPos.getWidth() - dest.w); ! else if(m_Justification == AED_JUST_CENTER) ! dest.x = myPos.getX() + int ((myPos.getWidth() - dest.w) / 2); ! } } Index: aedTextBox.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedTextBox.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** aedTextBox.cpp 16 Apr 2004 01:29:56 -0000 1.35 --- aedTextBox.cpp 21 May 2004 13:48:30 -0000 1.36 *************** *** 329,333 **** aedTextBox::render(void) { ! SDL_Surface *s1 = NULL; SDL_Rect src = { 0, 0, 0, 0 --- 329,333 ---- aedTextBox::render(void) { ! //SDL_Surface *s1 = NULL; SDL_Rect src = { 0, 0, 0, 0 *************** *** 369,373 **** thisColor.setA(this->getAlphaValue()); ! s1 = m_Font->renderTextBlended(m_Caption.c_str(), thisColor); if(m_SelectionStart != m_SelectionEnd) --- 369,373 ---- thisColor.setA(this->getAlphaValue()); ! //s1 = m_Font->renderTextBlended(m_Caption.c_str(), thisColor); if(m_SelectionStart != m_SelectionEnd) *************** *** 402,416 **** else { ! screenORrect = s1; } ! SLOCK(s1); // TODO: What should selected text look like? int x2 = SelectionStartX + SelectionWidth - 1; ! if(x2 >= s1->w) ! x2 = s1->w - 1; DrawRect(screenORrect, SelectionStartX, 0, x2, SelectionBoxHeight - 1, SelectColor); ! SUNLOCK(s1); } --- 402,416 ---- else { ! //screenORrect = s1; } ! //SLOCK(s1); // TODO: What should selected text look like? int x2 = SelectionStartX + SelectionWidth - 1; ! if(x2 >= width1) ! x2 = width1 - 1; DrawRect(screenORrect, SelectionStartX, 0, x2, SelectionBoxHeight - 1, SelectColor); ! //SUNLOCK(s1); } *************** *** 420,425 **** dest.h -= cPad * 3; ! if(s1) ! { if(width1 < m_StartPixel) { --- 420,425 ---- dest.h -= cPad * 3; ! if(width1>=0) // don't bother if there's no text ! { if(width1 < m_StartPixel) { *************** *** 433,438 **** m_StartPixel = int (width1 - dest.w + (dest.w / 4)); ! if(m_StartPixel + dest.w > s1->w) ! m_StartPixel = s1->w - dest.w; } --- 433,438 ---- m_StartPixel = int (width1 - dest.w + (dest.w / 4)); ! if(m_StartPixel + dest.w > width1) ! m_StartPixel = width1 - dest.w; } *************** *** 447,455 **** src.x = m_StartPixel; src.y = 0; ! src.h = s1->h; src.w = dest.w; ! SDL_BlitSurface(s1, &src, m_Surface, &dest); ! SDL_FreeSurface(s1); ! } // caret --- 447,460 ---- src.x = m_StartPixel; src.y = 0; ! src.h = height1; src.w = dest.w; ! m_Font->renderTextBlended(m_Surface, ! dest.x, ! dest.y, ! m_Caption.c_str(), ! thisColor); ! //SDL_BlitSurface(s1, &src, m_Surface, &dest); ! //SDL_FreeSurface(s1); ! } // caret Index: aedFont.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedFont.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** aedFont.cpp 23 Nov 2003 18:19:09 -0000 1.15 --- aedFont.cpp 21 May 2004 13:48:30 -0000 1.16 *************** *** 7,13 **** --- 7,17 ---- #endif + aedFont::aedFont() { data = NULL; + + charcount = 224; + charoffset = 32; } *************** *** 21,24 **** --- 25,29 ---- closeFont(); data = TTF_OpenFont(file, pointsize); + generateFontVector(); return (data != NULL); } *************** *** 29,32 **** --- 34,38 ---- closeFont(); this->data = TTF_OpenFontRW(SDL_RWFromMem(data, datasize), 1, pointsize); + generateFontVector(); return (this->data != NULL); } *************** *** 40,43 **** --- 46,50 ---- data = NULL; } + destroyFontVector(); } *************** *** 54,57 **** --- 61,65 ---- // The AED_FONT styles are the same as TTF styles TTF_SetFontStyle(data, style); + generateFontVector(); } *************** *** 105,184 **** } ! SDL_Surface * ! aedFont::renderTextSolid(const char *str, const aedColor & color) ! { ! if(pApp->getUTF8()) ! return TTF_RenderUTF8_Solid(data, str, color); ! else ! return TTF_RenderText_Solid(data, str, color); ! } ! SDL_Surface * ! aedFont::renderTextShaded(const char *str, const aedColor & fg, ! const aedColor & bg) ! { ! if(pApp->getUTF8()) ! return TTF_RenderUTF8_Shaded(data, str, fg, bg); ! else ! return TTF_RenderText_Shaded(data, str, fg, bg); ! } ! SDL_Surface * ! aedFont::renderTextBlended(const char *str, const aedColor & color) ! { ! if(pApp->getUTF8()) ! return TTF_RenderUTF8_Blended(data, str, color); ! else ! return TTF_RenderText_Blended(data, str, color); ! } ! void aedFont::renderTextSolid(SDL_Surface * s, int x, int y, const char *str, ! const aedColor & color) { SDL_Rect dst; ! SDL_Surface *tmp; ! ! tmp = renderTextSolid(str, color); ! if(tmp) ! { ! dst.x = x; ! dst.y = y; ! SDL_BlitSurface(tmp, NULL, s, &dst); ! SDL_FreeSurface(tmp); ! } } ! void aedFont::renderTextShaded(SDL_Surface * s, int x, int y, const char *str, ! const aedColor & fg, const aedColor & bg) { SDL_Rect dst; ! SDL_Surface *tmp; ! ! tmp = renderTextShaded(str, fg, bg); ! if(tmp) ! { ! dst.x = x; ! dst.y = y; ! SDL_BlitSurface(tmp, NULL, s, &dst); ! SDL_FreeSurface(tmp); ! } } ! void aedFont::renderTextBlended(SDL_Surface * s, int x, int y, const char *str, ! const aedColor & color) { SDL_Rect dst; ! SDL_Surface *tmp; ! tmp = renderTextBlended(str, color); ! if(tmp) ! { ! dst.x = x; ! dst.y = y; ! SDL_BlitSurface(tmp, NULL, s, &dst); ! SDL_FreeSurface(tmp); ! } } --- 113,353 ---- } ! // SDL_Surface * ! // aedFont::renderTextSolid(const char *str, const aedColor & color) ! // { ! // if(pApp->getUTF8()) ! // return TTF_RenderUTF8_Solid(data, str, color); ! // else ! // return TTF_RenderText_Solid(data, str, color); ! // } ! // SDL_Surface * ! // aedFont::renderTextShaded(const char *str, const aedColor & fg, ! // const aedColor & bg) ! // { ! // if(pApp->getUTF8()) ! // return TTF_RenderUTF8_Shaded(data, str, fg, bg); ! // else ! // return TTF_RenderText_Shaded(data, str, fg, bg); ! // } ! // SDL_Surface * ! // aedFont::renderTextBlended(const char *str, const aedColor & color) ! // { ! // if(pApp->getUTF8()) ! // return TTF_RenderUTF8_Blended(data, str, color); ! // else ! // return TTF_RenderText_Blended(data, str, color); ! // } ! int aedFont::renderTextSolid(SDL_Surface * s, int x, int y, const char *str, ! aedColor & color) { SDL_Rect dst; ! SDL_Palette *palette; ! int nTextLenght = strlen(str); // no need to call slow strlen more than once ! aedRect cliprect; ! SDL_Rect src = {0,0,s->w,s->h}; ! dst.x = x; ! dst.y = y; ! for(int i=0;i<nTextLenght;++i) ! { ! dst.w = charVector[str[i]-charoffset].solidSurface->w; ! dst.h = charVector[str[i]-charoffset].solidSurface->h; ! if(!cliprect.intersectRect(dst,src)) ! return i; ! dst = cliprect.getSDLRect(); ! if(charVector[str[i]-charoffset].solidColor != color) ! { ! // Borrowed the following from SDL_ttf.c ! palette = ! charVector[str[i]-charoffset].solidSurface->format->palette; ! palette->colors[0].r = 255 - color.getR(); ! palette->colors[0].g = 255 - color.getG(); ! palette->colors[0].b = 255 - color.getB(); ! palette->colors[1].r = color.getR(); ! palette->colors[1].g = color.getG(); ! palette->colors[1].b = color.getB(); ! SDL_SetColorKey(charVector[str[i]-charoffset].solidSurface, ! SDL_SRCCOLORKEY, 0); ! charVector[str[i]-charoffset].solidColor = color; ! } ! dst.y = y+charVector[str[i]-charoffset].yoffset; ! SDL_BlitSurface(charVector[str[i]-charoffset].solidSurface, NULL, s, &dst); ! dst.x+=charVector[str[i]-charoffset].advance; ! }; ! return nTextLenght; } ! int aedFont::renderTextShaded(SDL_Surface * s, int x, int y, const char *str, ! aedColor & fg, aedColor & bg) { SDL_Rect dst; ! SDL_Surface *srf; ! // SDL_Palette *palette; ! int nTextLenght = strlen(str); ! // no need to call slow strlen more than once ! // int rdiff; ! // int gdiff; ! // int bdiff; ! Uint32 *pixel; ! Uint32 uColor = ! (0xFF << 24) | ! (fg.getR() << 16) | ! (fg.getG() << 8) | ! fg.getB(); ! aedRect cliprect; ! SDL_Rect src = {0,0,s->w,s->h}; ! SDL_Rect shaderect = {x,y,0,TTF_FontHeight(data)}; ! dst.x = x; ! dst.y = y; ! for(int i=0;i<nTextLenght;++i) ! { ! shaderect.w = dst.w = charVector[str[i]-charoffset].advance; ! dst.h = charVector[str[i]-charoffset].blendedSurface->h; ! if(!cliprect.intersectRect(dst,src)) ! return i; ! dst = cliprect.getSDLRect(); ! if(charVector[str[i]-charoffset].blendedColor != fg) ! { ! srf = charVector[str[i]-charoffset].blendedSurface; ! SDL_LockSurface(srf); ! pixel = (Uint32*) srf->pixels; ! for(int j=0;j<(srf->w * srf->h);++j) ! { ! pixel[j] |= 0x00FFFFFF; ! pixel[j] &= uColor; ! }; ! SDL_UnlockSurface(srf); ! charVector[str[i]-charoffset].blendedColor = fg; ! } ! dst.y = y+charVector[str[i]-charoffset].yoffset; ! SDL_FillRect(s, &shaderect,bg.getUint32(s)); ! SDL_BlitSurface(charVector[str[i]-charoffset].blendedSurface, ! NULL, ! s, ! &dst); ! dst.x+=charVector[str[i]-charoffset].advance; ! shaderect.x = dst.x; ! }; ! return nTextLenght; } ! int aedFont::renderTextBlended(SDL_Surface * s, int x, int y, const char *str, ! aedColor & color) { SDL_Rect dst; ! SDL_Surface *srf; ! int nTextLenght = strlen(str); ! aedRect cliprect; ! SDL_Rect src = {0,0,s->w,s->h}; ! dst.x = x; ! dst.y = y; ! Uint32 *pixel; ! Uint32 uColor = ! (0xFF << 24) | ! (color.getR() << 16) | ! (color.getG() << 8) | ! color.getB(); ! for(int i=0;i<nTextLenght;++i) ! { ! dst.w = charVector[str[i]-charoffset].blendedSurface->w; ! dst.h = charVector[str[i]-charoffset].blendedSurface->h; ! if(!cliprect.intersectRect(dst,src)) ! return i; ! dst = cliprect.getSDLRect(); ! if(charVector[str[i]-charoffset].blendedColor != color) ! { ! srf = charVector[str[i]-charoffset].blendedSurface; ! SDL_LockSurface(srf); ! pixel = (Uint32*) srf->pixels; ! for(int j=0;j<(srf->w * srf->h);++j) ! { ! pixel[j] |= 0x00FFFFFF; ! pixel[j] &= uColor; //0x00FFFFFF; ! }; ! SDL_UnlockSurface(srf); ! charVector[str[i]-charoffset].blendedColor = color; ! } ! dst.y = y+charVector[str[i]-charoffset].yoffset; ! SDL_BlitSurface(charVector[str[i]-charoffset].blendedSurface, NULL, s, &dst); ! dst.x+=charVector[str[i]-charoffset].advance; ! }; ! return nTextLenght; ! } ! int ! aedFont::getMaxCharLen(SDL_Surface * s, int x, int y, const char *str) ! { ! SDL_Rect dst; ! int nTextLenght = strlen(str); ! aedRect cliprect; ! SDL_Rect src = {0,0,s->w,s->h}; ! dst.x = x; ! dst.y = y; ! for(int i=0;i<nTextLenght;++i) ! { ! dst.w = charVector[str[i]-charoffset].blendedSurface->w; ! dst.h = charVector[str[i]-charoffset].blendedSurface->h; ! // take into account half chars ! if((!cliprect.intersectRect(dst,src))||(cliprect.getWidth()!=dst.w)) ! return i; ! dst = cliprect.getSDLRect(); ! dst.y = y+charVector[str[i]-charoffset].yoffset; ! dst.x+=charVector[str[i]-charoffset].advance; ! }; ! return nTextLenght; } + + void + aedFont::generateFontVector() + { + char ch; + // these Colors are not randomly selected + // in OpenGL these will help us get proper + // text coloring + aedColor bg(0,0,0,0); + aedColor fg(255,255,255,255); + chardata charData; + int minx; + int maxx; + int miny; + int maxy; + int advance; + destroyFontVector(); + for(int i=0;i<charcount;++i) + { + ch = i+charoffset; + TTF_GlyphMetrics(data, + ch, + &minx, + &maxx, + &miny, + &maxy, + &advance); + charVector.push_back(charData); + charVector[i].solidSurface = TTF_RenderGlyph_Solid(data,ch,fg); + charVector[i].blendedSurface = TTF_RenderGlyph_Blended(data,ch,fg); + charVector[i].advance = advance; + charVector[i].yoffset = TTF_FontAscent(data) - maxy; + charVector[i].blendedColor = fg; + charVector[i].solidColor = fg; + }; + }; + + void + aedFont::destroyFontVector() + { + size_t vectorsize; + size_t i; + vectorsize = charVector.size(); + for(i=0;i<vectorsize;++i) + { + SDL_FreeSurface(charVector[i].solidSurface); + SDL_FreeSurface(charVector[i].blendedSurface); + } + charVector.clear(); + }; |
From: Rodrigo H. <kw...@us...> - 2004-05-21 13:48:42
|
Update of /cvsroot/aedgui/aedGUI/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23670/include Modified Files: aedColor.h aedFont.h aedRect.h Log Message: aedFont now uses a vector of surfaces for text rendering Index: aedRect.h =================================================================== RCS file: /cvsroot/aedgui/aedGUI/include/aedRect.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** aedRect.h 6 Nov 2003 18:46:33 -0000 1.7 --- aedRect.h 21 May 2004 13:48:29 -0000 1.8 *************** *** 146,150 **** return true; } ! private: Sint32 m_X, m_Y, m_W, m_H; --- 146,150 ---- return true; } ! bool intersectRect(const SDL_Rect& rect1, const SDL_Rect& rect2); private: Sint32 m_X, m_Y, m_W, m_H; Index: aedColor.h =================================================================== RCS file: /cvsroot/aedgui/aedGUI/include/aedColor.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** aedColor.h 6 Nov 2003 18:46:32 -0000 1.6 --- aedColor.h 21 May 2004 13:48:29 -0000 1.7 *************** *** 100,103 **** --- 100,111 ---- return c; } + bool operator!=(aedColor c) + { + return ((c.r!=r)||(c.g!=g)||(c.b!=b)||(c.a!=a)); + } + bool operator==(aedColor c) + { + return ((c.r==r)&&(c.g==g)&&(c.b==b)&&(c.a==a)); + } private: Uint8 r, g, b, a; Index: aedFont.h =================================================================== RCS file: /cvsroot/aedgui/aedGUI/include/aedFont.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** aedFont.h 12 Mar 2004 03:33:25 -0000 1.13 --- aedFont.h 21 May 2004 13:48:29 -0000 1.14 *************** *** 27,31 **** #include "dllmacros.h" #include "aedColor.h" ! #ifdef _MSC_VER #pragma warning(disable:4800) --- 27,32 ---- #include "dllmacros.h" #include "aedColor.h" ! #include <vector> ! using namespace std; #ifdef _MSC_VER #pragma warning(disable:4800) *************** *** 39,43 **** typedef struct _TTF_Font TTF_Font; ! /** The aedFont class handles text rendering. */ // Added DLLEXPORT to some functions to see if it solves the problem with // MinGW gcc 3.2.3 not exporting the symbols --- 40,54 ---- typedef struct _TTF_Font TTF_Font; ! typedef struct chardata ! { ! SDL_Surface *solidSurface; ! SDL_Surface *blendedSurface; ! int yoffset; // how far from the top should the char be blit ! int advance; // how much space to skip for next character ! aedColor blendedColor; ! aedColor solidColor; ! }; ! ! /** The aedFont class handles text rendering thru SDL_ttf. */ // Added DLLEXPORT to some functions to see if it solves the problem with // MinGW gcc 3.2.3 not exporting the symbols *************** *** 69,102 **** // These return rendered string as a surface which the caller must free #ifndef _MSC_VER DLLEXPORT #endif ! SDL_Surface *renderTextSolid(const char *str, const aedColor & color); ! #ifndef _MSC_VER ! DLLEXPORT ! #endif ! SDL_Surface *renderTextShaded(const char *str, const aedColor & fg, ! const aedColor & bg); ! #ifndef _MSC_VER ! DLLEXPORT ! #endif ! SDL_Surface *renderTextBlended(const char *str, const aedColor & color); ! ! // These are just for convenience, render directly to the given surface #ifndef _MSC_VER DLLEXPORT #endif ! void renderTextSolid(SDL_Surface * s, int x, int y, const char *str, ! const aedColor & color); #ifndef _MSC_VER DLLEXPORT #endif ! void renderTextShaded(SDL_Surface * s, int x, int y, const char *str, ! const aedColor & fg, const aedColor & bg); #ifndef _MSC_VER DLLEXPORT #endif ! void renderTextBlended(SDL_Surface * s, int x, int y, const char *str, ! const aedColor & color); static Uint16 getUnicode(const char *utf8, int *advance) { --- 80,163 ---- // These return rendered string as a surface which the caller must free + /* #ifndef _MSC_VER */ + /* DLLEXPORT */ + /* #endif */ + /* SDL_Surface *renderTextSolid(const char *str, const aedColor & color); */ + /* #ifndef _MSC_VER */ + /* DLLEXPORT */ + /* #endif */ + /* SDL_Surface *renderTextShaded(const char *str, const aedColor & fg, */ + /* const aedColor & bg); */ + /* #ifndef _MSC_VER */ + /* DLLEXPORT */ + /* #endif */ + /* SDL_Surface *renderTextBlended(const char *str, const aedColor & color); */ + + // These are just for convenience, render directly to the given surface #ifndef _MSC_VER DLLEXPORT #endif ! /*! renderTextSolid ! Renders the specified text on str to the Surface s with hard edges, ! it clips the text in case it runs past the width of the surface ! \param s Surface where the text should be blit to ! \param x X position for the blit ! \param Y Y position for the blit ! \param str text to blit ! \param color foreground text color ! \return Returns the number of characters blit, including characters which ! were partially blit due to clipping. ! \sa aedFont::renderTextBlended,aedFont::renderTextShaded ! */ ! int renderTextSolid(SDL_Surface * s, int x, int y, const char *str, ! aedColor & color); #ifndef _MSC_VER DLLEXPORT #endif ! /*! renderTextBlended ! Renders the specified text on str to the Surface s with a solid background, ! it clips the text in case it runs past the width of the surface ! \param s Surface where the text should be blit to ! \param x X position for the blit ! \param Y Y position for the blit ! \param str text to blit ! \param fg foreground text color ! \param bg background text color ! \return Returns the number of characters blit, including characters which ! were partially blit due to clipping. ! \sa aedFont::renderTextSolid,aedFont::renderTextBlended ! */ ! int renderTextShaded(SDL_Surface * s, int x, int y, const char *str, ! aedColor & fg, aedColor & bg); #ifndef _MSC_VER DLLEXPORT #endif ! /*! renderTextBlended ! Renders the specified text on str to the Surface s with soft edges, ! it clips the text in case it runs past the width of the surface ! \param s Surface where the text should be blit to ! \param x X position for the blit ! \param Y Y position for the blit ! \param str text to blit ! \param color foreground text color ! \return Returns the number of characters blit, including characters which ! were partially blit due to clipping. ! \sa aedFont::renderTextSolid,aedFont::renderTextShaded ! */ ! int renderTextBlended(SDL_Surface * s, int x, int y, const char *str, ! aedColor & color); #ifndef _MSC_VER DLLEXPORT #endif ! /*! getMaxCharLen ! returns the number of characterss from "str" that would fit in "s" at x,y ! \param s Surface where the text would be blit to ! \param x X position for the blit ! \param Y Y position for the blit ! \param str text to check for ! \return Returns the number of complete characters that fit in the Surface if one of the renderText[Solid|Blended|Shaded] member functions where called with these parameters ! \sa aedFont::renderTextSolid,aedFont::renderTextBlended,aedFont::renderTextShaded ! */ ! int getMaxCharLen(SDL_Surface * s, int x, int y, const char *str); static Uint16 getUnicode(const char *utf8, int *advance) { *************** *** 126,133 **** return ch; } ! private: ! TTF_Font * data; ! // This isn't the best design, but it does what we need: // allow only aedApp to open and close fonts --- 187,201 ---- return ch; } ! inline TTF_Font* getTTFFont(){return data;}; private: ! TTF_Font * data; ! /** ! These are going to hold out font Tables ! */ ! vector<chardata> charVector; ! void generateFontVector(); ! void destroyFontVector(); ! int charcount; /**< Number of characters available default to 224 ASCII Extended */ ! int charoffset; /**< Offset to first printable character in table, default 32 (SPACE in ASCII Extended) */ // This isn't the best design, but it does what we need: // allow only aedApp to open and close fonts |
From: Rodrigo H. <kw...@us...> - 2004-05-21 13:48:39
|
Update of /cvsroot/aedgui/aedGUI/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23670/test Modified Files: main.cpp Log Message: aedFont now uses a vector of surfaces for text rendering Index: main.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/test/main.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** main.cpp 15 May 2004 08:05:33 -0000 1.53 --- main.cpp 21 May 2004 13:48:30 -0000 1.54 *************** *** 266,271 **** aedStaticText staticText1; ! staticText1.create(&desktop, aedRect(400, 380, 175, 30), ! "aedGUI test application. http://aedgui.sf.net/"); staticText1.setJustification(AED_JUST_RIGHT); staticText1.setWordWrap(true); --- 266,271 ---- aedStaticText staticText1; ! staticText1.create(&desktop, aedRect(400, 380, 175, 60), ! "aedGUI test application. http://aedgui.sf.net/ blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah"); staticText1.setJustification(AED_JUST_RIGHT); staticText1.setWordWrap(true); *************** *** 277,281 **** "FPS:"); staticTextFPS.setJustification(AED_JUST_LEFT); - staticTextFPS.setWordWrap(true); staticTextFPS.setFontSize(12); --- 277,280 ---- *************** *** 325,329 **** if(GetFPS(nFPS)) { ! sprintf(szFPS,"fps:%d",nFPS); //fprintf(stdout,"FPS: %d\r\n",nFPS); staticTextFPS.setCaption(szFPS); --- 324,328 ---- if(GetFPS(nFPS)) { ! sprintf(szFPS,"FPS: %d",nFPS); //fprintf(stdout,"FPS: %d\r\n",nFPS); staticTextFPS.setCaption(szFPS); |
From: Rodrigo H. <kw...@us...> - 2004-05-21 13:48:38
|
Update of /cvsroot/aedgui/aedGUI/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23670/docs Modified Files: Doxyfile Log Message: aedFont now uses a vector of surfaces for text rendering Index: Doxyfile =================================================================== RCS file: /cvsroot/aedgui/aedGUI/docs/Doxyfile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Doxyfile 15 Aug 2003 14:24:52 -0000 1.2 --- Doxyfile 21 May 2004 13:48:28 -0000 1.3 *************** *** 1,1109 **** ! # Doxyfile 1.3.3 ! ! # This file describes the settings to be used by the documentation system ! # doxygen (www.doxygen.org) for a project ! # ! # All text after a hash (#) is considered a comment and will be ignored ! # The format is: ! # TAG = value [value, ...] ! # For lists items can also be appended using: ! # TAG += value [value, ...] [...1296 lines suppressed...] CLASS_GRAPH = YES COLLABORATION_GRAPH = YES UML_LOOK = NO TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES CALL_GRAPH = NO GRAPHICAL_HIERARCHY = YES DOT_IMAGE_FORMAT = png DOT_PATH = DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_HEIGHT = 1024 MAX_DOT_GRAPH_DEPTH = 0 GENERATE_LEGEND = YES DOT_CLEANUP = YES #--------------------------------------------------------------------------- ! # Configuration::additions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = NO |
From: Rodrigo H. <kw...@us...> - 2004-05-17 07:36:07
|
Update of /cvsroot/aedgui/aedGUI/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14132/include Modified Files: aedCallBack.h dllmacros.h Log Message: removed DLLEXPORT declaration of aedCallback Index: aedCallBack.h =================================================================== RCS file: /cvsroot/aedgui/aedGUI/include/aedCallBack.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** aedCallBack.h 6 Nov 2003 18:46:32 -0000 1.6 --- aedCallBack.h 17 May 2004 07:35:57 -0000 1.7 *************** *** 28,32 **** #include "aedFunctor1Arg.h" ! class DLLEXPORT aedCallBack { public: --- 28,35 ---- #include "aedFunctor1Arg.h" ! // if this class ever gets a definition file (.cpp) then ! // the class will need to be declared as DLLEXPORT ! ! class aedCallBack { public: Index: dllmacros.h =================================================================== RCS file: /cvsroot/aedgui/aedGUI/include/dllmacros.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dllmacros.h 5 Feb 2004 04:40:25 -0000 1.8 --- dllmacros.h 17 May 2004 07:35:58 -0000 1.9 *************** *** 3,10 **** #if defined(_MSC_VER) ! #pragma warning( disable : 4231 ) ! #pragma warning( disable : 4251 ) ! #pragma warning( disable : 4267 ) ! #pragma warning( disable : 4311 ) #endif --- 3,10 ---- #if defined(_MSC_VER) ! #pragma warning( disable : 4231 ) ! #pragma warning( disable : 4251 ) ! #pragma warning( disable : 4267 ) ! #pragma warning( disable : 4311 ) #endif |
From: Rodrigo H. <kw...@us...> - 2004-05-15 08:05:44
|
Update of /cvsroot/aedgui/aedGUI/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23660/test Modified Files: main.cpp Log Message: Added a Frames Per Second counter to test app Index: main.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/test/main.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** main.cpp 16 Feb 2004 19:46:34 -0000 1.52 --- main.cpp 15 May 2004 08:05:33 -0000 1.53 *************** *** 15,21 **** --- 15,55 ---- aedButton *tb2; + // Variables and Functions to keep track of the frames per second + // how can we tell wether or not we actually improved aedGUI otherwise? + + bool bFPSChanged = true; + Uint32 nFramesPerSecond = 0; + Uint32 nFrameCount = 0; + Uint32 nLastTime = 0; + + void CalculateFrameRate() + { + Uint32 nCurrentTime = SDL_GetTicks(); + ++nFrameCount; + if( nCurrentTime - nLastTime > 1000) + { + nLastTime = nCurrentTime; + nFramesPerSecond = nFrameCount; + nFrameCount = 0; + bFPSChanged = true; + } + } + + bool GetFPS(Uint32 &nFPS) + { + nFPS = nFramesPerSecond; + if(bFPSChanged) + { + bFPSChanged = false; + return true; + } + return false; + }; + int main(int argc, char *argv[]) { + char szFPS[256]; + Uint32 nFPS = 0; //AK(12-Feb-04) { *************** *** 232,236 **** aedStaticText staticText1; ! staticText1.create(&desktop, aedRect(400, 380, 175, 60), "aedGUI test application. http://aedgui.sf.net/"); staticText1.setJustification(AED_JUST_RIGHT); --- 266,270 ---- aedStaticText staticText1; ! staticText1.create(&desktop, aedRect(400, 380, 175, 30), "aedGUI test application. http://aedgui.sf.net/"); staticText1.setJustification(AED_JUST_RIGHT); *************** *** 238,241 **** --- 272,283 ---- staticText1.setFontSize(12); + aedStaticText staticTextFPS; + + staticTextFPS.create(&desktop, aedRect(400, 440, 175, 20), + "FPS:"); + staticTextFPS.setJustification(AED_JUST_LEFT); + staticTextFPS.setWordWrap(true); + staticTextFPS.setFontSize(12); + aedListBox listBox; *************** *** 280,284 **** } } ! desktop.update(); boxSizer.calculateSize(); // TEST --- 322,332 ---- } } ! CalculateFrameRate(); ! if(GetFPS(nFPS)) ! { ! sprintf(szFPS,"fps:%d",nFPS); ! //fprintf(stdout,"FPS: %d\r\n",nFPS); ! staticTextFPS.setCaption(szFPS); ! }; desktop.update(); boxSizer.calculateSize(); // TEST |
From: Rodrigo H. <kw...@us...> - 2004-04-27 18:39:12
|
Update of /cvsroot/aedgui/aedGUI/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2967/src Modified Files: aedWindow.cpp Log Message: fixed aedWindow (was not compiling) Index: aedWindow.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedWindow.cpp,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** aedWindow.cpp 16 Apr 2004 01:29:56 -0000 1.70 --- aedWindow.cpp 27 Apr 2004 18:38:59 -0000 1.71 *************** *** 90,98 **** void aedWindow::render(void) ! { ! ! // Position our title caption correctly ! Uint16 CaptionWidth, CaptionHeight; ! int x, y; m_CaptionLabel->getFont()->getTextSize(m_Caption.c_str(), &CaptionWidth, --- 90,96 ---- void aedWindow::render(void) ! { ! // Position our title caption correctly ! Uint16 CaptionWidth, CaptionHeight; m_CaptionLabel->getFont()->getTextSize(m_Caption.c_str(), &CaptionWidth, *************** *** 134,138 **** SLOCK(m_Surface); DrawRect(screenORrect, TitleBarX1, TitleBarY1, TitleBarX2, TitleBarY2, ! temp.getUint32(m_Surface)); SUNLOCK(m_Surface); } --- 132,136 ---- SLOCK(m_Surface); DrawRect(screenORrect, TitleBarX1, TitleBarY1, TitleBarX2, TitleBarY2, ! temp); SUNLOCK(m_Surface); } *************** *** 186,196 **** // TODO: Write me ! } void aedWindow::Minimize() { // TODO: Write me ! } void __aedInternal__WindowCloseButtonHandler(void *caller, void *data) { --- 184,197 ---- // TODO: Write me ! }; + void aedWindow::Minimize() { // TODO: Write me ! }; ! ! void __aedInternal__WindowCloseButtonHandler(void *caller, void *data) { |
Update of /cvsroot/aedgui/aedGUI/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6822/src Modified Files: Makefile.am aedApp.cpp aedButton.cpp aedTextBox.cpp aedTheme.cpp aedWidget.cpp aedWindow.cpp aedXmlFile.cpp drawlibs.cpp Log Message: OpenGL Patch Index: aedXmlFile.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedXmlFile.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** aedXmlFile.cpp 6 Nov 2003 18:46:37 -0000 1.6 --- aedXmlFile.cpp 16 Apr 2004 01:29:56 -0000 1.7 *************** *** 21,443 **** #include <iostream> ! bool aedXmlFile::loadFromFile(const std::string & fileName, aedWidget * parent) ! { ! TiXmlDocument doc; ! std::cout << "LoadFromFile: " << fileName << std::endl; ! if(doc.LoadFile(fileName) == false) ! { ! m_ErrorText = doc.ErrorDesc(); ! return false; ! } ! return parseChildElements(doc.FirstChildElement(), parent); ! } ! ! bool aedXmlFile::loadFromString(const std::string & xml, aedWidget * parent) ! { ! TiXmlDocument doc; ! std::cout << "LoadFromXml: " << xml << std::endl; ! if(doc.Parse(xml.c_str()) == NULL) ! { ! m_ErrorText = doc.ErrorDesc(); ! return false; ! } ! return parseChildElements(doc.FirstChildElement(), parent); ! } ! ! std::string aedXmlFile::getError() ! { ! return m_ErrorText; ! } ! ! #define CREATE_IF(e, f) do { if (ElementType == e) return f(element, parent); } while(0); ! bool aedXmlFile::parseElement(TiXmlElement * element, aedWidget * parent) ! { ! std::string ElementType(element->Value()); ! CREATE_IF("window", parseWindow); ! CREATE_IF("button", parseButton); ! CREATE_IF("statictext", parseStaticText); ! CREATE_IF("textbox", parseTextBox); ! CREATE_IF("progressbar", parseTextBox); ! CREATE_IF("frame", parseFrame); ! CREATE_IF("checkbox", parseCheckBox); ! CREATE_IF("staticimage", parseStaticImage); ! CREATE_IF("slider", parseSlider); ! CREATE_IF("scrollbar", parseScrollBar); ! CREATE_IF("radiobuttongroup", parseRadioButtonGroup); ! CREATE_IF("listbox", parseListBox); ! CREATE_IF("spinner", parseSpinner); ! return true; ! } ! ! bool aedXmlFile::parseChildElements(TiXmlElement * element, aedWidget * parent) ! { ! TiXmlElement * ChildElement = element->FirstChildElement(); ! while(ChildElement) ! { ! if(parseElement(ChildElement, parent) == false) ! { ! return false; ! } ! ChildElement = ChildElement->NextSiblingElement(); ! } ! return true; ! } ! ! bool aedXmlFile::parseWindow(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedWindow * window = new aedWindow(); ! window->create(parent, Position, Caption, WF_NORMAL); ! window->setId(Name); ! std::cerr << "parseWindow: " << Name << std::endl; ! return parseChildElements(element, window); ! } ! ! bool aedXmlFile::parseStaticText(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedStaticText * statictext = new aedStaticText(); ! statictext->create(parent, Position, Caption); ! statictext->setId(Name); ! std::cerr << "parseStaticText: " << Name << std::endl; ! return true; ! } ! ! bool aedXmlFile::parseButton(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedButton * button = new aedButton(); ! button->create(parent, Position, Caption); ! button->setId(Name); ! std::cout << "parseButton: " << Name << std::endl; ! return true; ! } ! ! bool aedXmlFile::parseTextBox(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedTextBox * textbox = new aedTextBox(); ! textbox->create(parent, Position, Caption); ! textbox->setId(Name); ! std::cout << "parseTextBox: " << Name << std::endl; ! return true; ! } ! ! bool aedXmlFile::parseProgressBar(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedProgressBar * progressbar = new aedProgressBar(); ! progressbar->create(parent, Position, Caption); ! progressbar->setId(Name); ! std::cout << "parseProgressBar: " << Name << std::endl; ! int ! Value = safeExtractInt(element, "value"); ! ! progressbar->setValue(Value); ! return true; ! } ! ! bool aedXmlFile::parseFrame(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedFrame * frame = new aedFrame(); ! frame->create(parent, Position, Caption); ! frame->setId(Name); ! std::cout << "parseFrame: " << Name << std::endl; ! return parseChildElements(element, frame); ! } ! ! bool aedXmlFile::parseCheckBox(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedCheckBox * checkbox = new aedCheckBox(); ! checkbox->create(parent, Position, Caption); ! checkbox->setId(Name); ! std::cout << "parseCheckBox: " << Name << std::endl; ! std::string Value = safeExtractString(element, "value"); ! checkbox->setState(Value == "true"); ! return true; ! } ! ! bool aedXmlFile::parseStaticImage(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedStaticImage * staticimage = new aedStaticImage(); ! staticimage->create(parent, Position, Caption); ! staticimage->setId(Name); ! std::cout << "parseStaticImage: " << Name << std::endl; ! std::string Value = safeExtractString(element, "value"); ! if(Value.length() != 0) ! { ! SDL_Surface * surface = SDL_LoadBMP(Value.c_str()); ! if(surface != NULL) ! { ! if(safeExtractString(element, "colorkey") == "true") ! { ! int ! r = safeExtractInt(element, "key_r"); ! int ! g = safeExtractInt(element, "key_r"); ! int ! b = safeExtractInt(element, "key_r"); ! unsigned int ! ColourKey = SDL_MapRGB(surface->format, r, g, b); ! ! SDL_SetColorKey(surface, SDL_SRCCOLORKEY, ColourKey); ! } ! ConvertSurface(&surface); ! staticimage->setImage(aedImage(surface)); ! staticimage->setSize(surface->w, surface->h); ! } ! } ! return true; ! } ! ! bool aedXmlFile::parseSlider(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! std::string Orientation = safeExtractString(element, "orientation"); ! aedOrientation orient; ! if(Orientation == "vertical") ! { ! orient = AED_VERTICAL; ! } ! else if(Orientation == "horizontal") ! { ! orient = AED_HORIZONTAL; ! } ! else ! { // A required attribute was missing. Return true to continue // parsing xml, just don't create this widget ! return true; ! } ! aedSlider * slider = new aedSlider(orient); ! slider->create(parent, Position, Caption); ! slider->setId(Name); ! int ! Min = safeExtractInt(element, "min"); ! int ! Max = safeExtractInt(element, "max"); ! int ! Value = safeExtractInt(element, "value"); ! ! slider->setRange(Min, Max); ! slider->setValue(Value); ! std::cout << "parseSlider: " << Name << std::endl; ! return true; ! } ! ! bool aedXmlFile::parseScrollBar(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! std::string Orientation = safeExtractString(element, "orientation"); ! aedOrientation orient; ! if(Orientation == "vertical") ! { ! orient = AED_VERTICAL; ! } ! else if(Orientation == "horizontal") ! { ! orient = AED_HORIZONTAL; ! } ! else ! { // A required attribute was missing. Return true to continue // parsing xml, just don't create this widget ! return true; ! } ! aedScrollBar * scrollbar = new aedScrollBar(orient); ! scrollbar->create(parent, Position, Caption); ! scrollbar->setId(Name); ! int ! Min = safeExtractInt(element, "min"); ! int ! Max = safeExtractInt(element, "max"); ! int ! Value = safeExtractInt(element, "value"); ! ! scrollbar->setRange(Min, Max); ! scrollbar->setValue(Value); ! std::cout << "parseScrollBar: " << Name << std::endl; ! return true; ! } ! ! bool aedXmlFile::parseRadioButtonGroup(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedRadioButtonGroup * radiobuttongroup = new aedRadioButtonGroup(); ! radiobuttongroup->create(parent, Position, Caption); ! radiobuttongroup->setId(Name); ! std::cout << "parseRadioButtonGroup: " << Name << std::endl; ! TiXmlElement * ChildElement = element->FirstChildElement(); ! while(ChildElement) ! { ! if(std::string(ChildElement->Value()) == "radiobutton") ! { ! std::string Text = safeExtractString(ChildElement, "caption"); ! std::string Name = safeExtractString(ChildElement, "name"); ! radiobuttongroup->addButton(Text); ! std:: ! cerr << "Added radio button: " << Name << " : " << Text << std:: ! endl; ! } ! ChildElement = ChildElement->NextSiblingElement(); ! } ! int ! SelectedButton = safeExtractInt(element, "selected"); ! ! radiobuttongroup->selectButton(SelectedButton); ! return true; ! } ! ! bool aedXmlFile::parseListBox(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedListBox * listbox = new aedListBox(); ! listbox->create(parent, Position, Caption); ! listbox->setId(Name); ! std::cout << "parseListBox: " << Name << std::endl; ! TiXmlElement * ListBoxColumnElement = element->FirstChildElement(); ! while(ListBoxColumnElement) ! { ! std::string ColumnType = ! safeExtractString(ListBoxColumnElement, "type"); ! if(ColumnType == "string") ! { ! TiXmlElement * ListBoxElement = ! ListBoxColumnElement->FirstChildElement(); ! while(ListBoxElement) ! { ! if(std::string(ListBoxElement->Value()) == "listboxstringitem") ! { ! std::string Text = ! safeExtractString(ListBoxElement, "caption"); ! std::string Name = ! safeExtractString(ListBoxElement, "name"); ! listbox->add(Text); ! std:: ! cerr << "Added list box item: " << Name << " : " << Text ! << std::endl; ! } ! ListBoxElement = ListBoxElement->NextSiblingElement(); ! } ! ListBoxColumnElement = ListBoxColumnElement->NextSiblingElement(); ! } // else if (ColumnType == "...") // { // } ! } ! return true; ! } ! ! bool aedXmlFile::parseSpinner(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedSpinner * spinner = new aedSpinner(); ! spinner->create(parent, Position, Caption); ! spinner->setId(Name); ! std::cout << "parseSpinner: " << Name << std::endl; ! return true; ! } ! ! std::string aedXmlFile::safeExtractString(TiXmlElement * element, ! const std:: string & attributeName) ! { ! if(element->Attribute(attributeName) != NULL) ! { ! return element->Attribute(attributeName); ! } ! else ! { ! return ""; ! } ! } ! int ! aedXmlFile::safeExtractInt(TiXmlElement * element, const std::string & attributeName) ! { ! int val = 0; ! ! element->Attribute(attributeName, &val); ! return val; ! } ! ! aedRect aedXmlFile::safeExtractPosition(TiXmlElement * element) ! { ! int ! x, ! y, ! w, ! h; ! ! element->Attribute("x", &x); ! element->Attribute("y", &y); ! element->Attribute("w", &w); ! element->Attribute("h", &h); ! return aedRect(x, y, w, h); ! } ! --- 21,443 ---- #include <iostream> ! bool aedXmlFile::loadFromFile(const std::string & fileName, aedWidget * parent) ! { ! TiXmlDocument doc; ! std::cout << "LoadFromFile: " << fileName << std::endl; ! if(doc.LoadFile(fileName) == false) ! { ! m_ErrorText = doc.ErrorDesc(); ! return false; ! } ! return parseChildElements(doc.FirstChildElement(), parent); ! } ! ! bool aedXmlFile::loadFromString(const std::string & xml, aedWidget * parent) ! { ! TiXmlDocument doc; ! std::cout << "LoadFromXml: " << xml << std::endl; ! if(doc.Parse(xml.c_str()) == NULL) ! { ! m_ErrorText = doc.ErrorDesc(); ! return false; ! } ! return parseChildElements(doc.FirstChildElement(), parent); ! } ! ! std::string aedXmlFile::getError() ! { ! return m_ErrorText; ! } ! ! #define CREATE_IF(e, f) do { if (ElementType == e) return f(element, parent); } while(0); ! bool aedXmlFile::parseElement(TiXmlElement * element, aedWidget * parent) ! { ! std::string ElementType(element->Value()); ! CREATE_IF("window", parseWindow); ! CREATE_IF("button", parseButton); ! CREATE_IF("statictext", parseStaticText); ! CREATE_IF("textbox", parseTextBox); ! CREATE_IF("progressbar", parseTextBox); ! CREATE_IF("frame", parseFrame); ! CREATE_IF("checkbox", parseCheckBox); ! CREATE_IF("staticimage", parseStaticImage); ! CREATE_IF("slider", parseSlider); ! CREATE_IF("scrollbar", parseScrollBar); ! CREATE_IF("radiobuttongroup", parseRadioButtonGroup); ! CREATE_IF("listbox", parseListBox); ! CREATE_IF("spinner", parseSpinner); ! return true; ! } ! ! bool aedXmlFile::parseChildElements(TiXmlElement * element, aedWidget * parent) ! { ! TiXmlElement * ChildElement = element->FirstChildElement(); ! while(ChildElement) ! { ! if(parseElement(ChildElement, parent) == false) ! { ! return false; ! } ! ChildElement = ChildElement->NextSiblingElement(); ! } ! return true; ! } ! ! bool aedXmlFile::parseWindow(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedWindow * window = new aedWindow(); ! window->create(parent, Position, Caption, WF_NORMAL); ! window->setId(Name); ! std::cerr << "parseWindow: " << Name << std::endl; ! return parseChildElements(element, window); ! } ! ! bool aedXmlFile::parseStaticText(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedStaticText * statictext = new aedStaticText(); ! statictext->create(parent, Position, Caption); ! statictext->setId(Name); ! std::cerr << "parseStaticText: " << Name << std::endl; ! return true; ! } ! ! bool aedXmlFile::parseButton(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedButton * button = new aedButton(); ! button->create(parent, Position, Caption); ! button->setId(Name); ! std::cout << "parseButton: " << Name << std::endl; ! return true; ! } ! ! bool aedXmlFile::parseTextBox(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedTextBox * textbox = new aedTextBox(); ! textbox->create(parent, Position, Caption); ! textbox->setId(Name); ! std::cout << "parseTextBox: " << Name << std::endl; ! return true; ! } ! ! bool aedXmlFile::parseProgressBar(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedProgressBar * progressbar = new aedProgressBar(); ! progressbar->create(parent, Position, Caption); ! progressbar->setId(Name); ! std::cout << "parseProgressBar: " << Name << std::endl; ! int ! Value = safeExtractInt(element, "value"); ! ! progressbar->setValue(Value); ! return true; ! } ! ! bool aedXmlFile::parseFrame(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedFrame * frame = new aedFrame(); ! frame->create(parent, Position, Caption); ! frame->setId(Name); ! std::cout << "parseFrame: " << Name << std::endl; ! return parseChildElements(element, frame); ! } ! ! bool aedXmlFile::parseCheckBox(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedCheckBox * checkbox = new aedCheckBox(); ! checkbox->create(parent, Position, Caption); ! checkbox->setId(Name); ! std::cout << "parseCheckBox: " << Name << std::endl; ! std::string Value = safeExtractString(element, "value"); ! checkbox->setState(Value == "true"); ! return true; ! } ! ! bool aedXmlFile::parseStaticImage(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedStaticImage * staticimage = new aedStaticImage(); ! staticimage->create(parent, Position, Caption); ! staticimage->setId(Name); ! std::cout << "parseStaticImage: " << Name << std::endl; ! std::string Value = safeExtractString(element, "value"); ! if(Value.length() != 0) ! { ! SDL_Surface * surface = SDL_LoadBMP(Value.c_str()); ! if(surface != NULL) ! { ! if(safeExtractString(element, "colorkey") == "true") ! { ! int ! r = safeExtractInt(element, "key_r"); ! int ! g = safeExtractInt(element, "key_r"); ! int ! b = safeExtractInt(element, "key_r"); ! unsigned int ! ColourKey = SDL_MapRGB(surface->format, r, g, b); ! ! SDL_SetColorKey(surface, SDL_SRCCOLORKEY, ColourKey); ! } ! ConvertSurface(&surface); ! staticimage->setImage(aedImage(surface)); ! staticimage->setSize(surface->w, surface->h); ! } ! } ! return true; ! } ! ! bool aedXmlFile::parseSlider(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! std::string Orientation = safeExtractString(element, "orientation"); ! aedOrientation orient; ! if(Orientation == "vertical") ! { ! orient = AED_VERTICAL; ! } ! else if(Orientation == "horizontal") ! { ! orient = AED_HORIZONTAL; ! } ! else ! { // A required attribute was missing. Return true to continue // parsing xml, just don't create this widget ! return true; ! } ! aedSlider * slider = new aedSlider(orient); ! slider->create(parent, Position, Caption); ! slider->setId(Name); ! int ! Min = safeExtractInt(element, "min"); ! int ! Max = safeExtractInt(element, "max"); ! int ! Value = safeExtractInt(element, "value"); ! ! slider->setRange(Min, Max); ! slider->setValue(Value); ! std::cout << "parseSlider: " << Name << std::endl; ! return true; ! } ! ! bool aedXmlFile::parseScrollBar(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! std::string Orientation = safeExtractString(element, "orientation"); ! aedOrientation orient; ! if(Orientation == "vertical") ! { ! orient = AED_VERTICAL; ! } ! else if(Orientation == "horizontal") ! { ! orient = AED_HORIZONTAL; ! } ! else ! { // A required attribute was missing. Return true to continue // parsing xml, just don't create this widget ! return true; ! } ! aedScrollBar * scrollbar = new aedScrollBar(orient); ! scrollbar->create(parent, Position, Caption); ! scrollbar->setId(Name); ! int ! Min = safeExtractInt(element, "min"); ! int ! Max = safeExtractInt(element, "max"); ! int ! Value = safeExtractInt(element, "value"); ! ! scrollbar->setRange(Min, Max); ! scrollbar->setValue(Value); ! std::cout << "parseScrollBar: " << Name << std::endl; ! return true; ! } ! ! bool aedXmlFile::parseRadioButtonGroup(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedRadioButtonGroup * radiobuttongroup = new aedRadioButtonGroup(); ! radiobuttongroup->create(parent, Position, Caption); ! radiobuttongroup->setId(Name); ! std::cout << "parseRadioButtonGroup: " << Name << std::endl; ! TiXmlElement * ChildElement = element->FirstChildElement(); ! while(ChildElement) ! { ! if(std::string(ChildElement->Value()) == "radiobutton") ! { ! std::string Text = safeExtractString(ChildElement, "caption"); ! std::string Name = safeExtractString(ChildElement, "name"); ! radiobuttongroup->addButton(Text); ! std:: ! cerr << "Added radio button: " << Name << " : " << Text << std:: ! endl; ! } ! ChildElement = ChildElement->NextSiblingElement(); ! } ! int ! SelectedButton = safeExtractInt(element, "selected"); ! ! radiobuttongroup->selectButton(SelectedButton); ! return true; ! } ! ! bool aedXmlFile::parseListBox(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedListBox * listbox = new aedListBox(); ! listbox->create(parent, Position, Caption); ! listbox->setId(Name); ! std::cout << "parseListBox: " << Name << std::endl; ! TiXmlElement * ListBoxColumnElement = element->FirstChildElement(); ! while(ListBoxColumnElement) ! { ! std::string ColumnType = ! safeExtractString(ListBoxColumnElement, "type"); ! if(ColumnType == "string") ! { ! TiXmlElement * ListBoxElement = ! ListBoxColumnElement->FirstChildElement(); ! while(ListBoxElement) ! { ! if(std::string(ListBoxElement->Value()) == "listboxstringitem") ! { ! std::string Text = ! safeExtractString(ListBoxElement, "caption"); ! std::string Name = ! safeExtractString(ListBoxElement, "name"); ! listbox->add(Text); ! std:: ! cerr << "Added list box item: " << Name << " : " << Text ! << std::endl; ! } ! ListBoxElement = ListBoxElement->NextSiblingElement(); ! } ! ListBoxColumnElement = ListBoxColumnElement->NextSiblingElement(); ! } // else if (ColumnType == "...") // { // } ! } ! return true; ! } ! ! bool aedXmlFile::parseSpinner(TiXmlElement * element, aedWidget * parent) ! { ! aedRect Position = safeExtractPosition(element); ! std::string Name = safeExtractString(element, "name"); ! std::string Caption = safeExtractString(element, "caption"); ! aedSpinner * spinner = new aedSpinner(); ! spinner->create(parent, Position, Caption); ! spinner->setId(Name); ! std::cout << "parseSpinner: " << Name << std::endl; ! return true; ! } ! ! std::string aedXmlFile::safeExtractString(TiXmlElement * element, ! const std:: string & attributeName) ! { ! if(element->Attribute(attributeName) != NULL) ! { ! return element->Attribute(attributeName); ! } ! else ! { ! return ""; ! } ! } ! int ! aedXmlFile::safeExtractInt(TiXmlElement * element, const std::string & attributeName) ! { ! int val = 0; ! ! element->Attribute(attributeName, &val); ! return val; ! } ! ! aedRect aedXmlFile::safeExtractPosition(TiXmlElement * element) ! { ! int ! x, ! y, ! w, ! h; ! ! element->Attribute("x", &x); ! element->Attribute("y", &y); ! element->Attribute("w", &w); ! element->Attribute("h", &h); ! return aedRect(x, y, w, h); ! } ! Index: Makefile.am =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/Makefile.am,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Makefile.am 20 Dec 2003 19:17:23 -0000 1.33 --- Makefile.am 16 Apr 2004 01:29:56 -0000 1.34 *************** *** 1,4 **** SUBDIRS = tinyxml ! AM_LDFLAGS = @SDL_LIBS@ AM_CXXFLAGS = `@SDL_CONFIG@ --cflags` -I../include/ --- 1,4 ---- SUBDIRS = tinyxml ! AM_LDFLAGS = @SDL_LIBS@ @GL_LIBS@ AM_CXXFLAGS = `@SDL_CONFIG@ --cflags` -I../include/ Index: aedApp.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedApp.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** aedApp.cpp 20 Dec 2003 19:17:23 -0000 1.31 --- aedApp.cpp 16 Apr 2004 01:29:56 -0000 1.32 *************** *** 44,47 **** --- 44,48 ---- m_cancelButton = NULL; m_UTF8 = false; + m_use_OpenGL = false; pLog = new aedLog; Index: aedWindow.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedWindow.cpp,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** aedWindow.cpp 9 Apr 2004 05:03:00 -0000 1.69 --- aedWindow.cpp 16 Apr 2004 01:29:56 -0000 1.70 *************** *** 119,126 **** } aedColor temp(0, 0, 255, 255); ! // we need to lock the surface before touching its pixels... SLOCK(m_Surface); ! DrawRect(m_Surface, TitleBarX1, TitleBarY1, TitleBarX2, TitleBarY2, temp.getUint32(m_Surface)); SUNLOCK(m_Surface); --- 119,137 ---- } aedColor temp(0, 0, 255, 255); ! void* screenORrect = NULL; ! aedRect rect; ! if(pApp->usesOpenGL()) ! { ! rect = getRealPos(); ! screenORrect = ▭ ! } ! else ! { ! screenORrect = m_Surface; ! } ! // we need to lock the surface before touching its pixels... SLOCK(m_Surface); ! DrawRect(screenORrect, TitleBarX1, TitleBarY1, TitleBarX2, TitleBarY2, temp.getUint32(m_Surface)); SUNLOCK(m_Surface); Index: aedWidget.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedWidget.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** aedWidget.cpp 6 Feb 2004 05:10:05 -0000 1.10 --- aedWidget.cpp 16 Apr 2004 01:29:56 -0000 1.11 *************** *** 5,8 **** --- 5,9 ---- #include "drawlibs.h" #include "rint.h" + #include "SDL_opengl.h" // flags used in findChildAtCoord() *************** *** 470,473 **** --- 471,488 ---- if(!isVisible()) return; + + if((pApp->getRoot() == this)&&(pApp->usesOpenGL())) + { + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + glOrtho(0, m_ScreenWidth,m_ScreenHeight,0, 0, 1); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + //glDisable(GL_DEPTH_TEST); + fprintf(stdout,"OpenGL Set\r\n"); + //OpenGL needs everything to be drawn each frame + makeAllDirty(); + } if(!screen) *************** *** 511,515 **** --- 526,541 ---- // always call renderAll on the root widget if(pApp->getRoot() == this) + { pUpdateMgr->updateRects(screen); + if(pApp->usesOpenGL()) + { + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); + //glEnable(GL_DEPTH_TEST); + + fprintf(stdout,"OpenGL Reset\r\n"); + } + } } Index: aedTheme.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedTheme.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** aedTheme.cpp 6 Nov 2003 18:46:36 -0000 1.23 --- aedTheme.cpp 16 Apr 2004 01:29:56 -0000 1.24 *************** *** 40,48 **** { aedFont *font = widget->getFont(); std::string caption = widget->getCaption(); int sy, maxWidth = 18, maxHeight = 18; SDL_Rect gradRect; ! Uint32 borderColor; if(!caption.empty()) --- 40,59 ---- { aedFont *font = widget->getFont(); + void* screenORrect=NULL; + aedRect wdRect = widget->getRealPos(); + if(pApp->usesOpenGL()) + { + screenORrect = &wdRect; + } + else + { + screenORrect = screen; + } std::string caption = widget->getCaption(); int sy, maxWidth = 18, maxHeight = 18; SDL_Rect gradRect; ! //Uint32 borderColor; ! aedColor borderColor; if(!caption.empty()) *************** *** 62,72 **** if(widget->getActiveBorder()) { ! borderColor = SDL_MapRGBA(screen->format, 80, 80, 255, ! PROCESS_ALPHA(255, widget->getAlphaValue())); } else { ! borderColor = SDL_MapRGBA(screen->format, 0, 0, 0, ! PROCESS_ALPHA(60, widget->getAlphaValue())); } --- 73,83 ---- if(widget->getActiveBorder()) { ! borderColor.setAllColors(80, 80, 255, ! PROCESS_ALPHA(255, widget->getAlphaValue())); } else { ! borderColor.setAllColors(0, 0, 0, ! PROCESS_ALPHA(60, widget->getAlphaValue())); } *************** *** 83,106 **** SLOCK(screen); ! DrawPixel(screen, 2, sy + 2, borderColor); ! DrawPixel(screen, 2, sy + maxHeight - 2, borderColor); ! DrawPixel(screen, maxWidth - 2, sy + 2, borderColor); ! DrawPixel(screen, maxWidth - 2, sy + maxHeight - 2, borderColor); ! DrawLine(screen, 2, sy + 1, maxWidth - 3, sy + 1, borderColor); ! DrawLine(screen, 1, sy + 2, 1, sy + maxHeight - 3, borderColor); ! DrawLine(screen, maxWidth - 1, sy + 2, maxWidth - 1, sy + maxHeight - 3, borderColor); ! DrawLine(screen, 2, sy + maxHeight - 1, maxWidth - 3, sy + maxHeight - 1, borderColor); ! borderColor = ! SDL_MapRGBA(screen->format, 255, 255, 255, PROCESS_ALPHA(255, widget->getAlphaValue())); ! DrawLine(screen, 2, sy + 2, 2, sy + maxHeight - 3, borderColor); ! DrawLine(screen, maxWidth - 2, sy + 2, maxWidth - 2, sy + maxHeight - 3, borderColor); ! DrawLine(screen, 2, sy + 2, maxWidth - 3, sy + 2, borderColor); ! DrawLine(screen, 2, sy + maxHeight - 2, maxWidth - 3, sy + maxHeight - 2, borderColor); --- 94,116 ---- SLOCK(screen); ! DrawPixel(screenORrect, 2, sy + 2, borderColor); ! DrawPixel(screenORrect, 2, sy + maxHeight - 2, borderColor); ! DrawPixel(screenORrect, maxWidth - 2, sy + 2, borderColor); ! DrawPixel(screenORrect, maxWidth - 2, sy + maxHeight - 2, borderColor); ! DrawLine(screenORrect, 2, sy + 1, maxWidth - 3, sy + 1, borderColor); ! DrawLine(screenORrect, 1, sy + 2, 1, sy + maxHeight - 3, borderColor); ! DrawLine(screenORrect, maxWidth - 1, sy + 2, maxWidth - 1, sy + maxHeight - 3, borderColor); ! DrawLine(screenORrect, 2, sy + maxHeight - 1, maxWidth - 3, sy + maxHeight - 1, borderColor); ! borderColor.setAllColors(255, 255, 255, PROCESS_ALPHA(255, widget->getAlphaValue())); ! DrawLine(screenORrect, 2, sy + 2, 2, sy + maxHeight - 3, borderColor); ! DrawLine(screenORrect, maxWidth - 2, sy + 2, maxWidth - 2, sy + maxHeight - 3, borderColor); ! DrawLine(screenORrect, 2, sy + 2, maxWidth - 3, sy + 2, borderColor); ! DrawLine(screenORrect, 2, sy + maxHeight - 2, maxWidth - 3, sy + maxHeight - 2, borderColor); *************** *** 197,200 **** --- 207,221 ---- aedTheme::drawScrollBar(aedScrollBar * widget, SDL_Surface * screen) { + void* screenORrect=NULL; + aedRect wdRect = widget->getRealPos(); + if(pApp->usesOpenGL()) + { + screenORrect = &wdRect; + } + else + { + screenORrect = screen; + } + Uint16 maxHeight = screen->h - 1; Uint16 maxWidth = screen->w - 1; *************** *** 221,232 **** SLOCK(screen); ! Uint32 borderColor = SDL_MapRGBA(screen->format, 0, 0, 0, ! PROCESS_ALPHA(60, ! widget->getAlphaValue())); ! DrawLine(screen, -1, 0, maxWidth, 0, borderColor); ! DrawLine(screen, 0, 0, 0, maxHeight, borderColor); ! DrawLine(screen, maxWidth, 0, maxWidth, maxHeight, borderColor); ! DrawLine(screen, 0, maxHeight, maxWidth, maxHeight, borderColor); SUNLOCK(screen); } --- 242,253 ---- SLOCK(screen); ! aedColor borderColor(0, 0, 0, ! PROCESS_ALPHA(60, ! widget->getAlphaValue())); ! DrawLine(screenORrect, -1, 0, maxWidth, 0, borderColor); ! DrawLine(screenORrect, 0, 0, 0, maxHeight, borderColor); ! DrawLine(screenORrect, maxWidth, 0, maxWidth, maxHeight, borderColor); ! DrawLine(screenORrect, 0, maxHeight, maxWidth, maxHeight, borderColor); SUNLOCK(screen); } *************** *** 235,238 **** --- 256,269 ---- aedTheme::drawSlider(aedSlider * widget, SDL_Surface * screen) { + void* screenORrect=NULL; + aedRect wdRect = widget->getRealPos(); + if(pApp->usesOpenGL()) + { + screenORrect = &wdRect; + } + else + { + screenORrect = screen; + } Uint16 maxHeight = screen->h - 1; Uint16 maxWidth = screen->w - 1; *************** *** 260,271 **** SLOCK(screen); ! Uint32 borderColor = SDL_MapRGBA(screen->format, 0, 0, 0, ! PROCESS_ALPHA(60, ! widget->getAlphaValue())); ! ! DrawLine(screen, -1, 0, maxWidth, 0, borderColor); ! DrawLine(screen, 0, 0, 0, maxHeight, borderColor); ! DrawLine(screen, maxWidth, 0, maxWidth, maxHeight, borderColor); ! DrawLine(screen, 0, maxHeight, maxWidth, maxHeight, borderColor); SUNLOCK(screen); --- 291,302 ---- SLOCK(screen); ! aedColor borderColor(0, 0, 0, ! PROCESS_ALPHA(60, ! widget->getAlphaValue())); ! ! DrawLine(screenORrect, -1, 0, maxWidth, 0, borderColor); ! DrawLine(screenORrect, 0, 0, 0, maxHeight, borderColor); ! DrawLine(screenORrect, maxWidth, 0, maxWidth, maxHeight, borderColor); ! DrawLine(screenORrect, 0, maxHeight, maxWidth, maxHeight, borderColor); SUNLOCK(screen); *************** *** 275,278 **** --- 306,319 ---- aedTheme::drawFrame(aedFrame * widget, SDL_Surface * screen) { + void* screenORrect=NULL; + aedRect wdRect = widget->getRealPos(); + if(pApp->usesOpenGL()) + { + screenORrect = &wdRect; + } + else + { + screenORrect = screen; + } Uint16 minY = 0; Uint16 maxHeight = screen->h - 1; *************** *** 284,311 **** SLOCK(screen); ! Uint32 borderColor = SDL_MapRGBA(screen->format, 0, 0, 0, ! PROCESS_ALPHA(60, ! widget->getAlphaValue())); ! DrawPixel(screen, 2, minY + 2, borderColor); ! DrawPixel(screen, 2, maxHeight - 2, borderColor); ! DrawPixel(screen, maxWidth - 2, minY + 2, borderColor); ! DrawPixel(screen, maxWidth - 2, maxHeight - 2, borderColor); ! DrawLine(screen, 2, minY + 1, maxWidth - 3, minY + 1, borderColor); ! DrawLine(screen, 1, minY + 2, 1, maxHeight - 3, borderColor); ! DrawLine(screen, maxWidth - 1, minY + 2, maxWidth - 1, maxHeight - 3, borderColor); ! DrawLine(screen, 2, maxHeight - 1, maxWidth - 3, maxHeight - 1, borderColor); ! borderColor = ! SDL_MapRGBA(screen->format, 255, 255, 255, PROCESS_ALPHA(255, widget->getAlphaValue())); ! DrawLine(screen, 2, minY + 2, 2, maxHeight - 3, borderColor); ! DrawLine(screen, maxWidth - 2, minY + 2, maxWidth - 2, maxHeight - 3, borderColor); ! DrawLine(screen, 2, minY + 2, maxWidth - 3, minY + 2, borderColor); ! DrawLine(screen, 2, maxHeight - 2, maxWidth - 3, maxHeight - 2, borderColor); --- 325,351 ---- SLOCK(screen); ! aedColor borderColor(0, 0, 0, ! PROCESS_ALPHA(60, ! widget->getAlphaValue())); ! DrawPixel(screenORrect, 2, minY + 2, borderColor); ! DrawPixel(screenORrect, 2, maxHeight - 2, borderColor); ! DrawPixel(screenORrect, maxWidth - 2, minY + 2, borderColor); ! DrawPixel(screenORrect, maxWidth - 2, maxHeight - 2, borderColor); ! DrawLine(screenORrect, 2, minY + 1, maxWidth - 3, minY + 1, borderColor); ! DrawLine(screenORrect, 1, minY + 2, 1, maxHeight - 3, borderColor); ! DrawLine(screenORrect, maxWidth - 1, minY + 2, maxWidth - 1, maxHeight - 3, borderColor); ! DrawLine(screenORrect, 2, maxHeight - 1, maxWidth - 3, maxHeight - 1, borderColor); ! borderColor.setAllColors(255, 255, 255, PROCESS_ALPHA(255, widget->getAlphaValue())); ! DrawLine(screenORrect, 2, minY + 2, 2, maxHeight - 3, borderColor); ! DrawLine(screenORrect, maxWidth - 2, minY + 2, maxWidth - 2, maxHeight - 3, borderColor); ! DrawLine(screenORrect, 2, minY + 2, maxWidth - 3, minY + 2, borderColor); ! DrawLine(screenORrect, 2, maxHeight - 2, maxWidth - 3, maxHeight - 2, borderColor); *************** *** 357,363 **** aedTheme::drawBorder(aedWidget * widget, SDL_Surface * screen) { Uint16 maxWidth = screen->w - 1; Uint16 maxHeight = screen->h - 1; ! Uint32 borderColor; SLOCK(screen); --- 397,413 ---- aedTheme::drawBorder(aedWidget * widget, SDL_Surface * screen) { + void* screenORrect=NULL; + aedRect wdRect = widget->getRealPos(); + if(pApp->usesOpenGL()) + { + screenORrect = &wdRect; + } + else + { + screenORrect = screen; + } Uint16 maxWidth = screen->w - 1; Uint16 maxHeight = screen->h - 1; ! aedColor borderColor; SLOCK(screen); *************** *** 365,399 **** if(widget->hasFocus() && widget->isEnabled()) { ! borderColor = SDL_MapRGBA(screen->format, 80, 80, 255, ! PROCESS_ALPHA(255, widget->getAlphaValue())); } else { ! borderColor = SDL_MapRGBA(screen->format, 0, 0, 0, ! PROCESS_ALPHA(60, widget->getAlphaValue())); } if(widget->getBorder() == AED_BORDER_ROUND) { ! DrawPixel(screen, 2, 2, borderColor); ! DrawPixel(screen, 2, maxHeight - 2, borderColor); ! DrawPixel(screen, maxWidth - 2, 2, borderColor); ! DrawPixel(screen, maxWidth - 2, maxHeight - 2, borderColor); ! DrawLine(screen, 2, 1, maxWidth - 3, 1, borderColor); ! DrawLine(screen, 1, 2, 1, maxHeight - 3, borderColor); ! DrawLine(screen, maxWidth - 1, 2, maxWidth - 1, maxHeight - 3, borderColor); ! DrawLine(screen, 2, maxHeight - 1, maxWidth - 3, maxHeight - 1, borderColor); ! borderColor = ! SDL_MapRGBA(screen->format, 255, 255, 255, PROCESS_ALPHA(255, widget->getAlphaValue())); ! DrawLine(screen, 2, 2, 2, maxHeight - 3, borderColor); ! DrawLine(screen, maxWidth - 2, 2, maxWidth - 2, maxHeight - 3, borderColor); ! DrawLine(screen, 2, 2, maxWidth - 3, 2, borderColor); ! DrawLine(screen, 2, maxHeight - 2, maxWidth - 3, maxHeight - 2, borderColor); } --- 415,448 ---- if(widget->hasFocus() && widget->isEnabled()) { ! borderColor.setAllColors(80, 80, 255, ! PROCESS_ALPHA(255, widget->getAlphaValue())); } else { ! borderColor.setAllColors(0, 0, 0, ! PROCESS_ALPHA(60, widget->getAlphaValue())); } if(widget->getBorder() == AED_BORDER_ROUND) { ! DrawPixel(screenORrect, 2, 2, borderColor); ! DrawPixel(screenORrect, 2, maxHeight - 2, borderColor); ! DrawPixel(screenORrect, maxWidth - 2, 2, borderColor); ! DrawPixel(screenORrect, maxWidth - 2, maxHeight - 2, borderColor); ! DrawLine(screenORrect, 2, 1, maxWidth - 3, 1, borderColor); ! DrawLine(screenORrect, 1, 2, 1, maxHeight - 3, borderColor); ! DrawLine(screenORrect, maxWidth - 1, 2, maxWidth - 1, maxHeight - 3, borderColor); ! DrawLine(screenORrect, 2, maxHeight - 1, maxWidth - 3, maxHeight - 1, borderColor); ! borderColor.setAllColors(255, 255, 255, PROCESS_ALPHA(255, widget->getAlphaValue())); ! DrawLine(screenORrect, 2, 2, 2, maxHeight - 3, borderColor); ! DrawLine(screenORrect, maxWidth - 2, 2, maxWidth - 2, maxHeight - 3, borderColor); ! DrawLine(screenORrect, 2, 2, maxWidth - 3, 2, borderColor); ! DrawLine(screenORrect, 2, maxHeight - 2, maxWidth - 3, maxHeight - 2, borderColor); } *************** *** 401,408 **** { /* AED_BORDER_SQUARED */ ! DrawLine(screen, -1, 0, maxWidth, 0, borderColor); ! DrawLine(screen, 0, 0, 0, maxHeight, borderColor); ! DrawLine(screen, maxWidth, 0, maxWidth, maxHeight, borderColor); ! DrawLine(screen, 0, maxHeight, maxWidth, maxHeight, borderColor); } --- 450,457 ---- { /* AED_BORDER_SQUARED */ ! DrawLine(screenORrect, -1, 0, maxWidth, 0, borderColor); ! DrawLine(screenORrect, 0, 0, 0, maxHeight, borderColor); ! DrawLine(screenORrect, maxWidth, 0, maxWidth, maxHeight, borderColor); ! DrawLine(screenORrect, 0, maxHeight, maxWidth, maxHeight, borderColor); } *************** *** 412,424 **** // SDL_FillRect(screen, NULL, widget->getBGColor().getUint32(screen)); SLOCK(screen); ! DrawLine(screen, 0, 0, screen->w, 0, SDL_MapRGBA(screen->format, 213, 214, 205, 255)); ! DrawLine(screen, 0, -1, 0, screen->h - 1, SDL_MapRGBA(screen->format, 213, 214, 205, 255)); ! DrawLine(screen, 1, 1, screen->w - 2, 1, SDL_MapRGBA(screen->format, 172, 170, 164, 255)); ! DrawLine(screen, 1, 0, 1, screen->h - 2, SDL_MapRGBA(screen->format, 172, 170, 164, 255)); ! DrawLine(screen, 1, screen->h - 2, screen->w - 2, screen->h - 2, SDL_MapRGBA(screen->format, 246, 246, 238, 255)); SUNLOCK(screen); --- 461,473 ---- // SDL_FillRect(screen, NULL, widget->getBGColor().getUint32(screen)); SLOCK(screen); ! DrawLine(screenORrect, 0, 0, screen->w, 0, SDL_MapRGBA(screen->format, 213, 214, 205, 255)); ! DrawLine(screenORrect, 0, -1, 0, screen->h - 1, SDL_MapRGBA(screen->format, 213, 214, 205, 255)); ! DrawLine(screenORrect, 1, 1, screen->w - 2, 1, SDL_MapRGBA(screen->format, 172, 170, 164, 255)); ! DrawLine(screenORrect, 1, 0, 1, screen->h - 2, SDL_MapRGBA(screen->format, 172, 170, 164, 255)); ! DrawLine(screenORrect, 1, screen->h - 2, screen->w - 2, screen->h - 2, SDL_MapRGBA(screen->format, 246, 246, 238, 255)); SUNLOCK(screen); *************** *** 430,436 **** aedTheme::drawButton(aedButton * widget, SDL_Surface * screen) { Uint16 maxWidth = screen->w - 1; Uint16 maxHeight = screen->h - 1; ! Uint32 borderColor = 0; bool btnDown = widget->getButtonState(); --- 479,495 ---- aedTheme::drawButton(aedButton * widget, SDL_Surface * screen) { + void* screenORrect=NULL; + aedRect wdRect = widget->getRealPos(); + if(pApp->usesOpenGL()) + { + screenORrect = &wdRect; + } + else + { + screenORrect = screen; + } Uint16 maxWidth = screen->w - 1; Uint16 maxHeight = screen->h - 1; ! aedColor borderColor; bool btnDown = widget->getButtonState(); *************** *** 438,454 **** if(widget->isEnabled() && widget->hasFocus()) // We have Focus { ! borderColor = ! SDL_MapRGBA(screen->format, 80, 80, 255, ! PROCESS_ALPHA(255, widget->getAlphaValue())); ! DrawPixel(screen, 2, 2, borderColor); ! DrawPixel(screen, 2, maxHeight - 2, borderColor); ! DrawPixel(screen, maxWidth - 2, 2, borderColor); ! DrawPixel(screen, maxWidth - 2, maxHeight - 2, borderColor); ! DrawLine(screen, 2, 1, maxWidth - 3, 1, borderColor); ! DrawLine(screen, 1, 2, 1, maxHeight - 3, borderColor); ! DrawLine(screen, maxWidth - 1, 2, maxWidth - 1, maxHeight - 3, borderColor); ! DrawLine(screen, 2, maxHeight - 1, maxWidth - 3, maxHeight - 1, borderColor); } --- 497,512 ---- if(widget->isEnabled() && widget->hasFocus()) // We have Focus { ! borderColor.setAllColors(80, 80, 255, ! PROCESS_ALPHA(255, widget->getAlphaValue())); ! DrawPixel(screenORrect, 2, 2, borderColor); ! DrawPixel(screenORrect, 2, maxHeight - 2, borderColor); ! DrawPixel(screenORrect, maxWidth - 2, 2, borderColor); ! DrawPixel(screenORrect, maxWidth - 2, maxHeight - 2, borderColor); ! DrawLine(screenORrect, 2, 1, maxWidth - 3, 1, borderColor); ! DrawLine(screenORrect, 1, 2, 1, maxHeight - 3, borderColor); ! DrawLine(screenORrect, maxWidth - 1, 2, maxWidth - 1, maxHeight - 3, borderColor); ! DrawLine(screenORrect, 2, maxHeight - 1, maxWidth - 3, maxHeight - 1, borderColor); } *************** *** 456,509 **** { // this has to change ! borderColor = ! SDL_MapRGBA(screen->format, 0, 0, 0, PROCESS_ALPHA(60, widget->getAlphaValue())); ! DrawPixel(screen, 2, 2, borderColor); ! DrawPixel(screen, 2, maxHeight - 2, borderColor); ! DrawPixel(screen, maxWidth - 2, 2, borderColor); ! DrawPixel(screen, maxWidth - 2, maxHeight - 2, borderColor); ! DrawLine(screen, 2, 1, maxWidth - 3, 1, borderColor); ! DrawLine(screen, 1, 2, 1, maxHeight - 3, borderColor); ! DrawLine(screen, maxWidth - 1, 2, maxWidth - 1, maxHeight - 3, borderColor); ! DrawLine(screen, 2, maxHeight - 1, maxWidth - 3, maxHeight - 1, borderColor); } // Internal Borders ! borderColor = ! SDL_MapRGBA(screen->format, 255, 255, 255, PROCESS_ALPHA(255, widget->getAlphaValue())); ! DrawLine(screen, maxWidth - 2, 2, maxWidth - 2, maxHeight - 3, borderColor); ! DrawLine(screen, 2, maxHeight - 2, maxWidth - 3, maxHeight - 2, borderColor); ! borderColor = ! SDL_MapRGBA(screen->format, 238, 238, 230, PROCESS_ALPHA(255, widget->getAlphaValue())); ! DrawLine(screen, 2, 2, 2, maxHeight - 3, borderColor); if(btnDown) { // External Shadow ! borderColor = ! SDL_MapRGBA(screen->format, 0, 0, 0, PROCESS_ALPHA(25, widget->getAlphaValue())); ! DrawLine(screen, 2, 0, maxWidth - 4, 0, borderColor); ! DrawLine(screen, 0, 2, 0, maxHeight - 4, borderColor); ! DrawPixel(screen, 1, 2, borderColor); ! DrawPixel(screen, 2, 1, borderColor); } else { // External Shadow ! borderColor = ! SDL_MapRGBA(screen->format, 0, 0, 0, PROCESS_ALPHA(25, widget->getAlphaValue())); ! DrawLine(screen, 3, maxHeight, maxWidth - 3, maxHeight, borderColor); ! DrawLine(screen, maxWidth, 3, maxWidth, maxHeight - 3, borderColor); ! DrawPixel(screen, maxWidth - 1, maxHeight - 2, borderColor); ! DrawPixel(screen, maxWidth - 2, maxHeight - 1, borderColor); } --- 514,562 ---- { // this has to change ! borderColor.setAllColors(0, 0, 0, PROCESS_ALPHA(60, widget->getAlphaValue())); ! DrawPixel(screenORrect, 2, 2, borderColor); ! DrawPixel(screenORrect, 2, maxHeight - 2, borderColor); ! DrawPixel(screenORrect, maxWidth - 2, 2, borderColor); ! DrawPixel(screenORrect, maxWidth - 2, maxHeight - 2, borderColor); ! DrawLine(screenORrect, 2, 1, maxWidth - 3, 1, borderColor); ! DrawLine(screenORrect, 1, 2, 1, maxHeight - 3, borderColor); ! DrawLine(screenORrect, maxWidth - 1, 2, maxWidth - 1, maxHeight - 3, borderColor); ! DrawLine(screenORrect, 2, maxHeight - 1, maxWidth - 3, maxHeight - 1, borderColor); } // Internal Borders ! borderColor.setAllColors(255, 255, 255, PROCESS_ALPHA(255, widget->getAlphaValue())); ! DrawLine(screenORrect, maxWidth - 2, 2, maxWidth - 2, maxHeight - 3, borderColor); ! DrawLine(screenORrect, 2, maxHeight - 2, maxWidth - 3, maxHeight - 2, borderColor); ! borderColor.setAllColors(238, 238, 230, PROCESS_ALPHA(255, widget->getAlphaValue())); ! DrawLine(screenORrect, 2, 2, 2, maxHeight - 3, borderColor); if(btnDown) { // External Shadow ! borderColor.setAllColors(0, 0, 0, PROCESS_ALPHA(25, widget->getAlphaValue())); ! DrawLine(screenORrect, 2, 0, maxWidth - 4, 0, borderColor); ! DrawLine(screenORrect, 0, 2, 0, maxHeight - 4, borderColor); ! DrawPixel(screenORrect, 1, 2, borderColor); ! DrawPixel(screenORrect, 2, 1, borderColor); } else { // External Shadow ! borderColor.setAllColors(0, 0, 0, PROCESS_ALPHA(25, widget->getAlphaValue())); ! DrawLine(screenORrect, 3, maxHeight, maxWidth - 3, maxHeight, borderColor); ! DrawLine(screenORrect, maxWidth, 3, maxWidth, maxHeight - 3, borderColor); ! DrawPixel(screenORrect, maxWidth - 1, maxHeight - 2, borderColor); ! DrawPixel(screenORrect, maxWidth - 2, maxHeight - 1, borderColor); } *************** *** 543,546 **** --- 596,609 ---- aedTheme::drawSquareButton(aedButton * widget, SDL_Surface * screen) { + void* screenORrect=NULL; + aedRect wdRect = widget->getRealPos(); + if(pApp->usesOpenGL()) + { + screenORrect = &wdRect; + } + else + { + screenORrect = screen; + } SDL_Color c1, c2; SDL_Rect rect; *************** *** 573,593 **** SLOCK(screen); ! Uint32 borderColor; if(widget->isEnabled() && widget->hasFocus()) { ! borderColor = SDL_MapRGBA(screen->format, 80, 80, 255, PROCESS_ALPHA(255, widget->getAlphaValue())); } else { ! borderColor = SDL_MapRGBA(screen->format, 0, 0, 0, PROCESS_ALPHA(60, widget->getAlphaValue())); } ! DrawLine(screen, -1, 0, maxWidth, 0, borderColor); ! DrawLine(screen, 0, 0, 0, maxHeight, borderColor); ! DrawLine(screen, maxWidth, 0, maxWidth, maxHeight, borderColor); ! DrawLine(screen, 0, maxHeight, maxWidth, maxHeight, borderColor); SUNLOCK(screen); --- 636,656 ---- SLOCK(screen); ! aedColor borderColor; if(widget->isEnabled() && widget->hasFocus()) { ! borderColor.setAllColors(80, 80, 255, PROCESS_ALPHA(255, widget->getAlphaValue())); } else { ! borderColor.setAllColors(0, 0, 0, PROCESS_ALPHA(60, widget->getAlphaValue())); } ! DrawLine(screenORrect, -1, 0, maxWidth, 0, borderColor); ! DrawLine(screenORrect, 0, 0, 0, maxHeight, borderColor); ! DrawLine(screenORrect, maxWidth, 0, maxWidth, maxHeight, borderColor); ! DrawLine(screenORrect, 0, maxHeight, maxWidth, maxHeight, borderColor); SUNLOCK(screen); Index: aedButton.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedButton.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** aedButton.cpp 6 Nov 2003 18:46:36 -0000 1.23 --- aedButton.cpp 16 Apr 2004 01:29:56 -0000 1.24 *************** *** 121,128 **** a /= 2; ! DrawArrow(m_Surface, m_ButtonType - BUTTON_ARROW_UP, ! m_Surface->w / 2, m_Surface->h / 2, a, ! SDL_MapRGBA(m_Surface->format, 0, 0, 0, 255), ! isMouseOver(), SDL_MapRGBA(m_Surface->format, 0, 0, 0, 255)); } --- 121,141 ---- a /= 2; ! void* screenORrect = NULL; ! aedRect rect = getRealPos(); ! if(pApp->usesOpenGL()) ! { ! screenORrect = ▭ ! } ! else ! { ! screenORrect = m_Surface; ! } ! aedColor arrowColor(0, 0, 0, 255); ! aedColor arrowFillColor(0, 0, 0, 255); ! ! DrawArrow(screenORrect, m_ButtonType - BUTTON_ARROW_UP, ! rect.getWidth()/ 2, rect.getHeight()/ 2, a, ! arrowColor, ! isMouseOver(),arrowFillColor); } Index: aedTextBox.cpp =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/aedTextBox.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** aedTextBox.cpp 9 Jan 2004 05:49:18 -0000 1.34 --- aedTextBox.cpp 16 Apr 2004 01:29:56 -0000 1.35 *************** *** 393,396 **** --- 393,408 ---- aedColor SelectColor(0, 0, 200, 255); // TODO: This needs to come from the theme + void* screenORrect = NULL; + aedRect rect; + if(pApp->usesOpenGL()) + { + rect = getRealPos(); + screenORrect = ▭ + } + else + { + screenORrect = s1; + } + SLOCK(s1); // TODO: What should selected text look like? int x2 = SelectionStartX + SelectionWidth - 1; *************** *** 398,403 **** if(x2 >= s1->w) x2 = s1->w - 1; ! DrawRect(s1, SelectionStartX, 0, x2, SelectionBoxHeight - 1, ! SelectColor.getUint32(s1)); SUNLOCK(s1); } --- 410,415 ---- if(x2 >= s1->w) x2 = s1->w - 1; ! DrawRect(screenORrect, SelectionStartX, 0, x2, SelectionBoxHeight - 1, ! SelectColor); SUNLOCK(s1); } *************** *** 444,452 **** if(hasFocus() && m_ShowCaret &&... [truncated message content] |