xserver: Branch 'master' - 6 commits

Peter Hutterer whot at kemper.freedesktop.org
Tue Feb 24 20:56:52 PST 2009


 Xi/chdevhier.c     |   10 ---
 dix/eventconvert.c |   57 +++++++-------------
 dix/getevents.c    |    6 +-
 dix/inpututils.c   |    1 
 include/events.h   |  146 ++++++++++++++++++-----------------------------------
 include/inputstr.h |    4 -
 6 files changed, 77 insertions(+), 147 deletions(-)

New commits:
commit 59bc615ed2e60c595887dcc11fe04935b49bcaff
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Feb 24 15:26:20 2009 +1000

    dix: set the valuator mode in set_valuators
    
    We only have per-device mode for now anyway.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/getevents.c b/dix/getevents.c
index 09aaf5d..f7306c1 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -143,9 +143,11 @@ set_valuators(DeviceIntPtr dev, DeviceEvent* event, int first_valuator,
     int i;
 
     for (i = first_valuator; i < first_valuator + num_valuators; i++)
+    {
         SetBit(event->valuators.mask, i);
-
-    /* FIXME: Set the current mode */
+        if (dev->valuator->mode == Absolute)
+            SetBit(event->valuators.mode, i);
+    }
 
     memcpy(&event->valuators.data[first_valuator],
            valuators, num_valuators * sizeof(uint32_t));
commit cffa3c499a0495e132557bd6b08a8c0b858cdf3b
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Feb 24 15:25:49 2009 +1000

    dix: remove unused variable 'tmp'
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/inpututils.c b/dix/inpututils.c
index 07a2383..2226d55 100644
--- a/dix/inpututils.c
+++ b/dix/inpututils.c
@@ -111,7 +111,6 @@ _X_EXPORT int
 ApplyPointerMapping(DeviceIntPtr dev, CARD8 *map, int len, ClientPtr client)
 {
     int ret;
-    DeviceIntPtr tmp;
 
     /* If we can't perform the change on the requested device, bail out. */
     ret = check_butmap_change(dev, map, len, &client->errorValue, client);
commit 8d6dd83a38020080808705a156d32ec2a135633c
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Feb 20 13:13:58 2009 +1000

    include: fix indentation for lastSlave/master.
    
    Yeah!
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/include/inputstr.h b/include/inputstr.h
index 6d3fc52..c9faaec 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -475,8 +475,8 @@ typedef struct _DeviceIntRec {
     DeviceUnwrapProc    unwrapProc;
     SpriteInfoPtr       spriteInfo;
     union {
-    DeviceIntPtr        master;       /* master device */
-    DeviceIntPtr        lastSlave;    /* last slave device used */
+        DeviceIntPtr        master;     /* master device */
+        DeviceIntPtr        lastSlave;  /* last slave device used */
     } u;
 
     /* last valuator values recorded, not posted to client;
commit b3412adca8b2ba3fff348bceb4f01b9e968c0afc
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Sun Feb 22 20:53:46 2009 +1000

    Xi: don't need to set the XKB settings for new core devices.
    
    This is done by the XKB code these days anyway, so we might as well ignore it
    and keep using the stanard stuff.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/chdevhier.c b/Xi/chdevhier.c
index 154a402..9a85829 100644
--- a/Xi/chdevhier.c
+++ b/Xi/chdevhier.c
@@ -102,7 +102,6 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
                 {
                     xCreateMasterInfo* c = (xCreateMasterInfo*)any;
                     char* name;
-                    XkbRMLVOSet set;
 
                     SWAPIF(swaps(&c->namelen, n));
                     name = xcalloc(c->namelen + 1, sizeof(char));
@@ -119,15 +118,6 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
                     if (!c->sendCore)
                         ptr->coreEvents = keybd->coreEvents =  FALSE;
 
-                    /* supplying NULL for rules simply means we re-use
-                       whatever ruleset we used for the previous devices. */
-                    set.rules = NULL;
-                    set.model = "pc105";
-                    set.layout = "us";
-                    set.variant = NULL;
-                    set.options = NULL;
-                    XkbSetRulesDflts(&set);
-
                     ActivateDevice(ptr);
                     ActivateDevice(keybd);
 
commit a180c2367974abe2ccdc88bb5c6f138c7df4d2e9
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Feb 23 16:38:41 2009 +1000

    dix: remove ConvertBackToXI.
    
    This was a temporary solution for the internal-events rework and is not needed
    anymore.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index 15a0ba3..db7178c 100644
--- a/dix/eventconvert.c
+++ b/dix/eventconvert.c
@@ -327,26 +327,3 @@ GetXIType(InternalEvent *event)
     return xitype;
 }
 
-/*
- * FIXME: A temporary solution to make the server bisectable. Take the event
- * @event and copy it into @ev, returning the number of events in @ev.
- */
-int
-ConvertBackToXI(InternalEvent *event, xEvent *ev)
-{
-    int count = 0;
-    int evlen, i;
-    xEvent *xi =  NULL;
-
-
-    if (EventToXI(event, &xi, &count))
-        ErrorF("[dix] conversion to XI failed\n");
-
-    if (xi->u.u.type == GenericEvent)
-        evlen = (GEV(xi))->length * 4 + 32;
-    else
-        evlen = count *  32;
-    for (i = 0; i < count; i++)
-        memcpy(&ev[i], &xi[i], evlen);
-    return count;
-}
commit 26cf709e712573548990d165e71137f28271a8bb
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Feb 23 22:39:08 2009 +1000

    Doxygenify events.h and eventconvert.c
    
    Should have done that before pushing, but oh well.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index d3dda53..15a0ba3 100644
--- a/dix/eventconvert.c
+++ b/dix/eventconvert.c
@@ -23,8 +23,9 @@
  */
 
 /**
- * @file This file contains event conversion routines from InternalEvent to
- * the matching protocol events.
+ * @file eventconvert.c
+ * This file contains event conversion routines from InternalEvent to the
+ * matching protocol events.
  */
 
 #ifdef HAVE_DIX_CONFIG_H
@@ -50,14 +51,15 @@ static int eventToClassesChanged(DeviceChangedEvent *ev, xEvent **dcce,
                                  int *count);
 
 /**
- * Convert the given event @ev to the respective core event and store it in
- * @core.
+ * Convert the given event to the respective core event.
  *
  * Return values:
- * Success ... @core contains the matching core event.
+ * Success ... core contains the matching core event.
  * BadValue .. One or more values in the internal event are invalid.
  * BadMatch .. The event has no core equivalent.
  *
+ * @param[in] event The event to convert into a core event.
+ * @param[in] core The memory location to store the core event at.
  * @return Success or the matching error code.
  */
 int
@@ -96,13 +98,17 @@ EventToCore(InternalEvent *event, xEvent *core)
 }
 
 /**
- * Convert the given event @ev to the respective XI 1.x event and store it in
- * @xi. @xi is allocated on demand and must be freed by the caller.
- * @count returns the number of events in @xi. If @count is 1, and the type of
- * @xi is GenericEvent, then @xi may be larger than 32 bytes.
+ * Convert the given event to the respective XI 1.x event and store it in
+ * xi. xi is allocated on demand and must be freed by the caller.
+ * count returns the number of events in xi. If count is 1, and the type of
+ * xi is GenericEvent, then xi may be larger than 32 bytes.
  *
  * If the event cannot be converted into an XI event because of protocol
- * restrictions, @count is 0 and Success is returned.
+ * restrictions, count is 0 and Success is returned.
+ *
+ * @param[in] ev The event to convert into an XI 1 event.
+ * @param[out] xi Future memory location for the XI event.
+ * @param[out] count Number of elements in xi.
  */
 int
 EventToXI(InternalEvent *ev, xEvent **xi, int *count)
@@ -183,8 +189,8 @@ eventToKeyButtonPointer(DeviceEvent *ev, xEvent **xi, int *count)
 
 
 /**
- * Set @first to the first valuator in the event @ev and return the number of
- * valuators from @first to the last set valuator.
+ * Set first to the first valuator in the event ev and return the number of
+ * valuators from first to the last set valuator.
  */
 static int
 countValuators(DeviceEvent *ev, int *first)
@@ -282,7 +288,7 @@ eventToClassesChanged(DeviceChangedEvent *ev, xEvent **xi, int *count)
 }
 
 /**
- * Return the corresponding core type for the given @event or 0 if no core
+ * Return the corresponding core type for the given event or 0 if no core
  * equivalent exists.
  */
 int
