home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c185 / 2.ddi / OWLSRC.EXE / CSCAPE / SOURCE / PMWINOPE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-12  |  1.7 KB  |  75 lines

  1. /*
  2.     pmwinope.c    9/11/88
  3.  
  4.     % pmwin Open routines
  5.  
  6.     by Ted.
  7.  
  8.     OWL 1.1
  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. */
  16.  
  17. #include "oakhead.h"
  18. #include "disppriv.h"
  19. #include "pmwinobj.h"
  20. #include "bordobj.h"
  21. /* -------------------------------------------------------------------------- */
  22.  
  23. win_type pmwin_Open(pmwinclass, row, col, pmap)
  24.     class_fptr pmwinclass;        /* pointer to window's dispatch function */
  25.     int row;
  26.     int col;
  27.     pmap_type pmap;
  28. /*
  29.     Open a pixmap type window in character box coordinates.
  30.     Note: pmwinclass is taken as an argument so that classes inherited from
  31.     pmwin_Class may be opened with this function.
  32. */
  33. {
  34.     ofont_type font;
  35.  
  36.     font = disp_GetDefFont();
  37.  
  38.     return (pmwin_PixOpen(pmwinclass, 
  39.                     col * ofont_GetWidth(font), row * ofont_GetHeight(font),
  40.                     pmap, font));
  41. }
  42. /* -------------------------------------------------------------------------- */
  43.  
  44. win_type pmwin_PixOpen(pmwinclass, x, y, pmap, font)
  45.     class_fptr pmwinclass;        /* pointer to window's dispatch function */
  46.     opcoord x;
  47.     opcoord y;
  48.     pmap_type pmap;
  49.     ofont_type font;
  50. /*
  51.     Open a pixmap type window in pixel coordinates.
  52.     Note: pmwinclass is taken as an argument so that classes inherited from
  53.     pmwin_Class may be opened with this function.
  54. */
  55. {
  56.     opbox box;
  57.     win_type pmwin;
  58.  
  59.     if (pmap == NULL) {
  60.         return(NULL);
  61.     }
  62.     box.xmin = x;
  63.     box.ymin = y;
  64.     box.xmax = x + pmap_GetWidth(pmap);
  65.     box.ymax = y + pmap_GetHeight(pmap);
  66.  
  67.     pmwin = win_PixOpen(pmwinclass, &box, font);
  68.  
  69.     pmwin_SetPmap(pmwin, pmap);
  70.  
  71.     return(pmwin);
  72. }
  73. /* -------------------------------------------------------------------------- */
  74.  
  75.