From 171f9d52b8d8afcd0fb12230f363c56a770b9d1e Mon Sep 17 00:00:00 2001 From: Li Peng Date: Tue, 13 Apr 2010 15:44:15 +0800 Subject: Add "inputclass" section into builtin config This way we can remove the input driver conf under xorg.conf.d and do autoconfig in xserver. Signed-off-by: Li Peng --- hw/xfree86/common/xf86AutoConfig.c | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-) diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index 7b836b0..44c3c92 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -85,6 +85,34 @@ #define BUILTIN_LAYOUT_SECTION_POST \ "EndSection\n\n" +#define BUILTIN_INPUTCLASS_NAME \ + "\"default\"" + +#define BUILTIN_INPUTCLASS_SECTION_PRE \ + "Section \"INPUTCLASS\"\n" \ + "\tIdentifier\t" BUILTIN_INPUTCLASS_NAME "\n" \ + "\tDriver\t\"%s\"\n" + +#define BUILTIN_INPUTCLASS_SECTION_POST \ + "EndSection\n\n" + +#define BUILTIN_INPUTCLASS_SECTION \ + BUILTIN_INPUTCLASS_SECTION_PRE \ + BUILTIN_INPUTCLASS_SECTION_POST + +#define BUILTIN_INPUTCLASS_TOUCHPAD_NAME \ + "\"synaptics\"" + +#define BUILTIN_INPUTCLASS_TOUCHPAD_SECTION_PRE \ + "Section \"INPUTCLASS\"\n" \ + "\tIdentifier\t" BUILTIN_INPUTCLASS_TOUCHPAD_NAME "\n" \ + "\tMatchIsTouchpad\t" "\"true\"" "\n" \ + "\tDriver\t\"%s\"\n" + +#define BUILTIN_INPUTCLASS_TOUCHPAD_SECTION \ + BUILTIN_INPUTCLASS_TOUCHPAD_SECTION_PRE \ + BUILTIN_INPUTCLASS_SECTION_POST + static const char **builtinConfig = NULL; static int builtinLines = 0; @@ -265,6 +293,12 @@ xf86AutoConfig(void) xfree(*p); } + snprintf(buf, sizeof(buf), BUILTIN_INPUTCLASS_SECTION, "evdev"); + AppendToConfig(buf); + + snprintf(buf, sizeof(buf), BUILTIN_INPUTCLASS_TOUCHPAD_SECTION, "synaptics"); + AppendToConfig(buf); + xf86MsgVerb(X_DEFAULT, 0, "Using default built-in configuration (%d lines)\n", builtinLines); -- 1.6.1.3