home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Enlightenment / enl_BETA-0.13.src.tar.gz / enl_BETA-0.13.src.tar / enl-0.13 / menus.h < prev    next >
C/C++ Source or Header  |  1997-10-29  |  2KB  |  101 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.     
  36.    /* temp storage for static menu items on a windowlist menu */
  37.    MenuItem **static_items;
  38.    int static_num_items;
  39.    int static_item_x,static_item_y;
  40.     
  41.  
  42.    /* location of the popup when rendered live */
  43.    int px,py;
  44.  
  45.    /* variables to store default menuitem values */
  46.  
  47.    /* default location */
  48.    int item_x,item_y;
  49.  
  50.    /* default size */
  51.    int item_w,item_h;
  52.  
  53.    /* default text location and size */
  54.    int itemtext_x,itemtext_y,itemtext_w,itemtext_h;
  55.  
  56.    /* default relative location of the next item */
  57.    int itemdelta_x,itemdelta_y;
  58.  
  59.    /* default image information */
  60.    char *item_unsel,*item_sel;
  61.    ImColor item_unsel_icl,item_sel_icl;
  62. } Menu;
  63.  
  64. struct menulist
  65. {
  66.    struct menulist *next;
  67.    Menu *menu;
  68. };
  69.  
  70. /* menu types */
  71. #define MENU_CUSTOM        0
  72. #define MENU_WINDOWLIST       1
  73.  
  74. /* menu element types */
  75. #define DECOR              0
  76. #define ELEMENT            1
  77.  
  78. void InitMenuList();
  79. void AddMenuToList(Menu *menu);
  80. Menu *FindMenu(char *name);
  81. Menu *GetMenuWin(Window w);
  82. void AddActiveMenuToList(Menu *menu);
  83. void DeleteToActiveMenu(char *name);
  84. Menu *GetActiveMenuWin(Window w);
  85. Menu *CreateMenu(char *name, int type, int num_items);
  86. void AddMenuItem(Menu *m, MenuItem* mi);
  87. void RenderMenu(Menu *m);
  88. MenuItem *CreateMenuItem(int type, int x, int y, int width, int height, char *text,
  89.             int text_x, int text_y, int text_w, int text_h,
  90.             char *unsel, ImColor *unsel_icl,
  91.             char *sel, ImColor *sel_icl);
  92. MenuItem *CreateMenuWinlistItem(int type, int x, int y, int width, int height, char *text, 
  93.             int text_x, int text_y, int text_w, int text_h, 
  94.             char *unsel, ImColor *unsel_icl,
  95.             char *sel, ImColor *sel_icl);
  96. void DrawMenuItem(Menu *m, int num, int state);
  97. void ShowMenu(Menu *menu);
  98. void HideMenu(Menu *menu);
  99. void HideAllMenus();
  100.  
  101.