Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/putil/buttonHandle.h

Go to the documentation of this file.
00001 // Filename: buttonHandle.h
00002 // Created by:  drose (01Mar00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef BUTTONHANDLE_H
00020 #define BUTTONHANDLE_H
00021 
00022 #include <pandabase.h>
00023 
00024 ////////////////////////////////////////////////////////////////////
00025 //       Class : ButtonHandle
00026 // Description : A ButtonHandle represents a single button from any
00027 //               device, including keyboard buttons and mouse buttons
00028 //               (but see KeyboardButton and MouseButton).
00029 ////////////////////////////////////////////////////////////////////
00030 class EXPCL_PANDA ButtonHandle {
00031 PUBLISHED:
00032   INLINE ButtonHandle();
00033 
00034 public:
00035   INLINE ButtonHandle(const ButtonHandle &copy);
00036 
00037   INLINE bool operator == (const ButtonHandle &other) const;
00038   INLINE bool operator != (const ButtonHandle &other) const;
00039   INLINE bool operator < (const ButtonHandle &other) const;
00040 
00041 PUBLISHED:
00042   string get_name() const;
00043   INLINE bool has_ascii_equivalent() const;
00044   INLINE char get_ascii_equivalent() const;
00045 
00046   INLINE int get_index() const;
00047   INLINE void output(ostream &out) const;
00048   INLINE static ButtonHandle none();
00049 
00050 private:
00051   int _index;
00052   static ButtonHandle _none;
00053 
00054 friend class ButtonRegistry;
00055 };
00056 
00057 // It's handy to be able to output a ButtonHandle directly, and see the
00058 // button name.
00059 INLINE ostream &operator << (ostream &out, ButtonHandle button) {
00060   button.output(out);
00061   return out;
00062 }
00063 
00064 #include "buttonHandle.I"
00065 
00066 #endif
00067 

Generated on Fri May 2 00:43:33 2003 for Panda by doxygen1.3