PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
PEnvironment Class Referenceabstract

#include <PEnvironment.h>

Inheritance diagram for PEnvironment:
PlatformEnvironment PlatformEnvironment

Public Member Functions

 PEnvironment ()
 
virtual ~PEnvironment ()
 
virtual void Initialize ()=0
 
virtual bool IsInitialized ()
 
virtual bool AddWindow (PWindow *window)
 
virtual PWindowGetWindow (int index=0)
 
virtual bool RemoveWindow (PWindow *window)
 
virtual std::string GetSystemLocale ()=0
 
virtual bool IsSystemLocaleRTL ()=0
 

Protected Member Functions

virtual std::ostream & SendToStream (std::ostream &out) const
 

Protected Attributes

bool mIsInitialized
 
std::list< PWindow * > mWindows
 

Detailed Description

This class, a subtype of PEBLObjectBase, initiates the interface environment and maintians all widgets, sounds, etc. subtypes include sounds, visual objects, etc. It is a virtual class that needs to be inherited by a PlatformEnvironment, have and have its methods overridden.

Definition at line 39 of file PEnvironment.h.

Constructor & Destructor Documentation

◆ PEnvironment()

PEnvironment::PEnvironment ( )
inline

Definition at line 43 of file PEnvironment.h.

43:mIsInitialized(false){};
bool mIsInitialized

◆ ~PEnvironment()

PEnvironment::~PEnvironment ( )
virtual

Definition at line 57 of file PEnvironment.cpp.

58{
59
60
61}

Member Function Documentation

◆ AddWindow()

bool PEnvironment::AddWindow ( PWindow window)
virtual

Definition at line 30 of file PEnvironment.cpp.

31{
32 mWindows.push_front(window);
33 return true;
34}
std::list< PWindow * > mWindows

References mWindows.

Referenced by main(), and PEBLObjects::MakeWindow().

◆ GetSystemLocale()

virtual std::string PEnvironment::GetSystemLocale ( )
pure virtual

◆ GetWindow()

PWindow * PEnvironment::GetWindow ( int  index = 0)
virtual

Definition at line 46 of file PEnvironment.cpp.

47{
48 //index is not used--it just gets the first window on the list.
49 PWindow * retval = NULL;
50
51 if(mWindows.size()>0)
52 retval= *(mWindows.begin());
53
54 return retval;
55}
#define NULL
Definition BinReloc.cpp:317

References mWindows, and NULL.

◆ Initialize()

virtual void PEnvironment::Initialize ( )
pure virtual

◆ IsInitialized()

virtual bool PEnvironment::IsInitialized ( )
inlinevirtual

Definition at line 47 of file PEnvironment.h.

47{return mIsInitialized;}

References mIsInitialized.

◆ IsSystemLocaleRTL()

virtual bool PEnvironment::IsSystemLocaleRTL ( )
pure virtual

◆ RemoveWindow()

bool PEnvironment::RemoveWindow ( PWindow window)
virtual

Definition at line 36 of file PEnvironment.cpp.

37{
38 //std::cout << "Removing window from mWindows: " << mWindows.size() <<std::endl;
39 mWindows.remove(window);
40 //std::cout << "Removed window from mWindows: " << mWindows.size() <<std::endl;
41 return true;
42}

References mWindows.

Referenced by PWindow::~PWindow().

◆ SendToStream()

virtual std::ostream & PEnvironment::SendToStream ( std::ostream &  out) const
inlineprotectedvirtual

Reimplemented in PlatformEnvironment, and PlatformEnvironment.

Definition at line 68 of file PEnvironment.h.

68{return out;};

Member Data Documentation

◆ mIsInitialized

bool PEnvironment::mIsInitialized
protected

◆ mWindows


The documentation for this class was generated from the following files: