00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef VIRTUALMOUSE_H
00016 #define VIRTUALMOUSE_H
00017
00018 #include "pandabase.h"
00019 #include "dataNode.h"
00020 #include "buttonHandle.h"
00021 #include "buttonEvent.h"
00022 #include "pointerTo.h"
00023 #include "luse.h"
00024 #include "linmath_events.h"
00025 #include "buttonEventList.h"
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 class EXPCL_PANDA_DEVICE VirtualMouse : public DataNode {
00037 PUBLISHED:
00038 VirtualMouse(const string &name);
00039
00040 void set_mouse_pos(int x, int y);
00041 void set_window_size(int width, int height);
00042 void set_mouse_on(bool flag);
00043
00044 void press_button(ButtonHandle button);
00045 void release_button(ButtonHandle button);
00046
00047 private:
00048 int _mouse_x, _mouse_y;
00049 int _win_width, _win_height;
00050 bool _mouse_on;
00051
00052 protected:
00053
00054 virtual void do_transmit_data(DataGraphTraverser *trav,
00055 const DataNodeTransmit &input,
00056 DataNodeTransmit &output);
00057
00058 private:
00059
00060 int _pixel_xy_output;
00061 int _pixel_size_output;
00062 int _xy_output;
00063 int _button_events_output;
00064
00065 PT(EventStoreVec2) _pixel_xy;
00066 PT(EventStoreVec2) _pixel_size;
00067 PT(EventStoreVec2) _xy;
00068 PT(ButtonEventList) _button_events;
00069 PT(ButtonEventList) _next_button_events;
00070
00071 public:
00072 static TypeHandle get_class_type() {
00073 return _type_handle;
00074 }
00075 static void init_type() {
00076 DataNode::init_type();
00077 register_type(_type_handle, "VirtualMouse",
00078 DataNode::get_class_type());
00079 }
00080 virtual TypeHandle get_type() const {
00081 return get_class_type();
00082 }
00083 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00084
00085 private:
00086 static TypeHandle _type_handle;
00087 };
00088
00089 #endif
00090