home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2001 / MacHack 2001.toast / pc / The Hacks / GrowBoxDock / Sources / SimpleText.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-30  |  20.2 KB  |  519 lines

  1. /*
  2.     File:        SimpleText.h
  3.  
  4.     Contains:    defines input for both .c and .r files.
  5.                 structured so as to compile correctly in both.
  6.  
  7.     Version:    Mac OS X
  8.  
  9.     Disclaimer:    IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc.
  10.                 ("Apple") in consideration of your agreement to the following terms, and your
  11.                 use, installation, modification or redistribution of this Apple software
  12.                 constitutes acceptance of these terms.  If you do not agree with these terms,
  13.                 please do not use, install, modify or redistribute this Apple software.
  14.  
  15.                 In consideration of your agreement to abide by the following terms, and subject
  16.                 to these terms, Apple grants you a personal, non-exclusive license, under Apple’s
  17.                 copyrights in this original Apple software (the "Apple Software"), to use,
  18.                 reproduce, modify and redistribute the Apple Software, with or without
  19.                 modifications, in source and/or binary forms; provided that if you redistribute
  20.                 the Apple Software in its entirety and without modifications, you must retain
  21.                 this notice and the following text and disclaimers in all such redistributions of
  22.                 the Apple Software.  Neither the name, trademarks, service marks or logos of
  23.                 Apple Computer, Inc. may be used to endorse or promote products derived from the
  24.                 Apple Software without specific prior written permission from Apple.  Except as
  25.                 expressly stated in this notice, no other rights or licenses, express or implied,
  26.                 are granted by Apple herein, including but not limited to any patent rights that
  27.                 may be infringed by your derivative works or by other works in which the Apple
  28.                 Software may be incorporated.
  29.  
  30.                 The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO
  31.                 WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
  32.                 WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  33.                 PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
  34.                 COMBINATION WITH YOUR PRODUCTS.
  35.  
  36.                 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
  37.                 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  38.                 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  39.                 ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
  40.                 OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
  41.                 (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
  42.                 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  43.  
  44.     Copyright © 1993-2001 Apple Computer, Inc., All Rights Reserved
  45. */
  46.  
  47. #ifndef __SIMPLETEXT__
  48. #define __SIMPLETEXT__
  49.  
  50.  
  51. //#define kScrollBarSize                15        // size of a scroll bar, in pixels
  52. #ifndef REZ
  53. extern SInt16    kScrollBarSize;
  54. #endif
  55.  
  56. // Internal errors -- WARNING: some also appear in SimpleText.r
  57. #define eActionAlreadyHandled        100        // the action was handled by the object, don't report an error
  58. #define eUserCanceled                101        // user canceled an operation
  59.  
  60. #define eDocumentTooLarge            200        // document too large to be opened
  61. #define eDocumentWrongKind            201        // document cannot be opened by this application
  62. #define eErrorWhileDrawing            202        // error while drawing the document
  63. #define eDocumentContainsPS            203        // document contains PostScript, it may not display properly
  64. #define eMachineToOld                204
  65. #define eDocumentNotModifiable        205        // document can't be modified
  66. #define eDocumentAlreadyOpen        206
  67. #define eDocumentContainsNoPages    207
  68.  
  69. #define eDocumentHasNoContentsEntries 208    
  70.  
  71. // icon IDs -- WARNING: Also appear in SimpleText.r
  72. #define kTextIcon                    129
  73. #define kReadOnlyIcon                130
  74. #define kPICTIcon                    131
  75. #define kStationeryIcon                132
  76.  
  77. // menu and item defines -- define 'MENU' 'MCMD' 'hmnu' and 'STR#' IDs for menus!
  78. #define rMenuBar            128
  79.  
  80. #define    mApple                128
  81. #define    mFile                129
  82. #define    mEdit                130
  83. #define mFont                131
  84. #define mSize                132
  85. #define mStyle                133
  86. #define    mSound                134
  87. #define mVoices                135
  88. #define mContents            136        
  89.  
  90. #define mLastMenu            mContents
  91. #define mNumberMenus        9
  92.  
  93. #define mFontSubMenusStart    200
  94.  
  95. // Command numbers
  96. #define cNull                0
  97. #define cAbout                1
  98. #define cDeskAccessory        2
  99. #define cTypingCommand        3
  100.  
  101. #define cNew                10
  102. #define cOpen                11
  103. #define cClose                12
  104. #define cSave                13
  105. #define cSaveAs                14
  106. #define cPageSetup            15
  107. #define cPrint                16
  108. #define cPrintOneCopy        17
  109. #define cQuit                18
  110.  
  111. #define cUndo                20
  112. #define cCut                21
  113. #define cCopy                22
  114. #define cPaste                23
  115. #define cClear                24
  116. #define cSelectAll            25
  117. #define cFind                26
  118. #define cFindAgain            27
  119. #define cFindSelection        28
  120. #define cReplace            29
  121. #define cReplaceAgain        30
  122. #define cNextPage            31
  123. #define cPreviousPage        32
  124. #define cGotoPage            33
  125.     #define cGotoLast            32767
  126.     #define cGotoFirst            -32767
  127. #define cShowClipboard        34
  128.  
  129. #define cSelectFont            35
  130. #define cSelectFontStyle    36
  131. #define cExecute            37    // for AppleScript
  132.  
  133. #define cSize9                40
  134. #define cSize10                41
  135. #define cSize12                42
  136. #define cSize14                43
  137. #define cSize18                44
  138. #define cSize24                45
  139. #define cSize36                46
  140.  
  141. #define cPlain                50
  142. #define cBold                51
  143. #define cItalic                52
  144. #define cUnderline            53
  145. #define cOutline            54
  146. #define cShadow                55
  147. #define cCondensed            56
  148. #define cExtended            57
  149.  
  150. #define cRecord                60
  151. #define cPlay                61
  152. #define cErase                62
  153. #define cSpeak                63
  154. #define cStopSpeaking        64
  155. #define cSelectVoice        65
  156. #define cSelectVoiceSubMenu    66
  157.  
  158. #define cSelectContents        75        
  159.  
  160. // windows, dialogs, alerts, and other items of that sort
  161. #define kDefaultWindowID        128
  162. #define kSaveChangesWindowID    129
  163. #define kFindWindowID            130
  164. #define kReplaceWindowID        131
  165.     #define iFindEdit                4
  166.     #define iCaseSensitive            5
  167.     #define iWrapAround                6
  168.     #define iReplaceEdit            8
  169.     #define iReplaceAll                9
  170.     
  171. // Error STR# base
  172. #define kErrorBaseID            1000
  173.  
  174. // Help for window STR#
  175. #define kWindowHelpID            2000
  176.     #define iDidTheBalloon                -1
  177.     #define iNoBalloon                    0
  178.     
  179.     #define iHelpActiveScroll            1
  180.     #define iHelpDimHorizScroll            2
  181.     #define iHelpDimVertScroll            3
  182.     #define iHelpGrowBox                4
  183.     #define iHelpGenericContent            5
  184.  
  185.     #define iHelpPictContent            6
  186.     #define iHelpPictSelection            7
  187.     #define iHelpTextContent            8
  188.  
  189. // Miscellaneous strings (STR#)
  190. #define kMiscStrings            3000
  191. #define iFirstNewDocumentTitle    1
  192. #define iHelpMenuCommand        2
  193. #define iSelectAllCommand        3
  194. #define iSelectNoneCommand        4
  195.  
  196. // Patterns used for selections
  197. #define kPatternListID        128
  198.  
  199. // for disabling menu items
  200. #define AllItems    0b1111111111111111111111111111111    /* 31 flags */
  201. #define NoItems        0b0000000000000000000000000000000
  202. #define MenuItem1    0b0000000000000000000000000000001
  203. #define MenuItem2    0b0000000000000000000000000000010
  204. #define MenuItem3    0b0000000000000000000000000000100
  205. #define MenuItem4    0b0000000000000000000000000001000
  206. #define MenuItem5    0b0000000000000000000000000010000
  207. #define MenuItem6    0b0000000000000000000000000100000
  208. #define MenuItem7    0b0000000000000000000000001000000
  209. #define MenuItem8    0b0000000000000000000000010000000
  210. #define MenuItem9    0b0000000000000000000000100000000
  211. #define MenuItem10    0b0000000000000000000001000000000
  212. #define MenuItem11    0b0000000000000000000010000000000
  213. #define MenuItem12    0b0000000000000000000100000000000
  214. #define MenuItem13    0b0000000000000000001000000000000
  215. #define MenuItem14    0b0000000000000000010000000000000
  216. #define MenuItem15    0b0000000000000000100000000000000
  217. #define MenuItem16    0b0000000000000001000000000000000
  218. #define MenuItem17    0b0000000000000010000000000000000
  219. #define MenuItem18    0b0000000000000100000000000000000
  220. #define MenuItem19    0b0000000000001000000000000000000
  221.  
  222. // Size resource information
  223. #define kPreferredSize        1024*1024
  224. #define kMinimumSize        512*1024
  225.  
  226. #ifndef REZ
  227.  
  228.     enum {
  229.         // Keyboard virtual keycode constants
  230.         kHome        = 0x73,
  231.         kEnd        = 0x77,
  232.         kPageUp        = 0x74,
  233.         kPageDown    = 0x79,
  234.         kUpArrow    = 0x7E,
  235.         kDownArrow    = 0x7D,
  236.         kLeftArrow    = 0x7B,
  237.         kRightArrow    = 0x7C,
  238.         kF1            = 0x7A,
  239.         kF2            = 0x78,
  240.         kF3            = 0x63,
  241.         kF4            = 0x76,
  242.     
  243.         kFromTopTipOffset = 20,                        // offset from top/left of balloons
  244.         kFromBottomTipOffset = 7,                    // offset from bottom/right of balloons
  245.         
  246.         kRAMNeededForNew = 64*1024,                    // amount of RAM free before we allow New documents
  247.         kGrowScrollAdjust = 13,                        // amount to cull scroll bar to make room for growbox
  248.         
  249.         kMinDocSize        =     128                        // min window size in pixels
  250.         };
  251.  
  252.     enum
  253.         {
  254.         kMaxWaitTime    =    5*60*60                // maximum time to pass to WaitNextEvent()
  255.         };
  256.         
  257.     struct MachineInfoRec
  258.         {
  259.         Boolean            amInBackground;            // are we running in the background or foreground
  260.         Boolean            isQuitting;                // App is quitting, Nav Services dialogs are up for saving
  261.         Boolean            isClosing;                // All windows being closed, Nav dialogs are up for saving
  262.         long            documentCount;            // # of new docs we have made
  263.         short            lastBalloonIndex;        // identifier of last balloon we displayed
  264.  
  265.         Boolean            haveQuickTime;            // do we have QuickTime installed?
  266.         Boolean            haveRecording;            // do we have sound input?
  267.         Boolean            haveTTS;                // do we have text to speech?
  268.         Boolean            haveTSM;                // do we have text services?
  269.         Boolean            haveTSMTE;                // have inline support for TE?
  270.         Boolean            haveDragMgr;            // do we have the Drag Manager?
  271.         Boolean            haveThreeD;                // do we have 3D on this machine?
  272.         Boolean            haveAppleGuide;            // do we have AppleGuide?
  273.         Boolean            haveThreads;            // do we have threads?
  274.         Boolean            haveAppearanceMgr;        // do we have appearance manager?
  275.         Boolean            haveProxyIcons;            // do we have document proxy icons?
  276.         Boolean            haveFloatingWindows;    // do we have floating windows?
  277.         
  278.         Boolean            haveNavigationServices;    // do we have Navigation Services?
  279.         };
  280.     typedef struct MachineInfoRec MachineInfoRec, *MachineInfoPtr;
  281.  
  282.     #ifndef CompilingMain
  283.     extern MachineInfoRec     gMachineInfo;
  284.     extern EventRecord        gEvent;
  285.     extern Str255            gFindString, gReplaceString;
  286.     extern Boolean            gWrapAround, gCaseSensitive;
  287.     #endif
  288.     
  289.     
  290.     struct PreflightRecord
  291.         {
  292.         Boolean        continueWithOpen;    // continue with the opening of the window
  293.         Boolean        needResFork;        // create resfork if none exists
  294.         SignedByte    openKind;            // kind of opening of this file
  295.         short        resourceID;            // resource ID of the 'WIND' resource
  296.         Boolean        wantHScroll;        // want a horizontal scroll bar
  297.         Boolean        wantVScroll;        // want a vertical scroll bar
  298.         Boolean        doZoom;                // want window opened large
  299.         long        storageSize;        // data for the window's refCon
  300.         void *        makeProcPtr;        // pointer to the make proc
  301.         OSType        fileType;            // file type of document
  302.         };
  303.     typedef struct PreflightRecord PreflightRecord, *PreflightPtr;
  304.     
  305.     struct LongRect
  306.         {
  307.         long    top;
  308.         long    left;
  309.         long    bottom;
  310.         long    right;
  311.         };
  312.     typedef struct LongRect LongRect;
  313.  
  314.     typedef OSStatus     (*UpdateWindowProc)            (WindowPtr pWindow, void* refCon);
  315.     typedef OSStatus    (*CommandProc)                (WindowPtr pWindow, void* refCon, short commandID, long menuResult);
  316.     typedef OSStatus     (*PreflightWindowProc)        (PreflightPtr pPreflightData);
  317.     typedef OSStatus     (*MakeWindowProc)            (WindowPtr pWindow, void* refCon);
  318.     typedef OSStatus    (*PreMenuAccessProc)        (WindowPtr pWindow, void* refCon);
  319.     typedef OSStatus     (*AdjustMenusProc)            (WindowPtr pWindow, void* refCon);
  320.     typedef OSStatus     (*CloseWindowProc)            (WindowPtr pWindow, void* refCon);
  321.     typedef OSStatus     (*GetDocumentRectProc)        (WindowPtr pWindow, void* refCon, LongRect * documentRectangle, Boolean forGrow);
  322.     typedef OSStatus     (*ContentClickProc)            (WindowPtr pWindow, void* refCon, EventRecord * event);
  323.     typedef OSStatus     (*ScrollContentProc)        (WindowPtr pWindow, void* refCon, short deltaH, short deltaV);
  324.     typedef OSStatus    (*ActivateEventProc)        (WindowPtr pWindow, void* refCon, Boolean activating);
  325.     typedef OSStatus    (*KeyEventProc)                (WindowPtr pWindow, void* refCon, EventRecord * event, Boolean isMotionKey);
  326.     typedef OSStatus    (*AdjustSizeProc)            (WindowPtr pWindow, void* refCon, Boolean *didResize);
  327.     typedef OSStatus    (*AdjustCursorProc)            (WindowPtr pWindow, void* refCon, Point * localMouse, RgnHandle globalRgn);
  328.     typedef OSStatus    (*PrintPageProc)            (WindowPtr pWindow, void* refCon, Rect* pageRect, long* pageNum);
  329.     typedef OSStatus    (*GetBalloonProc)            (WindowPtr pWindow, void* refCon, Point *localMouse, short * returnedBalloonIndex, Rect *returnedRectangle);
  330.     typedef OSStatus    (*DragTrackingProc)            (WindowPtr pWindow, void *refCon, DragReference theDragRef, short message);
  331.     typedef OSStatus    (*DragReceiveProc)            (WindowPtr pWindow, void *refCon, DragReference theDragRef);
  332.     typedef OSStatus    (*DragAddFlavorsProc)        (WindowPtr pWindow, void *refCon, DragReference theDragRef);
  333.     typedef OSStatus    (*GetCoachRectangleProc)    (WindowPtr pWindow, void* refCon, Rect *pRect, Ptr name);
  334.     typedef OSStatus    (*SaveToProc)                (WindowPtr pWindow, void* refCon, FSSpec *fileSpec, Boolean isStationery );
  335.  
  336.     typedef Boolean        (*FilterEventProc)            (WindowPtr pWindow, void* refCon, EventRecord * event);
  337.     typedef long        (*CalculateIdleTimeProc)    (WindowPtr pWindow, void* refCon);
  338.  
  339.     struct WindowDataRecord
  340.         {
  341.         WindowPtr                theWindow;
  342.         ResType                    windowKind;                // and kind to identify window type
  343.         OSType                    originalFileType;        // original source of file
  344.         AliasHandle                fileAlias;                // alias handle of the file
  345.         FSSpec                    fileSpec;                // file spec of the file
  346.         short                    dataRefNum;                // data fork refNum
  347.         short                    resRefNum;                // res fork refNum
  348.         Boolean                    isWritable;                // can you write to this file?
  349.         Boolean                    bumpUntitledCount;        // does this kind of document use up an "untitled" number?
  350.         Boolean                    openAsNew;                // open as an untitled document?
  351.         Boolean                    changed;                // has content changed?
  352.         Boolean                    documentAcceptsText;    // document allows typing
  353.         Boolean                    dragWindowAligned;        // drag using DragAlignedWindow
  354.         Boolean                    isClosing;                // window is in the process of being closed,
  355.                                                         // waiting on a Nav Services dialog
  356.  
  357.         // Standard procedure entry points, may be NIL to get default behavior
  358.         PreflightWindowProc        pPreflightWindow;
  359.         MakeWindowProc            pMakeWindow;
  360.         CloseWindowProc            pCloseWindow;
  361.         
  362.         GetDocumentRectProc        pGetDocumentRect;
  363.         ScrollContentProc        pScrollContent;
  364.         AdjustSizeProc            pAdjustSize;
  365.         AdjustCursorProc        pAdjustCursor;
  366.         GetBalloonProc            pGetBalloon;
  367.         DragTrackingProc        pDragTracking;
  368.         DragReceiveProc            pDragReceive;
  369.         DragAddFlavorsProc        pDragAddFlavors;
  370.  
  371.         FilterEventProc            pFilterEvent;
  372.         ActivateEventProc        pActivateEvent;
  373.         UpdateWindowProc        pUpdateWindow;
  374.         PreMenuAccessProc        pPreMenuAccess;
  375.         AdjustMenusProc            pAdjustMenus;
  376.         KeyEventProc            pKeyEvent;
  377.         ContentClickProc        pContentClick;
  378.         CommandProc                pCommand;
  379.         PrintPageProc            pPrintPage;
  380.         CalculateIdleTimeProc    pCalculateIdleTime;
  381.         GetCoachRectangleProc    pGetCoachRectangle;
  382.         SaveToProc                pSaveTo;
  383.  
  384.         // controls that the default implementations use
  385.         Handle                    hPageFormat;    // new carbon print record for the page format object (flattened)
  386.         Handle                    hPrintSettings;    // new carbon print record for the print settings object (flattened)
  387.         Boolean                    hasGrow;        // has a grow box?
  388.         Rect                    contentRect;    // content area, minus the scroll bars
  389.         short                    minHSize;        // minimum window X size, 0 default
  390.         short                    minVSize;        // minimum window Y size, 0 default
  391.         ControlHandle            hScroll;        // horizontal scroll bar
  392.         ControlHandle            vScroll;        // vertical scroll bar
  393.         short                    hScrollAmount;    // amount to scroll in left/right arrow
  394.         short                    vScrollAmount;    // amount to scroll in up/down arrow
  395.         short                    hScrollOffset;    // offset of scrollbar from left side of window
  396.         short                    vScrollOffset;    // offset of scrollbar from top of window
  397.         short                    oldVValue;        // previous vertical value
  398.         short                    oldHValue;        // previous horizontal value
  399.         
  400.         // variables having to do with input support
  401.         TSMTERecHandle            docTSMRecHandle;    // TSM info stored here
  402.         TSMDocumentID            docTSMDoc;            // TSM document id
  403.         
  404.         // Info needed for NavServices state.
  405.         NavDialogRef            navDialog;        // The sheet window attached to this document, if any
  406.  
  407.         // Custom data follows here
  408.         };
  409.     typedef struct WindowDataRecord WindowDataRecord, *WindowDataPtr;    
  410.  
  411.     void SetDocumentContentChanged( WindowDataPtr pData, Boolean changed );
  412.  
  413.  
  414.     // Window adjustment routines
  415.     OSStatus AdjustScrollBars(WindowPtr pWindow, Boolean moveControls, Boolean didGrow, Boolean *needInvalidate);
  416.     void SetControlAndClipAmount(ControlHandle control, short * amount);
  417.     OSStatus DoScrollContent(WindowPtr pWindow, WindowDataPtr pData, short deltaH, short deltaV);
  418.  
  419.     // document rectangle utilities
  420.     void LongRectToRect(LongRect* longRect, Rect *rect);
  421.     void RectToLongRect(Rect *rect, LongRect *longRect);
  422.     void MovableModalDialog(ModalFilterProcPtr filterProc, short * pItem);
  423.     void BeginMovableModal(void);
  424.     void EndMovableModal(void);
  425.     void GetPICTRectangleAt72dpi(PicHandle hPicture, Rect *pictureRect);
  426.     
  427.     // menu command utilities
  428.     void EnableCommand(short commandID);
  429.     void EnableCommandCheck(short commandID, Boolean check);
  430.     void EnableCommandCheckStyle(short commandID, Boolean check, short style);
  431.     void ChangeCommandName(short commandID, short resourceID, short resourceIndex);
  432.     Boolean IsCommandEnabled(short commandID);
  433.  
  434.     // printing utility routines
  435.     OSStatus    DoDefault(WindowDataPtr     pData);
  436.     OSStatus    DoPageSetup(WindowPtr pWindow);
  437.  
  438.     // event handling routines
  439.     void HandleEvent(EventRecord *);
  440.     void DragAndDropArea(WindowPtr pWindow, WindowDataPtr pData, EventRecord* event, Rect *pFrameRect);
  441.     short ConductFindOrReplaceDialog(short dialogID);
  442.     Boolean PerformSearch(
  443.             Handle    h,                    // handle to search
  444.             long start,                    // offset to begin with
  445.             Str255 searchString,        // string to search for
  446.             Boolean isCaseSensitive,    // case sensitive search
  447.             Boolean isBackwards,        // search backwards from starting point
  448.             Boolean isWraparound,        // wrap search around from end->begining
  449.             long * pNewStart,            // returned new selection start
  450.             long * pNewEnd);            // returned new selection end
  451.  
  452.     // Drag utils
  453.     Boolean IsOnlyThisFlavor(DragReference theDragRef, FlavorType theType);
  454.     Boolean IsDropInFinderTrash(AEDesc *dropLocation);
  455.     Boolean DragText(WindowPtr pWindow, void *pData, EventRecord *pEvent, RgnHandle hilightRgn);
  456.     OSStatus TextDragTracking(WindowPtr pWindow, void *pData, DragReference theDragRef, short message);
  457.     OSStatus TextDragReceive(WindowPtr pWindow, void *pData, DragReference theDragRef);
  458.     
  459.     // TEClick utilities
  460.     pascal void TextClickLoop(void);
  461.     pascal TEClickLoopUPP GetOldClickLoop(void);
  462.     void AdjustTE(WindowDataPtr pData, Boolean doScroll);
  463.  
  464.     // error utilities
  465.     void ConductErrorDialog(OSStatus error, short commandID, short alertType);
  466.  
  467.     // generic utilities
  468.     OSStatus DoAdjustCursor(WindowPtr pWindow, Point *where);
  469.     void LocalToGlobalRgn(RgnHandle rgn);
  470.     void GlobalToLocalRgn(RgnHandle rgn);
  471.     void SetWatchCursor(void);
  472.     OSStatus SaveCurrentUndoState(WindowDataPtr pData, short newCommandID);
  473.     pascal void MyDrawHook ( unsigned short offset, unsigned short textLen,
  474.             Ptr textPtr, TEPtr tePtr, TEHandle teHdl );
  475.     
  476.     // Preflight routines for the windows we support
  477.     OSStatus AboutPreflightWindow(PreflightPtr pPreflightData);
  478.     OSStatus PICTPreflightWindow(PreflightPtr pPreflightData);
  479.     OSStatus MoviePreflightWindow(PreflightPtr pPreflightData);
  480.     OSStatus ClipboardPreflightWindow(PreflightPtr pPreflightData);
  481.     OSStatus TextPreflightWindow(PreflightPtr pPreflightData);
  482.     OSStatus ThreeDPreflightWindow(PreflightPtr pPreflightData);
  483.     
  484.     // File type routines for the document kinds we support
  485.     void AboutGetFileTypes(OSType * pFileTypes, OSType * pDocumentTypes, short * numTypes);
  486.     void PICTGetFileTypes(OSType * pFileTypes, OSType * pDocumentTypes, short * numTypes);
  487.     void MovieGetFileTypes(OSType * pFileTypes, OSType * pDocumentTypes, short * numTypes);
  488.     void ClipboardGetFileTypes(OSType * pFileTypes, OSType * pDocumentTypes, short * numTypes);
  489.     void TextGetFileTypes(OSType * pFileTypes, OSType * pDocumentTypes, short * numTypes);
  490.     void ThreeDGetFileTypes(OSType * pFileTypes, OSType * pDocumentTypes, short * numTypes);
  491.     
  492.     // selection rectangle utilities
  493.     #define MOVESELECTION(X) (((X) & 0x7) == 0x4)
  494.     void DrawSelection(WindowDataPtr pData, Rect *pSelection, short * pPhase, Boolean bumpPhase);
  495.     OSStatus SelectContents(WindowPtr pWindow, WindowDataPtr pData, EventRecord *pEvent, Rect *pSelection, Rect *pContent, short *pPhase);
  496.     
  497. #endif
  498.  
  499. // defined window kinds and resource ranges for windows we support
  500. #define kAboutWindow        'ABOT'
  501. #define kAboutBaseID        200
  502.  
  503. #define kPICTWindow            'PICT'
  504. #define kPICTBaseID            300
  505.  
  506. #define kMovieWindow        'MooV'
  507. #define kMovieBaseID        400
  508.  
  509. #define kClipboardWindow    'Clip'
  510. #define kClipboardBaseID    500
  511.  
  512. #define kTextWindow            'TEXT'
  513. #define kTextBaseID            600
  514.  
  515. #define kThreeDWindow        '3DMF'
  516. #define kThreeDBaseID        800
  517.  
  518. #endif
  519.