PEBL
2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
validator/PlatformWidget.cpp
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/PlatformWidget.cpp
4
// Purpose: Validator Platform Widget Implementation
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
#include "
PlatformWidget.h
"
26
27
PlatformWidget::PlatformWidget
() :
PWidget
() {
28
}
29
30
PlatformWidget::PlatformWidget
(
pInt
x,
pInt
y,
pInt
width,
pInt
height,
bool
visible)
31
:
PWidget
(x, y, width, height, visible) {
32
}
33
34
PlatformWidget::~PlatformWidget
() {
35
}
36
37
bool
PlatformWidget::Draw
() {
38
// No-op: no rendering in validator mode
39
return
true
;
40
}
41
42
bool
PlatformWidget::RotoZoom
(
pDouble
angle,
pDouble
zoomx,
pDouble
zoomy,
pInt
smooth) {
43
// Store the values but don't render
44
mRotation
= angle;
45
mZoomX
= zoomx;
46
mZoomY
= zoomy;
47
return
true
;
48
}
49
50
bool
PlatformWidget::SetPoint
(
pInt
x,
pInt
y,
PColor
col) {
51
// No-op: no pixel manipulation in validator mode
52
return
false
;
53
}
54
55
PColor
PlatformWidget::GetPixel
(
pInt
x,
pInt
y) {
56
// Return black - no pixel data available
57
return
PColor
(0, 0, 0, 255);
58
}
59
60
std::ostream&
PlatformWidget::SendToStream
(std::ostream& out)
const
{
61
out <<
"PlatformWidget (validator)"
;
62
return
out;
63
}
pInt
#define pInt
Definition
Defs.h:8
pDouble
#define pDouble
Definition
Defs.h:7
PColor
Definition
PColor.h:37
PWidget
Definition
PWidget.h:43
PWidget::mZoomX
pDouble mZoomX
Definition
PWidget.h:139
PWidget::mZoomY
pDouble mZoomY
Definition
PWidget.h:140
PWidget::mRotation
pDouble mRotation
Definition
PWidget.h:141
PlatformWidget::SetPoint
bool SetPoint(int x, int y, PColor col)
Definition
sdl/PlatformWidget.cpp:287
PlatformWidget::SendToStream
virtual std::ostream & SendToStream(std::ostream &out) const
An inheritable printing class used by PEBLObjectBase::operator<<.
Definition
sdl/PlatformWidget.cpp:92
PlatformWidget::Draw
virtual bool Draw()
This method initiates everything needed to display the main window
Definition
sdl/PlatformWidget.cpp:104
PlatformWidget::RotoZoom
virtual bool RotoZoom(double angle, double zoomx, double zoomy, int smooth)
This uses the SDL_gfx package to 'rotozoom'.
Definition
sdl/PlatformWidget.cpp:309
PlatformWidget::PlatformWidget
PlatformWidget()
Definition
sdl/PlatformWidget.cpp:47
PlatformWidget::~PlatformWidget
virtual ~PlatformWidget()
Definition
sdl/PlatformWidget.cpp:57
PlatformWidget::GetPixel
PColor GetPixel(int x, int y)
Definition
sdl/PlatformWidget.cpp:295
PlatformWidget.h
src
platforms
validator
PlatformWidget.cpp
Generated by
1.9.8