*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->HP-UX 11i man pages -> XmPrintToFile (3)              


 XmPrintToFile(library call)                     XmPrintToFile(library call)

 NAME    [Toc]    [Back]
      XmPrintToFile - Retrieves and saves data that would normally be
      printed by the X Print Server.

 SYNOPSIS    [Toc]    [Back]
      #include <Xm/Print.h>

 DESCRIPTION    [Toc]    [Back]
      XmPrintToFile hides the details of X display connection and
      XpGetDocumentData to the Motif application programmer.

      This function is a convenience routine that hides the details of the X
      and Xp internals to the application programmer by calling the
      XpGetDocumentData function with appropriate save and finish callbacks.

      This is used in the context of X Printing when the user has specified
      the "print-to-file" option from a regular Print Setup Dialog box.

      XmPrintToFile first tries to open the given filename for writing and
      returns False if it can't.  Else, it uses XpGetDocumentData, giving it
      a save proc that writes the data received in the file and a finish
      proc that closes the file or removes it on an unsuccessful
      termination.  It calls finish_proc at that point, passing it the
      argument received from the Xp layer (status == XPGetDocFinished means
      the file is valid and was closed, otherwise the file was removed).

      XmPrintToFile is non-blocking; if it returns successfully, it just
      means the file was opened successfully, not that all the data was

      dpy       Print display connection.

      filename  Name of the file to put the print data in.

                Called when all the data has been received.

                Passed with the finish_proc.

 RETURN VALUE    [Toc]    [Back]
      Returns False if the filename could not be created or opened for
      writing, True otherwise.


                                    - 1 -       Formatted:  January 24, 2005

 XmPrintToFile(library call)                     XmPrintToFile(library call)

      Not applicable

 EXAMPLES    [Toc]    [Back]
      A typical OK callback from a DtPrintSetupBox:

      {   int save_data = XPSpool;

          pshell = XmPrintSetup (widget, pbs->print_screen,
                                         "Print", NULL, 0);

          XtAddCallback(pshell, XmNstartJobCallback, startJobCB, data);

          if (pbs->destination == DtPRINT_TO_FILE)
                       save_data = XPGetData;

          /* start job must precede XpGetDocumentData in XmPrintToFile */
          XpStartJob(XtDisplay(pshell), save_data);
          XFlush(XtDisplay(pshell));  /* maintain the sequence
                                       between startjob and getdocument */

          /* setup print to file */
          if (pbs->destination == DtPRINT_TO_FILE)
                                       pbs->dest_info, FinishPrintToFile, NULL);


      static void
      startJobCB(Widget, XtPointer call_data, XtPointer client_data)
        print(p);   /* rendering happens here */


        /* clean up */

 SEE ALSO    [Toc]    [Back]
      XmPrintSetup(3), XmPrintShell(3), XmRedisplayWidget(3),

                                    - 2 -       Formatted:  January 24, 2005
[ Back ]
 Similar pages
Name OS Title
rpc.pcnfsd Tru64 The (PC)NFS authentication and print request server
rpc.pcnfsd HP-UX PC-NFS authentication and print request server
pcnfsd HP-UX PC-NFS authentication and print request server
ypwhich IRIX print the NIS server or map master hostname
pcnfsd Tru64 The (PC)NFS authentication and print request server
qlist IRIX display list of print queues on a NetWare server
printf Linux format and print data
jot OpenBSD print sequential or random data
jot FreeBSD print sequential or random data
XmClipboardRetrieve HP-UX A clipboard function that retrieves a data item from the clipboard
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service