00001 #ifndef WINSYS_INC
00002 #define WINSYS_INC
00003 #include "disp/view.H"
00004 #include "dev/dev.H"
00005
00006
00007
00008
00009 class MAPPED_CB {
00010 public:
00011 virtual ~MAPPED_CB() {}
00012 virtual void mapped() = 0;
00013 virtual void icon () = 0;
00014 };
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 class MoveMenu;
00027 class AlertBox;
00028 class FileSelect;
00029
00030 class WINSYS: public DEVmod_gen {
00031 protected:
00032 MAPPED_CB *_map_cb;
00033
00034 VIEWptr _view;
00035 int _double_buffered;
00036 int _stencil_buffer;
00037
00038 public:
00039 WINSYS() : _map_cb(0), _double_buffered(0), _stencil_buffer(0) {}
00040 virtual ~WINSYS() {}
00041
00042 static WINSYS *create(int &argc, char **argv);
00043
00044 virtual CVIEWptr &view() {return _view;}
00045 virtual void set_focus() {}
00046 virtual void set_context() = 0;
00047 virtual void swap_buffers() = 0;
00048
00049
00050 virtual void set_cursor(int i) = 0;
00051 virtual int get_cursor() = 0;
00052
00053 virtual void display() = 0;
00054 virtual void setup(CVIEWptr &v) { _view = v; }
00055 virtual WINSYS *copy() = 0;
00056 virtual void size(int &w, int &h) {}
00057 virtual void position(int &x, int &y) {}
00058 virtual void size_manually(int w, int h) { }
00059 virtual void position_manually(int w, int h) { }
00060
00061
00062 virtual uint red_bits() const = 0;
00063 virtual uint green_bits() const = 0;
00064 virtual uint blue_bits() const = 0;
00065 virtual uint alpha_bits() const = 0;
00066
00067
00068 virtual uint accum_red_bits() const = 0;
00069 virtual uint accum_green_bits() const = 0;
00070 virtual uint accum_blue_bits() const = 0;
00071 virtual uint accum_alpha_bits() const = 0;
00072
00073 virtual uint stencil_bits() const = 0;
00074 virtual uint depth_bits() const = 0;
00075
00076 virtual void stereo(VIEWimpl::stereo_mode m) = 0;
00077 virtual void map_cb (MAPPED_CB *cb) { _map_cb = cb; }
00078 virtual int double_buffered () const { return _double_buffered; }
00079 virtual void set_double_buffered(int db) { _double_buffered = db; }
00080 virtual int stencil_buffer () const { return _stencil_buffer; }
00081
00082
00083
00084 virtual Mouse* mouse() = 0;
00085 virtual MoveMenu* menu(Cstr_ptr &name) = 0;
00086 virtual DEVhandler* curspush() = 0;
00087 virtual FileSelect* file_select() = 0;
00088 virtual AlertBox* alert_box() = 0;
00089
00090 virtual int id() const {
00091 cerr << "Warning: dummy WINSYS::id() called" << endl;
00092 return -1;
00093 }
00094
00095
00096 virtual void lock() = 0;
00097 virtual void unlock() = 0;
00098
00099
00100 virtual int draw() { return 0; }
00101
00102
00103
00104
00105 virtual int needs_context() { return 0; }
00106
00107 virtual STDdstream & operator<<(STDdstream &ds)
00108 {
00109
00110 return ds << 0 << 0 << 640 << 480;
00111 }
00112
00113 virtual STDdstream & operator>>(STDdstream &ds)
00114 {
00115 int foo;
00116 return ds >> foo >> foo >> foo >> foo;
00117 }
00118 enum cursor_t {
00119 CURSOR_RIGHT_ARROW = 0,
00120 CURSOR_LEFT_ARROW,
00121 CURSOR_INFO,
00122 CURSOR_DESTROY,
00123 CURSOR_HELP,
00124 CURSOR_CYCLE,
00125 CURSOR_SPRAY,
00126 CURSOR_WAIT,
00127 CURSOR_TEXT,
00128 CURSOR_CROSSHAIR,
00129 CURSOR_UP_DOWN,
00130 CURSOR_LEFT_RIGHT,
00131 CURSOR_TOP_SIDE,
00132 CURSOR_BOTTOM_SIDE,
00133 CURSOR_LEFT_SIDE,
00134 CURSOR_RIGHT_SIDE,
00135 CURSOR_TOP_LEFT_CORNER,
00136 CURSOR_TOP_RIGHT_CORNER,
00137 CURSOR_BOTTOM_RIGHT_CORNER,
00138 CURSOR_BOTTOM_LEFT_CORNER,
00139 CURSOR_FULL_CROSSHAIR,
00140 CURSOR_NONE,
00141 CURSOR_INHERIT
00142 };
00143 };
00144 #endif