|
PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
|
#include <PlatformWindow.h>
Public Member Functions | |
| PlatformWindow (PlatformEnvironment *penv) | |
| Standard Constructor. | |
| ~PlatformWindow () | |
| Standard Destructor. | |
| bool | Initialize (PEBLVideoMode mode, PEBLVideoDepth vdepth, bool windowed, bool resizeable, unsigned int width, unsigned int height) |
| This method initiates everything needed to display the main window. | |
| int | GetVideoFlags () |
| bool | Resize (int w, int h) |
| bool | Draw () |
| long int | DrawFor (unsigned int cycles) |
| SDL_Window * | GetSDLWindow () |
| int | SaveScreenShot (int x, int y, int w, int h, const Variant fname) |
| PlatformWindow (PlatformEnvironment *env) | |
| virtual | ~PlatformWindow () |
| virtual bool | Draw () |
| virtual std::string | ObjectName () const |
| virtual int | SaveScreenShot (int x, int y, int w, int h, const Variant fname) |
| virtual bool | Initialize (PEBLVideoMode mode, PEBLVideoDepth depth, bool windowed, bool resizeable, unsigned int width, unsigned int height) |
| virtual bool | Resize (int w, int h) |
| virtual long int | DrawFor (unsigned int cycles) |
| virtual bool | SetProperty (std::string name, Variant v) |
| virtual ObjectValidationError | ValidateProperty (std::string name, Variant v) const |
| virtual ObjectValidationError | ValidateProperty (std::string name) const |
| virtual pInt | GetWidth () const |
| virtual pInt | GetHeight () const |
| virtual void | SetPosition (pInt x, pInt y) |
| This sets the widget's position on its parent widget. | |
| virtual void | SetBackgroundColor (const PColor &color) |
Public Member Functions inherited from PWindow | |
| PWindow (PEnvironment *penv) | |
| virtual | ~PWindow () |
| virtual Variant | GetProperty (std::string) const |
Public Member Functions inherited from PWidget | |
| PWidget () | |
| PWidget (const PWidget &pw) | |
| PWidget (pInt x, pInt y, pInt width, pInt height, bool visible) | |
| virtual | ~PWidget () |
| virtual void | SetParent (PWidget *widget) |
| This unconditionally sets the parent widget. | |
| virtual PWidget * | GetParent () |
| virtual bool | IsParent (PWidget *parent) |
| virtual void | SetZoomX (pDouble x) |
| This sets the widget's position on its parent widget. | |
| virtual void | SetZoomY (pDouble x) |
| This sets the widget's position on its parent widget. | |
| virtual void | SetRotation (pDouble x) |
| This sets the widget's position on its parent widget. | |
| virtual void | SetWidth (pInt w) |
| virtual void | SetHeight (pInt h) |
| virtual pInt | GetX () const |
| virtual pInt | GetY () const |
| virtual PColor | GetBackgroundColor () |
| virtual bool | AddSubWidget (PWidget *widget) |
| virtual bool | RemoveSubWidget (PWidget *widget) |
| virtual bool | RemoveLastSubWidget () |
| This is probably pretty useless. | |
| virtual void | Show () |
| virtual void | Hide () |
| virtual bool | IsVisible () const |
Public Member Functions inherited from PEBLObjectBase | |
| PEBLObjectBase () | |
| Standard Constructor. | |
| PEBLObjectBase (ComplexDataType cdt) | |
| Standard Constructor. | |
| PEBLObjectBase (const PEBLObjectBase &pob) | |
| virtual | ~PEBLObjectBase () |
| Standard Destructor. | |
| virtual bool | InitializeProperty (std::string name, Variant v) |
| Variant | GetProperty (std::string) const |
| ComplexDataType | GetType () |
| virtual std::ostream & | PrintProperties (std::ostream &out) |
| virtual Variant | GetPropertyList () |
Public Member Functions inherited from PlatformWidget | |
| PlatformWidget () | |
| virtual | ~PlatformWidget () |
| virtual SDL_Texture * | GetSDL_Texture () |
| Used to extract an SDL surface from the widget. Used by children drawing themselves on their parent. | |
| void | SetParent (PlatformWidget *parent) |
| SDL_Surface * | GetSurface () |
| virtual bool | SetRenderer (SDL_Renderer *renderer) |
| SDL_Renderer * | GetRenderer () |
| virtual bool | AddToParentWidget (PlatformWidget *parent) |
| virtual bool | AddSubWidget (PlatformWidget *widget) |
| virtual bool | RemoveSubWidget (PlatformWidget *widget) |
| virtual bool | RemoveSubWidgets () |
| virtual bool | RotoZoom (double angle, double zoomx, double zoomy, int smooth) |
| This uses the SDL_gfx package to 'rotozoom'. | |
| bool | SetPoint (int x, int y, PColor col) |
| PColor | GetPixel (int x, int y) |
| PlatformWidget () | |
| PlatformWidget (pInt x, pInt y, pInt width, pInt height, bool visible) | |
| virtual | ~PlatformWidget () |
| virtual bool | RotoZoom (pDouble angle, pDouble zoomx, pDouble zoomy, pInt smooth) |
| virtual bool | SetPoint (pInt x, pInt y, PColor col) |
| virtual PColor | GetPixel (pInt x, pInt y) |
Protected Member Functions | |
| virtual std::ostream & | SendToStream (std::ostream &out) const |
| An inheritable printing class used by PEBLObjectBase::operator<<. | |
| virtual std::string | ObjectName () const |
| virtual std::ostream & | SendToStream (std::ostream &out) const |
| An inheritable printing class used by PEBLObjectBase::operator<<. | |
Protected Member Functions inherited from PlatformWidget | |
| virtual void | PrintSubWidgets (std::ostream &out) const |
| virtual bool | LockSurface () |
| This needs to be used on some platforms/video cards. | |
| virtual bool | UnlockSurface () |
| This needs to be used on some platforms/video cards. | |
Additional Inherited Members | |
Protected Attributes inherited from PWindow | |
| PEnvironment * | mEnv |
Protected Attributes inherited from PWidget | |
| pInt | mX |
| pInt | mY |
| pInt | mDrawX |
| pInt | mDrawY |
| pInt | mWidth |
| pInt | mHeight |
| pDouble | mZoomX |
| pDouble | mZoomY |
| pDouble | mRotation |
| PColor | mBackgroundColor |
| The background color of the widget. if alpha = 0, will not be painted. | |
| std::list< PWidget * > | mSubWidgets |
| bool | mIsVisible |
| PWidget * | mParent |
Protected Attributes inherited from PEBLObjectBase | |
| ComplexDataType | mCDT |
| std::map< std::string, Variant > | mProperties |
Protected Attributes inherited from PlatformWidget | |
| pInt | mTextureWidth |
| pInt | mTextureHeight |
| bool | mNeedsTexture |
| SDL_Texture * | mTexture |
| SDL_Surface * | mSurface |
| SDL_Renderer * | mRenderer |
This class instantiates a PWindow using platform-specific code.
Headless platform window - no actual display Used for validation mode where no window is needed
Definition at line 48 of file sdl/PlatformWindow.h.
| PlatformWindow::PlatformWindow | ( | PlatformEnvironment * | penv | ) |
Standard Constructor.
Definition at line 56 of file sdl/PlatformWindow.cpp.
References CDT_WINDOW, PEBLObjectBase::mCDT, PlatformWidget::mRenderer, PlatformWidget::mSurface, PlatformWidget::mTexture, NULL, and PWidget::SetBackgroundColor().
| PlatformWindow::~PlatformWindow | ( | ) |
| PlatformWindow::PlatformWindow | ( | PlatformEnvironment * | env | ) |
|
virtual |
|
virtual |
This draws the subwidgets. It doesn't need a 'parent' argument, because 'this' is it.
Reimplemented from PWindow.
Definition at line 427 of file sdl/PlatformWindow.cpp.
References counted_ptr< X >::get(), PColor::GetAlpha(), PColor::GetBlue(), Variant::GetComplexData(), PColor::GetGreen(), PComplexData::GetObject(), PEBLObjectBase::GetProperty(), PColor::GetRed(), PWidget::mBackgroundColor, PlatformWidget::mRenderer, PWidget::mSubWidgets, PlatformWidget::mSurface, NULL, and PError::SignalFatalError().
Referenced by DrawFor(), and Initialize().
|
virtual |
This draws the subwidgets. It doesn't need a 'parent' argument, because 'this' is it.
Reimplemented from PWindow.
| long int PlatformWindow::DrawFor | ( | unsigned int | cycles | ) |
Definition at line 521 of file sdl/PlatformWindow.cpp.
References Draw().
Referenced by PEBLObjects::DrawFor().
|
inlinevirtual |
Definition at line 45 of file validator/PlatformWindow.h.
|
inlinevirtual |
Reimplemented from PWidget.
Definition at line 60 of file validator/PlatformWindow.h.
References PWidget::GetHeight().
Referenced by PEBLStream::WritePNG().
|
inline |
Definition at line 72 of file sdl/PlatformWindow.h.
Referenced by SDLUtility::PopupErrorBox().
| int PlatformWindow::GetVideoFlags | ( | ) |
Definition at line 92 of file sdl/PlatformWindow.cpp.
|
inlinevirtual |
Reimplemented from PWidget.
Definition at line 59 of file validator/PlatformWindow.h.
References PWidget::GetWidth().
Referenced by PEBLStream::WritePNG().
|
inlinevirtual |
Definition at line 43 of file validator/PlatformWindow.h.
| bool PlatformWindow::Initialize | ( | PEBLVideoMode | mode, |
| PEBLVideoDepth | vdepth, | ||
| bool | windowed, | ||
| bool | resizeable, | ||
| unsigned int | width, | ||
| unsigned int | height | ||
| ) |
This method initiates everything needed to display the main window.
This shouldn't be necessary, but if we specify the same screensize as the window, it goes to fake fullscreen mode.
Definition at line 102 of file sdl/PlatformWindow.cpp.
References VariableMap::AddVariable(), Draw(), VariableMap::Exists(), SDLUtility::GetDriverList(), Variant::GetString(), Evaluator::gGlobalVariableMap, PlatformWidget::mRenderer, PlatformWidget::mSurface, myEval, NULL, VariableMap::RetrieveValue(), PWidget::SetProperty(), PError::SignalFatalError(), and PEBLEnvironment::TimeStamp().
Referenced by main(), and PEBLObjects::MakeWindow().
|
inlineprotectedvirtual |
Reimplemented from PWindow.
Definition at line 78 of file sdl/PlatformWindow.h.
|
inlinevirtual |
Reimplemented from PWindow.
Definition at line 41 of file validator/PlatformWindow.h.
| bool PlatformWindow::Resize | ( | int | w, |
| int | h | ||
| ) |
Definition at line 555 of file sdl/PlatformWindow.cpp.
References VariableMap::AddVariable(), Evaluator::gGlobalVariableMap, PlatformWidget::mSurface, myEval, and VariableMap::RetrieveValue().
Referenced by PEBLObjects::ResizeWindow().
|
inlinevirtual |
Definition at line 44 of file validator/PlatformWindow.h.
| int PlatformWindow::SaveScreenShot | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h, | ||
| const Variant | fname | ||
| ) |
Definition at line 578 of file sdl/PlatformWindow.cpp.
References PlatformWidget::mRenderer, and SDLUtility::WritePNG().
Referenced by PEBLStream::WritePNG().
|
inlinevirtual |
Definition at line 42 of file validator/PlatformWindow.h.
|
protectedvirtual |
An inheritable printing class used by PEBLObjectBase::operator<<.
Reimplemented from PWindow.
Definition at line 45 of file validator/PlatformWindow.cpp.
|
protectedvirtual |
An inheritable printing class used by PEBLObjectBase::operator<<.
Reimplemented from PWindow.
|
inlinevirtual |
Reimplemented from PWidget.
Definition at line 64 of file validator/PlatformWindow.h.
References PWidget::SetBackgroundColor().
Referenced by main(), and PEBLObjects::MakeWindow().
This sets the widget's position on its parent widget.
Sets the location of the upper left-hand corner of the image on the parent widget; unless overridden
Reimplemented from PWidget.
Definition at line 63 of file validator/PlatformWindow.h.
References PWidget::SetPosition().
|
inlinevirtual |
Reimplemented from PWindow.
Definition at line 48 of file validator/PlatformWindow.h.
References PWindow::SetProperty().
|
inlinevirtual |
Reimplemented from PWindow.
Definition at line 54 of file validator/PlatformWindow.h.
References PWindow::ValidateProperty().
|
inlinevirtual |
Reimplemented from PWindow.
Definition at line 51 of file validator/PlatformWindow.h.
References PWindow::ValidateProperty().