home *** CD-ROM | disk | FTP | other *** search
- /*
- // { WASTE PROJECT: }
- // { Internal interface: constants, types and inline code }
-
- // { Copyright © 1993-1994 Marco Piovanelli }
- // { All Rights Reserved }
- */
-
- #ifndef __LONGCOORDINATES__
- #ifndef _LongCoords_
- #include "LongCoords.h"
- #endif
- #endif
-
- /* useful macros for testing, setting and clearing bits */
-
- #include <TextEdit.h>
- #include <Scrap.h>
- #include <TextServices.h>
- #include <Script.h>
- #include <ToolUtils.h>
- #include <TextUtils.h>
- #include <LowMem.h>
- #include <AERegistry.h>
- #include <Drag.h>
-
- #define BTST( FLAGS, BIT ) (((FLAGS) & (1L << (BIT))) ? 1 : 0)
- #define BSET( FLAGS, BIT ) ((FLAGS) |= (1L << (BIT)))
- #define BCLR( FLAGS, BIT ) ((FLAGS) &= (~(1L << (BIT))))
-
- #define ABS(A) ((A) > 0 ? (A) : -(A))
-
- #define BSL(A, B) (((long)A) << (B))
- #define BSR(A, B) (((long)A) >> (B))
-
- // if WASTE_TABS is defined, Mark Alldritt's tab modifications are included
- // WASTE_TAB_SIZE defines the width in pixels between the tab stops
- #define WASTE_TABS 1
- #define WASTE_TAB_SIZE 30L
-
- // if WEREDRAW_SPEED is defined, Mark Alldritt's optimizations of _WERedraw are used
- #define WEREDRAW_SPEED 1
-
- // if WEPINSCROLL is defined, Chris Thomas's modifications are used to make WEScroll()
- // behave like TEPinScroll()
- #define WEPINSCROLL 1
-
- // Don't let WASTE synchronize keyboard and fonts
- #define WASTENOSYNCH 1
-
- #include "LongCoords.h"
- #include <limits.h>
-
- /* result codes */
- enum{
- weNotAnObjectErr = -9482, // { selection is not an embedded object }
- weUnknownSelectorErr = -9480 // { unknown selector code }
- };
-
- enum {
- weCantUndoErr = -9479 /* can't undo */
- };
-
- enum {
- weUnknownObjectTypeErr = -9478 // { specified object type was not registered }
- };
-
- // { values for WEInstallObjectHandler handlerSelector parameter }
- enum {
- weNewHandler = 'new ',
- weDisposeHandler = 'free',
- weDrawHandler = 'draw',
- weClickHandler = 'clik',
- weCursorHandler = 'curs'
- };
-
- /* action kinds */
-
- enum {
- weAKNone = 0, /* null action */
- weAKUnspecified = 1, /* action of unspecified nature */
- weAKTyping = 2, /* some text has been typed in */
- weAKCut = 3, /* the selection range has been cut */
- weAKPaste = 4, /* something has been pasted */
- weAKClear = 5, /* the selection range has been deleted */
- weAKDrag = 6, /* drag and drop operation */
- weAKSetStyle = 7 /* some style has been applied to a text range */
- };
-
- /* action flags */
-
- enum {
- weAFIsRedo = 0x0001, // action saves edit state prior to a WEUndo call
- weAFDontSaveText = 0x0002, // don't save text
- weAFDontSaveStyles = 0x0004, // don't save styles
- weAFDontSaveSoup = 0x0008
- };
-
- typedef short WEActionKind;
- typedef short WEActionFlags;
-
- /* alignment styles */
-
- enum {
- weFlushLeft = -2, /* flush left */
- weFlushRight = -1, /* flush right */
- weFlushDefault = 0, /* flush according to system direction */
- weCenter = 1, /* centered */
- weJustify = 2 /* fully justified */
- };
-
- // { values for the edge parameter }
-
- enum {
- kLeadingEdge = -1,
- kTrailingEdge = 0
- };
-
- // { control character codes }
-
- enum {
- kObjectMarker = 1,
- kBackspace = 8,
- kEOL = 13,
- kArrowLeft = 28,
- kArrowRight = 29,
- kArrowUp = 30,
- kArrowDown = 31
- };
-
- // { bit equates for QuickDraw styles }
-
- enum {
- tsBold = 0,
- tsItalic = 1,
- tsUnderline = 2,
- tsOutline = 3,
- tsShadow = 4,
- tsCondense = 5,
- tsExtend = 6
- };
-
- // { bit equates for the tsFlags field of the WETextStyle record }
- enum {
- tsTSMHilite = 4, // { set if style run is part of active input area }
- tsTSMSelected = 5, // { set for selected raw/converted text }
- tsTSMConverted = 6, // { set for converted text, clear for raw text }
- tsRightToLeft = 7 // { reserved for future use }
- };
-
- // { bit equates for the mode parameter in WESetStyle and WEContinuousStyle }
- enum {
- kModeFont = 0,
- kModeFace = 1,
- kModeSize = 2,
- kModeColor = 3,
- kModeAddSize = 4,
- kModeToggleFace = 5,
- kModeReplaceFace = 6,
- kModeObject = 14,
- kModeFlags = 15
- };
-
- // { values for the mode parameter in WESetStyle and WEContinuousStyle }
- enum {
- weDoFont = 0x0001,
- weDoFace = 0x0002,
- weDoSize = 0x0004,
- weDoColor = 0x0008,
- weDoAll = weDoFont + weDoFace + weDoSize + weDoColor,
- weDoAddSize = 0x0010,
- weDoToggleFace = 0x0020,
- weDoReplaceFace = 0x0040,
- weDoObject = 0x4000,
- weDoFlags = 0x8000
- };
-
- // { values for WEFeatureFlag action parameter }
- enum {
- weBitClear = 0, // { disables the specified feature }
- weBitSet = 1, // { enables the specified feature }
- weBitTest = -1 // { returns the current setting of the specified feature }
- };
-
- // { bit equates for the flags field in the WE record }
- // { bits 0..15 can be used to turn on and off specific features with WEFeatureFlag }
- // { bits 16..31 are used internally and should not be modified }
-
- // { private flags }
- enum {
- weFHasColorQD = 31, // { Color QuickDraw is available }
- weFHasTextServices = 30, // { Text Services Manager is available }
- weFNonRoman = 29, // { at least one non-Roman script is enabled }
- weFDoubleByte = 28, // { a double-byte script is installed }
- weFCaretVisible = 24, // { the caret is currently visible }
- weFMouseTracking = 23, // { set internally during mouse tracking }
- weFAnchorIsEnd = 22, // { anchor offset is selEnd }
- weFUseNullStyle = 21, // { a null style is associated with the empty selection }
- weFActive = 20, // { we're active }
- weFHilited = 19, // { TRUE if text pane is highlighted (for Drag & Drop) }
- weFCanAcceptDrag = 18, // { The drag in the text pane can be accepted }
- weFDragCaretVisible = 17 // { Drag caret is currently visible }
- };
-
- // { public flags }
- enum {
- weFDrawOffscreen = 11, // { draw text offscreen for smoother visual results }
- weFUseTempMem = 10, // { use temporary memory for main data structures }
- weFInhibitRecal = 9, // { if set, recals and redraws are inhibited }
- weFDragAndDrop = 8, // { Text drag-and-drop }
- weFIntCutAndPaste = 7, // { Intelligent Cut & Paste }
- weFUndoSupport = 6, // { Support Undo/Redo }
- weFOutlineHilite = 2, // { frame selection range when text pane is inactive }
- weFAutoScroll = 0 // { automatically scroll text when cursor is outside pane }
- };
-
- // { masks for setting the feature bits }
- enum {
- weDoAutoScroll = 1 << weFAutoScroll,
- weDoOutlineHilite = 1 << weFOutlineHilite,
- weDoUndoSupport = 1 << weFUndoSupport,
- weDoIntCutAndPaste = 1 << weFIntCutAndPaste,
- weDoDragAndDrop = 1 << weFDragAndDrop,
- weDoInhibitRecal = 1 << weFInhibitRecal,
- weDoUseTempMem = 1 << weFUseTempMem,
- weDoDrawOffscreen = 1 << weFDrawOffscreen
- };
-
- // { scrap types }
- enum {
- kTypeText = 'TEXT',
- kTypeStyles = 'styl',
- kTypePicture = 'PICT',
- kTypeSoup = 'SOUP'
- };
-
- // { selectors for WEGetInfo/WESetInfo }
- enum {
- weClickLoop = 'clik',
- weCurrentDrag = 'drag',
- weLineArray = 'line',
- wePort = 'port',
- weRefCon = 'refc',
- weRunArray = 'runa',
- weScrollProc = 'scrl',
- weStyleTable = 'styl',
- weText = 'text',
- weTSMDocumentID = 'tsmd',
- weTSMPostUpdate = 'post',
- weTSMPreUpdate = 'pre '
- };
-
- // { possible values returned by WEIntelligentPaste }
- enum {
- weDontAddSpaces = 0,
- weAddSpaceOnLeftSide = -1,
- weAddSpaceOnRightSide = 1
- };
-
- // { values for WEAllocate allocFlags parameter }
- enum {
- kAllocClear = 0x0001, // { clear handle after allocation }
- kAllocTemp = 0x0002 // { use temporary memory if available }
- };
-
- // { other miscellaneous constants }
- enum {
- kCaretWidth = 1, // { width of the caret, in pixels }
- kMinFontSize = 1, // { minimum valid font size }
- kMaxFontSize = SHRT_MAX, // { maximum valid font size }
- kInvalidOffset = -1, // { used to flag an invalid or nonexistent offset }
- kNullDrag = 0 // { null or nonexistent drag reference }
- };
-
- // from WEMouse.c
- enum {
- noDragErr = 128,
- kTextMargin = 3, // { width of border area surrounding the text (in pixels) }
- kAutoScrollDelay = 10 // { delay before auto-scroll starts (in ticks) }
- };
-
-
- static long kOneToOneScaling = 0x00010001; // { 1:1 scaling ratio }
-
- // { WETextStyle is just a familiar TextStyle record as defined by TextEdit, where }
- // { tsFace is redefined as SignedByte (rather than Style) so that the filler byte }
- // { becomes "visible" from Pascal and can be used to store internal flags }
-
- #if defined(powerc) || defined (__powerc)
- #pragma options align=mac68k
- #endif
-
- typedef struct WETextStyle {
- short tsFont; /* font family number */
- char tsFace; /* set of QuickDraw styles */
- char tsFlags; /* flags (FOR INTERNAL USE ONLY) */
- short tsSize; /* font size, in integer points */
- RGBColor tsColor; /* absolute red-green-blue color */
- Handle tsObject; // { handle to object descriptor }
- } WETextStyle, *WETextStylePtr, **WETextStyleHandle;
-
- typedef struct WERunAttributes {
- short runHeight; /* style run height (ascent + descent + leading) */
- short runAscent; /* font ascent */
- WETextStyle runStyle; /* text style */
- } WERunAttributes, *WERunAttributesPtr, **WERunAttributesHandle;
-
- typedef struct WERunInfo {
- long runStart; /* byte offset to first character of this style run */
- long runEnd; /* byte offset to first character of next style run */
- WERunAttributes runAttrs; /* run attributes */
- } WERunInfo, *WERunInfoPtr, **WERunInfoHandle;
-
- typedef struct WEStyleScrapElement {
- long scrpStartChar;
- WERunAttributes scrpAttrs;
- } WEStyleScrapElement, *WEStyleScrapElementPtr, **WEStyleScrapElementHandle;
-
- // { another "view" for the familiar TextEdit 'styl' Clipboard type }
- /*
- typedef struct WEStyleScrap {
- short scrpNStyles;
- WEStyleScrapElement scrpStyleTab[1];
- } WEStyleScrap, *WEStyleScrapPtr, **WEStyleScrapHandle;
- */
- // { the purpose of the GrafPort1 declaration is to redefine the txFace field as SignedByte, }
- // { rather than Style ( = set of StyleItem), to avoid using THINK Pascal runtime routines }
- // { for set manipulation }
-
- typedef struct GrafPort1
- {
- short device;
- BitMap portBits;
- Rect portRect;
- RgnHandle visRgn;
- RgnHandle clipRgn;
- Pattern bkPat;
- Pattern fillPat;
- Point pnLoc;
- Point pnSize;
- short pnMode;
- Pattern pnPat;
- short pnVis;
- short txFont;
- char txFace;
- char filler;
- short txMode;
- short txSize;
- Fixed spExtra;
- long fgColor;
- long bkColor;
- short colrBit;
- short patStretch;
- Handle picSave;
- Handle rgnSave;
- Handle polySave;
- QDProcsPtr grafProcs;
- } GrafPort1, *GrafPtr1;
-
- typedef struct QDEnvironment {
- GrafPtr envPort;
- PenState envPen;
- WETextStyle envStyle;
- short envMode;
- } QDEnvironment;
-
- typedef struct RunArrayElement {
- long runStart; // { offset to first character in style run }
- long styleIndex; // { index into style table (high word currently unused) }
- } RunArrayElement, *RunArrayElementPtr, **RunArrayElementHandle;
-
- typedef struct RunArrayPair {
- RunArrayElement first;
- RunArrayElement second;
- } RunArrayPair, *RunArrayPeek;
-
- typedef struct TERunAttributes {
- short runHeight;
- short runAscent;
- TextStyle runTEStyle;
- } TERunAttributes, *TERunAttributesPtr;
-
- typedef struct TEStyleScrapElement {
- long scrpStartChar;
- TERunAttributes scrpTEAttrs;
- } TEStyleScrapElement, *TEStyleScrapElementPtr;
-
- typedef struct TEStyleScrap {
- short scrpNStyles;
- TEStyleScrapElement *scrpStyleTab;
- } TEStyleScrap, *TEStyleScrapPtr, **TEStyleScrapHandle;
-
- typedef struct TEStyleScrapPair {
- TEStyleScrapElement first;
- TEStyleScrapElement second;
- } TEStyleScrapPair, *TEStyleScrapPeek;
-
-
- // const kRunArrayMaxIndex = (maxLong / sizeOf(RunArrayElement)) - 1;
-
- typedef RunArrayElement *RunArrayPtr;
- typedef RunArrayPtr *RunArrayHandle;
-
- typedef struct StyleTableElement {
- long refCount; // { reference count }
- WERunAttributes info; // { style information }
- } StyleTableElement, *StyleTableElementPtr, **StyleTableElementHandle;
-
- // kStyleTableMaxIndex = (maxint div SizeOf(StyleTableElement)) - 1;
-
- typedef StyleTableElement *StyleTablePtr;
- typedef StyleTablePtr *StyleTableHandle;
-
- typedef struct LineRec {
- long lineStart; /* byte offset to first character in line */
- long lineOrigin; /* pixel offset from destRect.top */
- short lineAscent; /* maximum font ascent for this line */
- short lineSlop; /* extra pixels needed to fill up the line */
- Fixed lineJustAmount; /* normalized slop value, used for justification */
- } LineRec, *LinePtr, **LineHandle;
-
-
- typedef struct LinePair {
- LineRec first;
- LineRec second;
- } LinePair, *LinePeek;
-
- // kLineArrayMaxIndex = (maxLongInt div SizeOf(LineRec)) - 1;
-
- typedef LineRec *LineArrayPtr;
- typedef LineArrayPtr *LineArrayHandle;
-
- typedef struct WERec {
- GrafPtr port; /* graphics port text is drawn into */
- Handle hText; /* handle to the text */
- LineArrayHandle hLines; /* handle to the line array */
- StyleTableHandle hStyles; /* handle to the style table */
- RunArrayHandle hRuns; /* handle to the style run array */
- long textLength; /* length of text */
- long nLines; /* number of lines */
- long nStyles; /* number of unique styles in the style table */
- long nRuns; /* number of style runs */
- LongRect viewRect; /* view rectangle, all drawing is clipped to this */
- LongRect destRect; /* destination rectangle */
- long selStart; /* start of selection range */
- long selEnd; /* end of selection range */
- long flags; /* 32 bits of miscellaneous flags */
- long caretTime; /* time of most recent caret drawing, in ticks */
- long clickTime; /* time of most recent click, in ticks */
- long clickLoc; /* byte offset of most recent click */
- long anchorStart; /* start offset of anchor word/line */
- long anchorEnd; /* end offset of anchor word/line */
- ProcPtr clickLoop; /* click loop callback */
- char unused1; /* unused */
- char clickEdge; /* edge of character hit by most recent click */
- char unused2; /* unused */
- char firstByte; /* first byte of a double-byte character */
- GrafPtr offscreenPort; /* offscreen graphics world */
- RgnHandle viewRgn; /* handle to the view region */
- ProcPtr scrollProc; /* scroll callback */
- short clickCount; /* multiple click count */
- char alignment; /* alignment style */
- long refCon; /* reference value for client use */
- TSMDocumentID tsmReference; /* reference value for the text services manager */
- long tsmAreaStart; /* start of active input area (for TSM) */
- long tsmAreaEnd; /* end of active input area */
- ProcPtr tsmPreUpdate; /* TSM pre-update callback */
- ProcPtr tsmPostUpdate; /* TSM post-update callback */
- DragReference currentDrag; /* refereence of drag being tracked by _WEDrag */
- long dragCaretOffset; /* offset to caret displayed during a drag */
- Handle hActionStack; /* action stack for undo */
- WERunAttributes nullStyle; /* style for null selection */
- } WERec, *WEPtr, **WEHandle;
-
-
- typedef struct WEAction {
- WEHandle hOwner; // handle to associated WE instance
- struct WEAction **hNext; // used to keep a linked list of actions
- Handle hText; // handle to saved text
- Handle hStyles; // handle to saved styles
- Handle hSoup; // handle to saved "soup"
- long delRangeStart; // start of range to delete
- long delRangeLength; // length of range to delete
- long insRangeLength; // lenfth of range to insert
- long hiliteStart; // start of range to hilite
- long hiliteEnd; // end of range to hilite
- WEActionKind actionKind; // identifies event that caused this action to be pushed
- WEActionFlags actionFlags; // miscellaneous flags
- } WEAction, *WEActionPtr, **WEActionHandle;
-
- typedef struct WEObjectDesc {
- OSType objectType; // { 4-letter tag identifying object type }
- Handle objectDataHandle; // { handle to object data }
- Point objectSize; // { object height and width, in pixels }
- short objectIndex; // { index into object handler table (USED INTERNALLY) }
- WEHandle objectOwner; // { handle to owner WE instance }
- long objectRefCon; // { free for use by object handlers }
- } WEObjectDesc, *WEObjectDescPtr, **WEObjectDescHandle;
-
- // { a WESoup record describes an object embedded in the text }
- // { the 'SOUP' clipboard type is just a collection of WESoup records }
- // { this clipboard type complements the standard TEXT/styl pair }
-
- typedef struct WESoup {
- long soupOffset; // { insertion offset for this object }
- OSType soupType; // { 4-letter tag identifying object type }
- long soupReserved1; // { reserved for future use; set to zero }
- Size soupDataSize; // { size of object data (following this record) }
- Point soupSize; // { object height and width, in pixels }
- long soupReserved2; // { reserved for future use; set to zero }
- WEObjectDesc soupDesc; // { object descriptor }
- } WESoup, *WESoupPtr, **WESoupHandle;
-
- /* callback prototypes */
-
- typedef pascal Boolean (*WEClickLoopProcPtr)(WEHandle hWE);
- typedef pascal void (*WEScrollProcPtr)(WEHandle hWE);
- typedef pascal void (*WETSMPreUpdateProcPtr)(WEHandle hWE);
- typedef pascal void (*WETSMPostUpdateProcPtr)(WEHandle hWE,
- long fixLength, long inputAreaStart, long inputAreaEnd,
- long pinRangeStart, long pinRangeEnd);
- typedef pascal OSErr (*WENewObjectProcPtr)(WEObjectDescHandle objectRef,
- Point *defaultObjectSize);
- typedef pascal OSErr (*WEDisposeObjectProcPtr)(WEObjectDescHandle objectRef);
- typedef pascal OSErr (*WEDrawObjectProcPtr)(const Rect *destRect,
- WEObjectDescHandle objectRef);
-
- typedef Boolean (*SegmentLoopProcPtr)
- (LinePtr pLine,
- WERunAttributesPtr pAttrs,
- Ptr pSegment,
- long segmentStart,
- long segmentLength,
- JustStyleCode styleRunPosition,
- void *callbackData);
-
- struct SLDrawData {
- WEPtr pWE;
- Rect bounds; /* same rectangle, but in global coords */
- Boolean usingColor; /* true if drawing in color */
- Boolean usingOffscreen; /* true if an offscreen graphics world has been set up */
- Boolean drawingOffscreen; /* true if actually drawing to an offscreen buffer */
- Boolean doErase;
- };
-
- struct SLCalcSlopData {
- WEPtr pWE;
- short lineWidth;
- short totalSlop;
- Fixed totalProportion;
- };
-
- struct SLPixelToCharData {
- WEPtr pWE;
- #ifdef WASTE_TABS
- Fixed hPos;
- #endif
- Fixed pixelWidth;
- long offset;
- char *edge;
- };
-
- struct SLCharToPixelData {
- WEPtr pWE;
- long offset;
- LongPt *thePoint;
- };
-
- typedef struct WEFieldDescriptor {
- short fOffset;
- short fLength;
- } WEFieldDescriptor;
-
- typedef struct WELookupTable {
- OSType selector;
- WEFieldDescriptor desc;
- } WELookupTable;
-
- #if defined(powerc) || defined (__powerc)
- #pragma options align=reset
- #endif
-
-
- // Routines in WEUtilities.c
-
- pascal void _WEForgetHandle(Handle *h);
- pascal Boolean _WESetHandleLock(Handle h, Boolean lock);
- pascal void _WEBlockClr(Ptr block, long blockSize);
- pascal Boolean _WEBlockCmp(Ptr block1, Ptr block2, long blockSize);
- pascal void _WEReorder(long *a, long *b);
- pascal OSErr _WEAllocate(Size blockSize, short allocFlags, Handle *h);
-
- // in WEArrays.c
- pascal OSErr _WEInsertSlot(Handle h, Ptr element, long insertAt, long slotSize);
- pascal OSErr _WERemoveSlot(Handle h, long removeAt, long slotSize);
-
- // in WEInlineInput.c
- pascal OSErr _WEHiliteRangeArray(TextRangeArrayHandle hTray, WEHandle hWE);
- pascal OSErr _WEHandleUpdateActiveInputArea(AppleEvent *ae, AppleEvent *reply,
- long handlerRefCon);
- pascal OSErr _WEHandlePositionToOffset(AppleEvent *ae, AppleEvent *reply,
- long handlerRefCon);
- pascal OSErr _WEHandleOffsetToPosition(AppleEvent *ae, AppleEvent *reply, long handlerRefCon);
- pascal OSErr WEInstallTSMHandlers(void);
-
- // in WELongCoords.c
- pascal long _WEPinInRange(long value, long rangeStart, long rangeEnd);
- pascal void WELongPointToPoint(const LongPt *lp, Point *p);
- pascal void WEPointToLongPoint(Point p, LongPt *lp);
- pascal void WESetLongRect(LongRect *lr, long left, long top, long right, long bottom);
- pascal void WELongRectToRect(const LongRect *lr, Rect *r);
- pascal void WERectToLongRect(const Rect *r, LongRect *lr);
- pascal void WEOffsetLongRect(LongRect *lr, long hOffset, long vOffset);
- pascal Boolean WELongPointInLongRect(const LongPt *lp, const LongRect *lr);
-
- // in WEDrawing.c
- pascal long WEOffsetToLine (long offset, WEHandle hWE);
- pascal long _WEPixelToLine(long vOffset, WEHandle hWE);
- pascal long _WEOffsetToRun (long offset, WEHandle hWE);
- pascal void _WEGetIndStyle(long runIndex, WERunInfo *info, WEHandle hWE);
- pascal void WEGetRunInfo(long offset, WERunInfo *info, WEHandle hWE);
- pascal Boolean _WEIsEmbeddedObject(long offset, WEObjectDescHandle *hObjectDesc, WEHandle hWE);
- pascal void _WEContinuousStyleRange(long rangeStart, long rangeEnd, short *mode,
- WETextStyle *ts, WEHandle hWE);
- pascal void _WESynchNullStyle(WEHandle hWE);
- pascal Boolean WEContinuousStyle (short *mode, TextStyle *ts, WEHandle hWE);
- pascal void _WESegmentLoop(long firstLine, long lastLine, SegmentLoopProcPtr callback, void *callbackData,
- WEHandle hWE);
- pascal void _WEDrawTSMHilite(Rect *segmentRect, short tsFlags);
- pascal void _WEDrawLines (long firstLine, long lastLine, Boolean doErase, WEHandle hWE);
- pascal short _WECalcPenIndent(short slop, short alignment);
- pascal void _WESaveQDEnvironment(GrafPtr port, Boolean saveColor, QDEnvironment *theEnvironment);
- pascal void _WERestoreQDEnvironment(QDEnvironment *theEnvironment);
- pascal void _WEFillFontInfo (GrafPtr port, WERunAttributes *targetStyle);
- pascal void _WECopyStyle (WETextStyle *sourceStyle, WETextStyle *targetStyle, short offStyles,
- short mode);
- pascal Boolean _WEOffsetInRange(long offset, char edge, long rangeStart, long rangeEnd);
-
- /*** in WELineLayout.c ***/
- pascal OSErr _WERegisterWithTSM(WEHandle hWE);
- pascal void WEStopInlineSession(WEHandle hWE);
- pascal OSErr WENew(LongRect *destRect, LongRect *viewRect, short flags, WEHandle *hWE);
- pascal void WEDispose(WEHandle hWE);
- pascal OSErr _WERemoveLine(long lineIndex, WEPtr pWE);
- pascal OSErr InsertLine(long lineIndex, LineRec *theLine, WEPtr pWE);
- pascal void _WEBumpOrigin(long lineIndex, long deltaOrigin, WEPtr pWE);
- pascal long _WEFindLineBreak(long lineStart, WEHandle hWE);
- pascal void _WECalcHeights(long rangeStart, long rangeEnd, short *lineAscent, short *lineDescent,
- WEHandle hWE);
- pascal OSErr _WERecalBreaks(long *startLine, long *endLine, WEHandle hWE);
- pascal void _WERecalSlops(long firstLine, long lastLine, WEHandle hWE);
- pascal OSErr WECalText(WEHandle hWE);
- pascal OSErr WEUseText(Handle text, WEHandle hWE);
- pascal char WEGetAlignment(WEHandle hWE);
- pascal void WEGetSelection(long *selStart, long *selEnd, WEHandle hWE);
- pascal void WESetDestRect(LongRect *destRect, WEHandle hWE);
- pascal void WEGetDestRect(LongRect *destRect, WEHandle hWE);
- pascal void WESetViewRect(LongRect *viewRect, WEHandle hWE);
- pascal void WEGetViewRect(LongRect *viewRect, WEHandle hWE);
- pascal long WEGetTextLength(WEHandle hWE);
- pascal long WECountLines(WEHandle hWE);
- pascal long WEGetHeight(long startLine, long endLine, WEHandle hWE);
- pascal Handle WEGetText(WEHandle hWE);
- pascal char WEGetChar(long offset, WEHandle hWE);
- pascal OSErr WECopyRange(long rangeStart, long rangeEnd, Handle hText, Handle
- hStyles, Handle hSoup, WEHandle hWE);
- pascal OSErr WECopy(WEHandle hWE);
- pascal short WEFeatureFlag(short feature, short action, WEHandle hWE);
-
- // WESelecting.c
- pascal void ClearHiliteBit(void);
- pascal long WEGetOffset(const LongPt *thePoint, char *edge, WEHandle hWE);
- pascal void WEGetPoint(long offset, LongPt *thePoint, short *lineHeight, WEHandle hWE);
- pascal void WEFindLine(long offset, char edge, long *lineStart, long *lineEnd, WEHandle hWE);
- pascal long _WEGetLineStart(long lineNo, WEHandle hWE);
- pascal short _WEGetContext(long offset, long *contextStart, long *contextEnd,
- WEHandle hWE);
- pascal short _WEGetRestrictedContext(long offset, long *contextStart, long *contextEnd,
- WEHandle hWE);
- pascal void WEFindWord(long offset, char edge, long *wordStart, long *wordEnd, WEHandle hWE);
- pascal short WECharByte(long offset, WEHandle hWE);
- pascal short WECharType(long offset, WEHandle hWE);
- pascal void _WEDrawCaret(long offset, WEHandle hWE);
- pascal void _WEBlinkCaret(WEHandle hWE);
- pascal RgnHandle WEGetHiliteRgn(long rangeStart, long rangeEnd, WEHandle hWE);
- pascal void _WEHiliteRange(long rangeStart, long rangeEnd, WEHandle hWE);
- pascal void WESetSelection(long selStart, long selEnd, WEHandle hWE);
- pascal void WESetAlignment(char alignment, WEHandle hWE);
- pascal long _WEArrowOffset(short action, long offset, WEHandle hWE);
- pascal void _WEDoArrowKey (short arrow, short modifiers, WEHandle hWE);
- pascal Boolean WEAdjustCursor(Point mouseLoc, RgnHandle mouseRgn, WEHandle hWE);
- pascal void WEIdle(long *maxSleep, WEHandle hWE);
- pascal void WEUpdate(RgnHandle updateRgn, WEHandle hWE);
- pascal void WEDeactivate(WEHandle hWE);
- pascal void WEActivate(WEHandle hWE);
- pascal Boolean WEIsActive(WEHandle hWE);
- pascal void WEScroll(long hOffset, long vOffset, WEHandle hWE);
- pascal Boolean _WEScrollIntoView (long offset, WEHandle hWE);
- pascal void WESelView(WEHandle hWE);
-
- // WELowLevelEditing.c
- pascal Boolean _WEIsWordRange(long rangeStart, long rangeEnd, WEHandle hWE);
- pascal Boolean _WEIsPunct(long offset, WEHandle hWE);
- pascal void _WEIntelligentCut(long *rangeStart, long *rangeEnd, WEHandle hWE);
- pascal short _WEInte ectDesc);
- pascal OSErr _WEFreeObject(WEObjectDescHandle hObjectDesc);
- pascal OSErr _WEDrawObject(WEObjectDescHandle hObjectDesc);
- pascal OSErr WEInstallObjectHandler(OSType objectType, OSType handlerSelector, ProcPtr handler);
-
-
- /*** in WESelectors.c ***/
- #define weUndefinedSelectorErr -50 /* paramErr */
-
- pascal void _WELookupSelector(WELookupTable *table, OSType selector, WEFieldDescriptor *desc);
- pascal OSErr _WEGetField(WELookupTable *table, OSType selector, long *info, void *structure);
- pascal OSErr _WESetField(WELookupTable *table, OSType selector, long *info, void *structure);
- pascal OSErr WEGetInfo(OSType selector, void *info, WEHandle hWE);
- pascal OSErr WESetInfo(OSType selector, const void *info, WEHandle hWE);
-
-
-