/* ciisetup.h
** Copyright (C) 1993 by Xerox Corporation.  All rights reserved.
** MFP, September 28, 1993 5:12:41 pm PDT
**
** Dependencies:
**   cii.h
**
** Caveats:
**   
** Change log:
**   August 19, 1993 (MFP) - creation (as ciistartup.h)
**   September 21, 1993 (MFP) - renamed *startup* to *setup*
**   September 28, 1993 (MFP) - Added more comments
*/


#ifndef ciisetup←h
#define ciisetup←h

#ifndef cii←h
#include "cii.h"
#endif


/**********************************************************************
**  CII←SetupHandle: TYPE                                            **
**                                                                   **
**  This object provides methods for the creation and                **
**  initialization of a CII←Handle for some specific raster          **
**  devices.  Note that it is NOT the case that all CII←Handle       **
**  instances are created via this route, which is why this class    **
**  is defined separately from the cii interface.  Other suppliers   **
**  of cii implementations may well have their own CII←Handle        **
**  creation routines.                                               **
**                                                                   **
**  It is not normally necessary for interpreters to use this        **
**  interface, since they will be passed a CII←Handle.               **
**********************************************************************/
typedef struct CII←SetupObjectRep * CII←SetupHandle;

/**********************************************************************
**  CII←ScanMode: TYPE                                               **
**                                                                   **
**  For specifying the orientation of device rasters.  The most      **
**  popular are:                                                     **
**     CII←slowRightFastUp - for long-edge feed printers             **
**     CII←slowDownFastRight - for short-edge feed printers,         **
**                             raster displays                       **
**********************************************************************/
typedef enum {
    CII←slowRightFastUp,
    CII←slowDownFastRight,
    CII←slowLeftFastDown,
    CII←slowUpFastLeft,
    CII←slowRightFastDown,
    CII←slowDownFastLeft,
    CII←slowLeftFastUp,
    CII←slowUpFastRight
    } CII←ScanMode;

/**********************************************************************
**  CII←SetupStandardParams: METHOD                                  **
**                                                                   **
**  This sets the standard parameters, needed for every raster       **
**  device.                                                          **
**********************************************************************/
#define CII←SetupStandardParams(a, b, c, d, e, f) \
   (((a)->SetupStandardParams)(a, b, c, d, e, f))
typedef CII←RES
PROC←CII←SetupStandardParams(
    CII←SetupHandle s,
    unsigned int sSizeDevice,
    unsigned int fSizeDevice,
    CII←ScanMode scanMode,
    float surfaceUnitsPerInchX,
    float surfaceUnitsPerInchY
);

/**********************************************************************
**  CII←SetupArrayParamSize: METHOD                                  **
**                                                                   **
**  This provides an extension mechanism, for creators that need     **
**  variable-sized array parameters.                                 **
**********************************************************************/
#define CII←SetupArrayParamSize(s, name, size) \
   (((s)->SetupArrayParamSize)(s, name, size))
typedef CII←RES
PROC←CII←SetupArrayParamSize(
    CII←SetupHandle s,
    char* name,
    unsigned int size
);

/**********************************************************************
**  CII←SetupIntParam: METHOD                                        **
**                                                                   **
**  This provides an extension mechanism, for creators that need     **
**  parameters in addition to those set by SetupStandardParams.  If  **
**  index is not 0, the client must have called                      **
**  CII←SetupArrayParamSize with the same name paramenter, and a     **
**  size greater than the index value.                               **
**********************************************************************/
#define CII←SetupIntParam(s, name, index, value) \
   (((s)->SetupIntParam)(s, name, index, value))
typedef CII←RES
PROC←CII←SetupIntParam(
    CII←SetupHandle s,
    char* name,
    unsigned int index,
    int value
);

/**********************************************************************
**  CII←SetupFloatParam: METHOD                                      **
**                                                                   **
**  Similar to CII←SetupIntParam, but for floating-point parameters. **
**********************************************************************/
#define CII←SetupFloatParam(s, name, index, value) \
   (((s)->SetupFloatParam)(s, name, index, value))
typedef CII←RES
PROC←CII←SetupFloatParam(
    CII←SetupHandle s,
    char* name,
    unsigned int index,
    float value
);

/**********************************************************************
**  CII←SetupNameParam: METHOD                                       **
**                                                                   **
**  Similar to CII←SetupIntParam, but for string-valued parameters.  **
**********************************************************************/
#define CII←SetupNameParam(s, name, index, value) \
   (((s)->SetupNameParam)(s, name, index, value))
