DTPRINTFILLSETUPDATA(3)
π DtPrintFillSetupData π
okay bestie, welcome to the DtPrintFillSetupData(library call) page β it's a library-call situation, and we're gonna get you all the way together. This one is about grabbing X printer connection information. no cap. π«Ά
πΈ NAME πΈ
DtPrintFillSetupData β obtains X printer connection information. π
β SYNOPSIS β
#include &<Print.h>
XtEnum DtPrintFillSetupData(
Widget wid,
DtPrintSetupData* print_data);
π DESCRIPTION π
The DtPrintFillSetupData function obtains an X printer connection so you can start an X printing job in situations that are not direct interaction with a DtPrintSetupBox. Examples include a "quick print" button on a toolbar and "GUI-less" printing. This X printer connection info can come from an existing DtPrintSetupBox widget instance, or β if you don't have one β DtPrintFillSetupData will provide a new X printer connection. π
A print job is typically initiated when the user selects the "Print" button from within a DtPrintSetupBox widget instance. Applications may wish to provide additional avenues for the user to initiate a print job, namely a "Quick Print" toolbar button, or a command line parameter to allow "GUI-less" printing, such as from within a desktop action. DtPrintFillSetupData is designed to provide an X printer connection in a manner consistent with DtPrintSetupBox. β¨
For both the "Quick Print" and "GUI-less" cases, the caller may set the printer_name element of the passed print_data in order to specify the destination X printer. DtPrintFillSetupData will treat the passed printer_name as if the user had typed the printer name into the Printer Name text field of the DtPrintSetupBox. The printer_name will be verified, and an X printer connection will be established. The returned printer_name may be a fully qualified version of the passed printer_name as a result of the printer verification process. For a description of this process, see the DtNverifyPrinterProc resource description in DtPrintSetupBox(3). If DtPrintFillSetupData returns a new printer_name, it will free the passed printer_name by calling XtFree. π¦
π the "Quick Print" button case π
For the "Quick Print" button case, DtPrintFillSetupData is intended to be used with an existing DtPrintSetupBox instance, so that the "Quick Print" button behaves as if the user had brought up a DtPrintSetupBox, selected a printer as indicated by printer_name, and activated the "Print" button. The following conditions apply to this case:
- The
widparameter should be set to the widget ID of theDtPrintSetupBoxinstance.DtPrintFillSetupDatawill fill the passedprint_datastructure similarly to howDtPrintSetupBoxfills out theprint_dataelement of theDtPrintSetupCallbackStructpassed as call data to theDtNprintCallbacklist. The only exception is that when usingDtPrintFillSetupDatait is the caller's responsibility to free the allocated memory locations pointed to by theprint_datastructure by callingDtPrintFreeSetupData. π«Ά - The X printer connection returned is managed by the
DtPrintSetupBox. The caller should not destroy the print context, nor close the print display connection. π ββοΈ - The
DtPrintSetupBoxwidget instance passed viawiddoes not have to have been managed prior to callingDtPrintFillSetupData. - If the passed
printer_nameisNULL, the current printer as indicated by theDtNprinterNameresource will be used, and returned inprinter_name. If the passedprinter_nameis a different printer than indicated by the current value of theDtNprinterNameresource, the resource will be updated. π - The
destinationanddest_infoelements of the passedprint_datawill be set according to the current state of the passedDtPrintSetupBox. Ifdest_infois set when passed toDtPrintFillSetupData,DtPrintFillSetupDatawill free the memory by callingXtFreeif it decides to updatedest_info. - If a connection cannot be established, the
DtPrintSetupBoxwill automatically be managed, displaying an error message box. After dismissing the message box, the user can select a new printer and restart the print operation, if desired. π
π the "GUI-less" case π
For the "GUI-less" case, DtPrintFillSetupData is intended to provide an X printer connection, in a manner consistent with an X printer connection established by DtPrintSetupBox, without actually creating a DtPrintSetupBox. The following conditions apply to this case:
- The passed
widmust be set toNULL. - The X printer connection returned is managed by the caller, which means that the caller must destroy the print context (via
XpDestroyContext) and close the print display connection (viaXCloseDisplay). π - If
printer_nameis set toNULL,DtPrintFillSetupDatawill determine a default printer, using the same procedure asDtPrintSetupBox, and set theprinter_namefield to this default printer name upon return. - The
destinationanddest_infoelements of the passedprint_datastructure will be ignored byDtPrintFillSetupData. - The caller can free the allocated memory locations pointed to by the returned
print_datastructure by callingDtPrintFreeSetupData. π
π§ ARGUMENTS π§
widβ The widget ID of aDtPrintSetupBoxorNULL, if noDtPrintSetupBoxis available.print_dataβ A pointer to an existingDtPrintSetupDatastructure thatDtPrintFillSetupDatawill update with valid X printer connection information. SeeDtPrintSetupBox(3)for the definition of theDtPrintSetupDatastructure.
π₯ RETURN VALUE π₯
DtPRINT_SUCCESSβ The X printer connection was successfully obtained. slay. β¨DtPRINT_INVALID_DISPLAYβ The indicated X print server could not be found. πDtPRINT_NOT_XP_DISPLAYβ The indicated X server does not support the X Printing Extension.DtPRINT_NO_PRINTERβ The indicated printer could not be found on the X print server, or a default printer could not be determined.DtPRINT_BAD_PARMβ The value passed forprint_dataisNULL, or the value of theDtNprintSetupModeresource forwidis notDtPRINT_SETUP_XP.
πΌ ENVIRONMENT VARIABLES πΌ
None. literally none. π
π RESOURCES π
None. π
π ACTIONS/MESSAGES π
None. π¦
πΈ ERRORS/WARNINGS πΈ
None. π
β EXAMPLES β
None. no example era, bestie. π
π FILES π
None. π
π«Ά SEE ALSO π«Ά
DtPrintCopySetupData(3), DtPrintSetupBox(3), DtPrintFreeSetupData(3)
that's the whole page, bestie β footer vibes: DtPrintFillSetupData(library call), and the original doesn't show a date stamp. π
π¦ where this page comes from
- nixos 26.05: cde 2.5.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms