home *** CD-ROM | disk | FTP | other *** search
- /*
- View.h
- Application Kit, Release 2.0
- Copyright (c) 1988, 1989, 1990, NeXT, Inc. All rights reserved.
- */
-
- #import "NSWindow.h"
- #import "NSScreen.h"
- #import <time.h>
-
- /* Autosizing parameters */
-
- enum {
- NSViewNotSizable = 0,
- NSViewMinXMargin = 1,
- NSViewWidthSizable = 2,
- NSViewMaxXMargin = 4,
- NSViewMinYMargin = 8,
- NSViewHeightSizable = 16,
- NSViewMaxYMargin = 32
- };
-
- typedef enum _NSBorderType {
- NSNoBorder = 0,
- NSLineBorder = 1,
- NSBezelBorder = 2,
- NSGrooveBorder = 3
- } NSBorderType;
-
- typedef int NSTrackingRectTag;
-
- /* Are we drawing, printing, or copying PostScript to the scrap? */
-
- @class NSEvent;
-
- @interface NSView : NSResponder
- {
- NSRect frame;
- NSRect bounds;
- id superview;
- id subviews;
- id window;
- struct __vFlags {
- #ifdef __BIG_ENDIAN__
- unsigned int noClip:1;
- unsigned int translatedDraw:1;
- unsigned int drawInSuperview:1;
- unsigned int alreadyFlipped:1;
- unsigned int needsFlipped:1;
- unsigned int rotatedFromBase:1;
- unsigned int rotatedOrScaledFromBase:1;
- unsigned int opaque:1;
- unsigned int disableAutodisplay:1;
- unsigned int needsDisplay:1;
- unsigned int validGState:1;
- unsigned int newGState:1;
- unsigned int _RESERVED:2;
- unsigned int _noVerticalAutosizing:1;
- unsigned int _hasDirtySubview:1;
- #else
- unsigned int _hasDirtySubview:1;
- unsigned int _noVerticalAutosizing:1;
- unsigned int _RESERVED:2;
- unsigned int newGState:1;
- unsigned int validGState:1;
- unsigned int needsDisplay:1;
- unsigned int disableAutodisplay:1;
- unsigned int opaque:1;
- unsigned int rotatedOrScaledFromBase:1;
- unsigned int rotatedFromBase:1;
- unsigned int needsFlipped:1;
- unsigned int alreadyFlipped:1;
- unsigned int drawInSuperview:1;
- unsigned int translatedDraw:1;
- unsigned int noClip:1;
- #endif
- } vFlags;
- struct ___vFlags {
- #ifdef __BIG_ENDIAN__
- unsigned int autosizing:6;
- unsigned int autoresizeSubviews:1;
- unsigned int notifyWhenFlipped:1;
- unsigned int ancestorNotifyWasEnabled:1;
- unsigned int needsAncestorNotify:1;
- unsigned int notifyToInitGState:1;
- unsigned int wantsGState:1;
- unsigned int noCopyOnScroll:1;
- unsigned int noDisplayOnScroll:1;
- unsigned int specialClip:1;
- unsigned int mark:1;
- #else
- unsigned int mark:1;
- unsigned int specialClip:1;
- unsigned int noDisplayOnScroll:1;
- unsigned int noCopyOnScroll:1;
- unsigned int wantsGState:1;
- unsigned int notifyToInitGState:1;
- unsigned int needsAncestorNotify:1;
- unsigned int ancestorNotifyWasEnabled:1;
- unsigned int notifyWhenFlipped:1;
- unsigned int autoresizeSubviews:1;
- unsigned int autosizing:6;
- #endif
- } _vFlags;
- int _gState;
- id _frameMatrix;
- id _drawMatrix;
- NSString * *_dragTypes;
- void * _vPrivate;
- }
-
- - initWithFrame:(NSRect)frameRect;
-
- - window;
- - superview;
- - subviews;
- - (BOOL)isDescendantOf:aView;
- - ancestorSharedWithView:aView;
- - opaqueAncestor;
- - addSubview:aView;
- - addSubview:aView positioned:(int)place relativeTo:otherView;
- - (void)sortSubviewsUsingFunction:(int (*)(id, id, void *))compare context:(void *)context;
- - viewWillMoveToWindow:newWindow;
- - removeFromSuperview;
- - replaceSubview:oldView with:newView;
-
- - notifyAncestorWhenFrameChanged:(BOOL)flag;
- - setPostsFrameChangedNotifications:(BOOL)flag;
- - resizeSubviewsWithOldSize:(NSSize)oldSize;
- - resizeWithOldSuperviewSize:(NSSize)oldSize;
- - setAutoresizesSubviews:(BOOL)flag;
- - setAutoresizingMask:(unsigned int)mask;
- - (unsigned int)autoresizingMask;
-
- - setFrameOrigin:(NSPoint)newOrigin;
- - setFrameSize:(NSSize)newSize;
- - setFrame:(NSRect)frameRect;
- - (NSRect)frame;
- - setFrameRotation:(float)angle;
- - (float)frameRotation;
-
- - setBoundsOrigin:(NSPoint)_newOrigin;
- - setBoundsSize:(NSSize)_newSize;
- - setBoundsRotation:(float)angle;
- - (float)boundsRotation;
- - translateOriginToPoint:(NSPoint)_translation;
- - scaleUnitSquareToSize:(NSSize)_newUnitSize;
- - rotateByAngle:(float)angle;
- - setBounds:(NSRect)aRect;
- - (NSRect)bounds;
-
- - (BOOL)isFlipped;
- - (BOOL)isRotatedFromBase;
- - (BOOL)isRotatedOrScaledFromBase;
- - (BOOL)isOpaque;
-
- - (NSPoint)convertPoint:(NSPoint)aPoint fromView:aView;
- - (NSPoint)convertPoint:(NSPoint)aPoint toView:aView;
- - (NSSize)convertSize:(NSSize)aSize fromView:aView;
- - (NSSize)convertSize:(NSSize)aSize toView:aView;
- - convertRect:(NSRect)aRect fromView:aView;
- - convertRect:(NSRect)aRect toView:aView;
- - centerScanRect:(NSRect)aRect;
-
- - (int)gState;
- - allocateGState;
- - freeGState;
- - initGState;
- - renewGState;
-
- - (BOOL)canDraw;
- - setNeedsDisplay:(BOOL)flag;
- - (void)setNeedsDisplayInRect:(NSRect)invalidRect;
- - (BOOL)needsDisplay;
- - (BOOL)lockFocus;
- - unlockFocus;
- + (NSView *)focusView;
- - (NSRect)visibleRect;
-
- - display;
- - displayIfNeeded;
- - (void)displayIfNeededIgnoringOpacity;
- - displayRect:(NSRect)rects;
- - (void)displayIfNeededInRect:(NSRect)rect;
- - (void)displayRectIgnoringOpacity:(NSRect)rect;
- - (void)displayIfNeededInRectIgnoringOpacity:(NSRect)rect;
- - drawRect:(NSRect)rects;
-
- - scrollPoint:(NSPoint)aPoint;
- - scrollRectToVisible:(NSRect)aRect;
- - autoscroll:(NSEvent *)theEvent;
- - adjustScroll:(NSRect)newVisible;
- - scrollRect:(NSPoint)aRect by:(NSSize)delta;
-
- - hitTest:(NSPoint)aPoint;
- - (BOOL)mouse:(NSPoint)aPoint inRect:(NSRect *)aRect;
- - findViewWithTag:(int)aTag;
- - (int)tag;
- - (BOOL)performKeyEquivalent:(NSEvent *)theEvent;
- - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent;
- - (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent;
-
- - addCursorRect:(NSRect)aRect cursor:anObj;
- - removeCursorRect:(NSRect)aRect cursor:anObj;
- - discardCursorRects;
- - resetCursorRects;
-
- - (NSTrackingRectTag)addTrackingRect:(NSRect)aRect owner:(id)anObject assumeInside:(BOOL)flag;
- - (void)removeTrackingRect:(NSTrackingRectTag)tag;
-
- - (BOOL)shouldDrawColor;
-
- @end
-
- @interface NSView(Printing)
-
- - (NSData *)dataWithEPSInsideRect:(NSRect)rect;
- - writeEPSInsideRect:(NSRect)copyArea toPasteboard:pasteboard;
- - print:sender;
- - fax:sender;
- - (BOOL)knowsPagesFirst:(int *)firstPageNum last:(int *)lastPageNum;
- - openSpoolFile:(char *)filename;
- - beginPSOutput;
- - beginPrologueBBox:(NSRect)boundingBox creationDate:(NSString *)dateCreated createdBy:(NSString *)anApplication fonts:(NSString *)fontNames forWhom:(NSString *)user pages:(int)numPages title:(NSString *)aTitle;
- - endHeaderComments;
- - endPrologue;
- - beginSetup;
- - endSetup;
- - beginPage:(int)ordinalNum label:(NSString *)aString bBox:(NSRect)pageRect fonts:(NSString *)fontNames;
- - beginPageSetupRect:(NSRect)aRect placement:(NSPoint)location;
- - addToPageSetup;
- - endPageSetup;
- - endPage;
- - beginTrailer;
- - endTrailer;
- - spoolFile:(NSString *)filename;
- - (float)heightAdjustLimit;
- - (float)widthAdjustLimit;
- - adjustPageWidthNew:(float *)newRight left:(float)oldLeft right:(float)oldRight limit:(float)rightLimit;
- - adjustPageHeightNew:(float *)newBottom top:(float)oldTop bottom:(float)oldBottom limit:(float)bottomLimit;
- - (NSRect)rectForPage;
- - placePrintRect:(NSRect)aRect offset:(NSPoint)location;
- - drawSheetBorderWithSize:(NSSize)_borderSize;
- - drawPageBorderWithSize:(NSSize)_borderSize;
-
- @end
-
-
- @interface NSView(Drag)
- - dragImage:anImage at:(NSPoint)viewLocation offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard source:sourceObj slideBack:(BOOL)slideFlag;
-
- - registerForDraggedTypes:(NSArray *)newTypes;
- - unregisterDraggedTypes;
- @end
-
-
- @interface NSView (IconDragging)
- - dragFile:(NSString *)filename fromRect:(NSRect)rect slideBack:(BOOL)aFlag event:(NSEvent *)event;
- @end
-
- #ifndef STRICT_OPENSTEP
- @interface NSView(NSRIBPrinting)
- - (BOOL)canPrintRIB;
- @end
- #endif
-
- /* Notifications */
- extern NSString *NSViewFrameDidChangeNotification;
- extern NSString *NSViewFocusDidChangeNotification;
- extern NSString *NSViewBoundsDidChangeNotification;
-
-