Beaver  0.4.1
Functions | Variables
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

◆ beaver_ui_item_add_impl()

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
sectionthe section in which to create the new item
nameinternal name of the item
stock_idThe stock id for the action, or the name of an icon from the icon theme.
texttext on the label of the item
callbackthe function that get's called when user clicks on this menu item.
Returns
integer id representing the inserted menu item

◆ beaver_ui_item_remove_impl()

void beaver_ui_item_remove_impl ( gint  id,
const gchar *  name 
)

Removes a previously added menu item.

Parameters
idinteger id as returned by beaver_menu_add_* functions
nameinternal name of menu item (as passed in beaver_menu_add_item) if NULL then action will not be removed.

◆ beaver_ui_item_seperator_add_impl()

gint beaver_ui_item_seperator_add_impl ( enum BeaverMenuSection  section)

Adds a menu seperator.

Returns
integer id representing the inserted menu item

◆ beaver_ui_item_submenu_add_impl()

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
sectionthe section in which to create the new item
nameinternal name of menu item
texttext on the label of the menu item
Returns
integer id representing the inserted menu item