diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2012-03-07 21:02:41 -0800 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2012-03-07 21:02:41 -0800 |
commit | 1986fcc6afee53bf43bad1ee3f841c344a5c8e70 (patch) | |
tree | 02a643d314bb0f040108595238ee65cb34a4a942 /xorg | |
parent | 5b40f518c187e172658e91c42eef713312485a79 (diff) | |
download | xrdp-proprietary-1986fcc6afee53bf43bad1ee3f841c344a5c8e70.tar.gz xrdp-proprietary-1986fcc6afee53bf43bad1ee3f841c344a5c8e70.zip |
xrdp:X11R7.6: work on building X11rdp
Diffstat (limited to 'xorg')
-rwxr-xr-x | xorg/X11R7.6/buildx.sh | 23 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/Makefile | 50 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdp.h | 26 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpdraw.c | 355 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpinput.c | 95 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpmain.c | 69 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpup.c | 21 |
7 files changed, 310 insertions, 329 deletions
diff --git a/xorg/X11R7.6/buildx.sh b/xorg/X11R7.6/buildx.sh index deeae127..40a44f64 100755 --- a/xorg/X11R7.6/buildx.sh +++ b/xorg/X11R7.6/buildx.sh @@ -21,6 +21,7 @@ # flex bison libxml2-dev intltool # xsltproc +# xutils-dev python-libxml2 download_file() { @@ -193,6 +194,7 @@ make_it() patch -p1 < ../../$mod_name.patch fi # now configure + echo "executing ./configure --prefix=$PREFIX_DIR $mod_args" ./configure --prefix=$PREFIX_DIR $mod_args if [ $? -ne 0 ]; then echo "configuration failed for module $mn" @@ -277,8 +279,11 @@ fi echo "using $PREFIX_DIR" export PKG_CONFIG_PATH=$PREFIX_DIR/lib/pkgconfig:$PREFIX_DIR/share/pkgconfig -export PATH=$PREFIX_DIR/bin:$PATH -export LD_LIBRARY_PATH=$PREFIX_DIR/lib + +# using this seems to cause more trouble than good +#export PATH=$PREFIX_DIR/bin:$PATH +#export LD_LIBRARY_PATH=$PREFIX_DIR/lib + # really only needed for x84 export CFLAGS=-fPIC @@ -335,4 +340,18 @@ do done < $data_file +echo "build for X OK" + +X11RDPBASE=$PREFIX_DIR +export X11RDPBASE + +cd rdp +make +if [ $? -ne 0 ]; then + echo "" + echo "X11rdp make failed" + echo "" + exit 1 +fi + echo "All done" diff --git a/xorg/X11R7.6/rdp/Makefile b/xorg/X11R7.6/rdp/Makefile index fca19322..c373d91e 100644 --- a/xorg/X11R7.6/rdp/Makefile +++ b/xorg/X11R7.6/rdp/Makefile @@ -4,28 +4,30 @@ INCBASE = $(X11RDPBASE)/include LIBBASE = $(X11RDPBASE)/lib -OBJS = rdpmain.o rdpdraw.o rdpinput.o rdpmisc.o rdpup.o miinitext.o fbcmap.o - -LIBS = ../../dbe/.libs/libdbe.a \ - ../../dix/.libs/libdix.a \ - ../../fb/.libs/libfb.a \ - ../../mfb/.libs/libmfb.a \ - ../../mi/.libs/libmi.a \ - ../../os/.libs/libos.a \ - ../../randr/.libs/librandr.a \ - ../../record/.libs/librecord.a \ - ../../render/.libs/librender.a \ - ../../xkb/.libs/libxkb.a \ - ../../XTrap/.libs/libxtrap.a \ - ../../Xext/.libs/libXext.a \ - ../../Xi/.libs/libXi.a \ - ../../GL/glx/.libs/libglx.a \ - ../../GL/mesa/.libs/libGLcore.a \ - ../../xfixes/.libs/libxfixes.a \ +XSRCBASE = ../build_dir/xorg-server-1.9.3 + +OBJS = rdpmain.o rdpdraw.o rdpinput.o rdpmisc.o rdpup.o miinitext.o + +# fbcmap.o + +LIBS = $(XSRCBASE)/dbe/.libs/libdbe.a \ + $(XSRCBASE)/dix/.libs/libdix.a \ + $(XSRCBASE)/dix/.libs/libmain.a \ + $(XSRCBASE)/fb/.libs/libfb.a \ + $(XSRCBASE)/mi/.libs/libmi.a \ + $(XSRCBASE)/os/.libs/libos.a \ + $(XSRCBASE)/randr/.libs/librandr.a \ + $(XSRCBASE)/record/.libs/librecord.a \ + $(XSRCBASE)/render/.libs/librender.a \ + $(XSRCBASE)/xkb/.libs/libxkb.a \ + $(XSRCBASE)/Xext/.libs/libXext.a \ + $(XSRCBASE)/Xi/.libs/libXi.a \ + $(XSRCBASE)/glx/.libs/libglx.a \ + $(XSRCBASE)/xfixes/.libs/libxfixes.a \ librdp.a \ - -lfreetype -lz -lm -lXfont -lXau -lXdmcp + -lfreetype -lz -lm -lXfont -lXau -lXdmcp -lpixman-1 -CFLAGS = -O2 -fno-strength-reduce \ +CFLAGS = -O2 -Wall -fno-strength-reduce \ -I../../include \ -I../../cfb \ -I../../mfb \ @@ -80,8 +82,8 @@ X11rdp: $(OBJS) clean: rm -f $(OBJS) librdp.a -miinitext.o: ../../mi/miinitext.c - $(CC) $(CFLAGS) -c ../../mi/miinitext.c +miinitext.o: ../build_dir/xorg-server-1.9.3/mi/miinitext.c + $(CC) $(CFLAGS) -I../build_dir/xorg-server-1.9.3/Xext -c ../build_dir/xorg-server-1.9.3/mi/miinitext.c -fbcmap.o: ../../fb/fbcmap.c - $(CC) $(CFLAGS) -c ../../fb/fbcmap.c +#fbcmap.o: ../../fb/fbcmap.c +# $(CC) $(CFLAGS) -c ../../fb/fbcmap.c diff --git a/xorg/X11R7.6/rdp/rdp.h b/xorg/X11R7.6/rdp/rdp.h index ee68d511..cb489834 100644 --- a/xorg/X11R7.6/rdp/rdp.h +++ b/xorg/X11R7.6/rdp/rdp.h @@ -41,7 +41,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "scrnintstr.h" #include "servermd.h" #define PSZ 8 + //#include "cfb.h" + #include "mibstore.h" #include "colormapst.h" #include "gcstruct.h" @@ -59,6 +61,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "XKBstr.h" #include "inputstr.h" #include "randrstr.h" +#include "mi.h" +#include "fb.h" +#include "micmap.h" +#include "events.h" /* test to see if this is xorg source or xfree86 */ #ifdef XORGSERVER @@ -101,8 +107,10 @@ struct _rdpScreenInfoRec CreatePixmapProcPtr CreatePixmap; DestroyPixmapProcPtr DestroyPixmap; /* Window Procedures */ - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; + + //PaintWindowBackgroundProcPtr PaintWindowBackground; + //PaintWindowBorderProcPtr PaintWindowBorder; + CopyWindowProcPtr CopyWindow; ClearToBackgroundProcPtr ClearToBackground; ScreenWakeupHandlerProcPtr WakeupHandler; @@ -175,7 +183,8 @@ g_tcp_listen(int sck); Bool rdpCloseScreen(int i, ScreenPtr pScreen); PixmapPtr -rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth); +rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, + unsigned usage_hint); Bool rdpDestroyPixmap(PixmapPtr pPixmap); Bool @@ -235,13 +244,14 @@ rdpCursorOffScreen(ScreenPtr* ppScreen, int* x, int* y); void rdpCrossScreen(ScreenPtr pScreen, Bool entering); Bool -rdpSpriteRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor); +rdpSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs); Bool -rdpSpriteUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor); +rdpSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs); void -rdpSpriteSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y); +rdpSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs, + int x, int y); void -rdpSpriteMoveCursor(ScreenPtr pScreen, int x, int y); +rdpSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScr, int x, int y); void PtrAddEvent(int buttonMask, int x, int y); void @@ -282,6 +292,8 @@ int rdpup_draw_line(short x1, short y1, short x2, short y2); void rdpup_send_area(int x, int y, int w, int h); +int +rdpup_set_cursor(short x, short y, char* cur_data, char* cur_mask); #if defined(X_BYTE_ORDER) # if X_BYTE_ORDER == X_LITTLE_ENDIAN diff --git a/xorg/X11R7.6/rdp/rdpdraw.c b/xorg/X11R7.6/rdp/rdpdraw.c index e209b1c4..7aacebb5 100644 --- a/xorg/X11R7.6/rdp/rdpdraw.c +++ b/xorg/X11R7.6/rdp/rdpdraw.c @@ -33,7 +33,7 @@ Xserver drawing ops and funcs #endif extern rdpScreenInfoRec g_rdpScreen; /* from rdpmain.c */ -extern int g_rdpGCIndex; /* from rdpmain.c */ +extern DevPrivateKeyRec g_rdpGCIndex; /* from rdpmain.c */ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ @@ -80,21 +80,21 @@ rdp_get_clip(RegionPtr pRegion, DrawablePtr pDrawable, GCPtr pGC) { temp = &pWindow->clipList; } - if (miRegionNotEmpty(temp)) + if (RegionNotEmpty(temp)) { switch (pGC->clientClipType) { case CT_NONE: rv = 2; - miRegionCopy(pRegion, temp); + RegionCopy(pRegion, temp); break; case CT_REGION: rv = 2; - miRegionCopy(pRegion, pGC->clientClip); - miTranslateRegion(pRegion, - pDrawable->x + pGC->clipOrg.x, - pDrawable->y + pGC->clipOrg.y); - miIntersect(pRegion, pRegion, temp); + RegionCopy(pRegion, pGC->clientClip); + RegionTranslate(pRegion, + pDrawable->x + pGC->clipOrg.x, + pDrawable->y + pGC->clipOrg.y); + RegionIntersect(pRegion, pRegion, temp); break; default: rdpLog("unimp clip type %d\n", pGC->clientClipType); @@ -106,7 +106,7 @@ rdp_get_clip(RegionPtr pRegion, DrawablePtr pDrawable, GCPtr pGC) box.y1 = 0; box.x2 = g_rdpScreen.width; box.y2 = g_rdpScreen.height; - if (miRectIn(pRegion, &box) == rgnIN) + if (RegionContainsRect(pRegion, &box) == rgnIN) { rv = 1; } @@ -164,7 +164,7 @@ GetTextBoundingBox(DrawablePtr pDrawable, FontPtr font, int x, int y, /******************************************************************************/ #define GC_FUNC_PROLOGUE(_pGC) \ { \ - priv = (rdpGCPtr)(_pGC->devPrivates[g_rdpGCIndex].ptr); \ + priv = (rdpGCPtr)(dixGetPrivateAddr(&(_pGC->devPrivates), &g_rdpGCIndex)); \ (_pGC)->funcs = priv->funcs; \ if (priv->ops != 0) \ { \ @@ -206,7 +206,7 @@ rdpValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr d) { pRegion = &(((WindowPtr)d)->clipList); } - viewable = miRegionNotEmpty(pRegion); + viewable = RegionNotEmpty(pRegion); } priv->ops = 0; if (viewable) @@ -291,7 +291,7 @@ rdpCopyClip(GCPtr dst, GCPtr src) /******************************************************************************/ #define GC_OP_PROLOGUE(_pGC) \ { \ - priv = (rdpGCPtr)pGC->devPrivates[g_rdpGCIndex].ptr; \ + priv = (rdpGCPtr)dixGetPrivateAddr(&(pGC->devPrivates), &g_rdpGCIndex); \ oldFuncs = _pGC->funcs; \ (_pGC)->funcs = priv->funcs; \ (_pGC)->ops = priv->ops; \ @@ -320,12 +320,12 @@ rdpFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nInit, DEBUG_OUT_OPS(("in rdpFillSpans\n")); GC_OP_PROLOGUE(pGC) pGC->ops->FillSpans(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted); - miRegionInit(&clip_reg, NullBox, 0); + RegionInit(&clip_reg, NullBox, 0); cd = rdp_get_clip(&clip_reg, pDrawable, pGC); if (cd == 1) { rdpup_begin_update(); - miRegionCopy(&clip_reg, &(((WindowPtr)pDrawable)->borderClip)); + RegionCopy(&clip_reg, &(((WindowPtr)pDrawable)->borderClip)); for (j = REGION_NUM_RECTS(&clip_reg) - 1; j >= 0; j--) { box = REGION_RECTS(&clip_reg)[j]; @@ -336,8 +336,8 @@ rdpFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nInit, else if (cd == 2) { rdpup_begin_update(); - miIntersect(&clip_reg, &clip_reg, - &(((WindowPtr)pDrawable)->borderClip)); + RegionIntersect(&clip_reg, &clip_reg, + &(((WindowPtr)pDrawable)->borderClip)); for (j = REGION_NUM_RECTS(&clip_reg) - 1; j >= 0; j--) { box = REGION_RECTS(&clip_reg)[j]; @@ -345,7 +345,7 @@ rdpFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nInit, } rdpup_end_update(); } - miRegionUninit(&clip_reg); + RegionUninit(&clip_reg); GC_OP_EPILOGUE(pGC); } @@ -364,12 +364,12 @@ rdpSetSpans(DrawablePtr pDrawable, GCPtr pGC, char* psrc, DEBUG_OUT_OPS(("in rdpSetSpans\n")); GC_OP_PROLOGUE(pGC); pGC->ops->SetSpans(pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted); - miRegionInit(&clip_reg, NullBox, 0); + RegionInit(&clip_reg, NullBox, 0); cd = rdp_get_clip(&clip_reg, pDrawable, pGC); if (cd == 1) { rdpup_begin_update(); - miRegionCopy(&clip_reg, &(((WindowPtr)pDrawable)->borderClip)); + RegionCopy(&clip_reg, &(((WindowPtr)pDrawable)->borderClip)); for (j = REGION_NUM_RECTS(&clip_reg) - 1; j >= 0; j--) { box = REGION_RECTS(&clip_reg)[j]; @@ -380,8 +380,8 @@ rdpSetSpans(DrawablePtr pDrawable, GCPtr pGC, char* psrc, else if (cd == 2) { rdpup_begin_update(); - miIntersect(&clip_reg, &clip_reg, - &((WindowPtr)pDrawable)->borderClip); + RegionIntersect(&clip_reg, &clip_reg, + &((WindowPtr)pDrawable)->borderClip); for (j = REGION_NUM_RECTS(&clip_reg) - 1; j >= 0; j--) { box = REGION_RECTS(&clip_reg)[j]; @@ -389,7 +389,7 @@ rdpSetSpans(DrawablePtr pDrawable, GCPtr pGC, char* psrc, } rdpup_end_update(); } - miRegionUninit(&clip_reg); + RegionUninit(&clip_reg); GC_OP_EPILOGUE(pGC); } @@ -409,7 +409,7 @@ rdpPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, GC_OP_PROLOGUE(pGC); pGC->ops->PutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, pBits); - miRegionInit(&clip_reg, NullBox, 0); + RegionInit(&clip_reg, NullBox, 0); cd = rdp_get_clip(&clip_reg, pDrawable, pGC); if (cd == 1) { @@ -429,7 +429,7 @@ rdpPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, rdpup_reset_clip(); rdpup_end_update(); } - miRegionUninit(&clip_reg); + RegionUninit(&clip_reg); GC_OP_EPILOGUE(pGC); } @@ -455,7 +455,7 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, DEBUG_OUT_OPS(("in rdpCopyArea\n")); GC_OP_PROLOGUE(pGC); rv = pGC->ops->CopyArea(pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty); - miRegionInit(&clip_reg, NullBox, 0); + RegionInit(&clip_reg, NullBox, 0); cd = rdp_get_clip(&clip_reg, pDst, pGC); can_do_screen_blt = pSrc->type == DRAWABLE_WINDOW && ((WindowPtr)pSrc)->viewable && @@ -512,8 +512,8 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, box.y1 = pDst->y + dsty; box.x2 = box.x1 + w; box.y2 = box.y1 + h; - miRegionInit(&box_reg, &box, 0); - miIntersect(&clip_reg, &clip_reg, &box_reg); + RegionInit(&box_reg, &box, 0); + RegionIntersect(&clip_reg, &clip_reg, &box_reg); num_clips = REGION_NUM_RECTS(&clip_reg); if (num_clips < 10) { @@ -525,16 +525,16 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, } else { - pbox = miRegionExtents(&clip_reg); + pbox = RegionExtents(&clip_reg); rdpup_send_area(pbox->x1, pbox->y1, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1); } - miRegionUninit(&box_reg); + RegionUninit(&box_reg); } rdpup_end_update(); } } - miRegionUninit(&clip_reg); + RegionUninit(&clip_reg); GC_OP_EPILOGUE(pGC); return rv; } @@ -555,7 +555,7 @@ rdpCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GC_OP_PROLOGUE(pGC); rv = pGC->ops->CopyPlane(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, bitPlane); - miRegionInit(®, NullBox, 0); + RegionInit(®, NullBox, 0); cd = rdp_get_clip(®, pDstDrawable, pGC); if (cd == 1) { @@ -563,7 +563,7 @@ rdpCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, else if (cd == 2) { } - miRegionUninit(®); + RegionUninit(®); GC_OP_EPILOGUE(pGC); return rv; } @@ -630,7 +630,7 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, /* todo, use this total_box */ } pGC->ops->PolyPoint(pDrawable, pGC, mode, npt, in_pts); - miRegionInit(&clip_reg, NullBox, 0); + RegionInit(&clip_reg, NullBox, 0); cd = rdp_get_clip(&clip_reg, pDrawable, pGC); if (cd == 1) { @@ -669,7 +669,7 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, rdpup_end_update(); } } - miRegionUninit(&clip_reg); + RegionUninit(&clip_reg); if (pts != stack_pts) { g_free(pts); @@ -708,7 +708,7 @@ rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, } } pGC->ops->Polylines(pDrawable, pGC, mode, npt, pptInit); - miRegionInit(&clip_reg, NullBox, 0); + RegionInit(&clip_reg, NullBox, 0); cd = rdp_get_clip(&clip_reg, pDrawable, pGC); if (cd == 1) { @@ -777,7 +777,7 @@ rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, rdpup_end_update(); } } - miRegionUninit(&clip_reg); + RegionUninit(&clip_reg); g_free(ppts); GC_OP_EPILOGUE(pGC); } @@ -810,7 +810,7 @@ rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment* pSegs) } } pGC->ops->PolySegment(pDrawable, pGC, nseg, pSegs); - miRegionInit(&clip_reg, NullBox, 0); + RegionInit(&clip_reg, NullBox, 0); cd = rdp_get_clip(&clip_reg, pDrawable, pGC); if (cd == 1) /* no clip */ { @@ -851,7 +851,7 @@ rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment* pSegs) } } g_free(segs); - miRegionUninit(&clip_reg); + RegionUninit(&clip_reg); GC_OP_EPILOGUE(pGC); } @@ -886,7 +886,7 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects, rect1[i] = rects[i]; } pGC->ops->PolyRectangle(pDrawable, pGC, nrects, rects); - miRegionInit(&clip_reg, NullBox, 0); + RegionInit(&clip_reg, NullBox, 0); cd = rdp_get_clip(&clip_reg, pDrawable, pGC); regRects = 0; if (cd != 0 && nrects > 0) @@ -954,8 +954,8 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects, { if (regRects != 0) { - fill_reg = miRectsToRegion(nrects * 4, regRects, CT_NONE); - miIntersect(&clip_reg, &clip_reg, fill_reg); + fill_reg = RegionFromRects(nrects * 4, regRects, CT_NONE); + RegionIntersect(&clip_reg, &clip_reg, fill_reg); num_clips = REGION_NUM_RECTS(&clip_reg); if (num_clips > 0) { @@ -981,10 +981,10 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects, } rdpup_end_update(); } - miRegionDestroy(fill_reg); + RegionDestroy(fill_reg); } } - miRegionUninit(&clip_reg); + RegionUninit(&clip_reg); g_free(regRects); g_free(rect1); GC_OP_EPILOGUE(pGC); @@ -1027,13 +1027,13 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs) } } pGC->ops->PolyArc(pDrawable, pGC, narcs, parcs); - miRegionInit(&clip_reg, NullBox, 0); + RegionInit(&clip_reg, NullBox, 0); cd = rdp_get_clip(&clip_reg, pDrawable, pGC); if (cd == 1) { if (rects != 0) { - tmpRegion = miRectsToRegion(narcs, rects, CT_NONE); + tmpRegion = RegionFromRects(narcs, rects, CT_NONE); num_clips = REGION_NUM_RECTS(tmpRegion); if (num_clips > 0) { @@ -1045,15 +1045,15 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs) } rdpup_end_update(); } - miRegionDestroy(tmpRegion); + RegionDestroy(tmpRegion); } } else if (cd == 2) { if (rects != 0) { - tmpRegion = miRectsToRegion(narcs, rects, CT_NONE); - miIntersect(tmpRegion, tmpRegion, &clip_reg); + tmpRegion = RegionFromRects(narcs, rects, CT_NONE); + RegionIntersect(tmpRegion, tmpRegion, &clip_reg); num_clips = REGION_NUM_RECTS(tmpRegion); if (num_clips > 0) { @@ -1065,10 +1065,10 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs) } rdpup_end_update(); } - miRegionDestroy(tmpRegion); + RegionDestroy(tmpRegion); } } - miRegionUninit(&clip_reg); + RegionUninit(&clip_reg); g_free(rects); GC_OP_EPILOGUE(pGC); } @@ -1096,7 +1096,7 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC, DEBUG_OUT_OPS(("in rdpFillPolygon\n")); GC_OP_PROLOGUE(pGC); pGC->ops->FillPolygon(pDrawable, pGC, shape, mode, count, pPts); - miRegionInit(&clip_reg, NullBox, 0); + RegionInit(&clip_reg, NullBox, 0); cd = rdp_get_clip(&clip_reg, pDrawable, pGC); if (cd != 0) { @@ -1143,8 +1143,8 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC, } else if (cd == 2) { - miRegionInit(&box_reg, &box, 0); - miIntersect(&clip_reg, &clip_reg, &box_reg); + RegionInit(&box_reg, &box, 0); + RegionIntersect(&clip_reg, &clip_reg, &box_reg); num_clips = REGION_NUM_RECTS(&clip_reg); if (num_clips > 0) { @@ -1156,9 +1156,9 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC, } rdpup_end_update(); } - miRegionUninit(&box_reg); + RegionUninit(&box_reg); } - miRegionUninit(&clip_reg); + RegionUninit(&clip_reg); GC_OP_EPILOGUE(pGC); } @@ -1186,11 +1186,11 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, { copy_of_rects[i] = prectInit[i]; } - fill_reg = miRectsToRegion(nrectFill, copy_of_rects, CT_NONE); + fill_reg = RegionFromRects(nrectFill, copy_of_rects, CT_NONE); g_free(copy_of_rects); - miTranslateRegion(fill_reg, pDrawable->x, pDrawable->y); + RegionTranslate(fill_reg, pDrawable->x, pDrawable->y); pGC->ops->PolyFillRect(pDrawable, pGC, nrectFill, prectInit); - miRegionInit(&clip_reg, NullBox, 0); + RegionInit(&clip_reg, NullBox, 0); cd = rdp_get_clip(&clip_reg, pDrawable, pGC); if (cd == 1) /* no clip */ { @@ -1225,7 +1225,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, } else if (cd == 2) /* clip */ { - miIntersect(&clip_reg, &clip_reg, fill_reg); + RegionIntersect(&clip_reg, &clip_reg, fill_reg); num_clips = REGION_NUM_RECTS(&clip_reg); if (num_clips > 0) { @@ -1259,8 +1259,8 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, rdpup_end_update(); } } - miRegionUninit(&clip_reg); - miRegionDestroy(fill_reg); + RegionUninit(&clip_reg); + RegionDestroy(fill_reg); GC_OP_EPILOGUE(pGC); } @@ -1301,13 +1301,13 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs) } } pGC->ops->PolyFillArc(pDrawable, pGC, narcs, parcs); - miRegionInit(&clip_reg, NullBox, 0); + RegionInit(&clip_reg, NullBox, 0); cd = rdp_get_clip(&clip_reg, pDrawable, pGC); if (cd == 1) { if (rects != 0) { - tmpRegion = miRectsToRegion(narcs, rects, CT_NONE); + tmpRegion = RegionFromRects(narcs, rects, CT_NONE); num_clips = REGION_NUM_RECTS(tmpRegion); if (num_clips > 0) { @@ -1319,15 +1319,15 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs) } rdpup_end_update(); } - miRegionDestroy(tmpRegion); + RegionDestroy(tmpRegion); } } else if (cd == 2) { if (rects != 0) { - tmpRegion = miRectsToRegion(narcs, rects, CT_NONE); - miIntersect(tmpRegion, tmpRegion, &clip_reg); + tmpRegion = RegionFromRects(narcs, rects, CT_NONE); + RegionIntersect(tmpRegion, tmpRegion, &clip_reg); num_clips = REGION_NUM_RECTS(tmpRegion); if (num_clips > 0) { @@ -1339,10 +1339,10 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs) } rdpup_end_update(); } - miRegionDestroy(tmpRegion); + RegionDestroy(tmpRegion); } } - miRegionUninit(&clip_reg); + RegionUninit(&clip_reg); g_free(rects); GC_OP_EPILOGUE(pGC); } @@ -1369,7 +1369,7 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC, GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); } rv = pGC->ops->PolyText8(pDrawable, pGC, x, y, count, chars); - miRegionInit(®, NullBox, 0); + RegionInit(®, NullBox, 0); if (count == 0) { cd = 0; @@ -1386,8 +1386,8 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC, } else if (cd == 2) { - miRegionInit(®1, &box, 0); - miIntersect(®, ®, ®1); + RegionInit(®1, &box, 0); + RegionIntersect(®, ®, ®1); num_clips = REGION_NUM_RECTS(®); if (num_clips > 0) { @@ -1399,9 +1399,9 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC, } rdpup_end_update(); } - miRegionUninit(®1); + RegionUninit(®1); } - miRegionUninit(®); + RegionUninit(®); GC_OP_EPILOGUE(pGC); return rv; } @@ -1428,7 +1428,7 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC, GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); } rv = pGC->ops->PolyText16(pDrawable, pGC, x, y, count, chars); - miRegionInit(®, NullBox, 0); + RegionInit(®, NullBox, 0); if (count == 0) { cd = 0; @@ -1445,8 +1445,8 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC, } else if (cd == 2) { - miRegionInit(®1, &box, 0); - miIntersect(®, ®, ®1); + RegionInit(®1, &box, 0); + RegionIntersect(®, ®, ®1); num_clips = REGION_NUM_RECTS(®); if (num_clips > 0) { @@ -1458,9 +1458,9 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC, } rdpup_end_update(); } - miRegionUninit(®1); + RegionUninit(®1); } - miRegionUninit(®); + RegionUninit(®); GC_OP_EPILOGUE(pGC); return rv; } @@ -1486,7 +1486,7 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC, GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); } pGC->ops->ImageText8(pDrawable, pGC, x, y, count, chars); - miRegionInit(&clip_reg, NullBox, 0); + RegionInit(&clip_reg, NullBox, 0); if (count == 0) { cd = 0; @@ -1503,8 +1503,8 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC, } else if (cd == 2) { - miRegionInit(&box_reg, &box, 0); - miIntersect(&clip_reg, &clip_reg, &box_reg); + RegionInit(&box_reg, &box, 0); + RegionIntersect(&clip_reg, &clip_reg, &box_reg); num_clips = REGION_NUM_RECTS(&clip_reg); if (num_clips > 0) { @@ -1516,9 +1516,9 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC, } rdpup_end_update(); } - miRegionUninit(&box_reg); + RegionUninit(&box_reg); } - miRegionUninit(&clip_reg); + RegionUninit(&clip_reg); GC_OP_EPILOGUE(pGC); } @@ -1544,7 +1544,7 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC, GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); } pGC->ops->ImageText16(pDrawable, pGC, x, y, count, chars); - miRegionInit(&clip_reg, NullBox, 0); + RegionInit(&clip_reg, NullBox, 0); if (count == 0) { cd = 0; @@ -1561,8 +1561,8 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC, } else if (cd == 2) { - miRegionInit(&box_reg, &box, 0); - miIntersect(&clip_reg, &clip_reg, &box_reg); + RegionInit(&box_reg, &box, 0); + RegionIntersect(&clip_reg, &clip_reg, &box_reg); num_clips = REGION_NUM_RECTS(&clip_reg); if (num_clips > 0) { @@ -1574,9 +1574,9 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC, } rdpup_end_update(); } - miRegionUninit(&box_reg); + RegionUninit(&box_reg); } - miRegionUninit(&clip_reg); + RegionUninit(&clip_reg); GC_OP_EPILOGUE(pGC); } @@ -1602,7 +1602,7 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, GetTextBoundingBox(pDrawable, pGC->font, x, y, nglyph, &box); } pGC->ops->ImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); - miRegionInit(®, NullBox, 0); + RegionInit(®, NullBox, 0); if (nglyph == 0) { cd = 0; @@ -1619,8 +1619,8 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, } else if (cd == 2) { - miRegionInit(&box_reg, &box, 0); - miIntersect(®, ®, &box_reg); + RegionInit(&box_reg, &box, 0); + RegionIntersect(®, ®, &box_reg); num_clips = REGION_NUM_RECTS(®); if (num_clips > 0) { @@ -1632,9 +1632,9 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, } rdpup_end_update(); } - miRegionUninit(&box_reg); + RegionUninit(&box_reg); } - miRegionUninit(®); + RegionUninit(®); GC_OP_EPILOGUE(pGC); } @@ -1656,12 +1656,13 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, DEBUG_OUT_OPS(("in rdpPolyGlyphBlt\n")); GC_OP_PROLOGUE(pGC); + memset(&box, 0, sizeof(box)); if (nglyph != 0) { GetTextBoundingBox(pDrawable, pGC->font, x, y, nglyph, &box); } pGC->ops->PolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); - miRegionInit(®, NullBox, 0); + RegionInit(®, NullBox, 0); if (nglyph == 0) { cd = 0; @@ -1678,8 +1679,8 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, } else if (cd == 2) { - miRegionInit(&box_reg, &box, 0); - miIntersect(®, ®, &box_reg); + RegionInit(&box_reg, &box, 0); + RegionIntersect(®, ®, &box_reg); num_clips = REGION_NUM_RECTS(®); if (num_clips > 0) { @@ -1691,9 +1692,9 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, } rdpup_end_update(); } - miRegionUninit(&box_reg); + RegionUninit(&box_reg); } - miRegionUninit(®); + RegionUninit(®); GC_OP_EPILOGUE(pGC); } @@ -1713,8 +1714,9 @@ rdpPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst, DEBUG_OUT_OPS(("in rdpPushPixels\n")); GC_OP_PROLOGUE(pGC); + memset(&box, 0, sizeof(box)); pGC->ops->PushPixels(pGC, pBitMap, pDst, w, h, x, y); - miRegionInit(&clip_reg, NullBox, 0); + RegionInit(&clip_reg, NullBox, 0); cd = rdp_get_clip(&clip_reg, pDst, pGC); if (cd == 1) { @@ -1724,8 +1726,8 @@ rdpPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst, } else if (cd == 2) { - miRegionInit(&box_reg, &box, 0); - miIntersect(&clip_reg, &clip_reg, &box_reg); + RegionInit(&box_reg, &box, 0); + RegionIntersect(&clip_reg, &clip_reg, &box_reg); num_clips = REGION_NUM_RECTS(&clip_reg); if (num_clips > 0) { @@ -1737,9 +1739,9 @@ rdpPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst, } rdpup_end_update(); } - miRegionUninit(&box_reg); + RegionUninit(&box_reg); } - miRegionUninit(&clip_reg); + RegionUninit(&clip_reg); GC_OP_EPILOGUE(pGC); } @@ -1750,8 +1752,8 @@ rdpCloseScreen(int i, ScreenPtr pScreen) DEBUG_OUT_OPS(("in rdpCloseScreen\n")); pScreen->CloseScreen = g_rdpScreen.CloseScreen; pScreen->CreateGC = g_rdpScreen.CreateGC; - pScreen->PaintWindowBackground = g_rdpScreen.PaintWindowBackground; - pScreen->PaintWindowBorder = g_rdpScreen.PaintWindowBorder; + //pScreen->PaintWindowBackground = g_rdpScreen.PaintWindowBackground; + //pScreen->PaintWindowBorder = g_rdpScreen.PaintWindowBorder; pScreen->CopyWindow = g_rdpScreen.CopyWindow; pScreen->ClearToBackground = g_rdpScreen.ClearToBackground; pScreen->RestoreAreas = g_rdpScreen.RestoreAreas; @@ -1760,14 +1762,15 @@ rdpCloseScreen(int i, ScreenPtr pScreen) /******************************************************************************/ PixmapPtr -rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth) +rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, + unsigned usage_hint) { PixmapPtr rv; ErrorF("rdpCreatePixmap:\n"); ErrorF(" in width %d height %d depth %d\n", width, height, depth); pScreen->CreatePixmap = g_rdpScreen.CreatePixmap; - rv = pScreen->CreatePixmap(pScreen, width, height, depth); + rv = pScreen->CreatePixmap(pScreen, width, height, depth, usage_hint); pScreen->CreatePixmap = rdpCreatePixmap; ErrorF(" out width %d height %d depth %d\n", rv->drawable.width, rv->drawable.height, rv->drawable.depth); @@ -1799,9 +1802,9 @@ rdpCreateGC(GCPtr pGC) DEBUG_OUT_OPS(("in rdpCreateGC\n")); rv = 0; - if (g_rdpGCIndex != -1) + if (1) // g_rdpGCIndex != -1) { - priv = (rdpGCPtr)pGC->devPrivates[g_rdpGCIndex].ptr; + priv = (rdpGCPtr)dixGetPrivateAddr(&(pGC->devPrivates), &g_rdpGCIndex); g_pScreen->CreateGC = g_rdpScreen.CreateGC; rv = g_pScreen->CreateGC(pGC); if (rv) @@ -1825,96 +1828,6 @@ rdpCreateGC(GCPtr pGC) /******************************************************************************/ void -rdpPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what) -{ - int j; - RegionRec reg; - BoxRec box; - - DEBUG_OUT_OPS(("in rdpPaintWindowBackground\n")); - miRegionInit(®, NullBox, 0); - miRegionCopy(®, pRegion); - g_pScreen->PaintWindowBackground = g_rdpScreen.PaintWindowBackground; - g_pScreen->PaintWindowBackground(pWin, pRegion, what); - rdpup_begin_update(); - if (what == PW_BACKGROUND && pWin->backgroundState == BackgroundPixel) - { - rdpup_set_fgcolor(pWin->background.pixel); - for (j = REGION_NUM_RECTS(®) - 1; j >= 0; j--) - { - box = REGION_RECTS(®)[j]; - rdpup_fill_rect(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); - } - } - else if (what == PW_BORDER && pWin->borderIsPixel) - { - rdpup_set_fgcolor(pWin->border.pixel); - for (j = REGION_NUM_RECTS(®) - 1; j >= 0; j--) - { - box = REGION_RECTS(®)[j]; - rdpup_fill_rect(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); - } - } - else - { - for (j = REGION_NUM_RECTS(®) - 1; j >= 0; j--) - { - box = REGION_RECTS(®)[j]; - rdpup_send_area(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); - } - } - rdpup_end_update(); - miRegionUninit(®); - g_pScreen->PaintWindowBackground = rdpPaintWindowBackground; -} - -/******************************************************************************/ -void -rdpPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what) -{ - int j; - RegionRec reg; - BoxRec box; - - DEBUG_OUT_OPS(("in rdpPaintWindowBorder\n")); - miRegionInit(®, NullBox, 0); - miRegionCopy(®, pRegion); - g_pScreen->PaintWindowBackground = g_rdpScreen.PaintWindowBackground; - g_pScreen->PaintWindowBackground(pWin, pRegion, what); - rdpup_begin_update(); - if (what == PW_BACKGROUND && pWin->backgroundState == BackgroundPixel) - { - rdpup_set_fgcolor(pWin->background.pixel); - for (j = REGION_NUM_RECTS(®) - 1; j >= 0; j--) - { - box = REGION_RECTS(®)[j]; - rdpup_fill_rect(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); - } - } - else if (what == PW_BORDER && pWin->borderIsPixel) - { - rdpup_set_fgcolor(pWin->border.pixel); - for (j = REGION_NUM_RECTS(®) - 1; j >= 0; j--) - { - box = REGION_RECTS(®)[j]; - rdpup_fill_rect(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); - } - } - else - { - for (j = REGION_NUM_RECTS(®) - 1; j >= 0; j--) - { - box = REGION_RECTS(®)[j]; - rdpup_send_area(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); - } - } - rdpup_end_update(); - miRegionUninit(®); - g_pScreen->PaintWindowBackground = rdpPaintWindowBackground; -} - -/******************************************************************************/ -void rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) { RegionRec reg; @@ -1929,12 +1842,12 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) BoxRec box2; DEBUG_OUT_OPS(("in rdpCopyWindow\n")); - miRegionInit(®, NullBox, 0); - miRegionCopy(®, pOldRegion); + RegionInit(®, NullBox, 0); + RegionCopy(®, pOldRegion); g_pScreen->CopyWindow = g_rdpScreen.CopyWindow; g_pScreen->CopyWindow(pWin, ptOldOrg, pOldRegion); - miRegionInit(&clip, NullBox, 0); - miRegionCopy(&clip, &pWin->borderClip); + RegionInit(&clip, NullBox, 0); + RegionCopy(&clip, &pWin->borderClip); dx = pWin->drawable.x - ptOldOrg.x; dy = pWin->drawable.y - ptOldOrg.y; rdpup_begin_update(); @@ -1973,8 +1886,8 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) } rdpup_reset_clip(); rdpup_end_update(); - miRegionUninit(®); - miRegionUninit(&clip); + RegionUninit(®); + RegionUninit(&clip); g_pScreen->CopyWindow = rdpCopyWindow; } @@ -2006,8 +1919,8 @@ rdpClearToBackground(WindowPtr pWin, int x, int y, int w, int h, box.x2 = box.x1 + pWin->drawable.width; box.y2 = box.y1 + pWin->drawable.height; } - miRegionInit(®, &box, 0); - miIntersect(®, ®, &pWin->clipList); + RegionInit(®, &box, 0); + RegionIntersect(®, ®, &pWin->clipList); rdpup_begin_update(); for (j = REGION_NUM_RECTS(®) - 1; j >= 0; j--) { @@ -2015,7 +1928,7 @@ rdpClearToBackground(WindowPtr pWin, int x, int y, int w, int h, rdpup_send_area(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); } rdpup_end_update(); - miRegionUninit(®); + RegionUninit(®); } g_pScreen->ClearToBackground = rdpClearToBackground; } @@ -2030,8 +1943,8 @@ rdpRestoreAreas(WindowPtr pWin, RegionPtr prgnExposed) BoxRec box; DEBUG_OUT_OPS(("in rdpRestoreAreas\n")); - miRegionInit(®, NullBox, 0); - miRegionCopy(®, prgnExposed); + RegionInit(®, NullBox, 0); + RegionCopy(®, prgnExposed); g_pScreen->RestoreAreas = g_rdpScreen.RestoreAreas; rv = g_pScreen->RestoreAreas(pWin, prgnExposed); rdpup_begin_update(); @@ -2041,7 +1954,7 @@ rdpRestoreAreas(WindowPtr pWin, RegionPtr prgnExposed) rdpup_send_area(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); } rdpup_end_update(); - miRegionUninit(®); + RegionUninit(®); g_pScreen->RestoreAreas = rdpRestoreAreas; return rv; } @@ -2078,9 +1991,9 @@ rdpUninstallColormap(ColormapPtr pmap) { if (pmap->mid != pmap->pScreen->defColormap) { - curpmap = (ColormapPtr)LookupIDByType(pmap->pScreen->defColormap, - RT_COLORMAP); - pmap->pScreen->InstallColormap(curpmap); + //curpmap = (ColormapPtr)LookupIDByType(pmap->pScreen->defColormap, + // RT_COLORMAP); + //pmap->pScreen->InstallColormap(curpmap); } } } @@ -2135,12 +2048,12 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, box.y1 = p->y + yDst; box.x2 = box.x1 + width; box.y2 = box.y1 + height; - miRegionInit(®1, &box, 0); - miRegionInit(®2, NullBox, 0); - miRegionCopy(®2, pDst->clientClip); - miTranslateRegion(®2, p->x + pDst->clipOrigin.x, + RegionInit(®1, &box, 0); + RegionInit(®2, NullBox, 0); + RegionCopy(®2, pDst->clientClip); + RegionTranslate(®2, p->x + pDst->clipOrigin.x, p->y + pDst->clipOrigin.y); - miIntersect(®1, ®1, ®2); + RegionIntersect(®1, ®1, ®2); num_clips = REGION_NUM_RECTS(®1); if (num_clips > 0) { @@ -2152,8 +2065,8 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, } rdpup_end_update(); } - miRegionUninit(®1); - miRegionUninit(®2); + RegionUninit(®1); + RegionUninit(®2); } else { diff --git a/xorg/X11R7.6/rdp/rdpinput.c b/xorg/X11R7.6/rdp/rdpinput.c index 68e77196..a9a02a04 100644 --- a/xorg/X11R7.6/rdp/rdpinput.c +++ b/xorg/X11R7.6/rdp/rdpinput.c @@ -304,6 +304,7 @@ rdpKeybdProc(DeviceIntPtr pDevice, int onoff) KeySymsRec keySyms; CARD8 modMap[MAP_LENGTH]; DevicePtr pDev; + XkbRMLVOSet set[MAP_LENGTH]; DEBUG_OUT_INPUT(("rdpKeybdProc\n")); pDev = (DevicePtr)pDevice; @@ -311,8 +312,7 @@ rdpKeybdProc(DeviceIntPtr pDevice, int onoff) { case DEVICE_INIT: KbdDeviceInit(pDevice, &keySyms, modMap); - InitKeyboardDeviceStruct(pDev, &keySyms, modMap, - (BellProcPtr)rdpSendBell, + InitKeyboardDeviceStruct(pDevice, set, (BellProcPtr)rdpSendBell, (KbdCtrlProcPtr)NoopDDA); break; case DEVICE_ON: @@ -380,9 +380,19 @@ rdpMouseProc(DeviceIntPtr pDevice, int onoff) map[3] = 3; map[4] = 4; map[5] = 5; - InitPointerDeviceStruct(pDev, map, 5, miPointerGetMotionEvents, - PtrDeviceControl, - miPointerGetMotionBufferSize()); + //InitPointerDeviceStruct(pDevice, map, 5, 0, miPointerGetMotionEvents, + // PtrDeviceControl, + // miPointerGetMotionBufferSize(), 2, 0); +#if 0 + DevicePtr /*device*/, + CARD8* /*map*/, + int /*numButtons*/, + Atom* /* btn_labels */, + PtrCtrlProcPtr /*controlProc*/, + int /*numMotionEvents*/, + int /*numAxes*/, + Atom* /* axes_labels */); +#endif break; case DEVICE_ON: pDev->on = 1; @@ -419,7 +429,7 @@ rdpCrossScreen(ScreenPtr pScreen, Bool entering) /******************************************************************************/ Bool -rdpSpriteRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) +rdpSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs) { DEBUG_OUT_INPUT(("rdpSpriteRealizeCursor\n")); return 1; @@ -427,7 +437,7 @@ rdpSpriteRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) /******************************************************************************/ Bool -rdpSpriteUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) +rdpSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs) { DEBUG_OUT_INPUT(("hi rdpSpriteUnrealizeCursor\n")); return 1; @@ -520,7 +530,8 @@ set_pixel_safe(char* data, int x, int y, int width, int height, int bpp, /******************************************************************************/ void -rdpSpriteSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y) +rdpSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs, + int x, int y) { char cur_data[32 * (32 * 3)]; char cur_mask[32 * (32 / 8)]; @@ -537,28 +548,28 @@ rdpSpriteSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y) int fgcolor; int bgcolor; - if (pCursor == 0) + if (pCurs == 0) { return; } - if (pCursor->bits == 0) + if (pCurs->bits == 0) { return; } - w = pCursor->bits->width; - h = pCursor->bits->height; + w = pCurs->bits->width; + h = pCurs->bits->height; paddedRowBytes = PixmapBytePad(w, 1); - xhot = pCursor->bits->xhot; - yhot = pCursor->bits->yhot; + xhot = pCurs->bits->xhot; + yhot = pCurs->bits->yhot; /* ErrorF("xhot %d yhot %d\n", xhot, yhot); */ - data = (char*)(pCursor->bits->source); - mask = (char*)(pCursor->bits->mask); - fgcolor = (((pCursor->foreRed >> 8) & 0xff) << 16) | - (((pCursor->foreGreen >> 8) & 0xff) << 8) | - ((pCursor->foreBlue >> 8) & 0xff); - bgcolor = (((pCursor->backRed >> 8) & 0xff) << 16) | - (((pCursor->backGreen >> 8) & 0xff) << 8) | - ((pCursor->backBlue >> 8) & 0xff); + data = (char*)(pCurs->bits->source); + mask = (char*)(pCurs->bits->mask); + fgcolor = (((pCurs->foreRed >> 8) & 0xff) << 16) | + (((pCurs->foreGreen >> 8) & 0xff) << 8) | + ((pCurs->foreBlue >> 8) & 0xff); + bgcolor = (((pCurs->backRed >> 8) & 0xff) << 16) | + (((pCurs->backGreen >> 8) & 0xff) << 8) | + ((pCurs->backBlue >> 8) & 0xff); memset(cur_data, 0, sizeof(cur_data)); memset(cur_mask, 0, sizeof(cur_mask)); for (j = 0; j < 32; j++) @@ -582,7 +593,7 @@ rdpSpriteSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y) /******************************************************************************/ void -rdpSpriteMoveCursor(ScreenPtr pScreen, int x, int y) +rdpSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScr, int x, int y) { DEBUG_OUT_INPUT(("hi rdpSpriteMoveCursor\n")); } @@ -591,29 +602,37 @@ rdpSpriteMoveCursor(ScreenPtr pScreen, int x, int y) void PtrAddEvent(int buttonMask, int x, int y) { - xEvent ev; + //xEvent ev; int i; unsigned long time; + //InternalEvent e; + + //memset(&e, 0, sizeof(e)); time = GetTimeInMillis(); - miPointerAbsoluteCursor(x, y, time); + //todo PostSyntheticMotion(); + //miPointerAbsoluteCursor(x, y, time); for (i = 0; i < 5; i++) { if ((buttonMask ^ g_old_button_mask) & (1 << i)) { if (buttonMask & (1 << i)) { - ev.u.u.type = ButtonPress; - ev.u.u.detail = i + 1; - ev.u.keyButtonPointer.time = time; - mieqEnqueue(&ev); + //e.header = ET_Internal; + //e.type = ET_ButtonPress; + + //ev.u.u.type = ButtonPress; + //ev.u.u.detail = i + 1; + //ev.u.keyButtonPointer.time = time; + //mieqEnqueue(0, &ev); // todo } else { - ev.u.u.type = ButtonRelease; - ev.u.u.detail = i + 1; - ev.u.keyButtonPointer.time = time; - mieqEnqueue(&ev); + //ET_ButtonRelease + //ev.u.u.type = ButtonRelease; + //ev.u.u.detail = i + 1; + //ev.u.keyButtonPointer.time = time; + //mieqEnqueue(0, &ev); // todo } } } @@ -635,7 +654,7 @@ check_keysa(void) ev.u.u.type = KeyRelease; ev.u.keyButtonPointer.time = time; ev.u.u.detail = g_ctrl_down; - mieqEnqueue(&ev); + //mieqEnqueue(&ev); g_ctrl_down = 0; } if (g_alt_down != 0) @@ -644,7 +663,7 @@ check_keysa(void) ev.u.u.type = KeyRelease; ev.u.keyButtonPointer.time = time; ev.u.u.detail = g_alt_down; - mieqEnqueue(&ev); + //mieqEnqueue(&ev); g_alt_down = 0; } if (g_shift_down != 0) @@ -653,7 +672,7 @@ check_keysa(void) ev.u.u.type = KeyRelease; ev.u.keyButtonPointer.time = time; ev.u.u.detail = g_shift_down; - mieqEnqueue(&ev); + //mieqEnqueue(&ev); g_shift_down = 0; } } @@ -796,7 +815,7 @@ KbdAddEvent(int down, int param1, int param2, int param3, int param4) if (x_scancode > 0) { ev.u.u.detail = x_scancode; - mieqEnqueue(&ev); + //mieqEnqueue(&ev); } } @@ -819,6 +838,7 @@ KbdSync(int param1) { return; } +#if 0 if ((!(keyc->state & 0x02)) != (!(param1 & 4))) /* caps lock */ { KbdAddEvent(1, 58, 0, 58, 0); @@ -834,4 +854,5 @@ KbdSync(int param1) KbdAddEvent(1, 70, 0, 70, 0); KbdAddEvent(0, 70, 49152, 70, 49152); } +#endif } diff --git a/xorg/X11R7.6/rdp/rdpmain.c b/xorg/X11R7.6/rdp/rdpmain.c index 9f2161c9..cca24488 100644 --- a/xorg/X11R7.6/rdp/rdpmain.c +++ b/xorg/X11R7.6/rdp/rdpmain.c @@ -32,7 +32,10 @@ Sets up the functions rdpScreenInfoRec g_rdpScreen; /* the one screen */ ScreenPtr g_pScreen = 0; -int g_rdpGCIndex = -1; + +//int g_rdpGCIndex = -1; +DevPrivateKeyRec g_rdpGCIndex; + /* set all these at once, use function set_bpp */ int g_bpp = 16; int g_Bpp = 2; @@ -60,7 +63,7 @@ static miPointerSpriteFuncRec g_rdpSpritePointerFuncs = rdpSpriteRealizeCursor, rdpSpriteUnrealizeCursor, rdpSpriteSetCursor, - rdpSpriteMoveCursor, + rdpSpriteMoveCursor }; static miPointerScreenFuncRec g_rdpPointerCursorFuncs = { @@ -73,7 +76,9 @@ static miPointerScreenFuncRec g_rdpPointerCursorFuncs = #define FB_GET_SCREEN_PIXMAP(s) ((PixmapPtr) ((s)->devPrivate)) +#if 0 static OsTimerPtr g_updateTimer = 0; +#endif static XID g_wid = 0; static Bool @@ -233,17 +238,17 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char** argv) case 8: ret = fbScreenInit(pScreen, g_rdpScreen.pfbMemory, g_rdpScreen.width, g_rdpScreen.height, - dpix, dpiy, g_rdpScreen.paddedWidthInBytes); + dpix, dpiy, g_rdpScreen.paddedWidthInBytes, 8); break; case 16: ret = fbScreenInit(pScreen, g_rdpScreen.pfbMemory, g_rdpScreen.width, g_rdpScreen.height, - dpix, dpiy, g_rdpScreen.paddedWidthInBytes / 2); + dpix, dpiy, g_rdpScreen.paddedWidthInBytes / 2, 16); break; case 32: ret = fbScreenInit(pScreen, g_rdpScreen.pfbMemory, g_rdpScreen.width, g_rdpScreen.height, - dpix, dpiy, g_rdpScreen.paddedWidthInBytes / 4); + dpix, dpiy, g_rdpScreen.paddedWidthInBytes / 4, 32); break; default: return 0; @@ -276,10 +281,12 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char** argv) fbPictureInit(pScreen, 0, 0); } - if (!AllocateGCPrivate(pScreen, g_rdpGCIndex, sizeof(rdpGCRec))) + //if (!miAllocateGCPrivate(pScreen, g_rdpGCIndex, sizeof(rdpGCRec))) + if (!dixRegisterPrivateKey(&g_rdpGCIndex, PRIVATE_GC, sizeof(rdpGCRec))) { - FatalError("rdpScreenInit: AllocateGCPrivate failed\n"); + FatalError("rdpScreenInit: miAllocateGCPrivate failed\n"); } + /* Random screen procedures */ g_rdpScreen.CloseScreen = pScreen->CloseScreen; /* GC procedures */ @@ -288,8 +295,8 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char** argv) g_rdpScreen.CreatePixmap = pScreen->CreatePixmap; g_rdpScreen.DestroyPixmap = pScreen->DestroyPixmap; /* Window Procedures */ - g_rdpScreen.PaintWindowBackground = pScreen->PaintWindowBackground; - g_rdpScreen.PaintWindowBorder = pScreen->PaintWindowBorder; + //g_rdpScreen.PaintWindowBackground = pScreen->PaintWindowBackground; + //g_rdpScreen.PaintWindowBorder = pScreen->PaintWindowBorder; g_rdpScreen.CopyWindow = pScreen->CopyWindow; g_rdpScreen.ClearToBackground = pScreen->ClearToBackground; /* Backing store procedures */ @@ -316,8 +323,8 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char** argv) /* pScreen->CreatePixmap = rdpCreatePixmap; */ /* pScreen->DestroyPixmap = rdpDestroyPixmap; */ /* Window Procedures */ - pScreen->PaintWindowBackground = rdpPaintWindowBackground; - pScreen->PaintWindowBorder = rdpPaintWindowBorder; + //pScreen->PaintWindowBackground = rdpPaintWindowBackground; + //pScreen->PaintWindowBorder = rdpPaintWindowBorder; pScreen->CopyWindow = rdpCopyWindow; pScreen->ClearToBackground = rdpClearToBackground; /* Backing store procedures */ @@ -342,7 +349,7 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char** argv) } if (g_rdpScreen.bitsPerPixel == 1) { - ret = mfbCreateDefColormap(pScreen); + ret = fbCreateDefColormap(pScreen); } else { @@ -472,11 +479,11 @@ InitOutput(ScreenInfo* screenInfo, int argc, char** argv) { screenInfo->formats[i] = g_formats[i]; } - g_rdpGCIndex = AllocateGCPrivateIndex(); - if (g_rdpGCIndex < 0) - { - FatalError("InitOutput: AllocateGCPrivateIndex failed\n"); - } + //g_rdpGCIndex = miAllocateGCPrivateIndex(); + //if (g_rdpGCIndex < 0) + //{ + // FatalError("InitOutput: miAllocateGCPrivateIndex failed\n"); + //} if (!AddCallback(&ClientStateCallback, rdpClientStateChange, NULL)) { rdpLog("InitOutput: AddCallback failed\n"); @@ -496,13 +503,18 @@ InitInput(int argc, char** argv) DeviceIntPtr p; DeviceIntPtr k; - k = AddInputDevice(rdpKeybdProc, 1); - p = AddInputDevice(rdpMouseProc, 1); + k = AddInputDevice(serverClient, rdpKeybdProc, 1); + p = AddInputDevice(serverClient, rdpMouseProc, 1); RegisterKeyboardDevice(k); RegisterPointerDevice(p); + +// TODO +#if 0 /* screenInfo must be globally defined */ miRegisterPointerDevice(screenInfo.screens[0], p); mieqInit(k, p); +#endif + } /******************************************************************************/ @@ -523,7 +535,7 @@ ddxGiveUp(void) /******************************************************************************/ Bool -LegalModifier(unsigned int key, DevicePtr pDev) +LegalModifier(unsigned int key, DeviceIntPtr pDev) { return 1; /* true */ } @@ -533,7 +545,7 @@ void ProcessInputEvents(void) { mieqProcessInputEvents(); - miPointerUpdate(); + //miPointerUpdate(); } /******************************************************************************/ @@ -668,6 +680,7 @@ rdpRandRGetInfo(ScreenPtr pScreen, Rotation* pRotations) return TRUE; } +#if 0 /******************************************************************************/ static CARD32 rdpDeferredDrawCallback(OsTimerPtr timer, CARD32 now, pointer arg) @@ -683,6 +696,7 @@ rdpDeferredDrawCallback(OsTimerPtr timer, CARD32 now, pointer arg) */ return 0; } +#endif /******************************************************************************/ /* for lack of a better way, a window is created that covers a the area and @@ -698,7 +712,7 @@ rdpInvalidateArea(ScreenPtr pScreen, int x, int y, int cx, int cy) Mask mask; DEBUG_OUT(("rdpInvalidateArea:\n")); - rootWindow = GetCurrentRootWindow(); + rootWindow = 0; // GetCurrentRootWindow(); if (rootWindow != 0) { mask = 0; @@ -739,7 +753,6 @@ rdpRandRSetConfig(ScreenPtr pScreen, Rotation rotateKind, int rate, PixmapPtr screenPixmap; WindowPtr rootWindow; BoxRec box; - RegionRec temp; if ((pSize->width < 1) || (pSize->height < 1)) { @@ -782,7 +795,7 @@ rdpRandRSetConfig(ScreenPtr pScreen, Rotation rotateKind, int rate, screenPixmap->drawable.width, screenPixmap->drawable.height)); /* memset(g_rdpScreen.pfbMemory, 0xff, 2048 * 2048 * 4); */ } - rootWindow = GetCurrentRootWindow(); + rootWindow = 0; // GetCurrentRootWindow(); if (rootWindow != 0) { DEBUG_OUT(("rdpRandRSetConfig: rootWindow %p\n", (void*)rootWindow)); @@ -790,10 +803,10 @@ rdpRandRSetConfig(ScreenPtr pScreen, Rotation rotateKind, int rate, box.y1 = 0; box.x2 = pSize->width; box.y2 = pSize->height; - miRegionInit(&rootWindow->winSize, &box, 1); - miRegionInit(&rootWindow->borderSize, &box, 1); - miRegionReset(&rootWindow->borderClip, &box); - miRegionBreak(&rootWindow->clipList); + RegionInit(&rootWindow->winSize, &box, 1); + RegionInit(&rootWindow->borderSize, &box, 1); + RegionReset(&rootWindow->borderClip, &box); + RegionBreak(&rootWindow->clipList); rootWindow->drawable.width = pSize->width; rootWindow->drawable.height = pSize->height; ResizeChildrenWinSize(rootWindow, 0, 0, 0, 0); diff --git a/xorg/X11R7.6/rdp/rdpup.c b/xorg/X11R7.6/rdp/rdpup.c index 9124f88e..0e9468ab 100644 --- a/xorg/X11R7.6/rdp/rdpup.c +++ b/xorg/X11R7.6/rdp/rdpup.c @@ -33,9 +33,9 @@ static int g_sck_closed = 0; static int g_connected = 0; static int g_dis_listen_sck = 0; -static int g_dis_sck = 0; -static int g_dis_sck_closed = 0; -static int g_dis_connected = 0; +//static int g_dis_sck = 0; +//static int g_dis_sck_closed = 0; +//static int g_dis_connected = 0; static int g_begin = 0; static struct stream* g_out_s = 0; @@ -285,7 +285,7 @@ process_screen_size_msg(int width, int height, int bpp) RRScreenSizePtr pSize; int mmwidth; int mmheight; - int error; + //int error; ErrorF("process_screen_size_msg: set width %d height %d bpp %d\n", width, height, bpp); @@ -318,13 +318,14 @@ process_screen_size_msg(int width, int height, int bpp) RRSetCurrentConfig(g_pScreen, RR_Rotate_0, 0, pSize); if ((g_rdpScreen.width != width) || (g_rdpScreen.height != height)) { - error = RRSetScreenConfig(g_pScreen, RR_Rotate_0, 0, pSize); - if (error == BadImplementation) - { - ErrorF("process_screen_size_msg: RRSetScreenConfig returned " - "BadImplementation\n"); - } + //error = RRSetScreenConfig(g_pScreen, RR_Rotate_0, 0, pSize); + //if (error == BadImplementation) + //{ + // ErrorF("process_screen_size_msg: RRSetScreenConfig returned " + // "BadImplementation\n"); + //} } + return 0; } /******************************************************************************/ |