Common Desktop Environment: Programmer's Overview

2 Development Environment Considerations


Contents of Chapter:
Common Desktop Environment Characteristics
Underlying Foundations
Running Existing Applications
Libraries and Header Files
Demo Programs
Man Pages
Development Environment Directory Structure
This chapter discusses general information you should know before starting to use the Common Desktop Environment application program interfaces (APIs).

Before you integrate your application into the desktop, you should have a basic understanding of how the desktop works. Install the Common Desktop Environment on your platform and familiarize yourself with its features. For an introduction to the desktop, see the CDE User's Guide or the Desktop Introduction online help volume.


Common Desktop Environment Characteristics

The Common Desktop Environment provides a productive and comfortable desktop environment for UNIX users. As you develop your application, keep in mind the experience that the Common Desktop Environment delivers to its users. Develop your application with the following characteristics in mind, to help make it a powerful, consistent, and predictable part of the Common Desktop Environment:


Underlying Foundations

To compile an application that uses the desktop APIs, you need:

The resulting binary file must be run in an environment in which matching libraries are installed. The run-time libraries are in /usr/dt/lib, and they include the directories listed in Table 2-2.

To run properly, Common Desktop Environment-based applications require an environment in which some files from the following run-time directories are installed:

Your application should depend on only those run-time files explicitly mentioned in the X/Open XCDE standard. It should not depend on files not mentioned in the standard; for example, /usr/dt/appconfig/icons. If you build such dependencies into your application, it should be robust enough to run in an environment in which such files are missing or have changed.

For a listing of the minimum run-time environment required to run a Common Desktop Environment application, see the dtfilsys(5) man page.

The run-time environment includes Common Desktop Environment Motif, which is Motif 1.2.3 with bug fixes and enhancements. (For a description of these enhancements, see Appendix , "Common Desktop Environment Motif.") For more information on the Common Desktop Environment run-time environment, see the run-time documentation set.


Running Existing Applications

Existing X Window System-based applications that are not compiled with any Common Desktop Environment libraries run under the desktop window manager (dtwm) similarly to the way they run under the Motif window manager: they still work. The level of interoperability with the Common Desktop Environment follows these guidelines.

Table 2-1 Interoperability of Existing X-Based Applications with the Common Desktop Environment

If you want to recompile and relink an existing Motif application with the Common Desktop Environment Motif shared libraries, the application must be compatible with Motif 1.2.


Libraries and Header Files

Compile Common Desktop Environment applications against X11R5 header files and libraries, which reside in vendor-specific locations. Table 2-2 lists the locations of all development environment libraries and header files, as subdirectories of /usr/dt.


Demo Programs

The /usr/dt/examples subdirectories contain source code for development environment component demos, as well as a template application. See Table 2-2 for a listing of all demo subdirectories.

Each demo subdirectory contains source files for one or more demo programs, along with makefiles for the programs. It also contains a README file that describes the demos.

The demo whose source is in the template subdirectory is a simple drawing program. This demo illustrates the basic structure of a Common Desktop Environment application that is integrated with the desktop. It is internationalized and contains all localized components in a separate subdirectory. You can use the drawing program source as a template for your application.


Man Pages

The Common Desktop Environment man pages reside in /usr/dt/man. To view them using either the man() command or the desktop man page viewer, you must add /usr/dt/man to the MANPATH environment variable. For example, in your ~/.dtprofile file, set:

MANPATH = $MANPATH:/usr/dt/man

For a listing of the /usr/dt/man subdirectories and contents, see Table 2-2. For more information on the man() command, see the man(1) man page.


Development Environment Directory Structure

Table 2-2 lists the top-level directories in the development environment directory structure and lists their subdirectories. (All of the top-level directory names are prefixed by /usr/dt.)

Table 2-2 Development Environment Directories in /usr/dt



Generated with CERN WebMaker