Return to Contents
Copyright (c) 1994 by NeXT Computer, Inc. All Rights Reserved.

Types and Constants


Application

id NSApp;

Represents the application's NSApplication object.

typedef struct _NSModalSession *NSModalSession;

This structure stores information used by the system during a modal session.

Predefined return values for runModalFor: and runModalSession:.

enum {

};

NSString *NSModalPanelRunLoopMode; Input-filter modes passed to NSRunLoop.

NSString *NSEventTrackingRunLoopMode;


Box

typedef enum _NSTitlePosition { This type's constants represent the locations where an

NSNoTitle, NSBox's title is placed in relation to the border

NSAboveTop, (setTitlePosition: and titlePosition).

NSAtTop,

NSBelowTop,

NSAboveBottom,

NSAtBottom,

NSBelowBottom

} NSTitlePosition;


Buttons

typedef enum _NSButtonType { The constants of NSButtonType indicate the way

NSMomentaryPushButton, NSButtons and NSButtonCells behave when

NSPushOnPushOffButton, pressed, and how they display their state. They are

NSToggleButton, used in NSButton's setType: method.

NSSwitchButton,

NSRadioButton,

NSMomentaryChangeButton,

NSOnOffButton

} NSButtonType;


Cells and Button Cells

typedef enum _NSCellType { Represent different types of NSCell objects.

NSNullCellType, No display.

NSTextCellType, Displays text.

NSImageCellType Displays an image.

} NSCellType; Returned from type and set via setType:.

typedef enum _NSCellImagePosition { Represent the position of an NSButtonCell relative to its

NSNoImage, title. Returned from imagePosition and set through

NSImageOnly, setImagePosition:.

NSImageLeft,

NSImageRight,

NSImageBelow,

NSImageAbove,

NSImageOverlaps

} NSCellImagePosition;

typedef enum _NSCellAttribute { The constant values of NSCellAttribute represent

NSCellDisabled, parameters that you can set and access through

NSCellState, NSCell's and NSButtonCell's setParameter:to: and

NSPushInCell, getParameter: methods. Only the first five constants

NSCellEditable, are used by NSCell; the others apply to NSButtonCells

NSChangeGrayCell, only.

NSCellHighlighted,

NSCellLightsByContents,

NSCellLightsByGray,

NSChangeBackgroundCell,

NSCellLightsByBackground,

NSCellIsBordered,

NSCellHasOverlappingImage,

NSCellHasImageHorizontal,

NSCellHasImageOnLeftOrBottom,

NSCellChangesContents,

NSCellIsInsetButton

} NSCellAttribute;

enum { Numeric data types that an NSCell can accept. Used as

NSAnyType, the argument for setEntryType:.

NSIntType,

NSPositiveIntType,

NSFloatType,

NSPositiveFloatType,

NSDateType,

NSDoubleType,

NSPositiveDoubleType

};

enum { NSButtonCell uses these values to determine how to

NSNoCellMask, highlight a button cell or show an ON state

NSContentsCellMask, (returned/passed in showsStateBy/setShowsStateBy

NSPushInCellMask, and highlightsBy/setHighlightsBy).

NSChangeGrayCellMask,

NSChangeBackgroundCellMask

};


Color

enum { Tags that identify modes (or views) in the color panel.

NSGrayModeColorPanel,

NSRGBModeColorPanel,

NSCMYKModeColorPanel,

NSHSBModeColorPanel,

NSCustomPaletteModeColorPanel,

NSColorListModeColorPanel,

NSWheelModeColorPanel

};

enum { Bit masks for determining the current mode (or view) of the

NSColorPanelGrayModeMask, color panel.

NSColorPanelRGBModeMask,

NSColorPanelCMYKModeMask,

NSColorPanelHSBModeMask,

NSColorPanelCustomPaletteModeMask,

NSColorPanelColorListModeMask,

NSColorPanelWheelModeMask,

NSColorPanelAllModesMask

};


Data Link

typedef int NSDataLinkNumber; Returned by NSDataLink's linkNumber method as a persistent identifier of a destination link.

NSString *NSDataLinkFileNameExtension; The file name suffix to be used when data links are saved. The default is objlink.

typedef enum _NSDataLinkDisposition { Returned by NSDataLink's disposition method to identify

NSLinkInDestination, a link as a destination link, a source link, or a broken

NSLinkInSource, link.

NSLinkBroken

} NSDataLinkDisposition;

typedef enum _NSDataLinkUpdateMode { Identifies when a link's data is to be updated. Set through

NSUpdateContinuously, the setUpdateMode: method and returned by

NSUpdateWhenSourceSaved, updateMode.

NSUpdateManually,

NSUpdateNever

} NSDataLinkUpdateMode;


Drag Operation

typedef enum _NSDragOperation { The constants of this type identify different kinds of

NSDragOperationNone, dragging operations. NSDragOperationNone implies

NSDragOperationCopy, that the operation is rejected.

NSDragOperationLink, NSDragOperationPrivate means that the system

NSDragOperationGeneric, leaves the cursor alone.

NSDragOperationPrivate,

NSDragOperationAll

} NSDragOperation;


Event Handling

