home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / OpenStepConversion / IntermediateFrameworks4 / AppKit.framework / Headers / NSView.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-21  |  8.0 KB  |  272 lines

  1. /*
  2.     View.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import "NSWindow.h"
  8. #import "NSScreen.h"
  9. #import <time.h>
  10.  
  11. /* Autosizing parameters */
  12.  
  13. enum {
  14.     NSViewNotSizable            =  0,
  15.     NSViewMinXMargin            =  1,
  16.     NSViewWidthSizable            =  2,
  17.     NSViewMaxXMargin            =  4,
  18.     NSViewMinYMargin            =  8,
  19.     NSViewHeightSizable            = 16,
  20.     NSViewMaxYMargin            = 32
  21. };
  22.  
  23. typedef enum _NSBorderType {
  24.     NSNoBorder                = 0,
  25.     NSLineBorder            = 1,
  26.     NSBezelBorder            = 2,
  27.     NSGrooveBorder            = 3
  28. } NSBorderType;
  29.  
  30. typedef int NSTrackingRectTag;
  31.  
  32. /* Are we drawing, printing, or copying PostScript to the scrap? */
  33.  
  34. @class NSEvent;
  35.  
  36. @interface NSView : NSResponder
  37. {
  38.     NSRect              frame;
  39.     NSRect              bounds;
  40.     id                  superview;
  41.     id                  subviews;
  42.     id                  window;
  43.     struct __vFlags {
  44. #ifdef __BIG_ENDIAN__
  45.     unsigned int        noClip:1;
  46.     unsigned int        translatedDraw:1;
  47.     unsigned int        drawInSuperview:1;
  48.     unsigned int        alreadyFlipped:1;
  49.     unsigned int        needsFlipped:1;
  50.     unsigned int        rotatedFromBase:1;
  51.     unsigned int        rotatedOrScaledFromBase:1;
  52.     unsigned int        opaque:1;
  53.     unsigned int        disableAutodisplay:1;
  54.     unsigned int        needsDisplay:1;
  55.     unsigned int        validGState:1;
  56.     unsigned int        newGState:1;
  57.     unsigned int        _RESERVED:2;
  58.     unsigned int        _noVerticalAutosizing:1;
  59.     unsigned int        _hasDirtySubview:1;
  60. #else
  61.     unsigned int        _hasDirtySubview:1;
  62.     unsigned int        _noVerticalAutosizing:1;
  63.     unsigned int        _RESERVED:2;
  64.     unsigned int        newGState:1;
  65.     unsigned int        validGState:1;
  66.     unsigned int        needsDisplay:1;
  67.     unsigned int        disableAutodisplay:1;
  68.     unsigned int        opaque:1;
  69.     unsigned int        rotatedOrScaledFromBase:1;
  70.     unsigned int        rotatedFromBase:1;
  71.     unsigned int        needsFlipped:1;
  72.     unsigned int        alreadyFlipped:1;
  73.     unsigned int        drawInSuperview:1;
  74.     unsigned int        translatedDraw:1;
  75.     unsigned int        noClip:1;
  76. #endif
  77.     }                   vFlags;
  78.     struct ___vFlags {
  79. #ifdef __BIG_ENDIAN__
  80.     unsigned int        autosizing:6;
  81.     unsigned int        autoresizeSubviews:1;
  82.     unsigned int        notifyWhenFlipped:1;
  83.     unsigned int        ancestorNotifyWasEnabled:1;
  84.     unsigned int        needsAncestorNotify:1;
  85.     unsigned int        notifyToInitGState:1;
  86.     unsigned int        wantsGState:1;
  87.     unsigned int        noCopyOnScroll:1;
  88.     unsigned int        noDisplayOnScroll:1;
  89.     unsigned int        specialClip:1;
  90.     unsigned int        mark:1;
  91. #else
  92.     unsigned int        mark:1;
  93.     unsigned int        specialClip:1;
  94.     unsigned int        noDisplayOnScroll:1;
  95.     unsigned int        noCopyOnScroll:1;
  96.     unsigned int        wantsGState:1;
  97.     unsigned int        notifyToInitGState:1;
  98.     unsigned int        needsAncestorNotify:1;
  99.     unsigned int        ancestorNotifyWasEnabled:1;
  100.     unsigned int        notifyWhenFlipped:1;
  101.     unsigned int        autoresizeSubviews:1;
  102.     unsigned int        autosizing:6;
  103. #endif
  104.     }                   _vFlags;
  105.     int                 _gState;
  106.     id                  _frameMatrix;
  107.     id                  _drawMatrix;
  108.     NSString *           *_dragTypes;
  109.     void *             _vPrivate;
  110. }
  111.  
  112. - initWithFrame:(NSRect)frameRect;
  113.  
  114. - window;
  115. - superview;
  116. - subviews;
  117. - (BOOL)isDescendantOf:aView;
  118. - ancestorSharedWithView:aView;
  119. - opaqueAncestor;
  120. - addSubview:aView;
  121. - addSubview:aView positioned:(int)place relativeTo:otherView;
  122. - (void)sortSubviewsUsingFunction:(int (*)(id, id, void *))compare context:(void *)context;
  123. - viewWillMoveToWindow:newWindow;
  124. - removeFromSuperview;
  125. - replaceSubview:oldView with:newView;
  126.  
  127. - notifyAncestorWhenFrameChanged:(BOOL)flag;
  128. - setPostsFrameChangedNotifications:(BOOL)flag;
  129. - resizeSubviewsWithOldSize:(NSSize)oldSize;
  130. - resizeWithOldSuperviewSize:(NSSize)oldSize;
  131. - setAutoresizesSubviews:(BOOL)flag;
  132. - setAutoresizingMask:(unsigned int)mask;
  133. - (unsigned int)autoresizingMask;
  134.  
  135. - setFrameOrigin:(NSPoint)newOrigin;
  136. - setFrameSize:(NSSize)newSize;
  137. - setFrame:(NSRect)frameRect;
  138. - (NSRect)frame;
  139. - setFrameRotation:(float)angle;
  140. - (float)frameRotation;
  141.  
  142. - setBoundsOrigin:(NSPoint)_newOrigin;
  143. - setBoundsSize:(NSSize)_newSize;
  144. - setBoundsRotation:(float)angle;
  145. - (float)boundsRotation;
  146. - translateOriginToPoint:(NSPoint)_translation;
  147. - scaleUnitSquareToSize:(NSSize)_newUnitSize;
  148. - rotateByAngle:(float)angle;
  149. - setBounds:(NSRect)aRect;
  150. - (NSRect)bounds;
  151.  
  152. - (BOOL)isFlipped;
  153. - (BOOL)isRotatedFromBase;
  154. - (BOOL)isRotatedOrScaledFromBase;
  155. - (BOOL)isOpaque;
  156.  
  157. - (NSPoint)convertPoint:(NSPoint)aPoint fromView:aView;
  158. - (NSPoint)convertPoint:(NSPoint)aPoint toView:aView;
  159. - (NSSize)convertSize:(NSSize)aSize fromView:aView;
  160. - (NSSize)convertSize:(NSSize)aSize toView:aView;
  161. - convertRect:(NSRect)aRect fromView:aView;
  162. - convertRect:(NSRect)aRect toView:aView;
  163. - centerScanRect:(NSRect)aRect;
  164.  
  165. - (int)gState;
  166. - allocateGState;
  167. - freeGState;
  168. - initGState;
  169. - renewGState;
  170.  
  171. - (BOOL)canDraw;
  172. - setNeedsDisplay:(BOOL)flag;
  173. - (void)setNeedsDisplayInRect:(NSRect)invalidRect;
  174. - (BOOL)needsDisplay;
  175. - (BOOL)lockFocus;
  176. - unlockFocus;
  177. + (NSView *)focusView;
  178. - (NSRect)visibleRect;
  179.  
  180. - display;
  181. - displayIfNeeded;
  182. - (void)displayIfNeededIgnoringOpacity;
  183. - displayRect:(NSRect)rects;
  184. - (void)displayIfNeededInRect:(NSRect)rect;
  185. - (void)displayRectIgnoringOpacity:(NSRect)rect;
  186. - (void)displayIfNeededInRectIgnoringOpacity:(NSRect)rect;
  187. - drawRect:(NSRect)rects;
  188.  
  189. - scrollPoint:(NSPoint)aPoint;
  190. - scrollRectToVisible:(NSRect)aRect;
  191. - autoscroll:(NSEvent *)theEvent;
  192. - adjustScroll:(NSRect)newVisible;
  193. - scrollRect:(NSPoint)aRect by:(NSSize)delta;
  194.  
  195. - hitTest:(NSPoint)aPoint;
  196. - (BOOL)mouse:(NSPoint)aPoint inRect:(NSRect *)aRect;
  197. - findViewWithTag:(int)aTag;
  198. - (int)tag;
  199. - (BOOL)performKeyEquivalent:(NSEvent *)theEvent;
  200. - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent;
  201. - (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent;
  202.  
  203. - addCursorRect:(NSRect)aRect cursor:anObj;
  204. - removeCursorRect:(NSRect)aRect cursor:anObj;
  205. - discardCursorRects;
  206. - resetCursorRects;
  207.  
  208. - (NSTrackingRectTag)addTrackingRect:(NSRect)aRect owner:(id)anObject assumeInside:(BOOL)flag;
  209. - (void)removeTrackingRect:(NSTrackingRectTag)tag;
  210.  
  211. - (BOOL)shouldDrawColor;
  212.  
  213. @end
  214.  
  215. @interface NSView(Printing)
  216.  
  217. - (NSData *)dataWithEPSInsideRect:(NSRect)rect;
  218. - writeEPSInsideRect:(NSRect)copyArea toPasteboard:pasteboard;
  219. - print:sender;
  220. - fax:sender;
  221. - (BOOL)knowsPagesFirst:(int *)firstPageNum last:(int *)lastPageNum;
  222. - openSpoolFile:(char *)filename;
  223. - beginPSOutput;
  224. - beginPrologueBBox:(NSRect)boundingBox creationDate:(NSString *)dateCreated createdBy:(NSString *)anApplication fonts:(NSString *)fontNames forWhom:(NSString *)user pages:(int)numPages title:(NSString *)aTitle;
  225. - endHeaderComments;
  226. - endPrologue;
  227. - beginSetup;
  228. - endSetup;
  229. - beginPage:(int)ordinalNum label:(NSString *)aString bBox:(NSRect)pageRect fonts:(NSString *)fontNames;
  230. - beginPageSetupRect:(NSRect)aRect placement:(NSPoint)location;
  231. - addToPageSetup;
  232. - endPageSetup;
  233. - endPage;
  234. - beginTrailer;
  235. - endTrailer;
  236. - spoolFile:(NSString *)filename;
  237. - (float)heightAdjustLimit;
  238. - (float)widthAdjustLimit;
  239. - adjustPageWidthNew:(float *)newRight left:(float)oldLeft right:(float)oldRight limit:(float)rightLimit;
  240. - adjustPageHeightNew:(float *)newBottom top:(float)oldTop bottom:(float)oldBottom limit:(float)bottomLimit;
  241. - (NSRect)rectForPage;
  242. - placePrintRect:(NSRect)aRect offset:(NSPoint)location;
  243. - drawSheetBorderWithSize:(NSSize)_borderSize;
  244. - drawPageBorderWithSize:(NSSize)_borderSize;
  245.  
  246. @end
  247.  
  248.  
  249. @interface NSView(Drag)
  250. - dragImage:anImage at:(NSPoint)viewLocation offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard source:sourceObj slideBack:(BOOL)slideFlag;
  251.  
  252. - registerForDraggedTypes:(NSArray *)newTypes;
  253. - unregisterDraggedTypes;
  254. @end
  255.  
  256.  
  257. @interface NSView (IconDragging)
  258. - dragFile:(NSString *)filename fromRect:(NSRect)rect slideBack:(BOOL)aFlag event:(NSEvent *)event;
  259. @end
  260.  
  261. #ifndef STRICT_OPENSTEP
  262. @interface NSView(NSRIBPrinting)
  263. - (BOOL)canPrintRIB;
  264. @end
  265. #endif
  266.  
  267. /* Notifications */
  268. extern NSString *NSViewFrameDidChangeNotification;
  269. extern NSString *NSViewFocusDidChangeNotification;
  270. extern NSString *NSViewBoundsDidChangeNotification;
  271.  
  272.