Panda3D
|
Records a set of button events that happened recently. More...
#include "buttonEventList.h"
Public Member Functions | |
ButtonEventList (const ButtonEventList ©) | |
void | add_event (ButtonEvent event) |
Adds a new event to the end of the list. | |
void | add_events (const ButtonEventList &other) |
Appends the events from the other list onto the end of this one. | |
void | clear () |
Empties all the events from the list. | |
void | fillin (DatagramIterator &scan, BamReader *manager) |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new ButtonEventList. | |
virtual TypeHandle | force_init_type () |
const ButtonEvent & | get_event (int n) const |
Returns the nth event in the list. | |
int | get_num_events () const |
Returns the number of events in the list. | |
virtual TypeHandle | get_type () const |
void | operator= (const ButtonEventList ©) |
virtual void | output (ostream &out) const |
void | update_mods (ModifierButtons &mods) const |
Updates the indicated ModifierButtons object with all of the button up/down transitions indicated in the list. | |
void | write (ostream &out, int indent_level=0) const |
virtual void | write_datagram (BamWriter *manager, Datagram &dg) |
Writes the contents of this object to the datagram for shipping out to a Bam file. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
static void | register_with_read_factory () |
Tells the BamReader how to create objects of type Lens. | |
Static Protected Member Functions | |
static TypedWritable * | make_from_bam (const FactoryParams ¶ms) |
This function is called by the BamReader's factory when a new object of type Lens is encountered in the Bam file. |
Records a set of button events that happened recently.
This class is usually used only in the data graph, to transmit the recent button presses, but it may be used anywhere a list of ButtonEvents is desired.
Definition at line 37 of file buttonEventList.h.
void ButtonEventList::add_event | ( | ButtonEvent | event | ) | [inline] |
Adds a new event to the end of the list.
Definition at line 52 of file buttonEventList.I.
Referenced by MouseWatcher::do_transmit_data().
void ButtonEventList::add_events | ( | const ButtonEventList & | other | ) |
Appends the events from the other list onto the end of this one.
Definition at line 28 of file buttonEventList.cxx.
void ButtonEventList::clear | ( | ) | [inline] |
Empties all the events from the list.
Definition at line 89 of file buttonEventList.I.
void ButtonEventList::fillin | ( | DatagramIterator & | scan, |
BamReader * | manager | ||
) | [virtual] |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new ButtonEventList.
This function is normally protected, but it is declared public in this case so that MouseRecorder may call it to read a ButtonEventList from the middle of a datagram.
Reimplemented from TypedWritable.
Definition at line 148 of file buttonEventList.cxx.
References DatagramIterator::get_uint16(), and ButtonEvent::read_datagram().
Referenced by make_from_bam(), and MouseRecorder::play_frame().
const ButtonEvent & ButtonEventList::get_event | ( | int | n | ) | const [inline] |
Returns the nth event in the list.
This does not remove the event from the list; the only way to remove events is to empty the whole list with clear().
Definition at line 75 of file buttonEventList.I.
Referenced by AwMouseAndKeyboard::do_transmit_data(), RocketInputHandler::do_transmit_data(), MouseSubregion::do_transmit_data(), ButtonThrower::do_transmit_data(), DriveInterface::do_transmit_data(), and MouseWatcher::do_transmit_data().
int ButtonEventList::get_num_events | ( | ) | const [inline] |
Returns the number of events in the list.
Definition at line 62 of file buttonEventList.I.
Referenced by AwMouseAndKeyboard::do_transmit_data(), RocketInputHandler::do_transmit_data(), MouseSubregion::do_transmit_data(), ButtonThrower::do_transmit_data(), DriveInterface::do_transmit_data(), and MouseWatcher::do_transmit_data().
TypedWritable * ButtonEventList::make_from_bam | ( | const FactoryParams & | params | ) | [static, protected] |
This function is called by the BamReader's factory when a new object of type Lens is encountered in the Bam file.
It should create the Lens and extract its information from the file.
Definition at line 124 of file buttonEventList.cxx.
References fillin().
Referenced by register_with_read_factory().
void ButtonEventList::register_with_read_factory | ( | ) | [static] |
Tells the BamReader how to create objects of type Lens.
Definition at line 94 of file buttonEventList.cxx.
References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().
void ButtonEventList::update_mods | ( | ModifierButtons & | mods | ) | const |
Updates the indicated ModifierButtons object with all of the button up/down transitions indicated in the list.
Definition at line 44 of file buttonEventList.cxx.
Referenced by MouseInterfaceNode::check_button_events().
void ButtonEventList::write_datagram | ( | BamWriter * | manager, |
Datagram & | dg | ||
) | [virtual] |
Writes the contents of this object to the datagram for shipping out to a Bam file.
Reimplemented from TypedWritable.
Definition at line 105 of file buttonEventList.cxx.
References Datagram::add_uint16().