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