Panda3D
 All Classes Functions Variables Enumerations
graphicsWindowProcCallbackData.h
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 
15 #ifndef GRAPHICSWINDOWPROCCALLBACKDATA_H
16 #define GRAPHICSWINDOWPROCCALLBACKDATA_H
17 
18 #include "pandabase.h"
19 #include "callbackData.h"
20 #include "touchInfo.h"
21 
22 class GraphicsWindow;
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : GraphicsWindowProcCallbackData
26 // Description : This specialization on CallbackData is passed when
27 // the callback is initiated from from an implementation
28 // of the GraphicsWindowProc class, such as PythonGraphicsWindowProc.
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_PANDA_DISPLAY GraphicsWindowProcCallbackData : public CallbackData {
31 public:
32  INLINE GraphicsWindowProcCallbackData(GraphicsWindow* graphicsWindow);
33 
34  INLINE GraphicsWindow* get_graphics_window() const;
35 
36 #ifdef WIN32
37  INLINE void set_hwnd(int hwnd);
38  INLINE void set_msg(int msg);
39  INLINE void set_wparam(int wparam);
40  INLINE void set_lparam(int lparam);
41 #endif
42 
43 PUBLISHED:
44  virtual void output(ostream &out) const;
45 
46 #ifdef WIN32
47  INLINE int get_hwnd() const;
48  INLINE int get_msg() const;
49  INLINE int get_wparam() const;
50  INLINE int get_lparam() const;
51 #endif
52 
53  bool is_touch_event();
54  int get_num_touches();
55  TouchInfo get_touch_info(int index);
56 
57 private:
58  GraphicsWindow* _graphicsWindow;
59 #ifdef WIN32
60  int _hwnd;
61  int _msg;
62  int _wparam;
63  int _lparam;
64 #endif
65 
66 public:
67  static TypeHandle get_class_type() {
68  return _type_handle;
69  }
70  static void init_type() {
71  CallbackData::init_type();
72  register_type(_type_handle, "GraphicsWindowProcCallbackData",
73  CallbackData::get_class_type());
74  }
75  virtual TypeHandle get_type() const {
76  return get_class_type();
77  }
78  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
79 
80 private:
81  static TypeHandle _type_handle;
82 };
83 
84 #include "graphicsWindowProcCallbackData.I"
85 
86 #endif // GRAPHICSWINDOWPROCCALLBACKDATA_H
This specialization on CallbackData is passed when the callback is initiated from from an implementat...
This is a generic data block that is passed along to a CallbackObject when a callback is made...
Definition: callbackData.h:32
A window, fullscreen or on a desktop, into which a graphics device sends its output for interactive d...
Stores information for a single touch event.
Definition: touchInfo.h:24
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85