Application Programming Interface

The OS/2 application programming interface (API) gives applications access to all the features of the operating system. These features, such as windows, device-independent graphics, and multitasking, enables you to create applications that make optimal use of the computer's memory, display, and processor while still meeting the needs of a wide range of users through either the traditional character-based interface or the PM graphical user interface.

The OS/2 application programming interface consists of functions that can be organized into the distinct groups shown in table [*].


Table: OS/2 Function Groups
GROUP USAGE
DDF Dynamic-data formatting functions. Use to create and manage online, context-sensitive help information dynamically. These functions let you display both text and graphics and set up hypertext links between information units.
DEV PM device functions. Use to open and control PM device drivers. These functions let you create device contexts that you can associate with a presentation space and use with the Gpi functions to carry device-independent graphics operations for displays, printers, and plotters.
DOS Control Program functions. Use in full-screen and Presentation Manager sessions to read from and write to disk files, to allocate memory, to start threads and processes, to communicate with other processes, and to access computer devices directly. Most functions in this group can be used in PM applications.
DRG Direct manipulation functions. Use to move graphical representations (icons, for example) around the screen using a pointing device, such as a mouse. Drg functions let you initialize the structures that convey the necessary information about each object to the target and which describe the image to be displayed during the drag operation. They provide the system with the type, rendering mechanism, suggested name, container or folder name, name, true type, and native rendering mechanism of the objects being manipulated.
GPI Graphic-programming-interface functions. Use to create graphics output for a display, a printer, or other output devices. The Gpi functions give you a full range of graphic primitives, from lines to complex curves to bit maps. You choose the attributes for the primitives (such as color, line width, and pattern) and then draw lines, character, and shapes. The retained-graphics capability lets you save the drawings in segments and build complex pictures by drawing a chain of segments.
PRF Profile functions. Use to tailor some of the aspects of the system, including the names of ports, printers, printer drivers, and queues. Prf functions also enable you to change the spooler path, screen colors, the default printer and queue, the program list, and application settings.
SPL Spooler functions. Use to allow your applications to write data direct to a spool file. This means that data by-passes the presentation driver, so it must be in a format that the printer can understand. Your applications must format the data.
WIN Window-manager functions. Use to create and manage windows. PM applications use windows as the main interface with the user. Win functions let you create menus, scroll bars, and dialog boxes that let the user select commands and supply input. Your application receives all mouse and keyboard input as messages from the message queue. Win functions let you retrieve messages from the queue and dispatch them to the window for which the input is intended.