1 /* Copyright (c) 1993, 1994, Oracle and/or its affiliates. All rights reserved.
3 * Permission is hereby granted, free of charge, to any person obtaining a
4 * copy of this software and associated documentation files (the "Software"),
5 * to deal in the Software without restriction, including without limitation
6 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 * and/or sell copies of the Software, and to permit persons to whom the
8 * Software is furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice (including the next
11 * paragraph) shall be included in all copies or substantial portions of the
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
24 #ifndef _DGA_INTERNALDEFS_H
25 #define _DGA_INTERNALDEFS_H
27 #include "dga_externaldefs.h"
29 ** Defined symbols and macros used internally within DGA
32 #define DGA_MBFLIP_VIDEO 0
33 #define DGA_MBFLIP_COPY 1
35 /* Basic changes - attribute changes */
36 #define DGA_CHANGE_CLIP (1L<<0)
37 #define DGA_CHANGE_CURSOR (1L<<1)
38 #define DGA_CHANGE_BSTORE (1L<<2)
39 #define DGA_CHANGE_CACHE (1L<<3)
40 #define DGA_CHANGE_ZOMBIE (1L<<4)
42 /* Basic changes - "major boundary" changes */
43 #define DGA_CHANGE_MBUFSET (1L<<5)
44 #define DGA_CHANGE_ALIAS (1L<<6)
46 /* Always a derivative change */
47 #define DGA_CHANGE_SITE (1L<<7)
49 /* Device dependent information change */
50 #define DGA_CHANGE_DEVINFO (1L<<8)
52 /* Overlay state information change */
53 #define DGA_CHANGE_OVLSTATE (1L<<9)
55 #define DGA_WIN_CHANGEABLE_ATTRS \
56 (DGA_CHANGE_CLIP | DGA_CHANGE_CURSOR | DGA_CHANGE_BSTORE)
58 /* note: bstore needs to be included because prev lock subject could have
59 been a win with bstore and vmbufs never have bstore */
60 #define DGA_VMBUF_CHANGEABLE_ATTRS \
61 (DGA_CHANGE_CLIP | DGA_CHANGE_CURSOR | DGA_CHANGE_BSTORE)
63 /* note: bstore needs to be included because prev lock subject could have
64 been a win with bstore and nmbufs never have bstore */
65 #define DGA_NMBUF_CHANGEABLE_ATTRS \
66 (DGA_CHANGE_CLIP | DGA_CHANGE_CURSOR | DGA_CHANGE_BSTORE | DGA_CHANGE_CACHE)
68 #define DGA_LOCKSUBJ_INVALID (-2)
70 #define DGA_LOCKSUBJ_VALID(dgawin, lockSubj) \
71 ((lockSubj) != DGA_LOCKSUBJ_INVALID)
73 #define DGA_MBUFFER_MASK(bufIndex) \
76 /* lock subject is a window? */
77 #define DGA_LOCKSUBJ_WINDOW(dgawin, lockSubj) \
80 /* lock subject is a multibuffer? */
81 #define DGA_LOCKSUBJ_MBUFFER(dgawin, lockSubj) \
82 (!DGA_LOCKSUBJ_WINDOW((dgawin), (lockSubj)) && \
83 DGA_LOCKSUBJ_VALID((dgawin), (lockSubj)))
85 /* lock subject is a viewable multibuffer? */
86 #define DGA_LOCKSUBJ_VMBUFFER(dgawin, lockSubj) \
87 (DGA_LOCKSUBJ_MBUFFER((dgawin), (lockSubj)) \
88 ? DGA_MBUF_ISVIEWABLE((dgawin)->pMbs, (lockSubj)) \
91 /* effective lock subject is a nonviewable multibuffer? */
92 #define DGA_LOCKSUBJ_NMBUFFER(dgawin, lockSubj) \
93 (DGA_LOCKSUBJ_MBUFFER((dgawin), (lockSubj)) \
94 ? !DGA_LOCKSUBJ_VMBUFFER((dgawin), (lockSubj)) \
97 /* is lock subject viewable? (zombies are considered not viewable) */
98 #define DGA_LOCKSUBJ_VIEWABLE(dgawin, lockSubj) \
99 ( !((dgawin)->changeMask & DGA_CHANGE_ZOMBIE) && \
100 ((lockSubj) != DGA_LOCKSUBJ_INVALID) && \
101 ( (DGA_LOCKSUBJ_WINDOW((dgawin), (lockSubj))) || \
102 (DGA_MBUF_ISVIEWABLE((dgawin)->pMbs, (lockSubj))) \
106 /* is window or mbuffer aliased? */
107 #define DGA_MBSMEMB_ALIASED(dgawin) \
108 ((dgawin)->eLockSubj != (dgawin)->rLockSubj)
110 #define DGA_MBUF_ISVIEWABLE(pMbs, bufIndex) \
111 (!((pMbs)->pNbShinfo[(bufIndex)]))
113 #endif /* _DGA_INTERNALDEFS_H */