typedef enum _NSEventType { Each constant of NSEventType identifies an event type.

NSLeftMouseDown, (See the NSEvent class description.)

NSLeftMouseUp,

NSRightMouseDown,

NSRightMouseUp,

NSMouseMoved,

NSLeftMouseDragged,

NSRightMouseDragged,

NSMouseEntered,

NSMouseExited,

NSKeyDown,

NSKeyUp,

NSFlagsChanged,

NSPeriodic,

NSCursorUpdate

} NSEventType;

enum { Unicodes that identify function keys on the keyboard,

NSUpArrowFunctionKey = 0xF700, OpenStep reserves the range 0xF700-0xF8FF for

NSDownArrowFunctionKey = 0xF701, this purpose. The availability of some keys is

NSLeftArrowFunctionKey = 0xF702, system-dependent.

NSRightArrowFunctionKey = 0xF703,

NSF1FunctionKey = 0xF704,

NSF2FunctionKey = 0xF705,

NSF3FunctionKey = 0xF706,

NSF4FunctionKey = 0xF707,

NSF5FunctionKey = 0xF708,

NSF6FunctionKey = 0xF709,

NSF7FunctionKey = 0xF70A,

NSF8FunctionKey = 0xF70B,

NSF9FunctionKey = 0xF70C,

NSF10FunctionKey = 0xF70D,

NSF11FunctionKey = 0xF70E,

NSF12FunctionKey = 0xF70F,

NSF13FunctionKey = 0xF710,

NSF14FunctionKey = 0xF711,

NSF15FunctionKey = 0xF712,

NSF16FunctionKey = 0xF713,

NSF17FunctionKey = 0xF714,

NSF18FunctionKey = 0xF715,

NSF19FunctionKey = 0xF716,

NSF20FunctionKey = 0xF717,

NSF21FunctionKey = 0xF718,

NSF22FunctionKey = 0xF719,

NSF23FunctionKey = 0xF71A,

NSF24FunctionKey = 0xF71B,

NSF25FunctionKey = 0xF71C,

NSF26FunctionKey = 0xF71D,

NSF27FunctionKey = 0xF71E,

NSF28FunctionKey = 0xF71F,

NSF29FunctionKey = 0xF720,

NSF30FunctionKey = 0xF721,

NSF31FunctionKey = 0xF722,

NSF32FunctionKey = 0xF723,

NSF33FunctionKey = 0xF724,

NSF34FunctionKey = 0xF725,

NSF35FunctionKey = 0xF726,

NSInsertFunctionKey = 0xF727,

NSDeleteFunctionKey = 0xF728,

NSHomeFunctionKey = 0xF729,

NSBeginFunctionKey = 0xF72A,

NSEndFunctionKey = 0xF72B,

NSPageUpFunctionKey = 0xF72C,

NSPageDownFunctionKey = 0xF72D,

NSPrintScreenFunctionKey = 0xF72E,

NSScrollLockFunctionKey = 0xF72F,

NSPauseFunctionKey = 0xF730,

NSSysReqFunctionKey = 0xF731,

NSBreakFunctionKey = 0xF732,

NSResetFunctionKey = 0xF733,

NSStopFunctionKey = 0xF734,

NSMenuFunctionKey = 0xF735,

NSUserFunctionKey = 0xF736,

NSSystemFunctionKey = 0xF737,

NSPrintFunctionKey = 0xF738,

NSClearLineFunctionKey = 0xF739,

NSClearDisplayFunctionKey = 0xF73A,

NSInsertLineFunctionKey = 0xF73B,

NSDeleteLineFunctionKey = 0xF73C,

NSInsertCharFunctionKey = 0xF73D,

NSDeleteCharFunctionKey = 0xF73E,

NSPrevFunctionKey = 0xF73F,

NSNextFunctionKey = 0xF740,

NSSelectFunctionKey = 0xF741,

NSExecuteFunctionKey = 0xF742,

NSUndoFunctionKey = 0xF743,

NSRedoFunctionKey = 0xF744,

NSFindFunctionKey = 0xF745,

NSHelpFunctionKey = 0xF746,

NSModeSwitchFunctionKey = 0xF747

};

enum { Device-independent bit masks for evaluating event-

NSAlphaShiftKeyMask, modifier flags to determine which modifier key (if any)

NSShiftKeyMask, was pressed.

NSControlKeyMask,

NSAlternateKeyMask,

NSCommandKeyMask,

NSNumericPadKeyMask,

NSHelpKeyMask,

NSFunctionKeyMask

};

enum { Bit masks for determining the type of events.

NSLeftMouseDownMask,

NSLeftMouseUpMask,

NSRightMouseDownMask,

NSRightMouseUpMask,

NSMouseMovedMask,

NSLeftMouseDraggedMask,

NSRightMouseDraggedMask,

NSMouseEnteredMask,

NSMouseExitedMask,

NSKeyDownMask,

NSKeyUpMask,

NSFlagsChangedMask,

NSPeriodicMask,

NSCursorUpdateMask,

NSAnyEventMask

};


Exceptions

Global Exception Strings

The following global strings identify the exceptions returned by various operations in the Application Kit. They are defined in NSErrors.h.

NSString *NSAbortModalException;

NSString *NSAbortPrintingException;

NSString *NSAppKitIgnoredException;

NSString *NSAppKitVirtualMemoryException;

