Common Desktop Environment: Programmer's Overview

Action Invocation

The action invocation API enables applications to invoke desktop actions on file or buffer arguments. It chooses a suitable action for the file or buffer based on the Class, Type, Mode, and Number of the action arguments. For example, an Open action might invoke an image viewer for GIF files, a word processor for complex documents, and a simple text editor for ordinary ASCII files. Your application need not concern itself with the details of action selection or invocation.

Use the action invocation API so that your application uses the same mechanisms as the rest of the desktop. The user can then experience uniform desktop behavior.

The action functions in the libDtSvc library provide a way to invoke desktop actions (such as Open and Print) for files or buffers. They contain parameters that enable you to modify an action's behavior. The action invocation API consists of the following functions:

DtActionInvoke()

Invokes the specified action on its arguments, which can be files or buffers 

DtActionLabel()

Provides access to the localizable label string associated with an action 

DtActionDescription()

 

 

Returns a string containing the description information associated with the action your application called 

DtActionExists()

a Boolean function that checks whether a given name corresponds to an existing action 

DtActionIcon()

Returns the name of the icon associated with the specified action 

Library and Header Files

The desktop services library, libDtSvc, provides access to many desktop APIs, including that for actions. Include the Dt/Dt.h and Dt/Action.h header files to access the actions API.


Note -

If your application uses any of the action invocation APIs, 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.


Demo Programs

You can find the action invocation demos in /usr/dt/examples/dtaction. Read the README file for detailed information on the demos.

Related Documentation

For more information on actions, see the relevant man pages and the Solaris Common Desktop Environment: Programmer's Guide.