memvar.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 1986-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_MEMVAR_H
#define _SYS_MEMVAR_H
#pragma ident "%Z%%M% %I% %E% SMI" /* SunOS4.1.2 1.45 */
#ifdef __cplusplus
extern "C" {
#endif
/*
* A memory pixrect is a special type of pixrect. Its image resides in
* memory, in a publicly known format permitting more direct access to the
* image than possible with the general pixrectops.
*
* In the memory pixrect the image is stored in consecutive memory locations,
* across the row from left to right, and then from top to bottom. Each row
* is padded to a 16-bit or 32-bit boundary (for details refer to the Pixrect
* Reference Manual).
*
* The depth of a pixel is the number of bits required to represent it.
* Pixels are placed in consecutive fields of width the depth of each pixel,
* with placement being independent of word or byte boundaries.
*/
struct mpr_data {
int md_linebytes; /* number of bytes from one line to next */
short *md_image; /* word address */
short md_primary;
short md_flags; /* Flag bits, see below */
};
/* pixrect data for memory pixrect with plane mask (MP_PLANEMASK set) */
struct mprp_data {
int planes;
};
/* md_flags bits definitions */
/* (should only be set if pr_depth = 1) */
/* (should only be set if pr_depth > 1) */
#if defined(__i386)
#endif
/* (hint to pr_batchrop) */
/*
* Each line (row) of the pixrect is padded to be a multiple
* of this many bits
*/
#define MPR_LINEBITPAD 16
#define mpr_linebytes(x, depth) \
#define mpr_prlinebytes(mpr) \
#define mpr_mdlinebytes(mpr) \
((short *)(\
((uchar_t *)(\
short *_mprs_addr();
uchar_t *_mprs8_addr();
int _mprs_skew();
#endif
/*
* Static pixrects. A pixrect may be created at compile time using the
* mpr_static macro as part of the static declarations of a program. Thus
* mpr_static(cursor, 16, 16, 1, rawcursordata);
* will declare and initialize (using rawcursordata) the storage needed
* for a pixrect that may be referred to as 'cursor' subsequently in the
* same file, or as &cursor if a pointer to that pixrect is called for rather
* than the pixrect itself.
*/
/*
* First a pair of utility macros that allow concatenation in a fashion that
* won't annoy lint (These belong in a standard header file!):
*/
#if defined(__STDC__) && !defined(__LIBCPP__)
#ifndef CAT
#define CAT(a, b) a##b
#endif
#else /* __STDC__ */
#ifndef CAT
#define IDENT(x) x
#endif
#endif /* __STDC__ */
{mpr_linebytes(w, d), (short *)(image), {0, 0}, 0, 0}; \
/* static pixrect with variables declared "static" */
{mpr_linebytes(w, d), (short *)(image), {0, 0}, 0, 0}; \
/*
* mem_rop() can handle. Use the following macro to find out.
*/
extern struct pixrectops mem_ops;
int mem_rop();
#ifndef _KERNEL
int mem_stencil();
int mem_batchrop();
int mem_destroy();
int mem_get();
int mem_put();
int mem_vector();
Pixrect *mem_region();
#endif /* _KERNEL */
int mem_putcolormap();
int mem_putattributes();
#ifndef _KERNEL
int mem_getcolormap();
int mem_getattributes();
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_MEMVAR_H */