943N/A/* Copyright (c) 1993, 1994, Oracle and/or its affiliates. All rights reserved.
830N/A *
830N/A * Permission is hereby granted, free of charge, to any person obtaining a
919N/A * copy of this software and associated documentation files (the "Software"),
919N/A * to deal in the Software without restriction, including without limitation
919N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense,
919N/A * and/or sell copies of the Software, and to permit persons to whom the
919N/A * Software is furnished to do so, subject to the following conditions:
830N/A *
919N/A * The above copyright notice and this permission notice (including the next
919N/A * paragraph) shall be included in all copies or substantial portions of the
919N/A * Software.
830N/A *
919N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
919N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
919N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
919N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
919N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
919N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
919N/A * DEALINGS IN THE SOFTWARE.
830N/A */
830N/A
830N/A
830N/A#ifndef _DGA_INTERNALDEFS_H
830N/A#define _DGA_INTERNALDEFS_H
830N/A
830N/A#include "dga_externaldefs.h"
830N/A/*
830N/A** Defined symbols and macros used internally within DGA
830N/A*/
830N/A
830N/A#define DGA_MBFLIP_VIDEO 0
830N/A#define DGA_MBFLIP_COPY 1
830N/A
830N/A/* Basic changes - attribute changes */
830N/A#define DGA_CHANGE_CLIP (1L<<0)
830N/A#define DGA_CHANGE_CURSOR (1L<<1)
830N/A#define DGA_CHANGE_BSTORE (1L<<2)
830N/A#define DGA_CHANGE_CACHE (1L<<3)
830N/A#define DGA_CHANGE_ZOMBIE (1L<<4)
830N/A
830N/A/* Basic changes - "major boundary" changes */
830N/A#define DGA_CHANGE_MBUFSET (1L<<5)
830N/A#define DGA_CHANGE_ALIAS (1L<<6)
830N/A
830N/A/* Always a derivative change */
830N/A#define DGA_CHANGE_SITE (1L<<7)
830N/A
830N/A/* Device dependent information change */
830N/A#define DGA_CHANGE_DEVINFO (1L<<8)
830N/A
830N/A/* Overlay state information change */
830N/A#define DGA_CHANGE_OVLSTATE (1L<<9)
830N/A
830N/A#define DGA_WIN_CHANGEABLE_ATTRS \
830N/A (DGA_CHANGE_CLIP | DGA_CHANGE_CURSOR | DGA_CHANGE_BSTORE)
830N/A
830N/A/* note: bstore needs to be included because prev lock subject could have
830N/A been a win with bstore and vmbufs never have bstore */
830N/A#define DGA_VMBUF_CHANGEABLE_ATTRS \
830N/A (DGA_CHANGE_CLIP | DGA_CHANGE_CURSOR | DGA_CHANGE_BSTORE)
830N/A
830N/A/* note: bstore needs to be included because prev lock subject could have
830N/A been a win with bstore and nmbufs never have bstore */
830N/A#define DGA_NMBUF_CHANGEABLE_ATTRS \
830N/A (DGA_CHANGE_CLIP | DGA_CHANGE_CURSOR | DGA_CHANGE_BSTORE | DGA_CHANGE_CACHE)
830N/A
830N/A#define DGA_LOCKSUBJ_INVALID (-2)
830N/A
830N/A#define DGA_LOCKSUBJ_VALID(dgawin, lockSubj) \
830N/A ((lockSubj) != DGA_LOCKSUBJ_INVALID)
830N/A
830N/A#define DGA_MBUFFER_MASK(bufIndex) \
830N/A (1L<<(bufIndex))
830N/A
830N/A/* lock subject is a window? */
830N/A#define DGA_LOCKSUBJ_WINDOW(dgawin, lockSubj) \
830N/A ((lockSubj) == -1)
830N/A
830N/A/* lock subject is a multibuffer? */
830N/A#define DGA_LOCKSUBJ_MBUFFER(dgawin, lockSubj) \
830N/A (!DGA_LOCKSUBJ_WINDOW((dgawin), (lockSubj)) && \
830N/A DGA_LOCKSUBJ_VALID((dgawin), (lockSubj)))
830N/A
830N/A/* lock subject is a viewable multibuffer? */
830N/A#define DGA_LOCKSUBJ_VMBUFFER(dgawin, lockSubj) \
830N/A (DGA_LOCKSUBJ_MBUFFER((dgawin), (lockSubj)) \
830N/A ? DGA_MBUF_ISVIEWABLE((dgawin)->pMbs, (lockSubj)) \
830N/A : 0) \
830N/A
830N/A/* effective lock subject is a nonviewable multibuffer? */
830N/A#define DGA_LOCKSUBJ_NMBUFFER(dgawin, lockSubj) \
830N/A (DGA_LOCKSUBJ_MBUFFER((dgawin), (lockSubj)) \
830N/A ? !DGA_LOCKSUBJ_VMBUFFER((dgawin), (lockSubj)) \
830N/A : 0) \
830N/A
830N/A/* is lock subject viewable? (zombies are considered not viewable) */
830N/A#define DGA_LOCKSUBJ_VIEWABLE(dgawin, lockSubj) \
830N/A ( !((dgawin)->changeMask & DGA_CHANGE_ZOMBIE) && \
830N/A ((lockSubj) != DGA_LOCKSUBJ_INVALID) && \
830N/A ( (DGA_LOCKSUBJ_WINDOW((dgawin), (lockSubj))) || \
830N/A (DGA_MBUF_ISVIEWABLE((dgawin)->pMbs, (lockSubj))) \
830N/A ) \
830N/A )
830N/A
830N/A/* is window or mbuffer aliased? */
830N/A#define DGA_MBSMEMB_ALIASED(dgawin) \
830N/A ((dgawin)->eLockSubj != (dgawin)->rLockSubj)
830N/A
830N/A#define DGA_MBUF_ISVIEWABLE(pMbs, bufIndex) \
830N/A (!((pMbs)->pNbShinfo[(bufIndex)]))
830N/A
830N/A#endif /* _DGA_INTERNALDEFS_H */