home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / gnu / gmlibs23.lzh / GMLIBS23 / AESMENU.C < prev    next >
C/C++ Source or Header  |  1993-07-30  |  2KB  |  118 lines

  1. /*
  2.  *    Aes menu library interface
  3.  *
  4.  *        menu_bar        Show/Hide menu bar
  5.  *        menu_icheck        Check/Uncheck a menu item
  6.  *        menu_ienable    Enable/Disable a menu item
  7.  *        menu_tnormal    Display a menu item in normal/rev video
  8.  *        menu_text        Change the text of a menu item
  9.  *        menu_register    Put desk accessory menu item in Desk menu
  10.  *
  11.  *        ++jrb    bammi@cadence.com
  12.  *        modified: mj -- ntomczak@vm.ucs.ualberta.ca
  13.  */
  14. #include "common.h"
  15.  
  16. #ifdef __DEF_ALL__
  17.  
  18. #define L_menu_bar
  19. #define L_menu_ich
  20. #define L_menu_ien
  21. #define L_menu_tno
  22. #define L_menu_tex
  23. #define L_menu_reg
  24.  
  25. #endif /* __DEF_ALL__ */
  26.  
  27.  
  28. #ifdef L_menu_bar
  29.  
  30. /* Show/hide a menu bar
  31.  *    returns 0 on error    >0 no error
  32.  */
  33. int menu_bar(void *Tree, int ShowFlag)
  34. {
  35.     _int_in[0] = ShowFlag;
  36.     _addrin[0] = Tree;
  37.     
  38.     return __aes__(AES_CONTROL_ENCODE(30, 1, 1, 1));
  39. }
  40. #endif /* L_menu_bar */
  41.  
  42.  
  43. #ifdef L_menu_ich
  44.  
  45. /* Check/Uncheck a menu item
  46.  *    returns 0 on error    >0 no error
  47.  */
  48. int menu_icheck(void *Tree, int Item, int CheckFlag)
  49. {
  50.     _addrin[0] = Tree;
  51.     _int_in[0] = Item;
  52.     _int_in[1] = CheckFlag;
  53.     
  54.     return __aes__(AES_CONTROL_ENCODE(31, 2, 1, 1));
  55. }
  56. #endif /* L_menu_ich */
  57.  
  58. #ifdef L_menu_ien
  59.  
  60. /* Enable/Disable a menu item
  61.  *    returns 0 on error    >0 no error
  62.  */
  63. int menu_ienable(void *Tree, int Item, int EnableFlag)
  64. {
  65.     _addrin[0] = Tree;
  66.     _int_in[0] = Item;
  67.     _int_in[1] = EnableFlag;
  68.  
  69.     return __aes__(AES_CONTROL_ENCODE(32, 2, 1, 1));
  70. }
  71. #endif /* L_menu_ien */
  72.  
  73. #ifdef L_menu_tno
  74.  
  75. /* Show menu item in Norm/Rev video
  76.  *    returns 0 on error    >0 no error
  77.  */
  78. int menu_tnormal(void *Tree, int Item, int NormalFlag)
  79. {
  80.     _addrin[0] = Tree;
  81.     _int_in[0] = Item;
  82.     _int_in[1] = NormalFlag;
  83.  
  84.     return __aes__(AES_CONTROL_ENCODE(33, 2, 1, 1));
  85. }
  86. #endif /* L_menu_tno */
  87.  
  88. #ifdef L_menu_tex
  89.  
  90. /* Change the text of a menu item
  91.  *    returns 0 on error    >0 no error
  92.  */
  93. int menu_text(void *Tree, int Item, char *Text)
  94. {
  95.     _addrin[0] = Tree;
  96.     _addrin[1] = Text;
  97.     _int_in[0]  = Item;
  98.     
  99.     return __aes__(AES_CONTROL_ENCODE(34, 1, 1, 2));
  100. }
  101. #endif /* L_menu_tex */
  102.  
  103. #ifdef L_menu_reg
  104.  
  105. /* Register an accessory with the Desk Menu
  106.  *    returns menuid    -1 == no more room in desk menu
  107.  */
  108. int menu_register(int ApId, char *MenuText)
  109. {
  110.     _int_in[0] = ApId;
  111.     _addrin[0] = MenuText;
  112.     
  113.     return __aes__(AES_CONTROL_ENCODE(35, 1, 1, 1));
  114. }
  115. #endif /* L_menu_reg */
  116.  
  117. /* - eof - */
  118.