Panda3D
graphicsWindowProcCallbackData.cxx
1 // Filename: graphicsWindowProcCallbackData.cxx
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 #include "graphicsWindowProcCallbackData.h"
16 #include "graphicsWindow.h"
17 
18 TypeHandle GraphicsWindowProcCallbackData::_type_handle;
19 
20 ////////////////////////////////////////////////////////////////////
21 // Function: GraphicsWindowProcCallbackData::output
22 // Access: Published, Virtual
23 // Description:
24 ////////////////////////////////////////////////////////////////////
25 void GraphicsWindowProcCallbackData::
26 output(ostream &out) const {
27 #ifdef WIN32
28  out << get_type() << "(" << (void*)_graphicsWindow << ", " << _hwnd << ", "
29  << _msg << ", " << _wparam << ", " << _lparam << ")";
30 #else
31  out << get_type() << "()";
32 #endif
33 }
34 ////////////////////////////////////////////////////////////////////
35 // Function: GraphicsWindowProcCallbackData::is_touch_event
36 // Access: Public, Virtual
37 // Description: Returns whether the event is a touch event.
38 //
39 ////////////////////////////////////////////////////////////////////
42  return _graphicsWindow->is_touch_event(this);
43 }
44 
45 ////////////////////////////////////////////////////////////////////
46 // Function: GraphicsWindowProcCallbackData::get_num_touches
47 // Access: Public, Virtual
48 // Description: Returns the current number of touches on the window.
49 //
50 ////////////////////////////////////////////////////////////////////
53  return _graphicsWindow->get_num_touches();
54 }
55 
56 ////////////////////////////////////////////////////////////////////
57 // Function: GraphicsWindowProcCallbackData::get_touch_info
58 // Access: Public, Virtual
59 // Description: Returns the TouchInfo object describing the specified touch.
60 //
61 ////////////////////////////////////////////////////////////////////
63 get_touch_info(int index){
64  return _graphicsWindow->get_touch_info(index);
65 }
bool is_touch_event()
Returns whether the event is a touch event.
int get_num_touches()
Returns the current number of touches on the window.
virtual int get_num_touches()
Returns the current number of touches on this window.
Stores information for a single touch event.
Definition: touchInfo.h:24
virtual TouchInfo get_touch_info(int index)
Returns the TouchInfo object describing the specified touch.
virtual bool is_touch_event(GraphicsWindowProcCallbackData *callbackData)
Returns whether the specified event msg is a touch message.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
TouchInfo get_touch_info(int index)
Returns the TouchInfo object describing the specified touch.