PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
sdl/PlatformCanvas.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/platforms/sdl/PlatformCanvas.h
4// Purpose: Contains platform-specific interface for a 'canvas'
5// Author: Shane T. Mueller, Ph.D.
6// Copyright: (c) 2010 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 __PLATFORMCANVAS_H__
28#define __PLATFORMCANVAS_H__
29
30#include "PlatformWidget.h"
31#include "../../objects/PCanvas.h"
32#include "SDL.h"
33#include "../../utility/rc_ptrs.h"
34#include "../../base/PEBLObject.h"
35
36#include <vector>
37
41
42
43class PlatformCanvas: virtual public PlatformWidget, virtual public PCanvas
44{
45public:
46
47 PlatformCanvas(int width, int height, Variant bg);
48 PlatformCanvas(int width, int height);
49
51 PlatformCanvas(const PlatformCanvas & canv);
52
53 virtual ~PlatformCanvas();
54
55
56 virtual bool SetProperty(std::string, Variant v);
57 //These need to be overridden because the text needs to be re-rendered when they are called.
58
59 virtual bool Reset();
60 virtual std::string ObjectName()const{return "PlatformCanvas";} ;
61 virtual bool Draw();
62 virtual void SetWidth(pInt h);
63 virtual void SetHeight(pInt h);
64
65 virtual void SetZoomX(double h);
66 virtual void SetZoomY(double h);
67
68protected:
69
70 virtual std::ostream & SendToStream(std::ostream& out) const;
71
72
73private:
74
75 //unstretched canvas size:
76
77 int mCanvasWidth;
78 int mCanvasHeight;
79 Uint32 * mPixels;
80
81};
82
83
84
85#endif
#define pInt
Definition Defs.h:8
This class is the basic generic text box.
Definition PCanvas.h:39
Validator platform canvas - no pixel buffer, used only for compilation.
virtual void SetZoomX(double h)
virtual std::string ObjectName() const
virtual bool Draw()
This method initiates everything needed to display the main window
virtual void SetWidth(pInt h)
virtual bool SetProperty(std::string, Variant v)
virtual void SetHeight(pInt h)
virtual void SetZoomY(double h)
virtual ~PlatformCanvas()
Standard Destructor.
virtual std::ostream & SendToStream(std::ostream &out) const
An inheritable printing class used by PEBLObjectBase::operator<<.