mi: move over public SDK headers to include/

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2026-02-12 14:58:29 +01:00
committed by Enrico Weigelt
parent 0272fcd55e
commit 58e80dc78a
15 changed files with 14 additions and 21 deletions

View File

@@ -452,6 +452,16 @@ if build_xorg
'input.h',
'inputstr.h',
'list.h',
'micmap.h',
'micoord.h',
'migc.h',
'mi.h',
'miline.h',
'mioverlay.h',
'mipointer.h',
'mipointrst.h',
'mistruct.h',
'mizerarc.h',
'misc.h',
'miscstruct.h',
'misync.h',

300
include/mi.h Normal file
View File

@@ -0,0 +1,300 @@
/***********************************************************
Copyright 1987, 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.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
#ifndef MI_H
#define MI_H
#include <X11/X.h>
#include <X11/fonts/font.h>
#include "regionstr.h"
#include "validate.h"
#include "window.h"
#include "gc.h"
#include "input.h"
#include "cursor.h"
#include "privates.h"
#include "colormap.h"
#include "events.h"
#define MiBits CARD32
typedef struct _miDash *miDashPtr;
#define EVEN_DASH 0
#define ODD_DASH ~0
/* miarc.c */
extern _X_EXPORT void miPolyArc(DrawablePtr /*pDraw */ ,
GCPtr /*pGC */ ,
int /*narcs */ ,
xArc * /*parcs */
);
/* micopy.c */
#define miGetCompositeClip(pGC) ((pGC)->pCompositeClip)
typedef void (*miCopyProc) (DrawablePtr pSrcDrawable,
DrawablePtr pDstDrawable,
GCPtr pGC,
BoxPtr pDstBox,
int nbox,
int dx,
int dy,
Bool reverse,
Bool upsidedown, Pixel bitplane, void *closure);
extern _X_EXPORT void
miCopyRegion(DrawablePtr pSrcDrawable,
DrawablePtr pDstDrawable,
GCPtr pGC,
RegionPtr pDstRegion,
int dx,
int dy, miCopyProc copyProc, Pixel bitPlane, void *closure);
extern _X_EXPORT RegionPtr
miDoCopy(DrawablePtr pSrcDrawable,
DrawablePtr pDstDrawable,
GCPtr pGC,
int xIn,
int yIn,
int widthSrc,
int heightSrc,
int xOut,
int yOut, miCopyProc copyProc, Pixel bitplane, void *closure);
/* mieq.c */
#ifndef INPUT_H
typedef struct _DeviceRec *DevicePtr;
#endif
/* miexpose.c */
extern _X_EXPORT RegionPtr miHandleExposures(DrawablePtr /*pSrcDrawable */ ,
DrawablePtr /*pDstDrawable */ ,
GCPtr /*pGC */ ,
int /*srcx */ ,
int /*srcy */ ,
int /*width */ ,
int /*height */ ,
int /*dstx */ ,
int /*dsty */
);
extern _X_EXPORT void miClearDrawable(DrawablePtr /*pDraw */ ,
GCPtr /*pGC */
);
/* miglblt.c */
extern _X_EXPORT void miPolyGlyphBlt(DrawablePtr pDrawable,
GCPtr pGC,
int x,
int y,
unsigned int nglyph,
CharInfoPtr *ppci,
void *pglyphBase
);
extern _X_EXPORT void miImageGlyphBlt(DrawablePtr pDrawable,
GCPtr pGC,
int x,
int y,
unsigned int nglyph,
CharInfoPtr *ppci,
void *pglyphBase
);
/* mipoly.c */
extern _X_EXPORT void miFillPolygon(DrawablePtr /*dst */ ,
GCPtr /*pgc */ ,
int /*shape */ ,
int /*mode */ ,
int /*count */ ,
DDXPointPtr /*pPts */
);
/* mipolypnt.c */
extern _X_EXPORT void miPolyPoint(DrawablePtr /*pDrawable */ ,
GCPtr /*pGC */ ,
int /*mode */ ,
int /*npt */ ,
xPoint * /*pptInit */
);
/* mipolyrect.c */
extern _X_EXPORT void miPolyRectangle(DrawablePtr /*pDraw */ ,
GCPtr /*pGC */ ,
int /*nrects */ ,
xRectangle * /*pRects */
);
/* mipolyseg.c */
extern _X_EXPORT void miPolySegment(DrawablePtr /*pDraw */ ,
GCPtr /*pGC */ ,
int /*nseg */ ,
xSegment * /*pSegs */
);
/* mipolytext.c */
extern _X_EXPORT int miPolyText8(DrawablePtr /*pDraw */ ,
GCPtr /*pGC */ ,
int /*x */ ,
int /*y */ ,
int /*count */ ,
char * /*chars */
);
extern _X_EXPORT int miPolyText16(DrawablePtr /*pDraw */ ,
GCPtr /*pGC */ ,
int /*x */ ,
int /*y */ ,
int /*count */ ,
unsigned short * /*chars */
);
extern _X_EXPORT void miImageText8(DrawablePtr /*pDraw */ ,
GCPtr /*pGC */ ,
int /*x */ ,
int /*y */ ,
int /*count */ ,
char * /*chars */
);
extern _X_EXPORT void miImageText16(DrawablePtr /*pDraw */ ,
GCPtr /*pGC */ ,
int /*x */ ,
int /*y */ ,
int /*count */ ,
unsigned short * /*chars */
);
/* mipushpxl.c */
extern _X_EXPORT void miPushPixels(GCPtr /*pGC */ ,
PixmapPtr /*pBitMap */ ,
DrawablePtr /*pDrawable */ ,
int /*dx */ ,
int /*dy */ ,
int /*xOrg */ ,
int /*yOrg */
);
/* miscrinit.c */
extern _X_EXPORT Bool miModifyPixmapHeader(PixmapPtr pPixmap,
int width,
int height,
int depth,
int bitsPerPixel,
int devKind,
void *pPixData
);
extern _X_EXPORT Bool miScreenInit(ScreenPtr pScreen,
void *pbits,
int xsize,
int ysize,
int dpix,
int dpiy,
int width,
int rootDepth,
int numDepths,
DepthPtr depths,
VisualID rootVisual,
int numVisuals,
VisualPtr visuals
);
/* mivaltree.c */
extern _X_EXPORT void miWideLine(DrawablePtr /*pDrawable */ ,
GCPtr /*pGC */ ,
int /*mode */ ,
int /*npt */ ,
DDXPointPtr /*pPts */
);
extern _X_EXPORT void miWideDash(DrawablePtr /*pDrawable */ ,
GCPtr /*pGC */ ,
int /*mode */ ,
int /*npt */ ,
DDXPointPtr /*pPts */
);
extern _X_EXPORT void miPolylines(DrawablePtr pDrawable,
GCPtr pGC,
int mode,
int npt,
DDXPointPtr pPts);
/* mizerarc.c */
extern _X_EXPORT void miZeroPolyArc(DrawablePtr /*pDraw */ ,
GCPtr /*pGC */ ,
int /*narcs */ ,
xArc * /*parcs */
);
_X_EXPORT void miZeroLine(DrawablePtr dst, GCPtr gc, int mode, int nptInit, xPoint* pptInit);
_X_EXPORT void miZeroDashLine(DrawablePtr dst, GCPtr pgc, int mode, int nptInit, xPoint *pptInit);
extern _X_EXPORT void miPolyFillArc(DrawablePtr /*pDraw */ ,
GCPtr /*pGC */ ,
int /*narcs */ ,
xArc * /*parcs */
);
#endif /* MI_H */

