parent
bdc2c51fee
commit
26b42fa843
@ -0,0 +1,180 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#include "rdp.h"
|
||||
#include "rdpdraw.h"
|
||||
|
||||
#define LDEBUG 0
|
||||
|
||||
#define LOG_LEVEL 1
|
||||
#define LLOG(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; } } while (0)
|
||||
#define LLOGLN(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
|
||||
|
||||
extern rdpScreenInfoRec g_rdpScreen; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpGCIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpWindowIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
||||
extern int g_Bpp; /* from rdpmain.c */
|
||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||
|
||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||
|
||||
extern int g_con_number; /* in rdpup.c */
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpFillPolygonOrg(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int shape, int mode, int count,
|
||||
DDXPointPtr pPts)
|
||||
{
|
||||
rdpGCPtr priv;
|
||||
GCFuncs* oldFuncs;
|
||||
|
||||
GC_OP_PROLOGUE(pGC);
|
||||
pGC->ops->FillPolygon(pDrawable, pGC, shape, mode, count, pPts);
|
||||
GC_OP_EPILOGUE(pGC);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int shape, int mode, int count,
|
||||
DDXPointPtr pPts)
|
||||
{
|
||||
RegionRec clip_reg;
|
||||
RegionRec box_reg;
|
||||
int num_clips;
|
||||
int cd;
|
||||
int maxx;
|
||||
int maxy;
|
||||
int minx;
|
||||
int miny;
|
||||
int i;
|
||||
int j;
|
||||
int got_id;
|
||||
BoxRec box;
|
||||
struct image_data id;
|
||||
WindowPtr pDstWnd;
|
||||
PixmapPtr pDstPixmap;
|
||||
rdpPixmapRec* pDstPriv;
|
||||
|
||||
LLOGLN(10, ("rdpFillPolygon:"));
|
||||
|
||||
/* do original call */
|
||||
rdpFillPolygonOrg(pDrawable, pGC, shape, mode, count, pPts);
|
||||
|
||||
got_id = 0;
|
||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||
{
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
{
|
||||
rdpup_switch_os_surface(pDstPriv->rdpid);
|
||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||
{
|
||||
pDstWnd = (WindowPtr)pDrawable;
|
||||
if (pDstWnd->viewable)
|
||||
{
|
||||
rdpup_get_screen_image_rect(&id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!got_id)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RegionInit(&clip_reg, NullBox, 0);
|
||||
cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
|
||||
if (cd != 0)
|
||||
{
|
||||
box.x1 = 0;
|
||||
box.y1 = 0;
|
||||
box.x2 = 0;
|
||||
box.y2 = 0;
|
||||
if (count > 0)
|
||||
{
|
||||
maxx = pPts[0].x;
|
||||
maxy = pPts[0].y;
|
||||
minx = maxx;
|
||||
miny = maxy;
|
||||
for (i = 1; i < count; i++)
|
||||
{
|
||||
if (pPts[i].x > maxx)
|
||||
{
|
||||
maxx = pPts[i].x;
|
||||
}
|
||||
if (pPts[i].x < minx)
|
||||
{
|
||||
minx = pPts[i].x;
|
||||
}
|
||||
if (pPts[i].y > maxy)
|
||||
{
|
||||
maxy = pPts[i].y;
|
||||
}
|
||||
if (pPts[i].y < miny)
|
||||
{
|
||||
miny = pPts[i].y;
|
||||
}
|
||||
box.x1 = pDrawable->x + minx;
|
||||
box.y1 = pDrawable->y + miny;
|
||||
box.x2 = pDrawable->x + maxx + 1;
|
||||
box.y2 = pDrawable->y + maxy + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cd == 1)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
rdpup_end_update();
|
||||
}
|
||||
else if (cd == 2)
|
||||
{
|
||||
RegionInit(&box_reg, &box, 0);
|
||||
RegionIntersect(&clip_reg, &clip_reg, &box_reg);
|
||||
num_clips = REGION_NUM_RECTS(&clip_reg);
|
||||
if (num_clips > 0)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
for (j = num_clips - 1; j >= 0; j--)
|
||||
{
|
||||
box = REGION_RECTS(&clip_reg)[j];
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
}
|
||||
rdpup_end_update();
|
||||
}
|
||||
RegionUninit(&box_reg);
|
||||
}
|
||||
RegionUninit(&clip_reg);
|
||||
rdpup_switch_os_surface(-1);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __RDPFILLPOLYGON_H
|
||||
#define __RDPFILLPOLYGON_H
|
||||
|
||||
void
|
||||
rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int shape, int mode, int count,
|
||||
DDXPointPtr pPts);
|
||||
|
||||
#endif
|
@ -0,0 +1,151 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#include "rdp.h"
|
||||
#include "rdpdraw.h"
|
||||
|
||||
#define LDEBUG 0
|
||||
|
||||
#define LOG_LEVEL 1
|
||||
#define LLOG(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; } } while (0)
|
||||
#define LLOGLN(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
|
||||
|
||||
extern rdpScreenInfoRec g_rdpScreen; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpGCIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpWindowIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
||||
extern int g_Bpp; /* from rdpmain.c */
|
||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||
|
||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||
|
||||
extern int g_con_number; /* in rdpup.c */
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpImageGlyphBltOrg(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int x, int y, unsigned int nglyph,
|
||||
CharInfoPtr* ppci, pointer pglyphBase)
|
||||
{
|
||||
rdpGCPtr priv;
|
||||
GCFuncs* oldFuncs;
|
||||
|
||||
GC_OP_PROLOGUE(pGC);
|
||||
pGC->ops->ImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
||||
GC_OP_EPILOGUE(pGC);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int x, int y, unsigned int nglyph,
|
||||
CharInfoPtr* ppci, pointer pglyphBase)
|
||||
{
|
||||
RegionRec reg;
|
||||
RegionRec reg1;
|
||||
int num_clips;
|
||||
int cd;
|
||||
int j;
|
||||
int got_id;
|
||||
BoxRec box;
|
||||
struct image_data id;
|
||||
WindowPtr pDstWnd;
|
||||
PixmapPtr pDstPixmap;
|
||||
rdpPixmapRec* pDstPriv;
|
||||
|
||||
LLOGLN(10, ("rdpImageGlyphBlt:"));
|
||||
|
||||
if (nglyph != 0)
|
||||
{
|
||||
GetTextBoundingBox(pDrawable, pGC->font, x, y, nglyph, &box);
|
||||
}
|
||||
|
||||
/* do original call */
|
||||
rdpImageGlyphBltOrg(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
||||
|
||||
got_id = 0;
|
||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||
{
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
{
|
||||
rdpup_switch_os_surface(pDstPriv->rdpid);
|
||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||
{
|
||||
pDstWnd = (WindowPtr)pDrawable;
|
||||
if (pDstWnd->viewable)
|
||||
{
|
||||
rdpup_get_screen_image_rect(&id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!got_id)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RegionInit(®, NullBox, 0);
|
||||
if (nglyph == 0)
|
||||
{
|
||||
cd = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
cd = rdp_get_clip(®, pDrawable, pGC);
|
||||
}
|
||||
if (cd == 1)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
rdpup_end_update();
|
||||
}
|
||||
else if (cd == 2)
|
||||
{
|
||||
RegionInit(®1, &box, 0);
|
||||
RegionIntersect(®, ®, ®1);
|
||||
num_clips = REGION_NUM_RECTS(®);
|
||||
if (num_clips > 0)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
for (j = num_clips - 1; j >= 0; j--)
|
||||
{
|
||||
box = REGION_RECTS(®)[j];
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
}
|
||||
rdpup_end_update();
|
||||
}
|
||||
RegionUninit(®1);
|
||||
}
|
||||
RegionUninit(®);
|
||||
rdpup_switch_os_surface(-1);
|
||||
return;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __RDPIMAGEGLYPHBLT_H
|
||||
#define __RDPIMAGEGLYPHBLT_H
|
||||
|
||||
void
|
||||
rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int x, int y, unsigned int nglyph,
|
||||
CharInfoPtr* ppci, pointer pglyphBase);
|
||||
|
||||
#endif
|
@ -0,0 +1,149 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#include "rdp.h"
|
||||
#include "rdpdraw.h"
|
||||
|
||||
#define LDEBUG 0
|
||||
|
||||
#define LOG_LEVEL 1
|
||||
#define LLOG(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; } } while (0)
|
||||
#define LLOGLN(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
|
||||
|
||||
extern rdpScreenInfoRec g_rdpScreen; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpGCIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpWindowIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
||||
extern int g_Bpp; /* from rdpmain.c */
|
||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||
|
||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||
|
||||
extern int g_con_number; /* in rdpup.c */
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpImageText16Org(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int x, int y, int count, unsigned short* chars)
|
||||
{
|
||||
rdpGCPtr priv;
|
||||
GCFuncs* oldFuncs;
|
||||
|
||||
GC_OP_PROLOGUE(pGC);
|
||||
pGC->ops->ImageText16(pDrawable, pGC, x, y, count, chars);
|
||||
GC_OP_EPILOGUE(pGC);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int x, int y, int count, unsigned short* chars)
|
||||
{
|
||||
RegionRec reg;
|
||||
RegionRec reg1;
|
||||
int num_clips;
|
||||
int cd;
|
||||
int j;
|
||||
int got_id;
|
||||
BoxRec box;
|
||||
struct image_data id;
|
||||
WindowPtr pDstWnd;
|
||||
PixmapPtr pDstPixmap;
|
||||
rdpPixmapRec* pDstPriv;
|
||||
|
||||
LLOGLN(10, ("rdpImageText16:"));
|
||||
|
||||
if (count != 0)
|
||||
{
|
||||
GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box);
|
||||
}
|
||||
|
||||
/* do original call */
|
||||
rdpImageText16Org(pDrawable, pGC, x, y, count, chars);
|
||||
|
||||
got_id = 0;
|
||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||
{
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
{
|
||||
rdpup_switch_os_surface(pDstPriv->rdpid);
|
||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||
{
|
||||
pDstWnd = (WindowPtr)pDrawable;
|
||||
if (pDstWnd->viewable)
|
||||
{
|
||||
rdpup_get_screen_image_rect(&id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!got_id)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RegionInit(®, NullBox, 0);
|
||||
if (count == 0)
|
||||
{
|
||||
cd = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
cd = rdp_get_clip(®, pDrawable, pGC);
|
||||
}
|
||||
if (cd == 1)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
rdpup_end_update();
|
||||
}
|
||||
else if (cd == 2)
|
||||
{
|
||||
RegionInit(®1, &box, 0);
|
||||
RegionIntersect(®, ®, ®1);
|
||||
num_clips = REGION_NUM_RECTS(®);
|
||||
if (num_clips > 0)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
for (j = num_clips - 1; j >= 0; j--)
|
||||
{
|
||||
box = REGION_RECTS(®)[j];
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
}
|
||||
rdpup_end_update();
|
||||
}
|
||||
RegionUninit(®1);
|
||||
}
|
||||
RegionUninit(®);
|
||||
rdpup_switch_os_surface(-1);
|
||||
return;
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __RDPIMAGETEXT16_H
|
||||
#define __RDPIMAGETEXT16_H
|
||||
|
||||
void
|
||||
rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int x, int y, int count, unsigned short* chars);
|
||||
|
||||
#endif
|
@ -0,0 +1,149 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#include "rdp.h"
|
||||
#include "rdpdraw.h"
|
||||
|
||||
#define LDEBUG 0
|
||||
|
||||
#define LOG_LEVEL 1
|
||||
#define LLOG(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; } } while (0)
|
||||
#define LLOGLN(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
|
||||
|
||||
extern rdpScreenInfoRec g_rdpScreen; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpGCIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpWindowIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
||||
extern int g_Bpp; /* from rdpmain.c */
|
||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||
|
||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||
|
||||
extern int g_con_number; /* in rdpup.c */
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpImageText8Org(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int x, int y, int count, char* chars)
|
||||
{
|
||||
rdpGCPtr priv;
|
||||
GCFuncs* oldFuncs;
|
||||
|
||||
GC_OP_PROLOGUE(pGC);
|
||||
pGC->ops->ImageText8(pDrawable, pGC, x, y, count, chars);
|
||||
GC_OP_EPILOGUE(pGC);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpImageText8(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int x, int y, int count, char* chars)
|
||||
{
|
||||
RegionRec reg;
|
||||
RegionRec reg1;
|
||||
int num_clips;
|
||||
int cd;
|
||||
int j;
|
||||
int got_id;
|
||||
BoxRec box;
|
||||
struct image_data id;
|
||||
WindowPtr pDstWnd;
|
||||
PixmapPtr pDstPixmap;
|
||||
rdpPixmapRec* pDstPriv;
|
||||
|
||||
LLOGLN(10, ("rdpImageText8:"));
|
||||
|
||||
if (count != 0)
|
||||
{
|
||||
GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box);
|
||||
}
|
||||
|
||||
/* do original call */
|
||||
rdpImageText8Org(pDrawable, pGC, x, y, count, chars);
|
||||
|
||||
got_id = 0;
|
||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||
{
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
{
|
||||
rdpup_switch_os_surface(pDstPriv->rdpid);
|
||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||
{
|
||||
pDstWnd = (WindowPtr)pDrawable;
|
||||
if (pDstWnd->viewable)
|
||||
{
|
||||
rdpup_get_screen_image_rect(&id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!got_id)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RegionInit(®, NullBox, 0);
|
||||
if (count == 0)
|
||||
{
|
||||
cd = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
cd = rdp_get_clip(®, pDrawable, pGC);
|
||||
}
|
||||
if (cd == 1)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
rdpup_end_update();
|
||||
}
|
||||
else if (cd == 2)
|
||||
{
|
||||
RegionInit(®1, &box, 0);
|
||||
RegionIntersect(®, ®, ®1);
|
||||
num_clips = REGION_NUM_RECTS(®);
|
||||
if (num_clips > 0)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
for (j = num_clips - 1; j >= 0; j--)
|
||||
{
|
||||
box = REGION_RECTS(®)[j];
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
}
|
||||
rdpup_end_update();
|
||||
}
|
||||
RegionUninit(®1);
|
||||
}
|
||||
RegionUninit(®);
|
||||
rdpup_switch_os_surface(-1);
|
||||
return;
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __RDPIMAGETEXT8_H
|
||||
#define __RDPIMAGETEXT8_H
|
||||
|
||||
void
|
||||
rdpImageText8(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int x, int y, int count, char* chars);
|
||||
|
||||
#endif
|
@ -0,0 +1,174 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#include "rdp.h"
|
||||
#include "rdpdraw.h"
|
||||
|
||||
#define LDEBUG 0
|
||||
|
||||
#define LOG_LEVEL 1
|
||||
#define LLOG(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; } } while (0)
|
||||
#define LLOGLN(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
|
||||
|
||||
extern rdpScreenInfoRec g_rdpScreen; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpGCIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpWindowIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
||||
extern int g_Bpp; /* from rdpmain.c */
|
||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||
|
||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||
|
||||
extern int g_con_number; /* in rdpup.c */
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpPolyArcOrg(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
|
||||
{
|
||||
rdpGCPtr priv;
|
||||
GCFuncs* oldFuncs;
|
||||
|
||||
GC_OP_PROLOGUE(pGC);
|
||||
pGC->ops->PolyArc(pDrawable, pGC, narcs, parcs);
|
||||
GC_OP_EPILOGUE(pGC);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
|
||||
{
|
||||
RegionRec clip_reg;
|
||||
RegionPtr tmpRegion;
|
||||
int cd;
|
||||
int lw;
|
||||
int extra;
|
||||
int i;
|
||||
int num_clips;
|
||||
int got_id;
|
||||
xRectangle* rects;
|
||||
BoxRec box;
|
||||
struct image_data id;
|
||||
WindowPtr pDstWnd;
|
||||
PixmapPtr pDstPixmap;
|
||||
rdpPixmapRec* pDstPriv;
|
||||
|
||||
LLOGLN(10, ("rdpPolyArc:"));
|
||||
|
||||
rects = 0;
|
||||
if (narcs > 0)
|
||||
{
|
||||
rects = (xRectangle*)g_malloc(narcs * sizeof(xRectangle), 0);
|
||||
lw = pGC->lineWidth;
|
||||
if (lw == 0)
|
||||
{
|
||||
lw = 1;
|
||||
}
|
||||
extra = lw / 2;
|
||||
for (i = 0; i < narcs; i++)
|
||||
{
|
||||
rects[i].x = (parcs[i].x - extra) + pDrawable->x;
|
||||
rects[i].y = (parcs[i].y - extra) + pDrawable->y;
|
||||
rects[i].width = parcs[i].width + lw;
|
||||
rects[i].height = parcs[i].height + lw;
|
||||
}
|
||||
}
|
||||
|
||||
/* do original call */
|
||||
rdpPolyArcOrg(pDrawable, pGC, narcs, parcs);
|
||||
|
||||
got_id = 0;
|
||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||
{
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
{
|
||||
rdpup_switch_os_surface(pDstPriv->rdpid);
|
||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||
{
|
||||
pDstWnd = (WindowPtr)pDrawable;
|
||||
if (pDstWnd->viewable)
|
||||
{
|
||||
rdpup_get_screen_image_rect(&id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!got_id)
|
||||
{
|
||||
g_free(rects);
|
||||
return;
|
||||
}
|
||||
|
||||
RegionInit(&clip_reg, NullBox, 0);
|
||||
cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
|
||||
if (cd == 1)
|
||||
{
|
||||
if (rects != 0)
|
||||
{
|
||||
tmpRegion = RegionFromRects(narcs, rects, CT_NONE);
|
||||
num_clips = REGION_NUM_RECTS(tmpRegion);
|
||||
if (num_clips > 0)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
for (i = num_clips - 1; i >= 0; i--)
|
||||
{
|
||||
box = REGION_RECTS(tmpRegion)[i];
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
}
|
||||
rdpup_end_update();
|
||||
}
|
||||
RegionDestroy(tmpRegion);
|
||||
}
|
||||
}
|
||||
else if (cd == 2)
|
||||
{
|
||||
if (rects != 0)
|
||||
{
|
||||
tmpRegion = RegionFromRects(narcs, rects, CT_NONE);
|
||||
RegionIntersect(tmpRegion, tmpRegion, &clip_reg);
|
||||
num_clips = REGION_NUM_RECTS(tmpRegion);
|
||||
if (num_clips > 0)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
for (i = num_clips - 1; i >= 0; i--)
|
||||
{
|
||||
box = REGION_RECTS(tmpRegion)[i];
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
}
|
||||
rdpup_end_update();
|
||||
}
|
||||
RegionDestroy(tmpRegion);
|
||||
}
|
||||
}
|
||||
RegionUninit(&clip_reg);
|
||||
g_free(rects);
|
||||
rdpup_switch_os_surface(-1);
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __RDPPOLYARC_H
|
||||
#define __RDPPOLYARC_H
|
||||
|
||||
void
|
||||
rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs);
|
||||
|
||||
#endif
|
@ -0,0 +1,174 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#include "rdp.h"
|
||||
#include "rdpdraw.h"
|
||||
|
||||
#define LDEBUG 0
|
||||
|
||||
#define LOG_LEVEL 1
|
||||
#define LLOG(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; } } while (0)
|
||||
#define LLOGLN(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
|
||||
|
||||
extern rdpScreenInfoRec g_rdpScreen; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpGCIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpWindowIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
||||
extern int g_Bpp; /* from rdpmain.c */
|
||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||
|
||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||
|
||||
extern int g_con_number; /* in rdpup.c */
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpPolyFillArcOrg(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
|
||||
{
|
||||
rdpGCPtr priv;
|
||||
GCFuncs* oldFuncs;
|
||||
|
||||
GC_OP_PROLOGUE(pGC);
|
||||
pGC->ops->PolyFillArc(pDrawable, pGC, narcs, parcs);
|
||||
GC_OP_EPILOGUE(pGC);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
|
||||
{
|
||||
RegionRec clip_reg;
|
||||
RegionPtr tmpRegion;
|
||||
int cd;
|
||||
int lw;
|
||||
int extra;
|
||||
int i;
|
||||
int num_clips;
|
||||
int got_id;
|
||||
xRectangle* rects;
|
||||
BoxRec box;
|
||||
struct image_data id;
|
||||
WindowPtr pDstWnd;
|
||||
PixmapPtr pDstPixmap;
|
||||
rdpPixmapRec* pDstPriv;
|
||||
|
||||
LLOGLN(10, ("rdpPolyFillArc:"));
|
||||
|
||||
rects = 0;
|
||||
if (narcs > 0)
|
||||
{
|
||||
rects = (xRectangle*)g_malloc(narcs * sizeof(xRectangle), 0);
|
||||
lw = pGC->lineWidth;
|
||||
if (lw == 0)
|
||||
{
|
||||
lw = 1;
|
||||
}
|
||||
extra = lw / 2;
|
||||
for (i = 0; i < narcs; i++)
|
||||
{
|
||||
rects[i].x = (parcs[i].x - extra) + pDrawable->x;
|
||||
rects[i].y = (parcs[i].y - extra) + pDrawable->y;
|
||||
rects[i].width = parcs[i].width + lw;
|
||||
rects[i].height = parcs[i].height + lw;
|
||||
}
|
||||
}
|
||||
|
||||
/* do original call */
|
||||
rdpPolyFillArcOrg(pDrawable, pGC, narcs, parcs);
|
||||
|
||||
got_id = 0;
|
||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||
{
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
{
|
||||
rdpup_switch_os_surface(pDstPriv->rdpid);
|
||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||
{
|
||||
pDstWnd = (WindowPtr)pDrawable;
|
||||
if (pDstWnd->viewable)
|
||||
{
|
||||
rdpup_get_screen_image_rect(&id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!got_id)
|
||||
{
|
||||
g_free(rects);
|
||||
return;
|
||||
}
|
||||
|
||||
RegionInit(&clip_reg, NullBox, 0);
|
||||
cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
|
||||
if (cd == 1)
|
||||
{
|
||||
if (rects != 0)
|
||||
{
|
||||
tmpRegion = RegionFromRects(narcs, rects, CT_NONE);
|
||||
num_clips = REGION_NUM_RECTS(tmpRegion);
|
||||
if (num_clips > 0)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
for (i = num_clips - 1; i >= 0; i--)
|
||||
{
|
||||
box = REGION_RECTS(tmpRegion)[i];
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
}
|
||||
rdpup_end_update();
|
||||
}
|
||||
RegionDestroy(tmpRegion);
|
||||
}
|
||||
}
|
||||
else if (cd == 2)
|
||||
{
|
||||
if (rects != 0)
|
||||
{
|
||||
tmpRegion = RegionFromRects(narcs, rects, CT_NONE);
|
||||
RegionIntersect(tmpRegion, tmpRegion, &clip_reg);
|
||||
num_clips = REGION_NUM_RECTS(tmpRegion);
|
||||
if (num_clips > 0)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
for (i = num_clips - 1; i >= 0; i--)
|
||||
{
|
||||
box = REGION_RECTS(tmpRegion)[i];
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
}
|
||||
rdpup_end_update();
|
||||
}
|
||||
RegionDestroy(tmpRegion);
|
||||
}
|
||||
}
|
||||
RegionUninit(&clip_reg);
|
||||
g_free(rects);
|
||||
rdpup_switch_os_surface(-1);
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __RDPPOLYFILLARC_H
|
||||
#define __RDPPOLYFILLARC_H
|
||||
|
||||
void
|
||||
rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs);
|
||||
|
||||
#endif
|
@ -0,0 +1,151 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#include "rdp.h"
|
||||
#include "rdpdraw.h"
|
||||
|
||||
#define LDEBUG 0
|
||||
|
||||
#define LOG_LEVEL 1
|
||||
#define LLOG(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; } } while (0)
|
||||
#define LLOGLN(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
|
||||
|
||||
extern rdpScreenInfoRec g_rdpScreen; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpGCIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpWindowIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
||||
extern int g_Bpp; /* from rdpmain.c */
|
||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||
|
||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||
|
||||
extern int g_con_number; /* in rdpup.c */
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpPolyGlyphBltOrg(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int x, int y, unsigned int nglyph,
|
||||
CharInfoPtr* ppci, pointer pglyphBase)
|
||||
{
|
||||
rdpGCPtr priv;
|
||||
GCFuncs* oldFuncs;
|
||||
|
||||
GC_OP_PROLOGUE(pGC);
|
||||
pGC->ops->PolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
||||
GC_OP_EPILOGUE(pGC);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int x, int y, unsigned int nglyph,
|
||||
CharInfoPtr* ppci, pointer pglyphBase)
|
||||
{
|
||||
RegionRec reg;
|
||||
RegionRec reg1;
|
||||
int num_clips;
|
||||
int cd;
|
||||
int j;
|
||||
int got_id;
|
||||
BoxRec box;
|
||||
struct image_data id;
|
||||
WindowPtr pDstWnd;
|
||||
PixmapPtr pDstPixmap;
|
||||
rdpPixmapRec* pDstPriv;
|
||||
|
||||
LLOGLN(10, ("rdpPolyGlyphBlt:"));
|
||||
|
||||
if (nglyph != 0)
|
||||
{
|
||||
GetTextBoundingBox(pDrawable, pGC->font, x, y, nglyph, &box);
|
||||
}
|
||||
|
||||
/* do original call */
|
||||
rdpPolyGlyphBltOrg(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
||||
|
||||
got_id = 0;
|
||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||
{
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
{
|
||||
rdpup_switch_os_surface(pDstPriv->rdpid);
|
||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||
{
|
||||
pDstWnd = (WindowPtr)pDrawable;
|
||||
if (pDstWnd->viewable)
|
||||
{
|
||||
rdpup_get_screen_image_rect(&id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!got_id)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RegionInit(®, NullBox, 0);
|
||||
if (nglyph == 0)
|
||||
{
|
||||
cd = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
cd = rdp_get_clip(®, pDrawable, pGC);
|
||||
}
|
||||
if (cd == 1)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
rdpup_end_update();
|
||||
}
|
||||
else if (cd == 2)
|
||||
{
|
||||
RegionInit(®1, &box, 0);
|
||||
RegionIntersect(®, ®, ®1);
|
||||
num_clips = REGION_NUM_RECTS(®);
|
||||
if (num_clips > 0)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
for (j = num_clips - 1; j >= 0; j--)
|
||||
{
|
||||
box = REGION_RECTS(®)[j];
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
}
|
||||
rdpup_end_update();
|
||||
}
|
||||
RegionUninit(®1);
|
||||
}
|
||||
RegionUninit(®);
|
||||
rdpup_switch_os_surface(-1);
|
||||
return;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __RDPPOLYGLYPHBLT_H
|
||||
#define __RDPPOLYGLYPHBLT_H
|
||||
|
||||
void
|
||||
rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int x, int y, unsigned int nglyph,
|
||||
CharInfoPtr* ppci, pointer pglyphBase);
|
||||
|
||||
#endif
|
@ -0,0 +1,200 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#include "rdp.h"
|
||||
#include "rdpdraw.h"
|
||||
|
||||
#define LDEBUG 0
|
||||
|
||||
#define LOG_LEVEL 1
|
||||
#define LLOG(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; } } while (0)
|
||||
#define LLOGLN(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
|
||||
|
||||
extern rdpScreenInfoRec g_rdpScreen; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpGCIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpWindowIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
||||
extern int g_Bpp; /* from rdpmain.c */
|
||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||
|
||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||
|
||||
extern int g_con_number; /* in rdpup.c */
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpPolyPointOrg(DrawablePtr pDrawable, GCPtr pGC, int mode,
|
||||
int npt, DDXPointPtr in_pts)
|
||||
{
|
||||
rdpGCPtr priv;
|
||||
GCFuncs* oldFuncs;
|
||||
|
||||
GC_OP_PROLOGUE(pGC);
|
||||
pGC->ops->PolyPoint(pDrawable, pGC, mode, npt, in_pts);
|
||||
GC_OP_EPILOGUE(pGC);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
|
||||
int npt, DDXPointPtr in_pts)
|
||||
{
|
||||
RegionRec clip_reg;
|
||||
int num_clips;
|
||||
int cd;
|
||||
int x;
|
||||
int y;
|
||||
int i;
|
||||
int j;
|
||||
int got_id;
|
||||
BoxRec box;
|
||||
BoxRec total_box;
|
||||
DDXPointPtr pts;
|
||||
DDXPointRec stack_pts[32];
|
||||
struct image_data id;
|
||||
WindowPtr pDstWnd;
|
||||
PixmapPtr pDstPixmap;
|
||||
rdpPixmapRec* pDstPriv;
|
||||
|
||||
LLOGLN(10, ("rdpPolyPoint:"));
|
||||
|
||||
if (npt > 32)
|
||||
{
|
||||
pts = (DDXPointPtr)g_malloc(sizeof(DDXPointRec) * npt, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
pts = stack_pts;
|
||||
}
|
||||
for (i = 0; i < npt; i++)
|
||||
{
|
||||
pts[i].x = pDrawable->x + in_pts[i].x;
|
||||
pts[i].y = pDrawable->y + in_pts[i].y;
|
||||
if (i == 0)
|
||||
{
|
||||
total_box.x1 = pts[0].x;
|
||||
total_box.y1 = pts[0].y;
|
||||
total_box.x2 = pts[0].x;
|
||||
total_box.y2 = pts[0].y;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pts[i].x < total_box.x1)
|
||||
{
|
||||
total_box.x1 = pts[i].x;
|
||||
}
|
||||
if (pts[i].y < total_box.y1)
|
||||
{
|
||||
total_box.y1 = pts[i].y;
|
||||
}
|
||||
if (pts[i].x > total_box.x2)
|
||||
{
|
||||
total_box.x2 = pts[i].x;
|
||||
}
|
||||
if (pts[i].y > total_box.y2)
|
||||
{
|
||||
total_box.y2 = pts[i].y;
|
||||
}
|
||||
}
|
||||
/* todo, use this total_box */
|
||||
}
|
||||
|
||||
/* do original call */
|
||||
rdpPolyPointOrg(pDrawable, pGC, mode, npt, in_pts);
|
||||
|
||||
got_id = 0;
|
||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||
{
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
{
|
||||
rdpup_switch_os_surface(pDstPriv->rdpid);
|
||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||
{
|
||||
pDstWnd = (WindowPtr)pDrawable;
|
||||
if (pDstWnd->viewable)
|
||||
{
|
||||
rdpup_get_screen_image_rect(&id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!got_id)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RegionInit(&clip_reg, NullBox, 0);
|
||||
cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
|
||||
if (cd == 1)
|
||||
{
|
||||
if (npt > 0)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
rdpup_set_fgcolor(pGC->fgPixel);
|
||||
for (i = 0; i < npt; i++)
|
||||
{
|
||||
x = pts[i].x;
|
||||
y = pts[i].y;
|
||||
rdpup_fill_rect(x, y, 1, 1);
|
||||
}
|
||||
rdpup_end_update();
|
||||
}
|
||||
}
|
||||
else if (cd == 2)
|
||||
{
|
||||
num_clips = REGION_NUM_RECTS(&clip_reg);
|
||||
if (npt > 0 && num_clips > 0)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
rdpup_set_fgcolor(pGC->fgPixel);
|
||||
for (j = num_clips - 1; j >= 0; j--)
|
||||
{
|
||||
box = REGION_RECTS(&clip_reg)[j];
|
||||
rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
for (i = 0; i < npt; i++)
|
||||
{
|
||||
x = pts[i].x;
|
||||
y = pts[i].y;
|
||||
rdpup_fill_rect(x, y, 1, 1);
|
||||
}
|
||||
}
|
||||
rdpup_reset_clip();
|
||||
rdpup_end_update();
|
||||
}
|
||||
}
|
||||
RegionUninit(&clip_reg);
|
||||
if (pts != stack_pts)
|
||||
{
|
||||
g_free(pts);
|
||||
}
|
||||
rdpup_switch_os_surface(-1);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __RDPPOLYPOINT_H
|
||||
#define __RDPPOLYPOINT_H
|
||||
|
||||
void
|
||||
rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
|
||||
int npt, DDXPointPtr in_pts);
|
||||
|
||||
#endif
|
@ -0,0 +1,152 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#include "rdp.h"
|
||||
#include "rdpdraw.h"
|
||||
|
||||
#define LDEBUG 0
|
||||
|
||||
#define LOG_LEVEL 1
|
||||
#define LLOG(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; } } while (0)
|
||||
#define LLOGLN(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
|
||||
|
||||
extern rdpScreenInfoRec g_rdpScreen; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpGCIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpWindowIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
||||
extern int g_Bpp; /* from rdpmain.c */
|
||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||
|
||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||
|
||||
extern int g_con_number; /* in rdpup.c */
|
||||
|
||||
/******************************************************************************/
|
||||
int
|
||||
rdpPolyText16Org(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int x, int y, int count, unsigned short* chars)
|
||||
{
|
||||
int rv;
|
||||
rdpGCPtr priv;
|
||||
GCFuncs* oldFuncs;
|
||||
|
||||
GC_OP_PROLOGUE(pGC);
|
||||
rv = pGC->ops->PolyText16(pDrawable, pGC, x, y, count, chars);
|
||||
GC_OP_EPILOGUE(pGC);
|
||||
return rv;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
int
|
||||
rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int x, int y, int count, unsigned short* chars)
|
||||
{
|
||||
RegionRec reg;
|
||||
RegionRec reg1;
|
||||
int num_clips;
|
||||
int cd;
|
||||
int j;
|
||||
int rv;
|
||||
int got_id;
|
||||
BoxRec box;
|
||||
struct image_data id;
|
||||
WindowPtr pDstWnd;
|
||||
PixmapPtr pDstPixmap;
|
||||
rdpPixmapRec* pDstPriv;
|
||||
|
||||
LLOGLN(10, ("rdpPolyText16:"));
|
||||
|
||||
if (count != 0)
|
||||
{
|
||||
GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box);
|
||||
}
|
||||
|
||||
/* do original call */
|
||||
rv = rdpPolyText16Org(pDrawable, pGC, x, y, count, chars);
|
||||
|
||||
got_id = 0;
|
||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||
{
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
{
|
||||
rdpup_switch_os_surface(pDstPriv->rdpid);
|
||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||
{
|
||||
pDstWnd = (WindowPtr)pDrawable;
|
||||
if (pDstWnd->viewable)
|
||||
{
|
||||
rdpup_get_screen_image_rect(&id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!got_id)
|
||||
{
|
||||
return rv;
|
||||
}
|
||||
|
||||
RegionInit(®, NullBox, 0);
|
||||
if (count == 0)
|
||||
{
|
||||
cd = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
cd = rdp_get_clip(®, pDrawable, pGC);
|
||||
}
|
||||
if (cd == 1)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
rdpup_end_update();
|
||||
}
|
||||
else if (cd == 2)
|
||||
{
|
||||
RegionInit(®1, &box, 0);
|
||||
RegionIntersect(®, ®, ®1);
|
||||
num_clips = REGION_NUM_RECTS(®);
|
||||
if (num_clips > 0)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
for (j = num_clips - 1; j >= 0; j--)
|
||||
{
|
||||
box = REGION_RECTS(®)[j];
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
}
|
||||
rdpup_end_update();
|
||||
}
|
||||
RegionUninit(®1);
|
||||
}
|
||||
RegionUninit(®);
|
||||
rdpup_switch_os_surface(-1);
|
||||
return rv;
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __RDPPOLYTEXT16_H
|
||||
#define __RDPPOLYTEXT16_H
|
||||
|
||||
int
|
||||
rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int x, int y, int count, unsigned short* chars);
|
||||
|
||||
#endif
|
@ -0,0 +1,152 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#include "rdp.h"
|
||||
#include "rdpdraw.h"
|
||||
|
||||
#define LDEBUG 0
|
||||
|
||||
#define LOG_LEVEL 1
|
||||
#define LLOG(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; } } while (0)
|
||||
#define LLOGLN(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
|
||||
|
||||
extern rdpScreenInfoRec g_rdpScreen; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpGCIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpWindowIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
||||
extern int g_Bpp; /* from rdpmain.c */
|
||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||
|
||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||
|
||||
extern int g_con_number; /* in rdpup.c */
|
||||
|
||||
/******************************************************************************/
|
||||
int
|
||||
rdpPolyText8Org(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int x, int y, int count, char* chars)
|
||||
{
|
||||
int rv;
|
||||
rdpGCPtr priv;
|
||||
GCFuncs* oldFuncs;
|
||||
|
||||
GC_OP_PROLOGUE(pGC);
|
||||
rv = pGC->ops->PolyText8(pDrawable, pGC, x, y, count, chars);
|
||||
GC_OP_EPILOGUE(pGC);
|
||||
return rv;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
int
|
||||
rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int x, int y, int count, char* chars)
|
||||
{
|
||||
RegionRec reg;
|
||||
RegionRec reg1;
|
||||
int num_clips;
|
||||
int cd;
|
||||
int j;
|
||||
int rv;
|
||||
int got_id;
|
||||
BoxRec box;
|
||||
struct image_data id;
|
||||
WindowPtr pDstWnd;
|
||||
PixmapPtr pDstPixmap;
|
||||
rdpPixmapRec* pDstPriv;
|
||||
|
||||
LLOGLN(10, ("rdpPolyText8:"));
|
||||
|
||||
if (count != 0)
|
||||
{
|
||||
GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box);
|
||||
}
|
||||
|
||||
/* do original call */
|
||||
rv = rdpPolyText8Org(pDrawable, pGC, x, y, count, chars);
|
||||
|
||||
got_id = 0;
|
||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||
{
|
||||
pDstPixmap = (PixmapPtr)pDrawable;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
{
|
||||
rdpup_switch_os_surface(pDstPriv->rdpid);
|
||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||
{
|
||||
pDstWnd = (WindowPtr)pDrawable;
|
||||
if (pDstWnd->viewable)
|
||||
{
|
||||
rdpup_get_screen_image_rect(&id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!got_id)
|
||||
{
|
||||
return rv;
|
||||
}
|
||||
|
||||
RegionInit(®, NullBox, 0);
|
||||
if (count == 0)
|
||||
{
|
||||
cd = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
cd = rdp_get_clip(®, pDrawable, pGC);
|
||||
}
|
||||
if (cd == 1)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
rdpup_end_update();
|
||||
}
|
||||
else if (cd == 2)
|
||||
{
|
||||
RegionInit(®1, &box, 0);
|
||||
RegionIntersect(®, ®, ®1);
|
||||
num_clips = REGION_NUM_RECTS(®);
|
||||
if (num_clips > 0)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
for (j = num_clips - 1; j >= 0; j--)
|
||||
{
|
||||
box = REGION_RECTS(®)[j];
|
||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
}
|
||||
rdpup_end_update();
|
||||
}
|
||||
RegionUninit(®1);
|
||||
}
|
||||
RegionUninit(®);
|
||||
rdpup_switch_os_surface(-1);
|
||||
return rv;
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __RDPPOLYTEXT8_H
|
||||
#define __RDPPOLYTEXT8_H
|
||||
|
||||
int
|
||||
rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
|
||||
int x, int y, int count, char* chars);
|
||||
|
||||
#endif
|
@ -0,0 +1,137 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#include "rdp.h"
|
||||
#include "rdpdraw.h"
|
||||
|
||||
#define LDEBUG 0
|
||||
|
||||
#define LOG_LEVEL 1
|
||||
#define LLOG(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; } } while (0)
|
||||
#define LLOGLN(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
|
||||
|
||||
extern rdpScreenInfoRec g_rdpScreen; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpGCIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpWindowIndex; /* from rdpmain.c */
|
||||
extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
||||
extern int g_Bpp; /* from rdpmain.c */
|
||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||
|
||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||
|
||||
extern int g_con_number; /* in rdpup.c */
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpPushPixelsOrg(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
|
||||
int w, int h, int x, int y)
|
||||
{
|
||||
rdpGCPtr priv;
|
||||
GCFuncs* oldFuncs;
|
||||
|
||||
GC_OP_PROLOGUE(pGC);
|
||||
pGC->ops->PushPixels(pGC, pBitMap, pDst, w, h, x, y);
|
||||
GC_OP_EPILOGUE(pGC);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
|
||||
int w, int h, int x, int y)
|
||||
{
|
||||
RegionRec clip_reg;
|
||||
RegionRec box_reg;
|
||||
int num_clips;
|
||||
int cd;
|
||||
int j;
|
||||
int got_id;
|
||||
BoxRec box;
|
||||
struct image_data id;
|
||||
WindowPtr pDstWnd;
|
||||
PixmapPtr pDstPixmap;
|
||||
rdpPixmapRec* pDstPriv;
|
||||
|
||||
LLOGLN(10, ("rdpPushPixels:"));
|
||||
|
||||
/* do original call */
|
||||
rdpPushPixelsOrg(pGC, pBitMap, pDst, w, h, x, y);
|
||||
|
||||
got_id = 0;
|
||||
if (pDst->type == DRAWABLE_PIXMAP)
|
||||
{
|
||||
pDstPixmap = (PixmapPtr)pDst;
|
||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||
if (XRDP_IS_OS(pDstPriv))
|
||||
{
|
||||
rdpup_switch_os_surface(pDstPriv->rdpid);
|
||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pDst->type == DRAWABLE_WINDOW)
|
||||
{
|
||||
pDstWnd = (WindowPtr)pDst;
|
||||
if (pDstWnd->viewable)
|
||||
{
|
||||
rdpup_get_screen_image_rect(&id);
|
||||
got_id = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!got_id)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
memset(&box, 0, sizeof(box));
|
||||
RegionInit(&clip_reg, NullBox, 0);
|
||||
cd = rdp_get_clip(&clip_reg, pDst, pGC);
|
||||
if (cd == 1)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
rdpup_send_area(0, x, y, w, h);
|
||||
rdpup_end_update();
|
||||
}
|
||||
else if (cd == 2)
|
||||
{
|
||||
RegionInit(&box_reg, &box, 0);
|
||||
RegionIntersect(&clip_reg, &clip_reg, &box_reg);
|
||||
num_clips = REGION_NUM_RECTS(&clip_reg);
|
||||
if (num_clips > 0)
|
||||
{
|
||||
rdpup_begin_update();
|
||||
for (j = num_clips - 1; j >= 0; j--)
|
||||
{
|
||||
box = REGION_RECTS(&clip_reg)[j];
|
||||
rdpup_send_area(0, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||
}
|
||||
rdpup_end_update();
|
||||
}
|
||||
RegionUninit(&box_reg);
|
||||
}
|
||||
RegionUninit(&clip_reg);
|
||||
rdpup_switch_os_surface(-1);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
Copyright 2005-2012 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __RDPPUSHPIXELS_H
|
||||
#define __RDPPUSHPIXELS_H
|
||||
|
||||
void
|
||||
rdpPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
|
||||
int w, int h, int x, int y);
|
||||
|
||||
#endif
|
Loading…
Reference in new issue