Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Common Desktop Environment: Advanced User's and System Administrator's Guide > Chapter 11 Creating Data Types Manually

Defining the Data Attributes of a Data Type

» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

The DATA_ATTRIBUTES definition defines the appearance and behavior of the data type. It specifies the name of the data type, and provides the ability to specify:

  • The File Manager icon (ICON field)

  • The double-click behavior and contents of the Selected menu (ACTIONS field)

  • The data type's on-item help (DESCRIPTION field)

Specifying the Icon Image Used for a Data Type

Use the ICON field to specify the icon used in File Manager. If you do not specify an icon image, File Manager displays only a label.

The value of the ICON field can be:

  • A base file name.

    The base file name is the name of the file containing the icon image, minus the file-name suffixes for size (l,m, and t) and image type (bm and pm). For example, if files are named GameIcon.m.pm and GameIcon.t.pm, use GameIcon.

    If you use the base file name, the icon files must be placed in a directory on the icon search path:

    • Personal icons: HomeDirectory/.dt/icons

    • System-wide icons: /etc/dt/appconfig/icons/language

  • An absolute path to the icon file, including the full file name.

    You should use the absolute path only if the icon file is not located on the icon search path. For example, if icon file GameIcon.m.pm is placed in the directory /doc/projects, which is not on the icon search path, the value of the ICON field would be /doc/projects/GameIcon.m.pm.

Table 11-1 “Icon Names and Sizes for Data Type Icons” lists icon sizes you should create and the corresponding file names.

Table 11-1 Icon Names and Sizes for Data Type Icons

Size in Pixels

Bitmap Name

Pixmap Name

48 by 48

name.l.bm

name.l.pm

32 by 32

name.m.bm

name.m.pm

16 by 16

name.t.bm

name.t.pm

 

Associating Data Types with Actions

There are two ways that data types are associated with actions:

  • The ACTIONS field in the DATA_ATTRIBUTES definition lists the actions that will appear in File Manager's Selected menu. The first action in the list is the default (double-click) action.

  • Actions can be restricted to specified data types using the action definition's ARG_TYPE field.

For example, the following data type definition creates a data type for special "readme" files created by your system administrator that use the naming convention *.rm.

DATA_ATTRIBUTES SysReadmeFile
{
ICON SysReadMe
ACTIONS Open,Respond
}
DATA_CRITERIA SysReadmeFileCriteria
{
NAME_PATTERN *.rm
DATA_ATTRIBUTES_NAME SysReadmeFile
}

A special Respond action is defined below for the file. It opens a writable copy of the file in Text Editor. When the file is saved and Text Editor is exited, the file is mailed to the system administrator (mail address sysadmin@utd).

ACTION Respond
{
ARG_TYPE SysReadmeFile
EXEC_STRING /bin/sh -c 'cp %Arg_1% $HOME/readme.temp;\
chmod +w $HOME/readme.temp; \
dtpad $HOME/readme.temp; \
cat $HOME/readme.temp | \
/usr/bin/mailx sysadmin@utd; \
rm $HOME/readme.temp'
WINDOW_TYPE NO_STDIO
}

Hiding Files Based on Data Type

If a file is an invisible data type, it never appears in File Manager.

Use the PROPERTIES field in the DATA_ATTRIBUTES definition to specify that objects of this type be hidden:

PROPERTIES  invisible

Specifying Behaviors When the File Is Manipulated

The following DATA_ATTRIBUTES fields are used primarily by application programmers. They specify how files behave when the user performs various desktop activities.

For more information, see the Common Desktop Environment Programmer's Guide, which is part of the developer environment documentation.

Field

Description

MOVE_TO_ACTION

For containers such as directories. Specifies an action to be run when a file is moved to a container of this data type.

COPY_TO_ACTION

For containers such as directories. Specifies an action to be run when a file is copied to a container of this data type.

LINK_TO_ACTION

Specifies an action to be run when a file is linked to a file of this data type.

IS_TEXT

Specifies that files of this data type contain text that can be displayed in a text box.

MEDIA

Specifies the corresponding ToolTalk media type.

MIME_TYPE

Specifies the corresponding MIME type.

X400_TYPE

Specifies the corresponding X400 type.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.