43
include/micmap.h Normal file
View File

@@ -0,0 +1,43 @@
#ifndef _MICMAP_H_
#define _MICMAP_H_
#include <X11/X.h>
#include <X11/Xdefs.h>
#include <X11/Xfuncproto.h>
#include "colormap.h"
#include "privates.h"
#include "screenint.h"
extern _X_EXPORT DevPrivateKeyRec micmapScrPrivateKeyRec;
#define micmapScrPrivateKey (&micmapScrPrivateKeyRec)
extern _X_EXPORT int miListInstalledColormaps(ScreenPtr pScreen,
Colormap * pmaps);
extern _X_EXPORT void miInstallColormap(ColormapPtr pmap);
extern _X_EXPORT void miUninstallColormap(ColormapPtr pmap);
extern _X_EXPORT void miResolveColor(unsigned short *, unsigned short *,
unsigned short *, VisualPtr);
extern _X_EXPORT Bool miInitializeColormap(ColormapPtr);
extern _X_EXPORT Bool miCreateDefColormap(ScreenPtr);
extern _X_EXPORT void miClearVisualTypes(void);
extern _X_EXPORT Bool miSetVisualTypes(int, int, int, int);
extern _X_EXPORT Bool miSetPixmapDepths(void);
extern _X_EXPORT Bool miSetVisualTypesAndMasks(int depth, int visuals,
int bitsPerRGB, int preferredCVC,
Pixel redMask, Pixel greenMask,
Pixel blueMask);
extern _X_EXPORT int miGetDefaultVisualMask(int);
extern _X_EXPORT Bool miInitVisuals(VisualPtr *, DepthPtr *, int *, int *,
int *, VisualID *, unsigned long, int, int);
#define MAX_PSEUDO_DEPTH 10
#define StaticColorMask (1 << StaticColor)
#define PseudoColorMask (1 << PseudoColor)
#define TrueColorMask (1 << TrueColor)
#define DirectColorMask (1 << DirectColor)
#endif /* _MICMAP_H_ */

47
include/micoord.h Normal file
View File

@@ -0,0 +1,47 @@
/*
* Copyright (C) 2000 The XFree86 Project, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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
* XFREE86 PROJECT 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 XFree86 Project 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
* XFree86 Project.
*
*/
#ifndef _MICOORD_H_
#define _MICOORD_H_ 1
#include "servermd.h"
/* Macros which handle a coordinate in a single register */
#define GetHighWord(x) (((int) (x)) >> 16)
#if IMAGE_BYTE_ORDER == MSBFirst
#define coordToInt(x,y) (((x) << 16) | ((y) & 0xffff))
#define intToX(i) (GetHighWord(i))
#define intToY(i) ((int) ((short) i))
#else
#define coordToInt(x,y) (((y) << 16) | ((x) & 0xffff))
#define intToX(i) ((int) ((short) (i)))
#define intToY(i) (GetHighWord(i))
#endif
#endif /* _MICOORD_H_ */

54
include/migc.h Normal file
View File

@@ -0,0 +1,54 @@
/*
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 _MIGC_H
#define _MIGC_H
extern _X_EXPORT void miChangeGC(GCPtr pGC,
unsigned long mask);
extern _X_EXPORT void miDestroyGC(GCPtr pGC);
extern _X_EXPORT void miDestroyClip(GCPtr pGC);
extern _X_EXPORT void miChangeClip(GCPtr pGC,
int type,
void *pvalue,
int nrects);
extern _X_EXPORT void miCopyClip(GCPtr pgcDst,
GCPtr pgcSrc);
extern _X_EXPORT void miCopyGC(GCPtr pGCSrc,
unsigned long changes,
GCPtr pGCDst);
extern _X_EXPORT void miComputeCompositeClip(GCPtr pGC,
DrawablePtr pDrawable);
#endif

152
include/miline.h Normal file
View File

@@ -0,0 +1,152 @@
/*
Copyright 1994, 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 MILINE_H
#define MILINE_H
#include "screenint.h"
#include "privates.h"
/*
* Public definitions used for configuring basic pixelization aspects
* of the sample implementation line-drawing routines provided in
* {mfb,mi,cfb*} at run-time.
*/
#define XDECREASING 4
#define YDECREASING 2
#define YMAJOR 1
#define OCTANT1 (1 << (YDECREASING))
#define OCTANT2 (1 << (YDECREASING|YMAJOR))
#define OCTANT3 (1 << (XDECREASING|YDECREASING|YMAJOR))
#define OCTANT4 (1 << (XDECREASING|YDECREASING))
#define OCTANT5 (1 << (XDECREASING))
#define OCTANT6 (1 << (XDECREASING|YMAJOR))
#define OCTANT7 (1 << (YMAJOR))
#define OCTANT8 (1 << (0))
/*
* Devices can configure the rendering of routines in mi, mfb, and cfb*
* by specifying a thin line bias to be applied to a particular screen
* using the following function. The bias parameter is an OR'ing of
* the appropriate OCTANT constants defined above to indicate which
* octants to bias a line to prefer an axial step when the Bresenham
* error term is exactly zero. The octants are mapped as follows:
*
* \ | /
* \ 3 | 2 /
* \ | /
* 4 \ | / 1
* \|/
* -----------
* /|\
* 5 / | \ 8
* / | \
* / 6 | 7 \
* / | \
*
* For more information, see "Ambiguities in Incremental Line Rastering,"
* Jack E. Bresenham, IEEE CG&A, May 1987.
*/
extern _X_EXPORT void miSetZeroLineBias(ScreenPtr /* pScreen */ ,
unsigned int /* bias */
);
/*
* Private definitions needed for drawing thin (zero width) lines
* Used by the mi, mfb, and all cfb* components.
*/
#define X_AXIS 0
#define Y_AXIS 1
#define OUT_LEFT 0x08
#define OUT_RIGHT 0x04
#define OUT_ABOVE 0x02
#define OUT_BELOW 0x01
#define OUTCODES(_result, _x, _y, _pbox) \
if ( (_x) < (_pbox)->x1) (_result) |= OUT_LEFT; \
else if ( (_x) >= (_pbox)->x2) (_result) |= OUT_RIGHT; \
if ( (_y) < (_pbox)->y1) (_result) |= OUT_ABOVE; \
else if ( (_y) >= (_pbox)->y2) (_result) |= OUT_BELOW;
#define MIOUTCODES(outcode, x, y, xmin, ymin, xmax, ymax) \
{\
if (x < xmin) outcode |= OUT_LEFT;\
if (x > xmax) outcode |= OUT_RIGHT;\
if (y < ymin) outcode |= OUT_ABOVE;\
if (y > ymax) outcode |= OUT_BELOW;\
}
#define miGetZeroLineBias(_pScreen) ((unsigned long) (unsigned long*)\
dixLookupPrivate(&(_pScreen)->devPrivates, miZeroLineScreenKey))
#define CalcLineDeltas(_x1,_y1,_x2,_y2,_adx,_ady,_sx,_sy,_SX,_SY,_octant) \
(_octant) = 0; \
(_sx) = (_SX); \
if (((_adx) = (_x2) - (_x1)) < 0) { \
(_adx) = -(_adx); \
(_sx = -(_sx)); \
(_octant) |= XDECREASING; \
} \
(_sy) = (_SY); \
if (((_ady) = (_y2) - (_y1)) < 0) { \
(_ady) = -(_ady); \
(_sy = -(_sy)); \
(_octant) |= YDECREASING; \
}
#define SetYMajorOctant(_octant) ((_octant) |= YMAJOR)
#define FIXUP_ERROR(_e, _octant, _bias) \
(_e) -= (((_bias) >> (_octant)) & 1)
extern _X_EXPORT DevPrivateKeyRec miZeroLineScreenKeyRec;
#define miZeroLineScreenKey (&miZeroLineScreenKeyRec)
extern _X_EXPORT int miZeroClipLine(int /*xmin */ ,
int /*ymin */ ,
int /*xmax */ ,
int /*ymax */ ,
int * /*new_x1 */ ,
int * /*new_y1 */ ,
int * /*new_x2 */ ,
int * /*new_y2 */ ,
unsigned int /*adx */ ,
unsigned int /*ady */ ,
int * /*pt1_clipped */ ,
int * /*pt2_clipped */ ,
int /*octant */ ,
unsigned int /*bias */ ,
int /*oc1 */ ,
int /*oc2 */
);
#endif /* MILINE_H */

