src/api/ui.c File Reference

#include <glib.h>
#include <gtk/gtk.h>
#include "beaver.h"
#include "api.h"

Functions

gint beaver_ui_item_submenu_add_impl (enum BeaverMenuSection section, const gchar *name, const gchar *text)
gint beaver_ui_item_add_impl (enum BeaverMenuSection section, const gchar *name, const gchar *stock_id, const gchar *text, void(*callback)(void))
gint beaver_ui_item_seperator_add_impl (enum BeaverMenuSection section)
void beaver_ui_item_remove_impl (gint id, const gchar *name)

Variables

GtkUIManager * MenuManager

Detailed Description

Implementation for menu manipulations for plugins.


Function Documentation

gint beaver_ui_item_add_impl ( enum BeaverMenuSection  section,
const gchar *  name,
const gchar *  stock_id,
const gchar *  text,
void(*)(void)  callback 
)

Adds a menu item into specified menu section.

Parameters:
section the section in which to create the new item
name internal name of the item
stock_id The stock id for the action, or the name of an icon from the icon theme.
text text on the label of the item
callback the function that get's called when user clicks on this menu item.
Returns:
integer id representing the inserted menu item
void beaver_ui_item_remove_impl ( gint  id,
const gchar *  name 
)

Removes a previously added menu item.

Parameters:
id integer id as returned by beaver_menu_add_* functions
name internal name of menu item (as passed in beaver_menu_add_item) if NULL then action will not be removed.
gint beaver_ui_item_seperator_add_impl ( enum BeaverMenuSection  section  ) 

Adds a menu seperator.

Returns:
integer id representing the inserted menu item
gint beaver_ui_item_submenu_add_impl ( enum BeaverMenuSection  section,
const gchar *  name,
const gchar *  text 
)

Adds a submenu into the specified section. The submenu has to be populated with calls to beaver_menu_add_menu. To add items the text field in this call has to have the form <name>/<text> where name is the name you provided here and text is the label of the new submenuentry.

Parameters:
section the section in which to create the new item
name internal name of menu item
text text on the label of the menu item
Returns:
integer id representing the inserted menu item
Generated on Mon Jul 5 21:03:31 2010 for Beaver by  doxygen 1.6.3