xrdp:X11R7.6: work on building X11rdp

ulab-original
Jay Sorg 13 years ago
parent 5b40f518c1
commit 1986fcc6af

@ -21,6 +21,7 @@
# flex bison libxml2-dev intltool # flex bison libxml2-dev intltool
# xsltproc # xsltproc
# xutils-dev python-libxml2
download_file() download_file()
{ {
@ -193,6 +194,7 @@ make_it()
patch -p1 < ../../$mod_name.patch patch -p1 < ../../$mod_name.patch
fi fi
# now configure # now configure
echo "executing ./configure --prefix=$PREFIX_DIR $mod_args"
./configure --prefix=$PREFIX_DIR $mod_args ./configure --prefix=$PREFIX_DIR $mod_args
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "configuration failed for module $mn" echo "configuration failed for module $mn"
@ -277,8 +279,11 @@ fi
echo "using $PREFIX_DIR" echo "using $PREFIX_DIR"
export PKG_CONFIG_PATH=$PREFIX_DIR/lib/pkgconfig:$PREFIX_DIR/share/pkgconfig 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 # really only needed for x84
export CFLAGS=-fPIC export CFLAGS=-fPIC
@ -335,4 +340,18 @@ do
done < $data_file 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" echo "All done"

@ -4,28 +4,30 @@
INCBASE = $(X11RDPBASE)/include INCBASE = $(X11RDPBASE)/include
LIBBASE = $(X11RDPBASE)/lib LIBBASE = $(X11RDPBASE)/lib
OBJS = rdpmain.o rdpdraw.o rdpinput.o rdpmisc.o rdpup.o miinitext.o fbcmap.o XSRCBASE = ../build_dir/xorg-server-1.9.3
LIBS = ../../dbe/.libs/libdbe.a \ OBJS = rdpmain.o rdpdraw.o rdpinput.o rdpmisc.o rdpup.o miinitext.o
../../dix/.libs/libdix.a \
../../fb/.libs/libfb.a \ # fbcmap.o
../../mfb/.libs/libmfb.a \
../../mi/.libs/libmi.a \ LIBS = $(XSRCBASE)/dbe/.libs/libdbe.a \
../../os/.libs/libos.a \ $(XSRCBASE)/dix/.libs/libdix.a \
../../randr/.libs/librandr.a \ $(XSRCBASE)/dix/.libs/libmain.a \
../../record/.libs/librecord.a \ $(XSRCBASE)/fb/.libs/libfb.a \
../../render/.libs/librender.a \ $(XSRCBASE)/mi/.libs/libmi.a \
../../xkb/.libs/libxkb.a \ $(XSRCBASE)/os/.libs/libos.a \
../../XTrap/.libs/libxtrap.a \ $(XSRCBASE)/randr/.libs/librandr.a \
../../Xext/.libs/libXext.a \ $(XSRCBASE)/record/.libs/librecord.a \
../../Xi/.libs/libXi.a \ $(XSRCBASE)/render/.libs/librender.a \
../../GL/glx/.libs/libglx.a \ $(XSRCBASE)/xkb/.libs/libxkb.a \
../../GL/mesa/.libs/libGLcore.a \ $(XSRCBASE)/Xext/.libs/libXext.a \
../../xfixes/.libs/libxfixes.a \ $(XSRCBASE)/Xi/.libs/libXi.a \
$(XSRCBASE)/glx/.libs/libglx.a \
$(XSRCBASE)/xfixes/.libs/libxfixes.a \
librdp.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../../include \
-I../../cfb \ -I../../cfb \
-I../../mfb \ -I../../mfb \
@ -80,8 +82,8 @@ X11rdp: $(OBJS)
clean: clean:
rm -f $(OBJS) librdp.a rm -f $(OBJS) librdp.a
miinitext.o: ../../mi/miinitext.c miinitext.o: ../build_dir/xorg-server-1.9.3/mi/miinitext.c
$(CC) $(CFLAGS) -c ../../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 #fbcmap.o: ../../fb/fbcmap.c
$(CC) $(CFLAGS) -c ../../fb/fbcmap.c # $(CC) $(CFLAGS) -c ../../fb/fbcmap.c

@ -41,7 +41,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "scrnintstr.h" #include "scrnintstr.h"
#include "servermd.h" #include "servermd.h"
#define PSZ 8 #define PSZ 8
//#include "cfb.h" //#include "cfb.h"
#include "mibstore.h" #include "mibstore.h"
#include "colormapst.h" #include "colormapst.h"
#include "gcstruct.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 "XKBstr.h"
#include "inputstr.h" #include "inputstr.h"
#include "randrstr.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 */ /* test to see if this is xorg source or xfree86 */
#ifdef XORGSERVER #ifdef XORGSERVER
@ -101,8 +107,10 @@ struct _rdpScreenInfoRec
CreatePixmapProcPtr CreatePixmap; CreatePixmapProcPtr CreatePixmap;
DestroyPixmapProcPtr DestroyPixmap; DestroyPixmapProcPtr DestroyPixmap;
/* Window Procedures */ /* Window Procedures */
PaintWindowBackgroundProcPtr PaintWindowBackground;
PaintWindowBorderProcPtr PaintWindowBorder; //PaintWindowBackgroundProcPtr PaintWindowBackground;
//PaintWindowBorderProcPtr PaintWindowBorder;
CopyWindowProcPtr CopyWindow; CopyWindowProcPtr CopyWindow;
ClearToBackgroundProcPtr ClearToBackground; ClearToBackgroundProcPtr ClearToBackground;
ScreenWakeupHandlerProcPtr WakeupHandler; ScreenWakeupHandlerProcPtr WakeupHandler;
@ -175,7 +183,8 @@ g_tcp_listen(int sck);
Bool Bool
rdpCloseScreen(int i, ScreenPtr pScreen); rdpCloseScreen(int i, ScreenPtr pScreen);
PixmapPtr PixmapPtr
rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth); rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
unsigned usage_hint);
Bool Bool
rdpDestroyPixmap(PixmapPtr pPixmap); rdpDestroyPixmap(PixmapPtr pPixmap);
Bool Bool
@ -235,13 +244,14 @@ rdpCursorOffScreen(ScreenPtr* ppScreen, int* x, int* y);
void void
rdpCrossScreen(ScreenPtr pScreen, Bool entering); rdpCrossScreen(ScreenPtr pScreen, Bool entering);
Bool Bool
rdpSpriteRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor); rdpSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs);
Bool Bool
rdpSpriteUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor); rdpSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs);
void void
rdpSpriteSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y); rdpSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs,
int x, int y);
void void
rdpSpriteMoveCursor(ScreenPtr pScreen, int x, int y); rdpSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScr, int x, int y);
void void
PtrAddEvent(int buttonMask, int x, int y); PtrAddEvent(int buttonMask, int x, int y);
void void
@ -282,6 +292,8 @@ int
rdpup_draw_line(short x1, short y1, short x2, short y2); rdpup_draw_line(short x1, short y1, short x2, short y2);
void void
rdpup_send_area(int x, int y, int w, int h); 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 defined(X_BYTE_ORDER)
# if X_BYTE_ORDER == X_LITTLE_ENDIAN # if X_BYTE_ORDER == X_LITTLE_ENDIAN

@ -33,7 +33,7 @@ Xserver drawing ops and funcs
#endif #endif
extern rdpScreenInfoRec g_rdpScreen; /* from rdpmain.c */ 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 int g_Bpp; /* from rdpmain.c */
extern ScreenPtr g_pScreen; /* 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; temp = &pWindow->clipList;
} }
if (miRegionNotEmpty(temp)) if (RegionNotEmpty(temp))
{ {
switch (pGC->clientClipType) switch (pGC->clientClipType)
{ {
case CT_NONE: case CT_NONE:
rv = 2; rv = 2;
miRegionCopy(pRegion, temp); RegionCopy(pRegion, temp);
break; break;
case CT_REGION: case CT_REGION:
rv = 2; rv = 2;
miRegionCopy(pRegion, pGC->clientClip); RegionCopy(pRegion, pGC->clientClip);
miTranslateRegion(pRegion, RegionTranslate(pRegion,
pDrawable->x + pGC->clipOrg.x, pDrawable->x + pGC->clipOrg.x,
pDrawable->y + pGC->clipOrg.y); pDrawable->y + pGC->clipOrg.y);
miIntersect(pRegion, pRegion, temp); RegionIntersect(pRegion, pRegion, temp);
break; break;
default: default:
rdpLog("unimp clip type %d\n", pGC->clientClipType); 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.y1 = 0;
box.x2 = g_rdpScreen.width; box.x2 = g_rdpScreen.width;
box.y2 = g_rdpScreen.height; box.y2 = g_rdpScreen.height;
if (miRectIn(pRegion, &box) == rgnIN) if (RegionContainsRect(pRegion, &box) == rgnIN)
{ {
rv = 1; rv = 1;
} }
@ -164,7 +164,7 @@ GetTextBoundingBox(DrawablePtr pDrawable, FontPtr font, int x, int y,
/******************************************************************************/ /******************************************************************************/
#define GC_FUNC_PROLOGUE(_pGC) \ #define GC_FUNC_PROLOGUE(_pGC) \
{ \ { \
priv = (rdpGCPtr)(_pGC->devPrivates[g_rdpGCIndex].ptr); \ priv = (rdpGCPtr)(dixGetPrivateAddr(&(_pGC->devPrivates), &g_rdpGCIndex)); \
(_pGC)->funcs = priv->funcs; \ (_pGC)->funcs = priv->funcs; \
if (priv->ops != 0) \ if (priv->ops != 0) \
{ \ { \
@ -206,7 +206,7 @@ rdpValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr d)
{ {
pRegion = &(((WindowPtr)d)->clipList); pRegion = &(((WindowPtr)d)->clipList);
} }
viewable = miRegionNotEmpty(pRegion); viewable = RegionNotEmpty(pRegion);
} }
priv->ops = 0; priv->ops = 0;
if (viewable) if (viewable)
@ -291,7 +291,7 @@ rdpCopyClip(GCPtr dst, GCPtr src)
/******************************************************************************/ /******************************************************************************/
#define GC_OP_PROLOGUE(_pGC) \ #define GC_OP_PROLOGUE(_pGC) \
{ \ { \
priv = (rdpGCPtr)pGC->devPrivates[g_rdpGCIndex].ptr; \ priv = (rdpGCPtr)dixGetPrivateAddr(&(pGC->devPrivates), &g_rdpGCIndex); \
oldFuncs = _pGC->funcs; \ oldFuncs = _pGC->funcs; \
(_pGC)->funcs = priv->funcs; \ (_pGC)->funcs = priv->funcs; \
(_pGC)->ops = priv->ops; \ (_pGC)->ops = priv->ops; \
@ -320,12 +320,12 @@ rdpFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nInit,
DEBUG_OUT_OPS(("in rdpFillSpans\n")); DEBUG_OUT_OPS(("in rdpFillSpans\n"));
GC_OP_PROLOGUE(pGC) GC_OP_PROLOGUE(pGC)
pGC->ops->FillSpans(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted); 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); cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
if (cd == 1) if (cd == 1)
{ {
rdpup_begin_update(); 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--) for (j = REGION_NUM_RECTS(&clip_reg) - 1; j >= 0; j--)
{ {
box = REGION_RECTS(&clip_reg)[j]; box = REGION_RECTS(&clip_reg)[j];
@ -336,8 +336,8 @@ rdpFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nInit,
else if (cd == 2) else if (cd == 2)
{ {
rdpup_begin_update(); rdpup_begin_update();
miIntersect(&clip_reg, &clip_reg, RegionIntersect(&clip_reg, &clip_reg,
&(((WindowPtr)pDrawable)->borderClip)); &(((WindowPtr)pDrawable)->borderClip));
for (j = REGION_NUM_RECTS(&clip_reg) - 1; j >= 0; j--) for (j = REGION_NUM_RECTS(&clip_reg) - 1; j >= 0; j--)
{ {
box = REGION_RECTS(&clip_reg)[j]; box = REGION_RECTS(&clip_reg)[j];
@ -345,7 +345,7 @@ rdpFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nInit,
} }
rdpup_end_update(); rdpup_end_update();
} }
miRegionUninit(&clip_reg); RegionUninit(&clip_reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
@ -364,12 +364,12 @@ rdpSetSpans(DrawablePtr pDrawable, GCPtr pGC, char* psrc,
DEBUG_OUT_OPS(("in rdpSetSpans\n")); DEBUG_OUT_OPS(("in rdpSetSpans\n"));
GC_OP_PROLOGUE(pGC); GC_OP_PROLOGUE(pGC);
pGC->ops->SetSpans(pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted); 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); cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
if (cd == 1) if (cd == 1)
{ {
rdpup_begin_update(); 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--) for (j = REGION_NUM_RECTS(&clip_reg) - 1; j >= 0; j--)
{ {
box = REGION_RECTS(&clip_reg)[j]; box = REGION_RECTS(&clip_reg)[j];
@ -380,8 +380,8 @@ rdpSetSpans(DrawablePtr pDrawable, GCPtr pGC, char* psrc,
else if (cd == 2) else if (cd == 2)
{ {
rdpup_begin_update(); rdpup_begin_update();
miIntersect(&clip_reg, &clip_reg, RegionIntersect(&clip_reg, &clip_reg,
&((WindowPtr)pDrawable)->borderClip); &((WindowPtr)pDrawable)->borderClip);
for (j = REGION_NUM_RECTS(&clip_reg) - 1; j >= 0; j--) for (j = REGION_NUM_RECTS(&clip_reg) - 1; j >= 0; j--)
{ {
box = REGION_RECTS(&clip_reg)[j]; box = REGION_RECTS(&clip_reg)[j];
@ -389,7 +389,7 @@ rdpSetSpans(DrawablePtr pDrawable, GCPtr pGC, char* psrc,
} }
rdpup_end_update(); rdpup_end_update();
} }
miRegionUninit(&clip_reg); RegionUninit(&clip_reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
@ -409,7 +409,7 @@ rdpPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
GC_OP_PROLOGUE(pGC); GC_OP_PROLOGUE(pGC);
pGC->ops->PutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, pGC->ops->PutImage(pDrawable, pGC, depth, x, y, w, h, leftPad,
format, pBits); format, pBits);
miRegionInit(&clip_reg, NullBox, 0); RegionInit(&clip_reg, NullBox, 0);
cd = rdp_get_clip(&clip_reg, pDrawable, pGC); cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
if (cd == 1) if (cd == 1)
{ {
@ -429,7 +429,7 @@ rdpPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
rdpup_reset_clip(); rdpup_reset_clip();
rdpup_end_update(); rdpup_end_update();
} }
miRegionUninit(&clip_reg); RegionUninit(&clip_reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
@ -455,7 +455,7 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
DEBUG_OUT_OPS(("in rdpCopyArea\n")); DEBUG_OUT_OPS(("in rdpCopyArea\n"));
GC_OP_PROLOGUE(pGC); GC_OP_PROLOGUE(pGC);
rv = pGC->ops->CopyArea(pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty); 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); cd = rdp_get_clip(&clip_reg, pDst, pGC);
can_do_screen_blt = pSrc->type == DRAWABLE_WINDOW && can_do_screen_blt = pSrc->type == DRAWABLE_WINDOW &&
((WindowPtr)pSrc)->viewable && ((WindowPtr)pSrc)->viewable &&
@ -512,8 +512,8 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
box.y1 = pDst->y + dsty; box.y1 = pDst->y + dsty;
box.x2 = box.x1 + w; box.x2 = box.x1 + w;
box.y2 = box.y1 + h; box.y2 = box.y1 + h;
miRegionInit(&box_reg, &box, 0); RegionInit(&box_reg, &box, 0);
miIntersect(&clip_reg, &clip_reg, &box_reg); RegionIntersect(&clip_reg, &clip_reg, &box_reg);
num_clips = REGION_NUM_RECTS(&clip_reg); num_clips = REGION_NUM_RECTS(&clip_reg);
if (num_clips < 10) if (num_clips < 10)
{ {
@ -525,16 +525,16 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
} }
else else
{ {
pbox = miRegionExtents(&clip_reg); pbox = RegionExtents(&clip_reg);
rdpup_send_area(pbox->x1, pbox->y1, pbox->x2 - pbox->x1, rdpup_send_area(pbox->x1, pbox->y1, pbox->x2 - pbox->x1,
pbox->y2 - pbox->y1); pbox->y2 - pbox->y1);
} }
miRegionUninit(&box_reg); RegionUninit(&box_reg);
} }
rdpup_end_update(); rdpup_end_update();
} }
} }
miRegionUninit(&clip_reg); RegionUninit(&clip_reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
return rv; return rv;
} }
@ -555,7 +555,7 @@ rdpCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
GC_OP_PROLOGUE(pGC); GC_OP_PROLOGUE(pGC);
rv = pGC->ops->CopyPlane(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, rv = pGC->ops->CopyPlane(pSrcDrawable, pDstDrawable, pGC, srcx, srcy,
width, height, dstx, dsty, bitPlane); width, height, dstx, dsty, bitPlane);
miRegionInit(&reg, NullBox, 0); RegionInit(&reg, NullBox, 0);
cd = rdp_get_clip(&reg, pDstDrawable, pGC); cd = rdp_get_clip(&reg, pDstDrawable, pGC);
if (cd == 1) if (cd == 1)
{ {
@ -563,7 +563,7 @@ rdpCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
else if (cd == 2) else if (cd == 2)
{ {
} }
miRegionUninit(&reg); RegionUninit(&reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
return rv; return rv;
} }
@ -630,7 +630,7 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
/* todo, use this total_box */ /* todo, use this total_box */
} }
pGC->ops->PolyPoint(pDrawable, pGC, mode, npt, in_pts); 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); cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
if (cd == 1) if (cd == 1)
{ {
@ -669,7 +669,7 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
rdpup_end_update(); rdpup_end_update();
} }
} }
miRegionUninit(&clip_reg); RegionUninit(&clip_reg);
if (pts != stack_pts) if (pts != stack_pts)
{ {
g_free(pts); g_free(pts);
@ -708,7 +708,7 @@ rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode,
} }
} }
pGC->ops->Polylines(pDrawable, pGC, mode, npt, pptInit); 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); cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
if (cd == 1) if (cd == 1)
{ {
@ -777,7 +777,7 @@ rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode,
rdpup_end_update(); rdpup_end_update();
} }
} }
miRegionUninit(&clip_reg); RegionUninit(&clip_reg);
g_free(ppts); g_free(ppts);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
@ -810,7 +810,7 @@ rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment* pSegs)
} }
} }
pGC->ops->PolySegment(pDrawable, pGC, nseg, 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); cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
if (cd == 1) /* no clip */ if (cd == 1) /* no clip */
{ {
@ -851,7 +851,7 @@ rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment* pSegs)
} }
} }
g_free(segs); g_free(segs);
miRegionUninit(&clip_reg); RegionUninit(&clip_reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
@ -886,7 +886,7 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
rect1[i] = rects[i]; rect1[i] = rects[i];
} }
pGC->ops->PolyRectangle(pDrawable, pGC, nrects, rects); 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); cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
regRects = 0; regRects = 0;
if (cd != 0 && nrects > 0) if (cd != 0 && nrects > 0)
@ -954,8 +954,8 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
{ {
if (regRects != 0) if (regRects != 0)
{ {
fill_reg = miRectsToRegion(nrects * 4, regRects, CT_NONE); fill_reg = RegionFromRects(nrects * 4, regRects, CT_NONE);
miIntersect(&clip_reg, &clip_reg, fill_reg); RegionIntersect(&clip_reg, &clip_reg, fill_reg);
num_clips = REGION_NUM_RECTS(&clip_reg); num_clips = REGION_NUM_RECTS(&clip_reg);
if (num_clips > 0) if (num_clips > 0)
{ {
@ -981,10 +981,10 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
} }
rdpup_end_update(); rdpup_end_update();
} }
miRegionDestroy(fill_reg); RegionDestroy(fill_reg);
} }
} }
miRegionUninit(&clip_reg); RegionUninit(&clip_reg);
g_free(regRects); g_free(regRects);
g_free(rect1); g_free(rect1);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
@ -1027,13 +1027,13 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
} }
} }
pGC->ops->PolyArc(pDrawable, pGC, narcs, 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); cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
if (cd == 1) if (cd == 1)
{ {
if (rects != 0) if (rects != 0)
{ {
tmpRegion = miRectsToRegion(narcs, rects, CT_NONE); tmpRegion = RegionFromRects(narcs, rects, CT_NONE);
num_clips = REGION_NUM_RECTS(tmpRegion); num_clips = REGION_NUM_RECTS(tmpRegion);
if (num_clips > 0) if (num_clips > 0)
{ {
@ -1045,15 +1045,15 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
} }
rdpup_end_update(); rdpup_end_update();
} }
miRegionDestroy(tmpRegion); RegionDestroy(tmpRegion);
} }
} }
else if (cd == 2) else if (cd == 2)
{ {
if (rects != 0) if (rects != 0)
{ {
tmpRegion = miRectsToRegion(narcs, rects, CT_NONE); tmpRegion = RegionFromRects(narcs, rects, CT_NONE);
miIntersect(tmpRegion, tmpRegion, &clip_reg); RegionIntersect(tmpRegion, tmpRegion, &clip_reg);
num_clips = REGION_NUM_RECTS(tmpRegion); num_clips = REGION_NUM_RECTS(tmpRegion);
if (num_clips > 0) if (num_clips > 0)
{ {
@ -1065,10 +1065,10 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
} }
rdpup_end_update(); rdpup_end_update();
} }
miRegionDestroy(tmpRegion); RegionDestroy(tmpRegion);
} }
} }
miRegionUninit(&clip_reg); RegionUninit(&clip_reg);
g_free(rects); g_free(rects);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
@ -1096,7 +1096,7 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
DEBUG_OUT_OPS(("in rdpFillPolygon\n")); DEBUG_OUT_OPS(("in rdpFillPolygon\n"));
GC_OP_PROLOGUE(pGC); GC_OP_PROLOGUE(pGC);
pGC->ops->FillPolygon(pDrawable, pGC, shape, mode, count, pPts); 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); cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
if (cd != 0) if (cd != 0)
{ {
@ -1143,8 +1143,8 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
} }
else if (cd == 2) else if (cd == 2)
{ {
miRegionInit(&box_reg, &box, 0); RegionInit(&box_reg, &box, 0);
miIntersect(&clip_reg, &clip_reg, &box_reg); RegionIntersect(&clip_reg, &clip_reg, &box_reg);
num_clips = REGION_NUM_RECTS(&clip_reg); num_clips = REGION_NUM_RECTS(&clip_reg);
if (num_clips > 0) if (num_clips > 0)
{ {
@ -1156,9 +1156,9 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
} }
rdpup_end_update(); rdpup_end_update();
} }
miRegionUninit(&box_reg); RegionUninit(&box_reg);
} }
miRegionUninit(&clip_reg); RegionUninit(&clip_reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
@ -1186,11 +1186,11 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
{ {
copy_of_rects[i] = prectInit[i]; 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); 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); 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); cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
if (cd == 1) /* no clip */ if (cd == 1) /* no clip */
{ {
@ -1225,7 +1225,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
} }
else if (cd == 2) /* clip */ 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); num_clips = REGION_NUM_RECTS(&clip_reg);
if (num_clips > 0) if (num_clips > 0)
{ {
@ -1259,8 +1259,8 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
rdpup_end_update(); rdpup_end_update();
} }
} }
miRegionUninit(&clip_reg); RegionUninit(&clip_reg);
miRegionDestroy(fill_reg); RegionDestroy(fill_reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
@ -1301,13 +1301,13 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
} }
} }
pGC->ops->PolyFillArc(pDrawable, pGC, narcs, 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); cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
if (cd == 1) if (cd == 1)
{ {
if (rects != 0) if (rects != 0)
{ {
tmpRegion = miRectsToRegion(narcs, rects, CT_NONE); tmpRegion = RegionFromRects(narcs, rects, CT_NONE);
num_clips = REGION_NUM_RECTS(tmpRegion); num_clips = REGION_NUM_RECTS(tmpRegion);
if (num_clips > 0) if (num_clips > 0)
{ {
@ -1319,15 +1319,15 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
} }
rdpup_end_update(); rdpup_end_update();
} }
miRegionDestroy(tmpRegion); RegionDestroy(tmpRegion);
} }
} }
else if (cd == 2) else if (cd == 2)
{ {
if (rects != 0) if (rects != 0)
{ {
tmpRegion = miRectsToRegion(narcs, rects, CT_NONE); tmpRegion = RegionFromRects(narcs, rects, CT_NONE);
miIntersect(tmpRegion, tmpRegion, &clip_reg); RegionIntersect(tmpRegion, tmpRegion, &clip_reg);
num_clips = REGION_NUM_RECTS(tmpRegion); num_clips = REGION_NUM_RECTS(tmpRegion);
if (num_clips > 0) if (num_clips > 0)
{ {
@ -1339,10 +1339,10 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
} }
rdpup_end_update(); rdpup_end_update();
} }
miRegionDestroy(tmpRegion); RegionDestroy(tmpRegion);
} }
} }
miRegionUninit(&clip_reg); RegionUninit(&clip_reg);
g_free(rects); g_free(rects);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
@ -1369,7 +1369,7 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box);
} }
rv = pGC->ops->PolyText8(pDrawable, pGC, x, y, count, chars); rv = pGC->ops->PolyText8(pDrawable, pGC, x, y, count, chars);
miRegionInit(&reg, NullBox, 0); RegionInit(&reg, NullBox, 0);
if (count == 0) if (count == 0)
{ {
cd = 0; cd = 0;
@ -1386,8 +1386,8 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
} }
else if (cd == 2) else if (cd == 2)
{ {
miRegionInit(&reg1, &box, 0); RegionInit(&reg1, &box, 0);
miIntersect(&reg, &reg, &reg1); RegionIntersect(&reg, &reg, &reg1);
num_clips = REGION_NUM_RECTS(&reg); num_clips = REGION_NUM_RECTS(&reg);
if (num_clips > 0) if (num_clips > 0)
{ {
@ -1399,9 +1399,9 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
} }
rdpup_end_update(); rdpup_end_update();
} }
miRegionUninit(&reg1); RegionUninit(&reg1);
} }
miRegionUninit(&reg); RegionUninit(&reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
return rv; return rv;
} }
@ -1428,7 +1428,7 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box);
} }
rv = pGC->ops->PolyText16(pDrawable, pGC, x, y, count, chars); rv = pGC->ops->PolyText16(pDrawable, pGC, x, y, count, chars);
miRegionInit(&reg, NullBox, 0); RegionInit(&reg, NullBox, 0);
if (count == 0) if (count == 0)
{ {
cd = 0; cd = 0;
@ -1445,8 +1445,8 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
} }
else if (cd == 2) else if (cd == 2)
{ {
miRegionInit(&reg1, &box, 0); RegionInit(&reg1, &box, 0);
miIntersect(&reg, &reg, &reg1); RegionIntersect(&reg, &reg, &reg1);
num_clips = REGION_NUM_RECTS(&reg); num_clips = REGION_NUM_RECTS(&reg);
if (num_clips > 0) if (num_clips > 0)
{ {
@ -1458,9 +1458,9 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
} }
rdpup_end_update(); rdpup_end_update();
} }
miRegionUninit(&reg1); RegionUninit(&reg1);
} }
miRegionUninit(&reg); RegionUninit(&reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
return rv; return rv;
} }
@ -1486,7 +1486,7 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC,
GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box);
} }
pGC->ops->ImageText8(pDrawable, pGC, x, y, count, chars); pGC->ops->ImageText8(pDrawable, pGC, x, y, count, chars);
miRegionInit(&clip_reg, NullBox, 0); RegionInit(&clip_reg, NullBox, 0);
if (count == 0) if (count == 0)
{ {
cd = 0; cd = 0;
@ -1503,8 +1503,8 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC,
} }
else if (cd == 2) else if (cd == 2)
{ {
miRegionInit(&box_reg, &box, 0); RegionInit(&box_reg, &box, 0);
miIntersect(&clip_reg, &clip_reg, &box_reg); RegionIntersect(&clip_reg, &clip_reg, &box_reg);
num_clips = REGION_NUM_RECTS(&clip_reg); num_clips = REGION_NUM_RECTS(&clip_reg);
if (num_clips > 0) if (num_clips > 0)
{ {
@ -1516,9 +1516,9 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC,
} }
rdpup_end_update(); rdpup_end_update();
} }
miRegionUninit(&box_reg); RegionUninit(&box_reg);
} }
miRegionUninit(&clip_reg); RegionUninit(&clip_reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
@ -1544,7 +1544,7 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box);
} }
pGC->ops->ImageText16(pDrawable, pGC, x, y, count, chars); pGC->ops->ImageText16(pDrawable, pGC, x, y, count, chars);
miRegionInit(&clip_reg, NullBox, 0); RegionInit(&clip_reg, NullBox, 0);
if (count == 0) if (count == 0)
{ {
cd = 0; cd = 0;
@ -1561,8 +1561,8 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
} }
else if (cd == 2) else if (cd == 2)
{ {
miRegionInit(&box_reg, &box, 0); RegionInit(&box_reg, &box, 0);
miIntersect(&clip_reg, &clip_reg, &box_reg); RegionIntersect(&clip_reg, &clip_reg, &box_reg);
num_clips = REGION_NUM_RECTS(&clip_reg); num_clips = REGION_NUM_RECTS(&clip_reg);
if (num_clips > 0) if (num_clips > 0)
{ {
@ -1574,9 +1574,9 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
} }
rdpup_end_update(); rdpup_end_update();
} }
miRegionUninit(&box_reg); RegionUninit(&box_reg);
} }
miRegionUninit(&clip_reg); RegionUninit(&clip_reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
@ -1602,7 +1602,7 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
GetTextBoundingBox(pDrawable, pGC->font, x, y, nglyph, &box); GetTextBoundingBox(pDrawable, pGC->font, x, y, nglyph, &box);
} }
pGC->ops->ImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); pGC->ops->ImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
miRegionInit(&reg, NullBox, 0); RegionInit(&reg, NullBox, 0);
if (nglyph == 0) if (nglyph == 0)
{ {
cd = 0; cd = 0;
@ -1619,8 +1619,8 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
} }
else if (cd == 2) else if (cd == 2)
{ {
miRegionInit(&box_reg, &box, 0); RegionInit(&box_reg, &box, 0);
miIntersect(&reg, &reg, &box_reg); RegionIntersect(&reg, &reg, &box_reg);
num_clips = REGION_NUM_RECTS(&reg); num_clips = REGION_NUM_RECTS(&reg);
if (num_clips > 0) if (num_clips > 0)
{ {
@ -1632,9 +1632,9 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
} }
rdpup_end_update(); rdpup_end_update();
} }
miRegionUninit(&box_reg); RegionUninit(&box_reg);
} }
miRegionUninit(&reg); RegionUninit(&reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
@ -1656,12 +1656,13 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
DEBUG_OUT_OPS(("in rdpPolyGlyphBlt\n")); DEBUG_OUT_OPS(("in rdpPolyGlyphBlt\n"));
GC_OP_PROLOGUE(pGC); GC_OP_PROLOGUE(pGC);
memset(&box, 0, sizeof(box));
if (nglyph != 0) if (nglyph != 0)
{ {
GetTextBoundingBox(pDrawable, pGC->font, x, y, nglyph, &box); GetTextBoundingBox(pDrawable, pGC->font, x, y, nglyph, &box);
} }
pGC->ops->PolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); pGC->ops->PolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
miRegionInit(&reg, NullBox, 0); RegionInit(&reg, NullBox, 0);
if (nglyph == 0) if (nglyph == 0)
{ {
cd = 0; cd = 0;
@ -1678,8 +1679,8 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
} }
else if (cd == 2) else if (cd == 2)
{ {
miRegionInit(&box_reg, &box, 0); RegionInit(&box_reg, &box, 0);
miIntersect(&reg, &reg, &box_reg); RegionIntersect(&reg, &reg, &box_reg);
num_clips = REGION_NUM_RECTS(&reg); num_clips = REGION_NUM_RECTS(&reg);
if (num_clips > 0) if (num_clips > 0)
{ {
@ -1691,9 +1692,9 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
} }
rdpup_end_update(); rdpup_end_update();
} }
miRegionUninit(&box_reg); RegionUninit(&box_reg);
} }
miRegionUninit(&reg); RegionUninit(&reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
@ -1713,8 +1714,9 @@ rdpPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
DEBUG_OUT_OPS(("in rdpPushPixels\n")); DEBUG_OUT_OPS(("in rdpPushPixels\n"));
GC_OP_PROLOGUE(pGC); GC_OP_PROLOGUE(pGC);
memset(&box, 0, sizeof(box));
pGC->ops->PushPixels(pGC, pBitMap, pDst, w, h, x, y); 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); cd = rdp_get_clip(&clip_reg, pDst, pGC);
if (cd == 1) if (cd == 1)
{ {
@ -1724,8 +1726,8 @@ rdpPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
} }
else if (cd == 2) else if (cd == 2)
{ {
miRegionInit(&box_reg, &box, 0); RegionInit(&box_reg, &box, 0);
miIntersect(&clip_reg, &clip_reg, &box_reg); RegionIntersect(&clip_reg, &clip_reg, &box_reg);
num_clips = REGION_NUM_RECTS(&clip_reg); num_clips = REGION_NUM_RECTS(&clip_reg);
if (num_clips > 0) if (num_clips > 0)
{ {
@ -1737,9 +1739,9 @@ rdpPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
} }
rdpup_end_update(); rdpup_end_update();
} }
miRegionUninit(&box_reg); RegionUninit(&box_reg);
} }
miRegionUninit(&clip_reg); RegionUninit(&clip_reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
@ -1750,8 +1752,8 @@ rdpCloseScreen(int i, ScreenPtr pScreen)
DEBUG_OUT_OPS(("in rdpCloseScreen\n")); DEBUG_OUT_OPS(("in rdpCloseScreen\n"));
pScreen->CloseScreen = g_rdpScreen.CloseScreen; pScreen->CloseScreen = g_rdpScreen.CloseScreen;
pScreen->CreateGC = g_rdpScreen.CreateGC; pScreen->CreateGC = g_rdpScreen.CreateGC;
pScreen->PaintWindowBackground = g_rdpScreen.PaintWindowBackground; //pScreen->PaintWindowBackground = g_rdpScreen.PaintWindowBackground;
pScreen->PaintWindowBorder = g_rdpScreen.PaintWindowBorder; //pScreen->PaintWindowBorder = g_rdpScreen.PaintWindowBorder;
pScreen->CopyWindow = g_rdpScreen.CopyWindow; pScreen->CopyWindow = g_rdpScreen.CopyWindow;
pScreen->ClearToBackground = g_rdpScreen.ClearToBackground; pScreen->ClearToBackground = g_rdpScreen.ClearToBackground;
pScreen->RestoreAreas = g_rdpScreen.RestoreAreas; pScreen->RestoreAreas = g_rdpScreen.RestoreAreas;
@ -1760,14 +1762,15 @@ rdpCloseScreen(int i, ScreenPtr pScreen)
/******************************************************************************/ /******************************************************************************/
PixmapPtr PixmapPtr
rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth) rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
unsigned usage_hint)
{ {
PixmapPtr rv; PixmapPtr rv;
ErrorF("rdpCreatePixmap:\n"); ErrorF("rdpCreatePixmap:\n");
ErrorF(" in width %d height %d depth %d\n", width, height, depth); ErrorF(" in width %d height %d depth %d\n", width, height, depth);
pScreen->CreatePixmap = g_rdpScreen.CreatePixmap; pScreen->CreatePixmap = g_rdpScreen.CreatePixmap;
rv = pScreen->CreatePixmap(pScreen, width, height, depth); rv = pScreen->CreatePixmap(pScreen, width, height, depth, usage_hint);
pScreen->CreatePixmap = rdpCreatePixmap; pScreen->CreatePixmap = rdpCreatePixmap;
ErrorF(" out width %d height %d depth %d\n", rv->drawable.width, ErrorF(" out width %d height %d depth %d\n", rv->drawable.width,
rv->drawable.height, rv->drawable.depth); rv->drawable.height, rv->drawable.depth);
@ -1799,9 +1802,9 @@ rdpCreateGC(GCPtr pGC)
DEBUG_OUT_OPS(("in rdpCreateGC\n")); DEBUG_OUT_OPS(("in rdpCreateGC\n"));
rv = 0; 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; g_pScreen->CreateGC = g_rdpScreen.CreateGC;
rv = g_pScreen->CreateGC(pGC); rv = g_pScreen->CreateGC(pGC);
if (rv) if (rv)
@ -1823,96 +1826,6 @@ rdpCreateGC(GCPtr pGC)
return rv; return rv;
} }
/******************************************************************************/
void
rdpPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what)
{
int j;
RegionRec reg;
BoxRec box;
DEBUG_OUT_OPS(("in rdpPaintWindowBackground\n"));
miRegionInit(&reg, NullBox, 0);
miRegionCopy(&reg, 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(&reg) - 1; j >= 0; j--)
{
box = REGION_RECTS(&reg)[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(&reg) - 1; j >= 0; j--)
{
box = REGION_RECTS(&reg)[j];
rdpup_fill_rect(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
}
}
else
{
for (j = REGION_NUM_RECTS(&reg) - 1; j >= 0; j--)
{
box = REGION_RECTS(&reg)[j];
rdpup_send_area(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
}
}
rdpup_end_update();
miRegionUninit(&reg);
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(&reg, NullBox, 0);
miRegionCopy(&reg, 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(&reg) - 1; j >= 0; j--)
{
box = REGION_RECTS(&reg)[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(&reg) - 1; j >= 0; j--)
{
box = REGION_RECTS(&reg)[j];
rdpup_fill_rect(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
}
}
else
{
for (j = REGION_NUM_RECTS(&reg) - 1; j >= 0; j--)
{
box = REGION_RECTS(&reg)[j];
rdpup_send_area(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
}
}
rdpup_end_update();
miRegionUninit(&reg);
g_pScreen->PaintWindowBackground = rdpPaintWindowBackground;
}
/******************************************************************************/ /******************************************************************************/
void void
rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion)
@ -1929,12 +1842,12 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion)
BoxRec box2; BoxRec box2;
DEBUG_OUT_OPS(("in rdpCopyWindow\n")); DEBUG_OUT_OPS(("in rdpCopyWindow\n"));
miRegionInit(&reg, NullBox, 0); RegionInit(&reg, NullBox, 0);
miRegionCopy(&reg, pOldRegion); RegionCopy(&reg, pOldRegion);
g_pScreen->CopyWindow = g_rdpScreen.CopyWindow; g_pScreen->CopyWindow = g_rdpScreen.CopyWindow;
g_pScreen->CopyWindow(pWin, ptOldOrg, pOldRegion); g_pScreen->CopyWindow(pWin, ptOldOrg, pOldRegion);
miRegionInit(&clip, NullBox, 0); RegionInit(&clip, NullBox, 0);
miRegionCopy(&clip, &pWin->borderClip); RegionCopy(&clip, &pWin->borderClip);
dx = pWin->drawable.x - ptOldOrg.x; dx = pWin->drawable.x - ptOldOrg.x;
dy = pWin->drawable.y - ptOldOrg.y; dy = pWin->drawable.y - ptOldOrg.y;
rdpup_begin_update(); rdpup_begin_update();
@ -1973,8 +1886,8 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion)
} }
rdpup_reset_clip(); rdpup_reset_clip();
rdpup_end_update(); rdpup_end_update();
miRegionUninit(&reg); RegionUninit(&reg);
miRegionUninit(&clip); RegionUninit(&clip);
g_pScreen->CopyWindow = rdpCopyWindow; 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.x2 = box.x1 + pWin->drawable.width;
box.y2 = box.y1 + pWin->drawable.height; box.y2 = box.y1 + pWin->drawable.height;
} }
miRegionInit(&reg, &box, 0); RegionInit(&reg, &box, 0);
miIntersect(&reg, &reg, &pWin->clipList); RegionIntersect(&reg, &reg, &pWin->clipList);
rdpup_begin_update(); rdpup_begin_update();
for (j = REGION_NUM_RECTS(&reg) - 1; j >= 0; j--) for (j = REGION_NUM_RECTS(&reg) - 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_send_area(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
} }
rdpup_end_update(); rdpup_end_update();
miRegionUninit(&reg); RegionUninit(&reg);
} }
g_pScreen->ClearToBackground = rdpClearToBackground; g_pScreen->ClearToBackground = rdpClearToBackground;
} }
@ -2030,8 +1943,8 @@ rdpRestoreAreas(WindowPtr pWin, RegionPtr prgnExposed)
BoxRec box; BoxRec box;
DEBUG_OUT_OPS(("in rdpRestoreAreas\n")); DEBUG_OUT_OPS(("in rdpRestoreAreas\n"));
miRegionInit(&reg, NullBox, 0); RegionInit(&reg, NullBox, 0);
miRegionCopy(&reg, prgnExposed); RegionCopy(&reg, prgnExposed);
g_pScreen->RestoreAreas = g_rdpScreen.RestoreAreas; g_pScreen->RestoreAreas = g_rdpScreen.RestoreAreas;
rv = g_pScreen->RestoreAreas(pWin, prgnExposed); rv = g_pScreen->RestoreAreas(pWin, prgnExposed);
rdpup_begin_update(); 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_send_area(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
} }
rdpup_end_update(); rdpup_end_update();
miRegionUninit(&reg); RegionUninit(&reg);
g_pScreen->RestoreAreas = rdpRestoreAreas; g_pScreen->RestoreAreas = rdpRestoreAreas;
return rv; return rv;
} }
@ -2078,9 +1991,9 @@ rdpUninstallColormap(ColormapPtr pmap)
{ {
if (pmap->mid != pmap->pScreen->defColormap) if (pmap->mid != pmap->pScreen->defColormap)
{ {
curpmap = (ColormapPtr)LookupIDByType(pmap->pScreen->defColormap, //curpmap = (ColormapPtr)LookupIDByType(pmap->pScreen->defColormap,
RT_COLORMAP); // RT_COLORMAP);
pmap->pScreen->InstallColormap(curpmap); //pmap->pScreen->InstallColormap(curpmap);
} }
} }
} }
@ -2135,12 +2048,12 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
box.y1 = p->y + yDst; box.y1 = p->y + yDst;
box.x2 = box.x1 + width; box.x2 = box.x1 + width;
box.y2 = box.y1 + height; box.y2 = box.y1 + height;
miRegionInit(&reg1, &box, 0); RegionInit(&reg1, &box, 0);
miRegionInit(&reg2, NullBox, 0); RegionInit(&reg2, NullBox, 0);
miRegionCopy(&reg2, pDst->clientClip); RegionCopy(&reg2, pDst->clientClip);
miTranslateRegion(&reg2, p->x + pDst->clipOrigin.x, RegionTranslate(&reg2, p->x + pDst->clipOrigin.x,
p->y + pDst->clipOrigin.y); p->y + pDst->clipOrigin.y);
miIntersect(&reg1, &reg1, &reg2); RegionIntersect(&reg1, &reg1, &reg2);
num_clips = REGION_NUM_RECTS(&reg1); num_clips = REGION_NUM_RECTS(&reg1);
if (num_clips > 0) if (num_clips > 0)
{ {
@ -2152,8 +2065,8 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
} }
rdpup_end_update(); rdpup_end_update();
} }
miRegionUninit(&reg1); RegionUninit(&reg1);
miRegionUninit(&reg2); RegionUninit(&reg2);
} }
else else
{ {

@ -304,6 +304,7 @@ rdpKeybdProc(DeviceIntPtr pDevice, int onoff)
KeySymsRec keySyms; KeySymsRec keySyms;
CARD8 modMap[MAP_LENGTH]; CARD8 modMap[MAP_LENGTH];
DevicePtr pDev; DevicePtr pDev;
XkbRMLVOSet set[MAP_LENGTH];
DEBUG_OUT_INPUT(("rdpKeybdProc\n")); DEBUG_OUT_INPUT(("rdpKeybdProc\n"));
pDev = (DevicePtr)pDevice; pDev = (DevicePtr)pDevice;
@ -311,8 +312,7 @@ rdpKeybdProc(DeviceIntPtr pDevice, int onoff)
{ {
case DEVICE_INIT: case DEVICE_INIT:
KbdDeviceInit(pDevice, &keySyms, modMap); KbdDeviceInit(pDevice, &keySyms, modMap);
InitKeyboardDeviceStruct(pDev, &keySyms, modMap, InitKeyboardDeviceStruct(pDevice, set, (BellProcPtr)rdpSendBell,
(BellProcPtr)rdpSendBell,
(KbdCtrlProcPtr)NoopDDA); (KbdCtrlProcPtr)NoopDDA);
break; break;
case DEVICE_ON: case DEVICE_ON:
@ -380,9 +380,19 @@ rdpMouseProc(DeviceIntPtr pDevice, int onoff)
map[3] = 3; map[3] = 3;
map[4] = 4; map[4] = 4;
map[5] = 5; map[5] = 5;
InitPointerDeviceStruct(pDev, map, 5, miPointerGetMotionEvents, //InitPointerDeviceStruct(pDevice, map, 5, 0, miPointerGetMotionEvents,
PtrDeviceControl, // PtrDeviceControl,
miPointerGetMotionBufferSize()); // 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; break;
case DEVICE_ON: case DEVICE_ON:
pDev->on = 1; pDev->on = 1;
@ -419,7 +429,7 @@ rdpCrossScreen(ScreenPtr pScreen, Bool entering)
/******************************************************************************/ /******************************************************************************/
Bool Bool
rdpSpriteRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) rdpSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs)
{ {
DEBUG_OUT_INPUT(("rdpSpriteRealizeCursor\n")); DEBUG_OUT_INPUT(("rdpSpriteRealizeCursor\n"));
return 1; return 1;
@ -427,7 +437,7 @@ rdpSpriteRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
/******************************************************************************/ /******************************************************************************/
Bool Bool
rdpSpriteUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) rdpSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs)
{ {
DEBUG_OUT_INPUT(("hi rdpSpriteUnrealizeCursor\n")); DEBUG_OUT_INPUT(("hi rdpSpriteUnrealizeCursor\n"));
return 1; return 1;
@ -520,7 +530,8 @@ set_pixel_safe(char* data, int x, int y, int width, int height, int bpp,
/******************************************************************************/ /******************************************************************************/
void 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_data[32 * (32 * 3)];
char cur_mask[32 * (32 / 8)]; char cur_mask[32 * (32 / 8)];
@ -537,28 +548,28 @@ rdpSpriteSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
int fgcolor; int fgcolor;
int bgcolor; int bgcolor;
if (pCursor == 0) if (pCurs == 0)
{ {
return; return;
} }
if (pCursor->bits == 0) if (pCurs->bits == 0)
{ {
return; return;
} }
w = pCursor->bits->width; w = pCurs->bits->width;
h = pCursor->bits->height; h = pCurs->bits->height;
paddedRowBytes = PixmapBytePad(w, 1); paddedRowBytes = PixmapBytePad(w, 1);
xhot = pCursor->bits->xhot; xhot = pCurs->bits->xhot;
yhot = pCursor->bits->yhot; yhot = pCurs->bits->yhot;
/* ErrorF("xhot %d yhot %d\n", xhot, yhot); */ /* ErrorF("xhot %d yhot %d\n", xhot, yhot); */
data = (char*)(pCursor->bits->source); data = (char*)(pCurs->bits->source);
mask = (char*)(pCursor->bits->mask); mask = (char*)(pCurs->bits->mask);
fgcolor = (((pCursor->foreRed >> 8) & 0xff) << 16) | fgcolor = (((pCurs->foreRed >> 8) & 0xff) << 16) |
(((pCursor->foreGreen >> 8) & 0xff) << 8) | (((pCurs->foreGreen >> 8) & 0xff) << 8) |
((pCursor->foreBlue >> 8) & 0xff); ((pCurs->foreBlue >> 8) & 0xff);
bgcolor = (((pCursor->backRed >> 8) & 0xff) << 16) | bgcolor = (((pCurs->backRed >> 8) & 0xff) << 16) |
(((pCursor->backGreen >> 8) & 0xff) << 8) | (((pCurs->backGreen >> 8) & 0xff) << 8) |
((pCursor->backBlue >> 8) & 0xff); ((pCurs->backBlue >> 8) & 0xff);
memset(cur_data, 0, sizeof(cur_data)); memset(cur_data, 0, sizeof(cur_data));
memset(cur_mask, 0, sizeof(cur_mask)); memset(cur_mask, 0, sizeof(cur_mask));
for (j = 0; j < 32; j++) for (j = 0; j < 32; j++)
@ -582,7 +593,7 @@ rdpSpriteSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
/******************************************************************************/ /******************************************************************************/
void void
rdpSpriteMoveCursor(ScreenPtr pScreen, int x, int y) rdpSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScr, int x, int y)
{ {
DEBUG_OUT_INPUT(("hi rdpSpriteMoveCursor\n")); DEBUG_OUT_INPUT(("hi rdpSpriteMoveCursor\n"));
} }
@ -591,29 +602,37 @@ rdpSpriteMoveCursor(ScreenPtr pScreen, int x, int y)
void void
PtrAddEvent(int buttonMask, int x, int y) PtrAddEvent(int buttonMask, int x, int y)
{ {
xEvent ev; //xEvent ev;
int i; int i;
unsigned long time; unsigned long time;
//InternalEvent e;
//memset(&e, 0, sizeof(e));
time = GetTimeInMillis(); time = GetTimeInMillis();
miPointerAbsoluteCursor(x, y, time); //todo PostSyntheticMotion();
//miPointerAbsoluteCursor(x, y, time);
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
{ {
if ((buttonMask ^ g_old_button_mask) & (1 << i)) if ((buttonMask ^ g_old_button_mask) & (1 << i))
{ {
if (buttonMask & (1 << i)) if (buttonMask & (1 << i))
{ {
ev.u.u.type = ButtonPress; //e.header = ET_Internal;
ev.u.u.detail = i + 1; //e.type = ET_ButtonPress;
ev.u.keyButtonPointer.time = time;
mieqEnqueue(&ev); //ev.u.u.type = ButtonPress;
//ev.u.u.detail = i + 1;
//ev.u.keyButtonPointer.time = time;
//mieqEnqueue(0, &ev); // todo
} }
else else
{ {
ev.u.u.type = ButtonRelease; //ET_ButtonRelease
ev.u.u.detail = i + 1; //ev.u.u.type = ButtonRelease;
ev.u.keyButtonPointer.time = time; //ev.u.u.detail = i + 1;
mieqEnqueue(&ev); //ev.u.keyButtonPointer.time = time;
//mieqEnqueue(0, &ev); // todo
} }
} }
} }
@ -635,7 +654,7 @@ check_keysa(void)
ev.u.u.type = KeyRelease; ev.u.u.type = KeyRelease;
ev.u.keyButtonPointer.time = time; ev.u.keyButtonPointer.time = time;
ev.u.u.detail = g_ctrl_down; ev.u.u.detail = g_ctrl_down;
mieqEnqueue(&ev); //mieqEnqueue(&ev);
g_ctrl_down = 0; g_ctrl_down = 0;
} }
if (g_alt_down != 0) if (g_alt_down != 0)
@ -644,7 +663,7 @@ check_keysa(void)
ev.u.u.type = KeyRelease; ev.u.u.type = KeyRelease;
ev.u.keyButtonPointer.time = time; ev.u.keyButtonPointer.time = time;
ev.u.u.detail = g_alt_down; ev.u.u.detail = g_alt_down;
mieqEnqueue(&ev); //mieqEnqueue(&ev);
g_alt_down = 0; g_alt_down = 0;
} }
if (g_shift_down != 0) if (g_shift_down != 0)
@ -653,7 +672,7 @@ check_keysa(void)
ev.u.u.type = KeyRelease; ev.u.u.type = KeyRelease;
ev.u.keyButtonPointer.time = time; ev.u.keyButtonPointer.time = time;
ev.u.u.detail = g_shift_down; ev.u.u.detail = g_shift_down;
mieqEnqueue(&ev); //mieqEnqueue(&ev);
g_shift_down = 0; g_shift_down = 0;
} }
} }
@ -796,7 +815,7 @@ KbdAddEvent(int down, int param1, int param2, int param3, int param4)
if (x_scancode > 0) if (x_scancode > 0)
{ {
ev.u.u.detail = x_scancode; ev.u.u.detail = x_scancode;
mieqEnqueue(&ev); //mieqEnqueue(&ev);
} }
} }
@ -819,6 +838,7 @@ KbdSync(int param1)
{ {
return; return;
} }
#if 0
if ((!(keyc->state & 0x02)) != (!(param1 & 4))) /* caps lock */ if ((!(keyc->state & 0x02)) != (!(param1 & 4))) /* caps lock */
{ {
KbdAddEvent(1, 58, 0, 58, 0); KbdAddEvent(1, 58, 0, 58, 0);
@ -834,4 +854,5 @@ KbdSync(int param1)
KbdAddEvent(1, 70, 0, 70, 0); KbdAddEvent(1, 70, 0, 70, 0);
KbdAddEvent(0, 70, 49152, 70, 49152); KbdAddEvent(0, 70, 49152, 70, 49152);
} }
#endif
} }