NSString *NSBadBitmapParametersException;

NSString *NSBadComparisonException;

NSString *NSBadRTFColorTableException;

NSString *NSBadRTFDirectiveException;

NSString *NSBadRTFFontTableException;

NSString *NSBadRTFStyleSheetException;

NSString *NSBrowserIllegalDelegateException;

NSString *NSColorListIOException;

NSString *NSColorListNotEditableException;

NSString *NSDraggingException;

NSString *NSFontUnavailableException;

NSString *NSIllegalSelectorException;

NSString *NSImageCacheException;

NSString *NSNibLoadingException;

NSString *NSPPDIncludeNotFoundException;

NSString *NSPPDIncludeStackOverflowException;

NSString *NSPPDIncludeStackUnderflowException;

NSString *NSPPDParseException;

NSString *NSPasteboardCommunicationException;

NSString *NSPrintOperationExistsException; (Defined in NSPrintOperation.h.)

NSString *NSPrintPackageException;

NSString *NSPrintingCommunicationException;

NSString *NSRTFPropertyStackOverflowException;

NSString *NSTIFFException;

NSString *NSTextLineTooLongException;

NSString *NSTextNoSelectionException;

NSString *NSTextReadException;

NSString *NSTextWriteException;

NSString *NSTypedStreamVersionException;

NSString *NSWindowServerCommunicationException;

NSString *NSWordTablesReadException;

NSString *NSWordTablesWriteException;


Fonts

typedef unsigned int NSFontTraitMask; Characterizes one or more of a font's traits. It's used as an argument type for several of the methods in the NSFontManager class. You build a mask by OR'ing together the following enumeration constants.

enum { Values used by NSFontManager to identify font traits.

NSItalicFontMask,

NSBoldFontMask,

NSUnboldFontMask,

NSNonStandardCharacterSetFontMask,

NSNarrowFontMask,

NSExpandedFontMask,

NSCondensedFontMask,

NSSmallCapsFontMask,

NSPosterFontMask,

NSCompressedFontMask,

NSUnitalicFontMask

};

typedef unsigned int NSGlyph; A type for numbers identifying font glyphs. It's used as the argument type for several of the methods in NSFont.

enum { Tags identifying views in the font panel.

NSFPPreviewButton ,

NSFPRevertButton,

NSFPSetButton,

NSFPPreviewField,

NSFPSizeField,

NSFPSizeTitle,

NSFPCurrentField

};

const float *NSFontIdentityMatrix; Identifies a font matrix that's used for fonts displayed in an

NSView object that has an unflipped coordinate system.

NSString *NSAFMAscender; Global keys to access the values available in the AFM

NSString *NSAFMCapHeight; dictionary. You can convert the appropriate

NSString *NSAFMCharacterSet; values (e.g., ascender, cap height) to floating point

NSString *NSAFMDescender; values by using NSString's floatValue method.

NSString *NSAFMEncodingScheme;

NSString *NSAFMFamilyName;

NSString *NSAFMFontName;

NSString *NSAFMFormatVersion;

NSString *NSAFMFullName;

NSString *NSAFMItalicAngle;

NSString *NSAFMMappingScheme;

NSString *NSAFMNotice;

NSString *NSAFMUnderlinePosition;

NSString *NSAFMUnderlineThickness;

NSString *NSAFMVersion;

NSString *NSAFMWeight;

NSString *NSAFMXHeight;


Graphics

typedef int NSWindowDepth This type gives the window-depth limit. Use the NSAvailableWindowDepths() function to get a list of available window depths. Use the functions NSBitsPerSampleFromDepth(), NSBitsPerPixelFromDepth(), NSPlanarFromDepth, and NSColorSpaceFromDepth() to extract information from a window depth. The NSWindowDepth type is also used as an argument type of methods in NSScreen and NSWindow.

typedef enum _NSTIFFCompression { The constants defined in this type represent the various

NSTIFFCompressionNone = 1, TIFF (tag image file format) data compression

NSTIFFCompressionCCITTFAX3 = 3, schemes. They are defined in NSBitMapImageRep and

NSTIFFCompressionCCITTFAX4 = 4, used in several methods of that class as well as in

NSTIFFCompressionLZW = 5, the TIFFRepresentationUsingCompression:factor:

NSTIFFCompressionJPEG = 6, method of NSImage.

NSTIFFCompressionNEXT = 32766,

NSTIFFCompressionPackBits = 32773,

NSTIFFCompressionOldJPEG = 32865

} NSTIFFCompression;

enum { NSImageRepMatchesDevice indicates that the value

NSImageRepMatchesDevice varies according to the output device. It can be

}; passed in (or received back) as the value of NSImageRep's bitsPerSample, pixelsWide, and pixelsHigh.


Colorspace Names

Predefined colorspace names. Used as arguments in NSDrawBitMap() and NSNumberOfColorComponents(); value returned from NSColorSpaceFromDepth().

NSString *NSCalibratedWhiteColorSpace;

NSString *NSCalibratedBlackColorSpace;

NSString *NSCalibratedRGBColorSpace;

NSString *NSDeviceWhiteColorSpace;

NSString *NSDeviceBlackColorSpace;

NSString *NSDeviceRGBColorSpace;

NSString *NSDeviceCMYKColorSpace;

