Common Desktop Environment: Programmer's Overview

Chapter 2 Development Environment Considerations

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 Solaris Common Desktop Environment: 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 2.1 with bug fixes and enhancements. (For a description of these enhancements, see Appendix A, 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

Characteristics of Existing X-based Applications 

Interoperability Status with Desktop 

Motif 1.2 (and later) drag and drop (using preregister protocol) 

Yes 

Motif 1.2 (and later) drag and drop (using dynamic protocol) 

No [This is a Motif 1.2 drag-and-drop dynamic protocol interoperability problem, and it is not due to the Common Desktop Environment.]

Cut and paste (all applications) 

Yes  

OPEN LOOK drag and drop 

Yes (except multiple-item  

drag and drop) [This is implemented through a protocol translation mechanism in the drop site database manager (dsdm).]

ToolTalk Media Exchange and Desktop protocols 

Yes 

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

Directory 

Subdirectory 

Contents 

examples

 

Subdirectories that contain source code for development environment component demo programs 

 

 

README file 

 

dtaction

Action invocation API demos 

 

dtbuilder

Application Builder examples 

 

dtcalendar

Calendar API demos 

 

dtdnd

Drag-and-drop API demos 

 

dtdts

Data-typing API demos 

 

dthelp

Help API demos 

 

dtksh

dtksh example scripts

 

dtsession

Session Manager API demos 

 

dtterm

Terminal Emulator widget API demos 

 

dtwidget

Common Desktop Environment Motif widgets demos 

 

dtwsm

Workspace Manager API demos 

 

template

Template Common Desktop Environment application 

 

motif

Motif 1.2 API demos 

 

motif/clipboard

XmClipboard API demo

 

motif/dogs

Widget binary compatibility mechanism demo 

 

motif/draganddrop

Motif 1.2 drag-and-drop API demo 

 

motif/periodic

Motif widgets demo 

 

tt

ToolTalk Messaging Service demos 

include

 

Development environment library header files 

 

csa

Calendar header files 

 

Dt

Header files for DtSvc, DtWidget, DtHelp, and

DtTerm

 

Mrm

Motif 1.2 resource manager header files 

 

Tt

ToolTalk Messaging Service header files 

 

Xm

Motif 1.2 toolkit header files 

 

uil

Motif 1.2-callable UIL compiler header files 

lib

 

Library files for libcsa (Calendar),

libDtHelp (Help system),

libDtSvc (actions, data typing, drag and drop, Session Manager, Workspace Manager),

libDtTerm (Terminal Emulator),

libDtWidget (Common Desktop Environment Motif control and editor widgets),

libMrm (Motif 1.2 resource manager),

libUil (Motif 1.2-callable UIL compiler),

libXm (Motif 1.2 toolkit),

libtt (ToolTalk)

sparcv9 (a subdirectory containing 64-bit versions of all the libraries in the lib sudirectory)

man

 

Development environment man pages 

 

man1

Client and utility man pages 

 

man3

API man pages 

 

man4

Data formats 

 

man5

Header file and action man pages

64-bit Libraries

The libraries listed under the lib subdirectory are available in 64-bit versions in the sparcv9 subdirectory (see Table 2-2). These libraries enable the development of 64-bit applications for CDE.