JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
ToolTalk User's Guide
search filter icon
search icon

Document Information

Preface

1.  Introducing the ToolTalk Service

2.  An Overview of the ToolTalk Service

3.  Message Patterns

4.  Setting Up and Maintaining the ToolTalk Processes

5.  Maintaining Application Information

6.  Maintaining Files and Objects Referenced in ToolTalk Messages

7.  Participating in ToolTalk Sessions

8.  Sending Messages

9.  Dynamic Message Patterns

10.  Static Message Patterns

11.  Receiving Messages

12.  Objects

13.  Managing Information Storage

14.  Handling Errors

A.  Migrating from the Classing Engine to the ToolTalk Types Database

B.  A Simple Demonstration of How the ToolTalk Service Works

Inter-Application Communication Made Easy

Adding Inter-Operability Functionality

Modifying the Xedit Application

Modifying the Xfontsel Application

We Have Tool Communication!

Adding ToolTalk Code to the Demonstration Applications

Adding ToolTalk Code to the Xedit Files

Adding ToolTalk Code to the Xfontsel Files

C.  The ToolTalk Standard Message Sets

D.  Frequently Asked Questions

Glossary

Index

Adding Inter-Operability Functionality

Before the tools are able to inter-operate, you need to make modifications to the .c and Makefiles for each of the applications; and to the header file for the Xedit application. You also need to create a new file to declare the ToolTalk process type (ptype) for the Xfontsel application.

Use any standard editor, such as vi, to make these modifications and to create the ptype file.

Modifying the Xedit Application

To modify the Xedit application so that it will be able to communicate with the Xfontsel application, you need to modify the following files:

For the ToolTalk demonstration, Xedit needs to know about the ToolTalk header file. Xedit also needs to know about the new ToolTalk commands in the xedit.c file. These changes are made to the xedit.h file, as shown with commented explanations in .

Next, you need to add code to the Xedit.c file to set the ToolTalk session, make a button for the font change function, and to allow Xedit to receive and process ToolTalk messages. These changes to the file are shown with commented explanations in .

Now add code to the commands.c file so that Xedit can tell the Xfontsel application to send a reply when the font change has been completed, or to notify it if the operation failed. You also need to add code that tells Xfontsel what operation Xedit wants performed. These changes to the file are shown with commented explanations in .

The final modification you need to make to the Xedit program is to change the Makefile so that it uses the ToolTalk libraries. To do this, add the -ltt option as follows:

LOCAL_LIBRARIES = -ltt $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)

After you have made the indicated changes to the Xedit files, compile the Xedit program.

Modifying the Xfontsel Application

To modify the Xfontsel application so that it will be able to communicate with the Xedit application, you need to modify the following files:

You also need to create a new file to declare the ToolTalk ptype for the Xfontsel application.

For the ToolTalk demonstration, Xfontsel needs to know:

Xfontsel also needs to display an apply button and a command box to make the font change. In addition, you need to add code to tell Xfontsel when to send a ToolTalk callback message, and how to join the ToolTalk session. These modifications are made in the Xfontsel.c file, as shown in with commented explanations.

Next, modify the Makefile for the Xfontsel program so that it uses the ToolTalk libraries. To do this, add the -ltt option to the as follows:

LOCAL_LIBRARIES = -ltt $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)

The ToolTalk types mechanism is designed to help the ToolTalk service route messages. You first define a process type (ptype), and then compile the ptype with the ToolTalk type compiler, tt_type_comp. For the ToolTalk demonstration, you need to create a ptype file for the Xfontsel application, as shown in the following listing..


Note - directory_name is the pathname to the directory in which the modified Xfontsel files reside.


ptype xfontsel {                /* Process type identifier */
    start “/directory_name/xfontsel”;    /* Start string */


 handle:                    /* Receiving process */
        /* A signature is divided
         * into two parts by the => as follows:
         * Part 1 specifies how the message is to be matched;
         * Part 2 specifies what is to be taken when
           * a match occurs.
          */
 session GetFontName(out string fontname) => start;


}

When your tool declares a ptype, the message patterns listed in it are automatically registered; the ToolTalk service then matches messages it receives to these registered patterns. These static message patterns remain in effect until the tool closes communication with the ToolTalk service.

After you have created the ptype file, you need to install the ptype. To do this, run the ToolTalk type compiler as follows:

machine_name% tt_type_comp xfontsel.ptype

where xfontsel.ptype is the name of your ptype file.

After you have made the indicated changes to the Xfontsel files, created a ptype file, and installed the pytpe, compile the Xfontsel program.