summaryrefslogtreecommitdiff
path: root/xps
AgeCommit message (Collapse)Author
2012-02-06Drop XPS links in the correct function.Tor Andersson
Prevents segfaults when revisiting pages and trying to access the link object that was freed too early.
2012-02-03Be consistent about passing a fz_context in path/text/shade functions.Tor Andersson
2012-02-03Reference count fz_link objects.Tor Andersson
2012-02-03Remove extraneous blank lines.Tor Andersson
2012-02-03Add document interface.Tor Andersson
2012-02-03Make fz_malloc_struct return zeroed memory.Tor Andersson
2012-02-02Support remote links in XPS documents.Robin Watts
Update xps path handling to cope with URLs. Fix premature freeing of links. Spot remote URLs and use appropriate link type.
2012-02-02Work on supporting links in xps documents.Robin Watts
Currently, this only works with local links. When running the page, check for NavigateUri entries; if found, and that page is not already marked as having resolved it's links, add a new link entry to doc->current_page links. When the page finishes running, mark the page as having resolved it's links. This avoids the links being generated multiple times. Update the mupdf viewer to use these links - but only AFTER the page has been run.
2012-01-30Move PNG, JPEG and TIFF image loading from muxps into fitz.Tor Andersson
2012-01-27Remove dependency on fz_obj from the filter creation parameters.Tor Andersson
2012-01-27Rename pdf_xref type to pdf_document.Tor Andersson
2012-01-27Whitespace fixes.Tor Andersson
2012-01-26Pull in XPS commits from GhostXPS to MuXPSRobin Watts
This brings MuXPS up to date with GhostXPS as of today. The commits pulled in are: 856ecdc Whitespace fixes for parsing dashed line attributes 91dc749 Whitespace fixes while parsing points. This commit is tweaked from the original, and the changes will be pushed back into GhostXPS shortly. a298a05 Tiff premultiplied/non-premultiped alpha differences. No changes required for this, as we hold images premultiplied already (and already cope with premultiplying where required). Some changes to comments and cleanup code to avoid leaks though.
2012-01-24Make xps_free_context cope with NULL arg.Robin Watts
All destructors should accept NULL.
2012-01-20Flip images the right side up in the PDF interpreter.Tor Andersson
This way both pixmaps for rendering and image data are top-down.
2012-01-12Support proper XPS mitering. (And stroke fixes).Robin Watts
XPS differs from PS/PDF/etc in the way it handles miters; rather than simply converting a miter that's overly long to a bevel, it truncates it at the miter limit. As such it needs to be handled correctly. For clarity, expose new enumerated types for linejoins and linecaps, and use these throughout code. When we upgrade our freetype, we can move to using proper xps mitering in that too. Add new fz_matrix_max_expansion function to return a safer expansion value that works in the case where we scale up in one direction and down in another. In the xps path drawing code, avoid generating unnecessary linetos. Thanks to Zeniko for spotting these and providing implementations.
2012-01-12Check the abort cookie in XPS.Tor Andersson
2012-01-12Use the same coordinate system for pdf and xps pages in the interface.Tor Andersson
Move coordinate space tweaks into pdf_ and xps_run_page, and provide neutral pdf_ and xps_bound_page functions to return the page size as a zero-origined bounding box.
2012-01-11Add xps_run_page function.Tor Andersson
2012-01-11Stylistic comment and whitespace fixes.Tor Andersson
2012-01-11Add glyph bbox cache.Tor Andersson
2012-01-11Calculate accurate per-glyph bounding boxes for fz_bound_text.Tor Andersson
2012-01-06XPS tweaks/fixes.Robin Watts
xps_parse_resource_dictionary can now warn and return NULL when reading an empty dictionary, rather than throwing an error. Various bits of code are therefore updated to check for a NULL return value. We should cope better with multiple Resource dictionaries. Tweak to the zip file handling when looking for parts. Again, all from (or inspired by) Zenikos patch.
2012-01-06Various fixes to avoid arithmetic problems.Robin Watts
Various fixes to avoid overflow problems, division by zeros, use of uninitialised variables etc. All from/suggested by Zenikos patch.
2012-01-06Fix xps tiff context problem.Robin Watts
Exactly parallel to the png problem fixed a few days ago. Thanks to Zeniko for pointing this out.
2012-01-06Various memory leak fixes.Robin Watts
In error cases, ensure we free objects correctly. Thanks to Zeniko for finding the problems (and many of the solutions!)
2012-01-05Remove stray semicolons and fix typo in xps zip code.Tor Andersson
2011-12-30Avoid SEGV when reading PNG from XPSRobin Watts
The xps png reading code was overwriting its context pointer with zero, then referencing through it.
2011-12-28Outline/link destination tweaks.Robin Watts
Move 'kind' into the fz_link_dest structure (as this makes more sense). Put an fz_link_dest rather than just a page number into the outlines structure. Correct parsing of actions and dests from pdf outlines.
2011-12-16Add fz_malloc_struct, and make code use it.Robin Watts
The new fz_malloc_struct(A,B) macro allocates sizeof(B) bytes using fz_malloc, and then passes the resultant pointer to Memento_label to label it with "B". This costs nothing in non-memento builds, but gives much nicer listings of leaked blocks when memento is enabled.
2011-12-15Remove 'soft limit' on pixmaps in favour of fz_store.Robin Watts
Change the fz_store to be limited to 256 Megs. Remove the soft limit for pixmaps; the store will automatically throw old resources away to stay below the limit.
2011-12-15Rework pdf_store to fz_store, a part of fz_context.Robin Watts
Firstly, we rename pdf_store to fz_store, reflecting the fact that there are no pdf specific dependencies on it. Next, we rework it so that all the objects that can be stored in the store start with an fz_storable structure. This consists of a reference count, and a function used to free the object when the reference count reaches zero. All the keep/drop functions are then reimplemented by calling fz_keep_sharable/fz_drop_sharable. The 'drop' functions as supplied by the callers are thus now 'free' functions, only called if the reference count drops to 0. The store changes to keep all the items in the store in the linked list (which becomes a doubly linked one). We still make use of the hashtable to index into this list quickly, but we now have the objects in an LRU ordering within the list. Every object is put into the store, with a size record; this is an estimate of how much memory would be freed by freeing that object. The store is moved into the context and given a maximum size; when new things are inserted into the store, care is taken to ensure that we do not expand beyond this size. We evict any stored items (that are not in use) starting from the least recently used. Finding an object in the store now takes a reference to it already. LOCK and UNLOCK comments are used to indicate where locks need to be taken and released to ensure thread safety.
2011-12-08Throw exceptions in xps code.Tor Andersson
2011-11-15Merge branch 'master' into contextRobin Watts
Mostly redoing the xps_context to xps_document change and adding contexts to newly written code. Conflicts: apps/pdfapp.c apps/pdfapp.h apps/x11_main.c apps/xpsdraw.c draw/draw_device.c draw/draw_scale.c fitz/base_object.c fitz/fitz.h pdf/mupdf.h pdf/pdf_interpret.c pdf/pdf_outline.c pdf/pdf_page.c xps/muxps.h xps/xps_doc.c xps/xps_xml.c
2011-11-10Add XPS outline parsing and move outline data struct to fz_outline.Tor Andersson
2011-10-04Move to exception handling rather than error passing throughout.Robin Watts
This frees us from passing errors back everywhere, and hence enables us to pass results back as return values. Rather than having to explicitly check for errors everywhere and bubble them, we now allow exception handling to do the work for us; the downside to this is that we no longer emit as much debugging information as we did before (though this could be put back in). For now, the debugging information we have lost has been retained in comments with 'RJW:' at the start. This code needs fuller testing, but is being committed as a work in progress.
2011-09-21Rename xps_context to xps_document.Tor Andersson
2011-09-21Add warning context.Tor Andersson
2011-09-21Rename malloc functions for arrays (fz_calloc and fz_realloc).Tor Andersson
2011-09-21Don't thread ctx through safe fz_obj functions.Tor Andersson
2011-09-15Add context to mupdf.Robin Watts
Huge pervasive change to lots of files, adding a context for exception handling and allocation. In time we'll move more statics into there. Also fix some for(i = 0; i < function(...); i++) calls.
2011-09-14Initial import of exception handling codeRobin Watts
Import exception handling code from WSS, modified to fit into the fitz world. With this code we have 'real' fz_try/fz_catch/fz_rethrow functions, handling a fz_except type. We therefore rename the existing fz_throw/ fz_catch/fz_rethrow to be fz_error_make/fz_error_handle/fz_error_note. We don't actually use fz_try/fz_catch/fz_rethrow yet...
2011-09-06Don't invoke tiling device calls when there is only one tile to be drawn.Tor Andersson
2011-08-09Fix bug 692284: return error for empty resource dictionaries.Tor Andersson
2011-08-09Fix bug 692412: typo in buffer size.Tor Andersson
2011-07-08Clip area optimisations for displaylist case:Robin Watts
First, we add clipping rects to clipping functions. Various functions (the ones that handle clipping) are now additionally passed a rectangle that represents an additional bound for this clip in device space (i.e. it has already been mapped through the current ctm). Next, when constructing the displaylist, keep track of the bounding box for the contents of each clip. While writing the list, on every node we add, we add the bbox for that node to the enclosing clips content bbox (if there is an enclosing clip). When we pop a clip, write back to the corresponding push to update the bbox. This means if we get large clip regions, with only small areas used within them, we will only do the slow blending for those small areas. Finally, we fix a calculation in fz_bound_path which was incorrectly accounting for mitrelimits. This was showing up in testing on page 630 of the PDF reference v1.7.
2011-05-31Use fz_atof in XPS interpreter.Tor Andersson
2011-04-12Avoid conflict with compiler builtin definitions of tolower.Tor Andersson
2011-04-11Add triangle caps; separate start, dash and end cap styles for XPS.Tor Andersson
2011-04-10xps: Use specific font cache struct instead of hash table.Tor Andersson