NSString *NSNamedColorSpace;

NSString *NSCustomColorSpace;


Gray Values

Standard gray values for the 2-bit deep grayscale colorspace.

const float NSBlack;

const float NSDarkGray;

const float NSWhite;

const float NSLightGray;


Device Dictionary Keys

Keys to get designated values from device dictionaries.

NSString *NSDeviceResolution;

NSString *NSDeviceColorSpaceName

NSString *NSDeviceBitsPerSample;

NSString *NSDeviceIsScreen;

NSString *NSDeviceIsPrinter;

NSString *NSDeviceSize;


Matrix

typedef enum _NSMatrixMode { The constants in this type represent the modes of operation

NSRadioModeMatrix, of an NSMatrix.

NSHighlightModeMatrix,

NSListModeMatrix,

NSTrackModeMatrix

} NSMatrixMode;


Notifications

Notifications are posted to all interested observers of a specific condition to alert them that the condition has occurred. Global strings contain the actual text of the notification. In the Application Kit, these are defined per class. See the Foundation's NSNotification and NSNotificationCenter for details.

NSString *NSApplicationDidBecomeActiveNotification; NSApplication

NSString *NSApplicationDidFinishLaunchingNotification;

NSString *NSApplicationDidHideNotification;

NSString *NSApplicationDidResignActiveNotification;

NSString *NSApplicationDidUnhideNotification;

NSString *NSApplicationDidUpdateNotification;

NSString *NSApplicationWillBecomeActiveNotification;

NSString *NSApplicationWillFinishLaunchingNotification;

NSString *NSApplicationWillHideNotification;

NSString *NSApplicationWillResignActiveNotification;

NSString *NSApplicationWillUnhideNotification;

NSString *NSApplicationWillUpdateNotification;

NSString *NSColorListChangedNotification; NSColorList

NSString *NSColorPanelColorChangedNotification; NSColorPanel

NSString *NSControlTextDidBeginEditingNotification; NSControl

NSString *NSControlTextDidEndEditingNotification;

NSString *NSControlTextDidChangeNotification;

NSString *NSImageRepRegistryChangedNotification; NSImageRep

NSString *NSSplitViewDidResizeSubviewsNotification; NSSplitView

NSString *NSSplitViewWillResizeSubviewsNotification;

NSString *NSTextDidBeginEditingNotification; NSText

NSString *NSTextDidEndEditingNotification;

NSString *NSTextDidChangeNotification;

NSString *NSViewFrameChangedNotification; NSView

NSString *NSViewFocusChangedNotification;

NSString *NSWindowDidBecomeKeyNotification; NSWindow

NSString *NSWindowDidBecomeMainNotification;

NSString *NSWindowDidChangeScreenNotification;

NSString *NSWindowDidDeminiaturizeNotification;

NSString *NSWindowDidExposeNotification;

NSString *NSWindowDidMiniaturizeNotification;

NSString *NSWindowDidMoveNotification;

NSString *NSWindowDidResignKeyNotification;

NSString *NSWindowDidResignMainNotification;

NSString *NSWindowDidResizeNotification;

NSString *NSWindowDidUpdateNotification;

NSString *NSWindowWillCloseNotification;

NSString *NSWindowWillMiniaturizeNotification;

NSString *NSWindowWillMoveNotification;

NSString *NSWorkspaceDidLaunchApplicationNotification; NSWorkspace

NSString *NSWorkspaceDidMountNotification;

NSString *NSWorkspaceDidPerformFileOperationNotification;

NSString *NSWorkspaceDidTerminateApplicationNotification;

NSString *NSWorkspaceDidUnmountNotification;

NSString *NSWorkspaceWillLaunchApplicationNotification;

NSString *NSWorkspaceWillPowerOffNotification;

NSString *NSWorkspaceWillUnmountNotification;


Panel

enum { Values returned by the standard panel buttons,

NSOKButton = 1, OK and Cancel.

NSCancelButton = 0

};

enum { Values returned by the NSRunAlertPanel() function and

NSAlertDefaultReturn = 1, by runModalSession: when the modal session is run

NSAlertAlternateReturn = 0, with a Panel provided by NSGetAlertPanel().

NSAlertOtherReturn = -1,

NSAlertErrorReturn = -2

};


Page Layout

enum { Tags that identify buttons, fields, and other views of the

NSPLImageButton, Page Layout panel.

NSPLTitleField,

NSPLPaperNameButton,

NSPLUnitsButton,

NSPLWidthForm,

NSPLHeightForm,

NSPLOrientationMatrix,

NSPLCancelButton,

NSPLOKButton

};


Pasteboard

Pasteboard Type Globals

Identifies the standard pasteboard types. These are used in a variety of NSPasteboard methods and functions.

NSString *NSStringPboardType;

NSString *NSColorPboardType;

NSString *NSFileContentsPboardType;

NSString *NSFilenamesPboardType;

NSString *NSFontPboardType;

NSString *NSRulerPboardType;

NSString *NSPostScriptPboardType;

NSString *NSTabularTextPboardType;

NSString *NSRTFPboardType;

NSString *NSTIFFPboardType;

NSString *NSDataLinkPboardType; (Defined in NSDataLink.h.)

NSString *NSGeneralPboardType; (Defined in NSSelection.h.)

