OSDN Git Service

first
[psychlops/cpp.git] / psychlops / core / devices / psychlops_io_display.cpp
1 /*
2  *  psychlops_io_display.cpp
3  *  Psychlops Standard Library (Universal)
4  *
5  *  Last Modified 2009/04/05 by Kenchi HOSOKAWA
6  *  (C) 2009 Kenchi HOSOKAWA, Kazushi MARUYA and Takao SATO
7  */
8
9
10 #include "psychlops_io_display.h"
11
12
13 namespace Psychlops {
14
15         const Display::PROPERTY_DISPLAY Display::primary = Display::PROPERTY_DISPLAY(0);
16         const Display::PROPERTY_DISPLAY Display::secondary = Display::PROPERTY_DISPLAY(1);
17         Display::PROPERTY_DISPLAY::PROPERTY_DISPLAY()\r
18         {\r
19                 N = 0;\r
20         }
21         Display::PROPERTY_DISPLAY::PROPERTY_DISPLAY(int n)\r
22         {\r
23                 N = n;\r
24         }
25         Display::PROPERTY_DISPLAY::operator Display() const {\r
26                 if(N==0) {
27                         return Display::list()[0];\r
28                 } else {
29                         return (Display::list().size()>1) ? Display::list()[1] : Display::list()[0];\r
30                 }
31         }
32         int Display::PROPERTY_DISPLAY::getWidth() const { return ((Display)(*this)).width; }\r
33         int Display::PROPERTY_DISPLAY::getHeight() const { return ((Display)(*this)).height; }\r
34         int Display::PROPERTY_DISPLAY::getColorDepth() const { return ((Display)(*this)).color_depth; }\r
35         double Display::PROPERTY_DISPLAY::getRefreshRate() const { return ((Display)(*this)).refresh_rate; }\r
36         Rectangle Display::PROPERTY_DISPLAY::getArea() const { return ((Display)(*this)).area; }
37
38
39
40         Display::Display() {\r
41         }
42         Display::Display(const Display &disp) : api_(disp.api_) {
43                 width = disp.width;
44                 height = disp.height;
45                 color_depth = disp.color_depth;
46                 refresh_rate = disp.refresh_rate;
47                 name = disp.name;
48                 area = disp.area;
49         }
50
51         Display::~Display() {
52         }
53
54         Display& Display::operator =(const Display& disp) {
55                 width = width;
56                 height = disp.height;
57                 color_depth = disp.color_depth;
58                 refresh_rate = disp.refresh_rate;
59                 name = disp.name;
60                 area = disp.area;
61                 api_ = disp.api_;
62                 return *this;
63         }
64
65
66
67 }       /*      <- namespace Psycholops         */