#ifndef MUPDF_FITZ_DISPLAY_LIST_H1#define MUPDF_FITZ_DISPLAY_LIST_H23#include "mupdf/fitz/system.h"4#include "mupdf/fitz/context.h"5#include "mupdf/fitz/math.h"6#include "mupdf/fitz/device.h"78/*9Display list device -- record and play back device commands.10*/1112/*13fz_display_list is a list containing drawing commands (text,14images, etc.). The intent is two-fold: as a caching-mechanism15to reduce parsing of a page, and to be used as a data16structure in multi-threading where one thread parses the page17and another renders pages.1819Create a displaylist with fz_new_display_list, hand it over to20fz_new_list_device to have it populated, and later replay the21list (once or many times) by calling fz_run_display_list. When22the list is no longer needed drop it with fz_drop_display_list.23*/24typedef struct fz_display_list_s fz_display_list;2526/*27fz_new_display_list: Create an empty display list.2829A display list contains drawing commands (text, images, etc.).30Use fz_new_list_device for populating the list.31*/32fz_display_list *fz_new_display_list(fz_context *ctx);3334/*35fz_new_list_device: Create a rendering device for a display list.3637When the device is rendering a page it will populate the38display list with drawing commsnds (text, images, etc.). The39display list can later be reused to render a page many times40without having to re-interpret the page from the document file41for each rendering. Once the device is no longer needed, free42it with fz_drop_device.4344list: A display list that the list device takes ownership of.45*/46fz_device *fz_new_list_device(fz_context *ctx, fz_display_list *list);4748/*49fz_run_display_list: (Re)-run a display list through a device.5051list: A display list, created by fz_new_display_list and52populated with objects from a page by running fz_run_page on a53device obtained from fz_new_list_device.5455dev: Device obtained from fz_new_*_device.5657ctm: Transform to apply to display list contents. May include58for example scaling and rotation, see fz_scale, fz_rotate and59fz_concat. Set to fz_identity if no transformation is desired.6061area: Only the part of the contents of the display list62visible within this area will be considered when the list is63run through the device. This does not imply for tile objects64contained in the display list.6566cookie: Communication mechanism between caller and library67running the page. Intended for multi-threaded applications,68while single-threaded applications set cookie to NULL. The69caller may abort an ongoing page run. Cookie also communicates70progress information back to the caller. The fields inside71cookie are continually updated while the page is being run.72*/73void fz_run_display_list(fz_context *ctx, fz_display_list *list, fz_device *dev, const fz_matrix *ctm, const fz_rect *area, fz_cookie *cookie);7475/*76fz_keep_display_list: Keep a reference to a display list.7778Does not throw exceptions.79*/80fz_display_list *fz_keep_display_list(fz_context *ctx, fz_display_list *list);8182/*83fz_drop_display_list: Drop a reference to a display list, freeing it84if the reference count reaches zero.8586Does not throw exceptions.87*/88void fz_drop_display_list(fz_context *ctx, fz_display_list *list);8990#endif919293