Pasteboard Name Globals

Identifies the standard pasteboard names. Used in class method pasteboardWithName: to get a pasteboard by name.

NSString *NSDragPboard;

NSString *NSFindPboard;

NSString *NSFontPboard;

NSString *NSGeneralPboard;

NSString *NSRulerPboard;


Printing

typedef enum _NSPrinterTableStatus { These constants describe the state of a printer-information

NSPrinterTableOK, table stored by an NSPrinter object. It is the argument

NSPrinterTableNotFound, type of the return value of statusForTable:.

NSPrinterTableError

} NSPrinterTableStatus;

typedef enum _NSPrintingOrientation { These constants represent the way a page is oriented for

NSPortraitOrientation, printing.

NSLandscapeOrientation

} NSPrintingOrientation;

typedef enum _NSPrintingPageOrder { These constants describe the order in which pages are

NSDescendingPageOrder, spooled for printing. NSSpecialPageOrder tells the

NSSpecialPageOrder, spooler not to rearrange pages. Set through

NSAscendingPageOrder, NSPrintingOperation's setPageOrder: method and

NSUnknownPageOrder returned by its pageOrder method.

} NSPrintingPageOrder;

typedef enum _NSPrintingPaginationMode { These constants represent the different ways an image is

NSAutoPagination, divided into pages during pagination. Pagination can

NSFitPagination, occur automatically, the image can be forced onto a

NSClipPagination page, or it can be clipped to a page.

} NSPrintingPaginationMode;

enum { Tags that identify text fields, controls, and other views in

NSPPSaveButton, the Print Panel.

NSPPPreviewButton,

NSFaxButton,

NSPPTitleField,

NSPPImageButton,

NSPPNameTitle,

NSPPNameField,

NSPPNoteTitle,

NSPPNoteField,

NSPPStatusTitle,

NSPPStatusField,

NSPPCopiesField,

NSPPPageChoiceMatrix,

NSPPPageRangeFrom,

NSPPPageRangeTo,

NSPPScaleField,

NSPPOptionsButton,

NSPPPaperFeedButton,

NSPPLayoutButton

};

Printing Information Dictionary Keys

The keys in the mutable dictionary associated with NSPrintingInfo. See NSPrintingInfo.h for types and descriptions of values.

NSString *NSPrintAllPages;

NSString *NSPrintBottomMargin;

NSString *NSPrintCopies;

NSString *NSPrintFaxCoverSheetName;

NSString *NSPrintFaxHighResolution;

NSString *NSPrintFaxModem;

NSString *NSPrintFaxReceiverNames;

NSString *NSPrintFaxReceiverNumbers;

NSString *NSPrintFaxReturnReceipt;

NSString *NSPrintFaxSendTime;

NSString *NSPrintFaxTrimPageEnds;

NSString *NSPrintFaxUseCoverSheet;

NSString *NSPrintFirstPage;

NSString *NSPrintHorizonalPagination;

NSString *NSPrintHorizontallyCentered;

NSString *NSPrintJobDisposition;

NSString *NSPrintJobFeatures;

NSString *NSPrintLastPage;

NSString *NSPrintLeftMargin;

NSString *NSPrintManualFeed;

NSString *NSPrintOrientation;

NSString *NSPrintPackageException;

NSString *NSPrintPagesPerSheet;

NSString *NSPrintPaperFeed;

NSString *NSPrintPaperName;

NSString *NSPrintPaperSize;

NSString *NSPrintPrinter;

NSString *NSPrintReversePageOrder;

NSString *NSPrintRightMargin;

NSString *NSPrintSavePath;

NSString *NSPrintScalingFactor;

NSString *NSPrintTopMargin;

NSString *NSPrintVerticalPagination;

NSString *NSPrintVerticallyCentered;

Print Job Disposition Values

These global constants define the disposition of a print job. See NSPrintInfo's setJobDisposition: and jobDisposition.

NSString *NSPrintCancelJob;

NSString *NSPrintFaxJob;

NSString *NSPrintPreviewJob;

NSString *NSPrintSaveJob;

NSString *NSPrintSpoolJob;


Save Panel

enum { Tags that identify buttons, fields, and other views in the

NSFileHandlingPanelImageButton, Save Panel.

NSFileHandlingPanelTitleField,

NSFileHandlingPanelBrowser,

NSFileHandlingPanelCancelButton,

NSFileHandlingPanelOKButton,

NSFileHandlingPanelForm,

NSFileHandlingPanelHomeButton,

NSFileHandlingPanelDiskButton,

NSFileHandlingPanelDiskEjectButton

};


Scroller

typedef enum _NSScrollArrowPosition { NSScroller uses these constants in its setArrowPosition:

NSScrollerArrowsMaxEnd, method to set the position of the arrows within the

NSScrollerArrowsMinEnd, scroller.

NSScrollerArrowsNone

} NSScrollArrowPosition;

typedef enum _NSScrollerPart { NSScroller uses these constants in its hitPart method to

NSScrollerNoPart, identify the part of the scroller specified in a mouse

NSScrollerDecrementPage, event.

NSScrollerKnob,

NSScrollerIncrementPage,

NSScrollerDecrementLine,

NSScrollerIncrementLine,

NSScrollerKnobSlot

} NSScrollerPart;

