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

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


Committed by: gisburn

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

Added Files:
      Tag: XORG-CURRENT
	Imakefile xpsimplehelloworld.c xpsimplehelloworld.html 
	xpsimplehelloworld.man xpsimplehelloworld.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.3 2002/02/10 19:54:53 gisburn Exp $

LOCAL_LIBRARIES = $(XLIB) -lXp -lXprintUtil
SYS_LIBRARIES = MathLibrary
DEPLIBS = $(DEPXLIB)

DEFINES         = 
           SRCS = xpsimplehelloworld.c
           OBJS = xpsimplehelloworld.o

ComplexProgramTarget(xpsimplehelloworld)

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

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


--- NEW FILE: xpsimplehelloworld.c ---
/*
 * $Xorg: xphelloworld.c,v 1.2 2002/05/10 06:54:^1 gisburn Exp $
 * 
 * xphelloworld - Xprint version of hello world
 *
 * 
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>
 */

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/XprintUtil/xprintutil.h>

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

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

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

static const char *ProgramName;      /* program name (from argv[0]) */
static Bool        verbose = False;  /* verbose output what the program is doing */

static 
void usage(void)
{
    fprintf (stderr, "usage:  %s [options]\n", ProgramName);
    fprintf (stderr, "-printer printernname\tprinter to use\n");
    fprintf (stderr, "-printfile file\tprint to file instead of printer\n");
    fprintf (stderr, "-embedpsl2data string\tPostScript level 2 fragment to embed\n"
                     "\t\t(use 'xppsembeddemo1' to embed demo data)\n");
    fprintf (stderr, "-v\tverbose output\n");
    fprintf (stderr, "\n");
    exit(EXIT_FAILURE);
}

/* strstr(), case-insensitive */
static 
char *str_case_str(const char *s, const char *find)
{
  size_t len;
  char   c, 
         sc;

  if ((c = tolower(*find++)) != '\0')
  {
    len = strlen(find);
    do 
    {
      do
      {
        if ((sc = tolower(*s++)) == '\0')
          return NULL;
      } while (sc != c);
    } while (strncasecmp(s, find, len) != 0);
    s--;
  }
  return ((char *)s);
}

