PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
PEnvironment.h
Go to the documentation of this file.
1//* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
3// Name: src/objects/PEnvironment.h
4// Purpose: Contains generic specs for a PEBL Environment
5// Author: Shane T. Mueller, Ph.D.
6// Copyright: (c) 2003-2026 Shane T. Mueller <smueller@obereed.net>
7// License: GPL 2
8//
9//
10//
11// This file is part of the PEBL project.
12//
13// PEBL is free software; you can redistribute it and/or modify
14// it under the terms of the GNU General Public License as published by
15// the Free Software Foundation; either version 2 of the License, or
16// (at your option) any later version.
17//
18// PEBL is distributed in the hope that it will be useful,
19// but WITHOUT ANY WARRANTY; without even the implied warranty of
20// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21// GNU General Public License for more details.
22//
23// You should have received a copy of the GNU General Public License
24// along with PEBL; if not, write to the Free Software
25// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27#ifndef __PENVIRONMENT_H__
28#define __PENVIRONMENT_H__
29
30#include "../base/PEBLObject.h"
31//#include "PWindow.h"
32class PWindow;
38
40{
41public:
42
44 virtual ~PEnvironment();
45
46 virtual void Initialize()=0;
47 virtual bool IsInitialized(){return mIsInitialized;}
48
49 virtual bool AddWindow(PWindow * window);
50
51 virtual PWindow * GetWindow(int index=0);
52 //virtual std::string GetExecutableName(){return mExecutableName;};
53 //virtual void SetExecutableName(std::string name){mExecutableName=name;};
54
55 //This removes a window from the window list.
56 virtual bool RemoveWindow(PWindow * window);
57
58 // Platform-specific locale queries
59 // Get the system locale from OS settings (e.g., "ar", "en_US", "zh_CN", "he_IL")
60 // Returns empty string on error or if not supported
61 virtual std::string GetSystemLocale() = 0;
62
63 // Check if the system locale uses right-to-left text (Arabic, Hebrew)
64 virtual bool IsSystemLocaleRTL() = 0;
65
66
67protected:
68 virtual std::ostream & SendToStream(std::ostream& out) const {return out;};
69
71
72 //std::string mExecutableName;
73 // The main environment can
74 // hold multiple PWindows; usually just one, but more if
75 // you want separate interfaces for the subject and the experimenter.
76 std::list<PWindow*> mWindows;
77
78};
79
80
81#endif
virtual std::ostream & SendToStream(std::ostream &out) const
virtual ~PEnvironment()
virtual bool AddWindow(PWindow *window)
bool mIsInitialized
virtual void Initialize()=0
virtual bool RemoveWindow(PWindow *window)
std::list< PWindow * > mWindows
virtual PWindow * GetWindow(int index=0)
virtual std::string GetSystemLocale()=0
virtual bool IsSystemLocaleRTL()=0
virtual bool IsInitialized()