HP 3000 Manuals

HP Motif XL(TM) [ COMMUNICATOR 3000/XL XL RELEASE 3.0 ] MPE/iX Communicators


COMMUNICATOR 3000/XL XL RELEASE 3.0

HP Motif XL(TM) 

by Scott Cressler 
Computer Systems Division 

The following information describes some of the technical procedures for
using HP Motif XLtm1 

DEVELOPING THE CLIENT 

An X application is called a client.  This is due to the client/server
nature of the X Window Systemtm2.  The X client requests display services
from a process called an X display server.  The server controls a high
resolution, bit-mapped monitor, a keyboard and a pointing device, such as
a mouse.  The server executes on the same machine to which these devices
are connected, but the client can be executing on another machine on the
network.

An HP Motif XL client application executes on a 900 Series HP 3000 and
uses the X display server on a 300 or 400 Series HP 9000 workstation or
HP 700/X terminal.  By calling the functions provided by the Xlib, Xt and
Xm (OSF/Motiftm1) libraries, the application can present graphics and a
graphical user interface on this X display.

A New Client 

An HP Motif XL client must be written in the C language.  Clients that
you are creating for the first time on the HP 3000 should be written to
use the interfaces provided by X Version 11, Release 4 and OSF/Motif
Release 1.1.  Documentation and classes are available to help you learn
both interfaces.

A Ported Client 

If you are porting the client to the HP 3000 from another platform, there
are some changes that you must make to the source code.  The changes are:

   *   The client should be updated to be consistent with X Version 11,
       Release 4 and OSF/Motif 1.1.  This implies changes in many X and
       OSF/Motif clients, regardless of the platform.

   *   The header file MPEXL.H must be included before any other header
       files.

   *   Since file naming on MPE XL is more restrictive than on other
       platforms, some of the names of the X and OSF/Motif header files
       are different on MPE XL. Includes of these files must be modified
       as discussed later in this article.

   *   Any system intrinsic calls used on the other platform that are not
       available on MPE XL must be changed.

Include Files 

The manual, HP Motif XL Programmer's Supplement (P/N 36394-90001), lists
the names of the X and OSF/Motif header files, on both HP-UX and MPE XL.
When the name has been changed on MPE XL to conform to MPE file naming,
the include statement must refer to the correct file name when the code
is being compiled on MPE XL. You should use the following format to allow
portability to and from HP-UX and MPE XL. This is an example of an
include of one of the Xt header files, Intrinsic.h:

Example 

     #ifdef mpexl
     #include <X11/Intrnsic.h>
     #else
     #include <X11/Intrinsic.h>
     #endif

When compiled on MPE XL, the mpexl define will be automatically defined
by the C/XL compiler.  This will cause the file INTRNSIC to be included.
However, on HP-UX mpexl is not defined and the file Intrinsic.h will be
included.

COMPILING THE CLIENT 

A simple example of an HP Motif XL client application is included with
the product.  Use the following command to compile this application:

Example 

     :CCXL PIZZAC.EXAMPLE.HPX11,PIZZAO,PIZZAL;INFO="-IH.HPX11"

This command will invoke the C/XL compiler to compile the source file
PIZZAC.EXAMPLE.HPX11 into a local object file PIZZAO. The listing of the
compile will be in the local file PIZZAL. The INFO string provides
optional commands to the C/XL compiler.  The -I option changes the way
the compiler searches for header files in include statements.  Given an
include statement of the form:

Example 

     #include <X11/Intrnsic.h>

The compiler will search the group H.HPX11 for a file named INTRNSIC. All
HP Motif XL header files are located in this group, so the file will be
found.  If the file is not located there, e.g., the C standard header
file STDIO is not in H.HPX11, the compiler will then search in the group
H.SYS.

LINKING THE CLIENT 

Now the compiler has produced an object file.  This object file must be
linked to several relocatable libraries (RLs) to create a program file
that uses HP Motif XL. Use the following command to link the PIZZA
application:

Example 

     :LINK PIZZAO,PIZZA;RL=LIBXM.LIB.HPX11,LIBXT.LIB.HPX11,LIBX11.LIB.H PX11,&
     :     LIBC.LIB.SYS,LIBCRAND.LIB.SYS,LIBCANSI.LIB.SYS

This command links the necessary code from the RLs to the object file
PIZZAO into the program file PIZZA. LIBXM contains OSF/Motif functions.
LIBXT contains Xt Toolkit Intrinsics functions.  LIBX11 contains X
functions.  The LIBC, LIBCRAND and LIBCANSI libraries contain functions
used by the HP Motif XL libraries.

RUNNING THE CLIENT 

You can now run the program file to present its X user interface on an X
display.  You could use the following commands to run PIZZA, telling it
to display on the workstation with a network node name of MYNODE.

Example 

     :SETVAR DISPLAY "MYNODE:0"
     :PIZZA

The application will now make a connection to the MYNODE workstation
across the LAN. It will request the X display server on MYNODE to display
a window that contains several buttons.  These buttons can be used to
choose the size of and toppings on a pizza, and the application will
display the price of the pizza.

Once the CI variable DISPLAY has been set, e.g., in a logon UDC, all HP
Motif XL applications will connect to that display.  To connect to
another display, for example one named OTHRNODE, you could use the
following command, without changing the DISPLAY CI variable:

Example 

     :PIZZA "-display othrnode:0"

1OSF, Motif and OSF/Motif are trademarks of the Open Software Foundation.

2The X Window System is a trademark of the Massachusetts Institute of
Technology.



MPE/iX Communicators