Uwe Hermann [Wed, 20 Feb 2013 10:58:21 +0000 (11:58 +0100)]
Remove unneeded 'extern "C"'.
System headers, glib headers, and libsigrok/libsigrokdecode headers all
use 'extern "C"' already, so there's no need to explicitly add these
in PulseView (for these cases).
Uwe Hermann [Wed, 20 Feb 2013 10:39:38 +0000 (11:39 +0100)]
Print --help/--version output to stdout (not stderr).
Thanks R. Diez <redacted> for the patch!
This is not a feasible practice for CLI tools where the output might
be piped into other tools (and you don't want to pipe help messages or
other non-data). However, for the PulseView GUI this is acceptable since
it's not meant to be used that way.
View: Decouple horizontal scrolling from the scoll bar
Scrolling horizontally, regardless if through the tilt wheel, dragging the
signals, or moving the scroll bar, updates the viewport and the scroll bar. This
triggered a valueChanged() signal from the scroll bar, causing the viewport to
be updated again (redundantly). The operation of the viewport became dependent
on the scroll bar. On high zoom levels, where the scroll bar's resolution is
limited, the coupling manifested as jitter. The view was rendered with the
proper resolution of, caused the mouse drag event, then immediately updated and
rendered with the limited resolution of the scroll bar.
Decouple the viewport from the valueChanged() signal, and use the sliderMoved()
signal instead. The scroll bar becomes a simple input element, and only causes
a viewport update when acted upon by the user. Using the scroll bar is still
limited in resolution, but other scrolling methods are no longer affected by the
limitations of the scroll bar.
buildsystem: Link against the platform's thread library
At least on Linux, boost-thread depends on pthread. The linking is not
automatic, and users have had issues with this.
We need to link against the platform's thread library, as it is needed for
boost-thread. CMake takes care of getting the exact settings to be passed
to the linker for us with ${CMAKE_THREAD_LIBS_INIT}.
Uwe Hermann [Sun, 20 Jan 2013 16:11:51 +0000 (17:11 +0100)]
MinGW: Drop hardcoded BOOST_ROOT.
This was somewhat useful when PulseView only needed header-only parts of
Boost, but since boost-thread is now also needed this is not sufficient
anymore and needs a different setup for native MinGW builds on Windows.
Cross-compile builds using 'sigrok-cross-mingw' from sigrok-util work
fine without it, though.
Viewport: Only zoom in/out at vertical wheel events
Viewport always zoomed the signals in and out on a wheel event. Moving the
scroll wheel up or down caused the intended effect of zooming in or zooming out,
respectively. This works flawlessly on mice with only a vertical wheel.
On mice with a horizontal or tilting wheel, horizontal scrolling or tilting was
still treated as zooming in and out. This created a non-intuitive experience,
as the user expects the signals to scroll left or right with this gesture.
Check to make sure the wheel event is a vertical one, and only then zoom in/out.
Do nothing if the wheel event is not vertical.
Uwe Hermann [Wed, 12 Dec 2012 21:00:09 +0000 (22:00 +0100)]
cmake: Add boost-thread as explicit dependency.
Apparently boost-thread requires boost-system even if not explicitly
used in the code.
See also: https://svn.boost.org/trac/boost/ticket/7241
On Debian with libboost-thread1.50.0 and libboost-system1.50.0 the
following error occurs during linking:
/usr/bin/ld: CMakeFiles/pulseview.dir/main.cpp.o: undefined reference to symbol 'boost::system::system_category()'
/usr/bin/ld: note: 'boost::system::system_category()' is defined in DSO /usr/lib/libboost_system.so.1.50.0 so try adding it to the linker command line
/usr/lib/libboost_system.so.1.50.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
This commit fixes the issue.
It's unclear whether this is an issue that should be fixed in PulseView
in general, or whether it's a Boost issue.
Peter Stuge [Mon, 3 Dec 2012 03:23:37 +0000 (04:23 +0100)]
Add struct sr_context * to sr_driver_init() calls
libsigrok.git commit 193691ae1590eb31025d943ffbb0ea5c1047e6ca changes
the API of sr_driver_init() to take a struct sr_context * parameter as
allocated by sr_init().
Move our struct sr_context *sr_ctx out of main() into file global scope
so that it can be used easily in all calls to sr_driver_init().