home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / OpenStepConversion / IntermediateFrameworks3 / AppKit.framework / Headers / NSView.h < prev    next >
Text File  |  1994-09-29  |  9KB  |  277 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 "screens.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. /* Are we drawing, printing, or copying PostScript to the scrap? */
  31.  
  32. extern short NXDrawingStatus;
  33.  
  34. /* NXDrawingStatus values */
  35.  
  36. #define NX_DRAWING    1    /* we're drawing */
  37. #define NX_PRINTING    2    /* we're printing */
  38. #define NX_COPYING    3    /* we're copying to the scrap */
  39.  
  40. extern BOOL NSScreenDump;    /* Do we draw selection while printing? */
  41.  
  42. @class NSEvent;
  43.  
  44. @interface NSView : NSResponder
  45. {
  46.     NSRect              frame;
  47.     NSRect              bounds;
  48.     id                  superview;
  49.     id                  subviews;
  50.     id                  window;
  51.     struct __vFlags {
  52. #ifdef __BIG_ENDIAN__
  53.     unsigned int        noClip:1;
  54.     unsigned int        translatedDraw:1;
  55.     unsigned int        drawInSuperview:1;
  56.     unsigned int        alreadyFlipped:1;
  57.     unsigned int        needsFlipped:1;
  58.     unsigned int        rotatedFromBase:1;
  59.     unsigned int        rotatedOrScaledFromBase:1;
  60.     unsigned int        opaque:1;
  61.     unsigned int        disableAutodisplay:1;
  62.     unsigned int        needsDisplay:1;
  63.     unsigned int        validGState:1;
  64.     unsigned int        newGState:1;
  65.     unsigned int        _RESERVED:2;
  66.     unsigned int        _noVerticalAutosizing:1;
  67.     unsigned int        _hasDirtySubview:1;
  68. #else
  69.     unsigned int        _hasDirtySubview:1;
  70.     unsigned int        _noVerticalAutosizing:1;
  71.     unsigned int        _RESERVED:2;
  72.     unsigned int        newGState:1;
  73.     unsigned int        validGState:1;
  74.     unsigned int        needsDisplay:1;
  75.     unsigned int        disableAutodisplay:1;
  76.     unsigned int        opaque:1;
  77.     unsigned int        rotatedOrScaledFromBase:1;
  78.     unsigned int        rotatedFromBase:1;
  79.     unsigned int        needsFlipped:1;
  80.     unsigned int        alreadyFlipped:1;
  81.     unsigned int        drawInSuperview:1;
  82.     unsigned int        translatedDraw:1;
  83.     unsigned int        noClip:1;
  84. #endif
  85.     }                   vFlags;
  86.     struct ___vFlags {
  87. #ifdef __BIG_ENDIAN__
  88.     unsigned int        autosizing:6;
  89.     unsigned int        autoresizeSubviews:1;
  90.     unsigned int        notifyWhenFlipped:1;
  91.     unsigned int        ancestorNotifyWasEnabled:1;
  92.     unsigned int        needsAncestorNotify:1;
  93.     unsigned int        notifyToInitGState:1;
  94.     unsigned int        wantsGState:1;
  95.     unsigned int        noCopyOnScroll:1;
  96.     unsigned int        noDisplayOnScroll:1;
  97.     unsigned int        specialClip:1;
  98.     unsigned int        mark:1;
  99. #else
  100.     unsigned int        mark:1;
  101.     unsigned int        specialClip:1;
  102.     unsigned int        noDisplayOnScroll:1;
  103.     unsigned int        noCopyOnScroll:1;
  104.     unsigned int        wantsGState:1;
  105.     unsigned int        notifyToInitGState:1;
  106.     unsigned int        needsAncestorNotify:1;
  107.     unsigned int        ancestorNotifyWasEnabled:1;
  108.     unsigned int        notifyWhenFlipped:1;
  109.     unsigned int        autoresizeSubviews:1;
  110.     unsigned int        autosizing:6;
  111. #endif
  112.     }                   _vFlags;
  113.     int                 _gState;
  114.     id                  _frameMatrix;
  115.     id                  _drawMatrix;
  116.     NSString *           *_dragTypes;
  117.     void *             _vPrivate;
  118. }
  119.  
  120. - initFrame:(NSRect)frameRect;
  121. - window;
  122. - superview;
  123. - subviews;
  124. - (BOOL)isDescendantOf:aView;
  125. - findAncestorSharedWith:aView;
  126. - opaqueAncestor;
  127. - addSubview:aView;
  128. - addSubview:aView :(int)place relativeTo:otherView;
  129. - windowChanged:newWindow;
  130. - removeFromSuperview;
  131. - replaceSubview:oldView with:newView;
  132. - notifyAncestorWhenFrameChanged:(BOOL)flag;
  133. - suspendNotifyAncestorWhenFrameChanged:(BOOL)flag;
  134. - notifyWhenFlipped:(BOOL)flag;
  135. - descendantFrameChanged:sender;
  136. - descendantFlipped:sender;
  137. - resizeSubviews:(NSSize)oldSize;
  138. - superviewSizeChanged:(NSSize)oldSize;
  139. - setAutoresizeSubviews:(BOOL)flag;
  140. - setAutosizing:(unsigned int)mask;
  141. - (unsigned int)autosizing;
  142. - setFrameOrigin:(NSPoint)_newOrigin;
  143. - setFrameSize:(NSSize)_newSize;
  144. - setFrame:(NSRect)frameRect;
  145. - rotateTo:(float)angle;
  146. - moveBy:(float)deltaX :(float)deltaY;
  147. - sizeBy:(float)deltaWidth :(float)deltaHeight;
  148. - rotateBy:(float)deltaAngle;
  149. - (NSRect)frame;
  150. - (float)frameAngle;
  151. - setBoundsOrigin:(NSPoint)_newOrigin;
  152. - setBoundsSize:(NSSize)_newSize;
  153. - setDrawRotation:(float)angle;
  154. - translateOriginToPoint:(NSPoint)_translation;
  155. - scaleUnitSquareToSize:(NSSize)_newUnitSize;
  156. - rotate:(float)angle;
  157. - (NSRect)bounds;
  158. - (float)boundsAngle;
  159. - setFlipped:(BOOL)flag;
  160. - (BOOL)isFlipped;
  161. - (BOOL)isRotatedFromBase;
  162. - (BOOL)isRotatedOrScaledFromBase;
  163. - setOpaque:(BOOL)flag;
  164. - (BOOL)isOpaque;
  165. - (NSPoint)convertPointFromSuperview:(NSPoint)aPoint;
  166. - (NSPoint)convertPointToSuperview:(NSPoint)aPoint;
  167. - convertRectFromSuperview:(NSRect)aRect;
  168. - convertRectToSuperview:(NSRect)aRect;
  169. - (NSPoint)convertPoint:(NSPoint)aPoint fromView:aView;
  170. - (NSPoint)convertPoint:(NSPoint)aPoint toView:aView;
  171. - (NSSize)convertSize:(NSSize)aSize fromView:aView;
  172. - (NSSize)convertSize:(NSSize)aSize toView:aView;
  173. - convertRect:(NSRect)aRect fromView:aView;
  174. - convertRect:(NSRect)aRect toView:aView;
  175. - centerScanRect:(NSRect)aRect;
  176. - (BOOL)canDraw;
  177. - setAutodisplay:(BOOL)flag;
  178. - (BOOL)isAutodisplay;
  179. - setNeedsDisplay:(BOOL)flag;
  180. - (BOOL)needsDisplay;
  181. - update;
  182. - drawInSuperview;
  183. - (int)gState;
  184. - allocateGState;
  185. - freeGState;
  186. - notifyToInitGState:(BOOL)flag;
  187. - initGState;
  188. - renewGState;
  189. - clipToFrame:(NSRect)frameRect;
  190. - (BOOL)lockFocus;
  191. - unlockFocus;
  192. - (BOOL)isFocusView;
  193. - setClipping:(BOOL)flag;
  194. - (BOOL)doesClip;
  195. - (NSRect)visibleRect;
  196. - displayIfNeeded;
  197. - displayRect:(NSRect)rects;
  198. - display;
  199. - drawRect:(NSRect)rects;
  200. - scrollPoint:(NSPoint)aPoint;
  201. - scrollRectToVisible:(NSRect)aRect;
  202. - autoscroll:(NSEvent *)theEvent;
  203. - adjustScroll:(NSRect)newVisible;
  204. - invalidate:(NSRect)rect;
  205. - scrollRect:(NSPoint)aRect by:(NSSize)delta;
  206. - hitTest:(NSPoint)aPoint;
  207. - (BOOL)mouse:(NSPoint)aPoint inRect:(NSRect *)aRect;
  208. - findViewWithTag:(int)aTag;
  209. - (int)tag;
  210. - (BOOL)performKeyEquivalent:(NSEvent *)theEvent;
  211. - (BOOL)acceptsFirstMouse;
  212. - (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent;
  213. - addCursorRect:(NSRect)aRect cursor:anObj;
  214. - removeCursorRect:(NSRect)aRect cursor:anObj;
  215. - discardCursorRects;
  216. - resetCursorRects;
  217. - (BOOL)shouldDrawColor;
  218.  
  219. @end
  220.  
  221. @interface NSView(Printing)
  222.  
  223. - (NSData *)dataWithEPSInsideRect:(NSRect)rect;
  224. - writePSCodeInside:(NSRect)copyArea to:pasteboard;
  225. - printPSCode:sender;
  226. - faxPSCode:sender;
  227. - faxPSCode:sender toList:(const char *const *)names numberList:(const char *const *)numbers sendAt:(time_t)when wantsCover: (BOOL)cFlag wantsNotify: (BOOL)nFlag wantsHires: (BOOL)hFl faxName: (NSString *)aString;
  228. - (BOOL)knowsPagesFirst:(int *)firstPageNum last:(int *)lastPageNum;
  229. - openSpoolFile:(char *)filename;
  230. - beginPSOutput;
  231. - beginPrologueBBox:(NSRect)boundingBox creationDate:(NSString *)dateCreated createdBy:(NSString *)anApplication fonts:(NSString *)fontNames forWhom:(NSString *)user pages:(int)numPages title:(NSString *)aTitle;
  232. - endHeaderComments;
  233. - endPrologue;
  234. - beginSetup;
  235. - endSetup;
  236. - beginPage:(int)ordinalNum label:(NSString *)aString bBox:(NSRect)pageRect fonts:(NSString *)fontNames;
  237. - beginPageSetupRect:(NSRect)aRect placement:(NSPoint)location;
  238. - addToPageSetup;
  239. - endPageSetup;
  240. - endPage;
  241. - beginTrailer;
  242. - endTrailer;
  243. - endPSOutput;
  244. - spoolFile:(NSString *)filename;
  245. - (float)heightAdjustLimit;
  246. - (float)widthAdjustLimit;
  247. - adjustPageWidthNew:(float *)newRight left:(float)oldLeft right:(float)oldRight limit:(float)rightLimit;
  248. - adjustPageHeightNew:(float *)newBottom top:(float)oldTop bottom:(float)oldBottom limit:(float)bottomLimit;
  249. - (NSRect)rectForPage;
  250. - placePrintRect:(NSRect)aRect offset:(NSPoint)location;
  251. - drawSheetBorderWithSize:(NSSize)_borderSize;
  252. - drawPageBorderWithSize:(NSSize)_borderSize;
  253.  
  254. @end
  255.  
  256.  
  257. @interface NSView(Drag)
  258. - dragImage:anImage at:(NSPoint)viewLocation offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard source:sourceObj slideBack:(BOOL)slideFlag;
  259.  
  260. - registerForDraggedTypes:(NSArray *)newTypes;
  261. - unregisterDraggedTypes;
  262. @end
  263.  
  264.  
  265. @interface NSView (IconDragging)
  266. - dragFile:(NSString *)filename fromRect:(NSRect)rect slideBack:(BOOL)aFlag event:(NSEvent *)event;
  267. @end
  268.  
  269. @interface NSView (RIBPrinting)
  270. - (BOOL)canPrintRIB;
  271. @end
  272.  
  273. @interface NSObject(NXPrintingUserInterface)
  274. - (BOOL)shouldRunPrintPanel:aView;
  275. @end
  276.  
  277.