b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* $Xorg: pixmap.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/***********************************************************
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncCopyright 1987, 1998 The Open Group
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncPermission to use, copy, modify, distribute, and sell this software and its
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncdocumentation for any purpose is hereby granted without fee, provided that
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncthe above copyright notice appear in all copies and that both that
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynccopyright notice and this permission notice appear in supporting
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncdocumentation.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncThe above copyright notice and this permission notice shall be included in
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncall copies or substantial portions of the Software.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncExcept as contained in this notice, the name of The Open Group shall not be
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncused in advertising or otherwise to promote the sale, use or other dealings
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncin this Software without prior written authorization from The Open Group.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync All Rights Reserved
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncPermission to use, copy, modify, and distribute this software and its
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncdocumentation for any purpose and without fee is hereby granted,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncprovided that the above copyright notice appear in all copies and that
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncboth that copyright notice and this permission notice appear in
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncsupporting documentation, and that the name of Digital not be
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncused in advertising or publicity pertaining to distribution of the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncsoftware without specific, written prior permission.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncSOFTWARE.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync******************************************************************/
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* $XFree86$ */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#ifndef PIXMAP_H
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define PIXMAP_H
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#include "misc.h"
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#include "screenint.h"
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* types for Drawable */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define DRAWABLE_WINDOW 0
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define DRAWABLE_PIXMAP 1
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define UNDRAWABLE_WINDOW 2
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define DRAWABLE_BUFFER 3
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* flags to PaintWindow() */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define PW_BACKGROUND 0
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define PW_BORDER 1
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define NullPixmap ((PixmapPtr)0)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct _Drawable *DrawablePtr;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct _Pixmap *PixmapPtr;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef union _PixUnion {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync PixmapPtr pixmap;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync unsigned long pixel;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} PixUnion;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define SamePixUnion(a,b,isPixel)\
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ((isPixel) ? (a).pixel == (b).pixel : (a).pixmap == (b).pixmap)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define EqualPixUnion(as, a, bs, b) \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ((as) == (bs) && (SamePixUnion (a, b, as)))
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define OnScreenDrawable(type) \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ((type == DRAWABLE_WINDOW) || (type == DRAWABLE_BUFFER))
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define WindowDrawable(type) \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ((type == DRAWABLE_WINDOW) || (type == UNDRAWABLE_WINDOW))
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern PixmapPtr GetScratchPixmapHeader(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ScreenPtr /*pScreen*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*width*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*height*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*depth*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*bitsPerPixel*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*devKind*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync pointer /*pPixData*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern void FreeScratchPixmapHeader(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync PixmapPtr /*pPixmap*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern Bool CreateScratchPixmapsForScreen(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*scrnum*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern void FreeScratchPixmapsForScreen(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*scrnum*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern PixmapPtr AllocatePixmap(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ScreenPtr /*pScreen*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*pixDataSize*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#endif /* PIXMAP_H */