XpStartDoc(3Xp)

🌸 NAME 🌸

XpStartDoc β€” indicates the beginning of a print document. that’s the whole name section, bestie, short and iconic πŸ’…

this page is XpStartDoc(3Xp) from the XPRINT FUNCTIONS manual, so we’re folding the header in up top instead of copying it like a robot 🫢


✨ SYNOPSIS ✨

the whole call looks like this, no cap:

             cc [ flag... ] file... -lXp [ library... ]
             #include <X11/extensions/Print.h>

       void XpStartDoc ( display, type )
             Display *display;
             XPDocumentType type;

πŸ’¬ ARGUMENTS πŸ’¬

  • display β€” specifies a pointer to the Display structure; returned from XOpenDisplay. yes, that Display structure, the one from XOpenDisplay 🌟
  • type β€” specifies the type of document. it can be either XPDocRaw or XPDocNormal πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

XpStartDoc signals the beginning of a new print document. periodt.

if type is XPDocRaw, then the client will provide all the data for the resulting document using XpPutDocumentData; the X Print Server will not write any data into the resulting document. calling XpStartPage in a XPDocRaw document will generate an XPBadSequence error. for more information, see XpPutDocumentData. okay so raw mode means the client is fully in charge of the data, and the server is not adding its own data into the resulting document, bestie 😌

if type is XPDocNormal, then the X Print Server will generate document data, and depending on the DDX driver, can incorporate additional data from XpPutDocumentData into the output. for more information, see XpPutDocumentData. so normal mode lets the server generate stuff and maybe mix in extra data depending on the DDX driver, iykyk πŸŽ€

all changes to the XPDocAttr attribute pool (see XpSetAttributes) must be made prior to calling XpStartDoc, after which an XPBadSequence will be generated if changes are attempted, until XpEndDoc is called. so lock in those XPDocAttr changes before XpStartDoc, or the sequence is gonna be mad at you 😭

the application is not required to call XpStartDoc and XpEndDoc in the process of printing. the "document" delineation may not be useful from the application's or spooler's perspective, hence is optional. it’s giving β€œoptional era” πŸ’…

if XpStartPage is called immediately after XpStartJob then a synthetic XpStartDoc with XPDocNormal will be assumed by the X Print Server prior to XpStartPage (i.e. the XPStartDocNotify and XPStartPageNotify events will have the same sequence number). likewise, if XpEndJob is called immediately after XpEndPage then a synthetic XpEndDoc will be assumed by the X Print Server prior to XpEndJob (i.e., the XPEndDocNotify and XPEndJobNotify events will have the same sequence number). so yes, the server can quietly assume a synthetic doc when you skip the explicit calls β€” and the sequence numbers will match up like besties matching outfits 🌈

for clients selecting XPPrintMask (see XpSelectInput), the event XPPrintNotify will be generated with its detail field set to XPStartDocNotify. that’s the event heads-up, okay? πŸ‘‘


🧚 STRUCTURES 🧚

the XPDocumentType values are defined in <X11/extensions/Print.h>:

           #define   XPDocNormal     1     /βˆ— Doc data handled by Xserver*/
           #define   XPDocRaw        2     /βˆ— Doc data passed through Xserver*/

πŸ’€ DIAGNOSTICS πŸ’€

  • XPBadContext β€” a valid print context-id has not been set prior to making this call. not me forgetting the context-id πŸ™ˆ
  • XPBadSequence β€” the function was not called in the proper order with respect to the other X Print Service Extension calls (example, XpEndDoc prior to XpStartDoc). sequence matters, bestie, always 😭
  • BadValue β€” the value specified for type is not valid. that type did not pass the vibe check πŸ’€

πŸ“ FILES πŸ“

  • <X11/extensions/Print.h>

πŸ”₯ SEE ALSO πŸ”₯

  • XpEndDoc(3Xp)
  • XpEndJob(3Xp)
  • XpEndPage(3Xp)
  • XpPutDocumentData(3Xp)
  • XpSelectInput(3Xp)
  • XpSetAttributes(3Xp)
  • XpStartJob(3Xp)
  • XpStartPage(3Xp)

that’s the page, bestie 🫢 this icon is from X Version 11, libXp 1.0.4, and the footer didn’t give us a date, so we’re just gonna vibe with that 🌸✨ XpStartDoc(3Xp) out πŸ’…

πŸ“¦ where this page comes from