home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Enlightenment / enl_DR-0.10.tar.gz / enl_DR-0.10.tar / enl / menus.h < prev    next >
C/C++ Source or Header  |  1997-06-19  |  2KB  |  69 lines

  1. typedef struct
  2. {
  3.    int type; /* if this menu element is DECOR, only the bg_unsel are set */
  4.    Pixmap unsel_pmap;
  5.    Pixmap unsel_mask;
  6.    Pixmap sel_pmap;
  7.    Pixmap sel_mask;
  8.  
  9.    Window win;
  10.    
  11.    int x;
  12.    int y;
  13.    int width;
  14.    int height;
  15.  
  16.    char *text;
  17.    Action action;
  18. } MenuItem;
  19.  
  20. typedef struct
  21. {
  22.    int type; /* Menu type */
  23.    int num_items; /* number of items in the menuitme list */   
  24.    int width; /* width of the menu */
  25.    int height; /* height of the menu */
  26.    char name[256]; /* name identifier of menu (up to 255 chars) */
  27.  
  28.    int popup_x;
  29.    int popup_y;
  30.    Window win;
  31.    Pixmap mask;
  32.    int sel_item;
  33.    
  34.    MenuItem **items; /* list of menu items */
  35. } Menu;
  36.  
  37. struct menulist
  38. {
  39.    struct menulist *next;
  40.    Menu *menu;
  41. };
  42.  
  43. /* menu types */
  44. #define MENU_CUSTOM        0
  45.  
  46. /* menu element types */
  47. #define DECOR              0
  48. #define ELEMENT            1
  49.  
  50. void InitMenuList();
  51. void AddMenuToList(Menu *menu);
  52. Menu *FindMenu(char *name);
  53. Menu *GetMenuWin(Window w);
  54. void AddActiveMenuToList(Menu *menu);
  55. void DeleteToActiveMenu(char *name);
  56. Menu *GetActiveMenuWin(Window w);
  57. Menu *CreateMenu(char *name, int type, int num_items);
  58. void AddMenuItem(Menu *m, MenuItem* mi);
  59. void RenderMenu(Menu *m);
  60. MenuItem *CreateMenuItem(int type, int x, int y, int width, int height, char *text,
  61.             int text_x, int text_y, int text_w, int text_h,
  62.             char *unsel, ImColor *unsel_icl,
  63.             char *sel, ImColor *sel_icl);
  64. void DrawMenuItem(Menu *m, int num, int state);
  65. void ShowMenu(Menu *menu);
  66. void HideMenu(Menu *menu);
  67. void HideAllMenus();
  68.  
  69.