@@ -301,7 +307,7 @@ GetCoreType(InternalEvent *event)
 }
 
 /**
- * Return the corresponding XI 1.x type for the given @event or 0 if no
+ * Return the corresponding XI 1.x type for the given event or 0 if no
  * equivalent exists.
  */
 int
diff --git a/include/events.h b/include/events.h
index 4b98dee..b091167 100644
--- a/include/events.h
+++ b/include/events.h
@@ -26,7 +26,8 @@
 #define EVENTS_H
 
 /**
- * @file This file describes the event structures used internally by the X
+ * @file events.h
+ * This file describes the event structures used internally by the X
  * server during event generation and event processing.
  *
  * When are internal events used?
@@ -62,69 +63,44 @@ enum {
 } EventType;
 
 /**
- * Device event, used for ALL input device events internal in the server until
+ * Used for ALL input device events internal in the server until
  * copied into the matching protocol event.
  *
  * Note: We only use the device id because the DeviceIntPtr may become invalid while
  * the event is in the EQ.
- *
- * @header:     Always ET_Internal
- * @type:       One of EventType.
- * @length:     Length in bytes.
- * @time:       Time in ms.
- * @deviceid:   Device to post this event for.
- * @sourceid:   The physical source device.
- * @key:        Keycode of the event
- * @button:     Button number of the event.
- * @root_x:     Position relative to root window in 16.16 fixed point
- *              screen coordinates
- * @root_y:     Position relative to root window in 16.16 fixed point
- *              screen coordinates
- * @buttons:    Button mask.
- * @valuators.mask:  Valuator mask.
- * @valuators.mode:  Valuator mode. Bit set for Absolute mode, unset for relative.
- * @valuators.data:  Valuator data. Only set for valuators listed in @mask.
- * @mods.base:       XKB Base modifiers
- * @mods.latched:    XKB latched modifiers.
- * @mods.locked:     XKB locked modifiers.
- * @group.base:      XKB Base modifiers
- * @group.latched:   XKB latched modifiers.
- * @group.locked:    XKB locked modifiers.
- * @root:       Root window of the event.
- * @corestate:  Core key/button state BEFORE this event applied.
  */
 typedef struct
 {
-    unsigned char header;
-    int type;
-    int length;
-    Time time;
-    int deviceid;
-    int sourceid;
+    unsigned char header; /**< Always ET_Internal */
+    int type;             /**< One of EventType */
+    int length;           /**< Length in bytes */
+    Time time;            /**< Time in ms */
+    int deviceid;         /**< Device to post this event for */
+    int sourceid;         /**< The physical source device */
     union {
-        uint32_t button;
-        uint32_t key;
+        uint32_t button;  /**< Button number */
+        uint32_t key;     /**< Key code */
     } detail;
-    uint32_t root_x;
-    uint32_t root_y;
-    uint8_t    buttons[(MAX_BUTTONS + 7)/8];
+    uint32_t root_x;      /**< Pos relative to root window in 16.16 fixed pt */
+    uint32_t root_y;      /**< Pos relative to root window in 16.16 fixed pt */
+    uint8_t    buttons[(MAX_BUTTONS + 7)/8]; /**< Button mask */
     struct {
-        uint8_t  mask[(MAX_VALUATORS + 7)/8];
-        uint8_t  mode[(MAX_VALUATORS + 7)/8];
-        uint32_t data[MAX_VALUATORS];
+        uint8_t  mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */
+        uint8_t  mode[(MAX_VALUATORS + 7)/8]; /**< Valuator mode (Abs or Rel)*/
+        uint32_t data[MAX_VALUATORS];         /**< Valuator data */
     } valuators;
     struct {
-        uint32_t base;
-        uint32_t latched;
-        uint32_t locked;
+        uint32_t base;    /**< XKB base modifiers */
+        uint32_t latched; /**< XKB latched modifiers */
+        uint32_t locked;  /**< XKB locked modifiers */
     } mods;
     struct {
-        uint8_t base;
-        uint8_t latched;
-        uint8_t locked;
+        uint8_t base;    /**< XKB base group */
+        uint8_t latched; /**< XKB latched group */
+        uint8_t locked;  /**< XKB locked group */
     } group;
-    Window      root;
-    int corestate;
+    Window      root; /**< Root window of the event */
+    int corestate;    /**< Core key/button state BEFORE the event */
 } DeviceEvent;
 
 
@@ -133,25 +109,20 @@ typedef struct
 #define HAS_NEW_SLAVE 0x2
 
 /**
- * DeviceChangedEvent, sent whenever a device's capabilities have changed.
- *
- * @header:     Always ET_Internal
- * @type:       ET_DeviceChanged
- * @length:     Length in bytes
- * @time:       Time in ms.
- * @flags:      Mask of HAS_OLD_SLAVE (if @old_slaveid specifies the previous
- *              SD) and HAS_NEW_SLAVE (if @new_slaveid specifies the new SD).
- * @old_slaveid: Specifies the device previously attached to the MD.
- * @new_slaveid: Specifies the device now attached to the SD.
+ * Sent whenever a device's capabilities have changed.
  */
 typedef struct
 {
-    unsigned char header;
-    int type;
-    int length;
-    Time time;
-    int flags;
+    unsigned char header; /**< Always ET_Internal */
+    int type;             /**< ET_DeviceChanged */
+    int length;           /**< Length in bytes */
+    Time time;            /**< Time in ms */
+    int flags;            /**< Mask of ::HAS_OLD_SLAVE or ::HAS_NEW_SLAVE */
+    /** If flags & HAS_OLD_SLAVE is set, old_slaveid specifies SD previously
+     * attached to this device. */
     int old_slaveid;
+    /** If flags & HAS_OLD_SLAVE is set, old_slaveid specifies device now
+     * attached to this device. */
     int new_slaveid;
     /* FIXME: add the new capabilities here */
 } DeviceChangedEvent;
