[Python-ogre-commit] SF.net SVN: python-ogre: [409] trunk/python-ogre
Brought to you by:
andy_miller,
roman_yakovenko
From: <and...@us...> - 2007-10-05 08:20:17
|
Revision: 409 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=409&view=rev Author: andy_miller Date: 2007-10-05 01:20:21 -0700 (Fri, 05 Oct 2007) Log Message: ----------- Numerous updates for 1.1 Added ET Demo Added navi demo Modified Paths: -------------- trunk/python-ogre/ChangeLog.txt trunk/python-ogre/SConstruct trunk/python-ogre/code_generators/common_utils/__init__.py trunk/python-ogre/code_generators/common_utils/extract_documentation.py trunk/python-ogre/code_generators/ode/customization_data.py trunk/python-ogre/code_generators/ogre/generate_code.py trunk/python-ogre/code_generators/ogre/hand_made_wrappers.py trunk/python-ogre/code_generators/ogreal/generate_code.py trunk/python-ogre/code_generators/quickgui/generate_code.py trunk/python-ogre/demos/et/Demo_CEGUI_ET.py trunk/python-ogre/demos/et/resources.cfg Added Paths: ----------- trunk/python-ogre/PythonOgreInstallCreator.iss trunk/python-ogre/code_generators/navi/Navi.h trunk/python-ogre/code_generators/navi/NaviManager.h trunk/python-ogre/demos/et/media/ trunk/python-ogre/demos/et/media/ETShader.program trunk/python-ogre/demos/et/media/ETTerrain.material trunk/python-ogre/demos/et/media/ETcoverage.0.png trunk/python-ogre/demos/et/media/ETcoverage.1.png trunk/python-ogre/demos/et/media/ETlightmap.png trunk/python-ogre/demos/et/media/ETterrain.cfg trunk/python-ogre/demos/et/media/ETterrain.png trunk/python-ogre/demos/et/media/PSLighting.cg trunk/python-ogre/demos/et/media/PSSplat.cg trunk/python-ogre/demos/et/media/PSSplat2.cg trunk/python-ogre/demos/et/media/VSLodMorph.cg trunk/python-ogre/demos/et/media/VSLodMorph2.cg trunk/python-ogre/demos/et/media/brush.png trunk/python-ogre/demos/et/media/splatting0.png trunk/python-ogre/demos/et/media/splatting1.png trunk/python-ogre/demos/et/media/splatting2.png trunk/python-ogre/demos/et/media/splatting3.png trunk/python-ogre/demos/et/media/splatting4.png trunk/python-ogre/demos/et/media/splatting5.png trunk/python-ogre/demos/media/fonts/read_me.html trunk/python-ogre/demos/navi/Media/ trunk/python-ogre/demos/navi/Media/NaviDemo.material trunk/python-ogre/demos/navi/Media/OgreCore.zip trunk/python-ogre/demos/navi/Media/Thumbs.db trunk/python-ogre/demos/navi/Media/cerulean.jpg trunk/python-ogre/demos/navi/Media/clouds.jpg trunk/python-ogre/demos/navi/Media/cursor1.png trunk/python-ogre/demos/navi/Media/cursor2.png trunk/python-ogre/demos/navi/Media/cursor3.png trunk/python-ogre/demos/navi/Media/cursor4.png trunk/python-ogre/demos/navi/Media/cursor5.png trunk/python-ogre/demos/navi/Media/cursor6.png trunk/python-ogre/demos/navi/Media/cursorMove.png trunk/python-ogre/demos/navi/Media/grass.jpg trunk/python-ogre/demos/navi/Media/knot.mesh trunk/python-ogre/demos/navi/NaviLocal/ trunk/python-ogre/demos/navi/NaviLocal/Navi.js trunk/python-ogre/demos/navi/NaviLocal/Navi.vcproj trunk/python-ogre/demos/navi/NaviLocal/Navi.vcproj.JNPR.amiller.user trunk/python-ogre/demos/navi/NaviLocal/Thumbs.db trunk/python-ogre/demos/navi/NaviLocal/equip.html trunk/python-ogre/demos/navi/NaviLocal/hp_down.png trunk/python-ogre/demos/navi/NaviLocal/hp_up.png trunk/python-ogre/demos/navi/NaviLocal/hpbar.png trunk/python-ogre/demos/navi/NaviLocal/hpbar_gloss.png trunk/python-ogre/demos/navi/NaviLocal/jsTrace.js trunk/python-ogre/demos/navi/NaviLocal/menubar.html trunk/python-ogre/demos/navi/NaviLocal/mootools.v1.1.js trunk/python-ogre/demos/navi/NaviLocal/mootools.v1.11.js trunk/python-ogre/demos/navi/NaviLocal/navichat_bg.png trunk/python-ogre/demos/navi/NaviLocal/naviequip_bg.png trunk/python-ogre/demos/navi/NaviLocal/navimenu_bg.png trunk/python-ogre/demos/navi/NaviLocal/off.png trunk/python-ogre/demos/navi/NaviLocal/on.png trunk/python-ogre/demos/navi/NaviLocal/shield.jpg trunk/python-ogre/demos/navi/NaviLocal/status.html trunk/python-ogre/demos/navi/NaviLocal/status_bg.png trunk/python-ogre/demos/navi/NaviLocal/status_gloss.png trunk/python-ogre/demos/navi/NaviLocal/sword.jpg trunk/python-ogre/demos/navi/NaviProfile/ trunk/python-ogre/demos/navi/chrome/ trunk/python-ogre/demos/navi/components/ trunk/python-ogre/demos/navi/greprefs/ trunk/python-ogre/demos/navi/ogre.cfg trunk/python-ogre/demos/navi/plugins/ trunk/python-ogre/demos/navi/res/ trunk/python-ogre/packages_2.5/ogre/addons/et/ trunk/python-ogre/packages_2.5/ogre/addons/et/__init__.py trunk/python-ogre/packages_2.5/ogre/addons/ogreforests/ trunk/python-ogre/packages_2.5/ogre/addons/ogreforests/__init__.py Removed Paths: ------------- trunk/python-ogre/SConstruct.vc8 Modified: trunk/python-ogre/ChangeLog.txt =================================================================== --- trunk/python-ogre/ChangeLog.txt 2007-10-05 04:16:07 UTC (rev 408) +++ trunk/python-ogre/ChangeLog.txt 2007-10-05 08:20:21 UTC (rev 409) @@ -1,22 +1,26 @@ -xxx 2007: Version 1.1 Release -=============================== +October 05 2007: Version 1.1 Release +==================================== * Built with Ogre 1.4.4+ * Added Theora module for video playback +* Added Plib support - Sound and Networking + subset of ssg +* Added OgreForests -- a paging landscape manager +* Added Editable Terrain (Thanks Dermont) +* Added OgreBullet Support -- sperate modules for collission and dynamics +* Added Navi gui support - This REALLY needs Python built with VC8 and so IS BUGGY + all current python binaries for Windows are built with VC7 with an older MSVC runtime library that conflicts + with the javascript interpreter thats part of the Mozilla libraries * Code generated with updated Py++ that fixes 'already exposed' issues with multiple modules * Updated QuickGui - SVN * Updated NxOgre using version 0.9-38 -* Added initial Plib support - Sound and Networking + subset of ssg +* updated NxOgre config and framework (bug fixes) * Bug fix to OgreAL to fix ogg playback and general stability * Ogre code generation improvements - Ctype support for 'void const *' (changed to unsigned int) previous version only modified 'void *' (missed the const variables) Fixed cases where multiple void *'s in argument list - only first one was being fixed Moved common functions into common_utils so single place to fix -- need to implement for other modules + Created VARNAME_Copy helper functions for readonly variables, incase you want a copy for your own use * added helper function for PixelBox ("getData") to give access to the data variable * updated the vcredist files to the current version -* updated NxOgre config and framework (bug fixes) -* Added "navi" gui support - Now this REALLY needs Python built with VC8 and so IS BUGGY - all current python binaries for Windows are built with VC7 with an older MSVC runtime library that conflicts - with the javascript interpreter thats part of the Mozilla libraries * demos/media is now the standard OgreSDK media directory where necessary each demo directory has a ./media directory for additional 'demo' media Added: trunk/python-ogre/PythonOgreInstallCreator.iss =================================================================== --- trunk/python-ogre/PythonOgreInstallCreator.iss (rev 0) +++ trunk/python-ogre/PythonOgreInstallCreator.iss 2007-10-05 08:20:21 UTC (rev 409) @@ -0,0 +1,476 @@ +; +; Python-Ogre setup script +; +[Setup] +AppName=Python-Ogre +AppVerName=Python-Ogre 1.1 +DefaultDirName=C:\PythonOgre +DefaultGroupName=Python-Ogre +OutputBaseFilename=PythonOgreInstaller +OutputDir=C:\temp +SourceDir=C:\Development\PythonOgreRelease +VersionInfoDescription=Release 1.1 of Python-Ogre +AllowNoIcons=true +AppPublisher=OpenSource +AppPublisherURL=http://www.python-ogre.org +AppSupportURL=http://www.python-ogre.org +AppUpdatesURL=http://www.python-ogre.org +AppVersion=1.1.0 +LicenseFile=LICENSE.GPL +Compression=lzma +InfoBeforeFile=InstallWarning.rtf +InfoAfterFile=postinstall.rtf +SolidCompression=true +AppCopyright=LPGL +VersionInfoCompany=OpenSource +VersionInfoTextVersion=1.1.0 +VersionInfoCopyright=PythonOgre Development Team +RestartIfNeededByRun=false +UninstallDisplayName=PythonOgre +WizardImageFile=compiler:WizModernImage-IS.bmp +WizardSmallImageFile=compiler:WizModernSmallImage-IS.bmp +VersionInfoVersion=1.1.0 +[Files] +; base files, demos and tools +Source: *; DestDir: {app} +Source: plugins\*; DestDir: {app}\plugins +Source: tools\*; DestDir: {app}\tools +Source: demos\*; DestDir: {app}\demos; Flags: recursesubdirs +Source: docs\*; DestDir: {app}\docs; Flags: recursesubdirs +; the python modules - in the event we find python +Source: packages_2.5\*; DestDir: {code:GetPythonSiteDir}; Flags: recursesubdirs; Check: SelectedPython('2.5') +; the python modules again - if we don't find python we install both versions in the app directory +Source: packages_2.5\*; DestDir: {app}\packages_2.5; Flags: recursesubdirs; Check: NoPythonFound +; +; we need to remove the .pyc files when we uninstall +; +Source: ThirdParty\dxwebsetup.exe; DestDir: {app}\ThirdParty +Source: ThirdParty\vcredist_x86.exe; DestDir: {app}\ThirdParty + +[UninstallDelete] +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\*.pyc +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\renderer\*.pyc +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\renderer\OGRE\*.pyc +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\io\*.pyc +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\io\OIS\*.pyc +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\gui\*.pyc +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\gui\CEGUI\*.pyc +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\gui\QuickGUI\*.pyc +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\gui\BetaGUI\*.pyc +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\sound\*.pyc +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\sound\OgreAL\*.pyc +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\physics\*.pyc +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\physics\OgreRefApp\*.pyc +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\physics\ODE\*.pyc +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\physics\OgreOde\*.pyc +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\physics\OgreNewt\*.pyc +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\physics\NxOgre\*.pyc +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\physics\Physx\*.pyc +Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\physics\OpCode\*.pyc + +Type: files; Name: {app}\demos\CEGUI\*.pyc +Type: files; Name: {app}\demos\CEGUI\*.log +Type: files; Name: {app}\demos\CEGUI\*.cfg +Type: files; Name: {app}\demos\GUI\*.pyc +Type: files; Name: {app}\demos\GUI\*.log +Type: files; Name: {app}\demos\GUI\*.cfg +Type: files; Name: {app}\demos\ogre\*.pyc +Type: files; Name: {app}\demos\ogre\*.log +Type: files; Name: {app}\demos\ogre\*.cfg +Type: files; Name: {app}\demos\ogreode\*.pyc +Type: files; Name: {app}\demos\ogreode\*.log +Type: files; Name: {app}\demos\ogreode\*.cfg +Type: files; Name: {app}\demos\ogrenewt\*.pyc +Type: files; Name: {app}\demos\ogrenewt\*.log +Type: files; Name: {app}\demos\ogrenewt\*.cfg +Type: files; Name: {app}\demos\ogreal\*.pyc +Type: files; Name: {app}\demos\ogreal\*.log +Type: files; Name: {app}\demos\ogreal\*.cfg +Type: files; Name: {app}\demos\ode\*.pyc +Type: files; Name: {app}\demos\ode\*.log +Type: files; Name: {app}\demos\ode\*.cfg +Type: files; Name: {app}\demos\ffmpeg\*.pyc +Type: files; Name: {app}\demos\ffmpeg\*.log +Type: files; Name: {app}\demos\ffmpeg\*.cfg +Type: files; Name: {app}\demos\nxogre\*.pyc +Type: files; Name: {app}\demos\nxogre\*.log +Type: files; Name: {app}\demos\nxogre\*.cfg +Type: files; Name: {app}\demos\dshow\*.pyc +Type: files; Name: {app}\demos\dshow\*.log +Type: files; Name: {app}\demos\dshow\*.cfg +Type: dirifempty; Name: {app}\demos\CEGUI +Type: dirifempty; Name: {app}\demos\GUI +Type: dirifempty; Name: {app}\demos\ogre +Type: dirifempty; Name: {app}\demos\ogreode +Type: dirifempty; Name: {app}\demos\ogrenewt +Type: dirifempty; Name: {app}\demos\ogreal +Type: dirifempty; Name: {app}\demos\ode +Type: dirifempty; Name: {app}\demos\nxogre +Type: dirifempty; Name: {app}\demos\ffmepg +Type: dirifempty; Name: {app}\demos\dshow +Type: dirifempty; Name: {app}\demos +Type: dirifempty; Name: {app} + +; +; I REALLY DON'T like doing this but if people have used a previous version of Python-Ogre +; I need to remove it to force any existing source code to fail and hence have them +; update to the new directory structure.. +; being very conservative in this!!!!!!!!!!!!! +; +[InstallDelete] +Type: files; Name: {code:GetPythonSiteDir}\Ogre\*.pyd +Type: files; Name: {code:GetPythonSiteDir}\OIS\*.pyd +Type: files; Name: {code:GetPythonSiteDir}\GUI\*.pyd +Type: files; Name: {code:GetPythonSiteDir}\OgreOde\*.pyd +Type: files; Name: {code:GetPythonSiteDir}\OgreNewt\*.pyd +Type: files; Name: {code:GetPythonSiteDir}\OgreAL\*.pyd +Type: files; Name: {code:GetPythonSiteDir}\OgreRefApp\*.pyd +Type: files; Name: {code:GetPythonSiteDir}\ODE\*.pyd +Type: files; Name: {code:GetPythonSiteDir}\FMOD\*.pyd + +Type: files; Name: {code:GetPythonSiteDir}\Ogre\*.dll +Type: files; Name: {code:GetPythonSiteDir}\OIS\*.dll +Type: files; Name: {code:GetPythonSiteDir}\GUI\*.dll +Type: files; Name: {code:GetPythonSiteDir}\OgreOde\*.dll +Type: files; Name: {code:GetPythonSiteDir}\OgreNewt\*.dll +Type: files; Name: {code:GetPythonSiteDir}\OgreAL\*.dll +Type: files; Name: {code:GetPythonSiteDir}\OgreRefApp\*.dll +Type: files; Name: {code:GetPythonSiteDir}\ODE\*.dll +Type: files; Name: {code:GetPythonSiteDir}\FMOD\*.dll + +Type: files; Name: {code:GetPythonSiteDir}\Ogre\_*.p* +Type: files; Name: {code:GetPythonSiteDir}\OIS\_*.p* +Type: files; Name: {code:GetPythonSiteDir}\GUI\_*.p* +Type: files; Name: {code:GetPythonSiteDir}\OgreOde\_*.p* +Type: files; Name: {code:GetPythonSiteDir}\OgreNewt\_*.p* +Type: files; Name: {code:GetPythonSiteDir}\OgreAL\_*.p* +Type: files; Name: {code:GetPythonSiteDir}\OgreRefApp\_*.p* +Type: files; Name: {code:GetPythonSiteDir}\ODE\_*.p* +Type: files; Name: {code:GetPythonSiteDir}\FMOD\_*.p* + +Type: files; Name: {code:GetPythonSiteDir}\Ogre\sf_*.* + +Type: files; Name: {code:GetPythonSiteDir}\Ogre +Type: files; Name: {code:GetPythonSiteDir}\OIS +Type: files; Name: {code:GetPythonSiteDir}\GUI +Type: files; Name: {code:GetPythonSiteDir}\OgreOde +Type: files; Name: {code:GetPythonSiteDir}\OgreNewt +Type: files; Name: {code:GetPythonSiteDir}\OgreAL +Type: files; Name: {code:GetPythonSiteDir}\OgreRefApp +Type: files; Name: {code:GetPythonSiteDir}\ODE +Type: files; Name: {code:GetPythonSiteDir}\FMOD + +Type: dirifempty; Name: {code:GetPythonSiteDir}\Ogre +Type: dirifempty; Name: {code:GetPythonSiteDir}\OIS +Type: dirifempty; Name: {code:GetPythonSiteDir}\GUI +Type: dirifempty; Name: {code:GetPythonSiteDir}\OgreOde +Type: dirifempty; Name: {code:GetPythonSiteDir}\OgreNewt +Type: dirifempty; Name: {code:GetPythonSiteDir}\OgreAL +Type: dirifempty; Name: {code:GetPythonSiteDir}\OgreRefApp +Type: dirifempty; Name: {code:GetPythonSiteDir}\ODE + +[Icons] +Name: {group}\Ogre Demos\Bezier; Filename: {code:GetPythonExe}; Parameters: Demo_Bezier.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\BSP; Filename: {code:GetPythonExe}; Parameters: Demo_BSP.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\BSP_Collision; Filename: {code:GetPythonExe}; Parameters: Demo_BspCollision.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Camera Tracking; Filename: {code:GetPythonExe}; Parameters: Demo_CameraTracking.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\CEL Shading; Filename: {code:GetPythonExe}; Parameters: Demo_CelShading.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Compositor; Filename: {code:GetPythonExe}; Parameters: Demo_Compositor.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\ENV Map; Filename: {code:GetPythonExe}; Parameters: Demo_EnvMap.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Facial; Filename: {code:GetPythonExe}; Parameters: Demo_Facial.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Fish; Filename: {code:GetPythonExe}; Parameters: Demo_OneFish.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Fresnel; Filename: {code:GetPythonExe}; Parameters: Demo_Fresnel.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Grass; Filename: {code:GetPythonExe}; Parameters: Demo_Grass.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Lighting; Filename: {code:GetPythonExe}; Parameters: Demo_Lighting.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Particles; Filename: {code:GetPythonExe}; Parameters: Demo_ParticleFX.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Render to Texture; Filename: {code:GetPythonExe}; Parameters: Demo_RenderToTexture.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Shadows; Filename: {code:GetPythonExe}; Parameters: Demo_Shadows_Org.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Animation 1; Filename: {code:GetPythonExe}; Parameters: Demo_SkeletalAnimation.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Animation 2; Filename: {code:GetPythonExe}; Parameters: Demo_SkeletonAnimation.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Sky Box; Filename: {code:GetPythonExe}; Parameters: Demo_SkyBox.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Sky Dome; Filename: {code:GetPythonExe}; Parameters: Demo_SkyDome.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Sky Plane; Filename: {code:GetPythonExe}; Parameters: Demo_SkyPlane.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Smoke; Filename: {code:GetPythonExe}; Parameters: Demo_Smoke.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Terrain; Filename: {code:GetPythonExe}; Parameters: Demo_Terrain.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Textures; Filename: {code:GetPythonExe}; Parameters: Demo_TextureFX.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\Transparency; Filename: {code:GetPythonExe}; Parameters: Demo_Transparency.py; WorkingDir: {app}\Demos\Ogre +Name: {group}\Ogre Demos\WX Gui; Filename: {code:GetPythonExe}; Parameters: Demo_WX.py; WorkingDir: {app}\Demos\Ogre + +Name: {group}\GUI\CEGUI - Basic; Filename: {code:GetPythonExe}; Parameters: Demo_CEGUI_Gui.py; WorkingDir: {app}\Demos\gui +Name: {group}\GUI\CEGUI Drag and Drop; Filename: {code:GetPythonExe}; Parameters: Demo_CEGUI_DragnDrop.py; WorkingDir: {app}\Demos\gui +Name: {group}\GUI\CEGUI - Nice; Filename: {code:GetPythonExe}; Parameters: Demo_CEGUI_NewGui.py; WorkingDir: {app}\Demos\gui +Name: {group}\GUI\QuickGUI-01; Filename: {code:GetPythonExe}; Parameters: Demo_QuickGUI01.py; WorkingDir: {app}\Demos\gui +Name: {group}\GUI\Navi; Filename: {code:GetPythonExe}; Parameters: Demo_Navi.py; WorkingDir: {app}\Demos\gui + +Name: {group}\ODE Demos\Multiple Scenes; Filename: {code:GetPythonExe}; Parameters: Demo_Scenes.py; WorkingDir: {app}\Demos\OgreOde +Name: {group}\ODE Demos\Gran Turism; Filename: {code:GetPythonExe}; Parameters: GranTurismOgre.py; WorkingDir: {app}\Demos\OgreOde + +Name: {group}\OgreAL Demos\Basic Sound; Filename: {code:GetPythonExe}; Parameters: Demo_RenderToTexture.py; WorkingDir: {app}\Demos\OgreAL + +Name: {group}\OgreNewt Demos\Basics; Filename: {code:GetPythonExe}; Parameters: Demo01_TheBasics.py; WorkingDir: {app}\Demos\OgreNewt +Name: {group}\OgreNewt Demos\Joints; Filename: {code:GetPythonExe}; Parameters: Demo02_Joints.py; WorkingDir: {app}\Demos\OgreNewt +Name: {group}\OgreNewt Demos\Collision Callbacks; Filename: {code:GetPythonExe}; Parameters: Demo03_CollisionCallbacks.py; WorkingDir: {app}\Demos\OgreNewt +Name: {group}\OgreNewt Demos\Ray Casting; Filename: {code:GetPythonExe}; Parameters: Demo04_RayCasting.py; WorkingDir: {app}\Demos\OgreNewt +Name: {group}\OgreNewt Demos\Simple Vehicle; Filename: {code:GetPythonExe}; Parameters: Demo05_SimpleVehicle.py; WorkingDir: {app}\Demos\OgreNewt +Name: {group}\OgreNewt Demos\Simple Buoyancy; Filename: {code:GetPythonExe}; Parameters: Demo06_SimpleBuoyancy.py; WorkingDir: {app}\Demos\OgreNewt +Name: {group}\OgreNewt Demos\Custom Joints; Filename: {code:GetPythonExe}; Parameters: Demo07_CustomJoints.py; WorkingDir: {app}\Demos\OgreNewt +Name: {group}\OgreNewt Demos\Ragdoll; Filename: {code:GetPythonExe}; Parameters: Demo08_ragdoll.py; WorkingDir: {app}\Demos\OgreNewt + +Name: {group}\Video Demos\ffmpeg Video; Filename: {code:GetPythonExe}; Parameters: Demo_Video.py; WorkingDir: {app}\Demos\ffmpeg +Name: {group}\Video Demos\DirectShow Video; Filename: {code:GetPythonExe}; Parameters: Demo_Video.py; WorkingDir: {app}\Demos\dshow +Name: {group}\Video Demos\Theora Video; Filename: {code:GetPythonExe}; Parameters: Demo_Video.py; WorkingDir: {app}\Demos\theora + +Name: {group}\NxOgre\Download AGEIA drivers first; Filename: http://www.ageia.com/drivers/drivers.html +Name: {group}\NxOgre\Cakewalk; Filename: {code:GetPythonExe}; Parameters: Cakeframework.py; WorkingDir: {app}\Demos\nxogre +Name: {group}\NxOgre\Demo101; Filename: {code:GetPythonExe}; Parameters: Demo_101.py; WorkingDir: {app}\Demos\nxogre +Name: {group}\NxOgre\Demo102; Filename: {code:GetPythonExe}; Parameters: Demo_102.py; WorkingDir: {app}\Demos\nxogre +Name: {group}\NxOgre\Demo103; Filename: {code:GetPythonExe}; Parameters: Demo_103.py; WorkingDir: {app}\Demos\nxogre + +Name: {group}\Plib Demos\Networking - Server; Filename: {code:GetPythonExe}; Parameters: Demo_Server.py; WorkingDir: {app}\Demos\plib +Name: {group}\Plib Demos\Networking - Client; Filename: {code:GetPythonExe}; Parameters: Demo_Client.py; WorkingDir: {app}\Demos\plib +Name: {group}\Plib Demos\Sound; Filename: {code:GetPythonExe}; Parameters: Demo_Sound.py; WorkingDir: {app}\Demos\plib + +Name: {group}\OgreForests Demos\ogreoforests; Filename: {code:GetPythonExe}; Parameters: Demo_Forests.py; WorkingDir: {app}\Demos\ogreforests + +Name: {group}\Uninstall Python-Ogre; Filename: {uninstallexe} +Name: {group}\Python-Ogre API Documenatation; Filename: {app}\docs\Python-Ogre.chm +;Name: {group}\Python-Ogre API (Html); Filename: {app}\docs\html\index.html + +[Run] +Filename: {app}\ThirdParty\vcredist_x86.exe +Filename: {app}\ThirdParty\dxwebsetup.exe; Description: DirectX Installer; StatusMsg: You probably NEED to update your Directx Drivers; Flags: postinstall + +[Code] +var + Page: TInputOptionWizardPage; + NumPythonVersions : Integer; + PythonVersions : array of String; + PythonLocations : array of String; + PythonVersion : String; + DisplayedPythonWarning : Boolean; + SupportedVersions : array of String; + Debug : Boolean; + +function NoPythonFound(): Boolean; +begin + if NumPythonVersions = 0 then + Result := True + else + Result := False; +end; + + +function FoundPython ( ver: String ) : Boolean; +var + I : Integer; +begin + Result := False; + if NumPythonVersions = 0 then + Result := False + else + for I:=0 to GetArrayLength(PythonVersions)-1 do + if PythonVersions[I] = ver then Result := True; +end; + + +function FoundPythonIn ( ver: String; listin: array of String ) : Boolean; +var + I : Integer; +begin + Result := False; + if GetArrayLength(listin) = 0 then + Result := False + else + for I:=0 to GetArrayLength(listin)-1 do + if listin[I] = ver then Result := True; +end; + +function SelectedPython ( ver: String ) : Boolean; +var + I : Integer; +begin + if PythonVersion = ver then + Result := True + else + Result := False; +end; + +function IsSupportedVersion ( Param: String ) : Boolean; +var + I: Integer; +begin + Result := True; +// msgbox ('Checking Supported Versions ' + Param + IntToStr(GetArrayLength(SupportedVersions) ), mbInformation, MB_OK); + + for I:=0 to GetArrayLength(SupportedVersions)-1 do begin + if Param = SupportedVersions[i] then Result := True; +// msgbox ( 'Checked ' + SupportedVersions[i], mbInformation, MB_OK); + end; +end; + + +{ +Get the python versions -- we have to check two registry "areas" as python allows +the install to be "for everyone", or "just for me" which is a pain.. Further more +sometimes when you uninstall python it doesn't remove the registry entries so I +need to check the python executable exists as well +} +function GetInstalledPythonVersions() : Integer; + +var + i, count: Integer; + p: string; + Result1 : array of String; + tempv, templ : array of String; +begin + tempv := ['','']; + templ := ['','']; + count := 0; + RegGetSubkeyNames(HKEY_LOCAL_MACHINE, 'SOFTWARE\Python\PythonCore', Result1); + // if we have versions here process them + for i:=0 to GetArrayLength(Result1)-1 do + if IsSupportedVersion ( Result1[i] ) then begin // make sure we support it.. + if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Python\PythonCore\' + Result1[i] + '\InstallPath', '', p) then begin + if FileExists ( p + '\python.exe' ) then begin + tempv[count] := Result1[i]; + templ[count] := p; // save the location + count := count + 1; + end; + end; + end; + + + if count < 2 then begin // we've only found zero, or one version so far.. + // OK so we should now have all the valid versions listed in LOCAL_MACHINE + RegGetSubkeyNames(HKEY_CURRENT_USER, 'SOFTWARE\Python\PythonCore', Result1); + for i:=0 to GetArrayLength(Result1)-1 do + if not FoundPythonIn ( Result1[i], tempv ) then // check we don't already know about this version + if IsSupportedVersion (Result1[i]) then begin + if RegQueryStringValue(HKEY_CURRENT_USER, 'SOFTWARE\Python\PythonCore\' + Result1[i] + '\InstallPath', '', p) then begin + if FileExists ( p + '\python.exe' ) then begin + tempv[count] := Result1[i]; + templ[count] := p; + count := count + 1; + end; + end; + end; + + end; + for i:=0 to 1 do + if ( Length(tempv[i]) > 0 ) then begin + setarraylength ( PythonVersions, getarraylength (PythonVersions) + 1); + PythonVersions[getarraylength(PythonVersions)-1] := tempv[i]; + setarraylength ( PythonLocations, getarraylength (Pythonlocations) + 1); + PythonLocations[getarraylength(PythonLocations)-1] := templ[i]; + end; + + Result := GetArrayLength ( PythonVersions ); +end; + +function GetPythonInstallPath(Ver: String) : String; +var + I : Integer; +begin + Result := '' + for i:=0 to NumPythonVersions -1 do begin + if Ver = PythonVersions[i] then Result:= PythonLocations[i]; + end +end; + +function GetPythonSiteDir(Param: String) : String; +begin + Result := GetPythonInstallPath ( PythonVersion ) + 'Lib\site-packages'; +end; + +function GetPythonExe ( Param: String) : String; +begin + if NumPythonVersions > 0 then + Result := GetPythonInstallPath ( PythonVersion ) + '\python.exe' + else + Result := 'python.exe'; +end; + +function ShouldSkipPage(PageID: Integer): Boolean; +begin + Result := False; + if PageID = Page.ID then begin + if NumPythonVersions = 1 then + Result := True; + if NumPythonVersions = 0 then begin + if DisplayedPythonWarning = False then + MsgBox('Unable to Find Python - will install all versions - "python setup.py install" will need to be run', mbInformation, MB_OK); + DisplayedPythonWarning := True; + Result := True; + end; + end; +end; + + +function NextButtonClick(PageID: Integer): Boolean; +begin + Result := True; + if PageID = Page.ID then + PythonVersion := PythonVersions[Page.SelectedValueIndex] +end; + +function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String; +begin + Result:= 'Python-Ogre is about to be installed....' + NewLine + NewLine + + 'Tools, demos, and documentation will be installed to:' + NewLine + + Space + ExpandConstant('{app}') + NewLine + NewLine; + if NoPythonFound then begin + Result := Result + 'Python was not found so the python modules will' + NewLine + + Space + 'be installed under ' + ExpandConstant('{app}') +'.' + NewLine + + Space + 'You will need to run "python setup.py install" to install the modules' + + NewLine + NewLine + + Space + 'The program links will probably be broken as Python was not found'; + end else begin + Result := Result + 'Python Modules will be installed to:' + NewLine + + Space + GetPythonSiteDir ( PythonVersion ) + NewLine; + end; +end; +{ we have an issue that sometimes the older python ogre is not uninstalled or completely +deleted by out predelete file lists -- probably because a file has been added etc +This is OK except it leave the module directory with the wrong name so we need to fix this +} +procedure CurStepChanged(CurStep: TSetupStep); +begin + if CurStep = ssInstall then begin + if DirExists ( GetPythonSiteDir('') + '\Ogre' ) then begin + RenameFile ( GetPythonSiteDir('') + '\Ogre', GetPythonSiteDir('') + '\ogre' ); + end; + end; +end; + +procedure InitializeWizard(); +var + I: Integer; +begin + + DisplayedPythonWarning := False; + PythonVersion := ''; + SupportedVersions := ['2.4', '2.5']; + Debug := False; + + NumPythonVersions := GetInstalledPythonVersions(); + if Debug then + msgbox ('Number Of Python Versions is ' + InttoStr( NumPythonVersions), mbInformation, MB_OK); + if NumPythonVersions = 1 then + PythonVersion := PythonVersions[0]; + if Debug then + msgbox ('Using python version ' + PythonVersion, mbInformation, MB_OK); + + Page := CreateInputOptionPage(wpLicense, + 'Select Python Version', 'Multiple Version of Python Found - Select one', + 'Please select the version of Python you would like to have Python-Ogre installed for..', + True, False); + if NumPythonVersions > 0 then begin + for I:=0 to GetArrayLength(PythonVersions)-1 do begin + Page.Add ('Python Version ' + PythonVersions[I] ); + Page.Values[I] := False; + end; + Page.Values[I-1] := True; + end + + +end; Modified: trunk/python-ogre/SConstruct =================================================================== --- trunk/python-ogre/SConstruct 2007-10-05 04:16:07 UTC (rev 408) +++ trunk/python-ogre/SConstruct 2007-10-05 08:20:21 UTC (rev 409) @@ -91,16 +91,16 @@ possible_projects = ['ogre' , 'ois', 'ogrerefapp', 'ogrenewt', 'cegui', 'ode',\ 'ogreode', 'ogreal', 'quickgui', 'opcode', 'nxogre', 'bullet', 'physx', 'betagui','theora',\ 'ogrevideoffmpeg', 'ogredshow', 'plib', 'ogrebulletc', 'ogrebulletd', - 'ogreforests', 'et' ] # , 'raknet', 'navi', + 'ogreforests', 'et', 'navi' ] # , 'raknet' default_projects = ['ogre' , 'ois', 'ogrerefapp', 'ogrenewt', 'cegui', 'ode',\ 'ogreode', 'ogreal', 'quickgui', 'opcode', 'nxogre', 'bullet', 'physx', 'betagui','theora',\ 'ogrevideoffmpeg', 'ogredshow', 'plib', 'ogrebulletc', 'ogrebulletd', - 'ogreforests', 'et' ] # 'navi', + 'ogreforests', 'et'] # 'navi', # This lets you call scons like: 'scons PROJECTS=ogre,cegui' opts = Options('custom.py') opts.Add(ListOption('PROJECTS', 'Project to build wrappers for', - possible_projects, default_projects)) + default_projects, possible_projects )) temp_env = Environment(options = opts) tobuild = temp_env['PROJECTS'] del temp_env Deleted: trunk/python-ogre/SConstruct.vc8 =================================================================== --- trunk/python-ogre/SConstruct.vc8 2007-10-05 04:16:07 UTC (rev 408) +++ trunk/python-ogre/SConstruct.vc8 2007-10-05 08:20:21 UTC (rev 409) @@ -1,163 +0,0 @@ -#! /usr/bin/python -# Copyright 2007 - Python-Ogre Project -# Based upon code from Lakin Wecker (2006) -# -## -## This file should be located in the root dir -## - -## some more goes here - -_LOGGING_ON = True - -def log ( instring ): - if _LOGGING_ON: - print instring - -import os -import sys -import environment - -# -# list the modules here you want to build -# The names must match those in environment.projects -# -#tobuild = ['ogre' , 'ois', 'ogrerefapp', 'ogrenewt', 'cegui'] -#tobuild = ['ode'] - -if os.name=='nt': - builddir = "c:/temp/build_dir" + "_" + environment.PythonVersionString -else: - builddir = "build_dir" + "_" + environment.PythonVersionString - -def create_SConscript ( cls ): - fname = os.path.join( cls._source, 'SConscript') - if os.path.isfile ( fname ): - log ("WARNING: Over-Writing %s as it already exists" % (fname)) - ## return ## uncomment this if you have manually created a Sconscript file.. - - f = open ( fname , 'w' ) - if os.sys.platform <> 'darwin': - targettype = 'SharedLibrary' - else: - targettype = 'LoadableModule' - f.write (""" -Import(\'_env\') \n -_%(name)s = _env.%(targettype)s( "%(name)s", SHLIBPREFIX=\'\', source=_env["FILES"])\n -Return ('_%(name)s')\n - """ % { 'name':cls._name, 'targettype':targettype } ) - -def get_ccflags(): - if os.name=='nt': - CCFLAGS='' - #CCFLAGS += '-DBOOST_PYTHON_MAX_ARITY=19' - CCFLAGS += ' /nologo' # -Zm800 - CCFLAGS += ' /W3 /wd4675' # warning level -Zc:wchar_t - CCFLAGS += ' /TP /MD /Zc:forScope /EHs /c' - ##CCFLAGS += ' /Ogisyb2 /Gs /GR ' #/Op /Ox /O2 - CCFLAGS += ' /Ox /Ob2 /Oi /Ot /Oy /GS- /GR ' - elif os.name =='posix': - if os.sys.platform <> 'darwin': - CCFLAGS = ' `pkg-config --cflags OGRE` ' - CCFLAGS += ' -I' - CCFLAGS += ' -O3 -I./ -fvisibility=hidden -finline-limit=20 ' - CCFLAGS += ' -DOGRE_GCC_VISIBILITY ' # -fvisibility-inlines-hidden - else: - CCFLAGS = ' -I -pipe -Os -I./' - return CCFLAGS - -def get_source_files(_dir): - try: - source_files = filter( lambda s: s.endswith( '.cpp' ), os.listdir(_dir) ) - except OSError,e: - print 'WARNING: Generate the sources this directory: "%s"' % _dir - raise e - source_files.sort() - return source_files ## "Image.pypp.cpp" ##source_files - -def get_linkflags(): - if os.name=='nt': - #LINKFLAGS = " -NOLOGO -INCREMENTAL:NO -DLL -OPT:NOREF -subsystem:console " # no change - LINKFLAGS = " /NOLOGO /OPT:REF /INCREMENTAL:NO /DLL /OPT:ICF /OPT:NOWIN98 /subsystem:console " # 7 minutes 25% smaller 16.6 Meg - #LINKFLAGS = " /NOLOGO /INCREMENTAL:NO /DLL /subsystem:console " ### LONG Link , 80 minutes - 15.7 meg - elif os.name == 'posix': - if os.sys.platform <> 'darwin': - LINKFLAGS = ' `pkg-config --libs OGRE` --strip-all -lstdc++ ' - else: - LINKFLAGS = '' - return LINKFLAGS - -# Let us select the projects to build -possible_projects = ['ogre' , 'ois', 'ogrerefapp', 'ogrenewt', 'cegui', 'ode',\ - 'ogreode', 'ogreal', 'quickgui' ] ## 'betagui'] # , 'raknet' -default_projects = ['ogre' , 'ois', 'ogrerefapp', 'ogrenewt', 'cegui', 'ode',\ - 'ogreode', 'ogreal', 'quickgui' ] ##'betagui'] - -# This lets you call scons like: 'scons PROJECTS=ogre,cegui' -opts = Options('custom.py') -opts.Add(ListOption('PROJECTS', 'Project to build wrappers for', - possible_projects, default_projects)) -temp_env = Environment(options = opts) -tobuild = temp_env['PROJECTS'] -del temp_env - - -for name, cls in environment.projects.items(): - ##if name.active: - if name in tobuild: - log ("Building " + name) - - ## setup some defaults etc - cls._source = cls.generated_dir - cls._build_dir = os.path.join ( builddir, cls.dir_name) - cls._name = name - _env = Environment(ENV=os.environ) - - ## Use custom compilier if wanted (things like ccache) - if hasattr(environment, 'cxx_compiler'): - _env['CXX'] = environment.cxx_compiler - if hasattr(environment, 'cc_compiler'): - _env['CC'] = environment.cc_compiler - - ## setup linker paths/libs and flags (standard and additional) - _env.Append ( LIBPATH= cls.lib_dirs + [environment.python_lib_dirs] ) - linkflags=get_linkflags() - if hasattr ( cls, 'LINKFLAGS' ): - linkflags += cls.LINKFLAGS - _env.Append( LINKFLAGS=linkflags ) - _env.Append ( LIBS = cls.libs ) - - ## setup compile paths and flags (standard and additional) - _env.Append ( CPPPATH = cls.include_dirs + [environment.python_include_dirs, environment.Config.PATH_Boost] ) - ccflags= get_ccflags() - if hasattr( cls, 'CCFLAGS'): - ccflags += cls.CCFLAGS - _env.Append ( CCFLAGS=ccflags ) - - ## create a list of source files to include - _env.Append ( FILES= get_source_files(cls._source) ) - ##cls._env = _env.Copy() ## NOT sure this is needed... - - ## build it to somewhere else - _env.BuildDir(cls._build_dir, os.path.join( environment.generated_dir_name, cls.dir_name ), duplicate=0) - ##cls._env.BuildDir(cls._build_dir, os.path.join( environment.generated_dir_name, cls.dir_name ), duplicate=0) - - ## create a dynamic Sconscript file in the source directory (only if it doesn't exist) - create_SConscript ( cls ) -# # _env.LINKCOM = [_env['LINKCOM'],\ -# # 'mt.exe -nologo -manifest %(name)s.manifest -outputresource:%(name)s;2' % {'name':cls._name} ] - ## now call the SConscript file in the source directory - Export ( '_env' ) - package = _env.SConscript(os.path.join( cls._build_dir, 'SConscript' ) ) - - ## ugly hack - scons returns a list of targets from SharedLibrary - we have to choose the one we want - index = 0 # this is the index into a list of targets - '0' should be the platform default - - ## and lets have it install the output into the 'package_dir_name/ModuleName' dir and rename to the PydName - _env.AddPostAction(package,\ - 'mt.exe -nologo -manifest %(name)s.manifest -outputresource:%(name)s;2' % { 'name':package[index] } ) - - _env.InstallAs(os.path.join(environment.package_dir_name, cls.parent, - cls.ModuleName, cls.PydName), - package[index] ) - Modified: trunk/python-ogre/code_generators/common_utils/__init__.py =================================================================== --- trunk/python-ogre/code_generators/common_utils/__init__.py 2007-10-05 04:16:07 UTC (rev 408) +++ trunk/python-ogre/code_generators/common_utils/__init__.py 2007-10-05 08:20:21 UTC (rev 409) @@ -343,4 +343,63 @@ """ for className in ImplicitClasses: mb.class_(className).constructors().allow_implicit_conversion = True - \ No newline at end of file + +def Fix_ReadOnly_Vars ( main_ns, ToFixClasses, knownNonMutable ): + """ find read only variables that are "python" mutable, exclude them, add a getter function + and expose them using properties -- this ensures a copy is made of the variable, otherwise you get a pointer + to the original 'readonly' C++ variable AND CAN CHANGE IT :( -- it acts like a normal static variable + which can cause interersting things to go wrong.. + """ + + GetterFunction = \ + """ + // special function to replace an existing read only variable as + // we need to make a copy of the variable as python doesn't understand 'const' + typedef const %(return_type)s ( *fget_Special_%(variable_name)s )(%(class_type)s &); + %(return_type)s %(getter_name)s ( %(class_type)s & me ) { + return me.%(variable_name)s; + } + """ + GetterReg = \ + """ + add_property( // special :) + "%(variable_name)s_Copy" + , fget_Special_%(variable_name)s ( &%(getter_name)s ) + , "special get property, built to access const variable" ) + """ +# ## fix -- the implementation above isn't really what I wanted :) +# GetterFunction = \ +# """ +# // special function to replace an existing read only variable as +# // we need to make a copy of the variable as python doesn't understand 'const' +# typedef const %(return_type)s ( *fget_Special_%(variable_name)s )(); +# %(return_type)s %(getter_name)s ( ) { +# return ::%(class_type)s::%(variable_name)s; +# } +# """ + + for cls in main_ns.classes(): + if cls.name in ToFixClasses: # force fixes in specific classes + for v in cls.variables(allow_empty=True): + if v.is_read_only and v.exportable==True : # only if it's exposed.. + if type (v.type) == declarations.cpptypes.const_t: # only care about const's + known = False + for k in knownNonMutable: + if v.type.decl_string.startswith (k): + known = True + if not known: + ## OK so it must be mutable so lets fix it.. +# # # # v.exclude() ## remove it as a variable + return_type, ignore = v.type.decl_string.split(' ',1) # remove cont etc from decl + return_type = return_type[2:] # remove leading :: + variable_name = v.name + class_type = cls.decl_string[2:] # again don't need leading '::' + getter_name = variable_name + '_Getter_Copy' # define a non conflicting name + values = { 'return_type':return_type, 'variable_name':variable_name, + 'class_type':class_type, 'getter_name':getter_name } + # create the actual getter function + deccode = GetterFunction % values + cls.add_declaration_code( deccode ) + # and the property registration code + regcode = GetterReg % values + cls.add_registration_code( regcode ) Modified: trunk/python-ogre/code_generators/common_utils/extract_documentation.py =================================================================== --- trunk/python-ogre/code_generators/common_utils/extract_documentation.py 2007-10-05 04:16:07 UTC (rev 408) +++ trunk/python-ogre/code_generators/common_utils/extract_documentation.py 2007-10-05 08:20:21 UTC (rev 409) @@ -245,4 +245,4 @@ print doc_extractor("")(x_decl("myfunc(int x, int y)","c:/development/ocvs/ogrenew/ogremain/include/OgreSceneManager.h",218)) print doc_extractor("")(x_decl("","c:/development/ocvs/ogrenew/ogremain/include/OgreSceneManager.h",223)) - print doc_extractor("")(x_decl("","c:/development/CEGUI-0.5.0/include/CEGUIEvent.h",139)) + print doc_extractor("")(x_decl("","c:/development/CEGUI-0.5.0/include/CEGUIEvent.h",139)) \ No newline at end of file Added: trunk/python-ogre/code_generators/navi/Navi.h =================================================================== --- trunk/python-ogre/code_generators/navi/Navi.h (rev 0) +++ trunk/python-ogre/code_generators/navi/Navi.h 2007-10-05 08:20:21 UTC (rev 409) @@ -0,0 +1,169 @@ +/* + This file is part of Navi, a library that allows developers to embed movable + 'Navis' (Dynamic, HTML/JS/CSS-Driven GUI Overlays) within an Ogre3D application. + + Copyright (C) 2007 Adam J. Simmons + http://www.agelessanime.com/Navi/ + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __Navi_H__ +#define __Navi_H__ +#if _MSC_VER > 1000 +#pragma once +#endif + +#include "NaviPlatform.h" +#include "NaviManager.h" +#include <llmozlib.h> + +namespace NaviLibrary +{ + /** + * This class is pure private, Navi objects are solely handled by NaviManager + */ + class _NaviExport Navi : public LLEmbeddedBrowserWindowObserver, public Ogre::WindowEventListener, public Ogre::ManualResourceLoader + { + friend class NaviManager; + friend class NaviCompare; + + std::string naviName; + unsigned short naviWidth; + unsigned short naviHeight; + unsigned int winWidth; + unsigned int winHeight; + Ogre::RenderWindow* renderWindow; + bool isWinFocused; + NaviPosition position; + bool movable; + int windowID; + Ogre::Overlay* overlay; + Ogre::PanelOverlayElement* panel; + bool needsUpdate; + unsigned int maxUpdatePS; + bool forceMax; + Ogre::Timer timer; + unsigned long lastUpdateTime; + float opacity; + bool usingMask; + bool ignoringTrans; + float transparent; + bool usingColorKeying; + float keyFuzziness; + unsigned char keyR, keyG, keyB; + float keyFOpacity; + unsigned char keyFillR, keyFillG, keyFillB; + unsigned char* naviCache; + bool isMaterialOnly; + std::vector<NaviEventListener*> eventListeners; +// std::multimap<std::string, NaviDelegate> delegateMap; +// std::multimap<std::string, NaviDelegate>::iterator delegateIter; +// std::pair<std::multimap<std::string, NaviDelegate>::iterator, std::multimap<std::string, NaviDelegate>::iterator> dmBounds; + std::map<std::string, std::vector<std::string> > ensureKeysMap; + std::map<std::string, std::vector<std::string> >::iterator ensureKeysMapIter; + bool okayToDelete; + bool isVisible; + bool fadingOut; + unsigned long fadingOutStart; + unsigned long fadingOutEnd; + bool fadingIn; + unsigned long fadingInStart; + unsigned long fadingInEnd; + bool compensateNPOT; + unsigned short texWidth; + unsigned short texHeight; + size_t texPixelSize; + size_t texPitch; + + + Navi(Ogre::RenderWindow* renderWin, std::string name, std::string homepage, const NaviPosition &naviPosition, + unsigned short width, unsigned short height, bool isMovable, bool visible, unsigned int maxUpdatesPerSec, bool forceMaxUpdate, unsigned short zOrder, float _opacity); + + Navi(Ogre::RenderWindow* renderWin, std::string name, std::string homepage, unsigned short width, unsigned short height, bool visible, + unsigned int maxUpdatesPerSec, bool forceMaxUpdate, float _opacity, Ogre::FilterOptions texFiltering); + + ~Navi(); + + void createOverlay(unsigned short zOrder); + + void createBrowser(Ogre::RenderWindow* renderWin, std::string homepage); + + void createMaterial(Ogre::FilterOptions texFiltering = Ogre::FO_NONE); + + void setMask(std::string maskFileName, std::string groupName); + + void update(); + + void loadResource(Ogre::Resource* resource); + + void moveNavi(int deltaX, int deltaY); + + void navigateTo(std::string url); + + void navigateTo(std::string url, NaviData naviData); + + std::string evaluateJS(const std::string &script); + + void addEventListener(NaviEventListener* newListener); + + void removeEventListener(NaviEventListener* removeListener); + +// void bind(const std::string &naviDataName, const NaviDelegate &callback, const std::vector<std::string> &keys); + +// void unbind(const std::string &naviDataName, const NaviDelegate &callback = NaviDelegate()); + + void setBackgroundColor(float red, float green, float blue); + + void setOpacity(float _opacity); + + void setIgnoreTransparentAreas(bool ignoreTrans, float defineThreshold); + + void setColorKey(const std::string &keyColor, float keyFillOpacity = 0.0, const std::string &keyFillColor = "#000000", float keyFuzzy = 0.0); + + void setDefaultPosition(); + + void hide(bool fade, unsigned short fadeDurationMS); + + void show(bool fade, unsigned short fadeDurationMS); + + bool isPointOverMe(int x, int y); + + bool isPointWithin(int x, int y, int left, int right, int top, int bottom); + + bool isPointOpaqueEnough(int x, int y); + + int getRelativeX(int absX); + + int getRelativeY(int absY); + + void onPageChanged(const EventType& eventIn); + void onNavigateBegin(const EventType& eventIn); + void onNavigateComplete(const EventType& eventIn); + void onUpdateProgress(const EventType& eventIn); + void onStatusTextChange(const EventType& eventIn); + void onLocationChange(const EventType& eventIn); + void onClickLinkHref(const EventType& eventIn); + + void windowMoved(Ogre::RenderWindow* rw); + void windowResized(Ogre::RenderWindow* rw); + void windowClosed(Ogre::RenderWindow* rw); + void windowFocusChange(Ogre::RenderWindow* rw); + + }; + +} + +#endif \ No newline at end of file Added: trunk/python-ogre/code_generators/navi/NaviManager.h =================================================================== --- trunk/python-ogre/code_generators/navi/NaviManager.h (rev 0) +++ trunk/python-ogre/code_generators/navi/NaviManager.h 2007-10-05 08:20:21 UTC (rev 409) @@ -0,0 +1,754 @@ +/* + This file is part of Navi, a library that allows developers to embed movable + 'Navis' (Dynamic, HTML/JS/CSS-Driven GUI Overlays) within an Ogre3D application. + + Copyright (C) 2007 Adam J. Simmons + http://www.agelessanime.com/Navi/ + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __NaviManager_H__ +#define __NaviManager_H__ +#if _MSC_VER > 1000 +#pragma once +#endif + +#include "NaviPlatform.h" +#include "NaviData.h" +#include "NaviEventListener.h" +#include "NaviMouse.h" +//#include "NaviDelegate.h" +#include "NaviUtilities.h" +#include "NaviSingleton.h" +#include <OgrePanelOverlayElement.h> + +namespace NaviLibrary +{ + struct NaviCompare; + + /** + * Enumerates relative positions. Used by NaviManager::NaviPosition + */ + enum RelativePosition + { + Left, + TopLeft, + TopCenter, + TopRight, + Right, + BottomRight, + BottomCenter, + BottomLeft, + Center + }; + + /** + * An object that holds position-data for a Navi. Used by NaviManager::createNavi and NaviManager::setNaviPosition. + */ + class _NaviExport NaviPosition + { + bool usingRelative; + union { + struct { RelativePosition position; short x; short y; } rel; + struct { short left; short top; } abs; + } data; + + friend class Navi; + NaviPosition(); + public: + /** + * Creates a relatively-positioned NaviPosition object. + * + * @param relPosition The position of the Navi in relation to the Render Window + * + * @param offsetLeft How many pixels from the left to offset the Navi from the relative position. + * + * @param offsetTop How many pixels from the top to offset the Navi from the relative position. + */ + NaviPosition(const RelativePosition &relPosition, short offsetLeft = 0, short offsetTop = 0); + + /** + * Creates an absolutely-positioned NaviPosition object. + * + * @param absoluteLeft The number of pixels from the left of the Render Window. + * + * @param absoluteTop The number of pixels from the top of the Render Window. + */ + NaviPosition(short absoluteLeft, short absoluteTop); + }; + + /** + * Enumerates internal mouse button IDs. Used by NaviManager::injectMouseDown, NaviManager::injectMouseUp + */ + enum MouseButtonID + { + LeftMouseButton = 0, + RightMouseButton, + MiddleMouseButton + }; + + /** + * Supreme dictator and Singleton: NaviManager + * + * The class you will need to go to for all your Navi-related needs. + */ + class _NaviExport NaviManager : public Singleton<NaviManager> + { + friend class Navi; // Our very close friend <3 + friend void NaviUtilities::translateLocalProtocols(std::string &strToTranslate); + + bool startedUp; + std::string localNaviDirectory; + std::map<std::string,Navi*> activeNavis; + std::vector<Navi*> boundaryIgnorers; + Navi* focusedNavi; + int hiddenWindowID; + std::map<std::string,Navi*>::iterator iter; + std::vector<Navi*>::iterator bIter; + Ogre::RenderWindow* renderWindow; + int mouseXPos, mouseYPos; + bool mouseButtonRDown; + unsigned short zOrderCounter; + NaviMouse* mouse; + + void focusNavi(int x, int y, Navi* selection = 0); + const std::vector<Navi*>& getNavisAtPoint(int x, int y); + const std::vector<Navi*>& getNavis(); + public: + /** + * Creates the NaviManager and loads the internal LLMozLib library. + * + * @param _renderWindow The Ogre::RenderWindow to render Navis to + * + * @param _localNaviDirectory By default, "local://" means something like: + * "C:\MyApplicationDirectory\NaviLocal\" but by changing + * this parameter, you can change "NaviLocal" to something else. + * + * @throws Ogre::Exception::ERR_INTERNAL_ERROR Throws this when LLMozLib fails initialization + */ + NaviManager(Ogre::RenderWindow* _renderWindow, const std::string &_localNaviDirectory = "NaviLocal"); + + ~NaviManager(); + + /** + * Gets the NaviManager Singleton. + * + * @return A reference to the NaviManager Singleton. + * + * @throws Ogre::Exception::ERR_RT_ASSERTION_FAILED Throws this if NaviManager has not been new'd yet. + */ + static NaviManager& Get(); + + /** + * Gets the NaviManager Singleton as a pointer. + * + * @return A pointer to the NaviManager Singleton. + * + * @throws Ogre::Exception::ERR_RT_ASSERTION_FAILED Throws this if NaviManager has not been new'd yet. + */ + static NaviManager* GetPointer(); + + /** + * Starts up the NaviMouse singleton and returns a pointer to it. + * + * @param visible Whether or not the NaviMouse is visible. Use NaviMouse::show()/hide() later. + */ + NaviMouse* StartupMouse(bool visible = true); + + /** + * Returns the NaviMouse singleton. + * + * @throws Ogre::Exception::ERR_RT_ASSERTION_FAILED Throws this if StartupMouse() is not called prior. + */ + NaviMouse* getMouse(); + + /** + * Gives each active Navi a chance to update, each may or may not update their internal textures + * based on various conditions. + */ + void Update(); + + /** + * Destroys any active Navis and shuts down the LLMozLib library. + */ + void Shutdown(); + + /** + * Creates a Navi. (You MUST call Startup() before this.) + * + * @param naviName The name of the Navi, used to refer to a specific Navi in subsequent calls. + * + * @param homepage The default starting page for a Navi. You may use local:// here to refer to + * the local Navi directory (See NaviManager::Startup) + * + * @param naviPosition The unified position (either relative or absolute) of a Navi. + * See NaviManager::NaviPosition for more information. + * + * @param width The width of the Navi. MUST be a power of 2 (e.g. 128, 256, 512, 1024) + * Technically you may be able to use a number that is divisible by 16 but + * please be mindful of the 2^n texture size limitation of certain video cards + * + * @param height The height of the Navi. MUST be a power of 2 (e.g. 128, 256, 512, 1024) + * Technically you may be able to use a number that is divisible by 16 but + * please be mindful of the 2^n texture size limitation of certain video cards + * + * @param isMovable Whether or not this absolutely positioned Navi is movable (right-click-drag to move) + * + * @param isVisible Whether or not this Navi is visible upon creation. Use NaviManager::showNavi to display + * this Navi later. + * + * @param maxUpdatesPerSec This parameter limits the number of updates per second to a specific + * integer. To use no limiting, leave this parameter as '0'. This limiting is + * useful if, for example, you had some very hyperactive Javascript + * that animated a moving ball. Without update limiting, Navi will try to update + * itself at every possible moment: this is great for very smooth animation but + * bad for the overall framerate. + * + * @param forceMaxUpdate Navi normally only updates when the page has changed, to override this functionality + * set this parameter to 'True' to make Navi 'force update' using the value of the + * parameter 'maxUpdatesPerSec'. This is useful as a work-around for rendering embedded + * Flash applications. Note: if 'maxUpdatesPerSec' is 0, Navi will try to 'force update' + * every single chance it gets (not recommended). + * + * @param zOrder Sets the starting Z-Order for this Navi; Navis with higher Z-Orders will be on top of other + * Navis. To auto-increment this value for every successive Navi, leave this parameter as '0'. + * + * @param opacity Sets the starting Opacity of the Navi. + * Ex. 1.0000 = Fully opaque + * Ex. 0.5000 = Half opaque + * Ex. 0.0000 = Totally transparent + * + * @throws Ogre::Exception::ERR_RT_ASSERTION_FAILED Throws this if NaviManager::Startup is not called prior to this. + */ + void createNavi(const std::string &naviName, const std::string &homepage, const NaviPosition &naviPosition, + unsigned short width, unsigned short height, bool isMovable = true, bool isVisible = true, unsigned int maxUpdatesPerSec = 48, bool forceMaxUpdate = false, + unsigned short zOrder = 0, float opacity = 1.0); + + /** + * Creates a NaviMaterial. (You MUST call Startup() before this.) NaviMaterials are just like Navis except that they lack + * a movable overlay element. Instead, you handle the material and apply it to anything you like. Mouse input for NaviMaterials + * must be injected using the 'injectNaviMaterial...(...)' API calls. + * + * @param naviName The name of the NaviMaterial, used to refer to this specific Navi in subsequent calls. + * + * @param homepage The default starting page for a Navi. You may use local:// here to refer to + * the local Navi directory (See NaviManager::Startup) + * + * @param width The width of the NaviMaterial. MUST be a power of 2 (e.g. 128, 256, 512, 1024) + * Technically you may be able to use a number that is divisible by 16 but + * please be mindful of the 2^n texture size limitation of certain video cards + * + * @param height The height of the NaviMaterial. MUST be a power of 2 (e.g. 128, 256, 512, 1024) + * Technically you may be able to use a number that is divisible by 16 but + * please be mindful of the 2^n texture size limitation of certain video cards + * + * @param isVisible Whether or not this NaviMaterial is visible or not (0% opacity, non-updated). Use + * NaviManager::showNavi to display this NaviMaterial later. + * + * @param maxUpdatesPerSec This parameter limits the number of updates per second to a specific + * integer. To use no limiting, leave this parameter as '0'. This limiting is + * useful if, for example, you had some very hyperactive Javascript + * that animated a moving ball. Without update limiting, Navi will try to update + * itself at every possible moment: this is great for very smooth animation but + * bad for the overall framerate. + * + * @param forceMaxUpdate Navi normally only updates when the page has changed, to override this functionality + * set this parameter to 'True' to make Navi 'force update' using the value of the + * parameter 'maxUpdatesPerSec'. This is useful as a work-around for rendering embedded + * Flash applications. Note: if 'maxUpdatesPerSec' is 0, Navi will try to 'force update' + * every single chance it gets (not recommended). + * + * @param opacity Sets the starting Opacity of the Navi. + * Ex. 1.0000 = Fully opaque + * Ex. 0.5000 = Half... [truncated message content] |