824N/A/*
824N/A * DPSCAPproto.h -- CAP requests constants and alignment values,
824N/A * analgous to Xproto.h
824N/A *
824N/A * (c) Copyright 1991-1994 Adobe Systems Incorporated.
824N/A * All rights reserved.
824N/A *
824N/A * Permission to use, copy, modify, distribute, and sublicense this software
824N/A * and its documentation for any purpose and without fee is hereby granted,
824N/A * provided that the above copyright notices appear in all copies and that
824N/A * both those copyright notices and this permission notice appear in
824N/A * supporting documentation and that the name of Adobe Systems Incorporated
824N/A * not be used in advertising or publicity pertaining to distribution of the
824N/A * software without specific, written prior permission. No trademark license
824N/A * to use the Adobe trademarks is hereby granted. If the Adobe trademark
824N/A * "Display PostScript"(tm) is used to describe this software, its
824N/A * functionality or for any other purpose, such use shall be limited to a
824N/A * statement that this software works in conjunction with the Display
824N/A * PostScript system. Proper trademark attribution to reflect Adobe's
824N/A * ownership of the trademark shall be given whenever any such reference to
824N/A * the Display PostScript system is made.
824N/A *
824N/A * ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR
824N/A * ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
824N/A * ADOBE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
824N/A * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
824N/A * NON- INFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL ADOBE BE LIABLE
824N/A * TO YOU OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL
824N/A * DAMAGES OR ANY DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT,
824N/A * NEGLIGENCE, STRICT LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN
824N/A * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ADOBE WILL NOT
824N/A * PROVIDE ANY TRAINING OR OTHER SUPPORT FOR THE SOFTWARE.
824N/A *
824N/A * Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems
824N/A * Incorporated which may be registered in certain jurisdictions
824N/A *
824N/A * Author: Adobe Systems Incorporated
824N/A */
824N/A
824N/A
824N/A#ifndef _DPSCAPproto_h
824N/A#define _DPSCAPproto_h
824N/A
824N/A/* === DEFINITIONS === */
824N/A
824N/A#define DPSCAPPROTOVERSION 3
824N/A#define DPSCAPPROTOVERSION_2 2
824N/A
824N/A#define CSDPSPORT 6016 /* add agent instance number */
824N/A#define DPS_NX_SERV_NAME "dpsnx" /* name to look up in /etc/services */
824N/A
824N/A/* Request Opcodes */
824N/A
824N/A#define DPSCAPOPCODEBASE 126
824N/A#define DPSXOPCODEBASE 125
824N/A
824N/A#define X_CAPFlushAgent 1
824N/A#define X_CAPNotify 2
824N/A#define X_CAPSetArg 3
824N/A
824N/A/* === REQUESTS === */
824N/A
824N/Atypedef struct _CAPConnSetup {
824N/A BYTE byteorder; /* #x42 MSB, #x6C LSB */
824N/A BYTE dpscapVersion; /* proto version of connecting client */
824N/A CARD16 flags B16; /* functional hint flags */
824N/A CARD32 libraryversion B32; /* as for XPSInit */
824N/A CARD16 authProtoNameLength B16; /* in bytes */
824N/A CARD16 authProtoDataLength B16; /* in bytes */
824N/A CARD16 displayStringLength B16; /* in bytes */
824N/A CARD16 nodeStringLength B16; /* in bytes */
824N/A CARD16 transportStringLength B16; /* in bytes */
824N/A CARD16 display B16; /* Display number */
824N/A CARD16 screen B16; /* Screen number */
824N/A CARD16 reserved B16;
824N/A CARD32 clientWindow B32; /* window for ClientMessage */
824N/A} xCAPConnSetupReq;
824N/A#define sz_xCAPConnSetupReq 28
824N/A
824N/Atypedef struct {
824N/A BYTE success;
824N/A BYTE reasonLength;
824N/A CARD16 additionalLength B16;
824N/A} xCAPConnReplyPrefix;
824N/A#define sz_xCAPConnReplyPrefix 4
824N/A
824N/Atypedef struct _CAPConnFailed {
824N/A BYTE success; /* failed = 0, success = 1 */
824N/A BYTE reasonLength; /* in bytes if failed, ignore if success */
824N/A CARD16 additionalLength B16;/* quadbytes ADDITIONAL length */
824N/A CARD32 serverVersion B32; /* as for XPSInit */
824N/A CARD8 dpscapVersion; /* proto version of agent */
824N/A CARD8 pad;
824N/A CARD16 reserved B16;
824N/A} xCAPConnFailed;
824N/A#define sz_xCAPConnFailed 12
824N/A
824N/Atypedef struct _CAPConnSuccess {
824N/A BYTE success; /* failed = 0, success = 1 */
824N/A BYTE reasonLength; /* in bytes if failed, ignore if success */
824N/A CARD16 additionalLength B16;/* quadbytes ADDITIONAL length */
824N/A CARD32 serverVersion B32; /* as for XPSInit */
824N/A CARD8 dpscapVersion; /* proto version of agent */
824N/A CARD8 reserved;
824N/A CARD16 flagsUsed B16; /* mask of functional hint flags used */
824N/A CARD32 preferredNumberFormat B32; /* as for XPSInit */
824N/A CARD32 floatingNameLength B32; /* as for XPSInit */
824N/A CARD32 agentWindow B32; /* client sends messages to this window */
824N/A} xCAPConnSuccess;
824N/A#define sz_xCAPConnSuccess 24
824N/A
824N/Atypedef struct _CAPFlushAgent {
824N/A CARD8 reqType; /* always DPSCAPOPCODEBASE */
824N/A CARD8 type; /* always X_CAPFlushAgent */
824N/A CARD16 length B16; /* quadbyte length of request */
824N/A CARD32 cxid B32; /* context XID */
824N/A} xCAPFlushAgentReq;
824N/A#define sz_xCAPFlushAgentReq 8
824N/A
824N/Atypedef struct _CAPNotify {
824N/A CARD8 reqType; /* always DPSCAPOPCODEBASE */
824N/A CARD8 type; /* always X_CAPNotify */
824N/A CARD16 length B16; /* quadbyte length of request */
824N/A CARD32 cxid B32; /* context XID */
824N/A CARD32 notification B32; /* notify code */
824N/A CARD32 data B32; /* data word */
824N/A CARD32 extra B32; /* extra word */
824N/A} xCAPNotifyReq;
824N/A#define sz_xCAPNotifyReq 20
824N/A
824N/Atypedef struct _CAPSetArg {
824N/A CARD8 reqType; /* always DPSCAPOPCODEBASE */
824N/A CARD8 type; /* always X_CAPNotify */
824N/A CARD16 length B16; /* quadbyte length of request */
824N/A CARD32 arg B32; /* argument type */
824N/A CARD32 val B32; /* value */
824N/A} xCAPSetArgReq;
824N/A#define sz_xCAPSetArgReq 12
824N/A
824N/A/* === ERRORS === */
824N/A
824N/Atypedef struct _DPSCAPError {
824N/A BYTE type; /* always 0 */
824N/A BYTE errorCode; /* always 255 */
824N/A CARD16 sequenceNumber B16; /* the nth request from this client */
824N/A CARD8 subLength; /* how much of 21 bytes are used */
824N/A CARD8 unused;
824N/A CARD16 reserved B16;
824N/A CARD16 minorOpcode B16;
824N/A CARD8 majorOpcode; /* always 0 */
824N/A BYTE subData1;
824N/A CARD32 subData2 B32;
824N/A CARD32 subData3 B32;
824N/A CARD32 subData4 B32;
824N/A CARD32 subData5 B32;
824N/A CARD32 subData6 B32;
824N/A CARD32 subData7 B32;
824N/A} xDPSCAPError;
824N/A
824N/A/* === EVENTS === */
824N/A
824N/A/* Events sent from agent to client via XSendEvent */
824N/A
824N/A#define DPSCAP_OUTPUT_OVERHEAD 4
824N/A#define DPSCAP_BYTESPEROUTPUTEVENT (20 - DPSCAP_OUTPUT_OVERHEAD)
824N/A#define DPSCAP_DATA_LEN (DPSCAP_BYTESPEROUTPUTEVENT-1)
824N/A
824N/Atypedef struct {
824N/A CARD32 cxid;
824N/A CARD8 data[DPSCAP_BYTESPEROUTPUTEVENT];
824N/A} DPSCAPOutputEvent;
824N/A
824N/Atypedef struct {
824N/A BYTE status;
824N/A BYTE unused;
824N/A CARD16 sequenceNumber;
824N/A CARD32 cxid;
824N/A} DPSCAPStatusEvent;
824N/A
824N/A#endif /* _DPSCAPproto_h */