typedef enum _NSScrollerUsablePart { These constants define the usable parts of an NSScroller

NSNoScrollerParts, object.

NSOnlyScrollerArrows,

NSAllScrollerParts

} NSUsableScrollerParts;

typedef enum _NSScrollerArrow { These constants indicate the two types of scroller arrow.

NSScrollerIncrementArrow, NSScroller's drawArrow:highlight: method takes an

NSScrollerDecrementArrow NSScrollerArrow as the first argument.

} NSScrollerArrow;

const float NSScrollerWidth; Identifies the default width of a vertical NSScroller object and the default height of a horizontal NSScroller object.


Text

typedef struct _NSBreakArray { Holds line-break information for an NSText object. It's

NSTextChunk chunk; mainly an array of line descriptors.

NSLineDesc breaks[1];

} NSBreakArray;

typedef struct _NSCharArray { Holds the character array for the current line in the NSText

NSTextChunk chunk; object.

unsigned char text[1];

} NSCharArray;

typedef unsigned short (*NSCharFilterFunc) ( The character filter function analyzes each character the

unsigned short charCode, user enters in the NSText object.

int flags,

NSStringEncoding theEncoding);

typedef struct _NSFSM { A word definition finite-state machine structure used by an

const struct _NSFSM *next; NSText object.

short delta;

short token;

} NSFSM;

typedef struct _NSHeightChange { Associates line descriptors and line-height information in

NSLineDesc lineDesc; an NSText object.

NSHeightInfo heightInfo;

} NSHeightChange;

typedef struct _NSHeightInfo { Stores height information for each line of text in an NSText

float newHeight; object.

float oldHeight;

NSLineDesc lineDesc;

} NSHeightInfo;

typedef struct _NSLay { Represents a single sequence of text in a line and records

float x; everything needed to select or draw that piece.

float y;

short offset;

short chars;

id font;

void *paraStyle;

NSRun *run;

NSLayFlags lFlags;

} NSLay;

typedef struct _NSLayArray { Holds the layout for the current line. Since the structure's

NSTextChunk chunk; first field is an NSTextChunk structure, NSLayArrays

NSLay lays[1]; can be manipulated by the functions that manage

} NSLayArray; variable-sized arrays of records.

typedef struct { Records whether a text lay in an NSText object needs

unsigned int mustMove:1; special treatment (e.g., because of non-printing

unsigned int isMoveChar:1; characters).

unsigned int RESERVED:14;

} NSLayFlags;

typedef struct _NSLayInfo { NSText's scanning and drawing functions use this

NSRect rect; structure to communicate information about lines of

float descent; text.

float width;

float left;

float right;

float rightIndent;

NSLayArray *lays;

NSWidthArray *widths;

NSCharArray *chars;

NSTextCache cache;

NSRect *textClipRect;

struct _lFlags {

unsigned int horizCanGrow:1;

unsigned int vertCanGrow:1;

unsigned int erase:1;

unsigned int ping:1;

unsigned int endsParagraph:1;

unsigned int resetCache:1;

unsigned int RESERVED:10;

} lFlags;

} NSLayInfo;

typedef short NSLineDesc; Used to identify lines of text in the NSText object.

typedef enum _NSParagraphProperty { The constants of this type identify specific

NSLeftAlignedParagraph, paragraph properties for selected text.

NSRightAlignedParagraph, NSText's setSelProp: method takes this

NSCenterAlignedParagraph, argument type.

NSJustificationAlignedParagraph,

NSFirstIndentParagraph,

NSIndentParagraph,

NSAddTabParagraph,

NSRemoveTabParagraph,

NSLeftMarginParagraph,

NSRightMarginParagraph

} NSParagraphProperty;

typedef struct _NSRun { In an NSText object, this structure represents a single

id font; sequence of text with a given format.

int chars;

void *paraStyle;

int textRGBColor;

unsigned char superscript;

unsigned char subscript;

id info;

NSRunFlags rFlags;

} NSRun;

typedef struct _NSRunArray { This structure holds the array of text runs in an NSText

NSTextChunk chunk; object. Since the first field is an NSTextChunk structure

NSRun runs[1]; you can manipulate the items in the array with the

} NSRunArray; functions that manage variable-sized arrays of records.

typedef struct { The fields of this structure record whether a run in an

unsigned int underline:1; NSText object contains graphics, is underlined, or

unsigned int dummy:1; if an alternate character forced the use of a symbol.

unsigned int subclassWantsRTF:1;

unsigned int graphic:1;

unsigned int forcedSymbol:1;

unsigned int RESERVED:11;

} NSRunFlags;

typedef struct _NSSelPt { Represents one end of a selection in an NSText object.

int cp; Character position.

int line; Offset of LineDesc in break table.

float x; x coordinate.

float y; y coordinate.

int c1st; Character position of first character in the line.

float ht; Line height.

} NSSelPt;

typedef struct _NSTabStop { This structure describes an NSText object's tab stops.

short kind;

float x;

} NSTabStop;

typedef struct _NSTextBlock { A structure holds text characters in blocks no bigger than

struct _NSTextBlock *next; NSTextBlockSize (see below). A linked list of these

struct _NSTextBlock *prior; text blocks comprises the text for an NSText

struct _tbFlags { object.

unsigned int malloced:1;

unsigned int PAD:15;

} tbFlags;

short chars;

unsigned char *text;

} NSTextBlock;

