diff options
author | marha <marha@users.sourceforge.net> | 2009-09-06 18:48:27 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-09-06 18:48:27 +0000 |
commit | a915739887477b28d924ecc8417ee107d125bd6c (patch) | |
tree | c02f315476b61892d1fd89182e18943dce8d6277 /xorg-server/mi | |
parent | 6f25a23db1df27e992c34f6fd4c82e83c44fc2e2 (diff) | |
download | vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.tar.gz vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.tar.bz2 vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.zip |
Switched to xorg-server-1.6.99.900.tar.gz
Diffstat (limited to 'xorg-server/mi')
52 files changed, 1243 insertions, 791 deletions
diff --git a/xorg-server/mi/Makefile.am b/xorg-server/mi/Makefile.am index 7d76929ef..9714a21ca 100644 --- a/xorg-server/mi/Makefile.am +++ b/xorg-server/mi/Makefile.am @@ -3,7 +3,7 @@ noinst_LTLIBRARIES = libmi.la if XORG sdk_HEADERS = mibank.h micmap.h miline.h mipointer.h mi.h mibstore.h \ migc.h mipointrst.h mizerarc.h micoord.h mifillarc.h \ - mispans.h miwideline.h mistruct.h mifpoly.h + mispans.h miwideline.h mistruct.h mifpoly.h mioverlay.h endif AM_CFLAGS = $(DIX_CFLAGS) @@ -20,6 +20,7 @@ libmi_la_SOURCES = \ micmap.c \ micmap.h \ micoord.h \ + micopy.c \ micursor.c \ midash.c \ midispcur.c \ @@ -56,7 +57,6 @@ libmi_la_SOURCES = \ mispans.h \ misprite.c \ misprite.h \ - mispritest.h \ mistruct.h \ mivaltree.c \ mivalidate.h \ diff --git a/xorg-server/mi/Makefile.in b/xorg-server/mi/Makefile.in index 4b2cc4ed4..7d79421be 100644 --- a/xorg-server/mi/Makefile.in +++ b/xorg-server/mi/Makefile.in @@ -39,8 +39,11 @@ subdir = mi DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/dolt.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/shave.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -50,13 +53,14 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmi_la_LIBADD = am_libmi_la_OBJECTS = miarc.lo mibank.lo mibitblt.lo mibstore.lo \ - micmap.lo micursor.lo midash.lo midispcur.lo mieq.lo \ + micmap.lo micopy.lo micursor.lo midash.lo midispcur.lo mieq.lo \ miexpose.lo mifillarc.lo mifillrct.lo mifpolycon.lo migc.lo \ miglblt.lo mioverlay.lo mipointer.lo mipoly.lo mipolycon.lo \ mipolygen.lo mipolypnt.lo mipolyrect.lo mipolyseg.lo \ @@ -78,7 +82,8 @@ SOURCES = $(libmi_la_SOURCES) DIST_SOURCES = $(libmi_la_SOURCES) am__sdk_HEADERS_DIST = mibank.h micmap.h miline.h mipointer.h mi.h \ mibstore.h migc.h mipointrst.h mizerarc.h micoord.h \ - mifillarc.h mispans.h miwideline.h mistruct.h mifpoly.h + mifillarc.h mispans.h miwideline.h mistruct.h mifpoly.h \ + mioverlay.h am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -110,6 +115,7 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ +AM_MAKEFLAGS = @AM_MAKEFLAGS@ APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ @@ -130,9 +136,12 @@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DARWIN_LIBS = @DARWIN_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -161,7 +170,9 @@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -170,9 +181,13 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +F77 = @F77@ +FC = @FC@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GL_CFLAGS = @GL_CFLAGS@ @@ -211,12 +226,13 @@ LTCOMPILE = @LTCOMPILE@ LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ +MAIN_LIB = @MAIN_LIB@ +MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MAKE_HTML = @MAKE_HTML@ MAKE_PDF = @MAKE_PDF@ MAKE_PS = @MAKE_PS@ MAKE_TEXT = @MAKE_TEXT@ -MESA_SOURCE = @MESA_SOURCE@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ @@ -236,7 +252,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ @@ -246,6 +261,7 @@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PROJECTROOT = @PROJECTROOT@ PS2PDF = @PS2PDF@ +Q = @Q@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ @@ -259,11 +275,10 @@ STRIP = @STRIP@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ -VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@ -VENDOR_NAME = @VENDOR_NAME@ +V = @V@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ -VENDOR_RELEASE = @VENDOR_RELEASE@ VERSION = @VERSION@ +WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ @@ -299,6 +314,7 @@ XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ XORG_SYS_LIBS = @XORG_SYS_LIBS@ XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ XSDL_INCS = @XSDL_INCS@ @@ -323,7 +339,6 @@ YFLAGS = @YFLAGS@ __XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ -abi_font = @abi_font@ abi_videodrv = @abi_videodrv@ abi_xinput = @abi_xinput@ abs_builddir = @abs_builddir@ @@ -346,6 +361,7 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ +distcleancheck_listfiles = @distcleancheck_listfiles@ docdir = @docdir@ driverdir = @driverdir@ dvidir = @dvidir@ @@ -377,7 +393,9 @@ psdir = @psdir@ sbindir = @sbindir@ sdkdir = @sdkdir@ sharedstatedir = @sharedstatedir@ +shavedir = @shavedir@ srcdir = @srcdir@ +symbol_visibility = @symbol_visibility@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ @@ -386,7 +404,7 @@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libmi.la @XORG_TRUE@sdk_HEADERS = mibank.h micmap.h miline.h mipointer.h mi.h mibstore.h \ @XORG_TRUE@ migc.h mipointrst.h mizerarc.h micoord.h mifillarc.h \ -@XORG_TRUE@ mispans.h miwideline.h mistruct.h mifpoly.h +@XORG_TRUE@ mispans.h miwideline.h mistruct.h mifpoly.h mioverlay.h AM_CFLAGS = $(DIX_CFLAGS) libmi_la_SOURCES = \ @@ -401,6 +419,7 @@ libmi_la_SOURCES = \ micmap.c \ micmap.h \ micoord.h \ + micopy.c \ micursor.c \ midash.c \ midispcur.c \ @@ -437,7 +456,6 @@ libmi_la_SOURCES = \ mispans.h \ misprite.c \ misprite.h \ - mispritest.h \ mistruct.h \ mivaltree.c \ mivalidate.h \ @@ -506,6 +524,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mibitblt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mibstore.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/micmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/micopy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/micursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midispcur.Plo@am__quote@ diff --git a/xorg-server/mi/mi.h b/xorg-server/mi/mi.h index 6e8b89e19..3db8bfcf1 100644 --- a/xorg-server/mi/mi.h +++ b/xorg-server/mi/mi.h @@ -56,6 +56,8 @@ SOFTWARE. #include "input.h" #include "cursor.h" #include "privates.h" +#include "colormap.h" +#include "events.h" #define MiBits CARD32 @@ -65,7 +67,7 @@ typedef struct _miDash *miDashPtr; /* miarc.c */ -extern void miPolyArc( +extern _X_EXPORT void miPolyArc( DrawablePtr /*pDraw*/, GCPtr /*pGC*/, int /*narcs*/, @@ -74,7 +76,7 @@ extern void miPolyArc( /* mibitblt.c */ -extern RegionPtr miCopyArea( +extern _X_EXPORT RegionPtr miCopyArea( DrawablePtr /*pSrcDrawable*/, DrawablePtr /*pDstDrawable*/, GCPtr /*pGC*/, @@ -86,7 +88,7 @@ extern RegionPtr miCopyArea( int /*yOut*/ ); -extern RegionPtr miCopyPlane( +extern _X_EXPORT RegionPtr miCopyPlane( DrawablePtr /*pSrcDrawable*/, DrawablePtr /*pDstDrawable*/, GCPtr /*pGC*/, @@ -99,7 +101,7 @@ extern RegionPtr miCopyPlane( unsigned long /*bitPlane*/ ); -extern void miGetImage( +extern _X_EXPORT void miGetImage( DrawablePtr /*pDraw*/, int /*sx*/, int /*sy*/, @@ -110,7 +112,7 @@ extern void miGetImage( char * /*pdstLine*/ ); -extern void miPutImage( +extern _X_EXPORT void miPutImage( DrawablePtr /*pDraw*/, GCPtr /*pGC*/, int /*depth*/, @@ -123,9 +125,50 @@ extern void miPutImage( char * /*pImage*/ ); +/* 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); + /* micursor.c */ -extern void miRecolorCursor( +extern _X_EXPORT void miRecolorCursor( DeviceIntPtr /* pDev */, ScreenPtr /*pScr*/, CursorPtr /*pCurs*/, @@ -134,7 +177,7 @@ extern void miRecolorCursor( /* midash.c */ -extern void miStepDash( +extern _X_EXPORT void miStepDash( int /*dist*/, int * /*pDashIndex*/, unsigned char * /*pDash*/, @@ -149,39 +192,52 @@ extern void miStepDash( typedef struct _DeviceRec *DevicePtr; #endif -extern Bool mieqInit( +extern _X_EXPORT Bool mieqInit( void ); -extern void mieqResizeEvents( +extern _X_EXPORT void mieqResizeEvents( int /* min_size */ ); -extern void mieqEnqueue( +extern _X_EXPORT void mieqEnqueue( DeviceIntPtr /*pDev*/, - xEventPtr /*e*/ + InternalEvent* /*e*/ ); -extern void mieqSwitchScreen( +extern _X_EXPORT void mieqSwitchScreen( DeviceIntPtr /* pDev */, ScreenPtr /*pScreen*/, Bool /*fromDIX*/ ); -extern void mieqProcessInputEvents( +extern _X_EXPORT void mieqProcessDeviceEvent( + DeviceIntPtr /* dev*/, + InternalEvent* /* event */, + ScreenPtr /* screen*/ +); + +extern _X_EXPORT void mieqProcessInputEvents( void ); -typedef void (*mieqHandler)(int, xEventPtr, DeviceIntPtr, int); -void mieqSetHandler(int event, mieqHandler handler); +extern DeviceIntPtr CopyGetMasterEvent( + DeviceIntPtr /* sdev */, + InternalEvent* /* original */, + InternalEvent* /* copy */ +); -void -CopyGetMasterEvent(DeviceIntPtr mdev, DeviceIntPtr sdev, xEvent* original, - EventListPtr master, int count); +/** + * Custom input event handler. If you need to process input events in some + * other way than the default path, register an input event handler for the + * given internal event type. + */ +typedef void (*mieqHandler)(int screen, InternalEvent* event, DeviceIntPtr dev); +void _X_EXPORT mieqSetHandler(int event, mieqHandler handler); /* miexpose.c */ -extern RegionPtr miHandleExposures( +extern _X_EXPORT RegionPtr miHandleExposures( DrawablePtr /*pSrcDrawable*/, DrawablePtr /*pDstDrawable*/, GCPtr /*pGC*/, @@ -194,7 +250,7 @@ extern RegionPtr miHandleExposures( unsigned long /*plane*/ ); -extern void miSendGraphicsExpose( +extern _X_EXPORT void miSendGraphicsExpose( ClientPtr /*client*/, RegionPtr /*pRgn*/, XID /*drawable*/, @@ -202,33 +258,33 @@ extern void miSendGraphicsExpose( int /*minor*/ ); -extern void miSendExposures( +extern _X_EXPORT void miSendExposures( WindowPtr /*pWin*/, RegionPtr /*pRgn*/, int /*dx*/, int /*dy*/ ); -extern void miWindowExposures( +extern _X_EXPORT void miWindowExposures( WindowPtr /*pWin*/, RegionPtr /*prgn*/, RegionPtr /*other_exposed*/ ); -extern void miPaintWindow( +extern _X_EXPORT void miPaintWindow( WindowPtr /*pWin*/, RegionPtr /*prgn*/, int /*what*/ ); -extern void miClearDrawable( +extern _X_EXPORT void miClearDrawable( DrawablePtr /*pDraw*/, GCPtr /*pGC*/ ); /* mifillrct.c */ -extern void miPolyFillRect( +extern _X_EXPORT void miPolyFillRect( DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*nrectFill*/, @@ -237,7 +293,7 @@ extern void miPolyFillRect( /* miglblt.c */ -extern void miPolyGlyphBlt( +extern _X_EXPORT void miPolyGlyphBlt( DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*x*/, @@ -247,7 +303,7 @@ extern void miPolyGlyphBlt( pointer /*pglyphBase*/ ); -extern void miImageGlyphBlt( +extern _X_EXPORT void miImageGlyphBlt( DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*x*/, @@ -259,7 +315,7 @@ extern void miImageGlyphBlt( /* mipoly.c */ -extern void miFillPolygon( +extern _X_EXPORT void miFillPolygon( DrawablePtr /*dst*/, GCPtr /*pgc*/, int /*shape*/, @@ -270,7 +326,7 @@ extern void miFillPolygon( /* mipolycon.c */ -extern Bool miFillConvexPoly( +extern _X_EXPORT Bool miFillConvexPoly( DrawablePtr /*dst*/, GCPtr /*pgc*/, int /*count*/, @@ -279,7 +335,7 @@ extern Bool miFillConvexPoly( /* mipolygen.c */ -extern Bool miFillGeneralPoly( +extern _X_EXPORT Bool miFillGeneralPoly( DrawablePtr /*dst*/, GCPtr /*pgc*/, int /*count*/, @@ -288,7 +344,7 @@ extern Bool miFillGeneralPoly( /* mipolypnt.c */ -extern void miPolyPoint( +extern _X_EXPORT void miPolyPoint( DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*mode*/, @@ -298,7 +354,7 @@ extern void miPolyPoint( /* mipolyrect.c */ -extern void miPolyRectangle( +extern _X_EXPORT void miPolyRectangle( DrawablePtr /*pDraw*/, GCPtr /*pGC*/, int /*nrects*/, @@ -307,7 +363,7 @@ extern void miPolyRectangle( /* mipolyseg.c */ -extern void miPolySegment( +extern _X_EXPORT void miPolySegment( DrawablePtr /*pDraw*/, GCPtr /*pGC*/, int /*nseg*/, @@ -316,7 +372,7 @@ extern void miPolySegment( /* mipolytext.c */ -extern int miPolyText8( +extern _X_EXPORT int miPolyText8( DrawablePtr /*pDraw*/, GCPtr /*pGC*/, int /*x*/, @@ -325,7 +381,7 @@ extern int miPolyText8( char * /*chars*/ ); -extern int miPolyText16( +extern _X_EXPORT int miPolyText16( DrawablePtr /*pDraw*/, GCPtr /*pGC*/, int /*x*/, @@ -334,7 +390,7 @@ extern int miPolyText16( unsigned short * /*chars*/ ); -extern void miImageText8( +extern _X_EXPORT void miImageText8( DrawablePtr /*pDraw*/, GCPtr /*pGC*/, int /*x*/, @@ -343,7 +399,7 @@ extern void miImageText8( char * /*chars*/ ); -extern void miImageText16( +extern _X_EXPORT void miImageText16( DrawablePtr /*pDraw*/, GCPtr /*pGC*/, int /*x*/, @@ -354,7 +410,7 @@ extern void miImageText16( /* mipushpxl.c */ -extern void miPushPixels( +extern _X_EXPORT void miPushPixels( GCPtr /*pGC*/, PixmapPtr /*pBitMap*/, DrawablePtr /*pDrawable*/, @@ -368,22 +424,22 @@ extern void miPushPixels( /* see also region.h */ -extern Bool miRectAlloc( +extern _X_EXPORT Bool miRectAlloc( RegionPtr /*pRgn*/, int /*n*/ ); #ifdef DEBUG -extern Bool miValidRegion( +extern _X_EXPORT Bool miValidRegion( RegionPtr /*prgn*/ ); #endif -extern Bool miRegionBroken(RegionPtr pReg); +extern _X_EXPORT Bool miRegionBroken(RegionPtr pReg); /* miscrinit.c */ -extern Bool miModifyPixmapHeader( +extern _X_EXPORT Bool miModifyPixmapHeader( PixmapPtr /*pPixmap*/, int /*width*/, int /*height*/, @@ -393,17 +449,17 @@ extern Bool miModifyPixmapHeader( pointer /*pPixData*/ ); -extern Bool miCreateScreenResources( +extern _X_EXPORT Bool miCreateScreenResources( ScreenPtr /*pScreen*/ ); -extern Bool miScreenDevPrivateInit( +extern _X_EXPORT Bool miScreenDevPrivateInit( ScreenPtr /*pScreen*/, int /*width*/, pointer /*pbits*/ ); -extern Bool miScreenInit( +extern _X_EXPORT Bool miScreenInit( ScreenPtr /*pScreen*/, pointer /*pbits*/, int /*xsize*/, @@ -419,13 +475,13 @@ extern Bool miScreenInit( VisualPtr /*visuals*/ ); -extern DevPrivateKey miAllocateGCPrivateIndex( +extern _X_EXPORT DevPrivateKey miAllocateGCPrivateIndex( void ); /* mivaltree.c */ -extern int miShapedWindowIn( +extern _X_EXPORT int miShapedWindowIn( ScreenPtr /*pScreen*/, RegionPtr /*universe*/, RegionPtr /*bounding*/, @@ -440,17 +496,17 @@ typedef void typedef RegionPtr (*GetRedirectBorderClipProcPtr) (WindowPtr pWindow); -void +extern _X_EXPORT void miRegisterRedirectBorderClipProc (SetRedirectBorderClipProcPtr setBorderClip, GetRedirectBorderClipProcPtr getBorderClip); -extern int miValidateTree( +extern _X_EXPORT int miValidateTree( WindowPtr /*pParent*/, WindowPtr /*pChild*/, VTKind /*kind*/ ); -extern void miWideLine( +extern _X_EXPORT void miWideLine( DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*mode*/, @@ -458,7 +514,7 @@ extern void miWideLine( DDXPointPtr /*pPts*/ ); -extern void miWideDash( +extern _X_EXPORT void miWideDash( DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*mode*/, @@ -468,7 +524,7 @@ extern void miWideDash( /* miwindow.c */ -extern void miClearToBackground( +extern _X_EXPORT void miClearToBackground( WindowPtr /*pWin*/, int /*x*/, int /*y*/, @@ -477,21 +533,21 @@ extern void miClearToBackground( Bool /*generateExposures*/ ); -extern void miMarkWindow( +extern _X_EXPORT void miMarkWindow( WindowPtr /*pWin*/ ); -extern Bool miMarkOverlappedWindows( +extern _X_EXPORT Bool miMarkOverlappedWindows( WindowPtr /*pWin*/, WindowPtr /*pFirst*/, WindowPtr * /*ppLayerWin*/ ); -extern void miHandleValidateExposures( +extern _X_EXPORT void miHandleValidateExposures( WindowPtr /*pWin*/ ); -extern void miMoveWindow( +extern _X_EXPORT void miMoveWindow( WindowPtr /*pWin*/, int /*x*/, int /*y*/, @@ -499,7 +555,7 @@ extern void miMoveWindow( VTKind /*kind*/ ); -extern void miSlideAndSizeWindow( +extern _X_EXPORT void miSlideAndSizeWindow( WindowPtr /*pWin*/, int /*x*/, int /*y*/, @@ -508,30 +564,30 @@ extern void miSlideAndSizeWindow( WindowPtr /*pSib*/ ); -extern WindowPtr miGetLayerWindow( +extern _X_EXPORT WindowPtr miGetLayerWindow( WindowPtr /*pWin*/ ); -extern void miSetShape( +extern _X_EXPORT void miSetShape( WindowPtr /*pWin*/ ); -extern void miChangeBorderWidth( +extern _X_EXPORT void miChangeBorderWidth( WindowPtr /*pWin*/, unsigned int /*width*/ ); -extern void miMarkUnrealizedWindow( +extern _X_EXPORT void miMarkUnrealizedWindow( WindowPtr /*pChild*/, WindowPtr /*pWin*/, Bool /*fromConfigure*/ ); -extern void miSegregateChildren(WindowPtr pWin, RegionPtr pReg, int depth); +extern _X_EXPORT void miSegregateChildren(WindowPtr pWin, RegionPtr pReg, int depth); /* mizerarc.c */ -extern void miZeroPolyArc( +extern _X_EXPORT void miZeroPolyArc( DrawablePtr /*pDraw*/, GCPtr /*pGC*/, int /*narcs*/, @@ -540,7 +596,7 @@ extern void miZeroPolyArc( /* mizerline.c */ -extern void miZeroLine( +extern _X_EXPORT void miZeroLine( DrawablePtr /*dst*/, GCPtr /*pgc*/, int /*mode*/, @@ -548,7 +604,7 @@ extern void miZeroLine( DDXPointRec * /*pptInit*/ ); -extern void miZeroDashLine( +extern _X_EXPORT void miZeroDashLine( DrawablePtr /*dst*/, GCPtr /*pgc*/, int /*mode*/, @@ -556,7 +612,7 @@ extern void miZeroDashLine( DDXPointRec * /*pptInit*/ ); -extern void miPolyFillArc( +extern _X_EXPORT void miPolyFillArc( DrawablePtr /*pDraw*/, GCPtr /*pGC*/, int /*narcs*/, diff --git a/xorg-server/mi/miarc.c b/xorg-server/mi/miarc.c index f0c863fd9..a3e258030 100644 --- a/xorg-server/mi/miarc.c +++ b/xorg-server/mi/miarc.c @@ -880,8 +880,7 @@ miComputeWideEllipse( { if (spdata) xfree(spdata); - spdata = (miArcSpanData *)xalloc(sizeof(miArcSpanData) + - sizeof(miArcSpan) * (k + 2)); + spdata = xalloc(sizeof(miArcSpanData) + sizeof(miArcSpan) * (k + 2)); lruent->spdata = spdata; if (!spdata) { @@ -925,7 +924,7 @@ miFillWideEllipse( yorgu = parc->height + pGC->lineWidth; n = (sizeof(int) * 2) * yorgu; - widths = (int *)xalloc(n + (sizeof(DDXPointRec) * 2) * yorgu); + widths = xalloc(n + (sizeof(DDXPointRec) * 2) * yorgu); if (!widths) return; points = (DDXPointPtr)((char *)widths + n); @@ -1041,7 +1040,7 @@ miFillWideEllipse( * fuller explanation of this.) */ -_X_EXPORT void +void miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs) { int i; @@ -1361,7 +1360,7 @@ miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft, arc.height = width; arc.angle1 = -miDatan2 (corner.y - center.y, corner.x - center.x); arc.angle2 = a; - pArcPts = (SppPointPtr) xalloc (3 * sizeof (SppPointRec)); + pArcPts = xalloc (3 * sizeof (SppPointRec)); if (!pArcPts) return; pArcPts[0].x = otherCorner.x; @@ -1783,7 +1782,7 @@ addArc ( arc = (miArcDataPtr) xrealloc (*arcsp, newsize * sizeof (**arcsp)); if (!arc) - return (miArcDataPtr)NULL; + return NULL; *sizep = newsize; *arcsp = arc; } @@ -1885,7 +1884,7 @@ miComputeArcs ( int arcsJoin; int selfJoin; - int iDash = 0, dashRemaining; + int iDash = 0, dashRemaining = 0; int iDashStart = 0, dashRemainingStart = 0, iphaseStart; int startAngle, spanAngle, endAngle, backwards = 0; int prevDashAngle, dashAngle; @@ -1895,14 +1894,14 @@ miComputeArcs ( isDoubleDash = (pGC->lineStyle == LineDoubleDash); dashOffset = pGC->dashOffset; - data = (struct arcData *) xalloc (narcs * sizeof (struct arcData)); + data = xalloc (narcs * sizeof (struct arcData)); if (!data) - return (miPolyArcPtr)NULL; - arcs = (miPolyArcPtr) xalloc (sizeof (*arcs) * (isDoubleDash ? 2 : 1)); + return NULL; + arcs = xalloc (sizeof (*arcs) * (isDoubleDash ? 2 : 1)); if (!arcs) { xfree(data); - return (miPolyArcPtr)NULL; + return NULL; } for (i = 0; i < narcs; i++) { a0 = todeg (parcs[i].angle1); @@ -2255,7 +2254,7 @@ miComputeArcs ( arcfail: miFreeArcs(arcs, pGC); xfree(data); - return (miPolyArcPtr)NULL; + return NULL; } static double @@ -3111,7 +3110,7 @@ realAllocSpan (void) struct finalSpan *span; int i; - newChunk = (struct finalSpanChunk *) xalloc (sizeof (struct finalSpanChunk)); + newChunk = xalloc (sizeof (struct finalSpanChunk)); if (!newChunk) return (struct finalSpan *) NULL; newChunk->next = chunks; @@ -3158,8 +3157,8 @@ fillSpans ( if (nspans == 0) return; - xSpan = xSpans = (DDXPointPtr) xalloc (nspans * sizeof (DDXPointRec)); - xWidth = xWidths = (int *) xalloc (nspans * sizeof (int)); + xSpan = xSpans = xalloc (nspans * sizeof (DDXPointRec)); + xWidth = xWidths = xalloc (nspans * sizeof (int)); if (xSpans && xWidths) { i = 0; @@ -3216,10 +3215,9 @@ realFindSpan (int y) else change = SPAN_REALLOC; newSize = finalSize + change; - newSpans = (struct finalSpan **) xalloc - (newSize * sizeof (struct finalSpan *)); + newSpans = xalloc(newSize * sizeof (struct finalSpan *)); if (!newSpans) - return (struct finalSpan **)NULL; + return NULL; newMiny = finalMiny; newMaxy = finalMaxy; if (y < finalMiny) diff --git a/xorg-server/mi/mibank.c b/xorg-server/mi/mibank.c index dcaf4a14f..9e4d63162 100644 --- a/xorg-server/mi/mibank.c +++ b/xorg-server/mi/mibank.c @@ -171,8 +171,7 @@ typedef struct _miBankQueue (*pScreenPriv->BankInfo.SetDestinationBank)(pScreen, (_no)) - \ (pScreenPriv->BankInfo.BankSize * (_no))) -#define xalloc_ARRAY(atype, ntype) \ - (atype *)xalloc((ntype) * sizeof(atype)) +#define xalloc_ARRAY(atype, ntype) xalloc((ntype) * sizeof(atype)) static int miBankScreenKeyIndex; static DevPrivateKey miBankScreenKey = &miBankScreenKeyIndex; @@ -955,7 +954,7 @@ miBankCopy( paddedWidth = PixmapBytePad(maxWidth, pScreenPriv->pScreenPixmap->drawable.depth); - pImage = (char *)xalloc(paddedWidth * maxHeight); + pImage = xalloc(paddedWidth * maxHeight); pGC->fExpose = FALSE; @@ -1750,7 +1749,7 @@ miBankGetImage( paddedWidth = PixmapBytePad(w, pScreenPriv->pScreenPixmap->drawable.depth); - pBankImage = (char *)xalloc(paddedWidth * h); + pBankImage = xalloc(paddedWidth * h); if (pBankImage) { @@ -1811,7 +1810,7 @@ miBankGetSpans( paddedWidth = PixmapBytePad(pScreenPriv->pScreenPixmap->drawable.width, pScreenPriv->pScreenPixmap->drawable.depth); - pBankImage = (char *)xalloc(paddedWidth); + pBankImage = xalloc(paddedWidth); if (pBankImage) { @@ -1985,7 +1984,7 @@ miBankCopyWindow( xfree(pBoxNew1); } -_X_EXPORT Bool +Bool miInitializeBanking( ScreenPtr pScreen, unsigned int xsize, diff --git a/xorg-server/mi/mibank.h b/xorg-server/mi/mibank.h index 327507db9..0c10540a7 100644 --- a/xorg-server/mi/mibank.h +++ b/xorg-server/mi/mibank.h @@ -85,7 +85,7 @@ typedef struct _miBankInfo unsigned int nBankDepth; } miBankInfoRec, *miBankInfoPtr; -Bool +extern _X_EXPORT Bool miInitializeBanking( ScreenPtr /*pScreen*/, unsigned int /*xsize*/, @@ -99,7 +99,7 @@ miInitializeBanking( * and various screen attributes. DDX needs to determine this width before * initializing the screen. */ -int +extern _X_EXPORT int miScanLineWidth( unsigned int /*xsize*/, unsigned int /*ysize*/, diff --git a/xorg-server/mi/mibitblt.c b/xorg-server/mi/mibitblt.c index 3e82a5592..cc8b11d9c 100644 --- a/xorg-server/mi/mibitblt.c +++ b/xorg-server/mi/mibitblt.c @@ -104,7 +104,7 @@ miCopyArea(DrawablePtr pSrcDrawable, /* If the destination isn't realized, this is easy */ if (pDstDrawable->type == DRAWABLE_WINDOW && !((WindowPtr)pDstDrawable)->realized) - return (RegionPtr)NULL; + return NULL; /* clip the source */ if (pSrcDrawable->type == DRAWABLE_PIXMAP) @@ -143,14 +143,11 @@ miCopyArea(DrawablePtr pSrcDrawable, dsty += pDstDrawable->y; } - pptFirst = ppt = (DDXPointPtr) - xalloc(heightSrc * sizeof(DDXPointRec)); - pwidthFirst = pwidth = (unsigned int *) - xalloc(heightSrc * sizeof(unsigned int)); + pptFirst = ppt = xalloc(heightSrc * sizeof(DDXPointRec)); + pwidthFirst = pwidth = xalloc(heightSrc * sizeof(unsigned int)); numRects = REGION_NUM_RECTS(prgnSrcClip); boxes = REGION_RECTS(prgnSrcClip); - ordering = (unsigned int *) - xalloc(numRects * sizeof(unsigned int)); + ordering = xalloc(numRects * sizeof(unsigned int)); if(!pptFirst || !pwidthFirst || !ordering) { if (ordering) @@ -159,7 +156,7 @@ miCopyArea(DrawablePtr pSrcDrawable, xfree(pwidthFirst); if (pptFirst) xfree(pptFirst); - return (RegionPtr)NULL; + return NULL; } /* If not the same drawable then order of move doesn't matter. @@ -238,8 +235,7 @@ miCopyArea(DrawablePtr pSrcDrawable, ppt++->y = y++; *pwidth++ = width; } - pbits = (unsigned int *)xalloc(height * PixmapBytePad(width, - pSrcDrawable->depth)); + pbits = xalloc(height * PixmapBytePad(width, pSrcDrawable->depth)); if (pbits) { (*pSrcDrawable->pScreen->GetSpans)(pSrcDrawable, width, pptFirst, @@ -319,7 +315,7 @@ miGetPlane( if(!result) result = xcalloc(h, widthInBytes); if (!result) - return (MiBits *)NULL; + return NULL; bitsPerPixel = pDraw->bitsPerPixel; pOut = (OUT_TYPE *) result; if(bitsPerPixel == 1) @@ -433,8 +429,8 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc, dixChangeGC(NullClient, pGCT, GCBackground, NULL, gcv); ValidateGC((DrawablePtr)pPixmap, pGCT); miClearDrawable((DrawablePtr)pPixmap, pGCT); - ppt = pptFirst = (DDXPointPtr)xalloc(h * sizeof(DDXPointRec)); - pwidth = pwidthFirst = (int *)xalloc(h * sizeof(int)); + ppt = pptFirst = xalloc(h * sizeof(DDXPointRec)); + pwidth = pwidthFirst = xalloc(h * sizeof(int)); if(!pptFirst || !pwidthFirst) { if (pwidthFirst) xfree(pwidthFirst); @@ -643,7 +639,7 @@ miCopyPlane( DrawablePtr pSrcDrawable, * XY format: * get the single plane specified in planemask */ -_X_EXPORT void +void miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h, unsigned int format, unsigned long planeMask, char *pDst) { @@ -651,7 +647,7 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h, int i, linelength, width, srcx, srcy; DDXPointRec pt = {0, 0}; XID gcv[2]; - PixmapPtr pPixmap = (PixmapPtr)NULL; + PixmapPtr pPixmap = NULL; GCPtr pGC = NULL; depth = pDraw->depth; @@ -741,7 +737,7 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h, * ZPixmap format: * This part is simple, just call SetSpans */ -_X_EXPORT void +void miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *pImage) @@ -802,8 +798,8 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth, break; case ZPixmap: - ppt = pptFirst = (DDXPointPtr)xalloc(h * sizeof(DDXPointRec)); - pwidth = pwidthFirst = (int *)xalloc(h * sizeof(int)); + ppt = pptFirst = xalloc(h * sizeof(DDXPointRec)); + pwidth = pwidthFirst = xalloc(h * sizeof(int)); if(!pptFirst || !pwidthFirst) { if (pwidthFirst) diff --git a/xorg-server/mi/mibstore.c b/xorg-server/mi/mibstore.c index 294b2caee..262b4944d 100644 --- a/xorg-server/mi/mibstore.c +++ b/xorg-server/mi/mibstore.c @@ -2,22 +2,23 @@ * Copyright 2007 Red Hat, Inc. * * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, and/or sell copies of the Software, and to permit persons to whom - * them Software is furnished to do so, subject to the following conditions: + * 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 (including the next * paragraph) 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 MERCHANTIBILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS 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. + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS 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. */ #ifdef HAVE_DIX_CONFIG_H @@ -36,7 +37,7 @@ * for the implementation. */ -_X_EXPORT void +void miInitializeBackingStore (ScreenPtr pScreen) { pScreen->SaveDoomedAreas = NULL; diff --git a/xorg-server/mi/mibstore.h b/xorg-server/mi/mibstore.h index baa59202b..ef7e18790 100644 --- a/xorg-server/mi/mibstore.h +++ b/xorg-server/mi/mibstore.h @@ -18,7 +18,7 @@ #include "screenint.h" -extern void miInitializeBackingStore( +extern _X_EXPORT void miInitializeBackingStore( ScreenPtr /*pScreen*/ ); diff --git a/xorg-server/mi/micmap.c b/xorg-server/mi/micmap.c index b92ddece5..1d26a5232 100644 --- a/xorg-server/mi/micmap.c +++ b/xorg-server/mi/micmap.c @@ -46,9 +46,9 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "globals.h" #include "micmap.h" -_X_EXPORT ColormapPtr miInstalledMaps[MAXSCREENS]; +ColormapPtr miInstalledMaps[MAXSCREENS]; -_X_EXPORT int +int miListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps) { if (miInstalledMaps[pScreen->myNum]) { @@ -58,7 +58,7 @@ miListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps) return 0; } -_X_EXPORT void +void miInstallColormap(ColormapPtr pmap) { int index = pmap->pScreen->myNum; @@ -77,7 +77,7 @@ miInstallColormap(ColormapPtr pmap) } } -_X_EXPORT void +void miUninstallColormap(ColormapPtr pmap) { int index = pmap->pScreen->myNum; @@ -87,14 +87,16 @@ miUninstallColormap(ColormapPtr pmap) { if (pmap->mid != pmap->pScreen->defColormap) { - curpmap = (ColormapPtr) LookupIDByType(pmap->pScreen->defColormap, - RT_COLORMAP); + dixLookupResourceByType((pointer *)&curpmap, + pmap->pScreen->defColormap, + RT_COLORMAP, serverClient, + DixUseAccess); (*pmap->pScreen->InstallColormap)(curpmap); } } } -_X_EXPORT void +void miResolveColor(unsigned short *pred, unsigned short *pgreen, unsigned short *pblue, VisualPtr pVisual) { @@ -116,7 +118,7 @@ miResolveColor(unsigned short *pred, unsigned short *pgreen, } } -_X_EXPORT Bool +Bool miInitializeColormap(ColormapPtr pmap) { unsigned i; @@ -201,7 +203,7 @@ miInitializeColormap(ColormapPtr pmap) outdefs[i].blue = pmap->blue[blue >> pVisual->offsetBlue].co.local.blue; \ } -_X_EXPORT int +int miExpandDirectColors(ColormapPtr pmap, int ndef, xColorItem *indefs, xColorItem *outdefs) { @@ -261,7 +263,7 @@ miExpandDirectColors(ColormapPtr pmap, int ndef, xColorItem *indefs, return nresult; } -_X_EXPORT Bool +Bool miCreateDefColormap(ScreenPtr pScreen) { /* @@ -378,7 +380,7 @@ static int miVisualPriority[] = { static miVisualsPtr miVisuals; -_X_EXPORT void +void miClearVisualTypes(void) { miVisualsPtr v; @@ -390,7 +392,7 @@ miClearVisualTypes(void) } -_X_EXPORT Bool +Bool miSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB, int preferredCVC, Pixel redMask, Pixel greenMask, Pixel blueMask) @@ -398,7 +400,7 @@ miSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB, miVisualsPtr new, *prev, v; int count; - new = (miVisualsPtr) xalloc (sizeof *new); + new = xalloc (sizeof *new); if (!new) return FALSE; if (!redMask || !greenMask || !blueMask) @@ -424,14 +426,14 @@ miSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB, return TRUE; } -_X_EXPORT Bool +Bool miSetVisualTypes(int depth, int visuals, int bitsPerRGB, int preferredCVC) { return miSetVisualTypesAndMasks (depth, visuals, bitsPerRGB, preferredCVC, 0, 0, 0); } -_X_EXPORT int +int miGetDefaultVisualMask(int depth) { if (depth > MAX_PSEUDO_DEPTH) @@ -455,7 +457,7 @@ miVisualTypesSet (int depth) return FALSE; } -_X_EXPORT Bool +Bool miSetPixmapDepths (void) { int d, f; @@ -497,7 +499,7 @@ maskShift (Pixel p) * the set which can be used with this version of cfb. */ -_X_EXPORT Bool +Bool miInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp, int *ndepthp, int *rootDepthp, VisualID *defaultVisp, unsigned long sizes, int bitsPerRGB, int preferredVis) @@ -539,9 +541,9 @@ miInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp, ndepth++; nvisual += visuals->count; } - depth = (DepthPtr) xalloc (ndepth * sizeof (DepthRec)); - visual = (VisualPtr) xalloc (nvisual * sizeof (VisualRec)); - preferredCVCs = (int *)xalloc(ndepth * sizeof(int)); + depth = xalloc (ndepth * sizeof (DepthRec)); + visual = xalloc (nvisual * sizeof (VisualRec)); + preferredCVCs = xalloc(ndepth * sizeof(int)); if (!depth || !visual || !preferredCVCs) { xfree (depth); @@ -565,7 +567,7 @@ miInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp, vid = NULL; if (nvtype) { - vid = (VisualID *) xalloc (nvtype * sizeof (VisualID)); + vid = xalloc (nvtype * sizeof (VisualID)); if (!vid) { xfree(preferredCVCs); return FALSE; diff --git a/xorg-server/mi/micmap.h b/xorg-server/mi/micmap.h index 667004b49..5c8448a95 100644 --- a/xorg-server/mi/micmap.h +++ b/xorg-server/mi/micmap.h @@ -4,29 +4,29 @@ #ifndef _MICMAP_H_ #define _MICMAP_H_ -extern ColormapPtr miInstalledMaps[MAXSCREENS]; +extern _X_EXPORT ColormapPtr miInstalledMaps[MAXSCREENS]; typedef Bool (* miInitVisualsProcPtr)(VisualPtr *, DepthPtr *, int *, int *, int *, VisualID *, unsigned long, int, int); -int miListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps); -void miInstallColormap(ColormapPtr pmap); -void miUninstallColormap(ColormapPtr pmap); +extern _X_EXPORT int miListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps); +extern _X_EXPORT void miInstallColormap(ColormapPtr pmap); +extern _X_EXPORT void miUninstallColormap(ColormapPtr pmap); -void miResolveColor(unsigned short *, unsigned short *, unsigned short *, +extern _X_EXPORT void miResolveColor(unsigned short *, unsigned short *, unsigned short *, VisualPtr); -Bool miInitializeColormap(ColormapPtr); -int miExpandDirectColors(ColormapPtr, int, xColorItem *, xColorItem *); -Bool miCreateDefColormap(ScreenPtr); -void miClearVisualTypes(void); -Bool miSetVisualTypes(int, int, int, int); -Bool miSetPixmapDepths(void); -Bool miSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB, +extern _X_EXPORT Bool miInitializeColormap(ColormapPtr); +extern _X_EXPORT int miExpandDirectColors(ColormapPtr, int, xColorItem *, xColorItem *); +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); -int miGetDefaultVisualMask(int); -Bool miInitVisuals(VisualPtr *, DepthPtr *, int *, int *, int *, VisualID *, +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 diff --git a/xorg-server/mi/micopy.c b/xorg-server/mi/micopy.c new file mode 100644 index 000000000..3719f4646 --- /dev/null +++ b/xorg-server/mi/micopy.c @@ -0,0 +1,354 @@ +/* + * Copyright © 1998 Keith Packard + * + * 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, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include "mi.h" +#include "scrnintstr.h" +#include "gcstruct.h" +#include "pixmap.h" +#include "pixmapstr.h" +#include "windowstr.h" + +void +miCopyRegion (DrawablePtr pSrcDrawable, + DrawablePtr pDstDrawable, + GCPtr pGC, + RegionPtr pDstRegion, + int dx, + int dy, + miCopyProc copyProc, + Pixel bitPlane, + void *closure) +{ + int careful; + Bool reverse; + Bool upsidedown; + BoxPtr pbox; + int nbox; + BoxPtr pboxNew1, pboxNew2, pboxBase, pboxNext, pboxTmp; + + pbox = REGION_RECTS(pDstRegion); + nbox = REGION_NUM_RECTS(pDstRegion); + + /* XXX we have to err on the side of safety when both are windows, + * because we don't know if IncludeInferiors is being used. + */ + careful = ((pSrcDrawable == pDstDrawable) || + ((pSrcDrawable->type == DRAWABLE_WINDOW) && + (pDstDrawable->type == DRAWABLE_WINDOW))); + + pboxNew1 = NULL; + pboxNew2 = NULL; + if (careful && dy < 0) + { + upsidedown = TRUE; + + if (nbox > 1) + { + /* keep ordering in each band, reverse order of bands */ + pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); + if(!pboxNew1) + return; + pboxBase = pboxNext = pbox+nbox-1; + while (pboxBase >= pbox) + { + while ((pboxNext >= pbox) && + (pboxBase->y1 == pboxNext->y1)) + pboxNext--; + pboxTmp = pboxNext+1; + while (pboxTmp <= pboxBase) + { + *pboxNew1++ = *pboxTmp++; + } + pboxBase = pboxNext; + } + pboxNew1 -= nbox; + pbox = pboxNew1; + } + } + else + { + /* walk source top to bottom */ + upsidedown = FALSE; + } + + if (careful && dx < 0) + { + /* walk source right to left */ + if (dy <= 0) + reverse = TRUE; + else + reverse = FALSE; + + if (nbox > 1) + { + /* reverse order of rects in each band */ + pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); + if(!pboxNew2) + { + if (pboxNew1) + xfree(pboxNew1); + return; + } + pboxBase = pboxNext = pbox; + while (pboxBase < pbox+nbox) + { + while ((pboxNext < pbox+nbox) && + (pboxNext->y1 == pboxBase->y1)) + pboxNext++; + pboxTmp = pboxNext; + while (pboxTmp != pboxBase) + { + *pboxNew2++ = *--pboxTmp; + } + pboxBase = pboxNext; + } + pboxNew2 -= nbox; + pbox = pboxNew2; + } + } + else + { + /* walk source left to right */ + reverse = FALSE; + } + + (*copyProc) (pSrcDrawable, + pDstDrawable, + pGC, + pbox, + nbox, + dx, dy, + reverse, upsidedown, bitPlane, closure); + + if (pboxNew1) + xfree (pboxNew1); + if (pboxNew2) + xfree (pboxNew2); +} + +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) +{ + RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */ + Bool freeSrcClip = FALSE; + RegionPtr prgnExposed = NULL; + RegionRec rgnDst; + int dx; + int dy; + int numRects; + int box_x1; + int box_y1; + int box_x2; + int box_y2; + Bool fastSrc = FALSE; /* for fast clipping with pixmap source */ + Bool fastDst = FALSE; /* for fast clipping with one rect dest */ + Bool fastExpose = FALSE; /* for fast exposures with pixmap source */ + + /* Short cut for unmapped windows */ + + if (pDstDrawable->type == DRAWABLE_WINDOW && + !((WindowPtr)pDstDrawable)->realized) + { + return NULL; + } + + if ((pSrcDrawable != pDstDrawable) && + pSrcDrawable->pScreen->SourceValidate) + { + (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, xIn, yIn, widthSrc, heightSrc); + } + + /* Compute source clip region */ + if (pSrcDrawable->type == DRAWABLE_PIXMAP) + { + if ((pSrcDrawable == pDstDrawable) && (pGC->clientClipType == CT_NONE)) + prgnSrcClip = miGetCompositeClip(pGC); + else + fastSrc = TRUE; + } + else + { + if (pGC->subWindowMode == IncludeInferiors) + { + /* + * XFree86 DDX empties the border clip when the + * VT is inactive, make sure the region isn't empty + */ + if (!((WindowPtr) pSrcDrawable)->parent && + REGION_NOTEMPTY (pSrcDrawable->pScreen, + &((WindowPtr) pSrcDrawable)->borderClip)) + { + /* + * special case bitblt from root window in + * IncludeInferiors mode; just like from a pixmap + */ + fastSrc = TRUE; + } + else if ((pSrcDrawable == pDstDrawable) && + (pGC->clientClipType == CT_NONE)) + { + prgnSrcClip = miGetCompositeClip(pGC); + } + else + { + prgnSrcClip = NotClippedByChildren((WindowPtr)pSrcDrawable); + freeSrcClip = TRUE; + } + } + else + { + prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList; + } + } + + xIn += pSrcDrawable->x; + yIn += pSrcDrawable->y; + + xOut += pDstDrawable->x; + yOut += pDstDrawable->y; + + box_x1 = xIn; + box_y1 = yIn; + box_x2 = xIn + widthSrc; + box_y2 = yIn + heightSrc; + + dx = xIn - xOut; + dy = yIn - yOut; + + /* Don't create a source region if we are doing a fast clip */ + if (fastSrc) + { + RegionPtr cclip; + + fastExpose = TRUE; + /* + * clip the source; if regions extend beyond the source size, + * make sure exposure events get sent + */ + if (box_x1 < pSrcDrawable->x) + { + box_x1 = pSrcDrawable->x; + fastExpose = FALSE; + } + if (box_y1 < pSrcDrawable->y) + { + box_y1 = pSrcDrawable->y; + fastExpose = FALSE; + } + if (box_x2 > pSrcDrawable->x + (int) pSrcDrawable->width) + { + box_x2 = pSrcDrawable->x + (int) pSrcDrawable->width; + fastExpose = FALSE; + } + if (box_y2 > pSrcDrawable->y + (int) pSrcDrawable->height) + { + box_y2 = pSrcDrawable->y + (int) pSrcDrawable->height; + fastExpose = FALSE; + } + + /* Translate and clip the dst to the destination composite clip */ + box_x1 -= dx; + box_x2 -= dx; + box_y1 -= dy; + box_y2 -= dy; + + /* If the destination composite clip is one rectangle we can + do the clip directly. Otherwise we have to create a full + blown region and call intersect */ + + cclip = miGetCompositeClip(pGC); + if (REGION_NUM_RECTS(cclip) == 1) + { + BoxPtr pBox = REGION_RECTS(cclip); + + if (box_x1 < pBox->x1) box_x1 = pBox->x1; + if (box_x2 > pBox->x2) box_x2 = pBox->x2; + if (box_y1 < pBox->y1) box_y1 = pBox->y1; + if (box_y2 > pBox->y2) box_y2 = pBox->y2; + fastDst = TRUE; + } + } + + /* Check to see if the region is empty */ + if (box_x1 >= box_x2 || box_y1 >= box_y2) + { + REGION_NULL(pGC->pScreen, &rgnDst); + } + else + { + BoxRec box; + box.x1 = box_x1; + box.y1 = box_y1; + box.x2 = box_x2; + box.y2 = box_y2; + REGION_INIT(pGC->pScreen, &rgnDst, &box, 1); + } + + /* Clip against complex source if needed */ + if (!fastSrc) + { + REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip); + REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy); + } + + /* Clip against complex dest if needed */ + if (!fastDst) + { + REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, + miGetCompositeClip(pGC)); + } + + /* Do bit blitting */ + numRects = REGION_NUM_RECTS(&rgnDst); + if (numRects && widthSrc && heightSrc) + miCopyRegion (pSrcDrawable, pDstDrawable, pGC, + &rgnDst, dx, dy, copyProc, bitPlane, closure); + + /* Pixmap sources generate a NoExposed (we return NULL to do this) */ + if (!fastExpose && pGC->fExpose) + prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, + xIn - pSrcDrawable->x, + yIn - pSrcDrawable->y, + widthSrc, heightSrc, + xOut - pDstDrawable->x, + yOut - pDstDrawable->y, + (unsigned long) bitPlane); + REGION_UNINIT(pGC->pScreen, &rgnDst); + if (freeSrcClip) + REGION_DESTROY(pGC->pScreen, prgnSrcClip); + return prgnExposed; +} diff --git a/xorg-server/mi/midispcur.c b/xorg-server/mi/midispcur.c index 05352fc89..3fb7e02b5 100644 --- a/xorg-server/mi/midispcur.c +++ b/xorg-server/mi/midispcur.c @@ -34,7 +34,6 @@ in this Software without prior written authorization from The Open Group. #include <dix-config.h> #endif -#define NEED_EVENTS # include <X11/X.h> # include "misc.h" # include "input.h" @@ -52,7 +51,7 @@ in this Software without prior written authorization from The Open Group. # include "picturestr.h" #endif -# include "inputstr.h" /* for MAX_DEVICES */ +# include "inputstr.h" /* per-screen private data */ static int miDCScreenKeyIndex; @@ -136,12 +135,12 @@ static miSpriteCursorFuncRec miDCFuncs = { miDCDeviceCleanup }; -_X_EXPORT Bool +Bool miDCInitialize (ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs) { miDCScreenPtr pScreenPriv; - pScreenPriv = (miDCScreenPtr) xalloc (sizeof (miDCScreenRec)); + pScreenPriv = xalloc (sizeof (miDCScreenRec)); if (!pScreenPriv) return FALSE; @@ -230,9 +229,9 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor) GCPtr pGC; XID gcvals[3]; - pPriv = (miDCCursorPtr) xalloc (sizeof (miDCCursorRec)); + pPriv = xalloc (sizeof (miDCCursorRec)); if (!pPriv) - return (miDCCursorPtr)NULL; + return NULL; #ifdef ARGB_CURSOR if (pCursor->bits->argb) { @@ -244,7 +243,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor) if (!pFormat) { xfree ((pointer) pPriv); - return (miDCCursorPtr)NULL; + return NULL; } pPriv->sourceBits = 0; @@ -255,14 +254,14 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor) if (!pPixmap) { xfree ((pointer) pPriv); - return (miDCCursorPtr)NULL; + return NULL; } pGC = GetScratchGC (32, pScreen); if (!pGC) { (*pScreen->DestroyPixmap) (pPixmap); xfree ((pointer) pPriv); - return (miDCCursorPtr)NULL; + return NULL; } ValidateGC (&pPixmap->drawable, pGC); (*pGC->ops->PutImage) (&pPixmap->drawable, pGC, 32, @@ -276,7 +275,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor) if (!pPriv->pPicture) { xfree ((pointer) pPriv); - return (miDCCursorPtr)NULL; + return NULL; } dixSetPrivate(&pCursor->bits->devPrivates, CursorScreenKey(pScreen), pPriv); return pPriv; @@ -287,14 +286,14 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor) if (!pPriv->sourceBits) { xfree ((pointer) pPriv); - return (miDCCursorPtr)NULL; + return NULL; } pPriv->maskBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1, 0); if (!pPriv->maskBits) { (*pScreen->DestroyPixmap) (pPriv->sourceBits); xfree ((pointer) pPriv); - return (miDCCursorPtr)NULL; + return NULL; } dixSetPrivate(&pCursor->bits->devPrivates, CursorScreenKey(pScreen), pPriv); @@ -304,7 +303,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor) if (!pGC) { (void) miDCUnrealizeCursor (pScreen, pCursor); - return (miDCCursorPtr)NULL; + return NULL; } ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC); diff --git a/xorg-server/mi/mieq.c b/xorg-server/mi/mieq.c index 213ad5b40..1b81e4d99 100644 --- a/xorg-server/mi/mieq.c +++ b/xorg-server/mi/mieq.c @@ -36,7 +36,6 @@ in this Software without prior written authorization from The Open Group. #include <dix-config.h> #endif -# define NEED_EVENTS # include <X11/X.h> # include <X11/Xmd.h> # include <X11/Xproto.h> @@ -52,11 +51,11 @@ in this Software without prior written authorization from The Open Group. # include <X11/extensions/geproto.h> # include "extinit.h" # include "exglobals.h" +# include "eventstr.h" #ifdef DPMSExtension # include "dpmsproc.h" -# define DPMS_SERVER -# include <X11/extensions/dpms.h> +# include <X11/extensions/dpmsconst.h> #endif #define QUEUE_SIZE 512 @@ -66,7 +65,6 @@ in this Software without prior written authorization from The Open Group. typedef struct _Event { EventListPtr events; - int nevents; ScreenPtr pScreen; DeviceIntPtr pDev; /* device this event _originated_ from */ } EventRec, *EventPtr; @@ -80,7 +78,6 @@ typedef struct _EventQueue { } EventQueueRec, *EventQueuePtr; static EventQueueRec miEventQueue; -static EventListPtr masterEvents; /* for use in mieqProcessInputEvents */ #ifdef XQUARTZ #include <pthread.h> @@ -113,22 +110,12 @@ mieqInit(void) miEventQueue.handlers[i] = NULL; for (i = 0; i < QUEUE_SIZE; i++) { - EventListPtr evlist = InitEventList(1 + MAX_VALUATOR_EVENTS); + EventListPtr evlist = InitEventList(1); if (!evlist) FatalError("Could not allocate event queue.\n"); miEventQueue.events[i].events = evlist; } - /* XXX: mE is just 1 event long, if we have Motion + Valuator they are - * squashed into the first event to make passing it into the event - * processing handlers easier. This should be fixed when the processing - * handlers switch to EventListPtr instead of xEvent */ - masterEvents = InitEventList(1); - if (!masterEvents) - FatalError("Could not allocated MD event queue.\n"); - SetMinimumEventSize(masterEvents, 1, - (1 + MAX_VALUATOR_EVENTS) * sizeof(xEvent)); - SetInputCheck(&miEventQueue.head, &miEventQueue.tail); return TRUE; } @@ -140,7 +127,7 @@ mieqResizeEvents(int min_size) int i; for (i = 0; i < QUEUE_SIZE; i++) - SetMinimumEventSize(miEventQueue.events[i].events, 7, min_size); + SetMinimumEventSize(miEventQueue.events[i].events, 1, min_size); } /* @@ -151,92 +138,50 @@ mieqResizeEvents(int min_size) */ void -mieqEnqueue(DeviceIntPtr pDev, xEvent *e) +mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e) { unsigned int oldtail = miEventQueue.tail; EventListPtr evt; int isMotion = 0; int evlen; + Time time; #ifdef XQUARTZ wait_for_server_init(); pthread_mutex_lock(&miEventQueueMutex); #endif + CHECKEVENT(e); + /* avoid merging events from different devices */ - if (e->u.u.type == MotionNotify) + if (e->any.type == ET_Motion) isMotion = pDev->id; - else if (e->u.u.type == DeviceMotionNotify) - isMotion = pDev->id | (1 << 8); /* flag to indicate DeviceMotion */ - - /* We silently steal valuator events: just tack them on to the last - * motion event they need to be attached to. Sigh. */ - if (e->u.u.type == DeviceValuator) { - deviceValuator *v = (deviceValuator *) e; - EventPtr laste; - deviceKeyButtonPointer *lastkbp; - - laste = &miEventQueue.events[(oldtail - 1) % QUEUE_SIZE]; - lastkbp = (deviceKeyButtonPointer *) laste->events->event; - - if (laste->nevents > 6) { -#ifdef XQUARTZ - pthread_mutex_unlock(&miEventQueueMutex); -#endif - - ErrorF("[mi] mieqEnqueue: more than six valuator events; dropping.\n"); - return; - } - if (oldtail == miEventQueue.head || - !(lastkbp->type == DeviceMotionNotify || - lastkbp->type == DeviceButtonPress || - lastkbp->type == DeviceButtonRelease || - lastkbp->type == ProximityIn || - lastkbp->type == ProximityOut) || - ((lastkbp->deviceid & DEVICE_BITS) != - (v->deviceid & DEVICE_BITS))) { -#ifdef XQUARTZ - pthread_mutex_unlock(&miEventQueueMutex); -#endif - ErrorF("[mi] mieqEnequeue: out-of-order valuator event; dropping.\n"); - return; - } - - memcpy((laste->events[laste->nevents++].event), e, sizeof(xEvent)); -#ifdef XQUARTZ - pthread_mutex_unlock(&miEventQueueMutex); -#endif - return; - } if (isMotion && isMotion == miEventQueue.lastMotion && oldtail != miEventQueue.head) { - oldtail = (oldtail - 1) % QUEUE_SIZE; + oldtail = (oldtail - 1) % QUEUE_SIZE; } else { - static int stuck = 0; - /* Toss events which come in late. Usually this means your server's + static int stuck = 0; + /* Toss events which come in late. Usually this means your server's * stuck in an infinite loop somewhere, but SIGIO is still getting * handled. */ - if (((oldtail + 1) % QUEUE_SIZE) == miEventQueue.head) { - ErrorF("[mi] EQ overflowing. The server is probably stuck " - "in an infinite loop.\n"); - if (!stuck) { - xorg_backtrace(); - stuck = 1; - } + if (((oldtail + 1) % QUEUE_SIZE) == miEventQueue.head) { + if (!stuck) { + ErrorF("[mi] EQ overflowing. The server is probably stuck " + "in an infinite loop.\n"); + xorg_backtrace(); + stuck = 1; + } #ifdef XQUARTZ - pthread_mutex_unlock(&miEventQueueMutex); + pthread_mutex_unlock(&miEventQueueMutex); #endif - return; + return; } - stuck = 0; + stuck = 0; } - evlen = sizeof(xEvent); - if (e->u.u.type == GenericEvent) - evlen += ((xGenericEvent*)e)->length * 4; - + evlen = e->any.length; evt = miEventQueue.events[oldtail].events; if (evt->evlen < evlen) { @@ -253,17 +198,16 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e) } memcpy(evt->event, e, evlen); - miEventQueue.events[oldtail].nevents = 1; + time = e->any.time; /* Make sure that event times don't go backwards - this * is "unnecessary", but very useful. */ - if (e->u.u.type != GenericEvent && - e->u.keyButtonPointer.time < miEventQueue.lastEventTime && - miEventQueue.lastEventTime - e->u.keyButtonPointer.time < 10000) - evt->event->u.keyButtonPointer.time = miEventQueue.lastEventTime; + if (time < miEventQueue.lastEventTime && + miEventQueue.lastEventTime - time < 10000) + e->any.time = miEventQueue.lastEventTime; - miEventQueue.lastEventTime = evt->event->u.keyButtonPointer.time; - miEventQueue.events[oldtail].pScreen = EnqueueScreen(pDev); + miEventQueue.lastEventTime = ((InternalEvent*)evt->event)->any.time; + miEventQueue.events[oldtail].pScreen = pDev ? EnqueueScreen(pDev) : NULL; miEventQueue.events[oldtail].pDev = pDev; miEventQueue.lastMotion = isMotion; @@ -281,7 +225,7 @@ mieqSwitchScreen(DeviceIntPtr pDev, ScreenPtr pScreen, Bool fromDIX) #endif EnqueueScreen(pDev) = pScreen; if (fromDIX) - DequeueScreen(pDev) = pScreen; + DequeueScreen(pDev) = pScreen; #ifdef XQUARTZ pthread_mutex_unlock(&miEventQueueMutex); #endif @@ -307,86 +251,175 @@ mieqSetHandler(int event, mieqHandler handler) * Change the device id of the given event to the given device's id. */ static void -ChangeDeviceID(DeviceIntPtr dev, xEvent* event) +ChangeDeviceID(DeviceIntPtr dev, InternalEvent* event) { - int type = event->u.u.type; - - if (type == DeviceKeyPress || type == DeviceKeyRelease || - type == DeviceButtonPress || type == DeviceButtonRelease || - type == DeviceMotionNotify || type == ProximityIn || - type == ProximityOut) - ((deviceKeyButtonPointer*)event)->deviceid = dev->id; - else if (type == DeviceValuator) - ((deviceValuator*)event)->deviceid = dev->id; - else if (type == GenericEvent) + switch(event->any.type) { - DebugF("[mi] Unknown generic event (%d/%d), cannot change id.\n", - ((xGenericEvent*)event)->extension, - ((xGenericEvent*)event)->evtype); - } else - DebugF("[mi] Unknown event type (%d), cannot change id.\n", type); + case ET_Motion: + case ET_KeyPress: + case ET_KeyRelease: + case ET_ButtonPress: + case ET_ButtonRelease: + case ET_ProximityIn: + case ET_ProximityOut: + case ET_Hierarchy: + case ET_DeviceChanged: + event->device.deviceid = dev->id; + break; +#if XFreeXDGA + case ET_DGAEvent: + break; +#endif + case ET_RawKeyPress: + case ET_RawKeyRelease: + case ET_RawButtonPress: + case ET_RawButtonRelease: + case ET_RawMotion: + event->raw.deviceid = dev->id; + break; + default: + ErrorF("[mi] Unknown event type (%d), cannot change id.\n", + event->any.type); + } } static void -FixUpEventForMaster(DeviceIntPtr mdev, DeviceIntPtr sdev, xEvent* original, - EventListPtr master, int count) +FixUpEventForMaster(DeviceIntPtr mdev, DeviceIntPtr sdev, + InternalEvent* original, InternalEvent *master) { + CHECKEVENT(original); + CHECKEVENT(master); /* Ensure chained button mappings, i.e. that the detail field is the * value of the mapped button on the SD, not the physical button */ - if (original->u.u.type == DeviceButtonPress || original->u.u.type == DeviceButtonRelease) + if (original->any.type == ET_ButtonPress || + original->any.type == ET_ButtonRelease) { - int btn = original->u.u.detail; + int btn = original->device.detail.button; if (!sdev->button) return; /* Should never happen */ - master->event->u.u.detail = sdev->button->map[btn]; + master->device.detail.button = sdev->button->map[btn]; } } /** * Copy the given event into master. - * @param mdev The master device * @param sdev The slave device the original event comes from * @param original The event as it came from the EQ - * @param master The event after being copied - * @param count Number of events in original. + * @param copy The event after being copied + * @return The master device or NULL if the device is a floating slave. */ -void -CopyGetMasterEvent(DeviceIntPtr mdev, DeviceIntPtr sdev, xEvent* original, - EventListPtr master, int count) +DeviceIntPtr +CopyGetMasterEvent(DeviceIntPtr sdev, + InternalEvent* original, InternalEvent *copy) { - int len = count * sizeof(xEvent); - - /* Assumption: GenericEvents always have count 1 */ + DeviceIntPtr mdev; + int len = original->any.length; - if (GEV(original)->type == GenericEvent) - len += GEV(original)->length * 4; + CHECKEVENT(original); - if (master->evlen < len) - SetMinimumEventSize(master, 1, len); + if (!sdev->u.master) + return NULL; - memcpy(master->event, original, len); - while (count--) + switch(original->any.type) { - ChangeDeviceID(mdev, &master->event[count]); - FixUpEventForMaster(mdev, sdev, original, master, count); + case ET_KeyPress: + case ET_KeyRelease: + mdev = GetMaster(sdev, MASTER_KEYBOARD); + break; + case ET_ButtonPress: + case ET_ButtonRelease: + case ET_Motion: + case ET_ProximityIn: + case ET_ProximityOut: + mdev = GetMaster(sdev, MASTER_POINTER); + break; + default: + mdev = sdev->u.master; + break; } + + memcpy(copy, original, len); + ChangeDeviceID(mdev, copy); + FixUpEventForMaster(mdev, sdev, original, copy); + + return mdev; } -extern void -CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master); +/** + * Post the given @event through the device hierarchy, as appropriate. + * Use this function if an event must be posted for a given device during the + * usual event processing cycle. + */ +void +mieqProcessDeviceEvent(DeviceIntPtr dev, + InternalEvent *event, + ScreenPtr screen) +{ + mieqHandler handler; + int x = 0, y = 0; + DeviceIntPtr master; + InternalEvent mevent; /* master event */ + + CHECKEVENT(event); + + /* Custom event handler */ + handler = miEventQueue.handlers[event->any.type]; + + switch (event->any.type) { + /* Catch events that include valuator information and check if they + * are changing the screen */ + case ET_Motion: + case ET_KeyPress: + case ET_KeyRelease: + case ET_ButtonPress: + case ET_ButtonRelease: + if (dev && screen && screen != DequeueScreen(dev) && !handler) { + DequeueScreen(dev) = screen; + x = event->device.root_x; + y = event->device.root_y; + NewCurrentScreen (dev, DequeueScreen(dev), x, y); + } + break; + default: + break; + } + master = CopyGetMasterEvent(dev, event, &mevent); + + if (master) + master->u.lastSlave = dev; + + /* If someone's registered a custom event handler, let them + * steal it. */ + if (handler) + { + int screenNum = dev && DequeueScreen(dev) ? DequeueScreen(dev)->myNum : (screen ? screen->myNum : 0); + handler(screenNum, event, dev); + /* Check for the SD's master in case the device got detached + * during event processing */ + if (master && dev->u.master) + handler(screenNum, &mevent, master); + } else + { + /* process slave first, then master */ + dev->public.processInputProc(event, dev); + + /* Check for the SD's master in case the device got detached + * during event processing */ + if (master && dev->u.master) + master->public.processInputProc(&mevent, master); + } +} /* Call this from ProcessInputEvents(). */ void mieqProcessInputEvents(void) { - mieqHandler handler; EventRec *e = NULL; - int x = 0, y = 0; - int type, nevents, evlen, i; + int evlen; ScreenPtr screen; - static xEvent *event = NULL; + static InternalEvent *event = NULL; static size_t event_size = 0; DeviceIntPtr dev = NULL, master = NULL; @@ -398,19 +431,14 @@ mieqProcessInputEvents(void) while (miEventQueue.head != miEventQueue.tail) { e = &miEventQueue.events[miEventQueue.head]; - /* GenericEvents always have nevents == 1 */ - nevents = e->nevents; - evlen = (nevents > 1) ? sizeof(xEvent) : e->events->evlen; - if((nevents * evlen) > event_size) { - event_size = nevents * evlen; - event = (xEvent *)xrealloc(event, event_size); - } + evlen = e->events->evlen; + if(evlen > event_size) + event = xrealloc(event, evlen); if (!event) FatalError("[mi] No memory left for event processing.\n"); - for (i = 0; i < nevents; i++) - memcpy(&event[i], e->events[i].event, evlen); + memcpy(event, e->events->event, evlen); dev = e->pDev; @@ -421,9 +449,8 @@ mieqProcessInputEvents(void) #ifdef XQUARTZ pthread_mutex_unlock(&miEventQueueMutex); #endif - - type = event->u.u.type; - master = (!dev->isMaster && dev->u.master) ? dev->u.master : NULL; + + master = (dev && !IsMaster(dev) && dev->u.master) ? dev->u.master : NULL; if (screenIsSaved == SCREEN_SAVER_ON) dixSaveScreens (serverClient, SCREEN_SAVER_OFF, ScreenSaverReset); @@ -435,52 +462,10 @@ mieqProcessInputEvents(void) DPMSSet(serverClient, DPMSModeOn); #endif - /* Custom event handler */ - handler = miEventQueue.handlers[type]; - - if (screen != DequeueScreen(dev) && !handler) { - /* Assumption - screen switching can only occur on motion events. */ - DequeueScreen(dev) = screen; - x = event->u.keyButtonPointer.rootX; - y = event->u.keyButtonPointer.rootY; - NewCurrentScreen (dev, DequeueScreen(dev), x, y); - } - else { - if (master) { - /* Force a copy of the key class into the VCK so that the layout - is transferred. */ - if (event->u.u.type == DeviceKeyPress || - event->u.u.type == DeviceKeyRelease) - { - if (!master->key) - master = GetPairedDevice(master); - CopyKeyClass(dev, master); - } - - CopyGetMasterEvent(master, dev, event, masterEvents, nevents); - } - - /* If someone's registered a custom event handler, let them - * steal it. */ - if (handler) - { - handler(DequeueScreen(dev)->myNum, event, dev, nevents); - if (master) - handler(DequeueScreen(master)->myNum, - masterEvents->event, master, nevents); - } else - { - /* process slave first, then master */ - dev->public.processInputProc(event, dev, nevents); - - if (master) - master->public.processInputProc(masterEvents->event, master, - nevents); - } - } + mieqProcessDeviceEvent(dev, event, screen); /* Update the sprite now. Next event may be from different device. */ - if (type == DeviceMotionNotify && dev->coreEvents) + if (event->any.type == ET_Motion && master) miPointerUpdateSprite(dev); #ifdef XQUARTZ diff --git a/xorg-server/mi/miexpose.c b/xorg-server/mi/miexpose.c index f8a9e2fe4..6ce56ee85 100644 --- a/xorg-server/mi/miexpose.c +++ b/xorg-server/mi/miexpose.c @@ -78,7 +78,6 @@ Equipment Corporation. #endif #include <X11/X.h> -#define NEED_EVENTS #include <X11/Xproto.h> #include <X11/Xprotostr.h> @@ -127,7 +126,7 @@ exposing is done by the backing store's GraphicsExpose function, of course. */ -_X_EXPORT RegionPtr +RegionPtr miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, unsigned long plane) @@ -208,7 +207,7 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, box.y2 = pSrcDrawable->height; prgnSrcClip = &rgnSrcRec; REGION_INIT(pscr, prgnSrcClip, &box, 1); - pSrcWin = (WindowPtr)NULL; + pSrcWin = NULL; } if (pDstDrawable == pSrcDrawable) @@ -255,6 +254,10 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, /* intersect with visible areas of dest */ REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, prgnDstClip); + /* intersect with client clip region. */ + if (pGC->clientClipType == CT_REGION) + REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, pGC->clientClip); + /* * If we have LOTS of rectangles, we decide to take the extents * and force an exposure on that. This should require much less @@ -355,7 +358,7 @@ miSendGraphicsExpose (ClientPtr client, RegionPtr pRgn, XID drawable, numRects = REGION_NUM_RECTS(pRgn); pBox = REGION_RECTS(pRgn); - if(!(pEvent = (xEvent *)xalloc(numRects * sizeof(xEvent)))) + if(!(pEvent = xalloc(numRects * sizeof(xEvent)))) return; pe = pEvent; @@ -378,6 +381,7 @@ miSendGraphicsExpose (ClientPtr client, RegionPtr pRgn, XID drawable, else { xEvent event; + memset(&event, 0, sizeof(xEvent)); event.u.u.type = NoExpose; event.u.noExposure.drawable = drawable; event.u.noExposure.majorEvent = major; @@ -398,7 +402,7 @@ miSendExposures( WindowPtr pWin, RegionPtr pRgn, int dx, int dy) pBox = REGION_RECTS(pRgn); numRects = REGION_NUM_RECTS(pRgn); - if(!(pEvent = (xEvent *) xalloc(numRects * sizeof(xEvent)))) + if(!(pEvent = xcalloc(1, numRects * sizeof(xEvent)))) return; for (i=numRects, pe = pEvent; --i >= 0; pe++, pBox++) @@ -432,7 +436,7 @@ miSendExposures( WindowPtr pWin, RegionPtr pRgn, int dx, int dy) return; } realWin = win->info[0].id; - pWin = LookupIDByType(realWin, RT_WINDOW); + dixLookupWindow(&pWin, realWin, serverClient, DixSendAccess); } if(x || y || scrnum) for (i = 0; i < numRects; i++) { @@ -448,7 +452,7 @@ miSendExposures( WindowPtr pWin, RegionPtr pRgn, int dx, int dy) xfree(pEvent); } -_X_EXPORT void +void miWindowExposures( WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed) { RegionPtr exposures = prgn; @@ -518,7 +522,7 @@ void miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) { ScreenPtr pScreen = pWin->drawable.pScreen; - ChangeGCVal gcval[5]; + ChangeGCVal gcval[6]; BITS32 gcmask; GCPtr pGC; int i; @@ -586,23 +590,39 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) gcval[0].val = GXcopy; gcmask = GCFunction; +#ifdef ROOTLESS_SAFEALPHA +/* Bit mask for alpha channel with a particular number of bits per + * pixel. Note that we only care for 32bpp data. Mac OS X uses planar + * alpha for 16bpp. + */ +#define RootlessAlphaMask(bpp) ((bpp) == 32 ? 0xFF000000 : 0) +#endif + if (solid) { +#ifdef ROOTLESS_SAFEALPHA + gcval[1].val = fill.pixel | RootlessAlphaMask(pWin->drawable.bitsPerPixel); +#else gcval[1].val = fill.pixel; +#endif gcval[2].val = FillSolid; gcmask |= GCForeground | GCFillStyle; } else { - gcval[1].val = FillTiled; - gcval[2].ptr = (pointer)fill.pixmap; - gcval[3].val = tile_x_off; - gcval[4].val = tile_y_off; + int c=1; +#ifdef ROOTLESS_SAFEALPHA + gcval[c++].val = ((CARD32)-1) & ~RootlessAlphaMask(pWin->drawable.bitsPerPixel); + gcmask |= GCPlaneMask; +#endif + gcval[c++].val = FillTiled; + gcval[c++].ptr = (pointer)fill.pixmap; + gcval[c++].val = tile_x_off; + gcval[c++].val = tile_y_off; gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin; } - prect = (xRectangle *)xalloc(REGION_NUM_RECTS(prgn) * - sizeof(xRectangle)); + prect = xalloc(REGION_NUM_RECTS(prgn) * sizeof(xRectangle)); if (!prect) return; @@ -636,7 +656,7 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) /* MICLEARDRAWABLE -- sets the entire drawable to the background color of * the GC. Useful when we have a scratch drawable and need to initialize * it. */ -_X_EXPORT void +void miClearDrawable(DrawablePtr pDraw, GCPtr pGC) { XID fg = pGC->fgPixel; diff --git a/xorg-server/mi/mifillarc.c b/xorg-server/mi/mifillarc.c index f2ab5ceb1..c22baf54c 100644 --- a/xorg-server/mi/mifillarc.c +++ b/xorg-server/mi/mifillarc.c @@ -52,7 +52,7 @@ Author: Bob Scheifler, MIT X Consortium #define Dsin(d) sin((double)d*(M_PI/11520.0)) #define Dcos(d) cos((double)d*(M_PI/11520.0)) -_X_EXPORT void +void miFillArcSetup(xArc *arc, miFillArcRec *info) { info->y = arc->height >> 1; @@ -304,7 +304,7 @@ miGetPieEdge( miGetArcEdge(arc, edge, k, top, left); } -_X_EXPORT void +void miFillArcSliceSetup(xArc *arc, miArcSliceRec *slice, GCPtr pGC) { int angle1, angle2; @@ -546,10 +546,10 @@ miFillEllipseI( int *widths; int *wids; - points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * arc->height); + points = xalloc(sizeof(DDXPointRec) * arc->height); if (!points) return; - widths = (int *)xalloc(sizeof(int) * arc->height); + widths = xalloc(sizeof(int) * arc->height); if (!widths) { xfree(points); @@ -589,10 +589,10 @@ miFillEllipseD( int *widths; int *wids; - points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * arc->height); + points = xalloc(sizeof(DDXPointRec) * arc->height); if (!points) return; - widths = (int *)xalloc(sizeof(int) * arc->height); + widths = xalloc(sizeof(int) * arc->height); if (!widths) { xfree(points); @@ -661,10 +661,10 @@ miFillArcSliceI( slw = arc->height; if (slice.flip_top || slice.flip_bot) slw += (arc->height >> 1) + 1; - points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * slw); + points = xalloc(sizeof(DDXPointRec) * slw); if (!points) return; - widths = (int *)xalloc(sizeof(int) * slw); + widths = xalloc(sizeof(int) * slw); if (!widths) { xfree(points); @@ -725,10 +725,10 @@ miFillArcSliceD( slw = arc->height; if (slice.flip_top || slice.flip_bot) slw += (arc->height >> 1) + 1; - points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * slw); + points = xalloc(sizeof(DDXPointRec) * slw); if (!points) return; - widths = (int *)xalloc(sizeof(int) * slw); + widths = xalloc(sizeof(int) * slw); if (!widths) { xfree(points); @@ -770,7 +770,7 @@ miFillArcSliceD( * Since we don't have to worry about overlapping segments, we can just * fill each arc as it comes. */ -_X_EXPORT void +void miPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs) { int i; diff --git a/xorg-server/mi/mifillarc.h b/xorg-server/mi/mifillarc.h index 3e3bb9858..11587540f 100644 --- a/xorg-server/mi/mifillarc.h +++ b/xorg-server/mi/mifillarc.h @@ -176,12 +176,12 @@ typedef struct _miArcSlice { #define miFillInArcLower(slw) (((iny + dy) != 0) && \ ((slw > 1) || (ine != inxk))) -extern void miFillArcSetup( +extern _X_EXPORT void miFillArcSetup( xArc * /*arc*/, miFillArcRec * /*info*/ ); -extern void miFillArcSliceSetup( +extern _X_EXPORT void miFillArcSliceSetup( xArc * /*arc*/, miArcSliceRec * /*slice*/, GCPtr /*pGC*/ diff --git a/xorg-server/mi/mifillrct.c b/xorg-server/mi/mifillrct.c index 06f018e27..6e9979099 100644 --- a/xorg-server/mi/mifillrct.c +++ b/xorg-server/mi/mifillrct.c @@ -66,7 +66,7 @@ SOFTWARE. * then call FillSpans to fill each rectangle. We let FillSpans worry about * clipping to the destination */ -_X_EXPORT void +void miPolyFillRect( DrawablePtr pDrawable, GCPtr pGC, @@ -107,8 +107,8 @@ miPolyFillRect( maxheight = max(maxheight, prect->height); } - pptFirst = (DDXPointPtr) xalloc(maxheight * sizeof(DDXPointRec)); - pwFirst = (int *) xalloc(maxheight * sizeof(int)); + pptFirst = xalloc(maxheight * sizeof(DDXPointRec)); + pwFirst = xalloc(maxheight * sizeof(int)); if(!pptFirst || !pwFirst) { if (pwFirst) xfree(pwFirst); diff --git a/xorg-server/mi/mifpoly.h b/xorg-server/mi/mifpoly.h index 7bd77b356..ffd19a341 100644 --- a/xorg-server/mi/mifpoly.h +++ b/xorg-server/mi/mifpoly.h @@ -88,7 +88,7 @@ typedef struct _SppArc { /* mifpolycon.c */ -extern void miFillSppPoly( +extern _X_EXPORT void miFillSppPoly( DrawablePtr /*dst*/, GCPtr /*pgc*/, int /*count*/, diff --git a/xorg-server/mi/mifpolycon.c b/xorg-server/mi/mifpolycon.c index 4a3acfd2b..383502f64 100644 --- a/xorg-server/mi/mifpolycon.c +++ b/xorg-server/mi/mifpolycon.c @@ -116,9 +116,9 @@ miFillSppPoly( y = ymax - ymin + 1; if ((count < 3) || (y <= 0)) return; - ptsOut = FirstPoint = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * y); - width = FirstWidth = (int *) xalloc(sizeof(int) * y); - Marked = (int *) xalloc(sizeof(int) * count); + ptsOut = FirstPoint = xalloc(sizeof(DDXPointRec) * y); + width = FirstWidth = xalloc(sizeof(int) * y); + Marked = xalloc(sizeof(int) * count); if(!ptsOut || !width || !Marked) { diff --git a/xorg-server/mi/migc.c b/xorg-server/mi/migc.c index e6bec31c4..a797099cd 100644 --- a/xorg-server/mi/migc.c +++ b/xorg-server/mi/migc.c @@ -38,13 +38,13 @@ from The Open Group. #include "migc.h" /* ARGSUSED */ -_X_EXPORT void +void miChangeGC(GCPtr pGC, unsigned long mask) { return; } -_X_EXPORT void +void miDestroyGC(GCPtr pGC) { if (pGC->pRotatedPixmap) @@ -53,7 +53,7 @@ miDestroyGC(GCPtr pGC) REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip); } -_X_EXPORT void +void miDestroyClip(GCPtr pGC) { if (pGC->clientClipType == CT_NONE) @@ -74,7 +74,7 @@ miDestroyClip(GCPtr pGC) pGC->clientClipType = CT_NONE; } -_X_EXPORT void +void miChangeClip( GCPtr pGC, int type, pointer pvalue, int nrects) { (*pGC->funcs->DestroyClip) (pGC); @@ -101,7 +101,7 @@ miChangeClip( GCPtr pGC, int type, pointer pvalue, int nrects) pGC->stateChanges |= GCClipMask; } -_X_EXPORT void +void miCopyClip(GCPtr pgcDst, GCPtr pgcSrc) { RegionPtr prgnNew; @@ -125,13 +125,13 @@ miCopyClip(GCPtr pgcDst, GCPtr pgcSrc) } /* ARGSUSED */ -_X_EXPORT void +void miCopyGC(GCPtr pGCSrc, unsigned long changes, GCPtr pGCDst) { return; } -_X_EXPORT void +void miComputeCompositeClip( GCPtr pGC, DrawablePtr pDrawable) { ScreenPtr pScreen; diff --git a/xorg-server/mi/migc.h b/xorg-server/mi/migc.h index 51ed7b671..df5805f4d 100644 --- a/xorg-server/mi/migc.h +++ b/xorg-server/mi/migc.h @@ -27,38 +27,38 @@ from The Open Group. */ -extern void miChangeGC( +extern _X_EXPORT void miChangeGC( GCPtr /*pGC*/, unsigned long /*mask*/ ); -extern void miDestroyGC( +extern _X_EXPORT void miDestroyGC( GCPtr /*pGC*/ ); -extern void miDestroyClip( +extern _X_EXPORT void miDestroyClip( GCPtr /*pGC*/ ); -extern void miChangeClip( +extern _X_EXPORT void miChangeClip( GCPtr /*pGC*/, int /*type*/, pointer /*pvalue*/, int /*nrects*/ ); -extern void miCopyClip( +extern _X_EXPORT void miCopyClip( GCPtr /*pgcDst*/, GCPtr /*pgcSrc*/ ); -extern void miCopyGC( +extern _X_EXPORT void miCopyGC( GCPtr /*pGCSrc*/, unsigned long /*changes*/, GCPtr /*pGCDst*/ ); -extern void miComputeCompositeClip( +extern _X_EXPORT void miComputeCompositeClip( GCPtr /*pGC*/, DrawablePtr /*pDrawable*/ ); diff --git a/xorg-server/mi/miglblt.c b/xorg-server/mi/miglblt.c index 414773608..bc715aee9 100644 --- a/xorg-server/mi/miglblt.c +++ b/xorg-server/mi/miglblt.c @@ -81,7 +81,7 @@ with the sample server. use the bitmap in a call to PushPixels */ -_X_EXPORT void +void miPolyGlyphBlt( DrawablePtr pDrawable, GC *pGC, @@ -141,7 +141,7 @@ miPolyGlyphBlt( DoChangeGC(pGCtmp, GCFunction|GCForeground|GCBackground, gcvals, 0); nbyLine = BitmapBytePad(width); - pbits = (unsigned char *)xalloc(height*nbyLine); + pbits = xalloc(height*nbyLine); if (!pbits) { (*pDrawable->pScreen->DestroyPixmap)(pPixmap); @@ -197,7 +197,7 @@ miPolyGlyphBlt( } -_X_EXPORT void +void miImageGlyphBlt( DrawablePtr pDrawable, GC *pGC, diff --git a/xorg-server/mi/miinitext.c b/xorg-server/mi/miinitext.c index 92d6cd2f0..7f59126a4 100644 --- a/xorg-server/mi/miinitext.c +++ b/xorg-server/mi/miinitext.c @@ -134,10 +134,6 @@ extern Bool noXFree86VidModeExtension; #ifdef XFIXES extern Bool noXFixesExtension; #endif -#ifdef XKB -/* |noXkbExtension| is defined in xc/programs/Xserver/xkb/xkbInit.c */ -extern Bool noXkbExtension; -#endif #ifdef PANORAMIX extern Bool noPanoramiXExtension; #endif @@ -160,19 +156,15 @@ typedef void (*InitExtension)(INITARGS); #endif #ifdef MITSHM -#define _XSHM_SERVER_ -#include <X11/extensions/shmstr.h> +#include <X11/extensions/shm.h> #endif #ifdef XTEST -#define _XTEST_SERVER_ -#include <X11/extensions/XTest.h> +#include <X11/extensions/xtestconst.h> #endif -#ifdef XKB #include <X11/extensions/XKB.h> -#endif #ifdef XCSECURITY #include "securitysrv.h" -#include <X11/extensions/securstr.h> +#include <X11/extensions/secur.h> #endif #ifdef XSELINUX #include "xselinux.h" @@ -213,9 +205,7 @@ extern void XvExtensionInit(INITARGS); extern void XvMCExtensionInit(INITARGS); #endif extern void SyncExtensionInit(INITARGS); -#ifdef XKB extern void XkbExtensionInit(INITARGS); -#endif extern void XCMiscExtensionInit(INITARGS); #ifdef XRECORD extern void RecordExtensionInit(INITARGS); @@ -340,9 +330,7 @@ static ExtensionToggle ExtensionToggleList[] = { "XINERAMA", &noPanoramiXExtension }, #endif { "XInputExtension", NULL }, -#ifdef XKB - { "XKEYBOARD", &noXkbExtension }, -#endif + { "XKEYBOARD", NULL }, #ifdef XSELINUX { "SELinux", &noSELinuxExtension }, #endif @@ -416,9 +404,7 @@ InitExtensions(int argc, char *argv[]) } #endif SyncExtensionInit(); -#if defined(XKB) - if (!noXkbExtension) XkbExtensionInit(); -#endif + XkbExtensionInit(); XCMiscExtensionInit(); #ifdef XRECORD if (!noTestExtensions) RecordExtensionInit(); @@ -493,9 +479,7 @@ static ExtensionModule staticExtensions[] = { #endif { BigReqExtensionInit, "BIG-REQUESTS", NULL, NULL, NULL }, { SyncExtensionInit, "SYNC", NULL, NULL, NULL }, -#ifdef XKB - { XkbExtensionInit, XkbName, &noXkbExtension, NULL, NULL }, -#endif + { XkbExtensionInit, XkbName, NULL, NULL, NULL }, { XCMiscExtensionInit, "XC-MISC", NULL, NULL, NULL }, #ifdef XCSECURITY { SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension, NULL, NULL }, diff --git a/xorg-server/mi/miline.h b/xorg-server/mi/miline.h index 036c2b5df..b5f706dbf 100644 --- a/xorg-server/mi/miline.h +++ b/xorg-server/mi/miline.h @@ -77,7 +77,7 @@ in this Software without prior written authorization from The Open Group. * Jack E. Bresenham, IEEE CG&A, May 1987. */ -extern void miSetZeroLineBias( +extern _X_EXPORT void miSetZeroLineBias( ScreenPtr /* pScreen */, unsigned int /* bias */ ); @@ -120,7 +120,7 @@ extern void miSetZeroLineBias( t = y1; y1 = y2; y2 = t;\ } -#define miGetZeroLineBias(_pScreen) ((unsigned long) \ +#define miGetZeroLineBias(_pScreen) ((unsigned long) (unsigned long*)\ dixLookupPrivate(&(_pScreen)->devPrivates, miZeroLineScreenKey)) #define CalcLineDeltas(_x1,_y1,_x2,_y2,_adx,_ady,_sx,_sy,_SX,_SY,_octant) \ @@ -148,9 +148,9 @@ extern void miSetZeroLineBias( #define IsXDecreasingOctant(_octant) ((_octant) & XDECREASING) #define IsYDecreasingOctant(_octant) ((_octant) & YDECREASING) -extern DevPrivateKey miZeroLineScreenKey; +extern _X_EXPORT DevPrivateKey miZeroLineScreenKey; -extern int miZeroClipLine( +extern _X_EXPORT int miZeroClipLine( int /*xmin*/, int /*ymin*/, int /*xmax*/, diff --git a/xorg-server/mi/mioverlay.c b/xorg-server/mi/mioverlay.c index 395b1aab2..e0aa88017 100644 --- a/xorg-server/mi/mioverlay.c +++ b/xorg-server/mi/mioverlay.c @@ -102,7 +102,7 @@ static void miOverlayChangeBorderWidth(WindowPtr, unsigned int); HasBorder(w) && \ (w)->backgroundState == ParentRelative) -_X_EXPORT Bool +Bool miInitOverlay( ScreenPtr pScreen, miOverlayInOverlayFunc inOverlayFunc, @@ -900,7 +900,7 @@ miOverlayHandleExposures(WindowPtr pWin) REGION_UNINIT(pScreen, &val->after.borderExposed); REGION_UNINIT(pScreen, &val->after.exposed); xfree(val); - pChild->valdata = (ValidatePtr)NULL; + pChild->valdata = NULL; if (pChild->firstChild) { pChild = pChild->firstChild; @@ -1604,7 +1604,7 @@ miOverlayChangeBorderWidth( /* We need this as an addition since the xf86 common code doesn't know about the second tree which is static to this file. */ -_X_EXPORT void +void miOverlaySetRootClip(ScreenPtr pScreen, Bool enable) { WindowPtr pRoot = WindowTable[pScreen->myNum]; @@ -1688,7 +1688,7 @@ miOverlayClearToBackground( /****************************************************************/ /* not used */ -_X_EXPORT Bool +Bool miOverlayGetPrivateClips( WindowPtr pWin, RegionPtr *borderClip, @@ -1707,7 +1707,7 @@ miOverlayGetPrivateClips( return FALSE; } -_X_EXPORT void +void miOverlaySetTransFunction ( ScreenPtr pScreen, miOverlayTransFunc transFunc @@ -1715,13 +1715,13 @@ miOverlaySetTransFunction ( MIOVERLAY_GET_SCREEN_PRIVATE(pScreen)->MakeTransparent = transFunc; } -_X_EXPORT Bool +Bool miOverlayCopyUnderlay(ScreenPtr pScreen) { return MIOVERLAY_GET_SCREEN_PRIVATE(pScreen)->copyUnderlay; } -_X_EXPORT void +void miOverlayComputeCompositeClip(GCPtr pGC, WindowPtr pWin) { ScreenPtr pScreen = pGC->pScreen; @@ -1777,7 +1777,7 @@ miOverlayComputeCompositeClip(GCPtr pGC, WindowPtr pWin) } } -_X_EXPORT Bool +Bool miOverlayCollectUnderlayRegions( WindowPtr pWin, RegionPtr *region diff --git a/xorg-server/mi/mioverlay.h b/xorg-server/mi/mioverlay.h index 24b74f51c..dca65ad37 100644 --- a/xorg-server/mi/mioverlay.h +++ b/xorg-server/mi/mioverlay.h @@ -9,24 +9,24 @@ typedef void (*miOverlayTransFunc)(ScreenPtr, int, BoxPtr); typedef Bool (*miOverlayInOverlayFunc)(WindowPtr); -Bool +extern _X_EXPORT Bool miInitOverlay( ScreenPtr pScreen, miOverlayInOverlayFunc inOverlay, miOverlayTransFunc trans ); -Bool +extern _X_EXPORT Bool miOverlayGetPrivateClips( WindowPtr pWin, RegionPtr *borderClip, RegionPtr *clipList ); -Bool miOverlayCollectUnderlayRegions(WindowPtr, RegionPtr*); -void miOverlayComputeCompositeClip(GCPtr, WindowPtr); -Bool miOverlayCopyUnderlay(ScreenPtr); -void miOverlaySetTransFunction(ScreenPtr, miOverlayTransFunc); -void miOverlaySetRootClip(ScreenPtr, Bool); +extern _X_EXPORT Bool miOverlayCollectUnderlayRegions(WindowPtr, RegionPtr*); +extern _X_EXPORT void miOverlayComputeCompositeClip(GCPtr, WindowPtr); +extern _X_EXPORT Bool miOverlayCopyUnderlay(ScreenPtr); +extern _X_EXPORT void miOverlaySetTransFunction(ScreenPtr, miOverlayTransFunc); +extern _X_EXPORT void miOverlaySetRootClip(ScreenPtr, Bool); #endif /* __MIOVERLAY_H */ diff --git a/xorg-server/mi/mipointer.c b/xorg-server/mi/mipointer.c index e37316e71..e1f63be4e 100644 --- a/xorg-server/mi/mipointer.c +++ b/xorg-server/mi/mipointer.c @@ -27,7 +27,6 @@ in this Software without prior written authorization from The Open Group. #include <dix-config.h> #endif -# define NEED_EVENTS # include <X11/X.h> # include <X11/Xmd.h> # include <X11/Xproto.h> @@ -42,7 +41,7 @@ in this Software without prior written authorization from The Open Group. # include "inputstr.h" static int miPointerScreenKeyIndex; -_X_EXPORT DevPrivateKey miPointerScreenKey = &miPointerScreenKeyIndex; +DevPrivateKey miPointerScreenKey = &miPointerScreenKeyIndex; #define GetScreenPrivate(s) ((miPointerScreenPtr) \ dixLookupPrivate(&(s)->devPrivates, miPointerScreenKey)) @@ -52,9 +51,9 @@ static int miPointerPrivKeyIndex; static DevPrivateKey miPointerPrivKey = &miPointerPrivKeyIndex; #define MIPOINTER(dev) \ - ((DevHasCursor((dev)) || (!dev->isMaster && !dev->u.master)) ? \ + ((!IsMaster(dev) && !dev->u.master) ? \ (miPointerPtr)dixLookupPrivate(&(dev)->devPrivates, miPointerPrivKey): \ - (miPointerPtr)dixLookupPrivate(&(dev)->u.master->devPrivates, miPointerPrivKey)) + (miPointerPtr)dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, miPointerPrivKey)) static Bool miPointerRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor); @@ -81,7 +80,7 @@ static void miPointerDeviceCleanup(DeviceIntPtr pDev, static EventList* events; /* for WarpPointer MotionNotifies */ -_X_EXPORT Bool +Bool miPointerInitialize (ScreenPtr pScreen, miPointerSpriteFuncPtr spriteFuncs, miPointerScreenFuncPtr screenFuncs, @@ -89,7 +88,7 @@ miPointerInitialize (ScreenPtr pScreen, { miPointerScreenPtr pScreenPriv; - pScreenPriv = (miPointerScreenPtr) xalloc (sizeof (miPointerScreenRec)); + pScreenPriv = xalloc (sizeof (miPointerScreenRec)); if (!pScreenPriv) return FALSE; pScreenPriv->spriteFuncs = spriteFuncs; @@ -187,8 +186,8 @@ miPointerDisplayCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) miPointerPtr pPointer; /* return for keyboards */ - if ((pDev->isMaster && !DevHasCursor(pDev)) || - (!pDev->isMaster && pDev->u.master && !DevHasCursor(pDev->u.master))) + if ((IsMaster(pDev) && !DevHasCursor(pDev)) || + (!IsMaster(pDev) && pDev->u.master && !DevHasCursor(pDev->u.master))) return FALSE; pPointer = MIPOINTER(pDev); @@ -285,10 +284,11 @@ miPointerDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) static void miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) { - if (!pDev->isMaster && pDev->u.master) + SetupScreen(pScreen); + + if (!IsMaster(pDev) && pDev->u.master) return; - SetupScreen(pScreen); (*pScreenPriv->spriteFuncs->DeviceCursorCleanup)(pDev, pScreen); xfree(dixLookupPrivate(&pDev->devPrivates, miPointerPrivKey)); dixSetPrivate(&pDev->devPrivates, miPointerPrivKey, NULL); @@ -297,14 +297,14 @@ miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) /* Once signals are ignored, the WarpCursor function can call this */ -_X_EXPORT void +void miPointerWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { miPointerPtr pPointer; BOOL changedScreen = FALSE; - pPointer = MIPOINTER(pDev); SetupScreen (pScreen); + pPointer = MIPOINTER(pDev); if (pPointer->pScreen != pScreen) { @@ -367,6 +367,9 @@ miPointerUpdateSprite (DeviceIntPtr pDev) pPointer = MIPOINTER(pDev); + if (!pPointer) + return; + pScreen = pPointer->pScreen; if (!pScreen) return; @@ -444,28 +447,19 @@ miPointerSetScreen(DeviceIntPtr pDev, int screen_no, int x, int y) pPointer->limits.y2 = pScreen->height; } -_X_EXPORT ScreenPtr -miPointerCurrentScreen () +ScreenPtr +miPointerCurrentScreen (void) { return miPointerGetScreen(inputInfo.pointer); } -_X_EXPORT ScreenPtr +ScreenPtr miPointerGetScreen(DeviceIntPtr pDev) { miPointerPtr pPointer = MIPOINTER(pDev); return (pPointer) ? pPointer->pScreen : NULL; } -/* Move the pointer to x, y on the current screen, update the sprite, and - * the motion history. Generates no events. Does not return changed x - * and y if they are clipped; use miPointerSetPosition instead. */ -_X_EXPORT void -miPointerAbsoluteCursor (int x, int y, unsigned long time) -{ - miPointerSetPosition(inputInfo.pointer, &x, &y); -} - /* Move the pointer on the current screen, and update the sprite. */ static void miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, @@ -480,7 +474,7 @@ miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, * VCP, as this may cause a non-HW rendered cursor to be rendered during * SIGIO. This again leads to allocs during SIGIO which leads to SIGABRT. */ - if ((pDev == inputInfo.pointer || (!pDev->isMaster && pDev->u.master == inputInfo.pointer)) + if ((pDev == inputInfo.pointer || (!IsMaster(pDev) && pDev->u.master == inputInfo.pointer)) && !pScreenPriv->waitForUpdate && pScreen == pPointer->pSpriteScreen) { pPointer->devx = x; @@ -494,7 +488,7 @@ miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, pPointer->pScreen = pScreen; } -_X_EXPORT void +void miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y) { miPointerScreenPtr pScreenPriv; @@ -547,7 +541,7 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y) miPointerMoved(pDev, pScreen, *x, *y); } -_X_EXPORT void +void miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y) { *x = MIPOINTER(pDev)->x; @@ -590,7 +584,7 @@ miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) darwinEvents_lock(); #endif for (i = 0; i < nevents; i++) - mieqEnqueue(pDev, events[i].event); + mieqEnqueue(pDev, (InternalEvent*)events[i].event); #ifdef XQUARTZ darwinEvents_unlock(); #endif diff --git a/xorg-server/mi/mipointer.h b/xorg-server/mi/mipointer.h index d1eac987f..22575ea21 100644 --- a/xorg-server/mi/mipointer.h +++ b/xorg-server/mi/mipointer.h @@ -82,7 +82,7 @@ typedef struct _miPointerScreenFuncRec { ); void (*EnqueueEvent)( DeviceIntPtr /* pDev */, - xEventPtr /* event */ + InternalEvent* /* event */ ); void (*NewEventScreen)( DeviceIntPtr /* pDev */, @@ -91,69 +91,54 @@ typedef struct _miPointerScreenFuncRec { ); } miPointerScreenFuncRec, *miPointerScreenFuncPtr; -extern Bool miDCInitialize( +extern _X_EXPORT Bool miDCInitialize( ScreenPtr /*pScreen*/, miPointerScreenFuncPtr /*screenFuncs*/ ); -extern Bool miPointerInitialize( +extern _X_EXPORT Bool miPointerInitialize( ScreenPtr /*pScreen*/, miPointerSpriteFuncPtr /*spriteFuncs*/, miPointerScreenFuncPtr /*screenFuncs*/, Bool /*waitForUpdate*/ ); -extern void miPointerWarpCursor( +extern _X_EXPORT void miPointerWarpCursor( DeviceIntPtr /*pDev*/, ScreenPtr /*pScreen*/, int /*x*/, int /*y*/ -) _X_DEPRECATED; - -extern int miPointerGetMotionEvents( - DeviceIntPtr /*pPtr*/, - xTimecoord * /*coords*/, - unsigned long /*start*/, - unsigned long /*stop*/, - ScreenPtr /*pScreen*/ ); -/* Deprecated in favour of miPointerSetPosition. */ -extern void miPointerAbsoluteCursor( - int /*x*/, - int /*y*/, - unsigned long /*time*/ -) _X_DEPRECATED; - /* Deprecated in favour of miPointerGetScreen. */ -extern ScreenPtr miPointerCurrentScreen( +extern _X_EXPORT ScreenPtr miPointerCurrentScreen( void ) _X_DEPRECATED; -extern ScreenPtr miPointerGetScreen( +extern _X_EXPORT ScreenPtr miPointerGetScreen( DeviceIntPtr pDev); -extern void miPointerSetScreen( +extern _X_EXPORT void miPointerSetScreen( DeviceIntPtr pDev, int screen_num, int x, int y); /* Returns the current cursor position. */ -extern void miPointerGetPosition( +extern _X_EXPORT void miPointerGetPosition( DeviceIntPtr pDev, int *x, int *y); /* Moves the cursor to the specified position. May clip the co-ordinates: * x and y are modified in-place. */ -extern void miPointerSetPosition( +extern _X_EXPORT void miPointerSetPosition( DeviceIntPtr pDev, int *x, int *y); -extern void miPointerUpdateSprite( +extern _X_EXPORT void miPointerUpdateSprite( DeviceIntPtr pDev); -extern DevPrivateKey miPointerScreenKey; +extern _X_EXPORT DevPrivateKey miPointerScreenKey; #endif /* MIPOINTER_H */ diff --git a/xorg-server/mi/mipoly.c b/xorg-server/mi/mipoly.c index 5ec4bfd6a..b3e2c2fb1 100644 --- a/xorg-server/mi/mipoly.c +++ b/xorg-server/mi/mipoly.c @@ -66,7 +66,7 @@ SOFTWARE. #include "regionstr.h" -_X_EXPORT void +void miFillPolygon( DrawablePtr dst, GCPtr pgc, int shape, int mode, int count, DDXPointPtr pPts) diff --git a/xorg-server/mi/mipoly.h b/xorg-server/mi/mipoly.h index c1bab4943..d94796e2f 100644 --- a/xorg-server/mi/mipoly.h +++ b/xorg-server/mi/mipoly.h @@ -180,7 +180,7 @@ typedef struct _ScanLineListBlock { /* mipolyutil.c */ -extern Bool miCreateETandAET( +extern _X_EXPORT Bool miCreateETandAET( int /*count*/, DDXPointPtr /*pts*/, EdgeTable * /*ET*/, @@ -189,19 +189,19 @@ extern Bool miCreateETandAET( ScanLineListBlock * /*pSLLBlock*/ ); -extern void miloadAET( +extern _X_EXPORT void miloadAET( EdgeTableEntry * /*AET*/, EdgeTableEntry * /*ETEs*/ ); -extern void micomputeWAET( +extern _X_EXPORT void micomputeWAET( EdgeTableEntry * /*AET*/ ); -extern int miInsertionSort( +extern _X_EXPORT int miInsertionSort( EdgeTableEntry * /*AET*/ ); -extern void miFreeStorage( +extern _X_EXPORT void miFreeStorage( ScanLineListBlock * /*pSLLBlock*/ ); diff --git a/xorg-server/mi/mipolycon.c b/xorg-server/mi/mipolycon.c index 6e3889621..79384881d 100644 --- a/xorg-server/mi/mipolycon.c +++ b/xorg-server/mi/mipolycon.c @@ -105,8 +105,8 @@ miFillConvexPoly( dy = ymax - ymin + 1; if ((count < 3) || (dy < 0)) return(TRUE); - ptsOut = FirstPoint = (DDXPointPtr )xalloc(sizeof(DDXPointRec)*dy); - width = FirstWidth = (int *)xalloc(sizeof(int) * dy); + ptsOut = FirstPoint = xalloc(sizeof(DDXPointRec)*dy); + width = FirstWidth = xalloc(sizeof(int) * dy); if(!FirstPoint || !FirstWidth) { if (FirstWidth) xfree(FirstWidth); diff --git a/xorg-server/mi/mipolygen.c b/xorg-server/mi/mipolygen.c index 04bc2c67f..4744583c3 100644 --- a/xorg-server/mi/mipolygen.c +++ b/xorg-server/mi/mipolygen.c @@ -92,8 +92,7 @@ miFillGeneralPoly( if (count < 3) return(TRUE); - if(!(pETEs = (EdgeTableEntry *) - xalloc(sizeof(EdgeTableEntry) * count))) + if(!(pETEs = xalloc(sizeof(EdgeTableEntry) * count))) return(FALSE); ptsOut = FirstPoint; width = FirstWidth; diff --git a/xorg-server/mi/mipolypnt.c b/xorg-server/mi/mipolypnt.c index d16a95158..5d6243ab0 100644 --- a/xorg-server/mi/mipolypnt.c +++ b/xorg-server/mi/mipolypnt.c @@ -55,7 +55,7 @@ SOFTWARE. #include "windowstr.h" #include "mi.h" -_X_EXPORT void +void miPolyPoint( DrawablePtr pDrawable, GCPtr pGC, @@ -107,7 +107,7 @@ miPolyPoint( DoChangeGC(pGC, GCFillStyle, &fsNew, 0); ValidateGC(pDrawable, pGC); } - if(!(pwidthInit = (int *)xalloc(npt * sizeof(int)))) + if(!(pwidthInit = xalloc(npt * sizeof(int)))) return; pwidth = pwidthInit; for(i = 0; i < npt; i++) diff --git a/xorg-server/mi/mipolyrect.c b/xorg-server/mi/mipolyrect.c index e7504ef16..033c7a7c8 100644 --- a/xorg-server/mi/mipolyrect.c +++ b/xorg-server/mi/mipolyrect.c @@ -55,7 +55,7 @@ SOFTWARE. #include "pixmap.h" #include "mi.h" -_X_EXPORT void +void miPolyRectangle(DrawablePtr pDraw, GCPtr pGC, int nrects, xRectangle *pRects) { int i; @@ -90,7 +90,7 @@ miPolyRectangle(DrawablePtr pDraw, GCPtr pGC, int nrects, xRectangle *pRects) offset2 = pGC->lineWidth; offset1 = offset2 >> 1; offset3 = offset2 - offset1; - tmp = (xRectangle *) xalloc(ntmp * sizeof (xRectangle)); + tmp = xalloc(ntmp * sizeof (xRectangle)); if (!tmp) return; t = tmp; diff --git a/xorg-server/mi/mipolyseg.c b/xorg-server/mi/mipolyseg.c index 0832a601b..bf7f0f92e 100644 --- a/xorg-server/mi/mipolyseg.c +++ b/xorg-server/mi/mipolyseg.c @@ -66,7 +66,7 @@ SOFTWARE. *****************************************************************/ -_X_EXPORT void +void miPolySegment(DrawablePtr pDraw, GCPtr pGC, int nseg, xSegment *pSegs) { int i; diff --git a/xorg-server/mi/mipolytext.c b/xorg-server/mi/mipolytext.c index 7be40aef1..508e0ffa7 100644 --- a/xorg-server/mi/mipolytext.c +++ b/xorg-server/mi/mipolytext.c @@ -66,7 +66,7 @@ SOFTWARE. #include "dixfontstr.h" #include "mi.h" -_X_EXPORT int +int miPolyText8(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, char *chars) { unsigned long n, i; @@ -83,7 +83,7 @@ miPolyText8(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, char *chars) return x+w; } -_X_EXPORT int +int miPolyText16(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, unsigned short *chars) { unsigned long n, i; @@ -101,7 +101,7 @@ miPolyText16(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, unsigned sho return x+w; } -_X_EXPORT void +void miImageText8(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, char *chars) { unsigned long n; @@ -114,7 +114,7 @@ miImageText8(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, char *chars) (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(font)); } -_X_EXPORT void +void miImageText16(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, unsigned short *chars) { diff --git a/xorg-server/mi/mipolyutil.c b/xorg-server/mi/mipolyutil.c index ed41a7d1a..15561b73d 100644 --- a/xorg-server/mi/mipolyutil.c +++ b/xorg-server/mi/mipolyutil.c @@ -99,19 +99,18 @@ miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline, { if (*iSLLBlock > SLLSPERBLOCK-1) { - tmpSLLBlock = - (ScanLineListBlock *)xalloc(sizeof(ScanLineListBlock)); + tmpSLLBlock = xalloc(sizeof(ScanLineListBlock)); if (!tmpSLLBlock) return FALSE; (*SLLBlock)->next = tmpSLLBlock; - tmpSLLBlock->next = (ScanLineListBlock *)NULL; + tmpSLLBlock->next = NULL; *SLLBlock = tmpSLLBlock; *iSLLBlock = 0; } pSLL = &((*SLLBlock)->SLLs[(*iSLLBlock)++]); pSLL->next = pPrevSLL->next; - pSLL->edgelist = (EdgeTableEntry *)NULL; + pSLL->edgelist = NULL; pPrevSLL->next = pSLL; } pSLL->scanline = scanline; @@ -119,7 +118,7 @@ miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline, /* * now insert the edge in the right bucket */ - prev = (EdgeTableEntry *)NULL; + prev = NULL; start = pSLL->edgelist; while (start && (start->bres.minor < ETE->bres.minor)) { @@ -175,18 +174,18 @@ miCreateETandAET(int count, DDXPointPtr pts, EdgeTable *ET, EdgeTableEntry *AET, /* * initialize the Active Edge Table */ - AET->next = (EdgeTableEntry *)NULL; - AET->back = (EdgeTableEntry *)NULL; - AET->nextWETE = (EdgeTableEntry *)NULL; + AET->next = NULL; + AET->back = NULL; + AET->nextWETE = NULL; AET->bres.minor = MININT; /* * initialize the Edge Table. */ - ET->scanlines.next = (ScanLineList *)NULL; + ET->scanlines.next = NULL; ET->ymax = MININT; ET->ymin = MAXINT; - pSLLBlock->next = (ScanLineListBlock *)NULL; + pSLLBlock->next = NULL; PrevPt = &pts[count-1]; @@ -305,7 +304,7 @@ micomputeWAET(EdgeTableEntry *AET) int inside = 1; int isInside = 0; - AET->nextWETE = (EdgeTableEntry *)NULL; + AET->nextWETE = NULL; pWETE = AET; AET = AET->next; while (AET) @@ -324,7 +323,7 @@ micomputeWAET(EdgeTableEntry *AET) } AET = AET->next; } - pWETE->nextWETE = (EdgeTableEntry *)NULL; + pWETE->nextWETE = NULL; } /* diff --git a/xorg-server/mi/mipushpxl.c b/xorg-server/mi/mipushpxl.c index 4b9789047..3844519d8 100644 --- a/xorg-server/mi/mipushpxl.c +++ b/xorg-server/mi/mipushpxl.c @@ -123,7 +123,7 @@ miPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable, LONG2CHARSDIFFORDER((MiBits)(-1) >> 1); #endif - pwLineStart = (MiBits *)xalloc(BitmapBytePad(dx)); + pwLineStart = xalloc(BitmapBytePad(dx)); if (!pwLineStart) return; ipt = 0; diff --git a/xorg-server/mi/miregion.c b/xorg-server/mi/miregion.c index bbeac877b..c48befc6f 100644 --- a/xorg-server/mi/miregion.c +++ b/xorg-server/mi/miregion.c @@ -171,7 +171,7 @@ Equipment Corporation. ((r1)->y1 <= (r2)->y1) && \ ((r1)->y2 >= (r2)->y2) ) -#define xallocData(n) (RegDataPtr)xalloc(REGION_SZOF(n)) +#define xallocData(n) xalloc(REGION_SZOF(n)) #define xfreeData(reg) if ((reg)->data && (reg)->data->size) xfree((reg)->data) #define RECTALLOC_BAIL(pReg,n,bail) \ @@ -218,13 +218,13 @@ if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \ } -_X_EXPORT BoxRec miEmptyBox = {0, 0, 0, 0}; -_X_EXPORT RegDataRec miEmptyData = {0, 0}; +BoxRec miEmptyBox = {0, 0, 0, 0}; +RegDataRec miEmptyData = {0, 0}; RegDataRec miBrokenData = {0, 0}; static RegionRec miBrokenRegion = { { 0, 0, 0, 0 }, &miBrokenData }; -extern void +void InitRegions (void) { pixman_region_set_static_pointers (&miEmptyBox, &miEmptyData, &miBrokenData); @@ -236,7 +236,7 @@ InitRegions (void) * REGION of "size" number of rectangles. *****************************************************************/ -_X_EXPORT RegionPtr +RegionPtr miRegionCreate(BoxPtr rect, int size) { RegionPtr pReg; @@ -250,7 +250,7 @@ miRegionCreate(BoxPtr rect, int size) return(pReg); } -_X_EXPORT void +void miRegionDestroy(RegionPtr pReg) { pixman_region_fini (pReg); @@ -258,7 +258,7 @@ miRegionDestroy(RegionPtr pReg) xfree(pReg); } -_X_EXPORT void +void miPrintRegion(RegionPtr rgn) { int num, size; @@ -277,7 +277,7 @@ miPrintRegion(RegionPtr rgn) ErrorF("[mi] \n"); } -_X_EXPORT Bool +Bool miRegionEqual(RegionPtr reg1, RegionPtr reg2) { return pixman_region_equal (reg1, reg2); @@ -335,7 +335,7 @@ miValidRegion(RegionPtr reg) * Outer region rect is statically allocated. *****************************************************************/ -_X_EXPORT void +void miRegionInit(RegionPtr pReg, BoxPtr rect, int size) { if (rect) @@ -344,7 +344,7 @@ miRegionInit(RegionPtr pReg, BoxPtr rect, int size) pixman_region_init (pReg); } -_X_EXPORT void +void miRegionUninit(RegionPtr pReg) { pixman_region_fini (pReg); @@ -359,7 +359,7 @@ miRegionBreak (RegionPtr pReg) return FALSE; } -_X_EXPORT Bool +Bool miRectAlloc(RegionPtr pRgn, int n) { RegDataPtr data; @@ -398,7 +398,7 @@ miRectAlloc(RegionPtr pRgn, int n) return TRUE; } -_X_EXPORT Bool +Bool miRegionCopy(RegionPtr dst, RegionPtr src) { return pixman_region_copy (dst, src); @@ -654,7 +654,7 @@ miRegionOp( assert(r1 != r1End); assert(r2 != r2End); - oldData = (RegDataPtr)NULL; + oldData = NULL; if (((newReg == reg1) && (newSize > 1)) || ((newReg == reg2) && (numRects > 1))) { @@ -808,7 +808,7 @@ miRegionOp( { newReg->extents = *REGION_BOXPTR(newReg); xfreeData(newReg); - newReg->data = (RegDataPtr)NULL; + newReg->data = NULL; } else { @@ -891,7 +891,7 @@ miSetExtents (RegionPtr pReg) *----------------------------------------------------------------------- */ /*ARGSUSED*/ -_X_EXPORT Bool +Bool miIntersect( RegionPtr newReg, /* destination Region */ RegionPtr reg1, @@ -995,7 +995,7 @@ miUnionO ( return TRUE; } -_X_EXPORT Bool +Bool miUnion( RegionPtr newReg, /* destination Region */ RegionPtr reg1, @@ -1026,7 +1026,7 @@ miUnion( * dstrgn is modified if rgn has rectangles. * */ -_X_EXPORT Bool +Bool miRegionAppend(RegionPtr dstrgn, RegionPtr rgn) { int numRects, dnumRects, size; @@ -1039,7 +1039,7 @@ miRegionAppend(RegionPtr dstrgn, RegionPtr rgn) if (!rgn->data && (dstrgn->data == &miEmptyData)) { dstrgn->extents = rgn->extents; - dstrgn->data = (RegDataPtr)NULL; + dstrgn->data = NULL; return TRUE; } @@ -1210,7 +1210,7 @@ QuickSortRects( *----------------------------------------------------------------------- */ -_X_EXPORT Bool +Bool miRegionValidate(RegionPtr badreg, Bool *pOverlap) { /* Descriptor for regions under construction in Step 2. */ @@ -1343,7 +1343,7 @@ miRegionValidate(RegionPtr badreg, Bool *pOverlap) rit->prevBand = 0; rit->curBand = 0; rit->reg.extents = *box; - rit->reg.data = (RegDataPtr)NULL; + rit->reg.data = NULL; if (!miRectAlloc(&rit->reg, (i+numRI) / numRI)) /* MUST force allocation */ goto bail; NextRect: ; @@ -1362,7 +1362,7 @@ NextRect: ; if (reg->data->numRects == 1) /* keep unions happy below */ { xfreeData(reg); - reg->data = (RegDataPtr)NULL; + reg->data = NULL; } } @@ -1399,7 +1399,7 @@ bail: return miRegionBreak (badreg); } -_X_EXPORT RegionPtr +RegionPtr miRectsToRegion(int nrects, xRectangle *prect, int ctype) { @@ -1428,7 +1428,7 @@ miRectsToRegion(int nrects, xRectangle *prect, int ctype) pRgn->extents.y1 = y1; pRgn->extents.x2 = x2; pRgn->extents.y2 = y2; - pRgn->data = (RegDataPtr)NULL; + pRgn->data = NULL; } return pRgn; } @@ -1513,7 +1513,7 @@ miRectsToRegion(int nrects, xRectangle *prect, int ctype) * *----------------------------------------------------------------------- */ -_X_EXPORT Bool +Bool miSubtract(RegionPtr regD, RegionPtr regM, RegionPtr regS) { return pixman_region_subtract (regD, regM, regS); @@ -1538,7 +1538,7 @@ miSubtract(RegionPtr regD, RegionPtr regM, RegionPtr regS) * *----------------------------------------------------------------------- */ -_X_EXPORT Bool +Bool miInverse( RegionPtr newReg, /* Destination region */ RegionPtr reg1, /* Region to invert */ @@ -1547,7 +1547,7 @@ miInverse( { return pixman_region_inverse (newReg, reg1, invRect); } -_X_EXPORT int +int miRectIn(RegionPtr region, BoxPtr prect) { return pixman_region_contains_rectangle (region, prect); @@ -1557,19 +1557,19 @@ miRectIn(RegionPtr region, BoxPtr prect) translates in place */ -_X_EXPORT void +void miTranslateRegion(RegionPtr pReg, int x, int y) { pixman_region_translate (pReg, x, y); } -_X_EXPORT void +void miRegionReset(RegionPtr pReg, BoxPtr pBox) { pixman_region_reset (pReg, pBox); } -_X_EXPORT Bool +Bool miPointInRegion( RegionPtr pReg, int x, @@ -1580,7 +1580,7 @@ miPointInRegion( return pixman_region_contains_point (pReg, x, y, box); } -_X_EXPORT Bool +Bool miRegionNotEmpty(RegionPtr pReg) { return pixman_region_not_empty (pReg); @@ -1593,7 +1593,7 @@ miRegionBroken(RegionPtr pReg) return (REGION_NAR(pReg)); } -_X_EXPORT void +void miRegionEmpty(RegionPtr pReg) { good(pReg); @@ -1603,7 +1603,7 @@ miRegionEmpty(RegionPtr pReg) pReg->data = &miEmptyData; } -_X_EXPORT BoxPtr +BoxPtr miRegionExtents(RegionPtr pReg) { good(pReg); @@ -1728,7 +1728,7 @@ static void QuickSortSpans( returns the number of new, clipped scanlines. */ -_X_EXPORT int +int miClipSpans( RegionPtr prgnDst, DDXPointPtr ppt, diff --git a/xorg-server/mi/miscrinit.c b/xorg-server/mi/miscrinit.c index 28d331653..96113d65d 100644 --- a/xorg-server/mi/miscrinit.c +++ b/xorg-server/mi/miscrinit.c @@ -39,8 +39,8 @@ from The Open Group. #include "dix.h" #include "miline.h" #ifdef MITSHM -#define _XSHM_SERVER_ -#include <X11/extensions/XShm.h> +#include <X11/extensions/shm.h> +#include "shmint.h" #endif /* We use this structure to propogate some information from miScreenInit to @@ -60,7 +60,7 @@ typedef struct /* this plugs into pScreen->ModifyPixmapHeader */ -_X_EXPORT Bool +Bool miModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, pointer pPixData) { @@ -132,7 +132,7 @@ miCloseScreen (int iScreen, ScreenPtr pScreen) * possible private-requesting modules have been inited; we create the * screen pixmap here. */ -_X_EXPORT Bool +Bool miCreateScreenResources(ScreenPtr pScreen) { miScreenInitParmsPtr pScrInitParms; @@ -180,7 +180,7 @@ miScreenDevPrivateInit(ScreenPtr pScreen, int width, pointer pbits) * to the screen, until CreateScreenResources can put them in the * screen pixmap. */ - pScrInitParms = (miScreenInitParmsPtr)xalloc(sizeof(miScreenInitParmsRec)); + pScrInitParms = xalloc(sizeof(miScreenInitParmsRec)); if (!pScrInitParms) return FALSE; pScrInitParms->pbits = pbits; @@ -202,7 +202,7 @@ miSetScreenPixmap(PixmapPtr pPix) pPix->drawable.pScreen->devPrivate = (pointer)pPix; } -_X_EXPORT Bool +Bool miScreenInit( ScreenPtr pScreen, pointer pbits, /* pointer to screen bits */ @@ -297,16 +297,17 @@ static int privateKeyIndex; static DevPrivateKey privateKey = &privateKeyIndex; DevPrivateKey -miAllocateGCPrivateIndex() +miAllocateGCPrivateIndex(void) { return privateKey; } static int miZeroLineScreenKeyIndex; -_X_EXPORT DevPrivateKey miZeroLineScreenKey = &miZeroLineScreenKeyIndex; +DevPrivateKey miZeroLineScreenKey = &miZeroLineScreenKeyIndex; -_X_EXPORT void +void miSetZeroLineBias(ScreenPtr pScreen, unsigned int bias) { - dixSetPrivate(&pScreen->devPrivates, miZeroLineScreenKey, (pointer)bias); + dixSetPrivate(&pScreen->devPrivates, miZeroLineScreenKey, + (unsigned long *)(unsigned long)bias); } diff --git a/xorg-server/mi/mispans.c b/xorg-server/mi/mispans.c index e59d711ae..5504341c4 100644 --- a/xorg-server/mi/mispans.c +++ b/xorg-server/mi/mispans.c @@ -65,8 +65,7 @@ Written by Joel McCormack, Summer 1989. */ -void miInitSpanGroup(spanGroup) - SpanGroup *spanGroup; +void miInitSpanGroup(SpanGroup *spanGroup) { spanGroup->size = 0; spanGroup->count = 0; @@ -406,8 +405,8 @@ void miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup *spanGroup) ylength = spanGroup->ymax - ymin + 1; /* Allocate Spans for y buckets */ - yspans = (Spans *) xalloc(ylength * sizeof(Spans)); - ysizes = (int *) xalloc(ylength * sizeof (int)); + yspans = xalloc(ylength * sizeof(Spans)); + ysizes = xalloc(ylength * sizeof (int)); if (!yspans || !ysizes) { @@ -480,8 +479,8 @@ void miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup *spanGroup) } /* for i thorough Spans */ /* Now sort by x and uniquify each bucket into the final array */ - points = (DDXPointPtr) xalloc(count * sizeof(DDXPointRec)); - widths = (int *) xalloc(count * sizeof(int)); + points = xalloc(count * sizeof(DDXPointRec)); + widths = xalloc(count * sizeof(int)); if (!points || !widths) { int i; diff --git a/xorg-server/mi/mispans.h b/xorg-server/mi/mispans.h index 258b29279..8151415cc 100644 --- a/xorg-server/mi/mispans.h +++ b/xorg-server/mi/mispans.h @@ -45,6 +45,8 @@ SOFTWARE. ******************************************************************/ +#ifndef MISPANS_H +#define MISPANS_H typedef struct { int count; /* number of spans */ @@ -60,30 +62,30 @@ typedef struct { } SpanGroup; /* Initialize SpanGroup. MUST BE DONE before use. */ -extern void miInitSpanGroup( +extern _X_EXPORT void miInitSpanGroup( SpanGroup * /*spanGroup*/ ); /* Add a Spans to a SpanGroup. The spans MUST BE in y-sorted order */ -extern void miAppendSpans( +extern _X_EXPORT void miAppendSpans( SpanGroup * /*spanGroup*/, SpanGroup * /*otherGroup*/, Spans * /*spans*/ ); /* Paint a span group, insuring that each pixel is painted at most once */ -extern void miFillUniqueSpanGroup( +extern _X_EXPORT void miFillUniqueSpanGroup( DrawablePtr /*pDraw*/, GCPtr /*pGC*/, SpanGroup * /*spanGroup*/ ); /* Free up data in a span group. MUST BE DONE or you'll suffer memory leaks */ -extern void miFreeSpanGroup( +extern _X_EXPORT void miFreeSpanGroup( SpanGroup * /*spanGroup*/ ); -extern int miClipSpans( +extern _X_EXPORT int miClipSpans( RegionPtr /*prgnDst*/, DDXPointPtr /*ppt*/, int * /*pwidth*/, @@ -97,3 +99,4 @@ extern int miClipSpans( #define miSpansCarefulRop(rop) (((rop) & 0xc) == 0x8 || ((rop) & 0x3) == 0x2) #define miSpansEasyRop(rop) (!miSpansCarefulRop(rop)) +#endif /* MISPANS_H */ diff --git a/xorg-server/mi/misprite.c b/xorg-server/mi/misprite.c index 692e6c97a..2ec67827e 100644 --- a/xorg-server/mi/misprite.c +++ b/xorg-server/mi/misprite.c @@ -33,29 +33,106 @@ in this Software without prior written authorization from The Open Group. #include <dix-config.h> #endif -# include <X11/X.h> -# include <X11/Xproto.h> -# include "misc.h" -# include "pixmapstr.h" -# include "input.h" -# include "mi.h" -# include "cursorstr.h" -# include <X11/fonts/font.h> -# include "scrnintstr.h" -# include "colormapst.h" -# include "windowstr.h" -# include "gcstruct.h" -# include "mipointer.h" -# include "mispritest.h" -# include "dixfontstr.h" -# include <X11/fonts/fontstruct.h> -# include "inputstr.h" - -#ifdef RENDER -# include "mipict.h" -#endif -# include "damage.h" +#include <X11/X.h> +#include <X11/Xproto.h> +#include "misc.h" +#include "pixmapstr.h" +#include "input.h" +#include "mi.h" +#include "cursorstr.h" +#include <X11/fonts/font.h> +#include "scrnintstr.h" +#include "colormapst.h" +#include "windowstr.h" +#include "gcstruct.h" +#include "mipointer.h" +#include "misprite.h" +#include "dixfontstr.h" +#include <X11/fonts/fontstruct.h> +#include "inputstr.h" +#include "damage.h" + +typedef struct { + CursorPtr pCursor; + int x; /* cursor hotspot */ + int y; + BoxRec saved; /* saved area from the screen */ + Bool isUp; /* cursor in frame buffer */ + Bool shouldBeUp; /* cursor should be displayed */ + WindowPtr pCacheWin; /* window the cursor last seen in */ + Bool isInCacheWin; + Bool checkPixels; /* check colormap collision */ + ScreenPtr pScreen; +} miCursorInfoRec, *miCursorInfoPtr; + +/* + * per screen information + */ + +typedef struct { + /* screen procedures */ + CloseScreenProcPtr CloseScreen; + GetImageProcPtr GetImage; + GetSpansProcPtr GetSpans; + SourceValidateProcPtr SourceValidate; + + /* window procedures */ + CopyWindowProcPtr CopyWindow; + + /* colormap procedures */ + InstallColormapProcPtr InstallColormap; + StoreColorsProcPtr StoreColors; + + /* os layer procedures */ + ScreenBlockHandlerProcPtr BlockHandler; + + /* device cursor procedures */ + DeviceCursorInitializeProcPtr DeviceCursorInitialize; + DeviceCursorCleanupProcPtr DeviceCursorCleanup; + + xColorItem colors[2]; + ColormapPtr pInstalledMap; + ColormapPtr pColormap; + VisualPtr pVisual; + miSpriteCursorFuncPtr funcs; + DamagePtr pDamage; /* damage tracking structure */ + Bool damageRegistered; +} miSpriteScreenRec, *miSpriteScreenPtr; + +#define SOURCE_COLOR 0 +#define MASK_COLOR 1 + +/* + * Overlap BoxPtr and Box elements + */ +#define BOX_OVERLAP(pCbox,X1,Y1,X2,Y2) \ + (((pCbox)->x1 <= (X2)) && ((X1) <= (pCbox)->x2) && \ + ((pCbox)->y1 <= (Y2)) && ((Y1) <= (pCbox)->y2)) + +/* + * Overlap BoxPtr, origins, and rectangle + */ +#define ORG_OVERLAP(pCbox,xorg,yorg,x,y,w,h) \ + BOX_OVERLAP((pCbox),(x)+(xorg),(y)+(yorg),(x)+(xorg)+(w),(y)+(yorg)+(h)) + +/* + * Overlap BoxPtr, origins and RectPtr + */ +#define ORGRECT_OVERLAP(pCbox,xorg,yorg,pRect) \ + ORG_OVERLAP((pCbox),(xorg),(yorg),(pRect)->x,(pRect)->y, \ + (int)((pRect)->width), (int)((pRect)->height)) +/* + * Overlap BoxPtr and horizontal span + */ +#define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y)) +#define LINE_SORT(x1,y1,x2,y2) \ +{ int _t; \ + if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \ + if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } } + +#define LINE_OVERLAP(pCbox,x1,y1,x2,y2,lw2) \ + BOX_OVERLAP((pCbox), (x1)-(lw2), (y1)-(lw2), (x2)+(lw2), (y2)+(lw2)) #define SPRITE_DEBUG_ENABLE 0 @@ -65,29 +142,26 @@ in this Software without prior written authorization from The Open Group. #define SPRITE_DEBUG(x) #endif - #define MISPRITE(dev) \ - ((DevHasCursor(dev)) ? \ + ((!IsMaster(dev) && !dev->u.master) ? \ (miCursorInfoPtr)dixLookupPrivate(&dev->devPrivates, miSpriteDevPrivatesKey) : \ - (miCursorInfoPtr)dixLookupPrivate(&dev->u.master->devPrivates, miSpriteDevPrivatesKey)) - -static int damageRegister = 0; + (miCursorInfoPtr)dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, miSpriteDevPrivatesKey)) static void miSpriteDisableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv) { - if (damageRegister) { + if (pScreenPriv->damageRegistered) { DamageUnregister (&(pScreen->GetScreenPixmap(pScreen)->drawable), pScreenPriv->pDamage); - damageRegister = 0; + pScreenPriv->damageRegistered = 0; } } static void miSpriteEnableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv) { - if (!damageRegister) { - damageRegister = 1; + if (!pScreenPriv->damageRegistered) { + pScreenPriv->damageRegistered = 1; DamageRegister (&(pScreen->GetScreenPixmap(pScreen)->drawable), pScreenPriv->pDamage); } @@ -111,8 +185,8 @@ miSpriteIsDown(miCursorInfoPtr pDevCursor) static int miSpriteScreenKeyIndex; static DevPrivateKey miSpriteScreenKey = &miSpriteScreenKeyIndex; -static int mmiSpriteDevPrivatesKeyIndex; -static DevPrivateKey miSpriteDevPrivatesKey = &mmiSpriteDevPrivatesKeyIndex; +static int miSpriteDevPrivatesKeyIndex; +static DevPrivateKey miSpriteDevPrivatesKey = &miSpriteDevPrivatesKeyIndex; static Bool miSpriteCloseScreen(int i, ScreenPtr pScreen); static void miSpriteGetImage(DrawablePtr pDrawable, int sx, int sy, @@ -160,7 +234,7 @@ static void miSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, static void miSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y); -_X_EXPORT miPointerSpriteFuncRec miSpritePointerFuncs = { +miPointerSpriteFuncRec miSpritePointerFuncs = { miSpriteRealizeCursor, miSpriteUnrealizeCursor, miSpriteSetCursor, @@ -188,8 +262,7 @@ miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure) miCursorInfoPtr pCursorInfo; DeviceIntPtr pDev; - pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miSpriteScreenKey); + pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { @@ -199,8 +272,7 @@ miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure) if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && - RECT_IN_REGION (pScreen, pRegion, &pCursorInfo->saved) - != rgnOUT) + miRectIn(pRegion, &pCursorInfo->saved) != rgnOUT) { SPRITE_DEBUG(("Damage remove\n")); miSpriteRemoveCursor (pDev, pScreen); @@ -226,20 +298,20 @@ miSpriteInitialize (ScreenPtr pScreen, if (!DamageSetup (pScreen)) return FALSE; - pScreenPriv = (miSpriteScreenPtr) xalloc (sizeof (miSpriteScreenRec)); + pScreenPriv = xalloc (sizeof (miSpriteScreenRec)); if (!pScreenPriv) return FALSE; pScreenPriv->pDamage = DamageCreate (miSpriteReportDamage, - (DamageDestroyFunc) 0, + NULL, DamageReportRawRegion, TRUE, pScreen, - (void *) pScreen); + pScreen); if (!miPointerInitialize (pScreen, &miSpritePointerFuncs, screenFuncs,TRUE)) { - xfree ((pointer) pScreenPriv); + xfree (pScreenPriv); return FALSE; } for (pVisual = pScreen->visuals; @@ -271,6 +343,8 @@ miSpriteInitialize (ScreenPtr pScreen, pScreenPriv->colors[MASK_COLOR].red = 0; pScreenPriv->colors[MASK_COLOR].green = 0; pScreenPriv->colors[MASK_COLOR].blue = 0; + pScreenPriv->damageRegistered = 0; + dixSetPrivate(&pScreen->devPrivates, miSpriteScreenKey, pScreenPriv); pScreen->CloseScreen = miSpriteCloseScreen; @@ -284,8 +358,6 @@ miSpriteInitialize (ScreenPtr pScreen, pScreen->BlockHandler = miSpriteBlockHandler; - damageRegister = 0; - return TRUE; } @@ -303,8 +375,7 @@ miSpriteCloseScreen (int i, ScreenPtr pScreen) { miSpriteScreenPtr pScreenPriv; - pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miSpriteScreenKey); + pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); pScreen->CloseScreen = pScreenPriv->CloseScreen; pScreen->GetImage = pScreenPriv->GetImage; pScreen->GetSpans = pScreenPriv->GetSpans; @@ -315,7 +386,7 @@ miSpriteCloseScreen (int i, ScreenPtr pScreen) DamageDestroy (pScreenPriv->pDamage); - xfree ((pointer) pScreenPriv); + xfree (pScreenPriv); return (*pScreen->CloseScreen) (i, pScreen); } @@ -327,27 +398,27 @@ miSpriteGetImage (DrawablePtr pDrawable, int sx, int sy, int w, int h, { ScreenPtr pScreen = pDrawable->pScreen; miSpriteScreenPtr pScreenPriv; - DeviceIntPtr pDev = inputInfo.pointer; + DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; SCREEN_PROLOGUE (pScreen, GetImage); - pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miSpriteScreenKey); - for(pDev = inputInfo.devices; pDev; pDev = pDev->next) + if (pDrawable->type == DRAWABLE_WINDOW) { - if (DevHasCursor(pDev)) + pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,miSpriteScreenKey); + for(pDev = inputInfo.devices; pDev; pDev = pDev->next) { - pCursorInfo = MISPRITE(pDev); - if (pDrawable->type == DRAWABLE_WINDOW && - pCursorInfo->isUp && - pCursorInfo->pScreen == pScreen && - ORG_OVERLAP(&pCursorInfo->saved,pDrawable->x,pDrawable->y, - sx, sy, w, h)) - { - SPRITE_DEBUG (("GetImage remove\n")); - miSpriteRemoveCursor (pDev, pScreen); - } + if (DevHasCursor(pDev)) + { + pCursorInfo = MISPRITE(pDev); + if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && + ORG_OVERLAP(&pCursorInfo->saved,pDrawable->x,pDrawable->y, + sx, sy, w, h)) + { + SPRITE_DEBUG (("GetImage remove\n")); + miSpriteRemoveCursor (pDev, pScreen); + } + } } } @@ -363,43 +434,43 @@ miSpriteGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, { ScreenPtr pScreen = pDrawable->pScreen; miSpriteScreenPtr pScreenPriv; - DeviceIntPtr pDev = inputInfo.pointer; + DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; SCREEN_PROLOGUE (pScreen, GetSpans); - pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miSpriteScreenKey); - - for(pDev = inputInfo.devices; pDev; pDev = pDev->next) + if (pDrawable->type == DRAWABLE_WINDOW) { - if (DevHasCursor(pDev)) - { - pCursorInfo = MISPRITE(pDev); + pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,miSpriteScreenKey); - if (pDrawable->type == DRAWABLE_WINDOW && - pCursorInfo->isUp && - pCursorInfo->pScreen == pScreen) + for(pDev = inputInfo.devices; pDev; pDev = pDev->next) + { + if (DevHasCursor(pDev)) { - DDXPointPtr pts; - int *widths; - int nPts; - int xorg, - yorg; - - xorg = pDrawable->x; - yorg = pDrawable->y; - - for (pts = ppt, widths = pwidth, nPts = nspans; - nPts--; - pts++, widths++) + pCursorInfo = MISPRITE(pDev); + + if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen) { - if (SPN_OVERLAP(&pCursorInfo->saved,pts->y+yorg, - pts->x+xorg,*widths)) + DDXPointPtr pts; + int *widths; + int nPts; + int xorg, + yorg; + + xorg = pDrawable->x; + yorg = pDrawable->y; + + for (pts = ppt, widths = pwidth, nPts = nspans; + nPts--; + pts++, widths++) { - SPRITE_DEBUG (("GetSpans remove\n")); - miSpriteRemoveCursor (pDev, pScreen); - break; + if (SPN_OVERLAP(&pCursorInfo->saved,pts->y+yorg, + pts->x+xorg,*widths)) + { + SPRITE_DEBUG (("GetSpans remove\n")); + miSpriteRemoveCursor (pDev, pScreen); + break; + } } } } @@ -417,28 +488,29 @@ miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width, { ScreenPtr pScreen = pDrawable->pScreen; miSpriteScreenPtr pScreenPriv; - DeviceIntPtr pDev = inputInfo.pointer; + DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; SCREEN_PROLOGUE (pScreen, SourceValidate); - pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miSpriteScreenKey); - - for(pDev = inputInfo.devices; pDev; pDev = pDev->next) + if (pDrawable->type == DRAWABLE_WINDOW) { - if (DevHasCursor(pDev)) - { - pCursorInfo = MISPRITE(pDev); - if (pDrawable->type == DRAWABLE_WINDOW && pCursorInfo->isUp && - pCursorInfo->pScreen == pScreen && - ORG_OVERLAP(&pCursorInfo->saved, pDrawable->x, pDrawable->y, - x, y, width, height)) - { - SPRITE_DEBUG (("SourceValidate remove\n")); - miSpriteRemoveCursor (pDev, pScreen); - } - } + pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,miSpriteScreenKey); + + for(pDev = inputInfo.devices; pDev; pDev = pDev->next) + { + if (DevHasCursor(pDev)) + { + pCursorInfo = MISPRITE(pDev); + if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && + ORG_OVERLAP(&pCursorInfo->saved, pDrawable->x, pDrawable->y, + x, y, width, height)) + { + SPRITE_DEBUG (("SourceValidate remove\n")); + miSpriteRemoveCursor (pDev, pScreen); + } + } + } } if (pScreen->SourceValidate) @@ -452,13 +524,12 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { ScreenPtr pScreen = pWindow->drawable.pScreen; miSpriteScreenPtr pScreenPriv; - DeviceIntPtr pDev = inputInfo.pointer; + DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; SCREEN_PROLOGUE (pScreen, CopyWindow); - pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miSpriteScreenKey); + pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); for(pDev = inputInfo.devices; pDev; pDev = pDev->next) { @@ -469,7 +540,7 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) * Damage will take care of destination check */ if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && - RECT_IN_REGION (pScreen, prgnSrc, &pCursorInfo->saved) != rgnOUT) + miRectIn(prgnSrc, &pCursorInfo->saved) != rgnOUT) { SPRITE_DEBUG (("CopyWindow remove\n")); miSpriteRemoveCursor (pDev, pScreen); @@ -487,11 +558,10 @@ miSpriteBlockHandler (int i, pointer blockData, pointer pTimeout, { ScreenPtr pScreen = screenInfo.screens[i]; miSpriteScreenPtr pPriv; - DeviceIntPtr pDev = inputInfo.pointer; + DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; - pPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miSpriteScreenKey); + pPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); SCREEN_PROLOGUE(pScreen, BlockHandler); (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); @@ -534,8 +604,7 @@ miSpriteInstallColormap (ColormapPtr pMap) ScreenPtr pScreen = pMap->pScreen; miSpriteScreenPtr pPriv; - pPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miSpriteScreenKey); + pPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); SCREEN_PROLOGUE(pScreen, InstallColormap); (*pScreen->InstallColormap) (pMap); @@ -570,11 +639,10 @@ miSpriteStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef) int i; int updated; VisualPtr pVisual; - DeviceIntPtr pDev = inputInfo.pointer; + DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; - pPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miSpriteScreenKey); + pPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); SCREEN_PROLOGUE(pScreen, StoreColors); (*pScreen->StoreColors) (pMap, ndef, pdef); @@ -649,7 +717,7 @@ miSpriteStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef) static void miSpriteFindColors (miCursorInfoPtr pDevCursor, ScreenPtr pScreen) { - miSpriteScreenPtr pScreenPriv = (miSpriteScreenPtr) + miSpriteScreenPtr pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); CursorPtr pCursor; xColorItem *sourceColor, *maskColor; @@ -695,9 +763,8 @@ miSpriteRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) miSpriteScreenPtr pScreenPriv; miCursorInfoPtr pCursorInfo; - pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miSpriteScreenKey); - if (!pDev->isMaster && !pDev->u.master) + pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); + if (!IsMaster(pDev) && !pDev->u.master) { ErrorF("[mi] miSpriteRealizeCursor called for floating device.\n"); return FALSE; @@ -715,8 +782,7 @@ miSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { miSpriteScreenPtr pScreenPriv; - pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miSpriteScreenKey); + pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); return (*pScreenPriv->funcs->UnrealizeCursor) (pScreen, pCursor); } @@ -725,12 +791,11 @@ miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y) { miSpriteScreenPtr pScreenPriv; - - pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miSpriteScreenKey); miCursorInfoPtr pPointer; - if (!pDev->isMaster && !pDev->u.master) + pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); + + if (!IsMaster(pDev) && !pDev->u.master) { ErrorF("[mi] miSpriteSetCursor called for floating device.\n"); return; @@ -846,9 +911,8 @@ miSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) miSpriteScreenPtr pScreenPriv; CursorPtr pCursor; - pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miSpriteScreenKey); - if (!pDev->isMaster && !pDev->u.master) + pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); + if (!IsMaster(pDev) && !pDev->u.master) { ErrorF("[mi] miSpriteMoveCursor called for floating device.\n"); return; @@ -866,8 +930,7 @@ miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) miCursorInfoPtr pCursorInfo; int ret = FALSE; - pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miSpriteScreenKey); + pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); pCursorInfo = xalloc(sizeof(miCursorInfoRec)); if (!pCursorInfo) @@ -899,8 +962,8 @@ miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) if (DevHasCursor(pDev)) { miSpriteScreenPtr pScreenPriv; - pScreenPriv = (miSpriteScreenPtr) - dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); + pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, + miSpriteScreenKey); (*pScreenPriv->funcs->DeviceCursorCleanup)(pDev, pScreen); } @@ -917,14 +980,13 @@ miSpriteRemoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen) miCursorInfoPtr pCursorInfo; - if (!pDev->isMaster && !pDev->u.master) + if (!IsMaster(pDev) && !pDev->u.master) { ErrorF("[mi] miSpriteRemoveCursor called for floating device.\n"); return; } DamageDrawInternal (pScreen, TRUE); - pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miSpriteScreenKey); + pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); pCursorInfo = MISPRITE(pDev); miSpriteIsDown(pCursorInfo); @@ -958,14 +1020,13 @@ miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen) CursorPtr pCursor; miCursorInfoPtr pCursorInfo; - if (!pDev->isMaster && !pDev->u.master) + if (!IsMaster(pDev) && !pDev->u.master) { ErrorF("[mi] miSpriteSaveUnderCursor called for floating device.\n"); return; } DamageDrawInternal (pScreen, TRUE); - pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miSpriteScreenKey); + pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); pCursorInfo = MISPRITE(pDev); miSpriteComputeSaved (pDev, pScreen); @@ -1002,15 +1063,14 @@ miSpriteRestoreCursor (DeviceIntPtr pDev, ScreenPtr pScreen) CursorPtr pCursor; miCursorInfoPtr pCursorInfo; - if (!pDev->isMaster && !pDev->u.master) + if (!IsMaster(pDev) && !pDev->u.master) { ErrorF("[mi] miSpriteRestoreCursor called for floating device.\n"); return; } DamageDrawInternal (pScreen, TRUE); - pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miSpriteScreenKey); + pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); pCursorInfo = MISPRITE(pDev); miSpriteComputeSaved (pDev, pScreen); @@ -1047,13 +1107,12 @@ miSpriteComputeSaved (DeviceIntPtr pDev, ScreenPtr pScreen) CursorPtr pCursor; miCursorInfoPtr pCursorInfo; - if (!pDev->isMaster && !pDev->u.master) + if (!IsMaster(pDev) && !pDev->u.master) { ErrorF("[mi] miSpriteComputeSaved called for floating device.\n"); return; } - pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miSpriteScreenKey); + pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); pCursorInfo = MISPRITE(pDev); pCursor = pCursorInfo->pCursor; diff --git a/xorg-server/mi/mivaltree.c b/xorg-server/mi/mivaltree.c index 2585422bc..cfcdab756 100644 --- a/xorg-server/mi/mivaltree.c +++ b/xorg-server/mi/mivaltree.c @@ -769,7 +769,7 @@ miValidateTree ( if (pScreen->ClipNotify) (* pScreen->ClipNotify) (pWin, 0, 0); REGION_EMPTY( pScreen, &pWin->borderClip); - pWin->valdata = (ValidatePtr)NULL; + pWin->valdata = NULL; } } } diff --git a/xorg-server/mi/miwideline.c b/xorg-server/mi/miwideline.c index 40f0d3e49..210a6251e 100644 --- a/xorg-server/mi/miwideline.c +++ b/xorg-server/mi/miwideline.c @@ -95,10 +95,10 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, if (!spanData) { - pptInit = (DDXPointPtr) xalloc (overall_height * sizeof(*ppt)); + pptInit = xalloc (overall_height * sizeof(*ppt)); if (!pptInit) return; - pwidthInit = (int *) xalloc (overall_height * sizeof(*pwidth)); + pwidthInit = xalloc (overall_height * sizeof(*pwidth)); if (!pwidthInit) { xfree (pptInit); @@ -116,10 +116,10 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, } else { - spanRec.points = (DDXPointPtr) xalloc (overall_height * sizeof (*ppt)); + spanRec.points = xalloc (overall_height * sizeof (*ppt)); if (!spanRec.points) return; - spanRec.widths = (int *) xalloc (overall_height * sizeof (int)); + spanRec.widths = xalloc (overall_height * sizeof (int)); if (!spanRec.widths) { xfree (spanRec.points); @@ -221,10 +221,10 @@ miFillRectPolyHelper ( } else { - spanRec.points = (DDXPointPtr) xalloc (h * sizeof (*ppt)); + spanRec.points = xalloc (h * sizeof (*ppt)); if (!spanRec.points) return; - spanRec.widths = (int *) xalloc (h * sizeof (int)); + spanRec.widths = xalloc (h * sizeof (int)); if (!spanRec.widths) { xfree (spanRec.points); @@ -251,7 +251,7 @@ miFillRectPolyHelper ( } } -_X_EXPORT /* static */ int +/* static */ int miPolyBuildEdge ( double x0, double y0, @@ -313,7 +313,7 @@ miPolyBuildEdge ( #define StepAround(v, incr, max) (((v) + (incr) < 0) ? (max - 1) : ((v) + (incr) == max) ? 0 : ((v) + (incr))) -_X_EXPORT /* static */ int +/* static */ int miPolyBuildPoly ( PolyVertexPtr vertices, PolySlopePtr slopes, @@ -915,7 +915,7 @@ miRoundJoinFace (LineFacePtr face, PolyEdgePtr edge, Bool *leftEdge) return y; } -_X_EXPORT void +void miRoundJoinClip (LineFacePtr pLeft, LineFacePtr pRight, PolyEdgePtr edge1, PolyEdgePtr edge2, int *y1, int *y2, Bool *left1, Bool *left2) @@ -938,7 +938,7 @@ miRoundJoinClip (LineFacePtr pLeft, LineFacePtr pRight, *y2 = miRoundJoinFace (pRight, edge2, left2); } -_X_EXPORT int +int miRoundCapClip (LineFacePtr face, Bool isInt, PolyEdgePtr edge, Bool *leftEdge) { int y; @@ -1045,10 +1045,10 @@ miLineArc ( } if (!spanData) { - points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * pGC->lineWidth); + points = xalloc(sizeof(DDXPointRec) * pGC->lineWidth); if (!points) return; - widths = (int *)xalloc(sizeof(int) * pGC->lineWidth); + widths = xalloc(sizeof(int) * pGC->lineWidth); if (!widths) { xfree(points); @@ -1064,10 +1064,10 @@ miLineArc ( } else { - points = (DDXPointPtr) xalloc (pGC->lineWidth * sizeof (DDXPointRec)); + points = xalloc (pGC->lineWidth * sizeof (DDXPointRec)); if (!points) return; - widths = (int *) xalloc (pGC->lineWidth * sizeof (int)); + widths = xalloc (pGC->lineWidth * sizeof (int)); if (!widths) { xfree (points); @@ -1524,7 +1524,7 @@ miCleanupSpanData (DrawablePtr pDrawable, GCPtr pGC, SpanDataPtr spanData) miFreeSpanGroup (&spanData->fgGroup); } -_X_EXPORT void +void miWideLine (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr pPts) { @@ -2018,7 +2018,7 @@ miWideDashSegment ( *pDashOffset = pDash[dashIndex] - dashRemain; } -_X_EXPORT void +void miWideDash (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr pPts) { diff --git a/xorg-server/mi/miwideline.h b/xorg-server/mi/miwideline.h index 9d1aa03cb..1f615d689 100644 --- a/xorg-server/mi/miwideline.h +++ b/xorg-server/mi/miwideline.h @@ -153,7 +153,7 @@ typedef struct _LineFace { } \ } -extern void miRoundJoinClip( +extern _X_EXPORT void miRoundJoinClip( LineFacePtr /*pLeft*/, LineFacePtr /*pRight*/, PolyEdgePtr /*edge1*/, @@ -164,16 +164,16 @@ extern void miRoundJoinClip( Bool * /*left2*/ ); -extern int miRoundCapClip( +extern _X_EXPORT int miRoundCapClip( LineFacePtr /*face*/, Bool /*isInt*/, PolyEdgePtr /*edge*/, Bool * /*leftEdge*/ ); -extern int miPolyBuildEdge(double x0, double y0, double k, int dx, int dy, +extern _X_EXPORT int miPolyBuildEdge(double x0, double y0, double k, int dx, int dy, int xi, int yi, int left, PolyEdgePtr edge); -extern int miPolyBuildPoly(PolyVertexPtr vertices, PolySlopePtr slopes, +extern _X_EXPORT int miPolyBuildPoly(PolyVertexPtr vertices, PolySlopePtr slopes, int count, int xi, int yi, PolyEdgePtr left, PolyEdgePtr right, int *pnleft, int *pnright, int *h); diff --git a/xorg-server/mi/miwindow.c b/xorg-server/mi/miwindow.c index 498c8a656..31c028482 100644 --- a/xorg-server/mi/miwindow.c +++ b/xorg-server/mi/miwindow.c @@ -57,7 +57,7 @@ SOFTWARE. #include "pixmapstr.h" #include "mivalidate.h" -_X_EXPORT void +void miClearToBackground(WindowPtr pWin, int x, int y, int w, int h, Bool generateExposures) @@ -245,7 +245,7 @@ miHandleValidateExposures(WindowPtr pWin) (*WindowExposures)(pChild, &val->after.exposed, NullRegion); REGION_UNINIT(pScreen, &val->after.exposed); xfree(val); - pChild->valdata = (ValidatePtr)NULL; + pChild->valdata = NULL; if (pChild->firstChild) { pChild = pChild->firstChild; @@ -305,10 +305,10 @@ miMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pNextSib, VTKind kind) { if (pLayerWin == pWin) anyMarked |= (*pScreen->MarkOverlappedWindows) - (pWin, windowToValidate, (WindowPtr *)NULL); + (pWin, windowToValidate, NULL); else anyMarked |= (*pScreen->MarkOverlappedWindows) - (pWin, pLayerWin, (WindowPtr *)NULL); + (pWin, pLayerWin, NULL); if (anyMarked) @@ -500,10 +500,10 @@ miSlideAndSizeWindow(WindowPtr pWin, if (pLayerWin == pWin) anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange, - (WindowPtr *)NULL); + NULL); else anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pLayerWin, - (WindowPtr *)NULL); + NULL); if (pWin->valdata) { @@ -729,7 +729,7 @@ miSetShape(WindowPtr pWin) if (WasViewable) { anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin, - (WindowPtr *)NULL); + NULL); if (anyMarked) @@ -816,7 +816,7 @@ miMarkUnrealizedWindow(WindowPtr pChild, WindowPtr pWin, Bool fromConfigure) } } -_X_EXPORT void +void miSegregateChildren(WindowPtr pWin, RegionPtr pReg, int depth) { ScreenPtr pScreen; diff --git a/xorg-server/mi/mizerarc.c b/xorg-server/mi/mizerarc.c index d3cc1958c..ad84c0123 100644 --- a/xorg-server/mi/mizerarc.c +++ b/xorg-server/mi/mizerarc.c @@ -95,7 +95,7 @@ static miZeroArcPtRec oob = {65536, 65536, 0}; * */ -_X_EXPORT Bool +Bool miZeroArcSetup(xArc *arc, miZeroArcRec *info, Bool ok360) { int l; @@ -702,14 +702,14 @@ miZeroArcDashPts( dinfo->dashOffset = pGC->dash[dinfo->dashIndex] - dashRemaining; } -_X_EXPORT void +void miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs) { int maxPts = 0; int n, maxw = 0; xArc *arc; int i; - DDXPointPtr points, pts, oddPts; + DDXPointPtr points, pts, oddPts = NULL; DDXPointPtr pt; int numPts; Bool dospans; @@ -737,7 +737,7 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs) dospans = (pGC->fillStyle != FillSolid); if (dospans) { - widths = (int *)xalloc(sizeof(int) * numPts); + widths = xalloc(sizeof(int) * numPts); if (!widths) return; maxw = 0; @@ -754,7 +754,7 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs) (unsigned char *) pGC->dash, (int)pGC->numInDashList, &dinfo.dashOffsetInit); } - points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * numPts); + points = xalloc(sizeof(DDXPointRec) * numPts); if (!points) { if (dospans) diff --git a/xorg-server/mi/mizerarc.h b/xorg-server/mi/mizerarc.h index 28ebbe030..1612a525b 100644 --- a/xorg-server/mi/mizerarc.h +++ b/xorg-server/mi/mizerarc.h @@ -119,7 +119,7 @@ typedef struct { /* mizerarc.c */ -extern Bool miZeroArcSetup( +extern _X_EXPORT Bool miZeroArcSetup( xArc * /*arc*/, miZeroArcRec * /*info*/, Bool /*ok360*/ diff --git a/xorg-server/mi/mizerclip.c b/xorg-server/mi/mizerclip.c index dd05040bc..fb1e25fe4 100644 --- a/xorg-server/mi/mizerclip.c +++ b/xorg-server/mi/mizerclip.c @@ -404,7 +404,7 @@ the numerator is therefore (2^32 - 1), which does not overflow an unsigned * -1 for completely clipped line * */ -_X_EXPORT int +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, diff --git a/xorg-server/mi/mizerline.c b/xorg-server/mi/mizerline.c index a415d73da..46e2e2adc 100644 --- a/xorg-server/mi/mizerline.c +++ b/xorg-server/mi/mizerline.c @@ -97,7 +97,7 @@ SOFTWARE. }\ } -_X_EXPORT void +void miZeroLine( DrawablePtr pDraw, GCPtr pGC, @@ -155,8 +155,8 @@ miZeroLine( width = xright - xleft + 1; height = ybottom - ytop + 1; list_len = (height >= width) ? height : width; - pspanInit = (DDXPointPtr)xalloc(list_len * sizeof(DDXPointRec)); - pwidthInit = (int *)xalloc(list_len * sizeof(int)); + pspanInit = xalloc(list_len * sizeof(DDXPointRec)); + pwidthInit = xalloc(list_len * sizeof(int)); if (!pspanInit || !pwidthInit) return; |