home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / appkit / View.h < prev    next >
Text File  |  1992-03-06  |  8KB  |  258 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 "Window.h"
  8. #import "screens.h"
  9. #import <time.h>
  10.  
  11. /* Autosizing paramUEhs */
  12.  
  13. #define    NX_NOTSIZABLE        (0)
  14. #define    NX_MINXMARGINSIZABLE    (1)
  15. #define    NX_WIDTHSIZABLE        (2)
  16. #define    NX_MAXXMARGINSIZABLE    (4)
  17. #define    NX_MINYMARGINSIZABLE    (8)
  18. #define    NX_HEIGHTSIZABLE    (16)
  19. #define    NX_MAXYMARGINSIZABLE    (32)
  20.  
  21. /* Are we drawing, printing, or copying PostScript to the scrap? */
  22.  
  23. extern short NXDrawingStatus;
  24.  
  25. /* NXDrawingStatus values */
  26.  
  27. #define NX_DRAWING    1    /* we're drawing */
  28. #define NX_PRINTING    2    /* we're printing */
  29. #define NX_COPYING    3    /* we're copying to the scrap */
  30.  
  31. extern BOOL NXScreenDump;    /* Do we draw selection while printing? */
  32.  
  33. @interface View : Responder
  34. {
  35.     NXRect              frame;
  36.     NXRect              bounds;
  37.     id                  superview;
  38.     id                  subviews;
  39.     id                  window;
  40.     struct __vFlags {
  41.     unsigned int        noClip:1;
  42.     unsigned int        translatedDraw:1;
  43.     unsigned int        drawInSuperview:1;
  44.     unsigned int        alreadyFlipped:1;
  45.     unsigned int        needsFlipped:1;
  46.     unsigned int        rotatedFromBase:1;
  47.     unsigned int        rotatedOrScaledFromBase:1;
  48.     unsigned int        opaque:1;
  49.     unsigned int        disableAutodisplay:1;
  50.     unsigned int        needsDisplay:1;
  51.     unsigned int        validGState:1;
  52.     unsigned int        newGState:1;
  53.     unsigned int        _RESERVED:2;
  54.     unsigned int        _noVerticalAutosizing:1;
  55.     unsigned int        _hasDirtySubview:1;
  56.     }                   vFlags;
  57.     struct ___vFlags {
  58.     unsigned int        autosizing:6;
  59.     unsigned int        autoresizeSubviews:1;
  60.     unsigned int        notifyWhenFlipped:1;
  61.     unsigned int        ancestorNotifyWasEnabled:1;
  62.     unsigned int        needsAncestorNotify:1;
  63.     unsigned int        notifyToInitGState:1;
  64.     unsigned int        wantsGState:1;
  65.     unsigned int        noCopyOnScroll:1;
  66.     unsigned int        noDisplayOnScroll:1;
  67.     unsigned int        specialClip:1;
  68.     unsigned int        mark:1;
  69.     }                   _vFlags;
  70.     int                 _gState;
  71.     id                  _frameMatrix;
  72.     id                  _drawMatrix;
  73.     NXAtom           *_dragTypes;
  74.     void *             _vPrivate;
  75. }
  76.  
  77. - init;
  78. - initFrame:(const NXRect *)frameRect;
  79. - awake;
  80. - free;
  81. - window;
  82. - superview;
  83. - subviews;
  84. - (BOOL)isDescendantOf:aView;
  85. - findAncestorSharedWith:aView;
  86. - opaqueAncestor;
  87. - addSubview:aView;
  88. - addSubview:aView :(int)place relativeTo:otherView;
  89. - windowChanged:newWindow;
  90. - removeFrUEiperview;
  91. - replaceSubview:oldView with:newView;
  92. - notifyAncestorWhenFrameChanged:(BOOL)flag;
  93. - suspendNotifyAncestorWhenFrameChanged:(BOOL)flag;
  94. - notifyWhenFlipped:(BOOL)flag;
  95. - descendantFrameChanged:sender;
  96. - descendantFlipped:sender;
  97. - resizeSubviews:(const NXSize *)oldSize;
  98. - superviewSizeChanged:(const NXSize *)oldSize;
  99. - setAutoresizeSubviews:(BOOL)flag;
  100. - setAutosizing:(unsigned int)mask;
  101. - (unsigned int)autosizing;
  102. - moveTo:(NXCoord)x :(NXCoord)y;
  103. - sizeTo:(NXCoord)width :(NXCoord)height;
  104. - setFrame:(const NXRect *)frameRect;
  105. - rotateTo:(NXCoord)angle;
  106. - moveBy:(NXCoord)deltaX :(NXCoord)deltaY;
  107. - sizeBy:(NXCoord)deltaWidth :(NXCoord)deltaHeight;
  108. - rotateBy:(NXCoord)deltaAngle;
  109. - getFrame:(NXRect *)theRect;
  110. - (float)frameAngle;
  111. - setDrawOrigin:(NXCoord)x :(NXCoord)y;
  112. - setDrawSize:(NXCoord)width :(NXCoord)height;
  113. - setDrawRotation:(NXCoord)angle;
  114. - translate:(NXCoord)x :(NXCoord)y;
  115. - scale:(NXCoord)x :(NXCoord)y;
  116. - rotate:(NXCoord)angle;
  117. - getBounds:(NXRect *)theRect;
  118. - (float)boundsAngle;
  119. - setFlipped:(BOOL)flag;
  120. - (BOOL)isFlipped;
  121. - (BOOL)isRotatedFromBase;
  122. - (BOOL)isRotatedOrScaledFromBase;
  123. - setOpaque:(BOOL)flag;
  124. - (BOOL)isOpaque;
  125. - convertPointFromSuperview:(NXPoint *)aPoint;
  126. - convertPointToSuperview:(NXPoint *)aPoint;
  127. - convertRectFromSuperview:(NXRect *)aRect;
  128. - convertRectToSuperview:(NXRect *)aRect;
  129. - convertPoint:(NXPoint *)aPoint fromView:aView;
  130. - convertPoint:(NXPoint *)aPoint toView:aView;
  131. - convertSize:(NXSize *)aSize fromView:aView;
  132. - convertSize:(NXSize *)aSize toView:aView;
  133. - convertRect:(NXRect *)aRect fromView:aView;
  134. - convertRect:(NXRect *)aRect toView:aView;
  135. - centerScanRect:(NXRect *)aRect;
  136. - (BOOL)canDraw;
  137. - setAutodisplay:(BOOL)flag;
  138. - (BOOL)isAutodisplay;
  139. - setNeedsDisplay:(BOOL)flag;
  140. - (BOOL)needsDisplay;
  141. - update;
  142. - drawInSuperview;
  143. - (int)gState;
  144. - allocateGState;
  145. - freeGState;
  146. - notifyToInitGState:(BOOL)flag;
  147. - initGState;
  148. - renewGState;
  149. - clipToFrame:(const NXRect *)frameRect;
  150. - (BOOL)lockFocus;
  151. - unlockFocus;
  152. - (BOOL)isFocusView;
  153. - setClipping:(BOOL)flag;
  154. - (BOOL)doesClip;
  155. - (BOOL)getVisibleRect:(NXRect *)theRect;
  156. - displayIfNeeded;
  157. - display:(const NXRect *)rects :(int)rectCount :(BOOL)clipFlag;
  158. - displayFromOpaqueAncestor:(const NXRect *)rects :(int)rectCount :(BOOL)clipFlag;
  159. - display:(const NXRect *)rects :(int)rectCount;
  160. - display;
  161. - drawSelf:(const NXRect *)rectUEpint)rectCount;
  162. - (float)backgroundGray;
  163. - scrollPoint:(const NXPoint *)aPoint;
  164. - scrollRectToVisible:(const NXRect *)aRect;
  165. - autoscroll:(NXEvent *)theEvent;
  166. - adjustScroll:(NXRect *)newVisible;
  167. - (BOOL)calcUpdateRects:(NXRect *)rects :(int *)rectCount :(NXRect *)enclRect :(NXRect *)goodRect;
  168. - invalidate:(const NXRect *)rects :(int)rectCount;
  169. - scrollRect:(const NXRect *)aRect by:(const NXPoint *)delta;
  170. - hitTest:(NXPoint *)aPoint;
  171. - (BOOL)mouse:(NXPoint *)aPoint inRect:(NXRect *)aRect;
  172. - findViewWithTag:(int)aTag;
  173. - (int)tag;
  174. - (BOOL)performKeyEquivalent:(NXEvent *)theEvent;
  175. - (BOOL)acceptsFirstMouse;
  176. - (BOOL)shouldDelayWindowOrderingForEvent:(NXEvent *)theEvent;
  177. - addCursorRect:(const NXRect *)aRect cursor:anObj;
  178. - removeCursorRect:(const NXRect *)aRect cursor:anObj;
  179. - discardCursorRects;
  180. - resetCursorRects;
  181. - (BOOL)shouldDrawColor;
  182. - write:(NXTypedStream *)stream;
  183. - read:(NXTypedStream *)stream;
  184.  
  185. /* 
  186.  * The following new... methods are now obsolete.  They remain in this  
  187.  * interface file for backward compatibility only.  Use Object's alloc method  
  188.  * and the init... methods defined in this class instead.
  189.  */
  190. + newFrame:(const NXRect *)frameRect;
  191. + new;
  192.  
  193. @end
  194.  
  195. @interface View(Printing)
  196.  
  197. - copyPSCodeInside:(const NXRect *)rect to:(NXStream *)stream;
  198. - writePSCodeInside:(const NXRect *)copyArea to:pasteboard;
  199. - printPSCode:sender;
  200. - faxPSCode:sender;
  201. - faxPSCode:sender
  202.     toList: (const char *const *) names 
  203.     numberList: (const char *const *) numbers 
  204.     sendAt:(time_t) when
  205.     wantsCover: (BOOL) cFlag
  206.     wantsNotify: (BOOL) nFlag
  207.     wantsHires: (BOOL) hFlag
  208.     faxName: (const char *) aString;
  209. - (BOOL)knowsPagesFirst:(int *)firstPageNum last:(int *)lastPageNum;
  210. - openSpoolFile:(char *)filename;
  211. - beginPSOutput;
  212. - beginPrologueBBox:(const NXRect *)boundingBox creationDate:(const char *)dateCreated createdBy:(const char *)anApplication fonts:(const char *)fontNames forWhom:(const char *)user pages:(int)numPages title:(const char *)aTitle;
  213. - endHeaderComments;
  214. - endPrologue;
  215. - beginSetup;
  216. - endSetup;
  217. - beginPage:(int)ordinalNum label:(const char *)aString bBox:(const NXRect *)pageRect fonts:(const char *)fontNames;
  218. - beginPageSetupRect:(const NXRect *)aRect placement:(const NXPoint *)location;
  219. - addToPageSetup;
  220. - endPageSetup;
  221. - endPage;
  222. - beginTrailer;
  223. - endTrailer;
  224. - endPSOutput;
  225. - spoolFile:(coUEqchar *)filename;
  226. - (float)heightAdjustLimit;
  227. - (float)widthAdjustLimit;
  228. - adjustPageWidthNew:(float *)newRight left:(float)oldLeft right:(float)oldRight limit:(float)rightLimit;
  229. - adjustPageHeightNew:(float *)newBottom top:(float)oldTop bottom:(float)oldBottom limit:(float)bottomLimit;
  230. - (BOOL)getRect:(NXRect *)theRect forPage:(int)page;
  231. - placePrintRect:(const NXRect *)aRect offset:(NXPoint *)location;
  232. - drawSheetBorder:(float)width :(float)height;
  233. - drawPageBorder:(float)width :(float)height;
  234.  
  235. @end
  236.  
  237.  
  238. @interface View(Drag)
  239. - dragImage:anImage at:(NXPoint *)viewLocation offset:(NXPoint *)initialOffset event:(NXEvent *)event pasteboard:(Pasteboard *)pboard source:sourceObj slideBack:(BOOL)slideFlag;
  240.  
  241. - registerForDraggedTypes:(const char *const *)newTypes count:(int)numTypes;
  242. - unregisterDraggedTypes;
  243. @end
  244.  
  245.  
  246. @interface View (IconDragging)
  247. - dragFile:(const char *)filename fromRect:(NXRect *)rect slideBack:(BOOL) aFlag event:(NXEvent *)event;
  248. @end
  249.  
  250. @interface View (RIBPrinting)
  251. - (BOOL)canPrintRIB;
  252. @end
  253.  
  254. @interface Object(NXPrintingUserInterface)
  255. - (BOOL)shouldRunPrintPanel:aView;
  256. @end
  257.  
  258.