typedef struct _NSTextCache { This structure describes the current text block and run, and

int curPos; the cursor position in the text.

NSRun *curRun;

int runFirstPos;

NSTextBlock *curBlock;

int blockFirstPos;

} NSTextCache;

typedef struct _NSTextChunk { NSText uses this structure to implement variable-sized

short growby; arrays of records.

int allocated;

int used;

} NSTextChunk;

typedef char *(*NSTextFilterFunc) ( A text filter function implements autoindenting and other

id self, features in an NSText object.

unsigned char * insertText,

int *insertLength,

int position);

typedef int (*NSTextFunc) ( This is the type for an NSText object's scanning and

id self, drawing function, as set through the setScanFunc:

NSLayInfo *layInfo); and setDrawFunc: methods.

typedef enum _NSTextAlignment { The constants of this type determine text alignment. Used

NSLeftTextAlignment, by methods of NSCell, NSControl, NSForm,

NSRightTextAlignment, NSFormCell, and NSText. NSNaturalTextAlignment

NSCenterTextAlignment, indicates the default alignment for the text.

NSJustifiedTextAlignment,

NSNaturalTextAlignment

} NSTextAlignment;

typedef struct _NSTextStyle { NSText uses this structure to describe text layout and tab

float indent1st; stops.

float indent2nd;

float lineHt;

float descentLine;

NSTextAlignment alignment;

short numTabs;

NSTabStop *tabs;

} NSTextStyle;

typedef struct _NSWidthArray { Holds the character widths for the current line.

NSTextChunk chunk; Since the first field is an NSTextChunk structure

float widths[1]; you can manipulate the items in the array with the

} NSWidthArray; functions that manage variable-sized arrays of records.

enum { This constant is used by the NSText

NSLeftTab object's tab functions.

};

enum { These character-code constants are used by the NSText

NSBackspaceKey = 8, object's character filter function.

NSCarriageReturnKey = 13,

NSDeleteKey= 0x7f,

NSBacktabKey = 25

};

enum {

NSIllegalTextMovement = 0, Movement codes describing types of movement between text

NSReturnTextMovement = 0x10, fields. Passed in toNSText delegates as the last argument

NSTabTextMovement = 0x11, of textDidEnd:endChar:.

NSBacktabTextMovement = 0x12,

NSLeftTextMovement = 0x13,

NSRightTextMovement = 0x14,

NSUpTextMovement = 0x15,

NSDownTextMovement = 0x16

};

enum { The size, in bytes, of a text block.

NSTextBlockSize = 512

};


Break Tables

These tables (with their associated sizes) are finite-state machines that determine word wrapping in an NSText object.

const NSFSM *NSCBreakTable;

int NSCBreakTableSize;

const NSFSM *NSEnglishBreakTable;

int NSEnglishBreakTableSize;

const NSFSM *NSEnglishNoBreakTable;

int NSEnglishNoBreakTableSize;


Character Category Tables

These tables define the character classes used in an NSText object's break and click tables.

const unsigned char *NSCCharCatTable;

const unsigned char *NSEnglishCharCatTable;


Click Tables

NSText objects use these tables as finite-state machines that determine which characters are selected when the user double-clicks.

const NSFSM *NSCClickTable;

int NSCClickTableSize;

const NSFSM *NSEnglishClickTable;

int NSEnglishClickTableSize;


Smart Cut and Paste Tables

These tables are suitable as arguments for the NSText methods setPreSelSmartable: and setPostSelSmartTable:. When users paste text into an NSText object, if the character to the left (right) side of the new word is not in the left (right) table, an extra space is added to that side.

const unsigned char *NSCSmartLeftChars;

const unsigned char *NSCSmartRightChars;

const unsigned char *NSEnglishSmartLeftChars;

const unsigned char *NSEnglishSmartRightChars;


NSCStringText Internal State Structure

This is the structure returned by the cStringTextInternalState method of NSCStringText, for use only by applications that need to access the internal state of an NSCStringText object.

