home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / source / frntsdk1.cpt / Frontier SDK 1.0 ƒ / Move These Files / UserLand #includes / menusharing.h < prev   
Encoding:
C/C++ Source or Header  |  1991-10-21  |  1.9 KB  |  81 lines

  1.  
  2. /*⌐ Copyright 1991 UserLand Software, Inc.  All Rights Reserved.*/
  3.  
  4.  
  5. #ifndef __APPLEEVENTS__
  6.  
  7.     #include <AppleEvents.h>
  8.  
  9. #endif
  10.  
  11.  
  12. #define __MENUSHARING__ /*so other modules can tell that we've been included*/
  13.  
  14.  
  15.  
  16. typedef struct tysharedmenurecord { /*must match scripting system record structure*/
  17.     
  18.     short idmenu; /*the resource id of the menu*/
  19.     
  20.     int flhierarchic: 1; /*if true it's a hiearchic menu*/
  21.     
  22.     int flinserted: 1; /*if true the menu has been inserted in the menu bar*/
  23.     
  24.     MenuHandle hmenu; /*a handle to the Mac Menu Manager's data structure*/
  25.     } tysharedmenurecord;
  26.  
  27.  
  28. typedef tysharedmenurecord tymenuarray [1];
  29.  
  30. typedef tymenuarray **hdlmenuarray;
  31.  
  32. typedef Boolean (*tyMScallback) (void);
  33.  
  34.  
  35. typedef struct tyMSglobals { /*Menu Sharing globals, all in one struct*/
  36.  
  37.     OSType serverid; /*identifier for shared menu server*/
  38.  
  39.     OSType clientid; /*id of this application*/
  40.     
  41.     hdlmenuarray hsharedmenus; /*data structure that holds shared menus*/
  42.     
  43.     Boolean fldirtysharedmenus; /*if true, menus are reloaded next time app comes to front*/
  44.     
  45.     Boolean flscriptcancelled; /*set true by calling CancelSharedScript*/
  46.     
  47.     Boolean flscriptrunning; /*true if a script is currently running*/
  48.     
  49.     tyMScallback scriptcompletedcallback; /*if non-nil, it's called when the script completes*/
  50.     } tyMSglobals;
  51.  
  52.  
  53. extern tyMSglobals MSglobals; /*menu sharing globals*/
  54.  
  55.  
  56. /*basic Menu Sharing routines*/
  57.  
  58.     pascal Boolean InitSharedMenus (void);
  59.  
  60.     pascal Boolean SharedMenuHit (short, short);
  61.     
  62.     pascal Boolean SharedScriptRunning (void);
  63.     
  64.     pascal Boolean CancelSharedScript (void);
  65.     
  66.     pascal Boolean CheckSharedMenus (short);
  67.     
  68.     pascal Boolean SharedScriptCancelled (AppleEvent *, AppleEvent *);
  69.     
  70.  
  71. /*special-purpose routines*/
  72.  
  73.     pascal Boolean DisposeSharedMenus (void);
  74.  
  75.     pascal Boolean IsSharedMenu (short);
  76.     
  77.     pascal Boolean EnableSharedMenus (Boolean);
  78.     
  79.     pascal Boolean RunSharedMenuItem (short, short);
  80.     
  81.