[xorg-commit-diffs] xc/programs/xphelloworld/xpxmhelloworld Imakefile, NONE, 1.1.4.1 xpxmhelloworld.c, NONE, 1.1.4.1 xpxmhelloworld.html, NONE, 1.1.4.1 xpxmhelloworld.man, NONE, 1.1.4.1 xpxmhelloworld.sgml, NONE, 1.1.4.1

Roland Mainz xorg-commit at pdx.freedesktop.org
Wed Apr 21 20:03:59 EST 2004


Committed by: gisburn

Update of /cvs/xorg/xc/programs/xphelloworld/xpxmhelloworld
In directory pdx:/tmp/cvs-serv5532/programs/xphelloworld/xpxmhelloworld

Added Files:
      Tag: XORG-CURRENT
	Imakefile xpxmhelloworld.c xpxmhelloworld.html 
	xpxmhelloworld.man xpxmhelloworld.sgml 
Log Message:
Fix for http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=530 - Land XPRINT branch on XORG-CURRENT

--- NEW FILE: Imakefile ---
XCOMM $Xorg: Imakefile,v 1.1 2003/05/12 19:54:53 gisburn Exp $
     
LOCAL_LIBRARIES = -L$(PROJECTROOT)/lib -lXm -lXt $(XPLIB) -lXprintUtil $(XLIB)
SYS_LIBRARIES = MathLibrary
DEPLIBS = $(DEPXLIB)
INCLUDES = -I/usr/X11R6/include

DEFINES         = 
           SRCS = xpxmhelloworld.c
           OBJS = xpxmhelloworld.o

ComplexProgramTarget(xpxmhelloworld)

#ifdef HasDocBookTools
all:: xpxmhelloworld.man xpxmhelloworld.html

ConvertDocBookToManPage(xpxmhelloworld.sgml, xpxmhelloworld.man)
ConvertDocBookToHTML(xpxmhelloworld.sgml, xpxmhelloworld.html)
#endif /* HasDocBookTools */

--- NEW FILE: xpxmhelloworld.c ---

/*
 * $Xorg: xpxmhelloworld.c,v 1.2 2003/10/19 00:3:26 gisburn Exp $
 * 
 * xpxmhelloworld - Xprint version of hello world using Motif widgets
 *
 * 
Copyright 2002-2004 Roland Mainz <roland.mainz at nrubsig.org>

All Rights Reserved.

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
OPEN GROUP 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 name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
 *
 * Author:  Roland Mainz <roland.mainz at nrubsig.org>
 */

/*
 * Referencess:
 * http://nscp.upenn.edu/aix4.3html/libs/motiftr/XmPrintShell.htm
 * http://nscp.upenn.edu/aix4.3html/libs/motiftr/XmText.htm
 *
 */

#include <X11/IntrinsicP.h> 
#include <X11/ShellP.h>
#include <X11/StringDefs.h>
#include <Xm/Xm.h> 
#include <Xm/Text.h>
#include <Xm/Print.h>
#include <X11/XprintUtil/xprintutil.h>

#include <stdlib.h>
#include <stdio.h>

/* Turn a NULL pointer string into an empty string */
#define NULLSTR(x) (((x)!=NULL)?(x):(""))

#define Error(x) { printf x ; exit(EXIT_FAILURE); }
#define Log(x) { if(verbose) printf x; }

/* Prototypes */
static int do_hello_world( int argc, char *argv[], const char *printername,
                           const char *toFile, const char *sample_string );

/* Global vars */
const char *ProgramName;                /* program name (from argv[0]) */
Bool        verbose            = False; /* verbose output what the program is doing */
Bool        doPrint            = False; /* Do we print on a printer ? */
Display    *pdpy               = NULL;  /* (Paper) display */
Screen     *pscreen            = NULL;  /* (Paper) screen (DDX-specific!) */
XPContext   pcontext           = None;  /* Xprint context  */
void       *printtofile_handle = NULL;  /* XprintUtil "context" when printing to file */
Drawable    pdrawable          = None;  /* paper drawable */