typedef struct _NSCStringTextInternalState {

const NSFSM *breakTable; Pointer to state table that specifies word and line breaks

const NSFSM *clickTable; Pointer to state table that defines word boundaries for double-click selection

const unsigned char *preSelSmartTable; Pointer to table that specifies which characters on the left end of a selection are treated as equivalent to a space

const unsigned char *postSelSmartTable; Pointer to table that specifies which characters on the right end of a selection are treated as equivalent to a space

const unsigned char *charCategoryTable; Pointer to table that maps ASCII characters to character classes.

char delegateMethods; Record of notification methods the delegate implements

NSCharFilterFunc charFilterFunc; Function to check each character as it's typed into the text

NSTextFilterFunc textFilterFunc; Function to check text that's being added to the NSCStringText object

NSString *_string; Reserved for internal use

NSTextFunc scanFunc; Function that calculates the line of text

NSTextFunc drawFunc; Function that draws the line of text

id delegate; Object that's notified when the NSCStringText object is modified

int tag; Integer the delegate uses to identify the NSCStringText object

void *cursorTE; Timed entry number for the vertical bar that marks the insertion point

NSTextBlock *firstTextBlock; Pointer to first record in a linked list of text blocks

NSTextBlock *lastTextBlock; Pointer to last record in a linked list of text blocks

NSRunArray *theRuns; Pointer to array of format runs. By default, theRuns points to a single run of the default font

NSRun typingRun; Format run to use for the next characters entered

NSBreakArray *theBreaks; Pointer to the array of line breaks

int growLine; Line containing the end of the growing selection

int textLength; Number of characters in the NSCStringText object

float maxY; Bottom of the last line of text, relative to the origin of bodyRect

float maxX; Widest line of text. Only accurate after calcLine method is invoked

NSRect bodyRect; Rectangle in which the NSCStringText object draws

float borderWidth; Reserved for internal use

char clickCount; Number of clicks that created the selection

NSSelPt sp0; Starting position of the selection

NSSelPt spN; Ending position of the selection

NSSelPt anchorL; Left anchor position

NSSelPt anchorR; Right anchor position

NSSize maxSize; Maximum size of the frame rectangle

NSSize minSize; Minimum size of the frame rectangle

struct _tFlags {

#ifdef __BIG_ENDIAN__

unsigned int _editMode:2; Reserved for internal use

unsigned int _selectMode:2; Reserved for internal use

unsigned int _caretState:2; Reserved for internal use

unsigned int changeState:1; True if any changes have been made to the text since the NSCStringText object became first responder

unsigned int charWrap:1; True if the NSCStringText object wraps words whose length exceeds the line length on a character basis. False if such words are truncated at end of line

unsigned int haveDown:1; True if the left mouse button (or any button if button functions are not differentiated) is down

unsigned int anchorIs0:1; True if the anchor's position is at sp0

unsigned int horizResizable:1; True if the NSCStringText object's width can grow or shrink

unsigned int vertResizable:1; True if the NSCStringText object's height can grow or shrink

unsigned int overstrikeDiacriticals:1; Reserved for internal use

unsigned int monoFont:1; True if the NSCStringText object uses one font for all its text

unsigned int disableFontPanel:1; True if the NSCStringText object doesn't update the font panel automatically

unsigned int inClipView:1; True if the NSCStringText object is a subview of an NSClipView

#else

unsigned int inClipView:1;

unsigned int disableFontPanel:1;

unsigned int monoFont:1;

unsigned int overstrikeDiacriticals:1;

unsigned int vertResizable:1;

unsigned int horizResizable:1;

unsigned int anchorIs0:1;

unsigned int haveDown:1;

unsigned int charWrap:1;

unsigned int changeState:1;

unsigned int _caretState:2;

unsigned int _selectMode:2;

unsigned int _editMode:2;

#endif

} tFlags;

void *_info; Reserved for internal use

void *_textStr; Reserved for internal use

} NSCStringTextInternalState;


View

typedef int NSTrackingRectTag; A unique identifier of a tracking rectangle assigned by NSView. (See addTrackingRectangle:owner: assumeInside:.)

typedef enum _NSBorderType { Constants representing the four types of borders that can

NSNoBorder, appear around NSView objects.

NSLineBorder,

NSBezelBorder,

NSGrooveBorder

} NSBorderType;

enum { NSView uses these autoresize constants to describe

NSViewNotSizable, the parts of a view (or its margins) that are resized

NSViewMinXMargin, when the view's superview is resized.

NSViewWidthSizable,

NSViewMaxXMargin,

NSViewMinYMargin,

NSViewHeightSizable,

NSViewMaxYMargin

};


Window

enum { These constants list the window-device tiers that the

NSNormalWindowLevel = 0, Application Kit uses. Windows are ordered (or

NSFloatingWindowLevel = 3, layered) within tiers: The uppermost window in one

NSDockWindowLevel = 5, tier can still be obscured by the lowest window in

NSSubmenuWindowLevel = 10, the next higher tier.

NSMainMenuWindowLevel = 20

};

enum { Bitmap masks to determine certain window styles.

NSBorderlessWindowMask,

NSTitledWindowMask,

NSClosableWindowMask,

NSMiniaturizableWindowMask,

NSResizableWindowMask

};


Size Globals

These global constants give the dimensions of an icon and contained.

NSSize NSIconSize;

NSSize NSTokenSize:


Workspace

Workspace File Type Globals

Identifies the type of file queried by the method getInfoForFile:application:type: (passed back by reference in last argument).

NSString *NSPlainFileType;

NSString *NSDirectoryFileType;

NSString *NSApplicationFileType;

NSString *NSFilesystemFileType;

NSString *NSShellCommandFileType;

Workspace File Operation Globals

Used as file-operation arguments in the performFileOperation:source:destination:files:options: method (first argument).

NSString *NSWorkspaceCompressOperation;

NSString *NSWorkspaceCopyOperation;

NSString *NSWorkspaceDecompressOperation;

NSString *NSWorkspaceDecryptOperation;

NSString *NSWorkspaceDestroyOperation;

NSString *NSWorkspaceDuplicateOperation;

NSString *NSWorkspaceEncryptOperation;

NSString *NSWorkspaceLinkOperation;

NSString *NSWorkspaceMoveOperation;

NSString *NSWorkspaceRecycleOperation;