22
include/mioverlay.h Normal file
View File

@@ -0,0 +1,22 @@
#ifndef __MIOVERLAY_H
#define __MIOVERLAY_H
typedef void (*miOverlayTransFunc) (ScreenPtr, int, BoxPtr);
typedef Bool (*miOverlayInOverlayFunc) (WindowPtr);
extern _X_EXPORT Bool
miInitOverlay(ScreenPtr pScreen,
miOverlayInOverlayFunc inOverlay, miOverlayTransFunc trans);
extern _X_EXPORT Bool
miOverlayGetPrivateClips(WindowPtr pWin,
RegionPtr *borderClip, RegionPtr *clipList);
extern _X_EXPORT Bool miOverlayCollectUnderlayRegions(WindowPtr, RegionPtr *);
extern _X_EXPORT void miOverlayComputeCompositeClip(GCPtr, WindowPtr);
extern _X_EXPORT Bool miOverlayCopyUnderlay(ScreenPtr);
extern _X_EXPORT void miOverlaySetRootClip(ScreenPtr, Bool);
#endif /* __MIOVERLAY_H */

129
include/mipointer.h Normal file
View File

@@ -0,0 +1,129 @@
/*
Copyright 1989, 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 MIPOINTER_H
#define MIPOINTER_H
#include "cursor.h"
#include "input.h"
#include "privates.h"
typedef struct _miPointerSpriteFuncRec {
Bool (*RealizeCursor) (DeviceIntPtr /* pDev */ ,
ScreenPtr /* pScr */ ,
CursorPtr /* pCurs */
);
Bool (*UnrealizeCursor) (DeviceIntPtr /* pDev */ ,
ScreenPtr /* pScr */ ,
CursorPtr /* pCurs */
);
void (*SetCursor) (DeviceIntPtr /* pDev */ ,
ScreenPtr /* pScr */ ,
CursorPtr /* pCurs */ ,
int /* x */ ,
int /* y */
);
void (*MoveCursor) (DeviceIntPtr /* pDev */ ,
ScreenPtr /* pScr */ ,
int /* x */ ,
int /* y */
);
Bool (*DeviceCursorInitialize) (DeviceIntPtr /* pDev */ ,
ScreenPtr /* pScr */
);
void (*DeviceCursorCleanup) (DeviceIntPtr /* pDev */ ,
ScreenPtr /* pScr */
);
} miPointerSpriteFuncRec, *miPointerSpriteFuncPtr;
typedef struct _miPointerScreenFuncRec {
Bool (*CursorOffScreen) (ScreenPtr * /* ppScr */ ,
int * /* px */ ,
int * /* py */
);
void (*CrossScreen) (ScreenPtr /* pScr */ ,
int /* entering */
);
void (*WarpCursor) (DeviceIntPtr /*pDev */ ,
ScreenPtr /* pScr */ ,
int /* x */ ,
int /* y */
);
} miPointerScreenFuncRec, *miPointerScreenFuncPtr;
extern _X_EXPORT Bool miDCInitialize(ScreenPtr /*pScreen */ ,
miPointerScreenFuncPtr /*screenFuncs */
);
extern _X_EXPORT ScreenPtr
miPointerGetScreen(DeviceIntPtr pDev);
/* Returns the current cursor position. */
extern _X_EXPORT void
miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y);
/* Moves the cursor to the specified position. May clip the coordinates:
* x and y are modified in-place. */
extern _X_EXPORT ScreenPtr
miPointerSetPosition(DeviceIntPtr pDev, int mode, double *x, double *y,
int *nevents, InternalEvent *events);
extern _X_EXPORT DevPrivateKeyRec miPointerScreenKeyRec;
#define miPointerScreenKey (&miPointerScreenKeyRec)
/**
* @brief initialize pointer cursor with custom handling
*
* For DDX'es that need their own handling of pointer cursors,
* and can't use the generic "soft cursor" that's created via
* miDCInitialize().
*
* That can be the case on certain video HW with it's own sprite support,
* or on remote display protocols like RDP, where the client get the cursor
* pixmaps sent over the wire and is responsible for painting it on his side.
*
* Overwrites ScreenPtr vectors:
*
* ConstrainCursor, CursorLimits, DisplayCursor, RealizeCursor,
* UnrealizeCursor, SetCursorPosition, RecolorCursor, DeviceCursorCleanup
* DeviceCursorInitialize
*
* Hooks to ScreenPtr vectors: CloseScreen
*
* @param pScreen pointer to ScreenRec the pointer handling applies to
* @param spireFuncs pointer to miPointerSpriteFuncPtr call vectors
* @param screenFuncs pointer to miPointerScreenFuncPtr call vectors
* @param waitForUpdate TRUE if MI shouldn't redraw the pointer immediately,
but wait for somebody else triggering it explicitly
* @return TRUE on success, FALSE usually indicates allocation failure
*/
_X_EXPORT Bool
miPointerInitialize(ScreenPtr pScreen,
miPointerSpriteFuncPtr spriteFuncs,
miPointerScreenFuncPtr screenFuncs,
Bool waitForUpdate);
#endif /* MIPOINTER_H */

