00001 #ifndef MODE_NAME_IS_INCLUDED 00002 #define MODE_NAME_IS_INCLUDED 00003 00004 /*! 00005 * \file mode_name.H 00006 * \brief Contains the definition of the ModeName class. 00007 * 00008 * \sa mode_name.C 00009 * 00010 */ 00011 00012 #include "std/support.H" 00013 #include "geom/text2d.H" 00014 00015 /*! 00016 * \brief Simple interface for setting the name of the current "mode" 00017 * which is displayed in the top left corner of the jot window. 00018 * 00019 * \todo Rewrite as singleton class. 00020 * 00021 */ 00022 class ModeName { 00023 00024 public: 00025 00026 //! \brief Name currently displayed. 00027 static str_ptr get_name() { return name()->get_string(); } 00028 00029 //! \brief set a new name. 00030 static void push_name(Cstr_ptr& n); 00031 00032 //! \brief Remove the last name set, restore the one before it. 00033 static void pop_name(); 00034 00035 protected: 00036 00037 static TEXT2Dptr _mode_name; 00038 static LIST<str_ptr> _names; 00039 00040 static void init(); 00041 static TEXT2Dptr name() { init(); return _mode_name; } 00042 static void set_name(Cstr_ptr& n) { name()->set_string(n); } 00043 00044 }; 00045 00046 #endif // MODE_NAME_IS_INCLUDED 00047 00048 // end of file mode_name.H