home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 594b.lha / Precognition_rel1 / precognition_utils.h < prev    next >
C/C++ Source or Header  |  1991-12-12  |  3KB  |  100 lines

  1. #ifndef PRECOGNITION_UTILS_H
  2. #define PRECOGNITION_UTILS_H
  3.  
  4. #include <intuition/intuition.h>
  5. #include "intuition_typedefs.h"
  6.  
  7. #ifndef PRECOGNITION_UTILS_BODY
  8. extern TextAttr pcg_Topaz80;
  9. #endif
  10.  
  11.  
  12. BOOL is_Workbench_v2( void );
  13.    /* returns TRUE if you're running Workbench 2.0 */
  14.    
  15.  
  16. tPoint pcg_GadgetRelativeCoords( Gadget       *gadget,
  17.                                  IntuiMessage *event );
  18. /* Translates the MouseX, MouseY coordinates of a gadget-related
  19.  * IntuiMessage into coordinates which are relative to the gadget
  20.  * (instead of the window.)
  21.  */
  22.  
  23.  
  24. tPoint pcg_AspectRatio( USHORT ViewModes );
  25. /* Returns the aspect ration of a screen with the supplied viewmodes.
  26.  * i.e.  LO-RES            = 1 : 1
  27.  *       LORES INTERLACE   = 1 : 2
  28.  *       HIRES             = 2 : 1
  29.  *       HIRES INTERLACE   = 1 : 1
  30.  */
  31.  
  32. void SetWaitPointer( Window *w );
  33. /* changes the pointer to the standard 2.0 'clock' wait pointer. */
  34.  
  35. void ChainGadgets( Gadget *start_of_chain, Gadget *gadget );
  36.  
  37. IntuiMessage *WaitForMsg( struct MsgPort *mport );
  38.  
  39. Window *OpenWindowWithSharedPort( struct NewWindow *nw,
  40.                                   struct MsgPort   *shared );
  41.  
  42. void CloseWindowSafely( Window *w ); /* Taken from 1.3 RKM:L&D, page 171 */
  43.  
  44.  
  45.  
  46.  
  47. typedef struct AlignInfo   /* Used for alignment of text to objects */
  48. {
  49.    UBYTE Flags;
  50.    BYTE  Xpad;
  51.    BYTE  Ypad;
  52. } AlignInfo;
  53.  
  54. /* Text Alignment Flags */
  55. #define tx_LEFT      1
  56. #define tx_XCENTER   2
  57. #define tx_RIGHT     4
  58. #define tx_TOP       8
  59. #define tx_YCENTER   16
  60. #define tx_BOTTOM    32
  61. #define tx_INSIDE    64
  62. #define tx_OUTSIDE   128
  63.  
  64. #define STD_XPAD 4   /* Standard XPad value. */
  65. #define STD_YPAD 2   /* Standard YPad value. */
  66.  
  67.  
  68. /*
  69. ** This is a 'value added' version of 'struct IntuiText'
  70. **
  71. ** An 'AlignInfo' structure is appended to the end of the
  72. ** IntuiText data.  This information allows an object to
  73. ** intelligently reposition of the text when the object
  74. ** is resized.
  75. */
  76.  
  77. typedef struct PrecogText
  78. {
  79.    UBYTE             FrontPen,
  80.                      BackPen;   /* the pen numbers for the rendering */
  81.    UBYTE             DrawMode;  /* the mode for rendering the text */
  82.    SHORT             LeftEdge;  /* relative start location for the text */
  83.    SHORT             TopEdge;   /* relative start location for the text */
  84.    struct TextAttr  *ITextFont; /* if NULL, you accept the default */
  85.    UBYTE            *IText;     /* pointer to null-terminated text */
  86.    struct IntuiText *NextText;  /* continuation to TxWrite another text */
  87.  
  88.    AlignInfo         alignment;
  89. } PrecogText;
  90.  
  91.  
  92. void AlignText( PrecogText        *ptext,
  93.                 Point              size );
  94.    /*
  95.    ** Aligns text 'ptext' relative to an object of
  96.    ** dimensions 'size'.
  97.    */
  98.  
  99. #endif
  100.