static 
void usage( void )
{
    fprintf(stderr, "usage:  %s [options] string\n", ProgramName);
    fprintf(stderr, "-print\tPrint via Xprint instead of displaying on the Xserver\n");
    fprintf(stderr, "-printer printernname\tprinter to use\n");
    fprintf(stderr, "-printfile file\tprint to file instead of printer\n");
    fprintf(stderr, "-v\tverbose output\n");
    fprintf(stderr, "\n");
    exit(EXIT_FAILURE);
}

int main( int argc, char *argv[] )
{
    const char    *printername = NULL;  /* printer to query */
    const char    *toFile      = NULL;  /* output file (instead of printer) */
    XPPrinterList  plist;               /* list of printers */
    int            plist_count;         /* number of entries in |plist|-array */
    int            i;
    int            retval;
    const char    *sample_string;

    ProgramName = argv[0];
    
    if( argc < 2 )
    {
      usage();
    }

    for( i = 1 ; i < (argc-1) ; i++ )
    {
      char *arg = argv[i];
      int len = strlen(arg);
    
      if (!strncmp("-print", arg, len))
      {
        doPrint = True;
      }
      else if (!strncmp("-printer", arg, len))
      {
        if (++i >= argc)
          usage();
        printername = argv[i];
        doPrint = True;
      }
      else if (!strncmp("-printfile", arg, len))
      {
        if (++i >= argc)
          usage();
        toFile = argv[i];
        doPrint = True;
      }
      else if (!strncmp("-v", arg, len))
      {
        verbose = True;
      }
      else
      {
        usage();
      }  
    }
    
    sample_string = argv[argc-1];
    
    if( doPrint )
    {
      plist = XpuGetPrinterList(printername, &plist_count);

      if (!plist) {
        fprintf(stderr, "%s:  no printers found for printer spec \"%s\".\n",
           ProgramName, NULLSTR(printername));
        exit(EXIT_FAILURE);
      }
    
      Log(("Using printer '%s'\n", plist[0].name));
    
      retval = do_hello_world(argc, argv, plist[0].name, toFile, sample_string);
    
      XpuFreePrinterList(plist);
    }
    else
    {
      Log(("Displaying on framebuffer Xserver\n"));

      retval = do_hello_world(argc, argv, NULL, NULL, sample_string);
    }
    
    return retval;
}

/* xt_xp_openapplication() - mainly identical to XtOpenApplication() but
 * takes a |Display *| and |Screen *| as arguments, too... */
static
Widget xt_xp_openapplication(XtAppContext *app_context_return,
                             Display      *dpy,
                             Screen       *screen,
                             String        application_name,
                             String        application_class,
                             WidgetClass   widget_class,
                             int          *argc,
                             String       *argv)
{
    Widget   toplevel;
    Cardinal n;
    Arg      args[2];

    XtToolkitInitialize();
    *app_context_return = XtCreateApplicationContext();
    if( *app_context_return == NULL )
      return NULL;
      
    XtDisplayInitialize(*app_context_return, dpy,
                        application_name, application_class,
                        NULL, 0,
                        argc, argv);

    n = 0;
    XtSetArg(args[n], XtNscreen, screen); n++;
    toplevel = XtAppCreateShell(application_name, 
                                application_class,
                                widget_class,
                                dpy,
                                args, n);

    return toplevel;
}

typedef struct
{
  int          num_pages;
  int          curr_page;

  Widget       printshell_content;
  int          num_visible_rows;
  XtAppContext appcontext; /* for XtAppSetExitFlag() */
} MyPrintCallbackData;