typedef CII←RES
PROC←CII←SetupNameParam(
    CII←SetupHandle s,
    char* name,
    unsigned int index,
    char* value
);

/**********************************************************************
**  CII←CreateHandleFromRasters: METHOD                              **
**                                                                   **
**  Actually creates a CII←Handle.  After the handle is created,     **
**  there may be some additional calls needed to complete the        **
**  initializaton.                                                   **
**********************************************************************/
#define CII←CreateHandleFromRasters(s, logicalDevice, nRasters, rasters, handleResult) \
   (((s)->CreateHandleFromRasters)(s, logicalDevice, nRasters, rasters, handleResult))
typedef CII←RES
PROC←CII←CreateHandleFromRasters(
    CII←SetupHandle s,
    unsigned int logicalDevice,
    unsigned int nRasters,
    CII←RasterRep rasters[],
    CII←Handle* handleResult
);

/**********************************************************************
**  CII←DestroySetupObject: METHOD                                   **
**                                                                   **
**  Should be called exactly once on each CII←SetupHandle created,   **
**  after which the client must not use it.  It is OK to destroy a   **
**  CII←SetupHandle before you are done with the CII←Handles that    **
**  it was used to create.                                           **
**********************************************************************/
#define CII←DestroySetupObject(s) \
   (((s)->DestroySetupObject)(s))
typedef CII←RES
PROC←CII←DestroySetupObject(CII←SetupHandle s);

#ifdef c←plusplus
#define C←PROC "C"
#else
#define C←PROC
#endif


/**********************************************************************
**  CII←HighlightDeviceSetup: PROCEDURE                              **
**                                                                   **
**  This makes a CII←SetupHandle for creating a highlight device.    **
**  Additional initialization calls:                                 **
**    CII←SetOutputBuffers (allowed)                                 **
**    CII←SetHalftoneProperties (recommended)                        **
**********************************************************************/
extern C←PROC CII←SetupHandle
CII←HighlightDeviceSetup();

/**********************************************************************
**  CII←BWHalftoneDeviceSetup: PROCEDURE                             **
**                                                                   **
**  This makes a CII←SetupHandle for creating a monochrome           **
**  halftoning device.  Additional initialization calls:             **
**    CII←SetOutputBuffers (allowed)                                 **
**    CII←SetHalftoneProperties (recommended)                        **
**********************************************************************/
extern C←PROC CII←SetupHandle
CII←BWHalftoneDeviceSetup();

/**********************************************************************
**  CII←CMYKHalftoneDeviceSetup: PROCEDURE                           **
**                                                                   **
**  This makes a CII←SetupHandle for creating a four-color CMYK      **
**  halftoning device.  Additional initialization calls:             **
**    CII←SetOutputBuffers (allowed)                                 **
**    CII←SetHalftoneProperties (recommended)                        **
**********************************************************************/
extern C←PROC CII←SetupHandle
CII←CMYKHalftoneDeviceSetup();

/**********************************************************************
**  CII←CMYKHalftoneSeparationDeviceSetup: PROCEDURE                 **
**                                                                   **
**  This makes a CII←SetupHandle for creating a halftoning device    **
**  that makes just one separation of a four-color CMYK device.      **
**  Additional initialization calls:                                 **
**    CII←SetOutputBuffers (allowed)                                 **
**    CII←SetSeparation (required)                                   **
**    CII←SetHalftoneProperties (recommended)                        **
**********************************************************************/
extern C←PROC CII←SetupHandle
CII←CMYKHalftoneSeparationDeviceSetup();

/**********************************************************************
**  CII←SetupObjectRep: OBJECT                                       **
**                                                                   **
**********************************************************************/
typedef struct CII←SetupObjectRep {
    void* data;
    PROC←CII←SetupStandardParams* SetupStandardParams;
    PROC←CII←SetupArrayParamSize* SetupArrayParamSize;
    PROC←CII←SetupIntParam* SetupIntParam;
    PROC←CII←SetupFloatParam* SetupFloatParam;
    PROC←CII←SetupNameParam* SetupNameParam;
    PROC←CII←CreateHandleFromRasters* CreateHandleFromRasters;
    PROC←CII←DestroySetupObject* DestroySetupObject;
} CII←SetupObjectRep;
#undef C←PROC

#endif /* ciisetup←h */