added ui_begin/end_update and rdp_loop for ports

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@712 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Jay Sorg 2004-06-16 03:08:55 +00:00
parent 98ce135262
commit 2942c88808
4 changed files with 60 additions and 4 deletions

View File

@ -87,6 +87,7 @@ void process_cached_pointer_pdu(STREAM s);
void process_system_pointer_pdu(STREAM s);
void process_bitmap_updates(STREAM s);
void process_palette(STREAM s);
BOOL rdp_loop(BOOL * deactivated, uint32 * ext_disc_reason);
void rdp_main_loop(BOOL * deactivated, uint32 * ext_disc_reason);
BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password, char *command,
char *directory);
@ -155,6 +156,8 @@ uint16 ui_get_numlock_state(unsigned int state);
void reset_modifier_keys(void);
void rdp_send_scancode(uint32 time, uint16 flags, uint8 scancode);
/* xwin.c */
void ui_begin_update(void);
void ui_end_update(void);
BOOL get_key_state(unsigned int state, uint32 keysym);
BOOL ui_init(void);
void ui_deinit(void);

42
rdp.c
View File

@ -924,6 +924,7 @@ process_update_pdu(STREAM s)
in_uint16_le(s, update_type);
ui_begin_update();
switch (update_type)
{
case RDP_UPDATE_ORDERS:
@ -947,7 +948,7 @@ process_update_pdu(STREAM s)
default:
unimpl("update %d\n", update_type);
}
ui_end_update();
}
/* Process a disconnect PDU */
@ -1078,6 +1079,45 @@ rdp_main_loop(BOOL * deactivated, uint32 * ext_disc_reason)
return;
}
/* used in uiports, processes the rdp packets waiting */
BOOL
rdp_loop(BOOL * deactivated, uint32 * ext_disc_reason)
{
uint8 type;
BOOL disc = False; /* True when a disconnect PDU was received */
BOOL cont = True;
STREAM s;
while (cont)
{
s = rdp_recv(&type);
if (s == NULL)
return False;
switch (type)
{
case RDP_PDU_DEMAND_ACTIVE:
process_demand_active(s);
*deactivated = False;
break;
case RDP_PDU_DEACTIVATE:
DEBUG(("RDP_PDU_DEACTIVATE\n"));
*deactivated = True;
break;
case RDP_PDU_DATA:
disc = process_data_pdu(s, ext_disc_reason);
break;
case 0:
break;
default:
unimpl("PDU %d\n", type);
}
if (disc)
return False;
cont = g_next_packet < s->end;
}
return True;
}
/* Establish a connection up to the RDP layer */
BOOL
rdp_connect(char *server, uint32 flags, char *domain, char *password,

2
rdp5.c
View File

@ -47,6 +47,7 @@ rdp5_process(STREAM s, BOOL encryption)
hexdump(s->p, s->end - s->p);
#endif
ui_begin_update();
while (s->p < s->end)
{
in_uint8(s, type);
@ -125,4 +126,5 @@ rdp5_process(STREAM s, BOOL encryption)
s->p = next;
}
ui_end_update();
}

11
xwin.c
View File

@ -2183,3 +2183,14 @@ ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy)
XFree(image);
}
/* these do nothing here but are used in uiports */
void
ui_begin_update(void)
{
}
void
ui_end_update(void)
{
}