static
void PrintOnePageCB(Widget pshell, XtPointer context, XtPointer call_data)
{
    MyPrintCallbackData        *mpcd = (MyPrintCallbackData *)context;
    XmPrintShellCallbackStruct *psp  = (XmPrintShellCallbackStruct *)call_data;

    Log(("-->  PrintOnePageCB, printing page %d of %d\n", mpcd->curr_page, mpcd->num_pages));

    mpcd->curr_page++;
 
    /* Get ready for next page
     * Scroll widget to display the next page (except for the first page :)
     */
    if (!psp->last_page && mpcd->curr_page > 1)
    {
      /* XmText allows two solutions to scroll a page down
       * - Either scroll num_rows_per_page down (this is XmText-specific)
       *   or
       * - Call the "next-page" action procedure (this works for all widgets
       *   which support this action proc)
       */
#define USE_ACTION_TO_SCROLL_DOWN 1
#ifdef USE_ACTION_TO_SCROLL_DOWN
      Log(("Scrolling down one page ...\n"));
      XtCallActionProc(mpcd->printshell_content, "next-page", NULL, NULL, 0);
#else
      Log(("Scrolling down %d rows (=one page) ...\n", mpcd->num_visible_rows));
      XmTextScroll(mpcd->printshell_content, mpcd->num_visible_rows);
#endif /* USE_ACTION_TO_SCROLL_DOWN */
    }
 
    if (mpcd->curr_page == (int)mpcd->num_pages)
    {
      Log(("Printing last page.\n"));
      psp->last_page = True;
    }

    Log(("PrintOnePageCB: done\n"));
}

static
void PrintStartJobCB(Widget pshell, XtPointer context, XtPointer call_data)
{
    XmPrintShellCallbackStruct *psp = (XmPrintShellCallbackStruct *)call_data;

    Log(("-->  PrintStartJobCB\n"));
}

static
void PrintEndJobCB(Widget pshell, XtPointer context, XtPointer call_data)
{
    MyPrintCallbackData         *mpcd = (MyPrintCallbackData *)context;
    XmPrintShellCallbackStruct  *psp  = (XmPrintShellCallbackStruct *)call_data;

    Log(("--> PrintEndJobCB\n"));
    
    /* We're done with printing, tell |XtAppMainLoop()| that it can exit */
    XtAppSetExitFlag(mpcd->appcontext);
}

