X and DPS : The DPS client side
Previous: Introduction
Next: The DPS server side

2. The DPS client side

The DPS client side consists of four libraries and a number of basic tools for programming and configuration; these are all included with X11R6.8.1.

2.1. Libraries

The libpsres library is a library for management of PostScript resources, on-disk files representing PostScript data structures such as fonts, font encodings, procsets, etc. It is closely related to the makepsres tool (see client-side tools later in this document).

The basic DPS client library is libdps. This library contains a number of functions for connection establishment, resource management, as well as stubs for all standard PostScript operators. Normally, all DPS clients should link with libdps; in addition, libdps may be used for printing by non-DPS clients (this is done, for example, by Sun's JDK). This library is documented in [CLRM] and [CLSX].

The libdpstk library contains a number of additional utilities for managing DPS contexts, user paths and user objects, and for previewing EPS files. It is documented in [DPTX].

The libdpstkXm library contains four Motif widgets. The DPS Scrolling Widget is a DPS drawing area that automatically manages issues such as scrolling, scaling, client-side backing store, incremental redisplay, etc. The Font Selection Box, and its associated Font Preview, present a convenient and powerful interface for choosing scalable fonts. Finally, the Color Picker presents an interface for choosing colours using either of the RGB or HSV spaces. The latter three widgets are documented in [DPTX]; some summary Scrolling Widget documentation is available in the doc subdirectory of the DPS.tar.gz file, available from urlnam.

The source code for libdpstkXm is included with X11R6.8.1; however, as it depends on Motif, this library is not built by default. A GTK-based library providing some of the functionality of libdpstkXm is available from the gtkDPS site.

2.1.1. Libdps and Xt

In X11R5, libdps did not depend on libXt. In X11R6, however, code was added to make the Xt main loop dispatch to sundry code on DPS events; with this addition, all programs that link with libdps need to link with libXt, whether they use Xt or not.

This state of affairs is unfortunately true of the version of libdps included with X11R6.8.1. We are currently considering various solutions to this problem (including the use of weak linker symbols or splitting off the guilty functions into a separate library).

2.2. Client-side tools

In addition to the libraries, the client side of DPS consists of two utilities.

The makepsres utility is used for managing PostScript resources. Its basic operation consists in walking recursively a filesystem tree, noting all resources, and then writing out a ``Unix PostScript Resources,'' file, basically a directory of all the resources found. This utility is documented in the makepsres(1) manual page.

The pswrap utility is a stub generator for PostScript clients. Roughly speaking, it takes as its input textual PostScript code, and generates a collection of C functions that transmit that code in pre-tokenised form to the DPS extension. Pswrap is documented in [PSWRAP].

2.3. Sample clients

X11R6.8.1 contains three sample DPS clients, dpsinfo, dpsexec and texteroids. They are documented in their respective manual pages.

A number of sample clients that depend on Motif are available in urlnam. Additional sample clients can be found as part of GtkDPS (see above).

The GNUstep environment can be compiled to use DPS for all rendering; for more information, please see the GNUstep site.


X and DPS : The DPS client side
Previous: Introduction
Next: The DPS server side