📄 printstr.h
字号:
/* $XConsortium: Printstr.h /main/2 1996/11/16 15:20:15 rws $ *//****************************************************************************** ****************************************************************************** ** ** File: Printstr.h ** ** Description: Definitions needed by the server and library, but ** not clients. ** ** Print.h for server, library and clients. ** ****************************************************************************** ** ** (c) Copyright 1996 Hewlett-Packard Company ** (c) Copyright 1996 International Business Machines Corp. ** (c) Copyright 1996 Sun Microsystems, Inc. ** (c) Copyright 1996 Novell, Inc. ** (c) Copyright 1996 Digital Equipment Corp. ** (c) Copyright 1996 Fujitsu Limited ** (c) Copyright 1996 Hitachi, Ltd. ** ** Permission is hereby granted, free of charge, to any person obtaining a copy ** of this software and associated documentation files (the "Software"), to deal ** in the Software without restriction, including without limitation the rights ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ** copies of the Software, and to permit persons to whom the Software is ** furnished to do so, subject to the following conditions: ** ** The above copyright notice and this permission notice shall be included in ** all copies or substantial portions of the Software. ** ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ** COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER ** IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ** CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ** ** Except as contained in this notice, the names of the copyright holders shall ** not be used in advertising or otherwise to promote the sale, use or other ** dealings in this Software without prior written authorization from said ** copyright holders. ** ****************************************************************************** *****************************************************************************/#ifndef _XpPrintstr_H_#define _XpPrintstr_H_/* * NEED_EVENTS and NEED_REPLIES are hacks to limit the linker symbol-table * size. When function prototypes are needed from Print.h, this sets up * a cascading dependency on Printstr.h and eventually Xproto.h to provide * the event and reply struct definitions. */#ifndef NEED_EVENTS#define NEED_EVENTS#endif /* NEED_EVENTS */#define NEED_REPLIES#include <X11/Xproto.h>#ifndef _XP_PRINT_SERVER_#include <X11/Xlib.h>#endif /* _XP_PRINT_SERVER_ *//* * Pull in other definitions. Print.h will hide some things if we're * doing server side work. */#include <X11/extensions/Print.h>#include <X11/Xfuncproto.h>_XFUNCPROTOBEGIN/****************************************************************************** * * Protocol requests constants and alignment values * * Note: Xlib macro's expect X_ABC where ABC is the name of the * protocol request. */#define X_PrintQueryVersion 0#define X_PrintGetPrinterList 1#define X_PrintCreateContext 2#define X_PrintSetContext 3#define X_PrintGetContext 4#define X_PrintDestroyContext 5#define X_PrintGetContextScreen 6#define X_PrintStartJob 7#define X_PrintEndJob 8#define X_PrintStartDoc 9#define X_PrintEndDoc 10#define X_PrintPutDocumentData 11#define X_PrintGetDocumentData 12#define X_PrintStartPage 13#define X_PrintEndPage 14#define X_PrintSelectInput 15#define X_PrintInputSelected 16#define X_PrintGetAttributes 17#define X_PrintSetAttributes 18#define X_PrintGetOneAttribute 19#define X_PrintRehashPrinterList 20#define X_PrintGetPageDimensions 21#define X_PrintQueryScreens 22#define X_PrintSetImageResolution 23#define X_PrintGetImageResolution 24/******************************************************************** * * Protocol data types */#define PCONTEXT CARD32#define WINDOW CARD32#define DRAWABLE CARD32#define BITMASK CARD32/****************************************************************************** * * Event wire struct definitions * * Note: Xlib macro's expect xABC struct names and sz_xABC size * constants where ABC is the name of the protocol request. *//********************************************************************* * * Events. * * See Print.h for the protocol "type" values. */typedef struct _xPrintPrintEvent { BYTE type; /* XPPrintNotify + extEntry->eventBase */ BYTE detail; /* XPStartJobNotify, XPEndJobNotify, XPStartDocNotify, XPEndDocNotify, XPStartPageNotify, XPEndPageNotify */ CARD16 sequenceNumber B16; PCONTEXT printContext B32; /* print context */ BOOL cancel; /* canceled flag */ CARD8 pad1; /* rest is unused */ CARD16 pad2 B16; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32;} xPrintPrintEvent;#define sz_xPrintPrintEvent 32;typedef struct _xPrintAttributeEvent { BYTE type; /* XPAttributeNotify + extEntry->eventBase */ BYTE detail; /* XPJobAttr, XPDocAttr, XPPageAttr, XPPrinterAttr, XPSpoolerAttr, XPMediumAttr, XPServerAttr */ CARD16 sequenceNumber B16; PCONTEXT printContext B32; /* print context */ CARD32 pad1 B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32;} xPrintAttributeEvent;#define sz_xPrintAttributeEvent 32;/********************************************************************* * * Requests */typedef struct _PrintQueryVersion { CARD8 reqType; /* always PrintReqCode */ CARD8 printReqType; /* always X_PrintQueryVersion */ CARD16 length B16;} xPrintQueryVersionReq;#define sz_xPrintQueryVersionReq 4typedef struct { BYTE type; /* X_Reply */ CARD8 unused; /* not used */ CARD16 sequenceNumber B16; CARD32 length B32; CARD16 majorVersion B16; /* major version of Xp protocol */ CARD16 minorVersion B16; /* minor version of Xp protocol */ CARD32 pad1 B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32;} xPrintQueryVersionReply;#define sz_xPrintQueryVersionReply 32typedef struct _PrintGetPrinterList { CARD8 reqType; /* always PrintReqCode */ CARD8 printReqType; /* always X_PrintGetPrinterList */ CARD16 length B16; CARD32 printerNameLen B32; /* length of printer name */ CARD32 localeLen B32; /* length of locale string */ /* variable portion ***************************************** STRING8 printerName; * printer name * BYTE pad(printerNameLen) * unused * STRING8 locale; * locale * BYTE pad(localeLen) * unused * ************************************************************/} xPrintGetPrinterListReq;#define sz_xPrintGetPrinterListReq 12typedef struct { BYTE type; /* X_Reply */ CARD8 unused; /* not used */ CARD16 sequenceNumber B16; CARD32 length B32; CARD32 listCount B32; /* of PRINTER recs below */ CARD32 pad1 B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; /* variable portion ***************************************** CARD32 nameLen B32; * length of name in bytes * STRING8 name; * name * BYTE pad(nameLen) * unused * CARD32 descLen B32; * length of desc in bytes * STRING8 desc; * localized description * BYTE pad(descLen) * unused * ************************************************************/} xPrintGetPrinterListReply;#define sz_xPrintGetPrinterListReply 32typedef struct _PrintRehashPrinterList { CARD8 reqType; /* always PrintReqCode */ CARD8 printReqType; /* always X_PrintRehashPrinterList */ CARD16 length B16;} xPrintRehashPrinterListReq;#define sz_xPrintRehashPrinterListReq 4typedef struct _PrintCreateContext { CARD8 reqType; /* always PrintReqCode */ CARD8 printReqType; /* always X_PrintInitSetContext */ CARD16 length B16; CARD32 contextID B32; /* ID for context */ CARD32 printerNameLen B32; /* length of printerName in bytes */ CARD32 localeLen B32; /* length of locale in bytes */ /* variable portion ***************************************** STRING8 printerName * printer name * BYTE pad(printerNameLen) * unused * STRING8 locale * locale * BYTE pad(locale) * unused * ************************************************************/} xPrintCreateContextReq; #define sz_xPrintCreateContextReq 16typedef struct _PrintSetContext { CARD8 reqType; /* always PrintReqCode */ CARD8 printReqType; /* always X_PrintSetContext */ CARD16 length B16; PCONTEXT printContext B32; /* print context */} xPrintSetContextReq; #define sz_xPrintSetContextReq 8typedef struct _PrintGetContext { CARD8 reqType; /* always PrintReqCode */ CARD8 printReqType; /* always X_PrintGetContext */ CARD16 length B16;} xPrintGetContextReq; #define sz_xPrintGetContextReq 4typedef struct { BYTE type; /* X_Reply */ CARD8 unused; /* not used */ CARD16 sequenceNumber B16; CARD32 length B32; PCONTEXT printContext B32; /* print context */ CARD32 pad1 B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32;} xPrintGetContextReply;#define sz_xPrintGetContextReply 32typedef struct _PrintDestroyContext { CARD8 reqType; /* always PrintReqCode */ CARD8 printReqType; /* always X_PrintDestroyContext */ CARD16 length B16; PCONTEXT printContext B32; /* print context */} xPrintDestroyContextReq; #define sz_xPrintDestroyContextReq 8typedef struct _PrintGetContextScreen { CARD8 reqType; /* always PrintReqCode */ CARD8 printReqType; /* always X_PrintGetContextScreen */ CARD16 length B16; PCONTEXT printContext B32; /* print context */} xPrintGetContextScreenReq; #define sz_xPrintGetContextScreenReq 8typedef struct { BYTE type; /* X_Reply */ CARD8 unused; /* not used */ CARD16 sequenceNumber B16; CARD32 length B32; WINDOW rootWindow; /* screenPtr represented as rootWin */ CARD32 pad1 B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32;} xPrintGetContextScreenReply;#define sz_xPrintGetContextScreenReply 32typedef struct _PrintStartJob { CARD8 reqType; /* always PrintReqCode */ CARD8 printReqType; /* always X_PrintStartJob */ CARD16 length B16; CARD8 saveData; /* save data boolean */ CARD8 pad1; CARD16 pad2 B16;} xPrintStartJobReq; #define sz_xPrintStartJobReq 8typedef struct _PrintEndJob { CARD8 reqType; /* always PrintReqCode */ CARD8 printReqType; /* always X_PrintEndJob */ CARD16 length B16; BOOL cancel; /* cancel boolean */ CARD8 pad1; CARD16 pad2 B16;} xPrintEndJobReq;#define sz_xPrintEndJobReq 8typedef struct _PrintStartDoc { CARD8 reqType; /* always PrintReqCode */ CARD8 printReqType; /* always X_PrintStartDoc */ CARD16 length B16; CARD8 type; /* type for document */ CARD8 pad1; CARD16 pad2 B16;} xPrintStartDocReq; #define sz_xPrintStartDocReq 8typedef struct _PrintEndDoc { CARD8 reqType; /* always PrintReqCode */ CARD8 printReqType; /* always X_PrintEndDoc */ CARD16 length B16; BOOL cancel; /* cancel boolean */ CARD8 pad1; CARD16 pad2 B16;} xPrintEndDocReq;#define sz_xPrintEndDocReq 8
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -