mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-01 06:26:00 +01:00
Provide typedefs for functions of the plugins.
This commit is contained in:
parent
db859f3996
commit
eec5f61926
1 changed files with 103 additions and 17 deletions
120
plugin-api.h
120
plugin-api.h
|
@ -65,92 +65,178 @@ void zathura_plugin_add_mimetype(zathura_plugin_t* plugin, const char* mime_type
|
||||||
|
|
||||||
#define ZATHURA_PLUGIN_MIMETYPES(...) __VA_ARGS__
|
#define ZATHURA_PLUGIN_MIMETYPES(...) __VA_ARGS__
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Opens a document
|
||||||
|
*/
|
||||||
|
typedef zathura_error_t (*zathura_plugin_document_open_t)(zathura_document_t* document);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Frees the document
|
||||||
|
*/
|
||||||
|
typedef zathura_error_t (*zathura_plugin_document_free_t)(zathura_document_t* document, void* data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates the document index
|
||||||
|
*/
|
||||||
|
typedef girara_tree_node_t* (*zathura_plugin_document_index_generate_t)(zathura_document_t* document, void* data, zathura_error_t* error);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save the document
|
||||||
|
*/
|
||||||
|
typedef zathura_error_t (*zathura_plugin_document_save_as_t)(zathura_document_t* document, void* data, const char* path);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get list of attachments
|
||||||
|
*/
|
||||||
|
typedef girara_list_t* (*zathura_plugin_document_attachments_get_t)(zathura_document_t* document, void* data, zathura_error_t* error);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save attachment to a file
|
||||||
|
*/
|
||||||
|
typedef zathura_error_t (*zathura_plugin_document_attachment_save_t)(zathura_document_t* document, void* data, const char* attachment, const char* file);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get document information
|
||||||
|
*/
|
||||||
|
typedef girara_list_t* (*zathura_plugin_document_get_information_t)(zathura_document_t* document, void* data, zathura_error_t* error);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the page object
|
||||||
|
*/
|
||||||
|
typedef zathura_error_t (*zathura_plugin_page_init_t)(zathura_page_t* page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Free page
|
||||||
|
*/
|
||||||
|
typedef zathura_error_t (*zathura_plugin_page_clear_t)(zathura_page_t* page, void* data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Search text
|
||||||
|
*/
|
||||||
|
typedef girara_list_t* (*zathura_plugin_page_search_text_t)(zathura_page_t* page, void* data, const char* text, zathura_error_t* error);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get links on a page
|
||||||
|
*/
|
||||||
|
typedef girara_list_t* (*zathura_plugin_page_links_get_t)(zathura_page_t* page, void* data, zathura_error_t* error);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get form fields
|
||||||
|
*/
|
||||||
|
typedef girara_list_t* (*zathura_plugin_page_form_fields_get_t)(zathura_page_t* page, void* data, zathura_error_t* error);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get list of images
|
||||||
|
*/
|
||||||
|
typedef girara_list_t* (*zathura_plugin_page_images_get_t)(zathura_page_t* page, void* data, zathura_error_t* error);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the image
|
||||||
|
*/
|
||||||
|
typedef cairo_surface_t* (*zathura_plugin_page_image_get_cairo_t)(zathura_page_t* page, void* data, zathura_image_t* image, zathura_error_t* error);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get text for selection
|
||||||
|
*/
|
||||||
|
typedef char* (*zathura_plugin_page_get_text_t)(zathura_page_t* page, void* data, zathura_rectangle_t rectangle, zathura_error_t* error);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page
|
||||||
|
*/
|
||||||
|
typedef zathura_image_buffer_t* (*zathura_plugin_page_render_t)(zathura_page_t* page, void* data, zathura_error_t* error);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page
|
||||||
|
*/
|
||||||
|
typedef zathura_error_t (*zathura_plugin_page_render_cairo_t)(zathura_page_t* page, void* data, cairo_t* cairo, bool printing);
|
||||||
|
|
||||||
|
|
||||||
struct zathura_plugin_functions_s
|
struct zathura_plugin_functions_s
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Opens a document
|
* Opens a document
|
||||||
*/
|
*/
|
||||||
zathura_error_t (*document_open)(zathura_document_t* document);
|
zathura_plugin_document_open_t document_open;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Frees the document
|
* Frees the document
|
||||||
*/
|
*/
|
||||||
zathura_error_t (*document_free)(zathura_document_t* document, void* data);
|
zathura_plugin_document_free_t document_free;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates the document index
|
* Generates the document index
|
||||||
*/
|
*/
|
||||||
girara_tree_node_t* (*document_index_generate)(zathura_document_t* document, void* data, zathura_error_t* error);
|
zathura_plugin_document_index_generate_t document_index_generate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save the document
|
* Save the document
|
||||||
*/
|
*/
|
||||||
zathura_error_t (*document_save_as)(zathura_document_t* document, void* data, const char* path);
|
zathura_plugin_document_save_as_t document_save_as;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get list of attachments
|
* Get list of attachments
|
||||||
*/
|
*/
|
||||||
girara_list_t* (*document_attachments_get)(zathura_document_t* document, void* data, zathura_error_t* error);
|
zathura_plugin_document_attachments_get_t document_attachments_get;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save attachment to a file
|
* Save attachment to a file
|
||||||
*/
|
*/
|
||||||
zathura_error_t (*document_attachment_save)(zathura_document_t* document, void* data, const char* attachment, const char* file);
|
zathura_plugin_document_attachment_save_t document_attachment_save;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get document information
|
* Get document information
|
||||||
*/
|
*/
|
||||||
girara_list_t* (*document_get_information)(zathura_document_t* document, void* data, zathura_error_t* error);
|
zathura_plugin_document_get_information_t document_get_information;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the page object
|
* Gets the page object
|
||||||
*/
|
*/
|
||||||
zathura_error_t (*page_init)(zathura_page_t* page);
|
zathura_plugin_page_init_t page_init;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Free page
|
* Free page
|
||||||
*/
|
*/
|
||||||
zathura_error_t (*page_clear)(zathura_page_t* page, void* data);
|
zathura_plugin_page_clear_t page_clear;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search text
|
* Search text
|
||||||
*/
|
*/
|
||||||
girara_list_t* (*page_search_text)(zathura_page_t* page, void* data, const char* text, zathura_error_t* error);
|
zathura_plugin_page_search_text_t page_search_text;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get links on a page
|
* Get links on a page
|
||||||
*/
|
*/
|
||||||
girara_list_t* (*page_links_get)(zathura_page_t* page, void* data, zathura_error_t* error);
|
zathura_plugin_page_links_get_t page_links_get;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get form fields
|
* Get form fields
|
||||||
*/
|
*/
|
||||||
girara_list_t* (*page_form_fields_get)(zathura_page_t* page, void* data, zathura_error_t* error);
|
zathura_plugin_page_form_fields_get_t page_form_fields_get;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get list of images
|
* Get list of images
|
||||||
*/
|
*/
|
||||||
girara_list_t* (*page_images_get)(zathura_page_t* page, void* data, zathura_error_t* error);
|
zathura_plugin_page_images_get_t page_images_get;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the image
|
* Get the image
|
||||||
*/
|
*/
|
||||||
cairo_surface_t* (*page_image_get_cairo)(zathura_page_t* page, void* data, zathura_image_t* image, zathura_error_t* error);
|
zathura_plugin_page_image_get_cairo_t page_image_get_cairo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get text for selection
|
* Get text for selection
|
||||||
*/
|
*/
|
||||||
char* (*page_get_text)(zathura_page_t* page, void* data, zathura_rectangle_t rectangle, zathura_error_t* error);
|
zathura_plugin_page_get_text_t page_get_text;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders the page
|
* Renders the page
|
||||||
*/
|
*/
|
||||||
zathura_image_buffer_t* (*page_render)(zathura_page_t* page, void* data, zathura_error_t* error);
|
zathura_plugin_page_render_t page_render;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders the page
|
* Renders the page
|
||||||
*/
|
*/
|
||||||
zathura_error_t (*page_render_cairo)(zathura_page_t* page, void* data, cairo_t* cairo, bool printing);
|
zathura_plugin_page_render_cairo_t page_render_cairo;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue