tools: usbmon2hid-replay: fix index parsing

while switching to a global ctrl parsing, the index of the strings
messed up. Fixing it.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: parse_hid: do not store raw values in raw_item in reverse order

We spent too much time reversing it while nobody used it in the reverse
order.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: parse_rdesc: rename field size into item_size

in ReportDescriptor, size is used as a temporary place to store the current
item size which is being parsed. Rename it to something else as "size"
can be interpreted as the global size of the report descriptor.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: editor: implement save function

Add methods to parse_rdesc to allow to dump easily the report descriptor,
and then implement the save method of the editor.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: editor: write notification when the parsing failed

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: parse_rdesc: use the representation of raw_item

we used to access each individual field outside of the object, which is
wrong and already done by __repr__

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: parse_rdesc: export data() method for report descriptors

.data() sends back the raw content of the report descriptor

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: usbmon2hid-replay: change permmisson

allow to run directly ./usbmon2hid-replay.py instead of needing to call
python usbmon2hid-replay.py