home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample SMSAM / SampleSMSAM Source / BuildingBlocks / WriteLineWindow.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-28  |  2.9 KB  |  79 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        WriteLineWindow.h
  3.  
  4.     Copyright:    © 1991-1994 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Part of the AOCE Sample SMSAM Package.  Consult the license
  8.     which came with this software for your specific legal rights.
  9.  
  10. */
  11.  
  12.  
  13.  
  14. #ifndef __EVENTS__
  15. #include <Events.h>
  16. #endif
  17.  
  18. #ifndef    __FILES__
  19. #include "Files.h"
  20. #endif
  21.  
  22. /* All public procedure begin with WW (for WritelnWindow)*/
  23.  
  24. //    Call this to initialize the WW globals
  25. extern pascal void WWInit(short numLines, short numCharsPerLine);
  26.  
  27. //    Call this to create a 'default' window, located on the main screen and
  28. //    small enough to fit on a Mac SE sized screen.
  29. extern pascal void WWNewDefault(void);
  30.  
  31. //    Call this to treate a new window, with the given parameters.
  32. extern pascal void WWNew(Rect *bounds, Str255 windowTitle, Boolean goAway, Boolean visible,
  33.                 short outputFont, short outputSize);
  34.  
  35. //    Pass this routine an event, and it will check whether that event 
  36. //    'belongs' to this debug window.  If it does, then it will handle the
  37. //    event and return true; otherwise it will return false.
  38. extern pascal Boolean WWEvent(EventRecord *anEvent);
  39.  
  40. //    If you call this, then subsequent writelns will be sent to the indicated file.  (Assuming
  41. //    writing to the file is enabled. Pass '' for the fileName to close any open file.
  42. extern pascal OSErr WWRedirect(short vRefnum, long dirID, Str255 fileName);
  43.  
  44. //    This uses the FSSpec record introduced with MPW 3.2.  A special case is that, if the vRefNum and
  45. //    the parID of the redirectFile are 0, then the file will be created in the current System Folder.
  46. extern pascal OSErr WWFSpRedirect (FSSpec *redirectFile, Boolean appendToExistingFile);
  47.  
  48. extern pascal void WWShowWindow (void);
  49.  
  50. // Since it is now possible that one part of the program disables writelns to the window, you
  51. //        might want to guarantee that certain writelns appear in the window.  WWForceOutput saves
  52. //        the values of gWrToWindow & gWrToFile on a stack (depth = kForceDepth), and sets
  53. //        these values according to the parameters.  WWEndForce simply pops the stack.
  54. extern pascal void WWForceOutput(short wrToWindow, short wrToFile);
  55. extern pascal void WWEndForce();
  56.  
  57.  
  58.  
  59. extern pascal void WWAddText(Ptr textBuf, long byteCount);
  60.  
  61. /* Call before SizeWindow if you need to resize the debug window programmatically*/
  62. extern pascal void WWInvalGrowBox();
  63.  
  64. /* Call after SizeWindow if you need to resize the debug window programmatically*/
  65. extern pascal void WWGrown();
  66.  
  67. //    Call the following procedures in response to events for the WriteLnWindow.
  68. //    (Test the window receiving the event against gDebugWindowPtr.
  69.  
  70. extern pascal void WWActivateEvent(short modifiers);
  71. extern pascal void WWMouseDown(short where, Point pt, short modifiers);
  72. extern pascal void WWUpdateEvent();
  73. extern pascal void WWScroll(short howManyLines); /* for UTrace use; negative arg scrolls backwards*/
  74.  
  75. extern pascal void IDUWritelnWindow(); /* Writeln UWritelnWindow's compile time.*/
  76.  
  77. extern pascal void WWFlushOutputFile(void);
  78.  
  79.