Mercurial > fife-parpg
view engine/swigwrappers/python/extensions.i.templ @ 697:ecaa4d98f05f tip
Abstracted the GUI code and refactored the GUIChan-specific code into its own module.
* Most of the GUIChan code has been refactored into its own gui/guichan module. However, references to the GuiFont class still persist in the Engine and GuiManager code and these will need further refactoring.
* GuiManager is now an abstract base class which specific implementations (e.g. GUIChan) should subclass.
* The GUIChan GUI code is now a concrete implementation of GuiManager, most of which is in the new GuiChanGuiManager class.
* The GUI code in the Console class has been refactored out of the Console and into the GUIChan module as its own GuiChanConsoleWidget class. The rest of the Console class related to executing commands was left largely unchanged.
* Existing client code may need to downcast the GuiManager pointer received from FIFE::Engine::getGuiManager() to GuiChanGuiManager, since not all functionality is represented in the GuiManager abstract base class. Python client code can use the new GuiChanGuiManager.castTo static method for this purpose.
author | M. George Hansen <technopolitica@gmail.com> |
---|---|
date | Sat, 18 Jun 2011 00:28:40 -1000 |
parents | c0c3f64bfc2d |
children |
line wrap: on
line source
namespace FIFE { %extend PointType2D<int> { int getX() { return $self->x; } int getY() { return $self->y; } void setX(int _x) { $self->x = _x; } void setY(int _y) { $self->y = _y; } std::string __str__() { std::stringstream str; str << "Point" << *$self; return str.str(); } }; %extend PointType2D<double> { double getX() { return $self->x; } double getY() { return $self->y; } void setX(double _x) { $self->x = _x; } void setY(double _y) { $self->y = _y; } std::string __str__() { std::stringstream str; str << "DoublePoint" << *$self; return str.str(); } }; %extend PointType3D<int> { std::string __str__() { std::stringstream str; str << "Point3D" << *$self; return str.str(); } }; %extend PointType3D<double> { std::string __str__() { std::stringstream str; str << "DoublePoint3D" << *$self; return str.str(); } }; %extend RectType<int> { int getX() { return $self->x; } int getY() { return $self->y; } void setX(int _x) { $self->x = _x; } void setY(int _y) { $self->y = _y; } int getW() { return $self->w; } int getH() { return $self->h; } void setW(int _w) { $self->w = _w; } void setH(int _h) { $self->h = _h; } std::string __str__() { std::stringstream str; str << "Rect" << *$self; return str.str(); } }; %extend RectType<float> { float getX() { return $self->x; } float getY() { return $self->y; } void setX(float _x) { $self->x = _x; } void setY(float _y) { $self->y = _y; } float getW() { return $self->w; } float getH() { return $self->h; } void setW(float _w) { $self->w = _w; } void setH(float _h) { $self->h = _h; } std::string __str__() { std::stringstream str; str << "FloatRect" << *$self; return str.str(); } }; %extend RectType<double> { double getX() { return $self->x; } double getY() { return $self->y; } void setX(double _x) { $self->x = _x; } void setY(double _y) { $self->y = _y; } double getW() { return $self->w; } double getH() { return $self->h; } void setW(double _w) { $self->w = _w; } void setH(double _h) { $self->h = _h; } std::string __str__() { std::stringstream str; str << "DoubleRect" << *$self; return str.str(); } }; }