ftp.nice.ch/peanuts/GeneralData/Documents/adobe/DPS.Purple.ImportAdv.tar.gz#/NX_ImportAdv

DocView.h
[View DocView.h] 
DocView.m
[View DocView.m] 
Document.h
[View Document.h] 
Document.m
[View Document.m] 
DrawingView.h
[View DrawingView.h] 
DrawingView.m
[View DrawingView.m] 
DrawingViewWraps.psw
 
GraphicImport.h
[View GraphicImport.h] 
GraphicImport.m
[View GraphicImport.m] 
GraphicList.h
[View GraphicList.h] 
GraphicList.m
[View GraphicList.m] 
IB.proj
 
Icon.tiff
 
Import.iconheader
 

Import.nib


 
ImportApp.h
[View ImportApp.h] 
ImportApp.m
[View ImportApp.m] 
ImportPanel.h
[View ImportPanel.h] 
ImportPanel.m
[View ImportPanel.m] 
Import_main.m
[View Import_main.m] 
Makefile
 
Makefile.preamble
 
NXBitmapImageRepSub.h
[View NXBitmapImageRepSub.h] 
NXBitmapImageRepSub.m
[View NXBitmapImageRepSub.m] 
NXEPSImageRepSub.h
[View NXEPSImageRepSub.h] 
NXEPSImageRepSub.m
[View NXEPSImageRepSub.m] 
Preferences.h
[View Preferences.h] 
Preferences.m
[View Preferences.m] 
README
 
ResourcePanel.h
[View ResourcePanel.h] 
ResourcePanel.m
[View ResourcePanel.m] 

ResourcePanel.nib


 
SaveAsPanel.h
[View SaveAsPanel.h] 
SaveAsPanel.m
[View SaveAsPanel.m] 
ScrollingView.h
[View ScrollingView.h] 
ScrollingView.m
[View ScrollingView.m] 
buttonArrow.tiff
 
buttonRotate.tiff
 
buttonZoom.tiff
 
cursorImport.tiff
 
cursorRotate1.tiff
 
cursorRotate2.tiff
 
cursorZoom.tiff
 
cursorZoomDown.tiff
 
cursorZoomUp.tiff
 
epsf.h
[View epsf.h] 
epsferror.m
[View epsferror.m] 
epsfreader.m
[View epsfreader.m] 
epsfstruct.h
[View epsfstruct.h] 
epsfwraps.psw
 
epsfwriter.m
[View epsfwriter.m] 
resources.h
[View resources.h] 
rotate.tiff
 
rotateprocs.c
[View rotateprocs.c] 
rotateprocs.h
[View rotateprocs.h] 

README

README file for the ImportAdvanced application.

This application covers importing and exporting EPS files and TIFF images.
The important aspects here are caching the image in an NXImage and imaging
it within an NXEPSImageRep. The NXEPSImageRep switches contexts which
provides for a more robust recovery when errors are encountered in an EPS file.
Without a separate context, errors within an EPS file could sink the application's
context. The NXImage improves scrolling and other areas where quick redrawing
is necessary.

Other important aspects are the checking of the some of the included resources
(fonts and files). A panel is displayed showing which resources are missing. If a
%%IncludeFile: comment is encountered, then a temporary file or memory stream
is written with the included file or files incorporated into it. Its this file or memory stream
that's used for imaging. (This is done behind the veil of the NXEPSImageRep, but its
hope that this functionality will be incorporated into the class at some later point.)

The files can be copied into the document or imported by reference. Unfortunately,
a little more work needs to be done to allow the user to locate a referenced file if it
cannot be found. (That's left as an exercise for the reader.)

The saveTo: menu item initiates the path to output the Adobe Illustrator compatible
code for EPS files. Including a preview image as a comment in the file is also an option
when saving as EPS.

Another aspect of the application is the user interface. Importing by dragging out
is possible as well as dropping in. The user can rotate the files and zoom in and out.
These guidelines are not meant to establish a standard but provide a base from which
to best decide what may work for a particular application.

Portions of the source code in this application are based on source code
from the Draw example application provided by NeXT.


Below lies an annotated list of the files used in the application. The
classes listed first form the majority of the application and are
the more important ones to note. The others fill support roles.

ImportApp		- A subclass of Application. Manages the global operations.
Document		- A subclass of Responder. Manages the operations for a document.
					Operations such as import, save, etc.
DocView			- A subclass of View. Resides as the DocView of a ClipView and
					DrawingView. Positions the DrawingView within the ClipView.
DrawingView		- A subclass of View. The view that manages the drawing for a
					document. Contains the list of graphics.
GraphicImport		- A subclass of Object. Each imported eps and tiff  file is managed
					through an instance of this object. Uses an NXImage to retain
					the image of the file offscreen and an NXEPSImageRepSub
					to swiche DPS contexts when imaging to protect the application's
					context.
NXEPSImageRepSub - A subclass of NXEPSImageRep. Adds the resource parsing and
					checking routines, the include file handling and the drawing
					with rotation.
NXBitmapImageRepSub - A subclass of NXBitmapImageRep. Adds the drawing
					with rotation.

GraphicList		- A subclass of List. Acts like a GraphicEpsf object but just passes
					each message on to the elements in the list.

SaveAsPanel		- A subclass of SavePanel. 
ResourcePanel	- A subclass of Panel that displays the resources specified in the
					Epsf file but not found in the system.
ImportPanel		- A subclass of OpenPanel. 
ScrollingView		- A subclass of ScrollView.  One method overridden to scroll both the
					DrawingView and the offscreen buffer of the DrawingView. 
Preferences		- A subclass of Panel. Uses for setting the preferences. 

epsfwraps.psw	- Wraps for epsf files.
epsfreader.m		- Routines for parsing Eps files.
epsfwriter.m		- Routines for writing Eps files. 
epsferror.m		- Error codes and messages for parsing errors.


Topics of interest from ImportAdvanced:

Parsing an Eps file (epsfreader)
Resource checking and error flagging (epsfreader, GraphicImport, ResourcePanel)
Imaging an Eps file into an NXImage (GraphicImport)
Dragging out the place for an Eps file (DrawingView, GraphicImport)
Saving As EPS/Illustrator (Document, DrawingView, GraphicImport, NXEPSImageRepSub)

Rotating a graphic (DrawingView, GraphicImport, NXEPSImageRepSub,
		NXBitmapImageRepSub rotateprocs)
Multiple graphics (DrawingView, GraphicList)
Returning files to their Original Ratio and Original Size (DrawingView, GraphicImport)
Muliple images per Epsf file (GraphicImport)
Zooming in and out (DocView, DrawingView)
Including a Proc Set (DrawingView)

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.