background image
Functional specification
129
CDE/Motif PST
CDEnext
DESCRIPTION
XpFreeAttributes
frees the memory associated with the attributes for the specified print context.
XpFreeAttributes
should be called from the driver's
DestroyContext
function.
9.15
Xp Extension Functions
A print driver must implement the following set of functions which provide the underpinnings for the
extension requests defined by the Xp extension. The InitContext call is the function which was passed to
XpRegisterInitFunc, while the other functions are called via function pointers stored in each PrintContext.
A pointer to a PrintContext is passed to each of these routines, and has the following structure:
typedef struct _xpprintfuncs {
int versionNumber;
int (*StartJob)(); /* pPrintContext, saveData */
int (*EndJob)(); /* pPrintContext, cancel */
int (*StartDoc)(); /* pPrintContext */
int (*EndDoc)(); /* pPrintContext, cancel */
int (*StartPage)(); /* pPrintContext, pWin */
int (*EndPage)(); /* pPrintContext, pWin, cancel */
int (*PutDocumentData)(); /* pPrintContext, pWin, pData,len_data, pFmt,
pOpt */
int (*GetDocumentData)(); /* pPrintContext, client, maxBufferSize */
int (*DestroyContext)(); /* pPrintContext */
char *(*GetAttributes)(); /* pPrintContext, class */
char *(*GetOneAttribute)(); /* pPrintContext, class, attribute */
int (*SetAttributes)(); /* pPrintContext, class, pData */
int (*AugmentAttributes)(); /* pPrintContext, class, pData */
int (*GetMediumDimensions(); /* pPrintContext, pWidth, pHeight */
int (*GetReproducibleArea(); /* pPrintContext, pRect */
} XpDriverFuncs, *XpDriverFuncsPtr;
typedef struct _XpContext {
XID contextID;
char *printerName;
int screenNum;
struct _XpClient *clientHead; /* list of clients */
CARD32 state;
VisualID pageWin;
DevUnion *devPrivates;
XpDriverFuncs funcs;
} XpContextRec, *XpContextPtr;
When the driver's InitContext function is called it is free to inspect the printerName field of the
XpContext, and is required to fill in all of the function pointers in the embedded XpDriversFuncs structure.