home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: WPS_PM / WPS_PM.zip / xfld085s.zip / helpers / gpih.h < prev    next >
C/C++ Source or Header  |  1999-02-23  |  4KB  |  109 lines

  1.  
  2. /*
  3.  * gpih.h:
  4.  *      header file for gpih.h, which contains GPI helper functions
  5.  *      that are  independent of a single application,
  6.  *      i.e. these can be  used w/out the rest of the XFolder source in
  7.  *      any PM program.
  8.  *
  9.  *      Copyright (C) 1997-99 Ulrich Möller.
  10.  *      This file is part of the XFolder source package.
  11.  *      XFolder is free software; you can redistribute it and/or modify
  12.  *      it under the terms of the GNU General Public License as published
  13.  *      by the Free Software Foundation, in version 2 as it comes in the
  14.  *      "COPYING" file of the XFolder main distribution.
  15.  *      This program is distributed in the hope that it will be useful,
  16.  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.  *      GNU General Public License for more details.
  19.  */
  20.  
  21. #if __cplusplus
  22. extern "C" {
  23. #endif
  24.  
  25. #ifndef GPIH_HEADER_INCLUDED
  26.     #define GPIH_HEADER_INCLUDED
  27.     /*
  28.      * gpihQueryDisplayCaps:
  29.      *      this returns certain device capabilities of
  30.      *      the Display device. ulIndex must be one of
  31.      *      the indices as described in DevQueryCaps.
  32.      *      This function will load all the device capabilities
  33.      *      only once and reuse them afterwards.
  34.      */
  35.  
  36.     ULONG gpihQueryDisplayCaps(ULONG ulIndex);
  37.  
  38.     /*
  39.      * gpihQueryLineSpacing:
  40.      *      this returns the optimal line spacing for text
  41.      *      output with the current HPS; this is computed
  42.      *      by evaluating those incredible FONTMETRICS
  43.      */
  44.  
  45.     LONG gpihQueryLineSpacing(HPS hps,
  46.                               PSZ pszText);     // in:  text to output
  47.  
  48.  
  49.     /*
  50.      * gpihDraw3DFrame:
  51.      *      this draws a rectl in 3D style with a given line width;
  52.      *      if (fRaised), the 3D line is given a "raised" look,
  53.      *      "sunken" otherwise
  54.      */
  55.  
  56.     VOID gpihDraw3DFrame(HPS hps,
  57.                          PRECTL prcl,       // in:  rectangle
  58.                          USHORT usWidth,    // in:  line width (>= 1)
  59.                          BOOL fRaised);     // in:  TRUE for "raised", FALSE "sunken"
  60.  
  61.     /*
  62.      * gpihCreateMemPS:
  63.      *      creates a memory device context and presentation space so
  64.      *      they are compatible with the screen device context and
  65.      *      presentation space. These are stored in *hdcMem and *hpsMem.
  66.      *      You must free these with GpiDestroyPS(hpsMem) and
  67.      *      DevCloseDC(hdcMem) when you don't need these any more.
  68.      *      Returns FALSE upon errors.
  69.      */
  70.  
  71.     BOOL gpihCreateMemPS(HAB hab,        // in: anchor block
  72.                         HDC *hdcMem,     // out: memory DC
  73.                         HPS *hpsMem);    // out: memory PS
  74.  
  75.     /*
  76.      * gpihCreateBitmap:
  77.      *      creates a new bitmap for a given memory PS.
  78.      *      This new bitmap has the size specified in *prcl.
  79.      *      Note that the bitmap is _not_ selected in the mem PS.
  80.      *      Returns the bitmap handle or NULLHANDLE upon errors.
  81.      */
  82.  
  83.     HBITMAP gpihCreateBitmap(HPS hpsMem,        // memory DC
  84.                              PRECTL prcl);      // size of bitmap
  85.  
  86.  
  87.     /*
  88.      * gpihCreateBmpFromPS:
  89.      *      this creates a new bitmap, which is compatible with the
  90.      *      device associated with hpsScreen, and then copies the
  91.      *      rectangle prcl into it; returns the handle of the bitmap,
  92.      *      which can then be used for WinDrawBitmap and such
  93.      */
  94.  
  95.     HBITMAP gpihCreateBmpFromPS(HAB hab,        // in: anchor block
  96.                                 HPS hpsScreen,  // in: screen PS to copy from
  97.                                 PRECTL prcl);   // in: rectangle to copy
  98.  
  99.  
  100.     HBITMAP gpihLoadBitmapFile(HPS hps,
  101.                                PSZ pszBmpFile,
  102.                                PULONG pulError);
  103. #endif
  104.  
  105. #if __cplusplus
  106. }
  107. #endif
  108.  
  109.