@ -32,7 +32,10 @@ Sets up the functions
rdpScreenInfoRec g_rdpScreen; /* the one screen */ rdpScreenInfoRec g_rdpScreen; /* the one screen */
ScreenPtr g_pScreen = 0; ScreenPtr g_pScreen = 0;
int g_rdpGCIndex = -1;
//int g_rdpGCIndex = -1;
DevPrivateKeyRec g_rdpGCIndex;
/* set all these at once, use function set_bpp */ /* set all these at once, use function set_bpp */
int g_bpp = 16; int g_bpp = 16;
int g_Bpp = 2; int g_Bpp = 2;
@ -60,7 +63,7 @@ static miPointerSpriteFuncRec g_rdpSpritePointerFuncs =
rdpSpriteRealizeCursor, rdpSpriteRealizeCursor,
rdpSpriteUnrealizeCursor, rdpSpriteUnrealizeCursor,
rdpSpriteSetCursor, rdpSpriteSetCursor,
rdpSpriteMoveCursor, rdpSpriteMoveCursor
}; };
static miPointerScreenFuncRec g_rdpPointerCursorFuncs = static miPointerScreenFuncRec g_rdpPointerCursorFuncs =
{ {
@ -73,7 +76,9 @@ static miPointerScreenFuncRec g_rdpPointerCursorFuncs =
#define FB_GET_SCREEN_PIXMAP(s) ((PixmapPtr) ((s)->devPrivate)) #define FB_GET_SCREEN_PIXMAP(s) ((PixmapPtr) ((s)->devPrivate))
#if 0
static OsTimerPtr g_updateTimer = 0; static OsTimerPtr g_updateTimer = 0;
#endif
static XID g_wid = 0; static XID g_wid = 0;
static Bool static Bool
@ -233,17 +238,17 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char** argv)
case 8: case 8:
ret = fbScreenInit(pScreen, g_rdpScreen.pfbMemory, ret = fbScreenInit(pScreen, g_rdpScreen.pfbMemory,
g_rdpScreen.width, g_rdpScreen.height, g_rdpScreen.width, g_rdpScreen.height,
dpix, dpiy, g_rdpScreen.paddedWidthInBytes); dpix, dpiy, g_rdpScreen.paddedWidthInBytes, 8);
break; break;
case 16: case 16:
ret = fbScreenInit(pScreen, g_rdpScreen.pfbMemory, ret = fbScreenInit(pScreen, g_rdpScreen.pfbMemory,
g_rdpScreen.width, g_rdpScreen.height, g_rdpScreen.width, g_rdpScreen.height,
dpix, dpiy, g_rdpScreen.paddedWidthInBytes / 2); dpix, dpiy, g_rdpScreen.paddedWidthInBytes / 2, 16);
break; break;
case 32: case 32:
ret = fbScreenInit(pScreen, g_rdpScreen.pfbMemory, ret = fbScreenInit(pScreen, g_rdpScreen.pfbMemory,
g_rdpScreen.width, g_rdpScreen.height, g_rdpScreen.width, g_rdpScreen.height,
dpix, dpiy, g_rdpScreen.paddedWidthInBytes / 4); dpix, dpiy, g_rdpScreen.paddedWidthInBytes / 4, 32);
break; break;
default: default:
return 0; return 0;
@ -276,10 +281,12 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char** argv)
fbPictureInit(pScreen, 0, 0); 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 */ /* Random screen procedures */
g_rdpScreen.CloseScreen = pScreen->CloseScreen; g_rdpScreen.CloseScreen = pScreen->CloseScreen;
/* GC procedures */ /* GC procedures */
@ -288,8 +295,8 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char** argv)
g_rdpScreen.CreatePixmap = pScreen->CreatePixmap; g_rdpScreen.CreatePixmap = pScreen->CreatePixmap;
g_rdpScreen.DestroyPixmap = pScreen->DestroyPixmap; g_rdpScreen.DestroyPixmap = pScreen->DestroyPixmap;
/* Window Procedures */ /* Window Procedures */
g_rdpScreen.PaintWindowBackground = pScreen->PaintWindowBackground; //g_rdpScreen.PaintWindowBackground = pScreen->PaintWindowBackground;
g_rdpScreen.PaintWindowBorder = pScreen->PaintWindowBorder; //g_rdpScreen.PaintWindowBorder = pScreen->PaintWindowBorder;
g_rdpScreen.CopyWindow = pScreen->CopyWindow; g_rdpScreen.CopyWindow = pScreen->CopyWindow;
g_rdpScreen.ClearToBackground = pScreen->ClearToBackground; g_rdpScreen.ClearToBackground = pScreen->ClearToBackground;
/* Backing store procedures */ /* Backing store procedures */
@ -316,8 +323,8 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char** argv)
/* pScreen->CreatePixmap = rdpCreatePixmap; */ /* pScreen->CreatePixmap = rdpCreatePixmap; */
/* pScreen->DestroyPixmap = rdpDestroyPixmap; */ /* pScreen->DestroyPixmap = rdpDestroyPixmap; */
/* Window Procedures */ /* Window Procedures */
pScreen->PaintWindowBackground = rdpPaintWindowBackground; //pScreen->PaintWindowBackground = rdpPaintWindowBackground;
pScreen->PaintWindowBorder = rdpPaintWindowBorder; //pScreen->PaintWindowBorder = rdpPaintWindowBorder;
pScreen->CopyWindow = rdpCopyWindow; pScreen->CopyWindow = rdpCopyWindow;
pScreen->ClearToBackground = rdpClearToBackground; pScreen->ClearToBackground = rdpClearToBackground;
/* Backing store procedures */ /* Backing store procedures */
@ -342,7 +349,7 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char** argv)
} }
if (g_rdpScreen.bitsPerPixel == 1) if (g_rdpScreen.bitsPerPixel == 1)
{ {
ret = mfbCreateDefColormap(pScreen); ret = fbCreateDefColormap(pScreen);
} }
else else
{ {
@ -472,11 +479,11 @@ InitOutput(ScreenInfo* screenInfo, int argc, char** argv)
{ {
screenInfo->formats[i] = g_formats[i]; screenInfo->formats[i] = g_formats[i];
} }
g_rdpGCIndex = AllocateGCPrivateIndex(); //g_rdpGCIndex = miAllocateGCPrivateIndex();
if (g_rdpGCIndex < 0) //if (g_rdpGCIndex < 0)
{ //{
FatalError("InitOutput: AllocateGCPrivateIndex failed\n"); // FatalError("InitOutput: miAllocateGCPrivateIndex failed\n");
} //}
if (!AddCallback(&ClientStateCallback, rdpClientStateChange, NULL)) if (!AddCallback(&ClientStateCallback, rdpClientStateChange, NULL))
{ {
rdpLog("InitOutput: AddCallback failed\n"); rdpLog("InitOutput: AddCallback failed\n");
@ -496,13 +503,18 @@ InitInput(int argc, char** argv)
DeviceIntPtr p; DeviceIntPtr p;
DeviceIntPtr k; DeviceIntPtr k;
k = AddInputDevice(rdpKeybdProc, 1); k = AddInputDevice(serverClient, rdpKeybdProc, 1);
p = AddInputDevice(rdpMouseProc, 1); p = AddInputDevice(serverClient, rdpMouseProc, 1);
RegisterKeyboardDevice(k); RegisterKeyboardDevice(k);
RegisterPointerDevice(p); RegisterPointerDevice(p);
// TODO
#if 0
/* screenInfo must be globally defined */ /* screenInfo must be globally defined */
miRegisterPointerDevice(screenInfo.screens[0], p); miRegisterPointerDevice(screenInfo.screens[0], p);
mieqInit(k, p); mieqInit(k, p);
#endif
} }
/******************************************************************************/ /******************************************************************************/
@ -523,7 +535,7 @@ ddxGiveUp(void)
/******************************************************************************/ /******************************************************************************/
Bool Bool
LegalModifier(unsigned int key, DevicePtr pDev) LegalModifier(unsigned int key, DeviceIntPtr pDev)
{ {
return 1; /* true */ return 1; /* true */
} }
@ -533,7 +545,7 @@ void
ProcessInputEvents(void) ProcessInputEvents(void)
{ {
mieqProcessInputEvents(); mieqProcessInputEvents();
miPointerUpdate(); //miPointerUpdate();
} }
/******************************************************************************/ /******************************************************************************/
@ -668,6 +680,7 @@ rdpRandRGetInfo(ScreenPtr pScreen, Rotation* pRotations)
return TRUE; return TRUE;
} }
#if 0
/******************************************************************************/ /******************************************************************************/
static CARD32 static CARD32
rdpDeferredDrawCallback(OsTimerPtr timer, CARD32 now, pointer arg) rdpDeferredDrawCallback(OsTimerPtr timer, CARD32 now, pointer arg)
@ -683,6 +696,7 @@ rdpDeferredDrawCallback(OsTimerPtr timer, CARD32 now, pointer arg)
*/ */
return 0; return 0;
} }
#endif
/******************************************************************************/ /******************************************************************************/
/* for lack of a better way, a window is created that covers a the area and /* 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; Mask mask;
DEBUG_OUT(("rdpInvalidateArea:\n")); DEBUG_OUT(("rdpInvalidateArea:\n"));
rootWindow = GetCurrentRootWindow(); rootWindow = 0; // GetCurrentRootWindow();
if (rootWindow != 0) if (rootWindow != 0)
{ {
mask = 0; mask = 0;
@ -739,7 +753,6 @@ rdpRandRSetConfig(ScreenPtr pScreen, Rotation rotateKind, int rate,
PixmapPtr screenPixmap; PixmapPtr screenPixmap;
WindowPtr rootWindow; WindowPtr rootWindow;
BoxRec box; BoxRec box;
RegionRec temp;
if ((pSize->width < 1) || (pSize->height < 1)) if ((pSize->width < 1) || (pSize->height < 1))
{ {
@ -782,7 +795,7 @@ rdpRandRSetConfig(ScreenPtr pScreen, Rotation rotateKind, int rate,
screenPixmap->drawable.width, screenPixmap->drawable.height)); screenPixmap->drawable.width, screenPixmap->drawable.height));
/* memset(g_rdpScreen.pfbMemory, 0xff, 2048 * 2048 * 4); */ /* memset(g_rdpScreen.pfbMemory, 0xff, 2048 * 2048 * 4); */
} }
rootWindow = GetCurrentRootWindow(); rootWindow = 0; // GetCurrentRootWindow();
if (rootWindow != 0) if (rootWindow != 0)
{ {
DEBUG_OUT(("rdpRandRSetConfig: rootWindow %p\n", (void*)rootWindow)); DEBUG_OUT(("rdpRandRSetConfig: rootWindow %p\n", (void*)rootWindow));
@ -790,10 +803,10 @@ rdpRandRSetConfig(ScreenPtr pScreen, Rotation rotateKind, int rate,
box.y1 = 0; box.y1 = 0;
box.x2 = pSize->width; box.x2 = pSize->width;
box.y2 = pSize->height; box.y2 = pSize->height;
miRegionInit(&rootWindow->winSize, &box, 1); RegionInit(&rootWindow->winSize, &box, 1);
miRegionInit(&rootWindow->borderSize, &box, 1); RegionInit(&rootWindow->borderSize, &box, 1);
miRegionReset(&rootWindow->borderClip, &box); RegionReset(&rootWindow->borderClip, &box);
miRegionBreak(&rootWindow->clipList); RegionBreak(&rootWindow->clipList);
rootWindow->drawable.width = pSize->width; rootWindow->drawable.width = pSize->width;
rootWindow->drawable.height = pSize->height; rootWindow->drawable.height = pSize->height;
ResizeChildrenWinSize(rootWindow, 0, 0, 0, 0); ResizeChildrenWinSize(rootWindow, 0, 0, 0, 0);

@ -33,9 +33,9 @@ static int g_sck_closed = 0;
static int g_connected = 0; static int g_connected = 0;
static int g_dis_listen_sck = 0; static int g_dis_listen_sck = 0;
static int g_dis_sck = 0; //static int g_dis_sck = 0;
static int g_dis_sck_closed = 0; //static int g_dis_sck_closed = 0;
static int g_dis_connected = 0; //static int g_dis_connected = 0;
static int g_begin = 0; static int g_begin = 0;
static struct stream* g_out_s = 0; static struct stream* g_out_s = 0;
@ -285,7 +285,7 @@ process_screen_size_msg(int width, int height, int bpp)
RRScreenSizePtr pSize; RRScreenSizePtr pSize;
int mmwidth; int mmwidth;
int mmheight; int mmheight;
int error; //int error;
ErrorF("process_screen_size_msg: set width %d height %d bpp %d\n", ErrorF("process_screen_size_msg: set width %d height %d bpp %d\n",
width, height, bpp); 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); RRSetCurrentConfig(g_pScreen, RR_Rotate_0, 0, pSize);
if ((g_rdpScreen.width != width) || (g_rdpScreen.height != height)) if ((g_rdpScreen.width != width) || (g_rdpScreen.height != height))
{ {
error = RRSetScreenConfig(g_pScreen, RR_Rotate_0, 0, pSize); //error = RRSetScreenConfig(g_pScreen, RR_Rotate_0, 0, pSize);
if (error == BadImplementation) //if (error == BadImplementation)
{ //{
ErrorF("process_screen_size_msg: RRSetScreenConfig returned " // ErrorF("process_screen_size_msg: RRSetScreenConfig returned "
"BadImplementation\n"); // "BadImplementation\n");
} //}
} }
return 0;
} }
/******************************************************************************/ /******************************************************************************/

Loading…
Cancel
Save