int do_hello_world( int argc, char *argv[], const char *printername, const char *toFile, const char *sample_string )
{
    XtAppContext         app;                                                   
    Widget               toplevel,                                              
                         shell,                                                 
                         print_shell,                                           
                         hello;                                                 
    long                 dpi;                                                   
    char                 fontname[256]; /* BUG: is this really big enougth ? */ 
    XFontStruct         *textFont;                                              
    XmFontList           textFontList;                                          
    Cardinal             n;                                                     
    Arg                  args[10];                                              
    MyPrintCallbackData  mpcd;
       
    if( doPrint )
    {
      /* Get printer, either by "name" (foobar) or "name at display" (foobar at gaja:5) */
      if( XpuGetPrinter(printername, &pdpy, &pcontext) != 1 )
        Error(("XpuGetPrinter failure.\n"));
     
      /* Configure the print context (paper size, title etc.)
       * We must do this before creating any Xt widgets - otherwise they will
       * make wrong assuptions about fonts, resultions etc. ...
       */
      XpuSetJobTitle(pdpy, pcontext, "Simple Xprint XmPrintShell widget demo");
      
      /* Configuration done, set the context */
      XpSetContext(pdpy, pcontext);

      /* Get default printer resolution */   
      if( XpuGetResolution(pdpy, pcontext, &dpi) != 1 )
      {
        fprintf(stderr, "No default resolution for printer '%s'\n", printername);
        XpuClosePrinterDisplay(pdpy, pcontext);
        return(EXIT_FAILURE);
      }

      pscreen = XpGetScreenOfContext(pdpy, pcontext);
    }
    else
    {
      pdpy = XOpenDisplay(NULL);
      if( !pdpy )
        Error(("XOpenDisplay failure.\n"));

      dpi = 0;
      
      pscreen = XDefaultScreenOfDisplay(pdpy);
    }  

    toplevel = xt_xp_openapplication(&app, 
                                     pdpy, pscreen,
                                     "xpxmprintshelldemo", "XpXmPrintShellDemo",
                                     applicationShellWidgetClass,
                                     &argc, argv);

    if( !toplevel )
      Error(("xt_xp_openapplication failure.\n"));

    if( doPrint )
    {
      n = 0;
      print_shell = XtCreatePopupShell("myprintshell", 
                                       xmPrintShellWidgetClass, 
                                       toplevel, args, n);

      /* we're mapping/unmapping at start/end page time */
      XtSetMappedWhenManaged(print_shell, False);
      
      shell = print_shell;
    }
    else
    {
      shell = toplevel;
    }

    sprintf(fontname, "-adobe-courier-medium-r-normal--40-*-%ld-%ld-*-*-iso8859-1", dpi, dpi);
    textFont = XLoadQueryFont(pdpy, fontname);
    if( !textFont )
    {          
      sprintf(fontname, "-*-*-*-*-*-*-*-160-%ld-%ld-*-*-iso8859-1", dpi, dpi);
      textFont = XLoadQueryFont(pdpy, fontname);
    }
    if( !textFont )
      Error(("XLoadQueryFont failure.\n"));
    textFontList = XmFontListCreate(textFont, XmSTRING_DEFAULT_CHARSET);     

    n = 0;
    /* Make sure the cursor is off, current Xprt servers do not seem to like
     * blinking cursors that much... ;-/ */
    XtSetArg(args[n], XmNcursorPositionVisible, False);              n++;
    XtSetArg(args[n], XmNvalue,                 sample_string);      n++;
    XtSetArg(args[n], XmNfontList,              textFontList);       n++;
    XtSetArg(args[n], XmNeditMode,              XmMULTI_LINE_EDIT);  n++;
    
    hello = XmCreateText(shell, "mytext", args, n);
    if( !hello )
      Error(("XmCreateText failure.\n"));
      
    XtManageChild(hello);
    XtRealizeWidget(toplevel);
    XtRealizeWidget(shell);
    
    if( doPrint )
    {
      int   num_total_rows;
      short num_visible_rows;
      int   num_pages;

      pdpy      = XtDisplay(toplevel);
      pdrawable = XtWindow(toplevel);
      if( !pdpy || !pdrawable )
        Error(("No display.\n"));
      
      /* Make sure that the Xt machinery is really using the right screen (assertion) */
      if( XpGetScreenOfContext(XtDisplay(toplevel), pcontext) != XtScreen(toplevel) )
        Error(("Widget's screen != print screen. BAD.\n"));
                  
      /* Get number of rows visible per page and the number of total rows 
       * in the whole text widget... */
      n = 0;
      XtSetArg(args[n], XmNrows,       &num_visible_rows); n++ ;
      XtSetArg(args[n], XmNtotalLines, &num_total_rows);   n++ ;
      XtGetValues(hello, args, n);

      /* Take away one row to match the one-line overlapping used by the
       * "next-page" action proc */      
      num_visible_rows -= 1;

      /* Calculate the number of pages */
      num_pages = (num_total_rows+num_visible_rows-1) / num_visible_rows;
      Log(("Printing %d pages (num_total_rows=%d, num_visible_rows=%d)...\n", 
           num_pages, num_total_rows, num_visible_rows));
      
      /* Prepare our own context data for the print shell callbacks */
      mpcd.num_pages          = num_pages;
      mpcd.curr_page          = 0;
      mpcd.printshell_content = hello;
      mpcd.num_visible_rows   = num_visible_rows;
      mpcd.appcontext         = app;
      
      /* Setup the print shell callbacks... */
      XtAddCallback(print_shell,  XmNpageSetupCallback, PrintOnePageCB,  (XtPointer)&mpcd);
      XtAddCallback(print_shell,  XmNstartJobCallback,  PrintStartJobCB, NULL);
      XtAddCallback(print_shell,  XmNendJobCallback,    PrintEndJobCB,   (XtPointer)&mpcd);  

      /* ... and finally start the print job. */
      if( toFile )
      {
        printtofile_handle = XpuStartJobToFile(pdpy, pcontext, toFile);
        if( !printtofile_handle )
        {
          perror("XpuStartJobToFile failure");
          Error(("XpuStartJobToFile failure."));
        }
      }
      else
      {
        XpuStartJobToSpooler(pdpy);
      }
    }
    
    XtAppMainLoop(app);
    
    if( doPrint )
    {
      if( toFile )
      {
        if( XpuWaitForPrintFileChild(printtofile_handle) != XPGetDocFinished )
        {
          fprintf(stderr, "%s: Error while printing to file.\n", ProgramName);
        }
      }
    
      /* We have to use XpDestroyContext() and XtCloseDisplay() instead
       * of XpuClosePrinterDisplay() to make libXt happy... */
      if( pcontext != None )
        XpDestroyContext(pdpy, pcontext);
      XtCloseDisplay(pdpy);
    }
   
    return EXIT_SUCCESS;
}


