diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2013-07-23 19:26:07 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2013-07-23 19:26:07 -0700 |
commit | af8ca90784389f5b24df8721b34155b4a3ac12dd (patch) | |
tree | ec5619854a4eb057099abb2b5db9d1fe3b0848a5 /xorg/server/module | |
parent | 1f84c36ddd9803ae328713960bac4694374382ab (diff) | |
download | xrdp-proprietary-af8ca90784389f5b24df8721b34155b4a3ac12dd.tar.gz xrdp-proprietary-af8ca90784389f5b24df8721b34155b4a3ac12dd.zip |
xorg driver, work on input
Diffstat (limited to 'xorg/server/module')
-rw-r--r-- | xorg/server/module/Makefile | 2 | ||||
-rw-r--r-- | xorg/server/module/rdpComposite.c | 8 | ||||
-rw-r--r-- | xorg/server/module/rdpDraw.c | 4 | ||||
-rw-r--r-- | xorg/server/module/rdpFillSpans.c | 13 | ||||
-rw-r--r-- | xorg/server/module/rdpImageGlyphBlt.c | 11 | ||||
-rw-r--r-- | xorg/server/module/rdpImageText16.c | 11 | ||||
-rw-r--r-- | xorg/server/module/rdpImageText8.c | 11 | ||||
-rw-r--r-- | xorg/server/module/rdpInput.c | 119 | ||||
-rw-r--r-- | xorg/server/module/rdpInput.h | 41 | ||||
-rw-r--r-- | xorg/server/module/rdpMain.c | 2 | ||||
-rw-r--r-- | xorg/server/module/rdpPushPixels.c | 11 | ||||
-rw-r--r-- | xorg/server/module/rdpPutImage.c | 11 | ||||
-rw-r--r-- | xorg/server/module/rdpReg.c | 1 |
13 files changed, 238 insertions, 7 deletions
diff --git a/xorg/server/module/Makefile b/xorg/server/module/Makefile index eb8f1e29..6cb1893f 100644 --- a/xorg/server/module/Makefile +++ b/xorg/server/module/Makefile @@ -5,7 +5,7 @@ rdpPolyRectangle.o rdpPolyArc.o rdpFillPolygon.o rdpPolyFillRect.o \ rdpPolyFillArc.o rdpPolyText8.o rdpPolyText16.o rdpImageText8.o \ rdpImageText16.o rdpImageGlyphBlt.o rdpPolyGlyphBlt.o rdpPushPixels.o \ rdpCursor.o rdpMain.o rdpRandR.o rdpMisc.o rdpReg.o \ -rdpComposite.o rdpGlyphs.o rdpPixmap.o +rdpComposite.o rdpGlyphs.o rdpPixmap.o rdpInput.o CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 diff --git a/xorg/server/module/rdpComposite.c b/xorg/server/module/rdpComposite.c index a2c5568e..f41a4312 100644 --- a/xorg/server/module/rdpComposite.c +++ b/xorg/server/module/rdpComposite.c @@ -46,8 +46,8 @@ composite(alpha blending) calls static void rdpCompositeOrg(PictureScreenPtr ps, rdpPtr dev, CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, - INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, - INT16 yDst, CARD16 width, CARD16 height) + INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, + INT16 xDst, INT16 yDst, CARD16 width, CARD16 height) { ps->Composite = dev->Composite; ps->Composite(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, @@ -71,6 +71,6 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, pScrn = xf86Screens[pScreen->myNum]; dev = XRDPPTR(pScrn); ps = GetPictureScreen(pScreen); - rdpCompositeOrg(ps, dev, op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, - xDst, yDst, width, height); + rdpCompositeOrg(ps, dev, op, pSrc, pMask, pDst, xSrc, ySrc, + xMask, yMask, xDst, yDst, width, height); } diff --git a/xorg/server/module/rdpDraw.c b/xorg/server/module/rdpDraw.c index 462d7a13..a5a9e11b 100644 --- a/xorg/server/module/rdpDraw.c +++ b/xorg/server/module/rdpDraw.c @@ -39,6 +39,10 @@ misc draw calls #include "rdp.h" +#define LOG_LEVEL 1 +#define LLOGLN(_level, _args) \ + do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) + /*****************************************************************************/ void rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) diff --git a/xorg/server/module/rdpFillSpans.c b/xorg/server/module/rdpFillSpans.c index dbd4cc1e..69f4f01a 100644 --- a/xorg/server/module/rdpFillSpans.c +++ b/xorg/server/module/rdpFillSpans.c @@ -19,11 +19,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +/* this should be before all X11 .h files */ +#include <xorg-server.h> + +/* all driver need this */ +#include <xf86.h> +#include <xf86_OSproc.h> + #include "rdp.h" #include "rdpDraw.h" -#define LDEBUG 0 - #define LOG_LEVEL 1 #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) diff --git a/xorg/server/module/rdpImageGlyphBlt.c b/xorg/server/module/rdpImageGlyphBlt.c index 0b0d7ce8..1a9cd6db 100644 --- a/xorg/server/module/rdpImageGlyphBlt.c +++ b/xorg/server/module/rdpImageGlyphBlt.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +/* this should be before all X11 .h files */ +#include <xorg-server.h> + +/* all driver need this */ +#include <xf86.h> +#include <xf86_OSproc.h> + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/module/rdpImageText16.c b/xorg/server/module/rdpImageText16.c index 8ddd9bf3..6a3d9588 100644 --- a/xorg/server/module/rdpImageText16.c +++ b/xorg/server/module/rdpImageText16.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +/* this should be before all X11 .h files */ +#include <xorg-server.h> + +/* all driver need this */ +#include <xf86.h> +#include <xf86_OSproc.h> + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/module/rdpImageText8.c b/xorg/server/module/rdpImageText8.c index ab41753b..f05a6e87 100644 --- a/xorg/server/module/rdpImageText8.c +++ b/xorg/server/module/rdpImageText8.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +/* this should be before all X11 .h files */ +#include <xorg-server.h> + +/* all driver need this */ +#include <xf86.h> +#include <xf86_OSproc.h> + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/module/rdpInput.c b/xorg/server/module/rdpInput.c new file mode 100644 index 00000000..156165e2 --- /dev/null +++ b/xorg/server/module/rdpInput.c @@ -0,0 +1,119 @@ +/* +Copyright 2013 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 <stdio.h> +#include <stdlib.h> +#include <string.h> + +/* this should be before all X11 .h files */ +#include <xorg-server.h> + +/* all driver need this */ +#include <xf86.h> +#include <xf86_OSproc.h> + +#include "rdp.h" +#include "rdpDraw.h" +#include "rdpInput.h" +#include "rdpMisc.h" + +#define LOG_LEVEL 1 +#define LLOGLN(_level, _args) \ + do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) + +#define MAX_INPUT_PROC 4 + +struct input_proc_list +{ + int type; + rdpInputEventProcPtr proc; +}; + +static struct input_proc_list g_input_proc[MAX_INPUT_PROC]; + +/******************************************************************************/ +int +rdpRegisterInputCallback(int type, rdpInputEventProcPtr proc) +{ + if (type == 0) + { + g_input_proc[0].proc = proc; + } + else if (type == 1) + { + g_input_proc[1].proc = proc; + } + else + { + return 1; + } + return 0; +} + +/******************************************************************************/ +int +rdpUnregisterInputCallback(rdpInputEventProcPtr proc) +{ + int index; + + for (index = 0; index < MAX_INPUT_PROC; index++) + { + if (g_input_proc[index].proc == proc) + { + g_input_proc[index].proc = 0; + return 0; + } + } + return 1; +} + +/******************************************************************************/ +int +rdpInputKeyboardEvent(int msg, long param1, long param2, + long param3, long param4) +{ + if (g_input_proc[0].proc != 0) + { + return g_input_proc[0].proc(msg, param1, param2, param3, param4); + } + return 0; +} + +/******************************************************************************/ +int +rdpInputMouseEvent(int msg, long param1, long param2, + long param3, long param4) +{ + if (g_input_proc[1].proc != 0) + { + return g_input_proc[1].proc(msg, param1, param2, param3, param4); + } + return 0; +} + +/******************************************************************************/ +/* called when module loads */ +int +rdpInputInit(void) +{ + g_memset(g_input_proc, 0, sizeof(g_input_proc)); + return 0; +} diff --git a/xorg/server/module/rdpInput.h b/xorg/server/module/rdpInput.h new file mode 100644 index 00000000..91da3fcb --- /dev/null +++ b/xorg/server/module/rdpInput.h @@ -0,0 +1,41 @@ +/* +Copyright 2013 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. + +input + +*/ + +#ifndef _RDPINPUT_H +#define _RDPINPUT_H + +typedef int (*rdpInputEventProcPtr)(int msg, long param1, long param2, + long param3, long param4); + +int +rdpRegisterInputCallback(int type, rdpInputEventProcPtr proc); +int +rdpUnregisterInputCallback(rdpInputEventProcPtr proc); +int +rdpInputKeyboardEvent(int msg, long param1, long param2, + long param3, long param4); +int +rdpInputMouseEvent(int msg, long param1, long param2, + long param3, long param4); + +#endif 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; } diff --git a/xorg/server/module/rdpPushPixels.c b/xorg/server/module/rdpPushPixels.c index 3491d556..b02bc936 100644 --- a/xorg/server/module/rdpPushPixels.c +++ b/xorg/server/module/rdpPushPixels.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +/* this should be before all X11 .h files */ +#include <xorg-server.h> + +/* all driver need this */ +#include <xf86.h> +#include <xf86_OSproc.h> + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/module/rdpPutImage.c b/xorg/server/module/rdpPutImage.c index 2d9faa89..5c0e6f5f 100644 --- a/xorg/server/module/rdpPutImage.c +++ b/xorg/server/module/rdpPutImage.c @@ -19,6 +19,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +/* this should be before all X11 .h files */ +#include <xorg-server.h> + +/* all driver need this */ +#include <xf86.h> +#include <xf86_OSproc.h> + #include "rdp.h" #include "rdpDraw.h" diff --git a/xorg/server/module/rdpReg.c b/xorg/server/module/rdpReg.c index 3a343f14..e0cd4ea5 100644 --- a/xorg/server/module/rdpReg.c +++ b/xorg/server/module/rdpReg.c @@ -20,6 +20,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. to deal with regions changing in xorg versions */ + #include <stdio.h> #include <stdlib.h> #include <string.h> |