From b9be119a3f3258df58067d24f5133b3e19dde91a Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Wed, 30 Jul 2003 10:06:34 +0000 Subject: [PATCH] Run PKG_CHECK_MODULES on slim. Require slim. Mark hidden. (PixRegionCopy, PixRegionUnion): Mark hidden. Include and use X11/Xfuncproto.h. Include slim_{export,import}.h as appropriate. Mark all functions with __external_linkage. Rename include protect to _PIXREGIONINT_H_. --- pixman/ChangeLog.libpixregion | 11 ++++++ pixman/configure.in | 3 ++ pixman/libpixman.pc.in | 1 + pixman/src/pixman.h | 63 +++++++++++++++++++++-------------- pixman/src/pixregion.c | 8 +++++ pixman/src/pixregionint.h | 8 ++--- 6 files changed, 65 insertions(+), 29 deletions(-) diff --git a/pixman/ChangeLog.libpixregion b/pixman/ChangeLog.libpixregion index 92041b9c6..84f663b0e 100644 --- a/pixman/ChangeLog.libpixregion +++ b/pixman/ChangeLog.libpixregion @@ -1,3 +1,14 @@ +2003-07-30 Richard Henderson + + * configure.in: Run PKG_CHECK_MODULES on slim. + * libpixregion.pc.in: Require slim. + * src/pixregion.c (PixRegionCreateSimple): Mark hidden. + (PixRegionCopy, PixRegionUnion): Mark hidden. + * src/pixregion.h: Include and use X11/Xfuncproto.h. Include + slim_{export,import}.h as appropriate. Mark all functions with + __external_linkage. + * src/pixregionint.h: Rename include protect to _PIXREGIONINT_H_. + 2003-04-22 Carl Worth * configure.in (LIBPIXREGION_MAJOR_VERSION): Fixed typo (Owen Taylor) diff --git a/pixman/configure.in b/pixman/configure.in index 2a7041761..074a5a23f 100644 --- a/pixman/configure.in +++ b/pixman/configure.in @@ -43,6 +43,9 @@ AC_PATH_XTRA dnl =========================================================================== +SLIM_REQUIRED=0.1.0 +PKG_CHECK_MODULES(LIBPIXREGION, slim >= $SLIM_REQUIRED) + AC_SUBST(LIBPIXREGION_CFLAGS) AC_SUBST(LIBPIXREGION_LIBS) diff --git a/pixman/libpixman.pc.in b/pixman/libpixman.pc.in index 5727977bb..b7077064b 100644 --- a/pixman/libpixman.pc.in +++ b/pixman/libpixman.pc.in @@ -5,6 +5,7 @@ includedir=@includedir@ Name: libpixregion Description: Pixel region library +Requires: slim Version: @VERSION@ Libs: -L${libdir} -lpixregion Cflags: -I${includedir} diff --git a/pixman/src/pixman.h b/pixman/src/pixman.h index 7eb95950d..0ef543af0 100644 --- a/pixman/src/pixman.h +++ b/pixman/src/pixman.h @@ -44,10 +44,20 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $Id: pixman.h,v 1.3 2003-04-25 20:21:42 cworth Exp $ */ +/* $Id: pixman.h,v 1.4 2003-07-30 17:06:34 rth Exp $ */ -#ifndef PIXREGION_H -#define PIXREGION_H +#ifndef _PIXREGION_H_ +#define _PIXREGION_H_ + +#include + +#ifdef _PIXREGIONINT_H_ +#include +#else +#include +#endif + +_XFUNCPROTOBEGIN typedef struct _PixRegion PixRegion; @@ -62,51 +72,51 @@ typedef enum { /* creation/destruction */ -PixRegion * +extern PixRegion * __external_linkage PixRegionCreate (void); -PixRegion * +extern PixRegion * __external_linkage PixRegionCreateSimple (PixRegionBox *extents); -void +extern void __external_linkage PixRegionDestroy (PixRegion *region); /* manipulation */ -void +extern void __external_linkage PixRegionTranslate (PixRegion *region, int x, int y); -PixRegionStatus +extern PixRegionStatus __external_linkage PixRegionCopy (PixRegion *dest, PixRegion *source); -PixRegionStatus +extern PixRegionStatus __external_linkage PixRegionIntersect (PixRegion *newReg, PixRegion *reg1, PixRegion *reg2); -PixRegionStatus +extern PixRegionStatus __external_linkage PixRegionUnion (PixRegion *newReg, PixRegion *reg1, PixRegion *reg2); -PixRegionStatus +extern PixRegionStatus __external_linkage PixRegionUnionRect(PixRegion *dest, PixRegion *source, int x, int y, unsigned int width, unsigned int height); -PixRegionStatus +extern PixRegionStatus __external_linkage PixRegionSubtract (PixRegion *regD, PixRegion *regM, PixRegion *regS); -PixRegionStatus +extern PixRegionStatus __external_linkage PixRegionInverse (PixRegion *newReg, PixRegion *reg1, PixRegionBox *invRect); /* XXX: Need to fix this so it doesn't depend on an X data structure -PixRegion * +extern PixRegion * __external_linkage RectsToPixRegion (int nrects, xRectanglePtr prect, int ctype); */ /* querying */ /* XXX: These should proably be combined: PixRegionGetRects? */ -int +extern int __external_linkage PixRegionNumRects (PixRegion *region); -PixRegionBox * +extern PixRegionBox * __external_linkage PixRegionRects (PixRegion *region); /* XXX: Change to an enum */ @@ -114,36 +124,39 @@ PixRegionRects (PixRegion *region); #define rgnIN 1 #define rgnPART 2 -int +extern int __external_linkage PixRegionPointInRegion (PixRegion *region, int x, int y, PixRegionBox *box); -int +extern int __external_linkage PixRegionRectIn (PixRegion *PixRegion, PixRegionBox *prect); -int +extern int __external_linkage PixRegionNotEmpty (PixRegion *region); -PixRegionBox * +extern PixRegionBox * __external_linkage PixRegionExtents (PixRegion *region); /* mucking around */ /* WARNING: calling PixRegionAppend may leave dest as an invalid region. Follow-up with PixRegionValidate to fix it up. */ -PixRegionStatus +extern PixRegionStatus __external_linkage PixRegionAppend (PixRegion *dest, PixRegion *region); -PixRegionStatus +extern PixRegionStatus __external_linkage PixRegionValidate (PixRegion *badreg, int *pOverlap); /* Unclassified functionality * XXX: Do all of these need to be exported? */ -void +extern void __external_linkage PixRegionReset (PixRegion *region, PixRegionBox *pBox); -void +extern void __external_linkage PixRegionEmpty (PixRegion *region); -#endif /* PIXREGION_H */ +_XFUNCPROTOEND +#undef __external_linkage + +#endif /* _PIXREGION_H_ */ diff --git a/pixman/src/pixregion.c b/pixman/src/pixregion.c index 24bbd5f0d..e7aca90fd 100644 --- a/pixman/src/pixregion.c +++ b/pixman/src/pixregion.c @@ -51,6 +51,7 @@ SOFTWARE. #include #include "pixregionint.h" +#include #if defined (__GNUC__) && !defined (NO_INLINES) #define INLINE __inline @@ -87,6 +88,10 @@ PixRegionInit (PixRegion *region, PixRegionBox *rect); static void PixRegionUninit (PixRegion *region); +slim_hidden_proto(PixRegionCreateSimple) +slim_hidden_proto(PixRegionCopy) +slim_hidden_proto(PixRegionUnion) + /* * The functions in this file implement the Region abstraction used extensively * throughout the X11 sample server. A Region is simply a set of disjoint @@ -325,6 +330,7 @@ PixRegionCreateSimple (PixRegionBox *extents) return region; } +slim_hidden_def(PixRegionCreateSimple) /***************************************************************** * RegionInit(pReg, rect, size) @@ -449,6 +455,7 @@ PixRegionCopy(PixRegion *dst, PixRegion *src) dst->data->numRects * sizeof(PixRegionBox)); return PixRegionStatusSuccess; } +slim_hidden_def(PixRegionCopy) /*====================================================================== @@ -1232,6 +1239,7 @@ PixRegionUnion(PixRegion *newReg, PixRegion *reg1, PixRegion *reg2) good(newReg); return PixRegionStatusSuccess; } +slim_hidden_def(PixRegionUnion) /*====================================================================== diff --git a/pixman/src/pixregionint.h b/pixman/src/pixregionint.h index f7e6d7d69..b06b2b650 100644 --- a/pixman/src/pixregionint.h +++ b/pixman/src/pixregionint.h @@ -44,10 +44,10 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $Id: pixregionint.h,v 1.2 2003-04-25 20:21:42 cworth Exp $ */ +/* $Id: pixregionint.h,v 1.3 2003-07-30 17:06:34 rth Exp $ */ -#ifndef PIXREGIONINT_H -#define PIXREGIONINT_H +#ifndef _PIXREGIONINT_H_ +#define _PIXREGIONINT_H_ #include "pixregion.h" @@ -80,4 +80,4 @@ typedef struct _PixRegionPoint { #define PIXREGION_END(reg) PIXREGION_BOX(reg, (reg)->data->numRects - 1) #define PIXREGION_SZOF(n) (sizeof(PixRegionData) + ((n) * sizeof(PixRegionBox))) -#endif +#endif /* _PIXREGIONINT_H_ */