home *** CD-ROM | disk | FTP | other *** search
- /*
- pmwinope.c 9/11/88
-
- % pmwin Open routines
-
- by Ted.
-
- OWL 1.1
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 3/24/89 ted Changed order of args to pmwin_Open and pmwin_PixOpen.
- */
-
- #include "oakhead.h"
- #include "disppriv.h"
- #include "pmwinobj.h"
- #include "bordobj.h"
- /* -------------------------------------------------------------------------- */
-
- win_type pmwin_Open(pmwinclass, row, col, pmap)
- class_fptr pmwinclass; /* pointer to window's dispatch function */
- int row;
- int col;
- pmap_type pmap;
- /*
- Open a pixmap type window in character box coordinates.
- Note: pmwinclass is taken as an argument so that classes inherited from
- pmwin_Class may be opened with this function.
- */
- {
- ofont_type font;
-
- font = disp_GetDefFont();
-
- return (pmwin_PixOpen(pmwinclass,
- col * ofont_GetWidth(font), row * ofont_GetHeight(font),
- pmap, font));
- }
- /* -------------------------------------------------------------------------- */
-
- win_type pmwin_PixOpen(pmwinclass, x, y, pmap, font)
- class_fptr pmwinclass; /* pointer to window's dispatch function */
- opcoord x;
- opcoord y;
- pmap_type pmap;
- ofont_type font;
- /*
- Open a pixmap type window in pixel coordinates.
- Note: pmwinclass is taken as an argument so that classes inherited from
- pmwin_Class may be opened with this function.
- */
- {
- opbox box;
- win_type pmwin;
-
- if (pmap == NULL) {
- return(NULL);
- }
- box.xmin = x;
- box.ymin = y;
- box.xmax = x + pmap_GetWidth(pmap);
- box.ymax = y + pmap_GetHeight(pmap);
-
- pmwin = win_PixOpen(pmwinclass, &box, font);
-
- pmwin_SetPmap(pmwin, pmap);
-
- return(pmwin);
- }
- /* -------------------------------------------------------------------------- */
-