diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2013-07-14 20:47:52 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2013-07-14 20:47:52 -0700 |
commit | 720751ae360bfbf16b1e11dcffc0e2d5cce4540b (patch) | |
tree | 7c6fb94d0b89d8e2c3788103488a9b29ff2e122d /xorg/server/xrdpkeyb/rdpKeyboard.c | |
parent | d53588b683a3d2ad4db43ff4564b31187d9455e6 (diff) | |
download | xrdp-proprietary-720751ae360bfbf16b1e11dcffc0e2d5cce4540b.tar.gz xrdp-proprietary-720751ae360bfbf16b1e11dcffc0e2d5cce4540b.zip |
work on Xorg keyboard and mouse drivers
Diffstat (limited to 'xorg/server/xrdpkeyb/rdpKeyboard.c')
-rw-r--r-- | xorg/server/xrdpkeyb/rdpKeyboard.c | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/xorg/server/xrdpkeyb/rdpKeyboard.c b/xorg/server/xrdpkeyb/rdpKeyboard.c index fbf4eb1c..88bcf680 100644 --- a/xorg/server/xrdpkeyb/rdpKeyboard.c +++ b/xorg/server/xrdpkeyb/rdpKeyboard.c @@ -20,3 +20,117 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. xrdp keyboard module */ + +#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 "xf86Xinput.h" + +#include <mipointer.h> +#include <fb.h> +#include <micmap.h> +#include <mi.h> + +#include "rdp.h" + +/******************************************************************************/ +#define LOG_LEVEL 1 +#define LLOGLN(_level, _args) \ + do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) + +#define XRDP_DRIVER_NAME "XRDPKEYB" +#define XRDP_NAME "XRDPKEYB" +#define XRDP_VERSION 1000 + +#define PACKAGE_VERSION_MAJOR 1 +#define PACKAGE_VERSION_MINOR 0 +#define PACKAGE_VERSION_PATCHLEVEL 0 + +/******************************************************************************/ +static int +rdpKeybControl(DeviceIntPtr device, int what) +{ + LLOGLN(0, ("rdpKeybControl: what %d", what)); + return 0; +} + +/******************************************************************************/ +static int +rdpkeybPreInit(InputDriverPtr drv, InputInfoPtr info, int flags) +{ + LLOGLN(0, ("rdpkeybPreInit: drv %p info %p, flags 0x%x", + drv, info, flags)); + info->device_control = rdpKeybControl; + info->type_name = "Keyboard"; + + return 0; +} + +/******************************************************************************/ +static void +rdpkeybUnInit(InputDriverPtr drv, InputInfoPtr info, int flags) +{ + LLOGLN(0, ("rdpkeybUnInit: drv %p info %p, flags 0x%x", + drv, info, flags)); +} + +/******************************************************************************/ +static InputDriverRec rdpkeyb = +{ + PACKAGE_VERSION_MAJOR, /* version */ + XRDP_NAME, /* name */ + NULL, /* identify */ + rdpkeybPreInit, /* preinit */ + rdpkeybUnInit, /* uninit */ + NULL, /* module */ + 0 /* ref count */ +}; + +/******************************************************************************/ +static void +rdpkeybUnplug(pointer p) +{ + LLOGLN(0, ("rdpkeybUnplug:")); +} + +/******************************************************************************/ +static pointer +rdpkeybPlug(pointer module, pointer options, int *errmaj, int *errmin) +{ + LLOGLN(0, ("rdpkeybPlug:")); + xf86AddInputDriver(&rdpkeyb, module, 0); + return module; +} + +/******************************************************************************/ +static XF86ModuleVersionInfo rdpkeybVersionRec = +{ + XRDP_DRIVER_NAME, + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XORG_VERSION_CURRENT, + PACKAGE_VERSION_MAJOR, + PACKAGE_VERSION_MINOR, + PACKAGE_VERSION_PATCHLEVEL, + ABI_CLASS_XINPUT, + ABI_XINPUT_VERSION, + MOD_CLASS_XINPUT, + { 0, 0, 0, 0 } +}; + +/******************************************************************************/ +XF86ModuleData xrdpkeybModuleData = +{ + &rdpkeybVersionRec, + rdpkeybPlug, + rdpkeybUnplug +}; |