--- NEW FILE: xpxmhelloworld.html ---
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>xpxmhelloworld</title><meta name="generator" content="DocBook XSL Stylesheets V1.62.4"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="id2590201"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>Name</h2><p>xpxmhelloworld &#8212; &quot;Hello World&quot;-like Xprint sample utility based on the Motif2 toolkit</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><tt class="command">xpxmhelloworld</tt>  [<tt class="option">-print</tt>] [<tt class="option">-printer <i class="replaceable"><tt>printernname</tt></i></tt>] [<tt class="option">-v</tt>] [<tt class="option">-h</tt>]  <i class="replaceable"><tt>string</tt></i>... </p></div></div><div class="refsect1" lang="en"><a name="id2804937"></a><h2>DESCRIPTION</h2><p><span><b class="command">xpxmhelloworld</b></span> is a sample utility for Xprint, the
      printing system for the X Window system. It demonstrates how to send a test page to
      the specified printer (or the default printer, if none is specified) based on
      the Motif2 toolkit using the
      <span class="citerefentry"><span class="refentrytitle">XmPrintShell</span>(3x)</span>
      widget class.
    </p></div><div class="refsect1" lang="en"><a name="id2804971"></a><h2>OPTIONS</h2><div class="variablelist"><dl><dt><span class="term"><tt class="option">-print</tt></span></dt><dd><p>Print (default is to display on the video Xserver)</p></dd><dt><span class="term"><tt class="option">-printer <i class="replaceable"><tt>printernname</tt></i></tt></span></dt><dd><p>printer to use</p></dd><dt><span class="term"><tt class="option">-v</tt></span></dt><dd><p>verbose output</p></dd><dt><span class="term"><tt class="option">-h</tt></span></dt><dd><p>print usage</p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2805011"></a><h2>ENVIRONMENT</h2><div class="variablelist"><dl><dt><span class="term"><tt class="envar">XPSERVERLIST</tt></span></dt><dd><p><tt class="envar">${XPSERVERLIST}</tt> must be set,
	      identifying the available Xprint servers.
              See <span class="citerefentry"><span class="refentrytitle">Xprint</span>(7)</span>
	      for more details.
	  </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2805044"></a><h2>KNOWN BUGS</h2><p>
      A full list of bugs can be obtained from the Xprint.org bug database (<a href="http://xprint.mozdev.org/xprint_bugs.html" target="_top">http://xprint.mozdev.org/xprint_bugs.html</a>).
    </p></div><div class="refsect1" lang="en"><a name="id2805053"></a><h2>SEE ALSO</h2><p><span class="simplelist"><a href="http://nscp.upenn.edu/aix4.3html/libs/motiftr/XmPrintShell.htm" target="_top">http://nscp.upenn.edu/aix4.3html/libs/motiftr/XmPrintShell.htm</a>, <a href="http://nscp.upenn.edu/aix4.3html/libs/motiftr/XmText.htm" target="_top">http://nscp.upenn.edu/aix4.3html/libs/motiftr/XmText.htm</a>, <span class="citerefentry"><span class="refentrytitle">Xprint</span>(7)</span>, <span class="citerefentry"><span class="refentrytitle">X11</span>(7)</span>, <span class="citerefentry"><span class="refentrytitle">xplsprinters</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">xphelloworld</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">xpawhelloworld</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">xpxthelloworld</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">xpsimplehelloworld</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">Xserver</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">Xprt</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">libXp</span>(3x)</span>, <span class="citerefentry"><span class="refentrytitle">libXprintUtils</span>(3x)</span>, <span class="citerefentry"><span class="refentrytitle">libXprintAppUtils</span>(3x)</span>, <span class="citerefentry"><span class="refentrytitle">XmPrintShell</span>(3x)</span>, <span class="citerefentry"><span class="refentrytitle">XawPrintShell</span>(3x)</span>, Xprint FAQ (<a href="http://xprint.mozdev.org/docs/Xprint_FAQ.html" target="_top">http://xprint.mozdev.org/docs/Xprint_FAQ.html</a>), Xprint main site (<a href="http://xprint.mozdev.org/" target="_top">http://xprint.mozdev.org/</a>)</span></p></div></div></body></html>

--- NEW FILE: xpxmhelloworld.man ---
.\" This manpage has been automatically generated by docbook2man 
.\" from a DocBook document.  This tool can be found at:
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/> 
.\" Please send any bug reports, improvements, comments, patches, 
.\" etc. to Steve Cheng <steve at ggi-project.org>.
.TH "XPXMHELLOWORLD" "__mansuffix__" "13 February 2004" "" ""
.SH NAME
xpxmhelloworld \- \&"Hello World\&"-like Xprint sample utility based on the Motif2 toolkit
.SH SYNOPSIS

\fBxpxmhelloworld\fR [ \fB-print\fR]  [ \fB-printer \fIprinternname\fB\fR]  [ \fB-v\fR]  [ \fB-h\fR]  \fB\fIstring\fB\fR\fI ...\fR

.SH "DESCRIPTION"
.PP
\fBxpxmhelloworld\fR is a sample utility for Xprint, the
printing system for the X Window system. It demonstrates how to send a test page to
the specified printer (or the default printer, if none is specified) based on
the Motif2 toolkit using the
\fBXmPrintShell\fR(__libmansuffix__)
widget class.
.SH "OPTIONS"
.TP
\fB-print \fR
Print (default is to display on the video Xserver)
.TP
\fB-printer \fIprinternname\fB \fR
printer to use
.TP
\fB-v \fR
verbose output
.TP
\fB-h \fR
print usage
.SH "ENVIRONMENT"
.TP
\fBXPSERVERLIST \fR
\fB${XPSERVERLIST}\fR must be set,
identifying the available Xprint servers.
See \fBXprint\fR(__miscmansuffix__)
for more details.
.SH "KNOWN BUGS"
.PP
A full list of bugs can be obtained from the Xprint.org bug database (http://xprint.mozdev.org/xprint_bugs.html <URL:http://xprint.mozdev.org/xprint_bugs.html>).
.SH "SEE ALSO"
.PP
http://nscp.upenn.edu/aix4.3html/libs/motiftr/XmPrintShell.htm <URL:http://nscp.upenn.edu/aix4.3html/libs/motiftr/XmPrintShell.htm>, http://nscp.upenn.edu/aix4.3html/libs/motiftr/XmText.htm <URL:http://nscp.upenn.edu/aix4.3html/libs/motiftr/XmText.htm>, \fBXprint\fR(__miscmansuffix__), \fBX11\fR(__miscmansuffix__), \fBxplsprinters\fR(__mansuffix__), \fBxphelloworld\fR(__mansuffix__), \fBxpawhelloworld\fR(__mansuffix__), \fBxpxthelloworld\fR(__mansuffix__), \fBxpsimplehelloworld\fR(__mansuffix__), \fBXserver\fR(__mansuffix__), \fBXprt\fR(__mansuffix__), \fBlibXp\fR(__libmansuffix__), \fBlibXprintUtils\fR(__libmansuffix__), \fBlibXprintAppUtils\fR(__libmansuffix__), \fBXmPrintShell\fR(__libmansuffix__), \fBXawPrintShell\fR(__libmansuffix__), Xprint FAQ (http://xprint.mozdev.org/docs/Xprint_FAQ.html <URL:http://xprint.mozdev.org/docs/Xprint_FAQ.html>), Xprint main site (http://xprint.mozdev.org/ <URL:http://xprint.mozdev.org/>)

--- NEW FILE: xpxmhelloworld.sgml ---
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.2//EN" '/usr/share/sgml/docbook_4.2/docbook.dtd'>

<!-- Process this file with DocBook tools to generate the output format
(such as manual pages or HTML documents).

Note that strings like __mansuffix__, __filemansuffix__, __libmansuffix__,
__miscmansuffix__ etc. have to be replaced first (in theory that's the
job of ENTITIES but some XML tools are highly allergic to such stuff... ;-().
A quick way to do that is to filter this document via
/usr/bin/sed "s/__mansuffix__/${MANSUFFIX}/g;s/__filemansuffix__/${FILEMANSUFFIX}/g;s/__libmansuffix__/${LIBMANSUFFIX}/g;s/__miscmansuffix__/${MISCMANSUFFIX}/g"
assuming that env vars like MANSUFFIX etc. have been set to the matching
manual volume numbers.
  -->

<refentry>
  <refmeta>
    <refentrytitle>xpxmhelloworld</refentrytitle>
    <manvolnum>__mansuffix__</manvolnum>
  </refmeta>
  <refnamediv>
    <refname>xpxmhelloworld</refname>

    <refpurpose>"Hello World"-like Xprint sample utility based on the Motif2 toolkit</refpurpose>
  </refnamediv>
  <refsynopsisdiv>
    <cmdsynopsis>
      <command>xpxmhelloworld</command>

      <arg><option>-print</option></arg>

      <arg><option>-printer <replaceable>printernname</replaceable></option></arg>

      <arg><option>-v</option></arg>

      <arg><option>-h</option></arg>
      
      <arg choice="plain" rep="repeat"><replaceable>string</replaceable></arg>
      
    </cmdsynopsis>
  </refsynopsisdiv>
  <refsect1>
    <title>DESCRIPTION</title>

    <para><command>xpxmhelloworld</command> is a sample utility for Xprint, the
      printing system for the X Window system. It demonstrates how to send a test page to
      the specified printer (or the default printer, if none is specified) based on
      the Motif2 toolkit using the
      <citerefentry><refentrytitle>XmPrintShell</refentrytitle><manvolnum>__libmansuffix__</manvolnum></citerefentry>
      widget class.
    </para>
  </refsect1>

  <refsect1>
    <title>OPTIONS</title>

    <variablelist>
      <varlistentry>
        <term><option>-print</option>
        </term>
        <listitem>
          <para>Print (default is to display on the video Xserver)</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>-printer <replaceable>printernname</replaceable></option>
        </term>
        <listitem>
          <para>printer to use</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>-v</option>
        </term>
        <listitem>
          <para>verbose output</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>-h</option>
        </term>
        <listitem>
          <para>print usage</para>
        </listitem>
      </varlistentry>      
    </variablelist>
  </refsect1>

  <refsect1>
    <title>ENVIRONMENT</title>
    <variablelist>
      <varlistentry>
        <term><envar>XPSERVERLIST</envar>
        </term>
        <listitem>
	    <para>
              <envar>${XPSERVERLIST}</envar> must be set,
	      identifying the available Xprint servers.
              See <citerefentry><refentrytitle>Xprint</refentrytitle><manvolnum>__miscmansuffix__</manvolnum></citerefentry>
	      for more details.
	  </para>
	</listitem>
      </varlistentry>
    </variablelist>
  </refsect1>

  <refsect1>
    <title>KNOWN BUGS</title>
    <para>
      A full list of bugs can be obtained from the Xprint.org bug database (<ulink url="http://xprint.mozdev.org/xprint_bugs.html">http://xprint.mozdev.org/xprint_bugs.html</ulink>).
    </para>
  </refsect1>

  <refsect1>
    <title>SEE ALSO</title>
    <para>
      <simplelist type="inline">
        <!-- specific references -->
        <member><ulink url="http://nscp.upenn.edu/aix4.3html/libs/motiftr/XmPrintShell.htm">http://nscp.upenn.edu/aix4.3html/libs/motiftr/XmPrintShell.htm</ulink></member>
        <member><ulink url="http://nscp.upenn.edu/aix4.3html/libs/motiftr/XmText.htm">http://nscp.upenn.edu/aix4.3html/libs/motiftr/XmText.htm</ulink></member>
        
        <!-- Xprint general references -->
        <member><citerefentry><refentrytitle>Xprint</refentrytitle><manvolnum>__miscmansuffix__</manvolnum></citerefentry></member>
        <member><citerefentry><refentrytitle>X11</refentrytitle><manvolnum>__miscmansuffix__</manvolnum></citerefentry></member>
        <member><citerefentry><refentrytitle>xplsprinters</refentrytitle><manvolnum>__mansuffix__</manvolnum></citerefentry></member>
        <member><citerefentry><refentrytitle>xphelloworld</refentrytitle><manvolnum>__mansuffix__</manvolnum></citerefentry></member>
<!--
        <member><citerefentry><refentrytitle>xpxmhelloworld</refentrytitle><manvolnum>__mansuffix__</manvolnum></citerefentry></member>
-->
        <member><citerefentry><refentrytitle>xpawhelloworld</refentrytitle><manvolnum>__mansuffix__</manvolnum></citerefentry></member>
        <member><citerefentry><refentrytitle>xpxthelloworld</refentrytitle><manvolnum>__mansuffix__</manvolnum></citerefentry></member>
        <member><citerefentry><refentrytitle>xpsimplehelloworld</refentrytitle><manvolnum>__mansuffix__</manvolnum></citerefentry></member>
        <member><citerefentry><refentrytitle>Xserver</refentrytitle><manvolnum>__mansuffix__</manvolnum></citerefentry></member>
        <member><citerefentry><refentrytitle>Xprt</refentrytitle><manvolnum>__mansuffix__</manvolnum></citerefentry></member>
        <!-- ToDO: Add manual pages for the single Xprint DDX implementations (PostScript/PDF/PCL/PCL-MONO/Raster/etc.) -->
        <member><citerefentry><refentrytitle>libXp</refentrytitle><manvolnum>__libmansuffix__</manvolnum></citerefentry></member>
        <member><citerefentry><refentrytitle>libXprintUtils</refentrytitle><manvolnum>__libmansuffix__</manvolnum></citerefentry></member>
        <member><citerefentry><refentrytitle>libXprintAppUtils</refentrytitle><manvolnum>__libmansuffix__</manvolnum></citerefentry></member>
        <member><citerefentry><refentrytitle>XmPrintShell</refentrytitle><manvolnum>__libmansuffix__</manvolnum></citerefentry></member>
        <member><citerefentry><refentrytitle>XawPrintShell</refentrytitle><manvolnum>__libmansuffix__</manvolnum></citerefentry></member>
        <member>Xprint FAQ (<ulink url="http://xprint.mozdev.org/docs/Xprint_FAQ.html">http://xprint.mozdev.org/docs/Xprint_FAQ.html</ulink>)</member>
        <member>Xprint main site (<ulink url="http://xprint.mozdev.org/">http://xprint.mozdev.org/</ulink>)</member>
      </simplelist>
    </para>
  </refsect1>

</refentry>




More information about the xorg-commit-diffs mailing list