|
|
|
|
File: [XFree86 CVS] / xc / programs / Xserver / hw / xfree86 / accel / ibm8514 / Attic / win.c
(download)
Revision: 3.2, Sat Jan 28 15:51:51 1995 UTC (18 years, 3 months ago) by dawes Branch: MAIN CVS Tags: xf-3_1_2e, xf-3_1_2d, xf-3_1_2c, xf-3_1_2b, xf-3_1_2a, xf-3_1_2C, xf-3_1_2Bo, xf-3_1_2Bn, xf-3_1_2Bm, xf-3_1_2Bl, xf-3_1_2Bk, xf-3_1_2Bj, xf-3_1_2Bi, xf-3_1_2Bh, xf-3_1_2Bg, xf-3_1_2Bf, xf-3_1_2Be, xf-3_1_2Bd, xf-3_1_2Bc, xf-3_1_2Bb, xf-3_1_2Ba, xf-3_1_2B, xf-3_1_2Af, xf-3_1_2Ae, xf-3_1_2Ad, xf-3_1_2Ac, xf-3_1_2Ab, xf-3_1_2Aa, xf-3_1_2A, xf-3_1_2-branch, xf-3_1_2-S, xf-3_1_2, xf-3_1_1h, xf-3_1_1g, xf-3_1_1f, xf-3_1_1e, xf-3_1_1d, xf-3_1_1c, xf-3_1_1b, xf-3_1_1a, xf-3_1_1Z, xf-3_1_1Dc, xf-3_1_1Db, xf-3_1_1Da, xf-3_1_1D, xf-3_1_1Cd, xf-3_1_1Cc, xf-3_1_1Cb, xf-3_1_1Ca, xf-3_1_1C, xf-3_1_1Bi, xf-3_1_1Bh, xf-3_1_1Bg, xf-3_1_1Bf, xf-3_1_1Be, xf-3_1_1Bd, xf-3_1_1Bc, xf-3_1_1Bb, xf-3_1_1Ba, xf-3_1_1B, xf-3_1_1Ad, xf-3_1_1Ac, xf-3_1_1Ab, xf-3_1_1Aa, xf-3_1_1A, xf-3_1_1-u1, xf-3_1_1-u, xf-3_1_1, xf-3_1_0Zg, xf-3_1_0Zf Changes since 3.1: +2 -2 lines prelim fix-11 merge |
/* $XConsortium: win.c,v 1.1 95/01/26 15:29:18 kaleb Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/accel/ibm8514/win.c,v 3.1 1994/09/07 16:19:12 dawes Exp $ */
/*
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from the X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL, KEVIN E. MARTIN, AND TIAGO GONS DISCLAIM ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
IN NO EVENT SHALL DIGITAL, KEVIN E. MARTIN, OR TIAGO GONS BE LIABLE FOR ANY
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Rewritten for the 8514/A by Kevin E. Martin (martin@cs.unc.edu)
Further modifications by Tiago Gons (tiago@comosjn.hobby.nl)
*/
#include "X.h"
#include "input.h"
#include "scrnintstr.h"
#include "windowstr.h"
#include "gcstruct.h"
#include "cfb.h"
#include "mistruct.h"
#include "regionstr.h"
#include "cfbmskbits.h"
#include "xf86.h"
#include "xf86Priv.h"
#include "reg8514.h"
#include "ibm8514.h"
void
ibm8514CopyWindow(pWin, ptOldOrg, prgnSrc)
WindowPtr pWin;
DDXPointRec ptOldOrg;
RegionPtr prgnSrc;
{
RegionPtr prgnDst;
register BoxPtr pbox, pboxOrig;
register int dx, dy;
register int i, nbox;
short direction = 0;
unsigned int *ordering;
GC dummyGC;
/* 4-5-93 TCG : is VT visible */
if (!xf86VTSema)
{
cfbCopyWindow(pWin, ptOldOrg, prgnSrc);
return;
}
dummyGC.subWindowMode = ~IncludeInferiors;
prgnDst = (* pWin->drawable.pScreen->RegionCreate)(NULL, 1);
if ((dx = ptOldOrg.x - pWin->drawable.x) > 0)
direction |= INC_X;
if ((dy = ptOldOrg.y - pWin->drawable.y) > 0)
direction |= INC_Y;
(* pWin->drawable.pScreen->TranslateRegion)(prgnSrc, -dx, -dy);
(* pWin->drawable.pScreen->Intersect)(prgnDst, &pWin->borderClip, prgnSrc);
pboxOrig = REGION_RECTS(prgnDst);
nbox = REGION_NUM_RECTS(prgnDst);
ordering = (unsigned int *) ALLOCATE_LOCAL(nbox * sizeof(unsigned int));
if (!ordering) {
(* pWin->drawable.pScreen->RegionDestroy)(prgnDst);
return;
}
ibm8514FindOrdering((DrawablePtr)pWin, (DrawablePtr)pWin, &dummyGC, nbox,
pboxOrig, ptOldOrg.x, ptOldOrg.y, pWin->drawable.x,
pWin->drawable.y, ordering);
WaitQueue(3);
outw(FRGD_MIX, FSS_BITBLT | MIX_SRC);
outw(BKGD_MIX, BSS_BKGDCOL | MIX_SRC);
outw(WRT_MASK, 0xffff);
if (direction == (INC_X | INC_Y)) {
for (i = 0; i < nbox; i++)
{
pbox = &pboxOrig[ordering[i]];
WaitQueue(7);
outw(CUR_X, (short)(pbox->x1 + dx));
outw(CUR_Y, (short)(pbox->y1 + dy));
outw(DESTX_DIASTP, (short)(pbox->x1));
outw(DESTY_AXSTP, (short)(pbox->y1));
outw(MAJ_AXIS_PCNT, (short)(pbox->x2 - pbox->x1 - 1));
outw(MULTIFUNC_CNTL, MIN_AXIS_PCNT | (short)(pbox->y2 - pbox->y1 - 1));
outw(CMD, CMD_BITBLT | direction | DRAW | PLANAR | WRTDATA);
}
} else if (direction == INC_X) {
for (i = 0; i < nbox; i++)
{
pbox = &pboxOrig[ordering[i]];
WaitQueue(7);
outw(CUR_X, (short)(pbox->x1 + dx));
outw(CUR_Y, (short)(pbox->y2 + dy - 1));
outw(DESTX_DIASTP, (short)(pbox->x1));
outw(DESTY_AXSTP, (short)(pbox->y2 - 1));
outw(MAJ_AXIS_PCNT, (short)(pbox->x2 - pbox->x1 - 1));
outw(MULTIFUNC_CNTL, MIN_AXIS_PCNT | (short)(pbox->y2 - pbox->y1 - 1));
outw(CMD, CMD_BITBLT | direction | DRAW | PLANAR | WRTDATA);
}
} else if (direction == INC_Y) {
for (i = 0; i < nbox; i++)
{
pbox = &pboxOrig[ordering[i]];
WaitQueue(7);
outw(CUR_X, (short)(pbox->x2 + dx - 1));
outw(CUR_Y, (short)(pbox->y1 + dy));
outw(DESTX_DIASTP, (short)(pbox->x2 - 1));
outw(DESTY_AXSTP, (short)(pbox->y1));
outw(MAJ_AXIS_PCNT, (short)(pbox->x2 - pbox->x1 - 1));
outw(MULTIFUNC_CNTL, MIN_AXIS_PCNT | (short)(pbox->y2 - pbox->y1 - 1));
outw(CMD, CMD_BITBLT | direction | DRAW | PLANAR | WRTDATA);
}
} else {
for (i = 0; i < nbox; i++)
{
pbox = &pboxOrig[ordering[i]];
WaitQueue(7);
outw(CUR_X, (short)(pbox->x2 + dx - 1));
outw(CUR_Y, (short)(pbox->y2 + dy - 1));
outw(DESTX_DIASTP, (short)(pbox->x2 - 1));
outw(DESTY_AXSTP, (short)(pbox->y2 - 1));
outw(MAJ_AXIS_PCNT, (short)(pbox->x2 - pbox->x1 - 1));
outw(MULTIFUNC_CNTL, MIN_AXIS_PCNT | (short)(pbox->y2 - pbox->y1 - 1));
outw(CMD, CMD_BITBLT | direction | DRAW | PLANAR | WRTDATA);
}
}
WaitQueue(2);
outw(FRGD_MIX, FSS_FRGDCOL | MIX_SRC);
outw(BKGD_MIX, BSS_BKGDCOL | MIX_SRC);
(* pWin->drawable.pScreen->RegionDestroy)(prgnDst);
DEALLOCATE_LOCAL(ordering);
}
|
Powered by ViewCVS 0.9.2 |