00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef MOUSEANDKEYBOARD_H
00016 #define MOUSEANDKEYBOARD_H
00017
00018 #include "pandabase.h"
00019
00020 #include "dataNode.h"
00021 #include "buttonEventList.h"
00022 #include "pointerEventList.h"
00023 #include "linmath_events.h"
00024 #include "pointerTo.h"
00025 #include "graphicsWindow.h"
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 class EXPCL_PANDA_DEVICE MouseAndKeyboard : public DataNode {
00048 PUBLISHED:
00049 MouseAndKeyboard(GraphicsWindow *window, int device, const string &name);
00050 void set_source(GraphicsWindow *window, int device);
00051
00052 PT(GraphicsWindow) get_source_window() const;
00053 int get_source_device() const;
00054
00055 protected:
00056
00057 virtual void do_transmit_data(DataGraphTraverser *trav,
00058 const DataNodeTransmit &input,
00059 DataNodeTransmit &output);
00060
00061 private:
00062
00063 int _pixel_xy_output;
00064 int _pixel_size_output;
00065 int _xy_output;
00066 int _button_events_output;
00067 int _pointer_events_output;
00068
00069 PT(EventStoreVec2) _pixel_xy;
00070 PT(EventStoreVec2) _pixel_size;
00071 PT(EventStoreVec2) _xy;
00072 PT(ButtonEventList) _button_events;
00073
00074 PT(GraphicsWindow) _window;
00075 int _device;
00076
00077 public:
00078 static TypeHandle get_class_type() {
00079 return _type_handle;
00080 }
00081 static void init_type() {
00082 DataNode::init_type();
00083 register_type(_type_handle, "MouseAndKeyboard",
00084 DataNode::get_class_type());
00085 }
00086 virtual TypeHandle get_type() const {
00087 return get_class_type();
00088 }
00089 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00090
00091 private:
00092 static TypeHandle _type_handle;
00093 };
00094
00095 #endif