home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Ken Long / FontShow-1.1.2-c / Think / Fontshow.h < prev    next >
Encoding:
Text File  |  1994-12-04  |  3.2 KB  |  126 lines  |  [TEXT/KAHL]

  1. //• FontShow.h
  2.  
  3. #include <PrintTraps.h>        //• #included by kal. 
  4.  
  5. //• #exclude <ctype.h>        //• #excluded by kal.
  6. //• #exclude <unix.h>        //• #excluded by kal. 
  7.  
  8.  
  9. //• Menu stuff.
  10. #define APPLE         0
  11. #define FILE        1
  12. #define EDIT        2
  13. #define OPTIONS    3
  14. #define SIZE        4
  15.  
  16. #define APPLE_M     128
  17. #define FILE_M        129
  18. #define EDIT_M        130
  19. #define OPTIONS_M    131
  20. #define SIZE_M        132
  21. #define TEMP_M        200    //• Temporary menu for list creating.
  22.  
  23. #define SIZE9        1
  24. #define SIZE10        2
  25. #define SIZE12        3
  26. #define SIZE14        4
  27. #define SIZE18        5
  28. #define SIZE20        6
  29. #define SIZE24        7
  30.  
  31.  
  32. #define INFO        1
  33. #define SETUP         1
  34. #define DISPLAY    2
  35. #define PRINT        3
  36. #define QUIT        5
  37. #define SAMPLE        1
  38. #define STRING        2
  39. #define MAP            3
  40.  
  41. //• Dialog stuff.
  42. #define FONTLIST        128
  43. #define WAIT            129
  44. #define ABOUT            130
  45. #define SCREENBREAK    131
  46. #define PRINTBREAK    132
  47. #define SPOOLINFO        133
  48. #define PRINTINFO        134
  49.  
  50. #define INALL        4
  51. #define EXALL        5
  52. #define REVERT        6
  53. #define FLIST    7
  54.  
  55. //• Output stuff.
  56. #define FONTWINDOW 128
  57. #define STRINGS     129
  58.  
  59. #define TOPH    8
  60. #define TOPV    24
  61. #define TOPF    16
  62.  
  63. //• General stuff.
  64. #define NIL (void *)0L
  65.  
  66. //• Window stuff.
  67.  
  68.  
  69. //• Error messages.
  70. #define ERR_NOROOM    1
  71. #define ERR_PRINT        2
  72.  
  73. //•-----------------------------------------------------------------------•//
  74. //•-------------------- Global variables ---------------------------------•//
  75. //•-----------------------------------------------------------------------•//
  76.  
  77. typedef struct 
  78. {
  79.     Str255    fontName;            //• font name.
  80.     int        fontNum;                //• font number.
  81.     int        lineHeight;            //• line height.
  82.     int         widMax;                //• maximal character width.
  83.     Boolean    flag;                    //• flag set if font is selected.
  84. }myFontInfo;                        //• infos about each font.
  85.  
  86. myFontInfo    **fontHdl;            //• pointer to dynamic array of myFontInfos.
  87. ListHandle     myList;                //• list of font names.
  88. CursHandle    myCursor[4];        //• busy cursor.
  89. MenuHandle     myMenus[5];            //• menu bar.
  90. THPrint        prRecHdl;            //• print info.
  91. Handle        myText;                //• handle to sample text.
  92. int            textLength;            //• sample text length.
  93. int             fontCount;            //• nr of fonts in system.
  94. int            opt;                    //• sample text or character map.
  95. Boolean         prFlag;                //• printer or screen output.
  96. Boolean         quit;                    //• quit main loop.
  97. int            fontSize;            //• selected font size.
  98. int            oldItem;                //• font size menu item.
  99.  
  100. //•-----------------------------------------------------------------------•//
  101. //• Prototypes -----------------------------------------------------------•//
  102. //•-----------------------------------------------------------------------•//
  103.  
  104. extern void ErrorMsg (int index);
  105. extern void ShowInfo (void);
  106. extern Boolean BreakCheck (void);
  107. extern void DrawPage (int i);
  108. extern void ShowFonts (void);
  109. extern int HowMany (void);
  110. extern void PrintFonts (void);
  111. extern pascal void DrawList (WindowPtr theWindow, int itemNo);
  112. extern pascal Boolean myFilter (DialogPtr theDialog, EventRecord *theEvent, 
  113.                                         int *itemHit);
  114. extern void InitList (WindowPtr theWindow);
  115. extern Boolean SelectFonts (void);
  116. extern void HandleMenu (long sel);
  117. extern void HandleMouseDown (EventRecord event);
  118. extern void MainLoop (void);
  119. extern void InitMenu (void);
  120. extern void InitText (void);
  121. extern void InitPrint (void);
  122. extern void BuildList (void);
  123. extern void InitThings (void);
  124. extern void CleanUp (void);
  125. extern void main (void);
  126.