Merge lp://staging/~dandrader/frame/backend into lp://staging/frame
Proposed by
Daniel d'Andrada
Status: | Merged |
---|---|
Merged at revision: | 90 |
Proposed branch: | lp://staging/~dandrader/frame/backend |
Merge into: | lp://staging/frame |
Diff against target: |
1092 lines (+817/-28) 13 files modified
include/oif/frame_backend.h (+254/-0) src/device.cpp (+93/-6) src/device.h (+7/-1) src/event.cpp (+37/-0) src/event.h (+1/-0) src/frame.cpp (+82/-16) src/frame.h (+9/-0) src/libframe.ver (+34/-0) src/touch.cpp (+80/-0) src/touch.h (+13/-2) src/x11/device_x11.cpp (+0/-3) test/regular/Makefile.am (+1/-0) test/regular/backend.cpp (+206/-0) |
To merge this branch: | bzr merge lp://staging/~dandrader/frame/backend |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Chase Douglas (community) | Approve | ||
Review via email: mp+121230@code.staging.launchpad.net |
Commit message
Adds a backend API.
So that any client can adapt frame+grail to work on top of their input system, without relying on frame to provide a suitable backend implementation.
This API also removes the need to mock libframe when writing grail tests.
Description of the change
Adds a backend API.
So that any client can adapt frame+grail to work on top of their input system, without relying on frame to provide a suitable backend implementation.
This API also removes the need to mock libframe when writing grail tests.
To post a comment you must log in.
This is a great start! With a few changes we will hopefully be good to go :).
* The Doxygen comments for functions should have an extra newline between the summary and the extra description. The following function comments should be updated: event_set_ device( ) device_ add_axis( )
frame_
frame_
* I would rather namespace the backend functions so they are clearly distinct from the frontend functions. For example, frame_device_new() should be frame_backend_ device_ new(), and frame_device_ get_frontend( ) could be frame_backend_ device_ get_device( ).
* UFBackendDevice_ isn't an invariant because it is not fully initialized after the constructor returns. The constructor could be UFBackendDevice _(oif:: frame:: UFDevice* device), where the shared_ptr is initialized with the value of device. Then frame_backend_ device_ new() could simply be:
UFBackendDevice frame_device_new() _(new oif::frame: :UFDevice) ;
{
return new UFBackendDevice
}
This holds for UFBackendFrame and UFBackendTouch as well.
* Why can't we infer the number of axes from the number of added axes, rather than by having to manually set the value. The same for number of touches in the frame.
The simple fix would be to get the current value, increment it, then reinsert it into the device or frame when an axis or touch is added. The number of active touches would be set to the same value as the number of touches in the frame. The caller would need to set the total number of active touches *after* all frame touches have been added. A sanity check that the number of active touches is greater than or equal to the number of frame touches would be good.
* I understand how events are created, but how are they enqueued to a frame instance? How are devices added to a frame instance?