graphicsWindowProcCallbackData.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // Filename: graphicsWindowProcCallbackData.h
  2. // Created by: Walt Destler (June 2010)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) Carnegie Mellon University. All rights reserved.
  8. //
  9. // All use of this software is subject to the terms of the revised BSD
  10. // license. You should have received a copy of this license along
  11. // with this source code in a file named "LICENSE."
  12. //
  13. ////////////////////////////////////////////////////////////////////
  14. #ifndef GRAPHICSWINDOWPROCCALLBACKDATA_H
  15. #define GRAPHICSWINDOWPROCCALLBACKDATA_H
  16. #include "pandabase.h"
  17. #include "callbackData.h"
  18. #include "touchInfo.h"
  19. class GraphicsWindow;
  20. ////////////////////////////////////////////////////////////////////
  21. // Class : GraphicsWindowProcCallbackData
  22. // Description : This specialization on CallbackData is passed when
  23. // the callback is initiated from from an implementation
  24. // of the GraphicsWindowProc class, such as PythonGraphicsWindowProc.
  25. ////////////////////////////////////////////////////////////////////
  26. class EXPCL_PANDA_DISPLAY GraphicsWindowProcCallbackData : public CallbackData {
  27. public:
  28. INLINE GraphicsWindowProcCallbackData(GraphicsWindow* graphicsWindow);
  29. INLINE GraphicsWindow* get_graphics_window() const;
  30. #ifdef WIN32
  31. INLINE void set_hwnd(int hwnd);
  32. INLINE void set_msg(int msg);
  33. INLINE void set_wparam(int wparam);
  34. INLINE void set_lparam(int lparam);
  35. #endif
  36. PUBLISHED:
  37. virtual void output(ostream &out) const;
  38. #ifdef WIN32
  39. INLINE int get_hwnd() const;
  40. INLINE int get_msg() const;
  41. INLINE int get_wparam() const;
  42. INLINE int get_lparam() const;
  43. #endif
  44. bool is_touch_event();
  45. int get_num_touches();
  46. TouchInfo get_touch_info(int index);
  47. private:
  48. GraphicsWindow* _graphicsWindow;
  49. #ifdef WIN32
  50. int _hwnd;
  51. int _msg;
  52. int _wparam;
  53. int _lparam;
  54. #endif
  55. public:
  56. static TypeHandle get_class_type() {
  57. return _type_handle;
  58. }
  59. static void init_type() {
  60. CallbackData::init_type();
  61. register_type(_type_handle, "GraphicsWindowProcCallbackData",
  62. CallbackData::get_class_type());
  63. }
  64. virtual TypeHandle get_type() const {
  65. return get_class_type();
  66. }
  67. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  68. private:
  69. static TypeHandle _type_handle;
  70. };
  71. #include "graphicsWindowProcCallbackData.I"
  72. #endif // GRAPHICSWINDOWPROCCALLBACKDATA_H