static
int do_hello_world(const char *printername, const char *printerfile, const char *psembeddata )
{
    Display       *pdpy;               /* X connection */
    XPContext      pcontext;           /* Xprint context */
    void          *printtofile_handle; /* "context" when printing to file */
    int            xp_event_base,      /* XpExtension even base */
                   xp_error_base;      /* XpExtension error base */
    long           dpi;
    Screen        *pscreen;
    int            pscreennumber;
    Window         pwin;
    XGCValues      gcvalues;
    XEvent         ev;
    GC             pgc;
    unsigned short dummy;
    XRectangle     winrect;
    char           fontname[256]; /* BUG: is this really big enougth ? */
    XFontStruct   *font;

    if( XpuGetPrinter(printername, &pdpy, &pcontext) != 1 )
    {
      fprintf(stderr, "Cannot open printer '%s'\n", printername);
      return(EXIT_FAILURE);
    }
    
    if( XpQueryExtension(pdpy, &xp_event_base, &xp_error_base) == False )
    {
      fprintf(stderr, "XpQueryExtension() failed.\n");
      XpuClosePrinterDisplay(pdpy, pcontext);
      return(EXIT_FAILURE);
    }

    /* Listen to XP(Start|End)(Job|Doc|Page)Notify events).
     * This is mantatory as Xp(Start|End)(Job|Doc|Page) functions are _not_ 
     * syncronous !!
     * Not waiting for such events may cause that subsequent data may be 
     * destroyed/corrupted!!
     */
    XpSelectInput(pdpy, pcontext, XPPrintMask);
    
    /* Set job title */
    XpuSetJobTitle(pdpy, pcontext, "Hello world for Xprint");
 
    /* Set print context
     * Note that this modifies the available fonts, including builtin printer prints.
     * All XListFonts()/XLoadFont() stuff should be done _after_ setting the print 
     * context to obtain the proper fonts.
     */ 
    XpSetContext(pdpy, pcontext);

    /* Get default printer reolution */   
    if( XpuGetResolution(pdpy, pcontext, &dpi) != 1 )
    {
      fprintf(stderr, "No default resolution for printer '%s'.\n", printername);
      XpuClosePrinterDisplay(pdpy, pcontext);
      return(EXIT_FAILURE);
    }
      
    if( printerfile )
    {
      Log(("starting job (to file '%s').\n", printerfile));
      printtofile_handle = XpuStartJobToFile(pdpy, pcontext, printerfile);
      if( !printtofile_handle )
      {
        fprintf(stderr, "%s: Error: %s while trying to print to file.\n", 
                ProgramName, strerror(errno));
        XpuClosePrinterDisplay(pdpy, pcontext);
        return(EXIT_FAILURE);
      }
      
      XpuWaitForPrintNotify(pdpy, xp_event_base, XPStartJobNotify);
    }
    else
    {
      Log(("starting job.\n"));
      XpuStartJobToSpooler(pdpy);    
      XpuWaitForPrintNotify(pdpy, xp_event_base, XPStartJobNotify);
    }

#ifdef MULTIPLE_DOCUMENTS_IN_ONE_JOB
    /* Start document (one job can contain any number of "documents")
     * XpStartDoc() isn't mandatory if job only contains one document - first 
     * XpStartPage() will generate a "synthetic" XpStartDoc() if one had not 
     * already been done.
     */   
    XpStartDoc(pdpy, XPDocNormal);
    XpuWaitForPrintNotify(pdpy, xp_event_base, XPStartDocNotify);    
#endif /* MULTIPLE_DOCUMENTS_IN_ONE_JOB */

    pscreen = XpGetScreenOfContext(pdpy, pcontext);
    pscreennumber = XScreenNumberOfScreen(pscreen);
    
    /* Obtain some info about page geometry */
    XpGetPageDimensions(pdpy, pcontext, &dummy, &dummy, &winrect);

    pwin = XCreateSimpleWindow(pdpy,  XRootWindowOfScreen(pscreen),
                               winrect.x, winrect.y, winrect.width, winrect.height,
                               10,
                               XBlackPixel(pdpy, pscreennumber),
                               XWhitePixel(pdpy, pscreennumber));

    gcvalues.background = XWhitePixel(pdpy, pscreennumber);
    gcvalues.foreground = XBlackPixel(pdpy, pscreennumber);
            
    pgc = XCreateGC(pdpy, pwin, GCBackground|GCForeground, &gcvalues);
      
    Log(("start page.\n"));
    XpStartPage(pdpy, pwin);
    XpuWaitForPrintNotify(pdpy, xp_event_base, XPStartPageNotify);

    /* Mapping the window inside XpStartPage()/XpEndPage()
     * Set XCreateWindow/border_width to 0 or move XMapWindow in front of 
     * XpStartPage() to get rid of the surrounding black border lines.
     * (This is usually done before XpStartPage() in real applications)
     */     
    XMapWindow(pdpy, pwin);
      
    /* usual rendering stuff..... */

    sprintf(fontname, "-*-*-*-*-*-*-*-180-%ld-%ld-*-*-iso8859-1", dpi, dpi);
    font = XLoadQueryFont(pdpy, fontname);
    XSetFont(pdpy, pgc, font->fid);
    XDrawString(pdpy, pwin, pgc, 100, 100, "hello world from X11 print system", 33);

#define DO_EMBED_TEST 1

#ifdef DO_EMBED_TEST
    if( psembeddata )
    {
      char *embedded_formats_supported;
      
      embedded_formats_supported = XpGetOneAttribute(pdpy, pcontext, XPPrinterAttr, "xp-embedded-formats-supported");

      Log(("psembed: xp-embedded-formats-supported='%s'\n", NULLSTR(embedded_formats_supported)));

      /* MAX(XExtendedMaxRequestSize(pdpy), XMaxRequestSize(pdpy)) defines the
       * maximum length of emebdded PostScript data which can be send in one
       * step using XpPutDocumentData() */
      Log(("psembed: XExtendedMaxRequestSize=%ld\n", (long)XExtendedMaxRequestSize(pdpy)));
      Log(("psembed: XMaxRequestSize=%ld\n", (long)XMaxRequestSize(pdpy)));
      
      /* Should we embed the demo ? */
      if( !strcmp(psembeddata, "xppsembeddemo1") )
      {
        Log(("psembed: Using PS embedding demo 1\n"));
        psembeddata = "newpath\n270 360 moveto\n 0 72 rlineto\n"
                      "72 0 rlineto\n 0 -72 rlineto\n closepath\n fill\n";
      }
      else
      {
        Log(("psembed: Using user PS embedding data = '%s'\n", psembeddata));
      }

      /* Check whether "PostScript Level 2" is supported as embedding format
       * (The content of the "xp-embedded-formats-supported" attribute needs
       * to be searched in a case-insensitive way since the model-configs
       * may use the same word with multiple variants of case
       * (e.g. "PostScript" vs. "Postscript" or "PCL" vs. "Pcl" etc.")
       * To avoid problems we simply use |str_case_str()| (case-insensitive
       * strstr()) instead of |strstr()| here...)
       */
      if( embedded_formats_supported &&
          (str_case_str(embedded_formats_supported, "PostScript 2") != NULL) )
      {
        /* Note that the emebdded PostScript code uses the same resolution and
         * coordinate space as currently be used by the DDX (if you don not
         * want that simply reset it yourself :) */
        char *test     = (char *)psembeddata;
        int   test_len = strlen(test);
        char *type     = "PostScript 2"; /* Format of embedded data 
                                          * (older PS DDX may be picky, fixed via
                                          * http://xprint.mozdev.org/bugs/show_bug.cgi?id=4023)
                                          */
        char *option   = "";             /* PostScript DDX does not support any options yet
                                          * (in general |BadValue| will be returned for not
                                          * supported options/option values) */
        XpPutDocumentData(pdpy, pwin, test, test_len, type, option);
      }
      else
      {
        Log(("psembed: error: cannot embed data, 'PostScript 2' not supported as embedded data format for this printer\n"));
      }
    }
#endif /* DO_EMBED_TEST */
    
    XpEndPage(pdpy);
    XpuWaitForPrintNotify(pdpy, xp_event_base, XPEndPageNotify);
    Log(("end page.\n"));
    
#ifdef DO_SOME_MORE_RENDERING
    XpStartPage(pdpy);
    XpuWaitForPrintNotify(pdpy, xp_event_base, XPStartPageNotify);

    /* some more rendering.....   */

    XpEndPage(pdpy);
    XpuWaitForPrintNotify(pdpy, xp_event_base, XPEndPageNotify);
#endif /* DO_SOME_MORE_RENDERING */

#ifdef MULTIPLE_DOCUMENTS_IN_ONE_JOB
    /* End document. Do _not_ use it if you did not explicitly used 
     * XpStartDoc() above (e.g. if XpStartDoc() was triggered by first 
     * XpStartPage() - see comment about XpStartDoc() above... 
     */
    XpEndDoc(pdpy);
    XpuWaitForPrintNotify(pdpy, xp_event_base, XPEndDocNotify);
#endif /* MULTIPLE_DOCUMENTS_IN_ONE_JOB */

    /* End the print job - the final results are sent by the X print
     * server to the spooler sub system.
     */
    XpEndJob(pdpy);
    XpuWaitForPrintNotify(pdpy, xp_event_base, XPEndJobNotify);    
    Log(("end job.\n"));

    if( printerfile )
    {
      if( XpuWaitForPrintFileChild(printtofile_handle) != XPGetDocFinished )
      {
        fprintf(stderr, "%s: Error while printing to file.\n", ProgramName);
        XpuClosePrinterDisplay(pdpy, pcontext);
        return(EXIT_FAILURE);
      }
    }
    
    XpuClosePrinterDisplay(pdpy, pcontext);
    return(EXIT_SUCCESS);
}

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

    ProgramName = argv[0];

    for (i = 1; i < argc; i++)
    {
      char *arg = argv[i];
      int len = strlen(arg);
    
      if (!strncmp("-printer", arg, len))
      {
        if (++i >= argc)
          usage();
        printername = argv[i];
      }
      else if (!strncmp("-printfile", arg, len))
      {
        if (++i >= argc)
          usage();
        toFile = argv[i];
      }
      else if (!strncmp("-embedpsl2data", arg, len))
      {
        if (++i >= argc)
          usage();
        embedpsl2data = argv[i];
      }      
      else if (!strncmp("-v", arg, len))
      {
        verbose = True;
      }
      else
      {
        usage();
      }  
    }
    
    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(plist[0].name, toFile, embedpsl2data);
    
    XpuFreePrinterList(plist);
    
    return(retval);
}



