JWM Source Documentation

menu.h File Reference

Header for the menu functions. More...

Go to the source code of this file.

Data Structures

struct  MenuAction
 Structure to represent a menu action for callbacks. More...
struct  MenuItem
 Structure to represent a menu item. More...
struct  Menu
 Structure to represent a menu or submenu. More...

Typedefs

typedef struct MenuAction MenuAction
 Structure to represent a menu action for callbacks.
typedef struct MenuItem MenuItem
 Structure to represent a menu item.
typedef struct Menu Menu
 Structure to represent a menu or submenu.
typedef void(* RunMenuCommandType )(const MenuAction *action)

Enumerations

enum  MenuActionType {
  MA_NONE, MA_EXECUTE, MA_DESKTOP, MA_SENDTO,
  MA_LAYER, MA_STICK, MA_MAXIMIZE, MA_MAXIMIZE_H,
  MA_MAXIMIZE_V, MA_MINIMIZE, MA_RESTORE, MA_SHADE,
  MA_MOVE, MA_RESIZE, MA_KILL, MA_CLOSE,
  MA_EXIT, MA_RESTART
}
 Enumeration of menu action types. More...
enum  MenuItemType { MENU_ITEM_NORMAL, MENU_ITEM_SUBMENU, MENU_ITEM_SEPARATOR }
 Enumeration of possible menu elements. More...

Functions

void InitializeMenu (Menu *menu)
 Initialize a menu structure to be shown.
void ShowMenu (Menu *menu, RunMenuCommandType runner, int x, int y)
 Show a menu.
void DestroyMenu (Menu *menu)
 Destroy a menu structure.
void SetMenuOpacity (const char *str)
 Set the Menu opacity level.

Variables

int menuShown
 The number of open menus.

Detailed Description

Header for the menu functions.

Author:
Joe Wingbermuehle
Date:
2004-2006

Definition in file menu.h.


Typedef Documentation

typedef struct Menu Menu

Structure to represent a menu or submenu.

typedef struct MenuAction MenuAction

Structure to represent a menu action for callbacks.

typedef struct MenuItem MenuItem

Structure to represent a menu item.

typedef void(* RunMenuCommandType)(const MenuAction *action)

Definition at line 95 of file menu.h.


Enumeration Type Documentation

Enumeration of menu action types.

Enumerator:
MA_NONE 
MA_EXECUTE 
MA_DESKTOP 
MA_SENDTO 
MA_LAYER 
MA_STICK 
MA_MAXIMIZE 
MA_MAXIMIZE_H 
MA_MAXIMIZE_V 
MA_MINIMIZE 
MA_RESTORE 
MA_SHADE 
MA_MOVE 
MA_RESIZE 
MA_KILL 
MA_CLOSE 
MA_EXIT 
MA_RESTART 

Definition at line 14 of file menu.h.

Enumeration of possible menu elements.

Enumerator:
MENU_ITEM_NORMAL 

Normal menu item (button).

MENU_ITEM_SUBMENU 

Submenu.

MENU_ITEM_SEPARATOR 

Item separator.

Definition at line 49 of file menu.h.


Function Documentation

void DestroyMenu ( Menu menu)

Destroy a menu structure.

Parameters:
menuThe menu to destroy.
void InitializeMenu ( Menu menu)

Initialize a menu structure to be shown.

Parameters:
menuThe menu to initialize.
void SetMenuOpacity ( const char *  str)

Set the Menu opacity level.

Parameters:
strThe value (ASCII).
void ShowMenu ( Menu menu,
RunMenuCommandType  runner,
int  x,
int  y 
)

Show a menu.

Parameters:
menuThe menu to show.
runnerCallback executed when an item is selected.
xThe x-coordinate of the menu.
yThe y-coordinate of the menu.

Variable Documentation

int menuShown

The number of open menus.