Panda3D
clientButtonDevice.cxx
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file clientButtonDevice.cxx
10  * @author drose
11  * @date 2001-01-26
12  */
13 
14 #include "clientButtonDevice.h"
15 
16 #include "indent.h"
17 
18 using std::ostream;
19 
20 TypeHandle ClientButtonDevice::_type_handle;
21 
22 /**
23  *
24  */
25 ClientButtonDevice::
26 ClientButtonDevice(ClientBase *client, const std::string &device_name):
27  ClientDevice(client, get_class_type(), device_name)
28 {
29 }
30 
31 /**
32  *
33  */
35 output(ostream &out) const {
36  out << get_type() << " " << get_name() << " (";
37  output_buttons(out);
38  out << ")";
39 }
40 
41 /**
42  *
43  */
44 void ClientButtonDevice::
45 write(ostream &out, int indent_level) const {
46  indent(out, indent_level) << get_type() << " " << get_name() << ":\n";
47  write_buttons(out, indent_level + 2);
48 }
virtual void output(std::ostream &out) const
Writes a one-line string describing the device.
void output_buttons(std::ostream &out) const
Writes a one-line string of all of the current button states.
get_name
Returns a human-readable name for the device.
Definition: inputDevice.h:222
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition: indent.cxx:20
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An abstract base class for a family of client device interfaces–including trackers,...
Definition: clientBase.h:43
void write_buttons(std::ostream &out, int indent_level) const
Writes a multi-line description of the current button states.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Any of a number of different devices that might be attached to a ClientBase, including trackers,...
Definition: clientDevice.h:27