home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Entertainment / Boxes / Boxes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-26  |  2.8 KB  |  116 lines  |  [TEXT/KAHL]

  1.  
  2.  
  3. /*
  4.  * Horizontal and vertical ratios for positioning the dialogs on the screen
  5.  * according the Apple's (current) Human Interface Guidelines.
  6.  */
  7.  
  8. # define    horizRatio        FixRatio (1, 2)
  9. # define    vertRatio        FixRatio (1, 5)
  10.  
  11.  
  12. # define    aboutAlrt            1000
  13. # define    gnrlAlrt            1001
  14. # define    boardDlog            1002
  15. # define    infoAlrt            1003
  16. # define    colorDlog            1004
  17. # define    authorAlrt            1005
  18.  
  19. /*
  20.     Maximum number of players
  21. */
  22.  
  23. # define    maxPlayer    4
  24. # define    noPlayer    (-1)
  25.  
  26. /*
  27.     Maximum number of squares horizontally/vertically.
  28. */
  29.  
  30. # define    maxSquares    12
  31.  
  32.  
  33. # define    hPad        10        /* extra space on left/right */
  34. # define    vPad        10        /* extra space on top/bottom */
  35.  
  36. extern short    hSquares;
  37. extern short    vSquares;
  38.  
  39. extern FontInfo    fontInfo;            /* info about system font */
  40.  
  41. # define    fontHeight        (fontInfo.ascent + fontInfo.descent)
  42. # define    lineHeight        (fontInfo.ascent + fontInfo.descent + fontInfo.leading)
  43.  
  44. /* main module prototypes */
  45.  
  46. void SetOptionsMenuPlayerCount (void);
  47.  
  48. /* Window manager prototypes */
  49.  
  50. void    WindInit (void);
  51. void    ForceWindowUpdate (void);
  52. void    NewGame (void);
  53.  
  54. /* Board manager prototypes */
  55.  
  56. void    GetBoardSize (short *h, short *v);
  57. void    SetBoardSize (short h, short v);
  58. void    InitializeBoard (void);
  59. void    CalcBoardSize (Rect *r);
  60. short    SidesLeft (void);
  61. short    SetHSide (short h, short v, short player);
  62. short    SetVSide (short h, short v, short player);
  63. Boolean    HLinkHitTest (Point pt, short    *hval, short    *vval);
  64. Boolean VLinkHitTest (Point pt, short    *hval, short    *vval);
  65. void    DrawHSide (short h, short v);
  66. void    DrawVSide (short h, short v);
  67. void    DrawGrid (short cols, short rows,
  68.                     short hOffset, short vOffset,
  69.                     short hSize, short vSize);
  70. void    DrawOwner (short h, short v);
  71. void    DrawBoard (void);
  72.  
  73.  
  74. /* Scoreboard manager prototypes */
  75.  
  76. short    GetPlayerCount (void);
  77. void    SetPlayerCount (short n);
  78. void    InitializeScoreBoard (void);
  79. void    CalcScoreBoardSize (Rect *r);
  80. void    PlaceScoreBoard (short h, short v);
  81. void    NextPlayer (void);
  82. short    GetPlayer (void);
  83. void    IncrementScore (short player, short n);
  84. void    DrawScore (short i);
  85. void    DrawScoreBoard (void);
  86.  
  87. /* Color manager prototypes */
  88.  
  89. void    InitColor (void);
  90. void    SetColor (short color);
  91. void    RestoreColor (void);
  92. short    GetDotColor (void);
  93. short    GetSideColor (void);
  94. short    GetScoreboardColor (void);
  95. short    GetPlayerColor (short player);
  96. void    SetDotColor (short color);
  97. void    SetSideColor (short color);
  98. void    SetScoreboardColor (short color);
  99. void    SetPlayerColor (short player, short color);
  100.  
  101. /* Board size dialog prototypes */
  102.  
  103. void    BoardDialog (void);
  104.  
  105. /* Color dialog prototypes */
  106.  
  107. void    ColorDialog (void);
  108.  
  109. /* Message alert prototypes */
  110.  
  111. void    SetMessageAlertNum (short alrtNum);
  112. void    Message1 (StringPtr s1);
  113. void    Message2 (StringPtr s1, StringPtr s2);
  114. void    Message3 (StringPtr s1, StringPtr s2, StringPtr s3);
  115. void    Message4 (StringPtr s1, StringPtr s2, StringPtr s3, StringPtr s4);
  116.