Common Desktop Environment: Programmer's Overview

Chapter 3 Developing an Application

This chapter presents information specific to developing a Common Desktop Environment application, such as naming conventions and other guidelines. It introduces levels of integration, which are the guidelines for determining the desktop functionality to incorporate into your application to make it increasingly integrated with the desktop. It also provides an overview of the Application Builder, a tool to simplify Common Desktop Environment application development.

Levels of Desktop Integration

Users can run any X11-based application from a shell command line in the Common Desktop Environment. If you want to integrate your application into the desktop, however, there are guidelines for you to follow. The Common Desktop Environment defines three levels of integration to give you maximum flexibility in designing your application or porting an existing application:

For more information on all three levels of integration, see the Solaris Common Desktop Environment: Programmer's Guide. Basic Integration is also discussed in the Solaris Common Desktop Environment: Advanced User's and System Administrator's Guide.

Desktop Naming Conventions

The Common Desktop Environment uses naming conventions similar to those used by X and Motif. Desktop clients, desktop libraries, and other desktop components share a common prefix for externally visible names: dt, Dt, or DT. Private desktop structures, functions, and defines (found in the Common Desktop Environment code; not for developer use) have an _dt, _Dt, or _DT prefix. Table 3-1 lists the desktop naming conventions.

Table 3-1 Desktop Naming Conventions

Name  

Prefix 

Example 

Desktop clients and utilities 

dt

dthelpview

Resource names and classes 

Dt

DtNhelpType, DtCHelpType

Library names 

Dt

libDtHelp

Include references 

Dt

#include <Dt/Help.h>

Public function names 

Dt

DtCreateHelpDialog

Public data structure names 

Dt

DtHelpDialogCallbackStruct

Constant names 

Dt

DtHELP_NEW_WINDOW

Environment variables 

DT

DTHELPSEARCHPATH

Private desktop symbols (structures, functions, defines) 

_dt, _Dt, _DT

_DtHelpFunction, _DtHELP_DEFINE

Table 3-2 lists the exceptions to the preceding naming conventions.

Table 3-2 Exceptions to Desktop Naming Conventions

Name 

Prefix 

Example 

Common Desktop Environment Motif

Xm

XmCreateLabel

dtksh Convenience Functions

Dtksh

DtkshAddButtons

ToolTalk Messaging Service

tt (for functions)

Tt (for typedefs) 

TT (for constants) 

tt_open

Tt_message 

TT_NOTICE 

X11R5

X, Xt

XOpenDisplay, XtCreateWidget


Caution - Caution -

Do not use the prefixes dt, Dt, DT, _dt, _Dt, _DT, Xm, tt, Tt, TT, X, or Xt to define new symbols in your application code. If you do, you might define one that has already been defined--or might be defined in the future--in the Common Desktop Environment, ToolTalk, X11R5, or Motif code.


Public and Private Interfaces

If a Common Desktop Environment interface is documented in the man pages or the Common Desktop Environment documentation set, you can assume that the interface is public unless otherwise stated. An interface is not necessarily public just because it has a header file associated with it. Interfaces that are not documented are private to the Common Desktop Environment and are subject to change without notice.

Guidelines for Common Desktop Environment Databases

You can find the syntax for the desktop databases, such as those used for actions and data types, in man pages located in the /usr/dt/man/man4 directory.

For more information on databases, see the Solaris Common Desktop Environment: Programmer's Guide.

Application Initialization and libDtSvc

If your application uses any of the libDtSvc APIs (for actions, data typing, drag and drop, Session Manager, or Workspace Manager), it must first initialize the libDtSvc library by calling either DtInitialize() or DtAppInitialize(). Refer to the DtInitialize(3) or DtAppInitialize(3) man page for more information.

Application Builder

Application Builder (App Builder) is a tool that enables you to easily create your first graphical user interfaces (GUI) for Common Desktop Environment applications, without having to write code to call the desktop application program interfaces (APIs). It abstracts the Motif toolkit into simple object palettes and object property sheets. You can use App Builder to construct a wide range of applications, from simple GUI-based programs to complex, integrated systems. It supports User Interface Language (UIL) file import and export to enable you to migrate your application among other Motif-based tools and products.

App Builder is ideally suited for use if you:

In fact, even if you do not fit into any of the preceding categories, you will likely find App Builder to be appropriate and helpful for your application development.

Using App Builder, you can:

You can compile and invoke your application from within App Builder. You can execute the build, run, and debug cycles all from a common environment without having to exit and restart App Builder.


Tip -

App Builder is a good learning tool. A full-featured Motif GUI builder called XDesigner is available for purchase from the Sun Microsystems Advanced Developer Tools organization.


Demo Programs

You can find the App Builder example programs in /usr/dt/examples/dtbuilder. Read the README file for detailed information on these programs.

Related Documentation

For more information on Application Builder, see the appropriate man pages, the App Builder help volume, and the Common Desktop Environment: Application Builder User's Guide.