Page 381 - DCAP103_Principle of operating system
P. 381
Principles of Operating Systems
Notes Dialog boxes are popped up to inform the user of some event or ask a question. They may
contain buttons, sliders, or text fields to be filled in. Sounds can also be associated with dialog
boxes, for example for warning messages.
There are hundreds of drawing and painting functions available, ranging from setting a single
pixel to doing complex region clipping operations. Many calls are provided for drawing lines
and closed geometric figures of various kinds, with detailed control over textures, colours,
widths, and many other attributes.
Figure 13.1: Some Categories of Win32 API Calls
API group Description
Window management Create, destroy, and manage windows
Create, destroy, and append to menus and
Menus
menu bars
Dialog boxes Pop up a dialog box and collect information
Painting and drawing Display points, lines, and geometric figures
Text Display text in some font, size, and colour
Bitmaps and icons Placement of bitmaps and icons on the screen
Colours and palettes Manage the set of colours available
Pass information from one application to
The clipboard
another
Input Get information from the mouse and keyboard
Another group of calls relates to displaying text. Actually, the text display call, TextOut, is
straightforward. It is the management of the colour, point sizes, typefaces, character widths,
glyphs, kerning, and other typesetting details where the complexity comes in. Fortunately, the
rasterization of text (conversion to bitmaps) is generally done automatically.
Bitmaps are small rectangular blocks of pixels that can be placed on the screen using the
BitBlt Win32 call. They are used for icons and occasionally text. Various calls are provided for
creating, destroying, and managing icon objects.
Many displays use a colour mode with only 256 or 65,536 of the 2 possible colours in order
24
to represent each pixel with only 1 or 2 bytes, respectively. In these cases a colour palette is
needed to determine which 256 or 65,536 colours are available. The calls in this group create,
destroy, and manage palettes, select the nearest available colour to a given colour, and try to
make colours on the screen match colours on colour printers.
Many Windows 2000 programs allow the user to select some data (e.g., a block of text, part of
a drawing, a set of cells in a spreadsheet), put it on the clipboard, and allow it to be pasted into
another application. The clipboard is generally used for this transmission. Many clipboard formats
374 LOVELY PROFESSIONAL UNIVERSITY