* all plugins commands are bindable

support detachable menus in submenus of plugins menus
user_shortcuts_init() and user_shortcuts_save() are moved to not the most convenient spot, as init has to happen after plugins init and before menus creation
This commit is contained in:
Garux
2019-03-13 19:45:51 +03:00
parent 51ee1dcccb
commit 502c0f8bc1
5 changed files with 121 additions and 122 deletions

View File

@@ -41,8 +41,7 @@ virtual const char* getMenuName() = 0;
virtual std::size_t getCommandCount() = 0;
virtual const char* getCommand( std::size_t ) = 0;
virtual const char* getCommandTitle( std::size_t ) = 0;
virtual void addMenuID( std::size_t ) = 0;
virtual bool ownsCommandID( std::size_t n ) = 0;
virtual const char* getGlobalCommand( std::size_t ) = 0;
};
class PluginsVisitor
@@ -54,7 +53,6 @@ virtual void visit( IPlugIn& plugin ) = 0;
class CPlugInManager
{
public:
void Dispatch( std::size_t n, const char *p );
void Init( GtkWidget* main_window );
void constructMenu( PluginsVisitor& menu );
void Shutdown();
@@ -62,4 +60,19 @@ void Shutdown();
CPlugInManager& GetPlugInMgr();
inline bool plugin_submenu_in( const char* text ){
return text[0] == '>' && text[1] == '\0';
}
inline bool plugin_submenu_out( const char* text ){
return text[0] == '<' && text[1] == '\0';
}
inline bool plugin_menu_separator( const char* text ){
return text[0] == '-' && text[1] == '\0';
}
inline bool plugin_menu_special( const char* text ){
return plugin_menu_separator( text )
|| plugin_submenu_in( text )
|| plugin_submenu_out( text );
}
#endif