PEBL
2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
PDevice.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/devices/PDevice.h
4
// Purpose: Master Generic Device Class
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 __PDEVICE_H__
28
#define __PDEVICE_H__
29
30
#include <iostream>
31
using
std::cerr;
32
class
DeviceState
;
33
class
ValueState
;
34
class
IntervalState
;
35
class
RegionState
;
36
37
38
39
enum
PEBL_DEVICE_TYPE
40
{
41
PDT_UNKNOWN
= 0,
42
PDT_KEYBOARD
,
43
PDT_TEXT_INPUT
,
44
PDT_TEXT_EDITING
,
45
PDT_MOUSE_MOVEMENT
,
46
PDT_MOUSE_BUTTON
,
47
PDT_MOUSE_WHEEL
,
48
PDT_TIMER
,
49
PDT_STREAM
,
50
PDT_EVENT_QUEUE
,
51
PDT_AUDIO_OUT
,
52
PDT_JOYSTICK_AXIS
,
53
PDT_JOYSTICK_BALL
,
54
PDT_JOYSTICK_BUTTON
,
55
PDT_JOYSTICK_HAT
,
56
PDT_PORT
,
57
PDT_MOVIE_REFRESH
,
58
PDT_MOVIE_END
,
59
PDT_WINDOW_RESIZE
,
60
PDT_DUMMY
61
};
62
63
68
69
70
class
PDevice
71
{
72
73
74
public
:
76
PDevice
();
77
79
virtual
~PDevice
();
80
81
82
//Overload of the << operator
83
friend
std::ostream &
operator <<
(std::ostream & out,
const
PDevice
& device );
84
85
virtual
PEBL_DEVICE_TYPE
GetDeviceType
(){
return
PDT_UNKNOWN
;};
86
virtual
int
GetState
(
int
iface)
const
;
87
private
:
88
89
//Inheritable printing Method.
90
virtual
std::ostream& SendToStream(std::ostream& out)
const
;
91
92
};
93
94
95
96
97
98
#endif
PEBL_DEVICE_TYPE
PEBL_DEVICE_TYPE
Definition
PDevice.h:40
PDT_MOUSE_WHEEL
@ PDT_MOUSE_WHEEL
Definition
PDevice.h:47
PDT_MOVIE_END
@ PDT_MOVIE_END
Definition
PDevice.h:58
PDT_JOYSTICK_AXIS
@ PDT_JOYSTICK_AXIS
Definition
PDevice.h:52
PDT_TEXT_INPUT
@ PDT_TEXT_INPUT
Definition
PDevice.h:43
PDT_MOUSE_MOVEMENT
@ PDT_MOUSE_MOVEMENT
Definition
PDevice.h:45
PDT_UNKNOWN
@ PDT_UNKNOWN
Definition
PDevice.h:41
PDT_DUMMY
@ PDT_DUMMY
Definition
PDevice.h:60
PDT_EVENT_QUEUE
@ PDT_EVENT_QUEUE
Definition
PDevice.h:50
PDT_STREAM
@ PDT_STREAM
Definition
PDevice.h:49
PDT_JOYSTICK_BUTTON
@ PDT_JOYSTICK_BUTTON
Definition
PDevice.h:54
PDT_MOUSE_BUTTON
@ PDT_MOUSE_BUTTON
Definition
PDevice.h:46
PDT_PORT
@ PDT_PORT
Definition
PDevice.h:56
PDT_JOYSTICK_BALL
@ PDT_JOYSTICK_BALL
Definition
PDevice.h:53
PDT_TEXT_EDITING
@ PDT_TEXT_EDITING
Definition
PDevice.h:44
PDT_KEYBOARD
@ PDT_KEYBOARD
Definition
PDevice.h:42
PDT_WINDOW_RESIZE
@ PDT_WINDOW_RESIZE
Definition
PDevice.h:59
PDT_TIMER
@ PDT_TIMER
Definition
PDevice.h:48
PDT_AUDIO_OUT
@ PDT_AUDIO_OUT
Definition
PDevice.h:51
PDT_JOYSTICK_HAT
@ PDT_JOYSTICK_HAT
Definition
PDevice.h:55
PDT_MOVIE_REFRESH
@ PDT_MOVIE_REFRESH
Definition
PDevice.h:57
DeviceState
Definition
DeviceState.h:75
IntervalState
Definition
DeviceState.h:128
PDevice
Definition
PDevice.h:71
PDevice::operator<<
friend std::ostream & operator<<(std::ostream &out, const PDevice &device)
PDevice::PDevice
PDevice()
The Standard constructor.
Definition
PDevice.cpp:36
PDevice::GetDeviceType
virtual PEBL_DEVICE_TYPE GetDeviceType()
Definition
PDevice.h:85
PDevice::GetState
virtual int GetState(int iface) const
Definition
PDevice.cpp:65
PDevice::~PDevice
virtual ~PDevice()
The Standard destructor.
Definition
PDevice.cpp:42
RegionState
Definition
DeviceState.h:146
ValueState
Definition
DeviceState.h:114
src
devices
PDevice.h
Generated by
1.9.8