Presentation Manager API Enhancements in OS/2 V2.0

The 32-bit Presentation Manager API remains largely unchanged in OS/2 V2.0, though there are a number of new functions, mostly to help the programmer rather than adding significant new function. For a complete review of the changes and enhancements, see IBM OS/2 Version 2.0 Application Design Guide, which includes a chapter comparing 16-bit and 32-bit OS/2 functions, including a section covering Presentation Manager. The following section is a summary of that information.

Functions Removed

A number of 16-bit PM functions are not included in the 32-bit set. In most cases these have been replaced by new 32-bit functions, or are no longer appropriate with the new shell. Areas affected are:

  • Heap management functions

  • Program list (group windows)

  • Initialization file functions

  • Window locking

  • Window management.

    Printing

    All the printing functions, which previously had names with the prefix DosPrint, have been renamed to use the prefix Spl.

    Workplace Shell

    A number of new functions have been introduced giving PM programs an interface to the shell. These include, for example, the WinRegisterObjectClass() and WinCreateObject() functions, which allow a program to register and create Workplace Shell objects. The self-explanatory WinShutDownSystem() function provides a capability that was missing in previous releases.

    Dynamic Data Facility

    These new functions, which have the function name prefix Ddf, are intended to be used by programs that provide IPF text dynamically at run time. Such programs receive messages from IPF when they are to display their information, at which time they must build and display the text requested.

    The DDF functions enable the program to format the text into paragraphs, lists and headings in such a way that it can easily be reformatted when the window is resized. Functions are provided to allow the creation of hypertext links, references to bitmap data, and to specify what sort of text formatting is required (left or right justification, for example).

    Standard Font and File Dialogs

    Many applications offer their users the option of loading and saving files from and to disk, and CUA defines the dialog that should be presented to the user so that he can select the appropriate disk, directory and file to use. The standard file dialog function, WinFileDlg(), implements this dialog with very little programming effort.

    The standard font dialog, invoked by means of the WinFontDlg() function, does the same for those applications that allow font selection.

    These dialogs, which are also discussed in New Presentation Manager Features, significantly improve programmer productivity when file or font selection facilities are required. They also ensure that the dialogs used by different applications present a totally consistent user interface.

    New Window Classes

    OS/2 V2.0 introduces several new control window classes, which are described in New Presentation Manager Features, along with some corresponding new messages.

    Graphics Functions

    A number of new GPI functions are provided, mostly related to the use of fonts and characters.

    PM Helper Macros

    A set of helper macros is provided that simplify interaction with some of the more commonly used control window classes. The use of the macros can reduce the need explicitly to send messages to such windows for simple tasks such as inserting an entry into a list box, or querying the state of a checkbox.

    Being macros, these functions are expanded by the C pre-compiler into PM calls to send the relevant messages so, although they are coded as functions, no type-checking will be applied by the compiler to the arguments.


    [Back: Presentation Spaces and Device Contexts]
    [Next: The Workplace Shell Application Model]