home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / boopsi / popupmenuclass / include / popupmenuclass.h
C/C++ Source or Header  |  1995-10-09  |  2KB  |  95 lines

  1. #ifndef PUMG_CLASS_H
  2. #define PUMG_CLASS_H 1
  3. /** ** *** MakeRev Header *** **
  4. **
  5. **  ** PopupMenuClass - BOOPSI Popup menu. **
  6. **
  7. **  Copyright © 1993,1994 Markus Aalto
  8. **
  9. **  Creation date: 09-Dec-93
  10. **
  11. **  ------------------------------------------------------------------
  12. **  $Filename: PopUpMenuClass.h $
  13. **  $Revision: 1.1 $
  14. **  $Date: 29-Dec-93 $
  15. **
  16. **  $Author: Markus_Aalto $
  17. **  $Comment: Freely Distributable. $
  18. **
  19. */
  20.  
  21. #include <exec/types.h>
  22. #include <exec/memory.h>
  23. #include <exec/lists.h>
  24. #include <exec/libraries.h>
  25.  
  26. #include <graphics/gfxmacros.h>
  27. #include <graphics/regions.h>
  28.  
  29. #include <intuition/intuition.h>
  30. #include <intuition/classusr.h>
  31. #include <intuition/gadgetclass.h>
  32. #include <intuition/icclass.h>
  33. #include <intuition/imageclass.h>
  34.  
  35. #include <utility/tagitem.h>
  36.  
  37. #include <stdlib.h>
  38.  
  39. #include <proto/all.h>
  40.  
  41. extern  Class *CreatePopUpMenuClass( void );
  42. extern  BOOL DisposePopUpMenuClass( Class *cl );
  43.  
  44. #define PUMG_TAGBASE            (TAG_USER + 700)
  45.  
  46. /*  Text in Exec List. (ISG--) */
  47. #define PUMG_Labels             (PUMG_TAGBASE)
  48.  
  49. /*  Active item in Labels list. (ISGNU) */
  50. #define PUMG_Active             (PUMG_TAGBASE+1)
  51.  
  52. /*  TextFont we use for Texts. (ISG--) */
  53. #define PUMG_TextFont           (PUMG_TAGBASE+2)
  54.  
  55. /*  V39 users can use this to use NewLook menu colors. (I-G--) */
  56. #define PUMG_NewLook            (PUMG_TAGBASE+3)
  57.  
  58.  
  59. /* Predefined Minimum dimensions for safe operation. */
  60. #define PUMG_MinWidth           28
  61. #define PUMG_MinHeight          8
  62.  
  63. /*****************************************************/
  64. /* Private data, do NOT USE this outside class code. */
  65. /*****************************************************/
  66. #ifdef POPUPMENUCLASS_PRIVATE
  67.  
  68. #define PUMG_SetTagArg(tag, id, data)   {tag.ti_Tag = (ULONG)(id);\
  69.                                         tag.ti_Data = (ULONG)(data);}
  70.  
  71. typedef ULONG (*HookFunction)(void);
  72.  
  73. typedef struct {
  74.     struct  List *Labels;
  75.     UWORD   Active;
  76.     UWORD   Count;
  77.     BOOL    NewLook;
  78.  
  79.     /* For rendering. */
  80.     struct  Image *FrameImage;
  81.     struct  TextFont *Font;
  82.  
  83.     /* Temporary data for PopupMenu. */
  84.     UWORD   ItemHeight;
  85.     UWORD   FitsItems;
  86.     BOOL    ActiveFromMouse;
  87.     UWORD   Temp_Active;
  88.     struct  Window *popup_window;
  89.     struct  Rectangle rect;
  90. } PUMGData;
  91.  
  92. #endif      /* POPUPMENUCLASS_PRIVATE */
  93.  
  94. #endif      /* PUMG_CLASS_H */
  95.