@@ -159,50 +130,35 @@ typedef struct
 #if XFreeXDGA
 /**
  * DGAEvent, used by DGA to intercept and emulate input events.
- *
- * @header:     Always ET_Internal
- * @type:       ET_DGAEvent
- * @length:     Length in bytes
- * @time:       Time in ms
- * @subtype:    KeyPress, KeyRelease, ButtonPress, ButtonRelease, MotionNotify
- * @detail:     Key code or button number.
- * @dx:         Relative x coordinate
- * @dy:         Relative y coordinate
- * @screen:     Screen number this event applies to
- * @state:      Core modifier/button state
  */
 typedef struct
 {
-    unsigned char header;
-    int type;
-    int length;
-    Time time;
-    int subtype;
-    int detail;
-    int dx;
-    int dy;
-    int screen;
-    uint16_t state;
+    unsigned char header; /**<  Always ET_Internal */
+    int type;             /**<  ET_DGAEvent */
+    int length;           /**<  Length in bytes */
+    Time time;            /**<  Time in ms */
+    int subtype;          /**<  KeyPress, KeyRelease, ButtonPress,
+                                ButtonRelease, MotionNotify */
+    int detail;           /**<  Relative x coordinate */
+    int dx;               /**<  Relative x coordinate */
+    int dy;               /**<  Relative y coordinate */
+    int screen;           /**<  Screen number this event applies to */
+    uint16_t state;       /**<  Core modifier/button state */
 } DGAEvent;
 #endif
 
 /**
- * InternalEvent, event type used inside the X server for input event
+ * Event type used inside the X server for input event
  * processing.
- *
- * @header:     Always ET_Internal
- * @type:       One of ET_*
- * @length:     Length in bytes
- * @time:       Time in ms.
  */
 typedef struct
 {
     union {
         struct {
-            unsigned char header;
-            int type;
-            int length;
-            Time time;
+            unsigned char header; /**< Always ET_Internal */
+            int type;             /**< One of ET_* */
+            int length;           /**< Length in bytes */
+            Time time;            /**< Time in ms. */
         } any;
         DeviceEvent device;
         DeviceChangedEvent changed;


More information about the xorg-commit mailing list