home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / utils / precognition / include / precognition_utils.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-23  |  2.2 KB  |  86 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.  
  13. #define pcg_GadgetRelativeCoords( g,e) GadgetRelativeCoods(g,e)
  14. /* Translates the MouseX, MouseY coordinates of a gadget-related
  15.  * IntuiMessage into coordinates which are relative to the gadget
  16.  * (instead of the window.)
  17.  */
  18.  
  19.  
  20. tPoint pcg_AspectRatio( USHORT ViewModes );
  21. /* Returns the aspect ration of a screen with the supplied viewmodes.
  22.  * i.e.  LO-RES            = 1 : 1
  23.  *       LORES INTERLACE   = 1 : 2
  24.  *       HIRES             = 2 : 1
  25.  *       HIRES INTERLACE   = 1 : 1
  26.  */
  27.  
  28.  
  29. void ChainGadgets( Gadget *start_of_chain, Gadget *gadget );
  30.  
  31.  
  32.  
  33. typedef struct AlignInfo   /* Used for alignment of text to objects */
  34. {
  35.    UBYTE Flags;
  36.    BYTE  Xpad;
  37.    BYTE  Ypad;
  38. } AlignInfo;
  39.  
  40. /* Text Alignment Flags */
  41. #define tx_LEFT      1
  42. #define tx_XCENTER   2
  43. #define tx_RIGHT     4
  44. #define tx_TOP       8
  45. #define tx_YCENTER   16
  46. #define tx_BOTTOM    32
  47. #define tx_INSIDE    64
  48. #define tx_OUTSIDE   128
  49.  
  50. #define STD_XPAD 4   /* Standard XPad value. */
  51. #define STD_YPAD 2   /* Standard YPad value. */
  52.  
  53.  
  54. /*
  55. ** This is a 'value added' version of 'struct IntuiText'
  56. **
  57. ** An 'AlignInfo' structure is appended to the end of the
  58. ** IntuiText data.  This information allows an object to
  59. ** intelligently reposition of the text when the object
  60. ** is resized.
  61. */
  62.  
  63. typedef struct PrecogText
  64. {
  65.    UBYTE             FrontPen,
  66.                      BackPen;   /* the pen numbers for the rendering */
  67.    UBYTE             DrawMode;  /* the mode for rendering the text */
  68.    SHORT             LeftEdge;  /* relative start location for the text */
  69.    SHORT             TopEdge;   /* relative start location for the text */
  70.    struct TextAttr  *ITextFont; /* if NULL, you accept the default */
  71.    UBYTE            *IText;     /* pointer to null-terminated text */
  72.    struct IntuiText *NextText;  /* continuation to TxWrite another text */
  73.  
  74.    AlignInfo         alignment;
  75. } PrecogText;
  76.  
  77.  
  78. void AlignText( PrecogText        *ptext,
  79.                 Point              size );
  80.    /*
  81.    ** Aligns text 'ptext' relative to an object of
  82.    ** dimensions 'size'.
  83.    */
  84.  
  85. #endif
  86.