home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 06 - 1990 / 06.01 Jan 90 / MacTutor Help Source / Code Resource Version / Source Code / help.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-22  |  2.7 KB  |  88 lines  |  [TEXT/KAHL]

  1. /***********************************************************************\
  2. | Purpose :: This header file contains all of the global data             |
  3. |             structures and function prototypes necessary for this        |
  4. |             code resource to operate correctly.                          |
  5. |-----------------------------------------------------------------------|
  6. |        Copyright © Joe Pillera, 1990.  All Rights Reserved.            |
  7. |    Copyright © MacTutor Magazine, 1990.  All Rights Reserved.            |
  8. \***********************************************************************/
  9.  
  10.  
  11. /* Maximum number of topics */
  12. #define        MAX_TOPICS            50
  13.  
  14. /* Dialog box information */
  15. #define        Help_Window            300
  16. #define        Help_Not_Found        301
  17. #define        Help_Error            302
  18. #define        OK_Button            1
  19. #define        Topics_Area            2
  20. #define        Display_Area        3
  21. #define        Next_Button            4
  22. #define        Prev_Button            5
  23. #define        Message_Area        7
  24.  
  25. /* Constant for first screen in a series */
  26. #define        Initial_Picture            0
  27.  
  28. /* Are we in picture or text mode? */
  29. typedef  enum {
  30.     pict,
  31.     text
  32. }  ViewMode;
  33.  
  34. /* Errors I check for */
  35. typedef  enum {
  36.     err_no_HTBL,        /* Missing ID=128 of the help table      */
  37.     err_min_res,        /* Not enough help screens specified  */
  38.     err_intro_pict,        /* Intro screen must be a picture      */
  39.     err_bad_type,        /* Not a TEXT or PICT screen (typo?)  */
  40.     err_no_pict,        /* The PICT for this topic isnt there */
  41.     err_no_text            /* The TEXT for this topic isnt there */
  42. }  ErrorTypes;
  43.  
  44. /* Read the HTBL resource information */
  45. typedef struct {
  46.     int            First_Menu;    
  47.     int            Last_Menu;    
  48.     int            Number_Of_Topics;    
  49.     long        type;
  50.     int            resource_start;
  51.     int            resource_end;
  52.     Str255        topic_name;
  53. } **Help_Info_Handle;
  54.  
  55. /* Other constants */
  56. #define        NOT_FOUND            -1
  57. #define        ON                    0
  58. #define        OFF                    255
  59. #define        NIL                    0L
  60. #define        FRONT                (WindowPtr)-1
  61.  
  62. /* Function prototypes */
  63. extern    void    Add_List_String( Str255 *, ListHandle );
  64. extern    void    Bold_Button( DialogPtr, int );
  65. extern    void    Center_Window( DialogPtr, int, Boolean );
  66. extern    Boolean Create_Help( void );
  67. extern    void    Dialog_String( DialogPtr, int, char * );
  68. extern    void    Display_Pict( int );
  69. extern  void    Display_Text( void );
  70. extern    void    Error_Message( ErrorTypes );
  71. extern    void    Help_Event_Loop( void );
  72. extern    void    Handle_List_Event( int );
  73. extern    void    Handle_Update( void );
  74. extern    void    Init_Help( void );
  75. extern    void    Kill_Window( void );
  76. extern    pascal    void main( void );
  77. extern  pascal  void My_Scroll_Filter ( ControlHandle, int );
  78. extern  int     ParseInt( char ** );
  79. extern    long    ParseOSType( char **);
  80. extern    void     ParseString( char *, char ** );
  81. extern  void    pStrCat( char *, char *, char * );
  82. extern    void    pStrCopy( char *, char * );
  83. extern     void      Refresh_Topics( void );
  84. extern  void    Scroll_Picture( int );
  85. extern  void    Scroll_Text( int, int );
  86. extern    void    Set_Button_State( int, Boolean );
  87. extern  void    User_Message( char * );
  88.