From af8ca90784389f5b24df8721b34155b4a3ac12dd Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Tue, 23 Jul 2013 19:26:07 -0700 Subject: xorg driver, work on input --- xorg/server/module/rdpMain.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xorg/server/module/rdpMain.c') diff --git a/xorg/server/module/rdpMain.c b/xorg/server/module/rdpMain.c index 9930764c..713f5549 100644 --- a/xorg/server/module/rdpMain.c +++ b/xorg/server/module/rdpMain.c @@ -63,6 +63,8 @@ xorgxrdpSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor) { g_initialised = 1; } + rdpInputInit(); + rdpPrivateInit(); return (pointer) 1; } -- cgit v1.2.3 From 17bf2abe309c5e146ae53c25e634089842e847f1 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Tue, 23 Jul 2013 20:57:38 -0700 Subject: xorg driver, include cleanup --- sesman/chansrv/chansrv.h | 2 +- sesman/chansrv/clipboard.h | 17 +++---- sesman/chansrv/clipboard_common.h | 8 ++-- sesman/chansrv/devredir.c | 88 ++++++++++++++++++++++------------- sesman/chansrv/drdynvc.c | 9 ++-- sesman/chansrv/irp.h | 14 +++--- sesman/chansrv/smartcard.c | 38 +++++++++------ xorg/X11R7.6/rdp/rdpmain.c | 4 +- xorg/server/module/rdpCopyArea.c | 11 +++++ xorg/server/module/rdpCopyPlane.c | 11 +++++ xorg/server/module/rdpFillPolygon.c | 11 +++++ xorg/server/module/rdpInput.h | 2 + xorg/server/module/rdpMain.c | 1 + xorg/server/module/rdpPolyArc.c | 11 +++++ xorg/server/module/rdpPolyFillArc.c | 11 +++++ xorg/server/module/rdpPolyFillRect.c | 11 +++++ xorg/server/module/rdpPolyGlyphBlt.c | 11 +++++ xorg/server/module/rdpPolyPoint.c | 11 +++++ xorg/server/module/rdpPolyRectangle.c | 11 +++++ xorg/server/module/rdpPolySegment.c | 11 +++++ xorg/server/module/rdpPolyText16.c | 11 +++++ xorg/server/module/rdpPolyText8.c | 11 +++++ xorg/server/module/rdpPolylines.c | 11 +++++ xorg/server/module/rdpRandR.c | 42 +---------------- xorg/server/module/rdpSetSpans.c | 11 +++++ xorg/server/xrdpkeyb/rdpKeyboard.c | 25 ---------- 26 files changed, 261 insertions(+), 143 deletions(-) (limited to 'xorg/server/module/rdpMain.c') diff --git a/sesman/chansrv/chansrv.h b/sesman/chansrv/chansrv.h index a6b88a35..bca30ca4 100644 --- a/sesman/chansrv/chansrv.h +++ b/sesman/chansrv/chansrv.h @@ -57,7 +57,7 @@ struct xrdp_api_data int APP_CC send_channel_data(int chan_id, char *data, int size); int APP_CC main_cleanup(void); int APP_CC find_empty_slot_in_dvc_channels(); -struct xrdp_api_data *APP_CC struct_from_dvc_chan_id(tui32 dvc_chan_id); +struct xrdp_api_data * APP_CC struct_from_dvc_chan_id(tui32 dvc_chan_id); int remove_struct_with_chan_id(tui32 dvc_chan_id); #define LOG_LEVEL 5 diff --git a/sesman/chansrv/clipboard.h b/sesman/chansrv/clipboard.h index 74919170..449899ba 100644 --- a/sesman/chansrv/clipboard.h +++ b/sesman/chansrv/clipboard.h @@ -1,8 +1,8 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2009-2012 - * Copyright (C) Laxmikant Rashinkar 2012 + * Copyright (C) Jay Sorg 2009-2013 + * Copyright (C) Laxmikant Rashinkar 2012-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,14 +23,9 @@ #include "arch.h" #include "parse.h" -int APP_CC -clipboard_init(void); -int APP_CC -clipboard_deinit(void); -int APP_CC -clipboard_data_in(struct stream* s, int chan_id, int chan_flags, int length, - int total_length); -int APP_CC -clipboard_xevent(void* xevent); +int APP_CC clipboard_init(void); +int APP_CC clipboard_deinit(void); +int APP_CC clipboard_data_in(struct stream *s, int chan_id, int chan_flags, int length, int total_length); +int APP_CC clipboard_xevent(void *xevent); #endif diff --git a/sesman/chansrv/clipboard_common.h b/sesman/chansrv/clipboard_common.h index b1d5d723..5a74de66 100644 --- a/sesman/chansrv/clipboard_common.h +++ b/sesman/chansrv/clipboard_common.h @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2012 + * Copyright (C) Jay Sorg 2012-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -127,9 +127,7 @@ struct clip_file_desc /* CLIPRDR_FILEDESCRIPTOR */ char cFileName[256]; }; -int APP_CC -clipboard_out_unicode(struct stream *s, char *text, int num_chars); -int APP_CC -clipboard_in_unicode(struct stream *s, char *text, int *num_chars); +int APP_CC clipboard_out_unicode(struct stream *s, char *text, int num_chars); +int APP_CC clipboard_in_unicode(struct stream *s, char *text, int *num_chars); #endif diff --git a/sesman/chansrv/devredir.c b/sesman/chansrv/devredir.c index 8de28e43..f254fa89 100644 --- a/sesman/chansrv/devredir.c +++ b/sesman/chansrv/devredir.c @@ -515,7 +515,9 @@ void dev_redir_send_drive_dir_request(IRP *irp, tui32 device_id, if (InitialQuery) { if (Path == NULL) + { return; + } /* Path in unicode needs this much space */ path_len = ((g_mbstowcs(NULL, Path, 0) * sizeof(twchar)) / 2) + 2; @@ -704,7 +706,8 @@ void devredir_proc_client_devlist_announce_req(struct stream *s) } } -void dev_redir_proc_device_iocompletion(struct stream *s) +void APP_CC +dev_redir_proc_device_iocompletion(struct stream *s) { FUSE_DATA *fuse_data = NULL; IRP *irp = NULL; @@ -859,11 +862,12 @@ done: log_debug("exiting"); } -void dev_redir_proc_query_dir_response(IRP *irp, - struct stream *s_in, - tui32 DeviceId, - tui32 CompletionId, - tui32 IoStatus) +void APP_CC +dev_redir_proc_query_dir_response(IRP *irp, + struct stream *s_in, + tui32 DeviceId, + tui32 CompletionId, + tui32 IoStatus) { FUSE_DATA *fuse_data = NULL; XRDP_INODE *xinode = NULL; @@ -984,7 +988,8 @@ void dev_redir_proc_query_dir_response(IRP *irp, * @return 0 on success, -1 on failure *****************************************************************************/ -int dev_redir_get_dir_listing(void *fusep, tui32 device_id, char *path) +int APP_CC +dev_redir_get_dir_listing(void *fusep, tui32 device_id, char *path) { tui32 DesiredAccess; tui32 CreateOptions; @@ -1028,8 +1033,9 @@ int dev_redir_get_dir_listing(void *fusep, tui32 device_id, char *path) return rval; } -int dev_redir_file_open(void *fusep, tui32 device_id, char *path, - int mode, int type, char *gen_buf) +int APP_CC +dev_redir_file_open(void *fusep, tui32 device_id, char *path, + int mode, int type, char *gen_buf) { tui32 DesiredAccess; tui32 CreateOptions; @@ -1140,7 +1146,8 @@ int devredir_file_close(void *fusep, tui32 device_id, tui32 FileId) * Remove (delete) a directory or file *****************************************************************************/ -int devredir_rmdir_or_file(void *fusep, tui32 device_id, char *path, int mode) +int APP_CC +devredir_rmdir_or_file(void *fusep, tui32 device_id, char *path, int mode) { tui32 DesiredAccess; tui32 CreateOptions; @@ -1181,8 +1188,9 @@ int devredir_rmdir_or_file(void *fusep, tui32 device_id, char *path, int mode) * @return 0 on success, -1 on failure *****************************************************************************/ -int devredir_file_read(void *fusep, tui32 DeviceId, tui32 FileId, - tui32 Length, tui64 Offset) +int APP_CC +devredir_file_read(void *fusep, tui32 DeviceId, tui32 FileId, + tui32 Length, tui64 Offset) { struct stream *s; IRP *irp; @@ -1229,8 +1237,9 @@ int devredir_file_read(void *fusep, tui32 DeviceId, tui32 FileId, return 0; } -int dev_redir_file_write(void *fusep, tui32 DeviceId, tui32 FileId, - const char *buf, tui32 Length, tui64 Offset) +int APP_CC +dev_redir_file_write(void *fusep, tui32 DeviceId, tui32 FileId, + const char *buf, tui32 Length, tui64 Offset) { struct stream *s; IRP *irp; @@ -1293,7 +1302,8 @@ int dev_redir_file_write(void *fusep, tui32 DeviceId, tui32 FileId, * @return FUSE_DATA on success, or NULL on failure *****************************************************************************/ -void *devredir_fuse_data_peek(IRP *irp) +void * APP_CC +devredir_fuse_data_peek(IRP *irp) { log_debug("returning %p", irp->fd_head); return irp->fd_head; @@ -1305,7 +1315,8 @@ void *devredir_fuse_data_peek(IRP *irp) * @return FUSE_DATA on success, NULL on failure *****************************************************************************/ -void *devredir_fuse_data_dequeue(IRP *irp) +void * APP_CC +devredir_fuse_data_dequeue(IRP *irp) { FUSE_DATA *head; @@ -1340,7 +1351,8 @@ void *devredir_fuse_data_dequeue(IRP *irp) * @return 0 on success, -1 on failure *****************************************************************************/ -int devredir_fuse_data_enqueue(IRP *irp, void *vp) +int APP_CC +devredir_fuse_data_enqueue(IRP *irp, void *vp) { FUSE_DATA *fd; FUSE_DATA *tail; @@ -1377,12 +1389,13 @@ int devredir_fuse_data_enqueue(IRP *irp, void *vp) ** miscellaneous stuff ** ******************************************************************************/ -void devredir_insert_DeviceIoRequest(struct stream *s, - tui32 DeviceId, - tui32 FileId, - tui32 CompletionId, - tui32 MajorFunction, - tui32 MinorFunction) +void APP_CC +devredir_insert_DeviceIoRequest(struct stream *s, + tui32 DeviceId, + tui32 FileId, + tui32 CompletionId, + tui32 MajorFunction, + tui32 MinorFunction) { /* setup DR_DEVICE_IOREQUEST header */ xstream_wr_u16_le(s, RDPDR_CTYP_CORE); @@ -1398,7 +1411,8 @@ void devredir_insert_DeviceIoRequest(struct stream *s, * Convert / to windows compatible \ *****************************************************************************/ -void devredir_cvt_slash(char *path) +void APP_CC +devredir_cvt_slash(char *path) { char *cptr = path; @@ -1410,7 +1424,8 @@ void devredir_cvt_slash(char *path) } } -void devredir_cvt_to_unicode(char *unicode, char *path) +void APP_CC +devredir_cvt_to_unicode(char *unicode, char *path) { char *dest; char *src; @@ -1435,7 +1450,8 @@ void devredir_cvt_to_unicode(char *unicode, char *path) *dest++ = 0; } -void devredir_cvt_from_unicode_len(char *path, char *unicode, int len) +void APP_CC +devredir_cvt_from_unicode_len(char *path, char *unicode, int len) { char *dest; char *dest_saved; @@ -1472,7 +1488,8 @@ void devredir_cvt_from_unicode_len(char *path, char *unicode, int len) g_free(dest_saved); } -int dev_redir_string_ends_with(char *string, char c) +int APP_CC +dev_redir_string_ends_with(char *string, char c) { int len; @@ -1480,14 +1497,16 @@ int dev_redir_string_ends_with(char *string, char c) return (string[len - 1] == c) ? 1 : 0; } -void devredir_insert_RDPDR_header(struct stream *s, tui16 Component, - tui16 PacketId) +void APP_CC +devredir_insert_RDPDR_header(struct stream *s, tui16 Component, + tui16 PacketId) { xstream_wr_u16_le(s, Component); xstream_wr_u16_le(s, PacketId); } -void devredir_proc_cid_rmdir_or_file(IRP *irp, tui32 IoStatus) +void APP_CC +devredir_proc_cid_rmdir_or_file(IRP *irp, tui32 IoStatus) { struct stream *s; int bytes; @@ -1523,7 +1542,8 @@ void devredir_proc_cid_rmdir_or_file(IRP *irp, tui32 IoStatus) return; } -void devredir_proc_cid_rmdir_or_file_resp(IRP *irp, tui32 IoStatus) +void APP_CC +devredir_proc_cid_rmdir_or_file_resp(IRP *irp, tui32 IoStatus) { FUSE_DATA *fuse_data; @@ -1549,7 +1569,8 @@ void devredir_proc_cid_rmdir_or_file_resp(IRP *irp, tui32 IoStatus) IRP_MJ_CLOSE, 0, 32); } -void devredir_proc_cid_rename_file(IRP *irp, tui32 IoStatus) +void APP_CC +devredir_proc_cid_rename_file(IRP *irp, tui32 IoStatus) { struct stream *s; int bytes; @@ -1601,7 +1622,8 @@ void devredir_proc_cid_rename_file(IRP *irp, tui32 IoStatus) return; } -void devredir_proc_cid_rename_file_resp(IRP *irp, tui32 IoStatus) +void APP_CC +devredir_proc_cid_rename_file_resp(IRP *irp, tui32 IoStatus) { FUSE_DATA *fuse_data; diff --git a/sesman/chansrv/drdynvc.c b/sesman/chansrv/drdynvc.c index af86ea57..eaad17cc 100644 --- a/sesman/chansrv/drdynvc.c +++ b/sesman/chansrv/drdynvc.c @@ -22,12 +22,9 @@ int g_drdynvc_chan_id; int g_drdynvc_inited = 0; static int APP_CC drdynvc_send_capability_request(uint16_t version); -static int APP_CC drdynvc_process_capability_response(struct stream* s, - unsigned char cmd); -static int APP_CC drdynvc_process_open_channel_response(struct stream *s, - unsigned char cmd); -static int APP_CC drdynvc_process_close_channel_response(struct stream *s, - unsigned char cmd); +static int APP_CC drdynvc_process_capability_response(struct stream* s, unsigned char cmd); +static int APP_CC drdynvc_process_open_channel_response(struct stream *s, unsigned char cmd); +static int APP_CC drdynvc_process_close_channel_response(struct stream *s, unsigned char cmd); static int APP_CC drdynvc_process_data_first(struct stream* s, unsigned char cmd); static int APP_CC drdynvc_process_data(struct stream* s, unsigned char cmd); static int APP_CC drdynvc_insert_uint_124(struct stream *s, uint32_t val); diff --git a/sesman/chansrv/irp.h b/sesman/chansrv/irp.h index 64cbac93..e1a65d83 100644 --- a/sesman/chansrv/irp.h +++ b/sesman/chansrv/irp.h @@ -54,12 +54,12 @@ struct irp tui32 CompletionId, tui32 IoStatus); }; -IRP * devredir_irp_new(); -IRP * devredir_irp_clone(IRP *irp); -int devredir_irp_delete(IRP *irp); -IRP * devredir_irp_find(tui32 completion_id); -IRP * devredir_irp_find_by_fileid(tui32 FileId); -IRP * devredir_irp_get_last(); -void devredir_irp_dump(); +IRP * APP_CC devredir_irp_new(void); +IRP * APP_CC devredir_irp_clone(IRP *irp); +int APP_CC devredir_irp_delete(IRP *irp); +IRP * APP_CC devredir_irp_find(tui32 completion_id); +IRP * APP_CC devredir_irp_find_by_fileid(tui32 FileId); +IRP * APP_CC devredir_irp_get_last(void); +void APP_CC devredir_irp_dump(void); #endif /* end ifndef __IRP_H */ diff --git a/sesman/chansrv/smartcard.c b/sesman/chansrv/smartcard.c index 19650be1..d1052b9c 100644 --- a/sesman/chansrv/smartcard.c +++ b/sesman/chansrv/smartcard.c @@ -147,7 +147,8 @@ static void scard_release_resources(void); ** non static functions ** ******************************************************************************/ -void scard_device_announce(tui32 device_id) +void APP_CC +scard_device_announce(tui32 device_id) { IRP *irp; @@ -187,9 +188,10 @@ void scard_device_announce(tui32 device_id) ** callbacks into this module ** ******************************************************************************/ -void scard_handle_EstablishContext_Return(struct stream *s, IRP *irp, - tui32 DeviceId, tui32 CompletionId, - tui32 IoStatus) +void APP_CC +scard_handle_EstablishContext_Return(struct stream *s, IRP *irp, + tui32 DeviceId, tui32 CompletionId, + tui32 IoStatus) { tui32 len; int tmp; @@ -243,9 +245,10 @@ void scard_handle_EstablishContext_Return(struct stream *s, IRP *irp, log_debug("leaving"); } -void scard_handle_ListReaders_Return(struct stream *s, IRP *irp, - tui32 DeviceId, tui32 CompletionId, - tui32 IoStatus) +void APP_CC +scard_handle_ListReaders_Return(struct stream *s, IRP *irp, + tui32 DeviceId, tui32 CompletionId, + tui32 IoStatus) { tui32 len; @@ -283,7 +286,8 @@ void scard_handle_ListReaders_Return(struct stream *s, IRP *irp, * *****************************************************************************/ -static void scard_send_EstablishContext(IRP *irp) +static void APP_CC +scard_send_EstablishContext(IRP *irp) { struct stream *s; int bytes; @@ -311,7 +315,8 @@ static void scard_send_EstablishContext(IRP *irp) * *****************************************************************************/ -static void scard_send_ListReaders(IRP *irp, int wide) +static void APP_CC +scard_send_ListReaders(IRP *irp, int wide) { /* see [MS-RDPESC] 2.2.2.4 */ @@ -405,7 +410,8 @@ static void scard_send_ListReaders(IRP *irp, int wide) * @return stream with IOCTL inserted in it, NULL on error *****************************************************************************/ -static struct stream *scard_make_new_ioctl(IRP *irp, tui32 ioctl) +static struct stream * APP_CC +scard_make_new_ioctl(IRP *irp, tui32 ioctl) { /* * format of device control request @@ -462,7 +468,8 @@ static struct stream *scard_make_new_ioctl(IRP *irp, tui32 ioctl) * @return index into smartcards[] on success, -1 on failure *****************************************************************************/ -static int scard_add_new_device(tui32 device_id) +static int APP_CC +scard_add_new_device(tui32 device_id) { int index; SMARTCARD *sc; @@ -485,10 +492,12 @@ static int scard_add_new_device(tui32 device_id) /** * Find first unused entry in smartcards * - * @return index of first unused entry in smartcards or -1 if smartcards is full + * @return index of first unused entry in smartcards or -1 if smartcards + * is full *****************************************************************************/ -static int scard_get_free_slot(void) +static int APP_CC +scard_get_free_slot(void) { int i; @@ -509,7 +518,8 @@ static int scard_get_free_slot(void) * Release resources prior to shutting down *****************************************************************************/ -static void scard_release_resources(void) +static void APP_CC +scard_release_resources(void) { int i; diff --git a/xorg/X11R7.6/rdp/rdpmain.c b/xorg/X11R7.6/rdp/rdpmain.c index ffb43d1f..48ad7e4d 100644 --- a/xorg/X11R7.6/rdp/rdpmain.c +++ b/xorg/X11R7.6/rdp/rdpmain.c @@ -50,6 +50,8 @@ int g_do_dirty_ons = 0; /* delay remoting screen */ Bool g_wrapWindow = 1; Bool g_wrapPixmap = 1; +int g_codec_mode = 0; /* 0 = standard rdp, 1 = rfx */ + rdpPixmapRec g_screenPriv; /* if true, running in RemoteApp / RAIL mode */ @@ -237,7 +239,7 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) memset(&g_screenPriv, 0, sizeof(g_screenPriv)); /*dpix = 75; - dpiy = 75;*/ + dpiy = 75; */ dpix = PixelDPI; dpiy = PixelDPI; diff --git a/xorg/server/module/rdpCopyArea.c b/xorg/server/module/rdpCopyArea.c index dd32644e..145cb511 100644 --- a/xorg/server/module/rdpCopyArea.c +++ b/xorg/server/module/rdpCopyArea.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include +#include +#include + +/* this should be before all X11 .h files */ +#include + +/* all driver need this */ +#include +#include + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/module/rdpCopyPlane.c b/xorg/server/module/rdpCopyPlane.c index 9b89125c..51f67eb3 100644 --- a/xorg/server/module/rdpCopyPlane.c +++ b/xorg/server/module/rdpCopyPlane.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include +#include +#include + +/* this should be before all X11 .h files */ +#include + +/* all driver need this */ +#include +#include + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/module/rdpFillPolygon.c b/xorg/server/module/rdpFillPolygon.c index 38043c0b..c9d48a77 100644 --- a/xorg/server/module/rdpFillPolygon.c +++ b/xorg/server/module/rdpFillPolygon.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include +#include +#include + +/* this should be before all X11 .h files */ +#include + +/* all driver need this */ +#include +#include + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/module/rdpInput.h b/xorg/server/module/rdpInput.h index 91da3fcb..f41a1025 100644 --- a/xorg/server/module/rdpInput.h +++ b/xorg/server/module/rdpInput.h @@ -37,5 +37,7 @@ rdpInputKeyboardEvent(int msg, long param1, long param2, int rdpInputMouseEvent(int msg, long param1, long param2, long param3, long param4); +int +rdpInputInit(void); #endif diff --git a/xorg/server/module/rdpMain.c b/xorg/server/module/rdpMain.c index 713f5549..f68bcef3 100644 --- a/xorg/server/module/rdpMain.c +++ b/xorg/server/module/rdpMain.c @@ -38,6 +38,7 @@ rdp module main #include #include "rdp.h" +#include "rdpInput.h" /******************************************************************************/ #define LOG_LEVEL 1 diff --git a/xorg/server/module/rdpPolyArc.c b/xorg/server/module/rdpPolyArc.c index 63fc699b..126bf48f 100644 --- a/xorg/server/module/rdpPolyArc.c +++ b/xorg/server/module/rdpPolyArc.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include +#include +#include + +/* this should be before all X11 .h files */ +#include + +/* all driver need this */ +#include +#include + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/module/rdpPolyFillArc.c b/xorg/server/module/rdpPolyFillArc.c index b53a1131..dc2437d1 100644 --- a/xorg/server/module/rdpPolyFillArc.c +++ b/xorg/server/module/rdpPolyFillArc.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include +#include +#include + +/* this should be before all X11 .h files */ +#include + +/* all driver need this */ +#include +#include + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/module/rdpPolyFillRect.c b/xorg/server/module/rdpPolyFillRect.c index dc929f9f..58626514 100644 --- a/xorg/server/module/rdpPolyFillRect.c +++ b/xorg/server/module/rdpPolyFillRect.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include +#include +#include + +/* this should be before all X11 .h files */ +#include + +/* all driver need this */ +#include +#include + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/module/rdpPolyGlyphBlt.c b/xorg/server/module/rdpPolyGlyphBlt.c index 5265ed72..44e4b188 100644 --- a/xorg/server/module/rdpPolyGlyphBlt.c +++ b/xorg/server/module/rdpPolyGlyphBlt.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include +#include +#include + +/* this should be before all X11 .h files */ +#include + +/* all driver need this */ +#include +#include + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/module/rdpPolyPoint.c b/xorg/server/module/rdpPolyPoint.c index 6c9c77c1..da0231a7 100644 --- a/xorg/server/module/rdpPolyPoint.c +++ b/xorg/server/module/rdpPolyPoint.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include +#include +#include + +/* this should be before all X11 .h files */ +#include + +/* all driver need this */ +#include +#include + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/module/rdpPolyRectangle.c b/xorg/server/module/rdpPolyRectangle.c index e80b8178..c52dfcb4 100644 --- a/xorg/server/module/rdpPolyRectangle.c +++ b/xorg/server/module/rdpPolyRectangle.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include +#include +#include + +/* this should be before all X11 .h files */ +#include + +/* all driver need this */ +#include +#include + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/module/rdpPolySegment.c b/xorg/server/module/rdpPolySegment.c index f4a9d40c..31d60121 100644 --- a/xorg/server/module/rdpPolySegment.c +++ b/xorg/server/module/rdpPolySegment.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include +#include +#include + +/* this should be before all X11 .h files */ +#include + +/* all driver need this */ +#include +#include + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/module/rdpPolyText16.c b/xorg/server/module/rdpPolyText16.c index b5eac8c5..2fd43b1f 100644 --- a/xorg/server/module/rdpPolyText16.c +++ b/xorg/server/module/rdpPolyText16.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include +#include +#include + +/* this should be before all X11 .h files */ +#include + +/* all driver need this */ +#include +#include + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/module/rdpPolyText8.c b/xorg/server/module/rdpPolyText8.c index 8931a4c1..979a7332 100644 --- a/xorg/server/module/rdpPolyText8.c +++ b/xorg/server/module/rdpPolyText8.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include +#include +#include + +/* this should be before all X11 .h files */ +#include + +/* all driver need this */ +#include +#include + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/module/rdpPolylines.c b/xorg/server/module/rdpPolylines.c index b439db28..a86e9fc4 100644 --- a/xorg/server/module/rdpPolylines.c +++ b/xorg/server/module/rdpPolylines.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include +#include +#include + +/* this should be before all X11 .h files */ +#include + +/* all driver need this */ +#include +#include + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/module/rdpRandR.c b/xorg/server/module/rdpRandR.c index fd080184..2255d33a 100644 --- a/xorg/server/module/rdpRandR.c +++ b/xorg/server/module/rdpRandR.c @@ -69,29 +69,8 @@ Bool rdpRRSetConfig(ScreenPtr pScreen, Rotation rotateKind, int rate, RRScreenSizePtr pSize) { - ScrnInfoPtr pScrn; - rdpPtr dev; - rrScrPrivPtr pRRScrPriv; - Bool rv; - LLOGLN(0, ("rdpRRSetConfig:")); - rv = TRUE; - pScrn = xf86Screens[pScreen->myNum]; - dev = XRDPPTR(pScrn); -#if 0 - pRRScrPriv = rrGetScrPriv(pScreen); - if (pRRScrPriv != 0) - { - if (dev->rrSetConfig != 0) - { - LLOGLN(0, ("rdpRRSetConfig: here")); - pRRScrPriv->rrSetConfig = dev->rrSetConfig; - rv = pRRScrPriv->rrSetConfig(pScreen, rotateKind, rate, pSize); - pRRScrPriv->rrSetConfig = rdpRRSetConfig; - } - } -#endif - return rv; + return TRUE; } /******************************************************************************/ @@ -102,32 +81,15 @@ rdpRRGetInfo(ScreenPtr pScreen, Rotation *pRotations) int height; ScrnInfoPtr pScrn; rdpPtr dev; - rrScrPrivPtr pRRScrPriv; - Bool rv; LLOGLN(0, ("rdpRRGetInfo:")); - rv = TRUE; pScrn = xf86Screens[pScreen->myNum]; dev = XRDPPTR(pScrn); -#if 0 - pRRScrPriv = rrGetScrPriv(pScreen); - if (pRRScrPriv != 0) - { - if (dev->rrGetInfo != 0) - { - LLOGLN(0, ("rdpRRGetInfo: here")); - pRRScrPriv->rrGetInfo = dev->rrGetInfo; - rv = pRRScrPriv->rrGetInfo(pScreen, pRotations); - pRRScrPriv->rrGetInfo = rdpRRGetInfo; - } - } -#else *pRotations = RR_Rotate_0; width = dev->width; height = dev->height; rdpRRRegisterSize(pScreen, width, height); -#endif - return rv; + return TRUE; } /******************************************************************************/ diff --git a/xorg/server/module/rdpSetSpans.c b/xorg/server/module/rdpSetSpans.c index 1bd9ed80..130306d3 100644 --- a/xorg/server/module/rdpSetSpans.c +++ b/xorg/server/module/rdpSetSpans.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include +#include +#include + +/* this should be before all X11 .h files */ +#include + +/* all driver need this */ +#include +#include + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/xrdpkeyb/rdpKeyboard.c b/xorg/server/xrdpkeyb/rdpKeyboard.c index 33894d88..572dc24d 100644 --- a/xorg/server/xrdpkeyb/rdpKeyboard.c +++ b/xorg/server/xrdpkeyb/rdpKeyboard.c @@ -55,13 +55,6 @@ static int g_tab_down = 0; above *_down vars */ static int g_scroll_lock_down = 0; -/* if 1, a keystroke is done every minute, down, then up */ -#define XRDPKB_TEST 0 - -#if XRDPKB_TEST -static OsTimerPtr g_timer = 0; -#endif - /******************************************************************************/ #define LOG_LEVEL 1 #define LLOGLN(_level, _args) \ @@ -517,21 +510,6 @@ rdpInputKeyboard(int msg, long param1, long param2, long param3, long param4) return 0; } -#if XRDPKB_TEST -/******************************************************************************/ -static CARD32 -rdpDeferredUpdateCallback(OsTimerPtr timer, CARD32 now, pointer arg) -{ - LLOGLN(0, ("rdpDeferredUpdateCallback:")); - - rdpEnqueueKey(KeyPress, 115); - rdpEnqueueKey(KeyRelease, 115); - - g_timer = TimerSet(g_timer, 0, 1000, rdpDeferredUpdateCallback, 0); - return 0; -} -#endif - /******************************************************************************/ void rdpkeybDeviceInit(DeviceIntPtr pDevice, KeySymsPtr pKeySyms, CARD8 *pModMap) @@ -637,9 +615,6 @@ rdpkeybControl(DeviceIntPtr device, int what) rdpkeybChangeKeyboardControl); g_keyboard = device; rdpRegisterInputCallback(0, rdpInputKeyboard); -#if XRDPKB_TEST - g_timer = TimerSet(g_timer, 0, 1000, rdpDeferredUpdateCallback, 0); -#endif break; case DEVICE_ON: pDev->on = 1; -- cgit v1.2.3 From 4865b1dc6b37be40ff47df62dabafa2728c03e1d Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Thu, 1 Aug 2013 23:30:23 -0700 Subject: xorg driver, work on rdpup --- xorg/server/module/rdpClientCon.c | 19 +++++++++++++++---- xorg/server/module/rdpClientCon.h | 2 ++ xorg/server/module/rdpCursor.c | 8 +++++--- xorg/server/module/rdpMain.c | 36 ++++++++++++++++++++++++++++++++---- xorg/server/xrdpdev/xrdpdev.c | 9 ++++++++- xorg/server/xrdpkeyb/rdpKeyboard.c | 16 ++++++++-------- xorg/server/xrdpmouse/rdpMouse.c | 16 ++++++++-------- 7 files changed, 78 insertions(+), 28 deletions(-) (limited to 'xorg/server/module/rdpMain.c') diff --git a/xorg/server/module/rdpClientCon.c b/xorg/server/module/rdpClientCon.c index 44ab97ff..3edd1e0c 100644 --- a/xorg/server/module/rdpClientCon.c +++ b/xorg/server/module/rdpClientCon.c @@ -195,7 +195,6 @@ rdpClientConCheck(ScreenPtr pScreen) int rdpClientConInit(rdpPtr dev) { - char text[256]; int i; if (!g_directory_exist("/tmp/.xrdp")) @@ -208,19 +207,18 @@ rdpClientConInit(rdpPtr dev) return 0; } } - g_chmod_hex("/tmp/.xrdp", 0x1777); } - i = atoi(display); - if (i < 1) { + LLOGLN(0, ("rdpClientConInit: can not run at display < 1")); return 0; } g_sprintf(dev->uds_data, "/tmp/.xrdp/xrdp_display_%s", display); if (dev->listen_sck == 0) { + unlink(dev->uds_data); dev->listen_sck = g_tcp_local_socket_stream(); if (g_tcp_local_bind(dev->listen_sck, dev->uds_data) != 0) { @@ -232,3 +230,16 @@ rdpClientConInit(rdpPtr dev) } return 0; } + +/******************************************************************************/ +int +rdpClientConDeinit(rdpPtr dev) +{ + LLOGLN(0, ("rdpClientConDeinit:")); + if (dev->listen_sck != 0) + { + close(dev->listen_sck); + unlink(dev->uds_data); + } + return 0; +} diff --git a/xorg/server/module/rdpClientCon.h b/xorg/server/module/rdpClientCon.h index 717e4359..85a3925a 100644 --- a/xorg/server/module/rdpClientCon.h +++ b/xorg/server/module/rdpClientCon.h @@ -38,5 +38,7 @@ int rdpClientConCheck(ScreenPtr pScreen); int rdpClientConInit(rdpPtr dev); +int +rdpClientConDeinit(rdpPtr dev); #endif diff --git a/xorg/server/module/rdpCursor.c b/xorg/server/module/rdpCursor.c index 82aafd78..1e5ad311 100644 --- a/xorg/server/module/rdpCursor.c +++ b/xorg/server/module/rdpCursor.c @@ -38,6 +38,7 @@ cursor #include #include "rdp.h" +#include "rdpMain.h" /******************************************************************************/ #define LOG_LEVEL 1 @@ -49,7 +50,7 @@ Bool rdpSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs) { LLOGLN(0, ("rdpSpriteRealizeCursor:")); - return 1; + return TRUE; } /******************************************************************************/ @@ -57,7 +58,7 @@ Bool rdpSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs) { LLOGLN(0, ("rdpSpriteUnrealizeCursor:")); - return 1; + return TRUE; } /******************************************************************************/ @@ -80,7 +81,7 @@ Bool rdpSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScr) { LLOGLN(0, ("rdpSpriteDeviceCursorInitialize:")); - return 1; + return TRUE; } /******************************************************************************/ @@ -88,4 +89,5 @@ void rdpSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScr) { LLOGLN(0, ("rdpSpriteDeviceCursorCleanup:")); + xorgxrdpDownDown(pScr); } diff --git a/xorg/server/module/rdpMain.c b/xorg/server/module/rdpMain.c index f68bcef3..f19b06cd 100644 --- a/xorg/server/module/rdpMain.c +++ b/xorg/server/module/rdpMain.c @@ -39,6 +39,8 @@ rdp module main #include "rdp.h" #include "rdpInput.h" +#include "rdpDraw.h" +#include "rdpClientCon.h" /******************************************************************************/ #define LOG_LEVEL 1 @@ -53,22 +55,43 @@ rdp module main #define PACKAGE_VERSION_MINOR 0 #define PACKAGE_VERSION_PATCHLEVEL 0 -static int g_initialised = 0; +static Bool g_initialised = FALSE; /*****************************************************************************/ static pointer -xorgxrdpSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor) +xorgxrdpSetup(pointer Module, pointer Options, + int *ErrorMajor, int *ErrorMinor) { LLOGLN(0, ("xorgxrdpSetup:")); if (!g_initialised) { - g_initialised = 1; + g_initialised = TRUE; } rdpInputInit(); rdpPrivateInit(); return (pointer) 1; } +/*****************************************************************************/ +static void +xorgxrdpTearDown(pointer Module) +{ + LLOGLN(0, ("xorgxrdpTearDown:")); +} + +/*****************************************************************************/ +void +xorgxrdpDownDown(ScreenPtr pScreen) +{ + LLOGLN(0, ("xorgxrdpDownDown:")); + if (g_initialised) + { + g_initialised = FALSE; + LLOGLN(0, ("xorgxrdpDownDown: 1")); + rdpClientConDeinit(rdpGetDevFromScreen(pScreen)); + } +} + static MODULESETUPPROTO(xorgxrdpSetup); static XF86ModuleVersionInfo RDPVersRec = { @@ -86,4 +109,9 @@ static XF86ModuleVersionInfo RDPVersRec = { 0, 0, 0, 0 } }; -XF86ModuleData xorgxrdpModuleData = { &RDPVersRec, xorgxrdpSetup, NULL }; +_X_EXPORT XF86ModuleData xorgxrdpModuleData = +{ + &RDPVersRec, + xorgxrdpSetup, + xorgxrdpTearDown +}; diff --git a/xorg/server/xrdpdev/xrdpdev.c b/xorg/server/xrdpdev/xrdpdev.c index 7f47d9fe..2bc6732a 100644 --- a/xorg/server/xrdpdev/xrdpdev.c +++ b/xorg/server/xrdpdev/xrdpdev.c @@ -714,10 +714,17 @@ xrdpdevSetup(pointer module, pointer opts, int *errmaj, int *errmin) } } +/*****************************************************************************/ +static void +xrdpdevTearDown(pointer Module) +{ + LLOGLN(0, ("xrdpdevTearDown:")); +} + /* ModuleData */ _X_EXPORT XF86ModuleData xrdpdevModuleData = { &g_VersRec, xrdpdevSetup, - 0 + xrdpdevTearDown }; diff --git a/xorg/server/xrdpkeyb/rdpKeyboard.c b/xorg/server/xrdpkeyb/rdpKeyboard.c index efe1734a..26ba73b4 100644 --- a/xorg/server/xrdpkeyb/rdpKeyboard.c +++ b/xorg/server/xrdpkeyb/rdpKeyboard.c @@ -696,13 +696,6 @@ static InputDriverRec rdpkeyb = 0 /* ref count */ }; -/******************************************************************************/ -static void -rdpkeybUnplug(pointer p) -{ - LLOGLN(0, ("rdpkeybUnplug:")); -} - /******************************************************************************/ static pointer rdpkeybPlug(pointer module, pointer options, int *errmaj, int *errmin) @@ -712,6 +705,13 @@ rdpkeybPlug(pointer module, pointer options, int *errmaj, int *errmin) return module; } +/******************************************************************************/ +static void +rdpkeybUnplug(pointer p) +{ + LLOGLN(0, ("rdpkeybUnplug:")); +} + /******************************************************************************/ static XF86ModuleVersionInfo rdpkeybVersionRec = { @@ -730,7 +730,7 @@ static XF86ModuleVersionInfo rdpkeybVersionRec = }; /******************************************************************************/ -XF86ModuleData xrdpkeybModuleData = +_X_EXPORT XF86ModuleData xrdpkeybModuleData = { &rdpkeybVersionRec, rdpkeybPlug, diff --git a/xorg/server/xrdpmouse/rdpMouse.c b/xorg/server/xrdpmouse/rdpMouse.c index ce7a26e7..6215c408 100644 --- a/xorg/server/xrdpmouse/rdpMouse.c +++ b/xorg/server/xrdpmouse/rdpMouse.c @@ -330,13 +330,6 @@ static InputDriverRec rdpmouse = 0 /* ref count */ }; -/******************************************************************************/ -static void -rdpmouseUnplug(pointer p) -{ - LLOGLN(0, ("rdpmouseUnplug:")); -} - /******************************************************************************/ static pointer rdpmousePlug(pointer module, pointer options, int *errmaj, int *errmin) @@ -346,6 +339,13 @@ rdpmousePlug(pointer module, pointer options, int *errmaj, int *errmin) return module; } +/******************************************************************************/ +static void +rdpmouseUnplug(pointer p) +{ + LLOGLN(0, ("rdpmouseUnplug:")); +} + /******************************************************************************/ static XF86ModuleVersionInfo rdpmouseVersionRec = { @@ -364,7 +364,7 @@ static XF86ModuleVersionInfo rdpmouseVersionRec = }; /******************************************************************************/ -XF86ModuleData xrdpmouseModuleData = +_X_EXPORT XF86ModuleData xrdpmouseModuleData = { &rdpmouseVersionRec, rdpmousePlug, -- cgit v1.2.3