Panda3D
Loading...
Searching...
No Matches
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
18using std::ostream;
19
20TypeHandle ClientButtonDevice::_type_handle;
21
22/**
23 *
24 */
25ClientButtonDevice::
26ClientButtonDevice(ClientBase *client, const std::string &device_name):
27 ClientDevice(client, get_class_type(), device_name)
28{
29}
30
31/**
32 *
33 */
35output(ostream &out) const {
36 out << get_type() << " " << get_name() << " (";
37 output_buttons(out);
38 out << ")";
39}
40
41/**
42 *
43 */
44void ClientButtonDevice::
45write(ostream &out, int indent_level) const {
46 indent(out, indent_level) << get_type() << " " << get_name() << ":\n";
47 write_buttons(out, indent_level + 2);
48}
An abstract base class for a family of client device interfaces–including trackers,...
Definition clientBase.h:43
virtual void output(std::ostream &out) const
Writes a one-line string describing the device.
Any of a number of different devices that might be attached to a ClientBase, including trackers,...
get_name
Returns a human-readable name for the device.
void output_buttons(std::ostream &out) const
Writes a one-line string of all of the current button states.
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.
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.