44
include/mipointrst.h Normal file
View File

@@ -0,0 +1,44 @@
/*
* mipointrst.h
*
*/
/*
Copyright 1989, 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 MIPOINTRST_H
#define MIPOINTRST_H
#include "mipointer.h"
#include "scrnintstr.h"
typedef struct {
miPointerSpriteFuncPtr spriteFuncs; /* sprite-specific methods */
miPointerScreenFuncPtr screenFuncs; /* screen-specific methods */
CloseScreenProcPtr CloseScreen;
Bool waitForUpdate; /* don't move cursor from input thread */
Bool showTransparent; /* show empty cursors */
} miPointerScreenRec, *miPointerScreenPtr;
#endif /* MIPOINTRST_H */

62
include/mistruct.h Normal file
View File

@@ -0,0 +1,62 @@
/***********************************************************
Copyright 1987, 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.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
#ifndef MISTRUCT_H
#define MISTRUCT_H
#include "mi.h"
#include "regionstr.h"
/* information about dashes */
typedef struct _miDash {
xPoint pt;
int e1, e2; /* keep these, so we don't have to do it again */
int e; /* bresenham error term for this point on line */
int which;
int newLine; /* 0 if part of same original line as previous dash */
} miDashRec;
#endif /* MISTRUCT_H */

