The translated message loading is dependant on configuration of
resource location in each frontend, additionally they should have the
ability to deal with errors in this loading in a implementation
specific manner.
This also extends the message loading API to be capable of loading
from an inline memory buffer instead of from a file.
Previously this information was logged when netsurf_init was called
which might be many lines out output into the log.
It is useful to have this information at the beginning of the log to
make it easily found. In addition it makes netsurf_init less complex.
This changes the LOG macro to be varadic removing the need for all
callsites to have double bracketing and allows for future improvement
on how we use the logging macros.
The callsites were changed with coccinelle and the changes checked by
hand. Compile tested for several frontends but not all.
A formatting annotation has also been added which allows the compiler
to check the parameters and types passed to the logging.
The generic bitmap handlers provided by each frontend are called back
from the core and therefore should be in an operation table. This was
one of the very few remaining interfaces stopping the core code from
being split into a library.
The content thumbnailers for each frontend were being provided the
contents url. This was only ever used to call the urldb thumbnail
setting API.
This changes it so the single callsite that passed a valid url adds
the bitmap to that url itself in desktop_history.c instead of forcing
every frontend to require the urldb API.
Additionally the old API could pass the url as NULL which was causing
asserts where this was not an expected parameter value. Because of
this this fixes bug #2286 which was also present in the monkey
frontend as both called nsurl_access() on the url without the NULL
check and caused an assertion.
If saving hotlist to "<path>", we now save to "<path>.bk", then remove
the file at "<path>", and replace it with the one at "<path>.bk".
This should prevent hotlist corruption when someone pulls the plug
while the hotlist is being written.
The cocoa frontend was directly acessing browser internals instead of
using the API. In the case of gui.m there was a check for the browser
window not being root (browser->parent != NULL) . As gui windows can
only ever be associated with the root brower window (i.e. its parent
will always be NULL) this was completely redundant.
By hiding all but the form selection menu option structure from code
outside of render this reduces the API to the absolute minimum to
support this feature.
CERT MEM04-C suggests that zero length allocations behaviour might be
surprising so it should be avoided. This adds a check to ensure a zero
length allocation will be avoided. Additionally it returns errors to
the caller rather than warning directly (in some error paths)