Build tools: allow debuggable cross builds for Windows

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Make parse-xml callbacks be type-safe

.. and fix the type breakage brought in by commit eaf6d564874a ("CCR code:
Change to sample structure")

The XML parsing callbacks pass a "void *" around, because the helper
function that matches the XML node names ("match()") does so for all the
different dive/sample/dc member nodes that all have different types.

But that also hid the fact that it very much depended on the various types
being regular "int" etc, rather than the denser types that were introduced
so that the CCR data wouldn't expand memory use excessively. As a result,
XML loading would overwrite other members, and possibly even the
allocation, when it wrote an "int" value to something that only was a
8-bit allocation.

I left the "utf8_string()" without type checking - so it still uses
"void *_res" for the result type, with the cast happening inside the
function.

That's because the result destination ends up being a bit mixed-up wrt
"const char **" and just plain "char **". Note that the thing we modify
itself isn't const (it's not "char *const *"), but the pointer, but we
basically sometimes assign a "const char *", and sometimes a "char *".

I considered making two different versions of the callback, but it just
wasn't worth it. So "utf8_string()" users still aren't type-checked, and
you'd better give it a pointer to something that is some kind of "char *"

This patch doesn't really change the calling convention of the matching
function itself, but it makes the wrapper macro ("MATCH()") take a
properly type-checked function pointer instead (with a dummy call to do
type checking), and then casts the pointer to the "void *" type for the
actual real call.

The function pointer call is not really portable (although it works on
all sane architectures, particularly since the cast only changes one
argument from one type of pointer to another), and to make matters worse
uses the gcc statement-expression extension. But all the compilers we use
seem to support that gcc'ism, so in practice this gives us type-safety
with no downsides.

(If we ever want to use MSVC to compile subsurface, I suspect we'll have
to ifdef out the statement expression use and not type-check things. Or
perhaps re-write the thing as a ternary expression instead, or something).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Ignore user-manual_es.html

Some 'clean' Makefile target should remove the generated
user-manual_es.html too.

Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Correctly test QString for being empty

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
HTML export: fix packaging of theme dir

I was confused by the function name getSubsurfaceDataPath() - it does not
find paths relative to the "data" folder, if finds the path where we might
install folders like "data", "translations", or "theme".
"data" is for some reason where we install the "marbledata" files.
Therefore on both Mac and Windows we need to put the "theme" directory
next to the "data" directory, not below it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix out of tree building without asciidoc

We tried to copy the .html.git file from the out of tree build dir, not
from the source dir.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Gas was printed in permille, use gasname instead

After the switch to a central event decoder and just return gasmix from
that we printed things in permille, eg. EAN1000 and 180/550 which looks
kinda strange.
This fixes that by using gasname instead to give the gas a name.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Make make clean also clean in the doc subdir

Also add reminder comments for creating debug builds on Windows

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Attempt at telling Makefile how to build the user manual

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Save the timestamp of the dive.

Save the timestamp of the dive if it exists in the data provided
by the exif library.

[Dirk Hohndel: fixed whitespace and format specifier]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a scaleTo animation

ScaleTo animation will scale or shrinks an graphical element in an
animated way. This is going primarelly to be used on the pictures on the
profile, but can be used on anything else later.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Subtle animation when the picture gets hovered with the mouse.

This patch adds a subtle animation when the picture gets hovered
with the mouse, and restored to it's original size when mouse exits
the image area.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a nice white rectangle around the picture

This makes the picture looks a bit more like a real paper picture
shadow's missing, though.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a drop shadow on the picture

This patch adds a drop shadow on the picture. a real blurry shadow
could be much better, but without OpenGL it's too costly to calculate
the shadow for each picture.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Rotate the picture around -4 and 4 degrees.

This patch rotates the picture a bit, so it looks like it was
splattered around the profile.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Picture handling: adjust timestamp after it's set

We need to first parse the exif and then adjust the timestamp.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Picture handling: don't add the same picture more than once

It confuses us elsewhere (the model suddenly doesn't match the list of
pictures as the model doesn't reflect the duplicate pictures).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Picture handling: put the picture near its correct time during the dive

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Picture handling: keep picture list sorted

And simplify the list handling algorithm.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Picture handling: stagger the pictures

If the pictures are too close to each other, spread them out a bit more.
This seems to give a reasonably pleasant layout.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>