| 6058 | } |
| 6059 | |
| 6060 | std::string |
| 6061 | LayoutViewBase::mode_name () const |
| 6062 | { |
| 6063 | if (m_mode <= 0) { |
| 6064 | |
| 6065 | std::vector<std::string> intrinsic_modes; |
| 6066 | intrinsic_mouse_modes (&intrinsic_modes); |
| 6067 | |
| 6068 | if (int (intrinsic_modes.size ()) > -m_mode) { |
| 6069 | return name_from_title (intrinsic_modes [-m_mode]); |
| 6070 | } |
| 6071 | |
| 6072 | } else { |
| 6073 | |
| 6074 | for (auto i = mp_plugins.begin (); i != mp_plugins.end (); ++i) { |
| 6075 | std::string title; |
| 6076 | if ((*i) && (*i)->plugin_declaration () && (*i)->plugin_declaration ()->id () == m_mode && (*i)->plugin_declaration ()->implements_mouse_mode (title)) { |
| 6077 | return name_from_title (title); |
| 6078 | } |
| 6079 | } |
| 6080 | |
| 6081 | } |
| 6082 | |
| 6083 | return std::string (); |
| 6084 | } |
| 6085 | |
| 6086 | void |
| 6087 | LayoutViewBase::switch_mode (const std::string &name) |