Ignore:
Timestamp:
Dec 9, 2000, 8:19:42 PM (25 years ago)
Author:
umoeller
Message:

Major updates; timers, LVM, miscellaneous.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/gpih.c

    r13 r14  
    66 *      Usage: All PM programs.
    77 *
    8  *      A word about GPI rectangles: In general, graphics operations involving
    9  *      device coordinates (such as regions, bit maps and bit blts, and window
    10  *      management) use inclusive-exclusive rectangles.  All other graphics
    11  *      operations, such as GPI functions that define paths, use inclusive-inclusive
    12  *      rectangles.
     8 *      A word about GPI rectangles: In general, graphics operations
     9 *      involving device coordinates (such as regions, bit maps and
     10 *      bit blts, and window management) use inclusive-exclusive
     11 *      rectangles.  All other graphics operations, such as GPI
     12 *      functions that define paths, use inclusive-inclusive rectangles.
     13 *
     14 *      This can be a problem with mixing Win and Gpi functions. For
     15 *      example, WinQueryWindowRect returns an inclusive-exclusive
     16 *      rectangle (so that the xRight value is the same as the window
     17 *      width). However, GpiBox expects an inclusive-inclusive rectangle.
    1318 *
    1419 *      Function prefixes (new with V0.81):
     
    2328/*
    2429 *      Copyright (C) 1997-2000 Ulrich M”ller.
    25  *      This file is part of the XWorkplace source package.
    26  *      XWorkplace is free software; you can redistribute it and/or modify
     30 *      This file is part of the "XWorkplace helpers" source package.
     31 *      This is free software; you can redistribute it and/or modify
    2732 *      it under the terms of the GNU General Public License as published
    2833 *      by the Free Software Foundation, in version 2 as it comes in the
     
    3944    // as unsigned char
    4045
    41 #define INCL_DOSDEVIOCTL
    42 #define INCL_DOS
    4346#define INCL_DOSERRORS
    44 #define INCL_WIN
    45 #define INCL_GPI
     47
     48#define INCL_WINWINDOWMGR
     49#define INCL_WINPOINTERS
     50#define INCL_WINSYS
     51
     52#define INCL_GPIPRIMITIVES
     53#define INCL_GPIBITMAPS
     54#define INCL_GPILOGCOLORTABLE
     55#define INCL_GPILCIDS
    4656#include <os2.h>
    4757
     
    6878
    6979/* ******************************************************************
    70  *                                                                  *
    71  *   Device helpers                                                 *
    72  *                                                                  *
     80 *
     81 *   Device helpers
     82 *
    7383 ********************************************************************/
    7484
     
    100110
    101111/* ******************************************************************
    102  *                                                                  *
    103  *   Color helpers                                                  *
    104  *                                                                  *
     112 *
     113 *   Color helpers
     114 *
    105115 ********************************************************************/
    106116
     
    139149
    140150/* ******************************************************************
    141  *                                                                  *
    142  *   Drawing primitives helpers                                     *
    143  *                                                                  *
     151 *
     152 *   Drawing primitives helpers
     153 *
    144154 ********************************************************************/
    145155
     
    187197 *      the top right point lies _outside_ the rectangle
    188198 *      which is actually drawn. This is the same as with
    189  *      WinFillRect.
     199 *      WinFillRect. ### I don't think so any more... GpiBox
     200 *      uses inclusive-inclusive rectangles...
    190201 *
    191202 *      Changes to the HPS:
     
    252263    GpiMove(hps, &ptlSave);
    253264    GpiSetColor(hps, lColorSave);
     265}
     266
     267/*
     268 *@@ gpihThickBox:
     269 *      draws a box from the specified rectangle with the
     270 *      specified width.
     271 *
     272 *      The specified rectangle is inclusive, that is, the top
     273 *      right corner specifies the top right pixel to be drawn.
     274 *
     275 *      If usWidth > 1, the additional pixels will be drawn towards
     276 *      the _center_ of the rectangle. prcl thus always specifies
     277 *      the bottom left and top right pixels to be drawn.
     278 *
     279 *      This is different from using GpiSetLineWidth, with which
     280 *      I was unable to find out in which direction lines are
     281 *      extended.
     282 *
     283 *      This is similar to gpihDraw3DFrame, except that everything
     284 *      is painted in the current color.
     285 *
     286 *@@added V0.9.7 (2000-12-06) [umoeller]
     287 */
     288
     289VOID gpihDrawThickFrame(HPS hps,              // in: presentation space for output
     290                        PRECTL prcl,          // in: rectangle to draw (exclusive)
     291                        ULONG ulWidth)       // in: line width (>= 1)
     292{
     293    ULONG ul = 0;
     294    for (;
     295         ul < ulWidth;
     296         ul++)
     297    {
     298        GpiMove(hps, (PPOINTL)prcl);
     299        GpiBox(hps,
     300               DRO_OUTLINE,
     301               (PPOINTL)&(prcl->xRight),
     302               0,
     303               0);
     304
     305        // and one more to the outside
     306        prcl->xLeft++;
     307        prcl->yBottom++;
     308        prcl->xRight--;
     309        prcl->yTop--;
     310    }
    254311}
    255312
     
    355412
    356413/* ******************************************************************
    357  *                                                                  *
    358  *   Font helpers                                                   *
    359  *                                                                  *
     414 *
     415 *   Font helpers
     416 *
    360417 ********************************************************************/
    361418
     
    10301087
    10311088/* ******************************************************************
    1032  *                                                                  *
    1033  *   Bitmap helpers                                                 *
    1034  *                                                                  *
     1089 *
     1090 *   Bitmap helpers
     1091 *
    10351092 ********************************************************************/
    10361093
Note: See TracChangeset for help on using the changeset viewer.