#ifndef MUPDF_FITZ_OUTLINE_H
#define MUPDF_FITZ_OUTLINE_H
#include “mupdf/fitz/system.h”
#include “mupdf/fitz/context.h”
#include “mupdf/fitz/link.h”
#include “mupdf/fitz/output.h”
/* Outline */
/**
fz_outline is a tree of the outline of a document (also known
as table of contents).
title: Title of outline item using UTF-8 encoding. May be NULL
if the outline item has no text string.
uri: Destination in the document to be displayed when this
outline item is activated. May be an internal or external
link, or NULL if the outline item does not have a destination.
page: The page number of an internal link, or -1 for external
links or links with no destination.
next: The next outline item at the same level as this outline
item. May be NULL if no more outline items exist at this level.
down: The outline items immediate children in the hierarchy.
May be NULL if no children exist.
fz_outline 是文档大纲的树(也称为
作为目录)。
标题:使用 UTF-8 编码的大纲项的标题。 可能为 NULL
如果大纲项没有文本字符串。
uri: 文档中要显示的目的地
大纲项目被激活。 可能是内部或外部
链接,如果大纲项没有目标,则为 NULL。
page:内部链接的页码,或 -1 表示外部链接
链接或没有目的地的链接。
next:与此大纲同级的下一个大纲项
物品。 如果此级别不存在更多大纲项,则可能为 NULL。
down:大纲项目在层次结构中的直接子项。
如果不存在孩子,则可能为 NULL。
*/
typedef struct fz_outline
{
int refs;
char *title;
char *uri;
int page;
float x, y;
struct fz_outline *next;
struct fz_outline *down;
int is_open;
/* sumatrapdf: support color and flags */
int flags;
int n_color;
float color[4];
} fz_outline;
/**
Create a new outline entry with zeroed fields for the caller
to fill in.
为调用者创建一个带有归零字段的新大纲条目填写。
*/
fz_outline *fz_new_outline(fz_context *ctx);
/**
Increment the reference count. Returns the same pointer.
Never throws exceptions.
增加引用计数。 返回相同的指针。
从不抛出异常。
*/
fz_outline *fz_keep_outline(fz_context *ctx, fz_outline *outline);
/**
Decrements the reference count. When the reference point
reaches zero, the outline is freed.
When freed, it will drop linked outline entries (next and down)
too, thus a whole outline structure can be dropped by dropping
the top entry.
Never throws exceptions.
减少引用计数。 当参考点
达到零,轮廓被释放。
释放后,它将删除链接的大纲条目(下一个和下一个)
同样,因此可以通过删除来删除整个轮廓结构
顶部条目。
从不抛出异常。
*/
void fz_drop_outline(fz_context *ctx, fz_outline *outline);
#endif