This is PatternApp.h in view mode; [Download] [Up]
/* * (a) (C) 1990 by Adobe Systems Incorporated. All rights reserved. * * (b) If this Sample Code is distributed as part of the Display PostScript * System Software Development Kit from Adobe Systems Incorporated, * then this copy is designated as Development Software and its use is * subject to the terms of the License Agreement attached to such Kit. * * (c) If this Sample Code is distributed independently, then the following * terms apply: * * (d) This file may be freely copied and redistributed as long as: * 1) Parts (a), (d), (e) and (f) continue to be included in the file, * 2) If the file has been modified in any way, a notice of such * modification is conspicuously indicated. * * (e) PostScript, Display PostScript, and Adobe are registered trademarks of * Adobe Systems Incorporated. * * (f) THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO * CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED * AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED. * ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY * OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO * WARRANTY OF ANY KIND (EXPRESS, IMPLIED OR STATUTORY) * WITH RESPECT TO THIS INFORMATION, AND EXPRESSLY * DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY, * FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT * OF THIRD PARTY RIGHTS. */ /* * PatternApp.h * * This class performs some of the global functions necessary to start * the application. The drawing window is created here. * * Version: 2.0 * Author: Ken Fromm * History: * 03-07-91 Added this comment. */ #import <appkit/Application.h> #import <appkit/View.h> #define CIRCLESTAR 0 #define OCTAGON 1 #define BRICK 2 #define WEAVE 3 #define NUM_PATTERNS 4 #define STROKE 0 #define FILL 1 #define TEXT 2 /* * These values determine how the pattern * will be displayed. Each places a clipping path * around the path to be filled. * * The draw method draws each cell each time. * It is not the preferred method. (The font method * should be used instead.) * * The font method builds a character for each * color (layer) in the pattern. The characters are * then drawn a layer at a time. Its faster than the * first method because the characters are cached * in the font cache. * * The composite method creates an image * and then tiles the image through the path. * An advantage here is that only one pass is * necessary even with multicolored patterns. * Unfortunately, it cannot be used for printing. * * It turns out that a big performance win is gained * if the cell size is increased from a single image * into a cell with multiple images. Care must be * taken though to insure proper alignment of the * images within the cells. */ #define TYPE_DRAW 0 #define TYPE_FONT 1 #define TYPE_COMP 2 /* * These values lock the pattern to either the window or the view. * * If locked to the window, the changes produced by scrolling * are handled by a currenthalftonephase transtation (see the * PATthtp procedure in PatternDict). Resizing of the window or * changes in the placement of the view within the window may * cause shifts in the pattern tiling. * * Locking to the view eliminates the shifts of the pattern tiling * when the window is resized or when the view is moved within * the window. In the case of LOCK_VIEW, the size of the * pattern cell remains unchanged at any scale of the view. In * the case of LOCK_VIEWSCALE, the pattern cell scales to * reflect the scale of the drawing view. * * Level 2 patterns will most likely be handled like the first case. * If the behavior of either of the last two cases is desired then * the pattern will have to be remade when the window resizes, * the view is moved or the scale changes. */ #define LOCK_WINDOW 0 #define LOCK_VIEW 1 #define LOCK_VIEWSCALE 2 #define SCROLLVIEW_BORDER NX_NOBORDER @interface PatternApp : Application { id countMatrix, graphicsMatrix, patternMatrix, timingMatrix, typeMatrix, lockMatrix, zoomMatrix, patternBox, drawingviewId, /* the drawing view */ windowId; /* the window the views above are in */ } - createWindow:(NXRect *) winRect; - free; - countMatrix; - graphicsMatrix; - patternMatrix; - timingMatrix; - typeMatrix; - lockMatrix; - zoomMatrix; - patternBox; - drawingView; - docView; - appDidInit:sender; - windowDidResize:sender; @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.