home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / SourceCode / AdobeExamples / NX_Binary / DocView.h < prev    next >
Encoding:
Text File  |  1992-12-19  |  2.6 KB  |  93 lines

  1.  
  2. /*
  3.  * (a)  (C) 1990 by Adobe Systems Incorporated. All rights reserved.
  4.  *
  5.  * (b)  If this Sample Code is distributed as part of the Display PostScript
  6.  *    System Software Development Kit from Adobe Systems Incorporated,
  7.  *    then this copy is designated as Development Software and its use is
  8.  *    subject to the terms of the License Agreement attached to such Kit.
  9.  *
  10.  * (c)  If this Sample Code is distributed independently, then the following
  11.  *    terms apply:
  12.  *
  13.  * (d)  This file may be freely copied and redistributed as long as:
  14.  *    1) Parts (a), (d), (e) and (f) continue to be included in the file,
  15.  *    2) If the file has been modified in any way, a notice of such
  16.  *      modification is conspicuously indicated.
  17.  *
  18.  * (e)  PostScript, Display PostScript, and Adobe are registered trademarks of
  19.  *    Adobe Systems Incorporated.
  20.  * 
  21.  * (f) THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO
  22.  *    CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED
  23.  *    AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED.
  24.  *    ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY
  25.  *    OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO
  26.  *    WARRANTY OF ANY KIND (EXPRESS, IMPLIED OR STATUTORY)
  27.  *    WITH RESPECT TO THIS INFORMATION, AND EXPRESSLY
  28.  *    DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY, 
  29.  *    FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT
  30.  *    OF THIRD PARTY RIGHTS.
  31.  */
  32.  
  33. /*
  34.  *    DocView.h
  35.  *
  36.  *    This class allows the drawing view to be positioned in the center
  37.  *    of the clip view and a border and drop shadow placed around it
  38.  *    when the drawing view is scaled to be smaller than the clip view.
  39.  *    This class also handles the zooming of the drawing view.
  40.   *
  41.  *    Version:    2.0
  42.  *    Author:    Ken Fromm
  43.  *    History:
  44.  *            03-07-91        Added this comment.
  45. */
  46.  
  47. #import <appkit/View.h>
  48.  
  49. #define OFFSET        8
  50. #define LINEWIDTH    6
  51.  
  52. @interface DocView : View
  53. {
  54.     id        zoomCursor;        /* the zoom cursor. */
  55.     id        zoomControl;        /* the matrix of radio buttons for zooming. */
  56.     id        drawviewId;        /* the drawing view */
  57.  
  58.     BOOL    zooming;
  59.     
  60.     float        scale,            /* the scale of the drawing view */
  61.             hitsetting;            /* the size of the rectangle for hit detection. */
  62. }
  63.  
  64. - addDrawView:subView;
  65.  
  66. - setZoomControl:anObject;
  67. - zoomControl;
  68.  
  69. - setHitSetting:(float) value;
  70. - (float) hitSetting;
  71.  
  72. - setScale:(float) value;
  73. - (float) scale;
  74.  
  75. - (BOOL) isZooming;
  76.  
  77. - getDrawViewInRect:(const NXRect *) aRect  withDrop:(BOOL) drop;
  78.  
  79. - resetCursorRects;
  80. - zoom:sender;
  81.  
  82. - sizeView:viewId  withScale:(float) newscale;
  83. - scaleView:viewId  withScale:(float) newscale;
  84. - placeView:viewId;
  85.  
  86. - scaleDrawView:hitView  toPoint:(NXPoint *) p;
  87. - scrollPoint:(const NXPoint *) aPt  inView:hitView  to:(const NXPoint *) windowPt;
  88.  
  89. - drawSelf:(NXRect *)r :(int) count;
  90.  
  91. @end
  92.  
  93.