[ Previous | Next | Contents | Glossary | Home | Search ]
Motif 2.1 Widget Writer's Guide

What is WML?

Another way to make your new widgets accessible to UIL applications is to create a new UIL compiler that understands your new widgets. Motif provides the Widget Meta-Language (WML) facility to help you do this.You can use WML in two ways:

  1. Compile a customized WML file into a Widget Meta-Language Database (WMD) file. The UIL compiler reads this file at runtime and processes the new or modified widget definitions dynamically.

  2. Build a new UIL compiler by running the WML facility with a customized WML file.

    This section explains how to write an appropriate WML file. Later sections of this chapter will explain how to build a new UIL or WMD from your WML file.

    The WML facility generates the components of the UIL compiler that can change depending on the widget set. WML adds support in UIL for additional widgets that are not in the Motif standard widget set or for a totally new widget set.

    UIL is made up of the following:

    1. Static syntax

    2. Dynamic syntax

    3. Data types

    4. Static Syntax Elements

      The static syntax elements are the basic syntax and keywords of UIL. These elements do not change when the widget set is modified. The static syntax elements of UIL are defined in the file Uil.y in the WML source directory.

      Dynamic Syntax Elements

      The dynamic syntax elements are the parts of UIL that change with the widget set. These elements describe the widget and gadget classes supported by UIL, including their resources and hierarchy. The dynamic elements of UIL are defined in WML files. The motif.wml file (stored in the WML source directory) defines the dynamic elements of the standard Motif widget set. The Exm.wml file (in the demos/lib/Exm/wml directory) defines the dynamic elements of the Exm demonstration widget set.

      Data Types

      The data type elements describe the allowable data types for each widget and gadget resource. Although the data types do not change, the resources that they are assigned to change with the widget set. The allowable data types for each resource are defined in the same file as the dynamic syntax elements.

      The WML facility combines the static syntax, dynamic syntax, and data type elements to produce new source code for UIL. This allows a developer to modify the dynamic elements of UIL, adding resources, widgets, gadgets, or even new widget sets.

      For more information on the syntax of WML files, see the WML(5X) reference page in the Motif Programmer's Reference. The next section explores a sample WML file.

      [ Previous | Next | Contents | Glossary | Home | Search ]