129
include/mizerarc.h Normal file
View File

@@ -0,0 +1,129 @@
/************************************************************
Copyright 1989, 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 XSERVER_MIZERARC_H
#define XSERVER_MIZERARC_H
typedef struct {
int x;
int y;
int mask;
} miZeroArcPtRec;
typedef struct {
int x, y, k1, k3, a, b, d, dx, dy;
int alpha, beta;
int xorg, yorg;
int xorgo, yorgo;
int w, h;
int initialMask;
miZeroArcPtRec start, altstart, end, altend;
int firstx, firsty;
int startAngle, endAngle;
} miZeroArcRec;
#define miCanZeroArc(arc) (((arc)->width == (arc)->height) || \
(((arc)->width <= 800) && ((arc)->height <= 800)))
#define MIARCSETUP() \
x = info.x; \
y = info.y; \
k1 = info.k1; \
k3 = info.k3; \
a = info.a; \
b = info.b; \
d = info.d; \
dx = info.dx; \
dy = info.dy
#define MIARCOCTANTSHIFT(clause) \
if (a < 0) \
{ \
if (y == info.h) \
{ \
d = -1; \
a = b = k1 = 0; \
} \
else \
{ \
dx = (k1 << 1) - k3; \
k1 = dx - k1; \
k3 = -k3; \
b = b + a - (k1 >> 1); \
d = b + ((-a) >> 1) - d + (k3 >> 3); \
if (dx < 0) \
a = -((-dx) >> 1) - a; \
else \
a = (dx >> 1) - a; \
dx = 0; \
dy = 1; \
clause \
} \
}
#define MIARCSTEP(move1,move2) \
b -= k1; \
if (d < 0) \
{ \
x += dx; \
y += dy; \
a += k1; \
d += b; \
move1 \
} \
else \
{ \
x++; \
y++; \
a += k3; \
d -= a; \
move2 \
}
#define MIARCCIRCLESTEP(clause) \
b -= k1; \
x++; \
if (d < 0) \
{ \
a += k1; \
d += b; \
} \
else \
{ \
y++; \
a += k3; \
d -= a; \
clause \
}
/* mizerarc.c */
extern _X_EXPORT Bool miZeroArcSetup(xArc * /*arc */ ,
miZeroArcRec * /*info */ ,
Bool /*ok360 */
);
#endif /* XSERVER_MIZERARC_H */