|
PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
|
#include <PlatformWidget.h>
Public Member Functions | |
| PlatformWidget () | |
| virtual | ~PlatformWidget () |
| virtual bool | Draw () |
| This method initiates everything needed to display the main window | |
| 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 | Draw () |
| 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) |
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 bool | SetProperty (std::string, Variant v) |
| virtual Variant | GetProperty (std::string) const |
| virtual ObjectValidationError | ValidateProperty (std::string, Variant v) const |
| virtual ObjectValidationError | ValidateProperty (std::string) const |
| virtual void | SetParent (PWidget *widget) |
| This unconditionally sets the parent widget. | |
| virtual PWidget * | GetParent () |
| virtual bool | IsParent (PWidget *parent) |
| virtual void | SetPosition (pInt x, pInt y) |
| This sets the widget's position on its parent widget. | |
| 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 pInt | GetWidth () const |
| virtual pInt | GetHeight () const |
| virtual void | SetBackgroundColor (const PColor &color) |
| 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 |
| virtual std::string | ObjectName () 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 () |
Protected Member Functions | |
| virtual std::ostream & | SendToStream (std::ostream &out) const |
| An inheritable printing class used by PEBLObjectBase::operator<<. | |
| 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. | |
| virtual std::ostream & | SendToStream (std::ostream &out) const |
| An inheritable printing class used by PEBLObjectBase::operator<<. | |
Protected Attributes | |
| pInt | mTextureWidth |
| pInt | mTextureHeight |
| bool | mNeedsTexture |
| SDL_Texture * | mTexture |
| SDL_Surface * | mSurface |
| SDL_Renderer * | mRenderer |
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 |
This is the top-level widget of platform-specific widgets. Widgets inherit from PWidget along two pathways; through PlatformWidget and through their platform-general corresponding widget. This class is used to provide platform-specific drawing mechanisms that may prove useful. For SDL2 branch, the PlatformWidget class shuold ONLY hold a SDL_Texture. Individual subclasses may want SDL_Surface member objects to load things, but these should be transferred into textures on load or modification.
Headless platform widget - base class for all GUI objects All rendering methods are no-ops
Definition at line 44 of file sdl/PlatformWidget.h.
| PlatformWidget::PlatformWidget | ( | ) |
Definition at line 47 of file sdl/PlatformWidget.cpp.
|
virtual |
Definition at line 57 of file sdl/PlatformWidget.cpp.
References mNeedsTexture, PWidget::mParent, mSurface, mTexture, NULL, PWidget::RemoveSubWidget(), and RemoveSubWidgets().
| PlatformWidget::PlatformWidget | ( | ) |
Definition at line 30 of file validator/PlatformWidget.cpp.
|
virtual |
|
virtual |
Definition at line 404 of file sdl/PlatformWidget.cpp.
References PWidget::AddSubWidget(), GetRenderer(), PWidget::ObjectName(), SetParent(), SetRenderer(), and PError::SignalFatalError().
Referenced by PEBLObjects::AddObject(), and main().
|
virtual |
Definition at line 350 of file sdl/PlatformWidget.cpp.
References GetRenderer(), SetParent(), and SetRenderer().
|
virtual |
This method initiates everything needed to display the main window
Reimplemented from PWidget.
Reimplemented in PlatformCanvas, PlatformLine, PlatformThickLine, PlatformRectangle, PlatformSquare, PlatformEllipse, PlatformCircle, PlatformPolygon, PlatformBezier, PlatformImageBox, PlatformLabel, PlatformTextBox, PlatformWindow, PlatformCanvas, PlatformLine, PlatformThickLine, PlatformRectangle, PlatformSquare, PlatformEllipse, PlatformCircle, PlatformPolygon, PlatformBezier, PlatformImageBox, PlatformLabel, PlatformTextBox, and PlatformWindow.
Definition at line 104 of file sdl/PlatformWidget.cpp.
References count, GetSDL_Texture(), PWidget::IsVisible(), PWidget::mDrawX, PWidget::mDrawY, PWidget::mHeight, mNeedsTexture, PWidget::mParent, mRenderer, PWidget::mRotation, PWidget::mSubWidgets, mTexture, mTextureHeight, mTextureWidth, PWidget::mWidth, PWidget::mX, PWidget::mY, PWidget::mZoomX, PWidget::mZoomY, NULL, PWidget::SetPosition(), and PWidget::SetProperty().
Referenced by PlatformCanvas::Draw(), PlatformImageBox::Draw(), PlatformLabel::Draw(), PlatformTextBox::Draw(), and PEBLObjects::Draw().
|
virtual |
This draws the subwidgets. It doesn't need a 'parent' argument, because 'this' is it.
Reimplemented from PWidget.
Reimplemented in PlatformCanvas, PlatformLine, PlatformThickLine, PlatformRectangle, PlatformSquare, PlatformEllipse, PlatformCircle, PlatformPolygon, PlatformBezier, PlatformImageBox, PlatformLabel, PlatformTextBox, PlatformWindow, PlatformCanvas, PlatformLine, PlatformThickLine, PlatformRectangle, PlatformSquare, PlatformEllipse, PlatformCircle, PlatformPolygon, PlatformBezier, PlatformImageBox, PlatformLabel, PlatformTextBox, and PlatformWindow.
| PColor PlatformWidget::GetPixel | ( | int | x, |
| int | y | ||
| ) |
Definition at line 295 of file sdl/PlatformWidget.cpp.
References SDLUtility::GetPixelColor(), and mSurface.
Referenced by PEBLObjects::GetPixelColor().
Reimplemented from PWidget.
Definition at line 55 of file validator/PlatformWidget.cpp.
|
inline |
Definition at line 71 of file sdl/PlatformWidget.h.
References mRenderer.
Referenced by AddSubWidget(), and AddToParentWidget().
|
virtual |
Used to extract an SDL surface from the widget. Used by children drawing themselves on their parent.
Definition at line 344 of file sdl/PlatformWidget.cpp.
References mTexture.
Referenced by PlatformLine::Draw(), PlatformThickLine::Draw(), PlatformRectangle::Draw(), PlatformSquare::Draw(), PlatformEllipse::Draw(), PlatformCircle::Draw(), PlatformPolygon::Draw(), PlatformBezier::Draw(), Draw(), SDLUtility::DrawLine(), and SDLUtility::DrawPixel().
|
inline |
|
protectedvirtual |
This needs to be used on some platforms/video cards.
Definition at line 527 of file sdl/PlatformWidget.cpp.
References mSurface.
|
protectedvirtual |
Definition at line 502 of file sdl/PlatformWidget.cpp.
References PWidget::mSubWidgets.
|
virtual |
Definition at line 438 of file sdl/PlatformWidget.cpp.
References PWidget::mSubWidgets, NULL, PWidget::RemoveSubWidget(), and SetRenderer().
Referenced by PEBLObjects::RemoveObject().
|
virtual |
Reimplemented from PWidget.
Definition at line 456 of file sdl/PlatformWidget.cpp.
References PWidget::mSubWidgets.
Referenced by ~PlatformWidget().
|
virtual |
This uses the SDL_gfx package to 'rotozoom'.
Definition at line 309 of file sdl/PlatformWidget.cpp.
References PWidget::mHeight, mSurface, PWidget::mWidth, and PWidget::SetProperty().
Referenced by PEBLObjects::RotoZoom().
Reimplemented from PWidget.
Definition at line 42 of file validator/PlatformWidget.cpp.
References PWidget::mRotation, PWidget::mZoomX, and PWidget::mZoomY.
|
protectedvirtual |
An inheritable printing class used by PEBLObjectBase::operator<<.
Reimplemented from PWidget.
Reimplemented in PlatformCanvas, PlatformLine, PlatformThickLine, PlatformRectangle, PlatformSquare, PlatformEllipse, PlatformCircle, PlatformPolygon, PlatformBezier, PlatformImageBox, PlatformLabel, PlatformTextBox, PlatformWindow, PlatformCanvas, PlatformLine, PlatformThickLine, PlatformRectangle, PlatformSquare, PlatformEllipse, PlatformCircle, PlatformPolygon, PlatformBezier, PlatformImageBox, PlatformLabel, PlatformTextBox, and PlatformWindow.
Definition at line 92 of file sdl/PlatformWidget.cpp.
|
protectedvirtual |
An inheritable printing class used by PEBLObjectBase::operator<<.
Reimplemented from PWidget.
Reimplemented in PlatformCanvas, PlatformLine, PlatformThickLine, PlatformRectangle, PlatformSquare, PlatformEllipse, PlatformCircle, PlatformPolygon, PlatformBezier, PlatformImageBox, PlatformLabel, PlatformTextBox, PlatformWindow, PlatformCanvas, PlatformLine, PlatformThickLine, PlatformRectangle, PlatformSquare, PlatformEllipse, PlatformCircle, PlatformPolygon, PlatformBezier, PlatformImageBox, PlatformLabel, PlatformTextBox, and PlatformWindow.
| void PlatformWidget::SetParent | ( | PlatformWidget * | parent | ) |
Definition at line 482 of file sdl/PlatformWidget.cpp.
References PWidget::SetParent().
Referenced by AddSubWidget(), and AddToParentWidget().
| bool PlatformWidget::SetPoint | ( | int | x, |
| int | y, | ||
| PColor | col | ||
| ) |
Definition at line 287 of file sdl/PlatformWidget.cpp.
References SDLUtility::DrawPixel(), and mRenderer.
Referenced by PEBLObjects::SetPoint().
Reimplemented from PWidget.
Definition at line 50 of file validator/PlatformWidget.cpp.
|
virtual |
Definition at line 381 of file sdl/PlatformWidget.cpp.
References mRenderer, PWidget::mSubWidgets, and SetRenderer().
Referenced by AddSubWidget(), AddToParentWidget(), RemoveSubWidget(), and SetRenderer().
|
protectedvirtual |
This needs to be used on some platforms/video cards.
Definition at line 550 of file sdl/PlatformWidget.cpp.
References mSurface.
|
protected |
Definition at line 99 of file sdl/PlatformWidget.h.
Referenced by Draw(), PlatformBezier::PlatformBezier(), PlatformCanvas::PlatformCanvas(), PlatformCanvas::PlatformCanvas(), PlatformCanvas::PlatformCanvas(), PlatformCircle::PlatformCircle(), PlatformEllipse::PlatformEllipse(), PlatformImageBox::PlatformImageBox(), PlatformLine::PlatformLine(), PlatformPolygon::PlatformPolygon(), PlatformRectangle::PlatformRectangle(), PlatformSquare::PlatformSquare(), PlatformThickLine::PlatformThickLine(), and ~PlatformWidget().
|
protected |
Definition at line 106 of file sdl/PlatformWidget.h.
Referenced by PlatformLine::Draw(), PlatformThickLine::Draw(), PlatformRectangle::Draw(), PlatformSquare::Draw(), PlatformEllipse::Draw(), PlatformCircle::Draw(), PlatformPolygon::Draw(), PlatformBezier::Draw(), PlatformImageBox::Draw(), Draw(), PlatformWindow::Draw(), GetRenderer(), PlatformWindow::Initialize(), PlatformCanvas::PlatformCanvas(), PlatformCanvas::PlatformCanvas(), PlatformImageBox::PlatformImageBox(), PlatformLabel::PlatformLabel(), PlatformLabel::PlatformLabel(), PlatformTextBox::PlatformTextBox(), PlatformWidget(), PlatformWindow::PlatformWindow(), PlatformLabel::RenderText(), PlatformTextBox::RenderText(), PlatformCanvas::Reset(), PlatformWindow::SaveScreenShot(), SetPoint(), and SetRenderer().
|
protected |
Definition at line 102 of file sdl/PlatformWidget.h.
Referenced by PlatformImageBox::Draw(), PlatformWindow::Draw(), GetPixel(), GetSurface(), PlatformWindow::Initialize(), PlatformImageBox::LoadImage(), LockSurface(), PlatformBezier::PlatformBezier(), PlatformCanvas::PlatformCanvas(), PlatformCanvas::PlatformCanvas(), PlatformCanvas::PlatformCanvas(), PlatformCircle::PlatformCircle(), PlatformEllipse::PlatformEllipse(), PlatformImageBox::PlatformImageBox(), PlatformLabel::PlatformLabel(), PlatformLabel::PlatformLabel(), PlatformLine::PlatformLine(), PlatformPolygon::PlatformPolygon(), PlatformRectangle::PlatformRectangle(), PlatformSquare::PlatformSquare(), PlatformTextBox::PlatformTextBox(), PlatformThickLine::PlatformThickLine(), PlatformWidget(), PlatformWindow::PlatformWindow(), PlatformTextBox::RenderText(), PlatformCanvas::Reset(), PlatformWindow::Resize(), RotoZoom(), UnlockSurface(), and ~PlatformWidget().
|
protected |
Definition at line 101 of file sdl/PlatformWidget.h.
Referenced by PlatformImageBox::Draw(), PlatformLabel::Draw(), Draw(), GetSDL_Texture(), PlatformCanvas::PlatformCanvas(), PlatformCanvas::PlatformCanvas(), PlatformCanvas::PlatformCanvas(), PlatformImageBox::PlatformImageBox(), PlatformLabel::PlatformLabel(), PlatformLabel::PlatformLabel(), PlatformTextBox::PlatformTextBox(), PlatformWidget(), PlatformWindow::PlatformWindow(), PlatformLabel::RenderText(), PlatformTextBox::RenderText(), PlatformCanvas::Reset(), and ~PlatformWidget().
|
protected |
Definition at line 97 of file sdl/PlatformWidget.h.
Referenced by Draw(), PlatformImageBox::LoadImage(), PlatformCanvas::PlatformCanvas(), PlatformCanvas::PlatformCanvas(), PlatformCanvas::PlatformCanvas(), PlatformTextBox::PlatformTextBox(), PlatformLabel::RenderText(), PlatformTextBox::RenderText(), PlatformCanvas::Reset(), PlatformTextBox::SetHeight(), PlatformCanvas::SetHeight(), PlatformCanvas::SetZoomY(), and PlatformImageBox::SetZoomY().
|
protected |
Definition at line 96 of file sdl/PlatformWidget.h.
Referenced by Draw(), PlatformImageBox::LoadImage(), PlatformCanvas::PlatformCanvas(), PlatformCanvas::PlatformCanvas(), PlatformCanvas::PlatformCanvas(), PlatformTextBox::PlatformTextBox(), PlatformLabel::RenderText(), PlatformTextBox::RenderText(), PlatformCanvas::Reset(), PlatformTextBox::SetWidth(), PlatformCanvas::SetWidth(), PlatformCanvas::SetZoomX(), and PlatformImageBox::SetZoomX().