Back to index

lightning-sunbird  0.9+nobinonly
pixregionint.h
Go to the documentation of this file.
00001 /***********************************************************
00002 
00003 Copyright 1987, 1998  The Open Group
00004 
00005 Permission to use, copy, modify, distribute, and sell this software and its
00006 documentation for any purpose is hereby granted without fee, provided that
00007 the above copyright notice appear in all copies and that both that
00008 copyright notice and this permission notice appear in supporting
00009 documentation.
00010 
00011 The above copyright notice and this permission notice shall be included in
00012 all copies or substantial portions of the Software.
00013 
00014 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00015 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00016 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
00017 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
00018 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00019 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00020 
00021 Except as contained in this notice, the name of The Open Group shall not be
00022 used in advertising or otherwise to promote the sale, use or other dealings
00023 in this Software without prior written authorization from The Open Group.
00024 
00025 
00026 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
00027 
00028                         All Rights Reserved
00029 
00030 Permission to use, copy, modify, and distribute this software and its 
00031 documentation for any purpose and without fee is hereby granted, 
00032 provided that the above copyright notice appear in all copies and that
00033 both that copyright notice and this permission notice appear in 
00034 supporting documentation, and that the name of Digital not be
00035 used in advertising or publicity pertaining to distribution of the
00036 software without specific, written prior permission.  
00037 
00038 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
00039 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
00040 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
00041 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
00042 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
00043 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
00044 SOFTWARE.
00045 
00046 ******************************************************************/
00047 /* $Id: pixregionint.h,v 1.3.4.1 2005/09/27 23:09:03 vladimir%pobox.com Exp $ */
00048 
00049 #ifndef _PIXREGIONINT_H_
00050 #define _PIXREGIONINT_H_
00051 
00052 #include "pixman.h"
00053 
00054 typedef struct pixman_region16_data {
00055     long             size;
00056     long             numRects;
00057     /* XXX: And why, exactly, do we have this bogus struct definition? */
00058 /*  pixman_box16_t   rects[size];   in memory but not explicitly declared */
00059 } pixman_region16_data_t;
00060 
00061 struct pixman_region16 {
00062     pixman_box16_t   extents;
00063     pixman_region16_data_t  *data;
00064 };
00065 
00066 typedef struct pixman_region16_point {
00067     int x, y;
00068 } pixman_region16_point_t;
00069 
00070 #define PIXREGION_NIL(reg) ((reg)->data && !(reg)->data->numRects)
00071 /* not a region */
00072 #define PIXREGION_NAR(reg)  ((reg)->data == &pixman_brokendata)
00073 #define PIXREGION_NUM_RECTS(reg) ((reg)->data ? (reg)->data->numRects : 1)
00074 #define PIXREGION_SIZE(reg) ((reg)->data ? (reg)->data->size : 0)
00075 #define PIXREGION_RECTS(reg) ((reg)->data ? (pixman_box16_t *)((reg)->data + 1) \
00076                                     : &(reg)->extents)
00077 #define PIXREGION_BOXPTR(reg) ((pixman_box16_t *)((reg)->data + 1))
00078 #define PIXREGION_BOX(reg,i) (&PIXREGION_BOXPTR(reg)[i])
00079 #define PIXREGION_TOP(reg) PIXREGION_BOX(reg, (reg)->data->numRects)
00080 #define PIXREGION_END(reg) PIXREGION_BOX(reg, (reg)->data->numRects - 1)
00081 #define PIXREGION_SZOF(n) (sizeof(pixman_region16_data_t) + ((n) * sizeof(pixman_box16_t)))
00082 
00083 #endif /* _PIXREGIONINT_H_ */