PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
validator/PlatformWindow.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/PlatformWindow.h
4// Purpose: Validator Platform Window (stub - no display)
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_PLATFORMWINDOW_H__
26#define __VALIDATOR_PLATFORMWINDOW_H__
27
28#include "../../objects/PWindow.h"
29#include "PlatformWidget.h"
30
32
35class PlatformWindow : virtual public PWindow, virtual public PlatformWidget {
36public:
38 virtual ~PlatformWindow();
39
40 virtual bool Draw();
41 virtual std::string ObjectName() const { return "PlatformWindow (validator)"; }
42 virtual int SaveScreenShot(int x, int y, int w, int h, const Variant fname) { return 0; }
43 virtual bool Initialize(PEBLVideoMode mode, PEBLVideoDepth depth, bool windowed, bool resizeable, unsigned int width, unsigned int height) { return true; }
44 virtual bool Resize(int w, int h) { return true; }
45 virtual long int DrawFor(unsigned int cycles) { return 0; }
46
47 // Resolve ambiguity by explicitly delegating to PWindow
48 virtual bool SetProperty(std::string name, Variant v) {
49 return PWindow::SetProperty(name, v);
50 }
51 virtual ObjectValidationError ValidateProperty(std::string name, Variant v) const {
52 return PWindow::ValidateProperty(name, v);
53 }
54 virtual ObjectValidationError ValidateProperty(std::string name) const {
55 return PWindow::ValidateProperty(name);
56 }
57
58 // Resolve GetWidth/GetHeight ambiguity
59 virtual pInt GetWidth() const { return PWindow::GetWidth(); }
60 virtual pInt GetHeight() const { return PWindow::GetHeight(); }
61
62 // Resolve SetPosition/SetBackgroundColor ambiguity
63 virtual void SetPosition(pInt x, pInt y) { PWindow::SetPosition(x, y); }
64 virtual void SetBackgroundColor(const PColor &color) { PWindow::SetBackgroundColor(color); }
65
66protected:
67 virtual std::ostream& SendToStream(std::ostream& out) const;
68};
69
70#endif
#define pInt
Definition Defs.h:8
PEBLVideoDepth
Definition Globals.h:69
PEBLVideoMode
Definition Globals.h:58
ObjectValidationError
Definition PEBLObject.h:37
virtual void SetPosition(pInt x, pInt y)
This sets the widget's position on its parent widget.
Definition PWidget.cpp:220
virtual pInt GetWidth() const
Definition PWidget.h:85
virtual void SetBackgroundColor(const PColor &color)
Definition PWidget.cpp:287
virtual pInt GetHeight() const
Definition PWidget.h:86
virtual bool SetProperty(std::string, Variant v)
Definition PWindow.cpp:56
virtual ObjectValidationError ValidateProperty(std::string, Variant v) const
Definition PWindow.cpp:77
virtual std::string ObjectName() const
virtual long int DrawFor(unsigned int cycles)
virtual std::ostream & SendToStream(std::ostream &out) const
An inheritable printing class used by PEBLObjectBase::operator<<.
virtual bool Resize(int w, int h)
virtual ObjectValidationError ValidateProperty(std::string name) const
virtual pInt GetHeight() const
virtual bool Draw()
virtual pInt GetWidth() const
virtual bool SetProperty(std::string name, Variant v)
virtual void SetPosition(pInt x, pInt y)
This sets the widget's position on its parent widget.
virtual void SetBackgroundColor(const PColor &color)
PlatformWindow(PlatformEnvironment *env)
virtual bool Initialize(PEBLVideoMode mode, PEBLVideoDepth depth, bool windowed, bool resizeable, unsigned int width, unsigned int height)
virtual ObjectValidationError ValidateProperty(std::string name, Variant v) const
virtual ~PlatformWindow()
virtual int SaveScreenShot(int x, int y, int w, int h, const Variant fname)