summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2008-07-13 18:40:53 +0930
committerPeter Hutterer <peter.hutterer@who-t.net>2008-07-13 20:54:33 +0930
commit5bcc45e07e8726a5442567472dd29cfb5c901f2d (patch)
tree231436a1967b3fbcf0e9a929b67204f68378afb5 /Xi
parentc9eb0e870c87d291311491452adf7f91a911e24b (diff)
Xi: expose Enable/DisableDevice through XI_PROP_ENABLED property.
Diffstat (limited to 'Xi')
-rw-r--r--Xi/extinit.c2
-rw-r--r--Xi/xiproperty.c46
-rw-r--r--Xi/xiproperty.h2
3 files changed, 50 insertions, 0 deletions
diff --git a/Xi/extinit.c b/Xi/extinit.c
index 7460d71ee..ba93ebcf0 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -123,6 +123,7 @@ SOFTWARE.
#include "warpdevp.h"
#include "xiselev.h"
#include "xiproperty.c"
+#include "xiproperty.h"
static Mask lastExtEventMask = 1;
@@ -1140,6 +1141,7 @@ XInputExtensionInit(void)
IEventBase = extEntry->eventBase;
AllExtensionVersions[IReqCode - 128] = thisversion;
MakeDeviceTypeAtoms();
+ XIInitKnownProperties();
RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone);
RegisterResourceName(RT_INPUTCLIENT, "INPUTCLIENT");
FixExtensionEvents(extEntry);
diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index 17043beab..c9a01e4b7 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -39,8 +39,54 @@
#include "xiproperty.h"
+/**
+ * Properties used or alloced from inside the server.
+ */
+static struct dev_properties
+{
+ Atom type;
+ char *name;
+} dev_properties[] = {
+ {0, XI_PROP_ENABLED}
+};
+
static long XIPropHandlerID = 1;
+/**
+ * Return the type assigned to the specified atom or 0 if the atom isn't known
+ * to the DIX.
+ */
+_X_EXPORT Atom
+XIGetKnownProperty(char *name)
+{
+ int i;
+ for (i = 0; i < (sizeof(dev_properties)/sizeof(struct dev_properties)); i++)
+ {
+ if (strcmp(name, dev_properties[i].name) == 0)
+ return dev_properties[i].type;
+ }
+
+ return 0;
+}
+
+/**
+ * Init those properties that are allocated by the server and most likely used
+ * by the DIX or the DDX.
+ */
+void
+XIInitKnownProperties(void)
+{
+ int i;
+ for (i = 0; i < (sizeof(dev_properties)/sizeof(struct dev_properties)); i++)
+ {
+ dev_properties[i].type =
+ MakeAtom(dev_properties[i].name,
+ strlen(dev_properties[i].name),
+ TRUE);
+ }
+}
+
+
/* Registers a new property handler on the given device and returns a unique
* identifier for this handler. This identifier is required to unregister the
* property handler again.
diff --git a/Xi/xiproperty.h b/Xi/xiproperty.h
index e31cdad0a..47ba0eae3 100644
--- a/Xi/xiproperty.h
+++ b/Xi/xiproperty.h
@@ -40,4 +40,6 @@ int SProcXChangeDeviceProperty (ClientPtr client);
int SProcXDeleteDeviceProperty (ClientPtr client);
int SProcXGetDeviceProperty (ClientPtr client);
+void XIInitKnownProperties(void);
+
#endif /* XIPROPERTY_C */