home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / CSAPE32.ARJ / SOURCE / OWLSCR / PMWINOPE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-03-28  |  1.6 KB  |  67 lines

  1. /*
  2.     pmwinope.c    9/11/88
  3.  
  4.     % pmwin Open routines
  5.  
  6.     by Ted.
  7.  
  8.     OWL 1.2
  9.     Copyright (c) 1988, by Oakland Group, Inc.
  10.     ALL RIGHTS RESERVED.
  11.  
  12.     Revision History:
  13.     -----------------
  14.      3/24/89 ted    Changed order of args to pmwin_Open and pmwin_PixOpen.
  15.      3/28/90 jmd    ansi-fied
  16. */
  17.  
  18. #include "oakhead.h"
  19. #include "disppriv.h"
  20. #include "pmwinobj.h"
  21. #include "bordobj.h"
  22. /* -------------------------------------------------------------------------- */
  23.  
  24. win_type pmwin_Open(class_fptr pmwinclass, int row, int col, pmap_type pmap)
  25. /*
  26.     Open a pixmap type window in character box coordinates.
  27.     Note: pmwinclass is taken as an argument so that classes inherited from
  28.     pmwin_Class may be opened with this function.
  29. */
  30. {
  31.     ofont_type font;
  32.  
  33.     font = disp_GetDefFont();
  34.  
  35.     return (pmwin_PixOpen(pmwinclass, 
  36.                     col * ofont_GetWidth(font), row * ofont_GetHeight(font),
  37.                     pmap, font));
  38. }
  39. /* -------------------------------------------------------------------------- */
  40.  
  41. win_type pmwin_PixOpen(class_fptr pmwinclass, opcoord x, opcoord y, pmap_type pmap, ofont_type font)
  42. /*
  43.     Open a pixmap type window in pixel coordinates.
  44.     Note: pmwinclass is taken as an argument so that classes inherited from
  45.     pmwin_Class may be opened with this function.
  46. */
  47. {
  48.     opbox box;
  49.     win_type pmwin;
  50.  
  51.     if (pmap == NULL) {
  52.         return(NULL);
  53.     }
  54.     box.xmin = x;
  55.     box.ymin = y;
  56.     box.xmax = x + pmap_GetWidth(pmap);
  57.     box.ymax = y + pmap_GetHeight(pmap);
  58.  
  59.     pmwin = win_PixOpen(pmwinclass, &box, font);
  60.  
  61.     pmwin_SetPmap(pmwin, pmap);
  62.  
  63.     return(pmwin);
  64. }
  65. /* -------------------------------------------------------------------------- */
  66.  
  67.