libxrdp: no logic change, statis functions, indent

This commit is contained in:
Jay Sorg 2014-12-18 19:40:26 -08:00
parent a2183bc243
commit eddf0eefdc

View File

@ -117,16 +117,36 @@ xrdp_fastpath_init(struct xrdp_fastpath *self, struct stream *s)
int APP_CC int APP_CC
xrdp_fastpath_send(struct xrdp_fastpath *self, struct stream *s) xrdp_fastpath_send(struct xrdp_fastpath *self, struct stream *s)
{ {
if (trans_force_write_s(self->trans, s) != 0) if (trans_force_write_s(self->trans, s) != 0)
{ {
return 1; return 1;
} }
return 0; return 0;
} }
/*****************************************************************************/
static int APP_CC
xrdp_fastpath_session_callback(struct xrdp_fastpath *self, int msg,
long param1, long param2,
long param3, long param4)
{
if (self->session->callback != 0)
{
/* msg_type can be
RDP_INPUT_SYNCHRONIZE - 0
RDP_INPUT_SCANCODE - 4
RDP_INPUT_MOUSE - 0x8001
RDP_INPUT_MOUSEX - 0x8002 */
/* call to xrdp_wm.c : callback */
self->session->callback(self->session->id, msg,
param1, param2, param3, param4);
}
return 0;
}
/*****************************************************************************/ /*****************************************************************************/
/* FASTPATH_INPUT_EVENT_SCANCODE */ /* FASTPATH_INPUT_EVENT_SCANCODE */
int APP_CC static int APP_CC
xrdp_fastpath_process_EVENT_SCANCODE(struct xrdp_fastpath *self, xrdp_fastpath_process_EVENT_SCANCODE(struct xrdp_fastpath *self,
int eventFlags, struct stream *s) int eventFlags, struct stream *s)
{ {
@ -152,25 +172,17 @@ xrdp_fastpath_process_EVENT_SCANCODE(struct xrdp_fastpath *self,
if ((eventFlags & FASTPATH_INPUT_KBDFLAGS_EXTENDED)) if ((eventFlags & FASTPATH_INPUT_KBDFLAGS_EXTENDED))
flags |= KBD_FLAG_EXT; flags |= KBD_FLAG_EXT;
if (self->session->callback != 0) xrdp_fastpath_session_callback(self, RDP_INPUT_SCANCODE,
{ code, 0, flags, 0);
/* msg_type can be
RDP_INPUT_SYNCHRONIZE - 0
RDP_INPUT_SCANCODE - 4
RDP_INPUT_MOUSE - 0x8001
RDP_INPUT_MOUSEX - 0x8002 */
/* call to xrdp_wm.c : callback */
self->session->callback(self->session->id, RDP_INPUT_SCANCODE, code, 0,
flags, 0);
}
return 0; return 0;
} }
/*****************************************************************************/ /*****************************************************************************/
/* FASTPATH_INPUT_EVENT_MOUSE */ /* FASTPATH_INPUT_EVENT_MOUSE */
int APP_CC static int APP_CC
xrdp_fastpath_process_EVENT_MOUSE(struct xrdp_fastpath *self, int eventFlags, xrdp_fastpath_process_EVENT_MOUSE(struct xrdp_fastpath *self,
struct stream *s) int eventFlags, struct stream *s)
{ {
int pointerFlags; int pointerFlags;
int xPos; int xPos;
@ -190,23 +202,15 @@ xrdp_fastpath_process_EVENT_MOUSE(struct xrdp_fastpath *self, int eventFlags,
in_uint16_le(s, xPos); /* xPos (2 bytes) */ in_uint16_le(s, xPos); /* xPos (2 bytes) */
in_uint16_le(s, yPos); /* yPos (2 bytes) */ in_uint16_le(s, yPos); /* yPos (2 bytes) */
if (self->session->callback != 0) xrdp_fastpath_session_callback(self, RDP_INPUT_MOUSE,
{ xPos, yPos, pointerFlags, 0);
/* msg_type can be
RDP_INPUT_SYNCHRONIZE - 0
RDP_INPUT_SCANCODE - 4
RDP_INPUT_MOUSE - 0x8001
RDP_INPUT_MOUSEX - 0x8002 */
/* call to xrdp_wm.c : callback */
self->session->callback(self->session->id, RDP_INPUT_MOUSE,
xPos, yPos, pointerFlags, 0);
}
return 0; return 0;
} }
/*****************************************************************************/ /*****************************************************************************/
/* FASTPATH_INPUT_EVENT_MOUSEX */ /* FASTPATH_INPUT_EVENT_MOUSEX */
int APP_CC static int APP_CC
xrdp_fastpath_process_EVENT_MOUSEX(struct xrdp_fastpath *self, xrdp_fastpath_process_EVENT_MOUSEX(struct xrdp_fastpath *self,
int eventFlags, struct stream *s) int eventFlags, struct stream *s)
{ {
@ -228,50 +232,35 @@ xrdp_fastpath_process_EVENT_MOUSEX(struct xrdp_fastpath *self,
in_uint16_le(s, xPos); /* xPos (2 bytes) */ in_uint16_le(s, xPos); /* xPos (2 bytes) */
in_uint16_le(s, yPos); /* yPos (2 bytes) */ in_uint16_le(s, yPos); /* yPos (2 bytes) */
if (self->session->callback != 0) xrdp_fastpath_session_callback(self, RDP_INPUT_MOUSEX,
{ xPos, yPos, pointerFlags, 0);
/* msg_type can be
RDP_INPUT_SYNCHRONIZE - 0
RDP_INPUT_SCANCODE - 4
RDP_INPUT_MOUSE - 0x8001
RDP_INPUT_MOUSEX - 0x8002 */
/* call to xrdp_wm.c : callback */
self->session->callback(self->session->id, RDP_INPUT_MOUSEX,
xPos, yPos, pointerFlags, 0);
}
return 0; return 0;
} }
/*****************************************************************************/ /*****************************************************************************/
/* FASTPATH_INPUT_EVENT_SYNC */ /* FASTPATH_INPUT_EVENT_SYNC */
int APP_CC static int APP_CC
xrdp_fastpath_process_EVENT_SYNC(struct xrdp_fastpath *self, int eventCode, xrdp_fastpath_process_EVENT_SYNC(struct xrdp_fastpath *self,
int eventFlags, struct stream *s) int eventFlags, struct stream *s)
{ {
/* /*
* The eventCode bitfield (3 bits in size) MUST be set to * The eventCode bitfield (3 bits in size) MUST be set to
* FASTPATH_INPUT_EVENT_SYNC (3). * FASTPATH_INPUT_EVENT_SYNC (3).
* The eventFlags bitfield (5 bits in size) contains flags * The eventFlags bitfield (5 bits in size) contains flags
* indicating the "on" * indicating the "on"
* status of the keyboard toggle keys. * status of the keyboard toggle keys.
*/ */
if (self->session->callback != 0)
{ xrdp_fastpath_session_callback(self, RDP_INPUT_SYNCHRONIZE,
/* msg_type can be eventFlags, 0, 0, 0);
RDP_INPUT_SYNCHRONIZE - 0
RDP_INPUT_SCANCODE - 4
RDP_INPUT_MOUSE - 0x8001
RDP_INPUT_MOUSEX - 0x8002 */
/* call to xrdp_wm.c : callback */
self->session->callback(self->session->id, RDP_INPUT_SYNCHRONIZE,
eventFlags, 0, 0, 0);
}
return 0; return 0;
} }
/*****************************************************************************/ /*****************************************************************************/
/* FASTPATH_INPUT_EVENT_UNICODE */ /* FASTPATH_INPUT_EVENT_UNICODE */
int APP_CC static int APP_CC
xrdp_fastpath_process_EVENT_UNICODE(struct xrdp_fastpath *self, xrdp_fastpath_process_EVENT_UNICODE(struct xrdp_fastpath *self,
int eventFlags, struct stream *s) int eventFlags, struct stream *s)
{ {
@ -286,7 +275,8 @@ xrdp_fastpath_process_EVENT_UNICODE(struct xrdp_fastpath *self,
/*****************************************************************************/ /*****************************************************************************/
/* FASTPATH_INPUT_EVENT */ /* FASTPATH_INPUT_EVENT */
int APP_CC int APP_CC
xrdp_fastpath_process_input_event(struct xrdp_fastpath *self, struct stream *s) xrdp_fastpath_process_input_event(struct xrdp_fastpath *self,
struct stream *s)
{ {
int i; int i;
int eventHeader; int eventHeader;
@ -315,7 +305,6 @@ xrdp_fastpath_process_input_event(struct xrdp_fastpath *self, struct stream *s)
return 1; return 1;
} }
break; break;
case FASTPATH_INPUT_EVENT_MOUSE: case FASTPATH_INPUT_EVENT_MOUSE:
if (xrdp_fastpath_process_EVENT_MOUSE(self, if (xrdp_fastpath_process_EVENT_MOUSE(self,
eventFlags, eventFlags,
@ -333,7 +322,7 @@ xrdp_fastpath_process_input_event(struct xrdp_fastpath *self, struct stream *s)
} }
break; break;
case FASTPATH_INPUT_EVENT_SYNC: case FASTPATH_INPUT_EVENT_SYNC:
if (xrdp_fastpath_process_EVENT_SYNC(self, eventCode, if (xrdp_fastpath_process_EVENT_SYNC(self,
eventFlags, eventFlags,
s) != 0) s) != 0)
{ {
@ -352,7 +341,7 @@ xrdp_fastpath_process_input_event(struct xrdp_fastpath *self, struct stream *s)
g_writeln("xrdp_fastpath_process_input_event: unknown " g_writeln("xrdp_fastpath_process_input_event: unknown "
"eventCode %d", eventCode); "eventCode %d", eventCode);
break; break;
} }
} }
return 0; return 0;
} }