65fea56f17cd614bc8908264df980a62e1931468vboxsync/***********************************************************
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncCopyright 1987, 1998 The Open Group
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncPermission to use, copy, modify, distribute, and sell this software and its
65fea56f17cd614bc8908264df980a62e1931468vboxsyncdocumentation for any purpose is hereby granted without fee, provided that
65fea56f17cd614bc8908264df980a62e1931468vboxsyncthe above copyright notice appear in all copies and that both that
65fea56f17cd614bc8908264df980a62e1931468vboxsynccopyright notice and this permission notice appear in supporting
65fea56f17cd614bc8908264df980a62e1931468vboxsyncdocumentation.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncThe above copyright notice and this permission notice shall be included in
65fea56f17cd614bc8908264df980a62e1931468vboxsyncall copies or substantial portions of the Software.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
65fea56f17cd614bc8908264df980a62e1931468vboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
65fea56f17cd614bc8908264df980a62e1931468vboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
65fea56f17cd614bc8908264df980a62e1931468vboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
65fea56f17cd614bc8908264df980a62e1931468vboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
65fea56f17cd614bc8908264df980a62e1931468vboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncExcept as contained in this notice, the name of The Open Group shall not be
65fea56f17cd614bc8908264df980a62e1931468vboxsyncused in advertising or otherwise to promote the sale, use or other dealings
65fea56f17cd614bc8908264df980a62e1931468vboxsyncin this Software without prior written authorization from The Open Group.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync All Rights Reserved
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncPermission to use, copy, modify, and distribute this software and its
65fea56f17cd614bc8908264df980a62e1931468vboxsyncdocumentation for any purpose and without fee is hereby granted,
65fea56f17cd614bc8908264df980a62e1931468vboxsyncprovided that the above copyright notice appear in all copies and that
65fea56f17cd614bc8908264df980a62e1931468vboxsyncboth that copyright notice and this permission notice appear in
65fea56f17cd614bc8908264df980a62e1931468vboxsyncsupporting documentation, and that the name of Digital not be
65fea56f17cd614bc8908264df980a62e1931468vboxsyncused in advertising or publicity pertaining to distribution of the
65fea56f17cd614bc8908264df980a62e1931468vboxsyncsoftware without specific, written prior permission.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
65fea56f17cd614bc8908264df980a62e1931468vboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
65fea56f17cd614bc8908264df980a62e1931468vboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
65fea56f17cd614bc8908264df980a62e1931468vboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
65fea56f17cd614bc8908264df980a62e1931468vboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
65fea56f17cd614bc8908264df980a62e1931468vboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
65fea56f17cd614bc8908264df980a62e1931468vboxsyncSOFTWARE.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync******************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef PIXMAP_H
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define PIXMAP_H
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include "misc.h"
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include "screenint.h"
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include "regionstr.h"
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* types for Drawable */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define DRAWABLE_WINDOW 0
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define DRAWABLE_PIXMAP 1
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define UNDRAWABLE_WINDOW 2
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* corresponding type masks for dixLookupDrawable() */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define M_DRAWABLE_WINDOW (1<<0)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define M_DRAWABLE_PIXMAP (1<<1)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define M_UNDRAWABLE_WINDOW (1<<2)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define M_ANY (-1)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define M_WINDOW (M_DRAWABLE_WINDOW|M_UNDRAWABLE_WINDOW)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define M_DRAWABLE (M_DRAWABLE_WINDOW|M_DRAWABLE_PIXMAP)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define M_UNDRAWABLE (M_UNDRAWABLE_WINDOW)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* flags to PaintWindow() */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define PW_BACKGROUND 0
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define PW_BORDER 1
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define NullPixmap ((PixmapPtr)0)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef struct _Drawable *DrawablePtr;
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef struct _Pixmap *PixmapPtr;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef struct _PixmapDirtyUpdate *PixmapDirtyUpdatePtr;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef union _PixUnion {
65fea56f17cd614bc8908264df980a62e1931468vboxsync PixmapPtr pixmap;
65fea56f17cd614bc8908264df980a62e1931468vboxsync unsigned long pixel;
65fea56f17cd614bc8908264df980a62e1931468vboxsync} PixUnion;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define SamePixUnion(a,b,isPixel)\
65fea56f17cd614bc8908264df980a62e1931468vboxsync ((isPixel) ? (a).pixel == (b).pixel : (a).pixmap == (b).pixmap)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define EqualPixUnion(as, a, bs, b) \
65fea56f17cd614bc8908264df980a62e1931468vboxsync ((as) == (bs) && (SamePixUnion (a, b, as)))
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define OnScreenDrawable(type) \
65fea56f17cd614bc8908264df980a62e1931468vboxsync (type == DRAWABLE_WINDOW)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define WindowDrawable(type) \
65fea56f17cd614bc8908264df980a62e1931468vboxsync ((type == DRAWABLE_WINDOW) || (type == UNDRAWABLE_WINDOW))
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT PixmapPtr GetScratchPixmapHeader(ScreenPtr /*pScreen */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync int /*width */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync int /*height */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync int /*depth */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync int /*bitsPerPixel */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync int /*devKind */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync pointer /*pPixData */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT void FreeScratchPixmapHeader(PixmapPtr /*pPixmap */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT Bool CreateScratchPixmapsForScreen(ScreenPtr /*pScreen */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT void FreeScratchPixmapsForScreen(ScreenPtr /*pScreen */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT PixmapPtr AllocatePixmap(ScreenPtr /*pScreen */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync int /*pixDataSize */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT void FreePixmap(PixmapPtr /*pPixmap */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT PixmapPtr
65fea56f17cd614bc8908264df980a62e1931468vboxsyncPixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT Bool
65fea56f17cd614bc8908264df980a62e1931468vboxsyncPixmapStartDirtyTracking(PixmapPtr src,
65fea56f17cd614bc8908264df980a62e1931468vboxsync PixmapPtr slave_dst,
65fea56f17cd614bc8908264df980a62e1931468vboxsync int x, int y);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT Bool
65fea56f17cd614bc8908264df980a62e1931468vboxsyncPixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* helper function, drivers can do this themselves if they can do it more
65fea56f17cd614bc8908264df980a62e1931468vboxsync efficently */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT Bool
65fea56f17cd614bc8908264df980a62e1931468vboxsyncPixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty, RegionPtr dirty_region);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* PIXMAP_H */