--- NEW FILE: xpsimplehelloworld.html ---
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>xpsimplehelloworld</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>xpsimplehelloworld &#8212; &quot;Hello World&quot;-like Xprint sample utility based on plain X11 rendering calls</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><tt class="command">xpsimplehelloworld</tt>  [<tt class="option">-printer <i class="replaceable"><tt>printernname</tt></i></tt>] [<tt class="option">-v</tt>] [<tt class="option">-h</tt>]</p></div></div><div class="refsect1" lang="en"><a name="id2802597"></a><h2>DESCRIPTION</h2><p><span><b class="command">xpsimplehelloworld</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) using plain X11
      rendering instructions and without using special toolkit support (like one of
      the special Xt print shell widget classes
      (such as
      <span class="citerefentry"><span class="refentrytitle">XmPrintShell</span>(3x)</span>
      or
      <span class="citerefentry"><span class="refentrytitle">XawPrintShell</span>(3x)</span>)).
    </p></div><div class="refsect1" lang="en"><a name="id2804967"></a><h2>OPTIONS</h2><div class="variablelist"><dl><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="id2804998"></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="id2805031"></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="id2805040"></a><h2>SEE ALSO</h2><p><span class="simplelist"><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">xpxmhelloworld</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">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: xpsimplehelloworld.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 "XPSIMPLEHELLOWORLD" "__mansuffix__" "13 February 2004" "" ""
