|
|
@ -50,6 +50,7 @@ static int g_scheduled = 0;
|
|
|
|
static int g_count = 0;
|
|
|
|
static int g_count = 0;
|
|
|
|
static int g_rdpindex = -1;
|
|
|
|
static int g_rdpindex = -1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern DevPrivateKeyRec g_rdpWindowIndex; /* from rdpmain.c */
|
|
|
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
|
|
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
|
|
|
extern int g_Bpp; /* from rdpmain.c */
|
|
|
|
extern int g_Bpp; /* from rdpmain.c */
|
|
|
|
extern int g_Bpp_mask; /* from rdpmain.c */
|
|
|
|
extern int g_Bpp_mask; /* from rdpmain.c */
|
|
|
@ -59,6 +60,8 @@ extern int g_use_rail; /* from rdpmain.c */
|
|
|
|
/* true is to use unix domain socket */
|
|
|
|
/* true is to use unix domain socket */
|
|
|
|
extern int g_use_uds; /* in rdpmain.c */
|
|
|
|
extern int g_use_uds; /* in rdpmain.c */
|
|
|
|
extern char g_uds_data[]; /* in rdpmain.c */
|
|
|
|
extern char g_uds_data[]; /* in rdpmain.c */
|
|
|
|
|
|
|
|
extern int g_do_dirty_ons; /* in rdpmain.c */
|
|
|
|
|
|
|
|
extern rdpPixmapRec g_screenPriv; /* in rdpmain.c */
|
|
|
|
|
|
|
|
|
|
|
|
struct rdpup_os_bitmap
|
|
|
|
struct rdpup_os_bitmap
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -75,6 +78,12 @@ static int g_os_bitmap_stamp = 0;
|
|
|
|
static int g_pixmap_byte_total = 0;
|
|
|
|
static int g_pixmap_byte_total = 0;
|
|
|
|
static int g_pixmap_num_used = 0;
|
|
|
|
static int g_pixmap_num_used = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct rdpup_top_window
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
WindowPtr wnd;
|
|
|
|
|
|
|
|
struct rdpup_top_window *next;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
0 GXclear, 0
|
|
|
|
0 GXclear, 0
|
|
|
|
1 GXnor, DPon
|
|
|
|
1 GXnor, DPon
|
|
|
@ -351,14 +360,24 @@ rdpup_send_pending(void)
|
|
|
|
/******************************************************************************/
|
|
|
|
/******************************************************************************/
|
|
|
|
static CARD32
|
|
|
|
static CARD32
|
|
|
|
rdpDeferredUpdateCallback(OsTimerPtr timer, CARD32 now, pointer arg)
|
|
|
|
rdpDeferredUpdateCallback(OsTimerPtr timer, CARD32 now, pointer arg)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
LLOGLN(10, ("rdpDeferredUpdateCallback"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (g_do_dirty_ons)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
rdpup_check_dirty_screen(&g_screenPriv);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
rdpup_send_pending();
|
|
|
|
rdpup_send_pending();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
g_scheduled = 0;
|
|
|
|
g_scheduled = 0;
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/******************************************************************************/
|
|
|
|
static void
|
|
|
|
void
|
|
|
|
rdpScheduleDeferredUpdate(void)
|
|
|
|
rdpScheduleDeferredUpdate(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!g_scheduled)
|
|
|
|
if (!g_scheduled)
|
|
|
@ -581,6 +600,35 @@ process_version_msg(int param1, int param2, int param3, int param4)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
|
|
|
rdpup_send_rail(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
WindowPtr wnd;
|
|
|
|
|
|
|
|
rdpWindowRec *priv;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wnd = g_pScreen->root;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (wnd != 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
wnd = wnd->lastChild;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (wnd != 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (wnd->realized)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
priv = GETWINPRIV(wnd);
|
|
|
|
|
|
|
|
priv->status = 1;
|
|
|
|
|
|
|
|
rdpup_create_window(wnd, priv);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wnd = wnd->prevSib;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/******************************************************************************/
|
|
|
|
static int
|
|
|
|
static int
|
|
|
|
rdpup_process_msg(struct stream *s)
|
|
|
|
rdpup_process_msg(struct stream *s)
|
|
|
@ -710,6 +758,7 @@ rdpup_process_msg(struct stream *s)
|
|
|
|
if (g_rdpScreen.client_info.rail_support_level > 0)
|
|
|
|
if (g_rdpScreen.client_info.rail_support_level > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_use_rail = 1;
|
|
|
|
g_use_rail = 1;
|
|
|
|
|
|
|
|
rdpup_send_rail();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -901,6 +950,8 @@ rdpup_check(void)
|
|
|
|
int
|
|
|
|
int
|
|
|
|
rdpup_begin_update(void)
|
|
|
|
rdpup_begin_update(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
LLOGLN(10, ("rdpup_begin_update"));
|
|
|
|
|
|
|
|
|
|
|
|
if (g_connected)
|
|
|
|
if (g_connected)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (g_begin)
|
|
|
|
if (g_begin)
|
|
|
@ -924,10 +975,19 @@ rdpup_begin_update(void)
|
|
|
|
int
|
|
|
|
int
|
|
|
|
rdpup_end_update(void)
|
|
|
|
rdpup_end_update(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
LLOGLN(10, ("rdpup_end_update"));
|
|
|
|
|
|
|
|
|
|
|
|
if (g_connected && g_begin)
|
|
|
|
if (g_connected && g_begin)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (g_do_dirty_ons)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
rdpup_send_pending();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
rdpScheduleDeferredUpdate();
|
|
|
|
rdpScheduleDeferredUpdate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1624,15 +1684,6 @@ rdpup_create_window(WindowPtr pWindow, rdpWindowRec *priv)
|
|
|
|
LLOGLN(10, ("rdpup_create_window: id 0x%8.8x", pWindow->drawable.id));
|
|
|
|
LLOGLN(10, ("rdpup_create_window: id 0x%8.8x", pWindow->drawable.id));
|
|
|
|
|
|
|
|
|
|
|
|
if (g_connected)
|
|
|
|
if (g_connected)
|
|
|
|
{
|
|
|
|
|
|
|
|
root_id = pWindow->drawable.pScreen->root->drawable.id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pWindow->overrideRedirect)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
style = XR_STYLE_TOOLTIP;
|
|
|
|
|
|
|
|
ext_style = XR_EXT_STYLE_TOOLTIP;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
style = XR_STYLE_NORMAL;
|
|
|
|
style = XR_STYLE_NORMAL;
|
|
|
|
ext_style = XR_EXT_STYLE_NORMAL;
|
|
|
|
ext_style = XR_EXT_STYLE_NORMAL;
|
|
|
@ -1694,8 +1745,8 @@ rdpup_create_window(WindowPtr pWindow, rdpWindowRec *priv)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
flags |= WINDOW_ORDER_FIELD_WND_RECTS;
|
|
|
|
flags |= WINDOW_ORDER_FIELD_WND_RECTS;
|
|
|
|
out_uint32_le(g_out_s, 0); /* visible_offset_x */
|
|
|
|
out_uint32_le(g_out_s, pWindow->drawable.x); /* visible_offset_x */
|
|
|
|
out_uint32_le(g_out_s, 0); /* visible_offset_y */
|
|
|
|
out_uint32_le(g_out_s, pWindow->drawable.y); /* visible_offset_y */
|
|
|
|
flags |= WINDOW_ORDER_FIELD_VIS_OFFSET;
|
|
|
|
flags |= WINDOW_ORDER_FIELD_VIS_OFFSET;
|
|
|
|
out_uint16_le(g_out_s, num_visibility_rects); /* num_visibility_rects */
|
|
|
|
out_uint16_le(g_out_s, num_visibility_rects); /* num_visibility_rects */
|
|
|
|
|
|
|
|
|
|
|
@ -1846,12 +1897,143 @@ rdpup_check_dirty(PixmapPtr pDirtyPixmap, rdpPixmapRec *pDirtyPriv)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
di = di->next;
|
|
|
|
rdpup_reset_clip();
|
|
|
|
|
|
|
|
rdpup_set_opcode(GXcopy);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RDI_SCRBLT:
|
|
|
|
|
|
|
|
LLOGLN(10, (" RDI_SCRBLT"));
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
di = di->next;
|
|
|
|
|
|
|
|
}
|
|
|
|
draw_item_remove_all(pDirtyPriv);
|
|
|
|
draw_item_remove_all(pDirtyPriv);
|
|
|
|
rdpup_end_update();
|
|
|
|
rdpup_end_update();
|
|
|
|
pDirtyPriv->is_dirty = 0;
|
|
|
|
pDirtyPriv->is_dirty = 0;
|
|
|
|
rdpup_switch_os_surface(-1);
|
|
|
|
rdpup_switch_os_surface(-1);
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
int
|
|
|
|
|
|
|
|
rdpup_check_dirty_screen(rdpPixmapRec *pDirtyPriv)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int index;
|
|
|
|
|
|
|
|
int clip_index;
|
|
|
|
|
|
|
|
int count;
|
|
|
|
|
|
|
|
int num_clips;
|
|
|
|
|
|
|
|
BoxRec box;
|
|
|
|
|
|
|
|
xSegment *seg;
|
|
|
|
|
|
|
|
struct image_data id;
|
|
|
|
|
|
|
|
struct rdp_draw_item *di;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pDirtyPriv == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pDirtyPriv->is_dirty == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LLOGLN(10, ("-----------------got dirty"));
|
|
|
|
|
|
|
|
rdpup_get_screen_image_rect(&id);
|
|
|
|
|
|
|
|
rdpup_begin_update();
|
|
|
|
|
|
|
|
draw_item_pack(pDirtyPriv);
|
|
|
|
|
|
|
|
di = pDirtyPriv->draw_item_head;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (di != 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
LLOGLN(10, ("rdpup_check_dirty_screen: type %d", di->type));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (di->type)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
case RDI_FILL:
|
|
|
|
|
|
|
|
rdpup_set_fgcolor(di->u.fill.fg_color);
|
|
|
|
|
|
|
|
rdpup_set_opcode(di->u.fill.opcode);
|
|
|
|
|
|
|
|
count = REGION_NUM_RECTS(di->reg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (index = 0; index < count; index++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
box = REGION_RECTS(di->reg)[index];
|
|
|
|
|
|
|
|
LLOGLN(10, (" RDI_FILL %d %d %d %d", box.x1, box.y1,
|
|
|
|
|
|
|
|
box.x2, box.y2));
|
|
|
|
|
|
|
|
rdpup_fill_rect(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rdpup_set_opcode(GXcopy);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RDI_IMGLL:
|
|
|
|
|
|
|
|
rdpup_set_hints(1, 1);
|
|
|
|
|
|
|
|
rdpup_set_opcode(di->u.img.opcode);
|
|
|
|
|
|
|
|
count = REGION_NUM_RECTS(di->reg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (index = 0; index < count; index++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
box = REGION_RECTS(di->reg)[index];
|
|
|
|
|
|
|
|
LLOGLN(10, (" RDI_IMGLL %d %d %d %d", box.x1, box.y1,
|
|
|
|
|
|
|
|
box.x2, box.y2));
|
|
|
|
|
|
|
|
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1,
|
|
|
|
|
|
|
|
box.y2 - box.y1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rdpup_set_opcode(GXcopy);
|
|
|
|
|
|
|
|
rdpup_set_hints(0, 1);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RDI_IMGLY:
|
|
|
|
|
|
|
|
rdpup_set_opcode(di->u.img.opcode);
|
|
|
|
|
|
|
|
count = REGION_NUM_RECTS(di->reg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (index = 0; index < count; index++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
box = REGION_RECTS(di->reg)[index];
|
|
|
|
|
|
|
|
LLOGLN(10, (" RDI_IMGLY %d %d %d %d", box.x1, box.y1,
|
|
|
|
|
|
|
|
box.x2, box.y2));
|
|
|
|
|
|
|
|
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1,
|
|
|
|
|
|
|
|
box.y2 - box.y1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rdpup_set_opcode(GXcopy);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RDI_LINE:
|
|
|
|
|
|
|
|
LLOGLN(10, (" RDI_LINE"));
|
|
|
|
|
|
|
|
num_clips = REGION_NUM_RECTS(di->reg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (num_clips > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
rdpup_set_fgcolor(di->u.line.fg_color);
|
|
|
|
|
|
|
|
rdpup_set_opcode(di->u.line.opcode);
|
|
|
|
|
|
|
|
rdpup_set_pen(0, di->u.line.width);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (clip_index = num_clips - 1; clip_index >= 0; clip_index--)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
box = REGION_RECTS(di->reg)[clip_index];
|
|
|
|
|
|
|
|
rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (index = 0; index < di->u.line.nseg; index++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
seg = di->u.line.segs + index;
|
|
|
|
|
|
|
|
LLOGLN(10, (" RDI_LINE %d %d %d %d", seg->x1, seg->y1,
|
|
|
|
|
|
|
|
seg->x2, seg->y2));
|
|
|
|
|
|
|
|
rdpup_draw_line(seg->x1, seg->y1, seg->x2, seg->y2);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rdpup_reset_clip();
|
|
|
|
|
|
|
|
rdpup_set_opcode(GXcopy);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RDI_SCRBLT:
|
|
|
|
|
|
|
|
LLOGLN(10, (" RDI_SCRBLT"));
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
di = di->next;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
draw_item_remove_all(pDirtyPriv);
|
|
|
|
|
|
|
|
rdpup_end_update();
|
|
|
|
|
|
|
|
pDirtyPriv->is_dirty = 0;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|