Cairo-Dock  3.4.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cairo-dock-menu.h File Reference

Macros

#define gldi_submenu_new(...)
 
#define gldi_menu_item_new(cLabel, cImage)
 
#define gldi_menu_add_sub_menu(pMenu, cLabel, cImage)
 

Functions

GtkWidget * gldi_menu_new (Icon *pIcon)
 
void gldi_menu_init (GtkWidget *pMenu, Icon *pIcon)
 
void gldi_menu_popup (GtkWidget *menu)
 
GtkWidget * gldi_menu_item_new_full (const gchar *cLabel, const gchar *cImage, gboolean bUseMnemonic, GtkIconSize iSize)
 
GtkWidget * gldi_menu_item_new_with_action (const gchar *cLabel, const gchar *cImage, GCallback pFunction, gpointer pData)
 
GtkWidget * gldi_menu_item_new_with_submenu (const gchar *cLabel, const gchar *cImage, GtkWidget **pSubMenuPtr)
 
void gldi_menu_item_set_image (GtkWidget *pMenuItem, GtkWidget *image)
 
GtkWidget * gldi_menu_item_get_image (GtkWidget *pMenuItem)
 
GtkWidget * gldi_menu_add_item (GtkWidget *pMenu, const gchar *cLabel, const gchar *cImage, GCallback pFunction, gpointer pData)
 
GtkWidget * gldi_menu_add_sub_menu_full (GtkWidget *pMenu, const gchar *cLabel, const gchar *cImage, GtkWidget **pMenuItemPtr)
 
void gldi_menu_add_separator (GtkWidget *pMenu)
 

Detailed Description

This class defines the Menu. They are classical menus, but with a custom looking.

Macro Definition Documentation

#define gldi_submenu_new (   ...)

Creates a new sub-menu. It's just a menu that doesn't point on an Icon/Container.

#define gldi_menu_item_new (   cLabel,
  cImage 
)

A convenient function to create a menu-item with a label and an image.

Parameters
cLabelthe label, or NULL
cImagethe image path or name, or NULL
Returns
the new menu-item.
#define gldi_menu_add_sub_menu (   pMenu,
  cLabel,
  cImage 
)

A convenient function to add a sub-menu to a given menu.

Parameters
pMenuthe menu
cLabelthe label, or NULL
cImagethe image path or name, or NULL
Returns
the new sub-menu that has been added.

Function Documentation

GtkWidget* gldi_menu_new ( Icon pIcon)

Creates a new menu that will point on a given Icon. If the Icon is NULL, it will be placed under the mouse.

Parameters
pIconthe icon, or NULL
Returns
the new menu.
void gldi_menu_init ( GtkWidget *  pMenu,
Icon pIcon 
)

Initialize a menu, so that it can be drawn and placed correctly. It's useful if the menu was created beforehand (like a DbusMenu).

Parameters
pIconthe icon, or NULL
void gldi_menu_popup ( GtkWidget *  menu)

Pop-up a menu. The menu is placed above the icon, or above the container, or above the mouse, depending on how it has been initialized.

Parameters
menuthe menu.
GtkWidget* gldi_menu_item_new_full ( const gchar *  cLabel,
const gchar *  cImage,
gboolean  bUseMnemonic,
GtkIconSize  iSize 
)

Creates a menu-item, with a label and an image. The child widget of the menu-item is a gtk-label. If the label is NULL, the child widget will be NULL too (this is useful if the menu-item will hold a custom widget).

Parameters
cLabelthe label, or NULL
cImagethe image path or name, or NULL
bUseMnemonicwhether to use the mnemonic inside the label or not
iSizesize of the image, or 0 to use the default size
Returns
the new menu-item.
GtkWidget* gldi_menu_item_new_with_action ( const gchar *  cLabel,
const gchar *  cImage,
GCallback  pFunction,
gpointer  pData 
)

A convenient function to create a menu-item with a label, an image, and an associated action.

Parameters
cLabelthe label, or NULL
cImagethe image path or name, or NULL
pFunctionthe callback
pDatathe data passed to the callback
Returns
the new menu-item.
GtkWidget* gldi_menu_item_new_with_submenu ( const gchar *  cLabel,
const gchar *  cImage,
GtkWidget **  pSubMenuPtr 
)

A convenient function to create a menu-item with a label, an image, and an associated sub-menu.

Parameters
cLabelthe label
cImagethe image path or name, or NULL
pSubMenuPtrpointer that will contain the new sub-menu, or NULL
Returns
the new menu-item.
void gldi_menu_item_set_image ( GtkWidget *  pMenuItem,
GtkWidget *  image 
)

Sets a gtk-image on a menu-item. This is useful if the image can't be given by a name or path (for instance, loaded from a cairo surface).

Parameters
pMenuItemthe menu-item
imagethe image
GtkWidget* gldi_menu_item_get_image ( GtkWidget *  pMenuItem)

Gets the image of a menu-item.

Parameters
pMenuItemthe menu-item
Returns
the gtk-image
GtkWidget* gldi_menu_add_item ( GtkWidget *  pMenu,
const gchar *  cLabel,
const gchar *  cImage,
GCallback  pFunction,
gpointer  pData 
)

A convenient function to add an item to a given menu.

Parameters
pMenuthe menu
cLabelthe label, or NULL
cImagethe image path or name, or NULL
pFunctionthe callback
pDatathe data passed to the callback
Returns
the new menu-entry that has been added.
GtkWidget* gldi_menu_add_sub_menu_full ( GtkWidget *  pMenu,
const gchar *  cLabel,
const gchar *  cImage,
GtkWidget **  pMenuItemPtr 
)

A convenient function to add a sub-menu to a given menu.

Parameters
pMenuthe menu
cLabelthe label, or NULL
cImagethe image path or name, or NULL
pMenuItemPtrpointer that will contain the new menu-item, or NULL
Returns
the new sub-menu that has been added.
void gldi_menu_add_separator ( GtkWidget *  pMenu)

A convenient function to add a separator to a given menu.

Parameters
pMenuthe menu