.SH NAME
xpsimplehelloworld \- \&"Hello World\&"-like Xprint sample utility based on plain X11 rendering calls
.SH SYNOPSIS

\fBxpsimplehelloworld\fR [ \fB-printer \fIprinternname\fB\fR]  [ \fB-v\fR]  [ \fB-h\fR] 

.SH "DESCRIPTION"
.PP
\fBxpsimplehelloworld\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) using plain X11
rendering instructions and without using special toolkit support (like one of
the special Xt print shell widget classes
(such as
\fBXmPrintShell\fR(__libmansuffix__)
or
\fBXawPrintShell\fR(__libmansuffix__))).
.SH "OPTIONS"
.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
\fBXprint\fR(__miscmansuffix__), \fBX11\fR(__miscmansuffix__), \fBxplsprinters\fR(__mansuffix__), \fBxphelloworld\fR(__mansuffix__), \fBxpxmhelloworld\fR(__mansuffix__), \fBxpawhelloworld\fR(__mansuffix__), \fBxpxthelloworld\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: xpsimplehelloworld.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>xpsimplehelloworld</refentrytitle>
    <manvolnum>__mansuffix__</manvolnum>
  </refmeta>
  <refnamediv>
    <refname>xpsimplehelloworld</refname>

    <refpurpose>"Hello World"-like Xprint sample utility based on plain X11 rendering calls</refpurpose>
  </refnamediv>
  <refsynopsisdiv>
    <cmdsynopsis>
      <command>xpsimplehelloworld</command>

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

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

      <arg><option>-h</option></arg>
      
    </cmdsynopsis>
  </refsynopsisdiv>
  <refsect1>
    <title>DESCRIPTION</title>

    <para><command>xpsimplehelloworld</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) using plain X11
      rendering instructions and without using special toolkit support (like one of
      the special Xt print shell widget classes
      (such as
      <citerefentry><refentrytitle>XmPrintShell</refentrytitle><manvolnum>__libmansuffix__</manvolnum></citerefentry>
      or
      <citerefentry><refentrytitle>XawPrintShell</refentrytitle><manvolnum>__libmansuffix__</manvolnum></citerefentry>)).
    </para>

  </refsect1>

  <refsect1>
    <title>OPTIONS</title>

    <variablelist>
      <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 -->
        <!-- none -->
        
        <!-- 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