The fallback font functions have been commented as deprecated for ~15
years now.
I cannot remember what the problem may or may not have been, so let's
just drop the comments.
Also, move the call to free a fallback font in imlib_free_font() to the
internals (avoiding to call deprecated functions if the font fallback
chain stuff should be deprecated for real some day).
- Handling of odd sizes and offsets was broken
Might be a bit slower than before but should now be correct.
- Color mapping changed
Before we had
16 bit: RRRRRGGGGGGBBBBB -> aaaaaaaaRRRRR000GGGGGG00BBBBB000
15 bit: xRRRRRGGGGGBBBBB -> aaaaaaaaRRRRR000GGGGG000BBBBB000
Now we do
16 bit: RRRRRGGGGGGBBBBB -> aaaaaaaaRRRRRRRRGGGGGGGGBBBBBBBB
15 bit: xRRRRRGGGGGBBBBB -> aaaaaaaaRRRRRRRRGGGGGGGGBBBBBBBB
Probably somewhat slower than before because this mapping requires
multiply/divide instead of just shifts, but is more correct, IMO.
- Always include config.h before Imlib2.h
Needed for X_DISPLAY_MISSING.
- Always include config.h and Imlib2.h first
Should make it more likely to spot stuff missing but required
in Imlib2.h, like stddef.h.
gtest.h apparently must be included before X headers though.
- Make sure we use the Imlib2.h here and not the one in /usr/include
Also ensure that the tests build when building without X.
Although configure can be called to ignore x headers, eventually the
compilation of api_obsolete.c fails because the configuration results
in config.h are not evaluated.
For successful compilation with `./configure --without-x` and adding
config.h I also needed stddef.h, which is added as well.
this prevents the loader from spending unreasonable amount of time going
through the entire file in case someone opens a directory which might
contain large videos or files.
Warning seems to be incorrect though..
In function ‘__imlib_stripwhitespace’,
inlined from ‘__imlib_script_parse’ at ../../../../src/lib/script.c:256:21:
../../../../src/lib/script.c:53:4: error: pointer may be used after ‘free’ [-Werror=use-after-free]
53 | strcpy(str, tmpstr);
| ^~~~~~~~~~~~~~~~~~~
../../../../src/lib/script.c:54:4: note: call to ‘free’ here
54 | free(tmpstr);
| ^~~~~~~~~~~~
Although the warning is technically correct it is not a problem as the
address is just used to match if an ImlibImagePixmap references it.
../../../../src/lib/image.c: In function ‘__imlib_ConsumeImage’:
../../../../src/lib/image.c:111:4: error: pointer ‘im’ used after ‘free’ [-Werror=use-after-free]
111 | __imlib_PixmapUnrefImage(im);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../src/lib/image.c:108:4: note: call to ‘free’ here
108 | free(im);
| ^~~~~~~~