包含在查找更多文档专项支持资源 | 以 PDF 格式下载本书 (2592 KB)
Chapter 16 BinderThe Binder application allows you to bind icons, colors, applications, open methods and print methods to files. A binding is a connection between file types and elements such as applications to be started when a file is opened, print scripts, or icons that the File Manager, Print Tool, Mail Tool, and other DeskSet applications use to display and operate on files. Audio Tool sound files are also bound. Because the DeskSet applications come with a default set of bindings, most DeskSet users will not need to use the Binder application. You may want to use the Binder, however, to customize your DeskSet applications. For example, you use the Binder if you want to change the way particular files are displayed in the File Manager or other DeskSet applications, or if you want to change the application used to open or print a file. Programmers who want to integrate applications into the DeskSet should see the Desktop Integration Guide for programmer information about the Binder database. If you are not a programmer working on the integration of applications into the DeskSet, this chapter provides all the information you need to know about the Binder and the underlying Binder database. To open the Binder application, choose Workspace -> Programs -> Binder. Binder Icon and WindowThe Binder icon and base window are shown in Figure 16-1. Figure 16-1 Binder Icon and Base Window![]() Binder Control AreaUse the buttons in the Binder control area as follows:
Binder DatabasesThe scrolling list in the Binder base window displays the bindings stored in three different databases: a network database, a system database, and a private user database. These are the Binder databases used by all applications in the DeskSet environment to determine how to display, print, and open any file. The network database consists of the Binder entries shared by many workstations across a network. The system database consists of the Binder entries shared by multiple users on one workstation. Your private database consists of the Binder entries that apply only to you. Updating and Viewing Private Binder EntriesIf you start Binder from the Workspace menu, or from the command line without any command-line options, you can save only the changes to your private user database. Most users will run the Binder application this way. The first time you run the Binder application, all your bindings will be system or network entries. If you want to customize a system or network entry, you can copy it to your user database, and then modify the user entry. When you add a new binding, it will be added as a private entry. A message in the footer of the Binder window tells you whether the currently selected entry is a Read-Only Entry. These are the system and network entries that you normally cannot modify. These entries can be duplicated into your private database and then modified. Refer to "Updating and Viewing System and Network Binder Entries" for more information. Use the items on the View menu to determine the Binder entries displayed in the base window scrolling list, as follows:
Updating and Viewing System and Network Binder EntriesIf you want to modify your system bindings, you must become root and start Binder by typing binder -system in a Shell Tool or Command Tool. In order to modify the network bindings, you need to have root access on your OpenWindows server workstation, and you need to start Binder by typing binder -network in a Shell Tool or Command Tool. If you cannot start the Binder as root, you probably need to restart OpenWindows with the noauth option. To do this, exit the window system and type openwin -noauth at the console. The entries on the View menu have a different meaning if you are running the Binder with the command-line options listed previously. If you run the Binder with the -system option, all new entries are added to your system database. In this case you use the View menu as follows:
If you run the Binder with the -network option, all new entries are added to the network database. In this case the View menu is dimmed and unavailable. Only the network entries are displayed. To modify entries for local use on your machine, you need to copy them from the system and network databases into your private database. To copy an entry to your database, first scroll through the list of Binder entries in the Binder base window until you see the one you want to modify.
Binder PropertiesWhen you want to modify or add new bindings, use the Props menu or the Props keyboard key to display the Properties window. You fill in or change the information on these properties windows to specify your bindings. There are two categories of Binder properties: Icon properties and File Type properties. These categories are described in the following sections. The Apply and Reset buttons at the bottom of the Properties window apply or reset the changes made to both categories, Icon and File Type, at the same time. If you want to make both Icon and File Type changes, you only need to click SELECT on Apply once, after you have finished making both sets of changes. Icon PropertiesThe Icon Properties window displays all the information used by DeskSet applications to display and operate on files. The icon properties determine how files of a particular type are displayed by DeskSet applications (such as File Manager), and what happens when files of that type are opened or printed. You display the Icon Properties window by selecting an entry in the base window scrolling list and choosing Icon from the Props menu. The default Icon Properties window shows only the information needed to display a type of files, as shown in Figure 16-4. Figure 16-4 Default Icon Properties WindowYou can click SELECT on the plus sign (+) button at the lower right of the window to expand the window to display the full set of properties, including information needed to open and print a class of files, as shown in Figure 16-5. Figure 16-5 Expanded Icon Properties WindowYou can shrink the window back down to the smaller size by clicking SELECT on the minus sign (-) button at the bottom of the expanded window. This section describes the fields in the expanded Icon Properties window. Icon and Binder Entry NameThe Icon field shows the current icon and Binder database entry name. Use the text field to modify the entry name, and use the following fields to modify the appearance of the icon. Double-click SELECT on the temporary unique name to the right of the icon to modify the icon. Image FileThe Image File text field displays the path of the 32 by 32 pixel (XView format) icon that is bound to the current Binder entry. The icon is displayed in the base window scrolling list and the Icon field. This is the same icon displayed by the File Manager, Mail Tool, and other applications in the DeskSet environment. Mask FileThe Mask File text field displays the path of an icon color mask. A color mask defines the region of the icon to which the background color is applied. You can think of this as a stencil cut out overlaid on top of your icon before the background color is applied to the icon. If no icon mask file is specified, the entire icon is colored with the background color. The icon mask does not have to be a 32 by 32 (XView format) pixel icon. If it is larger, only the first 32 by 32 (XView format) pixels in the top left corner of the icon are used. For example, Figure 16-6shows the icon and the icon mask for the printtool-prog Binder entry. The image on the left is the icon image, and determines what is outlined in the foreground color. The image on the right is the icon mask, and determines the area of the icon colored with the background color. Figure 16-6 The printtool-prog Icon and printtool-prog Icon Mask
Image File and Mask File LineThese text lines specify the path (directory location) to the icon and the icon's mask--a stencil of the image that determines the area of the icon colored with the background color. To modify the current icon in its appearance on the workspace, do not modify these paths. Foregr (Foreground) ColorThe foreground color is the color that the icon itself is drawn (icon outline) within the File Manager and other DeskSet applications. If no value is given for this field, the foreground color is black. If you want to pick a new foreground color, click SELECT on the window button to the right of the Foregr Color text field to invoke the Color Chooser application. See "Using the Color Chooser Palette with Binder " for more information. Alternatively, you can type three numbers in the Foregr Color text field to indicate the amount each of red, green, and blue in the foreground color. Color saturation values range from 0 through 255. For example, 255 0 0 represents a bright, solid red color. Backgr (Background) ColorThe background color is the color the icon is colored within (the lines of the icon) the File Manager and other DeskSet applications. If no value is given for this field, the background color is white. If you want to pick a new background color, click SELECT on the button to the right of the Backgr Color text field to invoke the Color Chooser. See the section "Using the Color Chooser Palette with Binder " for more information. Alternatively, you can type three numbers in the Backgr Color text field to indicate the amount of red, green, and blue, respectively, of the background color. Color saturation values range from 0 through 255. For example, 0 255 0 represents a bright, solid green color. ApplicationThe Application text field defines the application that is invoked whenever any file defined by the current binding is opened in File Manager or other applications in the DeskSet environment. This text field is on the expanded portion of the Icon Properties window. Note - If there is a ToolTalk method available, applications do not use this field. Refer to the Desktop Integration Guide. Print MethodThe Print Method defines how a file is printed in the DeskSet environment. If no Print Method is specified, the default print method of the application the file is being printed from is used. This field is on the expanded portion of the Icon Properties window. Note - DeskSet applications such as File Manager and Print Tool expect print methods to be in this format: cat $FILE | (pipe1) | (pipe2) ... Defining a print method of another type may produce unexpected results with the deskset tools. See also Chapter 10, Print Tool, for information on overriding a default Print Method. File Type PropertiesYou use the File Type Properties window to define the set of files that are bound to the icon, colors, and applications defined in the Icon Properties window. You display the File Type properties by choosing File Types from the Props menu or the Category choice on the Properties window. The default File Type Properties window is shown in Figure 16-7. Figure 16-7 Default File Type Properties window
You can click SELECT on the plus sign (+) button to expand the window to display the full set of properties, including information needed to identify a class of files, as shown in Figure 16-8. Figure 16-8 Expanded File Type Properties window
You can shrink the window back down to the smaller size by clicking SELECT on the minus sign (-) button at the bottom of the expanded window. This section describes the fields in the File Type Properties window. File Type Scrolling ListEach entry in the File Type scrolling list defines how a file, or a group of files, is recognized by DeskSet applications. You can think of each entry in the File Type scrolling list as a class of files, which may consist of one file or many files. Each class of files in this scrolling list (each File Type entry) is bound to the Icon properties of the current Binder entry. Note - If you have two identical File Type entries in your Binder database, only the first one that the Binder reads is used. The first Binder entry to use the File Type entry is not necessarily the first Binder entry in the Binder base window scrolling list. Pattern Text FieldUse the Pattern text field beneath the scrolling list to modify the name of a File Type entry. If the files are to be identified by a pattern, this pattern must be the name of the Binding entry. If the currently selected File Type is identified by Content, the Pattern text field is dimmed and unavailable. When there are no items selected on the scrolling list, you can type a pattern into the Pattern text field and press Return to create a new File Type entry. File Type Properties Window ButtonsYou SELECT the buttons to the right of the File Type scrolling list to create and delete File Type entries, and to move them to and from a clipboard, as follows:
You use the Apply and Reset buttons at the bottom of the File Type Properties window to apply your File Type and Icon Properties changes to the current Binder entry, or to reset all the changes you've made since the last Apply. Identify Choice ItemTheIdentify choice item determines how the current class of files (the selected File Type entry) is recognized by DeskSet applications, such as the File Manager. A class of files is recognized either by Name or by Content, as defined in the following sections: Identify By NameIf the Identify choice is by Name, files are recognized by the pattern in the Pattern text field. In this case, the Pattern is often the name of an application. For example, Figure 16-9 shows the clock File Type entry that is bound to the clock-prog Binder entry. Any file called clock will be displayed by the File Manager with the clock icon and colors displayed in the base window scrolling list. (The icon and colors are defined by the clock-prog Icon properties.) Figure 16-9 Clock File Type Entry
When the Identify choice is "by Name" and the Pattern text field contains an asterisk (*), the asterisk in the Pattern means "match any file name here." For example, the File Type Entry *.ps, shown in Figure 16-10, matches all files that end with.ps. These files are PostScript files, and are displayed in the DeskSet with the postscript-file icon displayed in the Binder base window scrolling list. Figure 16-10 The *.ps File Type Entry
An exception to the rule about matching the pattern with the file name occurs with the Binder entries default-app, default-dir, and default-doc. The File Manager application uses these entries to determine the bindings for its default application files, directories (folders), and documents. The File Type patterns for these bindings are default|app, default|dir, and default|doc. You will never, however, actually find a file called default|app, default|dir, or default|doc. See "Changing a Binding" for information about how to change these default File Manager bindings. Identify by ContentIf the Identify choice is by Content, files are recognized by matching file contents instead of the file name. When you choose by Content, the four fields underneath the Identify setting become active. These fields define what the file contents should be to define files of the current File Type, as follows:
See the magic manual page for advanced information about the Tag Type, Tag Mask, and Tag Value fields. Figure 16-11 shows that PostScript files can be recognized by the string "%!" at the beginning of the file (Tag Offset = 0, Tag Type = String, Tag Value =%!). Note that PostScript files can also be recognized by files ending with.ps, as described previously in the section "Identify By Name". Figure 16-11 The postscript-file Content File Type Entry
Figure 16-12 shows the sun-raster File Type entry. This class of files is defined as all files starting with the Long value 0x59a66a95. Figure 16-12 The sun-raster File Type Entry
Creating a New BindingThe following steps explain how to create a new binding. The example binds the cat icon described in Chapter 15, Icon Editor to the cat program file in your /bin directory.
Deleting a Binder EntryTo delete a Binder entry, select the entry in the Binder base window scrolling list, and click SELECT on the Delete button. Then click SELECT on the Save button. The Delete button is dimmed and inactive if the currently selected entry is a read-only entry. Note - When you delete a Binder entry, the File Type entry associated with it is not deleted. If you want to delete the File Type entry, make sure to delete it from the File Type scrolling list before you delete the Binder entry. To delete the File Type entry, select the Binder entry in the base window scrolling list, display the File Type Properties window, select the File Type in the File Types scrolling list, and click SELECT on the Properties window Delete button. Changing a Binding
Using the Color Chooser Palette with BinderYou can use the Color Chooser with the Binder to specify foreground and background colors for the icons displayed by the File Manager or other DeskSet applications. To use the Color Chooser to select Foreground or Background icon colors, click SELECT on the Foregr Color or Backgr Color menu button. (These are the buttons to the right of the text fields.) The Color Chooser is then displayed, as shown in Figure 16-15. Figure 16-15 Color Chooser for Binder's Foreground Color
The icon image with the current Foreground and Background colors is displayed in the upper left corner of the palette shown in Figure 16-15 above. To use a color displayed in the Color Chooser palette: |