| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- // Filename: buttonEventDataAttribute.h
- // Created by: drose (27Mar00)
- //
- ////////////////////////////////////////////////////////////////////
- //
- // PANDA 3D SOFTWARE
- // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
- //
- // All use of this software is subject to the terms of the Panda 3d
- // Software license. You should have received a copy of this license
- // along with this source code; you will also find a current copy of
- // the license at http://www.panda3d.org/license.txt .
- //
- // To contact the maintainers of this program write to
- // [email protected] .
- //
- ////////////////////////////////////////////////////////////////////
- #ifndef BUTTONEVENTDATAATTRIBUTE_H
- #define BUTTONEVENTDATAATTRIBUTE_H
- #include <pandabase.h>
- #include <nodeAttribute.h>
- #include <buttonEvent.h>
- #include "pvector.h"
- class ButtonEventDataTransition;
- class ModifierButtons;
- ////////////////////////////////////////////////////////////////////
- // Class : ButtonEventDataAttribute
- // Description : This data graph attribute stores a collection of
- // button events that have been generated by the user
- // since the last time the data graph pulsed, in the
- // order they were generated.
- ////////////////////////////////////////////////////////////////////
- class EXPCL_PANDA ButtonEventDataAttribute : public NodeAttribute {
- private:
- typedef pvector<ButtonEvent> Buttons;
- public:
- INLINE ButtonEventDataAttribute();
- INLINE ButtonEventDataAttribute(const ButtonEventDataAttribute ©);
- INLINE void operator = (const ButtonEventDataAttribute ©);
- public:
- // Functions to access and manipulate the set of buttons.
- typedef Buttons::const_iterator const_iterator;
- typedef Buttons::const_iterator iterator;
- INLINE const_iterator begin() const;
- INLINE const_iterator end() const;
- INLINE void clear();
- INLINE void push_back(const ButtonEvent &event);
- void update_mods(ModifierButtons &mods) const;
- public:
- virtual NodeAttribute *make_copy() const;
- virtual NodeAttribute *make_initial() const;
- virtual TypeHandle get_handle() const;
- virtual NodeAttribute *merge(const NodeAttribute *other) const;
- virtual void output(ostream &out) const;
- virtual void write(ostream &out, int indent_level = 0) const;
- protected:
- virtual int internal_compare_to(const NodeAttribute *other) const;
- private:
- Buttons _buttons;
- public:
- virtual TypeHandle get_type() const {
- return get_class_type();
- }
- virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
- static TypeHandle get_class_type() {
- return _type_handle;
- }
- static void init_type() {
- NodeAttribute::init_type();
- register_type(_type_handle, "ButtonEventDataAttribute",
- NodeAttribute::get_class_type());
- }
- private:
- static TypeHandle _type_handle;
- friend class ButtonEventDataTransition;
- };
- #include "buttonEventDataAttribute.I"
- #endif
|