fife_0.3.5/0000775000175100017510000000000012205226420011541 5ustar waynewaynefife_0.3.5/CHANGES0000664000175100017510000014407012205217523012546 0ustar waynewayne __/\\\\\\\\\\\\\\\___/\\\\\\\\\\\___/\\\\\\\\\\\\\\\___/\\\\\\\\\\\\\\\_ _\/\\\///////////___\/////\\\///___\/\\\///////////___\/\\\///////////__ _\/\\\__________________\/\\\______\/\\\______________\/\\\_____________ _\/\\\\\\\\\\\__________\/\\\______\/\\\\\\\\\\\______\/\\\\\\\\\\\_____ _\/\\\///////___________\/\\\______\/\\\///////_______\/\\\///////______ _\/\\\__________________\/\\\______\/\\\______________\/\\\_____________ _\/\\\__________________\/\\\______\/\\\______________\/\\\_____________ _\/\\\_______________/\\\\\\\\\\\__\/\\\______________\/\\\\\\\\\\\\\\\_ _\///_______________\///////////___\///_______________\///////////////__ ================================================================================ == 0.3.5 (August 21st, 2013) == ================================================================================ === Engine === * Fixed another LayerCache bug. * Fixed blocking bug, which has affected multi cell objects. * Fixed segmentation fault within pathfinder. * Fixed segmentation fault within Instance::follow. * Fixed the visible/invisible problem. [t:780] * Fixed facing location and a related bug. [t:773] ================================================================================ == 0.3.4 (February 28th, 2013) == ================================================================================ === Engine === * Fixed a couple of compiler errors when SDL renderer is chosen (i.e. HAVE_OPENGL macro is not defined). [t:693] * Changed the way instance rotation works. Instead of using a facing location the instance now use only a rotation value. But the possibility to get and set facing locations is still available. In case you set a facing location, internally it is converted to a angle or in case of get, the angle is converted to a location. [t:647] * Fixed grid scaling by camera rotation. [t:695] * Optimized camera update() function. Old caused two matrix updates. * Changed the angle/rotation functions to use MapCoordinates instead of ExactLayerCoordinates. * Added a virtual destructor to the IResourceManager interface. [t:709] * Fixed a problem with the usage of the size_t type. [t:702] * Addressed some API inconsistencies. Renamed LogManager::isLoggingToPrompt() to isLogToPrompt() and LogManager::isLoggingToFile() to isLogToFile(). This shouldn't affect python clients as the appropriate changes have been made to the python extension. [t:711] * Addressed more API inconsistencies. Renamed (in serveral places) setMouseAcceleration() to setMouseAccelerationEnabled() and getMouseAcceleration() to isMouseAccelerationEnabled(). This shouldn't affect python clients as the appropriate changes have been made to the python extensions. [t:711] * Fixed some problems when zooming at 200% or 300%.. etc etc. Images were not exactly 2x2 or 3x3. [t:719] * Added getMapViewPort() and getLayerViewPort() functions to camera class. These functions return the position and size of the camera in map or layer coordinates. CellRenderer make use of it to speed up rendering, especially when many cells exist in the cache. [t:647] * Added Fog of War support. * Pathfinder has been completely re-written. * Added getDesktopHeight() and getDesktopWidth() to DeviceCaps. [t:669] * Enhanced Instance coloring. The new alpha component is used as interpolation factor. [t:729] * Ensure SCons version is 2.0+. [t:735] * Added the staticLayer feature so that layers can be rendered as one texture. [t:742] * Client can now select, per Layer, between three sorting algorithm. === Extensions === * Fix event groups in pychan; only the last group's callback used to be considered. [t:23] * Added the getter and setter functions to the fifelog extension. [t:711] * Replace 'dct.has_key(k)' with 'k in dct'. [t:631] * You can now overwrite existing widget types without pychan "trying" to throw an exception. There is no feedback if you do overwrite an existing widget, it will silently allow you to do so. fixes[t:748] * Allow client to set focus to a child widget when using widget.execute(). [t:750] * Fixed a bug in the slider widget which caused it to ignore the step length. [t:754] * Unknown exceptions are now caught by BasicApplication and the engine is exited gracefully. This prevents an endless output of exceptions from being printed to the console window. [t:755] * Added the ability to set the horizontal_scroll_amount and vertical_scroll_amount via XML for scroll areas. [t:692] * Modified the default settings dialog box to no longer use drop downs. This prevents the dropdown segfault from happening. [t:756] * Fix typo in xml serializer. This was leading to a crash when extra_attrs were passed. [t:760] === Misc === * Added some excludes to the fife.iss file so it doesn't include some files that it shouldn't when building the windows installer. [t:601] * Changed the python executable back to python.exe from pythonw.exe in the windows installer. pythonw.exe crashes with some version of python when you output something to the console screen. [t:601] * Added PathfinderTest to fife tests. It demonstrates multilayer movement and how speed and cost multiplier could be used. [t:647] * Updated the header file location for fifechan when building with mingw on windows. [t:698] * Update to allow FIFE to find fifechan when it is installed in the libpath. Tested this on archlinux. [t:698] * Allow for parallel builds. fixes[t:696] * Removed unused file - freebsd8-config-dist.py. [t:716] * Updated the COPYING file to be the current copy of the LGPL 2.1 text. It seemed to contain an older version of LGPL. fixes[t:718] * Modifying code/comments/file headers that apply to this branch to conform to the new coding standard. Also applied the correct eol-style svn property for some of the new files. [t:647] * Applying patch provided by gscai. This allows for custom command line parameters to be passed to the windows build batch files. [t:737] * Applying patch provided by gscai. This allows the use of the CXX environment variable to change the path to the desired C++ compiler. [t:738] * Fixed a bug where the shooter demo would crash after a few seconds after starting a new game. This also prevents the player ship from being lost off the left side of the screen. [t:747] === Docs === * Updated the doxygen configuration file to be current with the latest doxygen version. * Added a process on the web host to generate doxygen documentation as well as epydocs for the python modules. * Doxygen docs now include the FIFE revision number they were generated from. * Updated a comment in quadtreerenderer.cpp that was being mistaken by doxygen for the FIFE namespace docs. * Added FIFE namespace documentation to version.h * Fixed a bunch of doxygen warning/error messages (now that we are able to see them). [t:550] * Epydoc formatting fixes for xml loader files. [t:724] ================================================================================ == 0.3.3r3 (April 17th, 2012) == ================================================================================ === Engine === * Implemented C++ map savers which is now being used by the editor. [t:491] * Fixed instance Z so it works now as expected. This should only be used for small optical corrections. (r3810) * Added layer z offset. [t:366] * Fixed a problem with instance setLocation(). (r3810) * Removed sub image loaders as they are not used. (r3811) * Object is no longer derived from IResource. (r3811) * SDL Renderer now renders quads as expected. [t:607] * Changed the Image creation in CoordinateRenderer. The coordinate is now splitted into three images. So the TextRenderPool can reuse the most images and must not create one for each coordinate. Additional the images take camera zoom into account, but you can also disable it. [t:612] * Added InstanceDeleteListener to InstanceRenderer and RenderNode. [t:602] * All images created by effects are now owned by ImageManager and freed if no longer used after 60 seconds. [t:611] * Added the set method to PointType2D and PointeType3D. [t:615] * Changed the way Atlases and SubImages?(SharedImages?) are loaded and freed. SubImages now store a ImagePtr to its Atlas and the name. So a AtlasImage is only unreferenced if all SubImages are removed. It is also possible to free all images. Images that are required but were freed, invite self-adjusting. [t:605] * Added functions to allow the client to set the mouse position on the screen and retrieve it as a tuple in python. [t:617] * Added another version of captureScreen() that takes width and height params allowing you to resize the resulting image. [t:618] * Fixed a bug that led to Segmentation Faults, if the BitsPerPixel setting was different than 32. [t:623] * Added support for True Type Collection fonts. [t:614] * Optimized getMatchingInstances(). [t:592] * TargetRenderer is no longer dependent on map loading. [t:636] * Small fix in the AtlasLoader to set the filename of any objects read from the atlas file to the atlas xml file instead of the image file like it was doing previously. This fixes a problem seen in the map loading/saving where the imports would save the image file instead of the xml description file in the map. [t:491] * Zooming now works as expected with x and y offsets. [t:667] * We now get more information when gcn::Exception is thrown. [t:665] * MapLoader now allows for .zip files to be loaded. ZipSource implements a smarter file search so it can properly load files from a zip archive. [t:491] * Removed the lasttime_draw reset from TargetRenderer, because this can cause problems. [t:674] * Cursor no longer moves to 0,0 on startup. [t:670] * Removed unneeded command line option -Wl from both release and debug builds as this was breaking builds on gcc 4.7 and above. [t:691] === Extensions === * Fixed the file extensions registration for python plugin map loaders. [t:609] * Setting module is more robust on errors concerning non-string parameters. [t:626] * SimpleXMLSerializer now saves XML files with platform specific line engines. [t:630] * Child widgets should correctly report if they are hidden or not. [t:628] * Removing the hack to grab references to the GUIChanManager. Now we just use the pychan manager to grab what we need to grab from the GUIManager. Added 4 new functions to pychan Manager. getConsole(), getDefaultFont(), createFont(), and releaseFont(). [t:644] * Fixed deepApply() to now include hidden children in it's search. also added the ability to only search for visible widgets. [t:608] * GUI Icons can now be resized at render time. [t:655] * Widgets can now be cloned to make widget templating possible. [t:376] === Editor === * Users can now specify an additional plugin directory for the editor. [t:598] * Fixed a couple small editor bugs regarding map loading. [t:603] and [t:604] * Added a plugin interface to extend the editor with savers. [t:610] * Toolbars can be docked/undocked again. [t:635], [t:640], and [t:641] * The toolbox, toolbar, and statusbars statuses are now reflected correctly in the menu. [t:643] * Object Editor plugin now displays animations as expected. [t:624] * Added InstanceHighlighter plugin * Added docking status saving to ToolBar widget class, added default docking settings for Toolbox * Re-arranged init order in MainWindow.initGui() to make dockareas available for ToolBar * Small change to screenshot icon to give it a bit more space on the left * Refactored ObjectSelector ** Added auto-alignment depending on docking area (vertical/horizontal) ** Right click can be used to trigger the alignment change manually ** No annoying resizes on object selection ** Speed issues not fully solved, but pin-pointed: resizing ~200 icons is a bit too much for pychan * GUI Plugins can now use auto-alignment functionality from the ToolBar class * Small design fix in LayerTool * Small fix for MapFileHistory * Editor now doesn't load the same mapfile twice (gives feedback in the statusbar) * Re-enabled saving for ObjectEdit? plugin * Implemented XMLObjectSaver which allows serialization of a fife.Object ** NOTE: only well-formed xml files are accepted ** NOTE: provides a compat-mode to scan for tree roots, but also uses new tree root * Added namespace sorting to ObjectSelector * Refactored ObjectEdit === Misc === * Removed some unnecessary warning messages from Model. [t:645] * Removed non-free icons from the atlas editor and added license file to the atlas editor. [t:637] * Added a proper distclean build target. [t:622] * Added getRevision() to allow client to query the revision FIFE was build from. This only works if svnverion is present in the users PATH. Window users will always get 0. [t:671] * Added a check to animpacker.py to convert double points in action names to underlines. Additional the convert now consumes less RAM, because the ImageManager free images. [t:677] ================================================================================ == 0.3.3r2 (November 2nd, 2011) == ================================================================================ === Engine === * Added getVersion(), getMajor(), getMinor(), getSubMinor() functions and exposed them to python. [t:582] * Added a new math function to compare floats/doubles. It returns true if the difference is smaller as delta. * Fixed the getMatchingInstances() function. [t:579] * Added an bool to getMatchingInstances(). If a client need pixel accuracy results it should be set to true. Otherwise it should be set to false because so it skips the pixel compare and is much faster. [t:586] * Added two more InstanceChangeTypes, ICHANGE_BLOCK and ICHANGE_CELL. [t:574] * The ActionFrame for animations has been made functional. This means a minor API change. For details look into the changed demo scripts. [t:573] * Fixed the broken FIFE::Command type events. Now all event states are evaluated and not just one. Example from the ticket works now as expected. [t:503] * The DELETE macro which is defined in winnt.h is undef'ed on any windows platform that defines the WIN32 macro. This fixes compilation when using visual studio. [t:589] * Added two new mouse settings. The first one is the mouse sensitivity and the second can enable mouse acceleration. The sensitivity is limited to -0.99 (the slowest) and 10.0 (the fastest). If you enable mouse acceleration then the sensitivity is used as the max speed value. You can also change it on runtime with the EventManager. [t:487] * Added the getPtr() functions to ImageManager. All loaders now check to see if an image has been defined before creating it. This was a small bug that caused the image to be loaded even if the image was defined but not loaded in the first place. [t:590] * Fixed a bug in ImageManager::removeUnreferenced(). It would cause a segfault when executed. This has been fixed. * Fixed the problem where the animation atlas image becomes invalid after deleting all objects from model. [t:590] * Added a setting to allow users to deactivate the usage of the Framebuffer Object in opengl backends. refs[t:581] * Added a setting to allow users to deactivate the usage of NPOT Textures in opengl backends. [t:581] * Fixed a condition where if a widget is dragged to an area on the screen where there is no widget the event gets lost. It also prevents the focus from being dropped. [t:594] * Fixed a condition where the user drags from the map to a guichan widget and an event is lost. [t:594] * Added getRealCellDimensions() function to camera. [t:592] * Fixed a bug with Image names in TargetRenderer. [t:595] * Added 1024x600 as a valid resolution. [t:597] === Extensions === * Fixed a problem where the setting value cache is not updated [t:578] * Fixed a problem in fife_settings.py when starting the editor because the editor tried to modify the value of a setting not in the FIFE module. [t:578] * Added 'all' to the valid LogModules setting [t:578] * Pychan widgets can now be shown/hidden even if they are not top level containers [t:375] * Fixed a small bug with basicapplication. It was grabbing a reference to the gui manager incorrectly. === Editor === * Fixed a bug in the layertool GUI. It was using the quit.png icon as its delete layer image instead of the delete_layer.png icon. [t:583] * Replacing the editor's icon files with free ones. [t:584] * fixed a bug in pychan.internal (hide() method didn't handle deletion correctly, added a guard & docstring to explain why this is bad) * added new functionality to Plugin base class (read settings from editor's settings file) * added afterDock / afterUndock methods to Panel widget; did some code cleanup & improvements to meet coding standard * added documentation to the editor (mostly in docking functionality) * updated both MapFileHistory? and LayerTool? plugins to use the new Plugin functionality - their docking status is now saved & loaded again * added new event 'onOpenMapFile' to the signalmanager which sends the path of the requested mapfile * added MapFileHistory? plugin * records previous loaded mapfiles and loads them on editor startup via settings xml * selecting a mapfile either loads the map or updates outdated entries (e.g. if a map has been deleted) * I added a max value of 5 entries, can be adjusted in the plugin file though * fixed minor issue with moving multiple selected instances * fixed "move"-mode of editor - it now doesn't try to select / deselect cells (that's the task of "selection mode") * fifedit now can handle instances on hex grids again * deselection of cells is now possible (previous implementation never could work) * switched instance selection from pixel-perfect to location (click on a cell -> you select your instance, even if the cursor didn't scratch the instance image) === Misc === * Fixed the Free Software Foundation address in COPYING as it was outdated. * Added some more tiles to the rpg tileset in fife_test. * Added a Show Hide test to the PychanTest module in fife_test. * Small fix for the base class Test in the fife_test application. The create function reversed the engine and application parameters from what is actually passed in by the TestManager. The PychanTest was unaffected because it had the parameters in the correct order as opposed to reversed in the base class. * Commented out a whole lot of debug statements to make the debug output in FIFE useful again. I left them in the code in case anyone still needed them. * Added more tests to the fife_test testing platform. [t:683] ================================================================================ == 0.3.3 (October 6th, 2011) == ================================================================================ === Engine === * Many optimizations/improvements to the OpenGL renderer. Depth testing was modified and now works properly with alpha blending enabled. Alpha testing is used to discard pixels. [t:556] * Optimized color overlays. [t:539] * Customizable alpha threshold value for outlines / outlining [t:569] * Added support for drawing/modifying images. [t:553] * Re-implemented the Resouce Pools (ImagePool AnimationPool, etc) as ImangeManager, SoundClipManager, etc. [t:504] * Setting module no longer crashes when settings dialog has not been loaded. [t:555] * Fixed the problem that the objects of the renderers don't get deallocated when the camera deconstructor was called. Affected renderers: Instance-, Cellsection-, Generic- and LightRenderer. * Added the missing reset() and removeAll() functions to the GenericRender and LightRenderer. * Removed the Engine::preInit() function. * Removed EngineSetting::getPossibleResolutions() and validate() functions * EngineSettings no longer throws any exceptions. Instead default values as assigned and a warning message is sent to the logger. * Some optimizations to LayerCache and Camera * Removed some unnecessary includes. * Changed when some exceptions are thrown. [t:511] * Added setBackgroundColor(), so a client can change the clearing color for the screen. [t:307] * Added camera overlay functions. Clients can now add a color, image and animation overlay to the camera [t:460] * Made sure that the fife logger is part of the FIFE namespace. * Modifying all integer definitions to conform to the C99 standard. * Added the getMinMaxCoordinates() function to the map class. It retrieves the minimum/maximum coordinates of instances on the map. * Changed Model::getNumMaps() to Model::getMapCount(). * Changed Map::getNumLayers() to Map::getLayerCount(). * Changed Animation::getNumFrames() to Animation::getFrameCount(). * FifeClass is no longer derived from IReferenceCounted. * ResourceClass now implements the reference counting routines. * Singletons are no longer derived from FifeClass. * Modified the HexGrid? and SquareGrid? clone process to work as expected (even though it's not really used). This doesn't fix the obvious problems with CellGrid? and the way grids are created. This will have to be looked at closer in the future. * Made the quad tree depth easily changeable (instead of hard coded to 2) . * SquareGrid? now uses diagonals by default. * Model now logs to the LM_MODEL log module. * Small modifications to Exception to make it output to the log correctly. Now we can read the exception output. * Changed a few sqrt to match the new math definition. * Added layers getMinMaxCoordinate() function to python. * Renaming the only 2 .hpp files to conform to standards. * Optimized the lightrenderer a bit. * Fixed a build error on updating project files. This was caused by not installing the mingw part in the devkit installer. * Added code to support different versions of boost filesystem. [t:529] * Fixed some color variables (Uint8, int32_t to uint8_t). * Added some code to the python build environment to support python 2.4+. [t:465] * Fixed a segfault in the view_tests.py unittest. * Settings now list valid screen modes. [t:494] * the default image loader now throws exceptions if the image fails to load. * Fixed a bug in RawData::read where an incorrect calculation was done to check the validity of a passed in parameter. This caused a problem with loading asset files when the file did not have an appended new line at the bottom. Also modified the RawData::getDataInBytes, RawData::readString, and RawData::read methods so that they do not create a temporary data array and instead read directly into the output buffer, this should be more efficient. Added a quick comment to xmlobject.py describing why a raise call is subverted by an earlier return statement. [t:516] * Removes an unnecessary call from endFrame(). * Fixed some unittests. * Added a framerate limiter. [t:525] * Replaced the Generic- and LightRendererNode with RendererNode. * Fixed the distance calculation in routepather.cpp. * Added the OffRenderer. This is the only renderer that does not need a map or camera. The functions are identical to those of the GenericRenderer, but it use screen coordinates. This renderer is only intended for cases where no map is loaded, eg for an intro. * Changed the swig video_tests.py to use the new renderer. * Removed the primitives and a few other functions from the python interface. These are no longer needed. * Added the swig cursor unit test. * Added some getter functions to cursor along with some documentation. * RenderItem now stores an ImagePtr. * Fixed SharedPtr destructor. [t:561] * Added the getInstancesIn() function to Layer. This picks the Instances from the InstanceTree. * Fixed getMatchingInstances(). The picked instances be checked with the instances of the layer. To compare the instances, getInstancesIn() is used. [t:562] * Unnecessary InstanceActivity? are now detected and deleted. Inactive Instances are removed from Layer m_active_instances. [t:564] * Changed from using RawData::getDataInBytes to use RawData::readString in the animation/atlas/object/map loaders because the readString function appends a null terminator onto the end of the data contents. Without the null terminator errors were sometimes seen when trying to load map assets. * Added some error log printing indicating when map assets fail to load. [t:567] * Modified the RawData::read function so that it no longer appends a null terminator as this was causing the python xml loaders to throw a ParseError exception. Also fixed the RawData::readString function so that it now appends the null terminator in the proper place. [t:567] * Made scons check for the dev libraries of whatever python the user ran scons with. [t:523] * Fixed a problem where pychan will throw an exception when trying to print UTF8 characters to the console. [t:571] * Fixed and optimized a few functions in location.cpp. [t:563] and [t:568] * Added option --lib-dir to scons build system to specify a shared library install location. The shared library generated will now contain an soname that will be libfife.so.major. Also changed the generated shared library name to be libfife.so.major.minor.release. Added a version.h file to engine/core that will contain the current fife major, minor, and subminor versions and should be updated for each fife release. [t:575] * Fixed minor bug in getMatchingInstances(). This means that sometimes a wrong choice was made, because alpha value was not correct. * Change the way you set FIFE::Cursor to allow cursor to save a reference to the image or animation. Added a function to reset the cursor drag to nothing. * Added GLee - currently it's compiled with fife as .cpp (scons doesn't get compiled .c files). * Initial support for c++ map/object/animation loaders. [t:491] * Added dependency tinyxml for reading xml files. This is stored in engine/core/ext/tinyxml directory. The scons scripts will attempt to use system version of tinyxml if available otherwise the local one will be used. [t:491] * Added image Atlas support. [t:542] * Added a zoom flag to the image/animation functions of the GenericRenderer. So a client can disable the zoom for images. [t:543] * Fixed a bug that caused the generated SWIG interface file for fife to not compile when building with gcc 4.6.1. [t:546] * Began work on de-coupling FIFE from guichan. [t:549] * Changed Guichan graphics renderer to utilize vertex array instead of immediate mode. [t:549] * Removed Abstract* classes in favor of I* classes. This is to conform to our coding standards. [t:550] * After a new layer is added it is now activated for all renderers. This fixes the problem of no instances being rendered for a newly created layer. [t:551] * Added the option to change the alpha value for instance picking. * Added a setting for backbuffer clearing. So clients can deactivate it if they have reasons for this. * Removed the old setImageChunkingSize() setting because its useless. * Changed the pump function. Model update gets only called if a map is loaded. * Adding a quick and dirty shared pointer implementation that does not rely on any 3rd party libraries. This will need to be extensively tested and can always be swapped out for another implementation including boost::shared_ptr. * Added the unittest for SharedPtr. * Instances now inherit blocking property from objects [t:514] * Settings are now validated. [t:528] * VFS now allows paths outside of launched applications when using a python client. [t:544] * Reworked the lighting module. [t:557] * The Windows icon is now freed correctly. [t:530] === Demos === * Fixed a bug in the shooter demo that caused a crash. [t:495] * Updating the rio settings-dist.xml file to include the log level filter setting. * Added animated percentagebar widget to gui animation demo. * Pychan demo now closes when you press escape or when you close the window. [t:531] * Shooter demo now generates a hichscore file if one does not exist. === Documentation === * Documented the shooter World.reset() function. * Updating the dependency graphs. [t:554] * Documented all valid FIFE settings. [t:527] === Extensions === * Updated basicapplication.py to initialize the logger before settings so that setting messages will be logged. * Removed some deprecated functions in pychan. * Removed the deprecated ClickLabel widget from pychan. [t:552] * Added changeBlending() to python. === Tools === * Editor no longer crashes when there are too many instances on the map when using the OpenGL renderer. [t:500] * Added Atlas Creator tool. Currently it's a standalone application written in Qt. [t:541] ================================================================================ == 0.3.2 (November 19th, 2010) == ================================================================================ === Engine === * Removed the Camreazone renderer * Added light support (OpenGL only) by merging the light branch. Speacial thanks to Helios for all his hard work in this area (#364) * Added a percentage bar widget (#411) * Modified some size_t definitions to more appropriate ones (#152) * Instance rotation changes are reported to the instance change listeners (#475) * Fixed the GenericRenderingNode to no longer cause a segfault (#446) * Fixed an API inconsistency in SoundEmitter (#461) * There is no longer a memory leak when adding coloring overlays to instance (#472) * instance.get2dGfxVisual().setVisible(False) now works as expected (#471) * Removed the last 0(n) loop through instances when rendering (#419) * Generic renderer now only renders objects on the specified layer (#458) * Fixed a memory leak when deleting maps. The camera was not being deleted * Removed the NotFound exceptions in layer.getInstance() and model.getObjects() to be more consistent with the rest of the API * Fixed a bug in RenderBackendSDL, the clip area was not properly set * Renamed the backquad and border commands of the FloatingTextRenderer * Added the TransparentArea commands to the InstanceRenderer * Improved InstanceRenderer::addTransparentArea. You can now pass a list of namespaces to be marked as transparent * Updated Instance to no longer derive from ResourceClass. It now derives from FifeClass directly * Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Split quad and border into own commands * Added a triangle function to backend and genericrenderer, also added the functions to set an alpha value for geometric figures * floatingtextrenderer now can change colors of the font via setColor(uint r, uint b, uint g) * Added the colorbuffer patch with a small change due to SDL. Performance boost between under OpenGL * Improved the most renderers with setColor() function to allow the user to modify the color used to render the primitives * Fixed the genericrenderer. It is now tested whether the images are in the viewport * Fixed the gridrenderer to only render the grin within the viewport * Changed the vertex functions in opengl/renderbackendopengl.cpp from vertex3f() to vertex2f() * Moved the layer visibility and transparency, from instancerenderer.cpp to layercache.cpp and improved it (r3395) * Corrected the h,w calculation for zooming in layercache.cpp (r3369) * Fixed the bug, that x,y camera position result in an screen offset. (r3369) * GLImage now only creates one "texture chunk" (r3445, r3452) * Added nextPow2() math function (r3445) * Fixed color mask definitions and use them throughout the engine (r3445) * Moved the GLEnable and GLDisable structures to be globally accessible (r3445) * Templatized Rect to extend it's functionality beyond integers (r3447) * Added some typedefs: Rect, FloatRect, DoubleRect (r3447) * Removed the unused "trigger" system as it was unused (r3449) * Applied GreyGhosts patch to fife_settings. Allows the user to load the gui XML whenever they want. Also returns a reference to the dialog so it can be worked with outside of fife_settings. (r3451) * Removed unused files containing the unused GUIEventListener class (r3453) * Removed old and unused functions: set/getSourceWidget() (r3455) * Added drawRectangle() and fillRectangle() functions to the renderers (r3456) * Modified FIFE::FloatingTextRenderer? to use the new functions (r3456) * Updated some data types in FIFE::FloatingTextRenderer to use integer types defined in fife_stdint.h (r3456) * Added FIFE::DeviceCaps and FIFE::ScreenMode to detect valid screen modes * Added the ability to query the current running screen mode (r3467) * Added a method to detect the closest supported screen mode (not complete yet). If no matching screen modes are detected an exception is thrown. (r3467) * Small change to the way the screen is initialized. The screen mode now MUST be in the supported screen mode list before the screen will initialize. (r3467) * Added clearResourceLoaders() to the Pool class. This can be used if different resourceloaders have to be added at a later point in time (running editor for example, a plugin might want to have it's own loader added) (r3469) * Added the ability to normalize a 2D and 3D point (r3470) * You can now rotate a 2D point around the origin or a specific point (r3470) * Major improvements to fife_math.h and added corresponding Python bindings. Users now have access to FIFE's internal math functions. These functions are recommended to be used by all clients if required. Note: this may cause some problems with certain compilers. I hope this wont have to be reverted. TODO: remove the static constant globals somehow. (r3471) * Adopted the new math functions for all subsystems (r3471) * Added the ability to change screen modes on the fly. This works both in OpenGL and SDL modes. (#315) * Added IEngineChangeListener so the client can update the cameras viewport if the screen mode has been changed. I chose to do it this way because the engine has no way to know which camera it should update. It will be up to the client to do it. (#315) * The cursor surface is now correctly freed when exiting. (r3483) * Added DeviceCaps::getNearestScreenMode() for the client to request a supported screen mode. (#315) === Build System === * Removed libpng from ext (#385) * Debug is now automatically enabled when you build with profiling enabled (r3292) === Editor === * Re-arranged the ObjectEdit gui to avoid misunderstandings * Can now place instances (which are visible) on new maps again (r3392) === Extensions === * Added the SimpleXMLSerializer extension * Removed the XML portion out of fife_settings in favor of SimpleXMLSerializer * Made the serializer used in fife_settings "pluggable" * fife_settings widgets are now updated when the settings are reset to default * Can now specify the default settings filename instead of using settings-dist.xml * Fixed the write_instances function so it saves the stack position variable of instance visual when saving maps * Added getVolume() to the SoundManager * Added debug flag to loaders to enable/disable annoying print spam on maploading * BasicApplication now initializes pychan (r3388) * loaders extension can now handle multiple loaders for different filetypes. A difference between map and object files is now being made! (r3469) * Modified the sound manager to better take care of sound clips (r3476) === Docs === * Added some documentation to the filebrowser module === Pychan === * Timers are now handled correctly by pychan (#483) * Can now modify the step length for sliders (#482) * Built in pychan dialogs now work (r3384) === Demos === * Renamed /demos/pychan_demo/pychan_test.py to pychan_demo.py * Added a new pychan demo - gui animations * Added the Shooter demo * Made the dynamic widget test in the pychan_demo work/look a little better (r3484) === Misc === * Fixed some compiler warning messages * Added license information for the gimp icon ================================================================================ == 0.3.1 (March, 2010) == ================================================================================ === Engine === * Updated a lot of the python source files to have the correct headers * Fixed SWIG wrappers that didn't handle simple output parameters (#340) * Added color key support for both OpenGL and SDL renderer (#451, #146) * Changed the EventManager to use deque rather than vectors for storing listeners (#454) * Added the ability to prepend event listeners to the front of the listener list (#454) * Updated instance rotation values to be valid in all cases (#361) * VFS no longer crashes when entering a restricted path (#413) * Filename case is no longer transformed to be lower case (#418) * OpenGL renderer now clears the backbuffer correctly (#392) * Added the ability to render Vertexes (#455) * Camera names no longer clash when loading multiple maps (#342) * All layers are no longer activated when calling Camera::resetRenderers() (#457) * Word wrapping in a pychan label now works as expected (#408) * SWIG wrappers now handle all simple output parameters (#340) * Added ActionVisual::getActionImageAngles() * Added Cursor::getX() and Cursor::getY() === Build System === * FIFE now builds as expected on win32 using the FIFE dev kit * Win32 batch scripts no longer overwrite the users PATH variable (#429) * Requied DLLs are now installed as required on win32 (#430) * CXXFLAGS should now be honored * Fixed a problem with the dependency checks when using pkg-config on linux * Added OpenBSD support === Editor === * Can now re-load a map (#381) * Opening more than one map and then closing them no longer causes a crash (#441) * Undo/Redo works properly if you select different layers (#443) * Docked widgets no longer shrink when you click inside them (#444) * Object editor can now skip to first and last frames of an animation (#448) * Object editor sends some messages for the user to the editor status bar * Cleaned up object editor by adding preMapClosed and preMapShown events * Object editor now uses getActionImageAngles() to fetch animation angles * Object editor animation views should now work with all clients * Object offsets can now be saved to the object.xml file * Object offsets can now be manipulated by using the mousewheel * Added undo/redo support for the moving of instances === Extensions === * File Browser now refreshes correctly (#391) === Docs === * Fixed the Linux:Scons tutorial (#422) === Pychan === * Fixed a couple python import lines (#440) * Added Widget.requestFocus() === Rio De Hola === * Fixed the path to the AUTHORS file so the credits are displayed correctly === Misc === * Added color tester to pychan demo * Demos now look for a local copy of FIFE before importing the installed version of FIFE ================================================================================ == 0.3.0 (January 20th, 2010) == ================================================================================ === Engine === * Moved to Python 2.6 (#345) * Upgraded guichan in ext to 0.8.2 (#420) * Added UTF8 support * SCons build system has been re-written (#328) * Support for native mouse cursors * The background of Label widgets will be painted * Added adaptive pathfinding (#347) * Modified CellSelectionRenderer to support multiple cell selection * Added method Layer::getInstancesAt() * Added SoundEmitter::setCallback() * Added a setRolloff() function to the SoundEmitter class. * Added function to fife_utils: getUserDataDirectory. Returns the proper path to save setting and data files depending on OS. * Removed UnitTest++ from ext (#421) * Changed the way the fife python module is imported ( see http://wiki.fifengine.de/Importing_Python_Module ) * The serializers will use LogManager instead of printing directly to the console * GuiManager: Proper translation of Guichan key events to FIFE key events * Proper size calculation for ToggleButton * Fixed a layer visibility bug where the toggleInstancesVisible and setInstanceVisible functions were not working correctly. (#335) * Fixed building FIFE on OS X (#360) * Fixed setActionRuntime() (#373) * Fixed unreliable time handling when changing time factors. * Fixed a bug in the OpenGl renderer where the last chunk of images would not be displayed when image_height % chunk_size was 0. * Fixed layer and instance transparency (#378) * Fixed a lot of small bugs === Rio de hola === * Made rio_de_hola save its settings to the proper OS folder. * Added a prefix to cameras in Rio de Hola to avoid name clashes * Fixed second camera in rio so multiple Camera.setLocation calls are handled correctly * More documentation has been written === Editor === * Rewrote editor: - Improved GUI: - Resizable windows - Docking - Toolbars, menubar, statusbar - Model/View approach to toolbar and menubar buttons - New signal event system based on the one from django - Support for opening multiple maps - Better plugin support * New plugin: LayerTool * New plugin: LightEdit * New plugin: CameraEdit * Enhanced ObjectSelector * Enhanced ObjectEdit * New tool: ObjectPicker. Click on an instance on the map to set the current object to the instance object * Ability to select cells and perform actions on them (move, delete, fill, ...) * New type of scrolling: Press middle mouse button and move the mouse * New icons based on Bluesphere * Made the editor save its settings to the proper OS folder. * Fixed editor bug where the map didn't render after saving (#333) * Editor can now re-open a map (#381) * Fixed a problem navigating directory structure with the filebrowser (#377) * Filebrowser now refreshes when expected (#391) * Fixed a lot of bugs, and made a lot of new ones ;-) === PyChan === * New greedy layout engine: Widgets is now able to expand in addition to shrinking * New events: mouseWheelMovedUp and mouseWheelMovedDown * Added the position_technique attribute * Added Widget.removeAllChildren() method * Added a new method Widget.getNamedChildren * New method: Widget.insertChild() * New method: Widget.insertChildBefore() * New property: is_focusable * New properties: min_size, max_size * Moved helptext property from C++ to pychan * New togglebutton widget * ScrollArea: Size is not static anymore (can shrink and expand) * Allow objects with a call attribute to be used as event callbacks * Removed unused TimerListener * Switched to new content structure (#336) * Made the distribute and mapEvents methods faster * Added a small decorator for profiling rarely called functions * Optimized adaptLayout() * Added fast path for Widget.findChild(name=name). Roughly 10x faster * Fixed an input problem when a dropdown box is clicked on (#337) * Fixed pychan event_map to support callable objects (#374) * Fixed the pychan demo (#363) * Fixed a pychan problem where unkown characters were displayed when holding the shift key (#383) * Lots of bug fixes === Documentation === * Fixed some doxygen documentation problems (#343) * Created python coding standards article (#372) * Created "Bug Report" template (#409) === Misc === * New versioning scheme (x.y.z) instead of (yyyy.r) * Moved extensions and fife.py to /engine/python/fife * Moved rio_de_hola and pychan_demo to /demos * Moved some misc scripts to /tools * Moved the FIFE editor to /editor * Added a Win32 installer for FIFE and the win32 SDK ================================================================================ == 2009.0 (January 7th, 2009) == ================================================================================ === Engine === * Merged input rework branch * Possibility to hide instances/instance visuals * Added input and focus events * Modified clicklabel to provide a mouse listener for hover events * Use strings as grouping in generic renderer instead of numbers * Omission of a camera viewport in xml map files now indicate that the camera should use the full window * Added removeActionListener to SWIG export * Some improvements to Scons build scripts * Prepared basicapplication to use WindowTitle and WindowIcon from clients' settings.py * Logger now ignores non-existing log modules (warns to prompt) * Pools now have a function called purgeLoadedResources which deletes all loaded resources that have a reference count of zero. * Movie: Switched to using FIFE::Image instead of Overlays * Reworked matrix vector multiplication * OpenAL-soft patch for OSS support Optimizations: * Added hasing to pool to improve techdemo loading time * Lazy loading for animations * Combined events to reduce lag * Small optimizations for instance renderer Bugs: * Initialize instance visuals properly * Fixed false positives when searching for instances in a rectangle * Fixed a horrendous misconception in Pool. The map was sorted by pointer comparison. * Fix for textwrapping * Fixed bug where instances couldn't change layer * Fixed a small bug when initializing OpenGL * Fixed a scons issue where libraries checked for C instead of C++ * Fixed a shutdown order problem * Fixed segfault on shutdown when profiling was activated (#334) * Fixed: Editors camera doesn't show map after saving (#333) * Fixed: FIFE crashes with a segmentation fault (#297) === Pychan === * Modified pychan to accept RGBA colors * More documentation for layout system * adaptLayout now acts a bit smarter * Fix for scrollarea bug === Rio de hola === * Improved some graphics and added some new ones * Profiling support === Editor === * Scrolling support * Added an undo feature to the map-editor * Object editor plugin * Some bug fixes === Documentation === * Updated the map format article to reflect the datasets changes (#323) === Misc === * Removed old testmaps ================================================================================ == 2008.1 (July, 2008) == ================================================================================ === Model improvements & simplifications === * Elevations removed (Fallout legacy). * Support for namespaces: * New resource infrastructure migrated into whole engine. This enables: * uniform pooling for all resources that need to be pooled. * uniform loading for all resources (model stuff, images, sounds...). * uniform saving for resources which support saving (model stuff). * Datasets are now stored in a flat list in model instead of dataset hierarchy. * Changes in model are now bookkeeped. Observer interfaces provided for change listeners. * This enables e.g. reacting only to changes instead of polling on every round. * Also critical enabler for triggers. * Instances now support initial rotation value. * Objects support default actions. * Further model cleanup. === XML format changes === * All resources are now defined with principle 1 file / 1 resource. * Importing of objects can now be done also based on directories where they are contained. * Relative paths are now used instead of absolute ones. === Loaders === * All loading happens now from python (tinyxml dependency removed). * Improved error reporting. === Editor === * Possibility to move instances on map. * Possibility to rotate instances on map. * Possibility to zoom the map (OpenGL mode only). * Painting with currently selected instance (e.g. large ground areas). * Importing of multiple objects based on given directory. * Initial map creation wizard (still work in progress). === Rio de hola === * More assets: * Graphics, sounds, music... * Two new maps matching the storyline. * Rio de hola now conforms to package structure: http://wiki.fifengine.de/Fife_Package_Specification * Popup menu integration, demonstration of actions (kick, talk). === Pychan improvements === * Hiding of scrollbars. * Text wrapping. * A lot of smaller improvements. === Functionality === * Pixel perfect instance picking (taking transparency into account). * Ability to get list of instances from given screen rectangle. * Distance calculations made easy, exposed to scripts. * Instance outlining. * Instance coloring. * Screenshots are now saved in png format (instead of bmp). * Stereo sound support in linux (introduced with the help of openal-soft). === Video / view improvements === * Both renderbackend and separate images can now render graphical primitives (e.g. lines, dots..). * Each camera now has separate set of renderers. Allows truly adjusting cameras independently. * Zooming capability (currently properly supported only by OpenGL backend). * Support for drag cursor definitions. * OpenGL graphics chunking size is now definable in settings. Should help e.g. with large backgrounds. * GenericRenderer adding customised rendering capabilities for scripts. === Misc. changes === * Initial package structure defined for FIFE clients. * Updated guichan to the latest release 0.8.1. * Usage of unittest++ instead of boost unittests. * Lots of bug fixes. === Non-code related changes === * Switch from GPL 2.0 to LGPL 2.1 (or newer). fife_0.3.5/README0000664000175100017510000001460212205217523012430 0ustar waynewayne __/\\\\\\\\\\\\\\\___/\\\\\\\\\\\___/\\\\\\\\\\\\\\\___/\\\\\\\\\\\\\\\_ _\/\\\///////////___\/////\\\///___\/\\\///////////___\/\\\///////////__ _\/\\\__________________\/\\\______\/\\\______________\/\\\_____________ _\/\\\\\\\\\\\__________\/\\\______\/\\\\\\\\\\\______\/\\\\\\\\\\\_____ _\/\\\///////___________\/\\\______\/\\\///////_______\/\\\///////______ _\/\\\__________________\/\\\______\/\\\______________\/\\\_____________ _\/\\\__________________\/\\\______\/\\\______________\/\\\_____________ _\/\\\_______________/\\\\\\\\\\\__\/\\\______________\/\\\\\\\\\\\\\\\_ _\///_______________\///////////___\///_______________\///////////////__ == Introduction == Welcome to the FIFE v0.3.5 README. == Table of contents == 1 Features 2 License 3 FIFE Clients 4 Known Issues 5 Troubleshooting 6 Feedback 7 Closing Notes == 1) Features == A complete list of the features that FIFE offers can be found at the project wiki: * https://github.com/fifengine/fifengine/wiki/Features == 2) License == The source code (*.cpp, *.h & *.py) is licensed under LGPL 2.1 or newer: * http://www.gnu.org/licenses/lgpl-2.1.html Content was taken from a lot a lot of different 3rd party sources. Therefore each client directory comes with a separate LICENSE file that states the origin of the content, the author and the actual license it was published under. == 3) FIFE Clients == === 3.1) Editor === The editor tool can be found within the /tools/editor directory. You can launch it by running 'run.py'. It is used to edit map files for the tech demo (rio do hola). Other clients extend it and use it to edit their maps. === 3.2) Rio De Hola === Rio de hola is a technology demo showing off many of the FIFE features. It is located in the /demos/rio_de_hola directory and can be launched by running run.py. It was at one time meant to be an example game but we have moved away from that idea and it is now more of a technology demo and a playground for developers to test their code. It does serve as a good starting point for people wishing to play around with FIFE or base your game off of. === 3.3) Shooter Demo === The Shooter demo was an attempt to show the versatility and flexibility of FIFE. It is a simple side scrolling shooter that has a main menu, one level and an end boss. Try your luck and see if you can defeat the boss! === 3.4) PyChan Demo === Last but not least there is an example client residing in \demos\pychan_demo that shows how the pychan GUI library works. Start the GUI demo application by running pychan_test.py. === 3.5) Configuring the Editor and Demos === The engine utilizes special settings files for configuring FIFE. This file is called settings.xml and resides in the ~/.fife directory (in /Application Data/fife for Windows users). The Shooter Demo and the PyChan demo are exceptions. They both store their settings.xml file in their root directories. NOTE that the settings.xml file is auto generated and wont be there until you run the demos for the first time. FIFE automatically fills the settings file with default values. For more information on FIFE settings please see the wiki page here: https://github.com/fifengine/fifengine/wiki/Engine-settings == 4) Known issues == Documentation * Bug in dep_analyzer.py which prevents graphs from being generated (#554) * Atlas Creator needs to be documented (#559) Engine * No fallback solution for special characters (#302) * Cameras must be attached to layers (#305) * Loaders have a circular import (#478) * Unit-tests are broken (#423) * Mouse gets stuck in top left corner after alt+tab in fullscreen modes (#593) Guichan/Pychan * No UTF8 support using vanilla guichan source (#432) * Pychan dropdown menus crash FIFE-based client on win32 (#508) * Button doesn't react to click when drawn below mouse pointer (#387) * Pychan dropdowns refuse to open if there is no space below (#445) * Borders are not rendered on edges of widgets that touch their parent container's edge. (#522) * GuiImage unable to find loader for JPEG in ImagePool (#548) * Some strings are cut short in some widgets (#585) * applyOnlySuitable fails on functools.partial (#638) * Default style will sometimes override custom style (#656) * adjustSize() sometimes sets width to invalid values (#666) * Guichan adds hardcoded value to user setting of base_color attribute (#678) Build * Uninstaller Doesn't Remove fife Module (#526) * Improve build system shared library support on linux (#575) * Cannot build a usable debug version of _fife_d.pyd with mingw * _fife.so linked with absurd rpath (#620) * Unable to make distclean (#622) Editor * Editor code does not match coding standards (#371) * Map editor clobbers custom attributes (#379) * History bugs (#452) * Placing an instance on top of another then undoing resets the original instances properties (#459) * Should be able to set the default zoom level for a camera (#467) * Misc FIFE Editor crashes (user input validation/exception handling missing) (#537) * Editor file dialog uses botched relative paths (#616) == 5) Troubleshooting == === Video Card/Driver Issues === There are some known driver/card combinations that exhibit the some problems with FIFE. Users have reported seeing blank screens or fuzzy images. If this is happening to you please report it on our forums in the Help and troubleshooting section here: http://forums.fifengine.net/index.php?board=4.0 Please include your Card/Driver/OS information in your post. Currently the fix is to modify your settings.xml file and set both GLUseFramebuffer and GLUseNPOT to False (they are True by default). === Audio === Win32 users tend to suffer from problems with the OpenAL drivers. If you don't hear sound while running a FIFE client, run oalinst.exe that ships with the Win32 FIFE Development Kit. This is the latest OpenAL driver for Win32. == 6) Feedback == We appreciate every kind of feedback concerning the release, the project in general and the bundled techdemo. Feedback is a great way to help us to improve FIFE. If you would like to get in contact with us and provide feedback you can either visit our IRC channel or our forums: * https://github.com/fifengine/fifengine/wiki#community == 7) Closing Notes == Have fun with the release and let us know what you think about it! -- The FIFE team. http://www.fifengine.net/ 2013/08/21 fife_0.3.5/COPYING0000664000175100017510000006364212205217523012613 0ustar waynewayne GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! fife_0.3.5/build/0000775000175100017510000000000012205217523012644 5ustar waynewaynefife_0.3.5/build/win32-config.py0000664000175100017510000000527012205217523015427 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### import os import SCons.Util def initEnvironment(env): #a hack to stop passing the -nologo flag to mingw env['CCFLAGS'] = SCons.Util.CLVar('') path = os.getcwd() swigdir = os.path.join(path, 'build', 'win32', 'applications', 'swigwin-2.0.1') mingwbindir = os.path.join(path, 'build', 'win32', 'applications', 'mingw', 'bin') env.PrependENVPath('PATH', swigdir) env.PrependENVPath('PATH', mingwbindir) includepath = os.path.join(path, 'build', 'win32', 'includes') staticlibpath = os.path.join(path, 'build', 'win32', 'static_libs', 'mingw') env.Append(CPPPATH = [includepath + '\\libogg', includepath + '\\openal', includepath + '\\sdl_image', includepath + '\\zlib', includepath + '\\libguichan', includepath + '\\boost_1_47_0', includepath + '\\libvorbis', includepath + '\\libpng', includepath + '\\sdl_ttf', includepath + '\\sdl', includepath + '\\python27', includepath + '\\unittest++\\src']) env.Append(LIBPATH = [staticlibpath, staticlibpath + '\\python27']) env.Tool('swig') env.Tool('mingw') return env def addExtras(env, opengl): env.Append(LIBS = ['libguichan_sdl', 'libguichan', 'mingw32', 'zlib', 'vorbis', 'ogg', 'vorbisfile', 'libpng', 'SDL_image', 'SDLmain', 'SDL.dll', 'OpenAL32', 'SDL_ttf', 'boost_filesystem', 'boost_regex', 'boost_system']) if env['FIFE_DEBUG']: env.Append(LIBS = ['python27_d']) else: env.Append(LIBS = ['python27']) if opengl: env.Prepend(LIBS = ['libguichan_opengl']) env.Append(LIBS = ['opengl32']) # define for using tinyxml with stl support enabled env.AppendUnique(CPPDEFINES = ['TIXML_USE_STL']) return env def getRequiredHeaders(opengl): return None def getRequiredLibs(opengl): return None def getOptionalLibs(opengl): return None fife_0.3.5/build/gnu0-config.py0000664000175100017510000000646412205217523015344 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### import sys import os import platform pythonversion = 'python' + str(os.sys.version_info[0]) + '.' + str(os.sys.version_info[1]) def initEnvironment(env): rootpath = env.Dir('#.').srcnode().abspath extincludepath = os.path.join(rootpath, 'ext', 'install', 'include') extlibpath = os.path.join(rootpath, 'ext', 'install', 'lib') env.Append(CPPPATH = [os.path.join('/', 'opt', 'include'), os.path.join('/', 'usr', 'include', 'vorbis'), os.path.join('/', 'usr', 'include', 'SDL'), os.path.join('/', 'usr', 'include', pythonversion), extincludepath]) env.Append(LIBPATH = [os.path.join('/', 'opt', 'lib'), extlibpath, env.subst('$LIBDIR')]) env.AppendENVPath('LD_RUN_PATH', os.path.join('..', '..', '..', extlibpath)) env.AppendUnique(CXXFLAGS=["-DPNG_SKIP_SETJMP_CHECK"]) return env def addExtras(env, opengl): env.Append(LIBS = pythonversion) if opengl: env.Append(LIBS = ['stdc++', 'GL',]) env.Append(LIBPATH = os.path.join('/', 'usr', 'X11R6', 'lib')) # define for using tinyxml with stl support enabled env.AppendUnique(CPPDEFINES = ['TIXML_USE_STL']) return env def getRequiredHeaders(opengl): return None def getRequiredLibs(opengl): # libs is a list of tuples that have the form: # (libname, headers) # libname - may be a single library or a tuple of libraries # headers - may be a single header or a list of headers # # This list is somewhat order dependent # guichan_sdl - depends on at least the SDL libs and guichan prior in the list # guichan_opengl - depends on at least guichan prior in the list libs = [('vorbisfile', 'vorbisfile.h'), (pythonversion, pythonversion + '/Python.h'), ('openal', 'AL/al.h'), ('SDL', 'SDL.h'), ('SDL_ttf', 'SDL_ttf.h'), ('SDL_image', 'SDL_image.h'), ('guichan', 'guichan.hpp'), ('guichan_sdl', ''), ('boost_system', ''), (('boost_filesystem', 'boost_filesystem-gcc', 'boost_filesystem-gcc41', 'boost_filesystem-mt', 'libboost_filesystem-mt'), 'boost/filesystem.hpp'), (('boost_regex', 'boost_regex-gcc', 'boost_regex-gcc41', 'boost_regex-mt', 'libboost_regex-mt'), 'boost/regex.hpp'), ('png', 'png.h'), ('Xcursor', '')] if (opengl): libs.append(('guichan_opengl', '')) return libs def getOptionalLibs(opengl): libs = [('tinyxml', 'tinyxml.h')] return libs # vim: set filetype=python: fife_0.3.5/build/gnukfreebsd8-config.py0000664000175100017510000000646412205217523017062 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### import sys import os import platform pythonversion = 'python' + str(os.sys.version_info[0]) + '.' + str(os.sys.version_info[1]) def initEnvironment(env): rootpath = env.Dir('#.').srcnode().abspath extincludepath = os.path.join(rootpath, 'ext', 'install', 'include') extlibpath = os.path.join(rootpath, 'ext', 'install', 'lib') env.Append(CPPPATH = [os.path.join('/', 'opt', 'include'), os.path.join('/', 'usr', 'include', 'vorbis'), os.path.join('/', 'usr', 'include', 'SDL'), os.path.join('/', 'usr', 'include', pythonversion), extincludepath]) env.Append(LIBPATH = [os.path.join('/', 'opt', 'lib'), extlibpath, env.subst('$LIBDIR')]) env.AppendENVPath('LD_RUN_PATH', os.path.join('..', '..', '..', extlibpath)) env.AppendUnique(CXXFLAGS=["-DPNG_SKIP_SETJMP_CHECK"]) return env def addExtras(env, opengl): env.Append(LIBS = pythonversion) if opengl: env.Append(LIBS = ['stdc++', 'GL',]) env.Append(LIBPATH = os.path.join('/', 'usr', 'X11R6', 'lib')) # define for using tinyxml with stl support enabled env.AppendUnique(CPPDEFINES = ['TIXML_USE_STL']) return env def getRequiredHeaders(opengl): return None def getRequiredLibs(opengl): # libs is a list of tuples that have the form: # (libname, headers) # libname - may be a single library or a tuple of libraries # headers - may be a single header or a list of headers # # This list is somewhat order dependent # guichan_sdl - depends on at least the SDL libs and guichan prior in the list # guichan_opengl - depends on at least guichan prior in the list libs = [('vorbisfile', 'vorbisfile.h'), (pythonversion, pythonversion + '/Python.h'), ('openal', 'AL/al.h'), ('SDL', 'SDL.h'), ('SDL_ttf', 'SDL_ttf.h'), ('SDL_image', 'SDL_image.h'), ('guichan', 'guichan.hpp'), ('guichan_sdl', ''), ('boost_system', ''), (('boost_filesystem', 'boost_filesystem-gcc', 'boost_filesystem-gcc41', 'boost_filesystem-mt', 'libboost_filesystem-mt'), 'boost/filesystem.hpp'), (('boost_regex', 'boost_regex-gcc', 'boost_regex-gcc41', 'boost_regex-mt', 'libboost_regex-mt'), 'boost/regex.hpp'), ('png', 'png.h'), ('Xcursor', '')] if (opengl): libs.append(('guichan_opengl', '')) return libs def getOptionalLibs(opengl): libs = [('tinyxml', 'tinyxml.h')] return libs # vim: set filetype=python: fife_0.3.5/build/linux/0000775000175100017510000000000012205217523014003 5ustar waynewaynefife_0.3.5/build/linux/pkgconfig_files/0000775000175100017510000000000012205217523017134 5ustar waynewaynefife_0.3.5/build/linux/pkgconfig_files/guichan_sdl.pc0000664000175100017510000000076312205217523021746 0ustar waynewayne# guichan_sdl.pc -- pkg-config data for Guichan_SDL # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/' prefix= /usr/local INSTALL_BIN= ${prefix}/bin INSTALL_INC= ${prefix}/include INSTALL_LIB= ${prefix}/lib INSTALL_MAN= ${prefix}/man/man1 # canonical vars exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: Guichan Description: A GUI library Version: 0.8.1 Requires: Libs: -L${libdir} -lguichan_sdl Cflags: -I${includedir} # (end of guichan_sdl.pc) fife_0.3.5/build/linux/pkgconfig_files/sdl.pc0000664000175100017510000000066512205217523020251 0ustar waynewayne# sdl pkg-config source file prefix=/usr/local exec_prefix=${prefix}/bin libdir=${prefix}/lib includedir=${prefix}/include Name: sdl Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer. Version: 1.2.11 Requires: Conflicts: Libs: -framework SDL.framework Cflags: -framework SDL.framework fife_0.3.5/build/linux/pkgconfig_files/guichan_opengl.pc0000664000175100017510000000077712205217523022455 0ustar waynewayne# guichan_opengl.pc -- pkg-config data for Guichan_OpenGL # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/' prefix= /usr/local INSTALL_BIN= ${prefix}/bin INSTALL_INC= ${prefix}/include INSTALL_LIB= ${prefix}/lib INSTALL_MAN= ${prefix}/man/man1 # canonical vars exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: Guichan Description: A GUI library Version: 0.8.1 Requires: Libs: -L${libdir} -lguichan_opengl Cflags: -I${includedir} # (end of guichan_opengl.pc) fife_0.3.5/build/linux/pkgconfig_files/boost_filesystem.pc0000664000175100017510000000120612205217523023051 0ustar waynewayne# boost_filesystem.pc -- pkg-config data for boost_filesystem # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/' prefix= /usr/local INSTALL_BIN= ${prefix}/bin INSTALL_INC= ${prefix}/include/boost-1_33_1 INSTALL_LIB= ${prefix}/lib INSTALL_MAN= ${prefix}/share/man/man1 # canonical vars exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: Boost Filesystem Description: The Boost Filesystem Library provides portable facilities to query and manipulate paths, files and directories. Version: 1.33.1 Requires: Libs: -L${libdir} -lboost_filesystem Cflags: -I${includedir} # (end of boost_filesystem.pc) fife_0.3.5/build/linux/pkgconfig_files/guichan.pc0000664000175100017510000000074312205217523021102 0ustar waynewayne# guichan.pc -- pkg-config data for Guichan # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/' prefix= /usr/local INSTALL_BIN= ${prefix}/bin INSTALL_INC= ${prefix}/include INSTALL_LIB= ${prefix}/lib INSTALL_MAN= ${prefix}/man/man1 # canonical vars exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: Guichan Description: A GUI library Version: 0.8.1 Requires: Libs: -L${libdir} -lguichan Cflags: -I${includedir} # (end of guichan.pc) fife_0.3.5/build/linux/pkgconfig_files/z.pc0000664000175100017510000000072512205217523017735 0ustar waynewayne# z.pc -- pkg-config data for zlib # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/' prefix= /usr INSTALL_BIN= ${prefix}/bin INSTALL_INC= ${prefix}/include INSTALL_LIB= ${prefix}/lib INSTALL_MAN= ${prefix}/share/man/man1 # canonical vars exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: Zlib Description: A compression library Version: 1.2.3.3 Requires: Libs: -L${libdir} -lz Cflags: -I${includedir} # (end of z.pc) fife_0.3.5/build/linux/pkgconfig_files/boost_regex.pc0000664000175100017510000000106712205217523022004 0ustar waynewayne# boost_regex.pc -- pkg-config data for boost_regex # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/' prefix= /usr/local INSTALL_BIN= ${prefix}/bin INSTALL_INC= ${prefix}/include/boost-1_33_1 INSTALL_LIB= ${prefix}/lib INSTALL_MAN= ${prefix}/share/man/man1 # canonical vars exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: Boost Regex Description: Part of the Boost C++ Libraries Collection. Regex module. Version: 1.33.1 Requires: Libs: -L${libdir} -lboost_regex Cflags: -I${includedir} # (end of boost_regex.pc) fife_0.3.5/build/linux/KDevelop/0000775000175100017510000000000012205217523015514 5ustar waynewaynefife_0.3.5/build/linux/KDevelop/FIFE.kdevelop0000664000175100017510000001537512205217523017773 0ustar waynewayne FIFEteam@fife.org $VERSION$ KDevCustomProject C++ ../../.. false FIFE build/linux/KDevelop//../../../tests/unit_tests/testprog_images executable / false true build/linux/KDevelop//../../../tests/unit_tests/ false false false make build/linux/KDevelop/ false 1 0 false default *.java *.h *.H *.hh *.hxx *.hpp *.c *.C *.cc *.cpp *.c++ *.cxx Makefile CMakeLists.txt true false false false true 10 ada ada_bugs_gcc bash bash_bugs clanlib fortran_bugs_gcc gnome1 gnustep gtk gtk_bugs haskell haskell_bugs_ghc java_bugs_gcc java_bugs_sun kde2book opengl pascal_bugs_fp php php_bugs perl perl_bugs python python_bugs qt-kdev3 ruby ruby_bugs sdl sw w3c-dom-level2-html w3c-svg w3c-uaag10 wxwidgets_bugs Guide to the Qt Translation Tools Qt Assistant Manual Qt Designer Manual Qt Reference Documentation qmake User Guide KDE Libraries (Doxygen) true true true false true true true 250 400 250 false 0 true true false std=_GLIBCXX_STD;__gnu_cxx=std true false false false true true true false .; false false false 3 3 EmbeddedKDevDesigner set m_,_ theValue true true false true Vertical false false *.o,*.lo,CVS,*.*~,*.a,*kdevelop.filelist*,*os,fife.log,*.so,*.pyc,tags,FIFE.kdevelop.pcs,Doxyfile,*~,testprog_* false .h .cpp fife_0.3.5/build/linux/KDevelop/Makefile0000664000175100017510000000011612205217523017152 0ustar waynewayneFIFE: cd ../../.. && scons -Q tests=yes clean: cd ../../.. && scons --clean fife_0.3.5/build/linux/code_blocks/0000775000175100017510000000000012205217523016252 5ustar waynewaynefife_0.3.5/build/linux/code_blocks/Fife workspace.workspace0000664000175100017510000000032012205217523023015 0ustar waynewayne fife_0.3.5/build/linux/code_blocks/engine_template.xml0000664000175100017510000000367712205217523022151 0ustar waynewayne fife_0.3.5/build/openbsd4-config.py0000664000175100017510000000347612205217523016211 0ustar waynewayne# Install the following packages: libvorbis python py-yaml swig png openal sdl # sdl-image sdl-ttf guichan boost # import sys import os def initEnvironment(env): # Vorbisfile env.Append(CPPPATH = [ os.path.join('/', 'usr', 'local', 'include'), os.path.join('/', 'usr', 'local', 'include', 'vorbis') ]) env.Append(LIBPATH = [os.path.join('/', 'usr', 'local', 'lib')]) env.Append(LIBS = ['ogg', 'vorbis']) # PNG env.Append(CPPPATH = [os.path.join('/', 'usr', 'local', 'include', 'libpng')]) # Python library pythonversion = 'python' + str(os.sys.version_info[0]) + '.' + str(os.sys.version_info[1]) env.Append(CPPPATH = os.path.join('/', 'usr', 'local', 'include', pythonversion)) env.Append(LIBS = [pythonversion, 'util']) # OpenBSD specific pthreads option env.Append(LINKFLAGS = ['-pthread']) return env def addExtras(env, opengl): if opengl: env.Append(LIBS = ['stdc++', 'GL']) env.Append(LIBPATH = os.path.join('/', 'usr', 'X11R6', 'lib')) # define for using tinyxml with stl support enabled env.AppendUnique(CPPDEFINES = ['TIXML_USE_STL']) return env def getRequiredHeaders(opengl): return None def getRequiredLibs(opengl): libs = [ ('vorbisfile', 'vorbisfile.h'), ('openal', 'AL/al.h'), ('SDL', 'SDL.h'), ('SDL_ttf', 'SDL_ttf.h'), ('SDL_image', 'SDL_image.h'), ('guichan', 'guichan.hpp'), ('guichan_sdl', ''), ('boost_system', ''), (('boost_filesystem', 'boost_filesystem-gcc', 'boost_filesystem-gcc41', 'boost_filesystem-mt'), 'boost/filesystem.hpp'), (('boost_regex', 'boost_regex-gcc', 'boost_regex-gcc41', 'boost_regex-mt'), 'boost/regex.hpp'), ('png', 'png.h'), ('Xcursor', 'X11/Xcursor/Xcursor.h')] if (opengl): libs.append(('guichan_opengl', '')) return libs def getOptionalLibs(opengl): libs = [('tinyxml', 'tinyxml.h')] return libs # vim: ft=python: fife_0.3.5/build/freebsd8-config.py0000664000175100017510000000214512205217523016165 0ustar waynewayne# Needed pkg-config additions: # SDL_ttf & SDL_image # guichan, guichan_opengl & guichan_sdl # boost_filesystem & boost_regex # vorbisfile # openal import sys def initEnvironment(env): return env def addExtras(context): context.env.Append(CPPPATH = ['/usr/local/include/vorbis']) context.checkSimpleLib(['vorbisfile'], 'vorbisfile.h') context.checkSimpleLib(['openal'], 'AL/al.h') context.checkSimpleLib(['sdl11', 'sdl12', 'sdl'], 'SDL.h') context.checkSimpleLib(['SDL_ttf'], 'SDL_ttf.h') context.checkSimpleLib(['SDL_image'], 'SDL_image.h') context.checkSimpleLib(['guichan']) context.checkSimpleLib(['guichan_sdl']) context.checkSimpleLib(['boost_filesystem']) context.checkSimpleLib(['boost_regex']) context.checkSimpleLib(['xcursor']) context.checkSimpleLib(['png'], 'png.h') if context.env['opengl']: context.env.Append(LIBS = ['GL']) context.env.Append(CPPPATH = ['/usr/local/include']) context.env.Append(LIBPATH = ['/usr/local/lib']) context.checkSimpleLib(['guichan_opengl']) # For swig/python: context.env.Append(CPPPATH = ['/usr/local/include/python%s'%sys.version[:3]]) fife_0.3.5/build/darwin-config.py0000664000175100017510000000501712205217523015750 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### import os,sys from distutils.sysconfig import get_python_inc def initEnvironment(env): include_dirs = ['/opt/local/include', '/usr/local/include', '/usr/X11/include', '/opt/local/include/SDL', '/opt/local/include/guichan', '/opt/local/include/boost', '/System/Library/Frameworks/OpenAL.framework/Headers', '/opt/local/include/vorbis/', get_python_inc()] lib_dirs = ['/System/Library', '/opt/local/lib', '/usr/X11/lib'] env.Append(CPPPATH = include_dirs) env.Append(LIBPATH = lib_dirs) return env def addExtras(env, opengl): env.Append(SHLINKFLAGS='-F/opt/local/Library/Frameworks') env.Append(SHLINKFLAGS='-framework OpenAL') env.Append(SHLINKFLAGS='-framework Cocoa') env.Append(SHLINKFLAGS='-framework CoreFoundation') env.Append(SHLINKFLAGS='-framework Python') env.Prepend(CXXFLAGS = '-DUSE_COCOA') if opengl: env.Append(SHLINKFLAGS='-framework OpenGL') # define for using tinyxml with stl support enabled env.AppendUnique(CPPDEFINES = ['TIXML_USE_STL']) return env def getRequiredHeaders(opengl): return ['SDL/SDL_image.h', 'SDL/SDL_ttf.h'] def getRequiredLibs(opengl): libs = [('objc', ''), ('png', ''), ('SDL', ''), ('SDL_image', ''), ('SDL_ttf', ''), ('vorbisfile', 'vorbisfile.h'), ('guichan', ''), ('guichan_sdl', ''), ('z', 'zlib.h'), ('boost_filesystem-mt', ''), ('boost_system-mt', ''), ('boost_regex-mt', '')] if opengl: libs.append(('guichan_opengl', '')) return libs def getOptionalLibs(opengl): libs = [('tinyxml', 'tinyxml.h')] return libs fife_0.3.5/build/win32/0000775000175100017510000000000012205217523013606 5ustar waynewaynefife_0.3.5/build/win32/create_documentation.bat0000664000175100017510000000132412205217523020472 0ustar waynewayne:: Users will need to change paths if they use custom MinGW, SCons, Python or SWIG versions that didn't ship with the SDK SET _=%CD% SET _SWIG="%_%\applications\swigwin-1.3.40" :: To avoid path collisions the following line was commented out and replaced with a slightly different version :: SET PATH=%Path%;%_%\applications\scons;%_%\applications\mingw\bin SET PATH=%Path%;%_%\applications\scons;%_%\applications\mingw\bin :: Delete doxygen_log.txt in case that it's still in place from a former compile sessions del %_%\doxygen_log.txt :: Goto TRUNK and call SCons cd \ cd %_%\..\.. python build\win32\applications\scons\scons.py docs >> "%_%\doxygen_log.txt" 2>&1 :: Return us to the directory we started from cd %_% fife_0.3.5/build/win32/README.txt0000664000175100017510000000352512205217523015311 0ustar waynewayne========================== FIFE Win32 compile guide for building the 2009.0 release version ========================== Installation / build process ========================== 1. Check out the latest engine sources from SVN: Repository URL: http://fife.svn.cvsdude.com/engine/trunk 2.1 Get the latest compile SDK for Win32 from the FIFE wiki: http://wiki.fifengine.de/index.php?title=Download_section#Compile_SDKs 2.2 Get ActivePython 2.5 and install it to a location of your choice: http://downloads.activestate.com/ActivePython/windows/2.5/ActivePython-2.5.1.1-win32-x86.msi 3. Extraction process 3.1 Extract the content of the compile SDK to: \build\win32\ 3.2 Check if there is an \build\win32\applications folder; if it's in place, you know that you extracted the SDK into the correct location. One possible issue is that you've checked out the whole engine SVN repository instead of just trunk. In this case extract the compile SDK to: \trunk\build\win32 (if you want to compile trunk, otherwhise it needs to be extracted into the build\win32 directory of the branch that you want to compile) 4.1 Run \trunk\build\win32\update_project_files.bat. 4.2 Build files for each supported IDE can be found in the sub-directories of \build\win32\build_environments (code_blocks, scons, visual_studio_8, visual_studio_9). 5. The final dynamic library (_fife.pyd) is automatically moved to: \engine 6. Depending on the IDE you have utilized for building FIFE you either need to run \build\win32\update_dlls_mingw.bat (in case you built FIFE with code::blocks or scons), \build\win32\update_dlls_msvc2005.bat (Visual Studio 2005) or \build\win32\update_dlls_msvc2008.bat (Visual Studio 2008). 7. You can now start your custom FIFE build by launching the python scripts that reside in the subdirectories of \clients. fife_0.3.5/build/win32/update_swig_files.bat0000664000175100017510000000012312205217523017767 0ustar waynewayne@echo off :: run scons python applications\scons\scons.py -C ..\..\ fife-swig fife_0.3.5/build/win32/update_project_files.bat0000664000175100017510000000047712205217523020500 0ustar waynewayne@echo off SET _=%CD% :: Delete old generated project files to ensure that they get generated from scratch again cd %_%\build_environments del code_blocks\fife.cbp del visual_studio_8\fife.vcproj del visual_studio_9\fife.vcproj :: run scons cd %_% python applications\scons\scons.py -C ..\..\ projects fife_0.3.5/build/win32/delete_sdk.bat0000664000175100017510000000006412205217523016401 0ustar waynewaynerd /S /Q applications binaries includes static_libs fife_0.3.5/build/win32/build_environments/0000775000175100017510000000000012205217523017514 5ustar waynewaynefife_0.3.5/build/win32/build_environments/scons/0000775000175100017510000000000012205217523020641 5ustar waynewaynefife_0.3.5/build/win32/build_environments/scons/list_scons_args.bat0000664000175100017510000000015212205217523024523 0ustar waynewayne@echo off :: run scons python ..\..\applications\scons\scons.py -C ..\..\..\..\ -h > scons_args.txt 2>&1 fife_0.3.5/build/win32/build_environments/scons/logbuild_engine_nolog.bat0000664000175100017510000000033312205217523025654 0ustar waynewayne@echo off :: run scons python ..\..\applications\scons\scons.py -C ..\..\..\..\ --disable-log %* fife-python > engine_build_log.txt 2>&1 :: copy the needed dlls to the path where fife was installed call copy_dlls.bat fife_0.3.5/build/win32/build_environments/scons/cleanup_engine.bat0000664000175100017510000000043712205217523024311 0ustar waynewaynepython ..\..\applications\scons\scons.py -C ..\..\..\..\ -c python ..\..\applications\scons\scons.py -C ..\..\..\..\ --enable-debug -c python ..\..\applications\scons\scons.py -C ..\..\..\..\ -c fife-python fife-swig python ..\..\applications\scons\scons.py -C ..\..\..\..\ -c distclean fife_0.3.5/build/win32/build_environments/scons/logbuild_tests.bat0000664000175100017510000000030712205217523024354 0ustar waynewayne@echo off :: run scons python ..\..\applications\scons\scons.py -C ..\..\..\..\ %* tests > engine_build_log.txt 2>&1 :: copy the needed dlls to the path where fife was installed call copy_dlls.bat fife_0.3.5/build/win32/build_environments/scons/build_engine_debug.bat0000664000175100017510000000030112205217523025115 0ustar waynewayne@echo off :: run scons python ..\..\applications\scons\scons.py -C ..\..\..\..\ --enable-debug %* fife-python :: copy the needed dlls to the path where fife was installed call copy_dlls.bat fife_0.3.5/build/win32/build_environments/scons/build_engine.bat0000664000175100017510000000026112205217523023754 0ustar waynewayne@echo off :: run scons python ..\..\applications\scons\scons.py -C ..\..\..\..\ %* fife-python :: copy the needed dlls to the path where fife was installed call copy_dlls.bat fife_0.3.5/build/win32/build_environments/scons/install_engine.bat0000664000175100017510000000012012205217523024315 0ustar waynewayne@echo off :: run scons pushd ..\..\..\..\ python setup.py install popd fife_0.3.5/build/win32/build_environments/scons/loginstall_engine.bat0000664000175100017510000000015412205217523025026 0ustar waynewayne@echo off :: run scons pushd ..\..\..\..\ python setup.py install > engine_install_log.txt 2>&1 popd fife_0.3.5/build/win32/build_environments/scons/build_tests.bat0000664000175100017510000000025412205217523023653 0ustar waynewayne@echo off :: run scons python ..\..\applications\scons\scons.py -C ..\..\..\..\ %* tests :: copy the needed dlls to the path where fife was installed call copy_dlls.bat fife_0.3.5/build/win32/build_environments/scons/build_engine_nolog.bat0000664000175100017510000000030012205217523025144 0ustar waynewayne@echo off :: run scons python ..\..\applications\scons\scons.py -C ..\..\..\..\ --disable-log %* fife-python :: copy the needed dlls to the path where fife was installed call copy_dlls.bat fife_0.3.5/build/win32/build_environments/scons/copy_dlls.bat0000664000175100017510000000075312205217523023326 0ustar waynewayne@echo off if not defined xcopy goto :noxcopy xcopy "..\..\binaries\mingw\*.dll" "..\..\..\..\engine\python\fife" /e /c /i /q /y if "%1" == "install" xcopy "..\..\binaries\mingw\*.dll" "C:\Python26\Lib\site-packages\fife" /e /c /i /q /y :noxcopy %SystemRoot%\system32\xcopy "..\..\binaries\mingw\*.dll" "..\..\..\..\engine\python\fife" /e /c /i /q /y if "%1" == "install" %SystemRoot%\system32\xcopy "..\..\binaries\mingw\*.dll" "C:\Python26\Lib\site-packages\fife" /e /c /i /q /y fife_0.3.5/build/win32/build_environments/scons/logbuild_engine_debug.bat0000664000175100017510000000033412205217523025625 0ustar waynewayne@echo off :: run scons python ..\..\applications\scons\scons.py -C ..\..\..\..\ --enable-debug %* fife-python > engine_build_log.txt 2>&1 :: copy the needed dlls to the path where fife was installed call copy_dlls.bat fife_0.3.5/build/win32/build_environments/scons/logbuild_engine.bat0000664000175100017510000000031512205217523024456 0ustar waynewayne@echo off :: run scons python ..\..\applications\scons\scons.py -C ..\..\..\..\ %* fife-python > engine_build_log.txt 2>&1 :: copy the needed dlls to the path where fife was installed call copy_dlls.bat fife_0.3.5/build/win32/build_environments/visual_studio_9/0000775000175100017510000000000012205217523022636 5ustar waynewaynefife_0.3.5/build/win32/build_environments/visual_studio_9/Fife_UnitTest.vcproj0000664000175100017510000001332612205217523026600 0ustar waynewayne fife_0.3.5/build/win32/build_environments/visual_studio_9/Fife_UnitTest.sln0000664000175100017510000000276212205217523026073 0ustar waynewayne Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Fife_UnitTest", "Fife_UnitTest.vcproj", "{CF8061DB-347A-4BEC-A63B-FBFE5BAB9D1B}" ProjectSection(ProjectDependencies) = postProject {96025707-5759-400D-80E5-A1E94C8A79A2} = {96025707-5759-400D-80E5-A1E94C8A79A2} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfife", "fife.vcproj", "{96025707-5759-400D-80E5-A1E94C8A79A2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {CF8061DB-347A-4BEC-A63B-FBFE5BAB9D1B}.Debug|Win32.ActiveCfg = Debug|Win32 {CF8061DB-347A-4BEC-A63B-FBFE5BAB9D1B}.Debug|Win32.Build.0 = Debug|Win32 {CF8061DB-347A-4BEC-A63B-FBFE5BAB9D1B}.Release|Win32.ActiveCfg = Release|Win32 {CF8061DB-347A-4BEC-A63B-FBFE5BAB9D1B}.Release|Win32.Build.0 = Release|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Debug|Win32.ActiveCfg = Debug_static|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Debug|Win32.Build.0 = Debug_static|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Release|Win32.ActiveCfg = Release_static|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Release|Win32.Build.0 = Release_static|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal fife_0.3.5/build/win32/build_environments/visual_studio_9/engine_template.xml0000664000175100017510000003557012205217523026532 0ustar waynewayne __FILE_INSERTION_POINT__ fife_0.3.5/build/win32/build_environments/visual_studio_9/fife.vcproj.user0000664000175100017510000000120512205217523025747 0ustar waynewayne fife_0.3.5/build/win32/build_environments/visual_studio_9/fife_engine.sln0000664000175100017510000000353612205217523025621 0ustar waynewayne Microsoft Visual Studio Solution File, Format Version 10.00 # Visual C++ Express 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fife", "fife.vcproj", "{96025707-5759-400D-80E5-A1E94C8A79A2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug_python|Win32 = Debug_python|Win32 Debug_shared|Win32 = Debug_shared|Win32 Debug_static|Win32 = Debug_static|Win32 Release_python|Win32 = Release_python|Win32 Release_shared|Win32 = Release_shared|Win32 Release_static|Win32 = Release_static|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {96025707-5759-400D-80E5-A1E94C8A79A2}.Debug_python|Win32.ActiveCfg = Debug_python|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Debug_python|Win32.Build.0 = Debug_python|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Debug_shared|Win32.ActiveCfg = Debug_shared|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Debug_shared|Win32.Build.0 = Debug_shared|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Debug_static|Win32.ActiveCfg = Debug_static|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Debug_static|Win32.Build.0 = Debug_static|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Release_python|Win32.ActiveCfg = Release_python|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Release_python|Win32.Build.0 = Release_python|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Release_shared|Win32.ActiveCfg = Release_shared|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Release_shared|Win32.Build.0 = Release_shared|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Release_static|Win32.ActiveCfg = Release_static|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Release_static|Win32.Build.0 = Release_static|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal fife_0.3.5/build/win32/build_environments/visual_studio_8/0000775000175100017510000000000012205217523022635 5ustar waynewaynefife_0.3.5/build/win32/build_environments/visual_studio_8/engine_template.xml0000664000175100017510000003543412205217523026530 0ustar waynewayne __FILE_INSERTION_POINT__ fife_0.3.5/build/win32/build_environments/visual_studio_8/generate_unittests.py0000664000175100017510000000641412205217523027130 0ustar waynewayneimport sys, os , pythoncom def main (from_path, to_path): # check if the output-folder exists if os.path.exists(to_path) == False: os.mkdir(to_path); # traverse the unit_test-files files = os.listdir(from_path) guidlist=[] filelist=[] for file in files: if (file[-4:] == ".cpp"): guidlist.append(writeProject(file[0:-4], to_path)) filelist.append(file[0:-4].replace("test_", "testprog_")) writeSolution(to_path, filelist, guidlist) def writeProject(file, to_path): infile = open("unittest_template.xml", "r") outfile = open(to_path + "/" + file.replace("test_", "testprog_") + ".vcproj", "w") text = infile.read() guid = pythoncom.CreateGuid() text = text.replace("__INSERT_NAME_HERE__", file.replace("test_", "testprog_")) text = text.replace("__INSERT_FILENAME_HERE__", file) text = text.replace("__INSERT_GUID_HERE__", str(guid)) outfile.write(text) return str(guid) def writeSolution(to_path, namelist, guidlist): solution = open(to_path + "/unit_tests.sln", "w") solution.write("\xef\xbb\xbf\n") # Specify MSVS 2005 solution.write("Microsoft Visual Studio Solution File, Format Version 9.00\n") solution.write("# Visual Studio 2005\n") # add the libfife-project solution.write("Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libfife\", \"..\\fife.vcproj\", \"{96025707-5759-400D-80E5-A1E94C8A79A2}\"\n") solution.write("EndProject\n") # Add the test projects: for i in range(len(namelist)): solution.write("Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"" + namelist[i] + "\", \"" + namelist[i] + ".vcproj\", \"" + guidlist[i] + "\"\n") solution.write(" ProjectSection(ProjectDependencies) = postProject\n") solution.write(" {96025707-5759-400D-80E5-A1E94C8A79A2} = {96025707-5759-400D-80E5-A1E94C8A79A2}\n") solution.write(" EndProjectSection\n") solution.write("EndProject\n") solution.write("Global\n") solution.write(" GlobalSection(SolutionConfigurationPlatforms) = preSolution\n") solution.write(" Debug_static|Win32 = Debug_static|Win32\n") solution.write(" Release_static|Win32 = Release_static|Win32\n") solution.write(" EndGlobalSection\n") solution.write(" GlobalSection(ProjectConfigurationPlatforms) = postSolution\n") solution.write(" {96025707-5759-400D-80E5-A1E94C8A79A2}.Debug_static|Win32.ActiveCfg = Debug_static|Win32\n") solution.write(" {96025707-5759-400D-80E5-A1E94C8A79A2}.Debug_static|Win32.Build.0 = Debug_static|Win32\n") solution.write(" {96025707-5759-400D-80E5-A1E94C8A79A2}.Release_static|Win32.ActiveCfg = Release_static|Win32\n") solution.write(" {96025707-5759-400D-80E5-A1E94C8A79A2}.Release_static|Win32.Build.0 = Release_static|Win32\n") for guid in guidlist: solution.write(" " + guid + ".Debug|Win32.ActiveCfg = Debug_static|Win32\n") solution.write(" " + guid + ".Debug|Win32.Build.0 = Debug_static|Win32\n") solution.write(" " + guid + ".Release|Win32.ActiveCfg = Release_static|Win32\n") solution.write(" " + guid + ".Release|Win32.Build.0 = Release_static|Win32\n") solution.write(" EndGlobalSection\n") solution.write(" GlobalSection(SolutionProperties) = preSolution\n") solution.write(" HideSolutionNode = FALSE\n") solution.write(" EndGlobalSection\n") solution.write("EndGlobal\n") # call main function main ("../../../../tests/core_tests", "./unit_tests") fife_0.3.5/build/win32/build_environments/visual_studio_8/fife.vcproj.user0000664000175100017510000000120512205217523025746 0ustar waynewayne fife_0.3.5/build/win32/build_environments/visual_studio_8/fife_engine.sln0000664000175100017510000000353012205217523025612 0ustar waynewayne Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fife", "fife.vcproj", "{96025707-5759-400D-80E5-A1E94C8A79A2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug_python|Win32 = Debug_python|Win32 Debug_shared|Win32 = Debug_shared|Win32 Debug_static|Win32 = Debug_static|Win32 Release_python|Win32 = Release_python|Win32 Release_shared|Win32 = Release_shared|Win32 Release_static|Win32 = Release_static|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {96025707-5759-400D-80E5-A1E94C8A79A2}.Debug_python|Win32.ActiveCfg = Debug_python|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Debug_python|Win32.Build.0 = Debug_python|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Debug_shared|Win32.ActiveCfg = Debug_shared|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Debug_shared|Win32.Build.0 = Debug_shared|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Debug_static|Win32.ActiveCfg = Debug_static|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Debug_static|Win32.Build.0 = Debug_static|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Release_python|Win32.ActiveCfg = Release_python|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Release_python|Win32.Build.0 = Release_python|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Release_shared|Win32.ActiveCfg = Release_shared|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Release_shared|Win32.Build.0 = Release_shared|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Release_static|Win32.ActiveCfg = Release_static|Win32 {96025707-5759-400D-80E5-A1E94C8A79A2}.Release_static|Win32.Build.0 = Release_static|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal fife_0.3.5/build/win32/build_environments/visual_studio_8/unittest_template.xml0000664000175100017510000001037712205217523027141 0ustar waynewayne fife_0.3.5/build/win32/build_environments/code_blocks/0000775000175100017510000000000012205217523021763 5ustar waynewaynefife_0.3.5/build/win32/build_environments/code_blocks/engine_template.xml0000664000175100017510000001120512205217523025644 0ustar waynewayne fife_0.3.5/build/win32/build_environments/code_blocks/core_tests++.cbp0000664000175100017510000000664112205217523024760 0ustar waynewayne fife_0.3.5/build/win32/installer/0000775000175100017510000000000012205217523015603 5ustar waynewaynefife_0.3.5/build/win32/installer/license.rtf0000664000175100017510000027725612205217523017765 0ustar waynewayne{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31506\stshfloch31506\stshfhich31506\stshfbi31507\deflang1044\deflangfe1044\themelang1044\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;} {\f3\fbidi \froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f10\fbidi \fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;} {\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} {\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;} {\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} {\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;} {\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f39\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f40\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} {\f42\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f43\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f44\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f45\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} {\f46\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f47\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f59\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}{\f60\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;} {\f62\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f63\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f64\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f65\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);} {\f66\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f67\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f379\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f380\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;} {\f382\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f383\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f386\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f409\fbidi \fswiss\fcharset238\fprq2 Calibri CE;} {\f410\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\f412\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f413\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f416\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;} {\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} {\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} {\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} {\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} {\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} {\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;} {\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;} {\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} {\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} {\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} {\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} {\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} {\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} {\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} {\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} {\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} {\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} {\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} {\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}} {\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0; \red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\caccentone\ctint191\cshade255\red123\green160\blue205;\caccentone\ctint255\cshade255\red79\green129\blue189;\red255\green255\blue255; \cbackgroundone\ctint255\cshade255\red255\green255\blue255;\caccentone\ctint63\cshade255\red211\green223\blue238;}{\*\defchp \f31506\fs22\lang1044\langfe1033\langfenp1033 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1 \widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1044\langfe1033\cgrid\langnp1044\langfenp1033 \snext0 \sqformat \spriority0 \styrsid14828058 Normal;}{ \s1\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs48\alang1025 \ltrch\fcs0 \b\fs48\lang1044\langfe1044\kerning36\cgrid\langnp1044\langfenp1044 \sbasedon0 \snext1 \slink16 \sqformat \spriority9 \styrsid4288356 heading 1;}{\s2\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs36\alang1025 \ltrch\fcs0 \b\fs36\lang1044\langfe1044\cgrid\langnp1044\langfenp1044 \sbasedon0 \snext2 \slink17 \sqformat \spriority9 \styrsid4288356 heading 2;}{ \s3\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs27\alang1025 \ltrch\fcs0 \b\fs27\lang1044\langfe1044\cgrid\langnp1044\langfenp1044 \sbasedon0 \snext3 \slink18 \sqformat \spriority9 \styrsid4288356 heading 3;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\* \ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1 \widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1044\langfe1033\cgrid\langnp1044\langfenp1033 \snext11 \ssemihidden \sunhideused \sqformat Normal Table;}{\* \ts15\tsrowd\trbrdrt\brdrs\brdrw20\brdrcf17 \trbrdrl\brdrs\brdrw20\brdrcf17 \trbrdrb\brdrs\brdrw20\brdrcf17 \trbrdrr\brdrs\brdrw20\brdrcf17 \trbrdrh\brdrs\brdrw20\brdrcf17 \trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tscbandsh1\tscbandsv1\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1044\langfe1033\cgrid\langnp1044\langfenp1033 \sbasedon11 \snext15 \spriority63 \styrsid4154059 Medium Shading 1 Accent 1;}{\*\ts15\tsrowd\tscellcfpat0\tscellcbpat18\tscellpct0\tsbrdrt\brdrs\brdrw20\brdrcf17 \tsbrdrl\brdrs\brdrw20\brdrcf17 \tsbrdrb\brdrs\brdrw20\brdrcf17 \tsbrdrr\brdrs\brdrw20\brdrcf17 \tsbrdrh\brdrnone \tsbrdrv\brdrnone \sb0\sa0 \rtlch\fcs1 \ab\af31507 \ltrch\fcs0 \b\cf20 \tscfirstrow Medium Shading 1 Accent 1;}{\*\ts15\tsrowd\tsbrdrt\brdrdb\brdrw15\brdrcf17 \tsbrdrl\brdrs\brdrw20\brdrcf17 \tsbrdrb\brdrs\brdrw20\brdrcf17 \tsbrdrr\brdrs\brdrw20\brdrcf17 \tsbrdrh\brdrnone \tsbrdrv \brdrnone \sb0\sa0 \rtlch\fcs1 \ab\af31507 \ltrch\fcs0 \b \tsclastrow Medium Shading 1 Accent 1;}{\*\ts15\tsrowd \rtlch\fcs1 \ab\af31507 \ltrch\fcs0 \b \tscfirstcol Medium Shading 1 Accent 1;}{\*\ts15\tsrowd \rtlch\fcs1 \ab\af31507 \ltrch\fcs0 \b \tsclastcol Medium Shading 1 Accent 1;}{\*\ts15\tsrowd\tscellcfpat0\tscellcbpat21\tscellpct0 \rtlch\fcs1 \af31507 \ltrch\fcs0 \tscbandvertodd Medium Shading 1 Accent 1;}{\*\ts15\tsrowd\tscellcfpat0\tscellcbpat21\tscellpct0\tsbrdrh\brdrnone \tsbrdrv \brdrnone \rtlch\fcs1 \af31507 \ltrch\fcs0 \tscbandhorzodd Medium Shading 1 Accent 1;}{\*\ts15\tsrowd\tsbrdrh\brdrnone \tsbrdrv\brdrnone \rtlch\fcs1 \af31507 \ltrch\fcs0 \tscbandhorzeven Medium Shading 1 Accent 1;}{\*\cs16 \additive \rtlch\fcs1 \ab\af0\afs48 \ltrch\fcs0 \b\f0\fs48\lang0\langfe1044\kerning36\langfenp1044 \sbasedon10 \slink1 \slocked \spriority9 \styrsid4288356 Overskrift 1 Tegn;}{\*\cs17 \additive \rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\lang0\langfe1044\langfenp1044 \sbasedon10 \slink2 \slocked \spriority9 \styrsid4288356 Overskrift 2 Tegn;}{\*\cs18 \additive \rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\lang0\langfe1044\langfenp1044 \sbasedon10 \slink3 \slocked \spriority9 \styrsid4288356 Overskrift 3 Tegn;}{\* \cs19 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 \spriority0 \styrsid4288356 editsection;}{\*\cs20 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \ul\cf2 \sbasedon10 \sunhideused \styrsid4288356 Hyperlink;}{\*\cs21 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 \spriority0 \styrsid4288356 mw-headline;}{\*\cs22 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 \spriority0 \styrsid4288356 toctoggle;}{\*\cs23 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 \spriority0 \styrsid4288356 tocnumber;}{\* \cs24 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 \spriority0 \styrsid4288356 toctext;}{\s25\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1044\langfe1044\cgrid\langnp1044\langfenp1044 \sbasedon0 \snext25 \ssemihidden \sunhideused \styrsid4288356 Normal (Web);}{\s26\ql \li720\ri0\sa200\sl276\slmult1 \widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\contextualspace \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1044\langfe1033\cgrid\langnp1044\langfenp1033 \sbasedon0 \snext26 \sqformat \spriority34 \styrsid989751 List Paragraph;}{\s27\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1044\langfe1033\cgrid\langnp1044\langfenp1033 \snext27 \sqformat \spriority1 \styrsid546185 No Spacing;}}{\*\listtable{\list\listtemplateid-707091054{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 \levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0 {\leveltext\'01o;}{\levelnumbers;}\f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid7829027}{\list\listtemplateid1902025510{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0 \levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01o;}{\levelnumbers;}\f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;} \f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;} \f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;} \f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;} \f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;} \f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;} \f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;} \f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid672606555}{\list\listtemplateid1407204796{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext \'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;} \f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;} \f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;} \f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;} \f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;} \f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;} \f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;} \f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;} \f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1399012476}{\list\listtemplateid-1701530904{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext \'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1544170507}{\list\listtemplateid-808534830{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 \levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 {\leveltext\'01o;}{\levelnumbers;}\f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1796169553}{\list\listtemplateid1735579398{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 \levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0 {\leveltext\'01o;}{\levelnumbers;}\f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext \'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid2125268395}}{\*\listoverridetable{\listoverride\listid1796169553\listoverridecount0\ls1}{\listoverride\listid2125268395 \listoverridecount0\ls2}{\listoverride\listid1544170507\listoverridecount0\ls3}{\listoverride\listid7829027\listoverridecount0\ls4}{\listoverride\listid672606555\listoverridecount0\ls5}{\listoverride\listid1399012476\listoverridecount0\ls6}}{\*\pgptbl {\pgp\ipgp3\itap1\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp2\itap0\li0\ri0\sb0\sa0}}{\*\rsidtbl \rsid139237\rsid212568\rsid546185\rsid989751\rsid4154059\rsid4288356\rsid5521399\rsid7628730\rsid11091661\rsid13848561\rsid14828058 \rsid15615141\rsid16005567}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\author Bruker}{\operator Bruker}{\creatim\yr2009\mo9\dy2\hr23\min53} {\revtim\yr2009\mo9\dy3\min1}{\version10}{\edmins9}{\nofpages10}{\nofwords4333}{\nofchars22968}{\*\company H\'f8gskolen i Hedmark}{\nofcharsws27247}{\vern32771}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}} \paperw11906\paperh16838\margl1417\margr1417\margt1417\margb1417\gutter0\ltrsect \deftab708\widowctrl\ftnbj\aenddoc\hyphhotz425\trackmoves1\trackformatting1\donotembedsysfont1\relyonvml0\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0 \showxmlerrors1\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1417\dgvorigin1417\dghshow1\dgvshow1 \jexpand\viewkind1\viewscale125\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct \asianbrkrule\rsidroot4288356\newtblstyruls\nogrowautofit\usenormstyforlist\noindnmbrts\felnbrelev\nocxsptable\indrlsweleven\noafcnsttbl\afelev\utinl\hwelev\spltpgpar\notcvasp\notbrkcnstfrctbl\notvatxbx\krnprsnet\cachedcolbal \nouicompat \fet0 {\*\wgrffmtfilter 2450}\nofeaturethrottle1\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid14828058\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}} {\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}} {\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9 \pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\s1\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid7628730 \rtlch\fcs1 \ab\af0\afs48\alang1025 \ltrch\fcs0 \b\fs48\lang1044\langfe1044\kerning36\cgrid\langnp1044\langfenp1044 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1044\langnp1033\insrsid4288356\charrsid4288356 License}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1044\langnp1033\insrsid7628730 \line }{\rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16\lang1033\langfe1044\langnp1033\insrsid4288356\charrsid4288356 From FIFE development wiki}{\rtlch\fcs1 \af0\afs36 \ltrch\fcs0 \fs36\lang1033\langfe1044\langnp1033\insrsid4288356\charrsid4288356 {\*\bkmkstart Introduction}{\*\bkmkend Introduction} }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1044\langnp1033\insrsid4288356\charrsid4288356 \par }\pard\plain \ltrpar\s2\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid989751 \rtlch\fcs1 \ab\af0\afs36\alang1025 \ltrch\fcs0 \b\fs36\lang1044\langfe1044\cgrid\langnp1044\langfenp1044 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1044\langnp1033\insrsid139237\charrsid4288356 Contents \par }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid13848561 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1044\langfe1033\cgrid\langnp1044\langfenp1033 {\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid139237\charrsid212568 1 Introduction}{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid13848561 \line }{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid139237\charrsid212568 2 Used licenses}{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid13848561 \line }{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid139237\charrsid212568 3 Content license aspects}{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid13848561 \line }{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid139237\charrsid212568 4 The source code license }{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid13848561 \line }{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid139237\charrsid212568 4.1 GNU LESSER GENERAL PUBLIC LICENSE}{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid13848561 \line }{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid139237\charrsid212568 4.2 Preamble}{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid13848561 \line }{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid139237\charrsid212568 4.3 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION}{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid13848561 \line }{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid139237\charrsid212568 4.4 How to Apply These Terms to Your New Libraries}{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid139237\charrsid4288356 \par }\pard\plain \ltrpar\s2\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid989751 \rtlch\fcs1 \ab\af0\afs36\alang1025 \ltrch\fcs0 \b\fs36\lang1044\langfe1044\cgrid\langnp1044\langfenp1044 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1044\langnp1033\insrsid4288356\charrsid4288356 {\*\bkmkstart Used_licenses}{\*\bkmkend Used_licenses}Used licenses \par }\pard\plain \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4288356 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1044\langfe1033\cgrid\langnp1044\langfenp1033 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 The whole source code that the FIFE developers create will be licensed under the LGPL v2.1 or newer. }{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1044\langfe1044\langfenp1044\insrsid4288356\charrsid4288356 This means in detail: \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f3\fs20\lang1044\langfe1044\langfenp1044\insrsid4288356\charrsid4288356 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb100\sa100\sbauto1\saauto1\widctlpar \jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin720\itap0\pararsid4288356 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1044\langfe1044\langfenp1044\insrsid4288356\charrsid4288356 Engine code (C++) \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f3\fs20\lang1044\langfe1044\langfenp1044\insrsid4288356\charrsid4288356 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Editor code (C++ & Python) \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f3\fs20\lang1044\langfe1044\langfenp1044\insrsid4288356\charrsid4288356 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Engine extensions (Python) \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f3\fs20\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 Additional tools like frm2png or the GeometryTwister (C++ & Python) \par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4288356 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 Content that ships with FIFE releases is licensed under }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 HYPERLINK "http://creativecommons.org/licenses/by-sa/3.0/" \\o "http://creativecommons.org/licenses/by-sa/3.0/" }}{\fldrslt {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\ul\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 Creative Commons 3.0 attribution-share alike}}}\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid14828058\sftnbj { \rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 if not stated otherwhise in a LICENSE file in the same folder. (or if not listed as otherwise in the LICENSE file of the client's directory.) \par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid4288356 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 {\*\bkmkstart Content_license_aspects}{\*\bkmkend Content_license_aspects}Content license aspects \par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4288356 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 All 3rd party content that can be found within the FIFE }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 HYPERLINK "http://wiki.fifengine.de/Subversion_repository" \\o "Subversion repository" }}{\fldrslt {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\ul\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 Subversion repository}}}\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid14828058\sftnbj {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 needs a LICENSE file that contains the following information: \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1044\langfe1044\dbch\af0\langfenp1044\insrsid4288356\charrsid4288356 \hich\af0\dbch\af0\loch\f0 1.\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb100\sa100\sbauto1\saauto1\widctlpar \jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls3\adjustright\rin0\lin720\itap0\pararsid4288356 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1044\langfe1044\langfenp1044\insrsid4288356\charrsid4288356 Affected files \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1044\langfe1044\dbch\af0\langfenp1044\insrsid4288356\charrsid4288356 \hich\af0\dbch\af0\loch\f0 2.\tab}Author \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1044\langfe1044\dbch\af0\langfenp1044\insrsid4288356\charrsid4288356 \hich\af0\dbch\af0\loch\f0 3.\tab}Contact address \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1044\langfe1044\dbch\af0\langfenp1044\insrsid4288356\charrsid4288356 \hich\af0\dbch\af0\loch\f0 4.\tab}Download URL \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1044\langfe1044\dbch\af0\langfenp1044\insrsid4288356\charrsid4288356 \hich\af0\dbch\af0\loch\f0 5.\tab}License \par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid4288356 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\lang1044\langfe1044\langfenp1044\insrsid4288356\charrsid4288356 {\*\bkmkstart The_source_code_license}{\*\bkmkend The_source_code_license}The source code license \par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4288356 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 Taken from the }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 HYPERLINK "http://www.gnu.org/licenses/lgpl-2.1.html" \\o "http://www.gnu.org/licenses/lgpl-2.1.html" }}{\fldrslt {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\ul\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 GNU website}}} \sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid14828058\sftnbj {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 . \par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid4288356 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 {\*\bkmkstart GNU_LESSER_GENERAL_PUBLIC_LICENSE}{\*\bkmkend GNU_LESSER_GENERAL_PUBLIC_LICENSE}GNU LESSER GENERAL PUBLIC LICENSE \par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4288356 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 Version 2.1, February 1999 \par Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. \par This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1. \par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid4288356 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 {\*\bkmkstart Preamble}{\*\bkmkend Preamble}Preamble \par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4288356 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. \par This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better st rategy to use in any particular case, based on the explanations below. \par When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of fr ee software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. \par To protec t your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modif y it. \par For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the li brary, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. \par We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. \par To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduce d by others. \par Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefo re, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. \par Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free p rograms. \par When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. \par We call this license the "Lesser" General Public License because it does Less to pro tect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. \par For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. \par In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free p rograms enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. \par Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. \par The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference betw een a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. \par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid4288356 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 {\*\bkmkstart TERMS_AND_CONDITIONS_FOR_COPYING.2C_DIST}{\*\bkmkend TERMS_AND_CONDITIONS_FOR_COPYING.2C_DIST} TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION \par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4288356 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 0. This License Agreement applies to any software library or other program whi ch contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". \par A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. \par The "Library", below, refers to any such software library or work which has been dis tributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straig htforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) \par "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. \par Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. \par 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided tha t you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along w ith the Library. \par You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. \par 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work b ased on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f3\fs20\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb100\sa100\sbauto1\saauto1\widctlpar \jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin720\itap0\pararsid4288356 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 a) The modified work must itself be a software library. \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f3\fs20\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 \loch\af3\dbch\af0\hich\f3 \'b7\tab} b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f3\fs20\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 \loch\af3\dbch\af0\hich\f3 \'b7\tab} c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f3\fs20\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 \loch\af3\dbch\af0\hich\f3 \'b7\tab}d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure th at, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. \par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4288356 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute squar e roots.) \par These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permission s for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. \par Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. \par In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. \par 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. \par Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. \par This option is useful when you wish to copy part of the code of the Library into a program that is not a library. \par 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form und er the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. \par If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are n ot compelled to copy the source along with the object code. \par 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. \par However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it c ontains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. \par When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is its elf a library. The threshold for this to be true is not precisely defined by law. \par If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then t he use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) \par Otherwise, if the work is a derivative of the Library , you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. \par 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. \par You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. }{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1044\langfe1044\langfenp1044\insrsid4288356\charrsid4288356 Also, you must do one of these things: \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f3\fs20\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb100\sa100\sbauto1\saauto1\widctlpar \jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls5\adjustright\rin0\lin720\itap0\pararsid4288356 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the co m plete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes t he contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f3\fs20\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 \loch\af3\dbch\af0\hich\f3 \'b7\tab} b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses a t run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modif ied version is interface-compatible with the version that the work was made with. \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f3\fs20\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 \loch\af3\dbch\af0\hich\f3 \'b7\tab} c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f3\fs20\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 \loch\af3\dbch\af0\hich\f3 \'b7\tab} d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f3\fs20\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 \loch\af3\dbch\af0\hich\f3 \'b7\tab}e) Verify that the user has already rec eived a copy of these materials or that you have already sent this user a copy. \par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4288356 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unl ess that component itself accompanies the executable. \par It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use bot h them and the Library together in an executable that you distribute. \par 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f3\fs20\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb100\sa100\sbauto1\saauto1\widctlpar \jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls6\adjustright\rin0\lin720\itap0\pararsid4288356 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. \par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f3\fs20\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 \loch\af3\dbch\af0\hich\f3 \'b7\tab}b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. \par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4288356 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under th is License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. \par 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. \par 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute , link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this Lice nse. \par 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Li b rary at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. \par If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. \par It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution sy stem which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. \par This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. \par 12. If the distribution a nd/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those co untries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. \par 13. The Free Software Foundation may publish revised and/or new versi ons of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. \par Each version is given a distinguishing version number. If the Lib rary specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. \par 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, w rite to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. \par NO WARRANTY \par 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. E XCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS F OR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. \par 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE L AW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF TH E USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PAR TY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. \par END OF TERMS AND CONDITIONS \par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid4288356 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 {\*\bkmkstart How_to_Apply_These_Terms_to_Your_New_Lib}{\*\bkmkend How_to_Apply_These_Terms_to_Your_New_Lib}How to Apply These Terms to Your New Libraries \par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4288356 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\lang1033\langfe1044\langnp1033\langfenp1044\insrsid4288356\charrsid4288356 If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). \par To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the e xclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. \par one line to give the library's name and an idea of what it does. Copyright (C) year name of author \par 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. \par 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. \par 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 \par Also add information on how to contact you by electronic and paper mail. \par You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: \par Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. \par signature of Ty Coon, 1 April 1990 Ty Coon, President of Vice \par That's all there is to it! \par }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid14828058\charrsid4288356 \par }{\*\themedata 504b030414000600080000002100828abc13fa0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb6ac3301045f785fe83d0b6d8 72ba28a5d8cea249777d2cd20f18e4b12d6a8f843409c9df77ecb850ba082d74231062ce997b55ae8fe3a00e1893f354e9555e6885647de3a8abf4fbee29bbd7 2a3150038327acf409935ed7d757e5ee14302999a654e99e393c18936c8f23a4dc072479697d1c81e51a3b13c07e4087e6b628ee8cf5c4489cf1c4d075f92a0b 44d7a07a83c82f308ac7b0a0f0fbf90c2480980b58abc733615aa2d210c2e02cb04430076a7ee833dfb6ce62e3ed7e14693e8317d8cd0433bf5c60f53fea2fe7 065bd80facb647e9e25c7fc421fd2ddb526b2e9373fed4bb902e182e97b7b461e6bfad3f010000ffff0300504b030414000600080000002100a5d6a7e7c00000 00360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4fc7060abb08 84a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b63095120f88d94fbc 52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462a1a82fe353 bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f7468656d652f7468 656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b4b0d592c9c 070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b4757e8d3f7 29e245eb2b260a0238fd010000ffff0300504b030414000600080000002100dcaae620950600004f1b0000160000007468656d652f7468656d652f7468656d65 312e786d6cec594d6f1b4518be23f11f467b6f6327761a4775aad8b11b48d346b15bd4e37877bc3bcdecce6a669cd437d41e9190100571a012370e08a8d44a5c caaf09144191fa1778676677bd13af49d24650417d48bcb3cffbfd31ef8caf5ebb1f33744884a43c697bf5cb350f91c4e7014dc2b6777bd8bfb4e621a9701260 c613d2f6a6447ad736de7fef2a5e5711890902fa44aee3b6172995ae2f2d491f96b1bccc5392c0bb31173156f028c2a540e023e01bb3a5e55a6d7529c634f150 8263607b6b3ca63eb9a480d4dbc879f718084894d40b3e1303cd993804061b1cd435424e659709748859db0331013f1a92fbca430c4b052fda5ecd7cbca58dab 4b783d23626a016d89ae6f3e195d46101c2c1b99221c1542ebfd46ebca56c1df00989ac7f57abd6eaf5ef03300ecfb60a9d5a5ccb3d15fab77729e2590fd3acf bb5b6bd61a2ebec47f654ee756a7d369b6325d2c5303b25f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd5868b37a088d1e4 600ead03daef67dc0bc898b3ed4af81ac0d76a197c86826c28b24b8b18f3442dcab518dfe3a20f000d6458d104a9694ac6d88724eee2782428d602f03ac1a537 76c997734b5a1692bea0a96a7b1fa6180a62c6efd5f3ef5f3d7f8a8e1f3c3b7ef0d3f1c387c70f7eb48c1caa6d9c8465aa97df7ef6e7e38fd11f4fbf79f9e88b 6abc2ce37ffde1935f7efebc1a08e53353e7c5974f7e7bf6e4c5579ffefedda30af8a6c0a3327c486322d14d7284f6790c8619afb89a9391381fc530c2b44cb1 99841227584ba9e0df539183be39c52c8b8ea34787b81ebc23a07d5401af4fee390a0f223151b442f24e143bc05dce59878b4a2fec685925370f2749582d5c4c cab87d8c0fab647771e2c4b73749a16fe669e918de8d88a3e61ec389c221498842fa1d3f20a4c2babb943a7edda5bee0928f15ba4b5107d34a970ce9c8c9a619 d1368d212ed32a9b21de8e6f76efa00e6755566f9143170955815985f243c21c375ec71385e32a96431cb3b2c36f6015552939980abf8ceb4905910e09e3a817 1029ab686e09b0b714f41d0c1dab32ecbb6c1abb48a1e84115cf1b98f332728b1f74231ca755d8014da232f6037900298ad11e5755f05dee56887e8638e06461 b8ef50e284fbf46e709b868e4ab304d16f2642c7125ab5d381639afc5d3b6614fab1cd818b6bc7d0005f7cfdb822b3ded646bc097b5255256c9f68bf8b70279b 6e978b80befd3d770b4f923d02693ebff1bc6bb9ef5aaef79f6fb98beaf9ac8d76d65ba1edeab9c10ec566448e174ec863cad8404d19b921cd902c619f08fab0 a8e9cce1901427a63482af595f7770a1c0860609ae3ea22a1a44388501bbee6926a1cc588712a55cc2c1ce2c57f2d67818d2953d1636f581c1f60389d52e0fec f28a5ececf05051bb3db84e6f0990b5ad10cce2a6ce54ac614cc7e1d6175add499a5d58d6aa6d539d20a932186f3a6c162e14d1840108c2de0e555389e6bd170 30c18c04daef76efcdc362a270912192110e4816236df77c8cea264879ae989b00c89d8a18e943de295e2b496b69b66f20ed2c412a8b6b2c109747ef4da29467 f02c4aba6e4f94234bcac5c91274d4f65acde5a6877c9cb6bd319c69e16b9c42d4a59ef9300be15ec857c2a6fda9c56caa7c16cd566e985b0475b8a6b07e9f33 d8e903a9906a0bcbc8a6867995a5004bb424abff7213dc7a5106d84c7f0d2d56d62019fe352dc08f6e68c9784c7c550e766945fbce3e66ad944f141183283842 233611fb18c2af5315ec09a884ab09d311f403dca3696f9b576e73ce8aae7c7b6570761db334c259bbd5259a57b2859b3a2e74304f25f5c0b64add8d71e737c5 94fc0599524ee3ff99297a3f819b82954047c0875b5c8191aed7b6c7858a3874a134a27e5fc0e0607a07640bdcc5c26b482ab84b36ff0539d4ff6dcd591ea6ac e1c0a7f669880485fd484582903d684b26fb4e6156cff62ecb92658c4c4695d495a9557b440e091bea1eb8aaf7760f4590eaa69b646dc0e04ee69ffb9c55d028 d4434eb9de9c1e52ecbdb606fee9c9c7163318e5f66133d0e4fe2f54acd8552dbd21cff7deb221fac56ccc6ae45501c24a5b412b2bfbd754e19c5baded587316 2f3773e5208af316c3623110a570df83f41fd8ffa8f0193169ac37d421df87de8ae08706cd0cd206b2fa921d3c906e9076710483935db4c9a45959d766a393f6 5abe595ff0a45bc83de16cadd959e27d4e6717c3992bcea9c58b7476e661c7d7766da1ab21b2274b1496c6f941c604c6fca255fed5898fee41a0b7e07e7fc294 34c904bf29090ca3e7c0d40114bf95684837fe020000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f7468 656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f2451 eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e319872 0e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528a2 c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100828abc13fa0000001c020000130000000000000000000000000000 0000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000000000000000 2b0100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000014020000746865 6d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d0014000600080000002100dcaae620950600004f1b00001600000000000000000000 000000d10200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027000000000000 000000000000009a0900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000950a00000000} {\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d 617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169 6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363 656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e} {\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal; \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4; \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9; \lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7; \lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font; \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis; \lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing; \lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid; \lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1; \lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2; \lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading; \lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1; \lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1; \lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision; \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote; \lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1; \lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1; \lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2; \lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2; \lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2; \lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2; \lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2; \lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3; \lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3; \lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3; \lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3; \lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3; \lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4; \lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4; \lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4; \lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4; \lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5; \lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5; \lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5; \lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5; \lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5; \lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6; \lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6; \lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6; \lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6; \lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6; \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis; \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference; \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000 4d73786d6c322e534158584d4c5265616465722e352e30000000000000000000000e0000 d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff0900060000000000000000000000010000000100000000000000001000000200000001000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff fffffffffffffffffdffffff04000000feffffff05000000fefffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffff01000000ec69d9888b8b3d4c859eaf6cd158be0f00000000000000000000000090d1 9ffc182cca010300000080020000000000004d0073006f004400610074006100530074006f0072006500000000000000000000000000000000000000000000000000000000000000000000000000000000001a000101ffffffffffffffff02000000000000000000000000000000000000000000000090d19ffc182cca01 90d19ffc182cca01000000000000000000000000d000c40034005500550056003500c200c70055003000cf003300d100dc005800c500410048004d00d90051003d003d000000000000000000000000000000000032000101ffffffffffffffff03000000000000000000000000000000000000000000000090d19ffc182c ca0190d19ffc182cca010000000000000000000000004900740065006d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffff04000000ffffffff000000000000000000000000000000000000000000000000 00000000000000000000000000000000cf00000000000000010000000200000003000000feffffff0500000006000000070000000800000009000000feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3c623a536f757263657320786d6c6e733a623d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f6269626c696f6772617068792220786d6c6e733d 22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f6269626c696f677261706879222053656c65637465645374796c653d225c4150412e58534c22205374796c654e616d653d22415041222f3e0d0a00000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000003c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e0d0a3c64733a6461746173746f72654974656d2064733a6974656d49443d227b35313934 343743322d453235372d343639442d414637372d3146313739343031434345357d2220786d6c6e733a64733d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f637573746f6d586d6c223e3c64733a736368656d61526566733e3c 64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6f70656e500072006f007000650072007400690065007300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000200ffffffffffffffffffffffff000000000000 0000000000000000000000000000000000000000000000000000000000000400000055010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f6269626c696f677261706879222f3e3c2f64733a736368656d61526566733e3c2f64733a6461746173746f 72654974656d3e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000105000000000000}}fife_0.3.5/build/win32/installer/README.txt0000664000175100017510000000137612205217523017310 0ustar waynewayneTo create the installer you must have Inno Setup Compiler >= 5.3 installed. Then follow this procedure: 1. Check out a clean copy of fife trunk. 2. Build FIFE (ensure that the required DLLs get copied to \trunk\engine\python\fife) 3. From the \trunk directory execute the command 'python setup.py bdist_wininst' to build the python module installer. 4. Compile the FIFE installer (right click fife.iss -> Compile) You should now have a working installer called FIFE {VERSION}. Now that you have the working copy set up, all you have to do to create a new installer is: 1. Update the fife directory (svn update) 2. Recompile FIFE 3. Run 'python setup.py bdist_wininst' to create the python module installer 3. Compile the FIFE installer fife_0.3.5/build/win32/installer/devkit.iss0000664000175100017510000000710112205217523017610 0ustar waynewayne; TODO: ; * Run oalinst.exe if openal DLL is not installed? ; * Test that the installer works as non-admin on xp, vista and win7 [Setup] ; NOTE: The value of AppId uniquely identifies this application. ; Do not use the same AppId value in installers for other applications. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) AppId={{FE01A2E9-77CE-4293-B667-2FA8A184D4E7} AppName=FIFE Development Kit (April 2012) ; Version is yyyy.mm AppVerName=FIFE DevKit 2012.04 AppPublisher=FIFE Team AppPublisherURL=http://www.fifengine.net AppSupportURL=http://www.fifengine.net AppUpdatesURL=http://www.fifengine.net DefaultDirName={sd}\FIFE\build\win32\ DefaultGroupName=FIFE\Devkit DirExistsWarning=No EnableDirDoesntExistWarning=Yes AllowNoIcons=yes LicenseFile=license.rtf Compression=lzma SolidCompression=yes OutputBaseFilename=FIFE_Development_Kit_Apr2012 OutputDir=. DisableReadyPage=yes ; This will require some testing. We can't install to Program files if the user is not an admin. ; PrivilegesRequired=none [Types] Name: "full"; Description: "Full installation" Name: "compact"; Description: "Compact installation" Name: "custom"; Description: "Custom installation"; Flags: iscustom [Components] Name: "common"; Description: "Common files"; Types: full compact custom; Flags: fixed Name: "compilers"; Description: "Compiler specific files"; Types: full custom Name: "compilers\mingw"; Description: "MinGW"; Types: full compact custom Name: "compilers\msvc2005"; Description: "Visual Studio 2005"; Types: full custom Name: "compilers\msvc2008"; Description: "Visual Studio 2008"; Types: full custom [Languages] Name: "english"; MessagesFile: "compiler:Default.isl" [Files] ; Common Source: "..\applications\scons\*"; DestDir: "{app}\applications\scons"; Excludes: ".svn"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "..\applications\swigwin-2.0.1\*"; DestDir: "{app}\applications\swigwin-2.0.1"; Excludes: ".svn"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "..\includes\*"; DestDir: "{app}\includes"; Excludes: ".svn"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "README_DevKit_Apr2012.txt"; DestDir:"{app}"; Flags: isreadme ; MinGW Source: "..\applications\mingw\*"; DestDir: "{app}\applications\mingw"; Excludes: ".svn"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "..\binaries\mingw\*"; DestDir: "{app}\binaries\mingw"; Excludes: ".svn"; Components: compilers\mingw; Flags: ignoreversion recursesubdirs createallsubdirs Source: "..\static_libs\mingw\*"; DestDir: "{app}\static_libs\mingw"; Excludes: ".svn"; Components: compilers\mingw; Flags: ignoreversion recursesubdirs createallsubdirs ; MSVC8 Source: "..\binaries\msvc2005\*"; DestDir: "{app}\binaries\msvc2005"; Excludes: ".svn"; Components: compilers\msvc2005; Flags: ignoreversion recursesubdirs createallsubdirs Source: "..\static_libs\msvc2005\*"; DestDir: "{app}\static_libs\msvc2005"; Excludes: ".svn"; Components: compilers\msvc2005; Flags: ignoreversion recursesubdirs createallsubdirs ; MSVC9 Source: "..\binaries\msvc2008\*"; DestDir: "{app}\binaries\msvc2008"; Excludes: ".svn"; Components: compilers\msvc2008; Flags: ignoreversion recursesubdirs createallsubdirs Source: "..\static_libs\msvc2008\*"; DestDir: "{app}\static_libs\msvc2008"; Excludes: ".svn"; Components: compilers\msvc2008; Flags: ignoreversion recursesubdirs createallsubdirs [Icons] Name: "{group}\{cm:ProgramOnTheWeb,FIFE}"; Filename: "http://www.fifengine.net/" Name: "{group}\{cm:UninstallProgram,FIFE}"; Filename: "{uninstallexe}" fife_0.3.5/build/win32/installer/Devkit_installer.txt0000664000175100017510000000016612205217523021652 0ustar waynewayne1. Create the Devkit in build\win32\ as usual 2. Change the Devkit version in devkit.iss. 3. Compile the installer fife_0.3.5/build/win32/installer/fife.iss0000664000175100017510000000644712205217523017247 0ustar waynewayne; Script generated by the Inno Setup Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! [Setup] ; NOTE: The value of AppId uniquely identifies this application. ; Do not use the same AppId value in installers for other applications. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) AppId={{8A27DF0C-689B-4B76-8BFC-AFCDD90C1A31} AppName=FIFE 0.3.5 AppVerName=FIFE 0.3.5 AppPublisher=FIFE Team AppPublisherURL=http://www.fifengine.net/ AppSupportURL=http://www.fifengine.net/ AppUpdatesURL=http://www.fifengine.net/ DefaultDirName={pf}\FIFE\ DefaultGroupName=FIFE DirExistsWarning=No EnableDirDoesntExistWarning=Yes AllowNoIcons=yes LicenseFile=license.rtf Compression=lzma SolidCompression=yes OutputBaseFilename=FIFE_0.3.5_installer_win32 OutputDir=. DisableReadyPage=yes [Types] Name: "full"; Description: "Full installation" Name: "fife-only"; Description: "Engine only" Name: "fife-demos"; Description: "Engine and Demos" Name: "fife-tools"; Description: "Engine and Tools" [Components] Name: "engine"; Description: "FIFE python module"; Types: full fife-only fife-demos fife-tools; Flags: fixed Name: "demos"; Description: "Demos"; Types: full fife-demos Name: "tools"; Description: "Tools"; Types: full fife-tools [Languages] Name: "english"; MessagesFile: "compiler:Default.isl" [Files] ; engine Source: "..\..\..\dist\*.exe"; DestDir: "{app}\engine"; Excludes: ".git,.svn"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "..\..\..\AUTHORS"; DestDir: "{app}\doc\"; DestName:"Authors.txt" Source: "..\..\..\COPYING"; DestDir: "{app}\doc\"; DestName:"Copying.txt" Source: "..\..\..\CHANGES"; DestDir: "{app}\doc\"; DestName:"Changes.txt" Source: "..\..\..\README"; DestDir:"{app}"; DestName: "README.txt"; Flags: isreadme ; demos Source: "..\..\..\demos\*"; DestDir: "{app}\demos"; Excludes: "settings.xml,*.7z,rpg,.svn,*.pyc,*.patch"; Flags: ignoreversion recursesubdirs createallsubdirs ; tools Source: "..\..\..\tools\*"; DestDir: "{app}\tools"; Excludes: ".git,.svn,atlas,*.pyc,*.patch"; Flags: ignoreversion recursesubdirs createallsubdirs [Icons] Name: "{group}\{cm:ProgramOnTheWeb,FIFE}"; Filename: "http://www.fifengine.net/" Name: "{group}\Copying.txt"; Filename: "notepad.exe"; Parameters: "{app}\doc\Copying.txt" Name: "{group}\Changes.txt"; Filename: "notepad.exe"; Parameters: "{app}\doc\Changes.txt" Name: "{group}\tools\Map Editor"; Filename: "python.exe"; Parameters: """{app}\tools\editor\run.py"""; WorkingDir: "{app}\tools\editor"; Comment: "FIFE Editor"; Components: "tools" Name: "{group}\demos\Rio de hola"; Filename: "python.exe"; Parameters: """{app}\demos\rio_de_hola\run.py"""; WorkingDir: "{app}\demos\rio_de_hola"; Comment: "Techdemo"; Components: "demos" Name: "{group}\demos\Shooter"; Filename: "python.exe"; Parameters: """{app}\demos\shooter\run.py"""; WorkingDir: "{app}\demos\shooter"; Comment: "Side scrolling shooter demo"; Components: "demos" Name: "{group}\demos\Pychan demo"; Filename: "python.exe"; Parameters: """{app}\demos\pychan_demo\pychan_demo.py"""; WorkingDir: "{app}\demos\pychan_demo"; Comment: "FIFE GUI demo"; Components: "demos" Name: "{group}\{cm:UninstallProgram,FIFE}"; Filename: "{uninstallexe}" [Run] Filename: "{app}\engine\fife-0.3.5.win32.exe"; fife_0.3.5/build/win32/installer/README_DevKit_Apr2012.txt0000664000175100017510000001054412205217523021662 0ustar waynewayneNotes: =============================== * Building with Code::Blocks in combination with MinGW is currently broken. This might be resolved by a future SVN commit that fixes the FIFE Code::Blocks build script. * Building FIFE with SCons in combination with MinGW will only work in release mode! In case you want to debug FIFE, you'll have to build FIFE in release mode as well! ** Here's the catch: to get it working with FIFE built in debug mode, we would have to build Python and all of its libraries from source as there is no precompiled debug package of Python that works with MinGW. Gdb should provide somewhat useful backtraces even when FIFE is built in release mode. If that doesn't work out well due the missing debugging symbols, you still have the choice to use the MSVC debugger or to debug on a Linux system, where building FIFE in debug mode works fine. Sorry for the trouble but there isn't much we can do until there is an easy way to build Python from source via MinGW or (semi-)official precompiled debug packages of Python for Win32 are available. * FIFE will still only work in combination with a 32bit version of Python on Windows systems. ** To provide support for 64bit Python versions, we would have to provide precompiled 64bit versions of all of FIFE's dependencies. That's a rather huge undertaking and considering the small demand for a 64bit Windows version of FIFE, we don't support it yet and prolly won't support it in the near future. =============================== FIFE Win32 DevKit April 2012 =============================== Changes: =============================== * Added pre-built versions of guichan which includes all of our patches * Upgraded boost to 1.47.0 * Upgraded mingw to gcc 4.5.1 from http://tdm-gcc.tdragon.net/download =============================== FIFE Win32 DevKit November 2010 =============================== Changes: =============================== * Custom built SDL_d.dll for MSVC 2005 & MSVC 2008 to fix debugging support for these compilers * Updated mingw to 4.5.1 sjlj from http://tdm-gcc.tdragon.net/download * Updated Python to 2.7 ** Python 2.7 is now the only officially supported version that is guaranteed to work with FIFE on Microsoft Windows systems! ** If you want to use an older Python version with FIFE, you can do so at your own risk by copying the correct headers and libs into the corresponding directories and by editing the build scripts for your compiler of choice: *** build\win32\win32-config.py for mingw *** build\win32\build_environments\visual_studio_8\engine_template.xml for MSVC 2005 *** build\win32\build_environments\visual_studio_9\engine_template.xml for MSVC 2008 * Updated scons to 2.0.1 * Updated SWIG to 2.0.1 Installation / build process =============================== 1. Check out the latest engine sources from SVN or update your SVN checkout in case you have already checked out from SVN before: Repository URL: http://fife.svn.cvsdude.com/engine/trunk 2. Get ActivePython 2.7 (x86 version) and install it to a location of your choice: http://downloads.activestate.com/ActivePython/releases/2.7.0.2/ActivePython-2.7.0.2-win32-x86.msi 3. In case you've built FIFE with an older compile SDK in the past, either run the uninstaller or run \build\win32\delete_sdk.bat to get rid of the old SDK files 4. Extraction process 4.1 Extract the content of the compile SDK to: \build\win32\ 4.2 Check if there is an \build\win32\applications folder; if it's in place, you know that you extracted the SDK into the correct location. One possible issue is that you've checked out the whole engine SVN repository instead of just trunk. In this case extract the compile SDK to: \trunk\build\win32 (if you want to compile trunk, otherwhise it needs to be extracted into the build\win32 directory of the branch that you want to compile) 5.1 Run \trunk\build\win32\update_project_files.bat. 5.2 Build files for each supported IDE can be found in the sub-directories of \build\win32\build_environments (code_blocks, scons, visual_studio_8, visual_studio_9). See http://wiki.fifengine.de/Guides_%26_tutorials#Win32 for more information. 6. The final dynamic library (_fife.pyd) is automatically moved to: \engine\python\fife 7. You can now start your custom FIFE build by launching the python scripts that reside in the subdirectories of \demos fife_0.3.5/build/win32/clear_python_cache.bat0000664000175100017510000000010412205217523020103 0ustar waynewaynedel /S .\..\..\clients\*.pyc del /S .\..\..\engine\extensions\*.pyc fife_0.3.5/build/mac/0000775000175100017510000000000012205217523013404 5ustar waynewaynefife_0.3.5/build/mac/macbuild_files/0000775000175100017510000000000012205217523016346 5ustar waynewaynefife_0.3.5/build/mac/macbuild_files/SDLMain.h0000664000175100017510000000046312205217523017751 0ustar waynewayne/* SDLMain.m - main entry point for our Cocoa-ized SDL app Initial Version: Darrell Walisser Non-NIB-Code & other changes: Max Horn Feel free to customize this file to suit your needs */ #import @interface SDLMain : NSObject @end fife_0.3.5/build/mac/macbuild_files/SDLMain.m0000664000175100017510000002572012205217523017761 0ustar waynewayne/* SDLMain.m - main entry point for our Cocoa-ized SDL app Initial Version: Darrell Walisser Non-NIB-Code & other changes: Max Horn Feel free to customize this file to suit your needs */ #import "SDL.h" #import "SDLMain.h" #import /* for MAXPATHLEN */ #import /* For some reaon, Apple removed setAppleMenu from the headers in 10.4, but the method still is there and works. To avoid warnings, we declare it ourselves here. */ @interface NSApplication(SDL_Missing_Methods) - (void)setAppleMenu:(NSMenu *)menu; @end /* Use this flag to determine whether we use SDLMain.nib or not */ #define SDL_USE_NIB_FILE 0 /* Use this flag to determine whether we use CPS (docking) or not */ #define SDL_USE_CPS 1 #ifdef SDL_USE_CPS /* Portions of CPS.h */ typedef struct CPSProcessSerNum { UInt32 lo; UInt32 hi; } CPSProcessSerNum; extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); #endif /* SDL_USE_CPS */ static int gArgc; static char **gArgv; static BOOL gFinderLaunch; static BOOL gCalledAppMainline = FALSE; static NSString *getApplicationName(void) { NSDictionary *dict; NSString *appName = 0; /* Determine the application name */ dict = (NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle()); if (dict) appName = [dict objectForKey: @"CFBundleName"]; if (![appName length]) appName = [[NSProcessInfo processInfo] processName]; return appName; } #if SDL_USE_NIB_FILE /* A helper category for NSString */ @interface NSString (ReplaceSubString) - (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString; @end #endif @interface SDLApplication : NSApplication @end @implementation SDLApplication /* Invoked from the Quit menu item */ - (void)terminate:(id)sender { /* Post a SDL_QUIT event */ SDL_Event event; event.type = SDL_QUIT; SDL_PushEvent(&event); } @end /* The main class of the application, the application's delegate */ @implementation SDLMain /* Set the working directory to the .app's parent directory */ - (void) setupWorkingDirectory:(BOOL)shouldChdir { if (shouldChdir) { char parentdir[MAXPATHLEN]; CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); if (CFURLGetFileSystemRepresentation(url2, true, (UInt8 *)parentdir, MAXPATHLEN)) { assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */ } CFRelease(url); CFRelease(url2); } } #if SDL_USE_NIB_FILE /* Fix menu to contain the real app name instead of "SDL App" */ - (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName { NSRange aRange; NSEnumerator *enumerator; NSMenuItem *menuItem; aRange = [[aMenu title] rangeOfString:@"SDL App"]; if (aRange.length != 0) [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]]; enumerator = [[aMenu itemArray] objectEnumerator]; while ((menuItem = [enumerator nextObject])) { aRange = [[menuItem title] rangeOfString:@"SDL App"]; if (aRange.length != 0) [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]]; if ([menuItem hasSubmenu]) [self fixMenu:[menuItem submenu] withAppName:appName]; } [ aMenu sizeToFit ]; } #else static void setApplicationMenu(void) { /* warning: this code is very odd */ NSMenu *appleMenu; NSMenuItem *menuItem; NSString *title; NSString *appName; appName = getApplicationName(); appleMenu = [[NSMenu alloc] initWithTitle:@""]; /* Add menu items */ title = [@"About " stringByAppendingString:appName]; [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; [appleMenu addItem:[NSMenuItem separatorItem]]; title = [@"Hide " stringByAppendingString:appName]; [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"]; menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"]; [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""]; [appleMenu addItem:[NSMenuItem separatorItem]]; title = [@"Quit " stringByAppendingString:appName]; [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"]; /* Put menu into the menubar */ menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; [menuItem setSubmenu:appleMenu]; [[NSApp mainMenu] addItem:menuItem]; /* Tell the application object that this is now the application menu */ [NSApp setAppleMenu:appleMenu]; /* Finally give up our references to the objects */ [appleMenu release]; [menuItem release]; } /* Create a window menu */ static void setupWindowMenu(void) { NSMenu *windowMenu; NSMenuItem *windowMenuItem; NSMenuItem *menuItem; windowMenu = [[NSMenu alloc] initWithTitle:@"Window"]; /* "Minimize" item */ menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; [windowMenu addItem:menuItem]; [menuItem release]; /* Put menu into the menubar */ windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""]; [windowMenuItem setSubmenu:windowMenu]; [[NSApp mainMenu] addItem:windowMenuItem]; /* Tell the application object that this is now the window menu */ [NSApp setWindowsMenu:windowMenu]; /* Finally give up our references to the objects */ [windowMenu release]; [windowMenuItem release]; } /* Replacement for NSApplicationMain */ static void CustomApplicationMain (int argc, char **argv) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; SDLMain *sdlMain; /* Ensure the application object is initialised */ [SDLApplication sharedApplication]; #ifdef SDL_USE_CPS { CPSProcessSerNum PSN; /* Tell the dock about us */ if (!CPSGetCurrentProcess(&PSN)) if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) if (!CPSSetFrontProcess(&PSN)) [SDLApplication sharedApplication]; } #endif /* SDL_USE_CPS */ /* Set up the menubar */ [NSApp setMainMenu:[[NSMenu alloc] init]]; setApplicationMenu(); setupWindowMenu(); /* Create SDLMain and make it the app delegate */ sdlMain = [[SDLMain alloc] init]; [NSApp setDelegate:sdlMain]; /* Start the main event loop */ [NSApp run]; [sdlMain release]; [pool release]; } #endif /* * Catch document open requests...this lets us notice files when the app * was launched by double-clicking a document, or when a document was * dragged/dropped on the app's icon. You need to have a * CFBundleDocumentsType section in your Info.plist to get this message, * apparently. * * Files are added to gArgv, so to the app, they'll look like command line * arguments. Previously, apps launched from the finder had nothing but * an argv[0]. * * This message may be received multiple times to open several docs on launch. * * This message is ignored once the app's mainline has been called. */ - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename { const char *temparg; size_t arglen; char *arg; char **newargv; if (!gFinderLaunch) /* MacOS is passing command line args. */ return FALSE; if (gCalledAppMainline) /* app has started, ignore this document. */ return FALSE; temparg = [filename UTF8String]; arglen = SDL_strlen(temparg) + 1; arg = (char *) SDL_malloc(arglen); if (arg == NULL) return FALSE; newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2)); if (newargv == NULL) { SDL_free(arg); return FALSE; } gArgv = newargv; SDL_strlcpy(arg, temparg, arglen); gArgv[gArgc++] = arg; gArgv[gArgc] = NULL; return TRUE; } /* Called when the internal event loop has just started running */ - (void) applicationDidFinishLaunching: (NSNotification *) note { int status; /* Set the working directory to the .app's parent directory */ [self setupWorkingDirectory:gFinderLaunch]; #if SDL_USE_NIB_FILE /* Set the main menu to contain the real app name instead of "SDL App" */ [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()]; #endif /* Hand off to main application code */ gCalledAppMainline = TRUE; status = SDL_main (gArgc, gArgv); /* We're done, thank you for playing */ exit(status); } @end @implementation NSString (ReplaceSubString) - (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString { unsigned int bufferSize; unsigned int selfLen = [self length]; unsigned int aStringLen = [aString length]; unichar *buffer; NSRange localRange; NSString *result; bufferSize = selfLen + aStringLen - aRange.length; buffer = NSAllocateMemoryPages(bufferSize*sizeof(unichar)); /* Get first part into buffer */ localRange.location = 0; localRange.length = aRange.location; [self getCharacters:buffer range:localRange]; /* Get middle part into buffer */ localRange.location = 0; localRange.length = aStringLen; [aString getCharacters:(buffer+aRange.location) range:localRange]; /* Get last part into buffer */ localRange.location = aRange.location + aRange.length; localRange.length = selfLen - localRange.location; [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange]; /* Build output string */ result = [NSString stringWithCharacters:buffer length:bufferSize]; NSDeallocateMemoryPages(buffer, bufferSize); return result; } @end #ifdef main # undef main #endif /* Main entry point to executable - should *not* be SDL_main! */ int main (int argc, char **argv) { /* Copy the arguments into a global variable */ /* This is passed if we are launched by double-clicking */ if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) { gArgv = (char **) SDL_malloc(sizeof (char *) * 2); gArgv[0] = argv[0]; gArgv[1] = NULL; gArgc = 1; gFinderLaunch = YES; } else { int i; gArgc = argc; gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1)); for (i = 0; i <= argc; i++) gArgv[i] = argv[i]; gFinderLaunch = NO; } #if SDL_USE_NIB_FILE [SDLApplication poseAsClass:[NSApplication class]]; NSApplicationMain (argc, argv); #else CustomApplicationMain (argc, argv); #endif return 0; } fife_0.3.5/build/mac/README0000664000175100017510000000157012205217523014267 0ustar waynewayneJust a temporary README that was extracted from a mail of our Mac developer James Lacey, a useful README should be written for Mac users later to replace this version: I have written up the Mac build instructions here: http://wiki.fifengine.de/index.php?title=Mac_compile_guide. mac_build.tar.bz2 contains a patch file against SVN containing the changes I made. It also includes SDLMain.m and SDLMain.h. I put a copy of both those files in the following directories: core/src/guimap_test core/src/mapview_test core/src/writetest Also attached are the pkgconfig files (*.pc) that I hacked together so the SCons script would find the library locations. Up next, I am going to work on a Universal Binary build and try to make the SCons configure script more Mac-friendly (if possible). If anyone finds any mistakes or omissions, please let me know so I can correct them. Thanks, James fife_0.3.5/build/mac/pkgconfig_files/0000775000175100017510000000000012205217523016535 5ustar waynewaynefife_0.3.5/build/mac/pkgconfig_files/guichan_sdl.pc0000664000175100017510000000076112205217523021345 0ustar waynewayne# guichan_sdl.pc -- pkg-config data for Guichan_SDL # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/' prefix= /usr/local INSTALL_BIN= ${prefix}/bin INSTALL_INC= ${prefix}/include INSTALL_LIB= ${prefix}/lib INSTALL_MAN= ${prefix}/man/man1 # canonical vars exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: Guichan Description: A GUI library Version: 0.6 Requires: Libs: -L${libdir} -lguichan_sdl Cflags: -I${includedir} # (end of guichan_sdl.pc) fife_0.3.5/build/mac/pkgconfig_files/sdl.pc0000664000175100017510000000066512205217523017652 0ustar waynewayne# sdl pkg-config source file prefix=/usr/local exec_prefix=${prefix}/bin libdir=${prefix}/lib includedir=${prefix}/include Name: sdl Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer. Version: 1.2.11 Requires: Conflicts: Libs: -framework SDL.framework Cflags: -framework SDL.framework fife_0.3.5/build/mac/pkgconfig_files/guichan_opengl.pc0000664000175100017510000000077512205217523022054 0ustar waynewayne# guichan_opengl.pc -- pkg-config data for Guichan_OpenGL # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/' prefix= /usr/local INSTALL_BIN= ${prefix}/bin INSTALL_INC= ${prefix}/include INSTALL_LIB= ${prefix}/lib INSTALL_MAN= ${prefix}/man/man1 # canonical vars exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: Guichan Description: A GUI library Version: 0.6 Requires: Libs: -L${libdir} -lguichan_opengl Cflags: -I${includedir} # (end of guichan_opengl.pc) fife_0.3.5/build/mac/pkgconfig_files/boost_filesystem.pc0000664000175100017510000000110712205217523022452 0ustar waynewayne# boost_filesystem.pc -- pkg-config data for boost_filesystem # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/' prefix= /usr/local INSTALL_BIN= ${prefix}/bin INSTALL_INC= ${prefix}/include/boost-1_33_1 INSTALL_LIB= ${prefix}/lib INSTALL_MAN= ${prefix}/share/man/man1 # canonical vars exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: Boost Filesystem Description: # Is that the correct version for boost filesystem? Version: 0.6 Requires: Libs: -L${libdir} -lboost_filesystem Cflags: -I${includedir} # (end of boost_filesystem.pc) fife_0.3.5/build/mac/pkgconfig_files/guichan.pc0000664000175100017510000000074112205217523020501 0ustar waynewayne# guichan.pc -- pkg-config data for Guichan # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/' prefix= /usr/local INSTALL_BIN= ${prefix}/bin INSTALL_INC= ${prefix}/include INSTALL_LIB= ${prefix}/lib INSTALL_MAN= ${prefix}/man/man1 # canonical vars exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: Guichan Description: A GUI library Version: 0.6 Requires: Libs: -L${libdir} -lguichan Cflags: -I${includedir} # (end of guichan.pc) fife_0.3.5/build/mac/pkgconfig_files/z.pc0000664000175100017510000000071412205217523017334 0ustar waynewayne# z.pc -- pkg-config data for zlib # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/' prefix= /usr INSTALL_BIN= ${prefix}/bin INSTALL_INC= ${prefix}/include INSTALL_LIB= ${prefix}/lib INSTALL_MAN= ${prefix}/share/man/man1 # canonical vars exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: Guichan Description: A GUI library Version: 0.6 Requires: Libs: -L${libdir} -lz Cflags: -I${includedir} # (end of z.pc) fife_0.3.5/build/mac/pkgconfig_files/boost_regex.pc0000664000175100017510000000100412205217523021374 0ustar waynewayne# boost_regex.pc -- pkg-config data for boost_regex # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/' prefix= /usr/local INSTALL_BIN= ${prefix}/bin INSTALL_INC= ${prefix}/include/boost-1_33_1 INSTALL_LIB= ${prefix}/lib INSTALL_MAN= ${prefix}/share/man/man1 # canonical vars exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: Guichan Description: A GUI library Version: 0.6 Requires: Libs: -L${libdir} -lboost_regex Cflags: -I${includedir} # (end of boost_regex.pc) fife_0.3.5/build/gnukfreebsd9-config.py0000664000175100017510000000646412205217523017063 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### import sys import os import platform pythonversion = 'python' + str(os.sys.version_info[0]) + '.' + str(os.sys.version_info[1]) def initEnvironment(env): rootpath = env.Dir('#.').srcnode().abspath extincludepath = os.path.join(rootpath, 'ext', 'install', 'include') extlibpath = os.path.join(rootpath, 'ext', 'install', 'lib') env.Append(CPPPATH = [os.path.join('/', 'opt', 'include'), os.path.join('/', 'usr', 'include', 'vorbis'), os.path.join('/', 'usr', 'include', 'SDL'), os.path.join('/', 'usr', 'include', pythonversion), extincludepath]) env.Append(LIBPATH = [os.path.join('/', 'opt', 'lib'), extlibpath, env.subst('$LIBDIR')]) env.AppendENVPath('LD_RUN_PATH', os.path.join('..', '..', '..', extlibpath)) env.AppendUnique(CXXFLAGS=["-DPNG_SKIP_SETJMP_CHECK"]) return env def addExtras(env, opengl): env.Append(LIBS = pythonversion) if opengl: env.Append(LIBS = ['stdc++', 'GL',]) env.Append(LIBPATH = os.path.join('/', 'usr', 'X11R6', 'lib')) # define for using tinyxml with stl support enabled env.AppendUnique(CPPDEFINES = ['TIXML_USE_STL']) return env def getRequiredHeaders(opengl): return None def getRequiredLibs(opengl): # libs is a list of tuples that have the form: # (libname, headers) # libname - may be a single library or a tuple of libraries # headers - may be a single header or a list of headers # # This list is somewhat order dependent # guichan_sdl - depends on at least the SDL libs and guichan prior in the list # guichan_opengl - depends on at least guichan prior in the list libs = [('vorbisfile', 'vorbisfile.h'), (pythonversion, pythonversion + '/Python.h'), ('openal', 'AL/al.h'), ('SDL', 'SDL.h'), ('SDL_ttf', 'SDL_ttf.h'), ('SDL_image', 'SDL_image.h'), ('guichan', 'guichan.hpp'), ('guichan_sdl', ''), ('boost_system', ''), (('boost_filesystem', 'boost_filesystem-gcc', 'boost_filesystem-gcc41', 'boost_filesystem-mt', 'libboost_filesystem-mt'), 'boost/filesystem.hpp'), (('boost_regex', 'boost_regex-gcc', 'boost_regex-gcc41', 'boost_regex-mt', 'libboost_regex-mt'), 'boost/regex.hpp'), ('png', 'png.h'), ('Xcursor', '')] if (opengl): libs.append(('guichan_opengl', '')) return libs def getOptionalLibs(opengl): libs = [('tinyxml', 'tinyxml.h')] return libs # vim: set filetype=python: fife_0.3.5/build/__init__.py0000664000175100017510000000000012205217523014743 0ustar waynewaynefife_0.3.5/build/linux2-config.py0000664000175100017510000000646412205217523015714 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### import sys import os import platform pythonversion = 'python' + str(os.sys.version_info[0]) + '.' + str(os.sys.version_info[1]) def initEnvironment(env): rootpath = env.Dir('#.').srcnode().abspath extincludepath = os.path.join(rootpath, 'ext', 'install', 'include') extlibpath = os.path.join(rootpath, 'ext', 'install', 'lib') env.Append(CPPPATH = [os.path.join('/', 'opt', 'include'), os.path.join('/', 'usr', 'include', 'vorbis'), os.path.join('/', 'usr', 'include', 'SDL'), os.path.join('/', 'usr', 'include', pythonversion), extincludepath]) env.Append(LIBPATH = [os.path.join('/', 'opt', 'lib'), extlibpath, env.subst('$LIBDIR')]) env.AppendENVPath('LD_RUN_PATH', os.path.join('..', '..', '..', extlibpath)) env.AppendUnique(CXXFLAGS=["-DPNG_SKIP_SETJMP_CHECK"]) return env def addExtras(env, opengl): env.Append(LIBS = pythonversion) if opengl: env.Append(LIBS = ['stdc++', 'GL',]) env.Append(LIBPATH = os.path.join('/', 'usr', 'X11R6', 'lib')) # define for using tinyxml with stl support enabled env.AppendUnique(CPPDEFINES = ['TIXML_USE_STL']) return env def getRequiredHeaders(opengl): return None def getRequiredLibs(opengl): # libs is a list of tuples that have the form: # (libname, headers) # libname - may be a single library or a tuple of libraries # headers - may be a single header or a list of headers # # This list is somewhat order dependent # guichan_sdl - depends on at least the SDL libs and guichan prior in the list # guichan_opengl - depends on at least guichan prior in the list libs = [('vorbisfile', 'vorbisfile.h'), (pythonversion, pythonversion + '/Python.h'), ('openal', 'AL/al.h'), ('SDL', 'SDL.h'), ('SDL_ttf', 'SDL_ttf.h'), ('SDL_image', 'SDL_image.h'), ('guichan', 'guichan.hpp'), ('guichan_sdl', ''), ('boost_system', ''), (('boost_filesystem', 'boost_filesystem-gcc', 'boost_filesystem-gcc41', 'boost_filesystem-mt', 'libboost_filesystem-mt'), 'boost/filesystem.hpp'), (('boost_regex', 'boost_regex-gcc', 'boost_regex-gcc41', 'boost_regex-mt', 'libboost_regex-mt'), 'boost/regex.hpp'), ('png', 'png.h'), ('Xcursor', '')] if (opengl): libs.append(('guichan_opengl', '')) return libs def getOptionalLibs(opengl): libs = [('tinyxml', 'tinyxml.h')] return libs # vim: set filetype=python: fife_0.3.5/build/freebsd9-config.py0000664000175100017510000000214512205217523016166 0ustar waynewayne# Needed pkg-config additions: # SDL_ttf & SDL_image # guichan, guichan_opengl & guichan_sdl # boost_filesystem & boost_regex # vorbisfile # openal import sys def initEnvironment(env): return env def addExtras(context): context.env.Append(CPPPATH = ['/usr/local/include/vorbis']) context.checkSimpleLib(['vorbisfile'], 'vorbisfile.h') context.checkSimpleLib(['openal'], 'AL/al.h') context.checkSimpleLib(['sdl11', 'sdl12', 'sdl'], 'SDL.h') context.checkSimpleLib(['SDL_ttf'], 'SDL_ttf.h') context.checkSimpleLib(['SDL_image'], 'SDL_image.h') context.checkSimpleLib(['guichan']) context.checkSimpleLib(['guichan_sdl']) context.checkSimpleLib(['boost_filesystem']) context.checkSimpleLib(['boost_regex']) context.checkSimpleLib(['xcursor']) context.checkSimpleLib(['png'], 'png.h') if context.env['opengl']: context.env.Append(LIBS = ['GL']) context.env.Append(CPPPATH = ['/usr/local/include']) context.env.Append(LIBPATH = ['/usr/local/lib']) context.checkSimpleLib(['guichan_opengl']) # For swig/python: context.env.Append(CPPPATH = ['/usr/local/include/python%s'%sys.version[:3]]) fife_0.3.5/engine/0000775000175100017510000000000012205217523013012 5ustar waynewaynefife_0.3.5/engine/SConscript0000664000175100017510000002463012205217523015031 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2012 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### import os,sys import utils.scons.scons_utils as utils from utils.util_scripts.path import path as upath import utils.scons.scons_builders as builders Import('env', 'opts') _sep = os.path.sep src_path = upath(opts['SRC']) engine_path = opts['SRC'] core_path = os.path.join('engine', 'core') extensionpath = upath(os.path.join(opts['SRC'], 'python', 'fife', 'extensions')) #************************************************************************** #Compile the list of source code to be used #************************************************************************** allfiles = list(src_path.walkfiles()) allfiles_base = list() for f in allfiles: allfiles_base.append(utils.relpath(f, opts['SRC'])) extpyfiles = list(extensionpath.walkfiles('*.py')) extensionfiles = list() relextensionfiles = list() for f in extpyfiles: extensionfiles.append(utils.relpath(f, opts['SRC'])) relextensionfiles.append(utils.relpath(f, os.path.join(opts['SRC'], 'python', 'fife'))) headerfiles = [f for f in allfiles_base if utils.is_headerfile(f)] implfiles = [f for f in allfiles_base if utils.is_implfile(f)] swigfiles = [f for f in allfiles_base if utils.is_swigfile(f)] intfiles = utils.filter_by_dir(['swigwrappers'], swigfiles) compilefiles = utils.filter_by_dir(['swigwrappers'], implfiles) if sys.platform == 'win32': dllpath = upath(opts['DLLPATH']) dllfilelist = list(dllpath.walkfiles('*.dll')) dllfiles = list() for f in dllfilelist: dllfiles.append(utils.relpath(f,opts['DLLPATH'])) #************************************************************************** #define the FIFE revision number #************************************************************************** if opts['FIFE_REVISION'] is not "0": env.AppendUnique(CPPDEFINES = ['FIFE_REVISION=' + opts['FIFE_REVISION']]) #************************************************************************** #python #************************************************************************** #generate swig interface file utils.gen_swig_interface(os.path.join(engine_path, 'swigwrappers', 'python', 'fife.i.templ'), intfiles, os.path.join(engine_path, 'swigwrappers', 'python')) pyfiles = list(compilefiles) pyfiles.append([os.path.join('swigwrappers', 'python' ,'fife_wrap.cc')]) #************************************************************************** #definition of scons builders for project files #************************************************************************** msvc_project_builder = Builder(action = builders.generate_msvc_project, suffix = '.vcproj') env.Append(BUILDERS = {'MSVCProject': msvc_project_builder}) msvc_project_builder9 = Builder(action = builders.generate_msvc_project9, suffix = '.vcproj') env.Append(BUILDERS = {'MSVCProject9': msvc_project_builder9}) codeblocks_project_builder_win32 = Builder(action = builders.generate_codeblocks_project_win32, suffix = '.cbp') env.Append(BUILDERS = {'CodeblocksProjectWin32': codeblocks_project_builder_win32}) codeblocks_project_builder_linux = Builder(action = builders.generate_codeblocks_project_linux, suffix = '.cbp') env.Append(BUILDERS = {'CodeblocksProjectLinux': codeblocks_project_builder_linux}) python_extensions_builder = Builder(action = "$SWIG -o $TARGET ${_SWIGOUTDIR} ${_SWIGINCFLAGS} $SWIGFLAGS $SOURCES") env.Append(BUILDERS = {'PythonExtensions': python_extensions_builder}) #************************************************************************** #project files target #************************************************************************** projectfiles = compilefiles + headerfiles #projectfiles.append('swigwrappers/python/fife_wrap.cc') msvcproj = env.MSVCProject(os.path.join('..', '..','..', builders.msvcbuildpath, 'fife'), projectfiles) msvcproj9 = env.MSVCProject9(os.path.join('..', '..','..', builders.msvcbuildpath9, 'fife'), projectfiles) cbproj_win32 = env.CodeblocksProjectWin32(os.path.join('..', '..','..', builders.cbbuildpath_win32, 'fife'), projectfiles) cbproj_linux = env.CodeblocksProjectLinux(os.path.join('..', '..','..', builders.cbbuildpath_linux, 'fife'), projectfiles) if opts['DEBUG'] and sys.platform == 'win32': fife_tgt = 'fife_d' else: fife_tgt = 'fife' #************************************************************************** #shared library target #************************************************************************** if sys.platform == 'win32': env.AppendUnique(CPPDEFINES = ['FIFE_EXPORTING']) sharedlib = env.SharedLibrary(target = fife_tgt, source = compilefiles, OBJPREFIX='shared_', SHLIBEMITTER = '') elif sys.platform == 'darwin': sharedlib = env.SharedLibrary(target = fife_tgt, source = compilefiles) else: # soname will be libfife.so.major majorVersion = opts['FIFE_VERSION'].split('.')[0] soname = env.subst('$SHLIBPREFIX') + fife_tgt + env.subst('$SHLIBSUFFIX') + '.' + majorVersion sharedlib = env.SharedLibrary(target = fife_tgt, source = compilefiles, SHLIBSUFFIX = env.subst('$SHLIBSUFFIX') + '.' + opts['FIFE_VERSION'], LINKFLAGS=['-Wl,-soname,' + str(soname)]) #************************************************************************** #python library target #************************************************************************** if sys.platform == 'win32': dest_suffix = '.pyd' else: dest_suffix = '.so' pythonlib = env.SharedLibrary(target = fife_tgt, source = pyfiles, OBJPREFIX='py_', SHLIBPREFIX='_', SHLIBSUFFIX=dest_suffix, SHLIBEMITTER = '') pythonext = env.PythonExtensions(target = [os.path.join('swigwrappers', 'python' ,'fife_wrap.cc'), os.path.join('swigwrappers', 'python' ,'fife_wrap.h'), os.path.join('python', 'fife', 'fife.py')], source = os.path.join('swigwrappers', 'python' ,'fife.i'), SWIGFLAGS=['-python','-c++','-w511'], SWIGPATH='core', SWIGOUTDIR=Dir('#/engine/python/fife').srcnode().path) if opts['DEBUG'] and sys.platform == 'win32': copy_dest = os.path.join(opts['PYLIB_COPY_DEST'], '_fife_d' + dest_suffix) else: copy_dest = os.path.join(opts['PYLIB_COPY_DEST'], '_fife' + dest_suffix) copy_cmd = env.Command(copy_dest, pythonlib, [Copy('$TARGET', '$SOURCE')]) copy_cmd2 = env.Command(os.path.join(opts['WRAP_COPY_DEST'], 'fife_wrap.h'), os.path.join('swigwrappers','python','fife_wrap.h'), [Copy('$TARGET', '$SOURCE')]) copy_cmd3 = env.Command(os.path.join(opts['WRAP_COPY_DEST'], 'fife_wrap.cc'), os.path.join('swigwrappers','python','fife_wrap.cc'), [Copy('$TARGET', '$SOURCE')]) #************************************************************************** #static library target #************************************************************************** staticlib = env.StaticLibrary(target = fife_tgt, source = compilefiles, LINKFLAGS=['-Wl']) #************************************************************************** #Install targets #************************************************************************** #TODO: This is not complete. Because of the current linux rpath issue this #will not work as expected. install_static = env.Install(opts['LIBDIR'], staticlib) install_shared = env.Install(opts['LIBDIR'], sharedlib) headerdestlist = utils.gen_dest_files(os.path.join(opts['PREFIX'], 'include', 'fife'), headerfiles) install_headers = env.InstallAs(headerdestlist, headerfiles) pypath = os.path.join(opts['PYTHON_PREFIX'], 'fife') extdestfilelist = utils.gen_dest_files(pypath, relextensionfiles) install_python_lib = env.Install(pypath, pythonlib) install_python_module = env.Install(pypath, ['#/engine/python/fife/fife.py','#/engine/python/fife/__init__.py']) install_python_extensions = env.InstallAs(extdestfilelist, extensionfiles) if sys.platform == 'win32': dlldestfilelist = utils.gen_dest_files(pypath, dllfiles) dlldestfilelist2 = utils.gen_dest_files(os.path.join(engine_path, 'python', 'fife'), dllfiles) install_dlls = env.InstallAs(dlldestfilelist, dllfilelist) install_dlls2 = env.InstallAs(dlldestfilelist2, dllfilelist) #************************************************************************** #alias definitions #************************************************************************** alias_msvc = Alias('msvc',msvcproj) alias_msvc9 = Alias('msvc9',msvcproj9) alias_cbwin32 = Alias('cbwin32',cbproj_win32) alias_cblinux = Alias('cblinux',cbproj_linux) Alias('projects',[alias_msvc, alias_msvc9, alias_cbwin32, alias_cblinux]) alias_shared = Alias('fife-shared', sharedlib) alias_static = Alias('fife-static', staticlib) alias_swig = Alias('fife-swig', [pythonext, copy_cmd2, copy_cmd3]) if sys.platform == 'win32': alias_python = Alias('fife-python', [pythonlib, copy_cmd, alias_swig, install_dlls2]) else: alias_python = Alias('fife-python', [pythonlib, copy_cmd, alias_swig]) Alias('fife', [alias_shared, alias_static, alias_python]) alias_install_shared = Alias('install-shared', install_shared) alias_install_static = Alias('install-static', install_static) if sys.platform == 'win32': alias_install_python = Alias('install-python', [alias_python, install_python_lib, install_python_module, install_python_extensions, install_dlls]) else: alias_install_python = Alias('install-python', [alias_python, install_python_lib, install_python_module, install_python_extensions]) alias_install_dev = Alias('install-dev', [alias_install_shared, alias_install_static, install_headers]) Alias('install-all', [alias_install_python, alias_install_dev]) # vim: set filetype=python: fife_0.3.5/engine/python/0000775000175100017510000000000012205217523014333 5ustar waynewaynefife_0.3.5/engine/python/fife/0000775000175100017510000000000012205217523015244 5ustar waynewaynefife_0.3.5/engine/python/fife/extensions/0000775000175100017510000000000012205217523017443 5ustar waynewaynefife_0.3.5/engine/python/fife/extensions/serializers/0000775000175100017510000000000012205217523021777 5ustar waynewaynefife_0.3.5/engine/python/fife/extensions/serializers/xmlmapsaver.py0000664000175100017510000003101312205217523024706 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### import os from xml.sax.saxutils import XMLGenerator from xml.sax.xmlreader import AttributesNSImpl from fife.extensions.serializers import * from fife import fife MAPFORMAT = '1.0' fileExtensions = ('xml',) class XMLMapSaver: def __init__(self, filepath, engine, map, importList, state = 0, datastate = 0): self.SModel, self.SMap, self.SLayer, self.SInstances, self.SObject, self.SAction = range(6) self.engine = engine self.model = self.engine.getModel() self.image_manager = self.engine.getImageManager() if (state): self.state = state if (state == self.SMap): self.map = datastate else: assert 0, "Invalid initialization state." else: self.state = self.SModel self.stack = [ self.SModel ] self.datastack = [ ] self.file = open(filepath, 'w') self.xmlout = XMLGenerator(self.file, 'ascii') self.xmlout.startDocument() self.indent_level = '' self.nspace = None self.map = map self.importList = importList def startElement(self, name, attrs): self.file.write(self.indent_level) self.xmlout.startElementNS((None, name), name, attrs) self.file.write('\n') self.indent_level = self.indent_level + '\t' def endElement(self, name): self.indent_level = self.indent_level[0:(len(self.indent_level) - 1)] self.file.write(self.indent_level) self.xmlout.endElementNS((None, name), name) self.file.write('\n') def write_map(self): assert self.state == self.SModel, "Declaration of not at the top level." attr_vals = { (None, 'id'): self.map.getId(), (None, 'format'): MAPFORMAT, } attr_names = { (None, 'id'): 'id', (None, 'format'): 'format', } attrs = AttributesNSImpl(attr_vals, attr_names) self.startElement('map', attrs) self.state = self.SMap self.write_imports(self.map, self.importList) self.write_layers(self.map) self.write_camera(self.map) self.endElement('map') def write_imports(self, map, importList): for importdir in importList: self.write_importdir(root_subfile(map.getFilename(), importdir)) imports = [] for layer in map.getLayers(): for instance in layer.getInstances(): file = instance.getObject().getFilename() if not (file in imports): if not self.have_superdir(file, importList): imports.append(file) self.write_import(root_subfile(map.getFilename(), file)) def have_superdir(self, file, importList): '''returns true, if file is in directories given in importList''' for dir in importList: have = True for test in zip(dir.split(os.path.sep), file.split(os.path.sep)): if test[0] != test[1]: have = False if have: return True return False def write_import(self, file): attr_vals = { (None, 'file'): file, } attr_names = { (None, 'file'): 'file', } attrs = AttributesNSImpl(attr_vals, attr_names) self.file.write(self.indent_level) self.xmlout.startElementNS((None, 'import'), 'import', attrs) self.xmlout.endElementNS((None, 'import'), 'import') self.file.write('\n') def write_importdir(self, dir): attr_vals = { (None, 'dir'): dir, } attr_names = { (None, 'dir'): 'dir', } attrs = AttributesNSImpl(attr_vals, attr_names) self.file.write(self.indent_level) self.xmlout.startElementNS((None, 'import'), 'import', attrs) self.xmlout.endElementNS((None, 'import'), 'import') self.file.write('\n') def pathing_val_to_str(self, val): if val == fife.CELL_EDGES_AND_DIAGONALS: return "cell_edges_and_diagonals" if val == fife.FREEFORM: return "freeform" return "cell_edges_only" def layer_type_to_str(self, layer): if layer.isWalkable(): return "walkable" elif layer.isInteract(): return "interact" return "" def write_layers(self, map): for layer in map.getLayers(): cellgrid = layer.getCellGrid() attr_vals = { (None, 'id'): layer.getId(), (None, 'grid_type'): cellgrid.getType(), (None, 'x_scale'): str(cellgrid.getXScale()), (None, 'y_scale'): str(cellgrid.getYScale()), (None, 'rotation'): str(cellgrid.getRotation()), (None, 'x_offset'): str(cellgrid.getXShift()), (None, 'y_offset'): str(cellgrid.getYShift()), (None, 'z_offset'): str(cellgrid.getZShift()), (None, 'pathing'): self.pathing_val_to_str(layer.getPathingStrategy()), (None, 'transparency'): str(layer.getLayerTransparency()), (None, 'layer_type'): str(self.layer_type_to_str(layer)), (None, 'layer_type_id'): str(layer.getWalkableId()), } attr_names = { (None, 'id'): 'id', (None, 'grid_type'): 'grid_type', (None, 'scaling'): 'scaling', (None, 'rotation'): 'rotation', (None, 'x_offset'): 'x_offset', (None, 'y_offset'): 'y_offset', (None, 'z_offset'): 'z_offset', (None, 'pathing'): 'pathing', (None, 'layer_type'): 'layer_type', (None, 'layer_type_id'): 'layer_type_id', } attrs = AttributesNSImpl(attr_vals, attr_names) self.startElement('layer', attrs) self.write_instances(layer) self.write_lights(layer) self.endElement('layer') def write_instances(self, layer): attrs = AttributesNSImpl({}, {}) self.startElement('instances', attrs) for inst in layer.getInstances(): position = inst.getLocationRef().getExactLayerCoordinates() attr_vals = { (None, 'o'): inst.getObject().getId(), (None, 'x'): str(position.x), (None, 'y'): str(position.y), (None, 'z'): str(position.z), (None, 'r'): str(inst.getRotation()), } attr_names = { (None, 'o'): 'o', (None, 'x'): 'x', (None, 'y'): 'y', (None, 'z'): 'z', (None, 'r'): 'r', } visual = inst.get2dGfxVisual(); if visual: attr_vals[(None, 'stackpos')] = str(visual.getStackPosition()) attr_names[(None, 'stackpos')] = 'stackpos' nspace = inst.getObject().getNamespace() if nspace != self.nspace: attr_vals[(None, 'ns')] = inst.getObject().getNamespace() attr_names[(None, 'ns')] = 'ns' self.nspace = nspace instId = inst.getId() if instId: attr_vals[(None, 'id')] = inst.getId() attr_names[(None, 'id')] = 'id' if inst.isOverrideBlocking(): attr_vals[(None, 'override_blocking')] = str(int(inst.isOverrideBlocking())) attr_names[(None, 'override_blocking')] = 'override_blocking' if inst.getObject().isBlocking() is not inst.isBlocking(): attr_vals[(None, 'blocking')] = str(int(inst.isBlocking())) attr_names[(None, 'blocking')] = 'blocking' attrs = AttributesNSImpl(attr_vals, attr_names) self.file.write(self.indent_level) self.xmlout.startElementNS((None, 'i'), 'i', attrs) self.xmlout.endElementNS((None, 'i'), 'i') self.file.write('\n') self.endElement('instances') def write_lights(self, layer): attrs = AttributesNSImpl({}, {}) self.startElement('lights', attrs) cameras = layer.getMap().getCameras() for cam in cameras: hit = False layers = cam.getRenderer("LightRenderer").getActiveLayers(); for lay in layers: if lay.getId() == layer.getId(): hit = True if hit == False: continue renderer = fife.LightRenderer.getInstance(cam) groups = renderer.getGroups() for group in groups: infos = renderer.getLightInfo(group) for info in infos: attr_vals = {} attr_names = {} type = info.getName() attr_vals[(None, 'group')] = str(group) attr_names[(None, 'group')] = 'group' attr_vals[(None, 'type')] = str(type) attr_names[(None, 'type')] = 'type' attr_vals[(None, 'instance')] = str(info.getNode().getInstance().getId()) attr_names[(None, 'instance')] = 'instance' if info.getSrcBlend() > -1: attr_vals[(None, 'src')] = str(info.getSrcBlend()) attr_names[(None, 'src')] = 'src' if info.getDstBlend() > -1: attr_vals[(None, 'dst')] = str(info.getDstBlend()) attr_names[(None, 'dst')] = 'dst' if info.getStencil() > -1: attr_vals[(None, 's_ref')] = str(info.getStencil()) attr_names[(None, 's_ref')] = 's_ref' attr_vals[(None, 'a_ref')] = str(info.getAlpha()) attr_names[(None, 'a_ref')] = 'a_ref' if type == 'simple': if info.getRadius() > 0: attr_vals[(None, 'radius')] = str(info.getRadius()) attr_names[(None, 'radius')] = 'radius' if info.getColor(): color = info.getColor() attr_vals[(None, 'color')] = '%d,%d,%d' % (color[0], color[1], color[2]) attr_vals[(None, 'intensity')] = str(color[3]) attr_names[(None, 'color')] = 'color' attr_names[(None, 'intensity')] = 'intensity' if info.getSubdivisions() is not 32: attr_vals[(None, 'subdivisions')] = str(info.getSubdivisions()) attr_names[(None, 'subdivisions')] = 'subdivisions' if info.getXStretch() > 1.001 or info.getXStretch() < 0.999: attr_vals[(None, 'xstretch')] = str(info.getXStretch()) attr_names[(None, 'xstretch')] = 'xstretch' if info.getYStretch() > 1.001 or info.getYStretch() < 0.999: attr_vals[(None, 'ystretch')] = str(info.getYStretch()) attr_names[(None, 'ystretch')] = 'ystretch' elif type == 'image': if info.getImage() == 0: continue img = info.getImage() name = img.getName() attr_vals[(None, 'image')] = str('../' + name) attr_names[(None, 'image')] = 'image' elif type == 'animation': if info.getAnimation() == 0: continue ani = info.getAnimation(); count = 0 newstr = '' image = ani.getFrame(ani.getActionFrame()) fname = image.getName() strings = ([str(s) for s in fname.split('/')]) leng = len(strings) -1 while count < leng: newstr = str(newstr + strings[count] + '/') count += 1 name = str('../' + newstr + 'animation.' + fileExtensions[0]) attr_vals[(None, 'animation')] = str(name) attr_names[(None, 'animation')] = 'animation' else: continue attrs = AttributesNSImpl(attr_vals, attr_names) self.file.write(self.indent_level) self.xmlout.startElementNS((None, 'l'), 'l', attrs) self.xmlout.endElementNS((None, 'l'), 'l') self.file.write('\n') self.endElement('lights') # Save the linked camera of a map. def write_camera( self, map ): cameralist = map.getCameras() for cam in cameralist: if cam.getLocationRef().getMap().getId() == map.getId(): celldimensions = cam.getCellImageDimensions() viewport = cam.getViewPort(); attr_names = { (None, 'id'): 'id', (None, 'zoom'): 'zoom', (None, 'tilt'): 'tile', (None, 'rotation'): 'rotation', (None, 'ref_layer_id'): 'ref_layer_id', (None, 'ref_cell_width'): 'ref_cell_width', (None, 'ref_cell_height'): 'ref_cell_height', } attr_vals = { (None, 'id'): cam.getId(), (None, 'zoom'): str( cam.getZoom()), (None, 'tilt'): str( cam.getTilt()), (None, 'rotation'): str( cam.getRotation()), (None, 'ref_layer_id'): cam.getLocation().getLayer().getId(), (None, 'ref_cell_width'): str( celldimensions.x ), (None, 'ref_cell_height'): str( celldimensions.y ), } # add a viewport entry if the cam isn't full sized if not (viewport == self.engine.getRenderBackend().getArea()): attr_names[(None,'viewport')] = 'viewport' attr_vals[(None,'viewport')] = '%d,%d,%d,%d' % (viewport.x, viewport.y, viewport.w, viewport.h) colors = cam.getLightingColor() if colors[0] < 1.0 or colors[1] < 1.0 or colors[2] < 1.0: attr_names[(None,'light_color')] = 'light_color' attr_vals[(None,'light_color')] = '%f,%f,%f' % (colors[0], colors[1], colors[2]) attrs = AttributesNSImpl( attr_vals, attr_names ) self.startElement( 'camera', attrs ); self.endElement( 'camera' ); def flush(self): self.xmlout.endDocument() self.file.close() def saveResource(self): self.write_map() fife_0.3.5/engine/python/fife/extensions/serializers/xmlmap.py0000664000175100017510000005640312205217523023657 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### """ main xml parser class for xml map loading """ import time from fife import fife from fife.extensions.serializers import ET from fife.extensions.serializers import SerializerError, InvalidFormat from fife.extensions.serializers import NameClash, NotFound, WrongFileType from fife.extensions.serializers.xmlobject import XMLObjectLoader from fife.extensions.serializers.xmlanimation import loadXMLAnimation from fife.extensions.serializers.xml_loader_tools import loadImportFile, loadImportDir from fife.extensions.serializers.xml_loader_tools import loadImportDirRec from fife.extensions.serializers.xml_loader_tools import root_subfile, reverse_root_subfile FORMAT = '1.0' class XMLMapLoader(object): """ The B{XMLMapLoader} parses the xml map using several section. Each section fires a callback (if given) which can e. g. be used to show a progress bar. The callback sends two values, a string and a float (which shows the overall process): callback(string, float) """ def __init__(self, engine, callback, debug, extensions): """ @type engine: object @param engine: a pointer to fife.engine @type callback: function @param callback: a callback with two arguments, optional @type debug: bool @param debug: flag to activate / deactivate print statements @type extensions: dict @param extensions: information package which extension should be activated (lights, sounds) """ # self.thisown = 0 self.callback = callback self.debug = debug self.engine = engine self.vfs = self.engine.getVFS() self.model = self.engine.getModel() self.image_manager = self.engine.getImageManager() self.anim_pool = None self.obj_loader = XMLObjectLoader(engine) self.map = None self.source = None self.time_to_load = 0 self.nspace = None self.msg = {} self.msg['map'] = 'created map' self.msg['imports'] = 'loaded imports' self.msg['layer'] = 'loaded layer: %s' self.msg['camera'] = 'loaded camera: %s' if 'sound' not in extensions: extensions['sound'] = False if 'lights' not in extensions: extensions['lights'] = False self.light_data = {} self.extensions = extensions def _err(self, msg): raise SyntaxError(''.join(['File: ', self.source, ' . ', msg])) def loadResource(self, location): """ overwrite of B{fife.ResourceLoader} @type location: object @param location: path to a map file as a fife.ResourceLocation @return FIFE map object @rtype object """ start_time = time.time() self.source = location f = self.vfs.open(self.source) f.thisown = 1 tree = ET.parse(f) root = tree.getroot() map = self.parse_map(root) self.time_to_load = time.time() - start_time return map def parse_map(self, mapelt): """ start parsing the xml structure and call submethods for turning found tags into FIFE objects and create the map @type mapelt: object @param mapelt: ElementTree root @return FIFE map object @rtype object """ if not mapelt: self._err('No element found at top level of map file definition.') _id, format = mapelt.get('id'), mapelt.get('format') if not format == FORMAT: self._err(''.join(['This file has format ', format, ' but this loader has format ', FORMAT])) if not _id: self._err('Map declared without an identifier.') map = None try: self.map = self.model.createMap(str(_id)) self.map.setFilename(self.source) except fife.Exception, e: # NameClash appears as general fife.Exception; any ideas? print e.getMessage() print ''.join(['File: ', self.source, '. The map ', str(_id), ' already exists! Ignoring map definition.']) return map # xml-specific directory imports. This is used by xml savers. self.map.importDirs = [] if self.callback is not None: self.callback(self.msg['map'], float(0.25) ) self.parse_imports(mapelt, self.map) self.parse_layers(mapelt, self.map) self.parse_cameras(mapelt, self.map) # create light nodes if self.light_data: self.create_light_nodes(self.map) return self.map def parse_imports(self, mapelt, map): """ load all objects defined as import into memory @type mapelt: object @param mapelt: ElementTree root @return FIFE map object @rtype object """ parsedImports = {} if self.callback: tmplist = mapelt.findall('import') i = float(0) for item in mapelt.findall('import'): _file = item.get('file') if _file: _file = reverse_root_subfile(self.source, _file) _dir = item.get('dir') if _dir: _dir = reverse_root_subfile(self.source, _dir) # Don't parse duplicate imports if (_dir,_file) in parsedImports: if self.debug: print "Duplicate import:" ,(_dir, _file) continue parsedImports[(_dir,_file)] = 1 if _file and _dir: loadImportFile(self.obj_loader, '/'.join(_dir, _file), self.engine, self.debug) elif _file: loadImportFile(self.obj_loader, _file, self.engine, self.debug) elif _dir: loadImportDirRec(self.obj_loader, _dir, self.engine, self.debug) map.importDirs.append(_dir) else: if self.debug: print 'Empty import statement?' if self.callback: i += 1 self.callback(self.msg['imports'], float( i / float(len(tmplist)) * 0.25 + 0.25 ) ) def parse_layers(self, mapelt, map): """ create all layers and their instances @type mapelt: object @param mapelt: ElementTree root @type map: object @param map: FIFE map object """ if self.callback is not None: tmplist = mapelt.findall('layer') i = float(0) for layer in mapelt.findall('layer'): _id = layer.get('id') grid_type = layer.get('grid_type') if not _id: self._err(' declared with no id attribute.') if not grid_type: self._err(''.join(['Layer ', str(_id), ' has no grid_type attribute.'])) x_scale = layer.get('x_scale') y_scale = layer.get('y_scale') rotation = layer.get('rotation') x_offset = layer.get('x_offset') y_offset = layer.get('y_offset') z_offset = layer.get('z_offset') pathing = layer.get('pathing') transparency = layer.get('transparency') layer_type = layer.get('layer_type') layer_type_id = layer.get('layer_type_id') if not x_scale: x_scale = 1.0 if not y_scale: y_scale = 1.0 if not rotation: rotation = 0.0 if not x_offset: x_offset = 0.0 if not y_offset: y_offset = 0.0 if not z_offset: z_offset = 0.0 if not pathing: pathing = "cell_edges_only" if not transparency: transparency = 0 else: transparency = int(transparency) cellgrid = self.model.getCellGrid(grid_type) if not cellgrid: self._err(' declared with invalid cellgrid type. (%s)' % grid_type) cellgrid.setRotation(float(rotation)) cellgrid.setXScale(float(x_scale)) cellgrid.setYScale(float(y_scale)) cellgrid.setXShift(float(x_offset)) cellgrid.setYShift(float(y_offset)) cellgrid.setZShift(float(z_offset)) layer_obj = None try: layer_obj = map.createLayer(str(_id), cellgrid) except fife.Exception, e: print e.getMessage() print 'The layer ' + str(_id) + ' already exists! Ignoring this layer.' continue strgy = fife.CELL_EDGES_ONLY if pathing == "cell_edges_and_diagonals": strgy = fife.CELL_EDGES_AND_DIAGONALS layer_obj.setPathingStrategy(strgy) layer_obj.setLayerTransparency(transparency) if layer_type: if layer_type == 'walkable': layer_obj.setWalkable(True) elif layer_type == 'interact' and layer_type_id: layer_obj.setInteract(True, layer_type_id) self.parse_instances(layer, layer_obj) if self.extensions['lights']: self.parse_lights(layer, layer_obj) if self.extensions['sound']: self.parse_sounds(layer, layer_obj) if self.callback is not None: i += 1 self.callback(self.msg['layer'] % str(_id), float( i / float(len(tmplist)) * 0.25 + 0.5 ) ) layers = map.getLayers() for l in layers: if l.isInteract(): walk_layer = map.getLayer(l.getWalkableId()) if walk_layer: walk_layer.addInteractLayer(l); for l in layers: if l.isWalkable(): l.createCellCache() # cleanup if self.callback is not None: del tmplist del i def parse_lights(self, layerelt, layer): """ create light nodes @type layerelt: object @param layerelt: ElementTree layer branch @type layer: object @param layer: FIFE layer object """ _LIGHT_DEFAULT_BLENDING_SRC = -1 _LIGHT_DEFAULT_BLENDING_DST = -1 _LIGHT_DEFAULT_SUBDIVISIONS = 32 _LIGHT_DEFAULT_CAM_ID = 'default' _LIGHT_DEFAULT_INTENSITY = 128 _LIGHT_DEFAULT_RADIUS = 10.0 print "Processing lights ... " lightelt = layerelt.find('lights') if not lightelt: print "\tno lights found on layer %s" % layer.getId() return lights = [] for attr in ('l', 'light', 'lgt'): lights.extend(lightelt.findall(attr)) for light in lights: group = light.get('group') if not group: print "Light has no group. Omitting..." continue blending_src = light.get('src') if not blending_src: blending_src = _LIGHT_DEFAULT_BLENDING_SRC blending_dst = light.get('dst') if not blending_dst: blending_dst = _LIGHT_DEFAULT_BLENDING_DST _x = light.get('x') if not _x: _x = 0 _y = light.get('y') if not _y: _y = 0 _z = light.get('y') if not _z: _z = 0 node = {} node['blending_src'] = int(blending_src) node['blending_dst'] = int(blending_dst) node['layer'] = layer.getId() node['position'] = int(_x), int(_y), int(_z) # where is the light? *sing* instance_id = light.get('instance') node['instance'] = None if instance_id and layer.getInstance(instance_id): node['instance'] = instance_id type = light.get('type') if type: s_ref = light.get('s_ref') if not s_ref: s_ref = -1 node['s_ref'] = int(s_ref) a_ref = light.get('a_ref') if not a_ref: a_ref = 0.0 node['a_ref'] = float(a_ref) if type == 'image': image = light.get('image') if not image: print "Light has no image. Omitting..." continue node['type'] = 'image' image = reverse_root_subfile(self.source, image) img = self.image_manager.create(image) node['image'] = img elif type == 'animation': animation = light.get('animation') if not animation: print "Light has no animation. Omitting..." continue node['type'] = 'animation' animation = reverse_root_subfile(self.source, animation) anim = loadXMLAnimation(self.engine, animation) node['animation'] = anim elif type == 'simple': node['type'] = type radius = light.get('radius') if not radius: radius = _LIGHT_DEFAULT_RADIUS node['radius'] = float(radius) subdivisions = light.get('subdivisions') if not subdivisions: subdivisions = _LIGHT_DEFAULT_SUBDIVISIONS node['subdivisions'] = int(subdivisions) intensity = light.get('intensity') if not intensity: intensity = _LIGHT_DEFAULT_INTENSITY node['intensity'] = int(intensity) xstretch = light.get('xstretch') if not xstretch: xstretch = 1.0 ystretch = light.get('ystretch') if not ystretch: ystretch = 1.0 node['stretch'] = float(xstretch), float(ystretch) color = light.get('color') if not color: color = '%d,%d,%d' % (255, 255, 255) node['color'] = ([int(c) for c in color.split(',')]) else: continue cam_id = light.get('camera_id') if not cam_id: cam_id = _LIGHT_DEFAULT_CAM_ID if not cam_id in self.light_data: self.light_data[cam_id] = {} if group not in self.light_data[cam_id]: self.light_data[cam_id][group] = [] self.light_data[cam_id][group].append(node) for camera, groups in self.light_data.iteritems(): print "Lights for camera %s" % camera for group, lights in groups.iteritems(): print group, lights def parse_sounds(self, layerelt, layer): """ create sound emitter FIXME: - FIFE has a hard limit of sound emitters how should we load emitters here? - my first thought: collect a list of sound files & data for emitter creation, then let the client decide what to do with it @type layerelt: object @param layerelt: ElementTree layer branch @type layer: object @param layer: FIFE layer object """ # to be continued pass def parse_instances(self, layerelt, layer): """ create all layers and their instances @type layerelt: object @param layerelt: ElementTree layer branch @type layer: object @param layer: FIFE layer object """ instelt = layerelt.find('instances') instances = [] for attr in ('i', 'inst', 'instance'): instances.extend(instelt.findall(attr)) for instance in instances: _id = instance.get('id') if not _id: _id = '' objectID = '' for attr in ('o', 'object', 'obj'): objectID = instance.get(attr) if objectID: break if not objectID: self._err(' %s does not specify an object attribute.' % str(objectID)) objectID = str(objectID) nspace = '' for attr in ('namespace', 'ns'): nspace = instance.get(attr) if nspace: break # try to reuse the previous namespace if not nspace and self.nspace: nspace = self.nspace if not nspace and not self.nspace: self._err(' %s does not specify an object namespace, and no default is available.' % str(objectID)) nspace = str(nspace) self.nspace = nspace # check if there is an object for this instance available, if not -> skip this one object = self.model.getObject(objectID, nspace) if not object: print "Object with id=%s, ns=%s could not be found. Omitting..." % (objectID, nspace) continue x = instance.get('x') if x: self.x = x = float(x) else: x = self.x y = instance.get('y') if y: self.y = y = float(y) else: y = self.y z = instance.get('z') if z: z = float(z) else: z = 0.0 inst = layer.createInstance(object, fife.ExactModelCoordinate(x,y,z), _id) rotation = 0 for attr in ('r', 'rotation'): rotation = instance.get(attr) if rotation: break if not rotation: angles = object.get2dGfxVisual().getStaticImageAngles() if angles: rotation = angles[0] else: rotation = 0 else: rotation = int(rotation) inst.setRotation(rotation) over_block = instance.get('override_blocking') if over_block is not None: inst.setOverrideBlocking(bool(over_block)) blocking = instance.get('blocking') if blocking is not None: inst.setBlocking(bool(int(blocking))) fife.InstanceVisual.create(inst) stackpos = instance.get('stackpos') if stackpos: inst.get2dGfxVisual().setStackPosition(int(stackpos)) if (object.getAction('default')): target = fife.Location(layer) inst.act('default', target, True) def parse_cameras(self, mapelt, map): """ create all cameras and activate them FIXME: - should the cameras really be enabled here? IMO that's part of the setup within a client (we just _load_ things here) @type mapelt: object @param mapelt: ElementTree root @type map: object @param map: FIFE map object """ if self.callback: tmplist = mapelt.findall('camera') i = float(0) for camera in mapelt.findall('camera'): _id = camera.get('id') zoom = camera.get('zoom') tilt = camera.get('tilt') rotation = camera.get('rotation') ref_layer_id = camera.get('ref_layer_id') ref_cell_width = camera.get('ref_cell_width') ref_cell_height = camera.get('ref_cell_height') viewport = camera.get('viewport') light_color = camera.get('light_color') if not zoom: zoom = 1 if not tilt: tilt = 0 if not rotation: rotation = 0 if not _id: self._err('Camera declared without an id.') if not ref_layer_id: self._err(''.join(['Camera ', str(_id), ' declared with no reference layer.'])) if not (ref_cell_width and ref_cell_height): self._err(''.join(['Camera ', str(_id), ' declared without reference cell dimensions.'])) try: if viewport: cam = map.addCamera(str(_id), map.getLayer(str(ref_layer_id)),fife.Rect(*[int(c) for c in viewport.split(',')])) else: screen = self.engine.getRenderBackend() cam = map.addCamera(str(_id), map.getLayer(str(ref_layer_id)),fife.Rect(0,0,screen.getScreenWidth(),screen.getScreenHeight())) renderer = fife.InstanceRenderer.getInstance(cam) renderer.activateAllLayers(map) except fife.Exception, e: print e.getMessage() if light_color: cam.setLightingColor(*[float(c) for c in light_color.split(',')]) cam.setCellImageDimensions(int(ref_cell_width), int(ref_cell_height)) cam.setRotation(float(rotation)) cam.setTilt(float(tilt)) cam.setZoom(float(zoom)) renderer = fife.InstanceRenderer.getInstance(cam) renderer.activateAllLayers(map) if self.callback: i += 1 self.callback(self.msg['camera'] % str(_id), float( i / len(tmplist) * 0.25 + 0.75 ) ) def create_light_nodes(self, map): """ loop through all preloaded lights and create them according to their data @type map: object @param map: FIFE map object """ cameras = [i.getId() for i in map.getCameras()] renderers = {} default_cam = map.getCameras()[0].getId() def add_simple_light(group, renderer, node, data): """ add a node as simple light to the renderer @type group: string @param group: name of the light group @type renderer: object @param renderer: fife.LightRenderer instance @type node: object @param node: fife.RendererNode instance @type data: dict @param data: all data for the light type creation """ if not node: return if not group: return renderer.addSimpleLight( group, node, data['intensity'], data['radius'], data['subdivisions'], data['stretch'][0], data['stretch'][1], data['color'][0], data['color'][1], data['color'][2], data['blending_src'], data['blending_dst'], ) if data['s_ref'] is not -1: add_stencil_test(group, renderer, data) def add_animated_lightmap(group, renderer, node, data): """ add a node as animated lightmap to the renderer @type group: string @param group: name of the light group @type renderer: object @param renderer: fife.LightRenderer instance @type node: object @param node: fife.RendererNode instance @type data: dict @param data: all data for the light type creation """ if not node: return if not group: return renderer.addAnimation( group, node, data['animation'], data['blending_src'], data['blending_dst'], ) if data['s_ref'] is not -1: add_stencil_test(group, renderer, data) def add_lightmap(group, renderer, node, data): """ add a node as lightmap to the renderer @type group: string @param group: name of the light group @type renderer: object @param renderer: fife.LightRenderer instance @type node: object @param node: fife.RendererNode instance @type data: dict @param data: all data for the light type creation """ if not node: return if not group: return renderer.addImage( group, node, data['image'], data['blending_src'], data['blending_dst'], ) if data['s_ref'] is not -1: add_stencil_test(group, renderer, data) def add_stencil_test(group, renderer, data): """ add a stencil test to a group @type group: string @param group: name of the light group @type renderer: object @param renderer: fife.LightRenderer instance @type data: dict @param data: all data for the light type creation """ if not group: return renderer.addStencilTest( group, data['s_ref'], data['a_ref'], ) def create_node(instance=None, point=None, layer=None): """ creates a node of one of these types: - attached to an instance - attached to an instance with offset - attached to a point FIXME: - add location node @type: instance: object @param instance: fife instance object @type point: tuple @param point: x,y,z tuple @type layer: object @param layer: fife layer object """ node = None if not layer: return node # node at layer coordinates if point and not instance: point = fife.Point(point[0], point[1]) node = fife.RendererNode(point); # node with offset if instance and point: node = fife.RendererNode(instance, layer, fife.Point(point[0], point[1])) # node attached to instance if instance and not point: node = fife.RendererNode(instance, layer) if node: node.thisown = 0 return node def dump_data(): """ dump all loaded data """ for camera, groups in self.light_data.iteritems(): print "Lights for camera %s" % camera for group, lights in groups.iteritems(): print group, lights # fetch all renderer instances for available cameras for _id in cameras: camera = map.getCamera(_id) renderers[_id] = fife.LightRenderer.getInstance(camera) # parse data and create the lights for camera, groups in self.light_data.iteritems(): for group, lights in groups.iteritems(): for light in lights: instance = None layer = map.getLayer(light['layer']) if light['instance']: instance = layer.getInstance(light['instance']) position = light['position'] node = create_node(instance, position, layer) # some guards if not node: continue if camera == 'default': renderer = renderers[default_cam] else: renderer = renderers[camera] if light['type'] == 'simple': add_simple_light(group, renderer, node, light) elif light['type'] == 'image': add_lightmap(group, renderer, node, light) elif light['type'] == 'animation': add_animated_lightmap(group, renderer, node, light) # dump_data() fife_0.3.5/engine/python/fife/extensions/serializers/xmlobject.py0000664000175100017510000002764312205217523024354 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### """ submodule for xml map parsing """ from fife import fife from fife.extensions.serializers import ET from fife.extensions.serializers import SerializerError, InvalidFormat from fife.extensions.serializers import NameClash, NotFound, WrongFileType from fife.extensions.serializers.xmlanimation import loadXMLAnimation class XMLObjectSaver(object): """ The B{XMLObjectSaver} serializes a fife.Object instance by saving it back to its XML file @note: - this code does NOT allow the creation of a new xml file - this code does NOT touch atlas or animation definitions - this code does NOT allow saving to non-well-formed xml files - this code DOES save blocking & static flag, as well as image offsets @type engine: fife @ivar engine: pointer to initialized fife engine instance @type img_manager: fife.ImageManager @ivar img_manager: pointer to fife image manager @type compat: bool @ivar compat: flag to either use outdated xml definitions or new approach @type debug: bool @ivar debug: flag to activate/deactivate debug output @type vfs: fife.VFS @ivar vfs: pointer to fife vfs @type change: bool @ivar change: flag if object data differs from file data """ PROCESSING_INSTRUCTION = '' def __init__(self, engine, debug=False, compat=True): """ @type engine: fife @param engine: intialized fife engine """ self.compat = compat self.debug = debug self.engine = engine self.img_manager = engine.getImageManager() self.vfs = self.engine.getVFS() self.change = False def save(self, object): """ saves the data of a fife.Object to its xml file @type object: fife.Object @param object: the object which should be saved @rtype bool @return flag whether the saving was successful or not """ self.change = False result = False file = object.getFilename() if not file: raise SerializerError("Object cannot be saved, no file found %s" % object) return result if not self.vfs.exists(file): raise NotFound("File not within vfs: %s" % file) return result file_handle = self.vfs.open(file) file_handle.thisown = 1 tree = ET.parse(file_handle) root = tree.getroot() object_id = object.getId() blocking = object.isBlocking() static = object.isStatic() # @todo: # compat layer - remove as soon as cell_pathfinding branch # is merged back to trunk/ if hasattr(object, 'getCostId'): cost_id = object.getCostId() else: cost_id = '' if hasattr(object, 'getCost'): cost = object.getCost() else: cost = 0.0 if hasattr(object, 'getCellStackPosition'): cellstack_pos = object.getCellStackPosition() else: cellstack_pos = 0 if self.debug: print "XML tree dump: (pre-save)" ET.dump(root) print "Object data: " print "\tid", object_id print "\tblocking", blocking print "\tstatic", static print "\tcost id", cost_id print "\tcost", cost # check for compat mode if root.tag != 'assets': self.compat = True # in compat mode tree is if self.compat: objects = [root,] # new XML structure has tree root which groups multiple objects else: objects = root.findall("object") for obj in objects: _id = obj.get("id") if _id != object_id: if self.debug: print "...ommitting object %s " % _id continue if 'blocking' not in obj.attrib or int(obj.attrib['blocking']) != int(blocking): self.change = True if 'static' not in obj.attrib or int(obj.attrib['static']) != int(static): self.change = True if 'cost_id' not in obj.attrib or str(obj.attrib['cost_id']) != str(cost_id): self.change = True if 'cost' not in obj.attrib or float(obj.attrib['cost']) != float(cost): self.change = True if 'cellstack_position' not in obj.attrib or int(obj.attrib['cellstack_position']) != int(cellstack_pos): self.change = True obj.attrib['blocking'] = str(int(blocking)) obj.attrib['static'] = str(int(static)) if cost_id and cost: obj.attrib['cost_id'] = str(cost_id) obj.attrib['cost'] = str(cost) obj.attrib['cellstack_position'] = str(cellstack_pos) if self.debug and self.change: print "\tSet new data in xml tree: " print "\t\tblocking: ", obj.attrib['blocking'] print "\t\tstatic: ", obj.attrib['static'] images = obj.findall("image") actions = obj.findall("action") if self.debug: print "\tAttempting to save image data: " print "\t...found these image elements: " print "\t", images print "object dump: " print ET.dump(obj) self.save_images(images, object) self.save_actions(actions, object) if not self.change: return result xmlcontent = ET.tostring(root) if self.debug: print "XML tree dump: (post-manipulation)" ET.dump(root) # save xml data beneath the definition into the object file file = open(file, 'w') file.write(XMLObjectSaver.PROCESSING_INSTRUCTION+'\n') file.write(xmlcontent + "\n") file.close() result = True return result def save_actions(self, actions, object): """ save action definitions @type actions: list @param actions: list of elements @type object: fife.Object @param object: the object which should be saved """ for element in actions: # new xml format uses this, we only save the new format if 'animation_id' not in element.attrib: break animation_id = element.attrib['animation_id'] self.save_animation(animation_id, object) def save_animation(self, animation_id, object): """ save animation definitions for the given id @type animation_id: str @param animation_id: id of the animation data structure @type object: fife.Object @param object: the object which should be saved """ pass def save_images(self, images, object): """ save image definitions @type images: list @param images: list of elements @type object: fife.Object @param object: the object which should be saved """ visual = object.get2dGfxVisual() angles = visual.getStaticImageAngles() if self.debug: print "\t\tobject angles: ", angles for element in images: angle = int(element.get("direction")) if angle not in angles: continue index = visual.getStaticImageIndexByAngle(angle) image = self.img_manager.get(index) x_offset = image.getXShift() y_offset = image.getYShift() if 'x_offset' not in element.attrib or int(element.attrib['x_offset']) != x_offset: self.change = True if 'y_offset' not in element.attrib or int(element.attrib['y_offset']) != y_offset: self.change = True element.attrib['x_offset'] = str(x_offset) element.attrib['y_offset'] = str(y_offset) if self.debug and self.change: print "\tSet new data in xml tree: () " print "\t\tx offset: ", element.attrib['x_offset'] print "\t\ty offset: ", element.attrib['y_offset'] class XMLObjectLoader(object): """ """ def __init__(self, engine): """ """ self.engine = engine self.imgMgr = engine.getImageManager() self.anim_pool = None self.model = engine.getModel() self.vfs = engine.getVFS() self.source = None self.filename = '' def loadResource(self, location): """ """ self.source = location self.filename = self.source self.node = None self.file = None if hasattr(location, 'node'): self.node = location.node else: isobjectfile = True f = self.vfs.open(self.filename) f.thisown = 1 obj_identifier = '' try: s = f.readString(len(obj_identifier)) except fife.IndexOverflow: isobjectfile = False if isobjectfile and not s.startswith(obj_identifier): isobjectfile = False if not isobjectfile: return # this will never be hit currently, if this is put before the return it can provide useful debugging # but animation.xml files will raise this exception because apparently they come through here first raise WrongFileType('Tried to open non-object file %s with XMLObjectLoader.' % self.filename) self.do_load_resource(f) def do_load_resource(self, file): """ """ if file: tree = ET.parse(file) self.node = tree.getroot() self.parse_object(self.node) def parse_object(self, object): """ """ if self.node.tag != 'object': raise InvalidFormat('Expected tag, but found <%s>.' % self.node.tag) _id = object.get('id') if not _id: raise InvalidFormat(' declared without an id attribute.') _id = str(_id) nspace = object.get('namespace') if not nspace: raise InvalidFormat(' %s declared without a namespace attribute.' % str(_id)) nspace = str(nspace) obj = None parent = object.get('parent', None) if parent: query = self.metamodel.getObjects('id', str(parent)) if len(query) == 0: raise NotFound('No objects found with identifier %s.' % str(parent)) elif len(query) > 1: raise NameClash('%d objects found with identifier %s.' % (len(query), str(parent))) parent = query[0] # check if model already has this object if not bool(self.model.getObject(_id, nspace)): obj = self.model.createObject(_id, nspace, parent) else: print NameClash('Tried to create already existing object \n\t...ignoring: %s, %s' % (_id, nspace)) return obj.setFilename(self.source) fife.ObjectVisual.create(obj) obj.setBlocking(bool( int(object.get('blocking', False)) )) obj.setStatic(bool( int(object.get('static', False)) )) pather = object.get('pather', 'RoutePather') obj.setPather( self.model.getPather(pather) ) self.parse_images(object, obj) self.parse_actions(object, obj) def parse_images(self, objelt, object): """ """ for image in objelt.findall('image'): source = image.get('source') if not source: raise InvalidFormat(' declared without a source attribute.') # paths are relative to this resource's path path = self.filename.split('/') path.pop() path.append(str(source)) img = self.imgMgr.create('/'.join(path)) img.setXShift(int( image.get('x_offset', 0) )) img.setYShift(int( image.get('y_offset', 0) )) object.get2dGfxVisual().addStaticImage(int( image.get('direction', 0) ), img.getHandle()) def parse_actions(self, objelt, object): """ """ for action in objelt.findall('action'): id = action.get('id') if not id: raise InvalidFormat(' declared without an id attribute.') act_obj = object.createAction(str(id)) fife.ActionVisual.create(act_obj) self.parse_animations(action, act_obj) def parse_animations(self, actelt, action): """ """ pass for anim in actelt.findall('animation'): source = anim.get('source') if not source: raise InvalidFormat('Animation declared with no source location.') # animation paths are relative to this resource's path path = self.filename.split('/') path.pop() path.append(str(source)) animation = loadXMLAnimation(self.engine, '/'.join(path)) action.get2dGfxVisual().addAnimation(int( anim.get('direction', 0) ), animation) action.setDuration(animation.getDuration()) fife_0.3.5/engine/python/fife/extensions/serializers/xmlanimation.py0000664000175100017510000000746012205217523025060 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from fife import fife from fife.extensions.serializers import ET def loadXMLAnimation(engine, filename): f = engine.getVFS().open(filename) f.thisown = 1 imgMgr = engine.getImageManager() tree = ET.parse(f) node = tree.getroot() animation = fife.Animation.createAnimation() common_width = int(node.get('width', 0)) common_height = int(node.get('height', 0)) common_y_offset = int(node.get('y_offset', 0)) common_frame_delay = int(node.get('delay', 0)) common_x_offset = int(node.get('x_offset', 0)) common_y_offset = int(node.get('y_offset', 0)) animation.setActionFrame(int(node.get('action', 0))) frames = node.findall('frame') if not frames: raise InvalidFormat('animation without s') atlas = node.get('atlas') if atlas: path = filename.split('/') path.pop() path.append(str(atlas)) atlas_file = '/'.join(path) if imgMgr.exists(atlas_file): atlas_img = imgMgr.getPtr(str(atlas_file)) else: atlas_img = imgMgr.create(str(atlas_file)) # parse atlas animation format 2 (e.g. cursor) for frame in frames: source = frame.get('source') if not source: raise InvalidFormat('animation without s') frame_x_pos = int(frame.get('xpos', 0)) frame_y_pos = int(frame.get('ypos', 0)) frame_x_offset = int(frame.get('x_offset', common_x_offset)) frame_y_offset = int(frame.get('y_offset', common_y_offset)) frame_delay = int(frame.get('delay', common_frame_delay)) frame_width = int(frame.get('width', common_width)) frame_height = int(frame.get('height', common_height)) # xml paths are relative to the directory of the file they're used in. path = filename.split('/') path.pop() path.append(str(source)) frame_file = '/'.join(path) frame_file = atlas,":",frame_file if imgMgr.exists(str(frame_file)): frame_img = imgMgr.getPtr(str(frame_file)) else: frame_img = imgMgr.create(str(frame_file)) region = fife.Rect(frame_x_pos, frame_y_pos, frame_width, frame_height) frame_img.useSharedImage(atlas_img, region) frame_img.setXShift(frame_x_offset) frame_img.setYShift(frame_y_offset) animation.addFrame(frame_img, frame_delay) else: # parse single images for frame in frames: source = frame.get('source') if not source: raise InvalidFormat('animation without s') frame_x_offset = int(frame.get('x_offset', common_x_offset)) frame_y_offset = int(frame.get('y_offset', common_y_offset)) frame_delay = int(frame.get('delay', common_frame_delay)) # xml paths are relative to the directory of the file they're used in. path = filename.split('/') path.pop() path.append(str(source)) image_file = '/'.join(path) img = imgMgr.create(image_file) img.setXShift(frame_x_offset) img.setYShift(frame_y_offset) animation.addFrame(img, frame_delay) # animation.thisown = 0 return animation fife_0.3.5/engine/python/fife/extensions/serializers/xml_loader_tools.py0000664000175100017510000001114212205217523025716 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### """ utilities for xml maploading process """ import sys, os from fife import fife import math def loadImportFile(loader, path, engine, debug=False): """ uses XMLObjectLoader to load import files from path @type path: string @param path: path to import file @type debug: bool @param debug: flag to activate / deactivate print statements """ loader.loadResource(path) if debug: print 'imported object file ' + path def loadImportDir(loader, path, engine, debug=False): """ helper function to call loadImportFile on a directory @type path: string @param path: path to import directory @type debug: bool @param debug: flag to activate / deactivate print statements """ for _file in filter(lambda f: f.split('.')[-1] == 'xml', engine.getVFS().listFiles(path)): loadImportFile(loader, '/'.join([path, _file]), engine, debug) def loadImportDirRec(loader, path, engine, debug=False): """ helper function to call loadImportFile recursive on a directory @type path: string @param path: path to import directory @type debug: bool @param debug: flag to activate / deactivate print statements """ loadImportDir(loader, path, engine, debug) for _dir in filter(lambda d: not d.startswith('.'), engine.getVFS().listDirectories(path)): loadImportDirRec(loader, '/'.join([path, _dir]), engine, debug) def root_subfile(masterfile, subfile): """ Returns new path for given subfile (path), which is rooted against masterfile E.g. if masterfile is ./../foo/bar.xml and subfile is ./../foo2/subfoo.xml, returned path is ../foo2/subfoo.xml NOTE: masterfile is expected to be *file*, not directory. subfile can be either """ s = '/' masterfile = norm_path(os.path.abspath(masterfile)) subfile = norm_path(os.path.abspath(subfile)) master_fragments = masterfile.split(s) sub_fragments = subfile.split(s) master_leftovers = [] sub_leftovers = [] for i in xrange(len(master_fragments)): try: if master_fragments[i] == sub_fragments[i]: master_leftovers = master_fragments[i+1:] sub_leftovers = sub_fragments[i+1:] except IndexError: break pathstr = '' for f in master_leftovers[:-1]: pathstr += '..' + s pathstr += s.join(sub_leftovers) return pathstr def reverse_root_subfile(masterfile, subfile): """ does inverse operation to root_subfile. E.g. E.g. if masterfile is ./../foo/bar.xml and subfile is ../foo2/subfoo.xml, returned path ./../foo2/subfoo.xml Usually this function is used to convert saved paths into engine relative paths NOTE: masterfile is expected to be *file*, not directory. subfile can be either """ s = '/' masterfile = norm_path(os.path.abspath(masterfile)).split(s)[:-1] subfile = norm_path(os.path.abspath( s.join(masterfile) + s + subfile )) masterfile = norm_path(os.getcwd()) + s + 'foo.bar' # cheat a little to satisfy root_subfile return root_subfile(masterfile, subfile) def norm_path(path): """ Makes the path use '/' delimited separators. FIFE always uses these delimiters, but some os-related routines will default to os.path.sep. """ if os.path.sep == '/': return path return '/'.join(path.split(os.path.sep)) def frange(limit1, limit2 = None, increment = 1.): """ source: http://code.activestate.com/recipes/66472-frange-a-range-function-with-float-increments/ Range function that accepts floats (and integers). Usage: frange(-2, 2, 0.1) frange(10) frange(10, increment = 0.5) The returned value is an iterator. Use list(frange) for a list. """ if limit2 is None: limit2, limit1 = limit1, 0. else: limit1 = float(limit1) count = int(math.ceil(limit2 - limit1)/increment) return (limit1 + n*increment for n in range(count)) fife_0.3.5/engine/python/fife/extensions/serializers/__init__.py0000664000175100017510000001262412205217523024115 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### import fife, sys, os from traceback import print_exc __all__ = ('ET', 'SerializerError', 'InvalidFormat', 'WrongFileType', 'NameClash', 'NotFound', 'warn', 'root_subfile', 'reverse_root_subfile') try: import xml.etree.cElementTree as ET except ImportError: import xml.etree.ElementTree as ET class SerializerError(Exception): pass class InvalidFormat(SerializerError): pass class WrongFileType(SerializerError): pass class NameClash(SerializerError): pass class NotFound(SerializerError): pass def warn(self, msg): print 'Warning (%s): %s' % (self.filename, msg) def root_subfile(masterfile, subfile): """ Returns new path for given subfile (path), which is rooted against masterfile E.g. if masterfile is ./../foo/bar.xml and subfile is ./../foo2/subfoo.xml, returned path is ../foo2/subfoo.xml NOTE: masterfile is expected to be *file*, not directory. subfile can be either """ s = '/' masterfile = norm_path(os.path.abspath(masterfile)) subfile = norm_path(os.path.abspath(subfile)) master_fragments = masterfile.split(s) sub_fragments = subfile.split(s) master_leftovers = [] sub_leftovers = [] for i in xrange(len(master_fragments)): try: if master_fragments[i] == sub_fragments[i]: master_leftovers = master_fragments[i+1:] sub_leftovers = sub_fragments[i+1:] except IndexError: break pathstr = '' for f in master_leftovers[:-1]: pathstr += '..' + s pathstr += s.join(sub_leftovers) return pathstr def reverse_root_subfile(masterfile, subfile): """ does inverse operation to root_subfile. E.g. E.g. if masterfile is ./../foo/bar.xml and subfile is ../foo2/subfoo.xml, returned path ./../foo2/subfoo.xml Usually this function is used to convert saved paths into engine relative paths NOTE: masterfile is expected to be *file*, not directory. subfile can be either """ s = '/' masterfile = norm_path(os.path.abspath(masterfile)).split(s)[:-1] subfile = norm_path(os.path.abspath( s.join(masterfile) + s + subfile )) masterfile = norm_path(os.getcwd()) + s + 'foo.bar' # cheat a little to satisfy root_subfile return root_subfile(masterfile, subfile) def norm_path(path): """ Makes the path use '/' delimited separators. FIFE always uses these delimiters, but some os-related routines will default to os.path.sep. """ if os.path.sep == '/': return path return '/'.join(path.split(os.path.sep)) def loadImportFile(loader, path, engine, debug=False): """ uses XMLObjectLoader to load import files from path @type path: string @param path: path to import file @type debug: bool @param debug: flag to activate / deactivate print statements """ loader.loadResource(fife.ResourceLocation(path)) if debug: print 'imported object file ' + path def loadImportDir(loader, path, engine, debug=False): """ helper function to call loadImportFile on a directory @type path: string @param path: path to import directory @type debug: bool @param debug: flag to activate / deactivate print statements """ for _file in filter(lambda f: f.split('.')[-1] == 'xml', engine.getVFS().listFiles(path)): loadImportFile(loader, '/'.join([path, _file]), engine, debug) def loadImportDirRec(loader, path, engine, debug=False): """ helper function to call loadImportFile recursive on a directory @type path: string @param path: path to import directory @type debug: bool @param debug: flag to activate / deactivate print statements """ loadImportDir(loader, path, engine, debug) for _dir in filter(lambda d: not d.startswith('.'), engine.getVFS().listDirectories(path)): loadImportDirRec(loader, '/'.join([path, _dir]), engine, debug) def root_subfile(masterfile, subfile): """ Returns new path for given subfile (path), which is rooted against masterfile E.g. if masterfile is ./../foo/bar.xml and subfile is ./../foo2/subfoo.xml, returned path is ../foo2/subfoo.xml NOTE: masterfile is expected to be *file*, not directory. subfile can be either """ s = '/' masterfile = norm_path(os.path.abspath(masterfile)) subfile = norm_path(os.path.abspath(subfile)) master_fragments = masterfile.split(s) sub_fragments = subfile.split(s) master_leftovers = [] sub_leftovers = [] for i in xrange(len(master_fragments)): try: if master_fragments[i] == sub_fragments[i]: master_leftovers = master_fragments[i+1:] sub_leftovers = sub_fragments[i+1:] except IndexError: break pathstr = '' for f in master_leftovers[:-1]: pathstr += '..' + s pathstr += s.join(sub_leftovers) return pathstr fife_0.3.5/engine/python/fife/extensions/serializers/simplexml.py0000664000175100017510000002753312205217523024375 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### import os from StringIO import StringIO from fife.extensions.serializers import ET, SerializerError, InvalidFormat, NotFound EMPTY_XML_FILE="""\ """ class SimpleSerializer(object): """ Use this as a base class for custom setting loaders/savers to use with the Setting class. """ def __init__(self, filename=None): pass def get(self, module, name, defaultValue=None): pass def set(self, module, name, value, extra_attrs={}): pass def load(self, filename=None): """ @note: If the filename specified is empty this function MUST initialize an empty settings file in whatever format you need. """ pass def save(self, filename=None): pass def getModuleName(self): """ @note: Returns all the module names that are present in the settings.xml file as a list of strings """ pass def getAllSettings(self,module): """ @note: Returns all the setting names under the Module name module as a dictionary structure """ pass class SimpleXMLSerializer(SimpleSerializer): """ This class is a simple interface to get and store data in XML files. Usage:: from fife.extensions.serializers.simplexml import SimpleXMLSerializer serializer = SimpleXMLSerializer(filename="somefile.xml") serializer.set("module_name", "variable_name", "value") somevariable = serializer.get("module_name", "variable_name", "default_value") """ def __init__(self, filename=None): self._file = filename self._tree = None self._root_element = None self._initialized = False def load(self, filename=None): """ Loads the XML file into memory and validates it. Raises a SerializerError exception if the file is not specified. @param filename: The file to load @type filename: C{str} @note: If the file does not exist it will automatically create a blank file for you. """ if filename: self._file = filename if not self._file: raise SerializerError("Cannot load file or create file. No filename specified!") if not os.path.exists(self._file): self._tree = ET.parse(StringIO(EMPTY_XML_FILE)) self._tree.write(self._file, 'UTF-8') else: self._tree = ET.parse(self._file) self._root_element = self._tree.getroot() self._validateTree() def save(self, filename=None): """ Saves the XML file. @param filename: The file to save @type filename: C{str} @note: This Overwrites the file if it exists. """ if not self._initialized: self.load() self._initialized = True if filename: savefile = filename else: savefile = self._file if not savefile: raise SerializerError("Cannot save file. No filename specified!") """ Writes the settings to file """ self._indent(self._root_element) self._tree.write(savefile, 'UTF-8') def getValue(self, e_type, e_value): if e_type == 'int': return int(e_value) elif e_type == 'float': return float(e_value) elif e_type == 'bool': e_value = e_value.lower() if e_value == "" or e_value == "false" or e_value == "no" or e_value == "0": return False else: return True elif e_type == 'str' or e_type == 'string': return str(e_value) elif e_type == 'unicode': return unicode(e_value) elif e_type == 'list': return self._deserializeList(e_value) elif e_type == 'dict': return self._deserializeDict(e_value) def get(self, module, name, defaultValue=None): """ Gets the value of a specified variable @param module: Name of the module to get the variable from @param name: Variable name @param defaultValue: Specifies the default value to return if the variable is not found @type defaultValue: C{str} or C{unicode} or C{int} or C{float} or C{bool} or C{list} or C{dict} """ if not self._initialized: self.load() self._initialized = True if not isinstance(name, str) and not isinstance(name, unicode): raise AttributeError("SimpleXMLSerializer.get(): Invalid type for name argument.") #get the module tree: for example find tree under module FIFE moduleTree = self._getModuleTree(module) element = None for e in moduleTree.getchildren(): if e.tag == "Setting" and e.get("name", "") == name: element = e break else: return defaultValue e_value = element.text e_strip = element.get("strip", "1").strip().lower() e_type = str(element.get("type", "str")).strip() if e_value is None: return defaultValue # Strip value if e_strip == "" or e_strip == "false" or e_strip == "no" or e_strip == "0": e_strip = False else: e_strip = True if e_type == "str" or e_type == "unicode": if e_strip: e_value = e_value.strip() else: e_value = e_value.strip() # Return value e_value = self.getValue(e_type,e_value) return e_value def set(self, module, name, value, extra_attrs={}): """ Sets a variable to specified value. @param module: Module where the variable should be set @param name: Name of the variable @param value: Value to assign to the variable @type value: C{str} or C{unicode} or C{int} or C{float} or C{bool} or C{list} or C{dict} @param extra_attrs: Extra attributes to be stored in the XML-file @type extra_attrs: C{dict} """ if not self._initialized: self.load() self._initialized = True if not isinstance(name, str) and not isinstance(name, unicode): raise AttributeError("SimpleXMLSerializer.set(): Invalid type for name argument.") moduleTree = self._getModuleTree(module) e_type = "str" if isinstance(value, bool): # This must be before int e_type = "bool" value = str(value) elif isinstance(value, int): e_type = "int" value = str(value) elif isinstance(value, float): e_type = "float" value = str(value) elif isinstance(value, unicode): e_type = "unicode" value = unicode(value) elif isinstance(value, list): e_type = "list" value = self._serializeList(value) elif isinstance(value, dict): e_type = "dict" value = self._serializeDict(value) else: e_type = "str" value = str(value) for e in moduleTree.getchildren(): if e.tag != "Setting": continue if e.get("name", "") == name: e.text = value break else: attrs = {"name":name, "type":e_type} for k in extra_attrs: if k not in attrs: attrs[k] = extra_attrs[k] elm = ET.SubElement(moduleTree, "Setting", attrs) elm.text = value """ returns a list of string, where each string is a module name """ def getModuleName(self): self._moduleNames = [] for c in self._root_element.getchildren(): if c.tag == "Module": name = c.get("name","") if not isinstance(name, str) and not isinstance(name, unicode): raise AttributeError("SimpleXMLSerializer.get(): Invalid type for name argument.") self._moduleNames.append(name) return self._moduleNames def getAllSettings(self,module): self._settingsFromFile = {} # if file has not been loaded, load the file if not self._initialized: self.load() self._initialized = True # get the module tree, as we want to get values for module FIFE only moduleTree = self._getModuleTree(module) # now from the tree read every value, and put the necessary values # to the list for e in moduleTree.getchildren(): if e.tag == "Setting": name = e.get("name", "") # check the name if not isinstance(name, str) and not isinstance(name, unicode): raise AttributeError("SimpleXMLSerializer.get(): Invalid type for name argument.") element = e e_value = element.text e_strip = element.get("strip", "1").strip().lower() e_type = str(element.get("type", "str")).strip() # Strip value if e_strip == "" or e_strip == "false" or e_strip == "no" or e_strip == "0": e_strip = False else: e_strip = True if e_type == "str" or e_type == "unicode": if e_strip and e_value: e_value = e_value.strip() else: if e_value: e_value = e_value.strip() # get the value e_value = self.getValue(e_type,e_value) self._settingsFromFile[name] = e_value; return self._settingsFromFile def _validateTree(self): """ Iterates the XML tree and prints warning when an invalid tag is found. Raises an InvalidFormat exception if there is a format error. """ for c in self._root_element.getchildren(): if c.tag != "Module": raise InvalidFormat("Invalid tag in " + self._file + ". Expected Module, got: " + c.tag) elif c.get("name", "") == "": raise InvalidFormat("Invalid tag in " + self._file + ". Module name is empty.") else: for e in c.getchildren(): if e.tag != "Setting": raise InvalidFormat("Invalid tag in " + self._file + " in module: " + c.tag + ". Expected Setting, got: " + e.tag) elif c.get("name", "") == "": raise InvalidFormat("Invalid tag in " + self._file + " in module: " + c.tag + ". Setting name is empty" + e.tag) def _getModuleTree(self, module): """ Returns a module element from the XML tree. If no module with the specified name exists, a new element will be created. @param module: The module to get from the settings tree @type module: C{string} """ if not isinstance(module, str) and not isinstance(module, unicode): raise AttributeError("Settings:_getModuleTree: Invalid type for module argument.") for c in self._root_element.getchildren(): if c.tag == "Module" and c.get("name", "") == module: return c # Create module return ET.SubElement(self._root_element, "Module", {"name":module}) def _indent(self, elem, level=0): """ Adds whitespace, so the resulting XML-file is properly indented. Shamelessly stolen from http://effbot.org/zone/element-lib.htm """ i = os.linesep + level*" " if len(elem): if not elem.text or not elem.text.strip(): elem.text = i + " " if not elem.tail or not elem.tail.strip(): elem.tail = i for elem in elem: self._indent(elem, level+1) if not elem.tail or not elem.tail.strip(): elem.tail = i else: if level and (not elem.tail or not elem.tail.strip()): elem.tail = i # FIXME: # These serialization functions are not reliable at all # This will only serialize the first level of a dict or list # It will not check the types nor the content for conflicts. # Perhaps we should add a small serialization library? def _serializeList(self, list): """ Serializes a list, so it can be stored in a text file """ return " ; ".join(list) def _deserializeList(self, string): """ Deserializes a list back into a list object """ return string.split(" ; ") def _serializeDict(self, dict): """ Serializes a list, so it can be stored in a text file """ serial = "" for key in dict: value = dict[key] if serial != "": serial += " ; " serial += str(key)+" : "+str(value) return serial def _deserializeDict(self, serial): """ Deserializes a list back into a dict object """ dict = {} items = serial.split(" ; ") for i in items: kv_pair = i.split(" : ") dict[kv_pair[0]] = kv_pair[1] return dict fife_0.3.5/engine/python/fife/extensions/pychan/0000775000175100017510000000000012205217523020725 5ustar waynewaynefife_0.3.5/engine/python/fife/extensions/pychan/events.py0000664000175100017510000002510012205217523022601 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### """\ PyChan event handling (internal). ================================= Users shouldn't need to use this module directly. L{widgets.Widget.capture} and L{widgets.Widget.mapEvents} provide a convenient API to capture events. Nevertheless to understand how its supposed to work take a look at L{EventMapper} and L{EventListenerBase} Event callbacks --------------- You can either write callbacks yourself or use L{tools.callbackWithArguments} or L{tools.attrSetCallback} to generate suitable callbacks. Here's an example callback:: def dumpEventInfo(event=0,widget=0): print widget, " received the event ", event Note the signature - C{event} and C{widget} are keyword arguments passed to the callback. If doesn't accept either C{event} or C{widget} as argument, these are not passed. This way a simple function which ignores C{event} or C{widget} can be used, while they are available if needed. Currently only one callback can be set per event. In case you don't want to write your own callback that dispatches to different callbacks you can use L{tools.chainCallbacks}. Available Events ---------------- """ from compat import guichan import widgets import exceptions from internal import get_manager import tools import traceback import weakref from fife.extensions.fife_timer import Timer from fife.extensions.pychan.tools import callbackWithArguments as cbwa EVENTS = [ "mouseEntered", "mouseExited", "mousePressed", "mouseReleased", "mouseClicked", "mouseMoved", "mouseWheelMovedUp", "mouseWheelMovedDown", "mouseDragged", "action", "keyPressed", "keyReleased", ] # Add the EVENTS to the docs. __doc__ += "".join([" - %s\n" % event for event in EVENTS]) # The line before seems to leak the variable event into the global namespace ... remove that! # This is a python problem, addressed in python3 try: del event except:pass MOUSE_EVENT, KEY_EVENT, ACTION_EVENT = range(3) def getEventType(name): if "mouse" in name: return MOUSE_EVENT if "key" in name: return KEY_EVENT return ACTION_EVENT CALLBACK_NONE_MESSAGE = """\ You passed None as parameter to %s.capture, which would normally remove a mapped event. But there was no event mapped. Did you accidently call a function instead of passing it? """ class EventListenerBase(object): """ Redirector for event callbacks. Use *only* from L{EventMapper}. This class uses the SWIG director feature - overriden virtual methods are called from C++ to - listen to Guichan events. """ def __init__(self): super(EventListenerBase,self).__init__() self.events = {} self.indent = 0 self.debug = get_manager().debug self.is_attached = False self._timers = [] self._deadtimers = [] def attach(self,widget): """ Start receiving events. No need to call this manually. """ if self.is_attached: return if not self.events: return if self.debug: print "Attach:",self self.doAttach(widget.real_widget) self.widget_ref = weakref.ref(widget) self.is_attached = True def detach(self): """ Stop receiving events. No need to call this manually. """ if not self.is_attached: return if self.debug: print "Detach:",self self.is_attached = False def _redirectEvent(self,name,event): self.indent += 4 try: event = self.translateEvent(getEventType(name), event) if name in self.events: if self.debug: print "-"*self.indent, name for f in self.events[name].itervalues(): def delayed_f(timer, f=f): # bind f during loop n_timer = timer() f( event ) #FIXME: figure out a way to get rid of the dead timer list del self._deadtimers[:] if n_timer in self._timers: self._deadtimers.append(n_timer) self._timers.remove(n_timer) timer = Timer(repeat=1) timer._callback = cbwa(delayed_f, weakref.ref(timer)) timer.start() self._timers.append(timer) except: print name, repr(event) traceback.print_exc() raise finally: self.indent -= 4 def translateEvent(self,event_type,event): if event_type == MOUSE_EVENT: return get_manager().hook.translate_mouse_event(event) if event_type == KEY_EVENT: return get_manager().hook.translate_key_event(event) return event class _ActionEventListener(EventListenerBase,guichan.ActionListener): def __init__(self):super(_ActionEventListener,self).__init__() def doAttach(self,real_widget): real_widget.addActionListener(self) def doDetach(self,real_widget): real_widget.removeActionListener(self) def action(self,e): self._redirectEvent("action",e) class _MouseEventListener(EventListenerBase,guichan.MouseListener): def __init__(self):super(_MouseEventListener,self).__init__() def doAttach(self,real_widget): real_widget.addMouseListener(self) def doDetach(self,real_widget): real_widget.removeMouseListener(self) def mouseEntered(self,e): self._redirectEvent("mouseEntered",e) def mouseExited(self,e): self._redirectEvent("mouseExited",e) def mousePressed(self,e): self._redirectEvent("mousePressed",e) def mouseReleased(self,e): self._redirectEvent("mouseReleased",e) def mouseClicked(self,e): self._redirectEvent("mouseClicked",e) def mouseMoved(self,e): self._redirectEvent("mouseMoved",e) def mouseWheelMovedUp(self,e): self._redirectEvent("mouseWheelMovedUp",e) def mouseWheelMovedDown(self,e): self._redirectEvent("mouseWheelMovedDown",e) def mouseDragged(self,e): self._redirectEvent("mouseDragged",e) class _KeyEventListener(EventListenerBase,guichan.KeyListener): def __init__(self):super(_KeyEventListener,self).__init__() def doAttach(self,real_widget): real_widget.addKeyListener(self) def doDetach(self,real_widget): real_widget.removeKeyListener(self) def keyPressed(self,e): self._redirectEvent("keyPressed",e) def keyReleased(self,e): self._redirectEvent("keyReleased",e) class EventMapper(object): """ Handles events and callbacks for L{widgets.Widget} and derived classes. Every PyChan widget has an L{EventMapper} instance as attribute B{event_mapper}. This instance handles all necessary house-keeping. Such an event mapper can be either C{attached} or C{detached}. In its attached state an L{EventListenerBase} is added to the Guichan widget and will redirect the events to the callbacks. In its detached state no events are received from the real Guichan widget. The event mapper starts in the detached state. When a new event is captured the mapper attaches itself automatically. The widget doesn't need to handle that. """ def __init__(self,widget): super(EventMapper,self).__init__() self.widget_ref = weakref.ref(widget) self.callbacks = {} self.listener = { KEY_EVENT : _KeyEventListener(), ACTION_EVENT : _ActionEventListener(), MOUSE_EVENT : _MouseEventListener(), } self.is_attached = False self.debug = get_manager().debug def __repr__(self): return "EventMapper(%s)" % repr(self.widget_ref()) def attach(self): for listener in self.listener.values(): listener.attach() def detach(self): for listener in self.listener.values(): listener.detach() def capture(self,event_name,callback,group_name): if event_name not in EVENTS: raise exceptions.RuntimeError("Unknown eventname: " + event_name) if callback is None: if self.isCaptured(event_name,group_name): self.removeEvent(event_name,group_name) elif self.debug: print CALLBACK_NONE_MESSAGE % str(self.widget_ref()) return self.addEvent(event_name,callback,group_name) def isCaptured(self,event_name,group_name="default"): return ("%s/%s" % (event_name,group_name)) in self.getCapturedEvents() def getCapturedEvents(self): events = [] for event_type, listener in self.listener.items(): for event_name, group in listener.events.items(): for group_name in group.keys(): events.append( "%s/%s" % (event_name, group_name) ) return events def getListener(self,event_name): return self.listener[getEventType(event_name)] def removeEvent(self,event_name,group_name): listener = self.getListener(event_name) del listener.events[event_name][group_name] if not listener.events[event_name]: del listener.events[event_name] if not listener.events: listener.detach() del self.callbacks[group_name][event_name] if len(self.callbacks[group_name]) <= 0: del self.callbacks[group_name] def addEvent(self,event_name,callback,group_name): if not callable(callback): raise RuntimeError("An event callback must be either a callable or None - not %s" % repr(callback)) # The closure self needs to keep a weak ref. # Otherwise the GC has problems. self_ref = weakref.ref(self) # Set up callback dictionary. This should fix some GC issues if group_name not in self.callbacks: self.callbacks[group_name] = {} if event_name not in self.callbacks[group_name]: self.callbacks[group_name][event_name] = {} self.callbacks[group_name][event_name] = callback def captured_f(event): if self_ref() is not None: tools.applyOnlySuitable(self_ref().callbacks[group_name][event_name],event=event,widget=self_ref().widget_ref()) listener = self.getListener(event_name) if event_name not in listener.events: listener.events[event_name] = {group_name : captured_f} else: listener.events[event_name][group_name] = captured_f listener.attach(self.widget_ref()) def splitEventDescriptor(name): """ Utility function to split "widgetName/eventName" descriptions into tuples. """ L = name.split("/") if len(L) not in (1,2,3): raise exceptions.RuntimeError("Invalid widgetname / eventname combination: " + name) if len(L) == 1: L = L[0],"action" elif L[1] not in EVENTS: raise exceptions.RuntimeError("Unknown event name: " + name) if len(L) == 2: L = L[0],L[1],"default" return L fife_0.3.5/engine/python/fife/extensions/pychan/widgets/0000775000175100017510000000000012205217523022373 5ustar waynewaynefife_0.3.5/engine/python/fife/extensions/pychan/widgets/label.py0000664000175100017510000000772312205217523024035 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from common import * from basictextwidget import BasicTextWidget class Label(BasicTextWidget): """ A basic label - displaying a string. Also allows text wrapping and onMouse hover callbacks. New Attributes ============== - wrap_text: Boolean: Enable/Disable automatic text wrapping. Disabled by default. Currently to actually see text wrapping you have to explicitly set a max_size with the desired width of the text, as the layout engine is not capable of deriving the maximum width from a parent container. """ ATTRIBUTES = BasicTextWidget.ATTRIBUTES + [ BoolAttr('wrap_text') ] DEFAULT_WRAP_TEXT = False def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, margins = None, text = None, wrap_text = None): self.real_widget = fife.Label("") self.wrap_text = self.DEFAULT_WRAP_TEXT super(Label,self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand, font=font, base_color=base_color, background_color=background_color, foreground_color=foreground_color, selection_color=selection_color, border_size=border_size, position_technique=position_technique, is_focusable=is_focusable, comment=comment, margins=margins, text=text) if wrap_text is not None: self.wrap_text = wrap_text def clone(self, prefix): lblClone = Label(None, self._createNameWithPrefix(prefix), self.size, self.min_size, self.max_size, self.helptext, self.position, self.style, self.hexpand, self.vexpand, self.font, self.base_color, self.background_color, self.foreground_color, self.selection_color, self.border_size, self.position_technique, self.is_focusable, self.comment, self.margins, self.text, self.wrap_text) return lblClone; def resizeToContent(self, recurse=True): self.real_widget.setWidth( self.max_size[0] ) self.real_widget.adjustSize() self.height = self.real_widget.getHeight() + self.margins[1]*2 self.width = self.real_widget.getWidth() + self.margins[0]*2 #print self.width,self.max_size[0] def _setTextWrapping(self,wrapping): self.real_widget.setTextWrapping(wrapping) def _getTextWrapping(self): self.real_widget.isTextWrapping() wrap_text = property(_getTextWrapping,_setTextWrapping) fife_0.3.5/engine/python/fife/extensions/pychan/widgets/dropdown.py0000664000175100017510000001246012205217523024604 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from common import * from widget import Widget from listbox import GenericListmodel class DropDown(Widget): """ A dropdown or combo box widget for selecting lists of strings. New Attributes ============== - items: A List of strings. This can be treated like an ordinary python list. but only strings are allowed. - selected: The index of the selected item in the list. Starting from C{0} to C{len(items)-1}. A negative value indicates, that no item is selected. - selected_item: The selected string itself, or C{None} - if no string is selected. Data ==== The selected attribute can be read and set via L{distributeData} and L{collectData}. The list items can be set via L{distributeInitialData}. """ DEFAULT_ITEMS = [] def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, items = None, selected = None): if items is None: self._items = GenericListmodel(*self.DEFAULT_ITEMS) else: if type(items) is list: self._items = GenericListmodel(*items) else: raise RuntimeError("items parameter must be a list!") if selected is not None and items is not None: if len(items) > 0 and selected < len(items) and selected > 0: self.selected = selected else: raise RuntimeError("Invalid selected item index specified for dropdown!") elif selected is None and items is not None: if len(items) > 0: self.selected = 0 self.real_widget = fife.DropDown(self._items) super(DropDown,self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand, font=font, base_color=base_color, background_color=background_color, foreground_color=foreground_color, selection_color=selection_color, border_size=border_size, position_technique=position_technique, is_focusable=is_focusable, comment=comment) # Prepare Data collection framework self.accepts_initial_data = True self._realSetInitialData = self._setItems self.accepts_data = True self._realSetData = self._setSelected self._realGetData = self._getSelected def clone(self, prefix): itemsList = [] for i in range(self.items.getNumberOfElements()): itemsList.append(self.items.getElementAt(i)) dropdownClone = DropDown(None, self._createNameWithPrefix(prefix), self.size, self.min_size, self.max_size, self.helptext, self.position, self.style, self.hexpand, self.vexpand, self.font, self.base_color, self.background_color, self.foreground_color, self.selection_color, self.border_size, self.position_technique, self.is_focusable, self.comment, itemsList, self.selected) return dropdownClone def resizeToContent(self,recurse=True): # We append a minimum value, so max() does not bail out, # if no items are in the list _item_widths = map(self.real_font.getWidth, map(text2gui, map(unicode, self._items))) + [self.real_font.getHeight()] max_w = max(_item_widths) self.width = max_w self.height = (self.real_font.getHeight() + 2) def _getItems(self): return self._items def _setItems(self,items): # Note we cannot use real_widget.setListModel # for some reason ??? # Also self assignment can kill you if id(items) != id(self._items): self._items.clear() self._items.extend(items) items = property(_getItems,_setItems) def _getSelected(self): return self.real_widget.getSelected() def _setSelected(self,index): self.real_widget.setSelected(index) selected = property(_getSelected,_setSelected) def _getSelectedItem(self): if 0 <= self.selected < len(self._items): return self._items[self.selected] return None selected_item = property(_getSelectedItem) fife_0.3.5/engine/python/fife/extensions/pychan/widgets/widget.py0000664000175100017510000007335412205217523024244 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from fife.extensions.pychan.widgets.common import * class Widget(object): """ This is the common widget base class, which provides most of the wrapping functionality. Attributes ========== Widgets are manipulated (mostly) through attributes - and these can all be set by XML attributes. Derived widgets will have other attributes. Please see their B{New Attributes} sections. The types of the attributes are pretty straightforward, but note that Position and Color attribute types will also accept C{fife.Point} and C{fife.Color} values. - name: String: The identification of the widget, most useful if it is unique within a given widget hiarachy. This is used to find widgets by L{mapEvents},L{distributeInitialData},L{distributeData} and L{collectData}. - position: Position: The position relative to the parent widget - or on screen, if this is the root widget. - size: Position: The real size of the widget (including border and margins). Usually you do not need to set this. A notable exception is the L{ScrollArea}. - min_size: Position: The minimal size this widget is allowed to have. This is enforced through the accessor methods of the actual size attribute. - max_size: Position: The maximal size this widget is allowed to have. This is enforced through the accessor methods of the actual size attribute. - base_color: Color - background_color: Color - foreground_color: Color - selection_color: Color - font: String: This should identify a font that was loaded via L{loadFonts} before. - helptext: Unicode: Text which can be used for e.g. tooltips. - comment: Unicode: Additional text stored by the widget. Not used by PyChan directly. Can be used by the client for additional info about the widget. - border_size: Integer: The size of the border in pixels. - position_technique: This can be either "automatic" or "explicit" - only L{Window} has this set to "automatic" which results in new windows being centered on screen (for now). If it is set to "explicit" the position attribute will not be touched. - vexpand: Integer: >= 0. Proportion to expand this widget vertically. - hexpand: Integer: >= 0. Proportion to expand this widget horizontally. Convenience Attributes ====================== These attributes are convenience/shorthand versions of above mentioned attributes and assignment will reflect the associated attributes values. E.g. the following is equivalent:: # Set X position, leave Y alone widget.x = 10 # Same here posi = widget.position widget.position = (10, posi[1]) Here they are. - x: Integer: The horizontal part of the position attribute. - y: Integer: The vertical part of the position attribute. - width: Integer: The horizontal part of the size attribute. - height: Integer: The vertical part of the size attribute. """ ATTRIBUTES = [ Attr('name'), PointAttr('position'), PointAttr('min_size'), PointAttr('size'), PointAttr('max_size'), ColorAttr('base_color'), ColorAttr('background_color'), ColorAttr('foreground_color'), ColorAttr('selection_color'), Attr('style'), Attr('font'), IntAttr('border_size'), Attr('position_technique'), IntAttr('vexpand'), IntAttr('hexpand'), UnicodeAttr('helptext'), BoolAttr('is_focusable'), UnicodeAttr('comment') ] DEFAULT_NAME = '__unnamed__' DEFAULT_HEXPAND = 0 DEFAULT_VEXPAND = 0 DEFAULT_MAX_SIZE = 500000, 500000 DEFAULT_SIZE = -1, -1 DEFAULT_MIN_SIZE = 0, 0 DEFAULT_HELPTEXT = u"" DEFAULT_POSITION = 0, 0 DEFAULT_FONT = "default" DEFAULT_BORDER_SIZE = 0 DEFAULT_POSITION_TECHNIQUE = "explicit" DEFAULT_COMMENT = u"" HIDE_SHOW_ERROR = """\ You can only show/hide the top widget of a hierachy. Use 'addChild' or 'removeChild' to add/remove labels for example. """ def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None): # Make sure the real_widget has been created assert( hasattr(self,'real_widget') ) self.event_mapper = events.EventMapper(self) self._visible = False self._extra_border = (0,0) # Data distribution & retrieval settings self.accepts_data = False self.accepts_initial_data = False #set all defaults if get_manager().compat_layout: self.hexpand, self.vexpand = 0,0 else: self.hexpand = self.DEFAULT_HEXPAND self.vexpand = self.DEFAULT_VEXPAND self.name = self.DEFAULT_NAME self.has_name = False self.position = self.DEFAULT_POSITION self.position_technique = self.DEFAULT_POSITION_TECHNIQUE self.font = self.DEFAULT_FONT self.min_size = self.DEFAULT_MIN_SIZE self.max_size = self.DEFAULT_MAX_SIZE self.size = self.DEFAULT_SIZE self.border_size = self.DEFAULT_BORDER_SIZE self.helptext = self.DEFAULT_HELPTEXT self.comment = self.DEFAULT_COMMENT self._usedPrefixes = [] # Parent attribute makes sure we only have one parent, # that tests self.__parent - so make sure we have the attr here. self.__parent = None self.parent = parent # Inherit and apply style if style is None and parent: style = parent.style self.style = style or "default" # override everything style has set if vexpand is not None: self.vexpand = vexpand if hexpand is not None: self.hexpand = hexpand if name is not None: self.name = name self.has_name = True if position is not None: self.position = position if position_technique is not None: self.position_technique = position_technique if font is not None: self.font = font # only set this if it's provided if is_focusable is not None: self.is_focusable = is_focusable if min_size is not None: self.min_size = min_size if max_size is not None: self.max_size = max_size if size is not None: self.size = size if border_size is not None: self.border_size = border_size if helptext is not None: self.helptext = helptext if comment is not None: self.comment = comment # these are set in the default style #if base_color is not None: self.base_color = base_color if background_color is not None: self.background_color = background_color if foreground_color is not None: self.foreground_color = foreground_color if selection_color is not None: self.selection_color = selection_color def clone(self, prefix): """ Clones this widget. Concrete widgets should implement this one, if not, an exception should be raised. Prefix is used to create the name of the cloned widget. """ raise RuntimeError("No implementation of clone method for %s" % self.__class__) def execute(self, bind, focus=None): """ Execute a dialog synchronously. As argument a dictionary mapping widget names to return values is expected. Events from these widgets will cause this function to return with the associated return value. This function will not return until such an event occurs. The widget will be shown before execution and hidden afterwards. You can only execute root widgets. @param focus: name of child widget which should have focus. Defaults to main widget. Note: This feature is not tested well, and the API will probably change. Otherwise have fun:: # Okay this a very condensed example :-) return pychan.loadXML("contents/gui/dialog.xml").execute({ 'okButton' : True, 'closeButton' : False }) """ if not get_manager().can_execute: raise RuntimeError("Synchronous execution is not set up!") if self.__parent: raise RuntimeError("You can only 'execute' root widgets, not %s!" % str(self)) for name,returnValue in bind.items(): def _quitThisDialog(returnValue = returnValue ): get_manager().breakFromMainLoop( returnValue ) self.hide() self.findChild(name=name).capture( _quitThisDialog , group_name = "__execute__" ) self.show() if focus and self.findChild(name=focus): self.findChild(name=focus).is_focusable = True self.findChild(name=focus).requestFocus() else: self.is_focusable = True self.requestFocus() return get_manager().mainLoop() def requestFocus(self): """ Requests focus. The widget must be focusable in order for this to work. See the is_focusable property. """ if self.isVisible(): self.real_widget.requestFocus() def match(self,**kwargs): """ Matches the widget against a list of key-value pairs. Only if all keys are attributes and their value is the same it returns True. """ for k,v in kwargs.items(): if v != getattr(self,k,None): return False return True def capture(self, callback, event_name="action", group_name="default"): """ Add a callback to be executed when the widget event occurs on this widget. The callback must be either a callable or None. The old event handler (if any) will be overridden by the callback. If None is given, the event will be disabled. You can query L{isCaptured} wether this widgets events are currently captured. It might be useful to check out L{tools.callbackWithArguments}. @param callback: Event callback - may accept keyword arguments event and widget. @param event_name: The event to capture - may be one of L{events.EVENTS} and defaults to "action" @param group_name: Event group. Event groups are used to have different B{channels} which don't interfere with each other. For derived widgets that need to capture events it's advised to use the group_name 'widget'. The 'default' group is used by default, and should be reserved for the application programmers. """ self.event_mapper.capture( event_name, callback, group_name ) def isCaptured(self): """ Check whether this widgets events are captured (a callback is installed) or not. """ return bool(self.event_mapper.getCapturedEvents()) def show(self): """ Show the widget and all contained widgets. """ if self._visible: return if self.parent: self.beforeShow() self.parent.showChild(self) self.parent.adaptLayout() self._visible = True else: self.adaptLayout() self.beforeShow() get_manager().show(self) self._visible = True def _show(widget): widget._visible = True self.deepApply(_show, shown_only=True) def hide(self): """ Hide the widget and all contained widgets. """ if not self._visible: return if self.parent: self.parent.hideChild(self) self.parent.adaptLayout() else: get_manager().hide(self) self.afterHide() self._visible = False def _hide(widget): widget._visible = False self.deepApply(_hide, shown_only=True) def isVisible(self): """ Check whether the widget is currently shown, either directly or as part of a container widget. """ return self._visible def adaptLayout(self,recurse=True): """ Execute the Layout engine. Automatically called by L{show}. In case you want to relayout a visible widget. This function will automatically perform the layout adaption from the top-most layouted widget. To make this clear consider this arrangement:: VBox 1 - Container - VBox 2 - HBox - Label If you call adaptLayout on the Label the layout from the VBox 2 will get recalculated, while the VBox 1 stays untouched. @param recurse: Pass False here to force the layout to start from this widget. """ widget = self while widget.parent and recurse: if not isLayouted(widget.parent): break widget = widget.parent widget._recursiveResizeToContent() widget._recursiveExpandContent() def beforeShow(self): """ This method is called just before the widget is shown. You can override this in derived widgets to add finalization behaviour. NOTE: - if your widget is a container, you have to call _resetTiling(), as you will loose this call by using your override method """ def afterHide(self): """ This method is called just before the widget is hidden. You can override this in derived widgets to add finalization behaviour. """ def findChildren(self,**kwargs): """ Find all contained child widgets by attribute values. Usage:: closeButtons = root_widget.findChildren(name='close') buttons = root_widget.findChildren(__class__=pychan.widgets.Button) """ children = [] def _childCollector(widget): if widget.match(**kwargs): children.append(widget) self.deepApply(_childCollector) return children def getNamedChildren(self, include_unnamed = False): """ Create a dictionary of child widgets with the keys being their name. This will contain only Widgets which have a name different from "__unnamed__" (which is the default). @param include_unnamed: Defaults to false. If this is true unnamed widgets are added, too. The values are lists of widgets, so not only unique names are handled correctly. Usage:: children = widget.getNamedChildren() for widget in children.get("info",[]) print widget.name , " == info" """ children = {} if include_unnamed: def _childCollector(widget): children.setdefault(widget._name,[]).append(widget) else: def _childCollector(widget): if widget.has_name: children.setdefault(widget._name,[]).append(widget) self.deepApply(_childCollector) return children def findChild(self,**kwargs): """ Find the first contained child widgets by attribute values. Usage:: closeButton = root_widget.findChild(name='close') """ if kwargs.keys() == ["name"]: return self.findChildByName(kwargs["name"]) children = self.findChildren(**kwargs) if children: return children[0] return None def findChildByName(self,name): """ Find first contained child widget by its name. Note that this is the fast version of findChild(name="...") and that you don't have to call this explicitly, it is used if possible. """ result = [] def _childCollector(widget): if widget._name == name: result.append(widget) raise StopTreeWalking try: self.deepApply(_childCollector) except StopTreeWalking: return result[0] return None def addChild(self,widget): """ This function adds a widget as child widget and is only implemented in container widgets. You'll need to call L{adaptLayout} if the container is already shown, to adapt the layout to the new widget. This doesn't happen automatically. """ raise RuntimeError("Trying to add a widget to %s, which doesn't allow this." % repr(self)) def insertChild(self, widget, position): """ This function inserts a widget a given index in the child list. See L{addChild} and L{insertChildBefore} """ raise RuntimeError("Trying to insert a widget to %s, which doesn't allow this." % repr(self)) def insertChildBefore(self, widget, before): """ Inserts a child widget before a given widget. If the widget isn't found, the widget is appended to the children list. See L{addChild} and L{insertChild} """ raise RuntimeError("Trying to insert a widget to %s, which doesn't allow this." % repr(self)) def addChildren(self,*widgets): """ Add multiple widgets as children. Only implemented for container widgets. See also L{addChild} Usage:: container.addChildren( widget1, widget2, ... ) # or you can use this on a list container.addChildren( [widget1,widget2,...] ) """ if len(widgets) == 1 and not isinstance(widgets[0],Widget): widgets = widgets[0] for widget in widgets: self.addChild(widget) def removeChild(self,widget): """ This function removes a direct child widget and is only implemented in container widgets. You'll need to call L{adaptLayout} if the container is already shown, to adapt the layout to the removed widget. This doesn't happen automatically. """ raise RuntimeError("Trying to remove a widget from %s, which is not a container widget." % repr(self)) def removeChildren(self,*widgets): """ Remove a list of direct child widgets. All widgets have to be direct child widgets. To 'clear' a container take a look at L{removeAllChildren}. See also L{removeChild}. Usage:: container.removeChildren( widget1, widget2, ... ) # or you can use this on a list container.removeChildren( [widget1,widget2,...] ) """ if len(widgets) == 1 and not isinstance(widgets[0],Widget): widgets = widgets[0] for widget in widgets: self.removeChild(widget) def removeAllChildren(self): """ This function will remove all direct child widgets. This will work even for non-container widgets. """ children = self.findChildren(parent=self) for widget in children: self.removeChild(widget) def mapEvents(self,eventMap,ignoreMissing = False): """ Convenience function to map widget events to functions in a batch. Subsequent calls of mapEvents will merge events with different widget names and override the previously set callback. You can also pass C{None} instead of a callback, which will disable the event completely. @param eventMap: A dictionary with widget/event names as keys and callbacks as values. @param ignoreMissing: Normally this method raises an RuntimeError, when a widget can not be found - this behaviour can be overriden by passing True here. The keys in the dictionary are parsed as C{"widgetName/eventName"} with the slash separating the two. If no slash is found the eventName is assumed to be "action". Additionally you can supply a group name or channel C{"widgetName/eventName/groupName"}. Event handlers from one group are not overridden by handlers from another group. The default group name is C{"default"}. Example:: guiElement.mapEvents({ "button" : guiElement.hide, "button/mouseEntered" : toggleButtonColorGreen, "button/mouseExited" : toggleButtonColorBlue, }) """ children = self.getNamedChildren(include_unnamed=True) for descr,func in eventMap.items(): name, event_name, group_name = events.splitEventDescriptor(descr) #print name, event_name, group_name widgets = children.get(name,[]) if widgets: for widget in widgets: widget.capture( func, event_name = event_name, group_name = group_name ) elif not ignoreMissing: raise RuntimeError("No widget with the name: %s" % name) def setInitialData(self,data): """ Set the initial data on a widget, what this means depends on the Widget. In case the widget does not accept initial data, a L{RuntimeError} is thrown. """ if not self.accepts_initial_data: raise RuntimeError("Trying to set data on a widget that does not accept initial data. Widget: %s Data: %s " % (repr(self),repr(data))) self._realSetInitialData(data) def setData(self,data): """ Set the user-mutable data on a widget, what this means depends on the Widget. In case the widget does not accept data, a L{RuntimeError} is thrown. This is inverse to L{getData}. """ if not self.accepts_data: raise RuntimeError("Trying to set data on a widget that does not accept data.") self._realSetData(data) def getData(self): """ Get the user-mutable data of a widget, what this means depends on the Widget. In case the widget does not have user mutable data, a L{RuntimeError} is thrown. This is inverse to L{setData}. """ if not self.accepts_data: raise RuntimeError("Trying to retrieve data from a widget that does not accept data.") return self._realGetData() def distributeInitialData(self,initialDataMap): """ Distribute B{initial} (not mutable by the user) data from a dictionary over the widgets in the hierachy using the keys as names and the values as the data (which is set via L{setInitialData}). If more than one widget matches - the data is set on ALL matching widgets. By default a missing widget is just ignored. Use it like this:: guiElement.distributeInitialData({ 'myTextField' : 'Hello World!', 'myListBox' : ["1","2","3"] }) """ children = self.getNamedChildren(include_unnamed=True) for name,data in initialDataMap.items(): widgetList = children.get(name,[]) for widget in widgetList: widget.setInitialData(data) def distributeData(self,dataMap): """ Distribute data from a dictionary over the widgets in the hierachy using the keys as names and the values as the data (which is set via L{setData}). This will only accept unique matches. Use it like this:: guiElement.distributeData({ 'myTextField' : 'Hello World!', 'myListBox' : ["1","2","3"] }) """ children = self.getNamedChildren(include_unnamed=True) for name,data in dataMap.items(): widgetList = children.get(name,[]) if len(widgetList) != 1: if get_manager().debug: self.listNamedWidgets() raise RuntimeError("DistributeData can only handle widgets with unique names.") widgetList[0].setData(data) def collectDataAsDict(self,widgetNames): """ Collect data from a widget hierachy by names into a dictionary. This can only handle UNIQUE widget names (in the hierachy) and will raise a RuntimeError if the number of matching widgets is not equal to one. Usage:: data = guiElement.collectDataAsDict(['myTextField','myListBox']) print "You entered:",data['myTextField']," and selected ",data['myListBox'] """ children = self.getNamedChildren(include_unnamed=True) dataMap = {} for name in widgetNames: widgetList = children.get(name,[]) if len(widgetList) != 1: if get_manager().debug: self.listNamedWidgets() raise RuntimeError("CollectData can only handle widgets with unique names.") dataMap[name] = widgetList[0].getData() return dataMap def collectData(self,*widgetNames): """ Collect data from a widget hierachy by names. This can only handle UNIQUE widget names (in the hierachy) and will raise a RuntimeError if the number of matching widgets is not equal to one. This function takes an arbitrary number of widget names and returns a list of the collected data in the same order. In case only one argument is given, it will return just the data, with out putting it into a list. Usage:: # Multiple element extraction: text, selected = guiElement.collectData('myTextField','myListBox') print "You entered:",text," and selected item nr",selected # Single elements are handled gracefully, too: test = guiElement.collectData('testElement') """ children = self.getNamedChildren(include_unnamed=True) dataList = [] for name in widgetNames: widgetList = children.get(name,[]) if len(widgetList) != 1: if get_manager().debug: self.listNamedWidgets() raise RuntimeError("CollectData can only handle widgets with unique names.") dataList.append( widgetList[0].getData() ) if len(dataList) == 1: return dataList[0] return dataList def listNamedWidgets(self): """ This function will print a list of all currently named child-widgets to the standard output. This is useful for debugging purposes. """ def _printNamedWidget(widget): if widget.name != Widget.DEFAULT_NAME: print widget.name.ljust(20),repr(widget).ljust(50),repr(widget.__parent) print "Named child widgets of ",repr(self) print "name".ljust(20),"widget".ljust(50),"parent" self.deepApply(_printNamedWidget) def stylize(self,style,**kwargs): """ Recursively apply a style to all widgets. """ def _restyle(widget): get_manager().stylize(widget,style,**kwargs) self.deepApply(_restyle) def resizeToContent(self,recurse = True): """ Try to shrink the widget, so that it fits closely around its content. Do not call directly. """ def expandContent(self,recurse = True): """ Try to expand any spacer in the widget within the current size. Do not call directly. """ def _recursiveResizeToContent(self): """ Recursively call L{resizeToContent}. Uses L{deepApply}. Do not call directly. """ def _callResizeToContent(widget): #print "RTC:",widget widget.resizeToContent() self.deepApply(_callResizeToContent, shown_only = True) def _recursiveExpandContent(self): """ Recursively call L{expandContent}. Uses L{deepApply}. Do not call directly. """ def _callExpandContent(widget): #print "ETC:",widget widget.expandContent() self.deepApply(_callExpandContent, leaves_first=False, shown_only = True) def deepApply(self,visitorFunc, leaves_first = True, shown_only = False): """ Recursively apply a callable to all contained widgets and then the widget itself. """ visitorFunc(self) def getAbsolutePos(self): """ Get absolute position on screen """ absX = self.x absY = self.y parent = self.parent while parent is not None: absX += parent.x absY += parent.y parent = parent.parent return (absX, absY) def sizeChanged(self): pass def __str__(self): return "%s(name='%s')" % (self.__class__.__name__,self.name) def __repr__(self): return "<%s(name='%s') at %x>" % (self.__class__.__name__,self.name,id(self)) def _setSize(self,size): if isinstance(size,fife.Point): self.width, self.height = size.x, size.y else: self.width, self.height = size def _getSize(self): return self.width, self.height def _setPosition(self,size): if isinstance(size,fife.Point): self.x, self.y = size.x, size.y else: self.x, self.y = size def _getPosition(self): return self.x, self.y def _setX(self,x):self.real_widget.setX(x) def _getX(self): return self.real_widget.getX() def _setY(self,y): self.real_widget.setY(y) def _getY(self): return self.real_widget.getY() def _setWidth(self,w): old_width = self.width w = max(self.min_size[0],w) w = min(self.max_size[0],w) self.real_widget.setWidth(w) if w != old_width: self.sizeChanged() def _getWidth(self): return self.real_widget.getWidth() def _setHeight(self,h): old_height = self.height h = max(self.min_size[1],h) h = min(self.max_size[1],h) self.real_widget.setHeight(h) if h != old_height: self.sizeChanged() def _getHeight(self): return self.real_widget.getHeight() def _getMinWidth(self): return self.min_size[0] def _getMaxWidth(self): return self.max_size[0] def _getMinHeight(self): return self.min_size[1] def _getMaxHeight(self): return self.max_size[1] def _setMinWidth(self,w): self.min_size = w, self.min_size[1] def _setMaxWidth(self,w): self.max_size = w, self.max_size[1] def _setMinHeight(self,h): self.min_size = self.min_size[0],h def _setMaxHeight(self,h): self.max_size = self.max_size[0],h def _setFont(self, font): self._font = font self.real_font = get_manager().getFont(font) self.real_widget.setFont(self.real_font) def _getFont(self): return self._font def _getBorderSize(self): return self.real_widget.getFrameSize() def _setBorderSize(self,size): self.real_widget.setFrameSize(size) base_color = ColorProperty("BaseColor") background_color = ColorProperty("BackgroundColor") foreground_color = ColorProperty("ForegroundColor") selection_color = ColorProperty("SelectionColor") def _getStyle(self): return self._style def _setStyle(self,style): self._style = style get_manager().stylize(self,style) style = property(_getStyle,_setStyle) def _getParent(self): return self.__parent def _setParent(self,parent): if parent and not issubclass(type(parent), Widget): raise RuntimeError("Parent must be subclass of the Widget type.") if self.__parent is not parent: if self.__parent and parent is not None: print "Widget containment fumble:", self, self.__parent, parent self.__parent.removeChild(self) self.__parent = parent parent = property(_getParent,_setParent) def _setName(self,name): self._name = name if name != Widget.DEFAULT_NAME: self.has_name = True def _getName(self): # __str__ relies on self.name return getattr(self,'_name','__no_name_yet__') name = property(_getName,_setName) def _setFocusable(self, b): self.real_widget.setFocusable(b) def _isFocusable(self): return self.real_widget.isFocusable() def _createNameWithPrefix(self, prefix): if not isinstance(prefix, str): raise RuntimeError("Widget names should be prefixed with a string") if prefix in self._usedPrefixes: raise RuntimeError("Widget %s already cloned with prefix %s" % (self.name, prefix)) if len(prefix) == 0: raise RuntimeError("New widget name cannot be created with an empty prefix") self._usedPrefixes.append(prefix) return prefix + self.name x = property(_getX,_setX) y = property(_getY,_setY) width = property(_getWidth,_setWidth) height = property(_getHeight,_setHeight) min_width = property(_getMinWidth,_setMinWidth) min_height = property(_getMinHeight,_setMinHeight) max_width = property(_getMaxWidth,_setMaxWidth) max_height = property(_getMaxHeight,_setMaxHeight) size = property(_getSize,_setSize) position = property(_getPosition,_setPosition) font = property(_getFont,_setFont) border_size = property(_getBorderSize,_setBorderSize) is_focusable = property(_isFocusable,_setFocusable) fife_0.3.5/engine/python/fife/extensions/pychan/widgets/slider.py0000664000175100017510000001537412205217523024241 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from common import * from widget import Widget class Slider(Widget): """ A slider widget Use a callback to read out the slider value every time the marker is moved. New Attributes ============== - orientation: 1 = horizontal, 0=vertical - scale_start: float: default 0.0 - scale_end: float: default 1.0 - step_length: float: default scale_end/10 - marker_length: int: default 10 FIXME: - update docstrings """ HORIZONTAL = fife.Slider.HORIZONTAL VERTICAL = fife.Slider.VERTICAL ATTRIBUTES = Widget.ATTRIBUTES + [ IntAttr('orientation'), FloatAttr('scale_start'), FloatAttr('scale_end'), FloatAttr('step_length'), IntAttr('marker_length') ] DEFAULT_HEXPAND = 1 DEFAULT_VEXPAND = 0 DEFAULT_SIZE = 10,10 DEFAULT_MIN_SIZE = 10,10 DEFAULT_SCALE_START = 0.0 DEFAULT_SCALE_END = 1.0 DEFAULT_STEP_LENGTH = 0.1 DEFAULT_MARKER_LENGTH = 10 DEFAULT_ORIENTATION = HORIZONTAL def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, scale_start = None, scale_end = None, step_length = None, marker_length = None, orientation = None): self.real_widget = fife.Slider(scale_start or self.DEFAULT_SCALE_START, scale_end or self.DEFAULT_SCALE_END) self.orientation = self.DEFAULT_ORIENTATION self.step_length = self.DEFAULT_STEP_LENGTH self.marker_length = self.DEFAULT_MARKER_LENGTH super(Slider, self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand, font=font, base_color=base_color, background_color=background_color, foreground_color=foreground_color, selection_color=selection_color, border_size=border_size, position_technique=position_technique, is_focusable=is_focusable, comment=comment) if orientation is not None: self.orientation = orientation if scale_start is not None: self.scale_start = scale_start if scale_end is not None: self.scale_end = scale_end if step_length is not None: self.step_length = step_length if marker_length is not None: self.marker_length = marker_length self.accepts_data = True self._realSetData = self._setValue self._realGetData = self._getValue def clone(self, prefix): sliderClone = Slider(None, self._createNameWithPrefix(prefix), self.size, self.min_size, self.max_size, self.helptext, self.position, self.style, self.hexpand, self.vexpand, self.font, self.base_color, self.background_color, self.foreground_color, self.selection_color, self.border_size, self.position_technique, self.is_focusable, self.comment, self.scale_start, self.scale_end, self.step_length, self.marker_length, self.orientation) return sliderClone def _setScale(self, start, end): """setScale(self, double scaleStart, double scaleEnd)""" if type(start) != float: raise RuntimeError("Slider expects float for start scale") if type(end) != float: raise RuntimeError("Slider expects float for end scale") self.real_widget.setScale(start, end) def _getScaleStart(self): """getScaleStart(self) -> double""" return self.real_widget.getScaleStart() def _setScaleStart(self, start): """setScaleStart(self, double scaleStart)""" if type(start) != float: raise RuntimeError("Slider expects float for start scale") self.real_widget.setScaleStart(start) scale_start = property(_getScaleStart, _setScaleStart) def _getScaleEnd(self): """getScaleEnd(self) -> double""" return self.real_widget.getScaleEnd() def _setScaleEnd(self, end): """setScaleEnd(self, double scaleEnd)""" if type(end) != float: raise RuntimeError("Slider expects float for end scale") self.real_widget.setScaleEnd(end) scale_end = property(_getScaleEnd, _setScaleEnd) def _getValue(self): """getValue(self) -> double""" return self.real_widget.getValue() def _setValue(self, value): """setValue(self, double value)""" if type(value) != float: raise RuntimeError("Slider only accepts float values") self.real_widget.setValue(value) value = property(_getValue, _setValue) def _setMarkerLength(self, length): """setMarkerLength(self, int length)""" if type(length) != int: raise RuntimeError("Slider only accepts int for Marker lenght") self.real_widget.setMarkerLength(length) def _getMarkerLength(self): """getMarkerLength(self) -> int""" return self.real_widget.getMarkerLength() marker_length = property(_getMarkerLength, _setMarkerLength) def _setOrientation(self, orientation): """setOrientation(self, Orientation orientation)""" self.real_widget.setOrientation(orientation) def _getOrientation(self): """getOrientation(self) -> int""" return self.real_widget.getOrientation() orientation = property(_getOrientation, _setOrientation) def _setStepLength(self, length): """setStepLength(self, double length)""" if type(length) != float: raise RuntimeError("Slider only accepts floats for step length") self.real_widget.setStepLength(length) def _getStepLength(self): """getStepLength(self) -> double""" return self.real_widget.getStepLength() step_length = property(_getStepLength, _setStepLength) fife_0.3.5/engine/python/fife/extensions/pychan/widgets/listbox.py0000664000175100017510000001337512205217523024442 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from common import * from widget import Widget class GenericListmodel(fife.ListModel,list): """ A wrapper for the exported list model to behave more like a Python list. Don't use directly. """ def __init__(self,*args): super(GenericListmodel,self).__init__() map(self.append,args) def clear(self): while len(self): self.pop() def getNumberOfElements(self): return len(self) def getElementAt(self, i): i = max(0,min(i,len(self) - 1)) return text2gui(unicode(self[i])) class ListBox(Widget): """ A basic list box widget for displaying lists of strings. It makes most sense to wrap this into a L{ScrollArea}. New Attributes ============== - items: A List of strings. This can be treated like an ordinary python list. but only strings are allowed. - selected: The index of the selected item in the list. Starting from C{0} to C{len(items)-1}. A negative value indicates, that no item is selected. - selected_item: The selected string itself, or C{None} - if no string is selected. Data ==== The selected attribute can be read and set via L{distributeData} and L{collectData}. The list items can be set via L{distributeInitialData}. """ DEFAULT_HEXPAND = 1 DEFAULT_VEXPAND = 1 DEFAULT_ITEMS = [] def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, items = None, selected = None): if items is None: self._items = GenericListmodel(*self.DEFAULT_ITEMS) else: if type(items) is list: self._items = GenericListmodel(*items) else: raise RuntimeError("items parameter must be a list!") self.real_widget = fife.ListBox(self._items) if selected is not None and items is not None: if len(items) > 0 and selected < len(items) and selected > 0: self.selected = selected else: raise RuntimeError("Invalid selected item index specified for listbox!") elif selected is None and items is not None: if len(items) > 0: self.selected = 0 super(ListBox,self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand, font=font, base_color=base_color, background_color=background_color, foreground_color=foreground_color, selection_color=selection_color, border_size=border_size, position_technique=position_technique, is_focusable=is_focusable, comment=comment) # Prepare Data collection framework self.accepts_initial_data = True self._realSetInitialData = self._setItems self.accepts_data = True self._realSetData = self._setSelected self._realGetData = self._getSelected def clone(self, prefix): itemsList = [] for i in range(self.items.getNumberOfElements()): itemsList.append(self.items.getElementAt(i)) listboxClone = ListBox(None, self._createNameWithPrefix(prefix), self.size, self.min_size, self.max_size, self.helptext, self.position, self.styleNone, self.hexpand, self.vexpand, self.font, self.base_color, self.background_color, self.foreground_color, self.selection_color, self.border_size, self.position_technique, self.is_focusable, self.comment, itemsList, self.selected) return listboxClone def resizeToContent(self,recurse=True): # We append a minimum value, so max() does not bail out, # if no items are in the list _item_widths = map(self.real_font.getWidth,map(gui2str,self._items)) + [0] max_w = max(_item_widths) self.width = max_w self.height = (self.real_font.getHeight() + 2) * len(self._items) def _getItems(self): return self._items def _setItems(self,items): # Note we cannot use real_widget.setListModel # for some reason ??? # Also self assignment can kill you if id(items) != id(self._items): self._items.clear() self._items.extend(items) items = property(_getItems,_setItems) def _getSelected(self): return self.real_widget.getSelected() def _setSelected(self,index): self.real_widget.setSelected(index) selected = property(_getSelected,_setSelected) def _getSelectedItem(self): if 0 <= self.selected < len(self._items): return self._items[self.selected] return None selected_item = property(_getSelectedItem) fife_0.3.5/engine/python/fife/extensions/pychan/widgets/textfield.py0000664000175100017510000000676512205217523024753 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from common import * from widget import Widget class TextField(Widget): """ An editable B{single line} text edit widget. New Attributes ============== - text: The text in the TextBox. Data ==== The text can be read and set via L{distributeData} and L{collectData}. """ ATTRIBUTES = Widget.ATTRIBUTES + [ UnicodeAttr('text') ] DEFAULT_HEXPAND = 1 DEFAULT_VEXPAND = 0 DEFAULT_TEXT = u"" def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, margins = None, text = None): self.real_widget = fife.TextField() self.text = text or self.DEFAULT_TEXT super(TextField,self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand) # Prepare Data collection framework self.accepts_data = True self.accepts_inital_data = True self._realSetInitialData = self._setText self._realSetData = self._setText self._realGetData = self._getText def clone(self, prefix): textfieldClone = TextField(None, self._createNameWithPrefix(prefix), self.size, self.min_size, self.max_size, self.helptext, self.position, self.style, self.hexpand, self.vexpand, self.font, self.base_color, self.background_color, self.foreground_color, self.selection_color, self.border_size, self.position_technique, self.is_focusable, self.comment, self.margins, self.text) return textfieldClone def resizeToContent(self,recurse=True): max_w = self.real_font.getWidth(text2gui(self.text)) self.width = max_w self.height = (self.real_font.getHeight() + 2) def _getText(self): return gui2text(self.real_widget.getText()) def _setText(self,text): self.real_widget.setText(text2gui(text)) text = property(_getText,_setText) def _setOpaque(self,opaque): self.real_widget.setOpaque(opaque) def _getOpaque(self): return self.real_widget.isOpaque() opaque = property(_getOpaque,_setOpaque) fife_0.3.5/engine/python/fife/extensions/pychan/widgets/buttons.py0000664000175100017510000002573412205217523024456 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from common import * from basictextwidget import BasicTextWidget from fife.extensions.pychan.properties import ImageProperty class Button(BasicTextWidget): """ A basic push button. """ def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, margins = None, text = None): self.real_widget = fife.Button("") super(Button,self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand, font=font, base_color=base_color, background_color=background_color, foreground_color=foreground_color, selection_color=selection_color, border_size=border_size, position_technique=position_technique, is_focusable=is_focusable, comment=comment, margins=margins, text=text) def clone(self, prefix): btnClone = Button(None, self._createNameWithPrefix(prefix), self.size, self.min_size, self.max_size, self.helptext, self.position, self.style, self.hexpand, self.vexpand, self.font, self.base_color, self.background_color, self.foreground_color, self.selection_color, self.border_size, self.position_technique, self.is_focusable, self.comment, self.margins, self.text) return btnClone; class ImageButton(BasicTextWidget): """ A basic push button with three different images for the up, down and hover state. B{Work in progress.} New Attributes ============== - up_image: String: The source location of the Image for the B{unpressed} state. - down_image: String: The source location of the Image for the B{pressed} state. - hover_image: String: The source location of the Image for the B{unpressed hovered} state. """ ATTRIBUTES = BasicTextWidget.ATTRIBUTES + [ Attr('up_image'), Attr('down_image'), PointAttr('offset'), Attr('hover_image') ] DEFAULT_UPIMAGE = "" DEFAULT_DOWNIMAGE = "" DEFAULT_HOVERIMAGE = "" DEFAULT_OFFSET = 0,0 def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, margins = None, text = None, up_image=None, down_image=None, hover_image=None, offset=None, real_widget=None): if real_widget is None: self.real_widget = fife.TwoButton() else: self.real_widget = real_widget # set the defaulst offset = self.DEFAULT_OFFSET super(ImageButton,self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand, font=font, base_color=base_color, background_color=background_color, foreground_color=foreground_color, selection_color=selection_color, border_size=border_size, position_technique=position_technique, is_focusable=is_focusable, comment=comment, margins=margins, text=text) if up_image is not None: self.up_image = up_image else: self.up_image = self.DEFAULT_UPIMAGE if down_image is not None: self.down_image = down_image else: self.down_image = self.DEFAULT_DOWNIMAGE if hover_image is not None: self.hover_image = hover_image else: self.hover_image = self.DEFAULT_HOVERIMAGE # Override anything set when stylize was called if offset is not None: self.offset = offset def clone(self, prefix): imgButtonClone = ImageButton(None, self._createNameWithPrefix(prefix), self.size, self.min_size, self.max_size, self.helptext, self.position, self.style, self.hexpand, self.vexpand, self.font, self.base_color, self.background_color, self.foreground_color, self.selection_color, self.border_size, self.position_technique, self.is_focusable, self.comment, self.margins, self.text, self.up_image, self.down_image, self.hover_image, self.offset) return imgButtonClone up_image = ImageProperty("UpImage") down_image = ImageProperty("DownImage") hover_image = ImageProperty("HoverImage") def _setOffset(self, offset): self.real_widget.setDownOffset(offset[0], offset[1]) def _getOffset(self): return (self.real_widget.getDownXOffset(), self.real_widget.getDownYOffset()) offset = property(_getOffset,_setOffset) def resizeToContent(self, recurse=True): th, tw = 0, 0 if self.text: th = self.real_font.getHeight()#+self.real_font.getSpacing() tw = self.real_font.getWidth(text2gui(self.text))#+self.real_font.getSpacing() self.height = max( self._prop_upimage["image"].getHeight(), self._prop_downimage["image"].getHeight(), self._prop_hoverimage["image"].getHeight(), th) + self.margins[1]*2 self.width = max( self._prop_upimage["image"].getWidth(), self._prop_downimage["image"].getWidth(), self._prop_hoverimage["image"].getWidth(), tw) + self.margins[0]*2 class ToggleButton(ImageButton): """ A basic push button that can be toggled. Unfortunately a bit of code duplication from ImageButton. New Attributes ============== - group: String: The group the button belongs to. Only one button in each group will be toggled at one time. - toggled: Boolean: Whether the button is toggled or not. """ ATTRIBUTES = BasicTextWidget.ATTRIBUTES + [ Attr('up_image'), Attr('down_image'), Attr('hover_image'), PointAttr('offset'), Attr('group'), BoolAttr('toggled') ] DEFAULT_GROUP = "" DEFAULT_TOGGLED = False def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, margins = None, text = None, up_image = None, down_image = None, hover_image = None, offset = None, group = None, toggled = None): group = self.DEFAULT_GROUP toggled = self.DEFAULT_TOGGLED super(ToggleButton,self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand, font=font, base_color=base_color, background_color=background_color, foreground_color=foreground_color, selection_color=selection_color, border_size=border_size, position_technique=position_technique, is_focusable=is_focusable, comment=comment, margins=margins, text=text, up_image=up_image, down_image=down_image, hover_image=hover_image, offset=offset, real_widget=fife.ToggleButton()) if group is not None: self.group = group if toggled: self.toggled = toggled def clone(self, prefix): toggleButtonClone = ToggleButton(None, self._createNameWithPrefix(prefix), self.size, self.min_size, self.max_size, self.helptext, self.position, self.style, self.hexpand, self.vexpand, self.font, self.base_color, self.background_color, self.foreground_color, self.selection_color, self.border_size, self.position_technique, self.is_focusable, self.comment, self.margins, self.text, self.up_image, self.down_image, self.hover_image, self.offset, self.group) return toggleButtonClone def _setGroup(self,group): if group is not None and group != "": self.real_widget.setGroup( group ) def _getGroup(self): return self.real_widget.getGroup() group = property(_getGroup,_setGroup) def _setToggled(self, toggled): self.real_widget.setToggled( toggled ) def _isToggled(self): return self.real_widget.isToggled() toggled = property(_isToggled, _setToggled) def resizeToContent(self, recurse=True): # NOTE: Figure out how the spacing comes into play tw, th = 0, 0 if self.text: th = self.real_font.getHeight() + self.real_widget.getSpacing() tw = self.real_font.getWidth(text2gui(self.text)) + self.real_widget.getSpacing() self.height = max( self._prop_upimage["image"].getHeight(), self._prop_downimage["image"].getHeight(), self._prop_hoverimage["image"].getHeight(), th) + self.margins[1]*2 self.width = max( self._prop_upimage["image"].getWidth(), self._prop_downimage["image"].getWidth(), self._prop_hoverimage["image"].getWidth(), tw) + self.margins[0]*2 fife_0.3.5/engine/python/fife/extensions/pychan/widgets/checkbox.py0000664000175100017510000000707712205217523024546 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from common import * from basictextwidget import BasicTextWidget class CheckBox(BasicTextWidget): """ A basic checkbox. New Attributes ============== - marked: Boolean value, whether the checkbox is checked or not. Data ==== The marked status can be read and set via L{distributeData} and L{collectData} """ ATTRIBUTES = BasicTextWidget.ATTRIBUTES + [ BoolAttr('marked') ] DEFAULT_MARKED = False def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, margins = None, text = None, marked = None): self.real_widget = fife.CheckBox() self.marked = self.DEFAULT_MARKED super(CheckBox,self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand, font=font, base_color=base_color, background_color=background_color, foreground_color=foreground_color, selection_color=selection_color, border_size=border_size, position_technique=position_technique, is_focusable=is_focusable, comment=comment, margins=margins, text=text) if marked is not None: self.marked = marked # Prepare Data collection framework self.accepts_data = True self._realGetData = self._isMarked self._realSetData = self._setMarked def clone(self, prefix): checkboxClone = CheckBox(None, self._createNameWithPrefix(prefix), self.size, self.min_size, self.max_size, self.helptext, self.position, self.style, self.hexpand, self.vexpand, self.font, self.base_color, self.background_color, self.foreground_color, self.selection_color, self.border_size, self.position_technique, self.is_focusable, self.comment, self.margins, self.text, self.marked) return checkboxClone def _isMarked(self): return self.real_widget.isSelected() def _setMarked(self,mark): self.real_widget.setSelected(mark) marked = property(_isMarked,_setMarked) fife_0.3.5/engine/python/fife/extensions/pychan/widgets/containers.py0000664000175100017510000004456512205217523025130 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from common import * from widget import Widget from layout import VBoxLayoutMixin, HBoxLayoutMixin class Container(Widget): """ This is the basic container class. It provides space in which child widgets can be position via the position attribute. If you want to use the layout engine, you have to use derived containers with vertical or horizontal orientation (L{VBox} or L{HBox}) New Attributes ============== - padding - Integer: Not used in the Container class istelf, distance between child widgets. - background_image - Set this to a GuiImage or a resource location (simply a filename). The image will be tiled over the background area. - opaque - Boolean: Whether the background should be drawn at all. Set this to False to make the widget transparent. - children - Just contains the list of contained child widgets. Do NOT modify. """ ATTRIBUTES = Widget.ATTRIBUTES + [ IntAttr('padding'), Attr('background_image'), BoolAttr('opaque'), PointAttr('margins') ] DEFAULT_OPAQUE = True DEFAULT_MARGINS = 5,5 DEFAULT_PADDING = 5 DEFAULT_BACKGROUND = None def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, padding = None, background_image = None, opaque = None, margins = None, _real_widget = None): self.real_widget = _real_widget or fife.Container() self.children = [] self.children_position_cache = [] self.hidden_children = [] self._background = [] self._background_image = None self.background_image = self.DEFAULT_BACKGROUND self.margins = self.DEFAULT_MARGINS self.padding = self.DEFAULT_PADDING self.opaque = self.DEFAULT_OPAQUE super(Container,self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand, font=font, base_color=base_color, background_color=background_color, foreground_color=foreground_color, selection_color=selection_color, border_size=border_size, position_technique=position_technique, is_focusable=is_focusable, comment=comment) if margins is not None: self.margins = margins if padding is not None: self.padding = padding if opaque is not None: self.opaque = opaque if background_image is not None: self.background_image = background_image def clone(self, prefix): containerClone = Container(None, self._createNameWithPrefix(prefix), self.size, self.min_size, self.max_size, self.helptext, self.position, self.style, self.hexpand, self.vexpand, self.font, self.base_color, self.background_color, self.foreground_color, self.selection_color, self.border_size, self.position_technique, self.is_focusable, self.comment, self.padding, self.background_image, self.opaque, self.margins) containerClone.addChildren(self._cloneChildren(prefix)) return containerClone def addChild(self, widget): """ Adds a child widget to the container. This makes the childs widgets visible state the same as the containers. i.e. if the containter is visible the child will be as well and if the container widget is hidden so will the child. The child however WILL be shown when you show the container widget. If you want the child to be hidden when you show the container widget you must call child.hide(). """ widget.parent = self widget._visible = self._visible self.children.append(widget) self.children_position_cache.append(widget) self.real_widget.add(widget.real_widget) #update the states of the child widgets. This does not actually call #the show() or hide() functions of the widget. if self._visible: def _show(shown_widget): shown_widget._visible = True self.deepApply(_show, shown_only=True) else: def _hide(hidden_widget): hidden_widget._visible = False self.deepApply(_hide) def insertChild(self, widget, position): if position > len(self.children) or 0-position > len(self.children): print "insertChild: Warning: Index overflow.", if position >= 0: self.addChild(widget) else: self.insertChild(widget, 0) return children = self.children[0:position]+[widget]+self.children[position:] #assert len(children) == len(self.children) + 1 for child_to_remove in self.children[:]: self.removeChild(child_to_remove) for child in children: self.addChild(child) def insertChildBefore(self, widget, before): if before not in self.children: raise RuntimeError("Couldn't find widget %s as child of %s - in insertChildBefore" % (str(widget),str(before))) self.insertChild(widget, self.children.index(before)) def removeChild(self,widget): if not widget in self.children and not widget in self.hidden_children: raise RuntimeError("%s does not have %s as direct child widget." % (str(self),str(widget))) if widget in self.children: self.children.remove(widget) self.real_widget.remove(widget.real_widget) if widget in self.children_position_cache: self.children_position_cache.remove(widget) if widget in self.hidden_children: self.hidden_children.remove(widget) widget.parent = None def hideChild(self, child): if not child in self.children: raise RuntimeError("%s does not have %s as direct child widget." % (str(self), str(child))) self.hidden_children.append(child) self.children.remove(child) self.real_widget.remove(child.real_widget) child._visible = False def showChild(self, child): if not child in self.hidden_children: return self.hidden_children.remove(child) children = self.children[:] children_position_cache = self.children_position_cache[:] hidden_children = self.hidden_children[:] for widget in children: self.removeChild(widget) for child_widget in children_position_cache: if not child_widget in hidden_children: self.addChild(child_widget) self.children_position_cache = children_position_cache[:] self.hidden_children = hidden_children[:] def add(self,*widgets): print "PyChan: Deprecation warning: Please use 'addChild' or 'addChildren' instead." self.addChildren(*widgets) def getMaxChildrenWidth(self): if not self.children: return 0 return max(widget.width for widget in self.children) def getMaxChildrenHeight(self): if not self.children: return 0 return max(widget.height for widget in self.children) def deepApply(self,visitorFunc, leaves_first = True, shown_only = False): if not shown_only: children = self.children + self.hidden_children else: children = self.children if leaves_first: for child in children: child.deepApply(visitorFunc, leaves_first = leaves_first, shown_only = shown_only) visitorFunc(self) if not leaves_first: for child in children: child.deepApply(visitorFunc, leaves_first = leaves_first, shown_only = shown_only) def beforeShow(self): self._resetTiling() def _resetTiling(self): image = self._background_image if image is None: return back_w,back_h = self.width, self.height image_w, image_h = image.getWidth(), image.getHeight() map(self.real_widget.remove,self._background) # Now tile the background over the widget self._background = [] icon = fife.Icon(image) x, w = 0, image_w while x < back_w: y, h = 0, image_h while y < self.height: icon = fife.Icon(image) icon.setPosition(x,y) self._background.append(icon) y += h x += w map(self.real_widget.add,self._background) for tile in self._background: tile.requestMoveToBottom() def setBackgroundImage(self,image): self._background = getattr(self,'_background',None) if image is None: self._background_image = None map(self.real_widget.remove,self._background) self._background = [] return # Background generation is done in _resetTiling if not isinstance(image, fife.GuiImage): image = get_manager().loadImage(image) self._background_image = image def getBackgroundImage(self): return self._background_image background_image = property(getBackgroundImage,setBackgroundImage) def _setOpaque(self,opaque): self.real_widget.setOpaque(opaque) def _getOpaque(self): return self.real_widget.isOpaque() opaque = property(_getOpaque,_setOpaque) def _cloneChildren(self, prefix): """ Clones each child and return the clones in a list. """ cloneList = [] for child in self.children: cloneList.append(child.clone(prefix)) return cloneList class VBox(VBoxLayoutMixin,Container): """ A vertically aligned box - for containement of child widgets. Widgets added to this container widget, will layout on top of each other. Also the minimal width of the container will be the maximum of the minimal widths of the contained widgets. The default alignment is to the top. This can be changed by adding a Spacer to the widget at any point (but only one!). The spacer will expand, so that widgets above the spacer are aligned to the top, while widgets below the spacer are aligned to the bottom. """ DEFAULT_HEXPAND = 0 DEFAULT_VEXPAND = 1 def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, padding = None, background_image = None, opaque = None, margins = None, _real_widget = None): super(VBox,self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand, font=font, base_color=base_color, background_color=background_color, foreground_color=foreground_color, selection_color=selection_color, border_size=border_size, position_technique=position_technique, is_focusable=is_focusable, comment=comment, padding=padding, background_image=background_image, opaque=opaque, margins=margins, _real_widget=_real_widget) def clone(self, prefix): vboxClone = VBox(None, self._createNameWithPrefix(prefix), self.size, self.min_size, self.max_size, self.helptext, self.position, self.style, self.hexpand, self.vexpand, self.font, self.base_color, self.background_color, self.foreground_color, self.selection_color, self.border_size, self.position_technique, self.is_focusable, self.comment, self.padding, self.background_image, self.opaque, self.margins) vboxClone.addChildren(self._cloneChildren(prefix)) return vboxClone class HBox(HBoxLayoutMixin,Container): """ A horizontally aligned box - for containement of child widgets. Please see L{VBox} for details - just change the directions :-). """ DEFAULT_HEXPAND = 1 DEFAULT_VEXPAND = 0 def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, padding = None, background_image = None, opaque = None, margins = None, _real_widget = None): super(HBox,self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand, font=font, base_color=base_color, background_color=background_color, foreground_color=foreground_color, selection_color=selection_color, border_size=border_size, position_technique=position_technique, is_focusable=is_focusable, comment=comment, padding=padding, background_image=background_image, opaque=opaque, margins=margins, _real_widget=_real_widget) def clone(self, prefix): hboxClone = HBox(None, self._createNameWithPrefix(prefix), self.size, self.min_size, self.max_size, self.helptext, self.position, self.style, self.hexpand, self.vexpand, self.font, self.base_color, self.background_color, self.foreground_color, self.selection_color, self.border_size, self.position_technique, self.is_focusable, self.comment, self.padding, self.background_image, self.opaque, self.margins) hboxClone.addChildren(self._cloneChildren(prefix)) return hboxClone class Window(VBoxLayoutMixin,Container): """ A L{VBox} with a draggable title bar aka a window New Attributes ============== - title: The Caption of the window - titlebar_height: The height of the window title bar """ ATTRIBUTES = Container.ATTRIBUTES + [ UnicodeAttr('title'), IntAttr('titlebar_height') ] DEFAULT_TITLE = u"title" DEFAULT_TITLE_HEIGHT = 0 DEFAULT_POSITION_TECHNIQUE = "automatic" def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, padding = None, background_image = None, opaque = None, margins = None, _real_widget = None, title = None, titlebar_height = None): super(Window,self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand, font=font, base_color=base_color, background_color=background_color, foreground_color=foreground_color, selection_color=selection_color, border_size=border_size, position_technique=position_technique, is_focusable=is_focusable, comment=comment, padding=padding, background_image=background_image, opaque=opaque, margins=margins, _real_widget= fife.Window()) if titlebar_height is not None: if titlebar_height == 0: titlebar_height = self.real_font.getHeight() + 4 self.titlebar_height = titlebar_height else: self.titlebar_height = self.real_font.getHeight() + 4 if title is not None: self.title = title else: self.title = self.DEFAULT_TITLE def clone(self, prefix): windowClone = Window(None, self._createNameWithPrefix(prefix), self.size, self.min_size, self.max_size, self.helptext, self.position, self.style, self.hexpand, self.vexpand, self.font, self.base_color, self.background_color, self.foreground_color, self.selection_color, self.border_size, self.position_technique, self.is_focusable, self.comment, self.padding, self.background_image, self.opaque, self.margins, None, self.title, self.titlebar_height ) windowClone.addChildren(self._cloneChildren(prefix)) return windowClone def _getTitle(self): return gui2text(self.real_widget.getCaption()) def _setTitle(self,text): self.real_widget.setCaption(text2gui(text)) title = property(_getTitle,_setTitle) def _getTitleBarHeight(self): return self.real_widget.getTitleBarHeight() def _setTitleBarHeight(self,h): self.real_widget.setTitleBarHeight(h) titlebar_height = property(_getTitleBarHeight,_setTitleBarHeight) # Hackish way of hiding that title bar height in the perceived height. # Fixes VBox calculation def _setHeight(self,h): h = max(self.min_size[1],h) h = min(self.max_size[1],h) self.real_widget.setHeight(h + self.titlebar_height) def _getHeight(self): return self.real_widget.getHeight() - self.titlebar_height height = property(_getHeight,_setHeight) fife_0.3.5/engine/python/fife/extensions/pychan/widgets/icon.py0000664000175100017510000000614012205217523023676 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from common import * from widget import Widget from fife.extensions.pychan.properties import ImageProperty class Icon(Widget): """ An image icon. New Attributes ============== - image: String or GuiImage: The source location of the Image or a direct GuiImage """ ATTRIBUTES = Widget.ATTRIBUTES + [ Attr('image') ] def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, image = None): self.real_widget = fife.Icon(None) super(Icon,self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand, font=font, base_color=base_color, background_color=background_color, foreground_color=foreground_color, selection_color=selection_color, border_size=border_size, position_technique=position_technique, is_focusable=is_focusable, comment=comment) self.image = image def clone(self, prefix): iconClone = Icon(None, self._createNameWithPrefix(prefix), self.size, self.min_size, self.max_size, self.helptext, self.position, self.style, self.hexpand, self.vexpand, self.font, self.base_color, self.background_color, self.foreground_color, self.selection_color, self.border_size, self.position_technique, self.is_focusable, self.comment, self.image) return iconClone _image = ImageProperty("Image") def _setImage(self,source): self._image = source def _getImage(self): return self._image image = property(_getImage,_setImage) fife_0.3.5/engine/python/fife/extensions/pychan/widgets/scrollarea.py0000664000175100017510000001523112205217523025076 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from common import * from widget import Widget class ScrollArea(Widget): """ A wrapper around another (content) widget. New Attributes ============== - content: The wrapped widget. - vertical_scrollbar: Boolean: Set this to False to hide the Vertical scrollbar - horizontal_scrollbar: Boolean: Set this to False to hide the Horizontal scrollbar """ ATTRIBUTES = Widget.ATTRIBUTES + [ BoolAttr("vertical_scrollbar"), BoolAttr("horizontal_scrollbar"), IntAttr("vertical_scroll_amount"), IntAttr("horizontal_scroll_amount") ] DEFAULT_HEXPAND = 1 DEFAULT_VEXPAND = 1 def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, content = None, vertical_scrollbar = None, horizontal_scrollbar = None, vertical_scroll_amount = None, horizontal_scroll_amount = None ): self.real_widget = fife.ScrollArea() self._content = None super(ScrollArea,self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand) if content is not None: self.content = content if vertical_scrollbar is not None: self.vertical_scrollbar = vertical_scrollbar if horizontal_scrollbar is not None: self.horizontal_scrollbar = horizontal_scrollbar if vertical_scroll_amount is not None: self.vertical_scroll_amount = vertical_scroll_amount if horizontal_scroll_amount is not None: self.horizontal_scroll_amount = horizontal_scroll_amount def clone(self, prefix): scrollareaClone = ScrollArea(None, self._createNameWithPrefix(prefix), self.size, self.min_size, self.max_size, self.helptext, self.position, self.style, self.hexpand, self.vexpand, self.font, self.base_color, self.background_color, self.foreground_color, self.selection_color, self.border_size, self.position_technique, self.is_focusable, self.comment, None, #NOTE since content is a widget hierarchy it should be cloned too self.vertical_scrollbar, self.horizontal_scrollbar, self.vertical_scroll_amount, self.horizontal_scroll_amount) scrollareaClone.content = self.content.clone(prefix) return scrollareaClone def addChild(self,widget): self.content = widget widget.parent = self def removeChild(self,widget): if self._content != widget: raise RuntimeError("%s does not have %s as direct child widget." % (str(self),str(widget))) self.content = None widget.parent = None def _setContent(self,content): if content is None: self.real_widget.setContent(content) else: self.real_widget.setContent(content.real_widget) self._content = content def _getContent(self): return self._content content = property(_getContent,_setContent) def deepApply(self,visitorFunc, leaves_first = True, shown_only = False): if leaves_first: if self._content: self._content.deepApply(visitorFunc, leaves_first = leaves_first, shown_only = shown_only) visitorFunc(self) if not leaves_first: if self._content: self._content.deepApply(visitorFunc, leaves_first = leaves_first, shown_only = shown_only) def resizeToContent(self,recurse=True): if self._content is None: return if recurse: self.content.resizeToContent(recurse=recurse) self.size = self.min_size def _visibilityToScrollPolicy(self,visibility): if visibility: return fife.ScrollArea.SHOW_AUTO return fife.ScrollArea.SHOW_NEVER def _scrollPolicyToVisibility(self,policy): if policy == fife.ScrollArea.SHOW_NEVER: return False return True def _setHorizontalScrollbar(self,visibility): self.real_widget.setHorizontalScrollPolicy( self._visibilityToScrollPolicy(visibility) ) def _setVerticalScrollbar(self,visibility): self.real_widget.setVerticalScrollPolicy( self._visibilityToScrollPolicy(visibility) ) def _getHorizontalScrollbar(self): return self._scrollPolicyToVisibility( self.real_widget.getHorizontalScrollPolicy() ) def _getVerticalScrollbar(self): return self._scrollPolicyToVisibility( self.real_widget.getVerticalScrollPolicy() ) def sizeChanged(self): if self.content: self.content.width = max(self.content.width,self.width-5) self.content.height = max(self.content.height,self.height-5) def getVerticalMaxScroll(self): return self.real_widget.getVerticalMaxScroll() def getHorizontalMaxScroll(self): return self.real_widget.getHorizontalMaxScroll() def _getHorizontalScrollAmount(self): return self.real_widget.getHorizontalScrollAmount() def _setHorizontalScrollAmount(self, scroll_amount): return self.real_widget.setHorizontalScrollAmount(scroll_amount) def _getVerticalScrollAmount(self): return self.real_widget.getVerticalScrollAmount() def _setVerticalScrollAmount(self, scroll_amount): return self.real_widget.setVerticalScrollAmount(scroll_amount) vertical_scrollbar = property(_getVerticalScrollbar,_setVerticalScrollbar) horizontal_scrollbar = property(_getHorizontalScrollbar,_setHorizontalScrollbar) horizontal_scroll_amount = property(_getHorizontalScrollAmount, _setHorizontalScrollAmount) vertical_scroll_amount = property(_getVerticalScrollAmount, _setVerticalScrollAmount) fife_0.3.5/engine/python/fife/extensions/pychan/widgets/ext/0000775000175100017510000000000012205217523023173 5ustar waynewaynefife_0.3.5/engine/python/fife/extensions/pychan/widgets/ext/__init__.py0000664000175100017510000000266212205217523025312 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### """ Pychan extension widgets. Extension widgets are partly experimental, partly rarely used widgets which are added here. They are by default not included in the widgets registry and thus cannot be loaded from XML files. Use L{pychan.widgets.registerWidget} to enable that. Not the same care to keep the API stable will be taken for them and before and if they are added (or replace) the standard widgets they will have to be reviewed in detail. """ fife_0.3.5/engine/python/fife/extensions/pychan/widgets/basictextwidget.py0000664000175100017510000000645312205217523026147 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from widget import Widget from common import * class BasicTextWidget(Widget): """ The base class for widgets which display a string - L{Label},L{Button}, etc. Do not use directly. New Attributes ============== - text: The text (depends on actual widget) Data ==== The text can be set via the L{distributeInitialData} method. """ ATTRIBUTES = Widget.ATTRIBUTES + [ UnicodeAttr('text') ] DEFAULT_HEXPAND = 1 DEFAULT_VEXPAND = 0 DEFAULT_MARGINS = 5,5 DEFAULT_TEXT = u"" def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, margins = None, text = None): self.margins = self.DEFAULT_MARGINS self.text = self.DEFAULT_TEXT super(BasicTextWidget,self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand, font=font, base_color=base_color, background_color=background_color, foreground_color=foreground_color, selection_color=selection_color, border_size=border_size, position_technique=position_technique, is_focusable=is_focusable, comment=comment) # Prepare Data collection framework self.accepts_initial_data = True self._realSetInitialData = self._setText # Override anything set when stylize was called if margins is not None: self.margins = margins if text is not None: self.text = text def _getText(self): return gui2text(self.real_widget.getCaption()) def _setText(self,text): self.real_widget.setCaption(text2gui(text)) text = property(_getText,_setText) def resizeToContent(self, recurse = True): self.height = self.real_font.getHeight() + self.margins[1]*2 self.width = self.real_font.getWidth(text2gui(self.text)) + self.margins[0]*2 fife_0.3.5/engine/python/fife/extensions/pychan/widgets/layout.py0000664000175100017510000002240612205217523024266 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from fife.extensions.pychan.attrs import IntAttr AlignTop, AlignBottom, AlignLeft, AlignRight, AlignCenter = range(5) def isLayouted(widget): return isinstance(widget,LayoutBase) class LayoutBase(object): """ This class is at the core of the layout engine. The two MixIn classes L{VBoxLayoutMixin} and L{HBoxLayoutMixin} specialise on this by reimplementing the C{resizeToContent} and the C{expandContent} methods. Dynamic Layouting ================= The layout is calculated in the L{Widget.show} method. Thus if you modify the layout, by adding or removing child widgets for example, you have to call L{widgets.Widget.adaptLayout} so that the changes ripple through the widget hierachy. Internals ========= At the core the layout engine works in two passes: Before a root widget loaded by the XML code is shown, its resizeToContent method is called recursively (walking the widget containment relation in post order). This shrinks all HBoxes and VBoxes to their minimum heigt and width. After that the expandContent method is called recursively in the same order, which will re-align the widgets if there is space left AND if a Spacer is contained. Inside bare Container instances (without a Layout MixIn) absolute positioning can be used. """ def __init__(self,align = (AlignLeft,AlignTop), **kwargs): self.align = align self.spacer = [] super(LayoutBase,self).__init__(**kwargs) def addSpacer(self,spacer): self.spacer.append(spacer) spacer.index = len(self.children) def xdelta(self,widget):return 0 def ydelta(self,widget):return 0 def _applyHeight(self, spacers = []): y = self.border_size + self.margins[1] ydelta = map(self.ydelta,self.children) for index, child in enumerate(self.children): while spacers and spacers[0].index == index: y += spacers.pop(0).size child.y = y y += ydelta.pop(0) def _adjustHeightWithSpacer(self): pass def _applyWidth(self, spacers = []): x = self.border_size + self.margins[0] xdelta = map(self.xdelta,self.children) for index, child in enumerate(self.children): while spacers and spacers[0].index == index: x += spacers.pop(0).size child.x = x x += xdelta.pop(0) def _expandWidthSpacer(self): xdelta = map(self.xdelta,self.children) xdelta += [spacer.min_size for spacer in self.spacer] available_space = self.width - 2*self.margins[0] - 2*self.border_size - self._extra_border[0] used_space = sum(xdelta) if self.children: used_space -= self.padding if used_space >= available_space: return expandable_items = self._getExpanders(vertical=False) #print "AS/US - before",self,[o.width for o in expandable_items] #print "SPACERS",self.spacer index = 0 n = len(expandable_items) while used_space < available_space and expandable_items: index = index % n delta = (available_space - used_space) / n if delta == 0: delta = 1 expander = expandable_items[index] old_width = expander.width expander.width += delta delta = expander.width - old_width if delta == 0: expandable_items.pop(index) n -= 1 else: used_space += delta index += 1 #print "AS/US - after",self,[o.width for o in expandable_items] #print "SPACERS",self.spacer self._applyWidth(spacers = self.spacer[:]) def _expandHeightSpacer(self): ydelta = map(self.ydelta,self.children) ydelta += [spacer.min_size for spacer in self.spacer] available_space = self.height - 2*self.margins[1] - 2*self.border_size - self._extra_border[1] used_space = sum(ydelta) if self.children: used_space -= self.padding if used_space >= available_space: return expandable_items = self._getExpanders(vertical=True) #print "AS/US - before",self,[o.height for o in expandable_items] index = 0 n = len(expandable_items) while used_space < available_space and expandable_items: index = index % n delta = (available_space - used_space) / n if delta == 0: delta = 1 expander = expandable_items[index] old_height = expander.height expander.height += delta delta = expander.height - old_height if delta == 0: expandable_items.pop(index) n -= 1 else: used_space += delta index += 1 #print "AS/US - after",self,[o.height for o in expandable_items] self._applyHeight(spacers = self.spacer[:]) def _getExpanders(self,vertical=True): expanders = [] spacers = self.spacer[:] for index, child in enumerate(self.children): if spacers and spacers[0].index == index: expanders.append( spacers.pop(0) ) if child.vexpand and vertical: expanders += [child]*child.vexpand if child.hexpand and not vertical: expanders += [child]*child.hexpand return expanders + spacers def _resetSpacers(self): for spacer in self.spacer: spacer.size = 0 class VBoxLayoutMixin(LayoutBase): """ A mixin class for a vertical layout. Do not use directly. """ def __init__(self,**kwargs): super(VBoxLayoutMixin,self).__init__(**kwargs) def resizeToContent(self, recurse = True): self._resetSpacers() max_w = self.getMaxChildrenWidth() x = self.margins[0] + self.border_size y = self.margins[1] + self.border_size for widget in self.children: widget.width = max_w y += widget.height + self.padding if self.children: y -= self.padding y += sum([spacer.min_size for spacer in self.spacer]) self.height = y + self.margins[1] + self.border_size + self._extra_border[1] self.width = max_w + 2*x + self._extra_border[0] self._applyHeight(spacers = self.spacer[:]) self._applyWidth() def expandContent(self): self._expandHeightSpacer() if not self.hexpand and self.parent:return for widget in self.children: widget.width = self.width - 2*self.margins[0] - 2*self.border_size - self._extra_border[0] def ydelta(self,widget):return widget.height + self.padding class HBoxLayoutMixin(LayoutBase): """ A mixin class for a horizontal layout. Do not use directly. """ def __init__(self,**kwargs): super(HBoxLayoutMixin,self).__init__(**kwargs) def resizeToContent(self, recurse = True): self._resetSpacers() max_h = self.getMaxChildrenHeight() x = self.margins[0] + self.border_size y = self.margins[1] + self.border_size for widget in self.children: widget.height = max_h x += widget.width + self.padding if self.children: x -= self.padding x += sum([spacer.min_size for spacer in self.spacer]) self.width = x + self.margins[0] + self._extra_border[0] self.height = max_h + 2*y + self._extra_border[1] self._applyHeight() self._applyWidth(spacers = self.spacer[:]) def expandContent(self): self._expandWidthSpacer() if not self.vexpand and self.parent:return for widget in self.children: widget.height = self.height - 2*self.margins[1] - 2*self.border_size - self._extra_border[1] def xdelta(self,widget):return widget.width + self.padding class Spacer(object): """ A spacer represents expandable or fixed 'whitespace' in the GUI. In a XML file you can get this by adding a inside a VBox or HBox element (Windows implicitly are VBox elements). Attributes ========== As with widgets a number of attributes can be set on a spacer (inside the XML definition). - min_size: Int: The minimal size this Spacer is allowed to have. - max_size: Int: The maximal size this Spacer is allowed to have. - fixed_size: Int: Set min_size and max_size to the same vale - effectively a Fixed size spacer. """ ATTRIBUTES = [ IntAttr('min_size'), IntAttr('size'), IntAttr('max_size'), IntAttr('fixed_size'), ] def __init__(self,parent=None,**kwargs): self.parent = parent self.min_size = 0 self.max_size = 1000 self.size = 0 def __str__(self): return "Spacer(parent.name='%s')" % getattr(self.parent,'name','None') def __repr__(self): return "" % (getattr(self.parent,'name','None'),id(self)) def _getSize(self): self.size = self._size return self._size def _setSize(self,size): self._size = max(self.min_size, min(self.max_size,size)) size = property(_getSize,_setSize) # Alias for size width = property(_getSize,_setSize) height = property(_getSize,_setSize) def _setFixedSize(self,size): self.min_size = self.max_size = size self.size = size fixed_size = property(fset=_setFixedSize) def _isExpanding(self): if self.min_size < self.max_size: return 1 return 0 vexpand = property(_isExpanding) hexpand = property(_isExpanding) fife_0.3.5/engine/python/fife/extensions/pychan/widgets/textbox.py0000664000175100017510000001101412205217523024437 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from common import * from widget import Widget class TextBox(Widget): """ An editable B{multiline} text edit widget. New Attributes ============== - text: The text in the TextBox. - filename: A write-only attribute - assigning a filename will cause the widget to load it's text from it. Data ==== The text can be read and set via L{distributeData} and L{collectData}. """ ATTRIBUTES = Widget.ATTRIBUTES + [ UnicodeAttr('text'), Attr('filename') ] DEFAULT_HEXPAND = 1 DEFAULT_VEXPAND = 1 DEFAULT_TEXT = u"" DEFAULT_FILENAME = "" def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, margins = None, text = None, filename = None): self.real_widget = fife.TextBox() self.text = text or self.DEFAULT_TEXT self.filename = filename or self.DEFAULT_FILENAME super(TextBox,self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand, font=font, base_color=base_color, background_color=background_color, foreground_color=foreground_color, selection_color=selection_color, border_size=border_size, position_technique=position_technique, is_focusable=is_focusable, comment=comment) # Prepare Data collection framework self.accepts_data = True self.accepts_initial_data = True # Make sense in a way ... self._realSetInitialData = self._setText self._realSetData = self._setText self._realGetData = self._getText def clone(self, prefix): textboxClone = TextBox(None, self._createNameWithPrefix(prefix), self.size, self.min_size, self.max_size, self.helptext, self.position, self.style, self.hexpand, self.vexpand, self.font, self.base_color, self.background_color, self.foreground_color, self.selection_color, self.border_size, self.position_technique, self.is_focusable, self.comment, self.margins, self.text, self.filename) return textboxClone def _getFileName(self): return self._filename def _loadFromFile(self,filename): self._filename = filename if not filename: return try: # FIXME needs encoding detection. self.text = unicode(open(filename).read(),"utf8") except Exception, e: self.text = str(e) filename = property(_getFileName, _loadFromFile) def resizeToContent(self,recurse=True): rows = [self.real_widget.getTextRow(i) for i in range(self.real_widget.getNumberOfRows())] max_w = max(map(self.real_font.getWidth,rows)) self.width = max_w self.height = (self.real_font.getHeight() + 2) * self.real_widget.getNumberOfRows() def _getText(self): return gui2text(self.real_widget.getText()) def _setText(self,text): self.real_widget.setText(text2gui(text)) text = property(_getText,_setText) def _setOpaque(self,opaque): self.real_widget.setOpaque(opaque) def _getOpaque(self): return self.real_widget.isOpaque() opaque = property(_getOpaque,_setOpaque) fife_0.3.5/engine/python/fife/extensions/pychan/widgets/percentagebar.py0000664000175100017510000001017512205217523025553 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from common import * from widget import Widget class PercentageBar(Widget): """ A percentage bar widget New Attributes ============== - orientation: 1 = horizontal, 0=vertical - value: int: default 0 """ HORIZONTAL = fife.PercentageBar.HORIZONTAL VERTICAL = fife.PercentageBar.VERTICAL ATTRIBUTES = Widget.ATTRIBUTES + [ IntAttr('orientation'), IntAttr('value') ] DEFAULT_HEXPAND = 1 DEFAULT_VEXPAND = 0 DEFAULT_MIN_SIZE = 10,10 DEFAULT_VALUE = 0 DEFAULT_ORIENTATION = HORIZONTAL def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, value = None, orientation = None): self.real_widget = fife.PercentageBar() self.orientation = self.DEFAULT_ORIENTATION self.value = self.DEFAULT_VALUE super(PercentageBar, self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand, font=font, base_color=base_color, background_color=background_color, foreground_color=foreground_color, selection_color=selection_color, border_size=border_size, position_technique=position_technique, is_focusable=is_focusable, comment=comment) if orientation is not None: self.orientation = orientation if value is not None: self.value = value self.accepts_data = True self._realSetData = self._setValue self._realGetData = self._getValue def clone(self, prefix): pbarClone = PercentageBar(None, self._createNameWithPrefix(prefix), self.size, self.min_size, self.max_size, self.helptext, self.position, self.style, self.hexpand, self.vexpand, self.font, self.base_color, self.background_color, self.foreground_color, self.selection_color, self.border_size, self.position_technique, self.is_focusable, self.comment, self.value, self.orientation) return pbarClone def _getValue(self): """getValue(self) -> int""" return self.real_widget.getValue() def _setValue(self, value): """setValue(self, int value)""" if type(value) != int: raise RuntimeError("PercentageBar only accepts integer values") self.real_widget.setValue(value) value = property(_getValue, _setValue) def _setOrientation(self, orientation): """setOrientation(self, Orientation orientation)""" self.real_widget.setOrientation(orientation) def _getOrientation(self): """getOrientation(self) -> int""" return self.real_widget.getOrientation() orientation = property(_getOrientation, _setOrientation) fife_0.3.5/engine/python/fife/extensions/pychan/widgets/common.py0000664000175100017510000000461712205217523024245 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from fife import fife from fife.extensions.pychan import tools from fife.extensions.pychan import events from fife.extensions.pychan.exceptions import * from fife.extensions.pychan.attrs import Attr,UnicodeAttr, PointAttr,ColorAttr,BoolAttr,IntAttr,FloatAttr from fife.extensions.pychan.properties import ColorProperty AlignTop, AlignBottom, AlignLeft, AlignRight, AlignCenter = range(5) def get_manager(): from fife.extensions import pychan return pychan.manager def text2gui(text): """ This function is applied to all text set on widgets. It replaces tabs by four spaces. It assumes the text to be a unicode object. """ if not isinstance(text,unicode): print "Widget text needs to be set from an unicode object. Got: '%s'" % repr(text) text = unicode(text,"utf8") return text.encode("utf8",*get_manager().unicodePolicy).replace("\t"," "*4).replace("[br]","\n") def gui2text(text): """ This function is applied to all text get from widgets. Translates the encoded string into a unicode object. """ return unicode(text,"utf8",*get_manager().unicodePolicy) def gui2str(text): """ This function returns an 8-bit representation of the unicode string. This is useful for passing strings to SWIG functions. """ try: return text.__str__() except: # String contains non-ascii characters return text.encode("utf-8") def isLayouted(widget): from layout import LayoutBase return isinstance(widget,LayoutBase) fife_0.3.5/engine/python/fife/extensions/pychan/widgets/__init__.py0000664000175100017510000000470612205217523024513 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### ### Widget/Container Base Classes ### """ Widget wrappers. Please look at the documentation of L{Widget} for details. """ from widget import Widget from layout import Spacer from containers import Container, VBox, HBox, Window from label import Label from icon import Icon from buttons import Button, ToggleButton, ImageButton from checkbox import CheckBox from radiobutton import RadioButton from textfield import TextField from textbox import TextBox from listbox import ListBox from dropdown import DropDown from scrollarea import ScrollArea from slider import Slider from percentagebar import PercentageBar # Global Widget Class registry WIDGETS = { # Containers "Container" : Container, "Window" : Window, "VBox" : VBox, "HBox" : HBox, "ScrollArea" :ScrollArea, # Simple Widgets "Icon" : Icon, "Label" : Label, "PercentageBar" : PercentageBar, # Button Widgets "Button" : Button, "CheckBox" : CheckBox, "RadioButton" : RadioButton, "ImageButton" : ImageButton, "ToggleButton" : ToggleButton, #Complexer Widgets / Text io "TextField" : TextField, "TextBox" : TextBox, "ListBox" : ListBox, "DropDown" : DropDown, "Slider" : Slider } def registerWidget(cls): """ Register a new Widget class for pychan. If the widget class name is already used you will overwrite the existing definition. There is no warning to tell you if this has happened. Be sure to understand what you are doing here! """ global WIDGETS name = cls.__name__ WIDGETS[name] = cls fife_0.3.5/engine/python/fife/extensions/pychan/widgets/radiobutton.py0000664000175100017510000001012312205217523025274 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from common import * from basictextwidget import BasicTextWidget class RadioButton(BasicTextWidget): """ A basic radiobutton (an exclusive checkbox). New Attributes ============== - marked: Boolean: Whether the checkbox is checked or not. - group: String: All RadioButtons with the same group name can only be checked exclusively. Data ==== The marked status can be read and set via L{distributeData} and L{collectData} """ ATTRIBUTES = BasicTextWidget.ATTRIBUTES + [ BoolAttr('marked'), Attr('group') ] DEFAULT_GROUP = "_no_group_" def __init__(self, parent = None, name = None, size = None, min_size = None, max_size = None, helptext = None, position = None, style = None, hexpand = None, vexpand = None, font = None, base_color = None, background_color = None, foreground_color = None, selection_color = None, border_size = None, position_technique = None, is_focusable = None, comment = None, margins = None, text = None, group = None): self.real_widget = fife.RadioButton() self.group = self.DEFAULT_GROUP super(RadioButton,self).__init__(parent=parent, name=name, size=size, min_size=min_size, max_size=max_size, helptext=helptext, position=position, style=style, hexpand=hexpand, vexpand=vexpand, font=font, base_color=base_color, background_color=background_color, foreground_color=foreground_color, selection_color=selection_color, border_size=border_size, position_technique=position_technique, is_focusable=is_focusable, comment=comment, text=text) if group is not None: self.group = group # Prepare Data collection framework self.accepts_data = True self._realGetData = self._isMarked self._realSetData = self._setMarked # Initial data stuff inherited. def clone(self, prefix): rbuttonClone = RadioButton(None, self._createNameWithPrefix(prefix), self.size, self.min_size, self.max_size, self.helptext, self.position, self.style, self.hexpand, self.vexpand, self.font, self.base_color, self.background_color, self.foreground_color, self.selection_color, self.border_size, self.position_technique, self.is_focusable, self.comment, self.margins, self.text, self.group) return rbuttonClone def _isMarked(self): return self.real_widget.isSelected() def _setMarked(self,mark): self.real_widget.setSelected(mark) marked = property(_isMarked,_setMarked) def _setGroup(self,group): self.real_widget.setGroup(group) def _getGroup(self): return self.real_widget.getGroup() group = property(_getGroup,_setGroup) def resizeToContent(self,recurse=True): self.width = self.real_font.getWidth(text2gui(self.text)) + 35# Size of the Checked box? self.height = self.real_font.getHeight() fife_0.3.5/engine/python/fife/extensions/pychan/autoposition.py0000664000175100017510000000712512205217523024041 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### """ Automatic widget positioning ============================ You can use the C{position_technique} attribute on top level widgets which can also be set from xml. For direct use call L{placeWidget}. """ from internal import screen_width, screen_height from exceptions import PyChanException EXPLICIT = "explicit" AUTOMATIC = "automatic" TOP = "top" LEFT = "left" RIGHT = "right" CENTER = "center" BOTTOM = "bottom" def _splicePosition(p): if "+" in p: technique,delta = p.split("+") elif "-" in p: technique,delta = p.split("-") delta = '-' + delta else: technique,delta = p,0 delta = int(delta) return technique,delta def _parsePosition(position): try: if position == AUTOMATIC: position = "center+0:center+0" x_pos,y_pos = position.split(":") x_pos, x_delta = _splicePosition(x_pos) y_pos, y_delta = _splicePosition(y_pos) if x_pos not in [EXPLICIT,LEFT,CENTER,RIGHT]: raise if y_pos not in [EXPLICIT,TOP,CENTER,BOTTOM]: raise except: raise PyChanException("Malformed position definition: " + repr(position)) return x_pos,x_delta,y_pos,y_delta def placeWidget(widget,position): """ Place a widget according to a string defining relative coordinates to screen borders. The position definition has to be of the form: C{":"} C{} may be one of: - left - right - center - explicit C{} may be one of: - top - bottom - center - explicit C{explicit} means that the widgets x or y position will not be touched. The rest should be self explanatory. C{} and C{} must be of the form: +pixel_number or -pixel_number. Or completely omitted. Note that the sign has to be there for for positive deltas, too. For brevity two shortcuts exist: - "explicit" -> "explicit:explicit" - "automatic" -> "center:center" A few examples:: "right-20:top" "center:top+10" "center:center" @param widget: The PyChan widget. @param position: A position definition. If the position cannot be parsed a L{PyChanException} is thrown. """ if position == EXPLICIT: return x_pos,x_delta,y_pos,y_delta = _parsePosition(position) x,y = widget.position w,h = widget.size if x_pos == CENTER: x = (screen_width()-w)/2 + x_delta if y_pos == CENTER: y = (screen_height()-h)/2 + y_delta if x_pos == LEFT: x = x_delta if y_pos == TOP: y = y_delta if x_pos == RIGHT: x = screen_width() - w + x_delta if y_pos == BOTTOM: y = screen_height() - h + y_delta widget.position = x,y fife_0.3.5/engine/python/fife/extensions/pychan/fonts.py0000664000175100017510000000541112205217523022431 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### # Font handling from exceptions import * class Font(object): def __init__(self,name,get): from internal import get_manager self.font = None self.name = name self.typename = get("type") self.source = get("source") self.row_spacing = int(get("row_spacing",0)) self.glyph_spacing = int(get("glyph_spacing",0)) if self.typename == "truetype": self.size = int(get("size")) self.antialias = int(get("antialias",1)) self.color = map(int,get("color","255,255,255").split(',')) self.font = get_manager().createFont(self.source,self.size,"") if self.font is None: raise InitializationError("Could not load font %s" % name) self.font.setAntiAlias(self.antialias) self.font.setColor(*self.color) else: raise InitializationError("Unsupported font type %s" % self.typename) self.font.setRowSpacing( self.row_spacing ) self.font.setGlyphSpacing( self.glyph_spacing ) @staticmethod def loadFromFile(filename): """ Static method to load font definitions out of a PyChan config file. """ import ConfigParser fontdef = ConfigParser.ConfigParser() fontdef.read(filename) sections = [section for section in fontdef.sections() if section.startswith("Font/")] fonts = [] for section in sections: name = section[5:] def _get(name,default=None): if fontdef.has_option(section,name): return fontdef.get(section,name) return default fonts.append( Font(name,_get) ) return fonts def __str__(self): return "Font(source='%s')" % self.source def __repr__(self): return "" % (self.source,id(self)) def loadFonts(filename): """ Load fonts from a config file. These are then available via their name. """ from internal import get_manager for font in Font.loadFromFile(filename): get_manager().addFont(font) fife_0.3.5/engine/python/fife/extensions/pychan/dialogs.py0000664000175100017510000001502512205217523022724 0ustar waynewayne# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE 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 # #################################################################### from fife.extensions import pychan from fife.extensions.pychan import loadXML import fife.extensions.pychan.tools as tools import widgets from internal import get_manager, screen_width, screen_height from StringIO import StringIO OK,YES,NO,CANCEL = True,True,False,None def print_event(**kwargs): print kwargs class XMLDialog(object): def __init__(self, xml, ok_field = None, cancel_field = None,initial_data={},data={}): self.gui = loadXML(xml) self.ok_field = ok_field self.cancel_field = cancel_field self.initial_data= initial_data self.data= data self.max_size=None self.min_size=None # self.gui.capture(print_event,"mouseEntered") def execute(self): self.gui.distributeInitialData(self.initial_data) self.gui.distributeData(self.data) screen_w, screen_h = screen_width(), screen_height() if self.max_size is None: self.max_size = screen_w/2, screen_h/3 if self.min_size is None: self.min_size = screen_w/2, screen_h/4 self.gui.max_size = self.max_size self.gui.min_size = self.min_size resultMap = {} if self.gui.findChild(name="okButton"): resultMap["okButton"] = OK if self.gui.findChild(name="cancelButton"): resultMap["cancelButton"] = CANCEL if self.gui.findChild(name="yesButton"): resultMap["noButton"] = NO if self.gui.findChild(name="yesButton"): resultMap["yesButton"] = YES ok = self.gui.execute(resultMap) if ok: return self.getOkResult() return self.getCancelResult() def getOkResult(self): if self.ok_field: return self.gui.collectData(self.ok_field) return True def getCancelResult(self): if self.cancel_field: return self.gui.collectData(self.cancel_field) return False MESSAGE_BOX_XML = """\