home *** CD-ROM | disk | FTP | other *** search
/ Software Collection (I) / TOOLS.iso / d07 / 18.img / DDHELP.DAT < prev    next >
Encoding:
Text File  |  1992-03-31  |  26.6 KB  |  628 lines

  1. (C) Copyright Microsoft Corporation 1981-1990.  All rights reserved.
  2.  
  3.          DEVICE DRIVER GUIDANCE FOR Microsoft OS/2 VERSION 1.3
  4.          ===============================================
  5.  
  6. *****************************************************************
  7. * The following term, used in this file, is the trademark of the *
  8. * IBM Corporation in the United States and/or other countries:  *
  9. *                                                               *
  10. *      IBM                                                      *
  11. *                                                               *
  12. *****************************************************************
  13.  
  14. This document contains programming information on the following
  15. topics:
  16.  
  17.  -  Improvements to the color palette with IBMBGA.DLL
  18.  -  8514 bit map performance
  19.  -  Changes to the canceling of print jobs
  20.  -  Printing using an OD_DIRECT device context
  21.  -  Writing device drivers to handle monochrome bit maps.
  22.  
  23. *****************************************************************
  24. *                                                               *
  25. *       IMPROVEMENTS TO THE COLOR PALETTE WITH IBMBGA.DLL       *
  26. *                                                               *
  27. *****************************************************************
  28.  
  29. The IBMBGA.DLL driver now has improved support for displaying
  30. color and gray-level images.  This section describes how the
  31. changes affect the programmer, and gives information about the
  32. redesign of the color palette.
  33.  
  34. The changes made to IBMBGA.DLL are:
  35.  
  36. 1. Thirty two 'pure' gray-levels are available in the 256-
  37.    color palette of an IBM 8514/A display adapter with
  38.    extended memory.
  39.  
  40. 2. The range of red hues is reduced to make room for the
  41.    gray-levels.
  42.  
  43. 3. The metrics of the logical color table is changed from
  44.    'Linear RGB' to 'Psychometric RGB'.
  45.  
  46. 4. The GpiRealizeColorTable function is supported.
  47.  
  48. These changes will make icons that were designed for the old
  49. color table appear darker.  Tables 1 and 2 below show the mapping
  50. from (1) the old 8-bit color values to the new and (2) the new
  51. 8-bit color values to the old.  Use these tables to determine
  52. which colors your icons should use to map into the new color
  53. table.
  54.  
  55.  
  56. COLOR PALETTE
  57. -------------
  58.  
  59. The 8514/A display adaptor, with its full memory, allows a
  60. palette of 256 entries at its maximum resolution.  Each
  61. entry has 18-bits of color information, 6-bits each for the
  62. red, green, and blue primary colors, so each entry can be
  63. set to any one of the 256K values (64 x 64 x 64) in the
  64. logical color table.
  65.  
  66. In previous versions of IBMBGA.DLL, the default palette used
  67. a permutation of pure colors (8 reds, 8 greens, and 4 blues)
  68. that gave only two pure grays.  The actual values used for
  69. each pure color were chosen to give a linear progression
  70. of measured intensity from minimum to maximum (Linear RGB).
  71.  
  72. In this version of IBMBGA.DLL, the default palette contains
  73. 32 different pure grays and a range of colors derived from
  74. permutations of 7 reds, 8 greens, and 4 blues.  The actual
  75. values used for each pure color are chosen to give a linear
  76. progression of perceived intensity from minimum to maximum
  77. (Psychometric RGB).
  78.  
  79. Color-mapping from a logical color table, or from a bit-map
  80. color table, to the default palette has been changed so that
  81. all colors that have equal red, green, and blue values map
  82. directly into the most appropriate pure grey.
  83.  
  84.  
  85. GpiRealizeColorTable
  86. --------------------
  87.  
  88. The GpiRealizeColorTable function has been implemented in
  89. IBMBGA.DLL so that an application program can achieve the
  90. highest possible color accuracy in its screen presentation.
  91. Because calls to this function affect everything on the screen,
  92. the calling application must ensure that:
  93.  
  94. 1. If you realize the RGB value at index 0 or 255, you must
  95.    ensure that 0 and 255 have different RGB values.  These
  96.    are the pointer outline and interior; they must be different
  97.    to ensure that the pointer is visible against any color.
  98.    (Note that color tables with format=LCOLF_RGB cannot
  99.    be realized.)
  100.  
  101. 2. The call to GpiRealizeColorTable is made only when the
  102.    application's window is maximized and has the focus.
  103.  
  104. 3. The screen is repainted after making the call to
  105.    GpiRealizeColorTable.  (Note that repainting the screen
  106.    will not change the colors of icons and other bit maps;
  107.    bit-map colors are not remapped by the system.)
  108.  
  109. 4. GpiUnrealizeColorTable is called when the application's
  110.    window is no longer maximized or loses the focus.
  111.  
  112. 5. The screen is repainted after making the call to
  113.    GpiUnRealizeColorTable.
  114.  
  115. If an application that calls GpiRealizeColorTable does not
  116. follow these guidelines, the end-user may have to reboot
  117. the system to restore the normal colors.
  118.  
  119. The GpiRealizeColorTable function does not simply scale down
  120. the logical color values into the physical color palette,
  121. it makes corrections as appropriate to give consistent results
  122. according to the degree of accuracy allowed by the rendering
  123. technique:
  124.  
  125.    'Pure' Color - The system renders the color using the nearest
  126.     color found in the default physical palette.
  127.  
  128.    'Dithered' Color - The system will, if there is no matching
  129.     pure color, render the dithered color by mixing proportions
  130.     of suitable physical colors.
  131.  
  132.    'Realizable' Color - The system renders the color as it is
  133.     defined in the 'realized' physical palette.
  134.  
  135.  
  136. Realizable Color Tables
  137. -----------------------
  138.  
  139. Note that the realizable (LCOL_REALIZABLE) property of a
  140. logical color table is lost if the presentation space is
  141. reassociated.  It is necessary to create the logical color
  142. table again in order to re-establish the realizable
  143. property.  This is only necessary if the presentation space
  144. is associated with a device that supports realization.
  145.  
  146. Also, GpiUnrealizeColorTable should be issued before a
  147. presentation space (that currently has a realized logical
  148. color table) is dissociated or reassociated, that is before
  149. any GpiAssociate call referencing that presentation space.
  150.  
  151. For example, the following sequence of calls could be used:
  152.  
  153.    GpiAssociate            .. with a screen device context
  154.    GpiCreateLogColorTable  .. with LCOL_REALIZABLE
  155.    GpiRealizeColorTable
  156.      .
  157.      .                     .. draw to display
  158.      .
  159.    GpiUnrealizeColorTable
  160.    GpiAssociate            .. with a printer device context
  161.      .
  162.      .                     .. draw to printer
  163.      .
  164.    GpiAssociate            .. with a screen device context
  165.    GpiCreateLogColorTable  .. with LCOL_REALIZABLE
  166.    GpiRealizeColorTable
  167.      .
  168.      .                     .. draw to display
  169.      .
  170.  
  171.  
  172. GpiPlayMetafile
  173. ---------------
  174.  
  175. To ensure compatibility with existing applications, and
  176. to adequately enable the function for new applications, the
  177. options for GpiPlayMetafile have been changed; the
  178. CREA_REALIZE option is, and will continue to be, ignored and
  179. a CREA_DOREALIZE has been added.  When CREA_DOREALIZE is
  180. specified, the color table is loaded with the realizable
  181. option and then realized.  Note that the application must
  182. subsequently unrealize the color table as per the above
  183. guidelines.
  184.  
  185.  
  186. INCLUDE and HEADER FILES
  187. ------------------------
  188.  
  189. The definition of CREA_DOREALIZE should be added to the
  190. PMGPI.INC and PMGPI.H header files.
  191.  
  192. In PMGPI.INC, insert the following line immediately
  193. after the line defining CREA_REALIZE:
  194.  
  195. CREA_DOREALIZE;EQU;3
  196.  
  197. In PMGPI.H, insert the following line immediately
  198. after the line defining CREA_REALIZE:
  199.  
  200. #define CREA_DOREALIZE 3L
  201.  
  202.  
  203. CONVERSION TABLES
  204. -------------------
  205.  
  206. The following tables show the mapping between the old and
  207. new values for the 256 values in the 8-bit fields of the
  208. logical color table.  Because of the change from Linear-RGB
  209. to Psychometric-RGB, this mapping is not always one-to-one.
  210.  
  211. -------------------------------------------------------------
  212. Table 1.  Linear to Psychometric
  213.  
  214.  Lin  Psy        Lin  Psy        Lin  Psy        Lin  Psy
  215.  ---  ---        ---  ---        ---  ---        ---  ---
  216.    0    0         64  146        128  194        192  228
  217.    1    6         65  147        129  195        193  229
  218.    2   18         66  148        130  196        194  229
  219.    3   26         67  149        131  196        195  230
  220.    4   33         68  150        132  197        196  230
  221.    5   39         69  151        133  197        197  231
  222.    6   44         70  151        134  198        198  231
  223.    7   48         71  152        135  198        199  232
  224.    8   52         72  153        136  199        200  232
  225.    9   56         73  154        137  200        201  232
  226.   10   60         74  155        138  200        202  233
  227.   11   63         75  156        139  201        203  233
  228.   12   66         76  157        140  201        204  234
  229.   13   69         77  158        141  202        205  234
  230.   14   72         78  159        142  203        206  235
  231.   15   74         79  159        143  203        207  235
  232.   16   77         80  160        144  204        208  236
  233.   17   79         81  161        145  204        209  236
  234.   18   81         82  162        146  205        210  236
  235.   19   84         83  163        147  205        211  237
  236.   20   86         84  163        148  206        212  237
  237.   21   88         85  164        149  206        213  238
  238.   22   90         86  165        150  207        214  238
  239.   23   92         87  166        151  208        215  239
  240.   24   94         88  167        152  208        216  239
  241.   25   96         89  167        153  209        217  240
  242.   26   97         90  168        154  209        218  240
  243.   27   99         91  169        155  210        219  240
  244.   28  101         92  170        156  210        220  241
  245.   29  103         93  171        157  211        221  241
  246.   30  104         94  171        158  211        222  242
  247.   31  106         95  172        159  212        223  242
  248.   32  107         96  173        160  212        224  242
  249.   33  109         97  174        161  213        225  243
  250.   34  110         98  174        162  213        226  243
  251.   35  112         99  175        163  214        227  244
  252.   36  113        100  176        164  215        228  244
  253.   37  115        101  176        165  215        229  245
  254.   38  116        102  177        166  216        230  245
  255.   39  117        103  178        167  216        231  245
  256.   40  119        104  179        168  217        232  246
  257.   41  120        105  179        169  217        233  246
  258.   42  121        106  180        170  218        234  247
  259.   43  123        107  181        171  218        235  247
  260.   44  124        108  181        172  219        236  247
  261.   45  125        109  182        173  219        237  248
  262.   46  126        110  183        174  220        238  248
  263.   47  128        111  183        175  220        239  249
  264.   48  129        112  184        176  221        240  249
  265.   49  130        113  185        177  221        241  249
  266.   50  131        114  185        178  222        242  250
  267.   51  132        115  186        179  222        243  250
  268.   52  133        116  187        180  223        244  251
  269.   53  134        117  187        181  223        245  251
  270.   54  136        118  188        182  224        246  251
  271.   55  137        119  189        183  224        247  252
  272.   56  138        120  189        184  225        248  252
  273.   57  139        121  190        185  225        249  253
  274.   58  140        122  191        186  225        250  253
  275.   59  141        123  191        187  226        251  253
  276.   60  142        124  192        188  226        252  254
  277.   61  143        125  192        189  227        253  254
  278.   62  144        126  193        190  227        254  255
  279.   63  145        127  194        191  228        255  255
  280.  
  281. -------------------------------------------------------------
  282. Table 2.  Psychometric to Linear
  283.  
  284.  Psy  Lin        Psy  Lin        Psy  Lin        Psy  Lin
  285.  ---  ---        ---  ---        ---  ---        ---  ---
  286.    0    0         64   11        128   47        192  124
  287.    1    1         65   12        129   48        193  126
  288.    2    1         66   12        130   49        194  128
  289.    3    1         67   12        131   50        195  129
  290.    4    1         68   13        132   51        196  131
  291.    5    1         69   13        133   52        197  132
  292.    6    1         70   13        134   53        198  134
  293.    7    1         71   14        135   54        199  136
  294.    8    1         72   14        136   54        200  138
  295.    9    1         73   15        137   55        201  139
  296.   10    1         74   15        138   56        202  141
  297.   11    1         75   15        139   57        203  143
  298.   12    1         76   16        140   58        204  145
  299.   13    2         77   16        141   59        205  146
  300.   14    2         78   17        142   60        206  148
  301.   15    2         79   17        143   61        207  150
  302.   16    2         80   17        144   62        208  152
  303.   17    2         81   18        145   63        209  154
  304.   18    2         82   18        146   64        210  155
  305.   19    2         83   19        147   65        211  157
  306.   20    2         84   19        148   66        212  159
  307.   21    2         85   20        149   67        213  161
  308.   22    2         86   20        150   68        214  163
  309.   23    3         87   21        151   70        215  165
  310.   24    3         88   21        152   71        216  167
  311.   25    3         89   22        153   72        217  169
  312.   26    3         90   22        154   73        218  171
  313.   27    3         91   23        155   74        219  173
  314.   28    3         92   23        156   75        220  175
  315.   29    3         93   24        157   76        221  177
  316.   30    3         94   24        158   77        222  179
  317.   31    4         95   25        159   79        223  181
  318.   32    4         96   25        160   80        224  183
  319.   33    4         97   26        161   81        225  185
  320.   34    4         98   26        162   82        226  187
  321.   35    4         99   27        163   83        227  189
  322.   36    4        100   28        164   85        228  191
  323.   37    5        101   28        165   86        229  193
  324.   38    5        102   29        166   87        230  196
  325.   39    5        103   29        167   88        231  198
  326.   40    5        104   30        168   90        232  200
  327.   41    5        105   31        169   91        233  202
  328.   42    6        106   31        170   92        234  204
  329.   43    6        107   32        171   94        235  207
  330.   44    6        108   32        172   95        236  209
  331.   45    6        109   33        173   96        237  211
  332.   46    6        110   34        174   98        238  214
  333.   47    7        111   34        175   99        239  216
  334.   48    7        112   35        176  100        240  218
  335.   49    7        113   36        177  102        241  220
  336.   50    7        114   37        178  103        242  223
  337.   51    8        115   37        179  105        243  225
  338.   52    8        116   38        180  106        244  228
  339.   53    8        117   39        181  108        245  230
  340.   54    8        118   39        182  109        246  232
  341.   55    9        119   40        183  110        247  235
  342.   56    9        120   41        184  112        248  237
  343.   57    9        121   42        185  113        249  240
  344.   58   10        122   43        186  115        250  242
  345.   59   10        123   43        187  116        251  245
  346.   60   10        124   44        188  118        252  247
  347.   61   10        125   45        189  120        253  250
  348.   62   11        126   46        190  121        254  252
  349.   63   11        127   47        191  123        255  255
  350.  
  351. -------------------------------------------------------------
  352. *****************************************************************
  353. *                                                               *
  354. *                   8514 BIT MAP PERFORMANCE                    *
  355. *                                                               *
  356. *****************************************************************
  357.  
  358. To obtain fast setting of 8 bit per pel bit-map data into 8 bit
  359. per pel bit maps when using the 8514 display driver, preprocess
  360. the bit-map data to use a logical color table that exactly
  361. matches that of the default PM palette for the driver.  This
  362. logical color table for the default palette can be constructed
  363. using GpiQueryRealColors with a start value of 0 and a count of
  364. 256, leaving the ordering of the RGB values and the values
  365. themselves unchanged.
  366.  
  367. *****************************************************************
  368. *                                                               *
  369. *           CHANGES TO THE CANCELING OF PRINT JOBS              *
  370. *                                                               *
  371. *****************************************************************
  372.  
  373. This section describes the interaction between a device driver
  374. and the spooler when a print job is canceled.
  375.  
  376. A print job can be canceled either by the end-user or by an
  377. application.  The processing for each case is described below.
  378.  
  379. Note: Some output may be printed after the canceled job is
  380.       removed from the Print Manager list.  In previous versions
  381.       of OS/2, no output was sent to the printer after the job
  382.       was removed from the Print Manager list.
  383.  
  384. The following sections describe the processing carried out by
  385. the device driver when a print job is ended.
  386.  
  387. The application ends a job while spooling
  388. -----------------------------------------
  389.  
  390. 1.   The application calls DevEscape(DEVESC_ABORTDOC).
  391.  
  392. 2.   The device driver calls SplQmAbortDoc and flags that the
  393.      device context has been aborted (SplQmAbort should not be
  394.      called).
  395.  
  396. 3.   The application calls either DevEscape(DEVESC_STARTDOC)
  397.      to start another job on the same device context, or
  398.      DevCloseDC to close the device context.
  399.  
  400. When DevEscape(DEVESC_ABORTDOC) is issued, the spooler sets
  401. a flag and returns immediately.  The spooler then cancels the
  402. job when a Prt... call returns.  In previous versions of OS/2,
  403. the spooler waited until the job had been canceled before
  404. returning.
  405.  
  406. The end-user cancels a job
  407. --------------------------
  408.  
  409. 1.   The spooler calls SplQpControl(SPLC_ABORT).
  410.  
  411. 2.   The print processor calls DevEscape(DEVESC_ABORTDOC)
  412.      (the device driver must be able to accept DEVESC_ABORTDOC
  413.      while processing DEVESC_RAWDATA).
  414.  
  415. 3.   The device driver sets a flag to show that the job should
  416.      be stopped.
  417.  
  418. If the next Prt... call returns without an error, the device
  419. driver sends a form feed and calls PrtClose.  To ensure that
  420. the printer is not in graphics mode, the device driver can also
  421. send some null data.
  422.  
  423. If the next Prt... call returns with an error, the device
  424. driver behaves in the same way as it does when the printer
  425. runs out of paper, or is not online (see below).
  426.  
  427. The printer runs out of paper or is not online
  428. ----------------------------------------------
  429.  
  430. 1.    PrtWrite fails and returns an error to the device driver.
  431.  
  432. 2.    After the specified timeout, the device driver calls:
  433.  
  434.         SplMessageBox(LogAddr,
  435.            SPLINFO_DDERROR | SPLINFO_ERROR | SPLINFO_USERINTREQD,
  436.              SPLDATA_PRINTERJAM, NULL, NULL, 0, MB_RETRYCANCEL)
  437.  
  438.      This produces a message box to warn the end-user:
  439.  
  440.      -  If the user selects Cancel, the driver calls PrtAbort and
  441.         PrtClose.
  442.  
  443.      -  If the user selects Retry, the driver calls PrtWrite
  444.         again, unless the job has been canceled since the error.
  445.  
  446. Note: The spooler ignores all PrtWrite operations after PrtAbort
  447.       is called.  After the device driver has called PrtClose,
  448.       it returns the errors to the caller (the graphics
  449.       programming interface for PM_Q_STD data, or the print
  450.       processor for PM_Q_RAW data) until the device context is
  451.       closed.
  452.  
  453. *****************************************************************
  454. *                                                               *
  455. *          PRINTING USING AN OD_DIRECT DEVICE CONTEXT           *
  456. *                                                               *
  457. *****************************************************************
  458.  
  459. Applications that use an OD_DIRECT printer device context to
  460. print data must issue a pair of escape functions to "bracket"
  461. each print job.
  462.  
  463. Note: Queue drivers are special applications that must
  464.       always print data using an OD_DIRECT device context.
  465.  
  466. The escape functions are:
  467.  
  468.      DevEscape(DEVESC_STARTDOC)
  469.      DevEscape(DEVESC_ENDDOC)
  470.  
  471. The sequence of calls that you must use is:
  472.  
  473. GpiCreatePS        /* Create a presentation space.             */
  474. DevOpenDC          /* Create an OD_DIRECT device context.      */
  475. GpiAssociate       /* Associate the presentation space with    */
  476.                    /* the device context.                      */
  477. DevEscape(DEVESC_STARTDOC)
  478.                    /* Start the print job.                     */
  479.      .
  480.      .
  481.      .
  482. Gpixxxxxx calls    /* Draw the output data.                    */
  483.      .
  484.      .
  485.      .
  486. DevEscape(DEVESC_ENDDOC)
  487.                    /* End the print job.                       */
  488. GpiAssociate(hps,NULL)
  489.                    /* Disassociate the presentation space from */
  490.                    /* the device context.                      */
  491. GpiDestroyPS       /* Destroy the presentation space.          */
  492. DevCloseDC         /* Close the device context.                */
  493.  
  494. The sequence of calls is the same when you print using an
  495. OD_QUEUED device context.
  496.  
  497.  
  498. *****************************************************************
  499. *                                                               *
  500. *     WRITING DEVICE DRIVERS TO HANDLE MONOCHROME BIT MAPS      *
  501. *                                                               *
  502. *****************************************************************
  503.  
  504. This section describes the rules for handling monochrome bit
  505. maps in printer drivers and display drivers.  To ensure that the
  506. images produced from the same sequence of bit-map actions do not
  507. vary from driver to driver, they must follow the behavior of the
  508. Video Graphics Adapter (VGA) display driver.
  509.  
  510. Monochrome bit maps can be regarded as:
  511.  
  512.  - References to a color table
  513.  - Logic values
  514.  - References to the current image attributes
  515.    foreground/background colors (see GpiSetAttrs).
  516.  
  517.  
  518. BIT MAPS AND COLOR TABLES
  519. -------------------------
  520. Device drivers must be consistent in the way they deal with the
  521. GpiSetBitmapBits, GpiQueryBitmapBits, and GpiCreateBitmap calls.
  522.  
  523. When you use the GpiCreateBitmap or GpiSetBitmapBits calls to
  524. create a bit map, you specify a color table.  The device driver
  525. adjusts the internal bit-map data structure to reflect the image
  526. defined by the supplied pel values and the corresponding color
  527. table.
  528.  
  529. The VGA display driver represents white by the value 1 and black
  530. by the value 0 in its internal monochrome bit-map data structure.
  531. If you specify a color table that defines white as 0 and black as
  532. 1, the display driver complements the bit values before it stores
  533. them in its bit-map structure.  A subsequent call to
  534. GpiQueryBitmapBits returns a set of pel values together with a
  535. color table.  Thus the returned values may not match those
  536. supplied by GpiSetBitmapBits or GpiCreateBitmap.  Taken together
  537. with the color tables however, the complete return value matches
  538. the supplied data.  Therefore, the color table returned by the
  539. GpiQueryBitmapBits call with a monochrome bit map always
  540. represents white by the value 1 and black by the value 0.
  541.  
  542.  
  543. BIT MAPS AS LOGIC VALUES
  544. ------------------------
  545. When you use the GpiBitBlt call to copy data between a source and
  546. a destination bit map with the same number of bits per pel, the
  547. pel values in the internal bit-map structures are treated as
  548. logic values.  For example, the ROP_SRCAND raster operation
  549. combines the pel values using the AND machine instruction.
  550.  
  551. This aspect of the GpiBitBlt call forces a common representation
  552. value for white and black; therefore all device drivers must
  553. follow the VGA display driver and represent the color white by
  554. the value 1 and the color black by the value 0.
  555.  
  556. A ROP_SRCAND function issued to the VGA display driver maps:
  557.  
  558.  - White and white to white
  559.  - White and black to black
  560.  - Black and white to black
  561.  - Black and black to black
  562.  
  563. If this rule is not followed, the various raster operations
  564. (ROP_SRCAND for example) generate different results in the memory
  565. bit maps supported by different device drivers.
  566.  
  567.  
  568. BIT MAPS AND THE IMAGE ATTRIBUTES
  569. ---------------------------------
  570. When a GpiBitBlt operation occurs between source and destination
  571. bit maps that differ in the number of bits per pel, color
  572. conversion occurs.  For a monochrome source bit map, the color
  573. conversion maps 1-bits in the source bit map into the foreground
  574. color of the image attributes, and 0-bits to the background color
  575. of the image attributes.
  576.  
  577. Because the VGA display has a 16-color surface, the VGA display
  578. driver performs color conversion when you use the GpiBitBlt call
  579. to copy a monochrome bit map to it.  Printer drivers must follow
  580. this behavior when a monochrome bit map is copied to their
  581. display surface.  Thus color conversions must always use the
  582. current image attribute colors, even when the display surface is
  583. another monochrome bit map.
  584.  
  585. Note: This rule applies only to GpiBitBlt operations to the image
  586.       surface of the device driver, not to operations to a memory
  587.       bit map.
  588.  
  589.  
  590. SUMMARY OF RULES FOR DEVICE DRIVERS
  591. -----------------------------------
  592. To make the image behavior of device drivers conform to that of
  593. the VGA display driver:
  594.  
  595.  - Device drivers must represent the color white by the value 1
  596.    and the color black by the value 0 in their internal bit-map
  597.    representations.
  598.  
  599.  - Device drivers must always color-convert the source bit map
  600.    according to the current image attributes when a GpiBitBlt
  601.    operation is done from a monochrome memory bit map to a
  602.    display surface bit map.
  603.  
  604. Exceptions
  605. ----------
  606. The following device drivers do not follow these rules:
  607.  
  608.  IBMNULL.DRV           IBM52011.DRV
  609.  IBM3852.DRV           IBM52012.DRV
  610.  IBM5152.DRV           IBM5216.DRV
  611.  IBM5182.DRV
  612.  
  613.  
  614. SUMMARY OF RULES FOR APPLICATIONS
  615. ---------------------------------
  616.  - Applications must supply correct color tables for the
  617.    GpiCreateBitmap and GpiSetBitmapBits calls.
  618.  
  619.  - Applications must ensure that the foreground and background
  620.    colors of the image attributes are set for GpiBitBlt
  621.    operations from monochrome memory bit maps to the display
  622.    surface of a device.
  623.  
  624. Note: Applications that do not follow these rules may give
  625.       unpredictable output.
  626.  
  627.                      ----- End of document -----
  628.