home *** CD-ROM | disk | FTP | other *** search
- /*
- digpmcli.c
-
- % RAM driver stuff
-
- 10/4/88 Ted Extracted from pcramdra.c
-
- OWL 1.1
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 01/10/89 ted Removed redundant disp clip.
- 02/10/89 ted Renamed from pcramcpy for sharing
- */
-
- #include "oakhead.h"
- #include "disppriv.h"
- #include "digutil.h"
- /* -------------------------------------------------------------------------- */
-
- boolean DIGPRIV copypm_clip(ptd, pixmap, pmboxp, scrboxp, pmxp, pmyp)
- ptd_struct *ptd;
- pmap_type pixmap;
- opbox *pmboxp;
- opbox *scrboxp;
- opcoord *pmxp;
- opcoord *pmyp;
- /*
- Do all the clipping for copying a pixmap region to or from the display.
- Returns TRUE if some box is common to display and pixmap that can be copied.
- */
- {
- win_type win;
- opcoord pmorgx, pmorgy;
-
- win = ptd->win;
-
- /* Set up box in screen coordinates */
- opbox_copy(scrboxp, ptd->relboxp);
- opbox_trans(scrboxp, win_GetXmin(win), win_GetYmin(win));
-
- /* Construct vector from vid box origin to pixmap box origin */
- pmorgx = pmboxp->xmin - scrboxp->xmin;
- pmorgy = pmboxp->ymin - scrboxp->ymin;
-
- /* Put scrbox to position in pmap, now clip it to pmap and pmboxp */
- opbox_trans(scrboxp, pmorgx, pmorgy);
- if (!pmap_clipbox(pixmap, scrboxp)) {
- return(FALSE); /* bomb if no pmap in box */
- }
- if (!opbox_clipbox(pmboxp, scrboxp)) {
- return(FALSE); /* bomb if empty pmbox */
- }
- *pmxp = scrboxp->xmin;
- *pmyp = scrboxp->ymin;
-
- /* Now return triple clipped scrbox to its old site in display */
- opbox_trans(scrboxp, -pmorgx, -pmorgy);
- return(TRUE);
- }
- /* -------------------------------------------------------------------------- */
-
-