From adc27c5220918ee0b776e3948250f33c80279268 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 24 Feb 2025 19:13:37 +0100 Subject: [PATCH] dix: move ColormapRec declaration out of public header Not used by any external module/driver, so no need to keep it in public header. Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/saver.c | 1 - composite/compinit.c | 2 +- dix/colormap.c | 1 - dix/colormap_priv.h | 27 +++++++++++++++++++++++++++ dix/dispatch.c | 1 - dix/privates.c | 4 +++- dix/window.c | 1 - hw/kdrive/src/kdrive.h | 4 +++- hw/vfb/InitOutput.c | 1 - hw/xfree86/common/xf86DGA.c | 1 - hw/xfree86/common/xf86VGAarbiter.c | 2 ++ hw/xfree86/common/xf86cmap.c | 1 - hw/xfree86/ramdac/xf86CursorRD.c | 2 +- hw/xnest/Color.c | 1 - hw/xnest/Color.h | 2 ++ hw/xwin/win.h | 3 ++- include/colormapst.h | 30 +----------------------------- mi/micmap.c | 1 - mi/misprite.c | 1 - miext/rootless/rootlessCommon.c | 3 ++- miext/rootless/rootlessScreen.c | 1 - render/miindex.c | 1 - render/picture.c | 1 - render/render.c | 2 +- 24 files changed, 45 insertions(+), 49 deletions(-) diff --git a/Xext/saver.c b/Xext/saver.c index d82665702..3a6aeba83 100644 --- a/Xext/saver.c +++ b/Xext/saver.c @@ -50,7 +50,6 @@ in this Software without prior written authorization from the X Consortium. #include "resource.h" #include "gcstruct.h" #include "cursorstr.h" -#include "colormapst.h" #include "xace.h" #include "inputstr.h" #ifdef XINERAMA diff --git a/composite/compinit.c b/composite/compinit.c index 238ff5865..11e546bd6 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -43,9 +43,9 @@ #include +#include "dix/colormap_priv.h" #include "dix/dix_priv.h" #include "dix/screen_hooks_priv.h" -#include "include/colormapst.h" #include "os/osdep.h" #include "compint.h" diff --git a/dix/colormap.c b/dix/colormap.c index d1428a113..d78d1a775 100644 --- a/dix/colormap.c +++ b/dix/colormap.c @@ -61,7 +61,6 @@ SOFTWARE. #include "misc.h" #include "dix.h" #include "dixstruct.h" -#include "colormapst.h" #include "os.h" #include "scrnintstr.h" #include "resource.h" diff --git a/dix/colormap_priv.h b/dix/colormap_priv.h index 176dd1347..2768d3e79 100644 --- a/dix/colormap_priv.h +++ b/dix/colormap_priv.h @@ -10,6 +10,7 @@ #include "dix/screenint_priv.h" #include "include/colormap.h" +#include "include/colormapst.h" #include "include/dix.h" #include "include/window.h" @@ -21,6 +22,32 @@ typedef struct _CMEntry *EntryPtr; +/* COLORMAPs can be used for either Direct or Pseudo color. PseudoColor + * only needs one cell table, we arbitrarily pick red. We keep track + * of that table with freeRed, numPixelsRed, and clientPixelsRed */ + +typedef struct _ColormapRec { + VisualPtr pVisual; + short class; /* PseudoColor or DirectColor */ + XID mid; /* client's name for colormap */ + ScreenPtr pScreen; /* screen map is associated with */ + short flags; /* 1 = CM_IsDefault + * 2 = CM_AllAllocated */ + int freeRed; + int freeGreen; + int freeBlue; + int *numPixelsRed; + int *numPixelsGreen; + int *numPixelsBlue; + Pixel **clientPixelsRed; + Pixel **clientPixelsGreen; + Pixel **clientPixelsBlue; + Entry *red; + Entry *green; + Entry *blue; + PrivateRec *devPrivates; +} ColormapRec; + int dixCreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, ColormapPtr *ppcmap, int alloc, ClientPtr client); diff --git a/dix/dispatch.c b/dix/dispatch.c index 77686c884..70da7c043 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -123,7 +123,6 @@ Equipment Corporation. #include "dixfontstr.h" #include "gcstruct.h" #include "selection.h" -#include "colormapst.h" #include "cursorstr.h" #include "scrnintstr.h" #include "servermd.h" diff --git a/dix/privates.c b/dix/privates.c index 17bd65d33..846ddd9c3 100644 --- a/dix/privates.c +++ b/dix/privates.c @@ -51,12 +51,14 @@ from The Open Group. #include #include + +#include "dix/colormap_priv.h" + #include "windowstr.h" #include "resource.h" #include "privates.h" #include "gcstruct.h" #include "cursorstr.h" -#include "colormapst.h" #include "inputstr.h" #include "scrnintstr.h" #include "extnsionst.h" diff --git a/dix/window.c b/dix/window.c index d911bf00d..7af03768f 100644 --- a/dix/window.c +++ b/dix/window.c @@ -121,7 +121,6 @@ Equipment Corporation. #include "propertyst.h" #include "inputstr.h" #include "resource.h" -#include "colormapst.h" #include "cursorstr.h" #include "dixstruct.h" #include "gcstruct.h" diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h index 6899aa188..a4b7576d0 100644 --- a/hw/kdrive/src/kdrive.h +++ b/hw/kdrive/src/kdrive.h @@ -28,11 +28,13 @@ #include #include #include + +#include "dix/colormap_priv.h" + #include "scrnintstr.h" #include "pixmapstr.h" #include "windowstr.h" #include "servermd.h" -#include "colormapst.h" #include "gcstruct.h" #include "input.h" #include "mipointer.h" diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index 5c52d05cd..de007b89e 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -48,7 +48,6 @@ from The Open Group. #include "servermd.h" #define PSZ 8 #include "fb.h" -#include "colormapst.h" #include "gcstruct.h" #include "input.h" #include "mipointer.h" diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c index 7ec15de6f..452a4f2f5 100644 --- a/hw/xfree86/common/xf86DGA.c +++ b/hw/xfree86/common/xf86DGA.c @@ -58,7 +58,6 @@ #include "xf86Priv.h" #include "dgaproc.h" #include "dgaproc_priv.h" -#include "colormapst.h" #include "pixmapstr.h" #include "inputstr.h" #include "globals.h" diff --git a/hw/xfree86/common/xf86VGAarbiter.c b/hw/xfree86/common/xf86VGAarbiter.c index 448c72b4f..3cb8f7565 100644 --- a/hw/xfree86/common/xf86VGAarbiter.c +++ b/hw/xfree86/common/xf86VGAarbiter.c @@ -30,6 +30,8 @@ #include "xorg-config.h" +#include "dix/colormap_priv.h" + #include "xf86VGAarbiter_priv.h" #include "xf86VGAarbiterPriv.h" #include "xf86Bus.h" diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c index 31275d1e7..891ada2ac 100644 --- a/hw/xfree86/common/xf86cmap.c +++ b/hw/xfree86/common/xf86cmap.c @@ -40,7 +40,6 @@ #include "mi/mi_priv.h" #include "misc.h" -#include "colormapst.h" #include "scrnintstr.h" #include "resource.h" diff --git a/hw/xfree86/ramdac/xf86CursorRD.c b/hw/xfree86/ramdac/xf86CursorRD.c index 20cf2db00..ae880cfca 100644 --- a/hw/xfree86/ramdac/xf86CursorRD.c +++ b/hw/xfree86/ramdac/xf86CursorRD.c @@ -3,13 +3,13 @@ #include #endif +#include "dix/colormap_priv.h" #include "dix/cursor_priv.h" #include "dix/screen_hooks_priv.h" #include "mi/mipointer_priv.h" #include "xf86.h" #include "xf86CursorPriv.h" -#include "colormapst.h" #include "cursorstr.h" /* FIXME: This was added with the ABI change of the miPointerSpriteFuncs for diff --git a/hw/xnest/Color.c b/hw/xnest/Color.c index ecf337df1..2ea261178 100644 --- a/hw/xnest/Color.c +++ b/hw/xnest/Color.c @@ -22,7 +22,6 @@ is" without express or implied warranty. #include "scrnintstr.h" #include "window.h" #include "windowstr.h" -#include "colormapst.h" #include "resource.h" #include "Xnest.h" diff --git a/hw/xnest/Color.h b/hw/xnest/Color.h index 23f17540d..a91c3530d 100644 --- a/hw/xnest/Color.h +++ b/hw/xnest/Color.h @@ -18,6 +18,8 @@ is" without express or implied warranty. #include #include +#include "dix/colormap_priv.h" + #define DUMB_WINDOW_MANAGERS #define MAXCMAPS 1 diff --git a/hw/xwin/win.h b/hw/xwin/win.h index 0ac005a1e..5e9e50ba5 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -144,13 +144,14 @@ #include #include +#include "dix/colormap_priv.h" + #include "scrnintstr.h" #include "pixmapstr.h" #include "pixmap.h" #include "region.h" #include "gcstruct.h" #include "colormap.h" -#include "colormapst.h" #include "miscstruct.h" #include "servermd.h" #include "windowstr.h" diff --git a/include/colormapst.h b/include/colormapst.h index 78545f90d..c9eee9752 100644 --- a/include/colormapst.h +++ b/include/colormapst.h @@ -47,9 +47,7 @@ SOFTWARE. #ifndef CMAPSTRUCT_H #define CMAPSTRUCT_H 1 -#include "colormap.h" -#include "screenint.h" -#include "privates.h" +#include /* Shared color -- the color is used by AllocColorPlanes */ typedef struct { @@ -82,30 +80,4 @@ typedef struct _CMEntry { Bool fShared; } Entry; -/* COLORMAPs can be used for either Direct or Pseudo color. PseudoColor - * only needs one cell table, we arbitrarily pick red. We keep track - * of that table with freeRed, numPixelsRed, and clientPixelsRed */ - -typedef struct _ColormapRec { - VisualPtr pVisual; - short class; /* PseudoColor or DirectColor */ - XID mid; /* client's name for colormap */ - ScreenPtr pScreen; /* screen map is associated with */ - short flags; /* 1 = CM_IsDefault - * 2 = CM_AllAllocated */ - int freeRed; - int freeGreen; - int freeBlue; - int *numPixelsRed; - int *numPixelsGreen; - int *numPixelsBlue; - Pixel **clientPixelsRed; - Pixel **clientPixelsGreen; - Pixel **clientPixelsBlue; - Entry *red; - Entry *green; - Entry *blue; - PrivateRec *devPrivates; -} ColormapRec; - #endif /* COLORMAP_H */ diff --git a/mi/micmap.c b/mi/micmap.c index 134fe7a33..dce41a206 100644 --- a/mi/micmap.c +++ b/mi/micmap.c @@ -38,7 +38,6 @@ #include "os/osdep.h" #include "scrnintstr.h" -#include "colormapst.h" #include "resource.h" #include "globals.h" #include "micmap.h" diff --git a/mi/misprite.c b/mi/misprite.c index cee97bcef..b8c490281 100644 --- a/mi/misprite.c +++ b/mi/misprite.c @@ -47,7 +47,6 @@ in this Software without prior written authorization from The Open Group. #include "mi.h" #include "cursorstr.h" #include "scrnintstr.h" -#include "colormapst.h" #include "windowstr.h" #include "gcstruct.h" #include "mipointer.h" diff --git a/miext/rootless/rootlessCommon.c b/miext/rootless/rootlessCommon.c index b91b7dce5..4b059d863 100644 --- a/miext/rootless/rootlessCommon.c +++ b/miext/rootless/rootlessCommon.c @@ -34,8 +34,9 @@ #include /* For NULL */ #include /* For CHAR_BIT */ +#include "dix/colormap_priv.h" + #include "rootlessCommon.h" -#include "colormapst.h" unsigned int rootless_CopyBytes_threshold = 0; unsigned int rootless_CopyWindow_threshold = 0; diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c index 72d073ec4..e2ece791d 100644 --- a/miext/rootless/rootlessScreen.c +++ b/miext/rootless/rootlessScreen.c @@ -47,7 +47,6 @@ #include "propertyst.h" #include "mivalidate.h" #include "picturestr.h" -#include "colormapst.h" #include "rootlessCommon.h" #include "rootlessWindow.h" diff --git a/render/miindex.c b/render/miindex.c index df9cc110d..c9d62b916 100644 --- a/render/miindex.c +++ b/render/miindex.c @@ -32,7 +32,6 @@ #include "mi.h" #include "picturestr.h" #include "mipict.h" -#include "colormapst.h" #define NUM_CUBE_LEVELS 4 #define NUM_GRAY_LEVELS 13 diff --git a/render/picture.c b/render/picture.c index f0a2aee43..513c88ed1 100644 --- a/render/picture.c +++ b/render/picture.c @@ -36,7 +36,6 @@ #include "windowstr.h" #include "input.h" #include "resource.h" -#include "colormapst.h" #include "cursorstr.h" #include "dixstruct.h" #include "gcstruct.h" diff --git a/render/render.c b/render/render.c index 357f33d4b..729ca633d 100644 --- a/render/render.c +++ b/render/render.c @@ -31,6 +31,7 @@ #include #include +#include "dix/colormap_priv.h" #include "dix/cursor_priv.h" #include "dix/dix_priv.h" #include "os/osdep.h" @@ -42,7 +43,6 @@ #include "scrnintstr.h" #include "windowstr.h" #include "pixmapstr.h" -#include "colormapst.h" #include "extnsionst.h" #include "extinit_priv.h" #include "servermd.h"