From 62b0add8582347220bfb7600cdd74028af56e032 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 10 Feb 2026 12:57:00 +0100 Subject: [PATCH] mi: move ValidateRec to mi_priv.h and rename to MiValidateRec Signed-off-by: Enrico Weigelt, metux IT consult --- dix/window.c | 1 - hw/kdrive/src/kdrive.c | 1 - hw/kdrive/src/kxv.c | 1 - hw/kdrive/src/kxv.h | 1 - hw/xfree86/common/xf86Helper.c | 1 - hw/xfree86/common/xf86xv.c | 1 - hw/xquartz/xpr/driWrap.c | 1 - include/validate.h | 4 +-- include/windowstr.h | 2 +- mi/mi_priv.h | 13 +++++++++ mi/mioverlay.c | 1 - mi/mivalidate.h | 47 -------------------------------- mi/mivaltree.c | 1 - mi/miwindow.c | 9 +++--- miext/rootless/rootlessGC.c | 1 - miext/rootless/rootlessScreen.c | 1 - miext/rootless/rootlessValTree.c | 2 -- 17 files changed, 21 insertions(+), 67 deletions(-) delete mode 100644 mi/mivalidate.h diff --git a/dix/window.c b/dix/window.c index e661350f49..15be5c48d7 100644 --- a/dix/window.c +++ b/dix/window.c @@ -135,7 +135,6 @@ Equipment Corporation. #include "dixstruct.h" #include "gcstruct.h" #include "servermd.h" -#include "mivalidate.h" #include "globals.h" #include "compint.h" #include "privates.h" diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c index fba0bde0d3..eb921a0257 100644 --- a/hw/kdrive/src/kdrive.c +++ b/hw/kdrive/src/kdrive.c @@ -34,7 +34,6 @@ #include "os/osdep.h" #include "kdrive.h" -#include #include #include "privates.h" diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c index 285923c285..010d4b28ea 100644 --- a/hw/kdrive/src/kxv.c +++ b/hw/kdrive/src/kxv.c @@ -49,7 +49,6 @@ of the copyright holder. #include "regionstr.h" #include "windowstr.h" #include "pixmapstr.h" -#include "mivalidate.h" #include "validate.h" #include "resource.h" #include "gcstruct.h" diff --git a/hw/kdrive/src/kxv.h b/hw/kdrive/src/kxv.h index f251279420..9c5975072e 100644 --- a/hw/kdrive/src/kxv.h +++ b/hw/kdrive/src/kxv.h @@ -42,7 +42,6 @@ of the copyright holder. #include "regionstr.h" #include "windowstr.h" #include "pixmapstr.h" -#include "mivalidate.h" #include "validate.h" #include "resource.h" #include "gcstruct.h" diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index f5f09825df..6f5c464d70 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -61,7 +61,6 @@ #include "xf86Xinput_priv.h" #include "xf86InPriv.h" #include "xf86Config.h" -#include "mivalidate.h" #include "xf86Module_priv.h" /* For xf86GetClocks */ diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c index a4b42c05ac..e9f431f92d 100644 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c @@ -45,7 +45,6 @@ #include "regionstr.h" #include "windowstr.h" #include "pixmapstr.h" -#include "mivalidate.h" #include "validate.h" #include "resource.h" #include "gcstruct.h" diff --git a/hw/xquartz/xpr/driWrap.c b/hw/xquartz/xpr/driWrap.c index cf63eb9fc6..292a0c4882 100644 --- a/hw/xquartz/xpr/driWrap.c +++ b/hw/xquartz/xpr/driWrap.c @@ -36,7 +36,6 @@ #include "pixmapstr.h" #include "windowstr.h" #include "dixfontstr.h" -#include "mivalidate.h" #include "driWrap.h" #include "dri.h" diff --git a/include/validate.h b/include/validate.h index 1df22a38a7..8fcc8b8b4a 100644 --- a/include/validate.h +++ b/include/validate.h @@ -32,8 +32,8 @@ in this Software without prior written authorization from The Open Group. typedef enum { VTOther, VTStack, VTMove, VTUnmap, VTMap, VTBroken } VTKind; -/* union _Validate is now device dependent; see mivalidate.h for an example */ -typedef union _Validate *ValidatePtr; +/* union _MiValidate is now device dependent; see mivalidate.h for an example */ +typedef union _MiValidate *ValidatePtr; #define UnmapValData ((ValidatePtr)1) diff --git a/include/windowstr.h b/include/windowstr.h index 3c68c88781..9510c0ef84 100644 --- a/include/windowstr.h +++ b/include/windowstr.h @@ -124,7 +124,7 @@ typedef struct _Window { WindowPtr lastChild; /* bottom-most child */ RegionRec clipList; /* clipping rectangle for output */ RegionRec borderClip; /* NotClippedByChildren + border */ - union _Validate *valdata; + union _MiValidate *valdata; RegionRec winSize; RegionRec borderSize; xPoint origin; /* position relative to parent */ diff --git a/mi/mi_priv.h b/mi/mi_priv.h index ba52f03403..716adebb49 100644 --- a/mi/mi_priv.h +++ b/mi/mi_priv.h @@ -89,4 +89,17 @@ WindowPtr miXYToWindow(ScreenPtr pScreen, SpritePtr pSprite, int x, int y); _X_EXPORT /* used by in-tree libwfb.so module */ int miExpandDirectColors(ColormapPtr, int, xColorItem *, xColorItem *); +typedef union _MiValidate { + struct BeforeValidate { + DDXPointRec oldAbsCorner; /* old window position */ + RegionPtr borderVisible; /* visible region of border, */ + /* non-null when size changes */ + Bool resized; /* unclipped winSize has changed */ + } before; + struct AfterValidate { + RegionRec exposed; /* exposed regions, absolute pos */ + RegionRec borderExposed; + } after; +} MiValidateRec; + #endif /* _XSERVER_MI_PRIV_H */ diff --git a/mi/mioverlay.c b/mi/mioverlay.c index aa9544d8c6..d79473240f 100644 --- a/mi/mioverlay.c +++ b/mi/mioverlay.c @@ -18,7 +18,6 @@ #include "gcstruct.h" #include "regionstr.h" #include "privates.h" -#include "mivalidate.h" #include "mioverlay.h" #include "migc.h" diff --git a/mi/mivalidate.h b/mi/mivalidate.h deleted file mode 100644 index 1b423f85c5..0000000000 --- a/mi/mivalidate.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - -Copyright 1993, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ - -#ifndef MIVALIDATE_H -#define MIVALIDATE_H - -#include "regionstr.h" - -typedef union _Validate { - struct BeforeValidate { - DDXPointRec oldAbsCorner; /* old window position */ - RegionPtr borderVisible; /* visible region of border, */ - /* non-null when size changes */ - Bool resized; /* unclipped winSize has changed */ - } before; - struct AfterValidate { - RegionRec exposed; /* exposed regions, absolute pos */ - RegionRec borderExposed; - } after; -} ValidateRec; - -#endif /* MIVALIDATE_H */ diff --git a/mi/mivaltree.c b/mi/mivaltree.c index f812e52f99..8981f11146 100644 --- a/mi/mivaltree.c +++ b/mi/mivaltree.c @@ -99,7 +99,6 @@ Equipment Corporation. #include "validate.h" #include "windowstr.h" #include "regionstr.h" -#include "mivalidate.h" #include "globals.h" #include "compint.h" diff --git a/mi/miwindow.c b/mi/miwindow.c index 7eaa45c0ed..59aa00419f 100644 --- a/mi/miwindow.c +++ b/mi/miwindow.c @@ -59,7 +59,6 @@ SOFTWARE. #include "windowstr.h" #include "scrnintstr.h" #include "pixmapstr.h" -#include "mivalidate.h" #include "inputstr.h" void @@ -123,11 +122,13 @@ miClearToBackground(WindowPtr pWin, void miMarkWindow(WindowPtr pWin) { - ValidatePtr val; - if (pWin->valdata) return; - val = (ValidatePtr) XNFalloc(sizeof(ValidateRec)); + + ValidatePtr val = (ValidatePtr) calloc(1, sizeof(MiValidateRec)); + if (!val) + return; + val->before.oldAbsCorner.x = pWin->drawable.x; val->before.oldAbsCorner.y = pWin->drawable.y; val->before.borderVisible = NullRegion; diff --git a/miext/rootless/rootlessGC.c b/miext/rootless/rootlessGC.c index 1f68228317..9f7fe4cb2c 100644 --- a/miext/rootless/rootlessGC.c +++ b/miext/rootless/rootlessGC.c @@ -38,7 +38,6 @@ #include "pixmapstr.h" #include "windowstr.h" #include "dixfontstr.h" -#include "mivalidate.h" #include "fb.h" #include diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c index 3d1bef43a4..03d04a774a 100644 --- a/miext/rootless/rootlessScreen.c +++ b/miext/rootless/rootlessScreen.c @@ -46,7 +46,6 @@ #include "pixmapstr.h" #include "windowstr.h" #include "propertyst.h" -#include "mivalidate.h" #include "picturestr.h" #include "rootlessCommon.h" diff --git a/miext/rootless/rootlessValTree.c b/miext/rootless/rootlessValTree.c index 3a6b7f6893..26e9077fad 100644 --- a/miext/rootless/rootlessValTree.c +++ b/miext/rootless/rootlessValTree.c @@ -101,8 +101,6 @@ Equipment Corporation. #include "validate.h" #include "windowstr.h" #include "regionstr.h" -#include "mivalidate.h" - #include "globals.h" int RootlessMiValidateTree(WindowPtr pRoot, WindowPtr pChild, VTKind kind);