00001 // Filename: buttonRegistry.I 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 #include <notify.h> 00020 00021 //////////////////////////////////////////////////////////////////// 00022 // Function: ButtonRegistry::RegistryNode::Constructor 00023 // Access: Public 00024 // Description: 00025 //////////////////////////////////////////////////////////////////// 00026 INLINE ButtonRegistry::RegistryNode:: 00027 RegistryNode(ButtonHandle handle, const string &name) : 00028 _handle(handle), _name(name) { 00029 } 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Function: ButtonRegistry::ptr 00033 // Access: Public, Static 00034 // Description: Returns the pointer to the global ButtonRegistry 00035 // object. 00036 //////////////////////////////////////////////////////////////////// 00037 INLINE ButtonRegistry *ButtonRegistry:: 00038 ptr() { 00039 if (_global_pointer == (ButtonRegistry *)NULL) { 00040 init_global_pointer(); 00041 } 00042 return _global_pointer; 00043 } 00044 00045 //////////////////////////////////////////////////////////////////// 00046 // Function: ButtonRegistry::get_name 00047 // Access: Public 00048 // Description: Returns the name of the indicated button. 00049 //////////////////////////////////////////////////////////////////// 00050 INLINE string ButtonRegistry:: 00051 get_name(ButtonHandle button) const { 00052 RegistryNode *rnode = look_up(button); 00053 nassertr(rnode != (RegistryNode *)NULL, ""); 00054 return rnode->_name; 00055 }