1/* $Xorg: Printstr.h,v 1.3 2000/08/18 04:05:44 coskrey Exp $ */ 2/****************************************************************************** 3 ****************************************************************************** 4 ** 5 ** File: Printstr.h 6 ** 7 ** Description: Definitions needed by the server and library, but 8 ** not clients. 9 ** 10 ** Print.h for server, library and clients. 11 ** 12 ****************************************************************************** 13 ** 14 ** (c) Copyright 1996 Hewlett-Packard Company 15 ** (c) Copyright 1996 International Business Machines Corp. 16 ** (c) Copyright 1996, Oracle and/or its affiliates. 17 ** (c) Copyright 1996 Novell, Inc. 18 ** (c) Copyright 1996 Digital Equipment Corp. 19 ** (c) Copyright 1996 Fujitsu Limited 20 ** (c) Copyright 1996 Hitachi, Ltd. 21 ** 22 ** Permission is hereby granted, free of charge, to any person obtaining a copy 23 ** of this software and associated documentation files (the "Software"), to deal 24 ** in the Software without restriction, including without limitation the rights 25 ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 26 ** copies of the Software, and to permit persons to whom the Software is 27 ** furnished to do so, subject to the following conditions: 28 ** 29 ** The above copyright notice and this permission notice shall be included in 30 ** all copies or substantial portions of the Software. 31 ** 32 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 ** COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 36 ** IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 37 ** CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 38 ** 39 ** Except as contained in this notice, the names of the copyright holders shall 40 ** not be used in advertising or otherwise to promote the sale, use or other 41 ** dealings in this Software without prior written authorization from said 42 ** copyright holders. 43 ** 44 ****************************************************************************** 45 *****************************************************************************/ 46/* $XFree86: xc/include/extensions/Printstr.h,v 1.5 2001/08/01 00:44:35 tsi Exp $ */ 47 48 49#ifndef _XpPrintstr_H_ 50#define _XpPrintstr_H_ 51 52/* 53 * NEED_EVENTS and NEED_REPLIES are hacks to limit the linker symbol-table 54 * size. When function prototypes are needed from Print.h, this sets up 55 * a cascading dependency on Printstr.h and eventually Xproto.h to provide 56 * the event and reply struct definitions. 57 */ 58#ifndef NEED_EVENTS 59#define NEED_EVENTS 60#endif /* NEED_EVENTS */ 61 62#define NEED_REPLIES 63 64#include <X11/Xproto.h> 65#ifndef _XP_PRINT_SERVER_ 66#include <X11/Xlib.h> 67#endif /* _XP_PRINT_SERVER_ */ 68 69/* 70 * Pull in other definitions. Print.h will hide some things if we're 71 * doing server side work. 72 */ 73#include <X11/extensions/Print.h> 74 75#include <X11/Xfuncproto.h> 76 77_XFUNCPROTOBEGIN 78 79/****************************************************************************** 80 * 81 * Protocol requests constants and alignment values 82 * 83 * Note: Xlib macro's expect X_ABC where ABC is the name of the 84 * protocol request. 85 */ 86#define X_PrintQueryVersion 0 87#define X_PrintGetPrinterList 1 88#define X_PrintCreateContext 2 89#define X_PrintSetContext 3 90#define X_PrintGetContext 4 91#define X_PrintDestroyContext 5 92#define X_PrintGetContextScreen 6 93#define X_PrintStartJob 7 94#define X_PrintEndJob 8 95#define X_PrintStartDoc 9 96#define X_PrintEndDoc 10 97#define X_PrintPutDocumentData 11 98#define X_PrintGetDocumentData 12 99#define X_PrintStartPage 13 100#define X_PrintEndPage 14 101#define X_PrintSelectInput 15 102#define X_PrintInputSelected 16 103#define X_PrintGetAttributes 17 104#define X_PrintSetAttributes 18 105#define X_PrintGetOneAttribute 19 106#define X_PrintRehashPrinterList 20 107#define X_PrintGetPageDimensions 21 108#define X_PrintQueryScreens 22 109#define X_PrintSetImageResolution 23 110#define X_PrintGetImageResolution 24 111 112/******************************************************************** 113 * 114 * Protocol data types 115 */ 116#define PCONTEXT CARD32 117#define WINDOW CARD32 118#define DRAWABLE CARD32 119#define BITMASK CARD32 120 121/****************************************************************************** 122 * 123 * Event wire struct definitions 124 * 125 * Note: Xlib macro's expect xABC struct names and sz_xABC size 126 * constants where ABC is the name of the protocol request. 127 */ 128 129 130/********************************************************************* 131 * 132 * Events. 133 * 134 * See Print.h for the protocol "type" values. 135 */ 136typedef struct _xPrintPrintEvent { 137 BYTE type; /* XPPrintNotify + extEntry->eventBase */ 138 BYTE detail; /* XPStartJobNotify, XPEndJobNotify, 139 XPStartDocNotify, XPEndDocNotify, 140 XPStartPageNotify, XPEndPageNotify */ 141 CARD16 sequenceNumber; 142 PCONTEXT printContext; /* print context */ 143 BOOL cancel; /* canceled flag */ 144 CARD8 pad1; /* rest is unused */ 145 CARD16 pad2; 146 CARD32 pad3; 147 CARD32 pad4; 148 CARD32 pad5; 149 CARD32 pad6; 150 CARD32 pad7; 151} xPrintPrintEvent; 152#define sz_xPrintPrintEvent 32; 153 154typedef struct _xPrintAttributeEvent { 155 BYTE type; /* XPAttributeNotify + extEntry->eventBase */ 156 BYTE detail; /* XPJobAttr, XPDocAttr, XPPageAttr, 157 XPPrinterAttr, XPSpoolerAttr, 158 XPMediumAttr, XPServerAttr */ 159 CARD16 sequenceNumber; 160 PCONTEXT printContext; /* print context */ 161 CARD32 pad1; 162 CARD32 pad2; 163 CARD32 pad3; 164 CARD32 pad4; 165 CARD32 pad5; 166 CARD32 pad6; 167} xPrintAttributeEvent; 168#define sz_xPrintAttributeEvent 32; 169 170 171/********************************************************************* 172 * 173 * Requests 174 */ 175typedef struct _PrintQueryVersion { 176 CARD8 reqType; /* always PrintReqCode */ 177 CARD8 printReqType; /* always X_PrintQueryVersion */ 178 CARD16 length; 179} xPrintQueryVersionReq; 180#define sz_xPrintQueryVersionReq 4 181 182typedef struct { 183 BYTE type; /* X_Reply */ 184 CARD8 unused; /* not used */ 185 CARD16 sequenceNumber; 186 CARD32 length; 187 CARD16 majorVersion; /* major version of Xp protocol */ 188 CARD16 minorVersion; /* minor version of Xp protocol */ 189 CARD32 pad1; 190 CARD32 pad2; 191 CARD32 pad3; 192 CARD32 pad4; 193 CARD32 pad5; 194} xPrintQueryVersionReply; 195#define sz_xPrintQueryVersionReply 32 196 197 198typedef struct _PrintGetPrinterList { 199 CARD8 reqType; /* always PrintReqCode */ 200 CARD8 printReqType; /* always X_PrintGetPrinterList */ 201 CARD16 length; 202 CARD32 printerNameLen; /* length of printer name */ 203 CARD32 localeLen; /* length of locale string */ 204 205 /* variable portion ***************************************** 206 STRING8 printerName; * printer name * 207 BYTE pad(printerNameLen) * unused * 208 STRING8 locale; * locale * 209 BYTE pad(localeLen) * unused * 210 ************************************************************/ 211} xPrintGetPrinterListReq; 212#define sz_xPrintGetPrinterListReq 12 213 214typedef struct { 215 BYTE type; /* X_Reply */ 216 CARD8 unused; /* not used */ 217 CARD16 sequenceNumber; 218 CARD32 length; 219 CARD32 listCount; /* of PRINTER recs below */ 220 CARD32 pad1; 221 CARD32 pad2; 222 CARD32 pad3; 223 CARD32 pad4; 224 CARD32 pad5; 225 226 /* variable portion ***************************************** 227 CARD32 nameLen; * length of name in bytes * 228 STRING8 name; * name * 229 BYTE pad(nameLen) * unused * 230 231 CARD32 descLen; * length of desc in bytes * 232 STRING8 desc; * localized description * 233 BYTE pad(descLen) * unused * 234 ************************************************************/ 235} xPrintGetPrinterListReply; 236#define sz_xPrintGetPrinterListReply 32 237 238 239typedef struct _PrintRehashPrinterList { 240 CARD8 reqType; /* always PrintReqCode */ 241 CARD8 printReqType; /* always X_PrintRehashPrinterList */ 242 CARD16 length; 243} xPrintRehashPrinterListReq; 244#define sz_xPrintRehashPrinterListReq 4 245 246 247typedef struct _PrintCreateContext { 248 CARD8 reqType; /* always PrintReqCode */ 249 CARD8 printReqType; /* always X_PrintInitSetContext */ 250 CARD16 length; 251 CARD32 contextID; /* ID for context */ 252 CARD32 printerNameLen; /* length of printerName in bytes */ 253 CARD32 localeLen; /* length of locale in bytes */ 254 255 /* variable portion ***************************************** 256 STRING8 printerName * printer name * 257 BYTE pad(printerNameLen) * unused * 258 STRING8 locale * locale * 259 BYTE pad(locale) * unused * 260 ************************************************************/ 261} xPrintCreateContextReq; 262#define sz_xPrintCreateContextReq 16 263 264 265typedef struct _PrintSetContext { 266 CARD8 reqType; /* always PrintReqCode */ 267 CARD8 printReqType; /* always X_PrintSetContext */ 268 CARD16 length; 269 PCONTEXT printContext; /* print context */ 270} xPrintSetContextReq; 271#define sz_xPrintSetContextReq 8 272 273 274typedef struct _PrintGetContext { 275 CARD8 reqType; /* always PrintReqCode */ 276 CARD8 printReqType; /* always X_PrintGetContext */ 277 CARD16 length; 278} xPrintGetContextReq; 279#define sz_xPrintGetContextReq 4 280 281typedef struct { 282 BYTE type; /* X_Reply */ 283 CARD8 unused; /* not used */ 284 CARD16 sequenceNumber; 285 CARD32 length; 286 PCONTEXT printContext; /* print context */ 287 CARD32 pad1; 288 CARD32 pad2; 289 CARD32 pad3; 290 CARD32 pad4; 291 CARD32 pad5; 292} xPrintGetContextReply; 293#define sz_xPrintGetContextReply 32 294 295 296typedef struct _PrintDestroyContext { 297 CARD8 reqType; /* always PrintReqCode */ 298 CARD8 printReqType; /* always X_PrintDestroyContext */ 299 CARD16 length; 300 PCONTEXT printContext; /* print context */ 301} xPrintDestroyContextReq; 302#define sz_xPrintDestroyContextReq 8 303 304 305typedef struct _PrintGetContextScreen { 306 CARD8 reqType; /* always PrintReqCode */ 307 CARD8 printReqType; /* always X_PrintGetContextScreen */ 308 CARD16 length; 309 PCONTEXT printContext; /* print context */ 310} xPrintGetContextScreenReq; 311#define sz_xPrintGetContextScreenReq 8 312 313typedef struct { 314 BYTE type; /* X_Reply */ 315 CARD8 unused; /* not used */ 316 CARD16 sequenceNumber; 317 CARD32 length; 318 WINDOW rootWindow; /* screenPtr represented as rootWin */ 319 CARD32 pad1; 320 CARD32 pad2; 321 CARD32 pad3; 322 CARD32 pad4; 323 CARD32 pad5; 324} xPrintGetContextScreenReply; 325#define sz_xPrintGetContextScreenReply 32 326 327 328typedef struct _PrintStartJob { 329 CARD8 reqType; /* always PrintReqCode */ 330 CARD8 printReqType; /* always X_PrintStartJob */ 331 CARD16 length; 332 CARD8 saveData; /* save data boolean */ 333 CARD8 pad1; 334 CARD16 pad2; 335} xPrintStartJobReq; 336#define sz_xPrintStartJobReq 8 337 338typedef struct _PrintEndJob { 339 CARD8 reqType; /* always PrintReqCode */ 340 CARD8 printReqType; /* always X_PrintEndJob */ 341 CARD16 length; 342 BOOL cancel; /* cancel boolean */ 343 CARD8 pad1; 344 CARD16 pad2; 345} xPrintEndJobReq; 346#define sz_xPrintEndJobReq 8 347 348 349typedef struct _PrintStartDoc { 350 CARD8 reqType; /* always PrintReqCode */ 351 CARD8 printReqType; /* always X_PrintStartDoc */ 352 CARD16 length; 353 CARD8 type; /* type for document */ 354 CARD8 pad1; 355 CARD16 pad2; 356} xPrintStartDocReq; 357#define sz_xPrintStartDocReq 8 358 359typedef struct _PrintEndDoc { 360 CARD8 reqType; /* always PrintReqCode */ 361 CARD8 printReqType; /* always X_PrintEndDoc */ 362 CARD16 length; 363 BOOL cancel; /* cancel boolean */ 364 CARD8 pad1; 365 CARD16 pad2; 366} xPrintEndDocReq; 367#define sz_xPrintEndDocReq 8 368 369 370typedef struct _PrintPutDocumentData { 371 CARD8 reqType; /* always PrintReqCode */ 372 CARD8 printReqType; /* always X_PrintPutDocumentData */ 373 CARD16 length; 374 DRAWABLE drawable; /* target drawable */ 375 CARD32 len_data; /* big len in bytes */ 376 CARD16 len_fmt; /* len in bytes */ 377 CARD16 len_options; /* len in bytes */ 378 379 /* variable portion ***************************************** 380 LISTofBYTE data; * data * 381 BYTE pad(len_data) * unused * 382 STRING8 doc_fmt; * ISO compliant desc of data type * 383 BYTE pad(len_fmt) * unused * 384 STRING8 options; * additional device-dependent desc * 385 BYTE pad(len_options) * unused * 386 ************************************************************/ 387} xPrintPutDocumentDataReq; 388#define sz_xPrintPutDocumentDataReq 16 389 390 391typedef struct _PrintGetDocumentData { 392 CARD8 reqType; /* always PrintReqCode */ 393 CARD8 printReqType; /* always X_PrintGetDocumentData */ 394 CARD16 length; 395 PCONTEXT printContext; /* print context */ 396 CARD32 maxBufferSize; /* maximum buffer size requested */ 397} xPrintGetDocumentDataReq; 398#define sz_xPrintGetDocumentDataReq 12 399 400typedef struct { 401 BYTE type; /* X_Reply */ 402 CARD8 unused; /* not used */ 403 CARD16 sequenceNumber; 404 CARD32 length; 405 CARD32 statusCode; /* status code for reply */ 406 CARD32 finishedFlag; /* is this the last reply */ 407 CARD32 dataLen; /* data length */ 408 CARD32 pad1; 409 CARD32 pad2; 410 CARD32 pad3; 411 412 /* variable portion ***************************************** 413 LISTofBYTE data; * data * 414 BYTE pad(count) * unused * 415 ************************************************************/ 416} xPrintGetDocumentDataReply; 417#define sz_xPrintGetDocumentDataReply 32 418 419 420typedef struct _PrintStartPage { 421 CARD8 reqType; /* always PrintReqCode */ 422 CARD8 printReqType; /* always X_PrintStartPage */ 423 CARD16 length; 424 WINDOW window; /* window */ 425} xPrintStartPageReq; 426#define sz_xPrintStartPageReq 8 427 428typedef struct _PrintEndPage { 429 CARD8 reqType; /* always PrintReqCode */ 430 CARD8 printReqType; /* always X_PrintEndPage */ 431 CARD16 length; 432 BOOL cancel; /* cancel boolean */ 433 CARD8 pad1; 434 CARD16 pad2; 435} xPrintEndPageReq; 436#define sz_xPrintEndPageReq 8 437 438 439typedef struct _PrintSelectInput { 440 CARD8 reqType; /* always PrintReqCode */ 441 CARD8 printReqType; /* always X_PrintSelectInput */ 442 CARD16 length; 443 PCONTEXT printContext; /* print context */ 444 BITMASK eventMask; 445} xPrintSelectInputReq; 446#define sz_xPrintSelectInputReq 12 447 448 449typedef struct _PrintInputSelected { 450 CARD8 reqType; /* always PrintReqCode */ 451 CARD8 printReqType; /* always X_PrintInputSelected */ 452 CARD16 length; 453 PCONTEXT printContext; /* print context */ 454} xPrintInputSelectedReq; 455#define sz_xPrintInputSelectedReq 8 456 457typedef struct { 458 BYTE type; /* X_Reply */ 459 CARD8 unused; /* not used */ 460 CARD16 sequenceNumber; 461 CARD32 length; 462 BITMASK eventMask; /* your event mask */ 463 BITMASK allEventsMask; /* all event mask */ 464 CARD32 pad1; 465 CARD32 pad2; 466 CARD32 pad3; 467 CARD32 pad4; 468} xPrintInputSelectedReply; 469#define sz_xPrintInputSelectedReply 32 470 471typedef struct _PrintGetAttributes { 472 CARD8 reqType; /* always PrintReqCode */ 473 CARD8 printReqType; /* always X_PrintGetAttributes */ 474 CARD16 length; 475 PCONTEXT printContext; /* print context */ 476 CARD8 type; /* type */ 477 CARD8 pad1; /* unused */ 478 CARD16 pad2; /* unused */ 479} xPrintGetAttributesReq; 480#define sz_xPrintGetAttributesReq 12 481 482typedef struct { 483 BYTE type; /* X_Reply */ 484 CARD8 unused; /* not used */ 485 CARD16 sequenceNumber; 486 CARD32 length; 487 CARD32 stringLen; /* length of xrm db string */ 488 CARD32 pad1; 489 CARD32 pad2; 490 CARD32 pad3; 491 CARD32 pad4; 492 CARD32 pad5; 493 494 /* variable portion ***************************************** 495 STRING8 string; * xrm db as a string * 496 BYTE pad(stringLen) * unused * 497 ************************************************************/ 498} xPrintGetAttributesReply; 499#define sz_xPrintGetAttributesReply 32 500 501 502typedef struct _PrintSetAttributes { 503 CARD8 reqType; /* always PrintReqCode */ 504 CARD8 printReqType; /* always X_PrintSetAttributes */ 505 CARD16 length; 506 PCONTEXT printContext; /* print context */ 507 CARD32 stringLen; /* length of xrm db string */ 508 CARD8 type; /* type */ 509 CARD8 rule; /* replacement rule */ 510 CARD16 pad1; /* unused */ 511 512 /* variable portion ***************************************** 513 STRING8 string; * xrm db as a string * 514 BYTE pad(stringLen) * unused * 515 ************************************************************/ 516} xPrintSetAttributesReq; 517#define sz_xPrintSetAttributesReq 16 518 519 520typedef struct _PrintGetOneAttribute { 521 CARD8 reqType; /* always PrintReqCode */ 522 CARD8 printReqType; /* always X_PrintGetOneAttribute */ 523 CARD16 length; 524 PCONTEXT printContext; /* print context */ 525 CARD32 nameLen; /* length of name string */ 526 CARD8 type; /* type */ 527 CARD8 pad1; /* unused */ 528 CARD16 pad2; /* unused */ 529 530 /* variable portion ***************************************** 531 STRING8 name; * name as a string * 532 BYTE pad(name) * unused * 533 ************************************************************/ 534} xPrintGetOneAttributeReq; 535#define sz_xPrintGetOneAttributeReq 16 536 537typedef struct { 538 BYTE type; /* X_Reply */ 539 CARD8 unused; /* not used */ 540 CARD16 sequenceNumber; 541 CARD32 length; 542 CARD32 valueLen; /* length of value string */ 543 CARD32 pad1; 544 CARD32 pad2; 545 CARD32 pad3; 546 CARD32 pad4; 547 CARD32 pad5; 548 549 /* variable portion ***************************************** 550 STRING8 value; * value as a string * 551 BYTE pad(value) * unused * 552 ************************************************************/ 553} xPrintGetOneAttributeReply; 554#define sz_xPrintGetOneAttributeReply 32 555 556 557typedef struct _PrintGetPageDimensions { 558 CARD8 reqType; /* always PrintReqCode */ 559 CARD8 printReqType; /* always X_PrintGetPageDimensions */ 560 CARD16 length; 561 PCONTEXT printContext; /* print context */ 562} xPrintGetPageDimensionsReq; 563#define sz_xPrintGetPageDimensionsReq 8 564 565typedef struct { 566 BYTE type; /* X_Reply */ 567 CARD8 unused; /* not used */ 568 CARD16 sequenceNumber; 569 CARD32 length; 570 CARD16 width; /* total pixel width */ 571 CARD16 height; /* total pixel height */ 572 CARD16 rx; /* reproducible x pixel offset */ 573 CARD16 ry; /* reproducible y pixel offset */ 574 CARD16 rwidth; /* reproducible x pixel width */ 575 CARD16 rheight; /* reproducible y pixel width */ 576 CARD32 pad1; 577 CARD32 pad2; 578 CARD32 pad3; 579} xPrintGetPageDimensionsReply; 580#define sz_xPrintGetPageDimensionsReply 32 581 582 583typedef struct _PrintQueryScreens { 584 CARD8 reqType; /* always PrintReqCode */ 585 CARD8 printReqType; /* always X_PrintQueryScreens */ 586 CARD16 length; 587} xPrintQueryScreensReq; 588#define sz_xPrintQueryScreensReq 4 589 590typedef struct { 591 BYTE type; /* X_Reply */ 592 CARD8 unused; /* not used */ 593 CARD16 sequenceNumber; 594 CARD32 length; 595 CARD32 listCount; /* number of screens following */ 596 CARD32 pad1; 597 CARD32 pad2; 598 CARD32 pad3; 599 CARD32 pad4; 600 CARD32 pad5; 601 602 /* variable portion ***************************************** 603 WINDOW rootWindow; * root window of screen * 604 ************************************************************/ 605} xPrintQueryScreensReply; 606#define sz_xPrintQueryScreensReply 32 607 608typedef struct _PrintSetImageResolution { 609 CARD8 reqType; /* always PrintReqCode */ 610 CARD8 printReqType; /* always X_PrintSetImageResolution */ 611 CARD16 length; 612 PCONTEXT printContext; /* print context */ 613 CARD16 imageRes; /* image resolution */ 614 CARD16 pad1; 615} xPrintSetImageResolutionReq; 616#define sz_xPrintSetImageResolutionReq 12 617 618typedef struct { 619 BYTE type; /* X_Reply */ 620 BOOL status; /* accepted or not */ 621 CARD16 sequenceNumber; 622 CARD32 length; 623 CARD16 prevRes; /* previous resolution */ 624 CARD16 pad1; 625 CARD32 pad2; 626 CARD32 pad3; 627 CARD32 pad4; 628 CARD32 pad5; 629 CARD32 pad6; 630} xPrintSetImageResolutionReply; 631#define sz_xPrintSetImageResolutionReply 32 632 633typedef struct _PrintGetImageResolution { 634 CARD8 reqType; /* always PrintReqCode */ 635 CARD8 printReqType; /* always X_PrintGetImageResolution */ 636 CARD16 length; 637 PCONTEXT printContext; /* print context */ 638} xPrintGetImageResolutionReq; 639#define sz_xPrintGetImageResolutionReq 8 640 641typedef struct { 642 BYTE type; /* X_Reply */ 643 CARD8 unused; 644 CARD16 sequenceNumber; 645 CARD32 length; 646 CARD16 imageRes; /* image resolution */ 647 CARD16 pad1; 648 CARD32 pad2; 649 CARD32 pad3; 650 CARD32 pad4; 651 CARD32 pad5; 652 CARD32 pad6; 653} xPrintGetImageResolutionReply; 654#define sz_xPrintGetImageResolutionReply 32 655 656#ifndef _XP_PRINT_SERVER_ 657/*********************************************************************** 658 * 659 * Library-only definitions. 660 */ 661extern XPHinterProc _xp_hinter_proc; 662extern char *_xp_hinter_desc; 663extern int _xp_hinter_init; 664 665#else /* _XP_PRINT_SERVER_ */ 666 667/*********************************************************************** 668 * 669 * Server-only definitions shared between the extension and DDX layers. 670 * 671 */ 672 673/* 674 * Internal return code used to indicate that the requesting 675 * client has been suspended. 676 */ 677#define Suspended 84 678 679struct _XpContext; 680 681extern void XpRegisterPrinterScreen( 682 ScreenPtr pScreen, 683 int (*CreateContext)(struct _XpContext *)); 684 685typedef struct _xpprintFuncs { 686 int (*StartJob)( 687 struct _XpContext * /* pContext */, 688 Bool /* sendClientData */, 689 ClientPtr /* client */); 690 int (*EndJob)(struct _XpContext *, int); 691 int (*StartDoc)( 692 struct _XpContext * /* pContext */, 693 XPDocumentType /* type */); 694 int (*EndDoc)(struct _XpContext *, int); 695 int (*StartPage)( 696 struct _XpContext * /* pContext */, 697 WindowPtr /* pWin */); 698 int (*EndPage)( 699 struct _XpContext * /* pContext */, 700 WindowPtr /* pWin */); 701 int (*PutDocumentData)( 702 struct _XpContext * /* pContext */, 703 DrawablePtr /* pDraw */, 704 char * /* pData */, 705 int /* len_data */, 706 char * /* pDoc_fmt */, 707 int /* len_fmt */, 708 char * /* pOptions */, 709 int /* len_options */, 710 ClientPtr /* client */); 711 int (*GetDocumentData)( 712 struct _XpContext * /* pContext */, 713 ClientPtr /* client */, 714 int /* maxBufferSize */); 715 int (*DestroyContext)( 716 struct _XpContext *); /* pContext */ 717 char *(*GetAttributes)( 718 struct _XpContext *, 719 XPAttributes /* pool */); 720 char *(*GetOneAttribute)( 721 struct _XpContext * /* pContext */, 722 XPAttributes /* pool */, 723 char * /* attrs */); 724 int (*SetAttributes)( 725 struct _XpContext * /* pContext */, 726 XPAttributes /* pool */, 727 char * /* attrs */); 728 int (*AugmentAttributes)( 729 struct _XpContext * /* pContext */, 730 XPAttributes /* pool */, 731 char * /* attrs */); 732 int (*GetMediumDimensions)( 733 struct _XpContext * /* pPrintContext */, 734 CARD16 * /* pWidth */, 735 CARD16 * /* pHeight */); 736 int (*GetReproducibleArea)( 737 struct _XpContext * /* pPrintContext */, 738 xRectangle * /* pRect */); 739 int (*SetImageResolution)( 740 struct _XpContext * /* pPrintContext */, 741 int /* imageRes */, 742 Bool * /* pStatus */); 743} XpDriverFuncs, *XpDriverFuncsPtr; 744 745/* 746 * Each print context is represented by one of the following structs 747 * associated with a resource ID of type RTcontext . A pointer to 748 * the context is placed in the Xp extension's devPrivates 749 * element in each client * which establishes a context via 750 * either initContext or setContext. 751 * The context pointer is also placed in the struct indicated by the 752 * RTpage resource associated with each StartPage'd window. 753 */ 754typedef struct _XpContext { 755 XID contextID; 756 char *printerName; 757 int screenNum; /* screen containing the printer */ 758 struct _XpClient *clientHead; /* list of clients */ 759 CARD32 state; 760 VisualID pageWin; 761 PrivateRec *devPrivates; 762 XpDriverFuncs funcs; 763 ClientPtr clientSlept; 764 int imageRes; 765} XpContextRec, *XpContextPtr; 766 767#include <X11/fonts/fontstruct.h> /* FontResolutionPtr */ 768 769extern FontResolutionPtr XpGetClientResolutions(ClientPtr, int *); 770extern XpContextPtr XpContextOfClient(ClientPtr); 771extern XpContextPtr XpGetPrintContext(ClientPtr); 772extern int XpRehashPrinterList(void); 773extern void XpSetFontResFunc(ClientPtr); 774extern void XpUnsetFontResFunc(ClientPtr); 775extern void XpRegisterInitFunc(ScreenPtr, char *, int (*)(struct _XpContext *)); 776 777#endif /* _XP_PRINT_SERVER_ */ 778 779_XFUNCPROTOEND 780 781#endif /* _XpPrintstr_H_ */ 782