Previous: Command Editing Actions, Up: The Command Structure

7.3.4 Plugin Menu Functions

A special menu command category plugin_ctg is reserved for plugin functions. A GUI plugin can register itself into the command structure, which creates a subcategory in the plugin category and assigns an ID to it.

This is done by the function

     int plugin_menu_register( char * desc );

returning the plugin ID. The following functions can be used for adding and removing menu commands, adding commands in a more convenient way or unregistering the plugin. After unregistering, the plugin menu subcategory and all commands added conveniently are destroyed automatically and the plugin ID becomes invalid.

All these functions return zero iff they are successful.

     int plugin_menu_unregister( int plugin_id );
     int plugin_menu_command_register( int plugin_id, struct cmd * cmd );
     int plugin_menu_command_register_conv( int plugin_id, char * title,
         char * desc, uns request_mask, int request_cnt, uns request_type,
         void (*action_f)(void *) );