PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
validator/PlatformEnvironment.h
Go to the documentation of this file.
1//* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
3// Name: platforms/validator/PlatformEnvironment.h
4// Purpose: Validator Platform Environment (minimal stub)
5// Author: Shane T. Mueller, Ph.D.
6// Copyright: (c) 2025 Shane T. Mueller <smueller@obereed.net>
7// License: GPL 2
8//
9// This file is part of the PEBL project.
10//
11// PEBL is free software; you can redistribute it and/or modify
12// it under the terms of the GNU General Public License as published by
13// the Free Software Foundation; either version 2 of the License, or
14// (at your option) any later version.
15//
16// PEBL is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19// GNU General Public License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with PEBL; if not, write to the Free Software
23// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25#ifndef __VALIDATOR_PLATFORMENVIRONMENT_H__
26#define __VALIDATOR_PLATFORMENVIRONMENT_H__
27
28#include "../../objects/PEnvironment.h"
29#include "../../apps/Globals.h"
30#include "../../base/PEBLObject.h"
31#include <list>
32
33class PlatformWindow;
34
37class PlatformEnvironment : virtual public PEnvironment, public PEBLObjectBase {
38public:
40 bool windowed, bool resizeable, bool unicode);
42
43 // This method initiates everything needed (minimal in validator mode)
44 void Initialize();
45
46 virtual bool Draw();
47 PEBLVideoMode GetVideoMode() { return mVideoMode; };
48 PEBLVideoDepth GetVideoDepth() { return mVideoDepth; };
49 bool GetWindowed() { return mWindowed; };
50
51 Variant GetScreenModes(int screen = -1);
52 Variant GetResizeable() { return mResizeable; };
53
54 // Overloaded generic PEBLObjectBase methods
55 virtual bool SetProperty(std::string, Variant v);
56 virtual Variant GetProperty(std::string) const;
57
58 virtual int ShowCursor(int val);
59 virtual int SetCursorPosition(int x, int y);
61 virtual void SetKeyRepeat(bool onoff);
63 virtual bool GetUnicode() { return mUnicode; };
64
65 virtual int GetNumJoysticks();
66 virtual Variant GetJoystick(int index);
67
68 // Platform-specific locale queries (validator stubs - return defaults)
69 virtual std::string GetSystemLocale() { return ""; }
70 virtual bool IsSystemLocaleRTL() { return false; }
71
72protected:
73 virtual std::ostream& SendToStream(std::ostream& out) const;
74
75private:
76 PEBLVideoMode mVideoMode;
77 PEBLVideoDepth mVideoDepth;
78
79 bool mWindowed;
80 bool mResizeable;
81 bool mUnicode;
82 int mNumJoysticks;
83
84 void __SetProps__();
85};
86
87#endif
PEBLVideoDepth
Definition Globals.h:69
PEBLVideoMode
Definition Globals.h:58
virtual void SetKeyRepeat(bool onoff)
virtual int GetNumJoysticks()
virtual std::string GetSystemLocale()
virtual int ShowCursor(int val)
virtual bool SetProperty(std::string, Variant v)
virtual std::ostream & SendToStream(std::ostream &out) const
Variant GetScreenModes(int screen=-1)
virtual bool Draw()
virtual int SetCursorPosition(int x, int y)
virtual Variant GetJoystick(int index)
virtual Variant GetCursorPosition()
virtual ~PlatformEnvironment()
virtual Variant GetMouseState()
PlatformEnvironment(PEBLVideoMode mode, PEBLVideoDepth depth, bool windowed, bool resizeable, bool unicode)
virtual Variant GetProperty(std::string) const