From 147ace738233435408df18415c7d802631f7fecc Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sat, 18 Jan 2014 16:11:30 -0800 Subject: xorg: work on xorg driver --- xorg/server/module/Makefile | 3 +- xorg/server/module/rdpClientCon.c | 291 ++++++++++++++++++++++++++++++++++- xorg/server/module/rdpClientCon.h | 27 ++++ xorg/server/module/rdpDraw.c | 100 ++++++++++++ xorg/server/module/rdpDraw.h | 2 + xorg/server/module/rdpPolyFillRect.c | 53 ++++++- xorg/server/xrdpdev/Makefile | 3 +- xorg/server/xrdpdev/xrdpdev.c | 4 + xorg/server/xrdpkeyb/Makefile | 3 +- xorg/server/xrdpmouse/Makefile | 3 +- 10 files changed, 469 insertions(+), 20 deletions(-) diff --git a/xorg/server/module/Makefile b/xorg/server/module/Makefile index d30b2ba9..91f38679 100644 --- a/xorg/server/module/Makefile +++ b/xorg/server/module/Makefile @@ -7,7 +7,8 @@ rdpImageText16.o rdpImageGlyphBlt.o rdpPolyGlyphBlt.o rdpPushPixels.o \ rdpCursor.o rdpMain.o rdpRandR.o rdpMisc.o rdpReg.o \ rdpComposite.o rdpGlyphs.o rdpPixmap.o rdpInput.o rdpClientCon.o -CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 +CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 \ +-I../../../common LDFLAGS = diff --git a/xorg/server/module/rdpClientCon.c b/xorg/server/module/rdpClientCon.c index 729de591..73b08500 100644 --- a/xorg/server/module/rdpClientCon.c +++ b/xorg/server/module/rdpClientCon.c @@ -26,6 +26,8 @@ Client connection to xrdp #include #include #include +#include +#include /* this should be before all X11 .h files */ #include @@ -39,6 +41,7 @@ Client connection to xrdp #include "rdpClientCon.h" #include "rdpMisc.h" #include "rdpInput.h" +#include "rdpReg.h" #define LOG_LEVEL 1 #define LLOGLN(_level, _args) \ @@ -149,6 +152,9 @@ rdpClientConGotConnection(ScreenPtr pScreen, rdpPtr dev) dev->clientConTail->next = clientCon; dev->clientConTail = clientCon; } + + clientCon->dirtyRegion = rdpRegionCreate(NullBox, 0); + return 0; } @@ -241,19 +247,25 @@ rdpClientConDisconnect(rdpPtr dev, rdpClientCon *clientCon) dev->clientConHead = pcli->next; if (dev->clientConHead == NULL) { + /* removed only */ dev->clientConTail = NULL; } } else { plcli->next = pcli->next; + if (pcli == dev->clientConTail) + { + /* removed last */ + dev->clientConTail = plcli; + } } break; } plcli = pcli; pcli = pcli->next; } - + rdpRegionDestroy(clientCon->dirtyRegion); g_free(clientCon); return 0; } @@ -427,12 +439,17 @@ rdpClientConRecvMsg(rdpPtr dev, rdpClientCon *clientCon) if (rv == 0) { + s->end = s->data + 4; in_uint32_le(s, len); if (len > 3) { init_stream(s, len); rv = rdpClientConRecv(dev, clientCon, s->data, len - 4); + if (rv == 0) + { + s->end = s->data + len; + } } } } @@ -508,6 +525,93 @@ rdpClientConProcessMsgVersion(rdpPtr dev, rdpClientCon *clientCon, return 0; } +/******************************************************************************/ +/* + this from miScreenInit + pScreen->mmWidth = (xsize * 254 + dpix * 5) / (dpix * 10); + pScreen->mmHeight = (ysize * 254 + dpiy * 5) / (dpiy * 10); +*/ +static int +rdpClientConProcessScreenSizeMsg(rdpPtr dev, rdpClientCon *clientCon, + int width, int height, int bpp) +{ + RRScreenSizePtr pSize; + int mmwidth; + int mmheight; + int bytes; + Bool ok; + + LLOGLN(0, ("rdpClientConProcessScreenSizeMsg: set width %d height %d bpp %d", + width, height, bpp)); + clientCon->rdp_width = width; + clientCon->rdp_height = height; + clientCon->rdp_bpp = bpp; + + if (bpp < 15) + { + clientCon->rdp_Bpp = 1; + clientCon->rdp_Bpp_mask = 0xff; + } + else if (bpp == 15) + { + clientCon->rdp_Bpp = 2; + clientCon->rdp_Bpp_mask = 0x7fff; + } + else if (bpp == 16) + { + clientCon->rdp_Bpp = 2; + clientCon->rdp_Bpp_mask = 0xffff; + } + else if (bpp > 16) + { + clientCon->rdp_Bpp = 4; + clientCon->rdp_Bpp_mask = 0xffffff; + } + +// todo +#if 0 + if (g_use_shmem) + { + if (g_shmemptr != 0) + { + shmdt(g_shmemptr); + } + bytes = g_rdpScreen.rdp_width * g_rdpScreen.rdp_height * + g_rdpScreen.rdp_Bpp; + g_shmemid = shmget(IPC_PRIVATE, bytes, IPC_CREAT | 0777); + g_shmemptr = shmat(g_shmemid, 0, 0); + shmctl(g_shmemid, IPC_RMID, NULL); + LLOGLN(0, ("rdpClientConProcessScreenSizeMsg: g_shmemid %d g_shmemptr %p", + g_shmemid, g_shmemptr)); + g_shmem_lineBytes = g_rdpScreen.rdp_Bpp * g_rdpScreen.rdp_width; + + if (g_shm_reg != 0) + { + RegionDestroy(g_shm_reg); + } + g_shm_reg = RegionCreate(NullBox, 0); + } +#endif + + mmwidth = PixelToMM(width); + mmheight = PixelToMM(height); + +// todo +#if 0 + pSize = RRRegisterSize(g_pScreen, width, height, mmwidth, mmheight); + RRSetCurrentConfig(g_pScreen, RR_Rotate_0, 0, pSize); + + if ((g_rdpScreen.width != width) || (g_rdpScreen.height != height)) + { + LLOGLN(0, (" calling RRScreenSizeSet")); + ok = RRScreenSizeSet(g_pScreen, width, height, mmwidth, mmheight); + LLOGLN(0, (" RRScreenSizeSet ok=[%d]", ok)); + } +#endif + + return 0; +} + /******************************************************************************/ static int rdpClientConProcessMsgClientInput(rdpPtr dev, rdpClientCon *clientCon) @@ -539,9 +643,14 @@ rdpClientConProcessMsgClientInput(rdpPtr dev, rdpClientCon *clientCon) } else if (msg == 200) /* invalidate */ { + rdpClientConBeginUpdate(dev, clientCon); + rdpClientConSetFgcolor(dev, clientCon, 0x00ff0000); + rdpClientConFillRect(dev, clientCon, 0, 0, dev->width, dev->height); + rdpClientConEndUpdate(dev, clientCon); } else if (msg == 300) /* resize desktop */ { + rdpClientConProcessScreenSizeMsg(dev, clientCon, param1, param2, param3); } else if (msg == 301) /* version */ { @@ -561,10 +670,89 @@ static int rdpClientConProcessMsgClientInfo(rdpPtr dev, rdpClientCon *clientCon) { struct stream *s; + int bytes; + int i1; LLOGLN(0, ("rdpClientConProcessMsgClientInfo:")); s = clientCon->in_s; - g_hexdump(s->p, s->end - s->p); + in_uint32_le(s, bytes); + if (bytes > sizeof(clientCon->client_info)) + { + bytes = sizeof(clientCon->client_info); + } + memcpy(&(clientCon->client_info), s->p - 4, bytes); + clientCon->client_info.size = bytes; + + LLOGLN(0, (" got client info bytes %d", bytes)); + LLOGLN(0, (" jpeg support %d", clientCon->client_info.jpeg)); + i1 = clientCon->client_info.offscreen_support_level; + LLOGLN(0, (" offscreen support %d", i1)); + i1 = clientCon->client_info.offscreen_cache_size; + LLOGLN(0, (" offscreen size %d", i1)); + i1 = clientCon->client_info.offscreen_cache_entries; + LLOGLN(0, (" offscreen entries %d", i1)); + + if (clientCon->client_info.offscreen_support_level > 0) + { + if (clientCon->client_info.offscreen_cache_entries > 0) + { + clientCon->maxOsBitmaps = clientCon->client_info.offscreen_cache_entries; + g_free(clientCon->osBitmaps); + clientCon->osBitmaps = (struct rdpup_os_bitmap *) + g_malloc(sizeof(struct rdpup_os_bitmap) * clientCon->maxOsBitmaps, 1); + } + } + + if (clientCon->client_info.orders[0x1b]) /* 27 NEG_GLYPH_INDEX_INDEX */ + { + LLOGLN(0, (" client supports glyph cache but server disabled")); + //clientCon->doGlyphCache = 1; + } + if (clientCon->client_info.order_flags_ex & 0x100) + { + clientCon->doComposite = 1; + } + if (clientCon->doGlyphCache) + { + LLOGLN(0, (" using glyph cache")); + } + if (clientCon->doComposite) + { + LLOGLN(0, (" using client composite")); + } + LLOGLN(10, ("order_flags_ex 0x%x", clientCon->client_info.order_flags_ex)); + if (clientCon->client_info.offscreen_cache_entries == 2000) + { + LLOGLN(0, (" client can do offscreen to offscreen blits")); + clientCon->canDoPixToPix = 1; + } + else + { + LLOGLN(0, (" client can not do offscreen to offscreen blits")); + clientCon->canDoPixToPix = 0; + } + if (clientCon->client_info.pointer_flags & 1) + { + LLOGLN(0, (" client can do new(color) cursor")); + } + else + { + LLOGLN(0, (" client can not do new(color) cursor")); + } + if (clientCon->client_info.monitorCount > 0) + { + LLOGLN(0, (" client can do multimon")); + LLOGLN(0, (" client monitor data, monitorCount= %d", clientCon->client_info.monitorCount)); + clientCon->doMultimon = 1; + } + else + { + LLOGLN(0, (" client can not do multimon")); + clientCon->doMultimon = 0; + } + + //rdpLoadLayout(g_rdpScreen.client_info.keylayout); + return 0; } @@ -613,14 +801,17 @@ rdpClientConProcessMsg(rdpPtr dev, rdpClientCon *clientCon) static int rdpClientConGotData(ScreenPtr pScreen, rdpPtr dev, rdpClientCon *clientCon) { + int rv; + LLOGLN(10, ("rdpClientConGotData:")); - if (rdpClientConRecvMsg(dev, clientCon) == 0) + rv = rdpClientConRecvMsg(dev, clientCon); + if (rv == 0) { - rdpClientConProcessMsg(dev, clientCon); + rv = rdpClientConProcessMsg(dev, clientCon); } - return 0; + return rv; } /******************************************************************************/ @@ -716,21 +907,36 @@ rdpClientConCheck(ScreenPtr pScreen) { if (FD_ISSET(LTOUI32(clientCon->sck), &rfds)) { - rdpClientConGotData(pScreen, dev, clientCon); + if (rdpClientConGotData(pScreen, dev, clientCon) != 0) + { + LLOGLN(0, ("rdpClientConCheck: rdpClientConGotData failed")); + clientCon = dev->clientConHead; + continue; + } } } if (clientCon->sckControlListener > 0) { if (FD_ISSET(LTOUI32(clientCon->sckControlListener), &rfds)) { - rdpClientConGotControlConnection(pScreen, dev, clientCon); + if (rdpClientConGotControlConnection(pScreen, dev, clientCon) != 0) + { + LLOGLN(0, ("rdpClientConCheck: rdpClientConGotControlConnection failed")); + clientCon = dev->clientConHead; + continue; + } } } if (clientCon->sckControl > 0) { if (FD_ISSET(LTOUI32(clientCon->sckControl), &rfds)) { - rdpClientConGotControlData(pScreen, dev, clientCon); + if (rdpClientConGotControlData(pScreen, dev, clientCon) != 0) + { + LLOGLN(0, ("rdpClientConCheck: rdpClientConGotControlData failed")); + clientCon = dev->clientConHead; + continue; + } } } clientCon = clientCon->next; @@ -1612,3 +1818,72 @@ rdpClientConCheckDirtyScreen(rdpPtr dev, rdpClientCon *clientCon) { return 0; } + +/******************************************************************************/ +int +rdpClientConAddDirtyScreenReg(rdpPtr dev, rdpClientCon *clientCon, + RegionPtr reg) +{ + rdpRegionUnion(clientCon->dirtyRegion, clientCon->dirtyRegion, reg); + return 0; +} + +/******************************************************************************/ +void +rdpClientConGetScreenImageRect(rdpPtr dev, rdpClientCon *clientCon, + struct image_data *id) +{ + id->width = dev->width; + id->height = dev->height; + id->bpp = clientCon->rdp_bpp; + id->Bpp = clientCon->rdp_Bpp; + id->lineBytes = dev->paddedWidthInBytes; + id->pixels = dev->pfbMemory; + id->shmem_pixels = g_shmemptr; + id->shmem_id = g_shmemid; + id->shmem_offset = 0; + id->shmem_lineBytes = g_shmem_lineBytes; +} + +/******************************************************************************/ +void +rdpClientConGetPixmapImageRect(rdpPtr dev, rdpClientCon *clientCon, + PixmapPtr pPixmap, struct image_data *id) +{ + id->width = pPixmap->drawable.width; + id->height = pPixmap->drawable.height; + id->bpp = g_rdpScreen.rdp_bpp; + id->Bpp = g_rdpScreen.rdp_Bpp; + id->lineBytes = pPixmap->devKind; + id->pixels = (char *)(pPixmap->devPrivate.ptr); + id->shmem_pixels = 0; + id->shmem_id = 0; + id->shmem_offset = 0; + id->shmem_lineBytes = 0; +} + +/******************************************************************************/ +void +rdpClientConSendArea(struct image_data *id, int x, int y, int w, int h) +{ + struct image_data lid; + + LLOGLN(10, ("rdpClientConSendArea: id %p x %d y %d w %d h %d", id, x, y, w, h)); + + if (id == 0) + { + rdpup_get_screen_image_rect(&lid); + id = &lid; + } + + if (x >= id->width) + { + return; + } + + if (y >= id->height) + { + return; + } + +} diff --git a/xorg/server/module/rdpClientCon.h b/xorg/server/module/rdpClientCon.h index 84474bbd..2551a4ed 100644 --- a/xorg/server/module/rdpClientCon.h +++ b/xorg/server/module/rdpClientCon.h @@ -21,6 +21,10 @@ Client connection to xrdp */ +/* in xrdp/common */ +#include "xrdp_client_info.h" +#include "xrdp_constants.h" + #ifndef _RDPCLIENTCON_H #define _RDPCLIENTCON_H @@ -63,9 +67,16 @@ struct _rdpClientCon int osBitmapStamp; int osBitmapAllocSize; int osBitmapNumUsed; + int doComposite; + int doGlyphCache; + int canDoPixToPix; + int doMultimon; int rdp_bpp; /* client depth */ + int rdp_Bpp; int rdp_Bpp_mask; + int rdp_width; + int rdp_height; int rdpIndex; /* current os target */ @@ -75,9 +86,22 @@ struct _rdpClientCon struct font_cache font_cache[12][256]; int font_stamp; + RegionPtr dirtyRegion; + + struct xrdp_client_info client_info; + struct _rdpClientCon *next; }; +int +rdpClientConBeginUpdate(rdpPtr dev, rdpClientCon *clientCon); +int +rdpClientConEndUpdate(rdpPtr dev, rdpClientCon *clientCon); +int +rdpClientConSetFgcolor(rdpPtr dev, rdpClientCon *clientCon, int fgcolor); +int +rdpClientConFillRect(rdpPtr dev, rdpClientCon *clientCon, + short x, short y, int cx, int cy); int rdpClientConCheck(ScreenPtr pScreen); int @@ -95,6 +119,9 @@ void rdpClientConScheduleDeferredUpdate(rdpPtr dev); int rdpClientConCheckDirtyScreen(rdpPtr dev, rdpClientCon *clientCon); +int +rdpClientConAddDirtyScreenReg(rdpPtr dev, rdpClientCon *clientCon, + RegionPtr reg); #endif diff --git a/xorg/server/module/rdpDraw.c b/xorg/server/module/rdpDraw.c index fc3637c4..a731ee98 100644 --- a/xorg/server/module/rdpDraw.c +++ b/xorg/server/module/rdpDraw.c @@ -48,6 +48,106 @@ misc draw calls #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) +/******************************************************************************/ +/* return 0, draw nothing */ +/* return 1, draw with no clip */ +/* return 2, draw using clip */ +int +rdpDrawGetClip(rdpPtr dev, RegionPtr pRegion, DrawablePtr pDrawable, GCPtr pGC) +{ + WindowPtr pWindow; + RegionPtr temp; + BoxRec box; + int rv; + + rv = 0; + + if (pDrawable->type == DRAWABLE_PIXMAP) + { + switch (pGC->clientClipType) + { + case CT_NONE: + rv = 1; + break; + case CT_REGION: + rv = 2; + rdpRegionCopy(pRegion, pGC->clientClip); + break; + default: + LLOGLN(0, ("rdpDrawGetClip: unimp clip type %d", + pGC->clientClipType)); + break; + } + + if (rv == 2) /* check if the clip is the entire pixmap */ + { + box.x1 = 0; + box.y1 = 0; + box.x2 = pDrawable->width; + box.y2 = pDrawable->height; + + if (rdpRegionContainsRect(pRegion, &box) == rgnIN) + { + rv = 1; + } + } + } + else if (pDrawable->type == DRAWABLE_WINDOW) + { + pWindow = (WindowPtr)pDrawable; + + if (pWindow->viewable) + { + if (pGC->subWindowMode == IncludeInferiors) + { + temp = &pWindow->borderClip; + } + else + { + temp = &pWindow->clipList; + } + + if (RegionNotEmpty(temp)) + { + switch (pGC->clientClipType) + { + case CT_NONE: + rv = 2; + rdpRegionCopy(pRegion, temp); + break; + case CT_REGION: + rv = 2; + rdpRegionCopy(pRegion, pGC->clientClip); + rdpRegionTranslate(pRegion, + pDrawable->x + pGC->clipOrg.x, + pDrawable->y + pGC->clipOrg.y); + rdpRegionIntersect(pRegion, pRegion, temp); + break; + default: + LLOGLN(0, ("rdpDrawGetClip: unimp clip type %d", + pGC->clientClipType)); + break; + } + + if (rv == 2) /* check if the clip is the entire screen */ + { + box.x1 = 0; + box.y1 = 0; + box.x2 = dev->width; + box.y2 = dev->height; + + if (rdpRegionContainsRect(pRegion, &box) == rgnIN) + { + rv = 1; + } + } + } + } + } + + return rv; +} + /******************************************************************************/ int rdpDrawItemAdd(rdpPtr dev, rdpPixmapRec *priv, struct rdp_draw_item *di) diff --git a/xorg/server/module/rdpDraw.h b/xorg/server/module/rdpDraw.h index 99e81e02..eaebddb2 100644 --- a/xorg/server/module/rdpDraw.h +++ b/xorg/server/module/rdpDraw.h @@ -50,6 +50,8 @@ do { \ extern GCOps g_rdpGCOps; /* in rdpGC.c */ +int +rdpDrawGetClip(rdpPtr dev, RegionPtr pRegion, DrawablePtr pDrawable, GCPtr pGC); int rdpDrawItemAdd(rdpPtr dev, rdpPixmapRec *priv, struct rdp_draw_item *di); int diff --git a/xorg/server/module/rdpPolyFillRect.c b/xorg/server/module/rdpPolyFillRect.c index 8df6505a..afcdf3cc 100644 --- a/xorg/server/module/rdpPolyFillRect.c +++ b/xorg/server/module/rdpPolyFillRect.c @@ -33,6 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "rdp.h" #include "rdpDraw.h" #include "rdpClientCon.h" +#include "rdpReg.h" #define LOG_LEVEL 1 #define LLOGLN(_level, _args) \ @@ -40,9 +41,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /******************************************************************************/ static void -rdpPolyFillRectPre(rdpClientCon *clientCon, - DrawablePtr pDrawable, GCPtr pGC, int nrectFill, - xRectangle *prectInit) +rdpPolyFillRectPre(rdpPtr dev, rdpClientCon *clientCon, + int cd, RegionPtr clip_reg, + DrawablePtr pDrawable, GCPtr pGC, RegionPtr fill_reg) { } @@ -60,10 +61,31 @@ rdpPolyFillRectOrg(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, /******************************************************************************/ static void -rdpPolyFillRectPost(rdpClientCon *clientCon, - DrawablePtr pDrawable, GCPtr pGC, int nrectFill, - xRectangle *prectInit) +rdpPolyFillRectPost(rdpPtr dev, rdpClientCon *clientCon, + int cd, RegionPtr clip_reg, + DrawablePtr pDrawable, GCPtr pGC, RegionPtr fill_reg) { + BoxRec box; + WindowPtr pDstWnd; + + if (cd == 0) + { + return; + } + if (pDrawable->type != DRAWABLE_WINDOW) + { + return; + } + pDstWnd = (WindowPtr) pDrawable; + if (pDstWnd->viewable == FALSE) + { + return; + } + if (cd == 2) + { + rdpRegionIntersect(fill_reg, clip_reg, fill_reg); + } + rdpClientConAddDirtyScreenReg(dev, clientCon, fill_reg); } /******************************************************************************/ @@ -73,13 +95,25 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, { rdpPtr dev; rdpClientCon *clientCon; + RegionRec clip_reg; + RegionPtr fill_reg; + int cd; LLOGLN(10, ("rdpPolyFillRect:")); dev = rdpGetDevFromScreen(pGC->pScreen); + + /* make a copy of rects */ + fill_reg = rdpRegionFromRects(nrectFill, prectInit, CT_NONE); + rdpRegionTranslate(fill_reg, pDrawable->x, pDrawable->y); + + rdpRegionInit(&clip_reg, NullBox, 0); + cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); + LLOGLN(0, ("rdpPolyFillRect: cd %d", cd)); clientCon = dev->clientConHead; while (clientCon != NULL) { - rdpPolyFillRectPre(clientCon, pDrawable, pGC, nrectFill, prectInit); + rdpPolyFillRectPre(dev, clientCon, cd, &clip_reg, pDrawable, + pGC, fill_reg); clientCon = clientCon->next; } /* do original call */ @@ -87,7 +121,10 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, clientCon = dev->clientConHead; while (clientCon != NULL) { - rdpPolyFillRectPost(clientCon, pDrawable, pGC, nrectFill, prectInit); + rdpPolyFillRectPost(dev, clientCon, cd, &clip_reg, pDrawable, + pGC, fill_reg); clientCon = clientCon->next; } + RegionUninit(&clip_reg); + rdpRegionDestroy(fill_reg); } diff --git a/xorg/server/xrdpdev/Makefile b/xorg/server/xrdpdev/Makefile index 0219959e..bd17699f 100644 --- a/xorg/server/xrdpdev/Makefile +++ b/xorg/server/xrdpdev/Makefile @@ -1,7 +1,8 @@ OBJS = xrdpdev.o -CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 -I../module +CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 \ +-I../module -I../../../common LDFLAGS = diff --git a/xorg/server/xrdpdev/xrdpdev.c b/xorg/server/xrdpdev/xrdpdev.c index e0b92ffe..6c8f54d7 100644 --- a/xorg/server/xrdpdev/xrdpdev.c +++ b/xorg/server/xrdpdev/xrdpdev.c @@ -542,6 +542,10 @@ rdpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) LLOGLN(0, ("rdpScreenInit: rdpClientConInit failed")); } + dev->Bpp_mask = 0x00FFFFFF; + dev->Bpp = 4; + dev->bitsPerPixel = 32; + LLOGLN(0, ("rdpScreenInit: out")); return TRUE; } diff --git a/xorg/server/xrdpkeyb/Makefile b/xorg/server/xrdpkeyb/Makefile index c8654851..8c81fcee 100644 --- a/xorg/server/xrdpkeyb/Makefile +++ b/xorg/server/xrdpkeyb/Makefile @@ -1,7 +1,8 @@ OBJS = rdpKeyboard.o -CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 -I../module +CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 \ +-I../module -I../../../common LDFLAGS = diff --git a/xorg/server/xrdpmouse/Makefile b/xorg/server/xrdpmouse/Makefile index dfcabc88..905308ad 100644 --- a/xorg/server/xrdpmouse/Makefile +++ b/xorg/server/xrdpmouse/Makefile @@ -1,7 +1,8 @@ OBJS = rdpMouse.o -CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 -I../module +CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 \ +-I../module -I../../../common LDFLAGS = -- cgit v1.2.1 From 2360bef91ad0598a94cfd8d662a8ea1e9e5bf1ae Mon Sep 17 00:00:00 2001 From: speidy Date: Sun, 19 Jan 2014 15:18:58 +0200 Subject: neutrinordp: fix for rail proxy, change freerdp_UnicodeToAsciiAlloc calls --- neutrinordp/xrdp-neutrinordp.c | 43 +++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/neutrinordp/xrdp-neutrinordp.c b/neutrinordp/xrdp-neutrinordp.c index f0424c26..3602e57c 100644 --- a/neutrinordp/xrdp-neutrinordp.c +++ b/neutrinordp/xrdp-neutrinordp.c @@ -17,17 +17,17 @@ * limitations under the License. */ -#include -#include #include "xrdp-neutrinordp.h" #include "xrdp-color.h" #include "xrdp_rail.h" #include "log.h" +#include +#include #ifdef XRDP_DEBUG #define LOG_LEVEL 99 #else -#define LOG_LEVEL 1 +#define LOG_LEVEL 10 #endif #define LLOG(_level, _args) \ @@ -1478,8 +1478,10 @@ lrail_WindowCreate(rdpContext *context, WINDOW_ORDER_INFO *orderInfo, int index; struct mod *mod; struct rail_window_state_order wso; + UNICONV* uniconv; LLOGLN(0, ("llrail_WindowCreate:")); + uniconv = freerdp_uniconv_new(); mod = ((struct mod_context *)context)->modi; memset(&wso, 0, sizeof(wso)); /* copy the window state order */ @@ -1490,7 +1492,8 @@ lrail_WindowCreate(rdpContext *context, WINDOW_ORDER_INFO *orderInfo, if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_TITLE) { - freerdp_UnicodeToAsciiAlloc(window_state->titleInfo.string, &wso.title_info, window_state->titleInfo.length / 2); + wso.title_info = freerdp_uniconv_in(uniconv, + window_state->titleInfo.string, window_state->titleInfo.length); } LLOGLN(0, ("lrail_WindowCreate: %s", wso.title_info)); @@ -1616,29 +1619,31 @@ lrail_NotifyIconCreate(rdpContext *context, WINDOW_ORDER_INFO *orderInfo, { struct mod *mod; struct rail_notify_state_order rnso; + UNICONV* uniconv; LLOGLN(0, ("lrail_NotifyIconCreate:")); - + uniconv = freerdp_uniconv_new(); mod = ((struct mod_context *)context)->modi; memset(&rnso, 0, sizeof(rnso)); rnso.version = notify_icon_state->version; if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_NOTIFY_TIP) - { - freerdp_UnicodeToAsciiAlloc(notify_icon_state->toolTip.string, - &rnso.tool_tip, notify_icon_state->toolTip.length / 2); - } - - if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP) - { - rnso.infotip.timeout = notify_icon_state->infoTip.timeout; - rnso.infotip.flags = notify_icon_state->infoTip.flags; - freerdp_UnicodeToAsciiAlloc(notify_icon_state->infoTip.text.string, - &rnso.infotip.text, notify_icon_state->infoTip.text.length / 2); - freerdp_UnicodeToAsciiAlloc(notify_icon_state->infoTip.title.string, - &rnso.infotip.title, notify_icon_state->infoTip.title.length / 2); - } + { + rnso.tool_tip = freerdp_uniconv_in(uniconv, + notify_icon_state->toolTip.string, notify_icon_state->toolTip.length); + } + if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP) + { + rnso.infotip.timeout = notify_icon_state->infoTip.timeout; + rnso.infotip.flags = notify_icon_state->infoTip.flags; + rnso.infotip.text = freerdp_uniconv_in(uniconv, + notify_icon_state->infoTip.text.string, + notify_icon_state->infoTip.text.length); + rnso.infotip.title = freerdp_uniconv_in(uniconv, + notify_icon_state->infoTip.title.string, + notify_icon_state->infoTip.title.length); + } rnso.state = notify_icon_state->state; rnso.icon_cache_entry = notify_icon_state->icon.cacheEntry; -- cgit v1.2.1