00001 #ifndef GLUE_DEVMOUSE_H
00002 #define GLUE_DEVMOUSE_H
00003 
00004 #include "dev/dev.H"
00005 #include "dev/dev2d.H"
00006 #include "dev/buttons.H"
00007 
00008 inline str_ptr pstring(Cstr_ptr &p,const char *b) { 
00009    str_ptr d(p + str_ptr(b));
00010    cerr << d << endl; return d; 
00011 }
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 class DEVmouse : public DEVice {
00026   protected:
00027    DEVice_2d   _ptr;
00028    DEVice_btn  _btn0;
00029    DEVice_btn  _btn1;
00030    DEVice_btn  _btn2;
00031    DEVice_btn  _btn3; 
00032 
00033   public :
00034                DEVmouse(Cstr_ptr &name): 
00035                              DEVice(name, "mouse"),
00036                               _ptr (name),
00037                               _btn0(name+"_0","button0"),
00038                               _btn1(name+"_1","button1"),
00039                               _btn2(name+"_2","button2"),
00040                               _btn3(name+"_3","button3")
00041                                              { _btn0.add_source(this);
00042                                                _btn1.add_source(this);
00043                                                _btn2.add_source(this);
00044                                                _btn3.add_source(this);
00045                                                _ptr .add_source(this); }
00046    virtual     ~DEVmouse()                   { }
00047 
00048    DEVice_2d   *pointer()                    { return &_ptr; }
00049    DEVice_btn  *button0()                    { return &_btn0; }
00050    DEVice_btn  *button1()                    { return &_btn1; }
00051    DEVice_btn  *button2()                    { return &_btn2; }
00052    DEVice_btn  *button3()                    { return &_btn3; }
00053 
00054     
00055     DEFINE_DERIVED_TYPE(DEVmouse, DEVice, const DEVice *);
00056 };
00057 
00058 
00059 
00060 #endif