From 6ddade2e6a843a4c0081d4a31fa303d1e2464f36 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 12 Feb 2024 11:42:39 +0100 Subject: [PATCH] render: move private definitions out of picturestr.h Public module API headers don't need / shouldn't to contain anything that isn't part of the API (non-exported functions, etc). Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- Xext/panoramiX.c | 2 +- render/animcur.c | 2 +- render/picture.c | 2 +- render/picturestr.h | 32 ---------------------------- render/picturestr_priv.h | 46 ++++++++++++++++++++++++++++++++++++++++ render/render.c | 2 +- xfixes/region.c | 2 +- 7 files changed, 51 insertions(+), 37 deletions(-) create mode 100644 render/picturestr_priv.h diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index bd9c45b03..ae8489558 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -52,7 +52,7 @@ Equipment Corporation. #include "globals.h" #include "servermd.h" #include "resource.h" -#include "picturestr.h" +#include "picturestr_priv.h" #include "xfixesint.h" #include "damageextint.h" #ifdef COMPOSITE diff --git a/render/animcur.c b/render/animcur.c index ef27bda27..eb8b817e2 100644 --- a/render/animcur.c +++ b/render/animcur.c @@ -43,7 +43,7 @@ #include "cursorstr.h" #include "dixfontstr.h" #include "opaque.h" -#include "picturestr.h" +#include "picturestr_priv.h" #include "inputstr.h" #include "xace.h" diff --git a/render/picture.c b/render/picture.c index 2be4b1954..065890cfb 100644 --- a/render/picture.c +++ b/render/picture.c @@ -39,7 +39,7 @@ #include "dixstruct.h" #include "gcstruct.h" #include "servermd.h" -#include "picturestr.h" +#include "picturestr_priv.h" #include "xace.h" #ifdef PANORAMIX #include "panoramiXsrv.h" diff --git a/render/picturestr.h b/render/picturestr.h index a5d981e0d..5ebc3a132 100644 --- a/render/picturestr.h +++ b/render/picturestr.h @@ -56,7 +56,6 @@ typedef struct _PictFormat { typedef struct pixman_vector PictVector, *PictVectorPtr; typedef struct pixman_transform PictTransform, *PictTransformPtr; -#define PICT_GRADIENT_STOPTABLE_SIZE 1024 #define SourcePictTypeSolidFill 0 #define SourcePictTypeLinear 1 #define SourcePictTypeRadial 2 @@ -347,31 +346,12 @@ extern _X_EXPORT DevPrivateKeyRec PictureScreenPrivateKeyRec; extern _X_EXPORT DevPrivateKeyRec PictureWindowPrivateKeyRec; #define PictureWindowPrivateKey (&PictureWindowPrivateKeyRec) -extern RESTYPE PictureType; -extern RESTYPE PictFormatType; -extern RESTYPE GlyphSetType; - #define GetPictureScreen(s) ((PictureScreenPtr)dixLookupPrivate(&(s)->devPrivates, PictureScreenPrivateKey)) #define GetPictureScreenIfSet(s) (dixPrivateKeyRegistered(PictureScreenPrivateKey) ? GetPictureScreen(s) : NULL) #define SetPictureScreen(s,p) dixSetPrivate(&(s)->devPrivates, PictureScreenPrivateKey, p) #define GetPictureWindow(w) ((PicturePtr)dixLookupPrivate(&(w)->devPrivates, PictureWindowPrivateKey)) #define SetPictureWindow(w,p) dixSetPrivate(&(w)->devPrivates, PictureWindowPrivateKey, p) -#define VERIFY_PICTURE(pPicture, pid, client, mode) {\ - int tmprc = dixLookupResourceByType((void *)&(pPicture), pid,\ - PictureType, client, mode);\ - if (tmprc != Success)\ - return tmprc;\ -} - -#define VERIFY_ALPHA(pPicture, pid, client, mode) {\ - if (pid == None) \ - pPicture = 0; \ - else { \ - VERIFY_PICTURE(pPicture, pid, client, mode); \ - } \ -} \ - extern _X_EXPORT PictFormatPtr PictureWindowFormat(WindowPtr pWindow); @@ -505,13 +485,6 @@ CompositeTriFan(CARD8 op, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points); -Bool - AnimCurInit(ScreenPtr pScreen); - -int -AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor, - CursorPtr *ppCursor, ClientPtr client, XID cid); - extern _X_EXPORT void AddTraps(PicturePtr pPicture, INT16 xOff, INT16 yOff, int ntraps, xTrap * traps); @@ -542,11 +515,6 @@ CreateConicalGradientPicture(Picture pid, int nStops, xFixed * stops, xRenderColor * colors, int *error); -#ifdef PANORAMIX -extern void PanoramiXRenderInit(void); -extern void PanoramiXRenderReset(void); -#endif - /* * matrix.c */ diff --git a/render/picturestr_priv.h b/render/picturestr_priv.h new file mode 100644 index 000000000..b5064a5ac --- /dev/null +++ b/render/picturestr_priv.h @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: MIT OR X11 + * + * Copyright © 2024 Enrico Weigelt, metux IT consult + * Copyright © 2000 SuSE, Inc. + */ +#ifndef _XSERVER_PICTURESTR_PRIV_H_ +#define _XSERVER_PICTURESTR_PRIV_H_ + +#include "picturestr.h" +#include "scrnintstr.h" +#include "glyphstr.h" +#include "resource.h" +#include "privates.h" + +#define PICT_GRADIENT_STOPTABLE_SIZE 1024 + +extern RESTYPE PictureType; +extern RESTYPE PictFormatType; +extern RESTYPE GlyphSetType; + +#define VERIFY_PICTURE(pPicture, pid, client, mode) {\ + int tmprc = dixLookupResourceByType((void *)&(pPicture), pid,\ + PictureType, client, mode);\ + if (tmprc != Success)\ + return tmprc;\ +} + +#define VERIFY_ALPHA(pPicture, pid, client, mode) {\ + if (pid == None) \ + pPicture = 0; \ + else { \ + VERIFY_PICTURE(pPicture, pid, client, mode); \ + } \ +} \ + +Bool AnimCurInit(ScreenPtr pScreen); + +int AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor, + CursorPtr *ppCursor, ClientPtr client, XID cid); + +#ifdef PANORAMIX +void PanoramiXRenderInit(void); +void PanoramiXRenderReset(void); +#endif /* PANORAMIX */ + +#endif /* _XSERVER_PICTURESTR_PRIV_H_ */ diff --git a/render/render.c b/render/render.c index 456f156d4..8ae057ce0 100644 --- a/render/render.c +++ b/render/render.c @@ -41,7 +41,7 @@ #include "servermd.h" #include #include -#include "picturestr.h" +#include "picturestr_priv.h" #include "glyphstr.h" #include #include "cursorstr.h" diff --git a/xfixes/region.c b/xfixes/region.c index 7c0a7d2fe..42031faf3 100644 --- a/xfixes/region.c +++ b/xfixes/region.c @@ -26,7 +26,7 @@ #include "xfixesint.h" #include "scrnintstr.h" -#include +#include "picturestr_priv.h" #include #include